All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Woods, Brian" <Brian.Woods@amd.com>
To: Jan Beulich <JBeulich@suse.com>
Cc: xen-devel <xen-devel@lists.xenproject.org>,
	"Woods, Brian" <Brian.Woods@amd.com>,
	"Suthikulpanit, Suravee" <Suravee.Suthikulpanit@amd.com>,
	Roger Pau Monne <roger.pau@citrix.com>
Subject: Re: [PATCH v5 6/6] amd/iommu: skip bridge devices when updating IOMMU page tables
Date: Tue, 20 Nov 2018 23:26:34 +0000	[thread overview]
Message-ID: <20181120232627.GA31051@amd.com> (raw)
In-Reply-To: <5BF43A1902000078001FE31E@prv1-mh.provo.novell.com>

On Tue, Nov 20, 2018 at 09:45:13AM -0700, Jan Beulich wrote:
> >>> On 20.11.18 at 17:01, <roger.pau@citrix.com> wrote:
> > Bridges are not behind an IOMMU, and are already special cased and
> > skipped in amd_iommu_add_device. Apply the same special casing when
> > updating page tables.
> > 
> > This is required or else update_paging_mode will fail and return an
> > error to the caller (amd_iommu_{un}map_page) which will destroy the
> > domain.
> > 
> > Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
> > ---
> > Cc: Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>
> > Cc: Brian Woods <brian.woods@amd.com>
> > ---
> > Changes since v4:
> >  - Invert condition order so they match the order in
> >    amd_iommu_add_device.
> >  - Expand commit message to spell out why this is required.
> 
> Thanks. Nevertheless ...
> 
> > --- a/xen/drivers/passthrough/amd/iommu_map.c
> > +++ b/xen/drivers/passthrough/amd/iommu_map.c
> > @@ -612,6 +612,10 @@ static int update_paging_mode(struct domain *d, unsigned long dfn)
> >          /* Update device table entries using new root table and paging mode */
> >          for_each_pdev( d, pdev )
> >          {
> > +            if ( pdev->type == DEV_TYPE_PCI_HOST_BRIDGE &&
> > +                 is_hardware_domain(d) )
> > +                continue;
> 
> ... before spreading the issue I'd still like to see clarification of /
> justification for the is_hardware_domain() part of the condition
> you clone. Suravee, Brian?
> 
> Jan
> 

The original commit 0af438757d455f8eb6b5a6ae9a990ae245f230fd

The commit that adds is_hardware_domain (and rearrange things)
7c275549f46c5c46611592f7107c1345e93ed457

The orginal commit used the function like
setup_dom0_pci_devices(d, amd_iommu_setup_dom0_device);
which was because IOMMU needed to skip the host bridge devices on dom0.

So I assume you added the is_hardware_domain because it only needed to
be done on dom0.  I'm not familiar with the IOMMU/PCI history wrt to
what it mapped/passed through so.

-- 
Brian Woods

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

  reply	other threads:[~2018-11-20 23:26 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-20 16:01 [PATCH v5 0/6] x86/pvh: fixes for PVH Dom0 Roger Pau Monne
2018-11-20 16:01 ` [PATCH v5 1/6] vpci: fix updating the command register Roger Pau Monne
2018-11-26 11:20   ` Jan Beulich
2018-11-20 16:01 ` [PATCH v5 2/6] vpci: fix deferral of long operations Roger Pau Monne
2018-11-26 11:26   ` Jan Beulich
2018-11-26 11:41   ` Jan Beulich
2018-11-26 11:57     ` Paul Durrant
2018-11-20 16:01 ` [PATCH v5 3/6] vpci/msix: carve p2m hole for MSIX MMIO regions Roger Pau Monne
2018-11-20 16:01 ` [PATCH v5 4/6] pci: add a segment parameter to pci_hide_device Roger Pau Monne
2018-11-26 11:29   ` Jan Beulich
2018-11-20 16:01 ` [PATCH v5 5/6] amd/iommu: assign iommu devices to Xen Roger Pau Monne
2018-11-20 16:14   ` Jan Beulich
2018-11-20 16:01 ` [PATCH v5 6/6] amd/iommu: skip bridge devices when updating IOMMU page tables Roger Pau Monne
2018-11-20 16:45   ` Jan Beulich
2018-11-20 23:26     ` Woods, Brian [this message]
2018-11-21  9:21       ` Jan Beulich
2018-11-21 10:37         ` Roger Pau Monné
2018-11-21 10:58           ` Jan Beulich
2018-11-21 11:51             ` Roger Pau Monné
2018-11-21 13:23               ` Jan Beulich
2018-11-22 12:47                 ` Roger Pau Monné
2018-11-22 13:20                   ` Jan Beulich
2018-11-23 14:36                     ` Roger Pau Monné
     [not found]                       ` <60B388B7020000D60063616D@prv1-mh.provo.novell.com>
2018-11-26  8:42                         ` Jan Beulich

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=20181120232627.GA31051@amd.com \
    --to=brian.woods@amd.com \
    --cc=JBeulich@suse.com \
    --cc=Suravee.Suthikulpanit@amd.com \
    --cc=roger.pau@citrix.com \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.