All of lore.kernel.org
 help / color / mirror / Atom feed
From: Yosuke Iwamatsu <y-iwamatsu@ab.jp.nec.com>
To: Keir Fraser <Keir.Fraser@cl.cam.ac.uk>
Cc: xen-devel@lists.xensource.com
Subject: Re: [PATCH 0/3][RFC] PV Passthrough PCI Device Hotplug Support
Date: Fri, 22 Feb 2008 11:03:30 +0900	[thread overview]
Message-ID: <47BE2D72.7040000@ab.jp.nec.com> (raw)
In-Reply-To: <C3E330F4.1CCAC%Keir.Fraser@cl.cam.ac.uk>

Keir Fraser wrote:
> On 21/2/08 13:25, "Yosuke Iwamatsu" <y-iwamatsu@ab.jp.nec.com> wrote:
>> dev-#, vdev-# and state-# are all backend nodes.
>> Xend writes physical names on dev-# to let pciback know which device
>> should be exported (This is the original behaviour).
>> Then pciback publishes the corresponding virtul name on vdev-#.
>> At the time of detachment, pcifront scans backend nodes and finds
>> which device should be removed by seeing vdev-#.
>> pcifront doesn't need to know the physical name indeed.
> 
> This seems a bit different from how initial probe happens (by reading the
> root-%d xenstore nodes). Could we not just watch those in pcifront and
> re-parse them for changes?
> 
> Your state machine was also quite complicated, perhaps primarily so that
> pcifront could handshake when devices are removed. Is this handshake
> necessary? (e.g., in particular, is there any equivalent notion for real PCI
> hot-unplug?). If not, we can get equivalent hotplug functionality between
> HVM and PV without needing a complicated xend->frontend->backend->xend
> handshaking ring:
>  * xend updates dev-% nodes
>  * pciback sees this and updates root-%d nodes
>  * pcifront sees this and re-parses root-%d nodes

When hot add, this method (xend->pciback->pcifront) works.
And I did that way in my patch.

When hot remove, however, I'm afraid it's not safe.
xend->pciback->pcifront means that we first disable io/mmio port access,
destroy backend config space emulation and then notify the guest OS of
the removal. The guest OS would see something like a virtual
surprise-style removal, that is, a device suddenly disappears
while it is in use.

I confess that I have never done a real PCI hot-unplug myself, but
several specs (acpi spec 3.0b 6.3, pcihp spec 1.1) say that a
recommended hot removal sequence is like:
   1. the user notifys the OS of the desire to remove a slot
   2. the OS logicaly removes the device (unload driver, poweroff, etc)
      and report the user it's ready
   3. the user removes the slot
So the reason I added vdev-# and I chose xend->frontend->backend->xend
cicle is the same; let the guest OS cleanly shutdown the device first
and then actually remove it. I think it's quite essential.

Thanks,
   Yosuke

> 
>  -- Keir
> 

  reply	other threads:[~2008-02-22  2:03 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-02-21 11:00 [PATCH 0/3][RFC] PV Passthrough PCI Device Hotplug Support Yosuke Iwamatsu
2008-02-21 11:09 ` Keir Fraser
2008-02-21 12:37   ` Yosuke Iwamatsu
2008-02-21 12:50     ` Keir Fraser
2008-02-21 13:25       ` Yosuke Iwamatsu
2008-02-21 13:45         ` Keir Fraser
2008-02-22  2:03           ` Yosuke Iwamatsu [this message]
2008-02-22  8:01             ` Keir Fraser

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=47BE2D72.7040000@ab.jp.nec.com \
    --to=y-iwamatsu@ab.jp.nec.com \
    --cc=Keir.Fraser@cl.cam.ac.uk \
    --cc=xen-devel@lists.xensource.com \
    /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.