Re: [kvm-unit-tests PATCH 04/32] powerpc: interrupt stack backtracing

2024-02-28 Thread Nicholas Piggin
On Wed Feb 28, 2024 at 9:46 PM AEST, Andrew Jones wrote: > On Mon, Feb 26, 2024 at 08:11:50PM +1000, Nicholas Piggin wrote: > > Add support for backtracing across interrupt stacks, and > > add interrupt frame backtrace for unhandled interrupts. > > > > Sig

Re: [kvm-unit-tests PATCH 04/13] treewide: lib/stack: Make base_address arch specific

2024-02-28 Thread Nicholas Piggin
On Thu Feb 29, 2024 at 1:04 AM AEST, Andrew Jones wrote: > Calculating the offset of an address is image specific, which is > architecture specific. Until now, all architectures and architecture > configurations which select CONFIG_RELOC were able to subtract > _etext, but the EFI configuration of

Re: [kvm-unit-tests PATCH 03/13] treewide: lib/stack: Fix backtrace

2024-02-28 Thread Nicholas Piggin
#else > -static inline int > -backtrace_frame(const void *frame __unused, const void **return_addrs > __unused, > - int max_depth __unused) > +extern int backtrace(const void **return_addrs, int max_depth); > + > +static inline int backtrace_frame(const void *frame, const void > **return_addrs, > + int max_depth) > { > return 0; > } > #endif > > -extern int backtrace(const void **return_addrs, int max_depth); > - > #endif Is there a reason to add the inline wrappers rather than just externs and drop the arch_ prefix? Do we want to just generally have all arch specific functions have an arch_ prefix? Fine by me. Reviewed-by: Nicholas Piggin I'm fine to rebase the powerpc patch on top of this if it goes in first. Thanks for the heads up. Thanks, Nick

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

2024-02-26 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. Signed-off-by: Nicholas Piggin --- .gitlab-ci.yml| 16 ++-- powerpc/unittests.cfg | 15 --- 2 files changed, 14 insertions(+), 17

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

2024-02-26 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 30/32] configure: Make arch_libdir a first-class entity

2024-02-26 Thread Nicholas Piggin
c: kvm...@lists.linux.dev Cc: kvm-ri...@lists.infradead.org Cc: linuxppc-dev@lists.ozlabs.org Signed-off-by: Nicholas Piggin --- Makefile | 2 +- configure | 18 +- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index 4f35fffc6..4e0f54543 100644

[kvm-unit-tests PATCH 29/32] configure: Fail on unknown arch

2024-02-26 Thread Nicholas Piggin
-dev@lists.ozlabs.org Signed-off-by: Nicholas Piggin --- configure | 11 --- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/configure b/configure index 6907ccbbb..ae522c556 100755 --- a/configure +++ b/configure @@ -45,7 +45,8 @@ usage() { Usage: $0 [options

[kvm-unit-tests PATCH 28/32] powerpc: add pmu tests

2024-02-26 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 27/32] powerpc: add usermode support

2024-02-26 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 26/32] powerpc: Add sieve.c common test

2024-02-26 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 25/32] common/sieve: Support machines without MMU

2024-02-26 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: Andrew Jones Cc: k...@vger.kernel.org Signed-off-by: Nicholas Piggin --- common/sieve.c | 14

[kvm-unit-tests PATCH 24/32] common/sieve: Use vmalloc.h for setup_mmu definition

2024-02-26 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 + x86/vme

[kvm-unit-tests PATCH 23/32] powerpc: Add MMU support

2024-02-26 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). Signed-off-by: Nicholas Piggin --- configure | 39 +++-- lib/powerpc/asm

[kvm-unit-tests PATCH 22/32] powerpc: Add timebase tests

2024-02-26 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 | 330

[kvm-unit-tests PATCH 21/32] powerpc: Add atomics tests

2024-02-26 Thread Nicholas Piggin
Signed-off-by: Nicholas Piggin --- powerpc/Makefile.common | 1 + powerpc/atomics.c | 373 powerpc/unittests.cfg | 9 + 3 files changed, 383 insertions(+) create mode 100644 powerpc/atomics.c diff --git a/powerpc/Makefile.common b/powerpc

[kvm-unit-tests PATCH 20/32] powerpc: Avoid using larx/stcx. in spinlocks when only one CPU is running

2024-02-26 Thread Nicholas Piggin
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. Signed-off-by: Nicholas Piggin --- lib/powerpc/asm/smp.h| 1 + lib/powerpc/smp.c| 5 + lib/powerpc/spinlock.c | 28

[kvm-unit-tests PATCH 19/32] powerpc: Permit ACCEL=tcg,thread=single

2024-02-26 Thread Nicholas Piggin
Modify run script to permit single vs mttcg threading, add a thread=single smp case to unittests.cfg. Signed-off-by: Nicholas Piggin --- powerpc/run | 4 ++-- powerpc/unittests.cfg | 6 ++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/powerpc/run b/powerpc/run

[kvm-unit-tests PATCH 18/32] powerpc: add SMP and IPI support

