All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Roger Pau Monné" <roger.pau@citrix.com>
To: Jan Beulich <jbeulich@suse.com>
Cc: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>,
	Anthony Perard <anthony.perard@citrix.com>,
	Ian Jackson <iwj@xenproject.org>, Paul Durrant <paul@xen.org>,
	George Dunlap <george.dunlap@citrix.com>, Wei Liu <wl@xen.org>
Subject: Re: PCI pass-through vs PoD
Date: Wed, 17 Nov 2021 09:55:44 +0100	[thread overview]
Message-ID: <YZTDkNRY5pMLFUR6@Air-de-Roger> (raw)
In-Reply-To: <b62a87ca-b68f-76fd-51c6-114e8b8e125b@suse.com>

On Wed, Nov 17, 2021 at 09:39:17AM +0100, Jan Beulich wrote:
> On 13.09.2021 11:02, Jan Beulich wrote:
> > libxl__domain_config_setdefault() checks whether PoD is going to be
> > enabled and fails domain creation if at the same time devices would get
> > assigned. Nevertheless setting up of IOMMU page tables is allowed.

I'm unsure whether allowing enabling the IOMMU with PoD is the right
thing to do, at least for our toolstack.

> > However, when later assigning a device to a domain which has IOMMU page
> > tables, libxl__device_pci_add() does not appear to be concerned of PoD:
> > - xc_test_assign_device() / XEN_DOMCTL_test_assign_device only check the
> >   device for being available to assign,
> > - libxl__device_pci_setdefault() is only concerned about the RDM policy,
> > - other functions called look to not be related to such checking at all.
> 
> I've now verified this to be the case. In fact creating the guest and
> assigning it a device while the guest still sits in the boot loader
> allowed the (oldish) Linux guest I've been using to recognize the device
> (and hence load its driver) even without any hotplug driver. Obviously
> while still in the boot loader ...
> 
> > IMO assignment should fail if pod.count != pod.entry_count,
> 
> ... this holds, and hence assignment should have failed.
> 
> IOW this approach currently is a simple "workaround" to avoid the "PCI
> device assignment for HVM guest failed due to PoD enabled" error upon
> domain creation.
> 
> I'll see if I can find a reasonable place to add the missing check; I'm
> less certain about ...
> 
> > and all PoD
> > entries should be resolved otherwise (whether explicitly by the
> > hypervisor or through some suitable existing hypercalls - didn't check
> > yet whether there are any reasonable candidates - by the tool stack is
> > secondary).
> 
> ... the approach to take here.

I think forcing all entries to be resolved would be unexpected when
assigning a device.

I would rather print a message saying that either the guest must
balloon down to the requested amount of memory, or that all entries
should be resolved (ie: using mem-set to match the mem-max value).

Thanks, Roger.


  reply	other threads:[~2021-11-17  8:56 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-13  9:02 PCI pass-through vs PoD Jan Beulich
2021-11-17  8:39 ` Jan Beulich
2021-11-17  8:55   ` Roger Pau Monné [this message]
2021-11-17 10:13     ` Jan Beulich
2021-11-17 11:09       ` Andrew Cooper
2021-11-17 11:23         ` Jan Beulich
2021-11-17 13:07           ` Andrew Cooper
2021-11-18  8:08             ` 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=YZTDkNRY5pMLFUR6@Air-de-Roger \
    --to=roger.pau@citrix.com \
    --cc=anthony.perard@citrix.com \
    --cc=george.dunlap@citrix.com \
    --cc=iwj@xenproject.org \
    --cc=jbeulich@suse.com \
    --cc=paul@xen.org \
    --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 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.