[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-changelog] [xen-4.0-testing] x86 EPT: Only flush EPT TLB if the previous entry was valid
# HG changeset patch # User Keir Fraser <keir.fraser@xxxxxxxxxx> # Date 1274858891 -3600 # Node ID 2758a8028721c84e5349405b4f0984b065738c22 # Parent aa5ae409b1794108274e36c344f4e394e14184ee x86 EPT: Only flush EPT TLB if the previous entry was valid Original patch from George Dunlap <george.dunlap@xxxxxxxxxxxxx> Signed-off-by: Tim Deegan <Tim.Deegan@xxxxxxxxxx> xen-unstable changeset: 21455:32cdd423d4eb xen-unstable date: Wed May 26 08:08:46 2010 +0100 --- xen/arch/x86/mm/hap/p2m-ept.c | 9 ++++++++- 1 files changed, 8 insertions(+), 1 deletion(-) diff -r aa5ae409b179 -r 2758a8028721 xen/arch/x86/mm/hap/p2m-ept.c --- a/xen/arch/x86/mm/hap/p2m-ept.c Wed May 26 08:26:38 2010 +0100 +++ b/xen/arch/x86/mm/hap/p2m-ept.c Wed May 26 08:28:11 2010 +0100 @@ -187,6 +187,7 @@ ept_set_entry(struct domain *d, unsigned int direct_mmio = (p2mt == p2m_mmio_direct); uint8_t ipat = 0; int need_modify_vtd_table = 1; + int needs_sync = 1; /* We only support 4k and 2m pages now */ BUG_ON(order && order != EPT_TABLE_ORDER); @@ -223,6 +224,11 @@ ept_set_entry(struct domain *d, unsigned if ( i == walk_level ) { /* We reached the level we're looking for */ + + /* No need to flush if the old entry wasn't valid */ + if ( !(ept_entry->epte & 7) ) + needs_sync = 0; + if ( mfn_valid(mfn_x(mfn)) || direct_mmio || p2m_is_paged(p2mt) || (p2mt == p2m_ram_paging_in_start) ) { @@ -333,7 +339,8 @@ out: out: unmap_domain_page(table); - ept_sync_domain(d); + if ( needs_sync ) + ept_sync_domain(d); /* Now the p2m table is not shared with vt-d page table */ if ( iommu_enabled && need_iommu(d) && need_modify_vtd_table ) _______________________________________________ Xen-changelog mailing list Xen-changelog@xxxxxxxxxxxxxxxxxxx http://lists.xensource.com/xen-changelog
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |