Re: [PATCH 1/2] kvm: libkvm: support for irq routing

2009-01-15 Thread Sheng Yang
On Thursday 15 January 2009 17:59:43 Avi Kivity wrote: > Sheng Yang wrote: > > On Thursday 15 January 2009 14:17:16 Sheng Yang wrote: > >> On Wednesday 14 January 2009 21:53:10 Avi Kivity wrote: > >>> Signed-off-by: Avi Kivity > >> > >&

Re: [PATCH] Fix almost infinite loop in APIC

2009-01-20 Thread Sheng Yang
On Tuesday 20 January 2009 18:41:21 Alexander Graf wrote: > Marcelo Tosatti wrote: > > On Thu, Jan 15, 2009 at 03:20:06PM +0800, Sheng Yang wrote: > >>> + * Since reinjection is not rate-limited, use the delay > >>> + * to inject

Re: [PATCH] Fix almost infinite loop in APIC

2009-01-20 Thread Sheng Yang
On Tuesday 20 January 2009 20:09:23 Alexander Graf wrote: > Sheng Yang wrote: > > On Tuesday 20 January 2009 18:41:21 Alexander Graf wrote: > >> Marcelo Tosatti wrote: > >>> On Thu, Jan 15, 2009 at 03:20:06PM +0800, Sheng Yang wrote: > >>>>> +

Re: [PATCH] Fix almost infinite loop in APIC

2009-01-20 Thread Sheng Yang
On Tuesday 20 January 2009 18:41:21 Alexander Graf wrote: > Marcelo Tosatti wrote: > > On Thu, Jan 15, 2009 at 03:20:06PM +0800, Sheng Yang wrote: > >>> + * Since reinjection is not rate-limited, use the delay > >>> + * to inject

Re: [PATCH] Fix almost infinite loop in APIC

2009-01-20 Thread Sheng Yang
On Wednesday 21 January 2009 02:51:39 Marcelo Tosatti wrote: > Hi Sheng, > > On Tue, Jan 20, 2009 at 09:43:15PM +0800, Sheng Yang wrote: > > Marcelo, I realize some interesting things. > > > > In fact, on my machine, when I measured the delta of n

Re: [PATCH] Fix almost infinite loop in APIC

2009-01-20 Thread Sheng Yang
On Wednesday 21 January 2009 12:23:30 Marcelo Tosatti wrote: > On Wed, Jan 21, 2009 at 10:40:49AM +0800, Sheng Yang wrote: > > Mind continue to change... > > > > A: time_fire > > B: intr_post > > C: read TMCCT > > > > I think the sequence can be AAB

[PATCH 1/1] kvm: Fix build for VT-d/AMD IOMMU

2009-01-20 Thread Sheng Yang
ff-by: Sheng Yang --- kernel/ia64/Kbuild |4 ++-- kernel/x86/Kbuild |4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/kernel/ia64/Kbuild b/kernel/ia64/Kbuild index 130ec45..5bc6098 100644 --- a/kernel/ia64/Kbuild +++ b/kernel/ia64/Kbuild @@ -3,8 +3,8 @@ obj-m := kvm.

[PATCH 1/1] KVM: MMU: Map device MMIO as UC in EPT

2009-01-21 Thread Sheng Yang
Software are not allow to access device MMIO using cacheable memory type, the patch limit MMIO region with UC and WC(guest can select WC using PAT and PCD/PWT). Signed-off-by: Sheng Yang --- arch/x86/kvm/mmu.c |9 +++-- arch/x86/kvm/vmx.c |3 +-- 2 files changed, 8 insertions(+), 4

Re: Questions about relation between kernel version and KVM userspace version

2009-01-22 Thread Sheng Yang
On Friday 23 January 2009 07:47:23 Kenni Lund wrote: > Hi list > Hi Kenni > I've been wondering about something for a while: How does the version of > the kernel module and the version of the KVM userspace relate? Eg. if you > run with a newer 2.6.27-2.6.28 kernel with the modules included, will

Re: [PATCH] external modules: Fix pre-2.6.18 kernels

2009-01-29 Thread Sheng Yang
On Tue, Jan 27, 2009 at 03:51:08PM -0200, Marcelo Tosatti wrote: > On Tue, Jan 27, 2009 at 05:29:17PM +0100, Jan Kiszka wrote: > > pci_dev.msi_enabled was introduced in 2.6.18, thus building against > > older kernels now fail. Fix via a compat wrapper. > > > > Signed-off-by: Jan Kiszka > > --- >

Re: confused with invept

2009-01-30 Thread Sheng Yang
On Fri, Jan 30, 2009 at 12:10:18PM -0700, Bill Rieske wrote: > I get the following extracted from dmesg when essentially modprobing > kvm_intel. Note: distro using kvm 78 Hi Bill Are you using Core i7 processor? Only it support EPT. What's your host kernel version? And I think we can try the la

Re: confused with invept

2009-02-02 Thread Sheng Yang
On Tue, Feb 3, 2009 at 2:09 AM, Bill Rieske wrote: > >>>> On 1/30/2009 at 8:18 PM, Sheng Yang wrote: >> On Fri, Jan 30, 2009 at 12:10:18PM -0700, Bill Rieske wrote: >>> I get the following extracted from dmesg when essentially modprobing >> kvm_intel. Not

