Skip to contentSkip to conversation

Xen 4.2 and PCI hotplug.

DISCUSSION Konrad Rzeszutek Wilk 5 participants 8 messages Dec 18, 2012 – Dec 21, 2012

lore
Share & tools
lore
#0 lore raw

Hey,

I was wondering if the ACPI PCI hotplug (so inserting a new PCIe card in a server that supports said functionality) is something that Intel has been testing or using?

#1 lore raw

Are you playing with Xen ? so far, Xen doesn't support PCIe device hot-plug feature yet. But if you want to hot-plug a PCIe device to a Xen guest, it should supported well. Xiantao

Quoted 12 lines

-----Original Message-----
From: Konrad Rzeszutek [mailto:[email protected]] On Behalf Of Konrad Rzeszutek Wilk
Sent: Wednesday, December 19, 2012 6:46 AM
To: Zhang, Xiantao; [email protected]
Subject: Xen 4.2 and PCI hotplug.

Hey,

I was wondering if the ACPI PCI hotplug (so inserting a new PCIe card in a server that supports said functionality) is something that Intel has been testing or using?

#2 lore raw
Quoted 3 lines
Quoted 1 line
Quoted 1 line · Xiantao

Are you playing with Xen ? so far, Xen doesn't support PCIe device hot-plug feature yet.

When saying Xen, I assume you mean the pv-ops kernel instead? So far I was under the impression that this worked even with the very old 2.6.18 tree (as much or as little as hotplug there worked in the native case). And given that there are no special requirements on the hypervisor to make this work, it's not even obvious to me what would be missing in the pv-ops kernel to make it work.

All that is of course with me not having any practical experience with hotplug, due to the lack of capable hardware...

Jan

#3 lore raw
Quoted 12 lines

-----Original Message-----
From: Jan Beulich [mailto:[email protected]]
Sent: Wednesday, December 19, 2012 4:48 PM
To: Zhang, Xiantao
Cc: Konrad Rzeszutek Wilk; xen-devel
Subject: Re: [Xen-devel] Xen 4.2 and PCI hotplug.

Quoted 1 line
Quoted 1 line
Quoted 1 line

On 19.12.12 at 09:13, "Zhang, Xiantao" <[email protected]>

Quoted 2 lines · wrote:

Are you playing with Xen ? so far, Xen doesn't support PCIe device hot-plug feature yet.

Quoted 6 lines

When saying Xen, I assume you mean the pv-ops kernel instead? So far I was under the impression that this worked even with the very old 2.6.18 tree (as much or as little as hotplug there worked in the native case). And given that there are no special requirements on the hypervisor to make this work, it's not even obvious to me what would be missing in the pv-ops kernel to make it work.

Oh, my fault! Perhaps we don't need to do anything for pv-ops kernel to support device hot-plug if native system has it supported. Actually, we didn't do such testings before, since it is a native feature, not a Xen-specific one. Xiantao

#4 lore raw
Quoted 11 lines · Xiantao
Quoted 11 lines

-----Original Message-----
From: Jan Beulich [mailto:[email protected]]
Sent: Wednesday, December 19, 2012 4:48 PM
To: Zhang, Xiantao
Cc: Konrad Rzeszutek Wilk; xen-devel
Subject: Re: [Xen-devel] Xen 4.2 and PCI hotplug.

Quoted 1 line
Quoted 1 line
Quoted 1 line

On 19.12.12 at 09:13, "Zhang, Xiantao" <[email protected]>

Quoted 2 lines · wrote:

Are you playing with Xen ? so far, Xen doesn't support PCIe device hot-plug feature yet.

Quoted 8 lines
Quoted 6 lines

When saying Xen, I assume you mean the pv-ops kernel instead? So far I was under the impression that this worked even with the very old 2.6.18 tree (as much or as little as hotplug there worked in the native case). And given that there are no special requirements on the hypervisor to make this work, it's not even obvious to me what would be missing in the pv-ops kernel to make it work.

Oh, my fault! Perhaps we don't need to do anything for pv-ops kernel to support device hot-plug if native system has it supported. Actually, we didn't do such testings before, since it is a native feature, not a Xen-specific one. Xiantao

My current understanding is that on boot, Xen scans the PCI bus, then dom0 rescans it later. If a hotplug event gets serviced by dom0, does there not need to be some hypercall informing Xen that a new device has appeared? I expect PCIPassthrough would not work correctly on a hotplugged device which Xen is unaware of.

(But if I have got the wrong end of the stick, or this mechanism already exist, please ignore me. It just strikes me as a little xen-specific, even if the bulk of it is native)

~Andrew

Quoted 5 lines

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel

#5 lore raw
Quoted 24 lines
Quoted 1 line
Quoted 1 line · Andrew Cooper
Quoted 7 lines · Xiantao
Quoted 7 lines

-----Original Message-----
From: Jan Beulich [mailto:[email protected]]
Sent: Wednesday, December 19, 2012 4:48 PM
To: Zhang, Xiantao
Cc: Konrad Rzeszutek Wilk; xen-devel
Subject: Re: [Xen-devel] Xen 4.2 and PCI hotplug.

