From mboxrd@z Thu Jan 1 00:00:00 1970 From: Julien Grall Subject: Re: [PATCH v2 09/15] xen/passthrough: iommu: Introduce arch specific code Date: Mon, 24 Feb 2014 13:05:34 +0000 Message-ID: <530B439E.7030504@linaro.org> References: <1393193792-20008-1-git-send-email-julien.grall@linaro.org> <1393193792-20008-10-git-send-email-julien.grall@linaro.org> <530B3083020000780011EAB1@nat28.tlf.novell.com> <530B28A5.8010903@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta14.messagelabs.com ([193.109.254.103]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1WHvE4-0000TH-69 for xen-devel@lists.xenproject.org; Mon, 24 Feb 2014 13:05:40 +0000 Received: by mail-ea0-f176.google.com with SMTP id b10so3089698eae.7 for ; Mon, 24 Feb 2014 05:05:38 -0800 (PST) In-Reply-To: <530B28A5.8010903@citrix.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Andrew Cooper Cc: Keir Fraser , ian.campbell@citrix.com, Shane Wang , Joseph Cihula , tim@xen.org, Gang Wei , stefano.stabellini@citrix.com, Jan Beulich , xen-devel@lists.xenproject.org, Suravee Suthikulpanit , Xiantao Zhang List-Id: xen-devel@lists.xenproject.org Hi Andrew, On 02/24/2014 11:10 AM, Andrew Cooper wrote: > On 24/02/14 10:44, Jan Beulich wrote: >>>>> On 23.02.14 at 23:16, Julien Grall wrote: >>> --- a/xen/include/xen/hvm/iommu.h >>> +++ b/xen/include/xen/hvm/iommu.h >>> @@ -23,32 +23,8 @@ >>> #include >>> #include >>> >>> -struct g2m_ioport { >>> - struct list_head list; >>> - unsigned int gport; >>> - unsigned int mport; >>> - unsigned int np; >>> -}; >>> - >>> -struct mapped_rmrr { >>> - struct list_head list; >>> - u64 base; >>> - u64 end; >>> -}; >>> - >>> struct hvm_iommu { >>> - u64 pgd_maddr; /* io page directory machine address */ >>> - spinlock_t mapping_lock; /* io page table lock */ >>> - int agaw; /* adjusted guest address width, 0 is level 2 30-bit */ >>> - 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; >>> - >>> - /* amd iommu support */ >>> - int domain_id; >> At the very least this field doesn't look all that architecture specific, >> even if it might only be used on x86/AMD right now. > > Furthermore, it can be found using container_of() Every AMD function starts with: hd = domain_hvm_iommu(d) And then use hd->arch.domain_id in the code. x86/AMD iommu can directly use d->domain_id, as it's already done in some place. No need to use container_of() :). I will send a patch to remove domain_id in the structure. Cheers, -- Julien Grall