[PATCH 1/1] KVM: Using irq routing table for MSI

2009-02-09 Thread Sheng Yang
Merge MSI userspace interface with IRQ routing table. Notice the API have been changed, and using IRQ routing table would be the only interface kvm-userspace supported. Signed-off-by: Sheng Yang --- include/linux/kvm.h |8 + include/linux/kvm_host.h |2 +- virt/kvm/irq_comm.c

[PATCH] KVM: VMX: Judge MMIO based on PFN rather than HVA in EPT violation

2009-02-10 Thread Sheng Yang
One page can be unmapped from userspace, then HVA seems legal, but in fact, PFN is illegal. Signed-off-by: Sheng Yang --- arch/x86/kvm/vmx.c |6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c index 9913a1d..a4fa1b5 100644 --- a

Re: [PATCH] KVM: VMX: Judge MMIO based on PFN rather than HVA in EPT violation

2009-02-10 Thread Sheng Yang
On Tuesday 10 February 2009 20:14:32 Marcelo Tosatti wrote: > Hi Sheng, > > On Tue, Feb 10, 2009 at 05:43:41PM +0800, Sheng Yang wrote: > > One page can be unmapped from userspace, then HVA seems legal, but in > > fact, PFN is illegal. > > > > Signed-off-by: Shen

Re: [PATCH] KVM: VMX: Judge MMIO based on PFN rather than HVA in EPT violation

2009-02-10 Thread Sheng Yang
On Wednesday 11 February 2009 10:43:43 Sheng Yang wrote: > On Tuesday 10 February 2009 20:14:32 Marcelo Tosatti wrote: > > Hi Sheng, > > > > On Tue, Feb 10, 2009 at 05:43:41PM +0800, Sheng Yang wrote: > > > One page can be unmapped from userspace, then HVA seems le

[PATCH] KVM: VMX: Use kvm_mmu_page_fault() handle EPT violation

2009-02-10 Thread Sheng Yang
Removed the unnecessary works. Thanks for Marcelo's reminder. Signed-off-by: Sheng Yang --- arch/x86/kvm/vmx.c | 27 +-- 1 files changed, 1 insertions(+), 26 deletions(-) diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c index 9913a1d..8704d36 100644 --- a/arc

[PATCH] KVM: VMX: Use kvm_mmu_page_fault() handle EPT violation

2009-02-10 Thread Sheng Yang
Removed the unnecessary works. Signed-off-by: Sheng Yang --- arch/x86/kvm/vmx.c | 30 +- 1 files changed, 1 insertions(+), 29 deletions(-) diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c index 9913a1d..ff2cb11 100644 --- a/arch/x86/kvm/vmx.c +++ b/arch/x86

[PATCH 0/5 v8] Optimize and unify IOAPIC/MSI delivery

2009-02-11 Thread Sheng Yang
This patchset based on MSI patch which changed deliver method to irq routing. Thanks. -- Yang, Sheng -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html

[PATCH 2/5] KVM: Unified the delivery of IOAPIC and MSI

2009-02-11 Thread Sheng Yang
Signed-off-by: Sheng Yang --- include/linux/kvm_host.h |3 ++ virt/kvm/ioapic.c| 84 --- virt/kvm/irq_comm.c | 89 - 3 files changed, 89 insertions(+), 87 deletions(-) diff --git a/include

[PATCH 1/5] KVM: Split IOAPIC structure

2009-02-11 Thread Sheng Yang
Prepared for reuse ioapic_redir_entry for MSI. Signed-off-by: Sheng Yang --- include/linux/kvm_types.h | 17 + virt/kvm/ioapic.c |6 +++--- virt/kvm/ioapic.h | 17 + 3 files changed, 21 insertions(+), 19 deletions(-) diff --git a/include

[PATCH 4/5] KVM: Update intr delivery func to accept unsigned long* bitmap

2009-02-11 Thread Sheng Yang
Would be used with bit ops, and would be easily extended if KVM_MAX_VCPUS is increased. Signed-off-by: Sheng Yang --- arch/x86/kvm/lapic.c |8 virt/kvm/ioapic.c|4 ++-- virt/kvm/ioapic.h|4 ++-- virt/kvm/irq_comm.c |6 +++--- 4 files changed, 11 insertions

[PATCH 5/5] KVM: bit ops for deliver_bitmap

2009-02-11 Thread Sheng Yang
It's also convenient when we extend KVM supported vcpu number in the future. Signed-off-by: Sheng Yang --- arch/x86/kvm/lapic.c |7 --- virt/kvm/ioapic.c| 24 +--- virt/kvm/irq_comm.c | 22 -- 3 files changed, 29 insertions(+

[PATCH 3/5] KVM: Change API of kvm_ioapic_get_delivery_bitmask

2009-02-11 Thread Sheng Yang
In order to use with bit ops. Signed-off-by: Sheng Yang --- virt/kvm/ioapic.c | 17 - virt/kvm/ioapic.h |4 ++-- virt/kvm/irq_comm.c |5 +++-- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/virt/kvm/ioapic.c b/virt/kvm/ioapic.c index 99d274c

