Re: [PATCH 0/4 v12] MSI-X MMIO support for KVM

2011-03-03 Thread Sheng Yang
On Wed, Mar 02, 2011 at 03:51:20PM -0300, Marcelo Tosatti wrote: On Wed, Mar 02, 2011 at 11:23:14AM +0200, Michael S. Tsirkin wrote: On Wed, Mar 02, 2011 at 03:26:53PM +0800, Sheng Yang wrote: Change from v10: 1. Update according to the comments of Michael. 2. Use mmio_needed to exit

Re: [PATCH 3/4] KVM: Emulate MSI-X table in kernel

2011-03-01 Thread Sheng Yang
On Tue, Mar 01, 2011 at 02:20:02PM +0200, Michael S. Tsirkin wrote: On Tue, Mar 01, 2011 at 02:10:37PM +0800, Sheng Yang wrote: On Monday 28 February 2011 19:27:29 Michael S. Tsirkin wrote: On Mon, Feb 28, 2011 at 03:20:04PM +0800, Sheng Yang wrote: Then we can support mask bit operation

Re: [PATCH 3/4] KVM: Emulate MSI-X table in kernel

2011-03-01 Thread Sheng Yang
On Tue, Mar 01, 2011 at 02:20:02PM +0200, Michael S. Tsirkin wrote: On Tue, Mar 01, 2011 at 02:10:37PM +0800, Sheng Yang wrote: On Monday 28 February 2011 19:27:29 Michael S. Tsirkin wrote: On Mon, Feb 28, 2011 at 03:20:04PM +0800, Sheng Yang wrote: @@ -1877,6 +1879,24 @@ static long

Re: [PATCH 3/4] KVM: Emulate MSI-X table in kernel

2011-03-01 Thread Sheng Yang
On Wednesday 02 March 2011 04:18:58 Marcelo Tosatti wrote: On Fri, Feb 25, 2011 at 10:29:38AM +0200, Michael S. Tsirkin wrote: On Fri, Feb 25, 2011 at 02:28:02PM +0800, Sheng Yang wrote: On Thursday 24 February 2011 18:45:08 Michael S. Tsirkin wrote: On Thu, Feb 24, 2011 at 05:51:04PM

[PATCH 1/4] KVM: Move struct kvm_io_device to kvm_host.h

2011-03-01 Thread Sheng Yang
Then it can be used by other struct in kvm_host.h Signed-off-by: Sheng Yang sh...@linux.intel.com --- include/linux/kvm_host.h | 23 +++ virt/kvm/iodev.h | 25 + 2 files changed, 24 insertions(+), 24 deletions(-) diff --git a/include/linux

[PATCH 3/4] KVM: Emulate MSI-X table in kernel

2011-03-01 Thread Sheng Yang
Then we can support mask bit operation of assigned devices now. Signed-off-by: Sheng Yang sh...@linux.intel.com --- arch/x86/kvm/Makefile|2 +- arch/x86/kvm/x86.c | 31 - include/linux/kvm.h | 28 + include/linux/kvm_host.h | 34 ++ virt/kvm/assigned-dev.c

[PATCH 2/4] KVM: Add kvm_io_ext_data to IO handler

2011-03-01 Thread Sheng Yang
Add a new parameter to IO writing handler, so that we can transfer information from IO handler to caller. Signed-off-by: Sheng Yang sh...@linux.intel.com --- arch/x86/kvm/i8254.c |6 -- arch/x86/kvm/i8259.c |3 ++- arch/x86/kvm/lapic.c |3 ++- arch/x86/kvm/x86.c

[PATCH 0/4 v12] MSI-X MMIO support for KVM

2011-03-01 Thread Sheng Yang
Change from v10: 1. Update according to the comments of Michael. 2. Use mmio_needed to exit to userspace according to Marcelo's comments. Sheng Yang (4): KVM: Move struct kvm_io_device to kvm_host.h KVM: Add kvm_io_ext_data to IO handler KVM: Emulate MSI-X table in kernel KVM: Add

[PATCH 4/4] KVM: Add documents for MSI-X MMIO API

2011-03-01 Thread Sheng Yang
Signed-off-by: Sheng Yang sh...@linux.intel.com --- Documentation/kvm/api.txt | 58 + 1 files changed, 58 insertions(+), 0 deletions(-) diff --git a/Documentation/kvm/api.txt b/Documentation/kvm/api.txt index e1a9297..dd10c3b 100644

Re: [PATCH 3/4] KVM: Emulate MSI-X table in kernel

2011-02-28 Thread Sheng Yang
On Monday 28 February 2011 19:27:29 Michael S. Tsirkin wrote: On Mon, Feb 28, 2011 at 03:20:04PM +0800, Sheng Yang wrote: Then we can support mask bit operation of assigned devices now. Signed-off-by: Sheng Yang sh...@linux.intel.com A general question: we implement mmio read and write

Re: [PATCH 2/4] KVM: Add kvm_io_ext_data to IO handler

2011-02-27 Thread Sheng Yang
On Friday 25 February 2011 16:12:30 Michael S. Tsirkin wrote: On Fri, Feb 25, 2011 at 11:23:30AM +0800, Sheng Yang wrote: On Thursday 24 February 2011 18:22:19 Michael S. Tsirkin wrote: On Thu, Feb 24, 2011 at 05:51:03PM +0800, Sheng Yang wrote: Add a new parameter to IO writing handler

Re: [PATCH 3/4] KVM: Emulate MSI-X table in kernel

2011-02-27 Thread Sheng Yang
On Friday 25 February 2011 16:29:38 Michael S. Tsirkin wrote: On Fri, Feb 25, 2011 at 02:28:02PM +0800, Sheng Yang wrote: On Thursday 24 February 2011 18:45:08 Michael S. Tsirkin wrote: On Thu, Feb 24, 2011 at 05:51:04PM +0800, Sheng Yang wrote: Then we can support mask bit operation

