Re: [PATCH] powerpc/ftrace: Handle large kernel configs

2022-01-06 Thread Naveen N. Rao
Hi Christophe, Sorry for the delay, catching up with some of the earlier emails now.. Christophe Leroy wrote: Hi Naveen, Le 16/10/2018 à 22:25, Naveen N. Rao a écrit : ... +/* + * If this is a compiler generated long_branch trampoline (essentially, a + * trampoline that has a branch to

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

2022-01-06 Thread Michael Ellerman
Qu Wenruo writes: > On 2022/1/7 00:31, Neal Gompa wrote: >> On Wed, Jan 5, 2022 at 7:05 AM Qu Wenruo wrote: >>> >>> 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

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

2022-01-06 Thread Hector Martin
On 2022/01/07 9:13, Qu Wenruo wrote: > > > On 2022/1/7 00:31, Neal Gompa wrote: >> On Wed, Jan 5, 2022 at 7:05 AM Qu Wenruo wrote: >>> >>> Hi Christophe, >>> >>> I'm recently enhancing the subpage support for btrfs, and my current >>> branch should solve the problem for btrfs to support larger

[powerpc:merge] BUILD SUCCESS 80fdcf45da5a677ff7f284210b0f86f443a836a0

2022-01-06 Thread kernel test robot
viper_defconfig arm sunxi_defconfig arm randconfig-c002-20220106 ia64 allmodconfig ia64defconfig ia64 allyesconfig m68k

Re: [PATCH 2/2] soc: fsl: guts: Add a missing memory allocation failure check

2022-01-06 Thread Li Yang
On Thu, Nov 4, 2021 at 4:10 AM Christophe JAILLET wrote: > > If 'devm_kstrdup()' fails, we should return -ENOMEM. > > While at it, move the 'of_node_put()' call in the error handling path and > after the 'machine' has been copied. > Better safe than sorry. > > Suggested-by: Tyrel Datwyler >

Re: [PATCH 1/2] soc: fsl: guts: Revert commit 3c0d64e867ed

2022-01-06 Thread Li Yang
On Thu, Nov 4, 2021 at 4:09 AM Christophe JAILLET wrote: > > This reverts commit 3c0d64e867ed > ("soc: fsl: guts: reuse machine name from device tree"). > > A following patch will fix the missing memory allocation failure check > instead. > > Suggested-by: Tyrel Datwyler > Signed-off-by:

[powerpc:next] BUILD SUCCESS f1aa0e47c29268776205698f2453dc07fab49855

2022-01-06 Thread kernel test robot
defconfig i386 randconfig-c001-20220106 s390 zfcpdump_defconfig arm eseries_pxa_defconfig powerpcadder875_defconfig shsh7785lcr_defconfig powerpcklondike_defconfig m68k

Re: [PATCH] soc: fsl: qe: fix typo in a comment

2022-01-06 Thread Li Yang
On Sat, Dec 11, 2021 at 5:12 PM Jason Wang wrote: > > The double `is' in the comment in line 150 is repeated. Remove one > of them from the comment. Looks like you also removed a redundant tab in a new line. We probably can squeeze this trivial cleanup in, but we need to mention it. > >

Re: [PATCH] soc: fsl: qe: Check of ioremap return value

2022-01-06 Thread Li Yang
On Thu, Dec 30, 2021 at 9:47 AM Jiasheng Jiang wrote: > > As the possible failure of the ioremap(), the par_io could be NULL. > Therefore it should be better to check it and return error in order to > guarantee the success of the initiation. > But, I also notice that all the caller like

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

2022-01-06 Thread Alexey Kardashevskiy
On 07/01/2022 07:03, Fabiano Rosas wrote: 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: /* XXX Deliver Program interrupt to guest. */ and later the

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

2022-01-06 Thread Alexey Kardashevskiy
On 07/01/2022 07:03, Fabiano Rosas wrote: 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 ---

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

2022-01-06 Thread Qu Wenruo
On 2022/1/7 00:31, Neal Gompa wrote: On Wed, Jan 5, 2022 at 7:05 AM Qu Wenruo wrote: 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

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

