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

2010-11-05 Thread Sheng Yang
On Friday 05 November 2010 18:53:50 Sheng Yang wrote: > On Friday 05 November 2010 16:43:33 Michael S. Tsirkin wrote: > > On Fri, Nov 05, 2010 at 10:44:19AM +0800, Sheng Yang wrote: > > > > > +}; > > > > > + > > > > > +This ioctl would enable i

Re: [PATCH 0/5 v3] MSI-X mask supporting for assigned device(kernel)

2010-11-07 Thread Sheng Yang
On Saturday 06 November 2010 08:27:15 Marcelo Tosatti wrote: > On Thu, Nov 04, 2010 at 02:15:16PM +0800, Sheng Yang wrote: > > Here is the latest series of MSI-X mask supporting patches. > > > > The bigest change from last version is, in order to reduce the > > compl

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

2010-11-07 Thread Sheng Yang
On Friday 05 November 2010 21:27:42 Michael S. Tsirkin wrote: > On Fri, Nov 05, 2010 at 06:53:50PM +0800, Sheng Yang wrote: > > On Friday 05 November 2010 16:43:33 Michael S. Tsirkin wrote: > > > On Fri, Nov 05, 2010 at 10:44:19AM +0800

Re: [PATCH 3/3] qemu-kvm: device assignment: emulate MSI-X mask bits

2010-11-07 Thread Sheng Yang
On Friday 05 November 2010 21:54:16 Michael S. Tsirkin wrote: > On Fri, Nov 05, 2010 at 07:02:02PM +0800, Sheng Yang wrote: > > On Friday 05 November 2010 17:05:32 Michael S. Tsirkin wrote: > > > On Fri, Nov 05, 2010 at 11:20:37AM +0800, Sheng Yang wrote: > > > > On T

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

2010-11-07 Thread Sheng Yang
On Saturday 06 November 2010 08:24:51 Marcelo Tosatti wrote: > On Fri, Nov 05, 2010 at 06:53:50PM +0800, Sheng Yang wrote: > > On Friday 05 November 2010 16:43:33 Michael S. Tsirkin wrote: > > > On Fri, Nov 05, 2010 at 10:44:19AM +0800

Re: [PATCH 1/3] qemu-kvm: Ioctl for in-kernel mask support

2010-11-10 Thread Sheng Yang
On Friday 05 November 2010 16:52:47 Michael S. Tsirkin wrote: > On Fri, Nov 05, 2010 at 10:59:23AM +0800, Sheng Yang wrote: > > > We are trying to move away from using ifdefs. Stub these out instead? > > > > Example? > > 37859f054986fa

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

2010-11-10 Thread Sheng Yang
We need to query the entry later. Signed-off-by: Sheng Yang --- include/linux/kvm_host.h |2 ++ virt/kvm/irq_comm.c | 20 2 files changed, 22 insertions(+), 0 deletions(-) diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h index 7f9e4b7..e2ecbac

[PATCH 0/7 v4] MSI-X mask support for assigned device

2010-11-10 Thread Sheng Yang
Change from v3: 1. Re-design the userspace API. 2. Add big-endian support for msix_mmio_read/write()(untested!) Change from v2: 1. Move all mask handling to kernel, and userspace has to access it using API. 2. Discard userspace mask bit operation API. Sheng Yang (7): PCI: MSI: Move MSI-X entry

[PATCH 7/7] KVM: assigned dev: Big endian support for MSI-X MMIO

2010-11-10 Thread Sheng Yang
Add marco for big-endian machine.(Untested!) Signed-off-by: Sheng Yang --- virt/kvm/assigned-dev.c |7 --- 1 files changed, 4 insertions(+), 3 deletions(-) diff --git a/virt/kvm/assigned-dev.c b/virt/kvm/assigned-dev.c index 3010d7d..15b5f74 100644 --- a/virt/kvm/assigned-dev.c +++ b

[PATCH 1/7] PCI: MSI: Move MSI-X entry definition to pci_regs.h

2010-11-10 Thread Sheng Yang
Then it can be used by others. Reviewed-by: Hidetoshi Seto Reviewed-by: Matthew Wilcox Cc: Jesse Barnes Cc: linux-...@vger.kernel.org Signed-off-by: Sheng Yang --- drivers/pci/msi.h|6 -- include/linux/pci_regs.h |7 +++ 2 files changed, 7 insertions(+), 6 deletions

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

