[PATCH v3][uqmaster] kvm: Flush coalesced MMIO buffer periodly

2010-01-26 Thread Sheng Yang
shing coalesced MMIO buffer in VGA update handler. By this way, We don't need vcpu explicit exit to QEmu to handle this issue. Signed-off-by: Sheng Yang --- cpu-all.h |2 ++ exec.c|6 ++ kvm-all.c | 23 +++ kvm.h |1 + vl.c |2 ++

Re: [PATCH 2/3] qemu: Enable XSAVE related CPUID

2010-06-16 Thread Sheng Yang
On Thursday 10 June 2010 11:31:02 Sheng Yang wrote: > We can support it in KVM now. The 0xd leaf is queried from KVM. Hi Marcelo & Avi How about patch 1 and 2 in this series? They are used to enable XSAVE cpuid. -- regards Yang

Re: [PATCH v3] qemu: kvm: Enable XSAVE live migration support

2010-06-16 Thread Sheng Yang
On Thursday 17 June 2010 00:05:44 Marcelo Tosatti wrote: > On Wed, Jun 16, 2010 at 05:48:46PM +0200, Jan Kiszka wrote: > > Marcelo Tosatti wrote: > > > On Fri, Jun 11, 2010 at 12:36:49PM +0800, Sheng Yang wrote: > > >> Signed-off-by: Sheng Yang > > &

[PATCH] qemu: kvm: Fix cpu_is_bsp() compilation warning

2010-06-16 Thread Sheng Yang
Signed-off-by: Sheng Yang --- Applied to uq/master. target-i386/kvm.c |1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/target-i386/kvm.c b/target-i386/kvm.c index 9efb3e7..5a088a7 100644 --- a/target-i386/kvm.c +++ b/target-i386/kvm.c @@ -25,6 +25,7 @@ #include

[PATCH 1/4] qemu: kvm: Extend kvm_arch_get_supported_cpuid() to support index

2010-06-17 Thread Sheng Yang
Would use it later for XSAVE related CPUID. Signed-off-by: Sheng Yang --- kvm.h |2 +- target-i386/kvm.c | 19 +++ 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/kvm.h b/kvm.h index a28e7aa..7975e87 100644 --- a/kvm.h +++ b/kvm.h @@ -145,7

[PATCH v4 0/4] XSAVE enabling in QEmu

2010-06-17 Thread Sheng Yang
Notice the first three patches applied to uq/master branch of qemu-kvm, the last one applied to qemu-kvm master branch. And the last one would only apply after the first three merged in master branch. -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to maj

[PATCH 2/4] qemu: Enable XSAVE related CPUID

2010-06-17 Thread Sheng Yang
We can support it in KVM now. The 0xd leaf is queried from KVM. Signed-off-by: Sheng Yang --- target-i386/cpuid.c | 21 + 1 files changed, 21 insertions(+), 0 deletions(-) diff --git a/target-i386/cpuid.c b/target-i386/cpuid.c index 99d1f44..ab6536b 100644 --- a/target

[PATCH 4/4] qemu-kvm: Enable XSAVE live migration support

2010-06-17 Thread Sheng Yang
Based on upstream xsave related fields. Signed-off-by: Sheng Yang --- qemu-kvm-x86.c | 95 +++- qemu-kvm.c | 24 ++ qemu-kvm.h | 28 3 files changed, 146 insertions(+), 1 deletions(-) diff --git a

[PATCH 3/4] qemu: kvm: Enable XSAVE live migration support

2010-06-17 Thread Sheng Yang
Signed-off-by: Sheng Yang --- target-i386/cpu.h |5 ++ target-i386/kvm.c | 134 + target-i386/machine.c | 20 +++ 3 files changed, 159 insertions(+), 0 deletions(-) diff --git a/target-i386/cpu.h b/target-i386/cpu.h index

[PATCH 3/4] qemu: kvm: Enable XSAVE live migration support

2010-06-17 Thread Sheng Yang
Signed-off-by: Sheng Yang --- target-i386/cpu.h |7 ++- target-i386/kvm.c | 139 - target-i386/machine.c | 20 +++ 3 files changed, 163 insertions(+), 3 deletions(-) diff --git a/target-i386/cpu.h b/target-i386/cpu.h index

Re: [PATCH 4/4] qemu-kvm: Enable XSAVE live migration support

