From mboxrd@z Thu Jan 1 00:00:00 1970 From: Wei Wang2 Subject: Re: [PATCH 07 of 16] amd iommu: Add 2 hypercalls for libxc Date: Wed, 14 Dec 2011 17:57:33 +0100 Message-ID: <201112141757.33690.wei.wang2@amd.com> References: <4EE8E0720200007800067DDD@nat28.tlf.novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <4EE8E0720200007800067DDD@nat28.tlf.novell.com> Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Jan Beulich Cc: xen-devel@lists.xensource.com, keir@xen.org List-Id: xen-devel@lists.xenproject.org On Wednesday 14 December 2011 17:44:18 Jan Beulich wrote: > >>> On 14.12.11 at 16:29, Wei Wang wrote: > > > > # HG changeset patch > > # User Wei Wang > > # Date 1323875772 -3600 > > # Node ID ef5698887d044ad58293bee3549eaa20310c2b17 > > # Parent fbed4e6011fce13d3a521bbc339f4959bf32a06c > > amd iommu: Add 2 hypercalls for libxc > > > > iommu_set_msi: used by qemu to inform hypervisor iommu vector number in > > guest > > space. Hypervisor needs this vector to inject msi into guest when PPR > > logging > > happens. > > And this cannot be done with the existing MSI emulation? It looks like MSI emulation are used for passthru devices. I only add virtual amd iommu device and do not passthru amd iommu device. So no physcal msi are required and therefore complicate msi emulation might not be very necessary? > > iommu_bind_bdf: used by xl to bind guest bdf number to machine bdf > > number. IOMMU emulations codes receives commands from guest iommu driver > > and forwards > > them to host iommu. But virtual device id from guest should be converted > > into > > physical before sending to real hardware. > > The whole logic here needs to take the segment into account. No new > code should again ignore the segment numbers. Sure, I will fix that. > > --- a/xen/include/public/domctl.h Wed Dec 14 16:16:11 2011 +0100 > > +++ b/xen/include/public/domctl.h Wed Dec 14 16:16:12 2011 +0100 > > @@ -848,6 +848,31 @@ struct xen_domctl_set_access_required { > > typedef struct xen_domctl_set_access_required > > xen_domctl_set_access_required_t; > > DEFINE_XEN_GUEST_HANDLE(xen_domctl_set_access_required_t); > > > > +#if defined(__i386__) || defined(__x86_64__) > > What is x86-specific about these? These hypercalls are only used by AMD. so ia64 should be avoided Thanks, Wei > Jan > > > +/* Support for guest iommu emulation */ > > +struct xen_domctl_guest_iommu_op { > > + /* XEN_DOMCTL_GUEST_IOMMU_OP_* */ > > +#define XEN_DOMCTL_GUEST_IOMMU_OP_SET_MSI 0 > > +#define XEN_DOMCTL_GUEST_IOMMU_OP_BIND_BDF 1 > > + uint8_t op; > > + union { > > + struct iommu_msi { > > + uint8_t vector; > > + uint8_t dest; > > + uint8_t dest_mode; > > + uint8_t delivery_mode; > > + uint8_t trig_mode; > > + } msi; > > + struct bdf_bind { > > + uint32_t g_bdf; > > + uint32_t m_bdf; > > + } bdf_bind; > > + } u; > > +}; > > +typedef struct xen_domctl_guest_iommu_op xen_domctl_guest_iommu_op_t; > > +DEFINE_XEN_GUEST_HANDLE(xen_domctl_guest_iommu_op_t); > > +#endif > > + > > struct xen_domctl { > > uint32_t cmd; > > #define XEN_DOMCTL_createdomain 1