From: Roger Pau Monné Date: Thu, 5 Jun 2014 15:41:46 +0000 (+0200) Subject: make logdirty and iommu mutually exclusive X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~4898 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=37201c620379d3afdaafd85009312b17ab9842c3;p=xen.git make logdirty and iommu mutually exclusive Prevent the usage of global logdirty if the domain is using the IOMMU, and also prevent passthrough of devices if logdirty is enabled. Signed-off-by: Roger Pau Monné Acked-by: Jan Beulich Acked-by: Tim Deegan --- diff --git a/xen/arch/x86/mm/paging.c b/xen/arch/x86/mm/paging.c index 9e9a11b561..32764ba86d 100644 --- a/xen/arch/x86/mm/paging.c +++ b/xen/arch/x86/mm/paging.c @@ -168,6 +168,15 @@ int paging_log_dirty_enable(struct domain *d, bool_t log_global) { int ret; + if ( need_iommu(d) && log_global ) + { + /* + * Refuse to turn on global log-dirty mode + * if the domain is using the IOMMU. + */ + return -EINVAL; + } + if ( paging_mode_log_dirty(d) ) return -EINVAL; diff --git a/xen/drivers/passthrough/pci.c b/xen/drivers/passthrough/pci.c index b7f6e8ac1a..43c1a81f91 100644 --- a/xen/drivers/passthrough/pci.c +++ b/xen/drivers/passthrough/pci.c @@ -1233,7 +1233,8 @@ static int assign_device(struct domain *d, u16 seg, u8 bus, u8 devfn) * enabled for this domain */ if ( unlikely(!need_iommu(d) && (d->arch.hvm_domain.mem_sharing_enabled || - d->mem_event->paging.ring_page)) ) + d->mem_event->paging.ring_page || + p2m_get_hostp2m(d)->global_logdirty)) ) return -EXDEV; if ( !spin_trylock(&pcidevs_lock) )