[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-ppc] [PULL 03/62] spapr: Simulate CAS for qtest
From: |
David Gibson |
Subject: |
[Qemu-ppc] [PULL 03/62] spapr: Simulate CAS for qtest |
Date: |
Tue, 12 Mar 2019 19:52:17 +1100 |
From: Greg Kurz <address@hidden>
The RTAS event hotplug code for machine types 2.8 and newer depends on
the CAS negotiated ov5 in order to work properly. However, there's no
CAS when running under qtest. There has been a tentative to trick the
code by faking the OV5_HP_EVT bit, but it turned out to break other
assumptions in the code and the change got reverted.
Go for a more general approach and simulate a CAS when running under
qtest. For simplicity, this pseudo CAS simple simulates the case where
the guest supports the same features as the machine. It is done at
reset time, just before we reset the DRCs, which could potentially
exercise the unplug code.
This allows to test unplug on spapr with both older and newer machine
types.
Suggested-by: Michael Roth <address@hidden>
Signed-off-by: Greg Kurz <address@hidden>
Message-Id: <address@hidden>
Tested-by: Michael Roth <address@hidden>
Reviewed-by: Michael Roth <address@hidden>
Signed-off-by: David Gibson <address@hidden>
---
hw/ppc/spapr.c | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c
index 9e01226e18..f7d527464c 100644
--- a/hw/ppc/spapr.c
+++ b/hw/ppc/spapr.c
@@ -29,6 +29,7 @@
#include "qapi/visitor.h"
#include "sysemu/sysemu.h"
#include "sysemu/numa.h"
+#include "sysemu/qtest.h"
#include "hw/hw.h"
#include "qemu/log.h"
#include "hw/fw-path-provider.h"
@@ -1711,6 +1712,16 @@ static void spapr_machine_reset(void)
*/
spapr_irq_reset(spapr, &error_fatal);
+ /*
+ * There is no CAS under qtest. Simulate one to please the code that
+ * depends on spapr->ov5_cas. This is especially needed to test device
+ * unplug, so we do that before resetting the DRCs.
+ */
+ if (qtest_enabled()) {
+ spapr_ovec_cleanup(spapr->ov5_cas);
+ spapr->ov5_cas = spapr_ovec_clone(spapr->ov5);
+ }
+
/* DRC reset may cause a device to be unplugged. This will cause troubles
* if this device is used by another device (eg, a running vhost backend
* will crash QEMU if the DIMM holding the vring goes away). To avoid such
--
2.20.1
- [Qemu-ppc] [PULL 23/62] ppc/xive: export the TIMA memory accessors, (continued)
- [Qemu-ppc] [PULL 23/62] ppc/xive: export the TIMA memory accessors, David Gibson, 2019/03/12
- [Qemu-ppc] [PULL 18/62] spapr: Force SPAPR_MEMORY_BLOCK_SIZE to be a hwaddr (64-bit), David Gibson, 2019/03/12
- [Qemu-ppc] [PULL 07/62] target/ppc: Implement large decrementer support for KVM, David Gibson, 2019/03/12
- [Qemu-ppc] [PULL 25/62] ppc/pnv: change the CPU machine_data presenter type to Object *, David Gibson, 2019/03/12
- [Qemu-ppc] [PULL 02/62] vfio/spapr: Rename local systempagesize variable, David Gibson, 2019/03/12
- [Qemu-ppc] [PULL 14/62] target/ppc: Move handling of hardware breakpoints to a separate function, David Gibson, 2019/03/12
- [Qemu-ppc] [PULL 09/62] target/ppc/spapr: Add workaround option to SPAPR_CAP_IBS, David Gibson, 2019/03/12
- [Qemu-ppc] [PULL 04/62] Revert "spapr: support memory unplug for qtest", David Gibson, 2019/03/12
- [Qemu-ppc] [PULL 26/62] ppc/pnv: add a XIVE interrupt controller model for POWER9, David Gibson, 2019/03/12
- [Qemu-ppc] [PULL 08/62] target/ppc/spapr: Enable the large decrementer for pseries-4.0, David Gibson, 2019/03/12
- [Qemu-ppc] [PULL 03/62] spapr: Simulate CAS for qtest,
David Gibson <=
- [Qemu-ppc] [PULL 11/62] target/ppc/tcg: make spapr_caps apply cap-[cfpc/sbbc/ibs] non-fatal for tcg, David Gibson, 2019/03/12
- [Qemu-ppc] [PULL 15/62] target/ppc: Refactor kvm_handle_debug, David Gibson, 2019/03/12
- [Qemu-ppc] [PULL 01/62] vfio/spapr: Fix indirect levels calculation, David Gibson, 2019/03/12
- [Qemu-ppc] [PULL 16/62] PPC: E500: Update u-boot to v2019.01, David Gibson, 2019/03/12