2024-02-26 Thread Nicholas Piggin
powerpc SMP support is very primitive and does not set up a first-class runtime environment for secondary CPUs. This reworks SMP support, and provides a complete C and harness environment for the secondaries, including interrupt handling, as well as IPI support. Signed-off-by: Nicholas Piggin

[kvm-unit-tests PATCH 17/32] arch-run: Fix handling multiple exit status messages

2024-02-26 Thread Nicholas Piggin
code should probably serialise this to prevent it, but at the moment not all do. So make the parser handle this by just looking at the first EXIT. Cc: Paolo Bonzini Cc: Thomas Huth Cc: Andrew Jones Cc: k...@vger.kernel.org Signed-off-by: Nicholas Piggin --- scripts/arch-run.bash | 2 +- 1 file ch

[kvm-unit-tests PATCH 16/32] powerpc: Remove broken SMP exception stack setup

2024-02-26 Thread Nicholas Piggin
stack for the boot processor. Make the stack 64kB while we're here, to match the size of the regular stack. Signed-off-by: Nicholas Piggin --- lib/powerpc/setup.c | 16 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/lib/powerpc/setup.c b/lib/powerpc/setup.c

[kvm-unit-tests PATCH 15/32] powerpc: Add rtas stop-self support

2024-02-26 Thread Nicholas Piggin
other rtas operations. Reviewed-by: Thomas Huth Signed-off-by: Nicholas Piggin --- lib/powerpc/asm/rtas.h | 2 ++ lib/powerpc/rtas.c | 78 +- 2 files changed, 64 insertions(+), 16 deletions(-) diff --git a/lib/powerpc/asm/rtas.h b/lib/powerpc/asm/r

[kvm-unit-tests PATCH 14/32] powerpc: general interrupt tests

2024-02-26 Thread Nicholas Piggin
Add basic testing of various kinds of interrupts, machine check, page fault, illegal, decrementer, trace, syscall, etc. This has a known failure on QEMU TCG pseries machines where MSR[ME] can be incorrectly set to 0. Signed-off-by: Nicholas Piggin --- lib/powerpc/asm/processor.h | 4 + lib

[kvm-unit-tests PATCH 13/32] powerpc/sprs: Test hypervisor registers on powernv machine

2024-02-26 Thread Nicholas Piggin
This enables HV privilege registers to be tested with the powernv machine. Acked-by: Thomas Huth Signed-off-by: Nicholas Piggin --- powerpc/sprs.c | 33 + 1 file changed, 25 insertions(+), 8 deletions(-) diff --git a/powerpc/sprs.c b/powerpc/sprs.c index

[kvm-unit-tests PATCH 12/32] powerpc: Fix emulator illegal instruction test for powernv

2024-02-26 Thread Nicholas Piggin
Illegal instructions cause 0xe40 (HEAI) interrupts rather than program interrupts. Acked-by: Thomas Huth Signed-off-by: Nicholas Piggin --- lib/powerpc/asm/processor.h | 1 + lib/powerpc/setup.c | 13 + powerpc/emulator.c | 21 - 3 files

[kvm-unit-tests PATCH 11/32] powerpc: Support powernv machine with QEMU TCG

2024-02-26 Thread Nicholas Piggin
Add support for QEMU's powernv machine. This uses standard firmware (skiboot) rather than a minimal firmware shim. Reviewed-by: Cédric Le Goater Signed-off-by: Nicholas Piggin --- lib/powerpc/asm/processor.h | 23 +++ lib/powerpc/asm/reg.h | 4 ++ lib/powerpc/hc

[kvm-unit-tests PATCH 10/32] scripts: Accommodate powerpc powernv machine differences

2024-02-26 Thread Nicholas Piggin
error message. Acked-by: Thomas Huth Signed-off-by: Nicholas Piggin --- scripts/runtime.bash | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/runtime.bash b/scripts/runtime.bash index 8f9672d0d..bb32c0d10 100644 --- a/scripts/runtime.bash +++ b/scripts/runtime.bash

[kvm-unit-tests PATCH 09/32] scripts: allow machine option to be specified in unittests.cfg

2024-02-26 Thread Nicholas Piggin
This allows different machines with different requirements to be supported by run_tests.sh, similarly to how different accelerators are handled. Acked-by: Thomas Huth Signed-off-by: Nicholas Piggin --- scripts/common.bash | 8 ++-- scripts/runtime.bash | 16 2 files

[kvm-unit-tests PATCH 08/32] powerpc/sprs: Avoid taking PMU interrupts caused by register fuzzing

2024-02-26 Thread Nicholas Piggin
Storing certain values in MMCR0 can cause PMU interrupts when msleep enables MSR[EE], and this crashes the test. Freeze the PMU counters and clear any PMU exception before calling msleep. Signed-off-by: Nicholas Piggin --- lib/powerpc/asm/reg.h | 4 powerpc/sprs.c| 17

[kvm-unit-tests PATCH 07/32] powerpc/sprs: Don't fail changed SPRs that are used by the test harness

