Re: [PATCH v1 4/4] mm: Allow detection of wrong arch_enter_lazy_mmu_mode() context

2025-04-11 Thread Nicholas Piggin
ug for the arch and could fire frequently if it fires at all. Reviewed-by: Nicholas Piggin > --- > include/linux/pgtable.h | 15 --- > 1 file changed, 12 insertions(+), 3 deletions(-) > > diff --git a/include/linux/pgtable.h b/include/linux/pgtable.h > index e2b705c14

Re: [PATCH v1 0/4] mm: Fix apply_to_pte_range() vs lazy MMU mode

2025-04-11 Thread Nicholas Piggin
On Tue Apr 8, 2025 at 1:11 AM AEST, Alexander Gordeev wrote: > Hi All, > > This series is an attempt to fix the violation of lazy MMU mode context > requirement as described for arch_enter_lazy_mmu_mode(): > > This mode can only be entered and left under the protection of > the page table l

Re: [PATCH v1 1/4] kasan: Avoid sleepable page allocation from atomic context

2025-04-10 Thread Nicholas Piggin
On Tue Apr 8, 2025 at 1:11 AM AEST, Alexander Gordeev wrote: > apply_to_page_range() enters lazy MMU mode and then invokes > kasan_populate_vmalloc_pte() callback on each page table walk > iteration. The lazy MMU mode may only be entered only under > protection of the page table lock. However, the

Re: [PATCH v1 3/4] mm: Protect kernel pgtables in apply_to_pte_range()

2025-04-10 Thread Nicholas Piggin
ng that takes the ptl in the apply_to_page_range fn()... Looks like you may be right. I wonder why they do and nobody else? Just luck? Seems okay. Reviewed-by: Nicholas Piggin > @@ -401,13 +401,10 @@ static int kasan_depopulate_vmalloc_pte(pte_t *ptep, > unsigned long addr, &g

Re: [PATCH v1 2/4] mm: Cleanup apply_to_pte_range() routine

2025-04-10 Thread Nicholas Piggin
} > } while (addr += PAGE_SIZE, addr != end); > } > - *mask |= PGTBL_PTE_MODIFIED; > > arch_leave_lazy_mmu_mode(); > > if (mm != &init_mm) > pte_unmap_unlock(mapped_pte, ptl); > + > + *mask |= PGTBL_PTE_MODIFIED; This is done just because we might as well? Less work in critical section? Reviewed-by: Nicholas Piggin > + > return err; > } >

Re: [PATCH v1 1/4] kasan: Avoid sleepable page allocation from atomic context

2025-04-10 Thread Nicholas Piggin
pc64's requirement at least looks right to me so for that, Reviewed-by: Nicholas Piggin > > Signed-off-by: Alexander Gordeev > --- > mm/kasan/shadow.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/mm/kasan/shadow.c b/mm/kasan/shadow.c &g

Re: panic in cpufreq_online() in 6.14-rc1 on PowerNV

2025-02-17 Thread Nicholas Piggin
On Thu Feb 6, 2025 at 6:41 PM AEST, Dan Horák wrote: > Hi, > > I am getting a kernel panic on my Raptor Talos Power9 system after > updating to the 6.14-rc1 kernel from 6.13. Seems reproducable every > time, but I haven't start bisecting yet. Does it sound familiar to > anyone? No, but it's possib

[RFC PATCH 0/2] powerpc: change syscall error return scheme

2025-01-29 Thread Nicholas Piggin
break some corner case. This could possibly be done for the other weird archs too, if it works out for powerpc Thanks, Nick Nicholas Piggin (2): powerpc/signal: Clean up pt_regs access powerpc/syscall: rework syscall return value handling arch/powerpc/include/asm/ptrace.h | 13

[RFC PATCH 2/2] powerpc/syscall: rework syscall return value handling

2025-01-29 Thread Nicholas Piggin
ers, and recent 64-bit powerpc that use scv 0 for the past few years have the same limitation too. Signed-off-by: Nicholas Piggin --- arch/powerpc/include/asm/ptrace.h | 13 + arch/powerpc/include/asm/syscall.h| 31 +- arch/powerpc/kernel/interrupt.c

[RFC PATCH 1/2] powerpc/signal: Clean up pt_regs access

2025-01-29 Thread Nicholas Piggin
There are places in signal code that are made more readable by using a 'regs' local variable instead of finding it from the task. Signed-off-by: Nicholas Piggin --- arch/powerpc/kernel/signal.c| 11 ++- arch/powerpc/kernel/signal_64.c | 5 +++-- 2 files changed, 9 insert

Re: [PATCH 2/5] powerpc/microwatt: Device-tree updates

2025-01-29 Thread Nicholas Piggin
On Wed Jan 29, 2025 at 5:18 PM AEST, Paul Mackerras wrote: > On Wed, Jan 29, 2025 at 04:36:14PM +1000, Nicholas Piggin wrote: >> On Wed Jan 29, 2025 at 8:52 AM AEST, Paul Mackerras wrote: >> > Microwatt now implements ISA v3.1 (SFFS compliancy subset), including >> >

Re: [PATCH 4/5] powerpc: Define config option for processors without broadcast TLBIE

2025-01-29 Thread Nicholas Piggin
On Wed Jan 29, 2025 at 5:10 PM AEST, Paul Mackerras wrote: > On Wed, Jan 29, 2025 at 04:14:25PM +1000, Nicholas Piggin wrote: >> On Wed Jan 29, 2025 at 8:53 AM AEST, Paul Mackerras wrote: >> > Power ISA v3.1 implementations in the Linux Compliancy Subset and >> >

Re: [PATCH 5/5] powerpc/microwatt: Add SMP support

2025-01-29 Thread Nicholas Piggin
On Wed Jan 29, 2025 at 4:57 PM AEST, Paul Mackerras wrote: > On Wed, Jan 29, 2025 at 04:21:26PM +1000, Nicholas Piggin wrote: >> On Wed Jan 29, 2025 at 8:55 AM AEST, Paul Mackerras wrote: >> > This adds support for Microwatt systems with more than one core, and >> > upda

