[6.1.0-rc4-next-20221108] Boot failure on powerpc

2022-11-08 Thread Sachin Sant
6.1.0-rc4-next-20221108 fails to boot on IBM Power Server with following traces. [0.609442] PowerPC PowerNV PCI Hotplug Driver version: 0.1 [0.609699] Serial: 8250/16550 driver, 4 ports, IRQ sharing enabled [0.610037] tpm_ibmvtpm 3003: CRQ initialization completed [1.681458

Re: [PATCH v10 9/9] powerpc/code-patching: Consolidate and cache per-cpu patching context

2022-11-08 Thread Christophe Leroy
Le 09/11/2022 à 05:51, Benjamin Gray a écrit : > With the temp mm context support, there are CPU local variables to hold > the patch address and pte. Use these in the non-temp mm path as well > instead of adding a level of indirection through the text_poke_area > vm_struct and pointer chasing

Re: [PATCH v10 7/9] powerpc/tlb: Add local flush for page given mm_struct and psize

2022-11-08 Thread Christophe Leroy
Le 09/11/2022 à 05:51, Benjamin Gray a écrit : > Adds a local TLB flush operation that works given an mm_struct, VA to > flush, and page size representation. Most implementations mirror the > surrounding code. The book3s/32/tlbflush.h implementation is left as > a BUILD_BUG because it is more

Re: [PATCH v10 6/9] powerpc/mm: Remove flush_all_mm, local_flush_all_mm

2022-11-08 Thread Christophe Leroy
Le 09/11/2022 à 05:51, Benjamin Gray a écrit : > These functions were introduced for "cxl: Enable global TLBIs for cxl > contexts" [1], which ended up using them for Radix only. They were never > implemented on Hash (and creating an implementation appears to be > difficult), so nothing can

Re: [PATCH v10 5/9] cxl: Use radix__flush_all_mm instead of generic flush_all_mm

2022-11-08 Thread Christophe Leroy
Le 09/11/2022 à 05:51, Benjamin Gray a écrit : > The generic implementation of this function isn't really generic (Hash > is not implemented). Unfortunately, the runtime warnings cannot be > replaced with BUILD_BUG's, so it seems safer not to provide a stub in > the first place. > >

Re: [PATCH v10 4/9] powerpc/mm: Remove empty hash__ functions

2022-11-08 Thread Christophe Leroy
Le 09/11/2022 à 05:51, Benjamin Gray a écrit : > The empty hash__* functions are unnecessary. The empty definitions were > introduced when 64-bit Hash support was added, as the functions were > still used in generic code. These empty definitions were prefixed with > hash__ when Radix support was

Re: [PATCH v10 3/9] powerpc/mm: Remove extern from function prototypes

2022-11-08 Thread Christophe Leroy
Le 09/11/2022 à 05:51, Benjamin Gray a écrit : > Remove the extern keyword from function declarations. It is redundant > and would cause inconsistent style when new functions are added without > it. > > Signed-off-by: Benjamin Gray Reviewed-by: Christophe Leroy Allthough the style

Re: [PATCH v10 2/9] powerpc/code-patching: Use WARN_ON and fix check in poking_init

2022-11-08 Thread Christophe Leroy
Le 09/11/2022 à 05:51, Benjamin Gray a écrit : > BUG_ON() when failing to initialise the code patching window is > unnecessary, and use of BUG_ON is discouraged. We don't set > poking_init_done in this case, so failure to init the boot CPU will > result in a strict RWX error when a following

[PATCH v10 7/9] powerpc/tlb: Add local flush for page given mm_struct and psize

2022-11-08 Thread Benjamin Gray
Adds a local TLB flush operation that works given an mm_struct, VA to flush, and page size representation. Most implementations mirror the surrounding code. The book3s/32/tlbflush.h implementation is left as a BUILD_BUG because it is more complicated and not required for anything as yet. This

[PATCH v10 8/9] powerpc/code-patching: Use temporary mm for Radix MMU

2022-11-08 Thread Benjamin Gray
From: "Christopher M. Riedl" x86 supports the notion of a temporary mm which restricts access to temporary PTEs to a single CPU. A temporary mm is useful for situations where a CPU needs to perform sensitive operations (such as patching a STRICT_KERNEL_RWX kernel) requiring temporary mappings

[PATCH v10 0/9] powerpc/code-patching: Use temporary mm for Radix MMU

2022-11-08 Thread Benjamin Gray
This is a revision of Chris and Jordan's series to introduce a per-cpu temporary mm to be used for patching with strict rwx on radix mmus. v10:* Don't set poking_init_enabled on boot CPU init failure * Remove extern from functions in files touched by this series * Changed

[PATCH v10 3/9] powerpc/mm: Remove extern from function prototypes

2022-11-08 Thread Benjamin Gray
Remove the extern keyword from function declarations. It is redundant and would cause inconsistent style when new functions are added without it. Signed-off-by: Benjamin Gray --- v10:* New in v10 for consistency with new functions --- .../include/asm/book3s/64/tlbflush-hash.h | 19

[PATCH v10 9/9] powerpc/code-patching: Consolidate and cache per-cpu patching context

2022-11-08 Thread Benjamin Gray
With the temp mm context support, there are CPU local variables to hold the patch address and pte. Use these in the non-temp mm path as well instead of adding a level of indirection through the text_poke_area vm_struct and pointer chasing the pte. As both paths use these fields now, there is no

[PATCH v10 1/9] powerpc: Allow clearing and restoring registers independent of saved breakpoint state

2022-11-08 Thread Benjamin Gray
From: Jordan Niethe For the coming temporary mm used for instruction patching, the breakpoint registers need to be cleared to prevent them from accidentally being triggered. As soon as the patching is done, the breakpoints will be restored. The breakpoint state is stored in the per-cpu variable

[PATCH v10 5/9] cxl: Use radix__flush_all_mm instead of generic flush_all_mm

2022-11-08 Thread Benjamin Gray
The generic implementation of this function isn't really generic (Hash is not implemented). Unfortunately, the runtime warnings cannot be replaced with BUILD_BUG's, so it seems safer not to provide a stub in the first place. Signed-off-by: Benjamin Gray --- v10:* New in v10 to remove

[PATCH v10 4/9] powerpc/mm: Remove empty hash__ functions

2022-11-08 Thread Benjamin Gray
The empty hash__* functions are unnecessary. The empty definitions were introduced when 64-bit Hash support was added, as the functions were still used in generic code. These empty definitions were prefixed with hash__ when Radix support was added, and new wrappers with the original names were

[PATCH v10 2/9] powerpc/code-patching: Use WARN_ON and fix check in poking_init

2022-11-08 Thread Benjamin Gray
BUG_ON() when failing to initialise the code patching window is unnecessary, and use of BUG_ON is discouraged. We don't set poking_init_done in this case, so failure to init the boot CPU will result in a strict RWX error when a following patch_instruction uses raw_patch_instruction. If it only

[PATCH v10 6/9] powerpc/mm: Remove flush_all_mm, local_flush_all_mm

2022-11-08 Thread Benjamin Gray
These functions were introduced for "cxl: Enable global TLBIs for cxl contexts" [1], which ended up using them for Radix only. They were never implemented on Hash (and creating an implementation appears to be difficult), so nothing can actually rely on them. They behave differently to the

[PATCH linux-next][RFC]powerpc: move pseries interrupt cleanup code to under __cpu_disable

2022-11-08 Thread Zhouyi Zhou
According to Link: https://lore.kernel.org/lkml/20220914021528.15946-1-zhouzho...@gmail.com/T/ Link: https://lore.kernel.org/lkml/CN6WCMKCWHOG.LT2QV3910UJ2@bobo/ During the cpu offlining, the sub functions of xive_teardown_cpu will call __lock_acquire when CONFIG_LOCKDEP=y. The latter function

Re: [PATCH 2/2] tools/perf: Fix printing field separator in CSV metrics output

2022-11-08 Thread Arnaldo Carvalho de Melo
Em Wed, Nov 02, 2022 at 02:07:06PM +0530, Athira Rajeev escreveu: > > > > On 18-Oct-2022, at 2:26 PM, Athira Rajeev > > wrote: > > > > In perf stat with CSV output option, number of fields > > in metrics output is not matching with number of fields > > in other event output lines. > > > >

[powerpc:merge] BUILD SUCCESS 732d027c8c25634d189bda9363b9650c6f6e6b35

2022-11-08 Thread kernel test robot
defconfig s390defconfig i386 allyesconfig s390 allyesconfig arc randconfig-r043-20221108 s390 randconfig-r044-20221108 riscvrandconfig-r042

[PATCH v2 7/7] selftests/vm: anon_cow: add mprotect() optimization tests

2022-11-08 Thread David Hildenbrand
Let's extend the test to cover the possible mprotect() optimization when removing write-protection. mprotect() must not allow write-access to a COW-shared page by accident. Signed-off-by: David Hildenbrand --- tools/testing/selftests/vm/anon_cow.c | 49 +-- 1 file

[PATCH v2 6/7] mm: remove unused savedwrite infrastructure

2022-11-08 Thread David Hildenbrand
NUMA hinting no longer uses savedwrite, let's rip it out. ... and while at it, drop __pte_write() and __pmd_write() on ppc64. Signed-off-by: David Hildenbrand --- arch/powerpc/include/asm/book3s/64/pgtable.h | 80 +--- arch/powerpc/kvm/book3s_hv_rm_mmu.c | 2 +-

[PATCH v2 4/7] mm/mprotect: factor out check whether manual PTE write upgrades are required

2022-11-08 Thread David Hildenbrand
Let's factor the check out into vma_wants_manual_pte_write_upgrade(), to be reused in NUMA hinting fault context soon. Signed-off-by: David Hildenbrand --- include/linux/mm.h | 16 ++-- mm/mprotect.c | 17 - 2 files changed, 18 insertions(+), 15 deletions(-)

[PATCH v2 3/7] mm/huge_memory: try avoiding write faults when changing PMD protection

2022-11-08 Thread David Hildenbrand
Let's replicate what we have for PTEs in can_change_pte_writable() also for PMDs. While this might look like a pure performance improvement, we'll us this to get rid of savedwrite handling in do_huge_pmd_numa_page() next. Place do_huge_pmd_numa_page() strategically good for that purpose. Note

[PATCH v2 0/7] mm/autonuma: replace savedwrite infrastructure

2022-11-08 Thread David Hildenbrand
This series is based on mm-unstable. As discussed in my talk at LPC, we can reuse the same mechanism for deciding whether to map a pte writable when upgrading permissions via mprotect() -- e.g., PROT_READ -> PROT_READ|PROT_WRITE -- to replace the savedwrite infrastructure used for NUMA hinting

[PATCH v2 1/7] mm/mprotect: allow clean exclusive anon pages to be writable

2022-11-08 Thread David Hildenbrand
From: Nadav Amit Anonymous pages might have the dirty bit clear, but this should not prevent mprotect from making them writable if they are exclusive. Therefore, skip the test whether the page is dirty in this case. Note that there are already other ways to get a writable PTE mapping an

[PATCH v2 2/7] mm/mprotect: minor can_change_pte_writable() cleanups

2022-11-08 Thread David Hildenbrand
We want to replicate this code for handling PMDs soon. (1) No need to crash the kernel, warning and rejecting is good enough. As this will no longer get optimized out, drop the pte_write() check: no harm would be done. (2) Add a comment why PROT_NONE mapped pages are excluded. (3) Add a

Re: [PATCH 00/44] KVM: Rework kvm_init() and hardware enabling

2022-11-08 Thread Sean Christopherson
On Mon, Nov 07, 2022, Isaku Yamahata wrote: > On Fri, Nov 04, 2022 at 08:27:14PM +, > Sean Christopherson wrote: > > > On Fri, Nov 04, 2022, Isaku Yamahata wrote: > > > Thanks for the patch series. I the rebased TDX KVM patch series and it > > > worked. > > > Since cpu offline needs to be

Re: [RFC PATCH 4/6] powerpc/powernv: Convert pointers to physical addresses in OPAL call args

2022-11-08 Thread Christophe Leroy
Le 04/11/2022 à 18:27, Andrew Donnellan a écrit : > A number of OPAL calls take addresses as arguments (e.g. buffers with > strings to print, etc). These addresses need to be physical addresses, as > OPAL runs in real mode. > > Since the hardware ignores the top two bits of the address in real

Re: [PATCH] soc: fsl: qe: request pins non-exclusively

2022-11-08 Thread Dmitry Torokhov
On November 8, 2022 2:50:07 AM PST, Linus Walleij wrote: >On Tue, Nov 8, 2022 at 4:16 AM Dmitry Torokhov > wrote: > >> Commit 84582f9ed090 ("soc: fsl: qe: Avoid using gpio_to_desc()") changed >> qe_pin_request() to request and hold GPIO corresponding to a given pin. >> Unfortunately this does

Re: [RFC PATCH 5/6] powerpc/powernv/idle: Convert stack pointer to physical address

2022-11-08 Thread Christophe Leroy
Le 04/11/2022 à 18:27, Andrew Donnellan a écrit : > When we go into idle, we must disable the MMU. Currently, we can still > access the stack once the MMU is disabled, because the stack is in the > linear map. > > Once we enable CONFIG_VMAP_STACK, the normal stack pointer will be in the >

Re: sched/debug: CPU hotplug operation suffers in a large cpu systems

2022-11-08 Thread Greg Kroah-Hartman
On Tue, Nov 08, 2022 at 08:21:00PM +0530, Srikar Dronamraju wrote: > * Greg Kroah-Hartman [2022-11-08 13:24:39]: > > > On Tue, Nov 08, 2022 at 03:30:46PM +0530, Vishal Chourasia wrote: > > Hi Greg, > > > > > > > Thanks Greg & Peter for your direction. > > > > > > While we pursue the idea

Re: sched/debug: CPU hotplug operation suffers in a large cpu systems

2022-11-08 Thread Srikar Dronamraju
* Greg Kroah-Hartman [2022-11-08 13:24:39]: > On Tue, Nov 08, 2022 at 03:30:46PM +0530, Vishal Chourasia wrote: Hi Greg, > > > > Thanks Greg & Peter for your direction. > > > > While we pursue the idea of having debugfs based on kernfs, we thought about > > having a boot time parameter

Re: [PATCH 00/44] KVM: Rework kvm_init() and hardware enabling

2022-11-08 Thread Huang, Kai
On Tue, 2022-11-08 at 08:56 +, Huang, Kai wrote: > On Mon, 2022-11-07 at 21:43 -0800, Isaku Yamahata wrote: > > On Tue, Nov 08, 2022 at 01:09:27AM +, > > "Huang, Kai" wrote: > > > > > On Mon, 2022-11-07 at 13:46 -0800, Isaku Yamahata wrote: > > > > > On Fri, Nov 04, 2022, Isaku Yamahata

Re: [6.1.0-rc3-next-20221104] Boot failure - kernel BUG at mm/memblock.c:519

2022-11-08 Thread Yajun Deng
November 8, 2022 3:55 PM, "Mike Rapoport" wrote: > Hi Yajun, > > On Tue, Nov 08, 2022 at 02:27:53AM +, Yajun Deng wrote: > >> Hi Sachin, >> I didn't have a powerpc architecture machine. I don't know why this happened. >> >> Hi Mike, >> Do you have any suggestions? > > You can try

Re: [PATCH 00/44] KVM: Rework kvm_init() and hardware enabling

2022-11-08 Thread Huang, Kai
On Mon, 2022-11-07 at 21:43 -0800, Isaku Yamahata wrote: > On Tue, Nov 08, 2022 at 01:09:27AM +, > "Huang, Kai" wrote: > > > On Mon, 2022-11-07 at 13:46 -0800, Isaku Yamahata wrote: > > > > On Fri, Nov 04, 2022, Isaku Yamahata wrote: > > > > > Thanks for the patch series. I the rebased TDX

Re: [6.1.0-rc3-next-20221104] Boot failure - kernel BUG at mm/memblock.c:519

2022-11-08 Thread Yajun Deng
Hi Sachin, I didn't have a powerpc architecture machine. I don't know why this happened. Hi Mike, Do you have any suggestions? I tested in tools/testing/memblock, and it was successful. November 6, 2022 8:07 PM, "Sachin Sant" wrote: > While booting recent linux-next on a IBM Power10 Server

Re: [PATCH 00/44] KVM: Rework kvm_init() and hardware enabling

2022-11-08 Thread Huang, Kai
On Mon, 2022-11-07 at 13:46 -0800, Isaku Yamahata wrote: > > On Fri, Nov 04, 2022, Isaku Yamahata wrote: > > > Thanks for the patch series. I the rebased TDX KVM patch series and it > > > worked. > > > Since cpu offline needs to be rejected in some cases(To keep at least one > > > cpu > > > on a

Re: sched/debug: CPU hotplug operation suffers in a large cpu systems

2022-11-08 Thread Greg Kroah-Hartman
On Tue, Nov 08, 2022 at 03:30:46PM +0530, Vishal Chourasia wrote: > > Thanks Greg & Peter for your direction. > > While we pursue the idea of having debugfs based on kernfs, we thought about > having a boot time parameter which would disable creating and updating of the > sched_domain debugfs

Re: [PATCH] soc: fsl: qe: request pins non-exclusively

2022-11-08 Thread Andy Shevchenko
On Tue, Nov 08, 2022 at 11:50:07AM +0100, Linus Walleij wrote: > On Tue, Nov 8, 2022 at 4:16 AM Dmitry Torokhov > wrote: > > > Commit 84582f9ed090 ("soc: fsl: qe: Avoid using gpio_to_desc()") changed > > qe_pin_request() to request and hold GPIO corresponding to a given pin. > > Unfortunately

Re: [PATCH 4/5] powerpc/kprobes: Setup consistent pt_regs across kprobes, optprobes and KPROBES_ON_FTRACE

2022-11-08 Thread Naveen N. Rao
Nicholas Piggin wrote: On Fri Oct 21, 2022 at 3:29 AM AEST, Naveen N. Rao wrote: Ensure a more consistent pt_regs across kprobes, optprobes and KPROBES_ON_FTRACE: - Drop setting trap to 0x700 under optprobes. This is not accurate and is unnecessary. Instead, zero it out for both optprobes and

Re: [PATCH] soc: fsl: qe: request pins non-exclusively

2022-11-08 Thread Linus Walleij
On Tue, Nov 8, 2022 at 4:16 AM Dmitry Torokhov wrote: > Commit 84582f9ed090 ("soc: fsl: qe: Avoid using gpio_to_desc()") changed > qe_pin_request() to request and hold GPIO corresponding to a given pin. > Unfortunately this does not work, as fhci-hcd requests these GPIOs > first, befor calling

Re: [PATCH 1/5] powerpc/kprobes: Remove preempt disable around call to get_kprobe() in arch_prepare_kprobe()

2022-11-08 Thread Naveen N. Rao
Nicholas Piggin wrote: On Fri Oct 21, 2022 at 3:28 AM AEST, Naveen N. Rao wrote: arch_prepare_kprobe() is called from register_kprobe() via prepare_kprobe(), or through register_aggr_kprobe(), both with the kprobe_mutex held. Per the comment for get_kprobe(): /* * This routine is called

Re: [PATCH v2 1/4] powerpc/64: Add INTERRUPT_SANITIZE_REGISTERS Kconfig

2022-11-08 Thread Nicholas Piggin
On Tue Nov 8, 2022 at 2:39 AM AEST, Segher Boessenkool wrote: > Hi! > > On Mon, Nov 07, 2022 at 02:31:59PM +1100, Rohan McLure wrote: > > Add Kconfig option for enabling clearing of registers on arrival in an > > interrupt handler. This reduces the speculation influence of registers > > on kernel

Re: [PATCH 5/5] powerpc/kprobes: Remove unnecessary headers from kprobes

2022-11-08 Thread Naveen N. Rao
Christophe Leroy wrote: Le 20/10/2022 à 19:29, Naveen N. Rao a écrit : Many of these headers are not necessary since those are included indirectly, or the code using those headers has been removed. It is usually not a good idea to not include headers because they are already included

Re: sched/debug: CPU hotplug operation suffers in a large cpu systems

2022-11-08 Thread Vishal Chourasia
Thanks Greg & Peter for your direction. While we pursue the idea of having debugfs based on kernfs, we thought about having a boot time parameter which would disable creating and updating of the sched_domain debugfs files and this would also be useful even when the kernfs solution kicks in, as