2024-02-26 Thread Nicholas Piggin
SPRs annotated with SPR_HARNESS can change between consecutive reads because the test harness code has changed them. Avoid failing the test in this case. Signed-off-by: Nicholas Piggin --- powerpc/sprs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/powerpc/sprs.c b

[kvm-unit-tests PATCH 06/32] powerpc/sprs: Specify SPRs with data rather than code

2024-02-26 Thread Nicholas Piggin
eness, but also the code might one day be reused for a hypervisor-privileged test. Acked-by: Thomas Huth Signed-off-by: Nicholas Piggin --- lib/powerpc/asm/reg.h | 2 + powerpc/sprs.c| 647 +- 2 files changed, 457 insertions(+), 192 deletions(-) di

[kvm-unit-tests PATCH 05/32] powerpc: Cleanup SPR and MSR definitions

2024-02-26 Thread Nicholas Piggin
Move SPR and MSR defines out of ppc_asm.h and processor.h and into a new include, asm/reg.h. Add a define for the PVR SPR and various processor versions, and replace the open coded numbers in the sprs.c test case. Signed-off-by: Nicholas Piggin --- lib/powerpc/asm/ppc_asm.h | 8

[kvm-unit-tests PATCH 04/32] powerpc: interrupt stack backtracing

2024-02-26 Thread Nicholas Piggin
Add support for backtracing across interrupt stacks, and add interrupt frame backtrace for unhandled interrupts. Signed-off-by: Nicholas Piggin --- lib/powerpc/processor.c | 4 ++- lib/ppc64/asm/stack.h | 3 +++ lib/ppc64/stack.c | 55 + powerpc

[kvm-unit-tests PATCH 03/32] powerpc: Fix stack backtrace termination

2024-02-26 Thread Nicholas Piggin
it were a stack frame. But this is fragile, and does not work with powernv where address 0 contains firmware instructions. Use the existing dummy frame on stack as the NULL caller, and create a new frame on stack for the entry code. Signed-off-by: Nicholas Piggin --- powerpc/cstart64.S | 12

[kvm-unit-tests PATCH 02/32] powerpc: Fix pseries getchar return value

2024-02-26 Thread Nicholas Piggin
getchar() didn't get the shift value correct and never returned the first character. This never really mattered since it was only ever used for press-a-key-to-continue prompts. but it tripped me up when debugging a QEMU console output problem. Signed-off-by: Nicholas Piggin --- lib/po

[kvm-unit-tests PATCH 01/32] powerpc: Fix KVM caps on POWER9 hosts

2024-02-26 Thread Nicholas Piggin
KVM does not like to run on POWER9 hosts without cap-ccf-assist=off. Signed-off-by: Nicholas Piggin --- powerpc/run | 2 ++ 1 file changed, 2 insertions(+) diff --git a/powerpc/run b/powerpc/run index e469f1eb3..5cdb94194 100755 --- a/powerpc/run +++ b/powerpc/run @@ -24,6 +24,8 @@ M+=",

[kvm-unit-tests PATCH 00/32] powerpc improvements

2024-02-26 Thread Nicholas Piggin
and other tests that Joel and Thomas raised. Tidied up the new new SMP support and fixed a couple of issues there. Added MMU, usermode support, add atomics, timebase, PMU tests, and removes the ppc64 subdirectories. Thanks, Nick Nicholas Piggin (32): powerpc: Fix KVM caps on POWER9 hosts power

[kvm-unit-tests PATCH 7/7] common: add memory dirtying vs migration test

2024-02-26 Thread Nicholas Piggin
This test stores to a bunch of pages and verifies previous stores, while being continually migrated. This can fail due to a QEMU TCG physical memory dirty bitmap bug. Signed-off-by: Nicholas Piggin --- common/memory-verify.c | 48 + powerpc

[kvm-unit-tests PATCH 6/7] gitlab-ci: Run migration selftest on s390x and powerpc

2024-02-26 Thread Nicholas Piggin
The migration harness is complicated and easy to break so CI will be helpful. Signed-off-by: Nicholas Piggin --- .gitlab-ci.yml | 18 +++--- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 71d986e98..61f196d5d 100644 --- a/.gitlab

[kvm-unit-tests PATCH 5/7] arch-run: Add a "continuous" migration option for tests

2024-02-26 Thread Nicholas Piggin
cooperative migration iterations reduced to avoid increasing test time too much. Signed-off-by: Nicholas Piggin --- common/selftest-migration.c | 16 +-- lib/migrate.c | 18 lib/migrate.h | 3 ++ scripts/arch-run.bash | 55

[kvm-unit-tests PATCH 4/7] powerpc: add asm/time.h header with delay and get_clock_us/ms

2024-02-26 Thread Nicholas Piggin
This matches s390x clock and delay APIs, so common test code can start using time facilities. Signed-off-by: Nicholas Piggin --- lib/powerpc/asm/processor.h | 21 - lib/powerpc/asm/time.h | 30 ++ lib/powerpc/processor.c | 11

[kvm-unit-tests PATCH 3/7] (arm|s390): Use migrate_skip in test cases