2010-11-10 Thread Sheng Yang
Then we can use it instead of magic number 1. Reviewed-by: Hidetoshi Seto Cc: Matthew Wilcox Cc: Jesse Barnes Cc: linux-...@vger.kernel.org Signed-off-by: Sheng Yang --- drivers/pci/msi.c|5 +++-- include/linux/pci_regs.h |1 + 2 files changed, 4 insertions(+), 2 deletions

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

2010-11-10 Thread Sheng Yang
er to accelerate. Userspace shouldn't access the device MMIO directly for the information, instead it should uses provided API to do so. Signed-off-by: Sheng Yang --- arch/x86/kvm/x86.c |1 + include/linux/kvm.h | 32 + include/linux/kvm_host.h |5 + virt/kvm/assigned-dev

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

2010-11-10 Thread Sheng Yang
Then it can be used in struct kvm_assigned_dev_kernel later. 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

[PATCH 5/7] KVM: assigned dev: Clean up assigned_device's flag

2010-11-10 Thread Sheng Yang
Reuse KVM_DEV_ASSIGN_ENABLE_IOMMU for an in-kernel struct didn't make much sense. Signed-off-by: Sheng Yang --- include/linux/kvm_host.h |1 + virt/kvm/assigned-dev.c |7 --- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/include/linux/kvm_host.h b/include/

[PATCH 1/5] qemu-kvm: device assignment: Reset MSI-X table mask bit as set

2010-11-10 Thread Sheng Yang
According to the PCI spec, mask bit of MSI-X table should be set after reset. Signed-off-by: Sheng Yang --- hw/device-assignment.c | 12 1 files changed, 8 insertions(+), 4 deletions(-) diff --git a/hw/device-assignment.c b/hw/device-assignment.c index 2605bd1..dfca764 100644

[PATCH 2/5] qemu-kvm: Ioctl for in-kernel mask support

2010-11-10 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 733d0a9..aa30144 100644 --- a/qemu-kvm.c +++ b/qemu-kvm.c @@ -1094,6 +1094,20 @@ int kvm_assign_set_msix_entry

[PATCH 3/5] qemu-kvm: device assignment: Some clean up about MSI-X code

2010-11-10 Thread Sheng Yang
Then the code can be easily reviewed. Signed-off-by: Sheng Yang --- hw/device-assignment.c | 77 --- 1 files changed, 52 insertions(+), 25 deletions(-) diff --git a/hw/device-assignment.c b/hw/device-assignment.c index dfca764..5fe4a55 100644 --- a

[PATCH 4/5] qemu-kvm: device assignment: emulate MSI-X mask bits

2010-11-10 Thread Sheng Yang
This patch emulated MSI-X per vector mask bit on assigned device. Signed-off-by: Sheng Yang --- hw/device-assignment.c | 167 +--- hw/device-assignment.h |2 +- 2 files changed, 158 insertions(+), 11 deletions(-) diff --git a/hw/device

[PATCH 0/5 v4] MSI-X mask support for userspace

2010-11-10 Thread Sheng Yang
Change from v3: 1. Enable legacy(without MSI-X mask support) userspace to tracking mask bit. 2. Rewrite follow new kernel API. Sheng Yang (5): qemu-kvm: device assignment: Reset MSI-X table mask bit as set qemu-kvm: Ioctl for in-kernel mask support qemu-kvm: device assignment: Some clean up

[PATCH 5/5] qemu-kvm: Header file update for MSI-X mask support

2010-11-10 Thread Sheng Yang
Signed-off-by: Sheng Yang --- kvm/include/linux/kvm.h | 32 1 files changed, 32 insertions(+), 0 deletions(-) diff --git a/kvm/include/linux/kvm.h b/kvm/include/linux/kvm.h index e46729e..3925fab 100644 --- a/kvm/include/linux/kvm.h +++ b/kvm/include/linux

Re: [PATCH 7/7] KVM: assigned dev: Big endian support for MSI-X MMIO

2010-11-11 Thread Sheng Yang
On Friday 12 November 2010 00:12:21 Michael S. Tsirkin wrote: > On Thu, Nov 11, 2010 at 03:47:00PM +0800, Sheng Yang wrote: > > Add marco for big-endian machine.(Untested!) > > > > Signed-off-by: Sheng Yang > > I presume this is tested at the same level as the previ

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

