History log of /kvm-unit-tests/lib/powerpc/ (Results 1 – 25 of 71)
Revision Date Author Comments
(<<< Hide modified files)
(Show modified files >>>)
0cc3a35122-Feb-2025 Sean Christopherson <seanjc@google.com>

lib: Use __ASSEMBLER__ instead of __ASSEMBLY__

Convert all non-x86 #ifdefs from __ASSEMBLY__ to __ASSEMBLER__, and remove
all manual __ASSEMBLY__ #defines. __ASSEMBLY_ was inherited blindly from
th

lib: Use __ASSEMBLER__ instead of __ASSEMBLY__

Convert all non-x86 #ifdefs from __ASSEMBLY__ to __ASSEMBLER__, and remove
all manual __ASSEMBLY__ #defines. __ASSEMBLY_ was inherited blindly from
the Linux kernel, and must be manually defined, e.g. through build rules
or with the aforementioned explicit #defines in assembly code.

__ASSEMBLER__ on the other hand is automatically defined by the compiler
when preprocessing assembly, i.e. doesn't require manually #defines for
the code to function correctly.

Ignore x86, as x86 doesn't actually rely on __ASSEMBLY__ at the moment,
and is undergoing a parallel cleanup.

Signed-off-by: Sean Christopherson <seanjc@google.com>
Reviewed-by: Andrew Jones <andrew.jones@linux.dev>
Message-ID: <20250222014526.2302653-1-seanjc@google.com>
[thuth: Fix three more occurances in libfdt.h and sbi-tests.h]
Signed-off-by: Thomas Huth <thuth@redhat.com>

show more ...


/kvm-unit-tests/.editorconfig
/kvm-unit-tests/.gitlab-ci.yml
/kvm-unit-tests/Makefile
/kvm-unit-tests/README.md
/kvm-unit-tests/arm/Makefile.arm64
/kvm-unit-tests/arm/cstart.S
/kvm-unit-tests/arm/cstart64.S
/kvm-unit-tests/arm/fpu.c
/kvm-unit-tests/arm/pmu.c
/kvm-unit-tests/arm/selftest.c
/kvm-unit-tests/arm/unittests.cfg
/kvm-unit-tests/configure
/kvm-unit-tests/lib/arm/asm/arch_gicv3.h
/kvm-unit-tests/lib/arm/asm/arm-smccc.h
/kvm-unit-tests/lib/arm/asm/assembler.h
/kvm-unit-tests/lib/arm/asm/gic-v2.h
/kvm-unit-tests/lib/arm/asm/gic-v3.h
/kvm-unit-tests/lib/arm/asm/gic.h
/kvm-unit-tests/lib/arm/asm/page.h
/kvm-unit-tests/lib/arm/asm/pgtable.h
/kvm-unit-tests/lib/arm/asm/psci.h
/kvm-unit-tests/lib/arm/asm/ptrace.h
/kvm-unit-tests/lib/arm/asm/sysreg.h
/kvm-unit-tests/lib/arm/asm/thread_info.h
/kvm-unit-tests/lib/arm/asm/timer.h
/kvm-unit-tests/lib/arm/psci.c
/kvm-unit-tests/lib/arm/setup.c
/kvm-unit-tests/lib/arm64/asm/arch_gicv3.h
/kvm-unit-tests/lib/arm64/asm/arm-smccc.h
/kvm-unit-tests/lib/arm64/asm/assembler.h
/kvm-unit-tests/lib/arm64/asm/esr.h
/kvm-unit-tests/lib/arm64/asm/page.h
/kvm-unit-tests/lib/arm64/asm/processor.h
/kvm-unit-tests/lib/arm64/asm/ptrace.h
/kvm-unit-tests/lib/arm64/asm/sysreg.h
/kvm-unit-tests/lib/arm64/processor.c
/kvm-unit-tests/lib/asm-generic/page.h
/kvm-unit-tests/lib/auxinfo.h
/kvm-unit-tests/lib/cpumask.h
/kvm-unit-tests/lib/libcflat.h
/kvm-unit-tests/lib/libfdt/fdt.h
/kvm-unit-tests/lib/limits.h
/kvm-unit-tests/lib/linux/compiler.h
/kvm-unit-tests/lib/linux/const.h
/kvm-unit-tests/lib/memregions.h
/kvm-unit-tests/lib/on-cpus.c
/kvm-unit-tests/lib/on-cpus.h
asm/hcall.h
asm/processor.h
asm/rtas.h
/kvm-unit-tests/lib/ppc64/asm/page.h
/kvm-unit-tests/lib/ppc64/asm/ptrace.h
/kvm-unit-tests/lib/ppc64/asm/vpa.h
/kvm-unit-tests/lib/rand.c
/kvm-unit-tests/lib/rand.h
/kvm-unit-tests/lib/report.c
/kvm-unit-tests/lib/riscv/asm-offsets.c
/kvm-unit-tests/lib/riscv/asm/asm.h
/kvm-unit-tests/lib/riscv/asm/bug.h
/kvm-unit-tests/lib/riscv/asm/csr.h
/kvm-unit-tests/lib/riscv/asm/delay.h
/kvm-unit-tests/lib/riscv/asm/io.h
/kvm-unit-tests/lib/riscv/asm/mmu.h
/kvm-unit-tests/lib/riscv/asm/page.h
/kvm-unit-tests/lib/riscv/asm/processor.h
/kvm-unit-tests/lib/riscv/asm/sbi.h
/kvm-unit-tests/lib/riscv/asm/setup.h
/kvm-unit-tests/lib/riscv/asm/stack.h
/kvm-unit-tests/lib/riscv/asm/timer.h
/kvm-unit-tests/lib/riscv/delay.c
/kvm-unit-tests/lib/riscv/mmu.c
/kvm-unit-tests/lib/riscv/processor.c
/kvm-unit-tests/lib/riscv/sbi.c
/kvm-unit-tests/lib/riscv/setjmp.S
/kvm-unit-tests/lib/riscv/setup.c
/kvm-unit-tests/lib/riscv/smp.c
/kvm-unit-tests/lib/riscv/stack.c
/kvm-unit-tests/lib/riscv/timer.c
/kvm-unit-tests/lib/s390x/asm/arch_def.h
/kvm-unit-tests/lib/s390x/asm/cpacf.h
/kvm-unit-tests/lib/s390x/asm/facility.h
/kvm-unit-tests/lib/s390x/asm/sie-arch.h
/kvm-unit-tests/lib/s390x/sie-icpt.c
/kvm-unit-tests/lib/s390x/sie-icpt.h
/kvm-unit-tests/lib/s390x/sie.c
/kvm-unit-tests/lib/s390x/sie.h
/kvm-unit-tests/lib/s390x/snippet-exit.h
/kvm-unit-tests/lib/setjmp.h
/kvm-unit-tests/lib/stack.c
/kvm-unit-tests/lib/stack.h
/kvm-unit-tests/lib/x86/apic-defs.h
/kvm-unit-tests/lib/x86/apic.h
/kvm-unit-tests/lib/x86/asm/bitops.h
/kvm-unit-tests/lib/x86/asm/page.h
/kvm-unit-tests/lib/x86/atomic.h
/kvm-unit-tests/lib/x86/desc.c
/kvm-unit-tests/lib/x86/desc.h
/kvm-unit-tests/lib/x86/msr.h
/kvm-unit-tests/lib/x86/pmu.c
/kvm-unit-tests/lib/x86/pmu.h
/kvm-unit-tests/lib/x86/processor.h
/kvm-unit-tests/lib/x86/setup.c
/kvm-unit-tests/lib/x86/smp.c
/kvm-unit-tests/lib/x86/smp.h
/kvm-unit-tests/powerpc/cstart64.S
/kvm-unit-tests/riscv/Makefile
/kvm-unit-tests/riscv/cstart.S
/kvm-unit-tests/riscv/run
/kvm-unit-tests/riscv/sbi-asm.S
/kvm-unit-tests/riscv/sbi-fwft.c
/kvm-unit-tests/riscv/sbi-tests.h
/kvm-unit-tests/riscv/sbi.c
/kvm-unit-tests/riscv/unittests.cfg
/kvm-unit-tests/s390x/Makefile
/kvm-unit-tests/s390x/cpu-sie.S
/kvm-unit-tests/s390x/cpu.S
/kvm-unit-tests/s390x/diag258.c
/kvm-unit-tests/s390x/edat.c
/kvm-unit-tests/s390x/pv-diags.c
/kvm-unit-tests/s390x/pv-icptcode.c
/kvm-unit-tests/s390x/pv-ipl.c
/kvm-unit-tests/s390x/sie-dat.c
/kvm-unit-tests/s390x/snippets/Makefile
/kvm-unit-tests/s390x/snippets/c/sie-dat.c
/kvm-unit-tests/s390x/snippets/c/stfle.c
/kvm-unit-tests/s390x/snippets/lib/snippet-exit.h
/kvm-unit-tests/s390x/stfle-sie.c
/kvm-unit-tests/s390x/unittests.cfg
/kvm-unit-tests/scripts/check-patch.py
/kvm-unit-tests/scripts/checkpatch.pl
/kvm-unit-tests/x86/Makefile.common
/kvm-unit-tests/x86/Makefile.i386
/kvm-unit-tests/x86/Makefile.x86_64
/kvm-unit-tests/x86/asyncpf.c
/kvm-unit-tests/x86/cstart.S
/kvm-unit-tests/x86/cstart64.S
/kvm-unit-tests/x86/debug.c
/kvm-unit-tests/x86/efi/efistart64.S
/kvm-unit-tests/x86/la57.c
/kvm-unit-tests/x86/lam.c
/kvm-unit-tests/x86/msr.c
/kvm-unit-tests/x86/pcid.c
/kvm-unit-tests/x86/pmu.c
/kvm-unit-tests/x86/pmu_lbr.c
/kvm-unit-tests/x86/pmu_pebs.c
/kvm-unit-tests/x86/svm.h
/kvm-unit-tests/x86/svm_tests.c
/kvm-unit-tests/x86/trampolines.S
/kvm-unit-tests/x86/unittests.cfg
/kvm-unit-tests/x86/vmx.c
/kvm-unit-tests/x86/vmx.h
/kvm-unit-tests/x86/vmx_tests.c
93c847c112-Jun-2024 Nicholas Piggin <npiggin@gmail.com>

