[PATCH] powerpc/ptdump: Fix generic ptdump for 64-bit

2021-08-31 Thread Michael Ellerman
Since the conversion to generic ptdump we see crashes on 64-bit: BUG: Unable to handle kernel data access on read at 0xc0eeff7f Faulting instruction address: 0xc045e5fc Oops: Kernel access of bad area, sig: 11 [#1] ... NIP __walk_page_range+0x2bc/0xce0 LR

[PATCH] powerpc/bug: Cast to unsigned long before passing to inline asm

2021-08-31 Thread Michael Ellerman
In commit 1e688dd2a3d6 ("powerpc/bug: Provide better flexibility to WARN_ON/__WARN_FLAGS() with asm goto") we changed WARN_ON(). Previously it would take the warning condition, x, and double negate it before converting the result to int, and passing that int to the underlying inline asm. ie:

Re: [PATCH v4 4/4] powerpc/ptdump: Convert powerpc to GENERIC_PTDUMP

2021-08-31 Thread Michael Ellerman
Christophe Leroy writes: > Le 30/08/2021 à 13:55, Michael Ellerman a écrit : >> Christophe Leroy writes: >>> Le 30/08/2021 à 09:52, Michael Ellerman a écrit : Christophe Leroy writes: > Le 29/08/2021 à 20:55, Nathan Chancellor a écrit : >> On Thu, Jul 08, 2021 at 04:49:43PM +,

Re: [PATCH v2] powerpc/32: Add support for out-of-line static calls

2021-08-31 Thread Peter Zijlstra
On Tue, Aug 31, 2021 at 01:12:26PM +, Christophe Leroy wrote: > diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig > index 36b72d972568..a0fe69d8ec83 100644 > --- a/arch/powerpc/Kconfig > +++ b/arch/powerpc/Kconfig > @@ -247,6 +247,7 @@ config PPC > select HAVE_SOFTIRQ_ON_OWN_STACK

Re: [PATCH v3 1/3] powerpc: Remove MSR_PR check in interrupt_exit_{user/kernel}_prepare()

2021-08-31 Thread Michael Ellerman
On Mon, 23 Aug 2021 08:24:20 + (UTC), Christophe Leroy wrote: > In those hot functions that are called at every interrupt, any saved > cycle is worth it. > > interrupt_exit_user_prepare() and interrupt_exit_kernel_prepare() are > called from three places: > - From entry_32.S > - From

[PATCH v2] powerpc/32: Add support for out-of-line static calls

2021-08-31 Thread Christophe Leroy
Add support for out-of-line static calls on PPC32. This change improve performance of calls to global function pointers by using direct calls instead of indirect calls. The trampoline is initialy populated with a 'blr' or branch to target, followed by an unreachable long jump sequence. In order

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

2021-08-31 Thread Paul Moore
On Tue, Aug 31, 2021 at 5:09 AM Ondrej Mosnacek wrote: > On Sat, Jun 19, 2021 at 12:18 AM Dan Williams > wrote: > > On Wed, Jun 16, 2021 at 1:51 AM Ondrej Mosnacek wrote: ... > > > diff --git a/drivers/cxl/mem.c b/drivers/cxl/mem.c > > > index 2acc6173da36..c1747b6555c7 100644 > > > ---

Re: [PATCH v3 0/5] Updates to powerpc for robust CPU online/offline

2021-08-31 Thread Michael Ellerman
On Thu, 26 Aug 2021 15:35:16 +0530, Srikar Dronamraju wrote: > Changelog v2 -> v3: > v2: > https://lore.kernel.org/linuxppc-dev/20210821102535.169643-1-sri...@linux.vnet.ibm.com/t/#u > Add patch 1: to drop dbg and numa=debug (Suggested by Michael Ellerman) > Add patch 2: to convert printk to

Re: [PATCH v2 0/3] powerpc/smp: Misc fixes

2021-08-31 Thread Michael Ellerman
On Thu, 26 Aug 2021 15:33:58 +0530, Srikar Dronamraju wrote: > Changelog : v1 -> v2: > v1: > https://lore.kernel.org/linuxppc-dev/20210821092419.167454-1-sri...@linux.vnet.ibm.com/t/#u`` > [ patch 1: Updated to use DIV_ROUND_UP instead of max to handle more > situations ] > [ patch 2: updated

Re: [PATCH] powerpc/head_check: Fix shellcheck errors

2021-08-31 Thread Michael Ellerman
On Tue, 17 Aug 2021 22:51:54 +1000, Michael Ellerman wrote: > Replace "cat file | grep pattern" with "grep pattern file", and quote a > few variables. Together that fixes all shellcheck errors. Applied to powerpc/next. [1/1] powerpc/head_check: Fix shellcheck errors

Re: [PATCH] powerpc/64: Avoid link stack corruption in kexec_wait()

2021-08-31 Thread Daniel Axtens
Christophe Leroy writes: > Le 31/08/2021 à 08:17, Daniel Axtens a écrit : >> Hi Christophe, >> >>> Use bcl 20,31,+4 instead of bl in order to preserve link stack. >>> >>> See commit c974809a26a1 ("powerpc/vdso: Avoid link stack corruption >>> in __get_datapage()") for details. >> >> From my

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

2021-08-31 Thread Paul Moore
On Tue, Aug 31, 2021 at 5:08 AM Ondrej Mosnacek wrote: > Can we move this forward somehow, please? As mentioned previously, I can merge this via the SELinux tree but I need to see some ACKs from the other subsystems first, not to mention some resolution to the outstanding questions. -- paul

Re: [PATCH] powerpc: Redefine HMT_xxx macros as empty on PPC32

2021-08-31 Thread Michael Ellerman
On Wed, 25 Aug 2021 13:34:45 + (UTC), Christophe Leroy wrote: > HMT_xxx macros are macros for adjusting thread priority > (hardware multi-threading) are macros inherited from PPC64 > via commit 5f7c690728ac ("[PATCH] powerpc: Merged ppc_asm.h") > > Those instructions are pointless on PPC32,

Re: [PATCH v6 00/11] DDW + Indirect Mapping

2021-08-31 Thread Michael Ellerman
On Tue, 17 Aug 2021 03:39:18 -0300, Leonardo Bras wrote: > So far it's assumed possible to map the guest RAM 1:1 to the bus, which > works with a small number of devices. SRIOV changes it as the user can > configure hundreds VFs and since phyp preallocates TCEs and does not > allow IOMMU pages

Re: [PATCH 0/3] powerpc/microwatt: Device tree and config updates

2021-08-31 Thread Michael Ellerman
On Thu, 26 Aug 2021 21:56:50 +0930, Joel Stanley wrote: > This enables the liteeth network device for microwatt which will be > merged in v5.15. > > It also turns on some options so the microwatt defconfig can be used to > boot a userspace with systemd. > > Joel Stanley (3): >

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

2021-08-31 Thread Dan Williams
On Tue, Aug 31, 2021 at 6:53 AM Paul Moore wrote: > > On Tue, Aug 31, 2021 at 5:09 AM Ondrej Mosnacek wrote: > > On Sat, Jun 19, 2021 at 12:18 AM Dan Williams > > wrote: > > > On Wed, Jun 16, 2021 at 1:51 AM Ondrej Mosnacek > > > wrote: > > ... > > > > > diff --git a/drivers/cxl/mem.c

Re: [PATCH] powerpc/bug: Cast to unsigned long before passing to inline asm

2021-08-31 Thread Nathan Chancellor
On Tue, Aug 31, 2021 at 11:27:20PM +1000, Michael Ellerman wrote: > In commit 1e688dd2a3d6 ("powerpc/bug: Provide better flexibility to > WARN_ON/__WARN_FLAGS() with asm goto") we changed WARN_ON(). Previously > it would take the warning condition, x, and double negate it before > converting the

Re: [PATCH] powerpc/ptdump: Fix generic ptdump for 64-bit

2021-08-31 Thread Nathan Chancellor
On Tue, Aug 31, 2021 at 11:51:51PM +1000, Michael Ellerman wrote: > Since the conversion to generic ptdump we see crashes on 64-bit: > > BUG: Unable to handle kernel data access on read at 0xc0eeff7f > Faulting instruction address: 0xc045e5fc > Oops: Kernel access of bad

[powerpc:merge] BUILD SUCCESS eba39ec79104b8b498e9862da658748e7539b100

2021-08-31 Thread kernel test robot
allmodconfig powerpc allyesconfig powerpc allmodconfig powerpc allnoconfig i386 randconfig-a005-20210831 i386 randconfig-a002-20210831 i386 randconfig-a003-20210831 i386

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

2021-08-31 Thread Paul Moore
On Tue, Aug 31, 2021 at 2:58 PM Dan Williams wrote: > On Tue, Aug 31, 2021 at 6:53 AM Paul Moore wrote: > > On Tue, Aug 31, 2021 at 5:09 AM Ondrej Mosnacek wrote: > > > On Sat, Jun 19, 2021 at 12:18 AM Dan Williams > > > wrote: > > > > On Wed, Jun 16, 2021 at 1:51 AM Ondrej Mosnacek > > > >

Re: [PATCH v6 00/11] DDW + Indirect Mapping

2021-08-31 Thread Leonardo Brás
Hello David, Sorry for the delay, I did not get your mail because I was not CC'd in your reply (you sent the mail just to the mailing list). Replies bellow: On Mon, 2021-08-30 at 10:48 -0700, David Christensen wrote: > On 8/16/21 11:39 PM, Leonardo Bras wrote: > > So far it's assumed possible

Re: [PATCH v6 00/11] DDW + Indirect Mapping

2021-08-31 Thread David Christensen
On 8/31/21 1:18 PM, Leonardo Brás wrote: Hello David, Sorry for the delay, I did not get your mail because I was not CC'd in your reply (you sent the mail just to the mailing list). Replies bellow: On Mon, 2021-08-30 at 10:48 -0700, David Christensen wrote: On 8/16/21 11:39 PM, Leonardo

Re: [PATCH v6 00/11] DDW + Indirect Mapping

2021-08-31 Thread Leonardo Brás
On Tue, 2021-08-31 at 13:39 -0700, David Christensen wrote: > > > > This series allow Indirect DMA using DDW when available, which > > usually > > means bigger pagesizes and more TCEs, and so more DMA space. > > How is the mapping method selected?  LPAR creation via the HMC, Linux > kernel load

Re: [PATCH kernel] KVM: PPC: Fix clearing never mapped TCEs in realmode

2021-08-31 Thread Leonardo Brás
Hello Alexey, On Fri, 2021-08-27 at 14:07 +1000, Alexey Kardashevskiy wrote: > Since e1a1ef84cd07, pages for TCE tables for KVM guests are allocated > only when needed. This allows skipping any update when clearing TCEs. > This works mostly fine as TCE updates are handled when MMU is enabled. >

Re: [PATCH] powerpc/bug: Cast to unsigned long before passing to inline asm

2021-08-31 Thread Segher Boessenkool
Hi! On Tue, Aug 31, 2021 at 11:27:20PM +1000, Michael Ellerman wrote: > Nathan filed an LLVM bug [2], in which Eli Friedman explained that "if > you pass a value of a type that's narrower than a register to an inline > asm, the high bits are undefined". In this case we are passing a bool > to the

Re: [PATCH] powerpc/32: Add support for out-of-line static calls

2021-08-31 Thread Ard Biesheuvel
On Tue, 31 Aug 2021 at 10:53, Peter Zijlstra wrote: > > On Tue, Aug 31, 2021 at 08:05:21AM +, Christophe Leroy wrote: > > > +#define ARCH_DEFINE_STATIC_CALL_NULL_TRAMP(name) \ > > + asm(".pushsection .text, \"ax\" \n" \ > > + ".align

Re: [PATCH] powerpc/64: Avoid link stack corruption in kexec_wait()

2021-08-31 Thread Daniel Axtens
Hi Christophe, > Use bcl 20,31,+4 instead of bl in order to preserve link stack. > > See commit c974809a26a1 ("powerpc/vdso: Avoid link stack corruption > in __get_datapage()") for details. >From my understanding of that commit message, the change helps to keep the link stack correctly balanced

[powerpc:next] BUILD SUCCESS 57dbbe590f152e5e8a3ff8bf5ba163df34eeae0b

2021-08-31 Thread kernel test robot
tree/branch: https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git next branch HEAD: 57dbbe590f152e5e8a3ff8bf5ba163df34eeae0b powerpc/pseries/iommu: Rename "direct window" to "dma window" elapsed time: 6605m configs tested: 158 configs skipped: 3 The following configs have been

[PATCH] powerpc/32: Add support for out-of-line static calls

2021-08-31 Thread Christophe Leroy
Add support for out-of-line static calls on PPC32. This change improve performance of calls to global function pointers by using direct calls instead of indirect calls. The trampoline is initialy populated with a 'blr' and 3 'nop'. Then, depending on the target distance,

Re: [PATCH v2 1/3] powerpc/smp: Fix a crash while booting kvm guest with nr_cpus=2

2021-08-31 Thread Gautham R Shenoy
On Thu, Aug 26, 2021 at 03:33:59PM +0530, Srikar Dronamraju wrote: > Aneesh reported a crash with a fairly recent upstream kernel when > booting kernel whose commandline was appended with nr_cpus=2 > > 1:mon> e > cpu 0x1: Vector: 300 (Data Access) at [c8a67bd0] > pc: c002557c:

Re: [PATCH linux-next] power:pkeys: fix bugon.cocci warnings

2021-08-31 Thread Daniel Axtens
Hi Jing, Thanks for your patch. The patch looks good, but looking at the output of `make coccicheck M=arch/powerpc MODE=report`, it looks like there might be a few other things that we might want to fix. Would it be worth trying to make the arch/powerpc directory free from coccinelle warnings in

[PATCH] powerpc/machdep: Remove stale functions from ppc_md structure

2021-08-31 Thread Christophe Leroy
ppc_md.iommu_save() is not set anymore by any platform after commit c40785ad305b ("powerpc/dart: Use a cachable DART"). So iommu_save() has become a nop and can be removed. ppc_md.show_percpuinfo() is not set anymore by any platform after commit 4350147a816b ("[PATCH] ppc64: SMU based macs

[PATCH] powerpc/time: Remove generic_suspend_{dis/en}able_irqs()

2021-08-31 Thread Christophe Leroy
Commit d75d68cfef49 ("powerpc: Clean up obsolete code relating to decrementer and timebase") made generic_suspend_enable_irqs() and generic_suspend_disable_irqs() static. Fold them into their only caller. Signed-off-by: Christophe Leroy --- arch/powerpc/kernel/time.c | 22

Re: [PATCH] powerpc/64: Avoid link stack corruption in kexec_wait()

2021-08-31 Thread Christophe Leroy
Le 31/08/2021 à 08:17, Daniel Axtens a écrit : Hi Christophe, Use bcl 20,31,+4 instead of bl in order to preserve link stack. See commit c974809a26a1 ("powerpc/vdso: Avoid link stack corruption in __get_datapage()") for details. From my understanding of that commit message, the change

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

2021-08-31 Thread Ondrej Mosnacek
On Fri, Jun 18, 2021 at 5:40 AM Paul Moore wrote: > On Wed, Jun 16, 2021 at 4:51 AM 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

Re: [PATCH] powerpc/32: Add support for out-of-line static calls

2021-08-31 Thread Peter Zijlstra
On Tue, Aug 31, 2021 at 08:05:21AM +, Christophe Leroy wrote: > +#define ARCH_DEFINE_STATIC_CALL_NULL_TRAMP(name) \ > + asm(".pushsection .text, \"ax\" \n" \ > + ".align 4 \n" \ > +

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

2021-08-31 Thread Ondrej Mosnacek
On Sat, Jun 19, 2021 at 12:18 AM Dan Williams wrote: > On Wed, Jun 16, 2021 at 1:51 AM 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