Statistics
| Branch: | Revision:

root / target-i386 / kvm.c @ f8502cfb

History | View | Annotate | Download (47.1 kB)

# Date Author Comment
f8502cfb 10/21/2010 06:09 pm Hidetoshi Seto

x86, mce: ignore SRAO only when MCG_SER_P is available

And restruct this block to call kvm_mce_in_exception() only when it is
required.

Signed-off-by: Hidetoshi Seto <>
Signed-off-by: Marcelo Tosatti <>

296acb64 10/21/2010 12:15 am Joerg Roedel

Add svm cpuid features

This patch adds the svm cpuid feature flags to the qemu
intialization path. It also adds the svm features available
on phenom to its cpu-definition and extends the host cpu
type to support all svm features KVM can provide.

Signed-off-by: Joerg Roedel <>...

e7701825 10/21/2010 12:15 am Marcelo Tosatti

kvm: x86: add mce support

Port qemu-kvm's MCE support

commit c68b2374c9048812f488e00ffb95db66c0bc07a7
Author: Huang Ying <>
Date: Mon Jul 20 10:00:53 2009 +0800

Add MCE simulation support to qemu/kvm
KVM ioctls are used to initialize MCE simulation and inject MCE. The...
c0532a76 10/21/2010 12:15 am Marcelo Tosatti

MCE: Relay UCR MCE to guest

Port qemu-kvm's

commit 4b62fff1101a7ad77553147717a8bd3bf79df7ef
Author: Huang Ying <>
Date: Mon Sep 21 10:43:25 2009 +0800

MCE: Relay UCR MCE to guest
UCR (uncorrected recovery) MCE is supported in recent Intel CPUs,...
57780495 10/21/2010 12:15 am Marcelo Tosatti

Add savevm/loadvm support for MCE

Port qemu-kvm's

commit 1bab5d11545d8de5facf46c28630085a2f9651ae
Author: Huang Ying <>
Date: Wed Mar 3 16:52:46 2010 +0800

Add savevm/loadvm support for MCE
MCE registers are saved/load into/from CPUState in...
0f53994f 10/21/2010 12:15 am Marcelo Tosatti

Fix memory leak in register save load due to xsave support

From: Avi Kivity <>
Signed-off-by: Marcelo Tosatti <>

c958a8bd 06/28/2010 07:06 pm Sheng Yang

kvm: Extend kvm_arch_get_supported_cpuid() to support index

Would use it later for XSAVE related CPUID.

Signed-off-by: Sheng Yang <>
Signed-off-by: Marcelo Tosatti <>

f1665b21 06/28/2010 07:06 pm Sheng Yang

kvm: Enable XSAVE live migration support

Signed-off-by: Sheng Yang <>
Signed-off-by: Marcelo Tosatti <>

ddced198 06/28/2010 07:06 pm Marcelo Tosatti

kvm: init mp_state

Signed-off-by: Marcelo Tosatti <>
Signed-off-by: Avi Kivity <>

408392b3 06/28/2010 07:06 pm Sheng Yang

kvm: Fix cpu_is_bsp() compilation warning

Signed-off-by: Sheng Yang <>
Signed-off-by: Avi Kivity <>

4a942cea 06/19/2010 10:42 am Blue Swirl

apic: avoid passing CPUState from CPU code

Pass only APICState when accessing APIC from CPU code.

Signed-off-by: Blue Swirl <>

c1667e40 05/11/2010 11:07 pm Gleb Natapov

kvm: fix 80000001.EDX supported bit filtering

On AMD some bits from 1.EDX are reported in 80000001.EDX. The mask used
to copy bits from 1.EDX to 80000001.EDX is incorrect resulting in
unsupported features passed into a guest.

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

4513d923 05/11/2010 08:03 pm Gleb Natapov

Do not stop VM if emulation failed in userspace.

Continue vcpu execution in case emulation failure happened while vcpu
was in userspace. In this case #UD will be injected into the guest
allowing guest OS to kill offending process and continue.

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

dbaa07c4 05/11/2010 08:02 pm Jan Kiszka

kvm: validate context for kvm cpu get/put operations

Validate that KVM vcpu state is only read/written from cpu thread itself
or that cpu is stopped.

Signed-off-by: Marcelo Tosatti <>
Signed-off-by: Avi Kivity <>

0af691d7 05/11/2010 08:02 pm Marcelo Tosatti

kvm: enable smp > 1

Process INIT/SIPI requests and enable -smp > 1.

Signed-off-by: Marcelo Tosatti <>
Signed-off-by: Avi Kivity <>

