[PATCH] qemu-kvm: fix warnings on 32 bit systems

2009-05-20 Thread Michael S. Tsirkin
size_t must be printed with %zd, not %ld. long constants are UL, not ULL. Signed-off-by: Michael S. Tsirkin --- qemu-kvm.c |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/qemu-kvm.c b/qemu-kvm.c index 5e4002b..ebd6272 100644 --- a/qemu-kvm.c +++ b/qemu-kvm.c @@ -523,7

Re: [PATCH 0/2] Add serial number support for virtio_blk, V2

2009-05-20 Thread Christoph Hellwig
On Mon, May 18, 2009 at 11:00:41AM -0400, john cooper wrote: > Christoph Hellwig wrote: >> On Wed, May 13, 2009 at 01:06:57PM -0400, john cooper wrote: >>> [Resend of earlier patch: 1/2 rebased to qemu-kvm, >>> 2/2 minor tweak] >> >> patch 1/2 seems to be missing. > It is in the kvm and qemu-devel

Re: [PATCH v2] Driver for Inter-VM shared memory device for KVM supporting interrupts.

2009-05-20 Thread Christian Bornträger
Am Mittwoch 20 Mai 2009 04:58:38 schrieb Rusty Russell: > On Wed, 20 May 2009 02:21:08 am Cam Macdonell wrote: > > Avi Kivity wrote: > > > Christian Bornträger wrote: > > >>> To summarize, Anthony thinks it should use virtio, while I believe > > >>> virtio is useful for exporting guest memory, not

Re: [PATCH v2] Driver for Inter-VM shared memory device for KVM supporting interrupts.

