X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?a=blobdiff_plain;f=palacios%2Finclude%2Fpalacios%2Fvmcb.h;h=5728c74bb391bd752f545b4b76a0adb73bd4413b;hb=101529b6eae500272347287df43ec51aa003d0aa;hp=a61cf8961f689e85ff310afcb4f0ae00bc3c9c58;hpb=fc90c3287f85c66e1f6616685b66a8339145c3ee;p=palacios.git diff --git a/palacios/include/palacios/vmcb.h b/palacios/include/palacios/vmcb.h index a61cf89..5728c74 100644 --- a/palacios/include/palacios/vmcb.h +++ b/palacios/include/palacios/vmcb.h @@ -1,8 +1,13 @@ +/* (c) 2008, Jack Lange */ +/* (c) 2008, The V3VEE Project */ + #ifndef __VMCB_H #define __VMCB_H -#include +#ifdef __V3VEE__ +#include +#include #define VMCB_CTRL_AREA_OFFSET 0x0 #define VMCB_STATE_SAVE_AREA_OFFSET 0x400 @@ -63,26 +68,26 @@ struct Debug_Registers { struct Exception_Vectors { - uint_t de : 1 PACKED; // divide by zero - uint_t db : 1 PACKED; // Debug - uint_t nmi : 1 PACKED; // Non-maskable interrupt - uint_t bp : 1 PACKED; // Breakpoint - uint_t of : 1 PACKED; // Overflow - uint_t br : 1 PACKED; // Bound-Range - uint_t ud : 1 PACKED; // Invalid-Opcode - uint_t nm : 1 PACKED; // Device-not-available - uint_t df : 1 PACKED; // Double Fault + uint_t de : 1 PACKED; // (0) divide by zero + uint_t db : 1 PACKED; // (1) Debug + uint_t nmi : 1 PACKED; // (2) Non-maskable interrupt + uint_t bp : 1 PACKED; // (3) Breakpoint + uint_t of : 1 PACKED; // (4) Overflow + uint_t br : 1 PACKED; // (5) Bound-Range + uint_t ud : 1 PACKED; // (6) Invalid-Opcode + uint_t nm : 1 PACKED; // (7) Device-not-available + uint_t df : 1 PACKED; // (8) Double Fault uint_t ex9 : 1 PACKED; - uint_t ts : 1 PACKED; // Invalid TSS - uint_t np : 1 PACKED; // Segment-not-present - uint_t ss : 1 PACKED; // Stack - uint_t gp : 1 PACKED; // General Protection Fault - uint_t pf : 1 PACKED; // Page fault + uint_t ts : 1 PACKED; // (10) Invalid TSS + uint_t np : 1 PACKED; // (11) Segment-not-present + uint_t ss : 1 PACKED; // (12) Stack + uint_t gp : 1 PACKED; // (13) General Protection Fault + uint_t pf : 1 PACKED; // (14) Page fault uint_t ex15 : 1 PACKED; - uint_t mf : 1 PACKED; // Floating point exception - uint_t ac : 1 PACKED; // Alignment-check - uint_t mc : 1 PACKED; // Machine Check - uint_t xf : 1 PACKED; // SIMD floating-point + uint_t mf : 1 PACKED; // (15) Floating point exception + uint_t ac : 1 PACKED; // (16) Alignment-check + uint_t mc : 1 PACKED; // (17) Machine Check + uint_t xf : 1 PACKED; // (18) SIMD floating-point uint_t ex20 : 1 PACKED; uint_t ex21 : 1 PACKED; uint_t ex22 : 1 PACKED; @@ -93,7 +98,7 @@ struct Exception_Vectors { uint_t ex27 : 1 PACKED; uint_t ex28 : 1 PACKED; uint_t ex29 : 1 PACKED; - uint_t sx : 1 PACKED; // Security Exception + uint_t sx : 1 PACKED; // (30) Security Exception uint_t ex31 : 1 PACKED; }; @@ -217,10 +222,13 @@ typedef struct VMCB_Control_Area { * But it does say that the EXITINTINFO field is in bits 63-1 * ALL other occurances mention a 1 bit reserved field */ - uint_t rsvd5 : 1 PACKED; - ullong_t exit_int_info : 63 PACKED; + // uint_t rsvd5 : 1 PACKED; + //ullong_t exit_int_info : 63 PACKED; /* ** */ + // AMD Manual 2, pg 391, sect: 15.19 + struct Interrupt_Info exit_int_info PACKED; + // uint_t NP_ENABLE : 1 PACKED; //ullong_t rsvd6 : 63 PACKED; // Should be 0 ullong_t NP_ENABLE PACKED; @@ -354,4 +362,9 @@ typedef struct VMCB_State_Save_Area { void PrintDebugVMCB(vmcb_t * vmcb); +void set_vmcb_segments(vmcb_t * vmcb, struct v3_segments * segs); +void get_vmcb_segments(vmcb_t * vmcb, struct v3_segments * segs); + +#endif // ! __V3VEE__ + #endif