From: Guo Ren
Timer startup must after timer_irq_enable. For qemu, timer tick
irq hanppens but irq not enable, so it will cause qemu boot failed.
Signed-off-by: Guo Ren
Tested-by: Liu Zhiwei
---
drivers/clocksource/timer-mp-csky.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
dif
From: Guo Ren
We must add notrace on sched_clock_read, because it's called
by ftrace_graph_caller.
Signed-off-by: Guo Ren
---
drivers/clocksource/timer-mp-csky.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/clocksource/timer-mp-csky.c
b/drivers/clocksource/timer
From: Guo Ren
Glibc function mmap(... O_SYNC) will make page to _PAGE_UNCACHE +
_PAGE_SO and strong-order page couldn't support unalignment access.
So remove _PAGE_SO from _PAGE_UNCACHE, also sync abiv1 with the macro
of _PAGE_SO.
Signed-off-by: Guo Ren
Reported-by: Liu Renwei
Tested-by: Yuan
From: Guo Ren
In gdb/bfd elf32-csky.c, csky_elf_grok_prstatus() use fixed size of
elf_prstatus. It's 148 for abiv1 and 220 for abiv2, the size is enough
for coredump and no need full sizeof(struct pt_regs).
Signed-off-by: Guo Ren
Reported-by: Lu Baoquan
Reported-by: Liu Mao
---
arch/csky/inc
From: Guo Ren
The vr regs for vdsp only saved in task_switch not in every
exception trap-in. The memcpy with vdsp instructions will
destroy the vr regs for user space applications.
Signed-off-by: Guo Ren
---
arch/csky/abiv2/memcpy.S | 8 +---
1 file changed, 1 insertion(+), 7 deletions(-)
From: Guo Ren
Remove syscall_exit_work and union all to ret_from_exception.
Signed-off-by: Guo Ren
---
arch/csky/kernel/entry.S | 16
1 file changed, 4 insertions(+), 12 deletions(-)
diff --git a/arch/csky/kernel/entry.S b/arch/csky/kernel/entry.S
index 79f92b8..2b4a851 10064
From: Guo Ren
HI, LO, DSPCR registers are 807/810 related regs and no need for 610/860.
All of the regs must be saved in pt_regs and switch_stack. This patch
fixup saving dspcr reg in switch_stack and pt_regs.
Signed-off-by: Guo Ren
---
arch/csky/abiv1/inc/abi/switch_context.h | 17 +++
From: Guo Ren
This is a simple implement of CPU-hotplug for power saving. CPU use
wait instruction to enter power saving mode and waiting for IPI wakeup
signal.
Signed-off-by: Guo Ren
---
arch/csky/Kconfig | 9 ++
arch/csky/include/asm/smp.h | 4 +++
arch/csky/kernel/smp.c
From: Guo Ren
The gcc option "-mbacktrace" will push fp(r8),lr into stack and we could
unwind the stack with:
fp = *fp
lr = (unsigned int *)fp[1]
Signed-off-by: Guo Ren
---
arch/csky/Kconfig | 3 ++
arch/csky/Makefile | 4 +++
arch/csky/incl
From: Guo Ren
Use STACKTRACE to optimize panic print more pretty and align registers
printing.
Signed-off-by: Guo Ren
---
arch/csky/kernel/dumpstack.c | 59 ++--
arch/csky/kernel/ptrace.c| 34 ++---
arch/csky/mm/fault.c |
From: Guo Ren
With csky-gcc -pg -mbacktrace, ftrace call graph supported.
Signed-off-by: Guo Ren
---
arch/csky/Kconfig | 1 +
arch/csky/abiv2/mcount.S | 116 ++---
arch/csky/include/asm/ftrace.h | 6 ++-
arch/csky/kernel/ftrace.c
From: Guo Ren
When gcc with -pg, it'll add _mcount stub in every function. We need
implement the _mcount in kernel and ftrace depends on stackstrace.
To do: call-graph, dynamic ftrace
Signed-off-by: Guo Ren
---
arch/csky/Kconfig | 1 +
arch/csky/abiv2/Makefile | 1 +
arch
From: Guo Ren
C-SKY historically used 39, the same value as MCORE, from which the
architecture was derived.
C-SKY binutils support both EM_CSKY and EM_CSKY_OLD, confirmed by
binutils:include/elf/common.h
Signed-off-by: Guo Ren
---
arch/csky/include/asm/elf.h | 4 +++-
1 file changed, 3 insert
From: Guo Ren
Cleanup struct cpuinfo_csky and struct thread_struct, remove all esp0
related code. We could get pt_regs from sp and backtrace could use fp
in switch_stack.
Signed-off-by: Guo Ren
---
arch/csky/include/asm/processor.h | 12
arch/csky/kernel/asm-offsets.c| 1 -
a
From: Guo Ren
This adds basic perf support for all C-SKY CPUs. Hardware events are
only supported by 807/810/860.
Signed-off-by: Guo Ren
---
arch/csky/Kconfig | 16 +-
arch/csky/include/asm/perf_event.h |7 +
arch/csky/kernel/Makefile |1 +
arch/csky/kernel/
Hi Linus,
The following changes since commit 7566ec393f4161572ba6f11ad5171fd5d59b0fbd:
Linux 4.20-rc7 (2018-12-16 15:46:55 -0800)
are available in the git repository at:
g...@github.com:c-sky/csky-linux.git tags/csky-for-linus-4.21
for you to fetch changes up to f50fd2d8524c15b08da9e7e9d84
From: Guo Ren
core/ cBPF-JIT : TODO |
core/ eBPF-JIT : TODO |
core/ generic-idle-thread : ok |
core/ jump-labels : TODO |
core/ tracehook: ok |
debug/ KASAN: TODO |
debug/ gcov-profile-all
From: Guo Ren
patch[1 - 8]: Native qspinlock
patch[9 -14]: Paravirt qspinlock
This series based on:
- v6.7-rc7
- Rework & improve riscv cmpxchg.h and atomic.h
https://lore.kernel.org/linux-riscv/20230810040349.92279-2-leob...@redhat.com/
You can directly try it:
https://github.com/guore
From: Guo Ren
The arch_spinlock_t of qspinlock has contained the atomic_t val, which
satisfies the ticket-lock requirement. Thus, unify the arch_spinlock_t
into qspinlock_types.h. This is the preparation for the next combo
spinlock.
Reviewed-by: Leonardo Bras
Suggested-by: Arnd Bergmann
Link:
From: Guo Ren
Add a separate ticket-lock.h to include multiple spinlock versions and
select one at compile time or runtime.
Reviewed-by: Leonardo Bras
Suggested-by: Arnd Bergmann
Link:
https://lore.kernel.org/linux-riscv/cak8p3a2rnz9mqqhn6-e0cguuv9rntrelfdxt_weid7fxh7f...@mail.gmail.com/
Sign
From: Guo Ren
Move errata vendor func-id definitions from errata_list into
vendorid_list.h. Unifying these definitions is also for following
rwonce errata implementation.
Suggested-by: Leonardo Bras
Link: https://lore.kernel.org/linux-riscv/zqlfj1cmq8pao...@redhat.com/
Signed-off-by: Guo Ren
S
From: Guo Ren
The early version of T-Head C9xx cores has a store merge buffer
delay problem. The store merge buffer could improve the store queue
performance by merging multi-store requests, but when there are not
continued store requests, the prior single store request would be
waiting in the st
From: Guo Ren
The requirements of qspinlock have been documented by commit:
a8ad07e5240c ("asm-generic: qspinlock: Indicate the use of mixed-size
atomics").
Although RISC-V ISA gives out a weaker forward guarantee LR/SC, which
doesn't satisfy the requirements of qspinlock above, it won't prevent
From: Guo Ren
Combo spinlock could support queued and ticket in one Linux Image and
select them during boot time via command line. Here is the func
size (Bytes) comparison table below:
TYPE: COMBO | TICKET | QUEUED
arch_spin_lock : 106 | 60 | 50
arch_spin_unloc
From: Guo Ren
Add a static key controlling whether virt_spin_lock() should be
called or not. When running on bare metal set the new key to
false.
The VM guests should fall back to a Test-and-Set spinlock,
because fair locks have horrible lock 'holder' preemption issues.
The virt_spin_lock_key wo
From: Guo Ren
Force to enable virt_spin_lock when KVM guest, because fair locks
have horrible lock 'holder' preemption issues.
Suggested-by: Leonardo Bras
Link: https://lkml.kernel.org/kvm/zqk9-tn2mepxl...@redhat.com/
Signed-off-by: Guo Ren
Signed-off-by: Guo Ren
---
arch/riscv/include/asm/s
From: Guo Ren
Add the files functions needed to support the SBI PVLOCK (paravirt
qspinlock kick_cpu) extension. Implement kvm_sbi_ext_pvlock_kick_-
cpu(), and we only need to call the kvm_vcpu_kick() and bring
target_vcpu from the halt state. No irq raised, no other request,
just a pure vcpu_kick
From: Guo Ren
Using static_call to switch between:
native_queued_spin_lock_slowpath()__pv_queued_spin_lock_slowpath()
native_queued_spin_unlock() __pv_queued_spin_unlock()
Finish the pv_wait implementation, but pv_kick needs the SBI
definition of the next patches.
Reviewed-by:
From: Guo Ren
Implement pv_kick with SBI guest implementation, and add
SBI_EXT_PVLOCK extension detection. The backend part is
in the KVM pvqspinlock patch.
Reviewed-by: Leonardo Bras
Signed-off-by: Guo Ren
Signed-off-by: Guo Ren
---
arch/riscv/include/asm/sbi.h | 6 ++
arch/ri
From: Guo Ren
Disables the qspinlock slow path using PV optimizations which
allow the hypervisor to 'idle' the guest on lock contention.
Reviewed-by: Leonardo Bras
Signed-off-by: Guo Ren
Signed-off-by: Guo Ren
---
Documentation/admin-guide/kernel-parameters.txt | 2 +-
arch/riscv/kernel/qsp
From: Guo Ren
Add kconfig entry for paravirt_spinlock, an unfair qspinlock
virtualization-friendly backend, by halting the virtual CPU rather
than spinning.
Reviewed-by: Leonardo Bras
Signed-off-by: Guo Ren
Signed-off-by: Guo Ren
---
arch/riscv/Kconfig | 12
arch/riscv/k
From: Guo Ren
Add trace point for pv_kick&wait, here is the output:
ls /sys/kernel/debug/tracing/events/paravirt/
enable filter pv_kick pv_wait
cat /sys/kernel/debug/tracing/trace
entries-in-buffer/entries-written: 33927/33927 #P:12
_-=> irqs-off/BH
From: Guo Ren
C-SKY only needs set_thread_area, no need for get_thread_area, the
same as MIPS.
Signed-off-by: Guo Ren
Signed-off-by: Guo Ren
---
man2/set_thread_area.2 | 10 +-
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/man2/set_thread_area.2 b/man2/set_thread_area.
From: Guo Ren
$ grep strlen_user * -r
arch/csky/include/asm/uaccess.h:#define strlen_user(str) strnlen_user(str,
32767)
arch/csky/lib/usercopy.c: * strlen_user: - Get the size of a string in user
space.
arch/ia64/lib/strlen.S: // Please note that in the case of strlen() as opposed
to strlen_us
From: Guo Ren
$ grep strlen_user * -r
arch/csky/include/asm/uaccess.h:#define strlen_user(str) strnlen_user(str,
32767)
arch/csky/lib/usercopy.c: * strlen_user: - Get the size of a string in user
space.
arch/ia64/lib/strlen.S: // Please note that in the case of strlen() as opposed
to strlen_us
From: Guo Ren
$ grep strlen_user * -r
arch/csky/include/asm/uaccess.h:#define strlen_user(str) strnlen_user(str,
32767)
arch/csky/lib/usercopy.c: * strlen_user: - Get the size of a string in user
space.
arch/ia64/lib/strlen.S: // Please note that in the case of strlen() as opposed
to strlen_us
The following changes since commit 085b7755808aa11f78ab9377257e1dad2e6fa4bb:
Linux 5.1-rc6 (2019-04-21 10:45:57 -0700)
are available in the git repository at:
https://github.com/c-sky/csky-linux.git tags/csky-for-linus-5.1-rc7
for you to fetch changes up to a691f3334d58b833e41d56de1b9820e68
From: Guo Ren
Move #ifdef __KERNEL__ code in the uapi namespace to non-uapi
include/asm/ptrace.h namespace and remove #ifdef __KERNEL__ in
include/asm/ptrace.h. Seperate ptrace.h in uapi and non-uapi is more
common and clear.
Signed-off-by: Guo Ren
Cc: Dmitry V. Levin
---
arch/csky/include/as
From: Guo Ren
Linux kernel has provided some apis for arch signal's implementation.
For example:
restore_saved_sigmask()
set_current_blocked()
restore_altstack()
But in last version of csky signal.c didn't use them and some codes are
confusing, so reconstruct signal.c wit
From: Guo Ren
We could use regs->sr 16-24 bits to detect syscall: VEC_TRAP0 and
r11_sig is no necessary for current implementation.
In this patch, we implement the in_syscall and forget_syscall which are
inspired from arm & nds32, but csky pt_regs has no syscall_num element
and we just set zero
From: Guo Ren
The function of do_notify_resume called by entry.S could be entered
in loop when SIGPENDING was setted again before sret. So we must add
prevent code to make syscall restart (regs->sepc -= 0x4) or it may
re-execute unexpected instructions.
Just like in_syscall & forget_syscall used
From: Guo Ren
Before this patch csky-linux need CONFIG_RAM_BASE to determine start
physical address. Now we use phys_offset variable to replace the macro
of PHYS_OFFSET and we setup phys_offset with real physical address which
is determined during startup in head.S.
With this patch we needn't re
From: Mao Han
In trace events as tracepoints context are not able to
be retrieve with task_pt_regs. Without arch caller regs
support the pt_regs context will be all zero, perf can
not parsing the callchain and resolving the symbols
correctly, some time will even get into deadlock
while handling t
From: Guo Ren
In our stress test, we found some crash problem caused by:
if (!(vma->vm_flags & VM_EXEC))
return;
in update_mmu_cache().
Seems current update_mmu_cache implementation is wrong and we retread
to the conservative implementation.
Also the usage of kmap_atomic in update_mmu
From: Guo Ren
The timer-mp-csky.c only could support CPU_CK860 and it will
compile error with CPU_CK610.
Signed-off-by: Guo Ren
Cc: Daniel Lezcano
Cc: Thomas Gleixner
---
drivers/clocksource/Kconfig | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/clocksource/Kconf
From: Guo Ren
The irq-csky-mpintc.c only could support CPU_CK860 and it will
compile error with CPU_CK610.
Signed-off-by: Guo Ren
Cc: Marc Zyngier
---
drivers/irqchip/Kconfig | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/irqchip/Kconfig b/drivers/irqchip/Kconfig
From: Guo Ren
The irq-csky-mpintc.c only could support CPU_CK860 and it will
compile error with CPU_CK610.
It has beed selected in arch/csky/Kconfig
Signed-off-by: Guo Ren
Cc: Marc Zyngier
---
drivers/irqchip/Kconfig | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
---
v2: Drop the str
From: Guo Ren
The timer-mp-csky.c only could support CPU_CK860 and it will
compile error with CPU_CK610.
It has been selected in arch/csky/Kconfig.
Signed-off-by: Guo Ren
Cc: Daniel Lezcano
Cc: Thomas Gleixner
Cc: Marc Zyngier
---
drivers/clocksource/Kconfig | 2 +-
1 file changed, 1 inser
From: Tobias Klauser
These are used nowhere in the tree (except for some architectures which
define them for their own use) and were already removed for other
architectures in:
commit 6474924e2b5d ("arch: remove unused macro/function thread_saved_pc()")
commit c17c02040bf0 ("arch: remove unused
From: Guo Ren
secure_computing() is called first in syscall_trace_enter() so that
a system call will be aborted quickly without doing succeeding syscall
tracing if seccomp rules want to deny that system call.
TODO:
- Update https://github.com/seccomp/libseccomp csky support
Signed-off-by: Guo
From: Guo Ren
Here are the patchess for the next linux version. Add features
(seccomp-filter, err-injection, top-down&random mmap-layout, irq_work,
show_ipi, context-tracking), and fixup (kprobe_on_ftrace, ...),
Optimize (fault print, ...).
I think we'll finish most of features for arch/csky thi
From: Guo Ren
There is no user return for RESTORE_REGS_FTRACE, so it's no need to
save sp into ss0 as RESTORE_REGS_ALL.
Signed-off-by: Guo Ren
Cc: Arnd Bergmann
---
arch/csky/abiv2/inc/abi/entry.h | 3 ---
1 file changed, 3 deletions(-)
diff --git a/arch/csky/abiv2/inc/abi/entry.h b/arch/csk
From: Guo Ren
This patch support context tracking with no hz full.
Here is the test result with dynticks-testing (see tick_stop):
cat /sys/kernel/debug/tracing/per_cpu/cpu0/trace
tracer: nop
entries-in-buffer/entries-written: 356/356 #P:1
_-=> irqs-off
From: Guo Ren
The "Changing Execution Path" section in the Documentation/kprobes.txt
said:
Since kprobes can probe into a running kernel code, it can change the
register set, including instruction pointer.
Signed-off-by: Guo Ren
Cc: Arnd Bergmann
---
arch/csky/abiv2/mcount.S | 4 +++-
1 file
From: Guo Ren
Here is the result:
cat /proc/interrupts
CPU0 CPU1 CPU2 CPU3
15: 1348 1299952 1076 C-SKY SMP Intc 15 IPI
Interrupt
16: 1203 1825 1598 1307 C-SKY SMP Intc 16
csky_mp_timer
43:292
From: Guo Ren
Inspired by the commit 42d038c4fb00 ("arm64: Add support for function
error injection"), this patch supports function error injection for
csky.
This patch mainly support two functions: one is regs_set_return_value()
which is used to overwrite the return value; the another function
From: Guo Ren
Follow riscv mmap layout with commit "riscv: make mmap allocation
top-down by default (54c95a11cc1b)".
Before:
cat /proc/self/maps
8000-000dc000 r-xp fe:00 17 /bin/busybox
000dc000-000dd000 r--p 000d3000 fe:00 17 /bin/busybox
000dd000-000de000 rw-p 000
From: Guo Ren
- Seperate different trap functions
- Add trap_no()
- Remove panic code print
- Redesign die_if_kerenl to die with riscv's
- Print exact trap info for app segment fault
[ 17.389321] gzip[126]: unhandled signal 11 code 0x3 at 0x0007835a in
busybox[8000+d4000]
[ 17.393882]
From: Guo Ren
The C860 processors support 4 cores smp for maximum, so set NR_CPU
to 4 as default
Signed-off-by: Guo Ren
Cc: Arnd Bergmann
---
arch/csky/Kconfig | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/csky/Kconfig b/arch/csky/Kconfig
index fd92d73..ad98b93 1006
From: Guo Ren
Running work in hardware interrupt context for csky. Implement:
- arch_irq_work_raise()
- arch_irq_work_has_interrupt()
Signed-off-by: Guo Ren
Cc: Arnd Bergmann
---
arch/csky/include/asm/irq_work.h | 11 +++
arch/csky/kernel/smp.c | 12
2 files c
From: Guo Ren
This a wrong code, and no kmap symbol for export.
Signed-off-by: Guo Ren
Cc: Arnd Bergmann
---
arch/csky/mm/highmem.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/arch/csky/mm/highmem.c b/arch/csky/mm/highmem.c
index 89ec32e..89c1080 100644
--- a/arch/csky/mm/highmem.c
+
From: Guo Ren
CPU features registers are setup by customers' bootloader, but
Linux must help transfer them from the primary to secondary cores.
This patch add hint2 CPU feature register supported.
Signed-off-by: Guo Ren
Cc: Arnd Bergmann
---
arch/csky/kernel/smp.c | 3 +++
1 file changed, 3 i
Hi Linus,
Please pull csky updates for v5.9-rc1:
The following changes since commit 92ed301919932f13b9172e525674157e983d:
Linux 5.8-rc7 (2020-07-26 14:14:06 -0700)
are available in the git repository at:
https://github.com/c-sky/csky-linux.git tags/csky-for-linus-5.9-rc1
for you to fe
From: Guo Ren
The function ftrace_process_locs() will modify text code, so we
should give a text_mutex lock. Because some arch's patch code
will assert held of text_mutex even during start_kernel->
ftrace_init().
backtrace log:
assert by lockdep_assert_held(&text_mutex)
0 patch_insn_write (a
From: Guo Ren
Synopsys DesignWare MMC controller could be used in RISC-V and
C-SKY architectures.
Signed-off-by: Guo Ren
Cc: Ulf Hansson
---
drivers/mmc/host/Kconfig | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/mmc/host/Kconfig b/drivers/mmc/host/Kconfig
index 3
From: Guo Ren
When the timer counts to the upper limit, an overflow interrupt is
generated, and the count is reset with the value in the TIME_INI
register. But the software expects to start counting from 0 when
the count overflows, so it forces TIME_INI to 0 to solve the
potential interrupt storm
From: Guo Ren
PAGE_KERNEL_EXEC has been defined above.
Signed-off-by: Guo Ren
Cc: Palmer Dabbelt
Cc: Pekka Enberg
---
arch/riscv/include/asm/pgtable.h | 1 -
1 file changed, 1 deletion(-)
diff --git a/arch/riscv/include/asm/pgtable.h b/arch/riscv/include/asm/pgtable.h
index 41a72861987c..df
From: Guo Ren
Pick up the patch from the 'Link' made by Mark Rutland. Keep the
same with x86, arm, arm64, arc, sh, power.
Link:
https://lore.kernel.org/linux-arm-kernel/1499782763-31418-1-git-send-email-mark.rutl...@arm.com/
Signed-off-by: Guo Ren
Cc: Mark Rutland
Cc: Pekka Enberg
Cc: Palmer
From: Guo Ren
The "If" was wrongly spelled as "It".
Signed-off-by: Guo Ren
Cc: Andrew Morton
Cc: Oscar Salvador
Cc: Alexander Duyck
Cc: David Hildenbrand
Cc: Steven Price
---
include/linux/page-flags.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/include/linux/
From: Guo Ren
This patch introduces a ticket lock implementation for riscv, along the
same lines as the implementation for arch/arm & arch/csky.
Signed-off-by: Guo Ren
Cc: Catalin Marinas
Cc: Will Deacon
Cc: Peter Zijlstra
Cc: Palmer Dabbelt
Cc: Anup Patel
Cc: Arnd Bergmann
---
arch/risc
From: Guo Ren
Current riscv is still using baby spinlock implementation. It'll cause
fairness and cache line bouncing problems. Many people are involved
and pay the efforts to improve it:
- The first version of patch was made in 2019.1:
https://lore.kernel.org/linux-riscv/20190211043829.300
From: Michael Clark
Update the RISC-V port to use the generic qspinlock and qrwlock.
This patch requires support for xchg for short which are added by
a previous patch.
Guo fixed up compile error which made by below include sequence:
+#include
+#include
Signed-off-by: Michael Clark
Co-devel
From: Guo Ren
To reduce assembly codes, let's merge duplicate codes into one
(xchg_acquire, xchg_release, cmpxchg_release).
Signed-off-by: Guo Ren
Link:
https://lore.kernel.org/linux-riscv/CAJF2gTT1_mP-wiK2HsCpTeU61NqZVKZX1A5ye=twqvgn4tp...@mail.gmail.com/
Cc: Peter Zijlstra
Cc: Michael Clark
From: Guo Ren
riscv only support lr.wd/s(c).w(d) with word(double word) size &
align access. There are not lr.h/sc.h instructions. But qspinlock.c
need xchg with short type variable:
xchg_tail -> xchg_releaxed(&lock->tail, ...
typedef struct qspinlock {
union {
atomic_t
From: Guo Ren
Remove unnecessary marco, they are no use or handled by generic
files (atomic-fallback.h, asm-generic/cmpxchg*).
Signed-off-by: Guo Ren
Link:
https://lore.kernel.org/linux-riscv/CAJF2gTT1_mP-wiK2HsCpTeU61NqZVKZX1A5ye=twqvgn4tp...@mail.gmail.com/
Cc: Peter Zijlstra
Cc: Michael Cl
From: Guo Ren
Current riscv is still using baby spinlock implementation. It'll cause
fairness and cache line bouncing problems. Many people are involved
and pay the efforts to improve it:
- The first version of patch was made in 2019.1:
https://lore.kernel.org/linux-riscv/20190211043829.300
From: Michael Clark
Update the RISC-V port to use the generic qspinlock and qrwlock.
This patch requires support for xchg_xtail for full-word which
are added by a previous patch:
Guo added select ARCH_USE_QUEUED_SPINLOCKS_XCHG32 in Kconfig
Guo fixed up compile error which made by below include
From: Guo Ren
Some architectures don't have sub-word swap atomic instruction,
they only have the full word's one.
The sub-word swap only improve the performance when:
NR_CPUS < 16K
* 0- 7: locked byte
* 8: pending
* 9-15: not used
* 16-17: tail index
* 18-31: tail cpu (+1)
The 9-15 b
From: Guo Ren
This patch introduces a ticket lock implementation for riscv, along the
same lines as the implementation for arch/arm & arch/csky.
We still use qspinlock as default.
Signed-off-by: Guo Ren
Cc: Peter Zijlstra
Cc: Anup Patel
Cc: Arnd Bergmann
---
arch/riscv/Kconfig
From: Guo Ren
- Using smp_cond_load_acquire in arch_spin_lock by Peter's
advice.
- Using __smp_acquire_fence in arch_spin_trylock
- Using smp_store_release in arch_spin_unlock
All above are just coding conventions and won't affect the
function.
TODO in smp_cond_load_acquire for architectu
From: Guo Ren
Update the C-SKY port to use the generic qspinlock and qrwlock.
C-SKY only support ldex.w/stex.w with word(double word) size &
align access. So it must select XCHG32 to let qspinlock only use
word atomic xchg_tail.
Default is still ticket lock.
Signed-off-by: Guo Ren
Cc: Waiman
From: Guo Ren
We don't have native hw xchg16 instruction, so let qspinlock
generic code to deal with it.
Using the full-word atomic xchg instructions implement xchg16 has
the semantic risk for atomic operations.
This patch cancels the dependency of on qspinlock generic code on
architecture's xc
From: Guo Ren
We don't have native hw xchg16 instruction, so let qspinlock
generic code to deal with it.
Using the full-word atomic xchg instructions implement xchg16 has
the semantic risk for atomic operations.
This patch cancels the dependency of on qspinlock generic code on
architecture's xc
From: Guo Ren
We don't have native hw xchg16 instruction, so let qspinlock
generic code to deal with it.
Using the full-word atomic xchg instructions implement xchg16 has
the semantic risk for atomic operations.
This patch cancels the dependency of on qspinlock generic code on
architecture's xc
From: Guo Ren
We don't have native hw xchg16 instruction, so let qspinlock
generic code to deal with it.
Using the full-word atomic xchg instructions implement xchg16 has
the semantic risk for atomic operations.
This patch cancels the dependency of on qspinlock generic code on
architecture's xc
From: Guo Ren
Remove unnecessary marco, they are no use or handled by generic
files (atomic-fallback.h, asm-generic/cmpxchg*).
Signed-off-by: Guo Ren
Link:
https://lore.kernel.org/linux-riscv/CAJF2gTT1_mP-wiK2HsCpTeU61NqZVKZX1A5ye=twqvgn4tp...@mail.gmail.com/
Cc: Peter Zijlstra
Cc: Michael Cl
From: Guo Ren
Current riscv is still using baby spinlock implementation. It'll cause
fairness and cache line bouncing problems. Many people are involved
and pay the efforts to improve it:
- The first version of patch was made in 2019.1:
https://lore.kernel.org/linux-riscv/20190211043829.300
From: Guo Ren
To reduce assembly codes, let's merge duplicate codes into one
(xchg_acquire, xchg_release, cmpxchg_release).
Signed-off-by: Guo Ren
Link:
https://lore.kernel.org/linux-riscv/CAJF2gTT1_mP-wiK2HsCpTeU61NqZVKZX1A5ye=twqvgn4tp...@mail.gmail.com/
Cc: Peter Zijlstra
Cc: Michael Clark
From: Guo Ren
Some architectures don't have sub-word swap atomic instruction,
they only have the full word's one.
The sub-word swap only improve the performance when:
NR_CPUS < 16K
* 0- 7: locked byte
* 8: pending
* 9-15: not used
* 16-17: tail index
* 18-31: tail cpu (+1)
The 9-15 b
From: Michael Clark
Update the RISC-V port to use the generic qspinlock and qrwlock.
This patch requires support for xchg for short which are added by
a previous patch.
Guo fixed up compile error which made by below include sequence:
+#include
+#include
Signed-off-by: Michael Clark
Co-devel
From: Guo Ren
Current riscv is still using baby spinlock implementation. It'll cause
fairness and cache line bouncing problems. Many people are involved
and pay the efforts to improve it:
- The first version of patch was made in 2019.1:
https://lore.kernel.org/linux-riscv/20190211043829.300
From: Michael Clark
Update the RISC-V port to use the generic qspinlock and qrwlock.
This patch requires support for xchg_xtail for full-word which
are added by a previous patch:
Guo added select ARCH_USE_QUEUED_SPINLOCKS_XCHG32 in Kconfig
Guo fixed up compile error which made by below include
From: Guo Ren
Some architectures don't have sub-word swap atomic instruction,
they only have the full word's one.
The sub-word swap only improve the performance when:
NR_CPUS < 16K
* 0- 7: locked byte
* 8: pending
* 9-15: not used
* 16-17: tail index
* 18-31: tail cpu (+1)
The 9-15 b
From: Guo Ren
Update the C-SKY port to use the generic qspinlock and qrwlock.
C-SKY only support ldex.w/stex.w with word(double word) size &
align access. So it must select XCHG32 to let qspinlock only use
word atomic xchg_tail.
Signed-off-by: Guo Ren
Cc: Waiman Long
Cc: Peter Zijlstra
Cc: W
From: Guo Ren
We don't have native hw xchg16 instruction, so let qspinlock
generic code to deal with it.
Using the full-word atomic xchg instructions implement xchg16 has
the semantic risk for atomic operations.
This patch cancels the dependency of on qspinlock generic code on
architecture's xc
From: Guo Ren
We don't have native hw xchg16 instruction, so let qspinlock
generic code to deal with it.
Using the full-word atomic xchg instructions implement xchg16 has
the semantic risk for atomic operations.
This patch cancels the dependency of on qspinlock generic code on
architecture's xc
From: Guo Ren
We don't have native hw xchg16 instruction, so let qspinlock
generic code to deal with it.
Using the full-word atomic xchg instructions implement xchg16 has
the semantic risk for atomic operations.
This patch cancels the dependency of on qspinlock generic code on
architecture's xc
From: Guo Ren
We don't have native hw xchg16 instruction, so let qspinlock
generic code to deal with it.
Using the full-word atomic xchg instructions implement xchg16 has
the semantic risk for atomic operations.
This patch cancels the dependency of on qspinlock generic code on
architecture's xc
From: Guo Ren
Current GENERIC_ATOMIC64 in atomic-arch-fallback.h is broken. When a 32-bit
arch use atomic-arch-fallback.h will cause compile error.
In file included from include/linux/atomic.h:81,
from include/linux/rcupdate.h:25,
from include/linux/rculis
From: Guo Ren
The linux/atomic-arch-fallback.h has been there for a while, but
only x86 & arm64 support it. Let's make riscv follow the
linux/arch/* development trendy and make the codes more readable
and maintainable.
This patch also cleanup some codes:
- Add atomic_andnot_* operation
- Using
1 - 100 of 335 matches
Mail list logo