Re: [PATCH 2/5] csky: Remove mm.h from asm/uaccess.h

2020-03-21 Thread Guo Ren
27;struct percpu_rw_semaphore' > | 1422 | struct percpu_rw_semaphore rw_sem[SB_FREEZE_LEVELS]; > > once rcuwait.h includes linux/sched/signal.h. > > Remove the linux/mm.h include. > > Cc: Guo Ren > Cc: linux-c...@vger.kernel.org > Reported-by: kbuild test robot &g

Re: [PATCH 2/5] csky: Remove mm.h from asm/uaccess.h

2020-03-21 Thread Guo Ren
On Sat, Mar 21, 2020 at 8:08 PM Thomas Gleixner wrote: > > Guo Ren writes: > > > Tested and Acked by me. > > > > Queued for next pull request, thx > > Can we please route that with the rcuwait changes to avoid breakage > unless you ship it to Linus right away? Ok, I won't queue it.

Re: [PATCH] mm: convert totalram_pages, totalhigh_pages and managed_pages to atomic.

2018-11-21 Thread Guo Ren
@@ -88,7 +88,7 @@ void free_initmem(void) > ClearPageReserved(virt_to_page(addr)); > init_page_count(virt_to_page(addr)); > free_page(addr); > - totalram_pages++; > + atomic_long_inc(&totalram_pages); > addr += PAGE_SIZE; > } For csky part, it's OK. Guo Ren

Re: [PATCH 19/21] treewide: add checks for the return value of memblock_alloc*()

2019-01-17 Thread Guo Ren
__func__, PAGE_SIZE, > + PAGE_SIZE); > + > set_pmd(pmd, __pmd(__pa(pte))); > BUG_ON(pte != pte_offset_kernel(pmd, > 0)); > } Looks good for me and panic is ok. Reviewed-by: Guo Ren

Re: [PATCH 2/5] mm/vma: Make vma_is_accessible() available for general use

2020-02-17 Thread Guo Ren
csky: Acked-by: Guo Ren On Mon, Feb 17, 2020 at 1:04 PM Anshuman Khandual wrote: > > Lets move vma_is_accessible() helper to include/linux/mm.h which makes it > available for general use. While here, this replaces all remaining open > encodings for VMA access check with vma_i

Re: [PATCH 12/22] csky: fix arch_jump_label_transform_static override

2023-11-11 Thread Guo Ren
_static arch_jump_label_transform_static > + > #endif /* __ASSEMBLY__ */ > #endif /* __ASM_CSKY_JUMP_LABEL_H */ > -- > 2.39.2 > > Thank you! Reviewed-by: Guo Ren -- Best Regards Guo Ren

Re: [PATCH 8/8] c-sky: rm sentinel element from ctl_talbe array

2023-09-08 Thread Guo Ren
Acked-by: Guo Ren On Wed, Sep 6, 2023 at 6:04 PM Joel Granados via B4 Relay wrote: > > From: Joel Granados > > This commit comes at the tail end of a greater effort to remove the > empty elements at the end of the ctl_table arrays (sentinels) which > will reduce the overall

Re: [PATCH 09/21] riscv: dma-mapping: skip invalidation before bidirectional DMA

2023-05-04 Thread Guo Ren
ock_size); > break; > default: > break; > -- > 2.39.2 > -- Best Regards Guo Ren

Re: [PATCH 09/21] riscv: dma-mapping: skip invalidation before bidirectional DMA

2023-05-06 Thread Guo Ren
On Fri, May 5, 2023 at 9:19 PM Arnd Bergmann wrote: > > On Fri, May 5, 2023, at 07:47, Guo Ren wrote: > > On Mon, Mar 27, 2023 at 8:15 PM Arnd Bergmann wrote: > > >> > >> riscv also invalidates the caches before the transfer, which does > >> not appe

Re: [PATCH] irq_work: consolidate arch_irq_work_raise prototypes

2023-05-21 Thread Guo Ren
k.h > b/arch/csky/include/asm/irq_work.h > index 33aaf39d6f94..d39fcc1f5395 100644 > --- a/arch/csky/include/asm/irq_work.h > +++ b/arch/csky/include/asm/irq_work.h > @@ -7,5 +7,5 @@ static inline bool arch_irq_work_has_interrupt(void) > { > return true; > } > -

Re: [PATCH v3 22/34] csky: Convert __pte_free_tlb() to use ptdescs

2023-05-31 Thread Guo Ren
Acked-by: Guo Ren On Thu, Jun 1, 2023 at 5:34 AM Vishal Moola (Oracle) wrote: > > Part of the conversions to replace pgtable constructor/destructors with > ptdesc equivalents. > > Signed-off-by: Vishal Moola (Oracle) > --- > arch/csky/include/asm/pgalloc.h | 4 ++--

Re: [PATCH] kernel: exit: cleanup release_thread()

2022-08-18 Thread Guo Ren
For csky part Acked-by: Guo Ren On Fri, Aug 19, 2022 at 9:39 AM Kefeng Wang wrote: > > Only x86 has own release_thread(), introduce a new weak > release_thread() function to clean empty definitions in > other ARCHs. > > Signed-off-by: Kefeng Wang > --- > arch/alpha

Re: [PATCH v2 21/44] arch/idle: Change arch_cpu_idle() IRQ behaviour

2022-09-20 Thread Guo Ren
id noinstr arch_cpu_idle(void) > * tricks > */ > cpu_do_idle(); > - raw_local_irq_enable(); > } > --- a/arch/csky/kernel/process.c > +++ b/arch/csky/kernel/process.c > @@ -100,6 +100,5 @@ void arch_cpu_idle(void) > #ifdef CONFIG_CPU_PM_STO

Re: [PATCH v2 07/44] cpuidle,psci: Push RCU-idle into driver