2022-01-06 Thread Michael Ellerman
Laurent Dufour writes: > Happy New Year, Michael! > > Do you consider taking that patch soon? I did but I was hoping you and Nathan could come to an agreement. Looks like you did while I was sleeping, perfect :) I'll pick up v5. cheers > On 07/12/2021, 18:11:09, Laurent Dufour wrote: >> The

Re: [5.16.0-rc5][ppc][net] kernel oops when hotplug remove of vNIC interface

2022-01-06 Thread Sukadev Bhattiprolu
Michael Ellerman [m...@ellerman.id.au] wrote: > Jakub Kicinski writes: > > On Wed, 5 Jan 2022 13:56:53 +0530 Abdul Haleem wrote: > >> Greeting's > >> > >> Mainline kernel 5.16.0-rc5 panics when DLPAR ADD of vNIC device on my > >> Powerpc LPAR > >> > >> Perform below dlpar commands in a loop

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

2022-01-06 Thread Neal Gompa
On Wed, Jan 5, 2022 at 7:05 AM Qu Wenruo wrote: > > 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 > with

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

2022-01-06 Thread Nathan Lynch
Laurent Dufour writes: > The LPAR name may be changed after the LPAR has been started in the HMC. > In that case lparstat command is not reporting the updated value because it > reads it from the device tree which is read at boot time. > > However this value could be read from RTAS. > > Adding

Re: [PATCH V2 1/2] tools/perf: Include global and local variants for p_stage_cyc sort key

2022-01-06 Thread Arnaldo Carvalho de Melo
Em Thu, Jan 06, 2022 at 04:21:05PM +0530, Athira Rajeev escreveu: > > > > On 08-Dec-2021, at 9:21 AM, Nageswara Sastry wrote: > > > > > > > > On 07/12/21 8:22 pm, Arnaldo Carvalho de Melo wrote: > >> Em Fri, Dec 03, 2021 at 07:50:37AM +0530, Athira Rajeev escreveu: > >>> Sort key p_stage_cyc

[PATCH v2 7/7] KVM: PPC: mmio: Reject instructions that access more than mmio.data size

2022-01-06 Thread Fabiano Rosas
The MMIO interface between the kernel and userspace uses a structure that supports a maximum of 8-bytes of data. Instructions that access more than that need to be emulated in parts. We currently don't have generic support for splitting the emulation in parts and each set of instructions needs to

[PATCH v2 6/7] KVM: PPC: mmio: Return to guest after emulation failure

