summary refs log tree commit diff stats
path: root/hw/xen/xen_pt.h
diff options
context:
space:
mode:
authorKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>2015-07-01 15:41:33 -0400
committerStefano Stabellini <stefano.stabellini@eu.citrix.com>2015-09-10 16:47:12 +0000
commite2779de053b64f023de382fd87b3596613d47d1e (patch)
treef7b1c8b0d42b0b9208220a43e58002c89afbb1fa /hw/xen/xen_pt.h
parent5b4dd0f55ed3027557ed9a6fd89d5aa379122feb (diff)
downloadfocaccia-qemu-e2779de053b64f023de382fd87b3596613d47d1e.tar.gz
focaccia-qemu-e2779de053b64f023de382fd87b3596613d47d1e.zip
xen/pt: Remove XenPTReg->data field.
We do not want to have two entries to cache the guest configuration
registers: XenPTReg->data and dev.config. Instead we want to use
only the dev.config.

To do without much complications we rip out the ->data field
and replace it with an pointer to the dev.config. This way we
have the type-checking (uint8_t, uint16_t, etc) and as well
and pre-computed location.

Alternatively we could compute the offset in dev.config by
using the XenPTRRegInfo and XenPTRegGroup every time but
this way we have the pre-computed values.

This change also exposes some mis-use:
 - In 'xen_pt_status_reg_init' we used u32 for the Capabilities Pointer
   register, but said register is an an u16.
 - In 'xen_pt_msgdata_reg_write' we used u32 but should have only use u16.

Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Diffstat (limited to 'hw/xen/xen_pt.h')
-rw-r--r--hw/xen/xen_pt.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/hw/xen/xen_pt.h b/hw/xen/xen_pt.h
index 6763abc31c..76551efb26 100644
--- a/hw/xen/xen_pt.h
+++ b/hw/xen/xen_pt.h
@@ -138,7 +138,11 @@ struct XenPTRegInfo {
 struct XenPTReg {
     QLIST_ENTRY(XenPTReg) entries;
     XenPTRegInfo *reg;
-    uint32_t data; /* emulated value */
+    union {
+        uint8_t *byte;
+        uint16_t *half_word;
+        uint32_t *word;
+    } ptr; /* pointer to dev.config. */
 };
 
 typedef const struct XenPTRegGroupInfo XenPTRegGroupInfo;