2022-09-21 Thread Guo Ren
Reviewed-by: Guo Ren On Mon, Sep 19, 2022 at 6:17 PM Peter Zijlstra wrote: > > Doing RCU-idle outside the driver, only to then temporarily enable it > again, at least twice, before going idle is daft. > > Signed-off-by: Peter Zijlstra (Intel) > --- > drivers/cpuidle/

Re: [RFC PATCH 5/5] treewide: Rename and trace arch-definitions of smp_send_reschedule()

2022-10-07 Thread Guo Ren
sky/kernel/smp.c > index 4b605aa2e1d6..fd7f81be16dd 100644 > --- a/arch/csky/kernel/smp.c > +++ b/arch/csky/kernel/smp.c > @@ -140,7 +140,7 @@ void smp_send_stop(void) > on_each_cpu(ipi_stop, NULL, 1); > } > > -void smp_send_reschedule(int cpu) > +void arch_

Re: [PATCH] mm: remove kern_addr_valid() completely

2022-10-18 Thread Guo Ren
_addr_valid(), which almost does what we need. > + * not-valid. Walk the page table and check the PTE_VALID bit. > * > * Because this is only called on the kernel linear map, p?d_sect() implies > * p?d_present(). When debug_pagealloc is enabled, sections mappings ar

Re: [PATCH v1 2/2] stackprotector: actually use get_random_canary()

2022-10-23 Thread Guo Ren
> -#include > - > extern unsigned long __stack_chk_guard; > > /* > @@ -15,12 +12,7 @@ extern unsigned long __stack_chk_guard; > */ > static __always_inline void boot_init_stack_canary(void) > { > - unsigned long canary; > - > - /* Try to get a semi

Re: [PATCH 3/4] arch: define CONFIG_PAGE_SIZE_*KB on all architectures

2024-02-26 Thread Guo Ren
RF_EVENTS > select HAVE_PERF_REGS > select HAVE_PERF_USER_STACK_DUMP > diff --git a/arch/csky/include/asm/page.h b/arch/csky/include/asm/page.h > index 4a0502e324a6..f70f37402d75 100644 > --- a/arch/csky/include/asm/page.h > +++ b/arch/csky/include/asm/page.h > @@

Re: [PATCH 3/3] mm, arch: add generic implementation of pfn_valid() for FLATMEM

2023-01-26 Thread Guo Ren
> > #define virt_addr_valid(kaddr) ((void *)(kaddr) >= (void *)PAGE_OFFSET && \ > (void *)(kaddr) < high_memory) > -#define pfn_valid(pfn) ((pfn) >= ARCH_PFN_OFFSET && ((pfn) - > ARCH_PFN_OFFSET) < max_mapnr) For csky part:

Re: [PATCH 05/22] csky/cpu: Make sure arch_cpu_idle_dead() doesn't return

2023-02-03 Thread Guo Ren
_report_idle_dead(); arch_cpu_idle_dead(); + BUG(); } arch_cpu_idle_enter(); > } > #endif > -- > 2.39.0 > -- Best Regards Guo Ren

Re: [PATCH 05/22] csky/cpu: Make sure arch_cpu_idle_dead() doesn't return

2023-02-05 Thread Guo Ren
On Sat, Feb 4, 2023 at 10:29 AM Josh Poimboeuf wrote: > > On Sat, Feb 04, 2023 at 09:12:31AM +0800, Guo Ren wrote: > > On Sat, Feb 4, 2023 at 6:05 AM Josh Poimboeuf wrote: > > > > > > arch_cpu_idle_dead() doesn't return. Make that more explicit with

Re: [PATCH 10/21] csky: dma-mapping: skip invalidating before DMA from device

2023-03-27 Thread Guo Ren
cache_op(paddr, size, dma_wb_range); > - break; > case DMA_FROM_DEVICE: > case DMA_BIDIRECTIONAL: > - cache_op(paddr, size, dma_wbinv_range); > + cache_op(paddr, size, dma_wb_range); Reviewed-by: Guo Ren > break; > default: > BUG(); > -- > 2.39.2 > -- Best Regards Guo Ren

Re: [PATCH v3] kprobe/ftrace: bail out if ftrace was killed