ff44f1a3 04/26/2010 05:28 pm Jan Kiszka

KVM: x86: Add debug register saving and restoring

Make use of the new KVM_GET/SET_DEBUGREGS to save/restore the x86 debug
registers.

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

20420430 04/26/2010 05:28 pm Sheng Yang

kvm: allow qemu to set EPT identity mapping address

If we use larger BIOS image than current 256KB, we would need move reserved
TSS and EPT identity mapping pages. Currently TSS support this, but not
EPT.

Signed-off-by: Marcelo Tosatti <>...

8c0d577e 04/18/2010 05:22 pm Blue Swirl

kvm: avoid collision with dprintf macro in stdio.h, spotted by clang

Fixes clang errors:
CC i386-softmmu/kvm.o
/src/qemu/target-i386/kvm.c:40:9: error: 'dprintf' macro redefined
In file included from /src/qemu/target-i386/kvm.c:21:
In file included from /src/qemu/qemu-common.h:27:...

457dfed6 03/13/2010 05:50 pm Andre Przywara

x86/cpuid: remove unnecessary kvm_trim function

Correct me if I am wrong, but kvm_trim looks like a really bloated
implementation of a bitwise AND. So remove this function and replace
it with the real stuff(TM).

Signed-off-by: Andre Przywara <>...

ea643051 03/04/2010 05:29 am Jan Kiszka

KVM: x86: Restrict writeback of VCPU state

Do not write nmi_pending, sipi_vector, and mpstate unless we at least go
through a reset. And TSC as well as KVM wallclocks should only be
written on full sync, otherwise we risk to drop some time on state
read-modify-write....

ea375f9a 03/04/2010 05:29 am Jan Kiszka

KVM: Rework VCPU state writeback API

This grand cleanup drops all reset and vmsave/load related
synchronization points in favor of four(!) generic hooks:

- cpu_synchronize_all_states in qemu_savevm_state_complete
(initial sync from kernel before vmsave)...

b0b1d690 03/04/2010 05:29 am Jan Kiszka

KVM: Rework of guest debug state writing

So far we synchronized any dirty VCPU state back into the kernel before
updating the guest debug state. This was a tribute to a deficite in x86
kernels before 2.6.33. But as this is an arch-dependent issue, it is
better handle in the x86 part of KVM and remove the writeback point for...

35bed8ee 03/01/2010 05:29 am Paul Brook

Move ioport.h out of cpu-all.h

Only include ioport.h where it is actually needed.

Signed-off-by: Paul Brook <>

724c6893 02/23/2010 12:16 am Anthony Liguori

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

62f734a0 02/21/2010 11:41 am Jes Sorensen

kvm: Kill CR3_CACHE feature references

Remove all references to KVM_CR3_CACHE as it was never implemented.

Signed-off-by: Jes Sorensen <>
Signed-off-by: Avi Kivity <>

4c5b10b7 02/19/2010 11:53 pm Jes Sorensen

QEMU e820 reservation patch

Hi,

Kevin and I have agreed on the approach for this one now. So here is
the latest version of the patch for QEMU, submitting e820 reservation
entries via fw_cfg.

Cheers,
Jes

Use qemu-cfg to provide the BIOS with an optional table of e820 entries....

19ccb8ea 02/03/2010 11:47 pm Jan Kiszka

KVM: x86: Fix up misreported CPU features

From qemu-kvm: Kernels before 2.6.30 misreported some essential CPU
features via KVM_GET_SUPPORTED_CPUID. Fix them up.

Signed-off-by: Jan Kiszka <>

aee028b9 02/03/2010 11:47 pm Jan Kiszka

KVM: Request setting of nmi_pending and sipi_vector

The final version of VCPU events in 2.6.33 will allow to skip
nmi_pending and sipi_vector on KVM_SET_VCPU_EVENTS. For now let's write
them unconditionally, which is unproblematic for upstream due to missing...

bb0300dc 01/14/2010 01:14 am Gleb Natapov

Add KVM paravirt cpuid leaf

Initialize KVM paravirt cpuid leaf and allow user to control guest
visible PV features through -cpu flag.

Signed-off-by: Gleb Natapov <>
Signed-off-by: Anthony Liguori <>

e73223a5 01/11/2010 05:56 pm Gleb Natapov

remove pending exception on vcpu reset.

Without this qemu can even start on kvm modules with events support
since default value of exception_injected in zero and this is #DE
exception.

Signed-off-by: Gleb Natapov <>
Signed-off-by: Anthony Liguori <>