2010-06-17 Thread Sheng Yang
On Thursday 17 June 2010 15:41:43 Jan Kiszka wrote: > Sheng Yang wrote: > > Based on upstream xsave related fields. > > > > Signed-off-by: Sheng Yang > > --- > > > > qemu-kvm-x86.c | 95 > > ++

[PATCH 3/4] qemu: kvm: Enable XSAVE live migration support

2010-06-17 Thread Sheng Yang
Signed-off-by: Sheng Yang --- kvm-all.c | 21 +++ kvm.h |2 + target-i386/cpu.h |7 ++- target-i386/kvm.c | 139 - target-i386/machine.c | 20 +++ 5 files changed, 186 insertions(+), 3

[PATCH] qemu-kvm: Replace kvm_set/get_fpu() with upstream version.

2010-06-17 Thread Sheng Yang
Signed-off-by: Sheng Yang --- Would send out XSAVE patch after the upstream ones have been merged, since the patch would be affected by the merge. qemu-kvm-x86.c| 23 ++- qemu-kvm.c| 10 -- qemu-kvm.h| 30

Re: [PATCH] intel-iommu: Fix reference by physical address in intel_iommu_attach_device()

2010-06-17 Thread Sheng Yang
On Saturday 12 June 2010 19:21:42 Sheng Yang wrote: > Commit a99c47a2 "intel-iommu: errors with smaller iommu widths" replace the > dmar_domain->pgd with the first entry of page table when iommu's supported > width is smaller than dmar_domain's. But it use phy

Re: [PATCH 0/2] Fix xsave/xcr save/restore memory leak

2010-06-20 Thread Sheng Yang
On Sunday 20 June 2010 21:14:11 Avi Kivity wrote: > There's a small leak in xsave/xcr save/restore that rapidly drains all > memory during Windows XP install without FlexPriority, since that triggers > qemu register reload frequently. Oops... Would be more careful next time... -- regards Yang, S

[PATCH] KVM: x86: Enable AVX for guest

2010-06-22 Thread Sheng Yang
Enable Intel(R) Advanced Vector Extension(AVX) for guest. The detection of AVX feature includes OSXSAVE bit testing. When OSXSAVE bit is not set, even if AVX is supported, the AVX instruction would result in UD as well. So we're safe to expose AVX bits to guest directly. Signed-off-by:

[PATCH] KVM: VMX: Execute WBINVD to keep data consistency with assigned devices

2010-06-25 Thread Sheng Yang
d exit, or 2: execute wbinvd on all dirty physical CPUs when guest wbinvd exits. For wbinvd VMExit capable processors, we issue IPIs to all physical CPUs to do wbinvd, for we can't easily tell which physical CPUs are "dirty". Signed-off-by: Yaozu (Eddie) Dong Signed-off-by: Sheng Ya

Re: [PATCH] KVM: VMX: Execute WBINVD to keep data consistency with assigned devices

2010-06-25 Thread Sheng Yang
On Friday 25 June 2010 16:54:19 Jan Kiszka wrote: > Sheng Yang wrote: > > Some guest device driver may leverage the "Non-Snoop" I/O, and explicitly > > WBINVD or CLFLUSH to a RAM space. Since migration may occur before WBINVD > > or CLFLUSH, we need to maintain da

[PATCH v2] KVM: VMX: Execute WBINVD to keep data consistency with assigned devices

2010-06-25 Thread Sheng Yang
d exit, or 2: execute wbinvd on all dirty physical CPUs when guest wbinvd exits. Signed-off-by: Yaozu (Eddie) Dong Signed-off-by: Sheng Yang --- Jan- I've check if we can make it more generic. But the logic here heavily depends on if processor have WBINVD exit feature, and the common part

[PATCH v3] KVM: VMX: Execute WBINVD to keep data consistency with assigned devices

2010-06-27 Thread Sheng Yang
d exit, or 2: execute wbinvd on all dirty physical CPUs when guest wbinvd exits. Signed-off-by: Yaozu (Eddie) Dong Signed-off-by: Sheng Yang --- OK, I've checked AMD's spec, they do intercept WBINVD. So we can do it like this. arch/x86/include/asm/kvm_host.h |6 ++ ar

Re: [PATCH v3] KVM: VMX: Execute WBINVD to keep data consistency with assigned devices

