KVM: SVM: Add initial support for a VMGEXIT VMEXIT
[linux-2.6-microblaze.git] / arch / x86 / include / asm / svm.h
index 71d630b..caa8628 100644 (file)
@@ -130,7 +130,7 @@ struct __attribute__ ((__packed__)) vmcb_control_area {
        u32 exit_int_info_err;
        u64 nested_ctl;
        u64 avic_vapic_bar;
-       u8 reserved_4[8];
+       u64 ghcb_gpa;
        u32 event_inj;
        u32 event_inj_err;
        u64 nested_cr3;
@@ -178,7 +178,8 @@ struct __attribute__ ((__packed__)) vmcb_control_area {
 #define LBR_CTL_ENABLE_MASK BIT_ULL(0)
 #define VIRTUAL_VMLOAD_VMSAVE_ENABLE_MASK BIT_ULL(1)
 
-#define SVM_INTERRUPT_SHADOW_MASK 1
+#define SVM_INTERRUPT_SHADOW_MASK      BIT_ULL(0)
+#define SVM_GUEST_INTERRUPT_MASK       BIT_ULL(1)
 
 #define SVM_IOIO_STR_SHIFT 2
 #define SVM_IOIO_REP_SHIFT 3
@@ -379,6 +380,16 @@ struct vmcb {
                                (unsigned long *)&ghcb->save.valid_bitmap);     \
        }                                                                       \
                                                                                \
+       static inline u64 ghcb_get_##field(struct ghcb *ghcb)                   \
+       {                                                                       \
+               return ghcb->save.field;                                        \
+       }                                                                       \
+                                                                               \
+       static inline u64 ghcb_get_##field##_if_valid(struct ghcb *ghcb)        \
+       {                                                                       \
+               return ghcb_##field##_is_valid(ghcb) ? ghcb->save.field : 0;    \
+       }                                                                       \
+                                                                               \
        static inline void ghcb_set_##field(struct ghcb *ghcb, u64 value)       \
        {                                                                       \
                __set_bit(GHCB_BITMAP_IDX(field),                               \