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

2021-08-26 Thread Alexey Kardashevskiy
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. The realmode handlers fail with H_TOO_HARD when pages are not yet allocated except when

Re: [PATCH v15 10/12] swiotlb: Add restricted DMA pool initialization

2021-08-26 Thread Claire Chang
On Tue, Aug 24, 2021 at 10:26 PM Guenter Roeck wrote: > > Hi Claire, > > On Thu, Jun 24, 2021 at 11:55:24PM +0800, Claire Chang wrote: > > Add the initialization function to create restricted DMA pools from > > matching reserved-memory nodes. > > > > Regardless of swiotlb setting, the restricted

Re: [PATCH v2 4/5] KVM: selftests: Add a test for KVM_RUN+rseq to detect task migration bugs

2021-08-26 Thread Sean Christopherson
On Thu, Aug 26, 2021, Mathieu Desnoyers wrote: > - On Aug 25, 2021, at 8:51 PM, Sean Christopherson sea...@google.com > wrote: > >> >> + r = sched_setaffinity(0, sizeof(allowed_mask), > >> >> _mask); > >> >> + TEST_ASSERT(!r, "sched_setaffinity failed, errno = %d

Re: [PATCH v2 3/4] powerpc/64s/interrupt: Don't enable MSR[EE] in irq handlers unless perf is in use

2021-08-26 Thread Nicholas Piggin
Excerpts from kernel test robot's message of August 27, 2021 1:04 am: > Hi Nicholas, > > I love your patch! Yet something to improve: > > [auto build test ERROR on powerpc/next] > [also build test ERROR on v5.14-rc7 next-20210826] > [cannot apply to scottwood/next] > [

Re: [PATCH v2 1/2] powerpc/bug: Remove specific powerpc BUG_ON() and WARN_ON() on PPC32

2021-08-26 Thread Nicholas Piggin
Excerpts from Segher Boessenkool's message of August 27, 2021 1:30 am: > On Fri, Aug 27, 2021 at 01:04:36AM +1000, Nicholas Piggin wrote: >> Excerpts from Segher Boessenkool's message of August 27, 2021 12:37 am: >> >> No, they are all dispatched and issue to the BRU for execution. It's >> >>

Re: [PATCH v2 RESEND] powerpc/audit: Convert powerpc to AUDIT_ARCH_COMPAT_GENERIC

2021-08-26 Thread Paul Moore
On Thu, Aug 26, 2021 at 10:37 AM Michael Ellerman wrote: > Paul Moore writes: > > On Tue, Aug 24, 2021 at 1:11 PM Christophe Leroy > > wrote: > >> Le 24/08/2021 à 16:47, Paul Moore a écrit : > >> > On Tue, Aug 24, 2021 at 9:36 AM Christophe Leroy > >> > wrote: > >> >> > >> >> Commit

Re: [PATCH v2 2/3] selftests/powerpc: Add test for real address error handling

2021-08-26 Thread Ganesh
On 8/26/21 8:57 AM, Michael Ellerman wrote: Ganesh writes: On 8/24/21 6:18 PM, Michael Ellerman wrote: Ganesh Goudar writes: Add test for real address or control memory address access error handling, using NX-GZIP engine. The error is injected by accessing the control memory address

Re: [PATCH v2 2/2] powerpc/bug: Provide better flexibility to WARN_ON/__WARN_FLAGS() with asm goto

2021-08-26 Thread Nathan Chancellor
On Thu, Aug 26, 2021 at 11:54:17AM -0700, Nathan Chancellor wrote: > On Thu, Aug 26, 2021 at 01:21:39PM +1000, Michael Ellerman wrote: > > Nathan Chancellor writes: > > > On Tue, Apr 13, 2021 at 04:38:10PM +, Christophe Leroy wrote: > > >> Using asm goto in __WARN_FLAGS() and WARN_ON() allows

Re: [PATCH v2 2/2] powerpc/bug: Provide better flexibility to WARN_ON/__WARN_FLAGS() with asm goto

2021-08-26 Thread Nathan Chancellor
On Thu, Aug 26, 2021 at 01:21:39PM +1000, Michael Ellerman wrote: > Nathan Chancellor writes: > > On Tue, Apr 13, 2021 at 04:38:10PM +, Christophe Leroy wrote: > >> Using asm goto in __WARN_FLAGS() and WARN_ON() allows more > >> flexibility to GCC. > ... > > > > This patch as commit

Re: [PATCH v2 4/5] KVM: selftests: Add a test for KVM_RUN+rseq to detect task migration bugs

2021-08-26 Thread Mathieu Desnoyers
- On Aug 25, 2021, at 8:51 PM, Sean Christopherson sea...@google.com wrote: > On Mon, Aug 23, 2021, Mathieu Desnoyers wrote: >> [ re-send to Darren Hart ] >> >> - On Aug 23, 2021, at 11:18 AM, Mathieu Desnoyers >> mathieu.desnoy...@efficios.com wrote: >> >> > - On Aug 20, 2021, at

Re: [next-20210820][ppc][nvme/raid] pci unbind WARNS at fs/kernfs/dir.c:1524 kernfs_remove_by_name_ns+

2021-08-26 Thread Christoph Hellwig
Are you sure this is the very latest linux-next? This should hav been fixed by: "block: add back the bd_holder_dir reference in bd_link_disk_holder"

Re: [PATCH v2 1/2] powerpc/bug: Remove specific powerpc BUG_ON() and WARN_ON() on PPC32

2021-08-26 Thread Segher Boessenkool
On Fri, Aug 27, 2021 at 01:04:36AM +1000, Nicholas Piggin wrote: > Excerpts from Segher Boessenkool's message of August 27, 2021 12:37 am: > >> No, they are all dispatched and issue to the BRU for execution. It's > >> trivial to construct a test of a lot of not taken branches in a row > >> and

Re: [PATCH v2 3/4] powerpc/64s/interrupt: Don't enable MSR[EE] in irq handlers unless perf is in use

2021-08-26 Thread kernel test robot
Hi Nicholas, I love your patch! Yet something to improve: [auto build test ERROR on powerpc/next] [also build test ERROR on v5.14-rc7 next-20210826] [cannot apply to scottwood/next] [If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest

Re: [GIT PULL] retire legacy WR sbc8548 and sbc8641 platforms

2021-08-26 Thread Michael Ellerman
Paul Gortmaker writes: > This is unchanged from the original wr_sbc-delete branch sent in January, > other than to add the Acks from Scott in July, and update the baseline. > > Built with ppc64 defconfig and mpc85xx_cds_defconfig and mpc86xx_defconfig > just to make sure I didn't fat finger

Re: [PATCH v2 1/2] powerpc/bug: Remove specific powerpc BUG_ON() and WARN_ON() on PPC32

2021-08-26 Thread Nicholas Piggin
Excerpts from Segher Boessenkool's message of August 27, 2021 12:37 am: > On Thu, Aug 26, 2021 at 11:57:52PM +1000, Nicholas Piggin wrote: >> Excerpts from Segher Boessenkool's message of August 26, 2021 10:49 pm: >> > On Thu, Aug 26, 2021 at 01:26:14PM +1000, Nicholas Piggin wrote: >> >> Excerpts

Re: [PATCH v2 2/2] powerpc/bug: Provide better flexibility to WARN_ON/__WARN_FLAGS() with asm goto

2021-08-26 Thread Christophe Leroy
Le 26/08/2021 à 16:45, Michael Ellerman a écrit : Christophe Leroy writes: Le 26/08/2021 à 05:21, Michael Ellerman a écrit : Nathan Chancellor writes: On Tue, Apr 13, 2021 at 04:38:10PM +, Christophe Leroy wrote: Using asm goto in __WARN_FLAGS() and WARN_ON() allows more flexibility

Re: [PATCH v2 2/2] powerpc/bug: Provide better flexibility to WARN_ON/__WARN_FLAGS() with asm goto

2021-08-26 Thread Michael Ellerman
Christophe Leroy writes: > Le 26/08/2021 à 05:21, Michael Ellerman a écrit : >> Nathan Chancellor writes: >>> On Tue, Apr 13, 2021 at 04:38:10PM +, Christophe Leroy wrote: Using asm goto in __WARN_FLAGS() and WARN_ON() allows more flexibility to GCC. >> ... >>> >>> This patch as

[next-20210820][ppc][nvme/raid] pci unbind WARNS at fs/kernfs/dir.c:1524 kernfs_remove_by_name_ns+

2021-08-26 Thread Abdul Haleem
Greeting's Today's linux-next kernel WARN's while unbind of pci ssd flash device on my powerpc box # lspci -nn 001d:80:00.0 Non-Volatile memory controller [0108]: Seagate Technology PLC Nytro Flash Storage [1bb1:0100] 001e:90:00.0 Non-Volatile memory controller [0108]: Seagate Technology

Re: [PATCH v2 1/2] powerpc/bug: Remove specific powerpc BUG_ON() and WARN_ON() on PPC32

2021-08-26 Thread Segher Boessenkool
On Thu, Aug 26, 2021 at 11:57:52PM +1000, Nicholas Piggin wrote: > Excerpts from Segher Boessenkool's message of August 26, 2021 10:49 pm: > > On Thu, Aug 26, 2021 at 01:26:14PM +1000, Nicholas Piggin wrote: > >> Excerpts from Segher Boessenkool's message of August 19, 2021 1:06 am: > >> > On Fri,

Re: [PATCH v2 RESEND] powerpc/audit: Convert powerpc to AUDIT_ARCH_COMPAT_GENERIC

2021-08-26 Thread Michael Ellerman
Paul Moore writes: > On Tue, Aug 24, 2021 at 1:11 PM Christophe Leroy > wrote: >> Le 24/08/2021 à 16:47, Paul Moore a écrit : >> > On Tue, Aug 24, 2021 at 9:36 AM Christophe Leroy >> > wrote: >> >> >> >> Commit e65e1fc2d24b ("[PATCH] syscall class hookup for all normal >> >> targets") added

Re: [PATCH linux-next] powerpc/tm: remove duplicate include in tm-poison.c

2021-08-26 Thread Michael Ellerman
Christophe Leroy writes: > Le 24/08/2021 à 16:40, Shuah Khan a écrit : >> On 8/5/21 12:52 AM, cgel@gmail.com wrote: >>> From: yong yiran >>> >>> 'inttypes.h' included in 'tm-poison.c' is duplicated. >>> Remove all but the first include of inttypes.h from tm-poison.c. >>> >>> Reported-by:

Re: [PATCH] powerpc: Make set_endian() return EINVAL when not supporting little endian

2021-08-26 Thread Michael Ellerman
Christophe Leroy writes: > Le 26/08/2021 à 05:41, Michael Ellerman a écrit : >> Christophe Leroy writes: >>> There is no point in modifying MSR_LE bit on CPUs not supporting >>> little endian. >> >> Isn't that an ABI break? > > Or an ABI fix ? I don't know. It could break existing

Re: [PATCH v2 2/2] powerpc/bug: Provide better flexibility to WARN_ON/__WARN_FLAGS() with asm goto

2021-08-26 Thread Segher Boessenkool
On Thu, Aug 26, 2021 at 01:21:39PM +1000, Michael Ellerman wrote: > So there seems to be some misunderstanding with clang, it doesn't like > us passing an expression to the inline asm. > > AFAIK it is legal to pass expressions as inputs to inline asm, ie. it > doesn't have to just be a variable

Re: [PATCH v2 1/2] powerpc/bug: Remove specific powerpc BUG_ON() and WARN_ON() on PPC32

2021-08-26 Thread Nicholas Piggin
Excerpts from Segher Boessenkool's message of August 26, 2021 10:49 pm: > Hi! > > On Thu, Aug 26, 2021 at 01:26:14PM +1000, Nicholas Piggin wrote: >> Excerpts from Segher Boessenkool's message of August 19, 2021 1:06 am: >> > On Fri, Aug 13, 2021 at 04:08:13PM +1000, Nicholas Piggin wrote: >> >>

Re: [PATCH v2 2/2] powerpc/bug: Provide better flexibility to WARN_ON/__WARN_FLAGS() with asm goto

2021-08-26 Thread Segher Boessenkool
On Thu, Aug 26, 2021 at 08:37:09AM +0200, Christophe Leroy wrote: > Le 26/08/2021 à 05:21, Michael Ellerman a écrit : > >This patch seems to fix it. Not sure if that's just papering over it > >though. > > > >diff --git a/arch/powerpc/include/asm/bug.h > >b/arch/powerpc/include/asm/bug.h > >index

Re: [PATCH v2 3/3] powerpc/numa: Fill distance_lookup_table for offline nodes

2021-08-26 Thread Michael Ellerman
Srikar Dronamraju writes: > Scheduler expects unique number of node distances to be available at > boot. I think it needs "the number of unique node distances" ? > It uses node distance to calculate this unique node distances. It iterates over all pairs of nodes and records node_distance() for

Re: [PATCH v2 1/2] powerpc/bug: Remove specific powerpc BUG_ON() and WARN_ON() on PPC32

2021-08-26 Thread Segher Boessenkool
Hi! On Thu, Aug 26, 2021 at 01:26:14PM +1000, Nicholas Piggin wrote: > Excerpts from Segher Boessenkool's message of August 19, 2021 1:06 am: > > On Fri, Aug 13, 2021 at 04:08:13PM +1000, Nicholas Piggin wrote: > >> This one possibly the branches end up in predictors, whereas conditional > >>

Re: [PATCH v3] PCI: Move pci_dev_is/assign_added() to pci.h

2021-08-26 Thread Niklas Schnelle
On Wed, 2021-08-25 at 14:04 -0500, Bjorn Helgaas wrote: > On Mon, Aug 23, 2021 at 12:53:39PM +0200, Niklas Schnelle wrote: > > On Fri, 2021-08-20 at 17:37 -0500, Bjorn Helgaas wrote: > > > On Tue, Jul 20, 2021 at 05:01:45PM +0200, Niklas Schnelle wrote: > > > > The helper function

[PATCH 3/3] powerpc/configs/microwatt: Enable options for systemd

2021-08-26 Thread Joel Stanley
When booting with systemd these options are required. This increases the image by about 50KB, or 2%. Signed-off-by: Joel Stanley --- arch/powerpc/configs/microwatt_defconfig | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/arch/powerpc/configs/microwatt_defconfig

[PATCH 2/3] powerpc/configs/microwattt: Enable Liteeth

2021-08-26 Thread Joel Stanley
Liteeth is the network device used by Microwatt. Signed-off-by: Joel Stanley --- arch/powerpc/configs/microwatt_defconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/powerpc/configs/microwatt_defconfig b/arch/powerpc/configs/microwatt_defconfig index a08b739123da..2f8b1fec9a16

[PATCH 1/3] powerpc/microwatt: Add Ethernet to device tree

2021-08-26 Thread Joel Stanley
The liteeth network device is used in the Microwatt soc. Signed-off-by: Joel Stanley --- arch/powerpc/boot/dts/microwatt.dts | 12 1 file changed, 12 insertions(+) diff --git a/arch/powerpc/boot/dts/microwatt.dts b/arch/powerpc/boot/dts/microwatt.dts index

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

2021-08-26 Thread Joel Stanley
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): powerpc/microwatt: Add Ethernet to device tree powerpc/configs/microwattt: Enable

[PATCH v5 1/5] powerpc/numa: Drop dbg in favour of pr_debug

2021-08-26 Thread Srikar Dronamraju
PowerPc supported numa=debug which is not documented. This option was used to print early debug output. However something more flexible can be achieved by using CONFIG_DYNAMIC_DEBUG. Hence drop dbg (and numa=debug) in favour of pr_debug Cc: linuxppc-dev@lists.ozlabs.org Cc: Nathan Lynch Cc:

[PATCH v3 5/5] powerpc/numa: Fill distance_lookup_table for offline nodes

2021-08-26 Thread Srikar Dronamraju
Scheduler expects unique number of node distances to be available at boot. It uses node distance to calculate this unique node distances. On POWER, node distances for offline nodes is not available. However, POWER already knows unique possible node distances. Fake the offline node's

[PATCH v3 4/5] powerpc/numa: Update cpu_cpu_map on CPU online/offline

2021-08-26 Thread Srikar Dronamraju
cpu_cpu_map holds all the CPUs in the DIE. However in PowerPC, when onlining/offlining of CPUs, this mask doesn't get updated. This mask is however updated when CPUs are added/removed. So when both operations like online/offline of CPUs and adding/removing of CPUs are done simultaneously, then

[PATCH v3 3/5] powerpc/numa: Print debug statements only when required

2021-08-26 Thread Srikar Dronamraju
Currently, a debug message gets printed every time an attempt to add(remove) a CPU. However this is redundant if the CPU is already added (removed) from the node. Cc: linuxppc-dev@lists.ozlabs.org Cc: Nathan Lynch Cc: Michael Ellerman Cc: Ingo Molnar Cc: Peter Zijlstra Cc: Valentin Schneider

[PATCH v5 2/5] powerpc/numa: convert printk to pr_xxx

2021-08-26 Thread Srikar Dronamraju
Convert the remaining printk to pr_xxx One advantage would be all prints will now have prefix "numa:" from pr_fmt(). Cc: linuxppc-dev@lists.ozlabs.org Cc: Nathan Lynch Cc: Michael Ellerman Cc: Ingo Molnar Cc: Peter Zijlstra Cc: Valentin Schneider Cc: Gautham R Shenoy Cc: Vincent Guittot

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

2021-08-26 Thread Srikar Dronamraju
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 pr_xxx (Suggested by Michael Ellerman) Use pr_warn instead of

[PATCH v2 3/3] powerpc/smp: Enable CACHE domain for shared processor

2021-08-26 Thread Srikar Dronamraju
Currently CACHE domain is not enabled on shared processor mode PowerVM LPARS. On PowerVM systems, 'ibm,thread-group' device-tree property 2 under cpu-device-node indicates which all CPUs share L2-cache. However 'ibm,thread-group' device-tree property 2 is a relatively new property. In absence of

[PATCH v2 2/3] powerpc/smp: Update cpu_core_map on all PowerPc systems

2021-08-26 Thread Srikar Dronamraju
lscpu() uses core_siblings to list the number of sockets in the system. core_siblings is set using topology_core_cpumask. While optimizing the powerpc bootup path, Commit 4ca234a9cbd7 ("powerpc/smp: Stop updating cpu_core_mask"). it was found that updating cpu_core_mask() ended up taking a lot

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

2021-08-26 Thread Srikar Dronamraju
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: cpu_to_chip_id+0x3c/0x100 lr: c0058380:

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

2021-08-26 Thread Srikar Dronamraju
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 changelog to make it more generic powerpc issue ] The 1st patch fixes a

Re: [PATCH v2 2/2] powerpc/bug: Provide better flexibility to WARN_ON/__WARN_FLAGS() with asm goto

2021-08-26 Thread Christophe Leroy
Le 26/08/2021 à 05:21, Michael Ellerman a écrit : Nathan Chancellor writes: On Tue, Apr 13, 2021 at 04:38:10PM +, Christophe Leroy wrote: Using asm goto in __WARN_FLAGS() and WARN_ON() allows more flexibility to GCC. ... This patch as commit 1e688dd2a3d6 ("powerpc/bug: Provide