Re: [PATCH 2/5] powerpc/microwatt: Device-tree updates

2025-01-28 Thread Nicholas Piggin
vailable in ISA v3.0. Not that we do much with it at the moment IIRC, but there were dreams of wiring it in for compat guests. With that fixed, Acked-by: Nicholas Piggin Thanks, Nick > > Besides updating the ibm,powerpc-cpu-features property to reflect the > above, this also makes the

Re: [PATCH 5/5] powerpc/microwatt: Add SMP support

2025-01-28 Thread Nicholas Piggin
On Wed Jan 29, 2025 at 8:55 AM AEST, Paul Mackerras wrote: > This adds support for Microwatt systems with more than one core, and > updates the device tree for a 2-core version. (This does not prevent > the kernel from running on a single-core system.) > > Signed-off-by: Paul Mackerras Well, I'm

Re: [PATCH 4/5] powerpc: Define config option for processors without broadcast TLBIE

2025-01-28 Thread Nicholas Piggin
t required to operate on the TLBs > + in all CPUs in the system. Instead, the kernel does an IPI > + to each relevant CPU to get it to do a local TLBIE instruction. > + Select this option to force global invalidations to be done via > + IPIs unconditionally. ...

Re: [PATCH 3/5] powerpc/microwatt: Define an idle power-save function

2025-01-28 Thread Nicholas Piggin
On Wed Jan 29, 2025 at 8:52 AM AEST, Paul Mackerras wrote: > This uses the 'wait' instruction to pause instruction execution when > idle until an interrupt occurs. > > Signed-off-by: Paul Mackerras > --- > arch/powerpc/platforms/microwatt/setup.c | 9 + > 1 file changed, 9 insertions(+) >

Re: [PATCH 1/5] powerpc/microwatt: Select COMMON_CLK in order to get the clock framework

2025-01-28 Thread Nicholas Piggin
On Wed Jan 29, 2025 at 8:51 AM AEST, Paul Mackerras wrote: > This is to allow us to select Litex MMC host controller driver, which > drives the litesdcard gateware. > > Signed-off-by: Paul Mackerras Acked-by: Nicholas Piggin > --- > arch/powerpc/platforms/microwatt/Kconf

Re: [PATCH 1/5] KVM: e500: always restore irqs

2025-01-20 Thread Nicholas Piggin
g > Reported-by: Sean Christopherson > Signed-off-by: Paolo Bonzini Reviewed-by: Nicholas Piggin > --- > arch/powerpc/kvm/e500_mmu_host.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/arch/powerpc/kvm/e500_mmu_host.c > b/arch/powerpc/k

Re: [kvm-unit-tests PATCH 1/2] configure: Introduce add-config

2024-09-10 Thread Nicholas Piggin
On Wed Sep 4, 2024 at 12:39 AM AEST, Andrew Jones wrote: > Allow users to add additional CONFIG_* and override defaults > by concatenating a given file with #define's and #undef's to > lib/config.h That's a horrible config format lol, but probbaly the simplest way to get something working. What if

Re: [kvm-unit-tests PATCH v2 4/4] riscv: gitlab-ci: Add clang build tests

2024-09-10 Thread Nicholas Piggin
On Wed Sep 4, 2024 at 8:50 PM AEST, Andrew Jones wrote: > Test building 32 and 64-bit with clang. Throw a test of in- and out- > of-tree building in too by swapping which is done to which (32-bit > vs. 64-bit) with respect to the gcc build tests. > Acked-by: Nicholas Piggin > A

Re: [kvm-unit-tests PATCH v2 3/4] configure: Support cross compiling with clang

2024-09-10 Thread Nicholas Piggin
x27;--target=riscv64' \ > --cross-prefix=riscv64-linux-gnu- Nice. Perhaps add a recipe to README? Reviewed-by: Nicholas Piggin Thanks, Nick > > Reviewed-by: Thomas Huth > Signed-off-by: Andrew Jones > --- > configure | 11 --- > 1 file changed

Re: [kvm-unit-tests PATCH v2 2/4] Makefile: Prepare for clang EFI builds

2024-09-10 Thread Nicholas Piggin
ake such changes here. Okay in that case since it's limited to EFI. Reviewed-by: Nicholas Piggin > > Signed-off-by: Andrew Jones > --- > Makefile | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/Makefile b/Makefile > index 3d51cb726120..7471f7285b7

Re: [kvm-unit-tests PATCH v2 1/4] riscv: Drop mstrict-align

2024-09-10 Thread Nicholas Piggin
On Wed Sep 4, 2024 at 8:50 PM AEST, Andrew Jones wrote: > The spec says unaligned accesses are supported, so this isn't required > and clang doesn't support it. A platform might have slow unaligned > accesses, but kvm-unit-tests isn't about speed anyway. > > Reviewed-by: Thomas Huth > Signed-off-b

Re: [PATCH] powerpc/qspinlock: Fix deadlock in MCS queue

2024-08-27 Thread Nicholas Piggin
has been freed, but node->lock has not yet been cleared. Basically equivalent to the problem solved by the barrier() on the count++ side. This reordering would not cause a problem in your scenario AFAIKS because when the lock call returns, node->lock *will* be cleared so it can not cause a problem later. Still, should we put a barrier() between these just to make things a bit cleaner? I.e., when count is decremented, we definitely won't do any other stores to node. Otherwise, Reviewed-by: Nicholas Piggin Thanks, Nick

Re: [kvm-unit-tests PATCH] build: retain intermediate .aux.o targets

2024-07-25 Thread Nicholas Piggin
On Fri Jun 14, 2024 at 6:38 PM AEST, Nicholas Piggin wrote: > On Fri Jun 14, 2024 at 11:08 AM AEST, Segher Boessenkool wrote: > > On Fri, Jun 14, 2024 at 10:43:39AM +1000, Nicholas Piggin wrote: > > > On Wed Jun 12, 2024 at 6:28 PM AEST, Segher Boessenkool wrote: > > > &

