[PATCH 06/10] KVM: Export ioapic_get_delivery_bitmask

2008-10-30 Thread Sheng Yang
It would be used for MSI in device assignment, for MSI dispatch. Signed-off-by: Sheng Yang <[EMAIL PROTECTED]> --- virt/kvm/ioapic.c |4 ++-- virt/kvm/ioapic.h |2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/virt/kvm/ioapic.c b/virt/kvm/ioapic.c index c

[PATCH 09/10] KVM: Enable MSI for device assignment

2008-10-30 Thread Sheng Yang
rn -ENOTTY with KVM_DEV_IRQ_ASSIGN_ENABLE_MSI. Signed-off-by: Sheng Yang <[EMAIL PROTECTED]> --- virt/kvm/kvm_main.c | 80 +++ 1 files changed, 74 insertions(+), 6 deletions(-) diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c index d23f555..3ae8

[PATCH 07/10] x86: Add MSI delivery mode value

2008-10-30 Thread Sheng Yang
Signed-off-by: Sheng Yang <[EMAIL PROTECTED]> --- arch/x86/include/asm/msidef.h |2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/arch/x86/include/asm/msidef.h b/arch/x86/include/asm/msidef.h index 6706b30..32edc7f 100644 --- a/arch/x86/include/asm/msidef.h +++ b/ar

[PATCH 02/10] KVM: Separate update irq to a single function

2008-10-30 Thread Sheng Yang
Signed-off-by: Sheng Yang <[EMAIL PROTECTED]> --- virt/kvm/kvm_main.c | 68 -- 1 files changed, 38 insertions(+), 30 deletions(-) diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c index 4647a7b..7d261b1 100644 --- a/virt/kvm/kvm_

Re: [PATCH 08/10] KVM: Add assigned_device_msi_dispatch()

2008-11-04 Thread Sheng Yang
On Tuesday 04 November 2008 19:17:03 Avi Kivity wrote: > Sheng Yang wrote: > > The function is used to dispatch MSI to lapic according to MSI message > > address and message data. > > > > (Any way to replace macro GET_VAL_FROM_SHIFT()?) > > > > > >

Re: [PATCH 09/10] KVM: Enable MSI for device assignment

2008-11-04 Thread Sheng Yang
On Tue, Nov 04, 2008 at 04:35:19PM +0200, Avi Kivity wrote: > Sheng Yang wrote: >>> In fact, it's not just for pci. We could msi-enable e1000 and get >>> improved performance there as well. >>> >> >> E1000? Don't understand... Sounds lik

Re: [PATCH 09/10] KVM: Enable MSI for device assignment

2008-11-04 Thread Sheng Yang
On Tue, Nov 04, 2008 at 05:01:04PM +0200, Avi Kivity wrote: > Sheng Yang wrote: >>> struct gsi { >>>u32 n : 24; >>>u32 type : 8; // 0 -> classic gsi, 1 -> msi >>> }; >>> >> >> I just don't understand why we need 2

Re: [PATCH 06/10] KVM: Export ioapic_get_delivery_bitmask

2008-11-04 Thread Sheng Yang
On Tuesday 04 November 2008 19:07:19 Avi Kivity wrote: > Sheng Yang wrote: > > It would be used for MSI in device assignment, for MSI dispatch. > > > > -static u32 ioapic_get_delivery_bitmask(struct kvm_ioapic *ioapic, u8 > > dest, -

Re: [PATCH 10/10] KVM: MSI to INTx translate

2008-11-04 Thread Sheng Yang
On Tue, Nov 04, 2008 at 01:57:56PM +0200, Avi Kivity wrote: > Sheng Yang wrote: >> Yes, in theory, we got a little trouble, but not that much. >> >> The mechanism based on a assumption: every time guest got a interrupt, >> it would deassert the interrupt source soon

Re: [PATCH 10/10] KVM: MSI to INTx translate

2008-11-04 Thread Sheng Yang
On Tuesday 04 November 2008 19:25:34 Avi Kivity wrote: > Sheng Yang wrote: > > Now we use MSI as default one, and translate MSI to INTx when guest need > > INTx rather than MSI. For legacy device, we provide support for > > non-sharing host IRQ. > > Won't we run int

Re: [PATCH 07/10] x86: Add MSI delivery mode value

2008-11-04 Thread Sheng Yang
On Tuesday 04 November 2008 19:09:15 Avi Kivity wrote: > Sheng Yang wrote: > > Signed-off-by: Sheng Yang <[EMAIL PROTECTED]> > > --- > > arch/x86/include/asm/msidef.h |2 ++ > > 1 files changed, 2 insertions(+), 0 deletions(-) > > > > diff --git a

Re: [PATCH 09/10] KVM: Enable MSI for device assignment

2008-11-04 Thread Sheng Yang
On Tue, Nov 04, 2008 at 03:32:49PM +0200, Avi Kivity wrote: > Sheng Yang wrote: >> One question here: did the architectures other than X86 and IA64 need >> dispatch MSI support? > > s390 doesn't. ppc may, one day in the future. Not now I think. OK, so reuse is enoug

Re: [PATCH 09/10] KVM: Enable MSI for device assignment

2008-11-04 Thread Sheng Yang
On Tue, Nov 04, 2008 at 01:23:04PM +0200, Avi Kivity wrote: > Sheng Yang wrote: >> We enable guest MSI and host MSI support in this patch. The userspace want to >> enable MSI should set KVM_DEV_IRQ_ASSIGN_ENABLE_MSI in the assigned_irq's >> flag. Function would return -

[PATCH 1/1] kvm: fix external module on mtrr_var_range

2008-11-04 Thread Sheng Yang
Signed-off-by: Sheng Yang <[EMAIL PROTECTED]> --- kernel/x86/external-module-compat.h |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/kernel/x86/external-module-compat.h b/kernel/x86/external-module-compat.h index 882f5d1..b5e11e2 100644 --- a/kernel/x86/ex

[PATCH] KVM: VMX: Set IGMT bit in EPT entry

2008-11-05 Thread Sheng Yang
stent cache attribute. The patch set IGMT bit in EPT entry to ignore guest PAT and use WB as default memory type to protect host (notice that all memory mapped by KVM should be WB). Signed-off-by: Sheng Yang <[EMAIL PROTECTED]> --- arch/x86/kvm/vmx.c |3 ++- arch/x86/kvm/vmx.h |1

Re: [PATCH] KVM: VMX: Set IGMT bit in EPT entry

2008-11-06 Thread Sheng Yang
On Thursday 06 November 2008 21:47:59 Anthony Liguori wrote: > Sheng Yang wrote: > > (Patch for 2.6.27, based on kvm-updates/2.6.27) > > > > There is a potential issue that, when guest using pagetable without > > vmexit when EPT enabled, guest would use PAT/PCD/PWT bi

[PATCH 1/1] KVM: Fix kernel allocated memory slot

2008-11-10 Thread Sheng Yang
Commit 7fd49de9773fdcb7b75e823b21c1c5dc1e218c14 "KVM: ensure that memslot userspace addresses are page-aligned" broke kernel space allocated memory slot, for the userspace_addr is invalid. Signed-off-by: Sheng Yang <[EMAIL PROTECTED]> --- virt/kvm/kvm_main.c |2 +- 1

[PATCH 1/1] KVM: VMX: Clean up private memory slot allocation

2008-11-10 Thread Sheng Yang
userspace_addr should be a meaningless value. (Any suggestion on this "meaningless value"?) Signed-off-by: Sheng Yang <[EMAIL PROTECTED]> --- arch/x86/kvm/vmx.c |4 1 files changed, 4 insertions(+), 0 deletions(-) diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx

Re: [PATCH 1/1] KVM: Fix kernel allocated memory slot

2008-11-11 Thread Sheng Yang
On Tuesday 11 November 2008 22:58:25 Hollis Blanchard wrote: > On Tue, 2008-11-11 at 15:30 +0800, Sheng Yang wrote: > > Commit 7fd49de9773fdcb7b75e823b21c1c5dc1e218c14 "KVM: ensure that memslot > > userspace addresses are page-aligned" broke kernel space allocated

Re: [PATCH 1/1] KVM: VMX: Clean up private memory slot allocation

2008-11-13 Thread Sheng Yang
On Thursday 13 November 2008 20:27:13 Avi Kivity wrote: > Sheng Yang wrote: > > userspace_addr should be a meaningless value. > > Perhaps in __kvm_set_memory_region(), if !user_alloc? > > Why is it needed? Did you observe any problem? A potential issue is kvm_userspace_mem

[PATCH 1/1] KVM: VMX: Fix base_ptes for EPT

2008-11-19 Thread Sheng Yang
After support MTRR for EPT, memory type WB shouldn't take as default in base_ptes. (Something wrong during the merging...) Signed-off-by: Sheng Yang <[EMAIL PROTECTED]> --- arch/x86/kvm/vmx.c |1 - 1 files changed, 0 insertions(+), 1 deletions(-) diff --git a/arch/x86/kvm/vmx.c

Re: [PATCH 1/1] KVM: VMX: Fix base_ptes for EPT

2008-11-19 Thread Sheng Yang
On Wednesday 19 November 2008 18:25:32 Avi Kivity wrote: > Sheng Yang wrote: > > After support MTRR for EPT, memory type WB shouldn't take as default in > > base_ptes. (Something wrong during the merging...) > > Yes, my fault. > > But don't we still have a big

[PATCH 07/11] x86: Rename MSI macro name

2008-11-19 Thread Sheng Yang
Signed-off-by: Sheng Yang <[EMAIL PROTECTED]> --- arch/x86/include/asm/msidef.h |4 ++-- arch/x86/kernel/io_apic.c |4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/arch/x86/include/asm/msidef.h b/arch/x86/include/asm/msidef.h index 6706b30..988cb27 100644

[PATCH 03/11] KVM: Replace irq_requested with more generic irq_requested_type

2008-11-19 Thread Sheng Yang
Separate guest irq type and host irq type, for we can support guest using INTx with host using MSI (but not opposite combination). Signed-off-by: Sheng Yang <[EMAIL PROTECTED]> --- include/linux/kvm_host.h |4 +++- virt/kvm/kvm_main.c |9 + 2 files changed, 8 inse

[PATCH 0/11][v5] Enable MSI for KVM

2008-11-19 Thread Sheng Yang
Hi Here is v5 for MSI on assigned devices, sorry for the delay. Due to the bad weather, I got a badly cold recently, indeed feeling bad... :( v4->v5 Addressed all the comments from Avi. I would work on the generic MSI solution later as well. The most important one is a new modules paramter "msi2

[PATCH 01/11] KVM: Move ack notifier register and IRQ sourcd ID request

2008-11-19 Thread Sheng Yang
Signed-off-by: Sheng Yang <[EMAIL PROTECTED]> --- virt/kvm/kvm_main.c | 30 +++--- 1 files changed, 19 insertions(+), 11 deletions(-) diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c index 4727c08..8966fd1 100644 --- a/virt/kvm/kvm_main.c +++ b/vi

[PATCH 02/11] KVM: Separate update irq to a single function

2008-11-19 Thread Sheng Yang
Signed-off-by: Sheng Yang <[EMAIL PROTECTED]> --- virt/kvm/kvm_main.c | 68 -- 1 files changed, 38 insertions(+), 30 deletions(-) diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c index 8966fd1..ef2f03c 100644 --- a/virt/kvm/kvm_

[PATCH 08/11] x86: Add MSI delivery mode value

2008-11-19 Thread Sheng Yang
Signed-off-by: Sheng Yang <[EMAIL PROTECTED]> --- arch/x86/include/asm/msidef.h |2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/arch/x86/include/asm/msidef.h b/arch/x86/include/asm/msidef.h index 988cb27..412f94e 100644 --- a/arch/x86/include/asm/msidef.h +++ b/ar

[PATCH 05/11] KVM: Add fields for MSI device assignment

2008-11-19 Thread Sheng Yang
Prepared for kvm_arch_assigned_device_msi_dispatch(). Signed-off-by: Sheng Yang <[EMAIL PROTECTED]> --- include/linux/kvm.h |7 +++ include/linux/kvm_host.h |4 2 files changed, 11 insertions(+), 0 deletions(-) diff --git a/include/linux/kvm.h b/include/linux/kvm.h

[PATCH 06/11] KVM: Export ioapic_get_delivery_bitmask

2008-11-19 Thread Sheng Yang
It would be used for MSI in device assignment, for MSI dispatch. Signed-off-by: Sheng Yang <[EMAIL PROTECTED]> --- virt/kvm/ioapic.c |7 --- virt/kvm/ioapic.h |2 ++ 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/virt/kvm/ioapic.c b/virt/kvm/ioapic.c index c

[PATCH 10/11] KVM: Enable MSI for device assignment

2008-11-19 Thread Sheng Yang
rn -ENOTTY with KVM_DEV_IRQ_ASSIGN_ENABLE_MSI. Userspace can tell the support of MSI device from #ifdef KVM_CAP_DEVICE_MSI. Signed-off-by: Sheng Yang <[EMAIL PROTECTED]> --- include/linux/kvm.h |3 ++ virt/kvm/kvm_main.c | 81 +++ 2 files changed

[PATCH 09/11] KVM: Add assigned_device_msi_dispatch()

2008-11-19 Thread Sheng Yang
The function is used to dispatch MSI to lapic according to MSI message address and message data. Signed-off-by: Sheng Yang <[EMAIL PROTECTED]> --- virt/kvm/kvm_main.c | 54 +++ 1 files changed, 54 insertions(+), 0 deletions(-) diff --git

[PATCH 04/11] KVM: Clean up assigned_device_update_irq

2008-11-19 Thread Sheng Yang
Signed-off-by: Sheng Yang <[EMAIL PROTECTED]> --- virt/kvm/kvm_main.c | 10 -- 1 files changed, 4 insertions(+), 6 deletions(-) diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c index 638de47..2089f8b 100644 --- a/virt/kvm/kvm_main.c +++ b/virt/kvm/kvm_main.c @@ -180,11 +

[PATCH 11/11] KVM: MSI to INTx translate

2008-11-19 Thread Sheng Yang
Now we use MSI as default one, and translate MSI to INTx when guest need INTx rather than MSI. For legacy device, we provide support for non-sharing host IRQ. Provide a parameter msi2intx for this method. The value is true by default. Signed-off-by: Sheng Yang <[EMAIL PROTECTED]> --- vi

Re: 2.6.27.5 guest boot failure using in-kernel PIT

2008-11-20 Thread Sheng Yang
On Friday 21 November 2008 06:05:17 Eduardo Habkost wrote: > On Thu, Nov 20, 2008 at 12:22:53PM -0200, Eduardo Habkost wrote: > > Hi, > > > > When using a kvm.git kernel as host, I am getting guest boot failures > > when booting Fedora Rawhide kernel (2.6.27.5-117.fc10.x86_64). Guest > > stops boot

[PATCH 1/4] Add dependence for libpci

2008-11-21 Thread Sheng Yang
Signed-off-by: Sheng Yang <[EMAIL PROTECTED]> --- qemu/Makefile.target |2 +- qemu/configure | 19 +++ 2 files changed, 20 insertions(+), 1 deletions(-) diff --git a/qemu/Makefile.target b/qemu/Makefile.target index 58c816e..48b4493 100644 --- a/qemu/Makefile.

[PATCH 3/4] Support for device capability

2008-11-21 Thread Sheng Yang
This framework can be easily extended to support device capability, like MSI/MSI-x. Signed-off-by: Sheng Yang <[EMAIL PROTECTED]> --- qemu/hw/device-assignment.c | 96 -- qemu/hw/device-assignment.h |3 + 2 files changed, 94 insertions

[PATCH 4/4] Add MSI capability support

2008-11-21 Thread Sheng Yang
Now QEmu emulate a configuration space of capability region, and provide MSI capability here. Signed-off-by: Sheng Yang <[EMAIL PROTECTED]> --- qemu/hw/device-assignment.c | 61 +++--- qemu/hw/device-assignment.h |3 ++ 2 files changed, 59 inse

[PATCH 0/4] Userspace for MSI support of KVM

2008-11-21 Thread Sheng Yang
Hi Avi & Anthony Here is the userspace for MSI support of KVM. One key here is I changed QEmu to depends on libpci now. Comments are welcome! Thanks. -- regards Yang, Sheng -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to [EMAIL PROTECTED] More majord

[PATCH 2/4] Figure out device capability

2008-11-21 Thread Sheng Yang
AIL PROTECTED]> Signed-off-by: Sheng Yang <[EMAIL PROTECTED]> --- qemu/hw/device-assignment.c | 50 +++ qemu/hw/device-assignment.h |5 2 files changed, 55 insertions(+), 0 deletions(-) diff --git a/qemu/hw/device-assignment.c b/qemu/hw/device-

[PATCH] Make QEmu depends on libpci

2008-11-21 Thread Sheng Yang
libpci is handy to handle some pci device related things. This is the same as first patch I sent in MSI userspace patchset in kvm mailing list, and this one is based on QEmu upstream. Signed-off-by: Sheng Yang <[EMAIL PROTECTED]> --- Makefile.target |2 +- configure

Re: [PATCH] Make QEmu depends on libpci

2008-11-21 Thread Sheng Yang
On Friday 21 November 2008 22:10:59 Anthony Liguori wrote: > Sheng Yang wrote: > > libpci is handy to handle some pci device related things. > > > > This is the same as first patch I sent in MSI userspace patchset in kvm > > mailing list, and this one is based on QEmu up

Re: [PATCH 05/11] KVM: Add fields for MSI device assignment

2008-11-23 Thread Sheng Yang
On Sunday 23 November 2008 18:10:47 Avi Kivity wrote: > Sheng Yang wrote: > > Prepared for kvm_arch_assigned_device_msi_dispatch(). > > > > @@ -507,10 +507,17 @@ struct kvm_assigned_irq { > > __u32 guest_irq; > > __u32 flags; >

Re: [PATCH 07/11] x86: Rename MSI macro name

2008-11-23 Thread Sheng Yang
On Sunday 23 November 2008 18:12:54 Avi Kivity wrote: > Sheng Yang wrote: > > Signed-off-by: Sheng Yang <[EMAIL PROTECTED]> > > --- > > arch/x86/include/asm/msidef.h |4 ++-- > > arch/x86/kernel/io_apic.c |4 ++-- > > 2 files changed, 4 insertion

Re: [PATCH 09/11] KVM: Add assigned_device_msi_dispatch()

2008-11-23 Thread Sheng Yang
On Sunday 23 November 2008 18:22:47 Avi Kivity wrote: > Sheng Yang wrote: > > The function is used to dispatch MSI to lapic according to MSI message > > address and message data. > > > > + > > + deliver_bitmask = kvm_ioapic_get_delivery_bitmask(ioapic, > &

[PATCH 4/9] KVM: Clean up assigned_device_update_irq

2008-11-23 Thread Sheng Yang
Signed-off-by: Sheng Yang <[EMAIL PROTECTED]> --- virt/kvm/kvm_main.c | 10 -- 1 files changed, 4 insertions(+), 6 deletions(-) diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c index 638de47..2089f8b 100644 --- a/virt/kvm/kvm_main.c +++ b/virt/kvm/kvm_main.c @@ -180,11 +

[PATCH 1/9] KVM: Move ack notifier register and IRQ sourcd ID request

2008-11-23 Thread Sheng Yang
Distinguish common part for device assignment and INTx part, perparing for refactor later. Signed-off-by: Sheng Yang <[EMAIL PROTECTED]> --- virt/kvm/kvm_main.c | 30 +++--- 1 files changed, 19 insertions(+), 11 deletions(-) diff --git a/virt/kvm/kvm_main.c b/vi

[PATCH 0/9][v6] Enable MSI for KVM

2008-11-23 Thread Sheng Yang
Hi MSI patchset v6 is coming... v5->v6 Addressed all comments from Avi on v5. I also set msi2intx=0 in non-x86 architecture machines. And the TODO list after this patchset: 1. A independence IOCTL to deliver MSI message data/address and related info, so that kvm_set_irq() can deliver MSI messa

[PATCH 7/9] KVM: Add assigned_device_msi_dispatch()

2008-11-23 Thread Sheng Yang
The function is used to dispatch MSI to lapic according to MSI message address and message data. Signed-off-by: Sheng Yang <[EMAIL PROTECTED]> --- virt/kvm/kvm_main.c | 55 +++ 1 files changed, 55 insertions(+), 0 deletions(-) diff --git

[PATCH 6/9] KVM: Export ioapic_get_delivery_bitmask

2008-11-23 Thread Sheng Yang
It would be used for MSI in device assignment, for MSI dispatch. Signed-off-by: Sheng Yang <[EMAIL PROTECTED]> --- virt/kvm/ioapic.c |7 --- virt/kvm/ioapic.h |2 ++ 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/virt/kvm/ioapic.c b/virt/kvm/ioapic.c index c

[PATCH 5/9] KVM: Add fields for MSI device assignment

2008-11-23 Thread Sheng Yang
Prepared for kvm_arch_assigned_device_msi_dispatch(). Signed-off-by: Sheng Yang <[EMAIL PROTECTED]> --- include/linux/kvm.h |7 +++ include/linux/kvm_host.h |4 2 files changed, 11 insertions(+), 0 deletions(-) diff --git a/include/linux/kvm.h b/include/linux/kvm.h

[PATCH 3/9] KVM: Replace irq_requested with more generic irq_requested_type

2008-11-23 Thread Sheng Yang
Separate guest irq type and host irq type, for we can support guest using INTx with host using MSI (but not opposite combination). Signed-off-by: Sheng Yang <[EMAIL PROTECTED]> --- include/linux/kvm_host.h |4 +++- virt/kvm/kvm_main.c |9 + 2 files changed, 8 inse

[PATCH 8/9] KVM: Enable MSI for device assignment

2008-11-23 Thread Sheng Yang
rn -ENOTTY with KVM_DEV_IRQ_ASSIGN_ENABLE_MSI. Userspace can tell the support of MSI device from #ifdef KVM_CAP_DEVICE_MSI. Signed-off-by: Sheng Yang <[EMAIL PROTECTED]> --- include/linux/kvm.h |3 ++ virt/kvm/kvm_main.c | 81 +++ 2 files changed

[PATCH 2/9] KVM: Separate update irq to a single function

2008-11-23 Thread Sheng Yang
Separate INTx enabling part to a independence function, so that we can add MSI enabling part easily. Signed-off-by: Sheng Yang <[EMAIL PROTECTED]> --- virt/kvm/kvm_main.c | 68 -- 1 files changed, 38 insertions(+), 30 deletions(-) diff -

[PATCH 9/9] KVM: MSI to INTx translate

2008-11-23 Thread Sheng Yang
;t work in this mode. Signed-off-by: Sheng Yang <[EMAIL PROTECTED]> --- virt/kvm/kvm_main.c | 70 +++--- 1 files changed, 54 insertions(+), 16 deletions(-) diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c index bf36ae9..54d25e6 10064

Re: [PATCH 3/4] Support for device capability

2008-11-23 Thread Sheng Yang
On Sunday 23 November 2008 20:28:21 Avi Kivity wrote: > Sheng Yang wrote: > > This framework can be easily extended to support device capability, like > > MSI/MSI-x. > > At least some of this should go into pci.c, so non-assigned devices can > benefit. So you means a

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

2008-11-24 Thread Sheng Yang
Signed-off-by: Sheng Yang <[EMAIL PROTECTED]> --- 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 9a790c6..786b2f0 100644 --- a/qemu/hw/device-assign

[PATCH 4/5] Support for device capability

2008-11-24 Thread Sheng Yang
This framework can be easily extended to support device capability, like MSI/MSI-x. Signed-off-by: Sheng Yang <[EMAIL PROTECTED]> --- qemu/hw/pci.c | 85 + qemu/hw/pci.h | 30 2 files changed, 115 insertions

[PATCH 0/5][v2] Userspace for MSI support of KVM

2008-11-24 Thread Sheng Yang
Hi Avi & Anthony Here is the userspace for MSI support of KVM. Main change from v1: Make device assignment depends on libpci. Move capability framework to pci.c (this patch may can be accepted by QEmu). Thanks! -- regards Yang, Sheng -- To unsubscribe from this list: send the line "unsubscribe k

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

2008-11-24 Thread Sheng Yang
Which is used later for capability detection. Signed-off-by: Sheng Yang <[EMAIL PROTECTED]> --- qemu/Makefile.target |1 + qemu/configure | 20 2 files changed, 21 insertions(+), 0 deletions(-) diff --git a/qemu/Makefile.target b/qemu/Makefile.target

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

2008-11-24 Thread Sheng Yang
Signed-off-by: Sheng Yang <[EMAIL PROTECTED]> --- qemu/hw/device-assignment.c | 90 +++--- qemu/hw/device-assignment.h |2 + 2 files changed, 85 insertions(+), 7 deletions(-) diff --git a/qemu/hw/device-assignment.c b/qemu/hw/device-assignment.c

[PATCH 3/5] Figure out device capability

2008-11-24 Thread Sheng Yang
AIL PROTECTED]> Signed-off-by: Sheng Yang <[EMAIL PROTECTED]> --- qemu/hw/device-assignment.c | 50 +++ qemu/hw/device-assignment.h |5 2 files changed, 55 insertions(+), 0 deletions(-) diff --git a/qemu/hw/device-assignment.c b/qemu/hw/device-

[PATCH 3/5] Figure out device capability

2008-11-24 Thread Sheng Yang
generic.) Signed-off-by: Allen Kay <[EMAIL PROTECTED]> Signed-off-by: Sheng Yang <[EMAIL PROTECTED]> --- qemu/hw/device-assignment.c | 50 +++ qemu/hw/device-assignment.h |5 2 files changed, 55 insertions(+), 0 deletions(-) diff --g

Re: [PATCH 05/11] KVM: Add fields for MSI device assignment

2008-11-25 Thread Sheng Yang
On Tue, Nov 25, 2008 at 04:49:49PM +0200, Avi Kivity wrote: > Avi Kivity wrote: >>> (In fact, PCI spec defined message data length is u64, but as you >>> see, now msi_msg for whole Linux only have u32...) >>> >> >> Well in that case please define data as __u64, so we don't have >> surprises

Re: [PATCH 0/5][v2] Userspace for MSI support of KVM

2008-11-26 Thread Sheng Yang
On Monday 24 November 2008 19:50:30 Sheng Yang wrote: > Hi Avi & Anthony > > Here is the userspace for MSI support of KVM. > > Main change from v1: > Make device assignment depends on libpci. > Move capability framework to pci.c (this patch may can be accepted by >

Re: [PATCH 5/5] kvm: expose MSI capability to guest

2008-11-26 Thread Sheng Yang
On Monday 24 November 2008 19:50:35 Sheng Yang wrote: > Signed-off-by: Sheng Yang <[EMAIL PROTECTED]> Oh, hold this one for a moment... I don't want to deal with compatible problem of deliver msi_msg, so I would send out gsi->msi mapping patch and update the userspace patch.

[PATCH 1/1] KVM: Correct deassign device ioctl to IOW

2009-03-17 Thread Sheng Yang
It's IOR by mistake, so fix it before release. Signed-off-by: Sheng Yang --- include/linux/kvm.h |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/include/linux/kvm.h b/include/linux/kvm.h index f8abdbf..ee755e2 100644 --- a/include/linux/kvm.h +++ b/include/linux/

[PATCH] kvm: Move device capability init earlier

2009-03-19 Thread Sheng Yang
For if assign_irq() is called before capability init, it don't know device support MSI or not for the first time calling. So it won't enable MSI2INTx... Signed-off-by: Sheng Yang --- qemu/hw/device-assignment.c | 10 +- 1 files changed, 5 insertions(+), 5 deletions(-) di

Re: [PATCH 2/2] Interrupt unhalts vcpu when it shouldn't

2009-03-23 Thread Sheng Yang
On Monday 23 March 2009 23:17:42 Avi Kivity wrote: > Avi Kivity wrote: > > Gleb Natapov wrote: > >> kvm_vcpu_block() unhalts vpu on an interrupt/timer without checking > >> if interrupt window is actually opened. > >> > >> > >> +static int svm_interrupt_allowed(struct kvm_vcpu *vcpu) > >> +{ > >> +

[PATCH 1/1] KVM: Correct wrong vmcs reading

2009-03-24 Thread Sheng Yang
Some 64bit reading should be natrual wide reading... Signed-off-by: Sheng Yang --- arch/x86/kvm/vmx.c | 12 ++-- 1 files changed, 6 insertions(+), 6 deletions(-) diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c index d3919ac..ab736f6 100644 --- a/arch/x86/kvm/vmx.c +++ b/arch/x86

Re: Luvalley project: running KVM without Linux

2009-03-25 Thread Sheng Yang
On Thursday 26 March 2009 11:56:20 Jun Koi wrote: > Very cool! Who is behind this project? Intel? Not us... According to http://lists.centos.org/pipermail/centos-promo/2009- February/000402.html, it is "the Operating System Engineering Research Center in China." -- regards Yang, Sheng > > I w

[PATCH] KVM: Fix one line MMU comment

2009-03-26 Thread Sheng Yang
From: Eddie Dong The original one is for the code before reconstruct. Signed-off-by: Yaozu (Eddie) Dong Signed-off-by: Sheng Yang --- arch/x86/kvm/paging_tmpl.h |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/arch/x86/kvm/paging_tmpl.h b/arch/x86/kvm/paging_tmpl.h

Re: EPT support breakage on: KVM: VMX: Zero ept module parameter if ept is not present

2009-03-31 Thread Sheng Yang
Oops... Thanks very much for reporting! I can't believe we haven't awared of that... Could you please try the attached patch? Thanks! diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c index aba41ae..8d6465b 100644 --- a/arch/x86/kvm/vmx.c +++ b/arch/x86/kvm/vmx.c @@ -1195,15 +1195,6 @@ static

[PATCH 1/2] KVM: VMX: Clean up Flex Priority related

2009-04-01 Thread Sheng Yang
And clean paranthes on returns. Signed-off-by: Sheng Yang --- arch/x86/kvm/vmx.c | 47 ++- 1 files changed, 30 insertions(+), 17 deletions(-) diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c index aba41ae..1caa1fc 100644 --- a/arch/x86/kvm

[PATCH 2/2] KVM: VMX: Fix feature testing

2009-04-01 Thread Sheng Yang
The testing of feature is too early now, before vmcs_config complete initialization. Signed-off-by: Sheng Yang --- arch/x86/kvm/vmx.c | 18 +- 1 files changed, 9 insertions(+), 9 deletions(-) diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c index 1caa1fc..7d7b0d6 100644

[PATCH] KVM: Discard reserved bits checking on PDE bit 7-8

2009-04-01 Thread Sheng Yang
Signed-off-by: Sheng Yang --- arch/x86/kvm/mmu.c |7 --- 1 files changed, 4 insertions(+), 3 deletions(-) diff --git a/arch/x86/kvm/mmu.c b/arch/x86/kvm/mmu.c index e0f63b6..a0b130d 100644 --- a/arch/x86/kvm/mmu.c +++ b/arch/x86/kvm/mmu.c @@ -2196,7 +2196,7 @@ static void reset_rsvds_b

Re: Commit 3d28613c225ba94062950dacbb2304b2d2024abc breaks linux boot

2009-04-02 Thread Sheng Yang
On Friday 03 April 2009 05:15:03 Ryan Harper wrote: > * Gleb Natapov [2009-04-01 09:54]: > > On Wed, Apr 01, 2009 at 05:49:08PM +0300, Avi Kivity wrote: > > > Gleb Natapov wrote: > > >> Commit 3d28613c225ba94062950dacbb2304b2d2024abc break linux boot. > > >> It hangs after printing: > > >> SMP al

Re: [kvm] [PATCH 06/16] Support for device capability

2009-04-06 Thread Sheng Yang
On Saturday 04 April 2009 03:23:31 Alex Williamson wrote: > On Tue, 2009-03-17 at 11:50 +0800, Sheng Yang wrote: > > This framework can be easily extended to support device capability, like > > MSI/MSI-x. > > Sheng, > > Are you already looking at adding support for PM

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

2009-04-06 Thread Sheng Yang
On Saturday 04 April 2009 05:27:43 Alex Williamson wrote: > On Tue, 2009-03-17 at 11:50 +0800, Sheng Yang wrote: > > +if (*ctrl_word & PCI_MSIX_ENABLE) { > > +if (assigned_dev_update_msix_mmio(pci_dev) < 0) { > > +perror(&q

Re: [RFC PATCH] PCI pass-through fixups

2009-04-06 Thread Sheng Yang
On Tuesday 07 April 2009 08:02:10 Chris Wright wrote: > * Alex Williamson (alex.william...@hp.com) wrote: > > I'm wondering if we need a spot for device specific fixups for PCI > > pass-through. In the example below, I want to expose a single port of > > an Intel 82571EB quad port copper NIC to a

Re: [PATCH 1/3] Make kvm_cpu_(has|get)_interrupt() work for userspace irqchip too.

2009-04-07 Thread Sheng Yang
On Tuesday 07 April 2009 17:08:12 Gleb Natapov wrote: > Signed-off-by: Gleb Natapov > --- > > arch/x86/kvm/irq.c | 39 +++ > arch/x86/kvm/svm.c | 11 +++ > arch/x86/kvm/vmx.c | 18 +- > arch/x86/kvm/x86.c |4 ++-- > 4 files cha

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

2009-04-07 Thread Sheng Yang
On Wednesday 08 April 2009 00:38:10 Alex Williamson wrote: > On Tue, 2009-04-07 at 14:09 +0800, Sheng Yang wrote: > > On Saturday 04 April 2009 05:27:43 Alex Williamson wrote: > > > Do we need some disable logic here? If I toggle a bnx2 NIC in a guest, > > > I get the

[PATCH] kvm: Fix wrong counting of MSI-X table size

2009-04-07 Thread Sheng Yang
The PCI spec said... System software reads this field to determine the MSI-X Table Size *N*, which is encoded as *N-1*. For example, a returned value of “011” indicates a table size of 4. Signed-off-by: Sheng Yang --- qemu/hw/device-assignment.c |1 + 1 files changed, 1 insertions

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

2009-04-08 Thread Sheng Yang
On Thursday 09 April 2009 00:13:56 Alex Williamson wrote: > Hi Sheng, > > On Wed, 2009-04-08 at 10:26 +0800, Sheng Yang wrote: > > On Wednesday 08 April 2009 00:38:10 Alex Williamson wrote: > > > On Tue, 2009-04-07 at 14:09 +0800, Sheng Yang wrote: > > > > Could

[PATCH 1/1] kvm: don't check per-vector mask bit before enable MSI-X

2009-04-08 Thread Sheng Yang
vector by if msg_data is zero. Signed-off-by: Sheng Yang --- qemu/hw/device-assignment.c |3 --- 1 files changed, 0 insertions(+), 3 deletions(-) diff --git a/qemu/hw/device-assignment.c b/qemu/hw/device-assignment.c index f33ce3c..1f0a1a7 100644 --- a/qemu/hw/device-assignment.c +++ b/qemu

Re: [PATCH] kvm: Fix overlapping check for memory slots

2009-04-12 Thread Sheng Yang
On Saturday 11 April 2009 17:48:04 Jan Kiszka wrote: > This nice little buglet complicates a smarter slot management in qemu > user space just "slightly". Sigh... > > > > > When checking for overlapping slots on registration of a new one, kvm > currently also considers zero-length (ie. dele

Re: [PATCH] kvm: Fix overlapping check for memory slots

2009-04-13 Thread Sheng Yang
On Monday 13 April 2009 16:50:40 Jan Kiszka wrote: > Sheng Yang wrote: > > On Saturday 11 April 2009 17:48:04 Jan Kiszka wrote: > >> This nice little buglet complicates a smarter slot management in qemu > >> user space just "slightly". Sigh... > >&

Re: [PATCH 00/15] interrupt injection rework

2009-04-13 Thread Sheng Yang
On Monday 13 April 2009 19:51:59 Avi Kivity wrote: > Gleb Natapov wrote: > > Hi, > > > > This patch series aims to consolidate IRQ injection code for in kernel > > IRQ chip and userspace one. Also to move IRQ injection logic from > > SVM/VMX specific code to x86.c. > > Very nice patchset, removes c

[PATCH] KVM: Enable snooping control for supported hardware

2009-04-23 Thread Sheng Yang
would be a conflict of host memory type then be a potential issue. Snooping control can guarantee the cache correctness of accessing the DMA engine of VT-d. Signed-off-by: Sheng Yang --- arch/x86/include/asm/kvm_host.h |2 ++ arch/x86/kvm/mmu.c | 23

[PATCH] kvm: add iommu_domain_has_cap to module compatible

2009-04-23 Thread Sheng Yang
Signed-off-by: Sheng Yang --- kernel/external-module-compat-comm.h | 13 + kernel/external-module-compat.c |7 +++ 2 files changed, 20 insertions(+), 0 deletions(-) diff --git a/kernel/external-module-compat-comm.h b/kernel/external-module-compat-comm.h index c955927

Re: [PATCH] KVM: Enable snooping control for supported hardware

2009-04-26 Thread Sheng Yang
On Saturday 25 April 2009 06:37:17 Marcelo Tosatti wrote: > Sheng, > > On Thu, Apr 23, 2009 at 04:43:02PM +0800, Sheng Yang wrote: > > Memory aliases with different memory type is a problem for guest. For the > > guest without assigned device, the memory type of guest mem

[PATCH 2/2] KVM: Enable snooping control for supported hardware

2009-04-27 Thread Sheng Yang
would be a conflict of host memory type then be a potential issue. Snooping control can guarantee the cache correctness of memory go through the DMA engine of VT-d. Signed-off-by: Sheng Yang --- arch/x86/include/asm/kvm_host.h |5 - arch/x86/kvm/mmu.c | 16

[PATCH 1/2] KVM: Discard shadow_mt_mask

2009-04-27 Thread Sheng Yang
mt_mask is out of date, now it have only been used as a flag to indicate if TDP enabled. Get rid of it and use tdp_enabled instead. Signed-off-by: Sheng Yang --- arch/x86/include/asm/kvm_host.h |2 +- arch/x86/kvm/mmu.c |8 +++- arch/x86/kvm/vmx.c |3

Re: [PATCH 1/2] KVM: Discard shadow_mt_mask

2009-04-27 Thread Sheng Yang
On Monday 27 April 2009 17:47:44 Sheng Yang wrote: > mt_mask is out of date, now it have only been used as a flag to indicate if > TDP enabled. Get rid of it and use tdp_enabled instead. > (seems my gmail account delayed?) This one break SVM bisect. Would update soon. -- regards Ya

[PATCH 2/2] KVM: Enable snooping control for supported hardware

2009-04-27 Thread Sheng Yang
would be a conflict of host memory type then be a potential issue. Snooping control can guarantee the cache correctness of memory go through the DMA engine of VT-d. Signed-off-by: Sheng Yang --- arch/x86/include/asm/kvm_host.h |2 ++ arch/x86/kvm/vmx.c | 19

[PATCH 1/2] KVM: Replace get_mt_mask_shift with get_mt_mask

2009-04-27 Thread Sheng Yang
Shadow_mt_mask is out of date, now it have only been used as a flag to indicate if TDP enabled. Get rid of it and use tdp_enabled instead. Also put memory type logical in kvm_x86_ops->get_mt_mask(). Signed-off-by: Sheng Yang --- arch/x86/include/asm/kvm_host.h |5 +++-- arch/x86/kvm/mm

Re: [PATCH] kvm-userspace: Make PC speaker emulation aware of in-kernel PIT

2009-04-27 Thread Sheng Yang
On Sunday 26 April 2009 03:59:11 Anthony Liguori wrote: > Jan Kiszka wrote: > > Anthony Liguori wrote: > >> Marcelo Tosatti wrote: > >>> Jan, > >>> > >>> While the patch itself looks fine, IMO it would be better to move all > >>> of the timer handling to userspace, except the performance critical >

Re:

2009-04-27 Thread Sheng Yang
On Monday 27 April 2009 18:41:17 Michael S. Tsirkin wrote: > Sheng, Marcelo, > I've been reading code in qemu/hw/device-assignment.c, and > I have a couple of questions about msi-x implementation: Hi Michael > 1. What is the reason that msix_table_page is allocated >with mmap and not with e.g

Re: qemu/hw/device-assignment: questions about msix_table_page

2009-04-27 Thread Sheng Yang
On Monday 27 April 2009 21:51:34 Michael S. Tsirkin wrote: > On Mon, Apr 27, 2009 at 09:16:14PM +0800, Sheng Yang wrote: > > On Monday 27 April 2009 18:41:17 Michael S. Tsirkin wrote: > > > Sheng, Marcelo, > > > I've been reading code in qemu/hw/device-assignment

Re: qemu/hw/device-assignment: questions about msix_table_page

2009-04-27 Thread Sheng Yang
On Monday 27 April 2009 22:15:04 Michael S. Tsirkin wrote: > On Mon, Apr 27, 2009 at 10:03:59PM +0800, Sheng Yang wrote: > > On Monday 27 April 2009 21:51:34 Michael S. Tsirkin wrote: > > > On Mon, Apr 27, 2009 at 09:16:14PM +0800, Sheng Yang wrote: > > > > On Monday

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