2010-06-27 Thread Sheng Yang
On Monday 28 June 2010 11:56:08 Avi Kivity wrote: > On 06/28/2010 06:36 AM, Sheng Yang wrote: > > Some guest device driver may leverage the "Non-Snoop" I/O, and explicitly > > WBINVD or CLFLUSH to a RAM space. Since migration may occur before WBINVD > > or > >

Re: [PATCH v3] KVM: VMX: Execute WBINVD to keep data consistency with assigned devices

2010-06-27 Thread Sheng Yang
On Monday 28 June 2010 14:56:38 Avi Kivity wrote: > On 06/28/2010 09:42 AM, Sheng Yang wrote: > >>> +static void wbinvd_ipi(void *garbage) > >>> +{ > >>> + wbinvd(); > >>> +} > >> > >> Like Jan mentioned, this is quite heavy

Re: [PATCH v3] KVM: VMX: Execute WBINVD to keep data consistency with assigned devices

2010-06-28 Thread Sheng Yang
On Monday 28 June 2010 15:08:56 Avi Kivity wrote: > On 06/28/2010 09:56 AM, Sheng Yang wrote: > > On Monday 28 June 2010 14:56:38 Avi Kivity wrote: > >> On 06/28/2010 09:42 AM, Sheng Yang wrote: > >>>>> +static void wbinvd_ipi(void *garbag

[PATCH v4] KVM: VMX: Execute WBINVD to keep data consistency with assigned devices

2010-06-28 Thread Sheng Yang
d exit, or 2: execute wbinvd on all dirty physical CPUs when guest wbinvd exits. Signed-off-by: Yaozu (Eddie) Dong Signed-off-by: Sheng Yang --- arch/x86/include/asm/kvm_host.h |6 + arch/x86/kvm/emulate.c |5 +++- arch/x86/kvm/svm.c |7 ++ arch/x86

[PATCH v5] KVM: VMX: Execute WBINVD to keep data consistency with assigned devices

2010-06-28 Thread Sheng Yang
d exit, or 2: execute wbinvd on all dirty physical CPUs when guest wbinvd exits. Signed-off-by: Yaozu (Eddie) Dong Signed-off-by: Sheng Yang --- arch/x86/include/asm/kvm_host.h |6 + arch/x86/kvm/emulate.c |5 +++- arch/x86/kvm/svm.c |7 ++ arch/x86

[PATCH v6 1/2] KVM: VMX: Execute WBINVD to keep data consistency with assigned devices

2010-06-29 Thread Sheng Yang
d exit, or 2: execute wbinvd on all dirty physical CPUs when guest wbinvd exits. Signed-off-by: Yaozu (Eddie) Dong Signed-off-by: Sheng Yang --- arch/x86/include/asm/kvm_host.h |6 + arch/x86/kvm/emulate.c |5 +++- arch/x86/kvm/svm.c |7 ++ arch/x86

[PATCH v6 2/2] KVM: Using workqueue for WBINVD

2010-06-29 Thread Sheng Yang
It would buy us the ability to schedule compared to smp_call_function(). Signed-off-by: Sheng Yang --- But I am not sure if it worth the complexity. Anyway WBINVD itself can't be interrupted, so the benefit should come to the caller cpu I think. And that would extended the waiting time fo

[PATCH] KVM: Fix IOMMU memslot reference warning

2010-07-01 Thread Sheng Yang
+0x3a/0x3c [] ? sysret_signal+0x5/0x3d [] int_signal+0x12/0x17 Signed-off-by: Sheng Yang --- virt/kvm/iommu.c |8 ++-- 1 files changed, 6 insertions(+), 2 deletions(-) diff --git a/virt/kvm/iommu.c b/virt/kvm/iommu.c index 673c88a..7795595 100644 --- a/virt/kvm/iommu.c +++ b/virt/kvm

[PATCH v2] KVM: Fix IOMMU RCU related warning

2010-07-01 Thread Sheng Yang
+0x3a/0x3c [] ? sysret_signal+0x5/0x3d [] int_signal+0x12/0x17 Signed-off-by: Sheng Yang --- I just realized the first version of patch unnecessarily covered kvm_iommu_map_memslots(), because that part had already been covered by kvm_vm_ioctl_assign_device() definitely(though unpaired callings

Re: [PATCH] KVM: VMX: fix tlb flush with invalid root

2010-07-04 Thread Sheng Yang
On Saturday 03 July 2010 16:02:42 Xiao Guangrong wrote: > Commit 341d9b535b6c simplify reload logic while entry guest mode, it > can avoid unnecessary sync-root if KVM_REQ_MMU_RELOAD and > KVM_REQ_MMU_SYNC both set. Which commit you are talking about? Can't find 341d9b535b6c... -- regards Yang, S

Re: KVM vs. PCI-E Function Level Reset (FLR) ...

2010-07-13 Thread Sheng Yang
On Wednesday 14 July 2010 04:41:01 Casey Leedom wrote: > I've ground my way through most of the Linux kernel code supporting KVM > and "Device Assignment" but I haven't been able to untangle the path of > when/where PCI-E Function Level Resets (FLRs) are applied and what happens > if the Virtual

Re: KVM vs. PCI-E Function Level Reset (FLR) ...

2010-07-14 Thread Sheng Yang
On Thursday 15 July 2010 02:01:29 Casey Leedom wrote: > | From: Sheng Yang > | Date: Tuesday, July 13, 2010 05:53 pm (Please use reply to all next time.) > | > | On Wednesday 14 July 2010 04:41:01 Casey Leedom wrote: > | > It looks like the Linux KVM kernel support code iss

Re: [PATCH 0/24] Nested VMX, v5

2010-07-14 Thread Sheng Yang
On Sunday 13 June 2010 20:22:33 Nadav Har'El wrote: > Hi Avi, > > This is a followup of our nested VMX patches that Orit Wasserman posted in > December. We've addressed most of the comments and concerns that you and > others on the mailing list had with the previous patch set. We hope you'll > fin

Re: KVM vs. PCI-E Function Level Reset (FLR) ...

2010-07-15 Thread Sheng Yang
On Thursday 15 July 2010 23:39:36 Casey Leedom wrote: > | From: Sheng Yang > | Date: Wednesday, July 14, 2010 06:31 pm > | > | On Thursday 15 July 2010 02:01:29 Casey Leedom wrote: > | > | From: Sheng Yang > | > | Date: Tuesday, July 13, 2010 05:53 pm > | > | (Ple

Re: Disable EPT

2010-08-02 Thread Sheng Yang
On Monday 02 August 2010 17:16:56 Kuniyasu Suzaki wrote: > Hello, > > >>From: pradeepkumar > >>Subject: Re: Disable EPT > >> > >>On Mon, 02 Aug 2010 10:46:13 +0900 (JST) > >> > >>Kuniyasu Suzaki wrote: > >>> Please tell me how to disable EPT of KVM. > >>> Can I disable EPT in BIOS menu?

Re: [PATCH] kvm: fix poison overwritten caused by using wrong xstate size

2010-08-13 Thread Sheng Yang
t;H. Peter Anvin" > Cc: Suresh Siddha > Cc: Brian Gerst > Cc: Avi Kivity > Cc: Robert Richter > Cc: Sheng Yang > Cc: Marcelo Tosatti > Cc: Gleb Natapov > Cc: Jan Kiszka Reviewed-by: Sheng Yang -- regards Yang, Sheng > --- > arch/x86/kernel/i387.c |1

Re: [PATCH 1/1] KVM: IRQ ACK notifier should be used with in-kernel irqchip

2008-11-30 Thread Sheng Yang
t's what I meant to fix. Thanks for point out the bug. It's indeed a buggy fix for (!kian). > > On Mon, 2008-10-20 at 16:07 +0800, Sheng Yang wrote: > ... > > > diff --git a/virt/kvm/irq_comm.c b/virt/kvm/irq_comm.c > > index 55ad76e..9fbbdea 100644 &

Re: [PATCH 0/2] module_refcounting and anonymous inodes

2008-12-09 Thread Sheng Yang
On Monday 08 December 2008 19:57:14 Avi Kivity wrote: > Christian Borntraeger wrote: > > Am Dienstag, 2. Dezember 2008 schrieb Christian Borntraeger: > >> Hello Avi, > >> > >> here is the latest respin of my fixes for the kvm module unload problem: > >> > >> [PATCH 1/2] anon_inodes: use fops->owner

Re: [PATCH 0/2] module_refcounting and anonymous inodes

2008-12-09 Thread Sheng Yang
On Tuesday 09 December 2008 21:22:42 Avi Kivity wrote: > Avi Kivity wrote: > > Christian Borntraeger wrote: > >> The problem is, how do you detect if the base kernel has patch1 applied? > > > > In the external module compatibility kit, implement two versions of > > anon_inode_getfd(), and select th

[PATCH 0/8] MSI enhancement

2008-12-23 Thread Sheng Yang
Hi Avi Here is the first part of MSI-X enabling patchset. This one: 1. Add gsi_msg mapping mechanism, which gsi can used to indicated a MSI interrupt.(Notice API/ABI changed a little, but we don't have userspace patch now, so it should be OK.) 2. Provide MSI disable capability. The upcoming MSI

[PATCH 5/8] KVM: Using gsi_msg mapping for MSI device assignment

2008-12-23 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 | 33 - 2 files changed, 20 insertions(+), 14 deletions

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

2008-12-23 Thread Sheng Yang
In msi2intx mode, MSI is always enabled. But for non-msi2intx mode, we have to disable MSI if guest require to do so. Signed-off-by: Sheng Yang --- virt/kvm/kvm_main.c | 11 ++- 1 files changed, 10 insertions(+), 1 deletions(-) diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c

[PATCH 8/8] KVM: Merge MSI handling to kvm_set_irq

2008-12-23 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 | 96 ++--- virt/kvm/kvm_main.c | 75 +++- 3 files changed, 88

[PATCH 6/8] KVM: Improve MSI dispatch function

2008-12-23 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 50b3ff6..49848cb 100644 --- a/virt/kvm/kvm_main.c +++ b/virt/kvm/kvm_main.c

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

2008-12-23 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 ef

[PATCH 4/8] KVM: Add a route layer to convert MSI message to GSI

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

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

2008-12-23 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 7/8] KVM: Using ioapic_irqchip() macro for kvm_set_irq

2008-12-23 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 e95ec3f..f7dcf70 100644 --- a/virt/kvm/irq_comm.c +++ b/virt/kvm/irq_comm.c @@ -39,7 +39,7 @@ void kvm_set_irq(struct kvm

[PATCH 1/4] KVM: Using kfifo for irq recording

2008-12-23 Thread Sheng Yang
For MSI-X, we have to deal with multiply IRQ with same IRQ handler, so it's necessary to record the IRQ that trigger the IRQ handler. Signed-off-by: Sheng Yang --- include/linux/kvm_host.h |4 virt/kvm/kvm_main.c | 30 +++--- 2 files change

[PATCH 3/4] KVM: x86: displace MMIO handling part

2008-12-23 Thread Sheng Yang
effect?) Signed-off-by: Sheng Yang --- arch/x86/kvm/x86.c | 28 +--- 1 files changed, 9 insertions(+), 19 deletions(-) diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c index aa4575c..6554966 100644 --- a/arch/x86/kvm/x86.c +++ b/arch/x86/kvm/x86.c @@ -2022,17 +2022,6

[PATCH 2/4] KVM: Add intercepted MMIO for KVM

2008-12-23 Thread Sheng Yang
which stored MSI-X table, and what we write to real device's MMIO page is another story. Signed-off-by: Sheng Yang --- arch/x86/kvm/Makefile |2 +- arch/x86/kvm/mmu.c | 11 +++ arch/x86/kvm/paging_tmpl.h | 11 +++ include/linux/kvm.h |3 + include/linux/

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

2008-12-23 Thread Sheng Yang
ingle entry, I would add a hook in intercepted MMIO's read/write handler later. Signed-off-by: Sheng Yang --- include/linux/kvm.h |4 + include/linux/kvm_host.h | 12 ++- virt/kvm/kvm_main.c | 246 +- 3 files changed, 255 i

[PATCH 0/4] MSI-X Enabling

2008-12-23 Thread Sheng Yang
Hi Avi This patchset would enable MSI-X support. The main change is a new kind of fake device - intercepted MMIO device is added for supporting to intercept one page contained MSI-X entries table. I also consider of doing this intercept in userspace. But I think it's would be more complex to pus

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

2008-12-23 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 7a5..339f44a 100644 --- a/qemu/hw/device-assignment.c +++ b/qemu/hw/device

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

2008-12-23 Thread Sheng Yang
Signed-off-by: Sheng Yang --- qemu/hw/device-assignment.c | 107 --- qemu/hw/device-assignment.h |7 +++ 2 files changed, 107 insertions(+), 7 deletions(-) diff --git a/qemu/hw/device-assignment.c b/qemu/hw/device-assignment.c index d0264b5..61d3f66

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

2008-12-23 Thread Sheng Yang
Hi Avi & Anthony This patchset used updated interface (with gsi_msg) to enable MSI for assigned guest device in userspace. And the patchset provide a generic method to deal with PCI capability. Maybe someday, QEmu would found patch 5 is useful. :) Thanks! -- regards Yang, Sheng -- To unsubscribe

[PATCH 3/6] kvm: ioctl for gsi_msg

2008-12-23 Thread Sheng Yang
Signed-off-by: Sheng Yang --- libkvm/libkvm.c | 26 ++ libkvm/libkvm.h |7 +++ 2 files changed, 33 insertions(+), 0 deletions(-) diff --git a/libkvm/libkvm.c b/libkvm/libkvm.c index 9d3139e..c30f086 100644 --- a/libkvm/libkvm.c +++ b/libkvm/libkvm.c @@ -1144,3

[PATCH 4/6] Figure out device capability

2008-12-23 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 339f44a..d0264b5 100644 --- a/qemu/hw/device

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

2008-12-23 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 a304570..021e159 100644

[PATCH 5/6] Support for device capability

2008-12-23 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 0/3] Userspace for MSI-X

2008-12-23 Thread Sheng Yang
Oh, I know, here the last ones... :) 2008 is not that easy, but indeed a great year for KVM. Merry Xmas to the guys in the KVM community! -- 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