Re: [RFC PATCH v4 13/17] powerpc64/ftrace: Support .text larger than 32MB with out-of-line stubs

2024-07-15 Thread Nicholas Piggin
On Sun Jul 14, 2024 at 6:27 PM AEST, Naveen N Rao wrote: > We are restricted to a .text size of ~32MB when using out-of-line > function profile sequence. Allow this to be extended up to the previous > limit of ~64MB by reserving space in the middle of .text. > > A new config option CONFIG_PPC_FTRAC

Re: [RFC PATCH v4 12/17] powerpc64/ftrace: Move ftrace sequence out of line

2024-07-15 Thread Nicholas Piggin
On Sun Jul 14, 2024 at 6:27 PM AEST, Naveen N Rao wrote: > Function profile sequence on powerpc includes two instructions at the > beginning of each function: > mflrr0 > bl ftrace_caller > > The call to ftrace_caller() gets nop'ed out during kernel boot and is > patched in when

Re: [RFC PATCH v4 11/17] kbuild: Add generic hook for architectures to use before the final vmlinux link

2024-07-15 Thread Nicholas Piggin
On Sun Jul 14, 2024 at 6:27 PM AEST, Naveen N Rao wrote: > On powerpc, we would like to be able to make a pass on vmlinux.o and > generate a new object file to be linked into vmlinux. Add a generic pass > in Makefile.vmlinux that architectures can use for this purpose. > > Architectures need to sel

Re: [RFC PATCH v4 08/17] powerpc/ftrace: Move ftrace stub used for init text before _einittext

2024-07-14 Thread Nicholas Piggin
On Sun Jul 14, 2024 at 6:27 PM AEST, Naveen N Rao wrote: > Move the ftrace stub used to cover inittext before _einittext so that it > is within kernel text, as seen through core_kernel_text(). This is > required for a subsequent change to ftrace. Hmm, is there a reason it was outside einittext any

Re: [RFC PATCH 1/2] Revert "KVM: PPC: Book3S HV Nested: Stop forwarding all HFUs to L1"

2024-07-04 Thread Nicholas Piggin
e-tree or similar, and we could special case the HFAC->HEAI if necessary then. Reviewed-by: Nicholas Piggin > > Signed-off-by: Gautam Menghani > --- > arch/powerpc/kvm/book3s_hv.c | 31 ++- > 1 file changed, 2 insertions(+), 29 deletions(-) > > diff --

Re: [RFC PATCH 2/2] arch/powerpc/kvm: Fix doorbells for nested KVM guests on PowerNV

2024-07-04 Thread Nicholas Piggin
On Fri Jun 28, 2024 at 4:03 AM AEST, Gautam Menghani wrote: > commit 6398326b9ba1("KVM: PPC: Book3S HV P9: Stop using vc->dpdes") > introduced an optimization to use only vcpu->doorbell_request for SMT > emulation for Power9 and above guests, but the code for nested guests > still relies on the ol

Re: [RFC PATCH v3 11/11] powerpc64/bpf: Add support for bpf trampolines

2024-07-01 Thread Nicholas Piggin
On Fri Jun 21, 2024 at 5:09 AM AEST, Naveen N Rao wrote: > Add support for bpf_arch_text_poke() and arch_prepare_bpf_trampoline() > for 64-bit powerpc. What do BPF trampolines give you? > BPF prog JIT is extended to mimic 64-bit powerpc approach for ftrace > having a single nop at function entry,

Re: [RFC PATCH v3 06/11] powerpc64/ftrace: Move ftrace sequence out of line

2024-07-01 Thread Nicholas Piggin
On Fri Jun 21, 2024 at 4:54 AM AEST, Naveen N Rao wrote: > Function profile sequence on powerpc includes two instructions at the > beginning of each function: > mflrr0 > bl ftrace_caller > > The call to ftrace_caller() gets nop'ed out during kernel boot and is > patched in when

Re: [RFC PATCH v3 05/11] kbuild: Add generic hook for architectures to use before the final vmlinux link

2024-07-01 Thread Nicholas Piggin
On Fri Jun 21, 2024 at 4:54 AM AEST, Naveen N Rao wrote: > On powerpc, we would like to be able to make a pass on vmlinux.o and > generate a new object file to be linked into vmlinux. Add a generic pass > in Makefile.vmlinux that architectures can use for this purpose. > > Architectures need to sel

Re: [RFC PATCH v3 04/11] powerpc/ftrace: Remove pointer to struct module from dyn_arch_ftrace

2024-07-01 Thread Nicholas Piggin
*/ > - if (!rec->arch.mod) { > - pr_err("No module loaded\n"); > - return -EINVAL; > - } > - A couple of these conversions are not _exactly_ the same (lost the pr_err here), maybe that's deliberate because the messages don't look too useful. Looks okay though Reviewed-by: Nicholas Piggin

Re: [RFC PATCH v3 03/11] powerpc/module_64: Convert #ifdef to IS_ENABLED()

2024-07-01 Thread Nicholas Piggin
pc64_stub_entry); LGTM. Hmm, you could get even cleverer // make the trampoline to the ftrace_caller and ftrace_regs_caller relocs += IS_ENABLED(CONFIG_DYNAMIC_FTRACE) + IS_ENABLED(CONFIG_DYNAMIC_FTRACE_WITH_REGS); But either way Reviewed-by: Nicholas Piggin Thanks, Nick

Re: [RFC PATCH v3 02/11] powerpc/ftrace: Unify 32-bit and 64-bit ftrace entry code

