[PATCH 1/3] KVM: Add MSI_ACTION flag for assigned irq

2008-12-29 Thread Sheng Yang
For MSI disable feature later. Notice I changed ABI here, but due to no userspace patch, I think it's OK. Signed-off-by: Sheng Yang --- include/linux/kvm.h |3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/include/linux/kvm.h b/include/linux/kvm.h index 42

[PATCH 3/3] KVM: Add support to disable MSI for assigned device

2008-12-29 Thread Sheng Yang
MSI is always enabled by default for msi2intx=1. But if msi2intx=0, we have to disable MSI if guest require to do so. The patch also discard unnecessary msi2intx judgment if guest want to update MSI state. Signed-off-by: Sheng Yang --- virt/kvm/kvm_main.c | 12 ++-- 1 files changed

[PATCH 2/3] KVM: Use kvm_free_assigned_irq() for free irq

2008-12-29 Thread Sheng Yang
Which is more convenient... Signed-off-by: Sheng Yang --- virt/kvm/kvm_main.c | 10 ++ 1 files changed, 2 insertions(+), 8 deletions(-) diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c index ffd261d..cd84b3e 100644 --- a/virt/kvm/kvm_main.c +++ b/virt/kvm/kvm_main.c @@ -284,11

[PATCH 0/10][v3] GSI->MSG route layer for MSI/MSI-X

2008-12-29 Thread Sheng Yang
Update from v2: Add gsi_msg_pending_bitmap, in order to support MSI-X mutiply interrupts. And this one depends on the former "Device assignment code clean up and MSI disable support" patchset. -- regards Yang, Sheng -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of

[PATCH 03/10] KVM: Improve MSI dispatch function

2008-12-29 Thread Sheng Yang
Prepare to merge with kvm_set_irq(). Signed-off-by: Sheng Yang --- virt/kvm/kvm_main.c |8 1 files changed, 4 insertions(+), 4 deletions(-) diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c index 3494861..599257e 100644 --- a/virt/kvm/kvm_main.c +++ b/virt/kvm/kvm_main.c

[PATCH 04/10] KVM: Using ioapic_irqchip() macro for kvm_set_irq

2008-12-29 Thread Sheng Yang
Signed-off-by: Sheng Yang --- virt/kvm/irq_comm.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/virt/kvm/irq_comm.c b/virt/kvm/irq_comm.c index abfab46..47243ef 100644 --- a/virt/kvm/irq_comm.c +++ b/virt/kvm/irq_comm.c @@ -39,7 +39,7 @@ void kvm_set_irq(struct kvm

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

2008-12-29 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 | 16 3 files changed, 25 insertions(+), 22 dele

[PATCH 08/10] KVM: Change API of kvm_ioapic_get_delivery_bitmask

2008-12-29 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 af9f5de

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

2008-12-29 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 01/10] KVM: Add a route layer to convert MSI message to GSI

2008-12-29 Thread Sheng Yang
ovide two ioctls to userspace, which is more flexiable. Signed-off-by: Sheng Yang --- include/linux/kvm.h | 14 + include/linux/kvm_host.h | 16 ++ virt/kvm/irq_comm.c | 70 ++ virt/kvm/kvm_main.c |

[PATCH 06/10] KVM: Split IOAPIC structure

2008-12-29 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 05/10] KVM: Merge MSI handling to kvm_set_irq

2008-12-29 Thread Sheng Yang
Using kvm_set_irq to handle all interrupt injection. Signed-off-by: Sheng Yang --- include/linux/kvm_host.h |2 +- virt/kvm/irq_comm.c | 98 +++--- virt/kvm/kvm_main.c | 77 +++- 3 files changed, 90

[PATCH 02/10] KVM: Using gsi_msg mapping for MSI device assignment

2008-12-29 Thread Sheng Yang
Convert MSI userspace interface to support gsi_msg mapping(and nobody should be the user of the old interface...). Signed-off-by: Sheng Yang --- include/linux/kvm_host.h |1 - virt/kvm/kvm_main.c | 35 ++- 2 files changed, 22 insertions(+), 14

[PATCH 07/10] KVM: Unified the delivery of IOAPIC and MSI

2008-12-29 Thread Sheng Yang
Signed-off-by: Sheng Yang --- include/linux/kvm_host.h |3 ++ virt/kvm/ioapic.c| 84 +- virt/kvm/irq_comm.c | 75 3 files changed, 79 insertions(+), 83 deletions(-) diff --git a/include

Re: [PATCH 0/10][v3] GSI->MSG route layer for MSI/MSI-X

2008-12-29 Thread Sheng Yang
On Tuesday 30 December 2008 13:55:52 Sheng Yang wrote: > Update from v2: > Add gsi_msg_pending_bitmap, in order to support MSI-X mutiply interrupts. > > And this one depends on the former "Device assignment code clean up and MSI > disable support" patchset. > Sor

[Patch 0/3][v2] Userspace for MSI-X

2008-12-29 Thread Sheng Yang
Change from v2: Move MMIO intercepting to userspace, and add two new ioctls. For kernel space MSI-X depends on lots of related patch I sent before, this time I kept it and wait for others to be checked in. Please help to review, thanks. -- regards Yang, Sheng -- To unsubscribe from this list: se

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

2008-12-29 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 f2a622c..22c5de1 100644 --- a/qemu/hw/pci.h +++ b/qemu/hw/pci.h @@ -87,6 +87,7 @@ typedef struct PCIIORegion { #define

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

2008-12-29 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 | 275 ++- qemu/hw/d

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

2008-12-29 Thread Sheng Yang
Signed-off-by: Sheng Yang --- libkvm/libkvm.c | 26 ++ libkvm/libkvm.h |6 ++ 2 files changed, 32 insertions(+), 0 deletions(-) diff --git a/libkvm/libkvm.c b/libkvm/libkvm.c index ddcc929..ad218e1 100644 --- a/libkvm/libkvm.c +++ b/libkvm/libkvm.c @@ -1171,3

Re: [PATCH 1/3] KVM: Add MSI_ACTION flag for assigned irq

2008-12-30 Thread Sheng Yang
On Tuesday 30 December 2008 18:19:29 Avi Kivity wrote: > Sheng Yang wrote: > > For MSI disable feature later. > > > > Notice I changed ABI here, but due to no userspace patch, I think it's > > OK. > > It's not okay, since eventually we will have user

Re: [PATCH 1/3] KVM: Add MSI_ACTION flag for assigned irq

2008-12-30 Thread Sheng Yang
On Tuesday 30 December 2008 18:31:16 Avi Kivity wrote: > Sheng Yang wrote: > > On Tuesday 30 December 2008 18:19:29 Avi Kivity wrote: > >> Sheng Yang wrote: > >>> For MSI disable feature later. > >>> > >>> Notice I changed ABI here

Re: [PATCH 1/3] KVM: Add MSI_ACTION flag for assigned irq

2008-12-30 Thread Sheng Yang
On Tuesday 30 December 2008 18:41:54 Avi Kivity wrote: > Sheng Yang wrote: > >>> MASK_MSIX, and UNMASK, every two action are in pairs but we have to use > >>> twice bits to store them. So I'd like to use MSI_ACTION approach... > >> > >> Well, it y

Re: [PATCH 05/10] KVM: Merge MSI handling to kvm_set_irq

2008-12-30 Thread Sheng Yang
On Tuesday 30 December 2008 18:48:42 Avi Kivity wrote: > Sheng Yang wrote: > > Using kvm_set_irq to handle all interrupt injection. > > > > > > /* This should be called with the kvm->lock mutex held */ > > -void kvm_set_irq(struct kvm *kvm, int irq_sour

Re: [PATCH 2/3] KVM: Use kvm_free_assigned_irq() for free irq

2008-12-30 Thread Sheng Yang
On Tuesday 30 December 2008 19:16:27 Avi Kivity wrote: > Sheng Yang wrote: > >> This will call cancel_work_sync(), which may wait upon kvm->lock, which > >> I think we hold here -> deadlock. > >> > >> I think that the current code has even bigger prob

Re: [PATCH 2/3] KVM: Use kvm_free_assigned_irq() for free irq

2008-12-30 Thread Sheng Yang
On Tuesday 30 December 2008 18:28:21 Avi Kivity wrote: > Sheng Yang wrote: > > Which is more convenient... > > > > Signed-off-by: Sheng Yang > > --- > > virt/kvm/kvm_main.c | 10 ++ > > 1 files changed, 2 insertions(+), 8 deletions(-) > > &g

Re: [PATCH 05/10] KVM: Merge MSI handling to kvm_set_irq

2008-12-30 Thread Sheng Yang
On Tuesday 30 December 2008 19:07:52 Avi Kivity wrote: > Sheng Yang wrote: > >>> + mutex_lock(&kvm->gsi_msg_lock); > >> > >> The lock is already taken here? > > > > Um? For gsi_msg_lock? > > Sorry, my mistake. Will have to get used to all

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

2008-12-30 Thread Sheng Yang
On Tuesday 30 December 2008 14:29:32 Sheng Yang wrote: > 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. > Found some issues, would update this later.

[PATCH 0/3] Fix racy in kvm_free_assigned_irq

2008-12-30 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/3] KVM: Add kvm_arch_sync_events to sync with asynchronize events

2008-12-30 Thread Sheng Yang
a environment to quiet down other events. Signed-off-by: Sheng Yang --- arch/ia64/kvm/kvm-ia64.c |4 arch/powerpc/kvm/powerpc.c |4 arch/s390/kvm/kvm-s390.c |4 arch/x86/kvm/x86.c |4 include/linux/kvm_host.h |1 + virt/kvm/kvm_main.c

[PATCH 3/3] KVM: Fix racy in kvm_free_assigned_irq

2008-12-30 Thread Sheng Yang
r and interrupt_work, and ensure the legal state by moving the free function at the very beginning of kvm_destroy_vm(). And the patch fix the second bug by disable irq before cancel_work_sync(), which may result in nested disable of irq but OK for we are going to free it. Signed-off-by: Sheng Yang --- arc

[PATCH 1/3] KVM: Remove duplicated prototype of kvm_arch_destroy_vm

2008-12-30 Thread Sheng Yang
Signed-off-by: Sheng Yang --- include/linux/kvm_host.h |1 - 1 files changed, 0 insertions(+), 1 deletions(-) diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h index d63e9a4..76cc371 100644 --- a/include/linux/kvm_host.h +++ b/include/linux/kvm_host.h @@ -237,7 +237,6 @@ int

Re: [PATCH 15/15] KVM: Fix racy in kvm_free_assigned_irq

2008-12-30 Thread Sheng Yang
On Wednesday 31 December 2008 00:45:51 Marcelo Tosatti wrote: > On Tue, Dec 30, 2008 at 10:14:09AM +0800, Sheng Yang wrote: > > > There is one remaining issue: kvm_assigned_dev_interrupt_work_handler > > > can re-enable the interrupt for KVM_ASSIGNED_DEV_GUEST_MSI case. >

Re: [PATCH 2/3] KVM: Interrupt mask notifiers for ioapic

2009-01-04 Thread Sheng Yang
On Monday 05 January 2009 00:14:44 Avi Kivity wrote: > Allow clients to request notifications when the guest masks or unmasks a > particular irq line. This complements irq ack notifications, as the guest > will not ack an irq line that is masked. > > Currently implemented for the ioapic only. Hi

Re: [PATCH 15/15] KVM: Fix racy in kvm_free_assigned_irq

2009-01-04 Thread Sheng Yang
On Friday 02 January 2009 08:10:37 Marcelo Tosatti wrote: > On Wed, Dec 31, 2008 at 01:43:54PM +0800, Sheng Yang wrote: > > On Wednesday 31 December 2008 00:45:51 Marcelo Tosatti wrote: > > > On Tue, Dec 30, 2008 at 10:14:09AM +0800, Sheng Yang wrote: > > > >

Re: [PATCH 15/15] KVM: Fix racy in kvm_free_assigned_irq

2009-01-05 Thread Sheng Yang
On Monday 05 January 2009 21:27:00 Avi Kivity wrote: > Sheng Yang wrote: > > So Avi, can you check in the patchset? > > I had some comments about simplifying the userspace interface (or is > that another patchset?) Oh, I means another patchset while Marcelo reply to the old thr

[PATCH 3/3] KVM: Fix racy in kvm_free_assigned_irq

2009-01-05 Thread Sheng Yang
r and interrupt_work, and ensure the legal state by moving the free function at the very beginning of kvm_destroy_vm(). And the patch fix the second bug by disable irq before cancel_work_sync(), which may result in nested disable of irq but OK for we are going to free it. Signed-off-by: Sheng Yang --- arc

[PATCH 2/3] KVM: Add kvm_arch_sync_events to sync with asynchronize events

2009-01-05 Thread Sheng Yang
a environment to quiet down other events. Signed-off-by: Sheng Yang --- arch/ia64/kvm/kvm-ia64.c |4 arch/powerpc/kvm/powerpc.c |4 arch/s390/kvm/kvm-s390.c |4 arch/x86/kvm/x86.c |4 include/linux/kvm_host.h |1 + virt/kvm/kvm_main.c

[PATCH 1/3] KVM: Remove duplicated prototype of kvm_arch_destroy_vm

2009-01-05 Thread Sheng Yang
Signed-off-by: Sheng Yang --- include/linux/kvm_host.h |1 - 1 files changed, 0 insertions(+), 1 deletions(-) diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h index 545a133..dab985b 100644 --- a/include/linux/kvm_host.h +++ b/include/linux/kvm_host.h @@ -237,7 +237,6 @@ int

[PATCH 0/3][v2] Fix racy in kvm_free_assigned_irq

2009-01-05 Thread Sheng Yang
Hi Avi I just add a comment for kvm_free_assigned_irq(). The other things are all the same as the patchset you have reviewed. 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

[PATCH 1/2] KVM: Fix INTx for device assignment

2009-01-06 Thread Sheng Yang
Missing buckets and wrong parameter for free_irq() Signed-off-by: Sheng Yang --- virt/kvm/kvm_main.c |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c index 7a102d7..213bb91 100644 --- a/virt/kvm/kvm_main.c +++ b/virt/kvm

[PATCH 2/2] KVM: Add support to disable MSI for assigned device

2009-01-06 Thread Sheng Yang
operations, though we only got one for now. Signed-off-by: Sheng Yang --- include/linux/kvm.h |1 + virt/kvm/kvm_main.c | 18 -- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/include/linux/kvm.h b/include/linux/kvm.h index 4ec359e..71c150f 100644 --- a/include

[PATCH 00/02][v2] Support for disable MSI

2009-01-06 Thread Sheng Yang
Change from v2: Discard first two patches, instead fix bugs in update_intx(). Finally, I purpose to use kvm_free_assigned_irq(), but before that, I think I have to split kvm->lock due to cancel_work_sync() implicit need kvm->lock. So leave it a little later. -- include/linux/kvm.h |1 + virt/

[PATCH 07/10] KVM: Unified the delivery of IOAPIC and MSI

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

[PATCH 01/10] KVM: Add a route layer to convert MSI message to GSI

2009-01-07 Thread Sheng Yang
o 256 gsi_route_entry mapping, and gsi is allocated by kernel and provide two ioctls to userspace, which is more flexiable. Signed-off-by: Sheng Yang --- include/linux/kvm.h | 26 +++ include/linux/kvm_host.h | 20 + virt/kvm/irq_comm.c |

[PATCH 0/6][v3] Userspace support for MSI

2009-01-07 Thread Sheng Yang
Update from v2: Change API to gsi_route. -- 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/6] kvm: Replace force type convert with container_of()