2022-01-06 Thread Fabiano Rosas
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: /* XXX Deliver Program interrupt to guest. */ and later the commit d69614a295ae ("KVM: PPC: Separate loadstore

[PATCH v2 5/7] KVM: PPC: mmio: Queue interrupt at kvmppc_emulate_mmio

2022-01-06 Thread Fabiano Rosas
If MMIO emulation fails, we queue a Program interrupt to the guest. Move that line up into kvmppc_emulate_mmio, which is where we set RESUME_GUEST/HOST. No functional change, just separation of responsibilities. Signed-off-by: Fabiano Rosas --- arch/powerpc/kvm/emulate_loadstore.c | 4 +---

[PATCH v2 4/7] KVM: PPC: Don't use pr_emerg when mmio emulation fails

2022-01-06 Thread Fabiano Rosas
If MMIO emulation fails we deliver a Program interrupt to the guest. This is a normal event for the host, so use pr_info. Signed-off-by: Fabiano Rosas --- arch/powerpc/kvm/powerpc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/powerpc/kvm/powerpc.c

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

2022-01-06 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

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

2022-01-06 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 Reviewed-by: Nicholas

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

2022-01-06 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

[PATCH v2 0/7] KVM: PPC: MMIO fixes

2022-01-06 Thread Fabiano Rosas
The change from v1 is that I have altered the MMIO size check to fail the emulation in case the size exceeds 8 bytes. That brought some cleanups and another fix along with it, we were returning to userspace in case of failure instead of the guest. This has now become an MMIO series, but since the

Re: [PATCH]powerpc/xive: Export XIVE IPI information for online-only processors.

2022-01-06 Thread Cédric Le Goater
On 1/6/22 12:03, Sachin Sant wrote: Cédric pointed out that XIVE IPI information exported via sysfs (debug/powerpc/xive) display empty lines for processors which are not online. Switch to using for_each_online_cpu() so that information is displayed for online-only processors. Reported-by:

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

2022-01-06 Thread Laurent Dufour
The LPAR name may be changed after the LPAR has been started in the HMC. In that case lparstat command is not reporting the updated value because it reads it from the device tree which is read at boot time. However this value could be read from RTAS. Adding this value in the

[PATCH]powerpc/xive: Export XIVE IPI information for online-only processors.

2022-01-06 Thread Sachin Sant
Cédric pointed out that XIVE IPI information exported via sysfs (debug/powerpc/xive) display empty lines for processors which are not online. Switch to using for_each_online_cpu() so that information is displayed for online-only processors. Reported-by: Cédric Le Goater Signed-off-by: Sachin

Re: [PATCH] ethernet: ibmveth: use default_groups in kobj_type

2022-01-06 Thread patchwork-bot+netdevbpf
Hello: This patch was applied to netdev/net-next.git (master) by David S. Miller : On Wed, 5 Jan 2022 19:41:01 +0100 you wrote: > There are currently 2 ways to create a set of sysfs files for a > kobj_type, through the default_attrs field, and the default_groups > field. Move the ibmveth sysfs

Re: [PATCH 1/2] mm/cma: provide option to opt out from exposing pages on activation failure

2022-01-06 Thread Hari Bathini
On 22/12/21 12:18 am, David Hildenbrand wrote: On 20.12.21 20:34, Hari Bathini wrote: Commit 072355c1cf2d ("mm/cma: expose all pages to the buddy if activation of an area fails") started exposing all pages to buddy allocator on CMA activation failure. But there can be CMA users that want to

[PATCH 13/13] powerpc64/bpf: Optimize instruction sequence used for function calls

2022-01-06 Thread Naveen N. Rao
When calling BPF helpers, we load the function address to call into a register. This can result in upto 5 instructions. Optimize this by instead using the kernel toc in r2 and adjusting offset to the BPF helper. This works since all BPF helpers are part of kernel text, and all BPF

[PATCH 12/13] powerpc64/bpf elfv1: Do not load TOC before calling functions

2022-01-06 Thread Naveen N. Rao
BPF helpers always reside in core kernel and all BPF programs use the kernel TOC. As such, there is no need to load the TOC before calling helpers or other BPF functions. Drop code to do the same. Add a check to ensure we don't proceed if this assumption ever changes in future. Signed-off-by:

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

2022-01-06 Thread Naveen N. Rao
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: Naveen N. Rao --- arch/powerpc/net/bpf_jit_comp64.c | 8

[PATCH 10/13] powerpc64/bpf: Use r12 for constant blinding

2022-01-06 Thread Naveen N. Rao
In preparation for preserving kernel toc in r2, switch BPF_REG_AX from r2 to r12. r12 is not used by bpf JIT except during external helper/bpf calls, or with BPF_NOSPEC. These sequences aren't emitted when BPF_REG_AX is used for constant blinding and other purposes. Signed-off-by: Naveen N. Rao

[PATCH 09/13] powerpc64/bpf: Do not save/restore LR on each call to bpf_stf_barrier()

2022-01-06 Thread Naveen N. Rao
Instead of saving and restoring LR before each invocation to bpf_stf_barrier(), set SEEN_FUNC flag so that we save/restore LR in prologue/epilogue. Signed-off-by: Naveen N. Rao --- arch/powerpc/net/bpf_jit_comp64.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git

[PATCH 08/13] powerpc64/bpf: Limit 'ldbrx' to processors compliant with ISA v2.06

2022-01-06 Thread Naveen N. Rao
Johan reported the below crash with test_bpf on ppc64 e5500: test_bpf: #296 ALU_END_FROM_LE 64: 0x0123456789abcdef -> 0x67452301 jited:1 Oops: Exception in kernel mode, sig: 4 [#1] BE PAGE_SIZE=4K SMP NR_CPUS=24 QEMU e500 Modules linked in: test_bpf(+) CPU: 0 PID: 76 Comm: insmod Not

[PATCH 07/13] powerpc/bpf: Handle large branch ranges with BPF_EXIT

2022-01-06 Thread Naveen N. Rao
In some scenarios, it is possible that the program epilogue is outside the branch range for a BPF_EXIT instruction. Instead of rejecting such programs, emit epilogue as an alternate exit point from the program. Track the location of the same so that subsequent exits can take either of the two

[PATCH 06/13] powerpc/bpf: Emit a single branch instruction for known short branch ranges

2022-01-06 Thread Naveen N. Rao
PPC_BCC() emits two instructions to accommodate scenarios where we need to branch outside the range of a conditional branch. PPC_BCC_SHORT() emits a single branch instruction and can be used when the branch is known to be within a conditional branch range. Convert some of the uses of PPC_BCC() in

[PATCH 05/13] powerpc/bpf: Skip branch range validation during first pass

2022-01-06 Thread Naveen N. Rao
During the first pass, addrs[] is still being populated. So, all branches to following instructions will appear to be going to the start of the JIT program. Ignore branch range validation for such instructions and assume those to be in range. Branch range validation will happen during the second

[PATCH 04/13] tools/bpf: Rename 'struct event' to avoid naming conflict

2022-01-06 Thread Naveen N. Rao
On ppc64le, trying to build bpf seltests throws the below warning: In file included from runqslower.bpf.c:5: ./runqslower.h:7:8: error: redefinition of 'event' struct event { ^ /home/naveen/linux/tools/testing/selftests/bpf/tools/build/runqslower/vmlinux.h:156602:8: note:

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

2022-01-06 Thread Naveen N. Rao
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 bpf_for_each_map_elem() helper") Cc: sta...@vger.kernel.org # v5.15

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

2022-01-06 Thread Naveen N. Rao
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 pass. Fixes: 51c66ad849a703 ("powerpc/bpf: Implement

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

2022-01-06 Thread Naveen N. Rao
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 the call chain. Fixes: fa28dcb82a38f8 ("bpf: Introduce

[PATCH 00/13] powerpc/bpf: Some fixes and updates

2022-01-06 Thread Naveen N. Rao
A set of fixes and updates to powerpc BPF JIT: - Patches 1-3 fix issues with the existing powerpc JIT and are tagged for -stable. - Patch 4 fixes a build issue with bpf selftests on powerpc. - Patches 5-9 handle some corner cases and make some small improvements. - Patches 10-13 optimize how

Re: Linux kernel: powerpc: KVM guest can trigger host crash on Power8

2022-01-06 Thread Michael Ellerman
John Paul Adrian Glaubitz writes: > Hi Michael! > > Sorry for the long time without any responses. Shall we continue debugging > this? Yes! Sorry also that I haven't been able to fix it yet, I had to stop chasing this bug and work on other things before the end of the year. > We're currently

Re: [PATCH V2 1/2] tools/perf: Include global and local variants for p_stage_cyc sort key

2022-01-06 Thread Athira Rajeev
> On 08-Dec-2021, at 9:21 AM, Nageswara Sastry wrote: > > > > On 07/12/21 8:22 pm, Arnaldo Carvalho de Melo wrote: >> Em Fri, Dec 03, 2021 at 07:50:37AM +0530, Athira Rajeev escreveu: >>> Sort key p_stage_cyc is used to present the latency >>> cycles spend in pipeline stages. perf tool has

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

2022-01-06 Thread Laurent Dufour
On 06/01/2022, 02:17:21, Tyrel Datwyler wrote: > On 1/5/22 3:19 PM, Nathan Lynch wrote: >> Laurent Dufour writes: >>> On 07/12/2021, 18:11:09, Laurent Dufour wrote: The LPAR name may be changed after the LPAR has been started in the HMC. In that case lparstat command is not reporting