OSDN Git Service

spapr: Simulate CAS for qtest
authorGreg Kurz <groug@kaod.org>
Fri, 1 Mar 2019 19:32:37 +0000 (20:32 +0100)
committerDavid Gibson <david@gibson.dropbear.id.au>
Mon, 11 Mar 2019 23:50:59 +0000 (10:50 +1100)
commit23ff81bdfd1e8119127779ea67c3a05ce4a6227d
treefbe7d4c98698e2f96fb638915b337bb348accfde
parent3cdd801b0b65ec3fbb9280a2fa22976ad96645b0
spapr: Simulate CAS for qtest

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 <mdroth@linux.vnet.ibm.com>
Signed-off-by: Greg Kurz <groug@kaod.org>
Message-Id: <155146875704.147873.10563808578795890265.stgit@bahia.lan>
Tested-by: Michael Roth <mdroth@linux.vnet.ibm.com>
Reviewed-by: Michael Roth <mdroth@linux.vnet.ibm.com>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
hw/ppc/spapr.c