2010-11-12 Thread Sheng Yang
On Friday 12 November 2010 17:53:13 Michael S. Tsirkin wrote: > On Thu, Nov 11, 2010 at 03:46:59PM +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 dev

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

2010-11-12 Thread Sheng Yang
On Friday 12 November 2010 18:47:29 Michael S. Tsirkin wrote: > On Fri, Nov 12, 2010 at 06:13:48PM +0800, Sheng Yang wrote: > > On Friday 12 November 2010 17:53:13 Michael S. Tsirkin wrote: > > > On Thu, Nov 11, 2010 at 03:46:59PM +0800, Sheng Yang wrote: > > > > Thi

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

2010-11-14 Thread Sheng Yang
On Friday 12 November 2010 19:25:16 Michael S. Tsirkin wrote: > On Fri, Nov 12, 2010 at 06:54:01PM +0800, Sheng Yang wrote: > > On Friday 12 November 2010 18:47:29 Michael S. Tsirkin wrote: > > > On Fri, Nov 12, 2010 at 06:13:48PM +0800, Sheng Yang wrote: > > > > On

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

2010-11-14 Thread Sheng Yang
On Monday 15 November 2010 15:42:50 Michael S. Tsirkin wrote: > On Mon, Nov 15, 2010 at 03:37:21PM +0800, Sheng Yang wrote: > > > > We can back to them if there is someone really did it in that way. > > > > But for all hypervisors using QEmu, I think we haven't se

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 wrote: > > Then we can use it instead of magic number 1. > > > > Reviewed-by: Hidetoshi Seto > > Cc: Matthew Wilcox > > Cc: Jesse Barnes >

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

2010-11-15 Thread Sheng Yang
On Monday 15 November 2010 16:03:53 Michael S. Tsirkin wrote: > On Mon, Nov 15, 2010 at 03:48:46PM +0800, Sheng Yang wrote: > > On Monday 15 November 2010 15:42:50 Michael S. Tsirkin wrote: > > > On Mon, Nov 15, 2010 at 03:37:21PM +0800, Sheng Yang wrote: > > > > &g

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

2010-11-15 Thread Sheng Yang
We need to query the entry later. Signed-off-by: Sheng Yang --- include/linux/kvm_host.h |2 ++ virt/kvm/irq_comm.c | 20 2 files changed, 22 insertions(+), 0 deletions(-) diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h index 9da2f1a..274655b

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

2010-11-15 Thread Sheng Yang
Then it can be used in struct kvm_assigned_dev_kernel later. 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

[PATCH 0/6 v5] MSI-X mask support for assigned device

2010-11-15 Thread Sheng Yang
handling to kernel, and userspace has to access it using API. 2. Discard userspace mask bit operation API. Sheng Yang (6): PCI: MSI: Move MSI-X entry definition to pci_regs.h PCI: Add mask bit definition for MSI-X table KVM: Move struct kvm_io_device to kvm_host.h KVM: Add

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

2010-11-15 Thread Sheng Yang
er to accelerate. Userspace shouldn't access the device MMIO directly for the information, instead it should uses provided API to do so. Signed-off-by: Sheng Yang --- arch/x86/kvm/x86.c |1 + include/linux/kvm.h | 32 + include/linux/kvm_host.h |5 + virt/kvm/assigned-dev

[PATCH 5/6] KVM: assigned dev: Clean up assigned_device's flag

2010-11-15 Thread Sheng Yang
Reuse KVM_DEV_ASSIGN_ENABLE_IOMMU for an in-kernel struct didn't make much sense. Signed-off-by: Sheng Yang --- include/linux/kvm_host.h |1 + virt/kvm/assigned-dev.c |7 --- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/include/linux/kvm_host.h b/include/

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

2010-11-15 Thread Sheng Yang
Then we can use it instead of magic number 1. Reviewed-by: Hidetoshi Seto Acked-by: Jesse Barnes Cc: Matthew Wilcox Cc: linux-...@vger.kernel.org Signed-off-by: Sheng Yang --- drivers/pci/msi.c|5 +++-- include/linux/pci_regs.h |1 + 2 files changed, 4 insertions(+), 2

[PATCH 1/6] PCI: MSI: Move MSI-X entry definition to pci_regs.h

2010-11-15 Thread Sheng Yang
Then it can be used by others. Reviewed-by: Hidetoshi Seto Reviewed-by: Matthew Wilcox Acked-by: Jesse Barnes Cc: linux-...@vger.kernel.org Signed-off-by: Sheng Yang --- drivers/pci/msi.h|6 -- include/linux/pci_regs.h |7 +++ 2 files changed, 7 insertions(+), 6

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

