Re: [PATCH 2/2] powerpc/64s/interrupt: Check and fix srr_valid without crashing

2021-06-21 Thread Christophe Leroy
Le 22/06/2021 à 08:04, Nicholas Piggin a écrit : The PPC_RFI_SRR_DEBUG check added by patch "powerpc/64s: avoid reloading (H)SRR registers if they are still valid" has a few deficiencies. It does not fix the actual problem, it's not enabled by default, and it causes a program check interrupt w

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

2021-06-21 Thread Paolo Bonzini
On 22/06/21 07:25, Stephen Rothwell wrote: Hi all, Today's linux-next merge of the kvm tree got a conflict in: include/uapi/linux/kvm.h between commit: 9bb4a6f38fd4 ("KVM: PPC: Book3S HV: Add KVM_CAP_PPC_RPT_INVALIDATE capability") from the powerpc tree and commits: 644f706719f0 (

[PATCH 2/2] powerpc/64s/interrupt: Check and fix srr_valid without crashing

2021-06-21 Thread Nicholas Piggin
The PPC_RFI_SRR_DEBUG check added by patch "powerpc/64s: avoid reloading (H)SRR registers if they are still valid" has a few deficiencies. It does not fix the actual problem, it's not enabled by default, and it causes a program check interrupt which can cause more difficulties. However there are a

[PATCH 1/2] powerpc/64s: Fix "avoid reloading (H)SRR registers if they are still valid"

