[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-changelog] [xen-unstable] x86 EPT: Only flush EPT TLB if the previous entry was valid
# HG changeset patch # User Keir Fraser <keir.fraser@xxxxxxxxxx> # Date 1274857726 -3600 # Node ID 32cdd423d4ebab2b2d03a4501be08438c5dc7050 # Parent 23291daa9da48c474b630de82bbe2a3fadc363d3 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/arch/x86/mm/hap/p2m-ept.c | 9 ++++++++- 1 files changed, 8 insertions(+), 1 deletion(-) diff -r 23291daa9da4 -r 32cdd423d4eb xen/arch/x86/mm/hap/p2m-ept.c --- a/xen/arch/x86/mm/hap/p2m-ept.c Wed May 26 08:02:33 2010 +0100 +++ b/xen/arch/x86/mm/hap/p2m-ept.c Wed May 26 08:08:46 2010 +0100 @@ -242,6 +242,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; struct p2m_domain *p2m = p2m_get_hostp2m(d); if ( order != 0 ) @@ -276,6 +277,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) ) { @@ -336,7 +342,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 ( rv && 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 |