Quoted 7 lines
Quoted 7 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line

On 19.12.12 at 09:13, "Zhang, Xiantao" <[email protected]>

Quoted 2 lines · wrote:

Are you playing with Xen ? so far, Xen doesn't support PCIe device hot-plug feature yet.

When saying Xen, I assume you mean the pv-ops kernel instead? So far I was under the impression that this worked even with the very old 2.6.18 tree (as much or as little as hotplug there worked in the native case). And given

that

Quoted 4 lines
Quoted 3 lines

there are no special requirements on the hypervisor to make this work, it's not even obvious to me what would be missing in the pv-ops kernel to make it work.

Oh, my fault! Perhaps we don't need to do anything for pv-ops kernel to

support device hot-plug if native system has it supported. Actually, we didn't do such testings before, since it is a native feature, not a Xen-specific one.

Quoted 7 lines
Quoted 1 line

Xiantao

My current understanding is that on boot, Xen scans the PCI bus, then dom0 rescans it later. If a hotplug event gets serviced by dom0, does there not need to be some hypercall informing Xen that a new device has appeared? I expect PCIPassthrough would not work correctly on a hotplugged device which Xen is unaware of.

Sure - such a hypercall exists and is - from all I can tell - being made not only during the boot time bus scan, but also during hotplug processing. See drivers/xen/pci.c.

Jan

#6 lore raw
Quoted 32 lines · Jan Beulich
Quoted 24 lines
Quoted 1 line
Quoted 1 line · Andrew Cooper
Quoted 7 lines · Xiantao
Quoted 7 lines

-----Original Message-----
From: Jan Beulich [mailto:[email protected]]
Sent: Wednesday, December 19, 2012 4:48 PM
To: Zhang, Xiantao
Cc: Konrad Rzeszutek Wilk; xen-devel
Subject: Re: [Xen-devel] Xen 4.2 and PCI hotplug.

Quoted 7 lines
Quoted 7 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line

On 19.12.12 at 09:13, "Zhang, Xiantao" <[email protected]>

Quoted 2 lines · wrote:

Are you playing with Xen ? so far, Xen doesn't support PCIe device hot-plug feature yet.

When saying Xen, I assume you mean the pv-ops kernel instead? So far I was under the impression that this worked even with the very old 2.6.18 tree (as much or as little as hotplug there worked in the native case). And given

that

Quoted 4 lines
Quoted 3 lines

there are no special requirements on the hypervisor to make this work, it's not even obvious to me what would be missing in the pv-ops kernel to make it work.

Oh, my fault! Perhaps we don't need to do anything for pv-ops kernel to

support device hot-plug if native system has it supported. Actually, we didn't do such testings before, since it is a native feature, not a Xen-specific one.

Quoted 7 lines
Quoted 1 line

Xiantao

My current understanding is that on boot, Xen scans the PCI bus, then dom0 rescans it later. If a hotplug event gets serviced by dom0, does there not need to be some hypercall informing Xen that a new device has appeared? I expect PCIPassthrough would not work correctly on a hotplugged device which Xen is unaware of.

Quoted 3 lines

Sure - such a hypercall exists and is - from all I can tell - being made not only during the boot time bus scan, but also during hotplug processing. See drivers/xen/pci.c.

Right. What I am not sure about - and this is why I am asking Intel - whether that notifier gets called _after_ dom0 has interogated the new PCI device.

And if so, would Xen (which gets trapped on the 0xcf8) would not let dom0 actually interogate the new BDF b/c it hasn't been told about this BDF existence.

This is all speculation - and I might be very well completly wrong about all of this - hence this email-thread.

Testing would of course tell for sure, but I am not sure if I even have such hardware.

Quoted 9 lines

Jan

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel

#7 lore raw
In reply to Jan Beulich
Quoted 5 lines · Jan Beulich
Quoted 3 lines
Quoted 1 line
Quoted 1 line · Xiantao

Are you playing with Xen ? so far, Xen doesn't support PCIe device hot-plug feature yet.

When saying Xen, I assume you mean the pv-ops kernel instead? So

I am looking at the PCI AER which can do native hotplug. And from the Linux side it ought to work right -- but there is some scanning of said new PCI device "before" the notifications are sent (which we latch on and do the hypercall on). At least that is from a cursory read of the code.

I presume that "before" the hypercall is sent Xen would just ignore the 0xcf8 reads. But after the hypercall it would populate appropiately whatever it needs. But it would never get to that point b/c Linux couldn't read the device.

I might be of course completly off-base - hence asking if Intel has done any sort of testing on this?

Quoted 12 lines

far I was under the impression that this worked even with the very old 2.6.18 tree (as much or as little as hotplug there worked in the native case). And given that there are no special requirements on the hypervisor to make this work, it's not even obvious to me what would be missing in the pv-ops kernel to make it work.

All that is of course with me not having any practical experience with hotplug, due to the lack of capable hardware...

Jan