[PATCH 2/4] KVM: Add kvm_io_ext_data to IO handler

2011-02-27 Thread Sheng Yang
Add a new parameter to IO writing handler, so that we can transfer information from IO handler to caller. Signed-off-by: Sheng Yang sh...@linux.intel.com --- arch/x86/kvm/i8254.c |6 -- arch/x86/kvm/i8259.c |3 ++- arch/x86/kvm/lapic.c |3 ++- arch/x86/kvm/x86.c

[PATCH 0/4 v11] MSI-X MMIO support for KVM

2011-02-27 Thread Sheng Yang
Change from v9: Update according to the comments of Alex and Michael. Notice this patchset still based on 2.6.37 due to a block bug on assigned device in the upstream now. Sheng Yang (4): KVM: Move struct kvm_io_device to kvm_host.h KVM: Add kvm_io_ext_data to IO handler KVM: Emulate MSI-X

[PATCH 3/4] KVM: Emulate MSI-X table in kernel

2011-02-27 Thread Sheng Yang
Then we can support mask bit operation of assigned devices now. Signed-off-by: Sheng Yang sh...@linux.intel.com --- arch/x86/include/asm/kvm_host.h |1 + arch/x86/kvm/Makefile |2 +- arch/x86/kvm/mmu.c |2 + arch/x86/kvm/x86.c | 40 - include

[PATCH 4/4] KVM: Add documents for MSI-X MMIO API

2011-02-27 Thread Sheng Yang
Signed-off-by: Sheng Yang sh...@linux.intel.com --- Documentation/kvm/api.txt | 58 + 1 files changed, 58 insertions(+), 0 deletions(-) diff --git a/Documentation/kvm/api.txt b/Documentation/kvm/api.txt index e1a9297..dd10c3b 100644

[PATCH 1/4] KVM: Move struct kvm_io_device to kvm_host.h

2011-02-27 Thread Sheng Yang
Then it can be used by other struct in kvm_host.h Signed-off-by: Sheng Yang sh...@linux.intel.com --- include/linux/kvm_host.h | 23 +++ virt/kvm/iodev.h | 25 + 2 files changed, 24 insertions(+), 24 deletions(-) diff --git a/include/linux

Re: [PATCH 2/3] KVM: Emulate MSI-X table in kernel

2011-02-24 Thread Sheng Yang
On Wednesday 23 February 2011 16:45:37 Michael S. Tsirkin wrote: On Wed, Feb 23, 2011 at 02:59:04PM +0800, Sheng Yang wrote: On Wednesday 23 February 2011 08:19:21 Alex Williamson wrote: On Sun, 2011-01-30 at 13:11 +0800, Sheng Yang wrote: Then we can support mask bit operation

Re: [PATCH 2/3] KVM: Emulate MSI-X table in kernel

2011-02-24 Thread Sheng Yang
On Wednesday 23 February 2011 16:45:37 Michael S. Tsirkin wrote: On Wed, Feb 23, 2011 at 02:59:04PM +0800, Sheng Yang wrote: On Wednesday 23 February 2011 08:19:21 Alex Williamson wrote: On Sun, 2011-01-30 at 13:11 +0800, Sheng Yang wrote: Then we can support mask bit operation

[PATCH 0/4 v10] MSI-X MMIO support for KVM

2011-02-24 Thread Sheng Yang
Change from v8: 1. Fix one MSI-X routing update exit bug. 2. Update according to the comments of Alex and Michael. Notice this patchset still based on 2.6.37 due to a block bug on assigned device in the upstream now. Sheng Yang (4): KVM: Move struct kvm_io_device to kvm_host.h KVM: Add

[PATCH 2/4] KVM: Add kvm_io_ext_data to IO handler

2011-02-24 Thread Sheng Yang
Add a new parameter to IO writing handler, so that we can transfer information from IO handler to caller. Signed-off-by: Sheng Yang sh...@linux.intel.com --- arch/x86/kvm/i8254.c |6 -- arch/x86/kvm/i8259.c |3 ++- arch/x86/kvm/lapic.c |3 ++- arch/x86/kvm/x86.c

[PATCH 3/4] KVM: Emulate MSI-X table in kernel

2011-02-24 Thread Sheng Yang
Then we can support mask bit operation of assigned devices now. Signed-off-by: Sheng Yang sh...@linux.intel.com --- arch/x86/include/asm/kvm_host.h |1 + arch/x86/kvm/Makefile |2 +- arch/x86/kvm/mmu.c |2 + arch/x86/kvm/x86.c | 40 - include

[PATCH 4/4] KVM: Add documents for MSI-X MMIO API

2011-02-24 Thread Sheng Yang
Signed-off-by: Sheng Yang sh...@linux.intel.com --- Documentation/kvm/api.txt | 58 + 1 files changed, 58 insertions(+), 0 deletions(-) diff --git a/Documentation/kvm/api.txt b/Documentation/kvm/api.txt index e1a9297..dd10c3b 100644

[PATCH 1/4] KVM: Move struct kvm_io_device to kvm_host.h

2011-02-24 Thread Sheng Yang
Then it can be used by other struct in kvm_host.h Signed-off-by: Sheng Yang sh...@linux.intel.com --- include/linux/kvm_host.h | 23 +++ virt/kvm/iodev.h | 25 + 2 files changed, 24 insertions(+), 24 deletions(-) diff --git a/include/linux

Re: [PATCH 2/4] KVM: Add kvm_io_ext_data to IO handler

2011-02-24 Thread Sheng Yang
On Thursday 24 February 2011 18:22:19 Michael S. Tsirkin wrote: On Thu, Feb 24, 2011 at 05:51:03PM +0800, Sheng Yang wrote: Add a new parameter to IO writing handler, so that we can transfer information from IO handler to caller. Signed-off-by: Sheng Yang sh...@linux.intel.com