2024-05-01 Thread Guo Ren
d kprobe_ftrace_handler(unsigned long ip, unsigned long > parent_ip, > struct kprobe_ctlblk *kcb; > struct pt_regs *regs; > > + if (unlikely(kprobe_ftrace_disabled)) > + return; > + For csky part. Acked-by: Guo Ren > bit = ftrace_test_recu

Re: [patch RFC 06/15] csky/mm/highmem: Switch to generic kmap atomic

2020-09-22 Thread Guo Ren
Acked-by: Guo Ren On Sat, Sep 19, 2020 at 5:50 PM Thomas Gleixner wrote: > > Signed-off-by: Thomas Gleixner > Cc: Guo Ren > Cc: linux-c...@vger.kernel.org > --- > Note: Completely untested > --- > arch/csky/Kconfig |1 > arch/csky/include/asm/

Re: [PATCH v5 4/7] powerpc/qspinlock: Add ARCH_USE_QUEUED_SPINLOCKS_XCHG32

2021-03-28 Thread Guo Ren
On Sun, Mar 28, 2021 at 7:14 PM Christophe Leroy wrote: > > > > Le 28/03/2021 à 08:30, guo...@kernel.org a écrit : > > From: Guo Ren > > > > We don't have native hw xchg16 instruction, so let qspinlock > > generic code to deal with it. > > We ha

Re: [PATCH v6 3/9] riscv: locks: Introduce ticket-based spinlock implementation

2021-04-04 Thread Guo Ren
On Wed, Mar 31, 2021 at 10:32 PM wrote: > > 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 &

Re: [PATCH V5 09/21] riscv: compat: Add basic compat data type implementation

2022-02-23 Thread Guo Ren
On Wed, Feb 23, 2022 at 9:42 AM Palmer Dabbelt wrote: > > On Tue, 01 Feb 2022 07:05:33 PST (-0800), guo...@kernel.org wrote: > > From: Guo Ren > > > > Implement riscv asm/compat.h for struct compat_xxx, > > is_compat_task, compat_user_regset, regset convert.

Re: [PATCH V5 13/21] riscv: compat: process: Add UXL_32 support in start_thread

2022-02-23 Thread Guo Ren
On Wed, Feb 23, 2022 at 9:42 AM Palmer Dabbelt wrote: > > On Tue, 01 Feb 2022 07:05:37 PST (-0800), guo...@kernel.org wrote: > > From: Guo Ren > > > > If the current task is in COMPAT mode, set SR_UXL_32 in status for > > returning userspace. We need CONFI

Re: [PATCH V5 16/21] riscv: compat: vdso: Add rv32 VDSO base code implementation

2022-02-23 Thread Guo Ren
On Wed, Feb 23, 2022 at 9:42 AM Palmer Dabbelt wrote: > > On Tue, 01 Feb 2022 07:05:40 PST (-0800), guo...@kernel.org wrote: > > From: Guo Ren > > > > There is no vgettimeofday supported in rv32 that makes simple to > > generate rv32 vdso code which only

Re: [PATCH V5 17/21] riscv: compat: vdso: Add setup additional pages implementation

2022-02-23 Thread Guo Ren
On Wed, Feb 23, 2022 at 9:42 AM Palmer Dabbelt wrote: > > On Tue, 01 Feb 2022 07:05:41 PST (-0800), guo...@kernel.org wrote: > > From: Guo Ren > > > > Reconstruct __setup_additional_pages() by appending vdso info > > pointer argument to meet compat_vds

Re: [PATCH V5 17/21] riscv: compat: vdso: Add setup additional pages implementation

2022-02-23 Thread Guo Ren
Fon +49 551 30664-0, Fax +49 551 30664-11 > Gothaer Platz 3, 37083 Göttingen, Germany > Sitz der Gesellschaft: Göttingen, Amtsgericht Göttingen HR B 3160 > Geschäftsführung: Heike Jordan, Dr. Uwe Kracke – Ust-IdNr.: DE 205 198 055 > > emlix - smart embedded open source -- Best Regards Guo Ren ML: https://lore.kernel.org/linux-csky/

Re: [PATCH V5 17/21] riscv: compat: vdso: Add setup additional pages implementation

2022-02-24 Thread Guo Ren
On Wed, Feb 23, 2022 at 9:42 AM Palmer Dabbelt wrote: > > On Tue, 01 Feb 2022 07:05:41 PST (-0800), guo...@kernel.org wrote: > > From: Guo Ren > > > > Reconstruct __setup_additional_pages() by appending vdso info > > pointer argument to meet compat_vds

Re: [PATCH V6 11/20] riscv: compat: syscall: Add compat_sys_call_table implementation

2022-02-24 Thread Guo Ren
On Thu, Feb 24, 2022 at 5:38 PM Arnd Bergmann wrote: > > On Thu, Feb 24, 2022 at 9:54 AM wrote: > > > > From: Guo Ren > > > > Implement compat sys_call_table and some system call functions: > > truncate64, ftruncate64, fallocate, pread64, pwrite64, > >

Re: [PATCH V6 17/20] riscv: compat: vdso: Add setup additional pages implementation

2022-02-24 Thread Guo Ren
On Fri, Feb 25, 2022 at 1:57 AM Palmer Dabbelt wrote: > > On Thu, 24 Feb 2022 00:54:07 PST (-0800), guo...@kernel.org wrote: > > From: Guo Ren > > > > Reconstruct __setup_additional_pages() by appending vdso info > > pointer argument to meet compat_vds

Re: [PATCH V6 16/20] riscv: compat: vdso: Add rv32 VDSO base code implementation

2022-02-25 Thread Guo Ren
e/guoren/source/kernel/riscv-linux/arch/riscv/kernel/compat_vdso/gen_compat_vdso_offsets.sh | LC_ALL=C sort > include/generated/compat_vdso-offsets.h On Thu, Feb 24, 2022 at 6:13 PM Arnd Bergmann wrote: > > On Thu, Feb 24, 2022 at 9:54 AM wrote: > > > > From: Guo Ren > &

Re: [PATCH V6 16/20] riscv: compat: vdso: Add rv32 VDSO base code implementation

2022-02-25 Thread Guo Ren
On Fri, Feb 25, 2022 at 11:50 PM Arnd Bergmann wrote: > > On Fri, Feb 25, 2022 at 4:42 PM Guo Ren wrote: > > > > Hi Arnd & Palmer, > > > > Here is the new modified compat_vdso/Makefile, please have a look, >

Re: [PATCH V7 03/20] compat: consolidate the compat_flock{, 64} definition

2022-02-28 Thread Guo Ren
; So how do you think compat_loff_t could be defined with __aligned__(4)? > marking the structure packed isn't needed. > I believe compat_u64 and compat_s64 both have aligned(4). > It is also wrong, consider: > > struct foo { > char x; > struct compat_flock64 fl64; > }; > > There should be 3 bytes of padding after 'x'. > But you've removed it. > > David > > - > Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 > 1PT, UK > Registration No: 1397386 (Wales) > -- Best Regards Guo Ren ML: https://lore.kernel.org/linux-csky/

Re: [PATCH V7 03/20] compat: consolidate the compat_flock{, 64} definition

2022-02-28 Thread Guo Ren
On Mon, Feb 28, 2022 at 8:02 PM David Laight wrote: > > From: Guo Ren > > Sent: 28 February 2022 11:52 > > > > On Mon, Feb 28, 2022 at 2:40 PM David Laight > > wrote: > > > > > > From: guo...@kernel.org > > > > Sent: 27

Re: [PATCH V3 19/30] csky/mm: Enable ARCH_HAS_VM_GET_PAGE_PROT

2022-03-01 Thread Guo Ren
Acked-by: Guo Ren On Mon, Feb 28, 2022 at 7:10 PM Anshuman Khandual wrote: > > This defines and exports a platform specific custom vm_get_page_prot() via > subscribing ARCH_HAS_VM_GET_PAGE_PROT. Subsequently all __SXXX and __PXXX > macros can be dropped which are no longer needed. &

Re: [PATCH V7 14/20] riscv: compat: Add elf.h implementation

2022-03-10 Thread Guo Ren
hine == EM_RISCV && + hdr->e_ident[EI_CLASS] == ELFCLASS32; } static int __init compat_mode_detect(void) On Mon, Feb 28, 2022 at 12:30 AM wrote: > > From: Guo Ren > > Implement necessary type and macro for compat elf. See the code > comment for detail.

