xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Paul Durrant <xadimgnik@gmail.com>
To: "'Andrew Cooper'" <andrew.cooper3@citrix.com>,
	<xen-devel@lists.xenproject.org>
Cc: "'Kevin Tian'" <kevin.tian@intel.com>, "'Wei Liu'" <wl@xen.org>,
	"'Paul Durrant'" <pdurrant@amazon.com>,
	"'Lukasz Hawrylko'" <lukasz.hawrylko@linux.intel.com>,
	"'Jan Beulich'" <jbeulich@suse.com>,
	"'Roger Pau Monné'" <roger.pau@citrix.com>
Subject: RE: [PATCH 1/6] x86/iommu: re-arrange arch_iommu to separate common fields...
Date: Fri, 24 Jul 2020 19:49:55 +0100	[thread overview]
Message-ID: <000001d661eb$392e1ae0$ab8a50a0$@xen.org> (raw)
In-Reply-To: <68b40fdc-e578-7005-aa6e-499c6f04589c@citrix.com>

> -----Original Message-----
> From: Andrew Cooper <andrew.cooper3@citrix.com>
> Sent: 24 July 2020 18:29
> To: Paul Durrant <paul@xen.org>; xen-devel@lists.xenproject.org
> Cc: Paul Durrant <pdurrant@amazon.com>; Lukasz Hawrylko <lukasz.hawrylko@linux.intel.com>; Jan Beulich
> <jbeulich@suse.com>; Wei Liu <wl@xen.org>; Roger Pau Monné <roger.pau@citrix.com>; Kevin Tian
> <kevin.tian@intel.com>
> Subject: Re: [PATCH 1/6] x86/iommu: re-arrange arch_iommu to separate common fields...
> 
> On 24/07/2020 17:46, Paul Durrant wrote:
> > diff --git a/xen/include/asm-x86/iommu.h b/xen/include/asm-x86/iommu.h
> > index 6c9d5e5632..a7add5208c 100644
> > --- a/xen/include/asm-x86/iommu.h
> > +++ b/xen/include/asm-x86/iommu.h
> > @@ -45,16 +45,23 @@ typedef uint64_t daddr_t;
> >
> >  struct arch_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 */
> > -    u64 iommu_bitmap;              /* bitmap of iommu(s) that the domain uses */
> > -    struct list_head mapped_rmrrs;
> > -
> > -    /* amd iommu support */
> > -    int paging_mode;
> > -    struct page_info *root_table;
> > -    struct guest_iommu *g_iommu;
> > +    spinlock_t mapping_lock; /* io page table lock */
> > +
> > +    union {
> > +        /* Intel VT-d */
> > +        struct {
> > +            u64 pgd_maddr; /* io page directory machine address */
> > +            int agaw; /* adjusted guest address width, 0 is level 2 30-bit */
> > +            u64 iommu_bitmap; /* bitmap of iommu(s) that the domain uses */
> > +            struct list_head mapped_rmrrs;
> > +        } vtd;
> > +        /* AMD IOMMU */
> > +        struct {
> > +            int paging_mode;
> > +            struct page_info *root_table;
> > +            struct guest_iommu *g_iommu;
> > +        } amd_iommu;
> > +    };
> 
> The naming split here is weird.
> 
> Ideally we'd have struct {vtd,amd}_iommu in appropriate headers, and
> this would be simply
> 
> union {
>     struct vtd_iommu vtd;
>     struct amd_iommu amd;
> };
> 
> If this isn't trivial to arrange, can we at least s/amd_iommu/amd/ here ?

I was in two minds. I tried to look for a TLA for the AMD IOMMU and 'amd' seemed a little too non-descript. I don't really mind though if there's a strong preference to shorted it.
I can certainly try moving the struct definitions into the implementation headers.

  Paul

> 
> ~Andrew



  reply	other threads:[~2020-07-24 18:50 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-24 16:46 [PATCH 0/6] IOMMU cleanup Paul Durrant
2020-07-24 16:46 ` [PATCH 1/6] x86/iommu: re-arrange arch_iommu to separate common fields Paul Durrant
2020-07-24 17:29   ` Andrew Cooper
2020-07-24 18:49     ` Paul Durrant [this message]
2020-07-26  8:13       ` Jan Beulich
2020-07-27  9:30         ` Durrant, Paul
2020-07-24 16:46 ` [PATCH 2/6] x86/iommu: add common page-table allocator Paul Durrant
2020-07-24 18:24   ` Andrew Cooper
2020-07-26  8:26     ` Jan Beulich
2020-07-27  9:37     ` Durrant, Paul
2020-07-27 19:41       ` Jan Beulich
2020-07-24 16:46 ` [PATCH 3/6] iommu: remove iommu_lookup_page() and the lookup_page() method Paul Durrant
2020-07-24 18:38   ` Andrew Cooper
2020-07-24 18:53     ` Paul Durrant
2020-07-26  8:27       ` Jan Beulich
2020-07-27  9:58         ` Durrant, Paul
2020-07-24 16:46 ` [PATCH 4/6] remove remaining uses of iommu_legacy_map/unmap Paul Durrant
2020-07-26  8:36   ` Jan Beulich
2020-07-29  8:12     ` Durrant, Paul
2020-07-24 16:46 ` [PATCH 5/6] iommu: remove the share_p2m operation Paul Durrant
2020-07-24 19:00   ` Andrew Cooper
2020-07-29  8:43     ` Durrant, Paul
2020-07-26  8:50   ` Jan Beulich
2020-07-29  8:45     ` Durrant, Paul
2020-07-24 16:46 ` [PATCH 6/6] iommu: stop calling IOMMU page tables 'p2m tables' Paul Durrant
2020-07-24 19:08   ` Andrew Cooper
2020-07-27 10:13     ` Durrant, Paul

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='000001d661eb$392e1ae0$ab8a50a0$@xen.org' \
    --to=xadimgnik@gmail.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=jbeulich@suse.com \
    --cc=kevin.tian@intel.com \
    --cc=lukasz.hawrylko@linux.intel.com \
    --cc=paul@xen.org \
    --cc=pdurrant@amazon.com \
    --cc=roger.pau@citrix.com \
    --cc=wl@xen.org \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).