Re: [PATCH 2/3] KVM: Emulate MSI-X table in kernel

2011-02-24 Thread Sheng Yang
On Thursday 24 February 2011 18:11:44 Michael S. Tsirkin wrote: On Thu, Feb 24, 2011 at 04:08:22PM +0800, Sheng Yang wrote: On Wednesday 23 February 2011 16:45:37 Michael S. Tsirkin wrote: On Wed, Feb 23, 2011 at 02:59:04PM +0800, Sheng Yang wrote: On Wednesday 23 February 2011 08:19:21

Re: [PATCH 2/3] KVM: Emulate MSI-X table in kernel

2011-02-24 Thread Sheng Yang
On Thursday 24 February 2011 18:17:34 Michael S. Tsirkin wrote: On Thu, Feb 24, 2011 at 05:44:20PM +0800, Sheng Yang wrote: On Wednesday 23 February 2011 16:45:37 Michael S. Tsirkin wrote: On Wed, Feb 23, 2011 at 02:59:04PM +0800, Sheng Yang wrote: On Wednesday 23 February 2011 08:19:21

Re: [PATCH 3/4] KVM: Emulate MSI-X table in kernel

2011-02-24 Thread Sheng Yang
On Thursday 24 February 2011 18:45:08 Michael S. Tsirkin wrote: On Thu, Feb 24, 2011 at 05:51:04PM +0800, Sheng Yang wrote: Then we can support mask bit operation of assigned devices now. Signed-off-by: Sheng Yang sh...@linux.intel.com Doesn't look like all comments got addressed. E.g

[PATCH 3/4] KVM: Emulate MSI-X table in kernel

2011-02-24 Thread Sheng Yang
Then we can support mask bit operation of assigned devices now. Signed-off-by: Sheng Yang sh...@linux.intel.com --- arch/x86/include/asm/kvm_host.h |1 + arch/x86/kvm/Makefile |2 +- arch/x86/kvm/mmu.c |2 + arch/x86/kvm/x86.c | 40 - include

[PATCH 3/4 v10 UPDATED] KVM: Emulate MSI-X table in kernel

2011-02-24 Thread Sheng Yang
Then we can support mask bit operation of assigned devices now. Signed-off-by: Sheng Yang sh...@linux.intel.com --- arch/x86/include/asm/kvm_host.h |1 + arch/x86/kvm/Makefile |2 +- arch/x86/kvm/mmu.c |2 + arch/x86/kvm/x86.c | 40 - include

Re: [PATCH 2/3] KVM: Emulate MSI-X table in kernel

2011-02-22 Thread Sheng Yang
On Wednesday 23 February 2011 08:19:21 Alex Williamson wrote: On Sun, 2011-01-30 at 13:11 +0800, Sheng Yang wrote: Then we can support mask bit operation of assigned devices now. Looks pretty good overall. A few comments below. It seems like we should be able to hook this into vfio

Re: [PATCH 2/3] KVM: Emulate MSI-X table in kernel