Re: [PATCH V7 13/20] riscv: compat: process: Add UXL_32 support in start_thread

2022-03-10 Thread Guo Ren
Hi Arnd, On Mon, Feb 28, 2022 at 12:30 AM wrote: > > From: Guo Ren > > If the current task is in COMPAT mode, set SR_UXL_32 in status for > returning userspace. We need CONFIG _COMPAT to prevent compiling > errors with rv32 defconfig. > > Signed-off-by: Guo Ren > S

Re: [PATCH V7 13/20] riscv: compat: process: Add UXL_32 support in start_thread

2022-03-11 Thread Guo Ren
On Fri, Mar 11, 2022 at 9:38 PM Ben Dooks wrote: > > On 11/03/2022 02:38, Guo Ren wrote: > > Hi Arnd, > > > > On Mon, Feb 28, 2022 at 12:30 AM wrote: > >> > >> From: Guo Ren > >> > >> If the current task is in COMPAT mode, set SR_U

Re: [PATCH V7 13/20] riscv: compat: process: Add UXL_32 support in start_thread

2022-03-12 Thread Guo Ren
On Sat, Mar 12, 2022 at 4:36 PM Arnd Bergmann wrote: > > On Sat, Mar 12, 2022 at 3:13 AM Guo Ren wrote: > > On Fri, Mar 11, 2022 at 9:38 PM Ben Dooks wrote: > > > On 11/03/2022 02:38, Guo Ren wrote: > > > >> --- a/arch/riscv/kernel/process.c > &

Re: [PATCH V8 10/20] riscv: compat: Re-implement TASK_SIZE for COMPAT_32BIT

2022-03-20 Thread Guo Ren
16 #ifndef __ASSEMBLY__ On Wed, Mar 16, 2022 at 3:04 PM wrote: > > From: Guo Ren > > Make TASK_SIZE from const to dynamic detect TIF_32BIT flag > function. Refer to arm64 to implement DEFAULT_MAP_WINDOW_64 for > efi-stub. > > Limit 32-bit compatible process

Re: [PATCH V9 11/20] riscv: compat: syscall: Add compat_sys_call_table implementation

2022-03-23 Thread Guo Ren
Hi Palmer & Arnd, Fixup fadvise64_64 arguments problem. On Tue, Mar 22, 2022 at 10:41 PM wrote: > > From: Guo Ren > > Implement compat sys_call_table and some system call functions: > truncate64, ftruncate64, fallocate, pread64, pwrite64, > sync_file_range, readahead, f

Re: [PATCH V9 00/20] riscv: compat: Add COMPAT Kbuild skeletal support

2022-04-02 Thread Guo Ren
On Wed, Mar 23, 2022 at 5:00 AM Palmer Dabbelt wrote: > > On Tue, 22 Mar 2022 07:39:43 PDT (-0700), guo...@kernel.org wrote: > > From: Guo Ren > > > > Currently, most 64-bit architectures (x86, parisc, powerpc, arm64, > > s390, mips, sparc) have supported

Re: [PATCH V9 00/20] riscv: compat: Add COMPAT Kbuild skeletal support

2022-04-02 Thread Guo Ren
'/home/guoren/source/kernel/build-arm64' On Sat, Apr 2, 2022 at 8:53 PM Guo Ren wrote: > > On Wed, Mar 23, 2022 at 5:00 AM Palmer Dabbelt wrote: > > > > On Tue, 22 Mar 2022 07:39:43 PDT (-0700), guo...@kernel.org wrote: > > > From: Guo Ren > > > &

Re: [PATCH V10 04/20] kconfig: Add SYSVIPC_COMPAT for all architectures

2022-04-02 Thread Guo Ren
On Sat, Apr 2, 2022 at 9:39 PM Masahiro Yamada wrote: > > On Sat, Apr 2, 2022 at 10:36 PM wrote: > > > > From: Guo Ren > > > > The existing per-arch definitions are pretty much historic cruft. > > Move SYSVIPC_COMPAT into init/Kconfig. > > > > Si

Re: [PATCH V11 00/20] riscv: Add COMPAT mode support for rv64

2022-04-02 Thread Guo Ren
quest for COMPAT, thank you very much. On Sat, Apr 2, 2022 at 9:53 PM wrote: > > From: Guo Ren > > Currently, most 64-bit architectures (x86, parisc, powerpc, arm64, > s390, mips, sparc) have supported COMPAT mode. But they all have > history issues and can't use standard

Re: [PATCH V11 00/20] riscv: Add COMPAT mode support for rv64

2022-04-04 Thread Guo Ren
On Sat, Apr 2, 2022 at 10:04 PM Guo Ren wrote: > > Hi Palmer, > > Sorry for the late reply, I still want COMPAT to catch up at 5.18.. > I've pushed it into my next branch, and it would get in linux-next the > next day. You could have a look at that. The repo is: > htt

Re: [PATCH V11 00/20] riscv: Add COMPAT mode support for rv64

2022-04-04 Thread Guo Ren
Hi Palmer, On Tue, Apr 5, 2022 at 7:06 AM Palmer Dabbelt wrote: > > On Mon, 04 Apr 2022 07:28:50 PDT (-0700), guo...@kernel.org wrote: > > On Sat, Apr 2, 2022 at 10:04 PM Guo Ren wrote: > >> > >> Hi Palmer, > >> > >> Sorry for the late reply, I s

