Statistics
| Branch: | Revision:

root / kvm-all.c @ 7ed208c4

History | View | Annotate | Download (26.2 kB)

# Date Author Comment
a08d4367 06/29/2009 10:18 pm Jan Kiszka

Revert "Introduce reset notifier order"

This reverts commit 8217606e6edb49591b4a6fd5a0d1229cebe470a9 (and
updates later added users of qemu_register_reset), we solved the
problem it originally addressed less invasively.

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

8d2ba1fb 06/29/2009 10:18 pm Jan Kiszka

kvm: Rework VCPU synchronization

During startup and after reset we have to synchronize user space to the
in-kernel KVM state. Namely, we need to transfer the VCPU registers when
they change due to VCPU as well as APIC reset.

This patch refactors the required hooks so that kvm_init_vcpu registers...

8c14c173 06/16/2009 11:36 pm Jan Kiszka

kvm: Fix IRQ injection into full queue

User space may only inject interrupts during kvm_arch_pre_run if
ready_for_interrupt_injection is set in kvm_run. But that field is
updated on exit from KVM_RUN, so we must ensure that we enter the
kernel after potentially queuing an interrupt, otherwise we risk to...

168ccc11 06/07/2009 04:40 pm Jan Kiszka

kvm: Improve upgrade notes when facing unsupported kernels

Users complained that it is not obvious what to do when kvm refuses to
build or run due to an unsupported host kernel, so let's improve the
hints.

Signed-off-by: Jan Kiszka <>

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

kvm: Rework VCPU reset

Use standard callback with highest order to synchronize VCPU on reset
after all device callbacks were execute. This allows to remove the
special kvm hook in qemu_system_reset.

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

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...

4495d6a7 05/22/2009 06:50 pm Jan Kiszka

kvm: Introduce kvm_set_migration_log

Introduce a global dirty logging flag that enforces logging for all
slots. This can be used by the live migration code to enable/disable
global logging withouth destroying the per-slot setting.

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

62518b8b 05/22/2009 06:50 pm Jan Kiszka

kvm: Fix dirty log temporary buffer size

The buffer passed to KVM_GET_DIRTY_LOG requires one bit per page. Fix
the size calculation in kvm_physical_sync_dirty_bitmap accordingly,
avoiding allocation of extremly oversized buffers.

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

151f7749 05/22/2009 06:50 pm Jan Kiszka

kvm: Rework dirty bitmap synchronization

Extend kvm_physical_sync_dirty_bitmap() so that is can sync across
multiple slots. Useful for updating the whole dirty log during
migration. Moreover, properly pass down errors the whole call chain.

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

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

kvm: Conditionally apply workaround for KVM slot handling bug

Only apply the workaround for broken slot joining in KVM when the
capability was not found that signals the corresponding fix existence.

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

9f8fd694 05/20/2009 05:24 pm Mark McLoughlin

kvm: add error message for when SMP is requested

Right now, if you try e.g. '-smp 2' you just get 'failed to
initialize KVM'.

Signed-off-by: Mark McLoughlin <>

ad7b8b33 05/08/2009 11:42 pm Anthony Liguori

Introduce kvm_check_extension to check if KVM extensions are supported

Signed-off-by: Anthony Liguori <>

6f0437e8 05/01/2009 05:44 pm Jan Kiszka

kvm: Avoid COW if KVM MMU is asynchronous

Avi Kivity wrote:

Suggest wrapping in a function and hiding it deep inside kvm-all.c.

Done in v2:

---------->

If the KVM MMU is asynchronous (kernel does not support MMU_NOTIFIER),
we have to avoid COW for the guest memory. Otherwise we risk serious...

e6f4afe0 05/01/2009 05:38 pm Jan Kiszka

kvm: Relax aligment check of kvm_set_phys_mem

There is no need to reject an unaligned memory region registration if
the region will be I/O memory and it will not split an existing KVM
slot. This fixes KVM support on PPC.

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

6152e2ae 04/17/2009 05:26 pm aliguori

kvm: improve handling of overlapping slots (Jan Kiszka)

This reworks the slot management to handle more patterns of
cpu_register_physical_memory*, finally allowing to reset KVM guests (so
far address remapping on reset broke the slot management).

We could actually handle all possible ones without failing, but a KVM...

