From: "Marek Marczykowski-Górecki" <marmarek@invisiblethingslab.com>
To: "Roger Pau Monné" <roger.pau@citrix.com>
Cc: xen-devel@lists.xenproject.org, Wei Liu <wei.liu2@citrix.com>,
Ian Jackson <ian.jackson@eu.citrix.com>
Subject: Re: [PATCH v2 1/4] libxl: do not attach xen-pciback to HVM domain, if stubdomain is in use
Date: Wed, 16 Jan 2019 18:00:33 +0100 [thread overview]
Message-ID: <20190116170033.GO1205@mail-itl> (raw)
In-Reply-To: <20190116164719.aevcvhzotblpnbzw@mac>
[-- Attachment #1.1: Type: text/plain, Size: 2598 bytes --]
On Wed, Jan 16, 2019 at 05:47:19PM +0100, Roger Pau Monné wrote:
> On Tue, Jan 15, 2019 at 04:36:28PM +0100, Marek Marczykowski-Górecki wrote:
> > HVM domains use IOMMU and device model assistance for communicating with
> > PCI devices, xen-pcifront/pciback is used only in PV domains.
>
> You still need pciback in order to reset the device when it's
> deassigned from the guest, so it's functionality is not only used by
> PV guests.
Right, I'll update the commit message to match v2 code.
> > When HVM domain has device model in stubdomain, attaching xen-pciback to
> > the target domain itself is not only useless, but also may prevent
> > attaching xen-pciback to the stubdomain, effectively breaking PCI
> > passthrough.
>
> Right. When doing passthrough with a stubdomain you want the target
> domain to have the memory and IO regions mapped, and the stubdomain to
> handle the rest.
>
> > Signed-off-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
> > ---
> > Changes in v2:
> > - previously called "libxl: attach xen-pciback only to PV domains"
> > - instead of excluding all HVMs, change the condition to what actually
> > matters here - check if stubdomain is in use; this way xen-pciback is
> > always in use (either for the target domain, or it's stubdomain),
> > fixing PCI reset by xen-pciback concerns
> > ---
> > tools/libxl/libxl_pci.c | 4 ++--
> > 1 file changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git a/tools/libxl/libxl_pci.c b/tools/libxl/libxl_pci.c
> > index 87afa03..3b6b23c 100644
> > --- a/tools/libxl/libxl_pci.c
> > +++ b/tools/libxl/libxl_pci.c
> > @@ -1106,7 +1106,7 @@ out:
> > }
> > }
> >
> > - if (!starting)
> > + if (!starting && !libxl_get_stubdom_id(CTX, domid))
>
> This change seems to assume that both libxl_domain_config for the
> target and the stubdomain will have the assigned pci devices in the
> pcidevs field.
Not really. libxl__device_pci_add() calls do_pci_add() for both stubdomain
(if applicable) and target domain.
> Yet I cannot see where the stubdomain
> libxl_domain_config will get the pci devices from the target domain
> assigned, I've looked in libxl__spawn_stub_dm but there doesn't seem
> to be any copy from the target to the stubdom of the list of pci
> devices. I guess I'm missing something.
>
> Thanks, Roger.
--
Best Regards,
Marek Marczykowski-Górecki
Invisible Things Lab
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
[-- Attachment #2: Type: text/plain, Size: 157 bytes --]
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel
next prev parent reply other threads:[~2019-01-16 17:02 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-01-15 15:36 [PATCH v2 0/4] Fix PCI passthrough for HVM with stubdomain Marek Marczykowski-Górecki
2019-01-15 15:36 ` [PATCH v2 1/4] libxl: do not attach xen-pciback to HVM domain, if stubdomain is in use Marek Marczykowski-Górecki
2019-01-16 16:47 ` Roger Pau Monné
2019-01-16 17:00 ` Marek Marczykowski-Górecki [this message]
2019-01-17 9:21 ` Roger Pau Monné
2019-01-17 13:32 ` Marek Marczykowski-Górecki
2019-01-15 15:36 ` [PATCH v2 2/4] libxl: attach PCI device to qemu only after setting pciback/pcifront Marek Marczykowski-Górecki
2019-01-17 10:29 ` Roger Pau Monné
2019-01-26 2:24 ` Marek Marczykowski-Górecki
2019-01-15 15:36 ` [PATCH v2 3/4] libxl: don't try to manipulate json config for stubdomain Marek Marczykowski-Górecki
2019-01-17 10:44 ` Roger Pau Monné
2019-01-15 15:36 ` [PATCH v2 4/4] xen/x86: Allow stubdom access to irq created for msi Marek Marczykowski-Górecki
2019-01-16 9:21 ` Roger Pau Monné
2019-01-16 10:52 ` Marek Marczykowski-Górecki
2019-01-16 12:20 ` Roger Pau Monné
[not found] ` <94C5C3AC020000F30063616D@prv1-mh.provo.novell.com>
2019-01-16 12:57 ` Jan Beulich
2019-01-16 13:07 ` Roger Pau Monné
2019-01-16 13:49 ` Marek Marczykowski-Górecki
2019-01-17 8:57 ` Roger Pau Monné
[not found] ` <FB0C9893020000480063616D@prv1-mh.provo.novell.com>
2019-01-17 11:52 ` Jan Beulich
2019-01-17 11:56 ` Roger Pau Monné
2019-01-17 12:20 ` Jan Beulich
2019-01-17 12:32 ` Roger Pau Monné
[not found] ` <21B633D80200008F0063616D@prv1-mh.provo.novell.com>
2019-01-17 13:12 ` Jan Beulich
2019-01-25 19:43 ` Marek Marczykowski-Górecki
2019-01-25 20:04 ` Marek Marczykowski-Górecki
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=20190116170033.GO1205@mail-itl \
--to=marmarek@invisiblethingslab.com \
--cc=ian.jackson@eu.citrix.com \
--cc=roger.pau@citrix.com \
--cc=wei.liu2@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.