History log of /kvm-unit-tests/lib/powerpc/asm/processor.h (Results 1 – 14 of 14)
Revision Date Author Comments
# 0cc3a351 22-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 ...


# 93c847c1 12-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 ...


# d4c8e725 12-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 ...


# 851ef516 12-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 ...


# c76b0d0a 04-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 ...


# 00af1c84 04-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 ...


# cd27b4ba 04-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 ...


# 610c5a9c 04-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 ...


# 9c5e1913 26-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 ...


# 8b10d4fa 26-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 ...


# 875ebbc7 08-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 ...


# ba33a96f 08-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 ...


# f4d8d939 19-Aug-2016 Suraj Jitindar Singh <sjitindarsingh@gmail.com>

lib/powerpc: Implement generic delay function for use in unit tests

It would be nice if we had a generic delay function which could be used
in unit tests, add one.

Add the variable tb_hz used to st

lib/powerpc: Implement generic delay function for use in unit tests

It would be nice if we had a generic delay function which could be used
in unit tests, add one.

Add the variable tb_hz used to store the time base frequency which is read
from the device tree on setup.

Add functions mdelay, udelay and delay in processor.c to delay for a given
number of milliseconds, microseconds and time base ticks respectively.

Signed-off-by: Suraj Jitindar Singh <sjitindarsingh@gmail.com>
Reviewed-by: Andrew Jones <drjones@redhat.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: Radim Krčmář <rkrcmar@redhat.com>

show more ...


# 6842bc34 21-Mar-2016 Laurent Vivier <lvivier@redhat.com>

powerpc: add exception handler

Signed-off-by: Laurent Vivier <lvivier@redhat.com>
Reviewed-by: David Gibson <dgibson@redhat.com>
Message-Id: <1458560014-28862-2-git-send-email-lvivier@redhat.com>
Si

powerpc: add exception handler

Signed-off-by: Laurent Vivier <lvivier@redhat.com>
Reviewed-by: David Gibson <dgibson@redhat.com>
Message-Id: <1458560014-28862-2-git-send-email-lvivier@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>

show more ...