WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] [PATCH] Improve the current FLR logic

To: "Keir Fraser" <keir.fraser@xxxxxxxxxxxxx>, <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: [Xen-devel] [PATCH] Improve the current FLR logic
From: "Cui, Dexuan" <dexuan.cui@xxxxxxxxx>
Date: Sat, 12 Jul 2008 20:37:34 +0800
Cc:
Delivery-date: Sat, 12 Jul 2008 05:38:25 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Thread-index: AcjjYYcgVQ0HxNKySKyT3AMEK4RjNwAsz0mQ
Thread-topic: [PATCH] Improve the current FLR logic
Hi, all,
The attached patches try to improve the current FLR logic.
The idea is: removing the FLR logic from hypervisor and adding the
improved logic in Control Panel.

The current FLR logic in hypervisor has some issues: 1) Dstate
transition is not guaranteed to properly clear the device state; 2) the
current code for PCIe FLR is actually buggy: PCI_EXP_DEVSTA_TRPND
doesn't mean the completion of FLR; according to the PCIe spec, after
issuing FLR, we should wait at least 100ms.

To make it easier to improve the FLR logic, and to make the hypervisor
thin, I think we might as well move the logic to Control Panel for the
time being. In the long run, the essential logic may be implemented in
the pciback driver of Dom0 instead.

[PATCH1] sysmnt_cleanup.patch: this is only a small cleanup.

[PATCH2] remove_FLR_in_xen.patch: remove the FLR logic in Xen.

[PATCH3] do_FLR_in_control_panel.patch:  the improved FLR logic in
Control Panel: 1) If the device is PCIe endpoint and supports PCIe FLR,
we use that; 2) Else, if the device is PCIe endpoint, and all functions
on the device are assigned to the same guest, we use the immediate
parent bus's Secondary Bus Reset to reset all functions of the device
(here, actually we require all the functions of the device be assigned
to the same guest); 3) Else, if the device is PCI endpoint and is on a
host bus (e.g. integrated devices) and if the device supports PCI
Advanced Capabilities, we use that for FLR; 4) Else, we use the
Secondary Bus Reset (if the PCI device is behind a PCI/PCI-X bridge,
then all devices behind the uppermost such PCI/PCI-X bridge above this
device must be co-assigned)

[PATCH4] list_assignable_devices.patch: a command "xm
pci-list-assignable-devices" which can list all the assignable devices
in the system. It is useful for end users.

I made some tests on my hosts. Looks the patches work well.

I'd like to ask for your comments, and test feedbacks. Thank you very
much!

 Thanks, 
-- Dexuan

Attachment: sysmnt_cleanup.patch
Description: sysmnt_cleanup.patch

Attachment: remove_FLR_in_xen.patch
Description: remove_FLR_in_xen.patch

Attachment: do_FLR_in_control_panel.patch
Description: do_FLR_in_control_panel.patch

Attachment: list_assignable_devices.patch
Description: list_assignable_devices.patch

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel