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 commen

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

2011-03-01 Thread Sheng Yang
Signed-off-by: Sheng Yang --- 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 --- a/Documentation/kvm/api.txt +++ b

[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

[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 --- arch/x86/kvm/i8254.c |6 -- arch/x86/kvm/i8259.c |3 ++- arch/x86/kvm/lapic.c |3 ++- arch/x86/kvm/x86.c| 13

[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 --- 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 | 41 +++ virt

[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 --- include/linux/kvm_host.h | 23 +++ virt/kvm/iodev.h | 25 + 2 files changed, 24 insertions(+), 24 deletions(-) diff --git a/include/linux/kvm_host.h b/include

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: > > > &

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: > >

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: > > > >

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 > > A general question: we implement mmio

[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 --- include/linux/kvm_host.h | 23 +++ virt/kvm/iodev.h | 25 + 2 files changed, 24 insertions(+), 24 deletions(-) diff --git a/include/linux/kvm_host.h b/include

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

2011-02-27 Thread Sheng Yang
Signed-off-by: Sheng Yang --- 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 --- a/Documentation/kvm/api.txt +++ b

[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 --- 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/linux/kvm.h

[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 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 --- arch/x86/kvm/i8254.c |6 -- arch/x86/kvm/i8259.c |3 ++- arch/x86/kvm/lapic.c |3 ++- arch/x86/kvm/x86.c| 13

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: > > > >

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: > > >

[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 --- 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/linux/kvm.h

[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 --- 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/linux/kvm.h

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 > > Doesn't look like all comm

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: > > > >

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: > > > >

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 Y

[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 --- include/linux/kvm_host.h | 23 +++ virt/kvm/iodev.h | 25 + 2 files changed, 24 insertions(+), 24 deletions(-) diff --git a/include/linux/kvm_host.h b/include

[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 --- 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/linux/kvm.h

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

2011-02-24 Thread Sheng Yang
Signed-off-by: Sheng Yang --- 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 --- a/Documentation/kvm/api.txt +++ b

[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 --- arch/x86/kvm/i8254.c |6 -- arch/x86/kvm/i8259.c |3 ++- arch/x86/kvm/lapic.c |3 ++- arch/x86/kvm/x86.c| 13

[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

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

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

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 h

[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 --- hw/device-assignm

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

2011-02-18 Thread Sheng Yang
Signed-off-by: Sheng Yang --- 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/include/linux/kvm.h

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

2011-02-18 Thread Sheng Yang
Signed-off-by: Sheng Yang --- 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 kvm_assign_set_msix_entry

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

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

[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/d

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

2011-02-18 Thread Sheng Yang
Signed-off-by: Sheng Yang --- 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 --- a/Documentation/kvm/api.txt +++ b

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

2011-02-18 Thread Sheng Yang
Then we can support mask bit operation of assigned devices now. Signed-off-by: Sheng Yang --- arch/x86/kvm/Makefile|2 +- arch/x86/kvm/x86.c | 29 - include/linux/kvm.h | 28 + include/linux/kvm_host.h | 32 + virt/kvm/assigned-dev.c | 44 +++ virt

[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 --- arch/x86/kvm/i8254.c |6 -- arch/x86/kvm/i8259.c |3 ++- arch/x86/kvm/lapic.c |3 ++- arch/x86/kvm/x86.c| 13

[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 --- include/linux/kvm_host.h | 23 +++ virt/kvm/iodev.h | 25 + 2 files changed, 24 insertions(+), 24 deletions(-) diff --git a/include/linux/kvm_host.h b/include

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 > > > > +int kvm_vm_ioctl_r

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 gue

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: > >>

[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 --- hw/device-assignm

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

2011-01-29 Thread Sheng Yang
Signed-off-by: Sheng Yang --- 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/include/linux/kvm.h

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

2011-01-29 Thread Sheng Yang
Signed-off-by: Sheng Yang --- 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 kvm_assign_set_msix_entry

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

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

[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/d

[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 MMI

[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 --- 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 +++ virt/kvm

[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 --- include/linux/kvm_host.h | 23 +++ virt/kvm/iodev.h | 25 + 2 files changed, 24 insertions(+), 24 deletions(-) diff --git a/include/linux/kvm_host.h b/include

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

2011-01-29 Thread Sheng Yang
Signed-off-by: Sheng Yang --- 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 --- a/Documentation/kvm/api.txt +++ b

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_upd

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. > > > &g

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]; > > > > + en

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 Yang > > > > --

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 Yang > > --- > > > > Documentation/kvm/api.txt | 41 > > + 1 files changed, 41 > > inse

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 > > --- > > > > arch/x86/kvm/Make

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. &g

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

2011-01-06 Thread Sheng Yang
Signed-off-by: Sheng Yang --- 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 kvm_assign_set_msix_entry

[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 --- hw/device-assignm

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

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

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

2011-01-06 Thread Sheng Yang
Signed-off-by: Sheng Yang --- 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/include/linux/kvm.h

[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/d

[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 --- 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 +++ virt/kvm

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

2011-01-06 Thread Sheng Yang
Signed-off-by: Sheng Yang --- 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/kvm/api.txt +++ b

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

2011-01-06 Thread Sheng Yang
PCI: 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 doc

[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 --- include/linux/kvm_host.h | 23 +++ virt/kvm/iodev.h | 25 + 2 files changed, 24 insertions(+), 24 deletions(-) diff --git a/include/linux/kvm_host.h b/include

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. >

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

2010-12-30 Thread Sheng Yang
hange, for both paging to nonpaging, and nonpaging to paging switch. Signed-off-by: Sheng Yang --- 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 +++ b/ar

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 */ > > > >

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: > > > >

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

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

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

2010-12-30 Thread Sheng Yang
hange, for both paging to nonpaging, and nonpaging to paging switch. Signed-off-by: Sheng Yang --- 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/x86/

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: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 Michael S. Tsirkin wrote: > > > On Thu, Dec 30, 2010 at 03:32:42PM +0800, Sheng Yang wrote: > > > >

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: > > > >

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: > > > &g

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

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(un

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

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

2010-12-22 Thread Sheng Yang
Signed-off-by: Sheng Yang --- 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 kvm_assign_set_msix_entry

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

2010-12-22 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 --- hw/device-assignm

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

2010-12-22 Thread Sheng Yang
Signed-off-by: Sheng Yang --- hw/device-assignment.c | 143 +++- hw/device-assignment.h |7 ++- qemu-kvm.c | 36 qemu-kvm.h | 11 4 files changed, 180 insertions(+), 17 deletions(-) diff --git a/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 --- 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/include/linux/kvm.h

[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

[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 tab

[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 --- include/linux/kvm_host.h | 23 +++ virt/kvm/iodev.h | 25 + 2 files changed, 24 insertions(+), 24 deletions(-) diff --git a/include/linux/kvm_host.h b/include

[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 --- 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 ++ virt/kvm

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

[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 --- hw/device-assignm

Re: [PATCH] KVM: Fix OSXSAVE after migration

2010-12-08 Thread Sheng Yang
On Wednesday 08 December 2010 18:33:43 Avi Kivity wrote: > On 12/08/2010 04:49 AM, Sheng Yang wrote: > > CPUID's OSXSAVE is a mirror of CR4.OSXSAVE bit. We need to update the > > CPUID after migration. > > Applied, thanks. > > > @@ -5585,6 +5585,8 @@ int k

[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 --- 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/x86.c index ed

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 Yang > > --- > > Do we need this, or slot_lock covered this? > > > > virt/kvm/kvm_main.c | 24 +

[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 --- 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..3e71b91 100644 --- a/virt

Re: Mask bit support's API

2010-12-02 Thread Sheng Yang
On Thu, Dec 2, 2010 at 10:26 PM, Michael S. Tsirkin 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 th

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 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 vf. >>

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 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 wrote: >> > On Thu, Nov 18, 2010 at 11:30:47AM +0200, Avi Kivity wrote: >> >> >>

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 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 m

  1   2   3   4   5   6   7   8   9   10   >