VMM: Fix MSR emulation (XCC)
[akaros.git] / kern / arch / x86 / ros / vmx.h
index a233cf4..40fade9 100644 (file)
@@ -411,6 +411,8 @@ enum vmcs_field {
 #define INTR_TYPE_SOFT_INTR             (4 << 8) /* software interrupt */
 #define INTR_TYPE_SOFT_EXCEPTION       (6 << 8) /* software exception */
 
+#define VMX_POSTED_OUTSTANDING_NOTIF           256
+
 /* GUEST_INTERRUPTIBILITY_INFO flags. */
 #define GUEST_INTR_STATE_STI           0x00000001
 #define GUEST_INTR_STATE_MOV_SS                0x00000002
@@ -639,8 +641,15 @@ struct vmcs {
 
 typedef uint64_t gpa_t;
 typedef uint64_t gva_t;
+/* TODO: remove these nasty macros */
 #define rdmsrl(msr, val) (val) = read_msr((msr))
-#define rdmsr(msr, low, high) do {uint64_t m = read_msr(msr); low = m; high = m>>32;} while (0)
+#define rdmsr(msr, low, high)                                                  \
+do {                                                                           \
+       uint64_t m = read_msr(msr);                                                \
+                                                                                  \
+       low = m & 0xffffffff;                                                      \
+       high = m >> 32;                                                            \
+} while (0)
 
 struct vmx_capability {
        uint32_t ept;