31827373 12/18/2009 07:26 pm Jan Kiszka

kvm: x86: Use separate exception_injected CPUState field

Marcelo correctly remarked that there are usage conflicts between QEMU
core code and KVM /wrt exception_index. So spend a separate field and
also save/restore it properly.

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

1a03675d 12/12/2009 03:59 pm Glauber Costa

v2: properly save kvm system time msr registers

Currently, the msrs involved in setting up pvclock are not saved over
migration and/or save/restore. This patch puts their value in special
fields in our CPUState, and deal with them using vmstate.

kvm also has to account for it, by including them in the msr list...

6fb6d245 12/07/2009 04:45 pm Jan Kiszka

kvm: x86: Fix initial kvm_has_msr_star

KVM_GET_MSR_INDEX_LIST returns -E2BIG when the provided space is too
small for all MSRs. But this is precisely the error we trigger with the
initial request in order to obtain that size. Do not fail in that case.

This caused a subtle corruption of the guest state as MSR_STAR was not...

a0fb002c 12/03/2009 11:25 pm Jan Kiszka

kvm: x86: Add support for VCPU event states

This patch extends the qemu-kvm state sync logic with support for
KVM_GET/SET_VCPU_EVENTS, giving access to yet missing exception,
interrupt and NMI states.

Signed-off-by: Jan Kiszka <>
Signed-off-by: Anthony Liguori <>

5a2e3c2e 12/03/2009 11:25 pm Jan Kiszka

kvm: x86: Fix merge artifact of f8d926e9 about mp_state

Signed-off-by: Jan Kiszka <>
Signed-off-by: Anthony Liguori <>

caa5af0f 11/17/2009 04:49 pm Jan Kiszka

kvm: Add arch reset handler

Will be required by succeeding changes.

Signed-off-by: Jan Kiszka <>
Signed-off-by: Anthony Liguori <>

0e607a80 11/17/2009 04:49 pm Jan Kiszka

kvm: x86: Refactor use of interrupt_bitmap

Drop interrupt_bitmap from the cpustate and solely rely on the integer
interupt_injected. This prepares us for the new injected-interrupt
interface, which will deprecate the bitmap, while preserving
compatibility....

9bdbe550 11/12/2009 07:23 pm Hollis Blanchard

kvm: Move KVM mp_state accessors to i386-specific code

Unbreaks PowerPC and S390 KVM builds.

Signed-off-by: Hollis Blanchard <>
Signed-off-by: Anthony Liguori <>

38972938 09/25/2009 10:52 pm Juan Quintela

gcc wants 1st static and then const

Signed-off-by: Juan Quintela <>
Signed-off-by: Blue Swirl <>

d9db889f 07/10/2009 09:44 pm Jan Kiszka

kvm: Work around borken MSR_GET_INDEX_LIST

Allocate enough memory for KVM_GET_MSR_INDEX_LIST as older kernels shot
far beyond their limits, corrupting user space memory.

Signed-off-by: Jan Kiszka <>
Signed-off-by: Anthony Liguori <>

6c0d7ee8 06/29/2009 09:52 pm Andre Przywara

preserve the hypervisor bit while KVM trims the CPUID bits

The KVM kernel will disable all bits in CPUID which are not present in
the host. As this is mostly true for the hypervisor bit (1.ecx),
preserve its value before the trim and restore it afterwards....

6c1f42fe 06/29/2009 09:52 pm Andre Przywara

fix KVMs GET_SUPPORTED_CPUID feature usage

If we want to trim the user provided CPUID bits for KVM to be not greater
than that of the host, we should not remove the bits after we sent
them to the kernel.
This fixes the masking of features that are not present on the host by...

f8d926e9 05/22/2009 06:50 pm Jan Kiszka

kvm: x86: Save/restore KVM-specific CPU states

Save and restore all so far neglected KVM-specific CPU states. Handling
the TSC stabilizes migration in KVM mode. The interrupt_bitmap and
mp_state are currently unused, but will become relevant for in-kernel...

76ae317f 05/20/2009 05:12 pm Mark McLoughlin

kvm: work around supported cpuid ioctl() brokenness

KVM_GET_SUPPORTED_CPUID has been known to fail to return -E2BIG
when it runs out of entries. Detect this by always trying again
with a bigger table if the ioctl() fills the table.

Signed-off-by: Mark McLoughlin <>

b827df58 05/08/2009 11:42 pm Avi Kivity

kvm: Add support for querying supported cpu features

kvm does not support all cpu features; add support for dunamically querying
the supported feature set.