[PATCH 2/3] KVM: Add gsi_msg_pending_bitmap for MSI-X

2009-02-11 Thread Sheng Yang
We have to handle more than one interrupt with one handler for MSI-X. So we need a bitmap to track the triggered interrupts. Signed-off-by: Sheng Yang --- include/linux/kvm_host.h |5 +- virt/kvm/kvm_main.c | 103 - 2 files changed, 103

[PATCH 1/3] KVM: Ioctls for init MSI-X entry

2009-02-11 Thread Sheng Yang
entry number for now. Signed-off-by: Sheng Yang --- include/linux/kvm.h | 14 +++ include/linux/kvm_host.h |3 + virt/kvm/kvm_main.c | 96 ++ 3 files changed, 113 insertions(+), 0 deletions(-) diff --git a/include/linux/kvm.h b/in

[PATCH 3/3] KVM: Enable MSI-X for KVM assigned device

2009-02-11 Thread Sheng Yang
idn't implement MSI-X mask all and mask single entry. I would implement the former in driver/pci/msi.c later. And for single entry, userspace should have reposibility to handle it. Signed-off-by: Sheng Yang --- include/linux/kvm.h |8 virt/k

[PATCH 0/3 v2] MSI-X enabling

2009-02-11 Thread Sheng Yang
Based on former patchset. -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html

[PATCH 5/7] kvm: user interface for MSI type irq routing

2009-02-11 Thread Sheng Yang
Signed-off-by: Sheng Yang --- libkvm/libkvm.c | 98 --- libkvm/libkvm.h | 22 2 files changed, 101 insertions(+), 19 deletions(-) diff --git a/libkvm/libkvm.c b/libkvm/libkvm.c index 92ffe10..571506a 100644 --- a/libkvm

[PATCH 0/7][v2] Userspace support for MSI enabling

2009-02-11 Thread Sheng Yang
Update using irq routing method. -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html

[PATCH 1/7] kvm: Replace force type convert with container_of()

2009-02-11 Thread Sheng Yang
Signed-off-by: Sheng Yang --- qemu/hw/device-assignment.c | 20 1 files changed, 12 insertions(+), 8 deletions(-) diff --git a/qemu/hw/device-assignment.c b/qemu/hw/device-assignment.c index e6d2352..f14f971 100644 --- a/qemu/hw/device-assignment.c +++ b/qemu/hw/device

[PATCH 2/7] Make device assignment depend on libpci

2009-02-11 Thread Sheng Yang
Which is used later for capability detection. Signed-off-by: Sheng Yang --- qemu/Makefile.target |1 + qemu/configure | 20 2 files changed, 21 insertions(+), 0 deletions(-) diff --git a/qemu/Makefile.target b/qemu/Makefile.target index 2c7c0d5..28704ce 100644

[PATCH 4/7] Support for device capability

2009-02-11 Thread Sheng Yang
This framework can be easily extended to support device capability, like MSI/MSI-x. Signed-off-by: Sheng Yang --- qemu/hw/pci.c | 85 + qemu/hw/pci.h | 30 2 files changed, 115 insertions(+), 0 deletions(-) diff

[PATCH 3/7] Figure out device capability

2009-02-11 Thread Sheng Yang
: Sheng Yang --- qemu/hw/device-assignment.c | 29 + qemu/hw/device-assignment.h |1 + 2 files changed, 30 insertions(+), 0 deletions(-) diff --git a/qemu/hw/device-assignment.c b/qemu/hw/device-assignment.c index f14f971..76369ed 100644 --- a/qemu/hw/device

[PATCH 6/7] kvm: libkvm: allocate unused gsi for irq routing

2009-02-11 Thread Sheng Yang
Notice here is a simple solution, can be replaced later. Signed-off-by: Sheng Yang --- libkvm/kvm-common.h |1 + libkvm/libkvm.c | 10 ++ libkvm/libkvm.h |8 3 files changed, 19 insertions(+), 0 deletions(-) diff --git a/libkvm/kvm-common.h b/libkvm/kvm

[PATCH 7/7] kvm: expose MSI capability to guest

2009-02-11 Thread Sheng Yang
Signed-off-by: Sheng Yang --- qemu/hw/device-assignment.c | 112 --- qemu/hw/device-assignment.h |7 +++ 2 files changed, 112 insertions(+), 7 deletions(-) diff --git a/qemu/hw/device-assignment.c b/qemu/hw/device-assignment.c index 76369ed..3ff8fde

[PATCH 0/3][v3] Userspace for MSI-X enabling

2009-02-11 Thread Sheng Yang
Update from v2: Change the interface to irq routing method. -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html

[PATCH 1/3] Add MSI-X related macro to pci.c