powerpc: add usermode support

The biggest difficulty for user mode is MMU support. Otherwise it is
a simple matter of setting and clearing MSR[PR] with rfid and sc
respectively.

Some common harness

powerpc: add usermode support

The biggest difficulty for user mode is MMU support. Otherwise it is
a simple matter of setting and clearing MSR[PR] with rfid and sc
respectively.

Some common harness operations will fail in usermode, so some workarounds
are reqiured (e.g., puts() can't be used directly).

A usermode privileged instruction interrupt test is added.

Reviewed-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
Message-ID: <20240612052322.218726-8-npiggin@gmail.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>

show more ...

d4c8e72512-Jun-2024 Nicholas Piggin <npiggin@gmail.com>

powerpc: Add MMU support

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 fro

powerpc: Add MMU support

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 <andrew.jones@linux.dev> (configure changes)
Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
Message-ID: <20240612052322.218726-5-npiggin@gmail.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>

show more ...

28ac3b1012-Jun-2024 Nicholas Piggin <npiggin@gmail.com>

powerpc: Add timebase tests

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 <npiggin@

powerpc: Add timebase tests

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 <npiggin@gmail.com>
Message-ID: <20240612052322.218726-4-npiggin@gmail.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>

show more ...

851ef51612-Jun-2024 Nicholas Piggin <npiggin@gmail.com>

powerpc: Add facility to query TCG or KVM host

Use device tree properties to determine whether KVM or TCG is in
use.

Logically these are not the inverse of one another, because KVM can run
on a TCG

powerpc: Add facility to query TCG or KVM host

Use device tree properties to determine whether KVM or TCG is in
use.

Logically these are not the inverse of one another, because KVM can run
on a TCG processor (if TCG is emulating HV mode, or it is using the
nested hypervisor APIs in pseries / spapr). And kvm-unit-tests can run
on that KVM.

This can be a problem because some issues relate to TCG CPU emulation
some to the spapr hypervisor implementation, some to KVM, some to real
hardware, so the TCG test is best-effort for now and is set to the
opposite of KVM. The two independent variables are added because we may
be able to more accurately determine this in future.

Use this facility to restrict some of the known test failures to TCG.

Reviewed-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
Message-ID: <20240612052322.218726-2-npiggin@gmail.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>

show more ...

c76b0d0a04-May-2024 Nicholas Piggin <npiggin@gmail.com>

powerpc: add SMP and IPI support

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

powerpc: add SMP and IPI support

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 <npiggin@gmail.com>
Message-ID: <20240504122841.1177683-17-npiggin@gmail.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>

show more ...

8e4e051204-May-2024 Nicholas Piggin <npiggin@gmail.com>

powerpc: Enable page alloc operations

These will be used for stack allocation for secondary CPUs.

Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
Message-ID: <20240504122841.1177683-16-npiggin@g

powerpc: Enable page alloc operations

These will be used for stack allocation for secondary CPUs.

Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
Message-ID: <20240504122841.1177683-16-npiggin@gmail.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>

show more ...

2981505004-May-2024 Nicholas Piggin <npiggin@gmail.com>

powerpc: Remove broken SMP exception stack setup

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 st

powerpc: Remove broken SMP exception stack setup

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 target CPU itself. So secondaries
never got their SPRG2 set to a valid exception stack.

Remove the SMP code and just set an exception 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 <npiggin@gmail.com>
Message-ID: <20240504122841.1177683-15-npiggin@gmail.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>

show more ...

789a8e6904-May-2024 Nicholas Piggin <npiggin@gmail.com>

powerpc: Add rtas stop-self support

In preparation for improved SMP support, add stop-self support to the
harness. This is non-trivial because it requires an unlocked rtas
call: a CPU can't be holdi

powerpc: Add rtas stop-self support

In preparation for improved SMP support, add stop-self support to the
harness. This is non-trivial because it requires an unlocked rtas
call: a CPU can't be holding a spin lock when it goes offline or it
will deadlock other CPUs. rtas permits stop-self to be called without
serialising all other rtas operations.

Reviewed-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
Message-ID: <20240504122841.1177683-14-npiggin@gmail.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>

show more ...

00af1c8404-May-2024 Nicholas Piggin <npiggin@gmail.com>

powerpc: general interrupt tests

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

powerpc: general interrupt tests

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 <npiggin@gmail.com>
Message-ID: <20240504122841.1177683-13-npiggin@gmail.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>

show more ...

cd27b4ba04-May-2024 Nicholas Piggin <npiggin@gmail.com>

powerpc: Fix emulator illegal instruction test for powernv

Illegal instructions cause 0xe40 (HEAI) interrupts rather
than program interrupts.

Acked-by: Thomas Huth <thuth@redhat.com>
Signed-off-by:

powerpc: Fix emulator illegal instruction test for powernv

Illegal instructions cause 0xe40 (HEAI) interrupts rather
than program interrupts.

Acked-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
Message-ID: <20240504122841.1177683-11-npiggin@gmail.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>

show more ...

610c5a9c04-May-2024 Nicholas Piggin <npiggin@gmail.com>

powerpc: Support powernv machine with QEMU TCG

Add support for QEMU's powernv machine. This uses standard firmware
(skiboot) rather than a minimal firmware shim.

Reviewed-by: Cédric Le Goater <clg@

powerpc: Support powernv machine with QEMU TCG

Add support for QEMU's powernv machine. This uses standard firmware
(skiboot) rather than a minimal firmware shim.

Reviewed-by: Cédric Le Goater <clg@kaod.org>
Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
Message-ID: <20240504122841.1177683-10-npiggin@gmail.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>

show more ...

d499b05f04-May-2024 Nicholas Piggin <npiggin@gmail.com>

powerpc/sprs: Avoid taking PMU interrupts caused by register fuzzing

Storing certain values in MMCR0 can cause PMU interrupts when msleep
enables MSR[EE], and this crashes the test. Freeze the PMU c

powerpc/sprs: Avoid taking PMU interrupts caused by register fuzzing

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.

Reviewed-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
Message-ID: <20240504122841.1177683-7-npiggin@gmail.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>

show more ...

8f6290f004-May-2024 Nicholas Piggin <npiggin@gmail.com>

powerpc/sprs: Specify SPRs with data rather than code

A significant rework that builds an array of 'struct spr', where each
element describes an SPR. This makes various metadata about the SPR
like n

powerpc/sprs: Specify SPRs with data rather than code

A significant rework that builds an array of 'struct spr', where each
element describes an SPR. This makes various metadata about the SPR
like name and access type easier to carry and use.

Hypervisor privileged registers are described despite not being used
at the moment for completeness, but also the code might one day be
reused for a hypervisor-privileged test.

Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
Message-ID: <20240504122841.1177683-6-npiggin@gmail.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>

show more ...

ac6e1abf05-Apr-2024 Nicholas Piggin <npiggin@gmail.com>

powerpc: interrupt stack backtracing

Add support for backtracing across interrupt stacks, and add
interrupt frame backtrace for unhandled interrupts.

This requires a back-chain created from initial

powerpc: interrupt stack backtracing

Add support for backtracing across interrupt stacks, and add
interrupt frame backtrace for unhandled interrupts.

This requires a back-chain created from initial interrupt stack
frame to the r1 value of the interrupted context. A label is
added at the return location of the exception handler call, so
the unwinder can recognize the initial interrupt frame.

The additional cstart entry-frame is no longer required because
the unwinder now looks for frame == 0 as well as address == 0.

Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
Message-ID: <20240405083539.374995-11-npiggin@gmail.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>

show more ...


/kvm-unit-tests/.gitlab-ci.yml
/kvm-unit-tests/arm/efi/crt0-efi-aarch64.S
/kvm-unit-tests/arm/efi/elf_aarch64_efi.lds
/kvm-unit-tests/arm/efi/run
/kvm-unit-tests/arm/gic.c
/kvm-unit-tests/arm/run
/kvm-unit-tests/common/memory-verify.c
/kvm-unit-tests/common/selftest-migration.c
/kvm-unit-tests/configure
/kvm-unit-tests/lib/arm/mmu.c
/kvm-unit-tests/lib/arm/setup.c
/kvm-unit-tests/lib/arm/stack.c
/kvm-unit-tests/lib/arm64/processor.c
/kvm-unit-tests/lib/arm64/stack.c
/kvm-unit-tests/lib/efi.c
/kvm-unit-tests/lib/elf.h
/kvm-unit-tests/lib/linux/efi.h
/kvm-unit-tests/lib/memregions.c
/kvm-unit-tests/lib/memregions.h
/kvm-unit-tests/lib/migrate.c
/kvm-unit-tests/lib/migrate.h
processor.c
/kvm-unit-tests/lib/ppc64/asm/stack.h
/kvm-unit-tests/lib/ppc64/stack.c
/kvm-unit-tests/lib/riscv/asm/setup.h
/kvm-unit-tests/lib/riscv/processor.c
/kvm-unit-tests/lib/riscv/setup.c
/kvm-unit-tests/lib/riscv/stack.c
/kvm-unit-tests/lib/s390x/stack.c
/kvm-unit-tests/lib/stack.c
/kvm-unit-tests/lib/stack.h
/kvm-unit-tests/lib/x86/stack.c
/kvm-unit-tests/powerpc/Makefile.common
/kvm-unit-tests/powerpc/Makefile.ppc64
/kvm-unit-tests/powerpc/cstart64.S
/kvm-unit-tests/powerpc/memory-verify.c
/kvm-unit-tests/powerpc/run
/kvm-unit-tests/powerpc/unittests.cfg
/kvm-unit-tests/riscv/Makefile
/kvm-unit-tests/riscv/cstart.S
/kvm-unit-tests/riscv/efi/crt0-efi-riscv64.S
/kvm-unit-tests/riscv/efi/elf_riscv64_efi.lds
/kvm-unit-tests/riscv/efi/reloc_riscv64.c
/kvm-unit-tests/riscv/efi/run
/kvm-unit-tests/riscv/flat.lds
/kvm-unit-tests/riscv/run
/kvm-unit-tests/riscv/sbi.c
/kvm-unit-tests/run_tests.sh
/kvm-unit-tests/s390x/Makefile
/kvm-unit-tests/s390x/memory-verify.c
/kvm-unit-tests/s390x/migration-cmm.c
/kvm-unit-tests/s390x/migration-skey.c
/kvm-unit-tests/s390x/migration.c
/kvm-unit-tests/s390x/unittests.cfg
/kvm-unit-tests/scripts/arch-run.bash
/kvm-unit-tests/scripts/mkstandalone.sh
/kvm-unit-tests/scripts/runtime.bash
/kvm-unit-tests/x86/hyperv.h
/kvm-unit-tests/x86/hyperv_clock.c
/kvm-unit-tests/x86/hyperv_connections.c
/kvm-unit-tests/x86/hyperv_stimer.c
/kvm-unit-tests/x86/hyperv_synic.c
/kvm-unit-tests/x86/unittests.cfg
9c5e191326-Feb-2024 Nicholas Piggin <npiggin@gmail.com>

powerpc: Cleanup SPR and MSR definitions

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, an

powerpc: Cleanup SPR and MSR definitions

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 <npiggin@gmail.com>
Message-ID: <20240226101218.1472843-6-npiggin@gmail.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>

show more ...

8b10d4fa26-Feb-2024 Nicholas Piggin <npiggin@gmail.com>

powerpc: add asm/time.h header with delay and get_clock_us/ms

This matches s390x clock and delay APIs, so common test code can start
using time facilities.

Signed-off-by: Nicholas Piggin <npiggin@g

powerpc: add asm/time.h header with delay and get_clock_us/ms

This matches s390x clock and delay APIs, so common test code can start
using time facilities.

Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
Message-ID: <20240226093832.1468383-5-npiggin@gmail.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>

show more ...

34f7286926-Feb-2024 Nicholas Piggin <npiggin@gmail.com>

powerpc: Fix pseries getchar return value

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-

powerpc: Fix pseries getchar return value

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 <npiggin@gmail.com>
Message-ID: <20240226101218.1472843-3-npiggin@gmail.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>

show more ...


/kvm-unit-tests/.gitlab-ci.yml
/kvm-unit-tests/MAINTAINERS
/kvm-unit-tests/Makefile
/kvm-unit-tests/arm/Makefile.common
/kvm-unit-tests/arm/selftest.c
/kvm-unit-tests/arm/sieve.c
/kvm-unit-tests/common/selftest-migration.c
/kvm-unit-tests/common/sieve.c
/kvm-unit-tests/configure
/kvm-unit-tests/lib/arm/asm/gic-v2.h
/kvm-unit-tests/lib/arm/asm/gic-v3.h
/kvm-unit-tests/lib/arm/asm/gic.h
/kvm-unit-tests/lib/arm/asm/setup.h
/kvm-unit-tests/lib/arm/asm/smp.h
/kvm-unit-tests/lib/arm/io.c
/kvm-unit-tests/lib/arm/mmu.c
/kvm-unit-tests/lib/arm/setup.c
/kvm-unit-tests/lib/arm/smp.c
/kvm-unit-tests/lib/cpumask.h
/kvm-unit-tests/lib/ctype.h
/kvm-unit-tests/lib/elf.h
/kvm-unit-tests/lib/ldiv32.c
/kvm-unit-tests/lib/linux/const.h
/kvm-unit-tests/lib/memregions.c
/kvm-unit-tests/lib/memregions.h
/kvm-unit-tests/lib/migrate.c
/kvm-unit-tests/lib/migrate.h
/kvm-unit-tests/lib/on-cpus.c
/kvm-unit-tests/lib/on-cpus.h
hcall.c
/kvm-unit-tests/lib/riscv/.gitignore
/kvm-unit-tests/lib/riscv/asm-offsets.c
/kvm-unit-tests/lib/riscv/asm/asm-offsets.h
/kvm-unit-tests/lib/riscv/asm/barrier.h
/kvm-unit-tests/lib/riscv/asm/bitops.h
/kvm-unit-tests/lib/riscv/asm/bug.h
/kvm-unit-tests/lib/riscv/asm/csr.h
/kvm-unit-tests/lib/riscv/asm/io.h
/kvm-unit-tests/lib/riscv/asm/isa.h
/kvm-unit-tests/lib/riscv/asm/memory_areas.h
/kvm-unit-tests/lib/riscv/asm/mmu.h
/kvm-unit-tests/lib/riscv/asm/page.h
/kvm-unit-tests/lib/riscv/asm/pgtable.h
/kvm-unit-tests/lib/riscv/asm/processor.h
/kvm-unit-tests/lib/riscv/asm/ptrace.h
/kvm-unit-tests/lib/riscv/asm/sbi.h
/kvm-unit-tests/lib/riscv/asm/setup.h
/kvm-unit-tests/lib/riscv/asm/smp.h
/kvm-unit-tests/lib/riscv/asm/spinlock.h
/kvm-unit-tests/lib/riscv/asm/stack.h
/kvm-unit-tests/lib/riscv/bitops.c
/kvm-unit-tests/lib/riscv/io.c
/kvm-unit-tests/lib/riscv/isa.c
/kvm-unit-tests/lib/riscv/mmu.c
/kvm-unit-tests/lib/riscv/processor.c
/kvm-unit-tests/lib/riscv/sbi.c
/kvm-unit-tests/lib/riscv/setup.c
/kvm-unit-tests/lib/riscv/smp.c
/kvm-unit-tests/lib/riscv/stack.c
/kvm-unit-tests/lib/string.c
/kvm-unit-tests/lib/string.h
/kvm-unit-tests/powerpc/Makefile.common
/kvm-unit-tests/powerpc/cstart64.S
/kvm-unit-tests/powerpc/flat.lds
/kvm-unit-tests/powerpc/selftest-migration.c
/kvm-unit-tests/powerpc/unittests.cfg
/kvm-unit-tests/riscv/Makefile
/kvm-unit-tests/riscv/cstart.S
/kvm-unit-tests/riscv/flat.lds
/kvm-unit-tests/riscv/run
/kvm-unit-tests/riscv/sbi.c
/kvm-unit-tests/riscv/selftest.c
/kvm-unit-tests/riscv/sieve.c
/kvm-unit-tests/riscv/unittests.cfg
/kvm-unit-tests/s390x/Makefile
/kvm-unit-tests/s390x/selftest-migration.c
/kvm-unit-tests/s390x/sieve.c
/kvm-unit-tests/s390x/unittests.cfg
/kvm-unit-tests/scripts/arch-run.bash
/kvm-unit-tests/scripts/pretty_print_stacks.py
/kvm-unit-tests/scripts/runtime.bash
/kvm-unit-tests/x86/pmu.c
/kvm-unit-tests/x86/pmu_pebs.c
/kvm-unit-tests/x86/sieve.c
/kvm-unit-tests/x86/svm_tests.c
/kvm-unit-tests/x86/vmx_tests.c
56fb149416-Dec-2023 Nicholas Piggin <npiggin@gmail.com>

powerpc: Add support for more interrupts including HV interrupts

Interrupt vectors were not being populated for all architected
interrupt types, which could lead to crashes rather than a message for

powerpc: Add support for more interrupts including HV interrupts

Interrupt vectors were not being populated for all architected
interrupt types, which could lead to crashes rather than a message for
unhandled interrupts.

0x20 sized vectors require some reworking of the code to fit. This
also adds support for HV / HSRR type interrupts which will be used in
a later change.

Acked-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
Message-ID: <20231216134257.1743345-16-npiggin@gmail.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>

show more ...

8791cea016-Dec-2023 Nicholas Piggin <npiggin@gmail.com>

powerpc: Make interrupt handler error more readable

Installing the same handler twice reports a shifted trap vector
address which is hard to decipher. Print the unshifted address.

Signed-off-by: Ni

powerpc: Make interrupt handler error more readable

Installing the same handler twice reports a shifted trap vector
address which is hard to decipher. Print the unshifted address.

Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
Message-ID: <20231216134257.1743345-14-npiggin@gmail.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>

show more ...

0ec01e2716-Dec-2023 Nicholas Piggin <npiggin@gmail.com>

powerpc: Expand exception handler vector granularity

Exception handlers are currently indexed in units of 0x100, but
powerpc can have vectors that are aligned to as little as 0x20
bytes. Increase gr

powerpc: Expand exception handler vector granularity

Exception handlers are currently indexed in units of 0x100, but
powerpc can have vectors that are aligned to as little as 0x20
bytes. Increase granularity of the handler functions before
adding support for those vectors.

Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
Message-ID: <20231216134257.1743345-15-npiggin@gmail.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>

show more ...

99bb51c216-Dec-2023 Nicholas Piggin <npiggin@gmail.com>

powerpc: Fix interrupt stack alignment

ppc64 requires the stack to be 16-byte aligned but the interrupt
stack frame has 8-byte aligned size. Add padding to fix.

Signed-off-by: Nicholas Piggin <npig

powerpc: Fix interrupt stack alignment

ppc64 requires the stack to be 16-byte aligned but the interrupt
stack frame has 8-byte aligned size. Add padding to fix.

Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
Message-ID: <20231216134257.1743345-10-npiggin@gmail.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>

show more ...


/kvm-unit-tests/MAINTAINERS
/kvm-unit-tests/Makefile
/kvm-unit-tests/arm/Makefile.common
/kvm-unit-tests/arm/micro-bench.c
/kvm-unit-tests/arm/pmu.c
/kvm-unit-tests/lib/arm64/asm/sysreg.h
setup.c
/kvm-unit-tests/lib/ppc64/asm/ptrace.h
/kvm-unit-tests/lib/s390x/asm/arch_def.h
/kvm-unit-tests/lib/s390x/asm/cpacf.h
/kvm-unit-tests/lib/s390x/asm/interrupt.h
/kvm-unit-tests/lib/s390x/asm/mem.h
/kvm-unit-tests/lib/s390x/asm/uv.h
/kvm-unit-tests/lib/s390x/hardware.c
/kvm-unit-tests/lib/s390x/interrupt.c
/kvm-unit-tests/lib/s390x/mmu.c
/kvm-unit-tests/lib/s390x/mmu.h
/kvm-unit-tests/lib/s390x/pv_icptdata.h
/kvm-unit-tests/lib/s390x/sclp-console.c
/kvm-unit-tests/lib/s390x/sclp.c
/kvm-unit-tests/lib/s390x/sclp.h
/kvm-unit-tests/lib/s390x/sie.c
/kvm-unit-tests/lib/s390x/sie.h
/kvm-unit-tests/lib/s390x/snippet.h
/kvm-unit-tests/lib/s390x/stsi.h
/kvm-unit-tests/lib/s390x/uv.c
/kvm-unit-tests/lib/s390x/uv.h
/kvm-unit-tests/lib/util.h
/kvm-unit-tests/lib/x86/apic.c
/kvm-unit-tests/lib/x86/apic.h
/kvm-unit-tests/lib/x86/desc.c
/kvm-unit-tests/lib/x86/desc.h
/kvm-unit-tests/lib/x86/fault_test.c
/kvm-unit-tests/lib/x86/msr.h
/kvm-unit-tests/lib/x86/processor.h
/kvm-unit-tests/lib/x86/smp.c
/kvm-unit-tests/lib/x86/usermode.c
/kvm-unit-tests/powerpc/Makefile.common
/kvm-unit-tests/powerpc/emulator.c
/kvm-unit-tests/powerpc/run
/kvm-unit-tests/powerpc/spapr_hcall.c
/kvm-unit-tests/powerpc/spapr_vpa.c
/kvm-unit-tests/powerpc/unittests.cfg
/kvm-unit-tests/run_tests.sh
/kvm-unit-tests/s390x/Makefile
/kvm-unit-tests/s390x/flat.lds.S
/kvm-unit-tests/s390x/mvpg-sie.c
/kvm-unit-tests/s390x/pv-diags.c
/kvm-unit-tests/s390x/pv-icptcode.c
/kvm-unit-tests/s390x/pv-ipl.c
/kvm-unit-tests/s390x/run
/kvm-unit-tests/s390x/sclp.c
/kvm-unit-tests/s390x/selftest.c
/kvm-unit-tests/s390x/sie-dat.c
/kvm-unit-tests/s390x/sie.c
/kvm-unit-tests/s390x/snippets/asm/icpt-loop.S
/kvm-unit-tests/s390x/snippets/asm/loop.S
/kvm-unit-tests/s390x/snippets/asm/pv-diag-288.S
/kvm-unit-tests/s390x/snippets/asm/pv-diag-308.S
/kvm-unit-tests/s390x/snippets/asm/pv-diag-500.S
/kvm-unit-tests/s390x/snippets/asm/pv-diag-yield.S
/kvm-unit-tests/s390x/snippets/asm/pv-icpt-112.S
/kvm-unit-tests/s390x/snippets/asm/pv-icpt-vir-timing.S
/kvm-unit-tests/s390x/snippets/c/sie-dat.c
/kvm-unit-tests/s390x/snippets/c/sie-dat.h
/kvm-unit-tests/s390x/spec_ex-sie.c
/kvm-unit-tests/s390x/spec_ex.c
/kvm-unit-tests/s390x/topology.c
/kvm-unit-tests/s390x/unittests.cfg
/kvm-unit-tests/s390x/uv-host.c
/kvm-unit-tests/scripts/arch-run.bash
/kvm-unit-tests/scripts/common.bash
/kvm-unit-tests/scripts/kernel-doc
/kvm-unit-tests/scripts/runtime.bash
/kvm-unit-tests/x86/Makefile.common
/kvm-unit-tests/x86/access.c
/kvm-unit-tests/x86/apic.c
/kvm-unit-tests/x86/asyncpf.c
/kvm-unit-tests/x86/cet.c
/kvm-unit-tests/x86/cmpxchg8b.c
/kvm-unit-tests/x86/emulator.c
/kvm-unit-tests/x86/emulator64.c
/kvm-unit-tests/x86/eventinj.c
/kvm-unit-tests/x86/hyperv_connections.c
/kvm-unit-tests/x86/hyperv_stimer.c
/kvm-unit-tests/x86/hyperv_synic.c
/kvm-unit-tests/x86/intel-iommu.c
/kvm-unit-tests/x86/ioapic.c
/kvm-unit-tests/x86/memory.c
/kvm-unit-tests/x86/msr.c
/kvm-unit-tests/x86/pcid.c
/kvm-unit-tests/x86/pmu.c
/kvm-unit-tests/x86/pmu_pebs.c
/kvm-unit-tests/x86/svm.c
/kvm-unit-tests/x86/svm.h
/kvm-unit-tests/x86/svm_tests.c
/kvm-unit-tests/x86/taskswitch2.c
/kvm-unit-tests/x86/tscdeadline_latency.c
/kvm-unit-tests/x86/unittests.cfg
/kvm-unit-tests/x86/vmexit.c
/kvm-unit-tests/x86/vmx.h
/kvm-unit-tests/x86/vmx_tests.c
/kvm-unit-tests/x86/xsave.c
e7324a4808-Jun-2023 Nicholas Piggin <npiggin@gmail.com>

powerpc/spapr_vpa: Add basic VPA tests

The VPA is an optional memory structure shared between the hypervisor
and operating system, defined by PAPR. This test defines the structure
and adds registrat

powerpc/spapr_vpa: Add basic VPA tests

The VPA is an optional memory structure shared between the hypervisor
and operating system, defined by PAPR. This test defines the structure
and adds registration, deregistration, and a few simple sanity tests.

[Thanks to Thomas Huth for suggesting many of the test cases.]

Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Message-Id: <20230608075826.86217-8-npiggin@gmail.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>

show more ...

875ebbc708-Jun-2023 Nicholas Piggin <npiggin@gmail.com>

powerpc: Extract some common helpers and defines to headers

Move some common helpers and defines to processor.h.

Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
Message-Id: <20230608075826.86217

powerpc: Extract some common helpers and defines to headers

Move some common helpers and defines to processor.h.

Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
Message-Id: <20230608075826.86217-6-npiggin@gmail.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>

show more ...

ba33a96f08-Jun-2023 Nicholas Piggin <npiggin@gmail.com>

powerpc: Abstract H_CEDE calls into a sleep functions

This consolidates several implementations, and it no longer leaves
MSR[EE] enabled after the decrementer interrupt is handled, but
rather disabl

powerpc: Abstract H_CEDE calls into a sleep functions

This consolidates several implementations, and it no longer leaves
MSR[EE] enabled after the decrementer interrupt is handled, but
rather disables it on return.

The handler no longer allows a continuous ticking, but rather dec
has to be re-armed and EE re-enabled (e.g., via H_CEDE hcall) each
time.

Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
Message-Id: <20230608075826.86217-4-npiggin@gmail.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>

show more ...

123