d3f8d37f 04/17/2009 05:26 pm aliguori

kvm: Add sanity checks to slot management (Jan Kiszka)

Fail loudly if we run out of memory slot.

Make sure that dirty log start/stop works with consistent memory regions
by reporting invalid parameters. This reveals several inconsistencies in
the vga code, patch to fix them follows later in this series....

494ada42 04/17/2009 05:26 pm aliguori

kvm: Cleanup unmap condition in kvm_set_phys_mem (Jan Kiszka)

Testing for TLB_MMIO on unmap makes no sense as A) that flag belongs to
CPUTLBEntry and not to io_memory slots or physical addresses and B) we
already use a different condition before mapping. So make this test...

5579c7f3 04/11/2009 05:47 pm pbrook

Remove code phys_ram_base uses.

Signed-off-by: Paul Brook <>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@7085 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....

be214e6c 03/06/2009 11:48 pm aurel32

Fix race condition on access to env->interrupt_request

env->interrupt_request is accessed as the bit level from both main code
and signal handler, making a race condition possible even on CISC CPU.
This causes freeze of QEMU under high load when running the dyntick...

1eec614b 02/06/2009 12:06 am aliguori

toplevel: 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@6531 c046a42c-6fe2-441c-8c8c-71466251a162

a9c11522 12/19/2008 12:42 am aurel32

KVM: Silence unused s warning

Move s under #ifdef to avoid compiler warning.

Signed-off-by: Jan Kiszka <>
Signed-off-by: Aurelien Jarno <>

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

f5d6f51b 12/16/2008 12:20 am aliguori

kvm: sync vcpu state during initialization (Hollis Blanchard)

Currently on x86, qemu initializes CPUState but KVM ignores it and does its
own vcpu initialization. However, PowerPC KVM needs to be able to set the
initial register state to support the -kernel and -append options....

f65ed4c1 12/09/2008 10:09 pm aliguori

KVM: Coalesced MMIO support

MMIO exits are more expensive in KVM or Xen than in QEMU because they
involve, at least, privilege transitions. However, MMIO write
operations can be effectively batched if those writes do not have side
effects.

Good examples of this include VGA pixel operations when in a planar...

d85dc283 12/09/2008 09:59 pm aliguori

Disable KVM support if the kernel modules have broken memory slot handling

Prior to kvm-80, memory slot deletion was broken in the KVM kernel
modules. In kvm-81, a new capability is introduced to signify that this
problem has been fixed.

Since we rely on being able to delete memory slots, refuse to work with...

bd322087 12/04/2008 10:33 pm aliguori

Add virtio-balloon support

This adds a VirtIO based balloon driver. It uses madvise() to actually balloon
the memory when possible.

Until 2.6.27, KVM forced memory pinning so we must disable ballooning unless the
kernel actually supports it when using KVM. It's always safe when using TCG....

5832d1f2 11/24/2008 09:36 pm aliguori

kvm: Introduce kvm logging interface (Glauber Costa)

Introduce functions to control logging of memory regions.
We select regions based on its start address, a
guest_physical_addr (target_phys_addr_t, in qemu nomenclature).

The main user of this interface right now is VGA optimization...

34fc643f 11/19/2008 07:41 pm aliguori

Make KVMSlot a real structure

struct kvm_userspace_memory_region does not use QEMU friendly types to
define memory slots. This results in lots of ugly casting with warnings
on 32-bit platforms.

This patch introduces a proper KVMSlot structure that uses QEMU types to...

a3d6841f 11/19/2008 05:09 pm aliguori

kvm: de-register mem region for MMIO (Glauber Costa)

Besides unassigned memory, we also don't care about MMIO.
So if we're giving an MMIO area that is already registered,
wipe it out.

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

62d60e8c 11/18/2008 05:41 pm aliguori

Make KVM slot management more robust

KVM keeps track of physical memory based on slots in the kernel. The current
code that translates QEMU memory mappings to slots work but is not robust
in the fact of reregistering partial regions of memory.

This patch does the right thing for reregistering partial regions of memory. It...

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....

becfc390 11/10/2008 05:55 pm aliguori

KVM: simplify kvm_cpu_exec hook

We don't need to use cpu_loop_exit() because we never use the
condition codes so everything can be folded into a single case.

Signed-off-by: Anthony Liguori <>

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

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