Re: [PATCH V12 00/20] riscv: Add COMPAT mode support for 64BIT

2022-04-28 Thread Guo Ren
r taking care of compat patch series. On Tue, Apr 5, 2022 at 3:13 PM wrote: > > From: Guo Ren > > Currently, most 64-bit architectures (x86, parisc, powerpc, arm64, > s390, mips, sparc) have supported COMPAT mode. But they all have > history issues and can't use standard li

Re: [PATCH V12 00/20] riscv: Add COMPAT mode support for 64BIT

2022-04-29 Thread Guo Ren
g clean through all the > autobuilders before making it look good, I think it didn't fail this > time so I'll do a bit more refactoring. Shouldn't be too much longer at > this point. Cool, thank you. Hope it could be in v5.19. > > > > > > > On Tue, Ap

Re: [PATCH V12 00/20] riscv: Add COMPAT mode support for 64BIT

2022-05-20 Thread Guo Ren
On Fri, May 20, 2022 at 1:50 AM Palmer Dabbelt wrote: > > On Tue, 05 Apr 2022 00:12:54 PDT (-0700), guo...@kernel.org wrote: > > From: Guo Ren > > > > Currently, most 64-bit architectures (x86, parisc, powerpc, arm64, > > s390, mips, sparc) have supported

Re: [PATCH v6 4/9] csky: locks: Optimize coding convention

2021-04-11 Thread Guo Ren
On Wed, Mar 31, 2021 at 10:32 PM wrote: > > 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 cod

Re: [PATCH v6 3/9] riscv: locks: Introduce ticket-based spinlock implementation

2021-04-11 Thread Guo Ren
On Wed, Mar 31, 2021 at 10:32 PM wrote: > > 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 &

Re: [PATCH v6 3/9] riscv: locks: Introduce ticket-based spinlock implementation

2021-04-11 Thread Guo Ren
On Mon, Apr 12, 2021 at 12:02 AM Guo Ren wrote: > > On Wed, Mar 31, 2021 at 10:32 PM wrote: > > > > From: Guo Ren > > > > This patch introduces a ticket lock implementation for riscv, along the > > same lines as the implementation for arch/arm & arch

Re: [PATCH v2 12/45] csky: Use do_kernel_power_off()

2021-10-31 Thread Guo Ren
Only for this patch, Acked-by: Guo Ren On Thu, Oct 28, 2021 at 5:18 AM Dmitry Osipenko wrote: > > Kernel now supports chained power-off handlers. Use do_kernel_power_off() > that invokes chained power-off handlers. It also invokes legacy > pm_power_off() for now, which will be remo

Re: [PATCH 05/15] csky: switch to generic version of pte allocation

2019-05-03 Thread Guo Ren
Hi Mike, Acked-by: Guo Ren On Thu, May 02, 2019 at 06:28:32PM +0300, Mike Rapoport wrote: > The csky implementation pte_alloc_one(), pte_free_kernel() and pte_free() > is identical to the generic except of lack of __GFP_ACCOUNT for the user > PTEs allocation. > > Switch csky

Re: [PATCH 05/15] csky: switch to generic version of pte allocation

2019-05-03 Thread Guo Ren
On Sat, May 04, 2019 at 12:03:48AM +0800, Guo Ren wrote: > Hi Mike, > > Acked-by: Guo Ren > > On Thu, May 02, 2019 at 06:28:32PM +0300, Mike Rapoport wrote: > > The csky implementation pte_alloc_one(), pte_free_kernel() and pte_free() > > is identical to th

Re: [PATCH 4/8] sched: powerpc: Remove unused TASK_SIZE_OF

2021-12-21 Thread Guo Ren
On Wed, Dec 22, 2021 at 2:43 AM Christophe Leroy wrote: > > > > Le 21/12/2021 à 18:00, guo...@kernel.org a écrit : > > From: Guo Ren > > > > This macro isn't used in Linux sched, now. Delete in > > include/linux/sched.h and arch's include/asm. >

Re: [PATCH 4/8] sched: powerpc: Remove unused TASK_SIZE_OF

2021-12-22 Thread Guo Ren
Got it. Thx On Wed, Dec 22, 2021 at 3:27 PM Christophe Leroy wrote: > > > > Le 22/12/2021 à 04:02, Guo Ren a écrit : > > On Wed, Dec 22, 2021 at 2:43 AM Christophe Leroy > > wrote: > >> > >> > >> > >> Le 21/12/2021 à 18:00, guo...@kern

Re: [PATCH V2 5/8] sched: s390: Remove unused TASK_SIZE_OF

2021-12-26 Thread Guo Ren
On Sun, Dec 26, 2021 at 12:26 AM Heiko Carstens wrote: > > On Sat, Dec 25, 2021 at 12:54:27PM +0800, guo...@kernel.org wrote: > > From: Guo Ren > > > > This macro isn't used in Linux sched, now. Delete in > > include/linux/sched.h and arch's inc

Re: [PATCH V2 11/17] riscv: compat: Add elf.h implementation

2022-01-10 Thread Guo Ren
On Mon, Jan 10, 2022 at 10:29 PM Arnd Bergmann wrote: > > On Tue, Dec 28, 2021 at 3:39 PM wrote: > > > > From: Guo Ren > > > > Implement necessary type and macro for compat elf. See the code > > comment for detail. > > > > Signed-off-by: G

Re: [PATCH V2 03/17] asm-generic: fcntl: compat: Remove duplicate definitions