2024-02-26 Thread Nicholas Piggin
Have tests use the new migrate_skip command in skip paths, rather than calling migrate_once to prevent harness reporting an error. s390x/migration.c adds a new command that looks like it was missing previously. Signed-off-by: Nicholas Piggin --- arm/gic.c | 21

[kvm-unit-tests PATCH 2/7] migration: Add a migrate_skip command

2024-02-26 Thread Nicholas Piggin
ect a migration. Signed-off-by: Nicholas Piggin --- common/selftest-migration.c | 14 - lib/migrate.c | 19 - lib/migrate.h | 2 ++ powerpc/unittests.cfg | 6 ++ s390x/unittests.cfg | 5 + scripts/arch-run.bash

[kvm-unit-tests PATCH 1/7] arch-run: Keep infifo open

2024-02-26 Thread Nicholas Piggin
, simplifying the input pipeline. Signed-off-by: Nicholas Piggin --- scripts/arch-run.bash | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/scripts/arch-run.bash b/scripts/arch-run.bash index 6daef3218..e5b36a07b 100644 --- a/scripts/arch-run.bash +++ b/scripts/arch

[kvm-unit-tests PATCH 0/7] more migration enhancements and tests

2024-02-26 Thread Nicholas Piggin
test contually while it is running. - Put some migration tests in gitlab CI for powerpc and s390. - Add a test case that can reproduce the QEMU TCG dirty bitmap migration bug. Nicholas Piggin (7): arch-run: Keep infifo open migration: Add a migrate_skip command (arm|s390): Use migrate_ski

Re: [kvm-unit-tests PATCH v5 0/8] Multi-migration support

2024-02-26 Thread Nicholas Piggin
On Fri Feb 23, 2024 at 5:06 PM AEST, Thomas Huth wrote: > On 21/02/2024 04.27, Nicholas Piggin wrote: > > Now that strange arm64 hang is found to be QEMU bug, I'll repost. > > Since arm64 requires Thomas's uart patch and it is worse affected > > by the QEMU bug,

[kvm-unit-tests PATCH v5 8/8] migration: add a migration selftest

2024-02-20 Thread Nicholas Piggin
Add a selftest for migration support in guest library and test harness code. It performs migrations in a tight loop to irritate races and bugs in the test harness code. Include the test in s390, powerpc. Acked-by: Claudio Imbrenda (s390x) Reviewed-by: Thomas Huth Signed-off-by: Nicholas

[kvm-unit-tests PATCH v5 7/8] Add common/ directory for architecture-independent tests

2024-02-20 Thread Nicholas Piggin
x86/sieve.c is used by s390x, arm, and riscv via symbolic link. Make a new directory common/ for architecture-independent tests and move sieve.c here. Reviewed-by: Thomas Huth Signed-off-by: Nicholas Piggin --- arm/sieve.c| 2 +- common/sieve.c | 51

[kvm-unit-tests PATCH v5 6/8] migration: Add quiet migration support

2024-02-20 Thread Nicholas Piggin
Console output required to support migration becomes quite noisy when doing lots of migrations. Provide a migrate_quiet() call that suppresses console output and doesn't log a message. Reviewed-by: Thomas Huth Signed-off-by: Nicholas Piggin --- lib/migrate.c | 11 +++

[kvm-unit-tests PATCH v5 5/8] arch-run: rename migration variables

2024-02-20 Thread Nicholas Piggin
Using 1 and 2 for source and destination is confusing, particularly now with multiple migrations that flip between them. Do a rename pass to 'src' and 'dst' to tidy things up. Acked-by: Thomas Huth Signed-off-by: Nicholas Piggin --- scripts

[kvm-unit-tests PATCH v5 4/8] migration: Support multiple migrations

2024-02-20 Thread Nicholas Piggin
Signed-off-by: Nicholas Piggin --- lib/migrate.c | 8 ++-- lib/migrate.h | 1 + scripts/arch-run.bash | 86 --- 3 files changed, 77 insertions(+), 18 deletions(-) diff --git a/lib/migrate.c b/lib/migrate.c index 527e63ae1..b77216594 100644

[kvm-unit-tests PATCH v5 3/8] migration: use a more robust way to wait for background job

2024-02-20 Thread Nicholas Piggin
that is not running. This is easier to hit with subsequent multiple-migration support. Changing this to use $! by swapping the pipeline for a fifo is more robust. Reviewed-by: Thomas Huth Signed-off-by: Nicholas Piggin --- scripts/arch-run.bash | 15 +++ 1 file changed, 11 insertions

[kvm-unit-tests PATCH v5 2/8] arch-run: Clean up initrd cleanup

2024-02-20 Thread Nicholas Piggin
Rather than put a big script into the trap handler, have it call a function. Reviewed-by: Thomas Huth Signed-off-by: Nicholas Piggin --- scripts/arch-run.bash | 13 - 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/scripts/arch-run.bash b/scripts/arch-run.bash index

[kvm-unit-tests PATCH v5 1/8] arch-run: Fix TRAP handler recursion to remove temporary files properly

