#
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 ...
|
#
cc2ece41 |
| 04-May-2024 |
Nicholas Piggin <npiggin@gmail.com> |
powerpc: Add cpu_relax
Add a cpu_relax variant that uses SMT priority nop instructions like Linux. This was split out of the SMP patch because it affects the sprs test case.
Signed-off-by: Nicholas
powerpc: Add cpu_relax
Add a cpu_relax variant that uses SMT priority nop instructions like Linux. This was split out of the SMP patch because it affects the sprs test case.
Signed-off-by: Nicholas Piggin <npiggin@gmail.com> Message-ID: <20240504122841.1177683-18-npiggin@gmail.com> Reviewed-by: Thomas Huth <thuth@redhat.com> Signed-off-by: Thomas Huth <thuth@redhat.com>
show more ...
|
#
eb2d4443 |
| 02-Jun-2024 |
Nicholas Piggin <npiggin@gmail.com> |
powerpc/sprs: Fix report_kfail call
Parameters to report_kfail are wrong. String to bool conversion is not warned by gcc, and printf format did not catch it due to string variable being passed at th
powerpc/sprs: Fix report_kfail call
Parameters to report_kfail are wrong. String to bool conversion is not warned by gcc, and printf format did not catch it due to string variable being passed at the format location.
Fixes: 8f6290f0e6 ("powerpc/sprs: Specify SPRs with data rather than code") Signed-off-by: Nicholas Piggin <npiggin@gmail.com> Reviewed-by: Thomas Huth <thuth@redhat.com> Message-ID: <20240602122559.118345-2-npiggin@gmail.com> Signed-off-by: Thomas Huth <thuth@redhat.com>
show more ...
|
#
584c6ad4 |
| 04-May-2024 |
Nicholas Piggin <npiggin@gmail.com> |
powerpc/sprs: Test hypervisor registers on powernv machine
This enables HV privilege registers to be tested with the powernv machine.
Acked-by: Thomas Huth <thuth@redhat.com> Signed-off-by: Nichola
powerpc/sprs: Test hypervisor registers on powernv machine
This enables HV privilege registers to be tested with the powernv machine.
Acked-by: Thomas Huth <thuth@redhat.com> Signed-off-by: Nicholas Piggin <npiggin@gmail.com> Message-ID: <20240504122841.1177683-12-npiggin@gmail.com> Signed-off-by: Thomas Huth <thuth@redhat.com>
show more ...
|
#
d499b05f |
| 04-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 ...
|
#
8f6290f0 |
| 04-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 ...
|
#
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 ...
|
#
faaddcb0 |
| 08-Jun-2023 |
Nicholas Piggin <npiggin@gmail.com> |
powerpc: Add ISA v3.1 (POWER10) support to SPR test
This is a very basic detection that does not include all new SPRs.
Signed-off-by: Nicholas Piggin <npiggin@gmail.com> Reviewed-by: Thomas Huth <t
powerpc: Add ISA v3.1 (POWER10) support to SPR test
This is a very basic detection that does not include all new SPRs.
Signed-off-by: Nicholas Piggin <npiggin@gmail.com> Reviewed-by: Thomas Huth <thuth@redhat.com> Message-Id: <20230608075826.86217-5-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 ...
|
#
77a59d17 |
| 12-Dec-2022 |
Nico Boehr <nrb@linux.ibm.com> |
powerpc: use migrate_once() in migration tests
Signed-off-by: Nico Boehr <nrb@linux.ibm.com> Reviewed-by: Thomas Huth <thuth@redhat.com> Message-Id: <20221212111731.292942-3-nrb@linux.ibm.com> Signe
powerpc: use migrate_once() in migration tests
Signed-off-by: Nico Boehr <nrb@linux.ibm.com> Reviewed-by: Thomas Huth <thuth@redhat.com> Message-Id: <20221212111731.292942-3-nrb@linux.ibm.com> Signed-off-by: Thomas Huth <thuth@redhat.com>
show more ...
|
#
a299895b |
| 06-Dec-2019 |
Thomas Huth <thuth@redhat.com> |
Switch the order of the parameters in report() and report_xfail()
Commit c09c54c66b1df ("lib: use an argument which doesn't require default argument promotion") fixed a warning that occurs with Clan
Switch the order of the parameters in report() and report_xfail()
Commit c09c54c66b1df ("lib: use an argument which doesn't require default argument promotion") fixed a warning that occurs with Clang, but introduced a regression: If the "pass" parameter is a value which has only set the condition bits in the upper 32 bits of a 64 bit value, the condition is now false since the value is truncated to "unsigned int" so that the upper bits are simply discarded.
We fixed it by reverting the commit, but that of course also means trouble with Clang again. We can not use "bool" if it is the last parameter before the variable argument list. The proper fix is to swap the parameters around and make the format string the last parameter.
This patch (except the changes in lib/libcflat.h and lib/report.c and some rebase conflicts along the way) has basically been created with following coccinelle script (with some additional manual tweaking of long and disabled lines afterwards):
@@ expression fmt; expression pass; expression list args; @@ report( -fmt, pass +pass, fmt , args);
@@ expression fmt; expression pass; expression list args; @@ report_xfail( -fmt, xfail, pass +xfail, pass, fmt , args);
Tested-by: Andrew Jones <drjones@redhat.com> Signed-off-by: Thomas Huth <thuth@redhat.com> Message-Id: <20191206113102.14914-1-thuth@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
show more ...
|
#
6af53d29 |
| 06-Jun-2019 |
Paolo Bonzini <pbonzini@redhat.com> |
Merge tag 'ppc-next-pull-request' of https://github.com/vivier/kvm-unit-tests into HEAD
Fix h_cede_tm timeout
|
#
3ff90d5f |
| 15-May-2019 |
Suraj Jitindar Singh <sjitindarsingh@gmail.com> |
powerpc: Allow for a custom decr value to be specified to load on decr excp
Currently the handler for a decrementer exception will simply reload the maximum value (0x7FFFFFFF), which will take ~4 se
powerpc: Allow for a custom decr value to be specified to load on decr excp
Currently the handler for a decrementer exception will simply reload the maximum value (0x7FFFFFFF), which will take ~4 seconds to expire again. This means that if a vcpu cedes, it will be ~4 seconds between wakeups.
The h_cede_tm test is testing a known breakage when a guest cedes while suspended. To be sure we cede 500 times to check for the bug. However since it takes ~4 seconds to be woken up once we've ceded, we only get through ~20 iterations before we reach the 90 seconds timeout and the test appears to fail.
Add an option when registering the decrementer handler to specify the value which should be reloaded by the handler, allowing the timeout to be chosen.
Modify the spr test to use the max timeout to preserve existing behaviour. Modify the h_cede_tm test to use a 10ms timeout to ensure we can perform 500 iterations before hitting the 90 second time limit for a test.
This means the h_cede_tm test now succeeds rather than timing out.
Signed-off-by: Suraj Jitindar Singh <sjitindarsingh@gmail.com> Reviewed-by: Thomas Huth <thuth@redhat.com> Reviewed-by: Laurent Vivier <lvivier@redhat.com> [lv: reset initial value to 0x3FFFFFFF] Signed-off-by: Laurent Vivier <lvivier@redhat.com>
show more ...
|
#
1aee4297 |
| 07-Feb-2018 |
Andrew Jones <drjones@redhat.com> |
powerpc: Introduce getchar
Move the unit test specific h_get_term_char() to powerpc common code. Make it __getchar() because it is not blocking, and wrap it with a real getchar(). Other architecture
powerpc: Introduce getchar
Move the unit test specific h_get_term_char() to powerpc common code. Make it __getchar() because it is not blocking, and wrap it with a real getchar(). Other architectures may want to implement __getchar() too (ARM will in a coming patch), so put the prototype in libcflat.h
Signed-off-by: Andrew Jones <drjones@redhat.com> Message-Id: <20180207190334.16516-5-drjones@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
show more ...
|
#
ffd9da55 |
| 07-Feb-2018 |
Andrew Jones <drjones@redhat.com> |
powerpc: don't use NMI's to signal end of migration
The SPRs test already supports using serial input as the trigger to proceed after waiting for migration to complete, but the general test framewor
powerpc: don't use NMI's to signal end of migration
The SPRs test already supports using serial input as the trigger to proceed after waiting for migration to complete, but the general test framework uses NMI's (which the SPR test also supported before this patch). ARM doesn't support NMI injection, so change the general framework to use serial input instead, and drop the NMI support from the SPR test.
Acked-by: Thomas Huth <thuth@redhat.com> Signed-off-by: Andrew Jones <drjones@redhat.com> Message-Id: <20180207190334.16516-4-drjones@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
show more ...
|
#
25a302cb |
| 24-Jul-2017 |
Thomas Huth <thuth@redhat.com> |
powerpc/sprs: Test POWER9 specific registers
Most of the SPRS are the same as on POWER8, so we can re-use the PowerISA 2.07 functions and simply amend the additional registers afterwards.
Signed-of
powerpc/sprs: Test POWER9 specific registers
Most of the SPRS are the same as on POWER8, so we can re-use the PowerISA 2.07 functions and simply amend the additional registers afterwards.
Signed-off-by: Thomas Huth <thuth@redhat.com> Reviewed-by: Laurent Vivier <lvivier@redhat.com> Signed-off-by: Radim Krčmář <rkrcmar@redhat.com>
show more ...
|
#
fd6aada0 |
| 17-May-2017 |
Radim Krčmář <rkrcmar@redhat.com> |
use %# instead of 0x% in all format strings
It's one character shorter, properly prefixed, and also provides error detection: %#d triggers a warning.
Done with `sed -i 's/0x%/%#/g' **/*.[ch]` to mo
use %# instead of 0x% in all format strings
It's one character shorter, properly prefixed, and also provides error detection: %#d triggers a warning.
Done with `sed -i 's/0x%/%#/g' **/*.[ch]` to motivate the use of %#, existing padding was raised by 2 to account for the counted "0x" (output should be the same).
Signed-off-by: Radim Krčmář <rkrcmar@redhat.com>
show more ...
|
#
65a9238e |
| 29-Mar-2017 |
Paolo Bonzini <pbonzini@redhat.com> |
Merge branch 'ppc-next' of https://github.com/huth/kvm-unit-tests into HEAD
|
#
ee30cf14 |
| 28-Mar-2017 |
Thomas Huth <thuth@redhat.com> |
powerpc: Add Special Purpose Register persistency test
This test has two purposes: First, check whether the hypervisor can be destabilized by writing random values into the SPRs of the PowerPC CPU (
powerpc: Add Special Purpose Register persistency test
This test has two purposes: First, check whether the hypervisor can be destabilized by writing random values into the SPRs of the PowerPC CPU (this indeed revealed a bug last year, see CVE-2016-3044). Second, this test can be used to check whether the SPRs are synchronized properly between the KVM host CPU and QEMU, e.g. when migrating the VM from one QEMU instance to another. The test first fills the various SPRs with some non-zero value, then reads the values back into a first array. It then either sleeps a short period of time (for testing without migration, in the hope that we're rescheduled on another host CPU), or it waits for a key or NMI (with the '-w' option) so that it is possible to migrate the VM before continuing. The test then finally reads the values from the SPRs back into another array and then compares them with the initial values. Currently the test only supports the SPRs from the PowerISA v2.01 (PowerPC 970) and PowerISA v2.07 specification (i.e. POWER8 CPUs), but other versions should be pretty easy to add later.
Signed-off-by: Thomas Huth <thuth@redhat.com>
show more ...
|