2024-07-01 Thread Nicholas Piggin
ave the original return address in A's stack frame */ > + PPC_STL r0, LRSAVE(r1) > /* Create a minimal stack frame for representing B */ > PPC_STLUr1, -STACK_FRAME_MIN_SIZE(r1) > > @@ -44,8 +46,6 @@ > SAVE_GPRS(3, 10, r1) > > #ifdef CONFIG_PPC64 > - /* Save the original return address in A's stack frame */ > - std r0, LRSAVE+SWITCH_FRAME_SIZE+STACK_FRAME_MIN_SIZE(r1) > /* Ok to continue? */ > lbz r3, PACA_FTRACE_ENABLED(r13) > cmpdi r3, 0 That seems right to me. Reviewed-by: Nicholas Piggin

Re: [RFC PATCH v3 01/11] powerpc/kprobes: Use ftrace to determine if a probe is at function entry

2024-07-01 Thread Nicholas Piggin
On Fri Jun 21, 2024 at 4:54 AM AEST, Naveen N Rao wrote: > Rather than hard-coding the offset into a function to be used to > determine if a kprobe is at function entry, use ftrace_location() to > determine the ftrace location within the function and categorize all > instructions till that offset t

Re: [PATCH v6 21/23] powerpc/64s: Use contiguous PMD/PUD instead of HUGEPD

2024-06-25 Thread Nicholas Piggin
On Tue Jun 25, 2024 at 3:20 PM AEST, LEROY Christophe wrote: > > > Le 25/06/2024 à 06:49, Nicholas Piggin a écrit : > > On Tue Jun 25, 2024 at 12:45 AM AEST, Christophe Leroy wrote: > >> On book3s/64, the only user of hugepd is hash in 4k mode. > >> > >>

[PATCH] powerpc/pseries: Fix scv instruction crash with kexec

2024-06-25 Thread Nicholas Piggin
ed-by: Sourabh Jain Fixes: 7fa95f9adaee7 ("powerpc/64s: system call support for scv/rfscv instructions") Signed-off-by: Nicholas Piggin --- arch/powerpc/kexec/core_64.c | 11 +++ arch/powerpc/platforms/pseries/kexec.c | 8 arch/powerpc/platforms/pseries

Re: [PATCH v6 21/23] powerpc/64s: Use contiguous PMD/PUD instead of HUGEPD

2024-06-24 Thread Nicholas Piggin
On Tue Jun 25, 2024 at 12:45 AM AEST, Christophe Leroy wrote: > On book3s/64, the only user of hugepd is hash in 4k mode. > > All other setups (hash-64, radix-4, radix-64) use leaf PMD/PUD. > > Rework hash-4k to use contiguous PMD and PUD instead. > > In that setup there are only two huge page size

Re: [kvm-unit-tests PATCH v10 08/15] powerpc: add pmu tests

2024-06-24 Thread Nicholas Piggin
On Wed Jun 19, 2024 at 4:39 AM AEST, Thomas Huth wrote: > On 12/06/2024 07.23, Nicholas Piggin wrote: > > Add some initial PMU testing. > > > > - PMC5/6 tests > > - PMAE / PMI test > > - BHRB basic tests > > > > Signed-off-by: Nicholas Piggin &

Re: [kvm-unit-tests PATCH] build: retain intermediate .aux.o targets

2024-06-14 Thread Nicholas Piggin
On Fri Jun 14, 2024 at 11:08 AM AEST, Segher Boessenkool wrote: > On Fri, Jun 14, 2024 at 10:43:39AM +1000, Nicholas Piggin wrote: > > On Wed Jun 12, 2024 at 6:28 PM AEST, Segher Boessenkool wrote: > > > On Wed, Jun 12, 2024 at 02:42:32PM +1000, Nicholas Piggin wrote: > >

Re: [kvm-unit-tests PATCH v10 12/15] scripts/arch-run.bash: Fix run_panic() success exit status

2024-06-13 Thread Nicholas Piggin
On Wed Jun 12, 2024 at 5:26 PM AEST, Andrew Jones wrote: > On Wed, Jun 12, 2024 at 03:23:17PM GMT, Nicholas Piggin wrote: > > run_qemu_status() looks for "EXIT: STATUS=%d" if the harness command > > returned 1, to determine the final status of the test. In the case of >

Re: [kvm-unit-tests PATCH] build: retain intermediate .aux.o targets

2024-06-13 Thread Nicholas Piggin
On Wed Jun 12, 2024 at 6:28 PM AEST, Segher Boessenkool wrote: > On Wed, Jun 12, 2024 at 02:42:32PM +1000, Nicholas Piggin wrote: > > arm, powerpc, riscv, build .aux.o targets with implicit pattern rules > > in dependency chains that cause them to be made as intermediate files

[kvm-unit-tests PATCH v10 15/15] powerpc/gitlab-ci: Enable more tests with Fedora 40

2024-06-11 Thread Nicholas Piggin
With Fedora 40 (QEMU 8.2), more tests can be enabled. Signed-off-by: Nicholas Piggin --- .gitlab-ci.yml| 2 +- powerpc/unittests.cfg | 17 - 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index ffb3767ec..ee14330a3 100644

[kvm-unit-tests PATCH v10 14/15] powerpc/gitlab-ci: Upgrade powerpc to Fedora 40

2024-06-11 Thread Nicholas Piggin
QEMU has fixed a number of powerpc test fails in Fedora 40, so upgrade to that image. Other architectures seem to be okay with Fedora 40 except for x86-64, which fails some xsave and realmode tests, so only change powerpc to start with. Signed-off-by: Nicholas Piggin --- .gitlab-ci.yml | 2

[kvm-unit-tests PATCH v10 13/15] powerpc: Add a panic test

2024-06-11 Thread Nicholas Piggin
This adds a simple panic test for pseries and powernv that works with TCG (unlike the s390x panic tests), making it easier to test this part of the harness code. Signed-off-by: Nicholas Piggin --- lib/powerpc/asm/rtas.h | 1 + lib/powerpc/rtas.c | 16 powerpc/run

[kvm-unit-tests PATCH v10 12/15] scripts/arch-run.bash: Fix run_panic() success exit status

