From: Samuel Thibault <samuel.thibault@ens-lyon.org>
To: "Marek Marczykowski-Górecki" <marmarek@invisiblethingslab.com>
Cc: HW42 <hw42@ipsumj.de>, xen-devel <xen-devel@lists.xen.org>
Subject: Re: PCI passthrough with stubdomain
Date: Fri, 23 Sep 2016 16:51:33 +0200 [thread overview]
Message-ID: <20160923145133.GM4441@var.bordeaux.inria.fr> (raw)
In-Reply-To: <20160923142541.GB31510@mail-itl>
Marek Marczykowski-Górecki, on Fri 23 Sep 2016 16:25:41 +0200, wrote:
> On Fri, Sep 23, 2016 at 03:27:07PM +0200, Samuel Thibault wrote:
> > Marek Marczykowski-Górecki, on Fri 23 Sep 2016 10:48:14 +0200, wrote:
> > > I'm still trying to get PCI passthrough working with stubdomain and
> > > without qemu in dom0 (even for just vfb/vkbd backends). How is this
> > > supposed to work?
> >
> > Just as I recall from my memory:
> >
> > > 1. Should xen-pcifront in the target domain be used (and consequently,
> > > should xen-pciback be set for it)?
> >
> > I guess that could work.
>
> Could, or should? ;)
I don't really remember, actually. I do remember doing some passthrough
tests, but I don't remember the exact conditions.
> In the meantime, I've found this in xen-pcifront driver:
>
> static int __init pcifront_init(void)
> {
> if (!xen_pv_domain() || xen_initial_domain())
> return -ENODEV;
>
> So, it looks like pcifront is not used in PV domain.
? I read it as disabling pcifront when used in an HVM or native domain,
i.e. precisely used in PV domains.
> > So the unfortunate thing is that when using stubdom, you'd have to set
> > the pciback either on the guest (to run a PV driver in it), or on the
> > stubdom (to run a plain driver in the guest, and let mini-os use PV to
> > let qemu pass the board through)
>
> I've tried only on Linux HVM guest and as noted above xen-pcifront
> doesn't look to be involved. Is it any different on other OSes?
I don't know, perhaps it's different on windows. Or perhaps for windows
we just rely on the qemu pass-through.
> Toolstack during (stub)domain startup setup two things, mostly
> asynchronously:
> 1. pciback/pcifront (through standard xenstore entries)
> 2. instruct qemu to attach device (by writing "pci-ins" to
> device-model/xxx/command)
Ah, since pcifront_watches runs in a separate thread, it may not have
called init_pcifront before qemu calls libpci, i.e. pcifront_scan.
I'd say that's where the fix should be: make pcifront_scan wait for
init_pcifront to be done. It's however not so simple: we want to make
pcifront_scan do nothing if no pciback is to be launched. My memory is
rusty: is there something we are sure will show up in the xenstore when
a pciback is to be launched? If so, pcifront_scan could do this: wait
for pcifront_watches to have checked for the potential presence of
pciback. If pciback is not to be started, just do nothing; if pciback is
to be started, wait for init_pcifront to have been called by
pcifront_watches. Then it will find the devices.
Samuel
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
next prev parent reply other threads:[~2016-09-23 14:51 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-09-23 8:48 PCI passthrough with stubdomain Marek Marczykowski-Górecki
2016-09-23 9:22 ` Jan Beulich
2016-09-23 13:27 ` Samuel Thibault
2016-09-23 14:25 ` Marek Marczykowski-Górecki
2016-09-23 14:51 ` Samuel Thibault [this message]
2016-09-23 18:56 ` Marek Marczykowski-Górecki
2016-09-23 21:00 ` Samuel Thibault
2016-09-23 21:04 ` Marek Marczykowski-Górecki
2016-09-23 15:35 ` Konrad Rzeszutek Wilk
2016-09-23 18:47 ` 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=20160923145133.GM4441@var.bordeaux.inria.fr \
--to=samuel.thibault@ens-lyon.org \
--cc=hw42@ipsumj.de \
--cc=marmarek@invisiblethingslab.com \
--cc=xen-devel@lists.xen.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).