From: Wei Wang Subject: [PATCH 2 of 6 V6] amd iommu: call guest_iommu_set_base from hvmloader Date: Thu, 8 Mar 2012 14:21:49 +0100 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Ian.Jackson@eu.citrix.com, Ian.Campbell@citrix.com, JBeulich@suse.com, keir@xen.org Cc: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org # HG changeset patch # User Wei Wang # Date 1331210214 -3600 # Node ID e9d74ec1077472f9127c43903811ce3107fc038d # Parent 810296995a893c1bec898a366f08520fbae755fb amd iommu: call guest_iommu_set_base from hvmloader. IOMMU MMIO base address is dynamically allocated by firmware. This patch allows hvmloader to notify hypervisor where the iommu mmio pages are. Signed-off-by: Wei Wang diff -r 810296995a89 -r e9d74ec10774 xen/arch/x86/hvm/hvm.c --- a/xen/arch/x86/hvm/hvm.c Thu Mar 08 13:36:51 2012 +0100 +++ b/xen/arch/x86/hvm/hvm.c Thu Mar 08 13:36:54 2012 +0100 @@ -66,6 +66,7 @@ #include #include #include +#include bool_t __read_mostly hvm_enabled; @@ -3786,6 +3787,9 @@ long do_hvm_op(unsigned long op, XEN_GUE case HVM_PARAM_BUFIOREQ_EVTCHN: rc = -EINVAL; break; + case HVM_PARAM_IOMMU_BASE: + rc = guest_iommu_set_base(d, a.value); + break; } if ( rc == 0 ) diff -r 810296995a89 -r e9d74ec10774 xen/include/public/hvm/params.h --- a/xen/include/public/hvm/params.h Thu Mar 08 13:36:51 2012 +0100 +++ b/xen/include/public/hvm/params.h Thu Mar 08 13:36:54 2012 +0100 @@ -141,7 +141,8 @@ /* Boolean: Enable nestedhvm (hvm only) */ #define HVM_PARAM_NESTEDHVM 24 +#define HVM_PARAM_IOMMU_BASE 27 -#define HVM_NR_PARAMS 27 +#define HVM_NR_PARAMS 28 #endif /* __XEN_PUBLIC_HVM_PARAMS_H__ */