* [PATCH] ioemu: add pci passthrough support to NetBSD
@ 2012-10-25 14:14 Christoph Egger
2012-10-25 16:14 ` Ian Jackson
0 siblings, 1 reply; 4+ messages in thread
From: Christoph Egger @ 2012-10-25 14:14 UTC (permalink / raw)
To: xen-devel
[-- Attachment #1: Type: text/plain, Size: 346 bytes --]
Support PCI passthrough for NetBSD.
Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
--
---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
[-- Attachment #2: qemu_xen_traditional_pci_netbsd.diff --]
[-- Type: text/plain, Size: 3045 bytes --]
diff --git a/hw/pass-through.c b/hw/pass-through.c
index 8581253..ca2f75a 100644
--- a/hw/pass-through.c
+++ b/hw/pass-through.c
@@ -84,8 +84,6 @@
*/
#include "pass-through.h"
-#include "pci/header.h"
-#include "pci/pci.h"
#include "pt-msi.h"
#include "qemu-xen.h"
#include "iomulti.h"
diff --git a/hw/pass-through.h b/hw/pass-through.h
index d7d837c..98b6f5e 100644
--- a/hw/pass-through.h
+++ b/hw/pass-through.h
@@ -20,8 +20,13 @@
#include "hw.h"
#include "pci.h"
+#ifdef __NetBSD__
+#include "pciutils/header.h"
+#include "pciutils/pci.h"
+#else
#include "pci/header.h"
#include "pci/pci.h"
+#endif
#include "exec-all.h"
#include "sys-queue.h"
#include "qemu-timer.h"
diff --git a/hw/piix4acpi.c b/hw/piix4acpi.c
index fb1e5c3..d8ca298 100644
--- a/hw/piix4acpi.c
+++ b/hw/piix4acpi.c
@@ -41,7 +41,7 @@
#define PIIX4ACPI_LOG(level, fmt, ...) do { if (level <= PIIX4ACPI_LOGLEVEL) qemu_log(fmt, ## __VA_ARGS__); } while (0)
#ifdef CONFIG_PASSTHROUGH
-#include <pci/header.h>
+#include "pass-through.h"
#endif
/* PM1a_CNT bits, as defined in the ACPI specification. */
diff --git a/hw/pt-graphics.c b/hw/pt-graphics.c
index c6f8869..3bbd856 100644
--- a/hw/pt-graphics.c
+++ b/hw/pt-graphics.c
@@ -3,8 +3,6 @@
*/
#include "pass-through.h"
-#include "pci/header.h"
-#include "pci/pci.h"
#include <unistd.h>
#include <sys/ioctl.h>
diff --git a/hw/pt-msi.c b/hw/pt-msi.c
index 70c4023..0bd9446 100644
--- a/hw/pt-msi.c
+++ b/hw/pt-msi.c
@@ -22,6 +22,11 @@
#include "pt-msi.h"
#include <sys/mman.h>
+#ifdef __NetBSD__
+/* MAP_LOCKED is Linux specific. MAP_WIRED is NetBSD's equivalent. */
+#define MAP_LOCKED MAP_WIRED
+#endif
+
void msi_set_enable(struct pt_dev *dev, int en)
{
uint16_t val = 0;
diff --git a/hw/pt-msi.h b/hw/pt-msi.h
index 94e0d35..4b552dc 100644
--- a/hw/pt-msi.h
+++ b/hw/pt-msi.h
@@ -1,7 +1,6 @@
#ifndef _PT_MSI_H
#define _PT_MSI_H
-#include "pci/pci.h"
#include "pass-through.h"
#define PCI_CAP_ID_MSI 0x05 /* Message Signalled Interrupts */
diff --git a/xen-hooks.mak b/xen-hooks.mak
index b55f45b..430c40d 100644
--- a/xen-hooks.mak
+++ b/xen-hooks.mak
@@ -57,8 +57,16 @@ endif
ifdef CONFIG_STUBDOM
CONFIG_PASSTHROUGH=1
else
- ifeq (,$(wildcard /usr/include/pci))
-$(warning === pciutils-dev package not found - missing /usr/include/pci)
+ PCIUTILS_NetBSD=/usr/pkg/include/pciutils
+ PCIUTILS_Linux=/usr/include/pci
+ ifeq ($(CONFIG_NetBSD), y)
+PCIUTILS_HEADER=$(PCIUTILS_NetBSD)
+ endif
+ ifeq ($(CONFIG_Linux), y)
+PCIUTILS_HEADER=$(PCITUILS_Linux)
+ endif
+ ifeq (,$(wildcard $(PCIUTILS_HEADER)))
+$(warning === pciutils-dev package not found - missing $(PCIUTILS_HEADER))
$(warning === PCI passthrough capability has been disabled)
else
CONFIG_PASSTHROUGH=1
@@ -67,7 +75,11 @@ endif
ifdef CONFIG_PASSTHROUGH
OBJS+= pass-through.o pt-msi.o pt-graphics.o
+ifeq ($(CONFIG_NetBSD), y)
+LIBS += -lpciutils -lpci
+else
LIBS += -lpci
+endif
CFLAGS += -DCONFIG_PASSTHROUGH
$(info === PCI passthrough capability has been enabled ===)
endif
[-- Attachment #3: Type: text/plain, Size: 126 bytes --]
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] ioemu: add pci passthrough support to NetBSD
2012-10-25 14:14 [PATCH] ioemu: add pci passthrough support to NetBSD Christoph Egger
@ 2012-10-25 16:14 ` Ian Jackson
2012-10-25 16:17 ` Christoph Egger
0 siblings, 1 reply; 4+ messages in thread
From: Ian Jackson @ 2012-10-25 16:14 UTC (permalink / raw)
To: Christoph Egger; +Cc: xen-devel
Christoph Egger writes ("[Xen-devel] [PATCH] ioemu: add pci passthrough support to NetBSD"):
>
> Support PCI passthrough for NetBSD.
Hmm. I'm a bit reluctant to add new features to
qemu-xen-traditional. Does this work with the new upstream-based
qemu-xen ?
Thanks,
Ian.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] ioemu: add pci passthrough support to NetBSD
2012-10-25 16:14 ` Ian Jackson
@ 2012-10-25 16:17 ` Christoph Egger
2012-10-30 15:55 ` Ian Jackson
0 siblings, 1 reply; 4+ messages in thread
From: Christoph Egger @ 2012-10-25 16:17 UTC (permalink / raw)
To: Ian Jackson; +Cc: xen-devel
On 10/25/12 18:14, Ian Jackson wrote:
> Christoph Egger writes ("[Xen-devel] [PATCH] ioemu: add pci passthrough support to NetBSD"):
>>
>> Support PCI passthrough for NetBSD.
>
> Hmm. I'm a bit reluctant to add new features to
> qemu-xen-traditional. Does this work with the new upstream-based
> qemu-xen ?
I do not know.
Christoph
--
---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
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] ioemu: add pci passthrough support to NetBSD
2012-10-25 16:17 ` Christoph Egger
@ 2012-10-30 15:55 ` Ian Jackson
0 siblings, 0 replies; 4+ messages in thread
From: Ian Jackson @ 2012-10-30 15:55 UTC (permalink / raw)
To: Christoph Egger; +Cc: xen-devel
Christoph Egger writes ("Re: [Xen-devel] [PATCH] ioemu: add pci passthrough support to NetBSD"):
> On 10/25/12 18:14, Ian Jackson wrote:
> > Hmm. I'm a bit reluctant to add new features to
> > qemu-xen-traditional. Does this work with the new upstream-based
> > qemu-xen ?
>
> I do not know.
Certainly new features should go to the upstream qemu first.
Thanks,
Ian.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2012-10-30 15:55 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-10-25 14:14 [PATCH] ioemu: add pci passthrough support to NetBSD Christoph Egger
2012-10-25 16:14 ` Ian Jackson
2012-10-25 16:17 ` Christoph Egger
2012-10-30 15:55 ` Ian Jackson
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.