Re: [5.16.0] build error on unrecognized opcode: ptesync

2022-01-10 Thread Christophe Leroy
Le 10/01/2022 à 13:32, Mike a écrit : > Hey, so I originally sat down to compile the fast headers V2 patch, but > quickly discovered other things at play, and grabbed 5.16.0 a few hours > after it lifted off,  arch/powerpc/mm/mmu_context.c I had to > specifically say had to include -maltivec

Re: [PATCH v2 1/2] powerpc: Fix virt_addr_valid() check

2022-01-10 Thread Christophe Leroy
Le 11/01/2022 à 05:37, Nicholas Piggin a écrit : > Excerpts from Kefeng Wang's message of January 8, 2022 9:58 pm: >> Hi PPC maintainers, ping.. > > Hmm. I might have confused myself about this. I'm going back and > trying to work out what I was thinking when I suggested it. This > works on 64e

Re: [PATCH v2 1/2] powerpc: Fix virt_addr_valid() check

2022-01-10 Thread Nicholas Piggin
Excerpts from Kefeng Wang's message of January 8, 2022 9:58 pm: > Hi PPC maintainers, ping.. Hmm. I might have confused myself about this. I'm going back and trying to work out what I was thinking when I suggested it. This works on 64e because vmalloc space is below the kernel linear map, right?

Re: [PATCH v3 5/6] KVM: PPC: mmio: Return to guest after emulation failure

2022-01-10 Thread Nicholas Piggin
Excerpts from Alexey Kardashevskiy's message of January 11, 2022 9:51 am: > > > On 1/10/22 18:36, Nicholas Piggin wrote: >> Excerpts from Fabiano Rosas's message of January 8, 2022 7:00 am: >>> If MMIO emulation fails we don't want to crash the whole guest by >>> returning to userspace. >>> >>>

Re: [PATCH] powerpc/time: Fix build failure due to do_hard_irq_enable() on PPC32

2022-01-10 Thread Nicholas Piggin
Excerpts from Christophe Leroy's message of January 11, 2022 1:29 am: > CC arch/powerpc/kernel/time.o > In file included from : > ./arch/powerpc/include/asm/hw_irq.h: In function 'do_hard_irq_enable': > ././include/linux/compiler_types.h:335:45: error: call to >

Re: [PATCH 3/6] KVM: Remove opaque from kvm_arch_check_processor_compat

2022-01-10 Thread Chao Gao
On Mon, Jan 10, 2022 at 11:06:44PM +, Sean Christopherson wrote: >On Mon, Dec 27, 2021, Chao Gao wrote: >> No arch implementation uses this opaque now. > >Except for the RISC-V part, this can be a pure revert of commit b99040853738 >("KVM: >Pass kvm_init()'s opaque param to additional arch

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: Guo Ren > > Signed-off-by: Guo Ren > > Cc: Arnd

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: Guo Ren > > Signed-off-by: Guo Ren > > Cc: Arnd

[PATCH kernel v5] KVM: PPC: Merge powerpc's debugfs entry content into generic entry

2022-01-10 Thread Alexey Kardashevskiy
At the moment KVM on PPC creates 4 types of entries under the kvm debugfs: 1) "%pid-%fd" per a KVM instance (for all platforms); 2) "vm%pid" (for PPC Book3s HV KVM); 3) "vm%u_vcpu%u_timing" (for PPC Book3e KVM); 4) "kvm-xive-%p" (for XIVE PPC Book3s KVM, the same for XICS); The problem with this

Re: [PATCH v3 5/6] KVM: PPC: mmio: Return to guest after emulation failure

2022-01-10 Thread Alexey Kardashevskiy
On 1/10/22 18:36, Nicholas Piggin wrote: Excerpts from Fabiano Rosas's message of January 8, 2022 7:00 am: If MMIO emulation fails we don't want to crash the whole guest by returning to userspace. The original commit bbf45ba57eae ("KVM: ppc: PowerPC 440 KVM implementation") added a todo:

[5.16.0] build error on unrecognized opcode: ptesync

2022-01-10 Thread Mike
Hey, so I originally sat down to compile the fast headers V2 patch, but quickly discovered other things at play, and grabbed 5.16.0 a few hours after it lifted off, arch/powerpc/mm/mmu_context.c I had to specifically say had to include -maltivec or it barfed on a 'dssall', I'm fine with that,

Re: [PATCH 00/16] Remove usage of the deprecated "pci-dma-compat.h" API

