RE: [PATCH 5/6] device assignment: support for assigning PCI devices to guests

2008-10-29 Thread Zhang, Xiantao
Muli Ben-Yehuda wrote: On Tue, Oct 28, 2008 at 10:45:57AM -0500, Anthony Liguori wrote: +ifeq ($(USE_KVM), 1) +OBJS+= device-assignment.o +endif I don't think you want to build this on PPC so I think you need a stronger check. Good point. How about checking TARGET_BASE_ARCH = i386?

RE: [PATCH 5/6] device assignment: support for assigning PCI devices to guests

2008-10-29 Thread Han, Weidong
Muli Ben-Yehuda wrote: On Tue, Oct 28, 2008 at 10:45:57AM -0500, Anthony Liguori wrote: +ifeq ($(USE_KVM), 1) +OBJS+= device-assignment.o +endif I don't think you want to build this on PPC so I think you need a stronger check. Good point. How about checking TARGET_BASE_ARCH = i386?

Re: [PATCH 5/6] device assignment: support for assigning PCI devices to guests

2008-10-29 Thread Muli Ben-Yehuda
On Tue, Oct 28, 2008 at 04:55:22PM +, Mark McLoughlin wrote: On Tue, 2008-10-28 at 12:06 +0200, [EMAIL PROTECTED] wrote: ... +static int get_real_device(AssignedDevice *pci_dev, uint8_t r_bus, + uint8_t r_dev, uint8_t r_func) +{ +char dir[128],

Re: [PATCH 5/6] device assignment: support for assigning PCI devices to guests

2008-10-29 Thread Muli Ben-Yehuda
On Wed, Oct 29, 2008 at 12:25:50PM +0200, Muli Ben-Yehuda wrote: You still succeed if KVM_CAP_DEVICE_ASSIGNMENT isn't defined? That means a newer userspace compiled on an older kernel will silently fail if they try to do device assignment. There's probably no reason to build this

Re: [PATCH 5/6] device assignment: support for assigning PCI devices to guests

2008-10-29 Thread Muli Ben-Yehuda
On Wed, Oct 29, 2008 at 03:56:54PM +0800, Zhang, Xiantao wrote: Muli Ben-Yehuda wrote: On Tue, Oct 28, 2008 at 10:45:57AM -0500, Anthony Liguori wrote: +ifeq ($(USE_KVM), 1) +OBJS+= device-assignment.o +endif I don't think you want to build this on PPC so I think you need a

Re: [PATCH 5/6] device assignment: support for assigning PCI devices to guests

2008-10-29 Thread Muli Ben-Yehuda
On Tue, Oct 28, 2008 at 05:53:05PM +0200, Muli Ben-Yehuda wrote: On Tue, Oct 28, 2008 at 10:45:57AM -0500, Anthony Liguori wrote: +ifeq ($(USE_KVM), 1) +OBJS+= device-assignment.o +endif I don't think you want to build this on PPC so I think you need a stronger check. Good point.

Re: [PATCH 5/6] device assignment: support for assigning PCI devices to guests

2008-10-29 Thread Mark McLoughlin
On Wed, 2008-10-29 at 12:31 +0200, Muli Ben-Yehuda wrote: On Tue, Oct 28, 2008 at 04:55:22PM +, Mark McLoughlin wrote: On Tue, 2008-10-28 at 12:06 +0200, [EMAIL PROTECTED] wrote: +void assigned_dev_set_vector(int irq, int vector); +void assigned_dev_ack_mirq(int vector); ...

Re: [PATCH 5/6] device assignment: support for assigning PCI devices to guests

2008-10-29 Thread Mark McLoughlin
On Wed, 2008-10-29 at 12:31 +0200, Muli Ben-Yehuda wrote: On Tue, Oct 28, 2008 at 04:55:22PM +, Mark McLoughlin wrote: nr_assigned_devices isn't actually used anywhere. Nuked. Still there. +#define MAX_IO_REGIONS (6) Perhaps a comment to say this is the number of BARs in the

Re: [PATCH 5/6] device assignment: support for assigning PCI devices to guests

2008-10-29 Thread Muli Ben-Yehuda
On Wed, Oct 29, 2008 at 11:15:10AM +, Mark McLoughlin wrote: On Wed, 2008-10-29 at 12:31 +0200, Muli Ben-Yehuda wrote: On Tue, Oct 28, 2008 at 04:55:22PM +, Mark McLoughlin wrote: nr_assigned_devices isn't actually used anywhere. Nuked. Still there. +#define

Re: [PATCH 5/6] device assignment: support for assigning PCI devices to guests

2008-10-29 Thread Mark McLoughlin
On Wed, 2008-10-29 at 14:20 +0200, [EMAIL PROTECTED] wrote: diff --git a/qemu/hw/piix_pci.c b/qemu/hw/piix_pci.c index b9067b8..27d5f02 100644 --- a/qemu/hw/piix_pci.c +++ b/qemu/hw/piix_pci.c @@ -246,9 +246,9 @@ static void piix3_set_irq(qemu_irq *pic, int irq_num, int level) int

Re: [PATCH 5/6] device assignment: support for assigning PCI devices to guests

2008-10-29 Thread Muli Ben-Yehuda
On Wed, Oct 29, 2008 at 12:27:19PM +, Mark McLoughlin wrote: On Wed, 2008-10-29 at 14:20 +0200, [EMAIL PROTECTED] wrote: diff --git a/qemu/hw/piix_pci.c b/qemu/hw/piix_pci.c index b9067b8..27d5f02 100644 --- a/qemu/hw/piix_pci.c +++ b/qemu/hw/piix_pci.c @@ -246,9 +246,9 @@ static

RE: [PATCH 5/6] device assignment: support for assigning PCI devices to guests

2008-10-28 Thread Han, Weidong
[EMAIL PROTECTED] wrote: From: Muli Ben-Yehuda [EMAIL PROTECTED] This patch has been contributed to by the following people: Or Sagi [EMAIL PROTECTED] Nir Peleg [EMAIL PROTECTED] Amit Shah [EMAIL PROTECTED] Ben-Ami Yassour [EMAIL PROTECTED] Weidong Han [EMAIL PROTECTED] Glauber de

RE: [PATCH 5/6] device assignment: support for assigning PCI devices to guests

2008-10-28 Thread Han, Weidong
Han, Weidong wrote: [EMAIL PROTECTED] wrote: From: Muli Ben-Yehuda [EMAIL PROTECTED] This patch has been contributed to by the following people: Or Sagi [EMAIL PROTECTED] Nir Peleg [EMAIL PROTECTED] Amit Shah [EMAIL PROTECTED] Ben-Ami Yassour [EMAIL PROTECTED] Weidong Han [EMAIL

RE: [PATCH 5/6] device assignment: support for assigning PCI devices to guests

2008-10-28 Thread Han, Weidong
[EMAIL PROTECTED] wrote: From: Muli Ben-Yehuda [EMAIL PROTECTED] This patch has been contributed to by the following people: Or Sagi [EMAIL PROTECTED] Nir Peleg [EMAIL PROTECTED] Amit Shah [EMAIL PROTECTED] Ben-Ami Yassour [EMAIL PROTECTED] Weidong Han [EMAIL PROTECTED] Glauber de

Re: [PATCH 5/6] device assignment: support for assigning PCI devices to guests

2008-10-28 Thread Muli Ben-Yehuda
On Tue, Oct 28, 2008 at 10:10:07PM +0800, Han, Weidong wrote: +DEBUG(r_pio=%08x e_physbase=%08x r_virtbase=%08lx value=%08x\n, + r_pio, (int)r_access-e_physbase, + (unsigned long)r_access-r_virtbase, value); should be (unsigned long)r_access-u.r_virtbase Thanks, actually it

Re: [PATCH 5/6] device assignment: support for assigning PCI devices to guests

2008-10-28 Thread Anthony Liguori
[EMAIL PROTECTED] wrote: Signed-off-by: Amit Shah [EMAIL PROTECTED] Signed-off-by: Muli Ben-Yehuda [EMAIL PROTECTED] --- qemu/Makefile.target|3 + qemu/hw/device-assignment.c | 641 +++ qemu/hw/device-assignment.h | 117

Re: [PATCH 5/6] device assignment: support for assigning PCI devices to guests

2008-10-28 Thread Muli Ben-Yehuda
On Tue, Oct 28, 2008 at 11:36:10PM +0800, Han, Weidong wrote: diff --git a/qemu/qemu-kvm.c b/qemu/qemu-kvm.c index c5f3f29..5e66832 100644 --- a/qemu/qemu-kvm.c +++ b/qemu/qemu-kvm.c @@ -20,6 +20,7 @@ int kvm_pit = 1; #include console.h #include block.h #include compatfd.h

Re: [PATCH 5/6] device assignment: support for assigning PCI devices to guests

2008-10-28 Thread Muli Ben-Yehuda
On Tue, Oct 28, 2008 at 10:45:57AM -0500, Anthony Liguori wrote: +ifeq ($(USE_KVM), 1) +OBJS+= device-assignment.o +endif I don't think you want to build this on PPC so I think you need a stronger check. Good point. How about checking TARGET_BASE_ARCH = i386? +static void

Re: [PATCH 5/6] device assignment: support for assigning PCI devices to guests

2008-10-28 Thread Mark McLoughlin
On Tue, 2008-10-28 at 12:06 +0200, [EMAIL PROTECTED] wrote: ... +static int get_real_device(AssignedDevice *pci_dev, uint8_t r_bus, + uint8_t r_dev, uint8_t r_func) +{ +char dir[128], name[128]; +int fd, r = 0; +FILE *f; +unsigned long long start,