2009-05-20 Thread Christian Bornträger
Am Dienstag 19 Mai 2009 20:39:24 schrieb Anthony Liguori: > Perhaps something that maps closer to the current add_buf/get_buf API. > Something like: > > struct iovec *(*map_buf)(struct virtqueue *vq, unsigned int *out_num, > unsigned int *in_num); > void (*unmap_buf)(struct virtqueue *vq, struct io

Re: [PATCH 0/2] Add serial number support for virtio_blk, V2

2009-05-20 Thread Gleb Natapov
On Wed, May 20, 2009 at 03:31:29AM -0400, Christoph Hellwig wrote: > On Mon, May 18, 2009 at 11:00:41AM -0400, john cooper wrote: > > Christoph Hellwig wrote: > >> On Wed, May 13, 2009 at 01:06:57PM -0400, john cooper wrote: > >>> [Resend of earlier patch: 1/2 rebased to qemu-kvm, > >>> 2/2 minor t

Re: [PATCH][KVM][retry 3] Add support for Pause Filtering to AMD SVM

2009-05-20 Thread Ingo Molnar
* Mark Langsdorf wrote: > diff --git a/include/linux/sched.h b/include/linux/sched.h > index b4c38bc..683bc65 100644 > --- a/include/linux/sched.h > +++ b/include/linux/sched.h > @@ -2283,6 +2283,9 @@ static inline unsigned int task_cpu(const struct > task_struct *p) > return task_thread_

Re: [PATCH][KVM][retry 3] Add support for Pause Filtering to AMD SVM

2009-05-20 Thread Peter Zijlstra
On Tue, 2009-05-19 at 13:56 -0500, Mark Langsdorf wrote: > @@ -1947,6 +1947,11 @@ task_hot(struct task_struct *p, u64 now, struct > sched_domain *sd) > return delta < (s64)sysctl_sched_migration_cost; > } > > +void set_task_delay(struct task_struct *p, unsigned int delay) > +{ > +

Re: [PATCH v2] Driver for Inter-VM shared memory device for KVM supporting interrupts.

2009-05-20 Thread François Diakhate
On Wed, May 20, 2009 at 4:58 AM, Rusty Russell wrote: > The only interesting idea I can think of is exposing it to userspace, and > having that run some protocol across it for fast app <-> app comms. But if > that's your plan, you still have a lot of code the write! > > So I guess I'm missing th

Re: kvm guest debug using gdb on x86

2009-05-20 Thread Jan Kiszka
Aneesh Kumar K.V wrote: > On Wed, May 20, 2009 at 12:23:12AM +0530, Aneesh Kumar K.V wrote: >> Hi, >> >> With the latest qemu-kvm and 2.6.30-rc6 kernel i am not able to get >> the guest debugging with gdb. I get the following error. >> >> $gdb ./vmlinux >> GNU gdb 6.8-debian >> Copyright (C) 2008 F

Re: [PATCH -tip] x86: kvm replace MSR_IA32_TIME_STAMP_COUNTER with MSR_IA32_TSC of msr-index.h

2009-05-20 Thread Jaswinder Singh Rajput
Hello Avi, On Sun, 2009-05-17 at 21:48 +0300, Avi Kivity wrote: > Jaswinder Singh Rajput wrote: > > If this patch looks sane to you can apply in kvm tree. > > > > Here is the updated patch based on kvm tree: > > > > [PATCH] x86: kvm replace MSR_IA32_TIME_STAMP_COUNTER with MSR_IA32_TSC of > > msr

Re: [PATCH v2 2/2] Intel-IOMMU, intr-remap: source-id checking

2009-05-20 Thread Ingo Molnar
* Eric W. Biederman wrote: > Ingo Molnar writes: > > > * Weidong Han wrote: > > > >> To support domain-isolation usages, the platform hardware must be > >> capable of uniquely identifying the requestor (source-id) for each > >> interrupt message. Without source-id checking for interrupt >

Re: [PATCH][KVM][retry 3] Add support for Pause Filtering to AMD SVM

2009-05-20 Thread Avi Kivity
Peter Zijlstra wrote: That said, I still thoroughly dislike this whole approach. Can you explain why? We have a thread that has detected that it's spinning. Keeping on spinning is a waste of cpu time. Why not let something else use the cpu? -- error compiling committee.c: too many arg

RE: [PATCH v2 2/2] Intel-IOMMU, intr-remap: source-id checking

2009-05-20 Thread Han, Weidong
Ingo Molnar wrote: > * Eric W. Biederman wrote: > >> Ingo Molnar writes: >> >>> * Weidong Han wrote: >>> To support domain-isolation usages, the platform hardware must be capable of uniquely identifying the requestor (source-id) for each interrupt message. Without source-id che

Re: kvm guest debug using gdb on x86

2009-05-20 Thread Aneesh Kumar K.V
On Wed, May 20, 2009 at 10:10:59AM +0200, Jan Kiszka wrote: > Aneesh Kumar K.V wrote: > > On Wed, May 20, 2009 at 12:23:12AM +0530, Aneesh Kumar K.V wrote: > >> Hi, > >> > >> With the latest qemu-kvm and 2.6.30-rc6 kernel i am not able to get > >> the guest debugging with gdb. I get the following e

Re: [PATCH][KVM][retry 3] Add support for Pause Filtering to AMD SVM

2009-05-20 Thread Peter Zijlstra
On Wed, 2009-05-20 at 11:38 +0300, Avi Kivity wrote: > Peter Zijlstra wrote: > > That said, I still thoroughly dislike this whole approach. > > > > Can you explain why? We have a thread that has detected that it's > spinning. Keeping on spinning is a waste of cpu time. Why not let > someth

Re: [PATCH v2] Driver for Inter-VM shared memory device for KVM supporting interrupts.

2009-05-20 Thread Avi Kivity
Christian Bornträger wrote: o shared guest kernels: The CMS operating system is build as a bootable DCSS (called named-saved-segments NSS). All guests have the same host pages for the read-only parts of the CMS kernel. The local data is stored in exclusive-write parts of the same NSS. Linux

Re: KVM_ASSIGN_SET_MSIX_NR and KVM_ASSIGN_SET_MSIX_ENTRY should support MSI?

2009-05-20 Thread Sheng Yang
On Tuesday 05 May 2009 19:29:14 Gregory Haskins wrote: > Michael S. Tsirkin wrote: > > The new KVM_ASSIGN_SET_MSIX_NR and KVM_ASSIGN_SET_MSIX_ENTRY ioctls have > > been merged for 2.6.30. However, I note that PCI spec allows devices to > > support multiple vectors with MSI as well (support will be

Re: [PATCH][KVM][retry 3] Add support for Pause Filtering to AMD SVM

2009-05-20 Thread Avi Kivity
Peter Zijlstra wrote: That said, I still thoroughly dislike this whole approach. Can you explain why? We have a thread that has detected that it's spinning. Keeping on spinning is a waste of cpu time. Why not let something else use the cpu? Because its a polling interface. I

Re: [PATCH][KVM][retry 3] Add support for Pause Filtering to AMD SVM

2009-05-20 Thread Peter Zijlstra
On Wed, 2009-05-20 at 11:49 +0300, Avi Kivity wrote: > Peter Zijlstra wrote: > >>> That said, I still thoroughly dislike this whole approach. > >>> > >>> > >> Can you explain why? We have a thread that has detected that it's > >> spinning. Keeping on spinning is a waste of cpu time. W

Re: kvm guest debug using gdb on x86

2009-05-20 Thread Jan Kiszka
Aneesh Kumar K.V wrote: > On Wed, May 20, 2009 at 10:10:59AM +0200, Jan Kiszka wrote: >> Aneesh Kumar K.V wrote: >>> On Wed, May 20, 2009 at 12:23:12AM +0530, Aneesh Kumar K.V wrote: Hi, With the latest qemu-kvm and 2.6.30-rc6 kernel i am not able to get the guest debugging with

Re: [PATCH v2] Shared memory device with interrupt support

2009-05-20 Thread Avi Kivity
Anthony Liguori wrote: Avi Kivity wrote: Anthony Liguori wrote: I'd strongly recommend working these patches on qemu-devel and lkml. I suspect Avi may disagree with me, but in order for this to be eventually merged in either place, you're going to have additional requirements put on you. I

Re: kvm guest debug using gdb on x86

2009-05-20 Thread Aneesh Kumar K.V
On Wed, May 20, 2009 at 10:57:21AM +0200, Jan Kiszka wrote: > Aneesh Kumar K.V wrote: > > On Wed, May 20, 2009 at 10:10:59AM +0200, Jan Kiszka wrote: > >> Aneesh Kumar K.V wrote: > >>> On Wed, May 20, 2009 at 12:23:12AM +0530, Aneesh Kumar K.V wrote: > Hi, > > With the latest qemu-kv

Re: [PATCH][KVM][retry 3] Add support for Pause Filtering to AMD SVM

2009-05-20 Thread Avi Kivity
Peter Zijlstra wrote: It's a fully virtualized guest. There's no way to get this without patching the guest kernel. Yes there is.. virtualized monitor-wait stuff coupled with a monitor-wait based spinlock implementation. That only works if the guest uses monitor/mwait. Not all o

Re: [PATCH v2] Driver for Inter-VM shared memory device for KVM supporting interrupts.

2009-05-20 Thread Christian Bornträger
Am Mittwoch 20 Mai 2009 10:45:50 schrieb Avi Kivity: > Christian Bornträger wrote: > > o shared guest kernels: The CMS operating system is build as a bootable > > DCSS (called named-saved-segments NSS). All guests have the same host > > pages for the read-only parts of the CMS kernel. The local dat

Re: [PATCH][KVM][retry 3] Add support for Pause Filtering to AMD SVM

2009-05-20 Thread Peter Zijlstra
On Wed, 2009-05-20 at 12:04 +0300, Avi Kivity wrote: > Peter Zijlstra wrote: > >> It's a fully virtualized guest. There's no way to get this without > >> patching the guest kernel. > >> > > > > Yes there is.. virtualized monitor-wait stuff coupled with a > > monitor-wait based spinlock impl

Re: [PATCH v2] Driver for Inter-VM shared memory device for KVM supporting interrupts.

2009-05-20 Thread Avi Kivity
Christian Bornträger wrote: Am Mittwoch 20 Mai 2009 10:45:50 schrieb Avi Kivity: Christian Bornträger wrote: o shared guest kernels: The CMS operating system is build as a bootable DCSS (called named-saved-segments NSS). All guests have the same host pages for the read-only parts of the

Re: [PATCH][KVM][retry 3] Add support for Pause Filtering to AMD SVM

2009-05-20 Thread Avi Kivity
Peter Zijlstra wrote: It's a fully virtualized guest. There's no way to get this without patching the guest kernel. Yes there is.. virtualized monitor-wait stuff coupled with a monitor-wait based spinlock implementation. That only works if the guest uses monitor/mwait.

Re: [PATCH v2] Driver for Inter-VM shared memory device for KVM supporting interrupts.

2009-05-20 Thread Christian Bornträger
Am Mittwoch 20 Mai 2009 11:11:57 schrieb Avi Kivity: > > Yes, KSM is easier and it even finds duplicate data pages. > > On the other hand it does only provide memory saving. It does not speedup > > application startup like execute-in-place (major page faults become minor > > page faults for text pa

Re: kvm building issue

2009-05-20 Thread Avi Kivity
Nitin A Kamble wrote: Hi Avi, I am trying to build the kvm with changed repositories. I was trying to follow the instructions from here: http://www.linux-kvm.org/page/Code. Especially this section: "building an external module with older kernels" from that page. I find the kernel directory is

Re: kvm-autotest: The automation plans?

2009-05-20 Thread jason wang
sudhir kumar 写道: > 2009/5/14 sudhir kumar : > >> On Thu, May 14, 2009 at 12:22 PM, jason wang wrote: >> >>> sudhir kumar 写道: >>> Hi Uri/Lucas, Do you have any plans for enhancing kvm-autotest? I was looking mainly on the following 2 aspects: (1). w

Re: kvm guest debug using gdb on x86

2009-05-20 Thread Jan Kiszka
Aneesh Kumar K.V wrote: > On Wed, May 20, 2009 at 10:57:21AM +0200, Jan Kiszka wrote: >> Aneesh Kumar K.V wrote: >>> On Wed, May 20, 2009 at 10:10:59AM +0200, Jan Kiszka wrote: Aneesh Kumar K.V wrote: > On Wed, May 20, 2009 at 12:23:12AM +0530, Aneesh Kumar K.V wrote: >> Hi, >> >>>

Re: [PATCH v2 2/2] Intel-IOMMU, intr-remap: source-id checking

2009-05-20 Thread Joerg Roedel
On Wed, May 20, 2009 at 10:21:14AM +0200, Ingo Molnar wrote: > > * Eric W. Biederman wrote: > > Being a major nitpick, I have to point out that the code is not > > structured to support other iommus, and I think AMD has one that > > can do this as well. > > (Joerg Cc:-ed) The AMD IOMMU does a

Re: kvm guest debug using gdb on x86

2009-05-20 Thread Jan Kiszka
Jan Kiszka wrote: > Aneesh Kumar K.V wrote: >> On Wed, May 20, 2009 at 10:57:21AM +0200, Jan Kiszka wrote: >>> Aneesh Kumar K.V wrote: On Wed, May 20, 2009 at 10:10:59AM +0200, Jan Kiszka wrote: > Aneesh Kumar K.V wrote: >> On Wed, May 20, 2009 at 12:23:12AM +0530, Aneesh Kumar K.V wro

Guest OS cannot detect keystrokes/mouse clicks after system_reset

2009-05-20 Thread Sachin Sant
I used system_reset command from QEMU prompt with a SLES 11 Guest. After a reset the guest came up fine with the exception that neither key strokes nor mouse click worked. Host OS Info : CPU Model : Intel(R) Xeon(R) CPU X7350 @ 2.93GHz KVM Version : kvm-84 Host Kernel : uname -

Re: Guest OS cannot detect keystrokes/mouse clicks after system_reset

2009-05-20 Thread Mark McLoughlin
On Wed, 2009-05-20 at 15:25 +0530, Sachin Sant wrote: > > I used system_reset command from QEMU prompt with a SLES 11 > Guest. After a reset the guest came up fine with the exception > that neither key strokes nor mouse click worked. > > Host OS Info : > CPU Model : Intel(R) Xeon(R) CPU

RE: Network I/O performance

2009-05-20 Thread Fischer, Anna
> Subject: Re: Network I/O performance > > Fischer, Anna wrote: > >> Subject: Re: Network I/O performance > >> > >> Fischer, Anna wrote: > >> > >>> I am running KVM with Fedora Core 8 on a 2.6.23 32-bit kernel. I > use > >>> > >> the tun/tap device model and the Linux bridge kernel module to > con

RE: tun/tap and Vlans

2009-05-20 Thread Fischer, Anna
> Subject: Re: tun/tap and Vlans > > Lukas Kolbe wrote: > >> Right, I guess you'd see this with a real switch as well? Maybe > have > >> your guest send a packet out once in a while so the bridge can learn > its > >> MAC address (we do this after migration, for example). > >> > > > > Does this me

Re: Guest OS cannot detect keystrokes/mouse clicks after system_reset

2009-05-20 Thread Sachin Sant
Mark McLoughlin wrote: On Wed, 2009-05-20 at 15:25 +0530, Sachin Sant wrote: I used system_reset command from QEMU prompt with a SLES 11 Guest. After a reset the guest came up fine with the exception that neither key strokes nor mouse click worked. Host OS Info : CPU Model : Intel(R) X

Re: tun/tap and Vlans

2009-05-20 Thread Avi Kivity
Fischer, Anna wrote: Subject: Re: tun/tap and Vlans Lukas Kolbe wrote: Right, I guess you'd see this with a real switch as well? Maybe have your guest send a packet out once in a while so the bridge can learn its MAC address (we do this after migration, for

SLES 10 SP1 guest install fails with scsi drive

2009-05-20 Thread Pradeep K Surisetty
I tried to install SLES 10 SP1 Guest using qemu. Install halts in the early stages of installation when the interface drive is SCSi. But with IDE interface installation is successful. seems to be SCSI emulation issue.. Host OS Info : CPU Model : Dual-Core AMD Opteron(tm) Processor 2218

qemu sles 11 guest failed to boot up after the guest install

2009-05-20 Thread Pradeep K Surisetty
I tried to install SLES 11 Guest using qemu. it doesn't boot it up after successful install and dropping to minimum shell . Seems to be not finding the disk . Host OS Info : CPU Model : Dual-Core AMD Opteron(tm) Processor 2218 Host OS: fedora11 rawhide Host Kernel : uname -a Linux ml

Re: kvm guest debug using gdb on x86

2009-05-20 Thread Avi Kivity
Jan Kiszka wrote: Sigh, confirmed, there is a regression in qemu-kvm. Will dig into this. Hmpf, the regression is also present in qemu upstream in kvm mode. We need gdb tests in kvm-autotest. -- error compiling committee.c: too many arguments to function -- To unsubscribe from this

Re: qemu sles 11 guest failed to boot up after the guest install

2009-05-20 Thread Avi Kivity
Pradeep K Surisetty wrote: 4. After the guest install boot up from the image. qemu-kvm -boot c sles11.raw this command 4 fails to boot up the guest as mentioned above, dropping to minimum shell. Try qemu-kvm -drive file=sles11.raw,boot=on -- error compiling committee.c: too many arguments

[PATCH 01/46] KVM: VMX: Make flexpriority module parameter reflect hardware capability

2009-05-20 Thread Avi Kivity
If the hardware does not support flexpriority, zero the module parameter. Signed-off-by: Avi Kivity --- arch/x86/kvm/vmx.c |7 --- 1 files changed, 4 insertions(+), 3 deletions(-) diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c index b9e06b0..37ae13d 100644 --- a/arch/x86/kvm/vmx.c

[PATCH 03/46] KVM: MMU: Fix comment in page_fault()

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

[PATCH 00/46] KVM updates for the 2.6.31 merge window (batch 2/3)

2009-05-20 Thread Avi Kivity
Second batch of the 2.6.31 merge window submission. Note there will only be three batches instead of four as advertised in the previous message due to a divide failure. Please review. Avi Kivity (3): KVM: VMX: Make flexpriority module parameter reflect hardware capability KVM: MMU: Use d

[PATCH 04/46] KVM: ia64: enable external interrupt in vmm

2009-05-20 Thread Avi Kivity
From: Yang Zhang Currently, the interrupt enable bit is cleared when in the vmm. This patch sets the bit and the external interrupts can be dealt with when in the vmm. This improves the I/O performance. Signed-off-by: Yang Zhang Signed-off-by: Avi Kivity --- arch/ia64/kvm/process.c |5 +

[PATCH 06/46] KVM: MMU: Use different shadows when EFER.NXE changes

2009-05-20 Thread Avi Kivity
A pte that is shadowed when the guest EFER.NXE=1 is not valid when EFER.NXE=0; if bit 63 is set, the pte should cause a fault, and since the shadow EFER always has NX enabled, this won't happen. Fix by using a different shadow page table for different EFER.NXE bits. This allows vcpus to run corre

[PATCH 02/46] KVM: VMX: Correct wrong vmcs field sizes

2009-05-20 Thread Avi Kivity
From: Sheng Yang EXIT_QUALIFICATION and GUEST_LINEAR_ADDRESS are natural width, not 64-bit. Signed-off-by: Sheng Yang Signed-off-by: Avi Kivity --- 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 in

[PATCH 32/46] KVM: Replace kvmclock open-coded get_cpu_var() with the real thing

2009-05-20 Thread Avi Kivity
Suggested by Ingo Molnar. Signed-off-by: Avi Kivity --- arch/x86/kvm/x86.c | 11 ++- 1 files changed, 6 insertions(+), 5 deletions(-) diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c index 0c45df9..a7ea26e 100644 --- a/arch/x86/kvm/x86.c +++ b/arch/x86/kvm/x86.c @@ -627,16 +627,17

[PATCH 41/46] KVM: Make kvm_cpu_(has|get)_interrupt() work for userspace irqchip too

2009-05-20 Thread Avi Kivity
From: Gleb Natapov At the vector level, kernel and userspace irqchip are fairly similar. Signed-off-by: Gleb Natapov Signed-off-by: Avi Kivity --- arch/x86/kvm/irq.c |7 +++ arch/x86/kvm/svm.c | 11 +++ arch/x86/kvm/vmx.c | 18 +- arch/x86/kvm/x86.c |4

[PATCH 44/46] KVM: Use kvm_arch_interrupt_allowed() instead of checking interrupt_window_open directly

2009-05-20 Thread Avi Kivity
From: Gleb Natapov kvm_arch_interrupt_allowed() also checks IF so drop the check. Signed-off-by: Gleb Natapov Signed-off-by: Avi Kivity --- arch/x86/kvm/x86.c |5 ++--- 1 files changed, 2 insertions(+), 3 deletions(-) diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c index 7a572ec..28

[PATCH 39/46] KVM: ia64: ia64 vcpu_reset() do not call kmalloc() with irqs disabled

2009-05-20 Thread Avi Kivity
From: Jes Sorensen Restore local irq enabled state before calling kvm_arch_vcpu_init(), which calls kmalloc(GFP_KERNEL). Signed-off-by: Jes Sorensen Acked-by: Xiantao Zhang Signed-off-by: Avi Kivity --- arch/ia64/kvm/kvm-ia64.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) dif

[PATCH 40/46] KVM: MMU: Fix auditing code

2009-05-20 Thread Avi Kivity
From: Jan Kiszka Fix build breakage of hpa lookup in audit_mappings_page. Moreover, make this function robust against shadow_notrap_nonpresent_pte entries. Signed-off-by: Jan Kiszka Signed-off-by: Avi Kivity --- arch/x86/kvm/mmu.c |8 +--- 1 files changed, 5 insertions(+), 3 deletions

[PATCH 38/46] KVM: ia64: preserve int status through call to kvm_insert_vmm_mapping

2009-05-20 Thread Avi Kivity
From: Jes Sorensen Preserve interrupt status around call to kvm_insert_vmm_mappin() in kvm_vcpu_pre_transition(). Signed-off-by: Jes Sorensen Acked-by: Xiantao Zhang Signed-off-by: Avi Kivity --- arch/ia64/kvm/kvm-ia64.c |7 ++- 1 files changed, 6 insertions(+), 1 deletions(-) diff

[PATCH 22/46] KVM: x86 emulator: Add decoding of 16bit second immediate argument

2009-05-20 Thread Avi Kivity
From: Gleb Natapov Such as segment number in lcall/ljmp Signed-off-by: Gleb Natapov Signed-off-by: Avi Kivity --- arch/x86/kvm/x86_emulate.c |7 +++ 1 files changed, 7 insertions(+), 0 deletions(-) diff --git a/arch/x86/kvm/x86_emulate.c b/arch/x86/kvm/x86_emulate.c index d7c9f6f..c0

[PATCH 42/46] KVM: VMX: Consolidate userspace and kernel interrupt injection for VMX

2009-05-20 Thread Avi Kivity
From: Gleb Natapov Use the same callback to inject irq/nmi events no matter what irqchip is in use. Only from VMX for now. Signed-off-by: Gleb Natapov Signed-off-by: Avi Kivity --- arch/x86/include/asm/kvm_host.h |2 +- arch/x86/kvm/svm.c |2 +- arch/x86/kvm/vmx.c

[PATCH 45/46] KVM: SVM: Coalesce userspace/kernel irqchip interrupt injection logic

2009-05-20 Thread Avi Kivity
From: Gleb Natapov Start to use interrupt/exception queues like VMX does. This also fix the bug that if exit was caused by a guest internal exception access to IDT the exception was not reinjected. Use EVENTINJ to inject interrupts. Use VINT only for detecting when IRQ windows is open again. E

[PATCH 37/46] KVM: ia64: restore irq state before calling kvm_vcpu_init

2009-05-20 Thread Avi Kivity
From: Jes Sorensen Make sure to restore the psr after calling kvm_insert_vmm_mapping() which calls ia64_itr_entry() as it disables local interrupts and kvm_vcpu_init() may sleep. Avoids a warning from the lock debugging code. Signed-off-by: Jes Sorensen Acked-by : Xiantao Zhang Signed-off-by:

[PATCH 43/46] KVM: VMX: Cleanup vmx_intr_assist()

2009-05-20 Thread Avi Kivity
From: Gleb Natapov Signed-off-by: Gleb Natapov Signed-off-by: Avi Kivity --- arch/x86/kvm/vmx.c | 55 --- 1 files changed, 30 insertions(+), 25 deletions(-) diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c index 06252f7..9eb518f 100644 ---

[PATCH 46/46] KVM: Remove exception_injected() callback.

2009-05-20 Thread Avi Kivity
From: Gleb Natapov It always return false for VMX/SVM now. Signed-off-by: Gleb Natapov Signed-off-by: Avi Kivity --- arch/x86/include/asm/kvm_host.h |1 - arch/x86/kvm/svm.c |6 -- arch/x86/kvm/vmx.c |6 -- arch/x86/kvm/x86.c |2 -

[PATCH 36/46] KVM: ia64: remove empty function vti_vcpu_load()

2009-05-20 Thread Avi Kivity
From: Jes Sorensen vti_vcpu_load() doesn't do anything, so lets get rid of it. Signed-off-by: Jes Sorensen Acked-by : Xiantao Zhang Signed-off-by: Avi Kivity --- arch/ia64/kvm/kvm-ia64.c |5 - 1 files changed, 0 insertions(+), 5 deletions(-) diff --git a/arch/ia64/kvm/kvm-ia64.c b/ar

[PATCH 20/46] KVM: Make kvm header C++ friendly

2009-05-20 Thread Avi Kivity
From: nathan binkert Two things needed fixing: 1) g++ does not allow a named structure type within an anonymous union and 2) Avoid name clash between two padding fields within the same struct by giving them different names as is done elsewhere in the header. Signed-off-by: Nathan Binkert Signed

[PATCH 27/46] KVM: x86 emulator: Add unsigned byte immediate decode

2009-05-20 Thread Avi Kivity
From: Gleb Natapov Extend "Source operand type" opcode description field to 4 bites to accommodate new option. Signed-off-by: Gleb Natapov Signed-off-by: Avi Kivity --- arch/x86/kvm/x86_emulate.c | 17 +++-- 1 files changed, 11 insertions(+), 6 deletions(-) diff --git a/arch/x8

[PATCH 18/46] KVM: ia64: make kvm depend on CONFIG_MODULES.

2009-05-20 Thread Avi Kivity
From: Zhang, Xiantao Since kvm-intel modue can't be built-in, make kvm depend on CONFIG_MODULES. Signed-off-by: Xiantao Zhang Signed-off-by: Avi Kivity --- arch/ia64/kvm/Kconfig |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/arch/ia64/kvm/Kconfig b/arch/ia64/kvm/Kco

[PATCH 31/46] KVM: SVM: Skip instruction on a task switch only when appropriate

2009-05-20 Thread Avi Kivity
From: Gleb Natapov If a task switch was initiated because off a task gate in IDT and IDT was accessed because of an external even the instruction should not be skipped. Signed-off-by: Gleb Natapov Signed-off-by: Avi Kivity --- arch/x86/kvm/svm.c | 11 +-- 1 files changed, 9 insertio

[PATCH 35/46] KVM: ia64: Flush all TLBs once guest's memory mapping changes.

2009-05-20 Thread Avi Kivity
From: Xiantao Zhang Flush all vcpu's TLB entries once changes guest's memory mapping. Signed-off-by: Xiantao Zhang Signed-off-by: Avi Kivity --- arch/ia64/kvm/kvm-ia64.c |1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/arch/ia64/kvm/kvm-ia64.c b/arch/ia64/kvm/kvm-ia64.

[PATCH 26/46] KVM: x86 emulator: Complete decoding of call near in decode stage

2009-05-20 Thread Avi Kivity
From: Gleb Natapov Signed-off-by: Gleb Natapov Signed-off-by: Avi Kivity --- arch/x86/kvm/x86_emulate.c | 15 ++- 1 files changed, 2 insertions(+), 13 deletions(-) diff --git a/arch/x86/kvm/x86_emulate.c b/arch/x86/kvm/x86_emulate.c index 14b8ee2..4a9cd4c 100644 --- a/arch/x86/k

[PATCH 24/46] KVM: x86 emulator: Complete ljmp decoding at decode stage

2009-05-20 Thread Avi Kivity
From: Gleb Natapov Signed-off-by: Gleb Natapov Signed-off-by: Avi Kivity --- arch/x86/kvm/x86_emulate.c | 25 + 1 files changed, 5 insertions(+), 20 deletions(-) diff --git a/arch/x86/kvm/x86_emulate.c b/arch/x86/kvm/x86_emulate.c index 71b4bee..8779cf2 100644 --- a/

[PATCH 21/46] KVM: MMU: remove global page optimization logic

2009-05-20 Thread Avi Kivity
From: Marcelo Tosatti Complexity to fix it not worthwhile the gains, as discussed in http://article.gmane.org/gmane.comp.emulators.kvm.devel/28649. Signed-off-by: Marcelo Tosatti Signed-off-by: Avi Kivity --- arch/x86/include/asm/kvm_host.h |4 --- arch/x86/kvm/mmu.c | 50 +

[PATCH 34/46] KVM: x86: check for cr3 validity in ioctl_set_sregs

2009-05-20 Thread Avi Kivity
From: Marcelo Tosatti Matt T. Yourst notes that kvm_arch_vcpu_ioctl_set_sregs lacks validity checking for the new cr3 value: "Userspace callers of KVM_SET_SREGS can pass a bogus value of cr3 to the kernel. This will trigger a NULL pointer access in gfn_to_rmap() when userspace next tries to call

[PATCH 28/46] KVM: x86 emulator: Completely decode in/out at decoding stage

2009-05-20 Thread Avi Kivity
From: Gleb Natapov Signed-off-by: Gleb Natapov Signed-off-by: Avi Kivity --- arch/x86/kvm/x86_emulate.c |8 1 files changed, 4 insertions(+), 4 deletions(-) diff --git a/arch/x86/kvm/x86_emulate.c b/arch/x86/kvm/x86_emulate.c index 0988a13..c2f55ca 100644 --- a/arch/x86/kvm/x86_e

[PATCH 33/46] KVM: ia64: Don't hold slots_lock in guest mode

2009-05-20 Thread Avi Kivity
From: Jes Sorensen Reorder locking to avoid holding the slots_lock when entering the guest. Signed-off-by: Jes Sorensen Acked-by : Xiantao Zhang Signed-off-by: Avi Kivity --- arch/ia64/kvm/kvm-ia64.c | 64 +++-- 1 files changed, 33 insertions(+), 31 d

[PATCH 16/46] KVM: MMU: Discard reserved bits checking on PDE bit 7-8

2009-05-20 Thread Avi Kivity
From: Sheng Yang 1. It's related to a Linux kernel bug which fixed by Ingo on 07a66d7c53a538e1a9759954a82bb6c07365eff9. The original code exists for quite a long time, and it would convert a PDE for large page into a normal PDE. But it fail to fit normal PDE well. With the code before Ingo's fix

[PATCH 23/46] KVM: x86 emulator: Add lcall decoding

2009-05-20 Thread Avi Kivity
From: Gleb Natapov No emulation yet. Signed-off-by: Gleb Natapov Signed-off-by: Avi Kivity --- arch/x86/kvm/x86_emulate.c |3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/arch/x86/kvm/x86_emulate.c b/arch/x86/kvm/x86_emulate.c index c015063..71b4bee 100644 --- a/arch

[PATCH 19/46] KVM: PIT: fix count read and mode 0 handling

2009-05-20 Thread Avi Kivity
From: Marcelo Tosatti Commit 46ee278652f4cbd51013471b64c7897ba9bcd1b1 causes Solaris 10 to hang on boot. Assuming that PIT counter reads should return 0 for an expired timer is wrong: when it is active, the counter never stops (see comment on __kpit_elapsed). Also arm a one shot timer for mode

[PATCH 25/46] KVM: x86 emulator: Complete short/near jcc decoding in decode stage

2009-05-20 Thread Avi Kivity
From: Gleb Natapov Signed-off-by: Gleb Natapov Signed-off-by: Avi Kivity --- arch/x86/kvm/x86_emulate.c | 42 ++ 1 files changed, 10 insertions(+), 32 deletions(-) diff --git a/arch/x86/kvm/x86_emulate.c b/arch/x86/kvm/x86_emulate.c index 8779cf2..14b

[PATCH 29/46] KVM: x86 emulator: Decode soft interrupt instructions

2009-05-20 Thread Avi Kivity
From: Gleb Natapov Do not emulate them yet. Signed-off-by: Gleb Natapov Signed-off-by: Avi Kivity --- arch/x86/kvm/x86_emulate.c |3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/arch/x86/kvm/x86_emulate.c b/arch/x86/kvm/x86_emulate.c index c2f55ca..d2664fc 100644 ---

[PATCH 30/46] KVM: x86 emulator: Add new mode of instruction emulation: skip

2009-05-20 Thread Avi Kivity
From: Gleb Natapov In the new mode instruction is decoded, but not executed. The EIP is moved to point after the instruction. Signed-off-by: Gleb Natapov Signed-off-by: Avi Kivity --- arch/x86/include/asm/kvm_host.h |1 + arch/x86/kvm/x86.c |5 + 2 files changed, 6 in

[PATCH 15/46] KVM: Fix unneeded instruction skipping during task switching.

2009-05-20 Thread Avi Kivity
From: Gleb Natapov There is no need to skip instruction if the reason for a task switch is a task gate in IDT and access to it is caused by an external even. The problem is currently solved only for VMX since there is no reliable way to skip an instruction in SVM. We should emulate it instead.

[PATCH 17/46] KVM: x86 emulator: fix call near emulation

2009-05-20 Thread Avi Kivity
From: Gleb Natapov The length of pushed on to the stack return address depends on operand size not address size. Signed-off-by: Gleb Natapov Signed-off-by: Avi Kivity --- arch/x86/kvm/x86_emulate.c |1 - 1 files changed, 0 insertions(+), 1 deletions(-) diff --git a/arch/x86/kvm/x86_emula

[PATCH 07/46] KVM: remove pointless conditional before kfree() in lapic initialization

2009-05-20 Thread Avi Kivity
From: Wei Yongjun Remove pointless conditional before kfree(). Signed-off-by: Wei Yongjun Signed-off-by: Avi Kivity --- arch/x86/kvm/x86.c |3 +-- 1 files changed, 1 insertions(+), 2 deletions(-) diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c index 637bb80..34516bf 100644 --- a/arc

[PATCH 10/46] KVM: Use rsvd_bits_mask in load_pdptrs()

2009-05-20 Thread Avi Kivity
From: Dong, Eddie Also remove bit 5-6 from rsvd_bits_mask per latest SDM. Signed-off-by: Eddie Dong Signed-off-by: Avi Kivity --- arch/x86/kvm/mmu.c |8 +++- arch/x86/kvm/mmu.h |5 + arch/x86/kvm/x86.c |3 ++- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a

[PATCH 12/46] KVM: VMX: Rewrite vmx_complete_interrupt()'s twisted maze of if() statements

2009-05-20 Thread Avi Kivity
From: Gleb Natapov ...with a more straightforward switch(). Also fix a bug when NMI could be dropped on exit. Although this should never happen in practice, since NMIs can only be injected, never triggered internally by the guest like exceptions. Signed-off-by: Gleb Natapov Signed-off-by: Avi

[PATCH 14/46] KVM: Fix task switch back link handling.

2009-05-20 Thread Avi Kivity
From: Gleb Natapov Back link is written to a wrong TSS now. Signed-off-by: Gleb Natapov Signed-off-by: Avi Kivity --- arch/x86/kvm/x86.c | 40 1 files changed, 32 insertions(+), 8 deletions(-) diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c ind

[PATCH 08/46] KVM: VMX: Clean up Flex Priority related

2009-05-20 Thread Avi Kivity
From: Sheng Yang And clean paranthes on returns. Signed-off-by: Sheng Yang Signed-off-by: Avi Kivity --- 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 ab

[PATCH 09/46] KVM: VMX: Fix feature testing

2009-05-20 Thread Avi Kivity
From: Sheng Yang The testing of feature is too early now, before vmcs_config complete initialization. Signed-off-by: Sheng Yang Signed-off-by: Avi Kivity --- arch/x86/kvm/vmx.c | 18 +- 1 files changed, 9 insertions(+), 9 deletions(-) diff --git a/arch/x86/kvm/vmx.c b/arch

[PATCH 11/46] KVM: VMX: Fix handling of a fault during NMI unblocked due to IRET

2009-05-20 Thread Avi Kivity
From: Gleb Natapov Bit 12 is undefined in any of the following cases: If the VM exit sets the valid bit in the IDT-vectoring information field. If the VM exit is due to a double fault. Signed-off-by: Gleb Natapov Signed-off-by: Avi Kivity --- arch/x86/kvm/vmx.c | 17 +++-- 1 f

[PATCH 13/46] KVM: VMX: Do not zero idt_vectoring_info in vmx_complete_interrupts().

2009-05-20 Thread Avi Kivity
From: Gleb Natapov We will need it later in task_switch(). Code in handle_exception() is dead. is_external_interrupt(vect_info) will always be false since idt_vectoring_info is zeroed in vmx_complete_interrupts(). Signed-off-by: Gleb Natapov Signed-off-by: Avi Kivity --- arch/x86/kvm/vmx.c |

[PATCH 05/46] KVM: MMU: Emulate #PF error code of reserved bits violation

2009-05-20 Thread Avi Kivity
From: Dong, Eddie Detect, indicate, and propagate page faults where reserved bits are set. Take care to handle the different paging modes, each of which has different sets of reserved bits. [avi: fix pte reserved bits for efer.nxe=0] Signed-off-by: Eddie Dong Signed-off-by: Avi Kivity --- ar

Re: [PATCH -tip] x86: kvm replace MSR_IA32_TIME_STAMP_COUNTER with MSR_IA32_TSC of msr-index.h

2009-05-20 Thread Avi Kivity
Jaswinder Singh Rajput wrote: BTW, where you applied this patch. git://git.kernel.org/pub/scm/linux/kernel/git/avi/kvm.git is still showing old data. Sometimes things find their way into the queue branch. -- error compiling committee.c: too many arguments to function -- To unsubscribe fr

Re: [PATCH] qemu-kvm: Handle -no-shutodwn

2009-05-20 Thread Avi Kivity
Daniel Gollub wrote: Plain QEMU has the parameter -no-shutdown. This avoids termination of the qemu process when VM got shutdown (e.g. to still use the QEMU-Monitor with stopped VM). This parameter has no effect on qemu-kvm, today. This patch introduces identical handling, as in qemu, of -no-shu

Re: [PATCH] qemu-kvm: fix warnings on 32 bit systems

2009-05-20 Thread Avi Kivity
Michael S. Tsirkin wrote: size_t must be printed with %zd, not %ld. long constants are UL, not ULL. Applied, thanks. -- error compiling committee.c: too many arguments to function -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to majord...@vger.k

Re: [PATCH v7] kvm: Use a bitmap for tracking used GSIs

2009-05-20 Thread Avi Kivity
Alex Williamson wrote: We're currently using a counter to track the most recent GSI we've handed out. This quickly hits KVM_MAX_IRQ_ROUTES when using device assignment with a driver that regularly toggles the MSI enable bit (such as Linux kernels 2.6.21-26). This can mean only a few minutes of

Re: [PATCH][KVM][retry 3] Add support for Pause Filtering to AMD SVM

2009-05-20 Thread Avi Kivity
Mark Langsdorf wrote: On a 24 core system running 4 guests each with 16 VCPUs, this patch improved overall performance of each guest's 32 job kernbench by approximately 1%. Further performance improvement may be possible with a more sophisticated yield algorithm. This result is approximate

Re: XP smp using a lot of CPU

2009-05-20 Thread Avi Kivity
Erik Rull wrote: Hi Avi, here is the cpuinfo - what do you mean with "workload"? The CPU isage is around 33%. What programs is the guest running? -- error compiling committee.c: too many arguments to function -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a

Re: [PATCH v2 2/2] Intel-IOMMU, intr-remap: source-id checking

2009-05-20 Thread Eric W. Biederman
Joerg Roedel writes: > On Wed, May 20, 2009 at 10:21:14AM +0200, Ingo Molnar wrote: >> >> * Eric W. Biederman wrote: >> > Being a major nitpick, I have to point out that the code is not >> > structured to support other iommus, and I think AMD has one that >> > can do this as well. >> >> (Joe

Re: [PATCH 1/6] kvm-s390: Fix memory slot versus run

2009-05-20 Thread Christian Ehrhardt
Avi Kivity wrote: Christian Ehrhardt wrote: The bad thing on vcpu->request in that case is that I don't want the async behaviour of vcpu->requests in that case, I want the memory slot updated in all vcpu's when the ioctl is returning. You mean, the hardware can access the vcpu control block e

Re: [patch 2/4] KVM: move coalesced_mmio locking to its own device

2009-05-20 Thread Avi Kivity
Marcelo Tosatti wrote: Signed-off-by: Marcelo Tosatti Index: kvm/virt/kvm/coalesced_mmio.c === --- kvm.orig/virt/kvm/coalesced_mmio.c +++ kvm/virt/kvm/coalesced_mmio.c @@ -26,9 +26,10 @@ static int coalesced_mmio_in_range(struc

Re: [patch 3/4] KVM: introduce irq_lock, use it protect ioapic

2009-05-20 Thread Avi Kivity
Marcelo Tosatti wrote: Signed-off-by: Marcelo Tosatti Index: kvm/include/linux/kvm_host.h === --- kvm.orig/include/linux/kvm_host.h +++ kvm/include/linux/kvm_host.h @@ -123,7 +123,6 @@ struct kvm_kernel_irq_routing_entry { }; s

  1   2   >