2024-02-20 Thread Nicholas Piggin
n creation trap handler install. Reviewed-by: Thomas Huth Signed-off-by: Nicholas Piggin --- scripts/arch-run.bash | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/scripts/arch-run.bash b/scripts/arch-run.bash index d0864360a..11d47a85c 100644 --- a/scripts/arc

[kvm-unit-tests PATCH v5 0/8] Multi-migration support

2024-02-20 Thread Nicholas Piggin
ed slightly to remove the theoretical race rather than just adding a comment about it. - Patch 3 was missing a couple of fixes that leaked into patch 4, those are moved into patch 3. Thanks, Nick Nicholas Piggin (8): arch-run: Fix TRAP handler recursion to remove temporary files properly

Re: [kvm-unit-tests PATCH v4 8/8] migration: add a migration selftest

2024-02-19 Thread Nicholas Piggin
On Mon Feb 19, 2024 at 4:56 PM AEST, Thomas Huth wrote: > On 17/02/2024 08.19, Nicholas Piggin wrote: > > On Fri Feb 16, 2024 at 9:15 PM AEST, Thomas Huth wrote: > >> On 09/02/2024 10.11, Nicholas Piggin wrote: > >>> Add a selftest for migration support in

Re: [kvm-unit-tests PATCH v4 8/8] migration: add a migration selftest

2024-02-16 Thread Nicholas Piggin
On Fri Feb 16, 2024 at 9:15 PM AEST, Thomas Huth wrote: > On 09/02/2024 10.11, Nicholas Piggin wrote: > > Add a selftest for migration support in guest library and test harness > > code. It performs migrations in a tight loop to irritate races and bugs > > in

Re: [PATCH] powerpc/pseries: fix accuracy of stolen time

2024-02-12 Thread Nicholas Piggin
IG_PARAVIRT_TIME_ACCOUNTING") Good find and fix. Paper bag for me. I wonder why we didn't catch it in the first place. Maybe we didn't understand the hypervisor's sharing algorithm and what we expected it to report. In any case this is right. The KVM implementation of the

[kvm-unit-tests PATCH v4 8/8] migration: add a migration selftest

2024-02-09 Thread Nicholas Piggin
Add a selftest for migration support in guest library and test harness code. It performs migrations in a tight loop to irritate races and bugs in the test harness code. Include the test in arm, s390, powerpc. Acked-by: Claudio Imbrenda (s390x) Reviewed-by: Thomas Huth Signed-off-by: Nicholas

[kvm-unit-tests PATCH v4 7/8] Add common/ directory for architecture-independent tests

2024-02-09 Thread Nicholas Piggin
x86/sieve.c is used by s390x, arm, and riscv via symbolic link. Make a new directory common/ for architecture-independent tests and move sieve.c here. Reviewed-by: Thomas Huth Signed-off-by: Nicholas Piggin --- arm/sieve.c| 2 +- common/sieve.c | 51

[kvm-unit-tests PATCH v4 6/8] migration: Add quiet migration support

2024-02-09 Thread Nicholas Piggin
Console output required to support migration becomes quite noisy when doing lots of migrations. Provide a migrate_quiet() call that suppresses console output and doesn't log a message. Signed-off-by: Nicholas Piggin --- lib/migrate.c | 11 +++ lib/migrate.h

[kvm-unit-tests PATCH v4 5/8] arch-run: rename migration variables

2024-02-09 Thread Nicholas Piggin
Using 1 and 2 for source and destination is confusing, particularly now with multiple migrations that flip between them. Do a rename pass to 'src' and 'dst' to tidy things up. Acked-by: Thomas Huth Signed-off-by: Nicholas Piggin --- scripts

[kvm-unit-tests PATCH v4 4/8] migration: Support multiple migrations

2024-02-09 Thread Nicholas Piggin
Support multiple migrations by flipping dest file/socket variables to source after the migration is complete, ready to start again. A new destination is created if the test outputs the migrate line again. Test cases may now switch to calling migrate() one or more times. Signed-off-by: Nicholas

[kvm-unit-tests PATCH v4 3/8] migration: use a more robust way to wait for background job

2024-02-09 Thread Nicholas Piggin
that is not running. This is easier to hit with subsequent multiple-migration support. Changing this to use $! by swapping the pipeline for a fifo is more robust. Reviewed-by: Thomas Huth Signed-off-by: Nicholas Piggin --- scripts/arch-run.bash | 15 +++ 1 file changed, 11 insertions

[kvm-unit-tests PATCH v4 2/8] arch-run: Clean up initrd cleanup

2024-02-09 Thread Nicholas Piggin
Rather than put a big script into the trap handler, have it call a function. Signed-off-by: Nicholas Piggin --- scripts/arch-run.bash | 13 - 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/scripts/arch-run.bash b/scripts/arch-run.bash index 11d47a85..c1dd67ab 100644

[kvm-unit-tests PATCH v4 1/8] arch-run: Fix TRAP handler recursion to remove temporary files properly

