Re: code conditional on non-existing PPC_EARLY_DEBUG_MICROWATT.

2021-12-23 Thread Christophe Leroy
Le 23/12/2021 à 11:21, Lukas Bulwahn a écrit : > Dear Benjamin, dear Paul, dear Michael, > > with commit 48b545b8018d ("powerpc/microwatt: Use standard 16550 UART > for console"), you have some code in arch/powerpc/kernel/udbg_16550.c, > conditional on the Kconfig symbol PPC_EARLY_DEBUG_MICROWAT

Re: [PATCH] Revert "mm/usercopy: Drop extra is_vmalloc_or_module() check"

2021-12-23 Thread Christophe Leroy
Le 23/12/2021 à 11:21, Kefeng Wang a écrit : > This reverts commit 517e1fbeb65f5eade8d14f46ac365db6c75aea9b. > >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+0x6

[PATCH 2/3] KVM: PPC: Book3S HV: Delay setting of kvm ops

2021-12-23 Thread Fabiano Rosas
Delay the setting of kvm_hv_ops until after all init code has completed. This avoids leaving the ops still accessible if the init fails. Signed-off-by: Fabiano Rosas --- arch/powerpc/kvm/book3s_hv.c | 12 +++- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/arch/powerpc/kvm

[PATCH 1/3] KVM: PPC: Book3S HV: Check return value of kvmppc_radix_init

2021-12-23 Thread Fabiano Rosas
The return of the function is being shadowed by the call to kvmppc_uvmem_init. Fixes: ca9f4942670c ("KVM: PPC: Book3S HV: Support for running secure guests") Signed-off-by: Fabiano Rosas --- arch/powerpc/kvm/book3s_hv.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/arch

[PATCH 3/3] KVM: PPC: Book3S HV: Free allocated memory if module init fails

2021-12-23 Thread Fabiano Rosas
The module's exit function is not called when the init fails, we need to do cleanup before returning. Signed-off-by: Fabiano Rosas --- arch/powerpc/kvm/book3s_hv.c | 15 +++ 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/arch/powerpc/kvm/book3s_hv.c b/arch/powerpc/kvm

[PATCH 0/3] KVM: PPC: KVM module exit fixes

2021-12-23 Thread Fabiano Rosas
This is a resend the module cleanup fixes but this time without the HV/PR merge. Fabiano Rosas (1): KVM: PPC: Book3S HV: Check return value of kvmppc_radix_init KVM: PPC: Book3S HV: Delay setting of kvm ops KVM: PPC: Book3S HV: Free allocated memory if module init fails arch/powerpc/kvm/bo

[PATCH 3/3] KVM: PPC: Fix mmio length message

2021-12-23 Thread Fabiano Rosas
We check against 'bytes' but print 'run->mmio.len' which at that point has an old value. e.g. 16-byte load: before: __kvmppc_handle_load: bad MMIO length: 8 now: __kvmppc_handle_load: bad MMIO length: 16 Signed-off-by: Fabiano Rosas --- arch/powerpc/kvm/powerpc.c | 4 ++-- 1 file changed, 2 i

[PATCH 2/3] KVM: PPC: Fix vmx/vsx mixup in mmio emulation

2021-12-23 Thread Fabiano Rosas
The MMIO emulation code for vector instructions is duplicated between VSX and VMX. When emulating VMX we should check the VMX copy size instead of the VSX one. Fixes: acc9eb9305fe ("KVM: PPC: Reimplement LOAD_VMX/STORE_VMX instruction ...") Signed-off-by: Fabiano Rosas --- arch/powerpc/kvm/power

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

2021-12-23 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 --- This was noticed while enabling the kvm selftests for powerpc. There's an assert at the _vcpu_run function when we r

[PATCH 0/3] KVM: PPC: Minor fixes

2021-12-23 Thread Fabiano Rosas
Two fixes for MMIO emulation code that don't really affect anything. One fix for ioctl return code that is a prerequisite for the selftests enablement. Fabiano Rosas (3): KVM: PPC: Book3S HV: Stop returning internal values to userspace KVM: PPC: Fix vmx/vsx mixup in mmio emulation KVM: PPC:

Re: [PATCH v2 1/2] powerpc/set_memory: Avoid spinlock recursion in change_page_attr()

2021-12-23 Thread Christophe Leroy
Le 23/12/2021 à 13:09, Michael Ellerman a écrit : > Christophe Leroy writes: >> Commit 1f9ad21c3b38 ("powerpc/mm: Implement set_memory() routines") >> included a spin_lock() to change_page_attr() in order to >> safely perform the three step operations. But then >> commit 9f7853d7609d ("powerpc/m

[powerpc:next-test] BUILD SUCCESS 3f51a5add7bc61eddbd1049eb0fbd7ee95cd08ac

2021-12-23 Thread kernel test robot
arm64 defconfig i386 randconfig-c001-20211223 arm moxart_defconfig powerpc mpc834x_itxgp_defconfig sparc sparc64_defconfig powerpc wii_defconfig powerpc64

Re: [PATCH v2 1/2] powerpc/set_memory: Avoid spinlock recursion in change_page_attr()

2021-12-23 Thread Michael Ellerman
Christophe Leroy writes: > Commit 1f9ad21c3b38 ("powerpc/mm: Implement set_memory() routines") > included a spin_lock() to change_page_attr() in order to > safely perform the three step operations. But then > commit 9f7853d7609d ("powerpc/mm: Fix set_memory_*() against > concurrent accesses") modi

Re: [PATCH v2 00/20] powerpc: Define eligible functions as __init

2021-12-23 Thread Michael Ellerman
Christophe Leroy writes: > Le 16/12/2021 à 23:00, Nick Child a écrit : >> >> Changes in v2: >> - add `__init` in prototypes right before the funtion name instead of >> at the end. >> - respond to ./scripts/checkpatch feedback > > You probably missed the following comment from checkpatch:

code conditional on non-existing PPC_EARLY_DEBUG_MICROWATT.

2021-12-23 Thread Lukas Bulwahn
Dear Benjamin, dear Paul, dear Michael, with commit 48b545b8018d ("powerpc/microwatt: Use standard 16550 UART for console"), you have some code in arch/powerpc/kernel/udbg_16550.c, conditional on the Kconfig symbol PPC_EARLY_DEBUG_MICROWATT. However, since then, the definition of this Kconfig symb

Re: [PATCH/RFC] mm: add and use batched version of __tlb_remove_table()

2021-12-23 Thread Nikita Yushchenko
I currently don't have numbers for this patch taken alone. This patch originates from work done some years ago to reduce cost of memory accounting, and x86-only version of this patch was in virtuozzo/openvz kernel since then. Other patches from that work have been upstreamed, but this one was miss