2022-01-10 Thread Guo Ren
On Mon, Jan 10, 2022 at 9:35 PM Arnd Bergmann wrote: > > On Tue, Dec 28, 2021 at 3:39 PM wrote: > > > > From: Guo Ren > > > > Remove duplicate F_GETLK64,F_SETLK64,F_SETLKW64 definitions in > > arch/*/include/asm/compat.h. > > > > Signed-off-by: G

Re: [PATCH 4/5] uapi: always define F_GETLK64/F_SETLK64/F_SETLKW64 in fcntl.h

2022-01-11 Thread Guo Ren
gt; > This is probably what we want here for compatibility reasons, but I think > it should be explained in the changelog text, and I'd like Jeff or Bruce > to comment on it as well: the alternative here would be to make the > uapi definition depend on __BITS_PER_LONG==32, which is __BITS_PER_LONG==32 || __KERNEL__ just for kernel use in compat. > technically the right thing to do but more a of a change. > >Arnd -- Best Regards Guo Ren ML: https://lore.kernel.org/linux-csky/

Re: [PATCH V3 07/17] riscv: compat: Re-implement TASK_SIZE for COMPAT_32BIT

2022-01-20 Thread Guo Ren
s another topic, let's give the initial compat for 2GB support to riscv. > > David > > - > Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 > 1PT, UK > Registration No: 1397386 (Wales) -- Best Regards Guo Ren ML: https://lore.kernel.org/linux-csky/

Re: [PATCH V3 10/17] riscv: compat: Add elf.h implementation

2022-01-20 Thread Guo Ren
On Thu, Jan 20, 2022 at 9:33 PM Arnd Bergmann wrote: > > On Thu, Jan 20, 2022 at 8:39 AM wrote: > > From: Guo Ren > > > > Implement necessary type and macro for compat elf. See the code > > comment for detail. > > > > Signed-off-b

Re: [PATCH V3 15/17] riscv: compat: Add UXL_32 support in start_thread

2022-01-20 Thread Guo Ren
that #ifdef, as the is_compat_task() definition is > meant to drop the code at compile time, unless the SR_UXL_32 > definition is not visible here. I almost put CONFIG_COMPAT in every compat related code, because I hope the next arch that wants to support COMPAT could easily find where to be

Re: [PATCH V3 08/17] riscv: compat: syscall: Add compat_sys_call_table implementation

2022-01-20 Thread Guo Ren
t; > The names clash with the custom versions defined for powerpc and sparc, > but the duplicates look compatible if you can account for the padded > argument and the lo/hi order of the pairs, so could just be removed here > (all other architectures use custom function names instead). I would try it later. > > Arnd > > [1] https://riscv.org/wp-content/uploads/2015/01/riscv-calling.pdf -- Best Regards Guo Ren ML: https://lore.kernel.org/linux-csky/

Re: [PATCH V3 17/17] KVM: compat: riscv: Prevent KVM_COMPAT from being selected

2022-01-20 Thread Guo Ren
On Thu, Jan 20, 2022 at 6:32 PM Arnd Bergmann wrote: > > On Thu, Jan 20, 2022 at 8:39 AM wrote: > > > > From: Guo Ren > > > > Current riscv doesn't support the 32bit KVM/arm API. Let's make it > > clear by not selecting KVM_COMPAT. > > >

Re: [PATCH V3 06/17] riscv: compat: Add basic compat date type implementation

2022-01-20 Thread Guo Ren
remove those two lines. The rest looks good to > me. Yes, you are right. compat_mode_t should be unsigned int. > >Arnd -- Best Regards Guo Ren ML: https://lore.kernel.org/linux-csky/

Re: [PATCH V3 13/17] riscv: compat: signal: Add rt_frame implementation

2022-01-20 Thread Guo Ren
On Thu, Jan 20, 2022 at 6:31 PM Arnd Bergmann wrote: > > On Thu, Jan 20, 2022 at 8:39 AM wrote: > > > > From: Guo Ren > > > > Implement compat_setup_rt_frame for sigcontext save & restore. The > > main process is the same with signal, but the rv32 pt_reg

Re: [PATCH V3 08/17] riscv: compat: syscall: Add compat_sys_call_table implementation

2022-01-21 Thread Guo Ren
On Fri, Jan 21, 2022 at 4:57 PM Arnd Bergmann wrote: > > On Fri, Jan 21, 2022 at 7:25 AM Guo Ren wrote: > > On Thu, Jan 20, 2022 at 10:43 PM Arnd Bergmann wrote: > > > On Thu, Jan 20, 2022 at 8:39 AM wrote: > > > > Are you sure these are the right calling conve

Re: [PATCH V3 03/17] asm-generic: compat: Cleanup duplicate definitions

2022-01-27 Thread Guo Ren
On Thu, Jan 20, 2022 at 9:02 PM Arnd Bergmann wrote: > > On Thu, Jan 20, 2022 at 8:38 AM wrote: > > > > From: Guo Ren > > > > There are 7 64bit architectures that support Linux COMPAT mode to > > run 32bit applications. A lot of definitions

Re: [PATCH V4 06/17] riscv: compat: Add basic compat date type implementation

2022-01-29 Thread Guo Ren
tch the > native (~0UL) definition. Yes, native rv32 used ~0UL, although its task_size is only 2.4GB. I would remove #define COMPAT_RLIM_INFINITY 0x7fff > > Arnd -- Best Regards Guo Ren ML: https://lore.kernel.org/linux-csky/

Re: [PATCH V4 08/17] riscv: compat: syscall: Add compat_sys_call_table implementation

2022-01-29 Thread Guo Ren
On Sun, Jan 30, 2022 at 6:41 AM Arnd Bergmann wrote: > > > Implement compat sys_call_table and some system call functions: > > truncate64, ftruncate64, fallocate, pread64, pwrite64, > > sync_file_range, readahead, fadvise64_64 which need argument > > translation. >

Re: [PATCH V4 08/17] riscv: compat: syscall: Add compat_sys_call_table implementation

2022-01-30 Thread Guo Ren
On Sun, Jan 30, 2022 at 7:32 PM Arnd Bergmann wrote: > > On Sun, Jan 30, 2022 at 6:54 AM Guo Ren wrote: > > On Sun, Jan 30, 2022 at 6:41 AM Arnd Bergmann wrote: > > > > > > I would make these endian-specific, and reverse them on big-endian > > > arc

Re: [PATCH 1/5] uapi: remove the unused HAVE_ARCH_STRUCT_FLOCK64 define

2022-01-31 Thread Guo Ren
Reviewed-by: Guo Ren On Mon, Jan 31, 2022 at 2:49 PM Christoph Hellwig wrote: > > Signed-off-by: Christoph Hellwig > --- > include/uapi/asm-generic/fcntl.h | 2 -- > tools/include/uapi/asm-generic/fcntl.h | 2 -- > 2 files changed, 4 deletions(-) > > diff

Re: [PATCH 2/5] uapi: simplify __ARCH_FLOCK{,64}_PAD a little

2022-01-31 Thread Guo Ren
; > struct flock64 { > @@ -212,7 +206,9 @@ struct flock64 { > __kernel_loff_t l_start; > __kernel_loff_t l_len; > __kernel_pid_t l_pid; > +#ifdef __ARCH_FLOCK64_PAD > __ARCH_FLOCK64_PAD > +#endif > }; > > #endif /* _ASM_GENERIC_FCNTL_H */ > -- > 2.30.2 > Reviewed-by: Guo Ren -- Best Regards Guo Ren ML: https://lore.kernel.org/linux-csky/

