From mboxrd@z Thu Jan 1 00:00:00 1970 From: Elena Ufimtseva Subject: [PATCH RFC 3/5] pvh: add rwmem_ranges to keep mapped special regions Date: Fri, 13 Feb 2015 13:52:00 -0500 Message-ID: <20150213185158.GA12737@elena.ufimtseva> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: xen-devel@lists.xen.org Cc: kevin.tian@intel.com, tim@xen.org, jbeulich@suse.com, yang.z.zhang@intel.com, boris.ostrovsky@oracle.com, roger.pau@citrix.com List-Id: xen-devel@lists.xenproject.org Patch adds rwmem_ranges in arch_hvm_iommu to keep specail regions specified by dom0_iommu_rwmem boot option. These special regions mapped with p2m_sys_rw type introduced in the previous patch. TODO: - specify mapped flag in rwmem_range struct to indicte that actual mapping was successful; Signed-off-by: Elena Ufimtseva --- xen/drivers/passthrough/x86/iommu.c | 1 + xen/include/asm-x86/hvm/iommu.h | 2 ++ xen/include/xen/iommu.h | 5 +++++ 3 files changed, 8 insertions(+) diff --git a/xen/drivers/passthrough/x86/iommu.c b/xen/drivers/passthrough/x86/iommu.c index 52d8948..2e266a7 100644 --- a/xen/drivers/passthrough/x86/iommu.c +++ b/xen/drivers/passthrough/x86/iommu.c @@ -118,6 +118,7 @@ int arch_iommu_domain_init(struct domain *d) spin_lock_init(&hd->arch.mapping_lock); INIT_LIST_HEAD(&hd->arch.g2m_ioport_list); INIT_LIST_HEAD(&hd->arch.mapped_rmrrs); + INIT_LIST_HEAD(&hd->arch.rwmem_ranges); return 0; } diff --git a/xen/include/asm-x86/hvm/iommu.h b/xen/include/asm-x86/hvm/iommu.h index 46cb126..3261b5c 100644 --- a/xen/include/asm-x86/hvm/iommu.h +++ b/xen/include/asm-x86/hvm/iommu.h @@ -2,6 +2,7 @@ #define __ASM_X86_HVM_IOMMU_H__ #include +#include struct iommu_ops; extern const struct iommu_ops intel_iommu_ops; @@ -54,6 +55,7 @@ struct arch_hvm_iommu struct list_head g2m_ioport_list; /* guest to machine ioport mapping */ u64 iommu_bitmap; /* bitmap of iommu(s) that the domain uses */ struct list_head mapped_rmrrs; + struct list_head rwmem_ranges; /* amd iommu support */ int paging_mode; diff --git a/xen/include/xen/iommu.h b/xen/include/xen/iommu.h index 8eb764a..a5762e0 100644 --- a/xen/include/xen/iommu.h +++ b/xen/include/xen/iommu.h @@ -191,4 +191,9 @@ DECLARE_PER_CPU(bool_t, iommu_dont_flush_iotlb); extern struct spinlock iommu_pt_cleanup_lock; extern struct page_list_head iommu_pt_cleanup_list; +struct rwmem_range { + struct list_head list; + u64 start, end; +}; + #endif /* _IOMMU_H_ */ -- 1.7.10.4