2021-06-21 Thread Nicholas Piggin
This picks up a bunch of srr invalidation cases missed, and tries to convert the entire tree including 64e and 32-bit to use the accessors, to save headaches in future. It also avoids doing the general clobber after changing several things, to always using the accessors (a few extra stores to paca

[PATCH 0/2] fast interrupts fixes

2021-06-21 Thread Nicholas Piggin
These are a couple of improvements to the fast interrupt exits series that fit after patch 4. The first patch is incremental to patch 4 and should be folded in, the second could go anywhere in the series but I based it on top. I can rebase it or resend the series if needed. Thanks, Nick Nicholas

[PATCH] powerpc/64s: Fix copy-paste data exposure into newly created tasks

2021-06-21 Thread Nicholas Piggin
copy-paste contains implicit "copy buffer" state that can contain arbitrary user data (if the user process executes a copy instruction). This could be snooped by another process if a context switch hits while the state is live. So cp_abort is executed on context switch to clear out possible sensiti

linux-next: manual merge of the kvm tree with the powerpc tree

2021-06-21 Thread Stephen Rothwell
Hi all, Today's linux-next merge of the kvm tree got a conflict in: include/uapi/linux/kvm.h between commit: 9bb4a6f38fd4 ("KVM: PPC: Book3S HV: Add KVM_CAP_PPC_RPT_INVALIDATE capability") from the powerpc tree and commits: 644f706719f0 ("KVM: x86: hyper-v: Introduce KVM_CAP_HYPERV_ENF

Re: [PATCH v8 4/6] KVM: PPC: Book3S HV: Nested support in H_RPT_INVALIDATE

2021-06-21 Thread Bharata B Rao
On Mon, Jun 21, 2021 at 10:12:42AM -0700, Nathan Chancellor wrote: > > +long do_h_rpt_invalidate_pat(struct kvm_vcpu *vcpu, unsigned long lpid, > > +unsigned long type, unsigned long pg_sizes, > > +unsigned long start, unsigned long end) > > +{ > > +

[powerpc:next] BUILD SUCCESS 9a0b020d61685913a1504398273ccec8dbc8c32e

2021-06-21 Thread kernel test robot
ig powerpc allyesconfig powerpc allmodconfig powerpc allnoconfig x86_64 randconfig-a002-20210621 x86_64 randconfig-a001-20210621 x86_64 randconfig-a003-20210621 x86_64 randconfig-a00

linux-next: build failure after merge of the irqchip tree

2021-06-21 Thread Stephen Rothwell
Hi all, After merging the irqchip tree, today's linux-next build (powerpc ppc64_defconfig) failed like this: arch/powerpc/platforms/pseries/vas.c: In function 'allocate_setup_window': arch/powerpc/platforms/pseries/vas.c:219:22: error: implicit declaration of function 'irq_create_mapping' [-Werr

Re: [PATCH 1/2] powerpc/prom_init: Convert prom_strcpy() into prom_strscpy_pad()

2021-06-21 Thread Michael Ellerman
Daniel Axtens writes: > Hi > >> -static char __init *prom_strcpy(char *dest, const char *src) >> +static ssize_t __init prom_strscpy_pad(char *dest, const char *src, size_t >> n) >> { >> -char *tmp = dest; >> +ssize_t rc; >> +size_t i; >> >> -while ((*dest++ = *src++) != '\0')

[PATCH] powerpc/interrupts: Fix duplicate included asm/interrupt.h

2021-06-21 Thread Jiapeng Chong
Clean up the following includecheck warning: ./arch/powerpc/kernel/interrupt.c: asm/interrupt.h is included more than once. No functional change. Reported-by: Abaci Robot Signed-off-by: Jiapeng Chong --- arch/powerpc/kernel/interrupt.c | 1 - 1 file changed, 1 deletion(-) diff --git a/arch/p

Re: [PATCH for 4.16 v7 02/11] powerpc: membarrier: Skip memory barrier in switch_mm()

2021-06-21 Thread Segher Boessenkool
Hi! On Mon, Jun 21, 2021 at 04:11:04PM +0200, Christophe Leroy wrote: > Le 19/06/2021 à 17:02, Segher Boessenkool a écrit : > >The point of the twi in the I/O accessors was to make things easier to > >debug if the accesses fail: for the twi insn to complete the load will > >have to have completed

Re: [PATCH v4 7/7] powerpc/pseries: Add support for FORM2 associativity

2021-06-21 Thread Daniel Henrique Barboza
On 6/17/21 1:51 PM, Aneesh Kumar K.V wrote: PAPR interface currently supports two different ways of communicating resource grouping details to the OS. These are referred to as Form 0 and Form 1 associativity grouping. Form 0 is the older format and is now considered deprecated. This patch adds

Re: [PATCH] ibmvnic: Use strscpy() instead of strncpy()

2021-06-21 Thread patchwork-bot+netdevbpf
Hello: This patch was applied to netdev/net-next.git (refs/heads/master): On Mon, 21 Jun 2021 14:35:09 -0700 you wrote: > Since these strings are expected to be NUL-terminated and the buffers > are exactly sized (in vnic_client_data_len()) with no padding, strncpy() > can be safely replaced with

linux-next: Signed-off-by missing for commit in the powerpc tree

2021-06-21 Thread Stephen Rothwell
Hi all, Commit 77bbbc0cf848 ("KVM: PPC: Book3S HV: Fix TLB management on SMT8 POWER9 and POWER10 processors") is missing a Signed-off-by from its author. -- Cheers, Stephen Rothwell pgpxXwMax8acq.pgp Description: OpenPGP digital signature

[PATCH] ibmvnic: Use strscpy() instead of strncpy()

2021-06-21 Thread Kees Cook
Since these strings are expected to be NUL-terminated and the buffers are exactly sized (in vnic_client_data_len()) with no padding, strncpy() can be safely replaced with strscpy() here, as strncpy() on NUL-terminated string is considered deprecated[1]. This has the side-effect of silencing a -Warr

Re: [PATCH v13 01/12] swiotlb: Refactor swiotlb init functions

2021-06-21 Thread Christoph Hellwig
On Mon, Jun 21, 2021 at 10:59:20AM -0700, Stefano Stabellini wrote: > Just as a clarification: I was referring to the zeroing of "mem" in > swiotlb_late_init_with_tbl and swiotlb_init_with_tbl. While it looks > like Tom and Christoph are talking about the zeroing of "tlb". Indeed. > > The zeroi

Re: [PATCH -next v2 0/9] ASoC: fsl: Use devm_platform_get_and_ioremap_resource()

2021-06-21 Thread Mark Brown
On Tue, 15 Jun 2021 09:39:13 +0800, Yang Yingliang wrote: > patch #1 ~ #8: > Use devm_platform_get_and_ioremap_resource() > > patch #9 > check return value of platform_get_resource_byname() > > v2: > change error message in patch #9 > > [...] Applied to https://git.kernel.org/pub/scm/

[PATCH] KVM: PPC: Book3S HV: Workaround high stack usage with clang

2021-06-21 Thread Nathan Chancellor
LLVM does not emit optimal byteswap assembly, which results in high stack usage in kvmhv_enter_nested_guest() due to the inlining of byteswap_pt_regs(). With LLVM 12.0.0: arch/powerpc/kvm/book3s_hv_nested.c:289:6: error: stack frame size of 2512 bytes in function 'kvmhv_enter_nested_guest' [-Werro

Re: arch/powerpc/kvm/book3s_hv_nested.c:264:6: error: stack frame size of 2304 bytes in function 'kvmhv_enter_nested_guest'

2021-06-21 Thread Nathan Chancellor
On Mon, Jun 21, 2021 at 07:46:03PM +1000, Michael Ellerman wrote: > Nathan Chancellor writes: > > On 6/20/2021 4:59 PM, Nicholas Piggin wrote: > >> Excerpts from kernel test robot's message of April 3, 2021 8:47 pm: > >>> tree: > >>> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linu

Re: [PATCH v13 01/12] swiotlb: Refactor swiotlb init functions

2021-06-21 Thread Stefano Stabellini
On Fri, 18 Jun 2021, Christoph Hellwig wrote: > On Fri, Jun 18, 2021 at 09:09:17AM -0500, Tom Lendacky wrote: > > > swiotlb_init_with_tbl uses memblock_alloc to allocate the io_tlb_mem > > > and memblock_alloc[1] will do memset in memblock_alloc_try_nid[2], so > > > swiotlb_init_with_tbl is also go

Re: [powerpc][5.13.0-rc7] Kernel warning (kernel/sched/fair.c:401) while running LTP tests

2021-06-21 Thread Vincent Guittot
On Mon, 21 Jun 2021 at 19:32, Sachin Sant wrote: > > >>> Any thoughts Vincent? > >> > >> > >> I would prefer that we use the reason of adding the cfs in the list > >> instead. > >> > >> Something like the below should also fixed the problem. It is based on a > >> proposal I made to Rik sometimes

Re: [powerpc][5.13.0-rc7] Kernel warning (kernel/sched/fair.c:401) while running LTP tests

2021-06-21 Thread Sachin Sant
>>> Any thoughts Vincent? >> >> >> I would prefer that we use the reason of adding the cfs in the list instead. >> >> Something like the below should also fixed the problem. It is based on a >> proposal I made to Rik sometimes ago when he tried to flatten the rq: >> https://lore.kernel.org/lkml/

Re: [PATCH v8 4/6] KVM: PPC: Book3S HV: Nested support in H_RPT_INVALIDATE

2021-06-21 Thread Nathan Chancellor
On Mon, Jun 21, 2021 at 02:20:01PM +0530, Bharata B Rao wrote: > Enable support for process-scoped invalidations from nested > guests and partition-scoped invalidations for nested guests. > > Process-scoped invalidations for any level of nested guests > are handled by implementing H_RPT_INVALIDATE

Re: [powerpc][5.13.0-rc7] Kernel warning (kernel/sched/fair.c:401) while running LTP tests

2021-06-21 Thread Vincent Guittot
Hi Sacha On Mon, 21 Jun 2021 at 18:22, Vincent Guittot wrote: > > Le lundi 21 juin 2021 à 14:42:23 (+0200), Odin Ugedal a écrit : > > Hi, > > > > Did some more research, and it looks like this is what happens: > > > > $ tree /sys/fs/cgroup/ltp/ -d --charset=ascii > > /sys/fs/cgroup/ltp/ > > |-- d

Re: [powerpc][5.13.0-rc7] Kernel warning (kernel/sched/fair.c:401) while running LTP tests

2021-06-21 Thread Vincent Guittot
On Mon, 21 Jun 2021 at 18:45, Odin Ugedal wrote: > > man. 21. jun. 2021 kl. 18:22 skrev Vincent Guittot > : > > I would prefer that we use the reason of adding the cfs in the list instead. > > > > Something like the below should also fixed the problem. It is based on a > > proposal I made to Rik

Re: [powerpc][5.13.0-rc7] Kernel warning (kernel/sched/fair.c:401) while running LTP tests

2021-06-21 Thread Odin Ugedal
man. 21. jun. 2021 kl. 18:22 skrev Vincent Guittot : > I would prefer that we use the reason of adding the cfs in the list instead. > > Something like the below should also fixed the problem. It is based on a > proposal I made to Rik sometimes ago when he tried to flatten the rq: > https://lore.ker

Re: [powerpc][5.13.0-rc7] Kernel warning (kernel/sched/fair.c:401) while running LTP tests

2021-06-21 Thread Vincent Guittot
Le lundi 21 juin 2021 à 14:42:23 (+0200), Odin Ugedal a écrit : > Hi, > > Did some more research, and it looks like this is what happens: > > $ tree /sys/fs/cgroup/ltp/ -d --charset=ascii > /sys/fs/cgroup/ltp/ > |-- drain > `-- test-6851 > `-- level2 > |-- level3a > | |-- wo

Re: [PATCH 1/1] powerpc/pseries: Interface to represent PAPR firmware attributes

2021-06-21 Thread Pratik Sampat
Hello Fabiano, Thank you for your review. On 19/06/21 2:28 am, Fabiano Rosas wrote: "Pratik R. Sampat" writes: Adds a generic interface to represent the energy and frequency related PAPR attributes on the system using the new H_CALL "H_GET_ENERGY_SCALE_INFO". H_GET_EM_PARMS H_CALL was previ

Re: [PATCH for 4.16 v7 02/11] powerpc: membarrier: Skip memory barrier in switch_mm()

2021-06-21 Thread Christophe Leroy
Le 19/06/2021 à 17:02, Segher Boessenkool a écrit : On Sat, Jun 19, 2021 at 11:35:34AM +0200, Christophe Leroy wrote: Le 18/06/2021 à 19:26, Mathieu Desnoyers a écrit : - On Jun 18, 2021, at 1:13 PM, Christophe Leroy christophe.le...@csgroup.eu wrote: [...] I don't understand all tha

Re: [PATCH v2 2/9] powerpc: Add Microwatt device tree

2021-06-21 Thread Segher Boessenkool
On Sun, Jun 20, 2021 at 10:08:58PM +1000, Paul Mackerras wrote: > On Sat, Jun 19, 2021 at 09:26:16AM -0500, Segher Boessenkool wrote: > > On Fri, Jun 18, 2021 at 01:44:16PM +1000, Paul Mackerras wrote: > > > Microwatt currently runs with MSR[HV] = 0, > > > > That isn't compliant though? If your i

Re: [PATCH 1/2] powerpc/prom_init: Convert prom_strcpy() into prom_strscpy_pad()

2021-06-21 Thread Daniel Axtens
Hi > -static char __init *prom_strcpy(char *dest, const char *src) > +static ssize_t __init prom_strscpy_pad(char *dest, const char *src, size_t n) > { > - char *tmp = dest; > + ssize_t rc; > + size_t i; > > - while ((*dest++ = *src++) != '\0') > - /* nothing */; > -

Re: [powerpc][5.13.0-rc7] Kernel warning (kernel/sched/fair.c:401) while running LTP tests

2021-06-21 Thread Odin Ugedal
Hi, Did some more research, and it looks like this is what happens: $ tree /sys/fs/cgroup/ltp/ -d --charset=ascii /sys/fs/cgroup/ltp/ |-- drain `-- test-6851 `-- level2 |-- level3a | |-- worker1 | `-- worker2 `-- level3b `-- worker3 Timeline (i

Re: arch/powerpc/kvm/book3s_hv_nested.c:264:6: error: stack frame size of 2304 bytes in function 'kvmhv_enter_nested_guest'

2021-06-21 Thread Arnd Bergmann
On Mon, Jun 21, 2021 at 11:46 AM Michael Ellerman wrote: > Nathan Chancellor writes: > > On 6/20/2021 4:59 PM, Nicholas Piggin wrote: > >> Excerpts from kernel test robot's message of April 3, 2021 8:47 pm: > >>> > >>> vim +/kvmhv_enter_nested_guest +264 arch/powerpc/kvm/book3s_hv_nested.c > >> >

Re: [powerpc][5.13.0-rc7] Kernel warning (kernel/sched/fair.c:401) while running LTP tests

2021-06-21 Thread Odin Ugedal
man. 21. jun. 2021 kl. 12:57 skrev Sachin Sant : > > Unfortunately this does not help. I can still recreate the failure. > > Have attached the o/p from test run. > > Thanks > -Sachin Yes, thanks! I am able to reproduce it locally now, so will keep looking to see if I find the cause. Thanks! Odin

Re: [powerpc][5.13.0-rc7] Kernel warning (kernel/sched/fair.c:401) while running LTP tests

2021-06-21 Thread Sachin Sant
> On 21-Jun-2021, at 3:24 PM, Odin Ugedal wrote: > > man. 21. jun. 2021 kl. 11:50 skrev Vincent Guittot > : >> This means that a child's load was not null and it was inserted >> whereas parent's load was null. This should not happen unless the >> propagation failed somewhere > > My initial th

Re: [powerpc][5.13.0-rc7] Kernel warning (kernel/sched/fair.c:401) while running LTP tests

2021-06-21 Thread Odin Ugedal
man. 21. jun. 2021 kl. 11:50 skrev Vincent Guittot : > This means that a child's load was not null and it was inserted > whereas parent's load was null. This should not happen unless the > propagation failed somewhere My initial thought is that the patch below will fix it, if that is the issue (th

Re: [powerpc][5.13.0-rc7] Kernel warning (kernel/sched/fair.c:401) while running LTP tests

2021-06-21 Thread Odin Ugedal
man. 21. jun. 2021 kl. 08:33 skrev Sachin Sant : > > While running LTP tests (cfs_bandwidth01) against 5.13.0-rc7 kernel on a > powerpc box > following warning is seen > > [ 6611.331827] [ cut here ] > [ 6611.331855] rq->tmp_alone_branch != &rq->leaf_cfs_rq_list > [ 6611.33

Re: [powerpc][5.13.0-rc7] Kernel warning (kernel/sched/fair.c:401) while running LTP tests

2021-06-21 Thread Vincent Guittot
On Mon, 21 Jun 2021 at 11:39, Odin Ugedal wrote: > > man. 21. jun. 2021 kl. 08:33 skrev Sachin Sant : > > > > While running LTP tests (cfs_bandwidth01) against 5.13.0-rc7 kernel on a > > powerpc box > > following warning is seen > > > > [ 6611.331827] [ cut here ] > > [ 66

Re: arch/powerpc/kvm/book3s_hv_nested.c:264:6: error: stack frame size of 2304 bytes in function 'kvmhv_enter_nested_guest'

2021-06-21 Thread Michael Ellerman
Nathan Chancellor writes: > On 6/20/2021 4:59 PM, Nicholas Piggin wrote: >> Excerpts from kernel test robot's message of April 3, 2021 8:47 pm: >>> tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git >>> master >>> head: d93a0d43e3d0ba9e19387be4dae4a8d5b175a8d7 >>> commit

Re: [PATCH v3] lockdown,selinux: fix wrong subject in some SELinux lockdown checks

2021-06-21 Thread Steffen Klassert
On Wed, Jun 16, 2021 at 10:51:18AM +0200, Ondrej Mosnacek wrote: > Commit 59438b46471a ("security,lockdown,selinux: implement SELinux > lockdown") added an implementation of the locked_down LSM hook to > SELinux, with the aim to restrict which domains are allowed to perform > operations that would

[PATCH v8 6/6] KVM: PPC: Book3S HV: Use H_RPT_INVALIDATE in nested KVM

2021-06-21 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 Reviewed-by: Fabiano Rosas Reviewed-by: David Gibso

[PATCH v8 5/6] KVM: PPC: Book3S HV: Add KVM_CAP_PPC_RPT_INVALIDATE capability

2021-06-21 Thread Bharata B Rao
Now that we have H_RPT_INVALIDATE fully implemented, enable support for the same via KVM_CAP_PPC_RPT_INVALIDATE KVM capability Signed-off-by: Bharata B Rao Reviewed-by: David Gibson --- Documentation/virt/kvm/api.rst | 18 ++ arch/powerpc/kvm/powerpc.c | 3 +++ include/uapi

[PATCH v8 4/6] KVM: PPC: Book3S HV: Nested support in H_RPT_INVALIDATE

2021-06-21 Thread Bharata B Rao
Enable support for process-scoped invalidations from nested guests and partition-scoped invalidations for nested guests. Process-scoped invalidations for any level of nested guests are handled by implementing H_RPT_INVALIDATE handler in the nested guest exit path in L0. Partition-scoped invalidat

[PATCH v8 0/6] Support for H_RPT_INVALIDATE in PowerPC KVM

2021-06-21 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 v8: - - Used tlb_single_page_flush_ceiling in the process-scoped range flush routine to switch to full PID invalation i

[PATCH v8 3/6] KVM: PPC: Book3S HV: Add support for H_RPT_INVALIDATE

2021-06-21 Thread Bharata B Rao
H_RPT_INVALIDATE does two types of TLB invalidations: 1. Process-scoped invalidations for guests when LPCR[GTSE]=0. This is currently not used in KVM as GTSE is not usually disabled in KVM. 2. Partition-scoped invalidations that an L1 hypervisor does on behalf of an L2 guest. This is curr

[PATCH v8 1/6] KVM: PPC: Book3S HV: Fix comments of H_RPT_INVALIDATE arguments

2021-06-21 Thread Bharata B Rao
From: "Aneesh Kumar K.V" The type values H_RPTI_TYPE_PRT and H_RPTI_TYPE_PAT indicate invalidating the caching of process and partition scoped entries respectively. Signed-off-by: Aneesh Kumar K.V Signed-off-by: Bharata B Rao Reviewed-by: David Gibson --- arch/powerpc/include/asm/hvcall.h |

[PATCH v8 2/6] powerpc/book3s64/radix: Add H_RPT_INVALIDATE pgsize encodings to mmu_psize_def

2021-06-21 Thread Bharata B Rao
Add a field to mmu_psize_def to store the page size encodings of H_RPT_INVALIDATE hcall. Initialize this while scanning the radix AP encodings. This will be used when invalidating with required page size encoding in the hcall. Signed-off-by: Bharata B Rao Reviewed-by: David Gibson --- arch/powe