X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?a=blobdiff_plain;f=palacios%2Finclude%2Fpalacios%2Fvmm_lowlevel.h;h=331a3076b48df57445e223ab0de312e981c9ba73;hb=fe36af6238917000f4cc8b971829e347732df598;hp=8e85162fcf9a8f77e8425df7844c60b412af8b99;hpb=c06413341bf1dca02f22c0502fa5c2d1c2c11eab;p=palacios-OLD.git diff --git a/palacios/include/palacios/vmm_lowlevel.h b/palacios/include/palacios/vmm_lowlevel.h index 8e85162..331a307 100644 --- a/palacios/include/palacios/vmm_lowlevel.h +++ b/palacios/include/palacios/vmm_lowlevel.h @@ -23,6 +23,47 @@ #define CPUID_FEATURE_IDS 0x00000001 #define CPUID_EXT_FEATURE_IDS 0x80000001 +struct seg_selector { + union { + uint16_t value; + struct { + uint8_t rpl : 2; + uint8_t ti : 1; + uint16_t si : 13; + } __attribute__((packed)); + } __attribute__((packed)); +} __attribute__((packed)); + +struct gen_segment { + uint16_t limit_lo; + uint32_t base_lo : 24; + uint8_t type : 4; + uint8_t system : 1; + uint8_t dpl : 2; + uint8_t present : 1; + uint8_t limit_hi : 4; + uint8_t avail : 1; + uint8_t long_mode : 1; + uint8_t db : 1; + uint8_t granularity : 1; + uint8_t base_hi : 8; +} __attribute__((packed)); + +struct sys_segment64 { + uint16_t limit_lo; + uint32_t base_lo : 24; + uint8_t type : 4; + uint8_t rsvd0 : 1; + uint8_t dpl : 2; + uint8_t present : 1; + uint8_t limit_hi : 4; + uint8_t avail : 1; + uint8_t rsvd1 : 3; + uint8_t granularity : 1; + uint64_t base_hi : 40; + uint32_t rsvd2; +} __attribute__((packed)); + static void __inline__ v3_cpuid(uint32_t target, @@ -30,7 +71,7 @@ static void __inline__ v3_cpuid(uint32_t target, uint32_t * ecx, uint32_t * edx) { __asm__ __volatile__ ( "cpuid\n\t" - : "=a" (*eax), "=S" (*ebx), "=c" (*ecx), "=d" (*edx) + : "=a" (*eax), "=b" (*ebx), "=c" (*ecx), "=d" (*edx) : "0" (target), "2" (*ecx) ); return;