2024-02-09 Thread Nicholas Piggin
n creation trap handler install. Reviewed-by: Thomas Huth Signed-off-by: Nicholas Piggin --- scripts/arch-run.bash | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/scripts/arch-run.bash b/scripts/arch-run.bash index d0864360..11d47a85 100644 --- a/scripts/arch-run.

[kvm-unit-tests PATCH v4 0/8] Multi-migration support

2024-02-09 Thread Nicholas Piggin
r patch reworked slightly to remove the theoretical race rather than just adding a comment about it. - Patch 3 was missing a couple of fixes that leaked into patch 4, those are moved into patch 3. Thanks, Nick Nicholas Piggin (8): arch-run: Fix TRAP handler recursion to remove temporary file

Re: [kvm-unit-tests PATCH v3 4/8] migration: Support multiple migrations

2024-02-09 Thread Nicholas Piggin
On Fri Feb 9, 2024 at 6:19 PM AEST, Thomas Huth wrote: > On 09/02/2024 08.01, Nicholas Piggin wrote: > > Support multiple migrations by flipping dest file/socket variables to > > source after the migration is complete, ready to start again. A new > > destination is created if

Re: [kvm-unit-tests PATCH v3 2/8] arch-run: Clean up initrd cleanup

2024-02-09 Thread Nicholas Piggin
On Fri Feb 9, 2024 at 5:32 PM AEST, Thomas Huth wrote: > On 09/02/2024 08.01, Nicholas Piggin wrote: > > Rather than put a big script into the trap handler, have it call > > a function. > > > > Signed-off-by: Nicholas Piggin > > --- > > scripts/arch-r

[kvm-unit-tests PATCH v3 8/8] migration: add a migration selftest

2024-02-08 Thread Nicholas Piggin
Add a selftest for migration support in guest library and test harness code. It performs migrations a tight loop to irritate races and bugs in the test harness code. Include the test in arm, s390, powerpc. Acked-by: Claudio Imbrenda (s390x) Signed-off-by: Nicholas Piggin --- This has flushed

[kvm-unit-tests PATCH v3 7/8] Add common/ directory for architecture-independent tests

2024-02-08 Thread Nicholas Piggin
x86/sieve.c is used by s390x, arm, and riscv via symbolic link. Make a new directory common/ for architecture-independent tests and move sieve.c here. Signed-off-by: Nicholas Piggin --- arm/sieve.c| 2 +- common/sieve.c | 51 + riscv/sieve.c

[kvm-unit-tests PATCH v3 6/8] migration: Add quiet migration support

2024-02-08 Thread Nicholas Piggin
Console output required to support migration becomes quite noisy when doing lots of migrations. Provide a migrate_quiet() call that suppresses console output and doesn't log a message. Signed-off-by: Nicholas Piggin --- lib/migrate.c | 12 lib/migrate.h

[kvm-unit-tests PATCH v3 5/8] arch-run: rename migration variables

2024-02-08 Thread Nicholas Piggin
Using 1 and 2 for source and destination is confusing, particularly now with multiple migrations that flip between them. Do a rename pass to tidy things up. Signed-off-by: Nicholas Piggin --- scripts/arch-run.bash | 115 +- 1 file changed, 58 insertions

[kvm-unit-tests PATCH v3 4/8] migration: Support multiple migrations

2024-02-08 Thread Nicholas Piggin
Support multiple migrations by flipping dest file/socket variables to source after the migration is complete, ready to start again. A new destination is created if the test outputs the migrate line again. Test cases may now switch to calling migrate() one or more times. Signed-off-by: Nicholas

[kvm-unit-tests PATCH v3 3/8] migration: use a more robust way to wait for background job

2024-02-08 Thread Nicholas Piggin
that is not running. This is easier to hit with subsequent multiple-migration support. Changing this to use $! by swapping the pipeline for a fifo is more robust. Signed-off-by: Nicholas Piggin --- scripts/arch-run.bash | 15 +++ 1 file changed, 11 insertions(+), 4 deletions(-) diff

[kvm-unit-tests PATCH v3 2/8] arch-run: Clean up initrd cleanup

2024-02-08 Thread Nicholas Piggin
Rather than put a big script into the trap handler, have it call a function. Signed-off-by: Nicholas Piggin --- scripts/arch-run.bash | 13 - 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/scripts/arch-run.bash b/scripts/arch-run.bash index 11d47a85..1e903e83 100644

[kvm-unit-tests PATCH v3 1/8] arch-run: Fix TRAP handler recursion to remove temporary files properly

2024-02-08 Thread Nicholas Piggin
trap-time rather than install-time, which closes the small race between creation trap handler install. Reviewed-by: Thomas Huth Signed-off-by: Nicholas Piggin --- scripts/arch-run.bash | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/scripts/arch-run.bash b/sc

[kvm-unit-tests PATCH v3 0/8] Multi-migration support

2024-02-08 Thread Nicholas Piggin
it might be possible (along the lines of starting ( sleep N ; kill ) subshell in the backround), but it's very tricky to handle all the details. Existing script has timeout issues already, so this series doesn't add a fundamentally new type of problem here. Thanks, Nick Nicholas Pi

Re: [kvm-unit-tests PATCH v2 2/9] arch-run: Clean up temporary files properly