[PATCH 3/3] Add MSI-X capability support

2008-12-23 Thread Sheng Yang
Expose MSI-X capabilty to guest if the assigned device got it. Signed-off-by: Sheng Yang --- qemu/hw/device-assignment.c | 82 +-- qemu/hw/device-assignment.h |3 ++ 2 files changed, 82 insertions(+), 3 deletions(-) diff --git a/qemu/hw/device

[PATCH 2/3] KVM: Makefile change for intercepted MMIO

2008-12-23 Thread Sheng Yang
Signed-off-by: Sheng Yang --- kernel/x86/Kbuild |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/kernel/x86/Kbuild b/kernel/x86/Kbuild index c4723b1..a4b823c 100644 --- a/kernel/x86/Kbuild +++ b/kernel/x86/Kbuild @@ -5,7 +5,7 @@ include $(obj)/../config.kbuild obj-m

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

2008-12-23 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 3a0e9c2..8b9ac5f 100644 --- a/qemu/hw/pci.h +++ b/qemu/hw/pci.h @@ -67,6 +67,7 @@ typedef struct PCIIORegion { #define

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

2008-12-23 Thread Sheng Yang
On Wednesday 24 December 2008 01:32:24 Marcelo Tosatti wrote: > On Tue, Dec 23, 2008 at 04:00:24PM +0800, Sheng Yang wrote: > > For MSI disable feature later. > > > > Notice I changed ABI here, but due to no userspace patch, I think it's > > OK. &

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

2008-12-23 Thread Sheng Yang
On Wednesday 24 December 2008 01:55:42 Marcelo Tosatti wrote: > On Tue, Dec 23, 2008 at 04:00:27PM +0800, 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_msg is a

Re: [PATCH 5/8] KVM: Using gsi_msg mapping for MSI device assignment

2008-12-23 Thread Sheng Yang
On Wednesday 24 December 2008 02:05:15 Marcelo Tosatti wrote: > On Tue, Dec 23, 2008 at 04:00:28PM +0800, Sheng Yang wrote: > > Convert MSI userspace interface to support gsi_msg mapping(and nobody > > should be the user of the old interface...). > > > >

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

2008-12-23 Thread Sheng Yang
On Wednesday 24 December 2008 02:10:20 Marcelo Tosatti wrote: > On Tue, Dec 23, 2008 at 04:00:31PM +0800, Sheng Yang wrote: > > Using kvm_set_irq to handle all interrupt injection. > > > > Signed-off-by: Sheng Yang > > --- > > include/linux/kvm_host.h |

Re: [PATCH 0/4] MSI-X Enabling

2008-12-23 Thread Sheng Yang
On Wednesday 24 December 2008 04:19:32 Marcelo Tosatti wrote: > On Tue, Dec 23, 2008 at 04:12:49PM +0800, Sheng Yang wrote: > > Hi Avi > > > > This patchset would enable MSI-X support. > > > > The main change is a new kind of fake device - intercepted MMIO devi

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

2008-12-24 Thread Sheng Yang
On Wednesday 24 December 2008 10:31:00 Sheng Yang wrote: > On Wednesday 24 December 2008 01:55:42 Marcelo Tosatti wrote: > > On Tue, Dec 23, 2008 at 04:00:27PM +0800, Sheng Yang wrote: > > > Avi's purpose, to use single kvm_set_irq() to deal with all interrupt, > > &

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

2008-12-25 Thread Sheng Yang
On Tuesday 23 December 2008 23:18:43 Marcelo Tosatti wrote: > Hi Sheng, > > On Tue, Dec 23, 2008 at 04:00:25PM +0800, Sheng Yang wrote: > > Which is more convenient... > > > > Signed-off-by: Sheng Yang > > --- > > virt/kvm/kvm_main.c | 10 ++ &

[PATCH 09/15] KVM: Split IOAPIC structure

2008-12-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 02/15] KVM: Use kvm_free_assigned_irq() for free irq

