History log of /kvm-unit-tests/lib/powerpc/setup.c (Results 1 – 25 of 30)
Revision Date Author Comments
# 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 ...


# 8e4e0512 04-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 ...


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


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


# 99bb51c2 16-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 ...


# 805a6954 13-Jun-2018 Paolo Bonzini <pbonzini@redhat.com>

Merge tag 's390x-ppc-2018-06-13' of https://gitlab.com/huth/kvm-unit-tests into HEAD

Cleaning up the prototypes for s390x and ppc and adding new IEP test on s390x.


# 4ff26ec5 06-Jun-2018 Thomas Huth <thuth@redhat.com>

powerpc: Make code compilable with -Wmissing-prototypes

It's always better to check whether the implementations match the
prototypes, so make the code compilable with the -Wmissing-prototypes
compil

powerpc: Make code compilable with -Wmissing-prototypes

It's always better to check whether the implementations match the
prototypes, so make the code compilable with the -Wmissing-prototypes
compiler flag. (However, the flag is not turned on yet since the other
architectures are not ready for this yet)

Reviewed-by: Laurent Vivier <lvivier@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>

show more ...


# dc47ac61 22-Oct-2017 Paolo Bonzini <pbonzini@redhat.com>

lib: simplify alloc_ops

Layer malloc/calloc/free/memalign over a basic allocator.
The implementation of high-level routines remains the basic one
from before, but the callback interface is reduced t

lib: simplify alloc_ops

Layer malloc/calloc/free/memalign over a basic allocator.
The implementation of high-level routines remains the basic one
from before, but the callback interface is reduced to a single
function. Since alloc.c now contains the physical address allocator
only, rename it.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>

show more ...


# 63d5cbec 27-Jun-2017 Thomas Huth <thuth@redhat.com>

Add a proper header for the lib/argv.c file

Instead of declaring the prototypes for these functions in various
C files, introduce a proper header for them. This change also
revealed that the prototy

Add a proper header for the lib/argv.c file

Instead of declaring the prototypes for these functions in various
C files, introduce a proper header for them. This change also
revealed that the prototypes of setup_args_progname() did not match
the implementation - the argument can be a "const char *", so change
the code in argv.c accordingly.

Signed-off-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: David Hildenbrand <david@redhat.com>
Reviewed-by: Andrew Jones <drjones@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>

show more ...


# 3a9d03a4 22-May-2017 Andrew Jones <drjones@redhat.com>

arm/powerpc: setup: apply assert_msg

Signed-off-by: Andrew Jones <drjones@redhat.com>
Message-Id: <20170522181821.29482-2-drjones@redhat.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Signed-off-b

arm/powerpc: setup: apply assert_msg

Signed-off-by: Andrew Jones <drjones@redhat.com>
Message-Id: <20170522181821.29482-2-drjones@redhat.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>

show more ...


# 75a58702 25-May-2017 Andrew Jones <drjones@redhat.com>

lib/powerpc/setup: fix comment

Signed-off-by: Andrew Jones <drjones@redhat.com>
Message-Id: <20170525103936.23063-1-drjones@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>


# f266c3e8 13-Jan-2017 Andrew Jones <drjones@redhat.com>

powerpc: enable environ

Give powerpc unit tests access to environment variables.
The environment variables are passed to the unit test with
'-initrd env-file'.

Signed-off-by: Andrew Jones <drjones@

powerpc: enable environ

Give powerpc unit tests access to environment variables.
The environment variables are passed to the unit test with
'-initrd env-file'.

Signed-off-by: Andrew Jones <drjones@redhat.com>
Signed-off-by: Radim Krčmář <rkrcmar@redhat.com>

show more ...


# 01c82c0a 13-Jan-2017 Andrew Jones <drjones@redhat.com>

powerpc: import initrd

If an initrd is provided on the qemu command line, then "import"
it by copying it to a safe location during setup.

