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

Thomas Huth thuth at redhat.com
Tue Jun 4 20:53:27 AEST 2024


On 04/05/2024 14.28, Nicholas Piggin wrote:
> 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 be
> used on top of a TCG processor (if TCG is emulating HV mode, or if it
> provides a nested hypervisor interface with spapr). This can be a
> problem because some issues relate to TCG CPU emulation, and some to
> the spapr hypervisor implementation. At the moment there is no way to
> determine TCG is running a KVM host that is running the tests, but the
> two independent variables are added in case that is able to be
> determined in future. For now that case is just incorrectly considered
> to be kvm && !tcg.
> 
> Use this facility to restrict some of the known test failures to TCG.
> 
> Signed-off-by: Nicholas Piggin <npiggin at gmail.com>
> ---
>   lib/powerpc/asm/processor.h |  3 +++
>   lib/powerpc/setup.c         | 25 +++++++++++++++++++++++++
>   powerpc/atomics.c           |  2 +-
>   powerpc/interrupts.c        |  6 ++++--
>   powerpc/mmu.c               |  2 +-
>   powerpc/pmu.c               |  6 +++---
>   powerpc/sprs.c              |  2 +-
>   powerpc/timebase.c          |  4 ++--
>   powerpc/tm.c                |  2 +-
>   9 files changed, 41 insertions(+), 11 deletions(-)

As mentioned elsewhere, it would be nice to have this earlier in the series 
so you could use the conditions in the earlier patches already (but if it is 
too cumbersome to rework, I don't insist on that).

Reviewed-by: Thomas Huth <thuth at redhat.com>




More information about the Linuxppc-dev mailing list