2008-12-25 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 01/15] KVM: Add MSI_ACTION flag for assigned irq

2008-12-25 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 ef

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

2008-12-25 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 04/15] KVM: Add a route layer to convert MSI message to GSI

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

[PATCH 14/15] KVM: Using kfifo for irq recording

2008-12-25 Thread Sheng Yang
For MSI-X, we have to deal with multiply IRQ with same IRQ handler, so it's necessary to record the IRQ that trigger the IRQ handler. And this one is also useful for fixing kvm_free_assigned_irq(). Signed-off-by: Sheng Yang --- include/linux/kvm_host.h |4 virt/kvm/kvm_m

[PATCH 07/15] KVM: Using ioapic_irqchip() macro for kvm_set_irq

2008-12-25 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 12/15] KVM: Update intr delivery func to accept unsigned long* bitmap

2008-12-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 06/15] KVM: Improve MSI dispatch function

2008-12-25 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 13/15] KVM: bit ops for deliver_bitmap

2008-12-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| 24 +--- virt/kvm/irq_comm.c | 16 3 files changed, 25 insertions(+), 22 dele

[PATCH 08/15] KVM: Merge MSI handling to kvm_set_irq

2008-12-25 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 11/15] KVM: Change API of kvm_ioapic_get_delivery_bitmask

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

