aboutsummaryrefslogtreecommitdiff
path: root/include/hw/ppc
diff options
context:
space:
mode:
authorGreg Kurz <groug@kaod.org>2017-11-13 20:42:39 +0100
committerDavid Gibson <david@gibson.dropbear.id.au>2017-11-14 11:12:42 +1100
commitdcb556fc6ad879f7d29fb233a273a1ea3aa0549c (patch)
treeabb2d4d950e9ae5676991aa5552cc063e9ec398c /include/hw/ppc
parente05fba5004676cd0fa7c47b623cb0a14ad1feed8 (diff)
downloadqemu-dcb556fc6ad879f7d29fb233a273a1ea3aa0549c.zip
qemu-dcb556fc6ad879f7d29fb233a273a1ea3aa0549c.tar.gz
qemu-dcb556fc6ad879f7d29fb233a273a1ea3aa0549c.tar.bz2
xics/kvm: synchonize state before 'info pic'
When using the emulated XICS, the 'info pic' monitor command shows: CPU 0 XIRR=ff000000 ((nil)) PP=ff MFRR=ff ICS 1000..13ff 0x10040060340 1000 MSI 05 00 1001 MSI 05 00 1002 MSI 05 00 1003 MSI ff 00 1004 LSI ff 00 1005 LSI ff 00 1006 LSI ff 00 1007 LSI ff 00 1008 MSI 05 00 1009 MSI 05 00 100a MSI 05 00 100b MSI 05 00 100c MSI 05 00 but when using the in-kernel XICS with the very same guest, we get: CPU 0 XIRR=00000000 ((nil)) PP=ff MFRR=ff ICS 1000..13ff 0x10032e00340 1000 MSI ff 00 1001 MSI ff 00 1002 MSI ff 00 1003 MSI ff 00 1004 LSI ff 00 1005 LSI ff 00 1006 LSI ff 00 1007 LSI ff 00 1008 MSI ff 00 1009 MSI ff 00 100a MSI ff 00 100b MSI ff 00 100c MSI ff 00 ie, all irqs are masked and XIRR is null, while we should get the same output as with the emulated XICS. If the guest is then migrated, 'info pic' shows the expected values on both source and destination. The problem is that QEMU doesn't synchronize with KVM before printing the XICS state. Migration happens to fix the output because it enforces synchronization with KVM. To fix the invalid output of 'info pic', this patch introduces a new synchronize_state operation for both ICPStateClass and ICSStateClass. The ICP operation relies on run_on_cpu() in order to kick the vCPU and avoid sleeping on KVM_GET_ONE_REG. Signed-off-by: Greg Kurz <groug@kaod.org> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Diffstat (limited to 'include/hw/ppc')
-rw-r--r--include/hw/ppc/xics.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/include/hw/ppc/xics.h b/include/hw/ppc/xics.h
index 28d248a..2df99be 100644
--- a/include/hw/ppc/xics.h
+++ b/include/hw/ppc/xics.h
@@ -69,6 +69,7 @@ struct ICPStateClass {
void (*pre_save)(ICPState *icp);
int (*post_load)(ICPState *icp, int version_id);
void (*reset)(ICPState *icp);
+ void (*synchronize_state)(ICPState *icp);
};
struct ICPState {
@@ -119,6 +120,7 @@ struct ICSStateClass {
void (*reject)(ICSState *s, uint32_t irq);
void (*resend)(ICSState *s);
void (*eoi)(ICSState *s, uint32_t irq);
+ void (*synchronize_state)(ICSState *s);
};
struct ICSState {