[PATCH] powerpc: Use the newly added is_tsk_32bit_task() macro

2022-01-20 Thread Christophe Leroy
Two places deserve using the macro is_tsk_32bit_task() added by commit 252745240ba0 ("powerpc/audit: Fix syscall_get_arch()") Signed-off-by: Christophe Leroy --- arch/powerpc/kernel/ptrace/ptrace-view.c | 2 +- arch/powerpc/perf/perf_regs.c| 8 +++- 2 files changed, 4

Re: [PATCH v7 3/7] powerpc/pmem: Add flush routines using new pmem store and sync instruction

2022-01-20 Thread Christophe Leroy
Le 01/07/2020 à 09:22, Aneesh Kumar K.V a écrit : Start using dcbstps; phwsync; sequence for flushing persistent memory range. The new instructions are implemented as a variant of dcbf and hwsync and on P8 and P9 they will be executed as those instructions. We avoid using them on older hardware.

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_regs' size > > is different from rv64's, so

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

2022-01-20 Thread Guo Ren
On Thu, Jan 20, 2022 at 5:35 PM Arnd Bergmann wrote: > > On Thu, Jan 20, 2022 at 8:38 AM wrote: > > > @@ -0,0 +1,136 @@ > > +/* SPDX-License-Identifier: GPL-2.0-only */ > > +#ifndef __ASM_COMPAT_H > > +#define __ASM_COMPAT_H > > + > > +#define compat_mode_t compat_mode_t > > +typedef u16

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. > > > > Signed-off-by: Guo Ren > > --- > > virt/kvm/Kconfig |

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

2022-01-20 Thread Guo Ren
On Thu, Jan 20, 2022 at 10:43 PM Arnd Bergmann wrote: > > On Thu, Jan 20, 2022 at 8:39 AM wrote: > > > > /* The array of function pointers for syscalls. */ > > extern void * const sys_call_table[]; > > +#ifdef CONFIG_COMPAT > > +extern void * const compat_sys_call_table[]; > > +#endif > > No

[PATCH 2/2] KVM: selftests: Add support for ppc64le

2022-01-20 Thread Fabiano Rosas
This adds the infrastructure for writing tests for the powerpc platform (Only Radix MMU for now). This patch also enables two tests: - a dummy sample test that creates a guest with one vcpu, issues hypercalls and reads/writes test values from memory. - the kvm_page_table test, although at

[PATCH 0/2] KVM: selftests: Add powerpc support

2022-01-20 Thread Fabiano Rosas
This series adds the initial support for ppc64le Book3s with Radix MMU. At this time I'm including only the kvm_page_table test and a dummy test to serve as a sample of what can be done with these tests. I intend to make a pass over the remaining common tests and add the ones which could be built

[PATCH 1/2] KVM: PPC: Book3S HV: Stop returning internal values to userspace

2022-01-20 Thread Fabiano Rosas
Our kvm_arch_vcpu_ioctl_run currently returns the RESUME_HOST values to userspace, against the API of the KVM_RUN ioctl which returns 0 on success. Signed-off-by: Fabiano Rosas Reviewed-by: Nicholas Piggin --- This was noticed while enabling the kvm selftests for powerpc. There's an assert at

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

2022-01-20 Thread David Laight
... > One example of software that runs into virtual memory size limitations is > the gnu linker when building large applications, but it's unlikely that you'll > actually need to run applications that run into this, while also needing to > build them natively. There are also database programs

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

2022-01-20 Thread Arnd Bergmann
On Thu, Jan 20, 2022 at 2:27 PM Guo Ren wrote: > On Thu, Jan 20, 2022 at 8:53 PM David Laight wrote: > > I think the x86-64 32bit compat code even puts the boundary at 4GB. > Yes, we could give rv32 compat for 4GB with some effort. But it's unnecessary. > > There are no history issues for rv32,

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

2022-01-20 Thread Arnd Bergmann
On Thu, Jan 20, 2022 at 8:39 AM wrote: > > /* The array of function pointers for syscalls. */ > extern void * const sys_call_table[]; > +#ifdef CONFIG_COMPAT > +extern void * const compat_sys_call_table[]; > +#endif No need for the #ifdef, the normal convention is to just define the extern

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

