[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-changelog] [xen master] gnttab: don't flush the TLB on grant ops for auto-translated guests
commit 79675b78af7a4761f623e6af86ec0d81fce4256d Author: Roger Pau Monné <roger.pau@xxxxxxxxxx> AuthorDate: Thu May 8 14:05:35 2014 +0200 Commit: Jan Beulich <jbeulich@xxxxxxxx> CommitDate: Thu May 8 14:05:35 2014 +0200 gnttab: don't flush the TLB on grant ops for auto-translated guests For auto-translated guests the p2m code will do the necessary TLB flushes, so there's no need to perform any TLB flushes in generic grant table code. Signed-off-by: Roger Pau Monné <roger.pau@xxxxxxxxxx> Reviewed-by: Jan Beulich <jbeulich@xxxxxxxx> Reviewed-by: Tim Deegan <tim@xxxxxxx> --- xen/common/grant_table.c | 16 +++++++++++----- 1 files changed, 11 insertions(+), 5 deletions(-) diff --git a/xen/common/grant_table.c b/xen/common/grant_table.c index 778bdb7..2c93d9c 100644 --- a/xen/common/grant_table.c +++ b/xen/common/grant_table.c @@ -147,6 +147,12 @@ struct active_grant_entry { #define active_entry(t, e) \ ((t)->active[(e)/ACGNT_PER_PAGE][(e)%ACGNT_PER_PAGE]) +static inline void gnttab_flush_tlb(const struct domain *d) +{ + if ( !paging_mode_external(d) ) + flush_tlb_mask(d->domain_dirty_cpumask); +} + static inline unsigned int num_act_frames_from_sha_frames(const unsigned int num) { @@ -1096,7 +1102,7 @@ gnttab_unmap_grant_ref( guest_handle_add_offset(uop, 1); } - flush_tlb_mask(current->domain->domain_dirty_cpumask); + gnttab_flush_tlb(current->domain); for ( i = 0; i < partial_done; i++ ) __gnttab_unmap_common_complete(&(common[i])); @@ -1111,7 +1117,7 @@ gnttab_unmap_grant_ref( return 0; fault: - flush_tlb_mask(current->domain->domain_dirty_cpumask); + gnttab_flush_tlb(current->domain); for ( i = 0; i < partial_done; i++ ) __gnttab_unmap_common_complete(&(common[i])); @@ -1159,7 +1165,7 @@ gnttab_unmap_and_replace( guest_handle_add_offset(uop, 1); } - flush_tlb_mask(current->domain->domain_dirty_cpumask); + gnttab_flush_tlb(current->domain); for ( i = 0; i < partial_done; i++ ) __gnttab_unmap_common_complete(&(common[i])); @@ -1174,7 +1180,7 @@ gnttab_unmap_and_replace( return 0; fault: - flush_tlb_mask(current->domain->domain_dirty_cpumask); + gnttab_flush_tlb(current->domain); for ( i = 0; i < partial_done; i++ ) __gnttab_unmap_common_complete(&(common[i])); @@ -1566,7 +1572,7 @@ gnttab_transfer( } guest_physmap_remove_page(d, gop.mfn, mfn, 0); - flush_tlb_mask(d->domain_dirty_cpumask); + gnttab_flush_tlb(d); /* Find the target domain. */ if ( unlikely((e = rcu_lock_domain_by_id(gop.domid)) == NULL) ) -- generated by git-patchbot for /home/xen/git/xen.git#master _______________________________________________ Xen-changelog mailing list Xen-changelog@xxxxxxxxxxxxx http://lists.xensource.com/xen-changelog
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |