debuggers.hg
changeset 20940:9fc37faa25a0
x86: Intel EPT entry structure changes.
- Intel SDM defines bit6 in EPT page table entry as "Ignore PAT
memory type", so change the abbreviation from "igmt" to "ipat".
- Change the mfn and avail2 fields according to SDM definition.
Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com>
- Intel SDM defines bit6 in EPT page table entry as "Ignore PAT
memory type", so change the abbreviation from "igmt" to "ipat".
- Change the mfn and avail2 fields according to SDM definition.
Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com>
author | Keir Fraser <keir.fraser@citrix.com> |
---|---|
date | Thu Feb 04 09:04:33 2010 +0000 (2010-02-04) |
parents | 845d04d505d0 |
children | 729b32b17440 |
files | xen/arch/x86/hvm/mtrr.c xen/arch/x86/mm/hap/p2m-ept.c xen/include/asm-x86/hvm/vmx/vmx.h xen/include/asm-x86/mtrr.h |
line diff
1.1 --- a/xen/arch/x86/hvm/mtrr.c Thu Feb 04 09:03:42 2010 +0000 1.2 +++ b/xen/arch/x86/hvm/mtrr.c Thu Feb 04 09:04:33 2010 +0000 1.3 @@ -707,13 +707,13 @@ HVM_REGISTER_SAVE_RESTORE(MTRR, hvm_save 1.4 1, HVMSR_PER_VCPU); 1.5 1.6 uint8_t epte_get_entry_emt(struct domain *d, unsigned long gfn, mfn_t mfn, 1.7 - uint8_t *igmt, int direct_mmio) 1.8 + uint8_t *ipat, int direct_mmio) 1.9 { 1.10 uint8_t gmtrr_mtype, hmtrr_mtype; 1.11 uint32_t type; 1.12 struct vcpu *v = current; 1.13 1.14 - *igmt = 0; 1.15 + *ipat = 0; 1.16 1.17 if ( (current->domain != d) && 1.18 ((d->vcpu == NULL) || ((v = d->vcpu[0]) == NULL)) ) 1.19 @@ -733,7 +733,7 @@ uint8_t epte_get_entry_emt(struct domain 1.20 1.21 if ( !iommu_enabled ) 1.22 { 1.23 - *igmt = 1; 1.24 + *ipat = 1; 1.25 return MTRR_TYPE_WRBACK; 1.26 } 1.27 1.28 @@ -742,7 +742,7 @@ uint8_t epte_get_entry_emt(struct domain 1.29 1.30 if ( iommu_snoop ) 1.31 { 1.32 - *igmt = 1; 1.33 + *ipat = 1; 1.34 return MTRR_TYPE_WRBACK; 1.35 } 1.36
2.1 --- a/xen/arch/x86/mm/hap/p2m-ept.c Thu Feb 04 09:03:42 2010 +0000 2.2 +++ b/xen/arch/x86/mm/hap/p2m-ept.c Thu Feb 04 09:04:33 2010 +0000 2.3 @@ -105,11 +105,10 @@ static int ept_set_middle_entry(struct d 2.4 page_list_add_tail(pg, &d->arch.p2m->pages); 2.5 2.6 ept_entry->emt = 0; 2.7 - ept_entry->igmt = 0; 2.8 + ept_entry->ipat = 0; 2.9 ept_entry->sp_avail = 0; 2.10 ept_entry->avail1 = 0; 2.11 ept_entry->mfn = page_to_mfn(pg); 2.12 - ept_entry->rsvd = 0; 2.13 ept_entry->avail2 = 0; 2.14 2.15 ept_entry->r = ept_entry->w = ept_entry->x = 1; 2.16 @@ -186,7 +185,7 @@ ept_set_entry(struct domain *d, unsigned 2.17 int ret = 0; 2.18 int walk_level = order / EPT_TABLE_ORDER; 2.19 int direct_mmio = (p2mt == p2m_mmio_direct); 2.20 - uint8_t igmt = 0; 2.21 + uint8_t ipat = 0; 2.22 int need_modify_vtd_table = 1; 2.23 2.24 /* We only support 4k and 2m pages now */ 2.25 @@ -227,9 +226,9 @@ ept_set_entry(struct domain *d, unsigned 2.26 if ( mfn_valid(mfn_x(mfn)) || direct_mmio || p2m_is_paged(p2mt) || 2.27 (p2mt == p2m_ram_paging_in_start) ) 2.28 { 2.29 - ept_entry->emt = epte_get_entry_emt(d, gfn, mfn, &igmt, 2.30 + ept_entry->emt = epte_get_entry_emt(d, gfn, mfn, &ipat, 2.31 direct_mmio); 2.32 - ept_entry->igmt = igmt; 2.33 + ept_entry->ipat = ipat; 2.34 ept_entry->sp_avail = order ? 1 : 0; 2.35 2.36 if ( ret == GUEST_TABLE_SUPER_PAGE ) 2.37 @@ -253,7 +252,6 @@ ept_set_entry(struct domain *d, unsigned 2.38 } 2.39 2.40 ept_entry->avail1 = p2mt; 2.41 - ept_entry->rsvd = 0; 2.42 ept_entry->avail2 = 0; 2.43 2.44 ept_p2m_type_to_flags(ept_entry, p2mt); 2.45 @@ -292,8 +290,8 @@ ept_set_entry(struct domain *d, unsigned 2.46 split_ept_entry = split_table + i; 2.47 split_ept_entry->emt = epte_get_entry_emt(d, gfn - offset + i, 2.48 _mfn(super_mfn + i), 2.49 - &igmt, direct_mmio); 2.50 - split_ept_entry->igmt = igmt; 2.51 + &ipat, direct_mmio); 2.52 + split_ept_entry->ipat = ipat; 2.53 split_ept_entry->sp_avail = 0; 2.54 /* Don't increment mfn if it's a PoD mfn */ 2.55 if ( super_p2mt != p2m_populate_on_demand ) 2.56 @@ -301,7 +299,6 @@ ept_set_entry(struct domain *d, unsigned 2.57 else 2.58 split_ept_entry->mfn = super_mfn; 2.59 split_ept_entry->avail1 = super_p2mt; 2.60 - split_ept_entry->rsvd = 0; 2.61 split_ept_entry->avail2 = 0; 2.62 2.63 ept_p2m_type_to_flags(split_ept_entry, super_p2mt); 2.64 @@ -309,9 +306,9 @@ ept_set_entry(struct domain *d, unsigned 2.65 2.66 /* Set the destinated 4k page as normal */ 2.67 split_ept_entry = split_table + offset; 2.68 - split_ept_entry->emt = epte_get_entry_emt(d, gfn, mfn, &igmt, 2.69 + split_ept_entry->emt = epte_get_entry_emt(d, gfn, mfn, &ipat, 2.70 direct_mmio); 2.71 - split_ept_entry->igmt = igmt; 2.72 + split_ept_entry->ipat = ipat; 2.73 2.74 if ( split_ept_entry->mfn == mfn_x(mfn) ) 2.75 need_modify_vtd_table = 0; 2.76 @@ -556,16 +553,16 @@ static mfn_t ept_get_entry_current(unsig 2.77 * return 1 to not to reset ept entry. 2.78 */ 2.79 static int need_modify_ept_entry(struct domain *d, unsigned long gfn, 2.80 - mfn_t mfn, uint8_t o_igmt, uint8_t o_emt, 2.81 + mfn_t mfn, uint8_t o_ipat, uint8_t o_emt, 2.82 p2m_type_t p2mt) 2.83 { 2.84 - uint8_t igmt; 2.85 + uint8_t ipat; 2.86 uint8_t emt; 2.87 int direct_mmio = (p2mt == p2m_mmio_direct); 2.88 2.89 - emt = epte_get_entry_emt(d, gfn, mfn, &igmt, direct_mmio); 2.90 + emt = epte_get_entry_emt(d, gfn, mfn, &ipat, direct_mmio); 2.91 2.92 - if ( (emt == o_emt) && (igmt == o_igmt) ) 2.93 + if ( (emt == o_emt) && (ipat == o_ipat) ) 2.94 return 0; 2.95 2.96 return 1; 2.97 @@ -599,21 +596,21 @@ void ept_change_entry_emt_with_range(str 2.98 * Set emt for super page. 2.99 */ 2.100 order = EPT_TABLE_ORDER; 2.101 - if ( need_modify_ept_entry(d, gfn, mfn, e.igmt, e.emt, e.avail1) ) 2.102 + if ( need_modify_ept_entry(d, gfn, mfn, e.ipat, e.emt, e.avail1) ) 2.103 ept_set_entry(d, gfn, mfn, order, e.avail1); 2.104 gfn += 0x1FF; 2.105 } 2.106 else 2.107 { 2.108 /* Change emt for partial entries of the 2m area. */ 2.109 - if ( need_modify_ept_entry(d, gfn, mfn, e.igmt, e.emt, e.avail1) ) 2.110 + if ( need_modify_ept_entry(d, gfn, mfn, e.ipat, e.emt, e.avail1) ) 2.111 ept_set_entry(d, gfn, mfn, order, e.avail1); 2.112 gfn = ((gfn >> EPT_TABLE_ORDER) << EPT_TABLE_ORDER) + 0x1FF; 2.113 } 2.114 } 2.115 else /* gfn assigned with 4k */ 2.116 { 2.117 - if ( need_modify_ept_entry(d, gfn, mfn, e.igmt, e.emt, e.avail1) ) 2.118 + if ( need_modify_ept_entry(d, gfn, mfn, e.ipat, e.emt, e.avail1) ) 2.119 ept_set_entry(d, gfn, mfn, order, e.avail1); 2.120 } 2.121 }
3.1 --- a/xen/include/asm-x86/hvm/vmx/vmx.h Thu Feb 04 09:03:42 2010 +0000 3.2 +++ b/xen/include/asm-x86/hvm/vmx/vmx.h Thu Feb 04 09:04:33 2010 +0000 3.3 @@ -34,12 +34,11 @@ typedef union { 3.4 w : 1, 3.5 x : 1, 3.6 emt : 3, /* EPT Memory type */ 3.7 - igmt : 1, /* Ignore MTRR memory type */ 3.8 + ipat : 1, /* Ignore PAT memory type */ 3.9 sp_avail : 1, /* Is this a superpage? */ 3.10 avail1 : 4, 3.11 - mfn : 45, 3.12 - rsvd : 5, 3.13 - avail2 : 2; 3.14 + mfn : 40, 3.15 + avail2 : 12; 3.16 }; 3.17 u64 epte; 3.18 } ept_entry_t;
4.1 --- a/xen/include/asm-x86/mtrr.h Thu Feb 04 09:03:42 2010 +0000 4.2 +++ b/xen/include/asm-x86/mtrr.h Thu Feb 04 09:04:33 2010 +0000 4.3 @@ -67,7 +67,7 @@ extern void mtrr_centaur_report_mcr(int 4.4 extern u32 get_pat_flags(struct vcpu *v, u32 gl1e_flags, paddr_t gpaddr, 4.5 paddr_t spaddr, uint8_t gmtrr_mtype); 4.6 extern uint8_t epte_get_entry_emt(struct domain *d, unsigned long gfn, 4.7 - mfn_t mfn, uint8_t *igmt, int direct_mmio); 4.8 + mfn_t mfn, uint8_t *ipat, int direct_mmio); 4.9 extern void ept_change_entry_emt_with_range( 4.10 struct domain *d, unsigned long start_gfn, unsigned long end_gfn); 4.11 extern unsigned char pat_type_2_pte_flags(unsigned char pat_type);