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/
Home Products Support Community News


[Xen-devel] [PATCH 0 of 4] Patches for PCI passthrough with modified E82

To: xen-devel@xxxxxxxxxxxxxxxxxxx, Ian.Jackson@xxxxxxxxxxxxx, stefano.stabellini@xxxxxxxxxxxxx, Ian.Campbell@xxxxxxxxxx
Subject: [Xen-devel] [PATCH 0 of 4] Patches for PCI passthrough with modified E820 (v4.2).
From: Konrad Rzeszutek Wilk <konrad.wilk@xxxxxxxxxx>
Date: Thu, 26 May 2011 10:04:48 -0400
Cc: konrad.wilk@xxxxxxxxxx
Delivery-date: Thu, 26 May 2011 07:15:02 -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
User-agent: Mercurial-patchbomb/1.8.1

This set of v4.2 patches allows a PV domain to see the machine's
E820 and figure out where the PCI I/O gap is and match it with the reality.

Changes since v4.1 posting:
 - Fixed compile problems under 32-bit built.
 - Added 'e820_host' and fixed tab/space issues. Also by mistake posted
   that patchset as v3.1 which was incorrect.
[v3 posting]
 - Applied Ian's review comments. Retested with SLES,RHEL5, NetBSD.
[v2 posting]:
 - Moved 'libxl__e820_alloc' to be called from do_domain_create and if
   machine_e820 == true.
 - Made no_machine_e820 be set to true, if the guest has no PCI devices (and
   is PV)
 - Used Keir's re-worked code for E820 creation.
[v1 posting]:
 - Squashed the "x86: make the pv-only e820 array be dynamic" and
   "x86: adjust the size of the e820 for pv guest to be dynamic" together.
 - Made xc_domain_set_memmap_limit use the 'xc_domain_set_memory_map'
 - Moved 'libxl_e820_alloc' and 'libxl_e820_sanitize' to be an internal
   operation and called from 'libxl_device_pci_parse_bdf'.
 - Expanded 'libxl_device_pci_parse_bdf' API call to have an extra argument

The short end is that with these patches a PV domain can:

 - Use the correct PCI I/O gap. Before these patches, Linux guest would
   boot up and would tell:
   [    0.000000] Allocating PCI resources starting at 40000000 (gap:
   while in actuality the PCI I/O gap should have been:
   [    0.000000] Allocating PCI resources starting at b0000000 (gap:

 - The PV domain with PCI devices was limited to 3GB. It now can be booted
   with 4GB, 8GB, or whatever number you want. The PCI devices will now _not_
   conflict with System RAM. Meaning the drivers can load.

 - With 2.6.39 kernels (which has the 1-1 mapping code), the VM_IO flag will be
   now automatically applied to regions that are considerd PCI I/O regions. You
   can find out which those are by looking for '1-1' in the kernel bootup.

To use this patchset, the guest config file has to have the parameter
'pci=['&lt;BDF&gt;',...]' and 'e820_host=1' enabled.

This has been tested with 2.6.18 (RHEL5), 2.6.27(SLES11), 2.6.36, 2.6.37,
2.6.38, and 2.6.39 kernels. Also tested with PV NetBSD 5.1.

Tested this with the PCI devices (NIC, MSI), and with 2GB, 4GB, and 6GB guests
with success.

 libxc/xc_domain.c      |   77 +++++++++-----
 libxc/xc_e820.h        |    3 
 libxc/xenctrl.h        |   11 ++
 libxl/libxl.idl        |    1 
 libxl/libxl_create.c   |    8 +
 libxl/libxl_internal.h |    1 
 libxl/libxl_pci.c      |  257 +++++++++++++++++++++++++++++++++++++++++++++++--
 libxl/xl_cmdimpl.c     |   13 ++
 8 files changed, 338 insertions(+), 33 deletions(-)

Xen-devel mailing list