Statistics
| Branch: | Revision:

root / target-i386 / kvm.c @ 5b50e790

History | View | Annotate | Download (66.3 kB)

# Date Author Comment
38e478ec 07/27/2013 12:05 am Stefan Weil

kvm: Change prototype of kvm_update_guest_debug()

Passing a CPUState pointer instead of a CPUArchState pointer eliminates
the last target dependent data type in sysemu/kvm.h.

It also simplifies the code.

Signed-off-by: Stefan Weil <>
Acked-by: Paolo Bonzini <>...

f17ec444 07/23/2013 03:41 am Andreas Färber

exec: Change cpu_memory_rw_debug() argument to CPUState

Propagate X86CPU in kvmvapic for simplicity.

Signed-off-by: Andreas Färber <>

ed2803da 07/23/2013 03:41 am Andreas Färber

cpu: Move singlestep_enabled field from CPU_COMMON to CPUState

Prepares for changing cpu_single_step() argument to CPUState.

Acked-by: Michael Walle <> (for lm32)
Signed-off-by: Andreas Färber <>

51455c59 07/10/2013 06:54 pm Anthony Liguori

Merge remote-tracking branch 'afaerber/tags/qom-cpu-for-anthony' into staging

QOM CPUState refactorings

  • Fix for OpenRISCCPU subclasses
  • Fix for gdbstub CPU selection
  • Move linux-user CPU functions into new header
  • CPUState part 10 refactoring: first_cpu, next_cpu, cpu_single_env et al....
182735ef 07/09/2013 10:32 pm Andreas Färber

cpu: Make first_cpu and next_cpu CPUState

Move next_cpu from CPU_COMMON to CPUState.
Move first_cpu variable to qom/cpu.h.

gdbstub needs to use CPUState::env_ptr for now.
cpu_copy() no longer needs to save and restore cpu_next.

Acked-by: Paolo Bonzini <>...

36ad0e94 07/09/2013 09:38 pm Markus Armbruster

Fix -machine options accel, kernel_irqchip, kvm_shadow_mem

Multiple -machine options with the same ID are merged. All but the
one without an ID are to be silently ignored.

In most places, we query these options with a null ID. This is
correct.

In some places, we instead query whatever options come first in the...

1b5ec234 07/04/2013 06:42 pm Paolo Bonzini

memory: return MemoryRegion from qemu_ram_addr_from_host

It will be needed in the next patch.

Reviewed-by: Jan Kiszka <>
Signed-off-by: Paolo Bonzini <>

dd1750d7 06/28/2013 02:25 pm Andreas Färber

kvm: Change kvm_cpu_synchronize_state() argument to CPUState

It no longer relies on CPUArchState since 20d695a.

Reviewed-by: liguang <>
Acked-by: Paolo Bonzini <>
Reviewed-by: Richard Henderson <>...

cb446eca 06/28/2013 02:25 pm Andreas Färber

kvm: Change cpu_synchronize_state() argument to CPUState

Change Monitor::mon_cpu to CPUState as well.

Reviewed-by: liguang <>
Acked-by: Paolo Bonzini <>
Signed-off-by: Andreas Färber <>

0514ef2f 05/02/2013 01:27 am Eduardo Habkost

target-i386: Replace cpuid_*features fields with a feature word array

This replaces the feature-bit fields on both X86CPU and x86_def_t
structs with an array.

With this, we will be able to simplify code that simply does the same
operation on all feature words (e.g. kvm_check_features_against_host(),...

fc7a504c 05/02/2013 12:21 am Eduardo Habkost

target-i386/kvm.c: Code formatting changes

Add appropriate spaces around operators, and break line where it needs
to be broken to allow feature-words array to be introduced without
having too-long lines.

Signed-off-by: Eduardo Habkost <>...

917367aa 04/18/2013 05:27 am Marcelo Tosatti

target-i386: kvm: save/restore steal time MSR

Read and write steal time MSR, so that reporting is functional across
migration.

Signed-off-by: Marcelo Tosatti <>
Signed-off-by: Gleb Natapov <>

0d09e41a 04/08/2013 07:13 pm Paolo Bonzini

hw: move headers to include/

Many of these should be cleaned up with proper qdev-/QOM-ification.
Right now there are many catch-all headers in include/hw/ARCH depending
on cpu.h, and this makes it necessary to compile these files per-target.
However, fixing this does not belong in these patches....

259186a7 03/12/2013 11:35 am Andreas Färber

cpu: Move halted and interrupt_request fields to CPUState

Both fields are used in VMState, thus need to be moved together.
Explicitly zero them on reset since they were located before
breakpoints.

Pass PowerPCCPU to kvmppc_handle_halt().

Signed-off-by: Andreas Färber <>

fcd7d003 02/16/2013 03:51 pm Andreas Färber

cpu: Move exit_request field to CPUState

Since it was located before breakpoints field, it needs to be reset.

Signed-off-by: Andreas Färber <>

0893d460 01/30/2013 12:57 am Anthony Liguori

Merge remote-tracking branch 'qemu-kvm/uq/master' into staging

  • qemu-kvm/uq/master:
    target-i386: kvm: prevent buffer overflow if -cpu foo, [x]level is too big
    vmxcap: bit 9 of VMX_PROCBASED_CTLS2 is 'virtual interrupt delivery'

Conflicts:
target-i386/kvm.c...

f8bb0565 01/29/2013 08:57 am Igor Mammedov

target-i386: kvm: prevent buffer overflow if -cpu foo, [x]level is too big

Stack corruption may occur if too big 'level' or 'xlevel' values passed
on command line with KVM enabled, due to limited size of cpuid_data
in kvm_arch_init_vcpu().

reproduces with:...

b164e48e 01/27/2013 03:34 pm Eduardo Habkost

kvm: Create kvm_arch_vcpu_id() function

This will allow each architecture to define how the VCPU ID is set on
the KVM_CREATE_VCPU ioctl call.

Signed-off-by: Eduardo Habkost <>
Acked-by: Gleb Natapov <>
Signed-off-by: Andreas Färber <>

83b17af5 01/27/2013 03:34 pm Eduardo Habkost

target-i386: kvm: Set vcpu_id to APIC ID instead of CPU index

The CPU ID in KVM is supposed to be the APIC ID, so change the
KVM_CREATE_VCPU call to match it. The current behavior didn't break
anything yet because today the APIC ID is assumed to be equal to the CPU...

34daffa0 01/02/2013 04:01 pm Anthony Liguori

Merge remote-tracking branch 'qemu-kvm/uq/master' into staging

  • qemu-kvm/uq/master:
    qemu-kvm/pci-assign: 64 bits bar emulation
    target-i386: Enabling IA32_TSC_ADJUST for QEMU KVM guest VMs

Signed-off-by: Anthony Liguori <>

501a7ce7 12/23/2012 01:40 am Andreas Färber

Merge branch 'master' of git://git.qemu.org/qemu into qom-cpu

Adapt header include paths.

Signed-off-by: Andreas Färber <>

a60f24b5 12/19/2012 03:09 pm Andreas Färber

cpu: Move kvm_state field into CPUState

Adapt some functions to take CPUState / {PowerPC,S390}CPU argument.

Signed-off-by: Andreas Färber <>

f7575c96 12/19/2012 03:09 pm Andreas Färber

cpu: Move kvm_run into CPUState

Pass CPUState / {X86,S390}CPU to helper functions.

Signed-off-by: Andreas Färber <>

20d695a9 12/19/2012 03:09 pm Andreas Färber

kvm: Pass CPUState to kvm_arch_*

Move kvm_vcpu_dirty field into CPUState to simplify things and change
its type to bool while at it.

Signed-off-by: Andreas Färber <>

1bc22652 12/19/2012 03:09 pm Andreas Färber

kvm: Pass CPUState to kvm_vcpu_ioctl()

Adapt helper functions to pass X86CPU / PowerPCCPU / S390CPU.

Signed-off-by: Andreas Färber <>

9c17d615 12/19/2012 09:32 am Paolo Bonzini

softmmu: move include files to include/sysemu/

Signed-off-by: Paolo Bonzini <>

1de7afc9 12/19/2012 09:32 am Paolo Bonzini

misc: move include files to include/qemu/

Signed-off-by: Paolo Bonzini <>

022c62cb 12/19/2012 09:31 am Paolo Bonzini

exec: move include files to include/exec/

Signed-off-by: Paolo Bonzini <>

077805fa 12/19/2012 09:29 am Paolo Bonzini

janitor: do not rely on indirect inclusions of or from qemu-char.h

Various header files rely on qemu-char.h including qemu-config.h or
main-loop.h, but they really do not need qemu-char.h at all (particularly
interesting is the case of the block layer!). Clean this up, and also...

a2cb15b0 12/17/2012 01:02 pm Michael S. Tsirkin

pci: update all users to look in pci/

update all users so we can remove the makefile hack.

Signed-off-by: Michael S. Tsirkin <>

f28558d3 12/14/2012 10:17 pm Will Auld

target-i386: Enabling IA32_TSC_ADJUST for QEMU KVM guest VMs

CPUID.7.0.EBX1=1 indicates IA32_TSC_ADJUST MSR 0x3b is supported

Basic design is to emulate the MSR by allowing reads and writes to the
hypervisor vcpu specific locations to store the value of the emulated MSRs....

48405526 11/10/2012 03:49 pm Blue Swirl

kvm: avoid using cpu_single_env

Pass around CPUArchState instead of using global cpu_single_env.

Signed-off-by: Blue Swirl <>
Reviewed-by: Andreas Färber <>

43552994 11/01/2012 06:12 pm Anthony Liguori

Merge remote-tracking branch 'qemu-kvm/uq/master' into staging

  • qemu-kvm/uq/master: (28 commits)
    update-linux-headers.sh: Handle new kernel uapi/ directories
    target-i386: kvm_cpu_fill_host: use GET_SUPPORTED_CPUID
    target-i386: cpu: make -cpu host/check/enforce code KVM-specific...
bee615d4 10/31/2012 05:12 am Andreas Färber

target-i386: Pass X86CPU to kvm_mce_inject()

Needed for changing cpu_x86_inject_mce() argument to X86CPU.

Signed-off-by: Andreas Färber <>
[AF: Rebased onto hwaddr]

8c5cf3b6 10/31/2012 05:12 am Andreas Färber

target-i386: Pass X86CPU to cpu_x86_inject_mce()

Needed for changing run_on_cpu() argument to CPUState.

Signed-off-by: Andreas Färber <>

23d02d9b 10/31/2012 05:12 am Andreas Färber

target-i386: Pass X86CPU to kvm_get_mp_state()

Needed for moving halted field to CPUState.

Signed-off-by: Andreas Färber <>

839b5630 10/31/2012 05:12 am Andreas Färber

target-i386: Pass X86CPU to kvm_handle_halt()

Needed for moving interrupt_request and halted fields to CPUState.

Signed-off-by: Andreas Färber <>

c9da8382 10/31/2012 03:39 am Eduardo Habkost

i386: kvm: mask cpuid_ext4_features bits earlier

This way all the filtering by GET_SUPPORTED_CPUID is being done at the
same place in the code.

Signed-off-by: Eduardo Habkost <>
Signed-off-by: Marcelo Tosatti <>

bc74b7db 10/31/2012 03:39 am Eduardo Habkost

i386: kvm: filter CPUID feature words earlier, on cpu.c

cpu.c contains the code that will check if all requested CPU features
are available, so the filtering of KVM features must be there, so we can
implement "check" and "enforce" properly.

The only point where kvm_arch_init_vcpu() is called on i386 is:...

ac67ee26 10/31/2012 03:39 am Eduardo Habkost

i386: kvm: set CPUID_EXT_TSC_DEADLINE_TIMER on kvm_arch_get_supported_cpuid()

This moves the CPUID_EXT_TSC_DEADLINE_TIMER CPUID flag hacking from
kvm_arch_init_vcpu() to kvm_arch_get_supported_cpuid().

Full git grep for kvm_arch_get_supported_cpuid:

kvm.h:uint32_t kvm_arch_get_supported_cpuid(KVMState *env, uint32_t function,...
41e5e76d 10/31/2012 03:39 am Eduardo Habkost

i386: kvm: x2apic is not supported without in-kernel irqchip

This is necessary so that x2apic is not improperly enabled when the
in-kernel irqchip is disabled.

This won't generate a warning with "-cpu ...,check" because the current
check/enforce code is broken (it checks the host CPU data directly,...

ea85c9e4 10/31/2012 03:39 am Eduardo Habkost

i386: kvm: mask cpuid_kvm_features earlier

Instead of masking the KVM feature bits very late (while building the
KVM_SET_CPUID2 data), mask it out on env->cpuid_kvm_features, at the
same point where the other feature words are masked out.

Signed-off-by: Eduardo Habkost <>...

c2acb022 10/31/2012 03:39 am Eduardo Habkost

i386: kvm: kvm_arch_get_supported_cpuid: replace if+switch with single 'if'

Additional fixups will be added, and making them a single 'if/else if'
chain makes it clearer than two nested switch statements.

Signed-off-by: Eduardo Habkost <>...

84bd945c 10/31/2012 03:39 am Eduardo Habkost

i386: kvm: set CPUID_EXT_HYPERVISOR on kvm_arch_get_supported_cpuid()

Full grep for kvm_arch_get_supported_cpuid:

kvm.h:uint32_t kvm_arch_get_supported_cpuid(KVMState *env, uint32_t function,
target-i386/cpu.c: x86_cpu_def->cpuid_7_0_ebx_features = kvm_arch_get_supported_cpuid(kvm_state, 0x7, 0, R_EBX);...
8c723b79 10/31/2012 03:39 am Eduardo Habkost

i386: kvm: kvm_arch_get_supported_cpuid: clean up has_kvm_features check

Instead of a function-specific has_kvm_features variable, simply use a
"found" variable that will be checked in case we have to use the legacy
get_para_features() interface.

No behavior change, just code cleanup....

47111e2c 10/31/2012 03:39 am Eduardo Habkost

i386: kvm: kvm_arch_get_supported_cpuid: use 'entry' variable

The reg switch will be moved to a separate function, so store the entry
pointer in a variable.

No behavior change, just code movement.

Signed-off-by: Eduardo Habkost <>
Signed-off-by: Marcelo Tosatti <>

829ae2f9 10/31/2012 03:39 am Eduardo Habkost

i386: kvm: extract register switch to cpuid_entry_get_reg() function

No behavior change: just code movement.

Signed-off-by: Eduardo Habkost <>
Signed-off-by: Marcelo Tosatti <>

4fb73f1d 10/31/2012 03:39 am Eduardo Habkost

i386: kvm: extract CPUID entry lookup to cpuid_find_entry() function

No behavior change, just code movement.

Signed-off-by: Eduardo Habkost <>
Signed-off-by: Marcelo Tosatti <>

dd87f8a6 10/31/2012 03:39 am Eduardo Habkost

i386: kvm: extract try_get_cpuid() loop to get_supported_cpuid() function

No behavior change, just code movement.

Signed-off-by: Eduardo Habkost <>
Signed-off-by: Marcelo Tosatti <>

7b46e5ce 10/31/2012 03:39 am Eduardo Habkost

i386: kvm: kvm_arch_get_supported_cpuid: move R_EDX hack outside of for loop

The for loop will become a separate function, so clean it up so it can
become independent from the bit hacking for R_EDX.

No behavior change1, just code movement.

[1] Well, only if the kernel returned CPUID leafs 1 or 0x80000001 as...

2fa45344 10/31/2012 02:02 am Andreas Färber

cpus: Pass CPUState to cpu_is_stopped()

CPUArchState is no longer needed there.

Also change the return type to bool.

Signed-off-by: Andreas Färber <>

60e82579 10/31/2012 02:02 am Andreas Färber

cpus: Pass CPUState to qemu_cpu_is_self()

Change return type to bool, move to include/qemu/cpu.h and
add documentation.

Signed-off-by: Andreas Färber <>
Reviewed-by: Igor Mammedov <>
[AF: Updated new caller qemu_in_vcpu_thread()]

a8170e5e 10/23/2012 04:58 pm Avi Kivity

Rename target_phys_addr_t to hwaddr

target_phys_addr_t is unwieldly, violates the C standard (_t suffixes are
reserved) and its purpose doesn't match the name (most target_phys_addr_t
addresses are not target specific). Replace it with a finger-friendly,...

8fad4b44 09/30/2012 02:11 pm Eduardo Habkost

i386: kvm: use a #define for the set of alias feature bits

Instea of using a hardcoded hex constant, define CPUID_EXT2_AMD_ALIASES
as the set of CPUID[8000_0001].EDX bits that on AMD are the same as the
bits of CPUID1.EDX.

Signed-off-by: Eduardo Habkost <>...

b1f46793 09/30/2012 02:10 pm Eduardo Habkost

i386: kvm: bit 10 of CPUID[8000_0001].EDX is reserved

Bit 10 of CPUID[8000_0001].EDX is not defined as an alias of
CPUID1.EDX10, so do not duplicate it on
kvm_arch_get_supported_cpuid().

Signed-off-by: Eduardo Habkost <>
Reviewed-By: Igor Mammedov <>...

b139bd30 09/10/2012 03:29 pm Jan Kiszka

kvm: i386: Add services required for PCI device assignment

These helpers abstract the interaction of upcoming pci-assign with the
KVM kernel services. Put them under i386 only as other archs will
implement device pass-through via VFIO and not this classic interface....

bc9a839d 08/29/2012 06:51 pm Michael S. Tsirkin

kvm: get/set PV EOI MSR

Support get/set of new PV EOI MSR, for migration.
Add an optional section for MSR value - send it
out in case MSR was changed from the default value (0).

Signed-off-by: Michael S. Tsirkin <>
Signed-off-by: Anthony Liguori <>

f3e1bed8 08/09/2012 04:16 pm Peter Maydell

kvm: Decouple 'GSI routing' from 'kernel irqchip'

Don't assume having an in-kernel irqchip means that GSI
routing is enabled.

Signed-off-by: Peter Maydell <>
Signed-off-by: Avi Kivity <>

cc7e0ddf 08/09/2012 04:16 pm Peter Maydell

kvm: Decouple 'irqfds usable' from 'kernel irqchip'

Instead of assuming that we can use irqfds if and only if
kvm_irqchip_in_kernel(), add a bool to the KVMState which
indicates this, and is set only on x86 and only if the
irqchip is in the kernel.

The kernel documentation implies that the only thing...

614e41bc 08/09/2012 04:16 pm Peter Maydell

kvm: Decouple 'MSI routing via irqfds' from 'kernel irqchip'

Decouple another x86-specific assumption about what irqchips imply.

Signed-off-by: Peter Maydell <>
Signed-off-by: Avi Kivity <>

1d31f66b 08/09/2012 04:16 pm Peter Maydell

kvm: Move kvm_allows_irq0_override() to target-i386, fix return type

kvm_allows_irq0_override() is a totally x86 specific concept:
move it to the target-specific source file where it belongs.
This means we need a new header file for the prototype:
kvm_i386.h, in line with the existing kvm_ppc.h....

dd673288 08/01/2012 04:45 pm Igor Mammedov

target-i386: move cpu halted decision into x86_cpu_reset

MP initialization protocol differs between cpu families, and for P6 and
onward models it is up to CPU to decide if it will be BSP using this
protocol, so try to model this. However there is no point in implementing...

5d62c43a 07/10/2012 11:31 am Jan Kiszka

apic: Defer interrupt updates to VCPU thread

KVM performs TPR raising asynchronously to QEMU, specifically outside
QEMU's global lock. When an interrupt is injected into the APIC and TPR
is checked to decide if this can be delivered, a stale TPR value may be...

a75b3e0f 07/03/2012 11:36 pm Liu, Jinsong

kvm: expose tsc deadline timer feature to guest

This patch exposes tsc deadline timer feature to guest if
1). in-kernel irqchip is used, and
2). kvm has emulated tsc deadline timer, and
3). user authorize the feature exposing via cpu or +/ tsc-deadline...

232fc23b 06/05/2012 12:00 am Andreas Färber

target-i386: Pass X86CPU to do_cpu_{init,sipi}()

Allows to use cpu_reset() in place of cpu_state_reset().

Signed-off-by: Andreas Färber <>
Reviewed-by: Igor Mammedov <>

317ac620 03/14/2012 11:20 pm Andreas Färber

target-i386: Don't overuse CPUState

Scripted conversion:
sed -i "s/CPUState/CPUX86State/g" target-i386/*.[hc]
sed -i "s/#define CPUX86State/#define CPUState/" target-i386/cpu.h

Signed-off-by: Andreas Färber <>
Acked-by: Anthony Liguori <>

7e680753 03/07/2012 12:31 pm Michael S. Tsirkin

kvm: fill in padding to help valgrind

valgrind warns about padding fields which are passed
to vcpu ioctls uninitialized.
This is not an error in practice because kvm ignored padding.
Since the ioctls in question are off data path and
the cost is zero anyway, initialize padding to 0...

d362e757 02/18/2012 12:15 pm Jan Kiszka

target-i386: Add infrastructure for reporting TPR MMIO accesses

This will allow the APIC core to file a TPR access report. Depending on
the accelerator and kernel irqchip mode, it will either be delivered
right away or queued for later reporting.

In TCG mode, we can restart the triggering instruction and can therefore...

d1f86636 02/16/2012 06:21 pm Gleb Natapov

kvm: Synchronize cpu state in kvm_arch_stop_on_emulation_error()

Call to kvm_cpu_synchronize_state() is missing.
kvm_arch_stop_on_emulation_error may look at outdated registers here.

Signed-off-by: Gleb Natapov <>
Signed-off-by: Avi Kivity <>...

39d6960a 02/08/2012 07:57 pm Jan Kiszka

kvm: Allow to set shadow MMU size

Introduce the KVM-specific machine option kvm_shadow_mem. It allows to
set a custom shadow MMU size for the virtual machine. This is useful for
stress testing e.g.

Only x86 supports this for now, but it is in principle a generic...

3d4b2649 02/08/2012 07:57 pm Jan Kiszka

kvm: Implement kvm_irqchip_in_kernel like kvm_enabled

To both avoid that kvm_irqchip_in_kernel always has to be paired with
kvm_enabled and that the former ends up in a function call, implement it
like the latter. This means keeping the state in a global variable and...

84b058d7 01/19/2012 01:14 pm Jan Kiszka

kvm: Introduce core services for in-kernel irqchip support

Add the basic infrastructure to active in-kernel irqchip support, inject
interrupts into these models, and maintain IRQ routes.

Routing is optional and depends on the host arch supporting
KVM_CAP_IRQ_ROUTING. When it's not available on x86, we looe the HPET as...

680c1c6f 01/19/2012 01:14 pm Jan Kiszka

kvm: x86: Add user space part for in-kernel APIC

This introduces the alternative APIC device which makes use of KVM's
in-kernel device model. External NMI injection via LINT1 is emulated by
checking the current state of the in-kernel APIC, only injecting a NMI...

eab70139 01/19/2012 12:33 pm Vadim Rozenfeld

hyper-v: initialize Hyper-V CPUID leaves.

Signed-off-by: Marcelo Tosatti <>

f3c6a169 01/03/2012 10:39 pm Anthony Liguori

Merge remote-tracking branch 'qemu-kvm/memory/page_desc' into staging

  • qemu-kvm/memory/page_desc: (22 commits)
    Remove cpu_get_physical_page_desc()
    sparc: avoid cpu_get_physical_page_desc()
    virtio-balloon: avoid cpu_get_physical_page_desc()
    vhost: avoid cpu_get_physical_page_desc()...
fabacc0f 12/22/2011 06:53 pm Jan Kiszka

kvm: x86: Avoid runtime allocation of xsave buffer

Keep a per-VCPU xsave buffer for kvm_put/get_xsave instead of
continuously allocating and freeing it on state sync.

Signed-off-by: Jan Kiszka <>
Signed-off-by: Marcelo Tosatti <>

cce47516 12/22/2011 06:53 pm Jan Kiszka

kvm: x86: Drop redundant apic base and tpr update from kvm_get_sregs

The latter was already commented out, the former is redundant as well.
We always get the latest changes after return from the guest via
kvm_arch_post_run.

Signed-off-by: Jan Kiszka <>...

6b42494b 12/22/2011 06:53 pm Jan Kiszka

kvm: x86: Use symbols for all xsave field

Field 0 (FCW+FSW) and 1 (FTW+FOP) were hard-coded so far.

Signed-off-by: Jan Kiszka <>
Signed-off-by: Marcelo Tosatti <>

9f213ed9 12/20/2011 02:14 pm Avi Kivity

kvm: switch kvm slots to use host virtual address instead of ram_addr_t

This simplifies a later switch to the memory API in slot management.

Signed-off-by: Avi Kivity <>

12619721 11/17/2011 02:57 pm Vagrant Cascadian

Fix typo: runnning -> running

One n too many for running, need we say more.

Signed-Off-By: Vagrant Cascadian <>

Signed-off-by: Stefan Hajnoczi <>

21e87c46 10/25/2011 02:33 am Avi Kivity

i386: wire up MSR_IA32_MISC_ENABLE

It's needed for its default value - bit 0 specifies that "rep movs" is
good enough for memcpy, and Linux may use a slower memcpu if it is not set,
depending on cpu family/model.

Signed-off-by: Avi Kivity <>...

aa82ba54 10/25/2011 02:29 am Liu, Jinsong

kvm: support TSC deadline MSR with subsection

KVM add emulation of lapic tsc deadline timer for guest.
This patch is co-operation work at qemu side.

Use subsections to save/restore the field (mtosatti).

Signed-off-by: Liu, Jinsong <>...

38d2c27e 10/25/2011 02:27 am Marcelo Tosatti

Revert "kvm: support TSC deadline MSR"

This reverts commit bfc2455ddbb41148494a084d15777e6bed7533c3.
New patch with subsections will follow.

Signed-off-by: Marcelo Tosatti <>

bfc2455d 10/03/2011 07:53 pm Liu, Jinsong

kvm: support TSC deadline MSR

KVM add emulation of lapic tsc deadline timer for guest.
This patch is co-operation work at qemu side.

Signed-off-by: Liu, Jinsong <>
Signed-off-by: Marcelo Tosatti <>

1dfb4dd9 09/15/2011 10:39 pm Luiz Capitulino

Replace the VMSTOP macros with a proper state type

Today, when notifying a VM state change with vm_state_notify(),
we pass a VMSTOP macro as the 'reason' argument. This is not ideal
because the VMSTOP macros tell why qemu stopped and not exactly
what the current VM state is....

1354869c 09/15/2011 10:39 pm Luiz Capitulino

Drop the vm_running global variable

Use runstate_is_running() instead, which is introduced by this commit.

Signed-off-by: Luiz Capitulino <>

6115c0a8 09/10/2011 05:50 pm Blue Swirl

kvm: remove unnecessary assignments

Avoid these warnings from clang analyzer:
/src/qemu/target-i386/kvm.c:772:5: warning: Value stored to 'cwd' is never read
cwd = swd = twd = 0;
/src/qemu/target-i386/kvm.c:772:11: warning: Although the value stored to 'swd' is used in the enclosing expression, the value is never actually read from 'swd'...

541dc0d4 09/03/2011 01:45 pm Stefan Weil

Use new macro QEMU_PACKED for packed structures

Most changes were made using these commands:

git grep -la '__attribute__((packed))'|xargs perl -pi -e 's/__attribute__\(\(packed\)\)/QEMU_PACKED/'
git grep -la '__attribute__ ((packed))'|xargs perl -pi -e 's/__attribute__ \(\(packed\)\)/QEMU_PACKED/'...

fdc9c41a 08/25/2011 11:21 am Jan Kiszka

Fix up some style nits of last uq/master merge

Signed-off-by: Jan Kiszka <>
Signed-off-by: Stefan Hajnoczi <>

7267c094 08/21/2011 07:01 am Anthony Liguori

Use glib memory allocation and free functions

qemu_malloc/qemu_free no longer exist after this commit.

Signed-off-by: Anthony Liguori <>

ac363c90 08/05/2011 06:10 pm Marcelo Tosatti

Remove #ifdef KVM_CAP_TSC_CONTROL

Signed-off-by: Marcelo Tosatti <>

e7429073 08/05/2011 06:04 pm Joerg Roedel

qemu-x86: Set tsc_khz in kvm when supported

Make use of the KVM_TSC_CONTROL feature if available.

Signed-off-by: Joerg Roedel <>
Signed-off-by: Marcelo Tosatti <>

31e8c696 06/20/2011 09:26 pm Andre Przywara

KVM: Fix XSAVE feature bit enumeration

When iterating through the XSAVE feature enumeration CPUID leaf (0xD)
we should not stop at the first zero EAX, but instead keep scanning
since there are gaps in the enumeration (ECX=1 for instance).
This fixes the proper usage of AVX in KVM guests....

ba9bc59e 06/20/2011 09:24 pm Jan Kiszka

kvm: x86: Pass KVMState to kvm_arch_get_supported_cpuid

kvm_arch_get_supported_cpuid checks for global cpuid restrictions, it
does not require any CPUState reference. Changing its interface allows
to call it before any VCPU is initialized.

CC: Eduardo Habkost <>...

e56ff191 06/20/2011 09:19 pm Jan Kiszka

kvm: x86: Drop KVM_CAP build dependencies

No longer needed with accompanied kernel headers.

Signed-off-by: Jan Kiszka <>
Signed-off-by: Marcelo Tosatti <>

5802e066 06/20/2011 09:16 pm Jan Kiszka

kvm: Drop CONFIG_KVM_PARA

The kvm_para.h header is now always available.

Signed-off-by: Jan Kiszka <>
Signed-off-by: Marcelo Tosatti <>

42cc8fa6 06/19/2011 03:57 pm Jan Kiszka

kvm: x86: Save/restore FPU OP, IP and DP

These FPU states are properly maintained by KVM but not yet by TCG. So
far we unconditionally set them to 0 in the guest which may cause
state corruptions, though not with modern guests.

To avoid breaking backward migration, use a conditional subsection that...

b3baa152 06/14/2011 05:34 pm brillywu@viatech.com.cn

kvm: Add CPUID support for VIA CPU

When KVM is running on VIA CPU with host cpu's model, the
feautures of VIA CPU will be passed into kvm guest by calling
the CPUID instruction for Centaur.

Signed-off-by: BrillyWu<>
Signed-off-by: KaryJin<>...

4a043713 05/02/2011 03:51 pm Paolo Bonzini

kvm: use qemu_free consistently

Signed-off-by: Paolo Bonzini <>
Signed-off-by: Marcelo Tosatti <>

0c31b744 05/02/2011 02:24 pm Glauber Costa

kvm: use kernel-provided para_features instead of statically coming up with new capabilities

Use the features provided by KVM_GET_SUPPORTED_CPUID directly to
mask out features from guest-visible cpuid.

The old get_para_features() mechanism is kept for older kernels that do not implement it....