Re: [PATCH 4/5] uapi: always define F_GETLK64/F_SETLK64/F_SETLKW64 in fcntl.h

2022-01-31 Thread Guo Ren
Acked-by: Guo Ren On Mon, Jan 31, 2022 at 2:49 PM Christoph Hellwig wrote: > > The F_GETLK64/F_SETLK64/F_SETLKW64 fcntl opcodes are only implemented > for the 32-bit syscall APIs, but are also needed for compat handling > on 64-bit kernels. > > Consolidate them in unistd.h ins

Re: [PATCH V4 16/17] riscv: compat: Add COMPAT Kbuild skeletal support

2022-01-31 Thread Guo Ren
But most rv32 apps would meet different userspace segment faults. Current code would let the machine try the rv32 apps without detecting whether hw support or not. -- Best Regards Guo Ren ML: https://lore.kernel.org/linux-csky/

Re: [PATCH V4 03/17] asm-generic: compat: Cleanup duplicate definitions

2022-01-31 Thread Guo Ren
On Mon, Jan 31, 2022 at 8:21 PM Christoph Hellwig wrote: > > On Sat, Jan 29, 2022 at 08:17:14PM +0800, guo...@kernel.org wrote: > > From: Guo Ren > > > > There are 7 64bit architectures that support Linux COMPAT mode to > > run 32bit applications. A lo

Re: consolidate the compat fcntl definitions v2

2022-01-31 Thread Guo Ren
ed-by: Arnd Bergmann > > I think it would be best to merge this through the risc-v tree along > with the coming compat support > that depends on it. Okay, I would include it in my next version series. > Alternatively, I can put it into my asm-generic > tree for 5.18. > > Arnd -- Best Regards Guo Ren ML: https://lore.kernel.org/linux-csky/

Re: [PATCH 1/5] uapi: remove the unused HAVE_ARCH_STRUCT_FLOCK64 define

2022-01-31 Thread Guo Ren
gt; +++ b/tools/include/uapi/asm-generic/fcntl.h > @@ -202,7 +202,6 @@ struct flock { > }; > #endif > > -#ifndef HAVE_ARCH_STRUCT_FLOCK64 > #ifndef __ARCH_FLOCK64_PAD > #define __ARCH_FLOCK64_PAD > #endif > @@ -215,6 +214,5 @@ struct flock64 { > __kernel_pid_t l_p

Re: [PATCH 4/5] uapi: always define F_GETLK64/F_SETLK64/F_SETLKW64 in fcntl.h

2022-01-31 Thread Guo Ren
WN_EX15 > diff --git a/tools/include/uapi/asm-generic/fcntl.h > b/tools/include/uapi/asm-generic/fcntl.h > index bf961a71802e0..6e16722026f39 100644 > --- a/tools/include/uapi/asm-generic/fcntl.h > +++ b/tools/include/uapi/asm-generic/fcntl.h > @@ -115,13 +115,11 @@ > #define F_GETSIG 11 /* for sockets. */ > #endif > > -#ifndef CONFIG_64BIT > #ifndef F_GETLK64 > #define F_GETLK64 12 /* using 'struct flock64' */ > #define F_SETLK64 13 > #define F_SETLKW64 14 > #endif > -#endif > > #ifndef F_SETOWN_EX > #define F_SETOWN_EX15 > -- > 2.30.2 > -- Best Regards Guo Ren ML: https://lore.kernel.org/linux-csky/

Re: [PATCH 4/5] uapi: always define F_GETLK64/F_SETLK64/F_SETLKW64 in fcntl.h

2022-01-31 Thread Guo Ren
On Tue, Feb 1, 2022 at 11:02 AM Guo Ren wrote: > > On Mon, Jan 31, 2022 at 2:49 PM Christoph Hellwig wrote: > > > > The F_GETLK64/F_SETLK64/F_SETLKW64 fcntl opcodes are only implemented > > for the 32-bit syscall APIs, but are also needed for compat handli

Re: [PATCH V4 16/17] riscv: compat: Add COMPAT Kbuild skeletal support

2022-02-01 Thread Guo Ren
On Tue, Feb 1, 2022 at 3:45 PM Christoph Hellwig wrote: > > On Mon, Jan 31, 2022 at 09:50:58PM +0800, Guo Ren wrote: > > On Mon, Jan 31, 2022 at 8:26 PM Christoph Hellwig > > wrote: > > > > > > Given that most rv64 implementations can't run in rv3