2009-02-11 Thread Sheng Yang
Signed-off-by: Sheng Yang --- qemu/hw/pci.h |1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/qemu/hw/pci.h b/qemu/hw/pci.h index b6fc330..8466cf8 100644 --- a/qemu/hw/pci.h +++ b/qemu/hw/pci.h @@ -185,6 +185,7 @@ typedef struct PCIIORegion { #define

[PATCH 3/3] kvm: enable MSI-X capabilty for assigned device

2009-02-11 Thread Sheng Yang
The most important part here, is we emulate a page of MMIO region using a page of memory. That's because MSI-X table was put in the region and we have to intercept it. Signed-off-by: Sheng Yang --- qemu/hw/device-assignment.c | 287 ++- qemu/hw/d

[PATCH 2/3] kvm: add ioctl KVM_SET_MSIX_ENTRY_NR and KVM_SET_MSIX_ENTRY

2009-02-11 Thread Sheng Yang
Signed-off-by: Sheng Yang --- libkvm/libkvm.c | 25 + libkvm/libkvm.h |7 +++ 2 files changed, 32 insertions(+), 0 deletions(-) diff --git a/libkvm/libkvm.c b/libkvm/libkvm.c index b4433bd..ef0066a 100644 --- a/libkvm/libkvm.c +++ b/libkvm/libkvm.c @@ -1342,3

Re: [PATCH 3/3] KVM: Enable MSI-X for KVM assigned device

2009-02-11 Thread Sheng Yang
On Wednesday 11 February 2009 20:48:55 Avi Kivity wrote: > Sheng Yang wrote: > > This patch finally enable MSI-X. > > > > What we need for MSI-X: > > 1. Intercept one page in MMIO region of device. So that we can get guest > > desired MSI-X table and set up the rea

Re: [PATCH 1/3] KVM: Ioctls for init MSI-X entry

2009-02-11 Thread Sheng Yang
On Wednesday 11 February 2009 20:44:57 Avi Kivity wrote: > Sheng Yang wrote: > > Introduce KVM_SET_MSIX_NR and KVM_SET_MSIX_ENTRY two ioctls. > > > > This two ioctls are used by userspace to specific guest device MSI-X > > entry number and correlate MSI-X entry with GS

[PATCH 1/3] KVM: Ioctls for init MSI-X entry

2009-02-12 Thread Sheng Yang
entry number for now. Signed-off-by: Sheng Yang --- include/linux/kvm.h | 15 +++ include/linux/kvm_host.h |3 + virt/kvm/kvm_main.c | 101 ++ 3 files changed, 119 insertions(+), 0 deletions(-) diff --git a/include/linux/kvm.h b/in

[PATCH 3/3] kvm: enable MSI-X capabilty for assigned device

2009-02-12 Thread Sheng Yang
The most important part here, is we emulate a page of MMIO region using a page of memory. That's because MSI-X table was put in the region and we have to intercept it. Signed-off-by: Sheng Yang --- qemu/hw/device-assignment.c | 286 ++- qemu/hw/d

[PATCH 3/3] kvm: enable MSI-X capabilty for assigned device

2009-02-12 Thread Sheng Yang
The most important part here, is we emulate a page of MMIO region using a page of memory. That's because MSI-X table was put in the region and we have to intercept it. Signed-off-by: Sheng Yang --- qemu/hw/device-assignment.c | 286 ++- qemu/hw/d

Re: [PATCH 2/3] KVM: Add gsi_msg_pending_bitmap for MSI-X

2009-02-12 Thread Sheng Yang
On Friday 13 February 2009 03:51:18 Marcelo Tosatti wrote: > Hi Sheng, > > On Wed, Feb 11, 2009 at 04:08:50PM +0800, Sheng Yang wrote: > > We have to handle more than one interrupt with one handler for MSI-X. So > > we need a bitmap to track the triggered interrupts. > &g

Re: [PATCH 3/3] KVM: Enable MSI-X for KVM assigned device

2009-02-12 Thread Sheng Yang
On Friday 13 February 2009 04:40:05 Marcelo Tosatti wrote: > On Wed, Feb 11, 2009 at 04:08:51PM +0800, Sheng Yang wrote: > > This patch finally enable MSI-X. > > > > What we need for MSI-X: > > 1. Intercept one page in MMIO region of device. So that we can get guest >

[PATCH 1/3] KVM: Ioctls for init MSI-X entry

2009-02-15 Thread Sheng Yang
entry number for now. Signed-off-by: Sheng Yang --- include/linux/kvm.h | 16 +++ include/linux/kvm_host.h |3 + virt/kvm/kvm_main.c | 103 ++ 3 files changed, 122 insertions(+), 0 deletions(-) diff --git a/include/linux/kvm.h b/in

[PATCH 1/3] KVM: Ioctls for init MSI-X entry

2009-02-15 Thread Sheng Yang
pport change MSI-X entry number for now. Signed-off-by: Sheng Yang --- include/linux/kvm.h | 16 +++ include/linux/kvm_host.h |3 + virt/kvm/kvm_main.c | 103 ++ 3 files changed, 122 insertions(+), 0 deletions(-) diff --git a/in

Re: [PATCH 1/3] KVM: Ioctls for init MSI-X entry

2009-02-16 Thread Sheng Yang
On Tuesday 17 February 2009 07:23:23 Marcelo Tosatti wrote: > On Mon, Feb 16, 2009 at 01:49:29PM +0800, Sheng Yang wrote: > > (oops... fix a typo) > > > > Introduce KVM_SET_MSIX_NR and KVM_SET_MSIX_ENTRY two ioctls. > > > > This two ioctls are used by userspa

[PATCH 1/3] KVM: Ioctls for init MSI-X entry

2009-02-16 Thread Sheng Yang
entry number for now. Signed-off-by: Sheng Yang --- include/linux/kvm.h | 16 +++ include/linux/kvm_host.h |3 + virt/kvm/kvm_main.c | 103 ++ 3 files changed, 122 insertions(+), 0 deletions(-) diff --git a/include/linux/kvm.h b/in

Re: [PATCH 2/3] KVM: Add gsi_msg_pending_bitmap for MSI-X

2009-02-17 Thread Sheng Yang
On Wednesday 18 February 2009 02:09:49 Avi Kivity wrote: > Sheng Yang wrote: > >>> + if (assigned_dev->irq_requested_type == KVM_ASSIGNED_DEV_MSIX) { > >>> + u32 gsi; > >>> + gsi = find_gsi_from_host_irq(assign

[PATCH 0/3 v3] MSI-X enabling

2009-02-18 Thread Sheng Yang
Updated the patchset followed Marcelo and Avi's comments. Please also review MSI/MSI-X userspace patch as well. Thanks! -- regards Yang, Sheng -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vge

[PATCH 3/3] KVM: Enable MSI-X for KVM assigned device

2009-02-18 Thread Sheng Yang
idn't implement MSI-X mask all and mask single entry. I would implement the former in driver/pci/msi.c later. And for single entry, userspace should have reposibility to handle it. Signed-off-by: Sheng Yang --- include/linux/kvm.h |8 virt/k

[PATCH 2/3] KVM: Add gsi_msg_pending_bitmap for MSI-X

2009-02-18 Thread Sheng Yang
We have to handle more than one interrupt with one handler for MSI-X. So we need a bitmap to track the triggered interrupts. Signed-off-by: Sheng Yang --- include/linux/kvm_host.h |5 +- virt/kvm/kvm_main.c | 102 - 2 files changed, 102

[PATCH 1/3] KVM: Ioctls for init MSI-X entry

2009-02-18 Thread Sheng Yang
entry number for now. Signed-off-by: Sheng Yang --- include/linux/kvm.h | 16 +++ include/linux/kvm_host.h |3 + virt/kvm/kvm_main.c | 103 ++ 3 files changed, 122 insertions(+), 0 deletions(-) diff --git a/include/linux/kvm.h b/in

Re: [PATCH 2/3] KVM: Add gsi_msg_pending_bitmap for MSI-X

2009-02-18 Thread Sheng Yang
On Wednesday 18 February 2009 19:00:53 Avi Kivity wrote: > Sheng Yang wrote: > > We have to handle more than one interrupt with one handler for MSI-X. So > > we need a bitmap to track the triggered interrupts. > > Can you explain why? Or how can we know which interrupt

Re: [PATCH 2/3] KVM: Add gsi_msg_pending_bitmap for MSI-X

2009-02-18 Thread Sheng Yang
On Wednesday 18 February 2009 19:29:28 Avi Kivity wrote: > Sheng Yang wrote: > > On Wednesday 18 February 2009 19:00:53 Avi Kivity wrote: > >> Sheng Yang wrote: > >>> We have to handle more than one interrupt with one handler for MSI-X. > >>> So we need

Re: [PATCH 3/3] KVM: Enable MSI-X for KVM assigned device

2009-02-18 Thread Sheng Yang
On Wed, Feb 18, 2009 at 10:45:19AM +, Avi Kivity wrote: > Sheng Yang wrote: >> index a2dfbe0..78480d0 100644 >> --- a/include/linux/kvm.h >> +++ b/include/linux/kvm.h >> @@ -440,6 +440,9 @@ struct kvm_irq_routing { >> }; >> #endif >> +#if define

Re: [PATCH 3/3] KVM: Enable MSI-X for KVM assigned device

2009-02-18 Thread Sheng Yang
On Wednesday 18 February 2009 20:36:10 Avi Kivity wrote: > Sheng Yang wrote: > >>> struct kvm_assigned_msix_nr { > >>> __u32 assigned_dev_id; > >>> __u16 entry_nr; > >>> diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c > >>>

[PATCH 0/3 v4] MSI-X enabling

2009-02-18 Thread Sheng Yang
-- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html

[PATCH 2/4] KVM: Ioctls for init MSI-X entry

2009-02-18 Thread Sheng Yang
entry number for now. Signed-off-by: Sheng Yang --- include/linux/kvm.h | 18 include/linux/kvm_host.h | 10 virt/kvm/kvm_main.c | 104 ++ 3 files changed, 132 insertions(+), 0 deletions(-) diff --git a/include/linux/kv

[PATCH 3/4] KVM: Add MSI-X interrupt injection logic

2009-02-18 Thread Sheng Yang
We have to handle more than one interrupt with one handler for MSI-X. Avi suggested to use a flag to indicate the pending. So here is it. Signed-off-by: Sheng Yang --- include/linux/kvm_host.h |1 + virt/kvm/kvm_main.c | 66 +- 2 files

[PATCH 4/4] KVM: Enable MSI-X for KVM assigned device

2009-02-18 Thread Sheng Yang
idn't implement MSI-X mask all and mask single entry. I would implement the former in driver/pci/msi.c later. And for single entry, userspace should have reposibility to handle it. Signed-off-by: Sheng Yang --- arch/x86/include/asm/kvm.h |1 + include/linux/kvm.h|8

[PATCH 1/4] KVM: Fix wrong usage of _IOR in assigned device interface

2009-02-18 Thread Sheng Yang
_IOR for copy_to_user and _IOW for copy_from_user... Noticed by Avi. Signed-off-by: Sheng Yang --- include/linux/kvm.h |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/include/linux/kvm.h b/include/linux/kvm.h index 2163b3d..d742cbf 100644 --- a/include/linux/kvm.h

Re: [PATCH 1/4] KVM: Fix wrong usage of _IOR in assigned device interface

2009-02-19 Thread Sheng Yang
On Wednesday 18 February 2009 22:44:15 Avi Kivity wrote: > Sheng Yang wrote: > > _IOR for copy_to_user and _IOW for copy_from_user... > > > > Noticed by Avi. > > > > Signed-off-by: Sheng Yang > > --- > > include/linux/kvm.h |4 ++-- >

[PATCH 2/5] KVM: Unified the delivery of IOAPIC and MSI

2009-02-25 Thread Sheng Yang
Signed-off-by: Sheng Yang --- include/linux/kvm_host.h |3 + virt/kvm/ioapic.c| 92 virt/kvm/irq_comm.c | 95 +++-- 3 files changed, 94 insertions(+), 96 deletions(-) diff --git a/include

[PATCH 1/5] KVM: Split IOAPIC structure

2009-02-25 Thread Sheng Yang
Prepared for reuse ioapic_redir_entry for MSI. Signed-off-by: Sheng Yang --- include/linux/kvm_types.h | 17 + virt/kvm/ioapic.c |6 +++--- virt/kvm/ioapic.h | 17 + 3 files changed, 21 insertions(+), 19 deletions(-) diff --git a/include

[PATCH 4/5] KVM: Update intr delivery func to accept unsigned long* bitmap

2009-02-25 Thread Sheng Yang
Would be used with bit ops, and would be easily extended if KVM_MAX_VCPUS is increased. Signed-off-by: Sheng Yang --- arch/x86/kvm/lapic.c |8 include/linux/kvm_host.h |2 +- virt/kvm/ioapic.c|4 ++-- virt/kvm/ioapic.h|4 ++-- virt/kvm/irq_comm.c

[PATCH 5/5] KVM: bit ops for deliver_bitmap

2009-02-25 Thread Sheng Yang
It's also convenient when we extend KVM supported vcpu number in the future. Signed-off-by: Sheng Yang --- arch/x86/kvm/lapic.c |7 --- virt/kvm/ioapic.c| 25 ++--- virt/kvm/irq_comm.c | 21 - 3 files changed, 30 insertions(+

[PATCH 0/5 v9] Optimize and unify IOAPIC/MSI delivery

2009-02-25 Thread Sheng Yang
Rebased on latest upstream. The changes are "Report IRQ injection status" related in the second patch. The v8 was acked by Marcelo Tosatti. Thanks. -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to majord...@vger.kernel.org More majordomo info at http:

[PATCH 3/5] KVM: Change API of kvm_ioapic_get_delivery_bitmask

2009-02-25 Thread Sheng Yang
In order to use with bit ops. Signed-off-by: Sheng Yang --- virt/kvm/ioapic.c | 17 - virt/kvm/ioapic.h |4 ++-- virt/kvm/irq_comm.c |5 +++-- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/virt/kvm/ioapic.c b/virt/kvm/ioapic.c index d273013

[PATCH 0/3 v4][Resend] MSI-X enabling

2009-02-25 Thread Sheng Yang
Drop the first patch which corrected ABI error. -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html

[PATCH 2/3] KVM: Add MSI-X interrupt injection logic

2009-02-25 Thread Sheng Yang
We have to handle more than one interrupt with one handler for MSI-X. Avi suggested to use a flag to indicate the pending. So here is it. Signed-off-by: Sheng Yang --- include/linux/kvm_host.h |1 + virt/kvm/kvm_main.c | 66 +- 2 files

[PATCH 3/3] KVM: Enable MSI-X for KVM assigned device

2009-02-25 Thread Sheng Yang
idn't implement MSI-X mask all and mask single entry. I would implement the former in driver/pci/msi.c later. And for single entry, userspace should have reposibility to handle it. Signed-off-by: Sheng Yang --- arch/x86/include/asm/kvm.h |1 + include/linux/kvm.h|8

[PATCH 1/3] KVM: Ioctls for init MSI-X entry

2009-02-25 Thread Sheng Yang
entry number for now. Signed-off-by: Sheng Yang --- include/linux/kvm.h | 18 include/linux/kvm_host.h | 10 virt/kvm/kvm_main.c | 104 ++ 3 files changed, 132 insertions(+), 0 deletions(-) diff --git a/include/linux/kv

Re: [patch 0/3] unify hrtimer handler

2009-02-25 Thread Sheng Yang
On Monday 23 February 2009 21:57:38 Marcelo Tosatti wrote: > -- The patches look good to me. ACK. -- regards Yang, Sheng -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/major

Re: [PATCH 0/5 v9] Optimize and unify IOAPIC/MSI delivery

2009-02-25 Thread Sheng Yang
On Wednesday 25 February 2009 18:44:41 Avi Kivity wrote: > >> Rebased on latest upstream. The changes are "Report IRQ injection > >> status" > >> related in the second patch. > >> > >> The v8 was acked by Marcelo Tosatti. > > > > I just merged this (and resolved all the conflicts...). I'll see if

Re: [PATCH] use bitmap ops on a bitmap instead of bit ops

2009-02-26 Thread Sheng Yang
On Thursday 26 February 2009 21:03:39 Gleb Natapov wrote: > And don't zero bitmap twice. Assume that caller zeros it. > > Signed-off-by: Gleb Natapov > diff --git a/virt/kvm/ioapic.c b/virt/kvm/ioapic.c > index 7c2cb2b..21627b9 100644 > --- a/virt/kvm/ioapic.c > +++ b/virt/kvm/ioapic.c > @@ -170,1

[PATCH 1/1] KVM: Correct deliver_bitmask in kvm_get_intr_delivery_bitmask

2009-02-26 Thread Sheng Yang
1. deliver_bitmask is a bitmap rather than a unsigned long intereger. 2. Lowest priority target bitmap wrong calculated by mistake. 3. Prevent potential NULL reference. Signed-off-by: Sheng Yang --- virt/kvm/irq_comm.c |6 +- 1 files changed, 5 insertions(+), 1 deletions(-) diff --git

Re: [PATCH] use bitmap ops on a bitmap instead of bit ops

2009-03-01 Thread Sheng Yang
On Friday 27 February 2009 21:26:58 Gleb Natapov wrote: > On Fri, Feb 27, 2009 at 11:19:09AM +0800, Sheng Yang wrote: > > > - *mask = 0; > > > > I think the caller should not assume anything about the output, so let > > function itself do the clean is better.

Re: [PATCH 1/1] KVM: Correct deliver_bitmask in kvm_get_intr_delivery_bitmask

2009-03-01 Thread Sheng Yang
On Monday 02 March 2009 15:12:52 Gleb Natapov wrote: > On Fri, Feb 27, 2009 at 12:58:55PM +0800, Sheng Yang wrote: > > 1. deliver_bitmask is a bitmap rather than a unsigned long intereger. > > 2. Lowest priority target bitmap wrong calculated by mistake. > > 3. Prevent pot

[PATCH] KVM: Merge kvm_ioapic_get_delivery_bitmask into kvm_get_intr_delivery_bitmask

2009-03-02 Thread Sheng Yang
. Prevent potential NULL reference. 4. Declaration in include/kvm_host.h caused powerpc compilation warning. Signed-off-by: Gleb Natapov Signed-off-by: Sheng Yang --- include/linux/kvm_host.h |3 --- virt/kvm/ioapic.c| 39 --- virt/kvm/ioapic.h

[PATCH 02/10] Make device assignment depend on libpci

2009-03-02 Thread Sheng Yang
Which is used later for capability detection. Signed-off-by: Sheng Yang --- qemu/Makefile.target |1 + qemu/configure | 20 2 files changed, 21 insertions(+), 0 deletions(-) diff --git a/qemu/Makefile.target b/qemu/Makefile.target index efcbe0a..5b6fad4 100644

[PATCH 01/10] kvm: Replace force type convert with container_of()

2009-03-02 Thread Sheng Yang
Signed-off-by: Sheng Yang --- qemu/hw/device-assignment.c | 20 1 files changed, 12 insertions(+), 8 deletions(-) diff --git a/qemu/hw/device-assignment.c b/qemu/hw/device-assignment.c index b7cbcec..c9a3b8e 100644 --- a/qemu/hw/device-assignment.c +++ b/qemu/hw/device

[PATCH 04/10] Support for device capability

2009-03-02 Thread Sheng Yang
This framework can be easily extended to support device capability, like MSI/MSI-x. Signed-off-by: Sheng Yang --- qemu/hw/pci.c | 85 + qemu/hw/pci.h | 30 2 files changed, 115 insertions(+), 0 deletions(-) diff

[PATCH 05/10] kvm: user interface for MSI type irq routing

2009-03-02 Thread Sheng Yang
Signed-off-by: Sheng Yang --- libkvm/libkvm.c | 98 --- libkvm/libkvm.h | 22 2 files changed, 101 insertions(+), 19 deletions(-) diff --git a/libkvm/libkvm.c b/libkvm/libkvm.c index 0ac1c28..050eacd 100644 --- a/libkvm

[PATCH 09/10] kvm: add ioctl KVM_SET_MSIX_ENTRY_NR and KVM_SET_MSIX_ENTRY

2009-03-02 Thread Sheng Yang
Signed-off-by: Sheng Yang --- libkvm/libkvm.c | 25 + libkvm/libkvm.h |7 +++ 2 files changed, 32 insertions(+), 0 deletions(-) diff --git a/libkvm/libkvm.c b/libkvm/libkvm.c index 58ac995..bec1d4a 100644 --- a/libkvm/libkvm.c +++ b/libkvm/libkvm.c @@ -1369,3

[PATCH 10/10] kvm: enable MSI-X capabilty for assigned device

2009-03-02 Thread Sheng Yang
The most important part here, is we emulate a page of MMIO region using a page of memory. That's because MSI-X table was put in the region and we have to intercept it. Signed-off-by: Sheng Yang --- qemu/hw/device-assignment.c | 286 ++- qemu/hw/d

[PATCH 03/10] Figure out device capability

2009-03-02 Thread Sheng Yang
: Sheng Yang --- qemu/hw/device-assignment.c | 29 + qemu/hw/device-assignment.h |1 + 2 files changed, 30 insertions(+), 0 deletions(-) diff --git a/qemu/hw/device-assignment.c b/qemu/hw/device-assignment.c index c9a3b8e..fc05ac7 100644 --- a/qemu/hw/device

[PATCH 0/10 v4] MSI/MSI-X capability in userspace

2009-03-02 Thread Sheng Yang
OK, just resend the patchset... Patch 1-4 is a frame work for capability report in QEmu. Patch 5-7 is to expose MSI capability to the guest. Patch 8-10 is to expose MSI-X capability to the guest. I know it's huge, comments are welcome! Thanks! -- To unsubscribe from this list: send the line "u

[PATCH 08/10] Add MSI-X related macro to pci.c

2009-03-02 Thread Sheng Yang
Signed-off-by: Sheng Yang --- qemu/hw/pci.h |1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/qemu/hw/pci.h b/qemu/hw/pci.h index 7f3548b..0d988da 100644 --- a/qemu/hw/pci.h +++ b/qemu/hw/pci.h @@ -192,6 +192,7 @@ typedef struct PCIIORegion { #define

[PATCH 06/10] kvm: libkvm: allocate unused gsi for irq routing

2009-03-02 Thread Sheng Yang
Notice here is a simple solution, can be replaced later. Signed-off-by: Sheng Yang --- libkvm/kvm-common.h |1 + libkvm/libkvm.c | 10 ++ libkvm/libkvm.h |8 3 files changed, 19 insertions(+), 0 deletions(-) diff --git a/libkvm/kvm-common.h b/libkvm/kvm

[PATCH 07/10] kvm: expose MSI capability to guest

2009-03-02 Thread Sheng Yang
Signed-off-by: Sheng Yang --- qemu/hw/device-assignment.c | 112 --- qemu/hw/device-assignment.h |7 +++ 2 files changed, 112 insertions(+), 7 deletions(-) diff --git a/qemu/hw/device-assignment.c b/qemu/hw/device-assignment.c index fc05ac7..089c5b7

Re: [PATCH] use bitmap ops on a bitmap instead of bit ops

2009-03-02 Thread Sheng Yang
On Monday 02 March 2009 15:12:00 Sheng Yang wrote: > On Friday 27 February 2009 21:26:58 Gleb Natapov wrote: > > On Fri, Feb 27, 2009 at 11:19:09AM +0800, Sheng Yang wrote: > > > > - *mask = 0; > > > > > > I think the caller should not assume anything

[PATCH] KVM: Fix assigned device with no irq

2009-03-02 Thread Sheng Yang
Some device like VF of SRIOV only support MSI-X. With this patch, SRIOV can be enabled with KVM assigned device(all kernel space patches are ready). Signed-off-by: Sheng Yang --- virt/kvm/kvm_main.c |9 ++--- 1 files changed, 6 insertions(+), 3 deletions(-) diff --git a/virt/kvm

[PATCH 1/1] kvm: fix irq 0 assignment

2009-03-02 Thread Sheng Yang
Shouldn't update assigned irq if host irq is 0, which means uninitialized or don't support INTx. Signed-off-by: Sheng Yang --- qemu/hw/device-assignment.c |4 1 files changed, 4 insertions(+), 0 deletions(-) diff --git a/qemu/hw/device-assignment.c b/qemu/hw/device-assignme

Re: [PATCH 1/1] kvm: fix irq 0 assignment

2009-03-03 Thread Sheng Yang
On Tuesday 03 March 2009 15:54:09 Sheng Yang wrote: > Shouldn't update assigned irq if host irq is 0, which means uninitialized > or don't support INTx. Withdraw this, another problems shows... -- regards Yang, Sheng > > Signed-off-by: Sheng Yang > --- > qemu/h

Re: [PATCH] KVM: Fix assigned device with no irq

2009-03-03 Thread Sheng Yang
On Tuesday 03 March 2009 15:49:19 Sheng Yang wrote: > Some device like VF of SRIOV only support MSI-X. > > With this patch, SRIOV can be enabled with KVM assigned device(all kernel > space patches are ready). > Withdraw this as well. -- regards Yang, Sheng > Signed-

[PATCH] KVM: Fix assigned device with no irq

2009-03-03 Thread Sheng Yang
Some device like VF of SRIOV only support MSI-X. With this patch, SRIOV can be enabled with KVM assigned device(all kernel space patches are ready). Signed-off-by: Sheng Yang --- virt/kvm/kvm_main.c | 14 ++ 1 files changed, 10 insertions(+), 4 deletions(-) diff --git a/virt/kvm

<    5   6   7   8   9   10   11   >