Re: [RFC PATCH v1 7/7] powerpc/bpf: Implement extended BPF on PPC32

2020-12-16 Thread Alexei Starovoitov
On Wed, Dec 16, 2020 at 10:07:37AM +, Christophe Leroy wrote: > Implement Extended Berkeley Packet Filter on Powerpc 32 > > Test result with test_bpf module: > > test_bpf: Summary: 378 PASSED, 0 FAILED, [354/366 JIT'ed] nice! > Registers mapping: > > [BPF_REG_0] = r11-r12 >

Re: [PATCH v2 1/2] KVM: PPC: Book3S HV: Add support for H_RPT_INVALIDATE

2020-12-16 Thread David Gibson
On Wed, Dec 16, 2020 at 02:24:46PM +0530, Bharata B Rao wrote: > Implement H_RPT_INVALIDATE hcall and add KVM capability > KVM_CAP_PPC_RPT_INVALIDATE to indicate the support for the same. > > This hcall does two types of TLB invalidations: > > 1. Process-scoped invalidations for guests with

Re: [PATCH v2 0/2] Support for H_RPT_INVALIDATE in PowerPC KVM

2020-12-16 Thread David Gibson
On Wed, Dec 16, 2020 at 02:24:45PM +0530, Bharata B Rao wrote: > This patchset adds support for the new hcall H_RPT_INVALIDATE > and replaces the nested tlb flush calls with this new hcall > if support for the same exists. > > Changes in v2: > - > - Not enabling the hcall by default

powerpc VDSO files being unnecessarily rebuilt

2020-12-16 Thread Michael Ellerman
Hi all, Since the merge of the C VDSO I see we are repeatedly rebuilding some files in the VDSO, eg: $ make V=2 make[1]: Entering directory '/home/michael/linux/build~' GEN Makefile CALL/home/michael/linux/scripts/checksyscalls.sh - due to target missing CALL

[PATCH] powerpc/64s/kuap: Use mmu_has_feature()

2020-12-16 Thread Michael Ellerman
In commit 8150a153c013 ("powerpc/64s: Use early_mmu_has_feature() in set_kuap()") we switched the KUAP code to use early_mmu_has_feature(), to avoid a bug where we called set_kuap() before feature patching had been done, leading to recursion and crashes. That path, which called

Re: linux-next: manual merge of the akpm-current tree with the powerpc tree

2020-12-16 Thread Stephen Rothwell
Hi all, On Tue, 8 Dec 2020 20:40:16 +1100 Stephen Rothwell wrote: > > Today's linux-next merge of the akpm-current tree got conflicts in: > > drivers/misc/lkdtm/Makefile > drivers/misc/lkdtm/lkdtm.h > tools/testing/selftests/lkdtm/tests.txt > > between commit: > > 3ba150fb2120

Re: [PATCH] arch: fix 'unexpected IRQ trap at vector' warnings

2020-12-16 Thread Enrico Weigelt, metux IT consult
On 15.12.20 23:12, Thomas Gleixner wrote: > On Tue, Dec 15 2020 at 21:12, Enrico Weigelt wrote: >> On 09.12.20 00:01, Thomas Gleixner wrote: >>> 3) It's invoked from __handle_domain_irq() when the 'hwirq' which is >>> handed in by the caller does not resolve to a mapped Linux >>>

[PATCH -next] pci/controller/dwc: convert comma to semicolon

2020-12-16 Thread Zheng Yongjun
Replace a comma between expression statements by a semicolon. Signed-off-by: Zheng Yongjun --- drivers/pci/controller/dwc/pci-layerscape-ep.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/pci/controller/dwc/pci-layerscape-ep.c

[PATCH -next] soc: fsl: qbman: Delete useless kfree code

2020-12-16 Thread Zheng Yongjun
The parameter of kfree function is NULL, so kfree code is useless, delete it. Signed-off-by: Zheng Yongjun --- drivers/soc/fsl/qbman/bman.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/soc/fsl/qbman/bman.c b/drivers/soc/fsl/qbman/bman.c index c5dd026fe889..6cc1847e534a 100644 ---

[powerpc:next-test 146/304] arch/powerpc/mm/book3s64/pkeys.c:284:20: error: unused function 'update_current_thread_amr'