[PATCH 0/15] Device assignment & MSI enhancement

2008-12-25 Thread Sheng Yang
Hi Avi and Marcelo Merry Xmas! And here is the v2 of patchset. Target at 2.6.29 for it contained a lot of fix and improvement of current device assignment and MSI feature. Change from V1: Addressed Marcelo's comments, and: 1. Fix racy in kvm_free_assigned_irq(). In case to do this, I fetch one p

[PATCH 05/15] KVM: Using gsi_msg mapping for MSI device assignment

2008-12-25 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 15/15] KVM: Fix racy in kvm_free_assigned_irq

2008-12-25 Thread Sheng Yang
is code only consider the former situation. Also, we have a window between cancel_work_sync() and free_irq. This patch fixs them two. Signed-off-by: Sheng Yang --- virt/kvm/kvm_main.c | 26 ++ 1 files changed, 22 insertions(+), 4 deletions(-) diff --git a/virt/kvm/kvm_m

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

2008-12-25 Thread Sheng Yang
Duplicate code is always bothering... 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

Re: [PATCH 0/15] Device assignment & MSI enhancement

2008-12-25 Thread Sheng Yang
On Thursday 25 December 2008 17:09:24 Sheng Yang wrote: > Hi Avi and Marcelo > > Merry Xmas! And here is the v2 of patchset. Target at 2.6.29 for it > contained a lot of fix and improvement of current device assignment and MSI > feature. > > Change from V1: > > Addres

Re: [PATCH 1/4] KVM: Using kfifo for irq recording

2008-12-25 Thread Sheng Yang
On Thursday 25 December 2008 19:07:22 Avi Kivity wrote: > Sheng Yang wrote: > > For MSI-X, we have to deal with multiply IRQ with same IRQ handler, so > > it's necessary to record the IRQ that trigger the IRQ handler. > > Does MSI-X disallowing coalescing two requests int

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

2008-12-25 Thread Sheng Yang
On Thu, Dec 25, 2008 at 05:09:39PM +0800, Sheng Yang wrote: > Thanks to Marcelo's observation, The following code have potential issue: > > if (cancel_work_sync(&assigned_dev->interrupt_work)) > kvm_put_kvm(kvm); > > In fact, cancel_work_sync() would return t

Re: [PATCH 1/4] KVM: Using kfifo for irq recording

2008-12-25 Thread Sheng Yang
On Thursday 25 December 2008 21:26:29 Avi Kivity wrote: > Sheng Yang wrote: > > On Thursday 25 December 2008 19:07:22 Avi Kivity wrote: > >> Sheng Yang wrote: > >>> For MSI-X, we have to deal with multiply IRQ with same IRQ handler, so > >>> it's n

[PATCH 14/15] KVM: Replace host_irq_disable with a new flag