2009-01-07 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 d5eb7b2..f357d17 100644 --- a/qemu/hw/device-assignment.c +++ b/qemu/hw/device

[PATCH 5/6] Support for device capability

2009-01-07 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 6/6] kvm: expose MSI capability to guest

2009-01-07 Thread Sheng Yang
Signed-off-by: Sheng Yang --- qemu/hw/device-assignment.c | 111 --- qemu/hw/device-assignment.h |7 +++ 2 files changed, 111 insertions(+), 7 deletions(-) diff --git a/qemu/hw/device-assignment.c b/qemu/hw/device-assignment.c index 169357f..4c08b00

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

2009-01-07 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 f58015b..a58f31d 100644

[PATCH 3/6] kvm: ioctl for gsi_route

2009-01-07 Thread Sheng Yang
Signed-off-by: Sheng Yang --- libkvm/libkvm.c | 27 +++ libkvm/libkvm.h |8 2 files changed, 35 insertions(+), 0 deletions(-) diff --git a/libkvm/libkvm.c b/libkvm/libkvm.c index 0408fdb..6d53f38 100644 --- a/libkvm/libkvm.c +++ b/libkvm/libkvm.c

[PATCH 4/6] Figure out device capability

2009-01-07 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 f357d17..169357f 100644 --- a/qemu/hw/device

[PATCH 04/10] KVM: Using ioapic_irqchip() macro for kvm_set_irq

2009-01-07 Thread Sheng Yang
Signed-off-by: Sheng Yang --- virt/kvm/irq_comm.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/virt/kvm/irq_comm.c b/virt/kvm/irq_comm.c index 7460e7f..f5e2d2c 100644 --- a/virt/kvm/irq_comm.c +++ b/virt/kvm/irq_comm.c @@ -39,7 +39,7 @@ void kvm_set_irq(struct kvm

[PATCH 06/10] KVM: Split IOAPIC structure

2009-01-07 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 02/10] KVM: Using gsi route for MSI device assignment

2009-01-07 Thread Sheng Yang
Convert MSI userspace interface to support gsi_msg mapping(and nobody should be the user of the old interface...). Signed-off-by: Sheng Yang --- include/linux/kvm_host.h |1 - virt/kvm/kvm_main.c | 79 ++ 2 files changed, 45 insertions

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

2009-01-07 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 03/10] KVM: Improve MSI dispatch function

2009-01-07 Thread Sheng Yang
Prepare to merge with kvm_set_irq(). Signed-off-by: Sheng Yang --- virt/kvm/kvm_main.c |8 1 files changed, 4 insertions(+), 4 deletions(-) diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c index 0a59245..717e1b0 100644 --- a/virt/kvm/kvm_main.c +++ b/virt/kvm/kvm_main.c

[PATCH 08/10] KVM: Change API of kvm_ioapic_get_delivery_bitmask

2009-01-07 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 951df12

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

2009-01-07 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 | 17 + 3 files changed, 26 insertions(+), 22 dele

[PATCH 0/10][v4]GSI route layer for MSI/MSI-X

2009-01-07 Thread Sheng Yang
Update from v3: Addressed Avi's comment, improve struct gsi_route_entry and use a pair of ioctl to handle them(including some specific interrupt routing) all. Now only support MSI/MSI-X. -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to majord...@vger.ker

[PATCH 05/10] KVM: Merge MSI handling to kvm_set_irq

2009-01-07 Thread Sheng Yang
Using kvm_set_irq to handle all interrupt injection. Signed-off-by: Sheng Yang --- include/linux/kvm_host.h |2 +- virt/kvm/irq_comm.c | 79 +++-- virt/kvm/kvm_main.c | 79 +++--- 3 files changed

Userspace specific host irq?

2009-01-07 Thread Sheng Yang
Hi all This piece of code puzzled me at all time: virt/kvm/kvm_main.c:assigned_device_update_intx() > if (airq->host_irq) > adev->host_irq = airq->host_irq; > else > adev->host_irq = adev->dev->irq; I don't know why we can

Re: [PATCH 01/10] KVM: Add a route layer to convert MSI message to GSI

2009-01-07 Thread Sheng Yang
On Thursday 08 January 2009 00:18:39 Marcelo Tosatti wrote: > Hi Sheng, > Thanks for the careful review! :) > On Wed, Jan 07, 2009 at 06:42:37PM +0800, Sheng Yang wrote: > > diff --git a/virt/kvm/irq_comm.c b/virt/kvm/irq_comm.c > > index 5162a41..7460e7f 100644 > >

Re: [PATCH 05/10] KVM: Merge MSI handling to kvm_set_irq

2009-01-08 Thread Sheng Yang
On Thursday 08 January 2009 05:39:32 Marcelo Tosatti wrote: > On Wed, Jan 07, 2009 at 06:42:41PM +0800, Sheng Yang wrote: > > Using kvm_set_irq to handle all interrupt injection. > > > > Signed-off-by: Sheng Yang > > --- > > include/linux/kvm_host.h |2 +- >

[PATCH 3/7] KVM: Improve MSI dispatch function

2009-01-08 Thread Sheng Yang
Prepare to merge with kvm_set_irq(). Signed-off-by: Sheng Yang --- virt/kvm/kvm_main.c |8 1 files changed, 4 insertions(+), 4 deletions(-) diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c index 3bbb59f..fb2d639 100644 --- a/virt/kvm/kvm_main.c +++ b/virt/kvm/kvm_main.c

[PATCH 6/7] KVM: Split IOAPIC structure

2009-01-08 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/7] KVM: Using ioapic_irqchip() macro for kvm_set_irq