2024-06-11 Thread Nicholas Piggin
e. With this change, running a panic test returns 0 on success (panic), and the run_test.sh unit test correctly displays it as PASS rather than FAIL. Signed-off-by: Nicholas Piggin --- scripts/arch-run.bash | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/arch-run.bash b/scripts

[kvm-unit-tests PATCH v10 11/15] powerpc: gitlab CI update

2024-06-11 Thread Nicholas Piggin
, atomics) that are known to work in CI. Signed-off-by: Nicholas Piggin --- .gitlab-ci.yml| 32 powerpc/unittests.cfg | 34 +++--- 2 files changed, 35 insertions(+), 31 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index

[kvm-unit-tests PATCH v10 10/15] powerpc: Remove remnants of ppc64 directory and build structure

2024-06-11 Thread Nicholas Piggin
This moves merges ppc64 directories and files into powerpc, and merges the 3 makefiles into one. The configure --arch=powerpc option is aliased to ppc64 for good measure. Acked-by: Thomas Huth Signed-off-by: Nicholas Piggin --- MAINTAINERS| 1 - configure

[kvm-unit-tests PATCH v10 09/15] configure: Make arch_libdir a first-class entity

2024-06-11 Thread Nicholas Piggin
dev Cc: kvm-ri...@lists.infradead.org Cc: linuxppc-dev@lists.ozlabs.org Reviewed-by: Andrew Jones Signed-off-by: Nicholas Piggin --- Makefile | 2 +- configure | 18 +- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index 5b7998b79..7fe93dfd8

[kvm-unit-tests PATCH v10 08/15] powerpc: add pmu tests

2024-06-11 Thread Nicholas Piggin
Add some initial PMU testing. - PMC5/6 tests - PMAE / PMI test - BHRB basic tests Signed-off-by: Nicholas Piggin --- lib/powerpc/asm/processor.h | 2 + lib/powerpc/asm/reg.h | 9 + lib/powerpc/asm/setup.h | 1 + lib/powerpc/setup.c | 20 ++ powerpc/Makefile.common

[kvm-unit-tests PATCH v10 07/15] powerpc: add usermode support

2024-06-11 Thread Nicholas Piggin
leged instruction interrupt test is added. Reviewed-by: Thomas Huth Signed-off-by: Nicholas Piggin --- lib/powerpc/asm/processor.h | 9 + lib/powerpc/asm/reg.h | 1 + lib/powerpc/asm/smp.h | 1 + lib/powerpc/io.c| 7 +++ lib/powerpc/processor.c

[kvm-unit-tests PATCH v10 06/15] powerpc: Add sieve.c common test

2024-06-11 Thread Nicholas Piggin
Now that sieve copes with lack of MMU support, it can be run by powerpc. Reviewed-by: Thomas Huth Signed-off-by: Nicholas Piggin --- powerpc/Makefile.common | 1 + powerpc/sieve.c | 1 + powerpc/unittests.cfg | 3 +++ 3 files changed, 5 insertions(+) create mode 12 powerpc

[kvm-unit-tests PATCH v10 05/15] common/sieve: Support machines without MMU

2024-06-11 Thread Nicholas Piggin
Not all powerpc CPUs provide MMU support. Define vm_available() that is true by default but archs can override it. Use this to run VM tests. Reviewed-by: Thomas Huth Reviewed-by: Andrew Jones Signed-off-by: Nicholas Piggin --- common/sieve.c | 14 -- lib/ppc64/asm/mmu.h | 1

[kvm-unit-tests PATCH v10 04/15] powerpc: Add MMU support

2024-06-11 Thread Nicholas Piggin
Add support for radix MMU, 4kB and 64kB pages. This also adds MMU interrupt test cases, and runs the interrupts test entirely with MMU enabled if it is available (aside from machine check tests). Acked-by: Andrew Jones (configure changes) Signed-off-by: Nicholas Piggin --- configure

[kvm-unit-tests PATCH v10 03/15] powerpc: Add timebase tests

2024-06-11 Thread Nicholas Piggin
This has a known failure on QEMU TCG machines where the decrementer interrupt is not lowered when the DEC wraps from -ve to +ve. Signed-off-by: Nicholas Piggin --- lib/powerpc/asm/reg.h | 1 + powerpc/Makefile.common | 1 + powerpc/timebase.c | 350

[kvm-unit-tests PATCH v10 02/15] powerpc: Add atomics tests

2024-06-11 Thread Nicholas Piggin
Add some tests for larx/stcx. operations for certain edge cases including migration, as well as some simple performance tests. Signed-off-by: Nicholas Piggin --- powerpc/Makefile.common | 1 + powerpc/atomics.c | 386 powerpc/unittests.cfg

[kvm-unit-tests PATCH v10 01/15] powerpc: Add facility to query TCG or KVM host

2024-06-11 Thread Nicholas Piggin
accurately determine this in future. Use this facility to restrict some of the known test failures to TCG. Reviewed-by: Thomas Huth Signed-off-by: Nicholas Piggin --- lib/powerpc/asm/processor.h | 3 +++ lib/powerpc/setup.c | 26 ++ powerpc/interrupts.c| 6

[kvm-unit-tests PATCH v10 00/15] powerpc improvements

2024-06-11 Thread Nicholas Piggin
panic test user but it requires KVM so I couldn't see if run_tests.sh looks sane there, but the harness needed a fix to work on powerpc. Thanks, Nick Nicholas Piggin (15): powerpc: Add facility to query TCG or KVM host powerpc: Add atomics tests powerpc: Add timebase tests powerpc: Ad

[kvm-unit-tests PATCH] build: retain intermediate .aux.o targets

2024-06-11 Thread Nicholas Piggin
, for consistency. Suggested-by: Marc Hartmayer Signed-off-by: Nicholas Piggin --- arm/Makefile.common | 2 +- powerpc/Makefile.common | 2 +- riscv/Makefile | 2 +- s390x/Makefile | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/arm/Makefile.common b

Re: [PATCH v2 0/8] KVM: PPC: Book3S HV: Nested guest migration fixes

