diff options
author | Keir Fraser <keir.fraser@citrix.com> | 2010-01-04 09:06:02 +0000 |
---|---|---|
committer | Keir Fraser <keir.fraser@citrix.com> | 2010-01-04 09:06:02 +0000 |
commit | 1c707e89c23fb9810f1e5e42510b79a5f3973d5b (patch) | |
tree | 99bfae88bc7921e03819069730f0e806c1c917a9 | |
parent | f3c8a24596ad166de0b62e881070d110850c5f37 (diff) | |
download | xen-1c707e89c23fb9810f1e5e42510b79a5f3973d5b.tar.gz xen-1c707e89c23fb9810f1e5e42510b79a5f3973d5b.tar.bz2 xen-1c707e89c23fb9810f1e5e42510b79a5f3973d5b.zip |
VT-d: clean up dynamic page mapping
Before dynamic VT-d page table for hvm guest (changeset 20152),
need_iommu is only used for PV guest. And it maps pages into VT-d for
PV guest in get_page_type and grant table. Now need_iommu is used
both hvm and pv guests, this patch makes those code still only for PV
guest, because it needn't to map pages there for hvm domain.
Signed-off-by: Weidong Han <Weidong.han@intel.com>
-rw-r--r-- | xen/arch/x86/mm.c | 2 | ||||
-rw-r--r-- | xen/common/grant_table.c | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c index a95f1f8fe2..45653ec25f 100644 --- a/xen/arch/x86/mm.c +++ b/xen/arch/x86/mm.c @@ -2391,7 +2391,7 @@ static int __get_page_type(struct page_info *page, unsigned long type, { /* Special pages should not be accessible from devices. */ struct domain *d = page_get_owner(page); - if ( d && unlikely(need_iommu(d)) ) + if ( d && !is_hvm_domain(d) && unlikely(need_iommu(d)) ) { if ( (x & PGT_type_mask) == PGT_writable_page ) iommu_unmap_page(d, mfn_to_gmfn(d, page_to_mfn(page))); diff --git a/xen/common/grant_table.c b/xen/common/grant_table.c index 7d62c2ad47..243ceb95ad 100644 --- a/xen/common/grant_table.c +++ b/xen/common/grant_table.c @@ -596,7 +596,7 @@ __gnttab_map_grant_ref( goto undo_out; } - if ( need_iommu(ld) && + if ( (!is_hvm_domain(ld) && need_iommu(ld)) && !(old_pin & (GNTPIN_hstw_mask|GNTPIN_devw_mask)) && (act_pin & (GNTPIN_hstw_mask|GNTPIN_devw_mask)) ) { @@ -779,7 +779,7 @@ __gnttab_unmap_common( act->pin -= GNTPIN_hstw_inc; } - if ( need_iommu(ld) && + if ( (!is_hvm_domain(ld) && need_iommu(ld)) && (old_pin & (GNTPIN_hstw_mask|GNTPIN_devw_mask)) && !(act->pin & (GNTPIN_hstw_mask|GNTPIN_devw_mask)) ) { |