Limit the CPU usage of KVM

2009-08-16 Thread Yu Jiang (yujia)
Hi KVM experts, Our user case needs to run KVM and application on host together. To reserve some CPU resource for application, we want to limit the CPU usage of KVM. Without KVM CPU usage limitation, the idle CPU of host OS becomes 0% in peak time. I have searched this topic on internet, but di

i8259 defaults wrong?

2009-08-16 Thread Herbert Poetzl
Greetings! looking at the i8259 implementation found in qemu as well as in the in-kernel kvm implementation, I see that on pic_reset() special_fully_nested_mode is set to zero, but the intel(r) 8259A manual says on page 15: Fully Nested Mode This mode is entered after initialization unless

Biweekly KVM Test report, kernel 7597f... qemu 1c45e...

2009-08-16 Thread Xu, Jiajun
Hi All, This Weekly KVM Testing Report against lastest kvm.git 7597fa7922136a354824f3360831f13bc98dea4e and qemu-kvm.git 1c45eec341763ed38270a3d1f230044fdfeefb16. There is no new bug found this week. The migration bug is fixed. One Fixed issue: 1.

[ kvm-Bugs-2832401 ] Guest will be no response after migration

2009-08-16 Thread SourceForge.net
Bugs item #2832401, was opened at 2009-08-04 18:34 Message generated for change (Settings changed) made by jiajun You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=893831&aid=2832401&group_id=180599 Please note that this message will contain a full copy of the comment

[PATCH] x86 emulator: Add 'push es' instruction (opcode 0x06)

2009-08-16 Thread Mohammed Gamal
Signed-off-by: Mohammed Gamal --- arch/x86/kvm/emulate.c | 14 +- 1 files changed, 13 insertions(+), 1 deletions(-) diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c index 2eb807a..7688c0b 100644 --- a/arch/x86/kvm/emulate.c +++ b/arch/x86/kvm/emulate.c @@ -92,7 +92,7 @@

[PATCH] Add push es instruction test in test harness

2009-08-16 Thread Mohammed Gamal
Signed-off-by: Mohammed Gamal --- kvm/user/test/x86/realmode.c | 17 + 1 files changed, 17 insertions(+), 0 deletions(-) diff --git a/kvm/user/test/x86/realmode.c b/kvm/user/test/x86/realmode.c index 755b5d1..041f0a5 100644 --- a/kvm/user/test/x86/realmode.c +++ b/kvm/user/test

Re: automatic memory ballooning?

2009-08-16 Thread Dor Laor
On 08/16/2009 05:18 PM, Thomas Fjellstrom wrote: On Sun August 16 2009, Avi Kivity wrote: On 08/16/2009 12:55 PM, Thomas Fjellstrom wrote: I'm wondering if kvm supports automatic memory ballooning. I've had a kvm guest running for a couple days, and the balloon driver was loaded, and I could ma

Re: automatic memory ballooning?

2009-08-16 Thread Avi Kivity
On 08/16/2009 05:18 PM, Thomas Fjellstrom wrote: On Sun August 16 2009, Avi Kivity wrote: On 08/16/2009 12:55 PM, Thomas Fjellstrom wrote: I'm wondering if kvm supports automatic memory ballooning. I've had a kvm guest running for a couple days, and the balloon driver was loaded, and

[PATCH] qemu-kvm: add compat eventfd

2009-08-16 Thread Michael S. Tsirkin
Support build on rhel 5.3 where we have syscall for eventfd but not userspace wrapper. Signed-off-by: Michael S. Tsirkin --- compat/sys/eventfd.h | 13 + configure|1 + 2 files changed, 14 insertions(+), 0 deletions(-) create mode 100644 compat/sys/eventfd.h diff

Re: automatic memory ballooning?

2009-08-16 Thread Thomas Fjellstrom
On Sun August 16 2009, Avi Kivity wrote: > On 08/16/2009 12:55 PM, Thomas Fjellstrom wrote: > > I'm wondering if kvm supports automatic memory ballooning. I've had a kvm > > guest running for a couple days, and the balloon driver was loaded, and I > > could manually change the amount of ram it had

Re: [RFC] defer skb allocation in virtio_net -- mergable buff part

2009-08-16 Thread Avi Kivity
On 08/13/2009 09:33 AM, Shirley Ma wrote: Guest virtio_net receives packets from its pre-allocated vring buffers, then it delivers these packets to upper layer protocols as skb buffs. So it's not necessary to pre-allocate skb for each mergable buffer, then frees it when it's useless. This patch

Re: How to enable memory ballooning in KVM

2009-08-16 Thread Dor Laor
On 08/16/2009 02:58 PM, Zhang Qian wrote: Any help will be really appeciated. You can use 'balloon TARGET' command in the monitor in order to ask the balloon driver reach this number (either inflate or deflate). 'info balloon' is used to retrieve current overall allocation. Regards, Qian

Re: [PATCH] kvm: export kvm_para.h

2009-08-16 Thread Michael S. Tsirkin
On Sun, Aug 16, 2009 at 03:09:55PM +0300, Avi Kivity wrote: > On 08/10/2009 03:48 PM, Michael S. Tsirkin wrote: >> kvm_para.h contains userspace interface and so >> should be exported. >> >> > > Doesn't it need asm/kvm_para.h as well? Yes, that was v2. > -- > error compiling committee.c: too

Re: [PATCHv2 for-2.6.31] kvm: export kvm_para.h

2009-08-16 Thread Avi Kivity
On 08/10/2009 03:59 PM, Michael S. Tsirkin wrote: kvm_para.h contains userspace interface and so should be exported. 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 t

Re: [PATCH] kvm: export kvm_para.h

2009-08-16 Thread Avi Kivity
On 08/10/2009 03:48 PM, Michael S. Tsirkin wrote: kvm_para.h contains userspace interface and so should be exported. Doesn't it need asm/kvm_para.h as well? -- error compiling committee.c: too many arguments to function -- To unsubscribe from this list: send the line "unsubscribe kvm" in

Re: [PATCH] x86: use kvm_read/write_guest_virt for reading and writing segment descriptors

2009-08-16 Thread Avi Kivity
On 08/10/2009 08:11 PM, Mikhail Ershov wrote: Descriptor table can be placed on two non-contiguous pages. It is better to read descriptor by linear address. Patch is good, but is whitespace-corrupted. Please send as an attachment (or using git-send-email). Make sure the attachment is pl

Re: How to enable memory ballooning in KVM

2009-08-16 Thread Zhang Qian
Any help will be really appeciated. Regards, Qian 2009/8/13 Zhang Qian : > Hi, > > It seems that KVM has supported memory ballooning since KVM-75, can > you please tell me how to enable it? > Another question is, the kernel version of my RHEL 5.3 box is > 2.6.18-128.el5, can I enable this featur

Re: Disk Emulation and Trim Instruction

2009-08-16 Thread Avi Kivity
On 08/14/2009 01:11 AM, Gordan Bobic wrote: With the recent talk of the trim SATA instruction becoming supported in the upcoming versions of Windows and claims from Intel that support for it in their SSDs is imminent, it occurs to me that this would be equally useful in virtual disk emulation.

Re: automatic memory ballooning?

2009-08-16 Thread Avi Kivity
On 08/16/2009 12:55 PM, Thomas Fjellstrom wrote: I'm wondering if kvm supports automatic memory ballooning. I've had a kvm guest running for a couple days, and the balloon driver was loaded, and I could manually change the amount of ram it had allocated in the console, but it never seemed to chan

automatic memory ballooning?

2009-08-16 Thread Thomas Fjellstrom
I'm wondering if kvm supports automatic memory ballooning. I've had a kvm guest running for a couple days, and the balloon driver was loaded, and I could manually change the amount of ram it had allocated in the console, but it never seemed to change automatically. Is there any support for that

[PATCH 12/48] KVM: Allow PIT emulation without speaker port

2009-08-16 Thread Avi Kivity
From: Jan Kiszka The in-kernel speaker emulation is only a dummy and also unneeded from the performance point of view. Rather, it takes user space support to generate sound output on the host, e.g. console beeps. To allow this, introduce KVM_CREATE_PIT2 which controls in-kernel speaker port emul

[PATCH 13/48] KVM: ia64: Correct itc_offset calculations

2009-08-16 Thread Avi Kivity
From: Jes Sorensen Init the itc_offset for all possible vCPUs. The current code by mistake ends up only initializing the offset on vCPU 0. Spotted by Gleb Natapov. Signed-off-by: Jes Sorensen Acked-by : Xiantao Zhang Signed-off-by: Avi Kivity --- arch/ia64/kvm/kvm-ia64.c |2 +- 1 files

[PATCH 05/48] KVM: fix cpuid E2BIG handling for extended request types

2009-08-16 Thread Avi Kivity
From: Mark McLoughlin If we run out of cpuid entries for extended request types we should return -E2BIG, just like we do for the standard request types. Signed-off-by: Mark McLoughlin Signed-off-by: Avi Kivity --- arch/x86/kvm/x86.c |4 1 files changed, 4 insertions(+), 0 deletions(-

[PATCH 08/48] KVM: cleanup arch/x86/kvm/Makefile

2009-08-16 Thread Avi Kivity
From: Christoph Hellwig Use proper foo-y style list additions to cleanup all the conditionals, move module selection after compound object selection and remove the superflous comment. Signed-off-by: Christoph Hellwig Signed-off-by: Avi Kivity --- arch/x86/kvm/Makefile | 32 +

[PATCH 10/48] KVM: Move common KVM Kconfig items to new file virt/kvm/Kconfig

2009-08-16 Thread Avi Kivity
Reduce Kconfig code duplication. Signed-off-by: Avi Kivity --- arch/ia64/kvm/Kconfig|7 ++- arch/powerpc/kvm/Kconfig |3 +-- arch/s390/kvm/Kconfig|6 +- arch/x86/kvm/Kconfig |7 ++- virt/kvm/Kconfig |7 +++ 5 files changed, 13 insertions(+)

[PATCH 06/48] KVM: x86 emulator: Implement zero-extended immediate decoding

2009-08-16 Thread Avi Kivity
Absolute jumps use zero extended immediate operands. Signed-off-by: Avi Kivity --- arch/x86/kvm/x86_emulate.c | 15 +++ 1 files changed, 15 insertions(+), 0 deletions(-) diff --git a/arch/x86/kvm/x86_emulate.c b/arch/x86/kvm/x86_emulate.c index 616de46..a30d5fc 100644 --- a/arch/x

[PATCH 00/48] KVM updates for 2.6.32 merge window (1/4)

2009-08-16 Thread Avi Kivity
Here is the first of four batches containing the KVM changes for 2.6.32. The 2.6.32 cycle will see scalability improvements, support for new hardware features, improvements in nested svm support, and eventfd-based infrastructure for connecting kvm guests to components in the host kernel, host users

[PATCH 03/48] KVM: Add MCE support

2009-08-16 Thread Avi Kivity
From: Huang Ying The related MSRs are emulated. MCE capability is exported via extension KVM_CAP_MCE and ioctl KVM_X86_GET_MCE_CAP_SUPPORTED. A new vcpu ioctl command KVM_X86_SETUP_MCE is used to setup MCE emulation such as the mcg_cap. MCE is injected via vcpu ioctl command KVM_X86_SET_MCE. Ext

[PATCH 07/48] KVM: x86 emulator: fix jmp far decoding (opcode 0xea)

2009-08-16 Thread Avi Kivity
The jump target should not be sign extened; use an unsigned decode flag. Signed-off-by: Avi Kivity --- arch/x86/kvm/x86_emulate.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/arch/x86/kvm/x86_emulate.c b/arch/x86/kvm/x86_emulate.c index a30d5fc..ef4dfca 100644 --- a/

[PATCH 09/48] KVM: Drop interrupt shadow when single stepping should be done only on VMX

2009-08-16 Thread Avi Kivity
From: Gleb Natapov The problem exists only on VMX. Also currently we skip this step if there is pending exception. The patch fixes this too. Signed-off-by: Gleb Natapov Signed-off-by: Avi Kivity --- arch/x86/kvm/vmx.c |8 arch/x86/kvm/x86.c |3 --- 2 files changed, 8 insertio

[PATCH 11/48] KVM: irqfd

2009-08-16 Thread Avi Kivity
From: Gregory Haskins KVM provides a complete virtual system environment for guests, including support for injecting interrupts modeled after the real exception/interrupt facilities present on the native platform (such as the IDT on x86). Virtual interrupts can come from a variety of sources (emu

[PATCH 14/48] KVM: s390: infrastructure to kick vcpus out of guest state

2009-08-16 Thread Avi Kivity
From: Christian Ehrhardt To ensure vcpu's come out of guest context in certain cases this patch adds a s390 specific way to kick them out of guest context. Currently it kicks them out to rerun the vcpu_run path in the s390 code, but the mechanism itself is expandable and with a new flag we could

[PATCH 02/48] KVM: Replace MSR_IA32_TIME_STAMP_COUNTER with MSR_IA32_TSC of msr-index.h

2009-08-16 Thread Avi Kivity
From: Jaswinder Singh Rajput Use standard msr-index.h's MSR declaration. MSR_IA32_TSC is better than MSR_IA32_TIME_STAMP_COUNTER as it also solves 80 column issue. Signed-off-by: Jaswinder Singh Rajput Signed-off-by: Avi Kivity --- arch/x86/include/asm/kvm_host.h |2 -- arch/x86/kvm/svm.

[PATCH 26/48] KVM: VMX: Avoid duplicate ept tlb flush when setting cr3

2009-08-16 Thread Avi Kivity
vmx_set_cr3() will call vmx_tlb_flush(), which will flush the ept context. So there is no need to call ept_sync_context() explicitly. Signed-off-by: Avi Kivity --- arch/x86/kvm/vmx.c |1 - 1 files changed, 0 insertions(+), 1 deletions(-) diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c

[PATCH 19/48] KVM: No disable_irq for MSI/MSI-X interrupt on device assignment

2009-08-16 Thread Avi Kivity
From: Sheng Yang Disable interrupt at interrupt handler and enable it when guest ack is for the level triggered interrupt, to prevent reinjected interrupt. MSI/MSI-X don't need it. One possible problem is multiply same vector interrupt injected between irq handler and scheduled work handler woul

[PATCH 15/48] KVM: s390: fix signal handling

2009-08-16 Thread Avi Kivity
From: Christian Ehrhardt If signal pending is true we exit without updating kvm_run, userspace currently just does nothing and jumps to kvm_run again. Since we did not set an exit_reason we might end up with a random one (whatever was the last exit). Therefore it was possible to e.g. jump to the

[PATCH 17/48] KVM: Downsize max support MSI-X entry to 256

2009-08-16 Thread Avi Kivity
From: Sheng Yang We only trap one page for MSI-X entry now, so it's 4k/(128/8) = 256 entries at most. Signed-off-by: Sheng Yang Signed-off-by: Avi Kivity --- include/linux/kvm.h |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/include/linux/kvm.h b/include/linux/kvm.h

[PATCH 20/48] KVM: remove redundant declarations

2009-08-16 Thread Avi Kivity
From: Christian Ehrhardt Changing s390 code in kvm_arch_vcpu_load/put come across this header declarations. They are complete duplicates, not even useful forward declarations as nothing using it is in between (maybe it was that in the past). This patch removes the two dispensable lines. Signed-

[PATCH 29/48] KVM: VMX: Fix reporting of unhandled EPT violations

2009-08-16 Thread Avi Kivity
Instead of returning -ENOTSUPP, exit normally but indicate the hardware exit reason. Signed-off-by: Avi Kivity --- arch/x86/kvm/vmx.c |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c index d726dec..959cb59 100644 --- a/arch/x86/k

[PATCH 18/48] KVM: SVM: use explicit 64bit storage for sysenter values

2009-08-16 Thread Avi Kivity
From: Andre Przywara Since AMD does not support sysenter in 64bit mode, the VMCB fields storing the MSRs are truncated to 32bit upon VMRUN/#VMEXIT. So store the values in a separate 64bit storage to avoid truncation. Signed-off-by: Christoph Egger Signed-off-by: Avi Kivity --- arch/x86/kvm/kv

[PATCH 21/48] KVM: SVM: Fold kvm_svm.h info svm.c

2009-08-16 Thread Avi Kivity
kvm_svm.h is only included from svm.c, so fold it in. Signed-off-by: Avi Kivity --- arch/x86/kvm/kvm_svm.h | 54 arch/x86/kvm/svm.c | 42 - 2 files changed, 41 insertions(+), 55 deletions(-) delete mode

[PATCH 25/48] KVM: do not register i8254 PIO regions until we are initialized

2009-08-16 Thread Avi Kivity
From: Gregory Haskins We currently publish the i8254 resources to the pio_bus before the devices are fully initialized. Since we hold the pit_lock, its probably not a real issue. But lets clean this up anyway. Reported-by: Avi Kivity Signed-off-by: Gregory Haskins Acked-by: Chris Wright Sig

[PATCH 32/48] KVM: ppc: e500: Directly pass pvr to guest

2009-08-16 Thread Avi Kivity
From: Liu Yu Signed-off-by: Liu Yu Signed-off-by: Avi Kivity --- arch/powerpc/include/asm/kvm_host.h |1 - arch/powerpc/kvm/e500.c |3 --- arch/powerpc/kvm/emulate.c |2 +- 3 files changed, 1 insertions(+), 5 deletions(-) diff --git a/arch/powerpc/include/asm/

[PATCH 23/48] KVM: Clean up coalesced_mmio destruction

2009-08-16 Thread Avi Kivity
From: Gregory Haskins We invoke kfree() on a data member instead of the structure. This works today because the kvm_io_device is the first element of the private structure, but this could change in the future, so lets clean this up. Signed-off-by: Gregory Haskins Acked-by: Chris Wright Signed

[PATCH 27/48] KVM: VMX: Simplify pdptr and cr3 management

2009-08-16 Thread Avi Kivity
Instead of reading the PDPTRs from memory after every exit (which is slow and wrong, as the PDPTRs are stored on the cpu), sync the PDPTRs from memory to the VMCS before entry, and from the VMCS to memory after exit. Do the same for cr3. Signed-off-by: Avi Kivity --- arch/x86/kvm/vmx.c | 21 ++

[PATCH 46/48] KVM: Use pointer to vcpu instead of vcpu_id in timer code.

2009-08-16 Thread Avi Kivity
From: Gleb Natapov Signed-off-by: Gleb Natapov Signed-off-by: Avi Kivity --- arch/x86/kvm/i8254.c |2 +- arch/x86/kvm/kvm_timer.h |2 +- arch/x86/kvm/lapic.c |2 +- arch/x86/kvm/timer.c |2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/arch/x86/k

[PATCH 36/48] KVM: move coalesced_mmio locking to its own device

2009-08-16 Thread Avi Kivity
From: Marcelo Tosatti Move coalesced_mmio locking to its own device, instead of relying on kvm->lock. Signed-off-by: Marcelo Tosatti Signed-off-by: Avi Kivity --- virt/kvm/coalesced_mmio.c | 10 -- virt/kvm/coalesced_mmio.h |1 + 2 files changed, 5 insertions(+), 6 deletions(-)

[PATCH 35/48] KVM: Grab pic lock in kvm_pic_clear_isr_ack

2009-08-16 Thread Avi Kivity
From: Marcelo Tosatti isr_ack is protected by kvm_pic->lock. Signed-off-by: Marcelo Tosatti Signed-off-by: Avi Kivity --- arch/x86/kvm/i8259.c |2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/arch/x86/kvm/i8259.c b/arch/x86/kvm/i8259.c index 2520922..bf94a45 100644 --

[PATCH 28/48] KVM: Cache pdptrs

2009-08-16 Thread Avi Kivity
Instead of reloading the pdptrs on every entry and exit (vmcs writes on vmx, guest memory access on svm) extract them on demand. Signed-off-by: Avi Kivity --- arch/x86/include/asm/kvm_host.h |4 arch/x86/kvm/kvm_cache_regs.h |9 + arch/x86/kvm/mmu.c |7 +++

[PATCH 31/48] KVM: ppc: e500: Move to Book-3e MMU definitions

2009-08-16 Thread Avi Kivity
From: Liu Yu According to commit 70fe3af8403f85196bb74f22ce4813db7dfedc1a. Signed-off-by: Liu Yu Signed-off-by: Avi Kivity --- arch/powerpc/kvm/e500_tlb.c | 10 +- arch/powerpc/kvm/e500_tlb.h |6 +++--- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/arch/powerpc/

[PATCH 34/48] KVM: Cleanup LAPIC interface

2009-08-16 Thread Avi Kivity
From: Jan Kiszka None of the interface services the LAPIC emulation provides need to be exported to modules, and kvm_lapic_get_base is even totally unused today. Signed-off-by: Jan Kiszka Signed-off-by: Avi Kivity --- arch/x86/kvm/lapic.c | 12 1 files changed, 0 insertions(+),

[PATCH 37/48] KVM: introduce irq_lock, use it to protect ioapic

2009-08-16 Thread Avi Kivity
From: Marcelo Tosatti Introduce irq_lock, and use to protect ioapic data structures. Signed-off-by: Marcelo Tosatti Signed-off-by: Avi Kivity --- include/linux/kvm_host.h |3 ++- virt/kvm/ioapic.c|5 + virt/kvm/kvm_main.c |1 + 3 files changed, 8 insertions(+), 1

[PATCH 39/48] KVM: VMX: Support Unrestricted Guest feature

2009-08-16 Thread Avi Kivity
From: Nitin A Kamble "Unrestricted Guest" feature is added in the VMX specification. Intel Westmere and onwards processors will support this feature. It allows kvm guests to run real mode and unpaged mode code natively in the VMX mode when EPT is turned on. With the unrestricted guest there

[PATCH 04/48] KVM: Use MSR names in place of address

2009-08-16 Thread Avi Kivity
From: Jaswinder Singh Rajput Replace 0xc0010010 with MSR_K8_SYSCFG and 0xc0010015 with MSR_K7_HWCR. Signed-off-by: Jaswinder Singh Rajput Signed-off-by: Avi Kivity --- arch/x86/kvm/x86.c |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/x86/kvm/x86.c b/arch/x86/

[PATCH 33/48] KVM: ppc: e500: Add MMUCFG and PVR emulation

2009-08-16 Thread Avi Kivity
From: Liu Yu Latest kernel started to use these two registers. Signed-off-by: Liu Yu Signed-off-by: Avi Kivity --- arch/powerpc/kvm/e500_emulate.c |3 +++ arch/powerpc/kvm/emulate.c |2 ++ 2 files changed, 5 insertions(+), 0 deletions(-) diff --git a/arch/powerpc/kvm/e500_emulat

[PATCH 22/48] KVM: powerpc: fix some init/exit annotations

2009-08-16 Thread Avi Kivity
From: Stephen Rothwell Fixes a couple of warnings like this one: WARNING: arch/powerpc/kvm/kvm-440.o(.text+0x1e8c): Section mismatch in reference from the function kvmppc_44x_exit() to the function .exit.text:kvmppc_booke_exit() The function kvmppc_44x_exit() references a function in an exit s

[PATCH 16/48] KVM: s390: streamline memslot handling

2009-08-16 Thread Avi Kivity
From: Christian Ehrhardt This patch relocates the variables kvm-s390 uses to track guest mem addr/size. As discussed dropping the variables at struct kvm_arch level allows to use the common vcpu->request based mechanism to reload guest memory if e.g. changes via set_memory_region. The kick mecha

[PATCH 30/48] KVM: Calculate available entries in coalesced mmio ring

2009-08-16 Thread Avi Kivity
Instead of checking whether we'll wrap around, calculate how many entries are available, and check whether we have enough (just one) for the pending mmio. By itself, this doesn't change anything, but it paves the way for making this function lockless. Signed-off-by: Avi Kivity --- virt/kvm/coal

[PATCH 24/48] KVM: cleanup io_device code

2009-08-16 Thread Avi Kivity
From: Gregory Haskins We modernize the io_device code so that we use container_of() instead of dev->private, and move the vtable to a separate ops structure (theoretically allows better caching for multiple instances of the same ops structure) Signed-off-by: Gregory Haskins Acked-by: Chris Wrig

[PATCH 40/48] KVM: Reorder ioctls in kvm.h

2009-08-16 Thread Avi Kivity
Somehow the VM ioctls got unsorted; resort. Signed-off-by: Avi Kivity --- include/linux/kvm.h | 10 +- 1 files changed, 5 insertions(+), 5 deletions(-) diff --git a/include/linux/kvm.h b/include/linux/kvm.h index 632a856..f1dada0 100644 --- a/include/linux/kvm.h +++ b/include/linux/kv

[PATCH 45/48] KVM: Introduce kvm_vcpu_is_bsp() function.

2009-08-16 Thread Avi Kivity
From: Gleb Natapov Use it instead of open code "vcpu_id zero is BSP" assumption. Signed-off-by: Gleb Natapov Signed-off-by: Avi Kivity --- arch/ia64/kvm/kvm-ia64.c |2 +- arch/ia64/kvm/vcpu.c |2 +- arch/x86/kvm/i8254.c |4 ++-- arch/x86/kvm/i8259.c |6 +++--- arch

[PATCH 48/48] KVM: Use macro to iterate over vcpus.

2009-08-16 Thread Avi Kivity
From: Gleb Natapov Signed-off-by: Gleb Natapov Signed-off-by: Avi Kivity --- arch/ia64/kvm/kvm-ia64.c | 29 ++--- arch/powerpc/kvm/powerpc.c | 16 ++-- arch/s390/kvm/kvm-s390.c | 33 - arch/x86/kvm/i8254.c |

[PATCH 44/48] KVM: MMU: s/shadow_pte/spte/

2009-08-16 Thread Avi Kivity
We use shadow_pte and spte inconsistently, switch to the shorter spelling. Rename set_shadow_pte() to __set_spte() to avoid a conflict with the existing set_spte(), and to indicate its lowlevelness. Signed-off-by: Avi Kivity --- arch/x86/kvm/mmu.c | 102 ++--

[PATCH 38/48] KVM: switch irq injection/acking data structures to irq_lock

2009-08-16 Thread Avi Kivity
From: Marcelo Tosatti Protect irq injection/acking data structures with a separate irq_lock mutex. This fixes the following deadlock: CPU A CPU B kvm_vm_ioctl_deassign_dev_irq() mutex_lock(&kvm->lock);worker_thread() -> kvm_deassign_irq()

[PATCH 41/48] KVM: VMX: Move rmode structure to vmx-specific code

2009-08-16 Thread Avi Kivity
rmode is only used in vmx, so move it to vmx.c Signed-off-by: Avi Kivity --- arch/x86/include/asm/kvm_host.h | 10 - arch/x86/kvm/vmx.c | 78 ++- 2 files changed, 44 insertions(+), 44 deletions(-) diff --git a/arch/x86/include/asm/kvm_hos

[PATCH 47/48] KVM: Break dependency between vcpu index in vcpus array and vcpu_id.

2009-08-16 Thread Avi Kivity
From: Gleb Natapov Archs are free to use vcpu_id as they see fit. For x86 it is used as vcpu's apic id. New ioctl is added to configure boot vcpu id that was assumed to be 0 till now. Signed-off-by: Gleb Natapov Signed-off-by: Avi Kivity --- arch/ia64/include/asm/kvm_host.h |1 - arch/ia6

[PATCH 43/48] KVM: MMU: Adjust pte accessors to explicitly indicate guest or shadow pte

2009-08-16 Thread Avi Kivity
Since the guest and host ptes can have wildly different format, adjust the pte accessor names to indicate on which type of pte they operate on. No functional changes. Signed-off-by: Avi Kivity --- arch/x86/kvm/mmu.c | 16 arch/x86/kvm/mmu.h |2 +- arch/x86

[PATCH 42/48] KVM: MMU: Fix is_dirty_pte()

2009-08-16 Thread Avi Kivity
is_dirty_pte() is used on guest ptes, not shadow ptes, so it needs to avoid shadow_dirty_mask and use PT_DIRTY_MASK instead. Misdetecting dirty pages could lead to unnecessarily setting the dirty bit under EPT. Signed-off-by: Avi Kivity --- arch/x86/kvm/mmu.c |2 +- 1 files changed, 1 inser

[PATCH 01/48] KVM: VMX: Properly handle software interrupt re-injection in real mode

2009-08-16 Thread Avi Kivity
From: Gleb Natapov When reinjecting a software interrupt or exception, use the correct instruction length provided by the hardware instead of a hardcoded 1. Fixes problems running the suse 9.1 livecd boot loader. Problem introduced by commit f0a3602c20 ("KVM: Move interrupt injection logic to x

Re: [PATCH] Documentation: Update KVM list email address

2009-08-16 Thread Avi Kivity
On 08/13/2009 05:35 PM, Amit Shah wrote: The KVM list moved to vger.kernel.org last year 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.kernel.org

Re: [PATCH] Add push es instruction test in test harness

2009-08-16 Thread Avi Kivity
On 08/16/2009 03:54 AM, Mohammed Gamal wrote: Signed-off-by: Mohammed Gamal --- kvm/user/test/x86/realmode.c | 16 1 files changed, 16 insertions(+), 0 deletions(-) diff --git a/kvm/user/test/x86/realmode.c b/kvm/user/test/x86/realmode.c index 755b5d1..8db2c7a 100644 --- a/

Re: [PATCH] x86 emulator: Add 'push es' instruction (opcode 0x06)

2009-08-16 Thread Avi Kivity
On 08/16/2009 04:09 AM, Mohammed Gamal wrote: +static void emulate_push_sreg(struct x86_emulate_ctxt *ctxt, int seg) +{ + struct decode_cache *c =&ctxt->decode; + c->src.ptr = (unsigned long *)&c->regs[seg]; + emulate_push(ctxt); +} + This can't be right. c->regs[] is th

Re: [PATCH v3 3/6] vbus: add a "vbus-proxy" bus model for vbus_driver objects

2009-08-16 Thread Avi Kivity
On 08/15/2009 01:32 PM, Ingo Molnar wrote: This will generally be used for hypervisors to publish any host-side virtual devices up to a guest. The guest will have the opportunity to consume any devices present on the vbus-proxy as if they were platform devices, similar to existing buses like PCI

Re: [PATCH v3 3/6] vbus: add a "vbus-proxy" bus model for vbus_driver objects

2009-08-16 Thread Ingo Molnar
* Anthony Liguori wrote: > Ingo Molnar wrote: >> * Gregory Haskins wrote: >> >> >>> This will generally be used for hypervisors to publish any host-side >>> virtual devices up to a guest. The guest will have the opportunity >>> to consume any devices present on the vbus-proxy as if they wer