2020-12-16 Thread kernel test robot
-20201216 (attached as .config) compiler: clang version 12.0.0 (https://github.com/llvm/llvm-project 71601d2ac9954cb59c443cb3ae442cb106df35d4) reproduce (this is a W=1 build): wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x

[RFC PATCH v1 3/7] powerpc/bpf: Move common helpers into bpf_jit.h

2020-12-16 Thread Christophe Leroy
Move functions bpf_flush_icache(), bpf_is_seen_register() and bpf_set_seen_register() in order to reuse them in future bpf_jit_comp32.c Signed-off-by: Christophe Leroy --- arch/powerpc/net/bpf_jit.h| 35 +++ arch/powerpc/net/bpf_jit64.h | 19

[RFC PATCH v1 0/7] Implement EBPF on powerpc32

2020-12-16 Thread Christophe Leroy
This series implements extended BPF on powerpc32. For the implementation details, see the last patch. Below are the results on a powerpc 885 at 132 MHz: - with the patch, with and without bpf_jit_enable - without the patch, with bpf_jit_enable (ie with CBPF) With the patch, with bpf_jit_enable =

[RFC PATCH v1 1/7] powerpc/bpf: Remove classical BPF support for PPC32

2020-12-16 Thread Christophe Leroy
At the time being, PPC32 has Classical BPF support. The test_bpf module exhibits some failure: test_bpf: #298 LD_IND byte frag jited:1 ret 202 != 66 FAIL (1 times) test_bpf: #299 LD_IND halfword frag jited:1 ret 51958 != 17220 FAIL (1 times) test_bpf: #301 LD_IND

[PATCH] powerpc/44x: fix spelling mistake in Kconfig "varients" -> "variants"

2020-12-16 Thread Colin King
From: Colin Ian King There is a spelling mistake in the Kconfig help text. Fix it. Signed-off-by: Colin Ian King --- arch/powerpc/platforms/44x/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/powerpc/platforms/44x/Kconfig b/arch/powerpc/platforms/44x/Kconfig

[PATCH v3 1/4] KVM: PPC: Allow nested guest creation when L0 hv_guest_state > L1

2020-12-16 Thread Ravi Bangoria
On powerpc, L1 hypervisor takes help of L0 using H_ENTER_NESTED hcall to load L2 guest state in cpu. L1 hypervisor prepares the L2 state in struct hv_guest_state and passes a pointer to it via hcall. Using that pointer, L0 reads/writes that state directly from/to L1 memory. Thus L0 must be aware

[PATCH v3 4/4] KVM: PPC: Introduce new capability for 2nd DAWR

2020-12-16 Thread Ravi Bangoria
Introduce KVM_CAP_PPC_DAWR1 which can be used by Qemu to query whether kvm supports 2nd DAWR or not. The capability is by default disabled even when the underlying CPU supports 2nd DAWR. Qemu needs to check and enable it manually to use the feature. Signed-off-by: Ravi Bangoria ---

[PATCH v3 0/4] KVM: PPC: Power10 2nd DAWR enablement

2020-12-16 Thread Ravi Bangoria
Enable p10 2nd DAWR feature for Book3S kvm guest. DAWR is a hypervisor resource and thus H_SET_MODE hcall is used to set/unset it. A new case H_SET_MODE_RESOURCE_SET_DAWR1 is introduced in H_SET_MODE hcall for setting/unsetting 2nd DAWR. Also, new capability KVM_CAP_PPC_DAWR1 has been added to

[PATCH v3 2/4] KVM: PPC: Rename current DAWR macros and variables

2020-12-16 Thread Ravi Bangoria
Power10 is introducing second DAWR. Use real register names (with suffix 0) from ISA for current macros and variables used by kvm. One exception is KVM_REG_PPC_DAWR. Keep it as it is because it's uapi so changing it will break userspace. Signed-off-by: Ravi Bangoria ---

[PATCH v3 3/4] KVM: PPC: Add infrastructure to support 2nd DAWR

2020-12-16 Thread Ravi Bangoria
kvm code assumes single DAWR everywhere. Add code to support 2nd DAWR. DAWR is a hypervisor resource and thus H_SET_MODE hcall is used to set/ unset it. Introduce new case H_SET_MODE_RESOURCE_SET_DAWR1 for 2nd DAWR. Also, kvm will support 2nd DAWR only if CPU_FTR_DAWR1 is set. Signed-off-by: Ravi

Re: [PATCH v3 04/19] powerpc/perf: move perf irq/nmi handling details into traps.c

2020-12-16 Thread Athira Rajeev
On 28-Nov-2020, at 8:10 PM, Nicholas Piggin wrote:This is required in order to allow more significant differences betweenNMI type interrupt handlers and regular asynchronous handlers.Signed-off-by: Nicholas Piggin Reviewed this patch and the changes looks good to me.Reviewed-by: Athira Rajeev

[RFC PATCH v1 7/7] powerpc/bpf: Implement extended BPF on PPC32

2020-12-16 Thread Christophe Leroy
Implement Extended Berkeley Packet Filter on Powerpc 32 Test result with test_bpf module: test_bpf: Summary: 378 PASSED, 0 FAILED, [354/366 JIT'ed] Registers mapping: [BPF_REG_0] = r11-r12 /* function arguments */ [BPF_REG_1] = r3-r4 [BPF_REG_2] = r5-r6

[RFC PATCH v1 5/7] powerpc/bpf: Change values of SEEN_ flags

2020-12-16 Thread Christophe Leroy
Because PPC32 will use more non volatile registers, move SEEN_ flags to positions 0-2 which corresponds to special registers. Signed-off-by: Christophe Leroy --- arch/powerpc/net/bpf_jit.h | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/arch/powerpc/net/bpf_jit.h

[RFC PATCH v1 6/7] powerpc/asm: Add some opcodes in asm/ppc-opcode.h for PPC32 eBPF

2020-12-16 Thread Christophe Leroy
The following opcodes will be needed for the implementation of eBPF for PPC32. Add them in asm/ppc-opcode.h PPC_RAW_ADDE PPC_RAW_ADDZE PPC_RAW_ADDME PPC_RAW_MFLR PPC_RAW_ADDIC PPC_RAW_ADDIC_DOT PPC_RAW_SUBFC PPC_RAW_SUBFE PPC_RAW_SUBFIC PPC_RAW_SUBFZE PPC_RAW_ANDIS PPC_RAW_NOR Signed-off-by:

[RFC PATCH v1 2/7] powerpc/bpf: Change register numbering for bpf_set/is_seen_register()

2020-12-16 Thread Christophe Leroy
Instead of using BPF register number as input in functions bpf_set_seen_register() and bpf_is_seen_register(), use CPU register number directly. Signed-off-by: Christophe Leroy --- arch/powerpc/net/bpf_jit_comp64.c | 16 1 file changed, 8 insertions(+), 8 deletions(-) diff

[RFC PATCH v1 4/7] powerpc/bpf: Move common functions into bpf_jit_comp.c

2020-12-16 Thread Christophe Leroy
Move into bpf_jit_comp.c the functions that will remain common to PPC64 and PPC32 when we add support of EBPF for PPC32. Signed-off-by: Christophe Leroy --- arch/powerpc/net/Makefile | 2 +- arch/powerpc/net/bpf_jit.h| 6 + arch/powerpc/net/bpf_jit_comp.c | 269

[PATCH v2 0/2] Support for H_RPT_INVALIDATE in PowerPC KVM

2020-12-16 Thread Bharata B Rao
This patchset adds support for the new hcall H_RPT_INVALIDATE and replaces the nested tlb flush calls with this new hcall if support for the same exists. Changes in v2: - - Not enabling the hcall by default now, userspace can enable it when required. - Added implementation for

[PATCH v2 2/2] KVM: PPC: Book3S HV: Use H_RPT_INVALIDATE in nested KVM

2020-12-16 Thread Bharata B Rao
In the nested KVM case, replace H_TLB_INVALIDATE by the new hcall H_RPT_INVALIDATE if available. The availability of this hcall is determined from "hcall-rpt-invalidate" string in ibm,hypertas-functions DT property. Signed-off-by: Bharata B Rao --- arch/powerpc/kvm/book3s_64_mmu_radix.c | 27

[PATCH v2 1/2] KVM: PPC: Book3S HV: Add support for H_RPT_INVALIDATE

2020-12-16 Thread Bharata B Rao
Implement H_RPT_INVALIDATE hcall and add KVM capability KVM_CAP_PPC_RPT_INVALIDATE to indicate the support for the same. This hcall does two types of TLB invalidations: 1. Process-scoped invalidations for guests with LPCR[GTSE]=0. This is currently not used in KVM as GTSE is not usually