All of lore.kernel.org
 help / color / mirror / Atom feed
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: Thu, 17 Jan 2019 14:32:24 +0100	[thread overview]
Message-ID: <20190117133224.GP1205@mail-itl> (raw)
In-Reply-To: <20190117092134.5jkayufjoerleybm@mac>


[-- Attachment #1.1: Type: text/plain, Size: 2168 bytes --]

On Thu, Jan 17, 2019 at 10:21:34AM +0100, Roger Pau Monné wrote:
> OK. From an architectural PoV I think it would make more sense to copy
> the list of pci devices to the stubdom config in libxl__spawn_stub_dm,
> but I'm not that familiar with pci handling in libxl, so there might
> be a reason why things are done like this currently.

libxl would refuse to attach the same device to two domains and also
will perform some operations twice (as for example device reset). As you
can see even right now some things needs to be disabled for stubdomain
or target domain, because of this. If device would be included in the
config for both target domain and its stubdomain, the code would need
some more exceptions, which I think would be even worse.

Other thing is the current code attach PCI devices when device-model is
already running (regardless of its version or using stubdomain). I guess
qemu doesn't setup those devices otherwise (there is nothing on qemu
command line about it and none of libxl part generate such options). I'm
not really sure if that couldn't be done differently, but I'm kind of
afraid changing to much in PCI passthrough related code...

> The change LGTM, albeit I found the pci handling code quite hard to
> follow. I'm also not sure whether certain parts of the code are
> correct, for example the PCI INTx seems to be mapped to both the
> stubdomain and the target domain, when it's only the target domain the
> one that actually uses it.

That's true. Generally, I think stubdomain needs only config space
access for its own, other things should be done for the target domain.
This include mapping interrupts of any kind. Stubdomain is given
permission to them only to be able to map them to the target domain.

This also may be the reason why PCI devices are not included in
stubdomain's config, but only do_pci_add() is called. It may be that in
the past some more parts of the device setup was skipped this way.

-- 
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

  reply	other threads:[~2019-01-17 13:32 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
2019-01-17  9:21       ` Roger Pau Monné
2019-01-17 13:32         ` Marek Marczykowski-Górecki [this message]
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=20190117133224.GP1205@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.