2024-02-08 Thread Nicholas Piggin
On Wed Feb 7, 2024 at 5:58 PM AEST, Thomas Huth wrote: > On 02/02/2024 07.57, Nicholas Piggin wrote: > > Migration files weren't being removed when tests were interrupted. > > This improves the situation. > > > > Signed-off-by: Nicholas Piggin > >

Re: [PATCH v2 5/5] sched/vtime: do not include header

2024-02-08 Thread Nicholas Piggin
On Fri Feb 9, 2024 at 6:15 AM AEST, Alexander Gordeev wrote: > There is no architecture-specific code or data left > that generic needs to know about. > Thus, avoid the inclusion of header. Nice cleanup! Acked-by: Nicholas Piggin > > Reviewed-by: Frederic Weisbecker

Re: [PATCH v2 3/5] s390/vtime: remove unused __ARCH_HAS_VTIME_TASK_SWITCH leftover

2024-02-08 Thread Nicholas Piggin
On Fri Feb 9, 2024 at 6:15 AM AEST, Alexander Gordeev wrote: > __ARCH_HAS_VTIME_TASK_SWITCH macro is not used anymore. ... but for benefit of patchwork if you decide to keep them apart Acked-by: Nicholas Piggin > > Reviewed-by: Frederic Weisbecker > Acked-by: Heiko Carstens >

Re: [PATCH v2 2/5] sched/vtime: get rid of generic vtime_task_switch() implementation

2024-02-08 Thread Nicholas Piggin
think this could be squashed with patch 3. Reviewed-by: Nicholas Piggin > > Reviewed-by: Frederic Weisbecker > Signed-off-by: Alexander Gordeev > --- > arch/powerpc/include/asm/cputime.h | 13 - > arch/powerpc/kernel/time.c | 22 ++

Re: [PATCH v2 1/5] sched/vtime: remove confusing arch_vtime_task_switch() declaration

2024-02-08 Thread Nicholas Piggin
e it. > And powerpc arch_vtime_task_switch is static inline too, so this just confuses things. Reviewed-by: Nicholas Piggin > Reviewed-by: Frederic Weisbecker > Signed-off-by: Alexander Gordeev > --- > include/linux/vtime.h | 1 - > 1 file changed, 1 deletion(-) > > diff --g

[PATCH 1/2] powerpc/pseries: Add a clear modifier to ibm,pa/pi-features parser

2024-02-06 Thread Nicholas Piggin
ure if the bit is set, but it does not set the feature if the bit is clear. The feature is expected to be set in the cpu table. This replaces the 'invert' modifier, which is unused since commit 7d4703455168 ("powerpc/feature: Remove CPU_FTR_NODSISRALIGN"). Signed-off-by: Nich

[PATCH 2/2] powerpc/pseries: Set CPU_FTR_DBELL according to ibm,pi-features

2024-02-06 Thread Nicholas Piggin
CPU_FTR_DBELL, and ensure CPU_FTR_DBELL is not in CPU_FTRS_ALWAYS. Signed-off-by: Nicholas Piggin --- arch/powerpc/include/asm/cputable.h | 11 ++- arch/powerpc/kernel/prom.c | 1 + 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/arch/powerpc/include/asm/cputable.h b/arch

Re: [kvm-unit-tests PATCH v2 4/9] migration: use a more robust way to wait for background job

2024-02-05 Thread Nicholas Piggin
On Tue Feb 6, 2024 at 12:58 AM AEST, Marc Hartmayer wrote: > On Fri, Feb 02, 2024 at 04:57 PM +1000, Nicholas Piggin > wrote: > > Starting a pipeline of jobs in the background does not seem to have > > a simple way to reliably find the pid of a particular process in the > &g

Re: [kvm-unit-tests PATCH v2 3/9] arch-run: Clean up initrd cleanup

2024-02-05 Thread Nicholas Piggin
On Mon Feb 5, 2024 at 10:04 PM AEST, Thomas Huth wrote: > On 02/02/2024 07.57, Nicholas Piggin wrote: > > Rather than put a big script into the trap handler, have it call > > a function. > > > > Signed-off-by: Nicholas Piggin > > --- > > scripts/arch-

[kvm-unit-tests PATCH v2 9/9] migration: add a migration selftest

2024-02-01 Thread Nicholas Piggin
Add a selftest for migration support in guest library and test harness code. It performs migrations a tight loop to irritate races and bugs in the test harness code. Acked-by: Claudio Imbrenda (s390x) Signed-off-by: Nicholas Piggin This has flushed out several bugs in developing the multi

[kvm-unit-tests PATCH v2 8/9] Add common/ directory for architecture-independent tests

2024-02-01 Thread Nicholas Piggin
x86/sieve.c is used by s390x and arm via symbolic link. Make a new directory common/ for architecture-independent tests and move sieve.c here. Signed-off-by: Nicholas Piggin --- arm/sieve.c| 2 +- common/sieve.c | 51 + s390x/sieve.c | 2

[kvm-unit-tests PATCH v2 7/9] migration: Add quiet migration support