Re: [PATCH V4 16/17] riscv: compat: Add COMPAT Kbuild skeletal support

2022-02-01 Thread Guo Ren
+#endif + riscv_fill_hwcap(); } On Tue, Feb 1, 2022 at 5:36 PM Arnd Bergmann wrote: > > On Tue, Feb 1, 2022 at 10:13 AM Guo Ren wrote: > > On Tue, Feb 1, 2022 at 3:45 PM Christoph Hellwig wrote: > > > On Mon, Jan 31, 2022 at 09:50:58PM +0800, Guo Ren wrote: >

Re: [PATCH V4 16/17] riscv: compat: Add COMPAT Kbuild skeletal support

2022-02-01 Thread Guo Ren
On Tue, Feb 1, 2022 at 7:48 PM Arnd Bergmann wrote: > > On Tue, Feb 1, 2022 at 11:26 AM Guo Ren wrote: > > > > Hi Arnd & Christoph, > > > > The UXL field controls the value of XLEN for U-mode, termed UXLEN, > > which may differ from the > > value of

Re: [PATCH V5 21/21] KVM: compat: riscv: Prevent KVM_COMPAT from being selected

2022-02-01 Thread Guo Ren
On Wed, Feb 2, 2022 at 12:11 AM Anup Patel wrote: > > On Tue, Feb 1, 2022 at 9:31 PM Paolo Bonzini wrote: > > > > On 2/1/22 16:44, Anup Patel wrote: > > > +Paolo > > > > > > On Tue, Feb 1, 2022 at 8:38 PM wrote: > > >> > > >>

Re: [PATCH V5 15/21] riscv: compat: Add hw capability check for elf

2022-02-01 Thread Guo Ren
On Tue, Feb 1, 2022 at 11:07 PM wrote: > > From: Guo Ren > > Detect hardware COMPAT (32bit U-mode) capability in rv64. If not > support COMPAT mode in hw, compat_elf_check_arch would return > false by compat_binfmt_elf.c > > Signed-off-by: Guo Ren > Signed-off-by: G

Re: [PATCH V5 15/21] riscv: compat: Add hw capability check for elf

2022-02-02 Thread Guo Ren
detected\n"); > > + } > > I don't think we need these printks here. Okay > > Also this could be simplified to: > > compat_mode_supported = (csr_read(CSR_STATUS) & SR_UXL) == SR_UXL_32; Okay -- Best Regards Guo Ren ML: https://lore.kernel.org/linux-csky/

Re: [PATCH V5 00/21] riscv: compat: Add COMPAT mode support for rv64

2022-02-07 Thread Guo Ren
On Tue, Feb 1, 2022 at 11:06 PM wrote: > > From: Guo Ren > > Currently, most 64-bit architectures (x86, parisc, powerpc, arm64, > s390, mips, sparc) have supported COMPAT mode. But they all have > history issues and can't use standard linux unistd.h. RISC-V wo

Re: [PATCH 10/15] csky, hexagon: fix broken sys_sync_file_range

2024-06-23 Thread Guo Ren
/uapi/asm/unistd.h > @@ -6,6 +6,7 @@ > #define __ARCH_WANT_SYS_CLONE3 > #define __ARCH_WANT_SET_GET_RLIMIT > #define __ARCH_WANT_TIME32_SYSCALLS > +#define __ARCH_WANT_SYNC_FILE_RANGE2 For csky part. Acked-by: Guo Ren > #include > > #define __NR_set_thread_area (__NR_arch_speci

Re: [PATCH RFC v3 0/2] mm: Introduce ADDR_LIMIT_47BIT personality flag

2024-09-05 Thread Guo Ren
The flag can be checked inside of vm_unmapped_area() so > that this flag does not have to be handled individually by each > architecture. Acked-by: Guo Ren Sv57's pain finds its cure in this antidote. > > Link: > https://github.com/openjdk/jdk/blob/f080b4bb8a75284db1b6037f8c00ef3

Re: [PATCH RFC v3 1/2] mm: Add personality flag to limit address to 47 bits

2024-09-06 Thread Guo Ren
traint in arch_get_mmap_end() > > For some reason, it appears that the arch_get_mmap_end() > logic on RISC-V defaults to the maximum address > space for the 'addr==0' case which is inconsistentn with > the other architectures, so we should probably fix that > part first, possibly moving more of that logic into a > shared implementation. > > Arnd > -- Best Regards Guo Ren

Re: [PATCH V9 20/20] riscv: compat: Add COMPAT Kbuild skeletal support

2022-05-23 Thread Guo Ren
ector/Zfinx-related checks. Signed-off-by: Tsukasa OI Reviewed-by: Alistair Francis Message-Id: Signed-off-by: Alistair Francis On Mon, May 23, 2022 at 1:45 PM Guenter Roeck wrote: > > On Tue, Mar 22, 2022 at 10:40:03PM +0800, guo...@kernel.org wrote: > > From: Guo

Re: [PATCH V9 20/20] riscv: compat: Add COMPAT Kbuild skeletal support

2022-05-24 Thread Guo Ren
On Mon, May 23, 2022 at 1:45 PM Guenter Roeck wrote: > > On Tue, Mar 22, 2022 at 10:40:03PM +0800, guo...@kernel.org wrote: > > From: Guo Ren > > > > Adds initial skeletal COMPAT Kbuild (Running 32bit U-mode on > > 64bit S-mode) support. > > - Setup kco

Re: [PATCH V9 20/20] riscv: compat: Add COMPAT Kbuild skeletal support

2022-05-24 Thread Guo Ren
On Wed, May 25, 2022 at 1:42 AM Guo Ren wrote: > > On Mon, May 23, 2022 at 1:45 PM Guenter Roeck wrote: > > > > On Tue, Mar 22, 2022 at 10:40:03PM +0800, guo...@kernel.org wrote: > > > From: Guo Ren > > > > > > Adds initial skeletal COMPAT Kbuil

  1   2   >