2024-06-05 Thread Nicholas Piggin
On Wed Jun 5, 2024 at 11:06 PM AEST, Shivaprasad G Bhat wrote: > The series fixes the issues exposed by the kvm-unit-tests[1] > sprs-migration test. > > The SDAR, MMCR3 were seen to have some typo/refactoring bugs. > The first two patches fix them. > > The remaining patches take care of save-restor

Re: [PATCH v2 0/2] Fix doorbell emulation for v2 API on PPC

2024-06-05 Thread Nicholas Piggin
On Wed Jun 5, 2024 at 9:39 PM AEST, Gautam Menghani wrote: > Doorbell emulation for KVM on PAPR guests is broken as support for DPDES > was not added in initial patch series [1]. > Add DPDES support and doorbell handling support for V2 API. Looks good, thanks. So fix for v1 doorbells is coming?

Re: [PATCH v2 2/2] arch/powerpc/kvm: Fix doorbell emulation for v2 API

2024-06-05 Thread Nicholas Piggin
st \ > -nographic \ > -machine pseries,ic-mode=xics -accel kvm > > Add doorbell state handling support in the host > KVM code to fix doorbell emulation. Reviewed-by: Nicholas Piggin > > Fixes: 19d31c5f1157 ("KVM: PPC: Add support for nestedv2 guests&qu

Re: [PATCH v2 1/2] arch/powerpc/kvm: Add DPDES support in helper library for Guest state buffer

2024-06-05 Thread Nicholas Piggin
On Wed Jun 5, 2024 at 9:39 PM AEST, Gautam Menghani wrote: > Add support for using DPDES in the library for using guest state > buffers. DPDES support is needed for enabling usage of doorbells in a > L2 KVM on PAPR guest. > Reviewed-by: Nicholas Piggin > Fixes: 6ccbbc33f06a

Re: [kvm-unit-tests PATCH v9 29/31] powerpc: Remove remnants of ppc64 directory and build structure

2024-06-05 Thread Nicholas Piggin
On Tue Jun 4, 2024 at 11:36 PM AEST, Andrew Jones wrote: > On Tue, Jun 04, 2024 at 12:49:51PM GMT, Thomas Huth wrote: > > On 04/05/2024 14.28, Nicholas Piggin wrote: > > > This moves merges ppc64 directories and files into powerpc, and > > > merges the 3 makefiles

Re: [kvm-unit-tests PATCH v9 31/31] powerpc: gitlab CI update

2024-06-04 Thread Nicholas Piggin
On Tue Jun 4, 2024 at 9:01 PM AEST, Thomas Huth wrote: > On 04/05/2024 14.28, Nicholas Piggin wrote: > > This adds testing for the powernv machine, and adds a gitlab-ci test > > group instead of specifying all tests in .gitlab-ci.yml, and adds a > > few new tests (smp, atomi

Re: [kvm-unit-tests PATCH v9 27/31] powerpc: add pmu tests

2024-06-04 Thread Nicholas Piggin
On Tue Jun 4, 2024 at 8:38 PM AEST, Thomas Huth wrote: > On 04/05/2024 14.28, Nicholas Piggin wrote: > > Add some initial PMU testing. > > > > - PMC5/6 tests > > - PMAE / PMI test > > - BHRB basic tests > > > > Signed-off-by: Nicholas Piggin > &g

Re: [kvm-unit-tests PATCH v9 22/31] powerpc: Add MMU support

2024-06-04 Thread Nicholas Piggin
On Tue Jun 4, 2024 at 5:30 PM AEST, Thomas Huth wrote: > On 04/05/2024 14.28, Nicholas Piggin wrote: > > Add support for radix MMU, 4kB and 64kB pages. > > > > This also adds MMU interrupt test cases, and runs the interrupts > > test entirely with MMU enabled if

Re: [kvm-unit-tests PATCH v9 21/31] powerpc: Add timebase tests

2024-06-04 Thread Nicholas Piggin
On Tue Jun 4, 2024 at 4:12 PM AEST, Thomas Huth wrote: > On 04/05/2024 14.28, Nicholas Piggin wrote: > > This has a known failure on QEMU TCG machines where the decrementer > > interrupt is not lowered when the DEC wraps from -ve to +ve. > > Would it then make sense to mar

Re: [kvm-unit-tests PATCH v9 20/31] powerpc: Add atomics tests

2024-06-04 Thread Nicholas Piggin
On Tue Jun 4, 2024 at 3:29 PM AEST, Thomas Huth wrote: > On 04/05/2024 14.28, Nicholas Piggin wrote: > > Signed-off-by: Nicholas Piggin > > --- > > Please provide at least a short patch description about what is being tested > here! Will do. Thanks, Nick

Re: [kvm-unit-tests PATCH v9 19/31] powerpc: Avoid using larx/stcx. in spinlocks when only one CPU is running

2024-06-04 Thread Nicholas Piggin
On Tue Jun 4, 2024 at 3:27 PM AEST, Thomas Huth wrote: > On 04/05/2024 14.28, Nicholas Piggin wrote: > > The test harness uses spinlocks if they are implemented with larx/stcx. > > it can prevent some test scenarios such as testing migration of a > > reservation. > >

Re: [PATCH 6/6] KVM: PPC: Book3S HV: Add one-reg interface for HASHKEYR register

2024-06-03 Thread Nicholas Piggin
On Mon Jun 3, 2024 at 9:15 PM AEST, Shivaprasad G Bhat wrote: > The patch adds a one-reg register identifier which can be used to > read and set the virtual HASHKEYR for the guest during enter/exit > with KVM_REG_PPC_HASHKEYR. The specific SPR KVM API documentation > too updated. > > Signed-off-by:

Re: [PATCH 0/6] KVM: PPC: Book3S HV: Nested guest migration fixes

2024-06-03 Thread Nicholas Piggin
On Mon Jun 3, 2024 at 9:13 PM AEST, Shivaprasad G Bhat wrote: > The series fixes the issues exposed by the kvm-unit-tests[1] > sprs-migration test. > > The SDAR, MMCR3 were seen to have some typo/refactoring bugs. > The first two patches fix them. > > Though the nestedv2 APIs defined the guest stat

Re: [PATCH 5/6] KVM: PPC: Book3S HV nestedv2: Keep nested guest HASHKEYR in sync

2024-06-03 Thread Nicholas Piggin
> + ulong hashkeyr; > ulong ciabr; > ulong cfar; > ulong ppr; Same comment applies Reviewed-by: Nicholas Piggin Thanks, Nick > diff --git a/arch/powerpc/kvm/book3s_hv.h b/arch/powerpc/kvm/book3s_hv.h > index 7b0fd282fe95..c073fdfa7dc4 100644 > --- a/

Re: [PATCH 3/6] KVM: PPC: Book3S HV nestedv2: Keep nested guest DEXCR in sync

2024-06-03 Thread Nicholas Piggin
dexcr; > ulong ciabr; > ulong cfar; > ulong ppr; Actually I would reorder the patches so you introduce the KVM reg first, and put this hunk there. The nested v2 bits look okay. For them, Reviewed-by: Nicholas Piggin > diff --git a/arch/powerpc/kvm/book3s_hv.h b/

Re: [PATCH 6/6] KVM: PPC: Book3S HV: Add one-reg interface for HASHKEYR register

2024-06-03 Thread Nicholas Piggin
Reviewed-by: Nicholas Piggin > > Signed-off-by: Shivaprasad G Bhat > --- > Documentation/virt/kvm/api.rst|1 + > arch/powerpc/include/uapi/asm/kvm.h |1 + > arch/powerpc/kvm/book3s_hv.c |6 ++ > tools/arch/powerpc/include/uapi/asm/

Re: [PATCH 4/6] KVM: PPC: Book3S HV: Add one-reg interface for DEXCR register

2024-06-03 Thread Nicholas Piggin
the uapi and documentation parts should go in their own patch in a ppc kvm uapi topic branch? Otherwise looks okay. Reviewed-by: Nicholas Piggin > > Signed-off-by: Shivaprasad G Bhat > --- > Documentation/virt/kvm/api.rst|1 + > arch/powerpc/include/uapi/asm/kvm.h

Re: [kvm-unit-tests PATCH v9 14/31] powerpc: Remove broken SMP exception stack setup

2024-06-03 Thread Nicholas Piggin
On Mon Jun 3, 2024 at 7:30 PM AEST, Thomas Huth wrote: > On 04/05/2024 14.28, Nicholas Piggin wrote: > > The exception stack setup does not work correctly for SMP, because > > it is the boot processor that calls cpu_set() which sets SPRG2 to > > the exception stack, not the

Re: [PATCH v1 RESEND] arch/powerpc/kvm: Fix doorbell emulation by adding DPDES support

2024-06-03 Thread Nicholas Piggin
On Mon Jun 3, 2024 at 5:09 PM AEST, Gautam Menghani wrote: > On Mon, Jun 03, 2024 at 03:42:22PM GMT, Nicholas Piggin wrote: > > On Wed May 22, 2024 at 6:49 PM AEST, Gautam Menghani wrote: > > > Doorbell emulation is broken for KVM on PowerVM guests as support for > > >

Re: [PATCH v1 RESEND] arch/powerpc/kvm: Fix doorbell emulation by adding DPDES support

2024-06-02 Thread Nicholas Piggin
On Wed May 22, 2024 at 6:49 PM AEST, Gautam Menghani wrote: > Doorbell emulation is broken for KVM on PowerVM guests as support for > DPDES was not added in the initial patch series. Due to this, a KVM on > PowerVM guest cannot be booted with the XICS interrupt controller as > doorbells are to be s

Re: [RFC PATCH v2 18/20] powerpc/64s: Use contiguous PMD/PUD instead of HUGEPD

2024-05-21 Thread Nicholas Piggin
On Tue May 21, 2024 at 2:43 AM AEST, Christophe Leroy wrote: > > > Le 20/05/2024 à 14:54, Nicholas Piggin a écrit : > > On Sat May 18, 2024 at 5:00 AM AEST, Christophe Leroy wrote: > >> On book3s/64, the only user of hugepd is hash in 4k mode. > >> > >> Al

Re: [RFC PATCH v2 18/20] powerpc/64s: Use contiguous PMD/PUD instead of HUGEPD

2024-05-20 Thread Nicholas Piggin
On Sat May 18, 2024 at 5:00 AM AEST, Christophe Leroy wrote: > On book3s/64, the only user of hugepd is hash in 4k mode. > > All other setups (hash-64, radix-4, radix-64) use leaf PMD/PUD. > > Rework hash-4k to use contiguous PMD and PUD instead. > > In that setup there are only two huge page sizes

Re: [kvm-unit-tests PATCH v9 07/31] scripts: allow machine option to be specified in unittests.cfg

2024-05-08 Thread Nicholas Piggin
On Wed May 8, 2024 at 11:36 PM AEST, Thomas Huth wrote: > On 08/05/2024 14.58, Thomas Huth wrote: > > On 08/05/2024 14.55, Thomas Huth wrote: > >> On 08/05/2024 14.27, Nicholas Piggin wrote: > >>> On Wed May 8, 2024 at 1:08 AM AEST, Thomas Huth wrote: > >>

Re: [PATCH v6] arch/powerpc/kvm: Add support for reading VPA counters for pseries guests

2024-05-08 Thread Nicholas Piggin
On Wed May 8, 2024 at 10:36 PM AEST, Michael Ellerman wrote: > Gautam Menghani writes: > > PAPR hypervisor has introduced three new counters in the VPA area of > > LPAR CPUs for KVM L2 guest (see [1] for terminology) observability - 2 > > for context switches from host to guest and vice versa, and

Re: [kvm-unit-tests PATCH v9 07/31] scripts: allow machine option to be specified in unittests.cfg

2024-05-08 Thread Nicholas Piggin
On Wed May 8, 2024 at 1:08 AM AEST, Thomas Huth wrote: > On 04/05/2024 14.28, Nicholas Piggin wrote: > > This allows different machines with different requirements to be > > supported by run_tests.sh, similarly to how different accelerators > > are handled. > >

Re: [PATCH v6] arch/powerpc/kvm: Add support for reading VPA counters for pseries guests

2024-05-08 Thread Nicholas Piggin
l2_to_l1_ns - local_paca->l2_to_l1_cs, > + l2_runtime_ns - > local_paca->l2_runtime_agg); > + local_paca->l1_to_l2_cs = l1_to_l2_ns; > + local_paca->l2_to_l1_cs = l2_to_l1_ns; > + local_paca->l2_runtime_agg = l2_runt

Re: [kvm-unit-tests PATCH v9 03/31] powerpc: Mark known failing tests as kfail

2024-05-06 Thread Nicholas Piggin
On Mon May 6, 2024 at 5:37 PM AEST, Thomas Huth wrote: > On 04/05/2024 14.28, Nicholas Piggin wrote: > > Mark the failing h_cede_tm and spapr_vpa tests as kfail. > > > > Signed-off-by: Nicholas Piggin > > --- > > powerpc/spapr_vpa.c | 3 ++- > > po

Re: [kvm-unit-tests PATCH v9 01/31] doc: update unittests doc

2024-05-06 Thread Nicholas Piggin
On Mon May 6, 2024 at 5:03 PM AEST, Thomas Huth wrote: > On 04/05/2024 14.28, Nicholas Piggin wrote: > > This adds a few minor fixes. > > > > Signed-off-by: Nicholas Piggin > > --- > > docs/unittests.txt | 12 +++- > > 1 file changed, 7 inse

[kvm-unit-tests PATCH v9 31/31] powerpc: gitlab CI update

2024-05-04 Thread Nicholas Piggin
This adds testing for the powernv machine, and adds a gitlab-ci test group instead of specifying all tests in .gitlab-ci.yml, and adds a few new tests (smp, atomics) that are known to work in CI. Signed-off-by: Nicholas Piggin --- .gitlab-ci.yml| 30

[kvm-unit-tests PATCH v9 30/31] powerpc: Add facility to query TCG or KVM host

2024-05-04 Thread Nicholas Piggin
incorrectly considered to be kvm && !tcg. Use this facility to restrict some of the known test failures to TCG. Signed-off-by: Nicholas Piggin --- lib/powerpc/asm/processor.h | 3 +++ lib/powerpc/setup.c | 25 + powerpc/atomics.c | 2 +-

[kvm-unit-tests PATCH v9 29/31] powerpc: Remove remnants of ppc64 directory and build structure

2024-05-04 Thread Nicholas Piggin
This moves merges ppc64 directories and files into powerpc, and merges the 3 makefiles into one. The configure --arch=powerpc option is aliased to ppc64 for good measure. Signed-off-by: Nicholas Piggin --- MAINTAINERS| 1 - configure

[kvm-unit-tests PATCH v9 28/31] configure: Make arch_libdir a first-class entity

2024-05-04 Thread Nicholas Piggin
dev Cc: kvm-ri...@lists.infradead.org Cc: linuxppc-dev@lists.ozlabs.org Reviewed-by: Andrew Jones Signed-off-by: Nicholas Piggin --- Makefile | 2 +- configure | 18 +- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index 5b7998b79..7fe93dfd8

[kvm-unit-tests PATCH v9 27/31] powerpc: add pmu tests

2024-05-04 Thread Nicholas Piggin
Add some initial PMU testing. - PMC5/6 tests - PMAE / PMI test - BHRB basic tests Signed-off-by: Nicholas Piggin --- lib/powerpc/asm/processor.h | 2 + lib/powerpc/asm/reg.h | 9 + lib/powerpc/asm/setup.h | 1 + lib/powerpc/setup.c | 23 ++ powerpc/Makefile.common

[kvm-unit-tests PATCH v9 26/31] powerpc: add usermode support

2024-05-04 Thread Nicholas Piggin
leged instruction interrupt test is added. Signed-off-by: Nicholas Piggin --- lib/powerpc/asm/processor.h | 9 + lib/powerpc/asm/reg.h | 1 + lib/powerpc/asm/smp.h | 1 + lib/powerpc/io.c| 7 +++ lib/powerpc/processor.c

[kvm-unit-tests PATCH v9 25/31] powerpc: Add sieve.c common test

2024-05-04 Thread Nicholas Piggin
Now that sieve copes with lack of MMU support, it can be run by powerpc. Signed-off-by: Nicholas Piggin --- powerpc/Makefile.common | 1 + powerpc/sieve.c | 1 + powerpc/unittests.cfg | 3 +++ 3 files changed, 5 insertions(+) create mode 12 powerpc/sieve.c diff --git a/powerpc

[kvm-unit-tests PATCH v9 24/31] common/sieve: Support machines without MMU

2024-05-04 Thread Nicholas Piggin
Not all powerpc CPUs provide MMU support. Define vm_available() that is true by default but archs can override it. Use this to run VM tests. Cc: Paolo Bonzini Cc: Thomas Huth Cc: k...@vger.kernel.org Reviewed-by: Andrew Jones Signed-off-by: Nicholas Piggin --- common/sieve.c | 14

[kvm-unit-tests PATCH v9 23/31] common/sieve: Use vmalloc.h for setup_mmu definition

2024-05-04 Thread Nicholas Piggin
ff-by: Nicholas Piggin --- common/sieve.c | 1 + lib/libcflat.h | 2 -- lib/s390x/io.c | 1 + lib/s390x/uv.h | 1 + lib/x86/vm.h | 1 + s390x/mvpg.c | 1 + s390x/selftest.c | 1 + x86/pmu.c | 1 + x86/pmu_lbr.c | 1 +

  1   2   3   4   5   6   7   8   9   10   >