2022-01-10 Thread Martin K. Petersen
Christophe, > This serie axes all the remaining usages of the deprecated > "pci-dma-compat.h" API. Applied patches 10-15 to 5.17/scsi-staging, thanks! -- Martin K. Petersen Oracle Linux Engineering

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

2022-01-10 Thread Christoph Hellwig
On Mon, Jan 10, 2022 at 02:35:19PM +0100, Arnd Bergmann wrote: > > +#if !defined(CONFIG_64BIT) || defined(CONFIG_COMPAT) > > #ifndef F_GETLK64 > > #define F_GETLK64 12 /* using 'struct flock64' */ > > #define F_SETLK64 13 > > The problem here is that include/uapi/ headers

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

2022-01-10 Thread Christophe Leroy
Le 28/12/2021 à 15:39, guo...@kernel.org a écrit : > From: Guo Ren > > Remove duplicate F_GETLK64,F_SETLK64,F_SETLKW64 definitions in > arch/*/include/asm/compat.h. > > Signed-off-by: Guo Ren > Signed-off-by: Guo Ren > Cc: Arnd Bergmann > --- > arch/arm64/include/asm/compat.h | 4

[PATCH] powerpc/time: Fix build failure due to do_hard_irq_enable() on PPC32

2022-01-10 Thread Christophe Leroy
CC arch/powerpc/kernel/time.o In file included from : ./arch/powerpc/include/asm/hw_irq.h: In function 'do_hard_irq_enable': ././include/linux/compiler_types.h:335:45: error: call to '__compiletime_assert_35' declared with attribute error: BUILD_BUG failed

[PATCH v3] powerpc/32s: Fix kasan_init_region() for KASAN

2022-01-10 Thread Christophe Leroy
It has been reported some configuration where the kernel doesn't boot with KASAN enabled. This is due to wrong BAT allocation for the KASAN area: ---[ Data Block Address Translation ]--- 0: 0xc000-0xcfff 0x 256M Kernel rw m 1:

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

2022-01-10 Thread Arnd Bergmann
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: Guo Ren > Signed-off-by: Guo Ren > Cc: Arnd Bergmann This looks mostly correct, > +/* > + * FIXME: not sure SET_PERSONALITY

[PATCH v4 6/6] module: Move duplicate mod_check_sig users code to mod_parse_sig

2022-01-10 Thread Michal Suchanek
Multiple users of mod_check_sig check for the marker, then call mod_check_sig, extract signature length, and remove the signature. Put this code in one place together with mod_check_sig. This changes the error from ENOENT to ENODATA for ima_read_modsig in the case the signature marker is

[PATCH v4 5/6] module: Use key_being_used_for for log messages in verify_appended_signature

2022-01-10 Thread Michal Suchanek
Add value for kexec appended signature and pass in key_being_used_for enum rather than a string to verify_appended_signature to produce log messages about the signature. Signed-off-by: Michal Suchanek --- arch/powerpc/kexec/elf_64.c | 2 +- arch/s390/kernel/machine_kexec_file.c

[PATCH v4 4/6] module: strip the signature marker in the verification function.

2022-01-10 Thread Michal Suchanek
It is stripped by each caller separately. Note: this changes the error for kexec_file from EKEYREJECTED to ENODATA when the signature marker is missing. Signed-off-by: Michal Suchanek --- v3: - Philipp Rudo : Update the commit with note about change of raturn value - the

[PATCH v4 2/6] powerpc/kexec_file: Add KEXEC_SIG support.

2022-01-10 Thread Michal Suchanek
Copy the code from s390x Both powerpc and s390x use appended signature format (as opposed to EFI based patforms using PE format). Signed-off-by: Michal Suchanek --- v3: - Philipp Rudo : Update the comit message with explanation why the s390 code is usable on powerpc. - Include correct

[PATCH v4 3/6] kexec_file: Don't opencode appended signature verification.

2022-01-10 Thread Michal Suchanek
Module verification already implements appeded signature verification. Reuse it for kexec_file. Signed-off-by: Michal Suchanek --- v3: - Philipp Rudo : Update the dependency on MODULE_SIG_FORMAT to MODULE_SIG - Include linux/verification.h - previously added in earlier patch v4: -

[PATCH v4 1/6] s390/kexec_file: Don't opencode appended signature check.

2022-01-10 Thread Michal Suchanek
Module verification already implements appeded signature check. Reuse it for kexec_file. The kexec_file implementation uses EKEYREJECTED error in some cases when there is no key and the common implementation uses ENOPKG or EBADMSG instead. Signed-off-by: Michal Suchanek Acked-by: Heiko

[PATCH v4 0/6] KEXEC_SIG with appended signature

2022-01-10 Thread Michal Suchanek
Hello, This is a refresh of the KEXEC_SIG series. This adds KEXEC_SIG support on powerpc and deduplicates the code dealing with appended signatures in the kernel. powerpc supports IMA_KEXEC but that's an exception rather than the norm. On the other hand, KEXEC_SIG is portable across platforms.

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

2022-01-10 Thread Arnd Bergmann
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: Guo Ren > Signed-off-by: Guo Ren > Cc: Arnd Bergmann Unfortunately, this one does not look correct to me: > @@ -116,7

Re: [PATCH v5] powerpc/pseries: read the lpar name from the firmware

2022-01-10 Thread kernel test robot
Hi Laurent, Thank you for the patch! Perhaps something to improve: [auto build test WARNING on powerpc/next] [also build test WARNING on linux/master linus/master v5.16 next-20220110] [If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest

[PATCH] powerpc/bpf: Always reallocate BPF_REG_5, BPF_REG_AX and TMP_REG when possible

2022-01-10 Thread Christophe Leroy
BPF_REG_5, BPF_REG_AX and TMP_REG are mapped on non volatile registers because there are not enough volatile registers, but they don't need to be preserved on function calls. So when some volatile registers become available, those registers can always be reallocated regardless of whether

Re: [PATCH v2 8/8] powerpc/bpf: Reallocate BPF registers to volatile registers when possible on PPC32

2022-01-10 Thread Christophe Leroy
Le 07/01/2022 à 12:51, Naveen N. Rao a écrit : > Christophe Leroy wrote: >> When the BPF routine doesn't call any function, the non volatile >> registers can be reallocated to volatile registers in order to >> avoid having to save them/restore on the stack. >> >> Before this patch, the test #359

Re: [PATCH V2 02/17] fs: stat: compat: Add __ARCH_WANT_COMPAT_STAT

2022-01-10 Thread Arnd Bergmann
On Tue, Dec 28, 2021 at 3:39 PM wrote: > > From: Guo Ren > > RISC-V doesn't neeed compat_stat, so using __ARCH_WANT_COMPAT_STAT > to exclude unnecessary SYSCALL functions. > > Signed-off-by: Guo Ren > Signed-off-by: Guo Ren Reviewed-by: Arnd Bergmann

Re: [PATCH V2 01/17] kconfig: Add SYSVIPC_COMPAT for all architectures

2022-01-10 Thread Arnd Bergmann
On Tue, Dec 28, 2021 at 3:39 PM wrote: > > From: Guo Ren > > The existing per-arch definitions are pretty much historic cruft. > Move SYSVIPC_COMPAT into init/Kconfig. > > Signed-off-by: Guo Ren > Signed-off-by: Guo Ren > Cc: Arnd Bergmann > Cc: Christoph Hellwig Acked-by: Arnd Bergmann

Re: [PATCH 03/13] powerpc/bpf: Update ldimm64 instructions during extra pass

2022-01-10 Thread Naveen N. Rao
Christophe Leroy wrote: Le 06/01/2022 à 12:45, Naveen N. Rao a écrit : These instructions are updated after the initial JIT, so redo codegen during the extra pass. Rename bpf_jit_fixup_subprog_calls() to clarify that this is more than just subprog calls. Fixes: 69c087ba6225b5 ("bpf: Add

Re: [PATCH 02/13] powerpc32/bpf: Fix codegen for bpf-to-bpf calls

2022-01-10 Thread Naveen N. Rao
Christophe Leroy wrote: Le 06/01/2022 à 12:45, Naveen N. Rao a écrit : Pad instructions emitted for BPF_CALL so that the number of instructions generated does not change for different function addresses. This is especially important for calls to other bpf functions, whose address will only be

Re: [PATCH 01/13] bpf: Guard against accessing NULL pt_regs in bpf_get_task_stack()

2022-01-10 Thread Naveen N. Rao
Christophe Leroy wrote: Le 06/01/2022 à 12:45, Naveen N. Rao a écrit : task_pt_regs() can return NULL on powerpc for kernel threads. This is then used in __bpf_get_stack() to check for user mode, resulting in a kernel oops. Guard against this by checking return value of task_pt_regs() before

[PATCH] powerpc/security: Provide stubs for when PPC_BARRIER_NOSPEC isn't enabled

2022-01-10 Thread Naveen N. Rao
kernel test robot reported the below build error with a randconfig: powerpc64-linux-ld: arch/powerpc/net/bpf_jit_comp64.o:(.toc+0x0): undefined reference to `powerpc_security_features' This can happen if CONFIG_PPC_BARRIER_NOSPEC is not enabled. Address this by providing stub functions for

Re: [PATCH 03/13] powerpc/bpf: Update ldimm64 instructions during extra pass

2022-01-10 Thread Christophe Leroy
Le 06/01/2022 à 12:45, Naveen N. Rao a écrit : > These instructions are updated after the initial JIT, so redo codegen > during the extra pass. Rename bpf_jit_fixup_subprog_calls() to clarify > that this is more than just subprog calls. > > Fixes: 69c087ba6225b5 ("bpf: Add

Re: [PATCH 11/13] powerpc64/bpf elfv2: Setup kernel TOC in r2 on entry

2022-01-10 Thread Christophe Leroy
Le 06/01/2022 à 12:45, Naveen N. Rao a écrit : > In preparation for using kernel TOC, load the same in r2 on entry. With > elfv1, the kernel TOC is already setup by our caller so we just emit a > nop. We adjust the number of instructions to skip on a tail call > accordingly. > > Signed-off-by:

Re: [PATCH 02/13] powerpc32/bpf: Fix codegen for bpf-to-bpf calls

2022-01-10 Thread Christophe Leroy
Le 06/01/2022 à 12:45, Naveen N. Rao a écrit : > Pad instructions emitted for BPF_CALL so that the number of instructions > generated does not change for different function addresses. This is > especially important for calls to other bpf functions, whose address > will only be known during extra

Re: [PATCH 01/13] bpf: Guard against accessing NULL pt_regs in bpf_get_task_stack()

2022-01-10 Thread Christophe Leroy
Le 06/01/2022 à 12:45, Naveen N. Rao a écrit : > task_pt_regs() can return NULL on powerpc for kernel threads. This is > then used in __bpf_get_stack() to check for user mode, resulting in a > kernel oops. Guard against this by checking return value of > task_pt_regs() before trying to obtain

Re: [PATCH 02/16] floppy: Remove usage of the deprecated "pci-dma-compat.h" API

2022-01-10 Thread Christoph Hellwig
Looks good, Reviewed-by: Christoph Hellwig

Re: [PATCH 06/23] powerpc/membarrier: Remove special barrier on mm switch

2022-01-10 Thread Christophe Leroy
Le 08/01/2022 à 17:43, Andy Lutomirski a écrit : > powerpc did the following on some, but not all, paths through > switch_mm_irqs_off(): > > /* > * Only need the full barrier when switching between processes. > * Barrier when switching from kernel to userspace is not >

Re: [PATCH] fs: btrfs: Disable BTRFS on platforms having 256K pages

2022-01-10 Thread Christophe Leroy
Hi Qu, Le 05/01/2022 à 00:32, Qu Wenruo a écrit : > Hi Christophe, > > I'm recently enhancing the subpage support for btrfs, and my current > branch should solve the problem for btrfs to support larger page sizes. > > But unfortunately my current test environment can only provide page size >

Re: [PATCH v7 1/3] riscv: Introduce CONFIG_RELOCATABLE

2022-01-10 Thread Alexandre ghiti
Hi Palmer, Do you think this could go in for-next? Thanks, Alex On 12/6/21 10:44, Alexandre ghiti wrote: @Palmer, can I do anything for that to be pulled in 5.17? Thanks, Alex On 10/27/21 07:04, Alexandre ghiti wrote: Hi Palmer, On 10/26/21 11:29 PM, Palmer Dabbelt wrote: On Sat, 09

Re: [PATCH v2 1/2] powerpc: Fix virt_addr_valid() check

2022-01-10 Thread Christophe Leroy
Le 25/12/2021 à 13:06, Kefeng Wang a écrit : > When run ethtool eth0, the BUG occurred, > >usercopy: Kernel memory exposure attempt detected from SLUB object not in > SLUB page?! (offset 0, size 1048)! >kernel BUG at mm/usercopy.c:99 >... >usercopy_abort+0x64/0xa0 (unreliable)