From mboxrd@z Thu Jan 1 00:00:00 1970 From: Christoph Egger Subject: [PATCH] libxl: NetBSD PCI passthrough support Date: Thu, 25 Oct 2012 16:12:19 +0200 Message-ID: <508948C3.5020106@amd.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------000302030609060900070201" Return-path: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: "xen-devel@lists.xen.org" List-Id: xen-devel@lists.xenproject.org --------------000302030609060900070201 Content-Type: text/plain; charset="ISO-8859-15" Content-Transfer-Encoding: 7bit Add PCI passthrough support for HVM guests. Signed-off-by: Christoph Egger -- ---to satisfy European Law for business letters: Advanced Micro Devices GmbH Einsteinring 24, 85689 Dornach b. Muenchen Geschaeftsfuehrer: Alberto Bozzo Sitz: Dornach, Gemeinde Aschheim, Landkreis Muenchen Registergericht Muenchen, HRB Nr. 43632 --------------000302030609060900070201 Content-Type: text/plain; charset="us-ascii"; name="libxl_pci_netbsd.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="libxl_pci_netbsd.diff" Content-Description: libxl_pci_netbsd.diff NetBSD PCI passthrough support diff -r 0149ba2b0ce8 -r a4baabcd7d56 tools/libxl/libxl_internal.h --- a/tools/libxl/libxl_internal.h +++ b/tools/libxl/libxl_internal.h @@ -373,8 +373,6 @@ typedef struct { #define PCI_SLOT(devfn) (((devfn) >> 3) & 0x1f) #define PCI_FUNC(devfn) ((devfn) & 0x07) #define AUTO_PHP_SLOT 0x100 -#define SYSFS_PCI_DEV "/sys/bus/pci/devices" -#define SYSFS_PCIBACK_DRIVER "/sys/bus/pci/drivers/pciback" #define XENSTORE_PID_FILE "/var/run/xenstored.pid" #define PROC_PCI_NUM_RESOURCES 7 diff -r 0149ba2b0ce8 -r a4baabcd7d56 tools/libxl/libxl_osdeps.h --- a/tools/libxl/libxl_osdeps.h +++ b/tools/libxl/libxl_osdeps.h @@ -23,14 +23,27 @@ #define _GNU_SOURCE -#if defined(__NetBSD__) || defined(__OpenBSD__) +#if defined(__NetBSD__) +#define SYSFS_PCI_DEV "/sys/bus/pci/devices" +#define SYSFS_PCIBACK_DRIVER "/kern/xen/pci" +#include +#elif defined(__OpenBSD__) #include #elif defined(__linux__) +#define SYSFS_PCI_DEV "/sys/bus/pci/devices" +#define SYSFS_PCIBACK_DRIVER "/sys/bus/pci/drivers/pciback" #include #elif defined(__sun__) #include #endif +#ifndef SYSFS_PCIBACK_DRIVER +#error define SYSFS_PCIBACK_DRIVER for your platform +#endif +#ifndef SYSFS_PCI_DEV +#error define SYSFS_PCI_DEV for your platform +#endif + #ifdef NEED_OWN_ASPRINTF #include --------------000302030609060900070201 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xen.org http://lists.xen.org/xen-devel --------------000302030609060900070201--