2010-11-15 Thread Sheng Yang
er to accelerate. Userspace shouldn't access the device MMIO directly for the information, instead it should uses provided API to do so. Signed-off-by: Sheng Yang --- arch/x86/kvm/x86.c |1 + include/linux/kvm.h | 32 + include/linux/kvm_host.h |5 + virt/kvm/assigned-dev

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 dev

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Re: KVM bug

2009-07-23 Thread Sheng Yang
On Friday 24 July 2009 04:59:51 Saksena, Abhishek wrote: > Hi > I am trying to boot a patched version of Boch's BIOS on KVM. It works fine > with Qemu with -no-kvm option. However I get following with KVM The first thing come to my mind is your bios lacks some reserved page for VMX. See qemu-kvm/

Re: [PATCH] kvm: remove superfluous NULL pointer check in kvm_inject_pit_timer_irqs()

2009-07-28 Thread Sheng Yang
int inject = 0; > ps = &pit->pit_state; > Oh, follow up for the recent zero day exploit, right? :) Yes, vcpu NULL check is not necessary here. Acked-by: Sheng Yang -- regards Yang, Sheng > -- > To unsubscribe from this list: send the line "unsubscribe k

[PATCH] KVM: Fix EPT identity IOCTL on 32pae

2009-08-02 Thread Sheng Yang
Copy u64 from guest result in chaos. Also fix a mistake of still using old macro rather than new variable(). Signed-off-by: Sheng Yang --- arch/x86/kvm/vmx.c |2 +- arch/x86/kvm/x86.c |2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/x86/kvm/vmx.c b/arch/x86

Re: [PATCH] KVM: Fix EPT identity IOCTL on 32pae

2009-08-03 Thread Sheng Yang
On Monday 03 August 2009 20:25:43 Avi Kivity wrote: > On 08/03/2009 09:17 AM, Sheng Yang wrote: > > Copy u64 from guest result in chaos. > > > > Also fix a mistake of still using old macro rather than new variable(). > > > > Signed-off-by: Sheng Yang > &

[PATCH] kvm: fix set_ept_identity_addr() in pae

2009-08-03 Thread Sheng Yang
The argument to kernel space should be u64 rather than unsigned long. Signed-off-by: Sheng Yang --- qemu-kvm-x86.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/qemu-kvm-x86.c b/qemu-kvm-x86.c index 492dbc5..5fa89e8 100644 --- a/qemu-kvm-x86.c +++ b/qemu-kvm-x86.c

[PATCH] KVM: Fix EPT identity page location

2009-08-03 Thread Sheng Yang
Should be new ept_identity_map_addr rather than old macro. Signed-off-by: Sheng Yang --- arch/x86/kvm/vmx.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c index 7931c72..c5aaa1b 100644 --- a/arch/x86/kvm/vmx.c +++ b/arch/x86/kvm

Re: [PATCH] KVM: Fix EPT identity IOCTL on 32pae

2009-08-03 Thread Sheng Yang
On Tuesday 04 August 2009 00:47:16 Marcelo Tosatti wrote: > On Mon, Aug 03, 2009 at 02:17:27PM +0800, Sheng Yang wrote: > > Copy u64 from guest result in chaos. > > Why? My fault in userspace... -- regards Yang, Sheng > > > Also fix a mistake of still using old macro

[PATCH] KVM: Fix EPT with WP bit change during paging

2009-08-18 Thread Sheng Yang
QNX update WP bit when paging enabled, which is not covered yet. This one fix QNX boot with EPT. Signed-off-by: Sheng Yang --- I think it's also necessary for 2.6.31? arch/x86/kvm/vmx.c |6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff --git a/arch/x86/kvm/vmx.c b/arc

[PATCH] KVM: Fix NULL pointer reference by update_cr8_intercept()

2009-08-18 Thread Sheng Yang
Commit 0d11419a result in NULL pointer reference when using --no-kvm-irqchip. Signed-off-by: Sheng Yang --- arch/x86/kvm/x86.c |3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c index 850cf56..9ac2d9e 100644 --- a/arch/x86/kvm/x86

Re: [PATCH V3] perf & kvm: Enhance perf to collect KVM guest os statistics from host side