Signed-off-by: Andrew Jones <drjones@redhat.com>
Signed-off

powerpc: import initrd

If an initrd is provided on the qemu command line, then "import"
it by copying it to a safe location during setup.

Signed-off-by: Andrew Jones <drjones@redhat.com>
Signed-off-by: Radim Krčmář <rkrcmar@redhat.com>

show more ...


# efe42003 13-Jan-2017 Andrew Jones <drjones@redhat.com>

powerpc: better document setup

To prepare for another region illustrate where we move the FDT.
No functional change.

Signed-off-by: Andrew Jones <drjones@redhat.com>
Signed-off-by: Radim Krčmář <rk

powerpc: better document setup

To prepare for another region illustrate where we move the FDT.
No functional change.

Signed-off-by: Andrew Jones <drjones@redhat.com>
Signed-off-by: Radim Krčmář <rkrcmar@redhat.com>

show more ...


# d81b83fd 13-Jan-2017 Andrew Jones <drjones@redhat.com>

devicetree: improve dt_get_bootargs interface

Don't lie to callers when bootargs wasn't found, they can check
for themselves. Also document that when a failure occurs @bootargs
will be NULL.

Signed

devicetree: improve dt_get_bootargs interface

Don't lie to callers when bootargs wasn't found, they can check
for themselves. Also document that when a failure occurs @bootargs
will be NULL.

Signed-off-by: Andrew Jones <drjones@redhat.com>
Signed-off-by: Radim Krčmář <rkrcmar@redhat.com>

show more ...


# ea325c68 22-Dec-2016 Paolo Bonzini <pbonzini@redhat.com>

Merge tag 'for-master' of https://github.com/rhdrjones/kvm-unit-tests into HEAD

arm/arm64 patches ready for master


# 7a20b74e 09-Dec-2016 Andrew Jones <drjones@redhat.com>

devicetree: cpu nodes may have 64-bit regs

Reported-by: Andre Przywara <andre.przywara@arm.com>
Cc: Laurent Vivier <lvivier@redhat.com>
Cc: Thomas Huth <thuth@redhat.com>
Signed-off-by: Andrew Jones

devicetree: cpu nodes may have 64-bit regs

Reported-by: Andre Przywara <andre.przywara@arm.com>
Cc: Laurent Vivier <lvivier@redhat.com>
Cc: Thomas Huth <thuth@redhat.com>
Signed-off-by: Andrew Jones <drjones@redhat.com>

show more ...


# d35482d5 09-Dec-2016 Andrew Jones <drjones@redhat.com>

lib/powerpc/setup: comment init dependencies

cpu_init must be called before mem_init because cpu_init determines
the cache-line sizes. Currently io_init has no dependency on
mem_init, but io_init sh

lib/powerpc/setup: comment init dependencies

cpu_init must be called before mem_init because cpu_init determines
the cache-line sizes. Currently io_init has no dependency on
mem_init, but io_init should be allowed to use heap allocation,
and someday it may, so we proactively comment it.

Cc: Laurent Vivier <lvivier@redhat.com>
Cc: Thomas Huth <thuth@redhat.com>
Signed-off-by: Andrew Jones <drjones@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 ...


# 809ebcb3 12-Jul-2016 Andrew Jones <drjones@redhat.com>

arm & powerpc: populate argv[0] fixups

* Fix powerpc builds, we can't pass $(LDFLAGS) to $(CC)
* Fix argv[0] name to include dir and suffix, like x86 has.
* Satisfy Drew's OCD by adding 'e' to all p

arm & powerpc: populate argv[0] fixups

* Fix powerpc builds, we can't pass $(LDFLAGS) to $(CC)
* Fix argv[0] name to include dir and suffix, like x86 has.
* Satisfy Drew's OCD by adding 'e' to all prognam variables,
matching the more popular variable name (says Google) used
by Paolo, PROGNAME.

Signed-off-by: Andrew Jones <drjones@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>

show more ...


12