2011-02-18 Thread Sheng Yang
On Thursday 03 February 2011 09:05:55 Marcelo Tosatti wrote: On Sun, Jan 30, 2011 at 01:11:15PM +0800, Sheng Yang wrote: Then we can support mask bit operation of assigned devices now. Signed-off-by: Sheng Yang sh...@linux.intel.com +int kvm_vm_ioctl_register_msix_mmio(struct kvm *kvm

[PATCH 0/4 v9] MSI-X MMIO support for KVM

2011-02-18 Thread Sheng Yang
. Sheng Yang (4): KVM: Move struct kvm_io_device to kvm_host.h KVM: Add kvm_io_ext_data to IO handler KVM: Emulate MSI-X table in kernel KVM: Add documents for MSI-X MMIO API Documentation/kvm/api.txt | 58 + arch/x86/kvm/Makefile |2 +- arch/x86/kvm/i8254.c |6

[PATCH 1/4] KVM: Move struct kvm_io_device to kvm_host.h

2011-02-18 Thread Sheng Yang
Then it can be used by other struct in kvm_host.h Signed-off-by: Sheng Yang sh...@linux.intel.com --- include/linux/kvm_host.h | 23 +++ virt/kvm/iodev.h | 25 + 2 files changed, 24 insertions(+), 24 deletions(-) diff --git a/include/linux

[PATCH 2/4] KVM: Add kvm_io_ext_data to IO handler

2011-02-18 Thread Sheng Yang
Add a new parameter to IO writing handler, so that we can transfer information from IO handler to caller. Signed-off-by: Sheng Yang sh...@linux.intel.com --- arch/x86/kvm/i8254.c |6 -- arch/x86/kvm/i8259.c |3 ++- arch/x86/kvm/lapic.c |3 ++- arch/x86/kvm/x86.c

[PATCH 4/4] KVM: Add documents for MSI-X MMIO API

2011-02-18 Thread Sheng Yang
Signed-off-by: Sheng Yang sh...@linux.intel.com --- Documentation/kvm/api.txt | 58 + 1 files changed, 58 insertions(+), 0 deletions(-) diff --git a/Documentation/kvm/api.txt b/Documentation/kvm/api.txt index e1a9297..dd10c3b 100644

[PATCH 0/4 v9] qemu-kvm: MSI-X MMIO support for assigned device

2011-02-18 Thread Sheng Yang
Update with kernel patches v9. Sheng Yang (4): qemu-kvm: device assignment: Enabling MSI-X according to the entries' mask bit qemu-kvm: Ioctl for MSIX MMIO support qemu-kvm: Header file update for MSI-X MMIO support qemu-kvm: MSI-X MMIO support for assigned device hw/device

[PATCH 4/4] qemu-kvm: MSI-X MMIO support for assigned device

2011-02-18 Thread Sheng Yang
Signed-off-by: Sheng Yang sh...@linux.intel.com --- hw/device-assignment.c | 106 +-- hw/device-assignment.h |3 + qemu-kvm.c | 46 + qemu-kvm.h | 19 + 4 files changed, 160 insertions(+), 14

[PATCH 2/4] qemu-kvm: Ioctl for MSIX MMIO support

2011-02-18 Thread Sheng Yang
Signed-off-by: Sheng Yang sh...@linux.intel.com --- qemu-kvm.c | 14 ++ qemu-kvm.h |7 +++ 2 files changed, 21 insertions(+), 0 deletions(-) diff --git a/qemu-kvm.c b/qemu-kvm.c index 49cd683..d282c95 100644 --- a/qemu-kvm.c +++ b/qemu-kvm.c @@ -1050,6 +1050,20 @@ int

[PATCH 3/4] qemu-kvm: Header file update for MSI-X MMIO support

2011-02-18 Thread Sheng Yang
Signed-off-by: Sheng Yang sh...@linux.intel.com --- kvm/include/linux/kvm.h | 28 1 files changed, 28 insertions(+), 0 deletions(-) diff --git a/kvm/include/linux/kvm.h b/kvm/include/linux/kvm.h index e46729e..dcb8f54 100644 --- a/kvm/include/linux/kvm.h +++ b/kvm

[PATCH 1/4] qemu-kvm: device assignment: Enabling MSI-X according to the entries' mask bit

2011-02-18 Thread Sheng Yang
The old MSI-X enabling method assume the entries are written before MSI-X enabled, but some OS didn't obey this, e.g. FreeBSD. This patch would fix this. Also, according to the PCI spec, mask bit of MSI-X table should be set after reset. Signed-off-by: Sheng Yang sh...@linux.intel.com --- hw

Re: [PATCH 2/3] KVM: Emulate MSI-X table in kernel

2011-01-31 Thread Sheng Yang
On Mon, Jan 31, 2011 at 03:09:09PM +0200, Avi Kivity wrote: On 01/30/2011 06:38 AM, Sheng Yang wrote: (Sorry, missed this mail...) On Mon, Jan 17, 2011 at 02:29:44PM +0200, Avi Kivity wrote: On 01/06/2011 12:19 PM, Sheng Yang wrote: Then we can support mask bit operation of assigned

Re: [PATCH 3/3] KVM: Add documents for MSI-X MMIO API

2011-01-31 Thread Sheng Yang
On Mon, Jan 31, 2011 at 03:24:27PM +0200, Avi Kivity wrote: On 01/26/2011 11:05 AM, Sheng Yang wrote: On Tuesday 25 January 2011 20:47:38 Avi Kivity wrote: On 01/19/2011 10:21 AM, Sheng Yang wrote: We already got an guest MMIO address for that in the exit information

Re: [PATCH 2/3] KVM: Emulate MSI-X table in kernel

2011-01-29 Thread Sheng Yang
(Sorry, missed this mail...) On Mon, Jan 17, 2011 at 02:29:44PM +0200, Avi Kivity wrote: On 01/06/2011 12:19 PM, Sheng Yang wrote: Then we can support mask bit operation of assigned devices now. +int kvm_assigned_device_update_msix_mask_bit(struct kvm *kvm

[PATCH 3/3] KVM: Add documents for MSI-X MMIO API

2011-01-29 Thread Sheng Yang
Signed-off-by: Sheng Yang sh...@linux.intel.com --- Documentation/kvm/api.txt | 47 + 1 files changed, 47 insertions(+), 0 deletions(-) diff --git a/Documentation/kvm/api.txt b/Documentation/kvm/api.txt index e1a9297..e6b7a1d 100644

[PATCH 1/3] KVM: Move struct kvm_io_device to kvm_host.h

2011-01-29 Thread Sheng Yang
Then it can be used by other struct in kvm_host.h Signed-off-by: Sheng Yang sh...@linux.intel.com --- include/linux/kvm_host.h | 23 +++ virt/kvm/iodev.h | 25 + 2 files changed, 24 insertions(+), 24 deletions(-) diff --git a/include/linux

[PATCH 2/3] KVM: Emulate MSI-X table in kernel

2011-01-29 Thread Sheng Yang
Then we can support mask bit operation of assigned devices now. Signed-off-by: Sheng Yang sh...@linux.intel.com --- arch/x86/kvm/Makefile|2 +- arch/x86/kvm/x86.c |8 +- include/linux/kvm.h | 21 include/linux/kvm_host.h | 25 virt/kvm/assigned-dev.c | 44

[PATCH 0/3 v8] MSI-X MMIO support for KVM

2011-01-29 Thread Sheng Yang
Change from v7: Update according to Marcelo and Avi's comments. BTW: I would be on vacation for Chinese New Year soon, and would be back mid Feb. Sheng Yang (3): KVM: Move struct kvm_io_device to kvm_host.h KVM: Emulate MSI-X table in kernel KVM: Add documents for MSI-X MMIO API

[PATCH 0/4 v8] qemu-kvm: MSI-X MMIO support for assigned device

2011-01-29 Thread Sheng Yang
Update with kernel patches v8. Sheng Yang (4): qemu-kvm: device assignment: Enabling MSI-X according to the entries' mask bit qemu-kvm: Ioctl for MSIX MMIO support qemu-kvm: Header file update for MSI-X MMIO support qemu-kvm: MSI-X MMIO support for assigned device hw/device

[PATCH 4/4] qemu-kvm: MSI-X MMIO support for assigned device

2011-01-29 Thread Sheng Yang
Signed-off-by: Sheng Yang sh...@linux.intel.com --- hw/device-assignment.c | 93 +-- hw/device-assignment.h |3 ++ qemu-kvm.c | 40 qemu-kvm.h | 11 ++ 4 files changed, 135 insertions(+), 12

[PATCH 2/4] qemu-kvm: Ioctl for MSIX MMIO support

2011-01-29 Thread Sheng Yang
Signed-off-by: Sheng Yang sh...@linux.intel.com --- qemu-kvm.c | 14 ++ qemu-kvm.h |7 +++ 2 files changed, 21 insertions(+), 0 deletions(-) diff --git a/qemu-kvm.c b/qemu-kvm.c index 471306b..956b62a 100644 --- a/qemu-kvm.c +++ b/qemu-kvm.c @@ -1050,6 +1050,20 @@ int

[PATCH 3/4] qemu-kvm: Header file update for MSI-X MMIO support

2011-01-29 Thread Sheng Yang
Signed-off-by: Sheng Yang sh...@linux.intel.com --- kvm/include/linux/kvm.h | 21 + 1 files changed, 21 insertions(+), 0 deletions(-) diff --git a/kvm/include/linux/kvm.h b/kvm/include/linux/kvm.h index e46729e..7b6d5b9 100644 --- a/kvm/include/linux/kvm.h +++ b/kvm

[PATCH 1/4] qemu-kvm: device assignment: Enabling MSI-X according to the entries' mask bit

2011-01-29 Thread Sheng Yang
The old MSI-X enabling method assume the entries are written before MSI-X enabled, but some OS didn't obey this, e.g. FreeBSD. This patch would fix this. Also, according to the PCI spec, mask bit of MSI-X table should be set after reset. Signed-off-by: Sheng Yang sh...@linux.intel.com --- hw

Re: [PATCH 3/3] KVM: Add documents for MSI-X MMIO API

2011-01-26 Thread Sheng Yang
On Tuesday 25 January 2011 20:47:38 Avi Kivity wrote: On 01/19/2011 10:21 AM, Sheng Yang wrote: We already got an guest MMIO address for that in the exit information. I've created a chain of handler in qemu to handle it. But we already decoded the table and entry

Re: [PATCH 3/3] KVM: Add documents for MSI-X MMIO API

2011-01-19 Thread Sheng Yang
On Monday 17 January 2011 20:45:55 Avi Kivity wrote: On 01/17/2011 02:35 PM, Sheng Yang wrote: On Monday 17 January 2011 20:21:45 Avi Kivity wrote: On 01/06/2011 12:19 PM, Sheng Yang wrote: Signed-off-by: Sheng Yangsh...@linux.intel.com --- Documentation/kvm

Re: [PATCH 2/3] KVM: Emulate MSI-X table in kernel

2011-01-19 Thread Sheng Yang
On Monday 17 January 2011 20:39:30 Marcelo Tosatti wrote: On Mon, Jan 17, 2011 at 08:18:22PM +0800, Sheng Yang wrote: + goto out; + + mmio = mmio_dev-mmio[idx]; + entry = (addr - mmio-table_base_addr) / PCI_MSIX_ENTRY_SIZE; + entry_base = mmio

Re: [PATCH 2/3] KVM: Emulate MSI-X table in kernel

2011-01-17 Thread Sheng Yang
On Monday 17 January 2011 19:54:47 Marcelo Tosatti wrote: On Thu, Jan 06, 2011 at 06:19:44PM +0800, Sheng Yang wrote: Then we can support mask bit operation of assigned devices now. Signed-off-by: Sheng Yang sh...@linux.intel.com --- arch/x86/kvm/Makefile|2 +- arch/x86

Re: [PATCH 3/3] KVM: Add documents for MSI-X MMIO API

2011-01-17 Thread Sheng Yang
On Monday 17 January 2011 20:21:45 Avi Kivity wrote: On 01/06/2011 12:19 PM, Sheng Yang wrote: Signed-off-by: Sheng Yangsh...@linux.intel.com --- Documentation/kvm/api.txt | 41 + 1 files changed, 41 insertions(+), 0 deletions

Re: [PATCH 0/3 v7] MSI-X MMIO support for KVM

2011-01-11 Thread Sheng Yang
On Thursday 06 January 2011 18:19:42 Sheng Yang wrote: Change from v6: 1. Discard PBA support. But we can still add it later. 2. Fix one memory reference bug 3. Add automatically MMIO unregister after device was deassigned. 4. Update according to Avi's comments. 5. Add documents for new API

[PATCH 1/3] KVM: Move struct kvm_io_device to kvm_host.h

2011-01-06 Thread Sheng Yang
Then it can be used by other struct in kvm_host.h Signed-off-by: Sheng Yang sh...@linux.intel.com --- include/linux/kvm_host.h | 23 +++ virt/kvm/iodev.h | 25 + 2 files changed, 24 insertions(+), 24 deletions(-) diff --git a/include/linux

[PATCH 0/3 v7] MSI-X MMIO support for KVM

2011-01-06 Thread Sheng Yang
: MSI: Move MSI-X entry definition to pci_regs.h PCI: Add mask bit definition for MSI-X table These two patches are in the Jesse's pci-2.6 tree. Do I need to repost them? Sheng Yang (3): KVM: Move struct kvm_io_device to kvm_host.h KVM: Emulate MSI-X table in kernel KVM: Add documents

[PATCH 2/3] KVM: Emulate MSI-X table in kernel

2011-01-06 Thread Sheng Yang
Then we can support mask bit operation of assigned devices now. Signed-off-by: Sheng Yang sh...@linux.intel.com --- arch/x86/kvm/Makefile|2 +- arch/x86/kvm/x86.c |8 +- include/linux/kvm.h | 21 include/linux/kvm_host.h | 25 virt/kvm/assigned-dev.c | 44

[PATCH 3/3] KVM: Add documents for MSI-X MMIO API

2011-01-06 Thread Sheng Yang
Signed-off-by: Sheng Yang sh...@linux.intel.com --- Documentation/kvm/api.txt | 41 + 1 files changed, 41 insertions(+), 0 deletions(-) diff --git a/Documentation/kvm/api.txt b/Documentation/kvm/api.txt index e1a9297..4978b94 100644 --- a/Documentation

[PATCH 0/4 v7] qemu-kvm: MSI-X MMIO support for assigned device

2011-01-06 Thread Sheng Yang
Update with kernel patches v7. Sheng Yang (4): qemu-kvm: device assignment: Enabling MSI-X according to the entries' mask bit qemu-kvm: Ioctl for MSIX MMIO support qemu-kvm: Header file update for MSI-X MMIO support qemu-kvm: MSI-X MMIO support for assigned device hw/device

[PATCH 3/4] qemu-kvm: Header file update for MSI-X MMIO support

2011-01-06 Thread Sheng Yang
Signed-off-by: Sheng Yang sh...@linux.intel.com --- kvm/include/linux/kvm.h | 21 + 1 files changed, 21 insertions(+), 0 deletions(-) diff --git a/kvm/include/linux/kvm.h b/kvm/include/linux/kvm.h index e46729e..7b6d5b9 100644 --- a/kvm/include/linux/kvm.h +++ b/kvm

[PATCH 4/4] qemu-kvm: MSI-X MMIO support for assigned device

2011-01-06 Thread Sheng Yang
Signed-off-by: Sheng Yang sh...@linux.intel.com --- hw/device-assignment.c | 93 +-- hw/device-assignment.h |3 ++ qemu-kvm.c | 40 qemu-kvm.h | 11 ++ 4 files changed, 135 insertions(+), 12

[PATCH 1/4] qemu-kvm: device assignment: Enabling MSI-X according to the entries' mask bit

2011-01-06 Thread Sheng Yang
The old MSI-X enabling method assume the entries are written before MSI-X enabled, but some OS didn't obey this, e.g. FreeBSD. This patch would fix this. Also, according to the PCI spec, mask bit of MSI-X table should be set after reset. Signed-off-by: Sheng Yang sh...@linux.intel.com --- hw

[PATCH] KVM: VMX: Fix 32bit Windows blue screen with EPT

2010-12-30 Thread Sheng Yang
paging to nonpaging, and nonpaging to paging switch. Signed-off-by: Sheng Yang sh...@linux.intel.com --- But I haven't found the exactly point affected by this, any clue? arch/x86/kvm/vmx.c |6 +- 1 files changed, 1 insertions(+), 5 deletions(-) diff --git a/arch/x86/kvm/vmx.c b/arch

Re: [PATCH] KVM: VMX: Fix 32bit Windows blue screen with EPT

2010-12-30 Thread Sheng Yang
On Thursday 30 December 2010 16:57:20 Avi Kivity wrote: On 12/30/2010 10:35 AM, Sheng Yang wrote: After CR0 is changed during VMExit, the result of kvm_read_cr3() may be different. Commit d95bfcdd7cda4dfdac9588e684bc7c75794a075e KVM: Fetch guest cr3 from hardware on demand caused 32bit

Re: [PATCH] KVM: VMX: Fix 32bit Windows blue screen with EPT

2010-12-30 Thread Sheng Yang
On Thursday 30 December 2010 16:57:20 Avi Kivity wrote: On 12/30/2010 10:35 AM, Sheng Yang wrote: After CR0 is changed during VMExit, the result of kvm_read_cr3() may be different. Commit d95bfcdd7cda4dfdac9588e684bc7c75794a075e KVM: Fetch guest cr3 from hardware on demand caused 32bit

Re: [PATCH 2/2][RFC] KVM: Emulate MSI-X table and PBA in kernel

2010-12-30 Thread Sheng Yang
On Thursday 30 December 2010 16:52:58 Michael S. Tsirkin wrote: On Thu, Dec 30, 2010 at 04:24:10PM +0800, Sheng Yang wrote: On Thursday 30 December 2010 16:15:32 Michael S. Tsirkin wrote: On Thu, Dec 30, 2010 at 03:55:10PM +0800, Sheng Yang wrote: On Thursday 30 December 2010 15:47:48

Re: [PATCH] KVM: VMX: Fix 32bit Windows blue screen with EPT

2010-12-30 Thread Sheng Yang
On Thursday 30 December 2010 17:14:23 Avi Kivity wrote: On 12/30/2010 11:05 AM, Sheng Yang wrote: if (!(cr0 X86_CR0_PG)) { /* From paging/starting to nonpaging */ vmcs_write32(CPU_BASED_VM_EXEC_CONTROL, @@ -1937,11

[PATCH v2] KVM: VMX: Fix 32bit Windows blue screen with EPT

2010-12-30 Thread Sheng Yang
paging to nonpaging, and nonpaging to paging switch. Signed-off-by: Sheng Yang sh...@linux.intel.com --- arch/x86/kvm/vmx.c |6 +- 1 files changed, 1 insertions(+), 5 deletions(-) diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c index f107315..bf89ec2 100644 --- a/arch/x86/kvm/vmx.c

Re: [PATCH 2/2][RFC] KVM: Emulate MSI-X table and PBA in kernel

2010-12-30 Thread Sheng Yang
On Thursday 30 December 2010 18:32:56 Michael S. Tsirkin wrote: On Thu, Dec 30, 2010 at 11:30:12AM +0200, Avi Kivity wrote: On 12/30/2010 09:47 AM, Michael S. Tsirkin wrote: I am not really suggesting this. What I say is PBA is unimplemented let us not commit to an interface yet. What

Re: [PATCH 2/2][RFC] KVM: Emulate MSI-X table and PBA in kernel

2010-12-29 Thread Sheng Yang
On Wednesday 29 December 2010 16:31:35 Michael S. Tsirkin wrote: On Wed, Dec 29, 2010 at 03:18:13PM +0800, Sheng Yang wrote: On Tuesday 28 December 2010 20:26:13 Avi Kivity wrote: On 12/22/2010 10:44 AM, Sheng Yang wrote: Then we can support mask bit operation of assigned devices now

Re: [PATCH 2/2][RFC] KVM: Emulate MSI-X table and PBA in kernel

2010-12-29 Thread Sheng Yang
On Wednesday 29 December 2010 17:28:24 Michael S. Tsirkin wrote: On Wed, Dec 29, 2010 at 04:55:19PM +0800, Sheng Yang wrote: On Wednesday 29 December 2010 16:31:35 Michael S. Tsirkin wrote: On Wed, Dec 29, 2010 at 03:18:13PM +0800, Sheng Yang wrote: On Tuesday 28 December 2010 20:26:13

Re: [PATCH 2/2][RFC] KVM: Emulate MSI-X table and PBA in kernel

2010-12-29 Thread Sheng Yang
On Thursday 30 December 2010 15:47:48 Michael S. Tsirkin wrote: On Thu, Dec 30, 2010 at 03:32:42PM +0800, Sheng Yang wrote: On Wednesday 29 December 2010 17:28:24 Michael S. Tsirkin wrote: On Wed, Dec 29, 2010 at 04:55:19PM +0800, Sheng Yang wrote: On Wednesday 29 December 2010 16:31:35

Re: [PATCH 2/2][RFC] KVM: Emulate MSI-X table and PBA in kernel

2010-12-28 Thread Sheng Yang
On Tuesday 28 December 2010 20:26:13 Avi Kivity wrote: On 12/22/2010 10:44 AM, Sheng Yang wrote: Then we can support mask bit operation of assigned devices now. @@ -3817,14 +3819,16 @@ static int emulator_write_emulated_onepage(unsigned long addr, mmio: trace_kvm_mmio

Re: [PATCH 0/2 v6] MSI-X mask bit support for KVM

2010-12-27 Thread Sheng Yang
On Wednesday 22 December 2010 16:44:53 Sheng Yang wrote: This patchset didn't include two PCI related patches which would be checked in through PCI subsystem. Would add the API document soon. Avi? BTW, there is one compiling issue for the second patch, due to last minute clean up

[PATCH 2/2][RFC] KVM: Emulate MSI-X table and PBA in kernel

2010-12-22 Thread Sheng Yang
Then we can support mask bit operation of assigned devices now. Signed-off-by: Sheng Yang sh...@linux.intel.com --- arch/x86/kvm/Makefile|2 +- arch/x86/kvm/x86.c |8 +- include/linux/kvm.h | 22 include/linux/kvm_host.h | 25 + virt/kvm/assigned-dev.c | 30

[PATCH 0/2 v6] MSI-X mask bit support for KVM

2010-12-22 Thread Sheng Yang
This patchset didn't include two PCI related patches which would be checked in through PCI subsystem. Would add the API document soon. Change from v5: Complete rewrote according to Avi's comments. Sheng Yang (2): KVM: Move struct kvm_io_device to kvm_host.h KVM: Emulate MSI-X table and PBA

[PATCH 1/2] KVM: Move struct kvm_io_device to kvm_host.h

2010-12-22 Thread Sheng Yang
Then it can be used by other struct in kvm_host.h Signed-off-by: Sheng Yang sh...@linux.intel.com --- include/linux/kvm_host.h | 23 +++ virt/kvm/iodev.h | 25 + 2 files changed, 24 insertions(+), 24 deletions(-) diff --git a/include/linux

[PATCH 0/4 v6] MSI-X MMIO support in userspace for assigned devices

2010-12-22 Thread Sheng Yang
BTW: the first patch can be applied alone. Sheng Yang (4): qemu-kvm: device assignment: Enabling MSI-X according to the entries' mask bit qemu-kvm: Ioctl for MSIX MMIO support qemu-kvm: Header file update for MSI-X MMIO support qemu-kvm: MSI-X MMIO support for assigned device hw

[PATCH 3/4] qemu-kvm: Header file update for MSI-X MMIO support

2010-12-22 Thread Sheng Yang
Signed-off-by: Sheng Yang sh...@linux.intel.com --- kvm/include/linux/kvm.h | 22 ++ 1 files changed, 22 insertions(+), 0 deletions(-) diff --git a/kvm/include/linux/kvm.h b/kvm/include/linux/kvm.h index e46729e..e11d2b2 100644 --- a/kvm/include/linux/kvm.h +++ b/kvm

[PATCH 2/4] qemu-kvm: Ioctl for MSIX MMIO support

2010-12-22 Thread Sheng Yang
Signed-off-by: Sheng Yang sh...@linux.intel.com --- qemu-kvm.c | 14 ++ qemu-kvm.h |7 +++ 2 files changed, 21 insertions(+), 0 deletions(-) diff --git a/qemu-kvm.c b/qemu-kvm.c index 471306b..956b62a 100644 --- a/qemu-kvm.c +++ b/qemu-kvm.c @@ -1050,6 +1050,20 @@ int

Re: [PATCH] qemu-kvm: device assignment: Enabling MSI-X according to mask bit

2010-12-20 Thread Sheng Yang
On Thursday 16 December 2010 16:21:52 Sheng Yang wrote: The old MSI-X enabling method assume the entries are written before MSI-X enabled, but some OS didn't obey this, e.g. FreeBSD. This patch would fix this. Also, according to the PCI spec, mask bit of MSI-X table should be set after

[PATCH] qemu-kvm: device assignment: Enabling MSI-X according to mask bit

2010-12-16 Thread Sheng Yang
The old MSI-X enabling method assume the entries are written before MSI-X enabled, but some OS didn't obey this, e.g. FreeBSD. This patch would fix this. Also, according to the PCI spec, mask bit of MSI-X table should be set after reset. Signed-off-by: Sheng Yang sh...@linux.intel.com --- hw

[PATCH] KVM: Fix OSXSAVE after migration

2010-12-07 Thread Sheng Yang
CPUID's OSXSAVE is a mirror of CR4.OSXSAVE bit. We need to update the CPUID after migration. Cc: sta...@kernel.org Signed-off-by: Sheng Yang sh...@linux.intel.com --- arch/x86/kvm/x86.c |2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm

[PATCH] KVM: Add reading critical region for kvm_io_bus_read/write

2010-12-06 Thread Sheng Yang
Seems we missed it. Signed-off-by: Sheng Yang sh...@linux.intel.com --- Do we need this, or slot_lock covered this? virt/kvm/kvm_main.c | 24 1 files changed, 16 insertions(+), 8 deletions(-) diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c index c4ee364

Re: [PATCH] KVM: Add reading critical region for kvm_io_bus_read/write

2010-12-06 Thread Sheng Yang
On Monday 06 December 2010 20:58:10 Avi Kivity wrote: On 12/06/2010 10:44 AM, Sheng Yang wrote: Seems we missed it. Signed-off-by: Sheng Yangsh...@linux.intel.com --- Do we need this, or slot_lock covered this? virt/kvm/kvm_main.c | 24 1 files

Re: Performance test result between virtio_pci MSI-X disable and enable

2010-12-02 Thread Sheng Yang
On Thu, Dec 2, 2010 at 5:49 PM, Michael S. Tsirkin m...@redhat.com wrote: On Thu, Dec 02, 2010 at 09:13:28AM +0800, Yang, Sheng wrote: On Wednesday 01 December 2010 22:03:58 Michael S. Tsirkin wrote: On Wed, Dec 01, 2010 at 04:41:38PM +0800, lidong chen wrote: I used sr-iov, give each vm 2

Re: Mask bit support's API

2010-12-02 Thread Sheng Yang
On Thu, Dec 2, 2010 at 10:26 PM, Michael S. Tsirkin m...@redhat.com wrote: On Thu, Dec 02, 2010 at 03:56:52PM +0200, Avi Kivity wrote: On 12/02/2010 03:47 PM, Michael S. Tsirkin wrote:  Which case?  the readl() doesn't need access to the routing table,  just the entry. One thing that

Re: [PATCH 4/6] KVM: Add kvm_get_irq_routing_entry() func

2010-11-18 Thread Sheng Yang
On Thu, Nov 18, 2010 at 5:41 PM, Michael S. Tsirkin m...@redhat.com wrote: On Thu, Nov 18, 2010 at 11:30:47AM +0200, Avi Kivity wrote:  *entry may be stale after rcu_read_unlock().  Is this a problem? I suppose not. All MSI-X MMIO accessing would be executed without delay, so no re-

Re: [PATCH 6/6] KVM: assigned dev: MSI-X mask support

2010-11-18 Thread Sheng Yang
On Thu, Nov 18, 2010 at 5:28 PM, Avi Kivity a...@redhat.com wrote: On 11/18/2010 03:58 AM, Sheng Yang wrote: On Wednesday 17 November 2010 21:58:00 Avi Kivity wrote:  On 11/15/2010 11:15 AM, Sheng Yang wrote:    This patch enable per-vector mask for assigned devices using MSI-X

Re: [PATCH 4/6] KVM: Add kvm_get_irq_routing_entry() func

2010-11-18 Thread Sheng Yang
On Thu, Nov 18, 2010 at 8:33 PM, Michael S. Tsirkin m...@redhat.com wrote: On Thu, Nov 18, 2010 at 07:59:10PM +0800, Sheng Yang wrote: On Thu, Nov 18, 2010 at 5:41 PM, Michael S. Tsirkin m...@redhat.com wrote: On Thu, Nov 18, 2010 at 11:30:47AM +0200, Avi Kivity wrote:  *entry may

Re: [PATCH 6/6] KVM: assigned dev: MSI-X mask support

2010-11-17 Thread Sheng Yang
On Wednesday 17 November 2010 21:58:00 Avi Kivity wrote: On 11/15/2010 11:15 AM, Sheng Yang wrote: This patch enable per-vector mask for assigned devices using MSI-X. This patch provided two new APIs: one is for guest to specific device's MSI-X table address in MMIO, the other

Re: [PATCH 4/6] KVM: Add kvm_get_irq_routing_entry() func

2010-11-17 Thread Sheng Yang
On Wednesday 17 November 2010 22:01:41 Avi Kivity wrote: On 11/15/2010 11:15 AM, Sheng Yang wrote: We need to query the entry later. +int kvm_get_irq_routing_entry(struct kvm *kvm, int gsi, + struct kvm_kernel_irq_routing_entry *entry) +{ + int count = 0; + struct

Re: [PATCH 6/6] KVM: assigned dev: MSI-X mask support

2010-11-17 Thread Sheng Yang
On Thursday 18 November 2010 14:21:40 Michael S. Tsirkin wrote: On Thu, Nov 18, 2010 at 09:58:55AM +0800, Sheng Yang wrote: +static int msix_mmio_write(struct kvm_io_device *this, gpa_t addr, int len, + const void *val) +{ + struct

Re: [PATCH 6/6] KVM: assigned dev: MSI-X mask support

2010-11-16 Thread Sheng Yang
On Wednesday 17 November 2010 03:45:22 Marcelo Tosatti wrote: On Mon, Nov 15, 2010 at 05:15:32PM +0800, Sheng Yang wrote: This patch enable per-vector mask for assigned devices using MSI-X. This patch provided two new APIs: one is for guest to specific device's MSI-X table address

Re: [PATCH 2/7] PCI: Add mask bit definition for MSI-X table

2010-11-15 Thread Sheng Yang
On Friday 12 November 2010 01:29:29 Jesse Barnes wrote: On Thu, 11 Nov 2010 15:46:55 +0800 Sheng Yang sh...@linux.intel.com wrote: Then we can use it instead of magic number 1. Reviewed-by: Hidetoshi Seto seto.hideto...@jp.fujitsu.com Cc: Matthew Wilcox wi...@linux.intel.com Cc

  1   2   3   4   5   6   7   8   9   10   >