2024-02-01 Thread Nicholas Piggin
Console output required to support migration becomes quite noisy when doing lots of migrations. Provide a migrate_quiet() call that suppresses console output and doesn't log a message. Signed-off-by: Nicholas Piggin --- lib/migrate.c | 12 lib/migrate.h

[kvm-unit-tests PATCH v2 6/9] arch-run: rename migration variables

2024-02-01 Thread Nicholas Piggin
Using 1 and 2 for source and destination is confusing, particularly now with multiple migrations that flip between them. Do a rename pass to tidy things up. Signed-off-by: Nicholas Piggin --- scripts/arch-run.bash | 112 +- 1 file changed, 57 insertions

[kvm-unit-tests PATCH v2 5/9] migration: Support multiple migrations

2024-02-01 Thread Nicholas Piggin
Support multiple migrations by flipping dest file/socket variables to source after the migration is complete, ready to start again. A new destination is created if the test outputs the migrate line again. Test cases may now switch to calling migrate() one or more times. Signed-off-by: Nicholas

[kvm-unit-tests PATCH v2 4/9] migration: use a more robust way to wait for background job

2024-02-01 Thread Nicholas Piggin
that is not running. This is easier to hit with subsequent multiple-migration support. Changing this to use $! by swapping the pipeline for a fifo is more robust. Signed-off-by: Nicholas Piggin --- scripts/arch-run.bash | 12 +--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git

[kvm-unit-tests PATCH v2 3/9] arch-run: Clean up initrd cleanup

2024-02-01 Thread Nicholas Piggin
Rather than put a big script into the trap handler, have it call a function. Signed-off-by: Nicholas Piggin --- scripts/arch-run.bash | 12 +++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/scripts/arch-run.bash b/scripts/arch-run.bash index f22ead6f..cc7da7c5 100644

[kvm-unit-tests PATCH v2 2/9] arch-run: Clean up temporary files properly

2024-02-01 Thread Nicholas Piggin
Migration files weren't being removed when tests were interrupted. This improves the situation. Signed-off-by: Nicholas Piggin --- scripts/arch-run.bash | 12 +++- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/scripts/arch-run.bash b/scripts/arch-run.bash index d08

[kvm-unit-tests PATCH v2 1/9] (arm|powerpc|s390x): Makefile: Fix .aux.o generation

2024-02-01 Thread Nicholas Piggin
prerequisite for this recipe. Fixes: f2372f2d49135 ("(arm|powerpc|s390x): Makefile: add `%.aux.o` target") Signed-off-by: Nicholas Piggin --- arm/Makefile.common | 2 +- powerpc/Makefile.common | 2 +- s390x/Makefile | 2 +- 3 files changed, 3 insertions(+), 3 deletion

[kvm-unit-tests PATCH v2 0/9] Multi-migration support

2024-02-01 Thread Nicholas Piggin
. And arm now has a reason to implement a a getchar that can run more than 15 times. Thanks, Nick Nicholas Piggin (9): (arm|powerpc|s390x): Makefile: Fix .aux.o generation arch-run: Clean up temporary files properly arch-run: Clean up initrd cleanup migration: use a more robust way to wai

[PATCH 3/3] powerpc/ps3: Make real stack frames for LV1 hcalls

2023-12-26 Thread Nicholas Piggin
The PS3 hcall assembly code makes ad-hoc stack frames that don't have a back-chain pointer or meet other requirements like minimum frame size. This probably confuses stack unwinders. Give all hcalls a real stack frame. Signed-off-by: Nicholas Piggin --- arch/powerpc/platforms/ps3/hvcall.S

[PATCH 2/3] powerpc/ps3: lv1 hcall code use symbolic constant for LR save offset

2023-12-26 Thread Nicholas Piggin
The LRSAVE constant is required for assembly compiled for both 32-bit and 64-bit, because the value differs there. PS3 is 64-bit only so this is a noop, but it is nice to abstract stack frame offsets. Signed-off-by: Nicholas Piggin --- arch/powerpc/platforms/ps3/hvcall.S | 128

[PATCH 0/3] powerpc/ps3: Fixes for lv1 hcall assembly

2023-12-26 Thread Nicholas Piggin
This (hopefully) fixes the ELFv2 bug that Geoff reported, with patch 1. And a couple of other possible improvements I noticed. I don't have a PS3 setup[*] so I have only compile tested these, I'm sorry. [*] Is RPCS3 usable for this kind of thing? Thanks, Nick Nicholas Piggin (3): p

[PATCH 1/3] powerpc/ps3: Fix lv1 hcall assembly for ELFv2 calling convention

2023-12-26 Thread Nicholas Piggin
Stack-passed parameters begin at a different offset in the caller's stack in the ELFv2 ABI. Reported-by: Geoff Levand Fixes: 8c5fa3b5c4df ("powerpc/64: Make ELFv2 the default for big-endian builds") Signed-off-by: Nicholas Piggin --- arch/powerpc/include/asm/ppc_asm.h |

<    1   2   3   4   5   6   7   8   9   10   >