All of lore.kernel.org
 help / color / mirror / Atom feed
From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
To: Konrad Rzeszutek Wilk <konrad@darnok.org>
Cc: Olaf Hering <olaf@aepfle.de>, xen-devel@lists.xen.org
Subject: Re: xl pci-attach silently fails the first time
Date: Wed, 3 Dec 2014 20:46:50 -0500	[thread overview]
Message-ID: <20141204014650.GA26886@konrad-lan.dumpdata.com> (raw)
In-Reply-To: <20141204013102.GA31385@andromeda.dapyr.net>

On Wed, Dec 03, 2014 at 09:31:03PM -0400, Konrad Rzeszutek Wilk wrote:
> On Mon, Dec 01, 2014 at 12:01:51PM -0500, Konrad Rzeszutek Wilk wrote:
> > On Mon, Dec 01, 2014 at 02:32:44PM +0100, Olaf Hering wrote:
> > > On Mon, Dec 01, Olaf Hering wrote:
> > > 
> > > > # xl pci-assignable-add 01:10.0
> > > > # xl pci-assignable-list
> > > > 0000:01:10.0
> > > > # xl create -f domU.cfg
> > > > # xl console domU
> > > > ## lspci gives just emulated PCI devices
> > > 
> > > ttyS0:Rescue:~ # lspci 
> > > 00:00.0 Host bridge: Intel Corporation 440FX - 82441FX PMC [Natoma] (rev 02)
> > > 00:01.0 ISA bridge: Intel Corporation 82371SB PIIX3 ISA [Natoma/Triton II]
> > > 00:01.1 IDE interface: Intel Corporation 82371SB PIIX3 IDE [Natoma/Triton II]
> > > 00:01.3 Bridge: Intel Corporation 82371AB/EB/MB PIIX4 ACPI (rev 03)
> > > 00:02.0 Unassigned class [ff80]: XenSource, Inc. Xen Platform Device (rev 01)
> > > 00:03.0 VGA compatible controller: Cirrus Logic GD 5446
> > > 00:04.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL-8100/8101L/8139 PCI Fast Ethernet Adapter (rev ff)
> > > 
> > > > ## detach from domU console
> > > > # xl pci-attach domU 0000:01:10.0
> > > > # xl pci-list domU
> > > > Vdev Device
> > > > 04.0 0000:01:10.0
> > > > 
> > > > # xl console domU
> > > > ## lspci gives just emulated PCI devices
> > > 
> > > ttyS0:Rescue:~ # lspci 
> > > 00:00.0 Host bridge: Intel Corporation 440FX - 82441FX PMC [Natoma] (rev 02)
> > > 00:01.0 ISA bridge: Intel Corporation 82371SB PIIX3 ISA [Natoma/Triton II]
> > > 00:01.1 IDE interface: Intel Corporation 82371SB PIIX3 IDE [Natoma/Triton II]
> > > 00:01.3 Bridge: Intel Corporation 82371AB/EB/MB PIIX4 ACPI (rev 03)
> > > 00:02.0 Unassigned class [ff80]: XenSource, Inc. Xen Platform Device (rev 01)
> > > 00:03.0 VGA compatible controller: Cirrus Logic GD 5446
> > > 00:04.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL-8100/8101L/8139 PCI Fast Ethernet Adapter (rev 01)
> > > 
> > > > ## detach from domU console
> > > > # xl pci-detach domU 0000:01:10.0
> > > Now lspci shows that the emulated network card is gone.
> > 
> > > ttyS0:Rescue:~ # lspci 
> > > 00:00.0 Host bridge: Intel Corporation 440FX - 82441FX PMC [Natoma] (rev 02)
> > > 00:01.0 ISA bridge: Intel Corporation 82371SB PIIX3 ISA [Natoma/Triton II]
> > > 00:01.1 IDE interface: Intel Corporation 82371SB PIIX3 IDE [Natoma/Triton II]
> > > 00:01.3 Bridge: Intel Corporation 82371AB/EB/MB PIIX4 ACPI (rev 03)
> > > 00:02.0 Unassigned class [ff80]: XenSource, Inc. Xen Platform Device (rev 01)
> > > 00:03.0 VGA compatible controller: Cirrus Logic GD 5446
> > > 
> > > > # xl pci-attach domU 0000:01:10.0
> > > > # xl pci-list domU
> > > > Vdev Device
> > > > 04.0 0000:01:10.0
> > > > # xl console domU
> > > > ## lspci shows now also the assigned host device
> > > 
> > > 
> > > So the actual bug is that the very first time after pci-attach the guests
> > > "00:04.0" PCI device is (most likely) replaced with the host PCI device. Just
> > > the guest does not notice that "00:04.0" was actually already gone after unplug.
> > 
> > That is odd - I see any device 'hot-plugged' being added at 00:05 and further.
> 
> I have to apologize. The reason it works for me is because the emulated
> device gets unplugged quite early:
> 
> # lspci
> 00:00.0 Host bridge: Intel Corporation 440FX - 82441FX PMC [Natoma] (rev 02)
> 00:01.0 ISA bridge: Intel Corporation 82371SB PIIX3 ISA [Natoma/Triton II]
> 00:01.1 IDE interface: Intel Corporation 82371SB PIIX3 IDE [Natoma/Triton II]
> 00:01.3 Bridge: Intel Corporation 82371AB/EB/MB PIIX4 ACPI (rev 03)
> 00:02.0 Class ff80: XenSource, Inc. Xen Platform Device (rev 01)
> 00:03.0 VGA compatible controller: Cirrus Logic GD 5446
> 
> [and here I run 'xl pci-attach USB 00:1a.0]
> 
> # [   30.609802] hpet1: lost 1589 rtc interrupts
> [   30.672030] hpet1: lost 2200 rtc interrupts
> [   30.672030] hpet1: lost 2201 rtc interrupts
> [   30.672030] hpet1: lost 2200 rtc interrupts
> [   30.899341] pci 0000:00:04.0: [8086:1c2d] type 00 class 0x0c0320
> 
> And the other test I have been running is when the guest is booted
> with an PCI device (and then unplugged):
> 
> # lspci
> 00:00.0 Host bridge: Intel Corporation 440FX - 82441FX PMC [Natoma] (rev 02)
> 00:01.0 ISA bridge: Intel Corporation 82371SB PIIX3 ISA [Natoma/Triton II]
> 00:01.1 IDE interface: Intel Corporation 82371SB PIIX3 IDE [Natoma/Triton II]
> 00:01.3 Bridge: Intel Corporation 82371AB/EB/MB PIIX4 ACPI (rev 01)
> 00:02.0 VGA compatible controller: Cirrus Logic GD 5446
> 00:03.0 Class ff80: XenSource, Inc. Xen Platform Device (rev 01)
> 00:05.0 USB Controller: Intel Corporation Cougar Point USB Enhanced Host Controller #2 (rev 04)
> 
> But oddly enough when I do 'pci-detach' and then 'pci-attach' I get:
> lspci
> 00:00.0 Host bridge: Intel Corporation 440FX - 82441FX PMC [Natoma] (rev 02)
> 00:01.0 ISA bridge: Intel Corporation 82371SB PIIX3 ISA [Natoma/Triton II]
> 00:01.1 IDE interface: Intel Corporation 82371SB PIIX3 IDE [Natoma/Triton II]
> 00:01.3 Bridge: Intel Corporation 82371AB/EB/MB PIIX4 ACPI (rev 01)
> 00:02.0 VGA compatible controller: Cirrus Logic GD 5446
> 00:03.0 Class ff80: XenSource, Inc. Xen Platform Device (rev 01)
> 00:04.0 USB Controller: Intel Corporation Cougar Point USB Enhanced Host Controller #2 (rev 04)
> 
> so something is busted as you surmised
> 
> And it looks to be busted in two cases - I see the 'hpet1' issues
> and the guest then crashes!

But that only shows up on this particular machine. If I use VFs and
unplug/plug it works OK.

  reply	other threads:[~2014-12-04  1:46 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-01 12:57 xl pci-attach silently fails the first time Olaf Hering
2014-12-01 13:32 ` Olaf Hering
2014-12-01 13:42   ` Olaf Hering
2014-12-01 13:57     ` Sander Eikelenboom
2014-12-01 14:34       ` Olaf Hering
2014-12-01 14:39         ` Ian Campbell
2014-12-01 14:46           ` Olaf Hering
2014-12-01 14:46         ` Sander Eikelenboom
2014-12-02 15:47           ` Olaf Hering
2014-12-01 17:01   ` Konrad Rzeszutek Wilk
2014-12-02 15:46     ` Olaf Hering
2014-12-02 18:39       ` Konrad Rzeszutek Wilk
2014-12-03  8:36         ` Olaf Hering
2014-12-03 11:24           ` Olaf Hering
2014-12-04  1:31     ` Konrad Rzeszutek Wilk
2014-12-04  1:46       ` Konrad Rzeszutek Wilk [this message]
2014-12-04  9:28       ` Ian Campbell
2014-12-04 12:03         ` Konrad Rzeszutek Wilk

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=20141204014650.GA26886@konrad-lan.dumpdata.com \
    --to=konrad.wilk@oracle.com \
    --cc=konrad@darnok.org \
    --cc=olaf@aepfle.de \
    --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 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.