2009-01-08 Thread Sheng Yang
Signed-off-by: Sheng Yang --- virt/kvm/irq_comm.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/virt/kvm/irq_comm.c b/virt/kvm/irq_comm.c index 64ca4cf..f8b22a1 100644 --- a/virt/kvm/irq_comm.c +++ b/virt/kvm/irq_comm.c @@ -39,7 +39,7 @@ void kvm_set_irq(struct kvm

[PATCH 2/7] KVM: Using gsi route for MSI device assignment

2009-01-08 Thread Sheng Yang
Convert MSI userspace interface to support gsi_msg mapping(and nobody should be the user of the old interface...). Signed-off-by: Sheng Yang --- include/linux/kvm_host.h |1 - virt/kvm/kvm_main.c | 79 ++ 2 files changed, 45 insertions

[PATCH 1/7] KVM: Add a route layer to convert MSI message to GSI

2009-01-08 Thread Sheng Yang
o 256 gsi_route_entry mapping, and gsi is allocated by kernel and provide two ioctls to userspace, which is more flexiable. Signed-off-by: Sheng Yang --- include/linux/kvm.h | 26 +++ include/linux/kvm_host.h | 20 + virt/kvm/irq_comm.c |

[PATCH 0/7][v5] GSI route layer for MSI/MSI-X

2009-01-08 Thread Sheng Yang
Update from v4: Addressed Marcelo's comments on the first patch, as well as separate bitmap optimize patchset, which would be posted after this one is checked in. -- regards Yang, Sheng -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to majord...@vger.ker

[PATCH 5/7] KVM: Merge MSI handling to kvm_set_irq

2009-01-08 Thread Sheng Yang
Using kvm_set_irq to handle all interrupt injection. Signed-off-by: Sheng Yang --- include/linux/kvm_host.h |2 +- virt/kvm/irq_comm.c | 79 +++-- virt/kvm/kvm_main.c | 79 +++--- 3 files changed

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

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

Re: KVM: Merge MSI handling to kvm_set_irq

2009-01-08 Thread Sheng Yang
On Thursday 08 January 2009 21:54:41 Mike Day wrote: > On 07/01/09 18:42 +0800, Sheng Yang wrote: > > Using kvm_set_irq to handle all interrupt injection. > > > > Signed-off-by: Sheng Yang > > --- > > > > +static void gsi_dispatch(struct kvm *kvm,

Re: [PATCH 1/7] KVM: Add a route layer to convert MSI message to GSI

2009-01-08 Thread Sheng Yang
On Thursday 08 January 2009 22:20:22 Marcelo Tosatti wrote: > On Thu, Jan 08, 2009 at 06:45:29PM +0800, Sheng Yang wrote: > > * ioctls for VM fds > > @@ -433,6 +436,8 @@ struct kvm_trace_rec { > > #define KVM_ASSIGN_IRQ _IOR(KVMIO, 0x70, \ > >

Re: [PATCH 1/7] KVM: Add a route layer to convert MSI message to GSI

2009-01-08 Thread Sheng Yang
On Thursday 08 January 2009 23:08:25 Avi Kivity wrote: > Sheng Yang wrote: > > Avi's purpose, to use single kvm_set_irq() to deal with all interrupt, > > including MSI. So here is it. > > > > struct gsi_route_entry is a mapping from a special gsi(with > >

Re: [PATCH 6/7] KVM: Split IOAPIC structure

2009-01-08 Thread Sheng Yang
On Thursday 08 January 2009 23:27:21 Marcelo Tosatti wrote: > On Thu, Jan 08, 2009 at 06:45:34PM +0800, Sheng Yang wrote: > > Prepared for reuse ioapic_redir_entry for MSI. > > What is the disadvantage of dispatching the MSI interrupts to the vcpus > via the IOAPIC? Pin short

Re: [PATCH] Fix almost infinite loop in APIC

2009-01-08 Thread Sheng Yang
On Friday 09 January 2009 00:36:06 Alexander Graf wrote: > While booting Linux in VMware ESX, I encountered a strange effect > in the in-kernel lapic implementation: time went backwards! > > While this should never occur, because of that the while loop that > is done after the invalid calculations

[PATCH 1/1] KVM: x86: No wrap around for lapic timer

2009-01-08 Thread Sheng Yang
Or would we meet 585 years later? :) Seriously, this wrap around hide implicit error... Reminder by Alexander Graf. Signed-off-by: Sheng Yang --- arch/x86/kvm/lapic.c | 13 ++--- 1 files changed, 2 insertions(+), 11 deletions(-) diff --git a/arch/x86/kvm/lapic.c b/arch/x86/kvm

Re: Migrating from Xen 3.2 to KVM

2009-01-09 Thread Sheng Yang
On Friday 09 January 2009 15:41:27 Mike Power wrote: > Hello, > > I currently (I think) have XP installed on an LVM > volume /dev/mapper/vol_group1-windows. I have been trying to power this > VM up on KVM (Ubuntu 8.10 dropped Xen). Come to think of it I am not > even sure if the on disk format KV

Re: [PATCH 1/7] KVM: Add a route layer to convert MSI message to GSI

2009-01-10 Thread Sheng Yang
On Fri, Jan 09, 2009 at 08:06:01PM +0200, Avi Kivity wrote: > Sheng Yang wrote: >>>> +struct kvm_gsi_route_entry_guest { >>>> >>> what does _guest mean here? almost all kvm stuff is _guest related. >>> >> >> Because

Re: [PATCH] Fix almost infinite loop in APIC

2009-01-10 Thread Sheng Yang
On Fri, Jan 09, 2009 at 01:57:30PM +0100, Alexander Graf wrote: > Sheng Yang wrote: > > On Friday 09 January 2009 00:36:06 Alexander Graf wrote: > > > >> While booting Linux in VMware ESX, I encountered a strange effect > >> in the in-kernel lapic im

Re: [PATCH] Fix almost infinite loop in APIC

2009-01-10 Thread Sheng Yang
On Fri, Jan 09, 2009 at 01:57:30PM +0100, Alexander Graf wrote: > Sheng Yang wrote: > > On Friday 09 January 2009 00:36:06 Alexander Graf wrote: > > > >> While booting Linux in VMware ESX, I encountered a strange effect > >> in the in-kernel lapic im

Re: [PATCH] Fix almost infinite loop in APIC

2009-01-10 Thread Sheng Yang
On Fri, Jan 09, 2009 at 01:57:30PM +0100, Alexander Graf wrote: > Sheng Yang wrote: > > On Friday 09 January 2009 00:36:06 Alexander Graf wrote: > > > >> While booting Linux in VMware ESX, I encountered a strange effect > >> in the in-kernel lapic im

Re: [PATCH 1/7] KVM: Add a route layer to convert MSI message to GSI

2009-01-10 Thread Sheng Yang
On Fri, Jan 09, 2009 at 08:06:01PM +0200, Avi Kivity wrote: > Sheng Yang wrote: >> I just use it as #ifdef in userspace now, for no user other than >> MSI/MSI-X now. And if we keep maintaining it in kernel, we would return >> free size instead of maximum size.. >&

Re: PCI pass-through: guest can't map memory

2009-01-10 Thread Sheng Yang
On Sun, Jan 11, 2009 at 01:12:42AM +0100, Harald Braumann wrote: > Hi! > > (please CC me, as I'm not subscribed) > > I try to give the guest (Windows XP) direct access to one of the > graphics adaptors. However, the driver in the guest always complains: > "Unable to map required address ranges fo

Re: [PATCH 1/7] KVM: Add a route layer to convert MSI message to GSI

2009-01-11 Thread Sheng Yang
On Sunday 11 January 2009 17:38:22 Avi Kivity wrote: > Sheng Yang wrote: > > After reconsidering, I must say I prefer add/remove ioctls. > > > > About the code size, I don't think it would increase much. I've rewritten > > the code twice, I think I know the

Re: PCI pass-through: guest can't map memory

2009-01-11 Thread Sheng Yang
On Sunday 11 January 2009 21:59:15 Harald Braumann wrote: > On Sun, 11 Jan 2009 12:35:12 +0800 > > Sheng Yang wrote: > > On Sun, Jan 11, 2009 at 01:12:42AM +0100, Harald Braumann wrote: > > > Hi! > > > > > > (please CC me, as I'm not subscribed)

Re: [PATCH] Fix almost infinite loop in APIC

2009-01-12 Thread Sheng Yang
On Sunday 11 January 2009 12:55:58 Marcelo Tosatti wrote: > On Sat, Jan 10, 2009 at 07:21:13PM +0800, Sheng Yang wrote: > > On Fri, Jan 09, 2009 at 01:57:30PM +0100, Alexander Graf wrote: > > > Sheng Yang wrote: > > > > On Friday 09 January 2009 00:36:06 Alexan

[PATCH 4/7] KVM: Using ioapic_irqchip() macro for kvm_set_irq

2009-01-13 Thread Sheng Yang
Signed-off-by: Sheng Yang --- virt/kvm/irq_comm.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/virt/kvm/irq_comm.c b/virt/kvm/irq_comm.c index 8f49113..0c3266a 100644 --- a/virt/kvm/irq_comm.c +++ b/virt/kvm/irq_comm.c @@ -39,7 +39,7 @@ void kvm_set_irq(struct kvm

[PATCH 6/7] KVM: Split IOAPIC structure

2009-01-13 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 0/7][v6] GSI route layer for MSI/MSI-X

2009-01-13 Thread Sheng Yang
Update from v5: Addressed Marcelo and Avi's comments, also change ioctl back to add/delete style one. -- 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/majord

[PATCH 2/7] KVM: Using gsi route for MSI device assignment

2009-01-13 Thread Sheng Yang
Convert MSI userspace interface to support gsi_msg mapping(and nobody should be the user of the old interface...). Signed-off-by: Sheng Yang --- include/linux/kvm_host.h |1 - virt/kvm/kvm_main.c | 79 ++ 2 files changed, 45 insertions

[PATCH 3/7] KVM: Improve MSI dispatch function

2009-01-13 Thread Sheng Yang
Prepare to merge with kvm_set_irq(). Signed-off-by: Sheng Yang --- virt/kvm/kvm_main.c |8 1 files changed, 4 insertions(+), 4 deletions(-) diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c index f3d5958..b0b97ba 100644 --- a/virt/kvm/kvm_main.c +++ b/virt/kvm/kvm_main.c

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

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

[PATCH 1/7] KVM: Add a route layer to convert MSI message to GSI

2009-01-13 Thread Sheng Yang
up to 128 gsi_route_entry mapping, and gsi is allocated by kernel and provide two ioctls to userspace, which is more flexiable. Signed-off-by: Sheng Yang --- include/linux/kvm.h | 24 +++ include/linux/kvm_host.h | 22 + virt/kvm/irq_comm.c |

[PATCH 5/7] KVM: Merge MSI handling to kvm_set_irq

2009-01-13 Thread Sheng Yang
Using kvm_set_irq to handle all interrupt injection. Signed-off-by: Sheng Yang --- include/linux/kvm_host.h |2 +- virt/kvm/irq_comm.c | 79 +++-- virt/kvm/kvm_main.c | 78 +++-- 3 files changed

Re: [PATCH 0/1] IRQ Routing

2009-01-14 Thread Sheng Yang
On Wednesday 14 January 2009 04:02:29 Avi Kivity wrote: > Following is my alternative to irq routing. The differences compared to > Sheng's version are: > > - A single ioctl to replace the entire routing table, instead of add/remove > ioctls for individual routing entries. Routing changes are r

Re: [PATCH] Fix almost infinite loop in APIC

2009-01-14 Thread Sheng Yang
On Wednesday 14 January 2009 06:01:17 Marcelo Tosatti wrote: > On Tue, Jan 13, 2009 at 03:47:49PM +0800, Sheng Yang wrote: > > On Sunday 11 January 2009 12:55:58 Marcelo Tosatti wrote: > > > > The original apic_timer_intr_post() got: > > > if (apic &

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

2009-01-14 Thread Sheng Yang
On Wednesday 14 January 2009 21:53:10 Avi Kivity wrote: > Signed-off-by: Avi Kivity Do we need a lock for the table? -- regards Yang, Sheng > --- > libkvm/kvm-common.h |4 ++ > libkvm/libkvm.c | 107 > +++ libkvm/libkvm.h | > 62 ++

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

2009-01-14 Thread Sheng Yang
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 > > Do we need a lock for the table? And kvm_add_irq_route/kvm_del_irq_route should be generic used, how about transfer a kvm_irq_r

Re: [PATCH] Fix almost infinite loop in APIC

2009-01-14 Thread Sheng Yang
On Thursday 15 January 2009 01:03:59 Marcelo Tosatti wrote: > On Wed, Jan 14, 2009 at 05:17:22PM +0800, Sheng Yang wrote: > > > So calculating the offset using last interrupt injection is not very > > > reasonable in this case. > > > > Um... I think it's

<    4   5   6   7   8   9   10   11   >