2008-12-25 Thread Sheng Yang
(I discard irq_fifo and change a method to fix this problem) We can reused the field "state" later. Signed-off-by: Sheng Yang --- include/linux/kvm_host.h |3 ++- virt/kvm/kvm_main.c |8 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/inc

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

2008-12-25 Thread Sheng Yang
is code only consider the former situation. Also, we have a window between cancel_work_sync() and free_irq. This patch fixs them two. Signed-off-by: Sheng Yang --- include/linux/kvm_host.h |1 + virt/kvm/kvm_main.c | 34 ++ 2 files changed, 31 inse

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

2008-12-28 Thread Sheng Yang
On Sat, Dec 27, 2008 at 05:27:25PM -0200, Marcelo Tosatti wrote: > > > > > +static int kvm_vm_ioctl_request_gsi_msg(struct kvm *kvm, > > > > > + struct kvm_assigned_gsi_msg > > > > > *agsi_msg) > > > > > +{ > > > > > + struct kvm_gsi_msg gsi_msg; > > > > > +

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

2008-12-28 Thread Sheng Yang
On Sat, Dec 27, 2008 at 06:06:26PM -0200, Marcelo Tosatti wrote: > On Fri, Dec 26, 2008 at 10:30:07AM +0800, Sheng Yang wrote: > > Thanks to Marcelo's observation, The following code have potential issue: > > > > if (cancel_work_sync(&assigned_dev->interru

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

2008-12-29 Thread Sheng Yang
On Monday 29 December 2008 13:42:22 Amit Shah wrote: > On Sun, Dec 28, 2008 at 07:24:02PM +0800, Sheng Yang wrote: > > On Sat, Dec 27, 2008 at 06:06:26PM -0200, Marcelo Tosatti wrote: > > > On Fri, Dec 26, 2008 at 10:30:07AM +0800, Sheng Yang wrote: > > > > Thanks

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

2008-12-29 Thread Sheng Yang
On Monday 29 December 2008 21:37:52 Avi Kivity wrote: > Sheng Yang wrote: > > The free assigned device in the destroy path of VM, so as free irq. And > > we got cancel_work_sync() in free irq which can sync with the execution > > of scheduled work. And now before cancel_work_s

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

2008-12-29 Thread Sheng Yang
On Monday 29 December 2008 23:20:57 Marcelo Tosatti wrote: > On Mon, Dec 29, 2008 at 08:23:28PM +0800, Sheng Yang wrote: > > On Monday 29 December 2008 13:42:22 Amit Shah wrote: > > > On Sun, Dec 28, 2008 at 07:24:02PM +0800, Sheng Yang wrote: > > > > On Sat, De

Re: [patch 2/2] QEMU/KVM: provide an option to disable in-kernel PIT int reinjection

2008-12-29 Thread Sheng Yang
On Tuesday 30 December 2008 01:42:35 Marcelo Tosatti wrote: > Signed-off-by: Marcelo Tosatti > >-- > #if defined(TARGET_I386) || defined(TARGET_X86_64) || defined(TARGET_IA64) > || defined(__linux__) { "pcidevice", HAS_ARG, QEMU_OPTION_pcidevice }, > @@ -5267,6 +5270,11 @@ int main(int argc, char

[0/3][RESEND] Device assignment code clean up and MSI disable support

2008-12-29 Thread Sheng Yang
I splitted the former patchset into 3 smaller one. Here is the first one. -- 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

<    3   4   5   6   7   8   9   10   11   >