From mboxrd@z Thu Jan 1 00:00:00 1970 From: Wei Wang Subject: [PATCH 09 of 14 V3] amd iommu: Add a hypercall for hvmloader Date: Tue, 10 Jan 2012 18:07:15 +0100 Message-ID: <2f9c68c3b521efccebeb.1326215235@gran.amd.com> 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.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: JBeulich@suse.com, Ian.Jackson@eu.citrix.com, Ian.Campbell@citrix.com, keir@xen.org Cc: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org # HG changeset patch # User Wei Wang # Date 1326213608 -3600 # Node ID 2f9c68c3b521efccebebffe76d17ace7dbae5e25 # Parent 82f5e77e13c43f0e4e34dfefdd218aec092f9542 amd iommu: Add a hypercall for 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 82f5e77e13c4 -r 2f9c68c3b521 xen/arch/x86/hvm/hvm.c --- a/xen/arch/x86/hvm/hvm.c Tue Jan 10 17:40:04 2012 +0100 +++ b/xen/arch/x86/hvm/hvm.c Tue Jan 10 17:40:08 2012 +0100 @@ -65,6 +65,7 @@ #include #include #include +#include bool_t __read_mostly hvm_enabled; @@ -3677,6 +3678,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 82f5e77e13c4 -r 2f9c68c3b521 xen/include/public/hvm/params.h --- a/xen/include/public/hvm/params.h Tue Jan 10 17:40:04 2012 +0100 +++ b/xen/include/public/hvm/params.h Tue Jan 10 17:40:08 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__ */