Signed-off-by: Avi Kivity <>
Signed-off-by: Anthony Liguori <>

a33609ca 04/17/2009 11:50 pm aliguori

kvm: Fix cpuid initialization (Jan Kiszka)

Fix (more or less) spurious guest boot failures due to corrupted cpuid
states. The reason was insufficient initialization of cpuid entries
before passing them to the kernel.

At this chance also fix improper entry pointer progression and simplify...

64bf3f4e 03/28/2009 07:51 pm aliguori

kvm: Drop kvm_patch_opcode_byte (Jan Kiszka)

As cpu_memory_rw_debug is now capable of modifying ROM, we can drop our
own patch function.

Signed-off-by: Jan Kiszka <>
Signed-off-by: Anthony Liguori <>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6906 c046a42c-6fe2-441c-8c8c-71466251a162

e22a25c9 03/12/2009 10:12 pm aliguori

Guest debugging support for KVM (Jan Kiszka)

This is a backport of the guest debugging support for the KVM
accelerator that is now part of the KVM tree. It implements the reworked
KVM kernel API for guest debugging (KVM_CAP_SET_GUEST_DEBUG) which is
not yet part of any mainline kernel but will probably be 2.6.30 stuff....

b136a4c6 02/11/2009 11:00 pm aliguori

KVM: cpuid function 2: store all values (Amit Shah)

Incrementing the array index was missed in the previous series which causes
us to not store all the values.

Signed-off-by: Amit Shah <>
Signed-off-by: Anthony Liguori <>...

a36b1029 02/09/2009 05:50 pm aliguori

KVM: Get all cpuid values from function 2 (Amit Shah)

cpuid function 2 can have multiple values to describe cache behaviour.
Loop till we have fetched all the values.

Signed-off-by: Amit Shah <>
Signed-off-by: Anthony Liguori <>...

486bd5a2 02/09/2009 05:50 pm aliguori

KVM: Fetch sub-leaf cpuid values for functions 4, 0xb, 0xd. (Amit Shah)

CPUID functions 4, 0xb and 0xd have sub-leaf values which depend on the
input value of ECX. Store these values as well.

Signed-off-by: Amit Shah <>
Signed-off-by: Anthony Liguori <>...

e00b6f80 02/09/2009 05:50 pm aliguori

KVM: CPUID takes ecx as input value for some functions (Amit Shah)

The CPUID instruction takes the value of ECX as an input parameter
in addition to the value of EAX as the count for functions 4, 0xb
and 0xd. Make sure we pass the value to the instruction....

0d0266a5 02/06/2009 12:06 am aliguori

targets: remove error handling from qemu_malloc() callers (Avi Kivity)

Signed-off-by: Avi Kivity <>
Signed-off-by: Anthony Liguori <>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6530 c046a42c-6fe2-441c-8c8c-71466251a162

8c6c919e 01/26/2009 10:32 pm aliguori

kvm-x86: Remove eflags conversion into emulator format (Jan Kiszka)

It seems that the conversion of the kernel-delivered eflags state into
qemu's internal split representation was once needed in an older kvm
design (register read-back may have taken place from inside cpu_exec)....

55308450 12/13/2008 10:49 pm aliguori

Initialize msr list size properly in KVM

Hollis Blanchard noticed that the last commit was not sufficient. We also need
to initialize the msr size in our newly allocated list.

Signed-off-by: Anthony Liguori <>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6018 c046a42c-6fe2-441c-8c8c-71466251a162

4c9f7372 12/13/2008 10:41 pm aliguori

Correctly initialize msr list in KVM

I believe this was spotted by Gerd Hoffman but I can't find his patch
now. This will cause very subtle corruption on the heap because we
don't allocate the appropriately sized buffer.

Signed-off-by: Anthony Liguori <>...

40a2d705 12/11/2008 11:03 pm aliguori

Fix crash in kvm.c (Stefan Weil)

Fix crash with kvm enabled.

Signed-off-by: Stefan Weil <>
Signed-off-by: Anthony Liguori <>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5984 c046a42c-6fe2-441c-8c8c-71466251a162

984b5181 11/13/2008 09:21 pm aliguori

Define kvm_ioctl in the same way as ioctl

The third argument to ioctl is a ... which allows any value to be passed. In
practice, glibc always treats the argument as a void *.

Do the same thing for the kvm ioctls to keep things consistent with a
traditional ioctl....

05330448 11/05/2008 06:29 pm aliguori

Add missing files to KVM commit.

Signed-off-by: Anthony Liguori <>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5629 c046a42c-6fe2-441c-8c8c-71466251a162