2022-01-20 Thread Guo Ren
On Thu, Jan 20, 2022 at 9:39 PM Arnd Bergmann wrote: > > On Thu, Jan 20, 2022 at 8:39 AM wrote: > > + > > +#ifdef CONFIG_COMPAT > > + if (is_compat_task()) > > + regs->status |= SR_UXL_32; > > +#endif > > > You should not need that #ifdef, as the is_compat_task() definition

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-by: Guo Ren > > Reviewed-by: Arnd Bergmann > > > + > > +/* > > +

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

2022-01-20 Thread Guo Ren
On Thu, Jan 20, 2022 at 8:53 PM David Laight wrote: > > > > Limit 32-bit compatible process in 0-2GB virtual address range > > > (which is enough for real scenarios), because it could avoid > > > address sign extend problem when 32-bit enter 64-bit and ease > > > software design. > > Eh? > I

Re: bug: usb: gadget: FSL_UDC_CORE Corrupted request list leads to unrecoverable loop.

2022-01-20 Thread Thorsten Leemhuis
Hi, this is your Linux kernel regression tracker speaking. On 04.12.21 01:40, Leo Li wrote: >> -Original Message- >> From: Joakim Tjernlund >> Sent: Thursday, December 2, 2021 4:45 PM >> To: regressi...@leemhuis.info; Leo Li ; >> eugene_bordenkirc...@selinc.com;

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

2022-01-20 Thread David Laight
From: Arnd Bergmann > Sent: 20 January 2022 11:52 .. > As with compat_flock, the packed attribute has no impact on the layout > here, but please drop it anyway for consistency. Never mind the structure layout, because 'packed' allows the structure to be aligned on any boundary it forces the

Re: [BUG] mtd: cfi_cmdset_0002: write regression since v4.17-rc1

2022-01-20 Thread Thorsten Leemhuis
Hi, this is your Linux kernel regression tracker speaking. On 15.12.21 18:34, Tokunori Ikegami wrote: > Hi Ahmad-san, > > Sorry for the regression issue by the change: dfeae1073583. > To make sure could you please try with the word write instead of the > buffered writes? Ahmad, did you try what

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

2022-01-20 Thread David Laight
> > Limit 32-bit compatible process in 0-2GB virtual address range > > (which is enough for real scenarios), because it could avoid > > address sign extend problem when 32-bit enter 64-bit and ease > > software design. Eh? I thought nearly all the other 32bit unix ports (of any flavour) put the

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

2022-01-20 Thread Arnd Bergmann
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 are duplicate: > - COMPAT_USER_HZ > - COMPAT_RLIM_INFINITY > - COMPAT_OFF_T_MAX > - __compat_uid_t, __compat_uid_t >

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

2022-01-20 Thread Arnd Bergmann
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_regs' size > is different from rv64's, so we needs convert them. > > Signed-off-by: Guo Ren > Signed-off-by:

[PATCH v5] powerpc/mce: Avoid using irq_work_queue() in realmode

2022-01-20 Thread Ganesh Goudar
In realmode mce handler we use irq_work_queue() to defer the processing of mce events, irq_work_queue() can only be called when translation is enabled because it touches memory outside RMA, hence we enable translation before calling irq_work_queue and disable on return, though it is not safe to do

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

2022-01-20 Thread Arnd Bergmann
On Thu, Jan 20, 2022 at 8:39 AM wrote: > > From: Guo Ren > > Adds initial skeletal COMPAT Kbuild (Runing 32bit U-mode on 64bit > S-mode) support. > - Setup kconfig & dummy functions for compiling. > - Implement compat_start_thread by the way. > > Signed-off-by: Guo Ren > Signed-off-by: Guo

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

2022-01-20 Thread Arnd Bergmann
On Thu, Jan 20, 2022 at 8:39 AM 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 in 0-2GB virtual address range > (which is enough for real

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

2022-01-20 Thread Arnd Bergmann
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. > > Signed-off-by: Guo Ren > --- > virt/kvm/Kconfig | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git

Re: [PATCH] powerpc/fixmap: Fix VM debug warning on unmap

2022-01-20 Thread Christophe Leroy
Hi Michael, ping ? Le 06/12/2021 à 12:11, Christophe Leroy a écrit : > Unmapping a fixmap entry is done by calling __set_fixmap() > with FIXMAP_PAGE_CLEAR as flags. > > Today, powerpc __set_fixmap() calls map_kernel_page(). > > map_kernel_page() is not happy when called a second time > for the

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

2022-01-20 Thread Arnd Bergmann
On Thu, Jan 20, 2022 at 8:39 AM wrote: > + > +#ifdef CONFIG_COMPAT > + if (is_compat_task()) > + regs->status |= SR_UXL_32; > +#endif You should not need that #ifdef, as the is_compat_task() definition is meant to drop the code at compile time, unless the SR_UXL_32

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

2022-01-20 Thread Arnd Bergmann
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-by: Guo Ren Reviewed-by: Arnd Bergmann > + > +/* > + * FIXME: not sure SET_PERSONALITY for compat process is right! > + */ >

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

2022-01-20 Thread Arnd Bergmann
On Thu, Jan 20, 2022 at 8:38 AM wrote: > @@ -0,0 +1,136 @@ > +/* SPDX-License-Identifier: GPL-2.0-only */ > +#ifndef __ASM_COMPAT_H > +#define __ASM_COMPAT_H > + > +#define compat_mode_t compat_mode_t > +typedef u16compat_mode_t; I think this one is wrong, as rv32 should get the

Re: [PATCH V3 04/17] syscalls: compat: Fix the missing part for __SYSCALL_COMPAT

2022-01-20 Thread Arnd Bergmann
On Thu, Jan 20, 2022 at 8:38 AM wrote: > > From: Guo Ren > > Make "uapi asm unistd.h" could be used for architectures' COMPAT > mode. The __SYSCALL_COMPAT is first used in riscv. > > Signed-off-by: Guo Ren > Signed-off-by: Guo Ren > Cc: Arnd Bergmann Reviewed-by: Arnd Bergmann

Fix for PowerPC kernel with new assembler behavior?

2022-01-20 Thread John Paul Adrian Glaubitz
Hi! Since this change in [1], the kernel no longer builds on 32- and 64-bit PowerPC and I was wondering whether anyone has already a patch available fixing this issue? Thanks, Adrian > [1] > https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=b25f942e18d6ecd7ec3e2d2e9930eb4f996c258a --