qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Michael S. Tsirkin" <mst@redhat.com>
To: "Gonglei (Arei)" <arei.gonglei@huawei.com>
Cc: "Huangweidong (C)" <weidong.huang@huawei.com>,
	Marcel Apfelbaum <marcel.a@redhat.com>,
	"qemu-devel@nongnu.org" <qemu-devel@nongnu.org>,
	"armbru@redhat.com" <armbru@redhat.com>,
	"imammedo@redhat.com" <imammedo@redhat.com>,
	Paolo Bonzini <pbonzini@redhat.com>
Subject: Re: [Qemu-devel] [Question] Why doesn't PCIe hotplug work for Q35 machine?
Date: Tue, 19 Aug 2014 23:19:05 +0200	[thread overview]
Message-ID: <20140819211905.GA10354@redhat.com> (raw)
In-Reply-To: <33183CC9F5247A488A2544077AF1902086D5A1F4@SZXEMA503-MBS.china.huawei.com>

On Tue, Aug 19, 2014 at 06:25:56AM +0000, Gonglei (Arei) wrote:
> > >> Subject: Re: [Question] Why doesn't PCIe hotplug work for Q35 machine?
> > >>
> > >> On Sun, 2014-08-17 at 13:00 +0200, Michael S. Tsirkin wrote:
> > >>> On Fri, Aug 15, 2014 at 07:33:29AM +0000, Gonglei (Arei) wrote:
> > >>>> Hi,
> > >>>>
> > >>>> I noticed that the qemu-2.1 release change log says
> > >>>> " PCIe: Basic hot-plug/hot-unplug support for Q35 machine."
> > >>>> And then I made a testing for the hotplugging function of Q35.
> > >>>> But I'm failed, and I got the dmesg log in guest os as below:
> > >>>>
> > >>>> [ 159.035250] Pciehp 0000:05:00.0:pcie24: Button pressed on Slot (0 - 4)
> > >>>> [ 159.035274] Pciehp 0000:05:00.0:pcie24: Card present on Slot (0 - 4)
> > >>>> [ 159.036517] Pciehp 0000:05:00.0:pcie24: PCI slot #0 - 4 - powering on
> > due
> > >> to button press.
> > >>>> [ 159.188049] Pciehp 0000:05:00.0:pcie24: Failed to check link status
> > >>>> [ 159.201968] Pciehp 0000:05:00.0:pcie24: Card not present on Slot (0 - 4)
> > >>>> [ 159.202529] Pciehp 0000:05:00.0:pcie24: Already disabled on Slot (0 - 4)
> > >>>>
> > >>>> Steps of testing:
> > >>>>
> > >>>> #1. QEMU version:
> > >>>>
> > >>>> 	The lateset master tree source.
> > >>>>
> > >>>> #2. Command line:
> > >>>>
> > >>>> ./qemu-system-x86_64 -enable-kvm -m 2048 -machine q35 -device
> > >> ide-drive,bus=ide.2,drive=MacHDD \
> > >>>>  -drive
> > id=MacHDD,if=none,file=/mnt/sdb/gonglei/image/redhat_q35.img
> > >> -monitor stdio -vnc :10 -readconfig ../docs/q35-chipset.cfg
> > >>>> QEMU 2.0.93 monitor - type 'help' for more information
> > >>>> (qemu) device_add
> > >> virtio-net-pci,id=nic2,bus=pcie-switch-downstream-port-1-1,addr=1.0
> > >>>
> > >>> I don't think you can use any slot except slot 0 for pci express.
> > >
> > > OK. Does the PCIe specification say that?
> > > I appreciate very much that you explain more.
> > 
> > The closest I could find is in "7.3. Configuration Transaction
> > Rules"/"7.3.1. Device Number":
> > 
> > With non-ARI Devices, PCI Express components are restricted to
> > implementing a single Device Number on their primary interface (Upstream
> > Port) [...] Downstream Ports that do not have ARI Forwarding enabled
> > must associate only Device 0 with the device attached to the Logical Bus
> > representing the Link from the Port. Configuration Requests
> > targeting the Bus Number associated with a Link specifying Device Number
> > 0 are delivered to the device attached to the Link; Configuration
> > Requests specifying all other Device Numbers (1-31)
> > must be terminated by the Switch Downstream Port or the Root Port with
> > an Unsupported Request Completion Status (equivalent to Master Abort in
> > PCI).
> > 
> Thanks a lot, Paolo.
> 
> And I found another issue when cold-plugging don't using slot 0, the PCIe device also can't
> be searched in guest os. 
> 
> So, I have some questions and ideas:
> 
> 1. Does qemu support ARI Forwarding for PCIe at present? If yes, how to enable it ?

What do you mean by forwarding?
What would you like to do?
We do have code to emulate ARI, I don't think many people
tested it so it's likely incomplete.

> 2. If not, we should add some check for PCIe root ports and downstream ports,
>  meanwhile add explaining document.

You want an attempt to add a device at slot !=0 to report an error?
We can do this if device at slot 0 does not have ARI support.
Seems like a low priority issue I think.

> 3. Those check should add in general code level, both hotplug and coldplug.

Generally it's not clear how we want to support hotplug for
multifunction devices. One way it to add functions != 0 then
add function 0 and notify guest.
If so, then of course we can't check things ...

> Am I right?  Thanks.
> 
> Best regards,
> -Gonglei

  parent reply	other threads:[~2014-08-19 21:18 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-15  7:33 [Qemu-devel] [Question] Why doesn't PCIe hotplug work for Q35 machine? Gonglei (Arei)
2014-08-17 11:00 ` Michael S. Tsirkin
2014-08-17 11:28   ` Marcel Apfelbaum
2014-08-18  9:12     ` Gonglei (Arei)
2014-08-18 13:03       ` Paolo Bonzini
2014-08-19  6:25         ` Gonglei (Arei)
2014-08-19  8:06           ` Paolo Bonzini
2014-08-19  8:16             ` Gonglei (Arei)
2014-08-19 21:19           ` Michael S. Tsirkin [this message]
2014-08-20  2:16             ` Gonglei (Arei)
2014-08-20  4:39               ` Knut Omang
2014-08-20  5:17                 ` Knut Omang
2014-08-20  6:04                   ` Gonglei (Arei)
2014-08-20  6:12                     ` Knut Omang

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=20140819211905.GA10354@redhat.com \
    --to=mst@redhat.com \
    --cc=arei.gonglei@huawei.com \
    --cc=armbru@redhat.com \
    --cc=imammedo@redhat.com \
    --cc=marcel.a@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=weidong.huang@huawei.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 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).