2010-04-14 Thread Sheng Yang
On Wednesday 14 April 2010 17:20:15 Avi Kivity wrote: > On 04/14/2030 12:05 PM, Zhang, Yanmin wrote: > > Here is the new patch of V3 against tip/master of April 13th > > if anyone wants to try it. > > Thanks for persisting despite the flames. > > Can you please separate arch/x86/kvm part of the p

Re: [PATCH V3] perf & kvm: Enhance perf to collect KVM guest os statistics from host side

2010-04-14 Thread Sheng Yang
On Wednesday 14 April 2010 17:57:50 Avi Kivity wrote: > On 04/14/2010 12:43 PM, Sheng Yang wrote: > > On Wednesday 14 April 2010 17:20:15 Avi Kivity wrote: > >> On 04/14/2030 12:05 PM, Zhang, Yanmin wrote: > >>> Here is the new patch of V3 against tip/master of April

Re: [PATCH V3] perf & kvm: Enhance perf to collect KVM guest os statistics from host side

2010-04-14 Thread Sheng Yang
On Wednesday 14 April 2010 18:19:49 Avi Kivity wrote: > On 04/14/2010 01:14 PM, Sheng Yang wrote: > >> I wouldn't like to depend on model specific behaviour. > >> > >> One option is to read all the information synchronously and store it in > >> a per-c

Re: [PATCH V3] perf & kvm: Enhance perf to collect KVM guest os statistics from host side

2010-04-14 Thread Sheng Yang
On Wednesday 14 April 2010 18:33:37 Avi Kivity wrote: > On 04/14/2010 01:27 PM, Sheng Yang wrote: > >> Yes, interesting to see what the latency is. If it's reasonably short > >> (and I expect it will be so), we can do the busy wait solution. > >> > >>

Re: [PATCH V3] perf & kvm: Enhance perf to collect KVM guest os statistics from host side

2010-04-15 Thread Sheng Yang
On Thursday 15 April 2010 18:44:15 Avi Kivity wrote: > On 04/15/2010 01:40 PM, Joerg Roedel wrote: > >> That means an NMI that happens outside guest code (for example, in the > >> mmu, or during the exit itself) would be counted as if in guest code. > > > > Hmm, true. The same is true for an NMI th

Re: [PATCH V3] perf & kvm: Enhance perf to collect KVM guest os statistics from host side

2010-04-19 Thread Sheng Yang
On Monday 19 April 2010 16:25:17 Avi Kivity wrote: > On 04/17/2010 09:12 PM, Avi Kivity wrote: > > I think you were right the first time around. > > Re-reading again (esp. the part about treatment of indirect NMI > vmexits), I think this was wrong, and that the code is correct. I am > now thoroug

[PATCH 2/4] KVM: Clean up duplicate assignment

2010-05-10 Thread Sheng Yang
mmu.free() already set root_hpa to INVALID_PAGE, no need to do it again in the destory_kvm_mmu(). kvm_x86_ops->set_cr4() and set_efer() already assign cr4/efer to vcpu->arch.cr4/efer, no need to do it again later. Signed-off-by: Sheng Yang --- arch/x86/kvm/mmu.c |5 ++--- arch/x86/k

[PATCH 4/4] VMX: x86: Only reset MMU when necessary

2010-05-10 Thread Sheng Yang
Only modifying some bits of CR0/CR4 needs paging mode switch. Add update_rsvd_bits_mask() to address EFER.NX bit updating for reserved bits. Signed-off-by: Sheng Yang --- arch/x86/include/asm/kvm_host.h |1 + arch/x86/kvm/mmu.c | 17 ++--- arch/x86/kvm/x86.c

[PATCH 3/4] KVM: x86: Remove kvm_mmu_reset_context() in kvm_set_efer()

2010-05-10 Thread Sheng Yang
Modify EFER won't result in mode switch directly. After EFER.LME set, the following set CR0.PG would result in mode switch to IA32e. And the later action already covered by kvm_set_cr0(). Signed-off-by: Sheng Yang --- arch/x86/kvm/x86.c |1 - 1 files changed, 0 insertions(+), 1 dele

[PATCH 1/4] KVM: x86: Check LMA bit before set_efer

2010-05-10 Thread Sheng Yang
kvm_x86_ops->set_efer() would execute vcpu->arch.efer = efer, so the checking of LMA bit didn't work. Signed-off-by: Sheng Yang --- arch/x86/kvm/x86.c |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c index cd8a6

<    1   2   3   4   5   6   7   8   9   10   >