Statistics
| Branch: | Revision:

root / kvm-all.c @ 80465e80

History | View | Annotate | Download (42.5 kB)

# Date Author Comment
bc8c6788 04/13/2012 01:01 am Jason Baron

kvm: set gsi_bits and max_gsi correctly

The current kvm_init_irq_routing() doesn't set up the used_gsi_bitmap
correctly, and as a consequence pins max_gsi to 32 when it really
should be 1024. I ran into this limitation while testing pci
passthrough, where I consistently got an -ENOSPC return from...

4b8f1c88 04/13/2012 01:01 am Michael S. Tsirkin

kvm: allow arbitrarily sized mmio ioeventfd

We use a 2 byte ioeventfd for virtio memory,
add support for this.

Signed-off-by: Michael S. Tsirkin <>
Reviewed-by: Amos Kong <>
Signed-off-by: Avi Kivity <>

c73b0097 04/13/2012 01:01 am Jan Kiszka

kvm: Drop unused kvm_pit_in_kernel

This is now implied by kvm_irqchip_in_kernel.

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

92e4b519 03/15/2012 02:12 pm David Gibson

kvm: Comparison with ioctl number macros needs to be unsigned

In kvm-all.c we store an ioctl cmd number in the irqchip_inject_ioctl field
of KVMState, which has type 'int'. This seems to make sense since the
ioctl() man page says that the cmd parameter has type int....

9349b4f9 03/14/2012 11:20 pm Andreas Färber

Rename CPUState -> CPUArchState

Scripted conversion:
for file in .[hc] hw/.[hc] hw/kvm/*.[hc] linux-user/*.[hc] linux-user/m68k/*.[hc] bsd-user/*.[hc] darwin-user/*.[hc] tcg/*/*.[hc] target-*/cpu.h; do
sed -i "s/CPUState/CPUArchState/g" $file
done...

dac6b1b2 03/09/2012 08:30 pm Anthony Liguori

Merge remote-tracking branch 'stefanha/trivial-patches' into staging

  • stefanha/trivial-patches:
    configure: Quote the configure args printed in config.log
    osdep: Remove local definition of macro offsetof
    libcacard: Spelling and grammar fixes in documentation...
93148aa5 03/08/2012 05:22 pm Stefan Weil

Spelling fixes in comments (it's -> its)

  • it's -> its (fixed for all files)
  • dont -> don't (only fixed in a line which was touched by the previous fix)
  • distrub -> disturb (fixed in the same line)

Reviewed-by: Andreas Färber <>
Signed-off-by: Stefan Weil <>...

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

8a7c7393 03/07/2012 12:27 pm Jan Kiszka

kvm: Add kvm_has_pit_state2 helper

To be used for in-kernel PIT emulation.

Signed-off-by: Jan Kiszka <>
Signed-off-by: Avi Kivity <>

88e6c606 03/01/2012 11:26 pm Anthony Liguori

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

  • qemu-kvm/memory/urgent:
    kvm: fix unaligned slots
14655e48 03/01/2012 11:26 pm Anthony Liguori

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

  • qemu-kvm/memory/core: (30 commits)
    memory: allow phys_map tree paths to terminate early
    memory: unify PhysPageEntry::node and ::leaf
    memory: change phys_page_set() to set multiple pages...
8f6f962b 03/01/2012 02:50 pm Avi Kivity

kvm: fix unaligned slots

kvm_set_phys_mem() may be passed sections that are not aligned to a page
boundary. The current code simply brute-forces the alignment which leads
to an inconsistency and an abort().

Fix by aligning the start and the end of the section correctly, discarding...

7376e582 02/29/2012 01:44 pm Avi Kivity

memory: allow MemoryListeners to observe a specific address space

Ignore any regions not belonging to a specified address space.

Signed-off-by: Avi Kivity <>

50c1e149 02/29/2012 01:44 pm Avi Kivity

memory: support stateless memory listeners

Current memory listeners are incremental; that is, they are expected to
maintain their own state, and receive callbacks for changes to that state.

This patch adds support for stateless listeners; these work by receiving...

72e22d2f 02/29/2012 01:44 pm Avi Kivity

memory: switch memory listeners to a QTAILQ

This allows reverse iteration, which in turns allows consistent ordering
among multiple listeners:

l1->add
l2->add
l2->del
l1->del

Signed-off-by: Avi Kivity <>
Reviewed-by: Richard Henderson <>

80a1ea37 02/29/2012 01:44 pm Avi Kivity

memory: move ioeventfd ops to MemoryListener

This way the accelerator (kvm) can handle them directly.

Signed-off-by: Avi Kivity <>
Reviewed-by: Richard Henderson <>

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

kvm: Set cpu_single_env only once

As we have thread-local cpu_single_env now and KVM uses exactly one
thread per VCPU, we can drop the cpu_single_env updates from the loop
and initialize this variable only once during setup.

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

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

a9c5eb0d 02/02/2012 03:47 am Alexander Graf

KVM: Fix compilation on non-x86

Commit 84b058d broke compilation for KVM on non-x86 targets, which
don't have KVM_CAP_IRQ_ROUTING defined.

Fix by not using the unavailable constant when it's not around.

Signed-off-by: Alexander Graf <>

fd4aa979 01/25/2012 08:32 pm Blue Swirl

memory: change dirty setting APIs to take a size

Instead of each target knowing or guessing the guest page size,
just pass the desired size of dirtied memory area.

Signed-off-by: Blue Swirl <>

5b4448d2 01/23/2012 07:00 pm Anthony Liguori

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

  • qemu-kvm/uq/master:
    kvm: Activate in-kernel irqchip support
    kvm: x86: Add user space part for in-kernel IOAPIC
    kvm: x86: Add user space part for in-kernel i8259
    kvm: x86: Add user space part for in-kernel APIC...
aa90fec7 01/21/2012 06:17 am Benjamin Herrenschmidt

Fix dirty logging with 32-bit qemu & 64-bit guests

The kvm_get_dirty_pages_log_range() function uses two address
variables to step through the monitored memory region to update the
dirty log. However, these variables have type unsigned long, which
can overflow if running a 64-bit guest with a 32-bit qemu binary....

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

9b5b76d4 01/19/2012 01:14 pm Jan Kiszka

kvm: x86: Establish IRQ0 override control

KVM is forced to disable the IRQ0 override when we run with in-kernel
irqchip but without IRQ routing support of the kernel. Set the fwcfg
value correspondingly. This aligns us with qemu-kvm.

Signed-off-by: Jan Kiszka <>

3fbffb62 01/15/2012 04:13 pm Avi Kivity

kvm: flush the dirty log when unregistering a slot

Otherwise, the dirty log information is lost in the kernel forever.

Fixes opensuse-12.1 boot screen, which changes the vga windows rapidly.

Signed-off-by: Avi Kivity <>

ffcde12f 01/03/2012 07:19 pm Avi Kivity

kvm: avoid cpu_get_physical_page_desc()

This reaches into the innards of the memory core, which are being
changed. Switch to a memory API version.

Signed-off-by: Avi Kivity <>

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

a01672d3 12/20/2011 02:14 pm Avi Kivity

kvm: convert to MemoryListener API

Drop the use of cpu_register_phys_memory_client() in favour of the new
MemoryListener API. The new API simplifies the caller, since there is no
need to deal with splitting and merging slots; however this is not exploited...

7b011fbc 12/16/2011 12:45 pm Michael Ellerman

kvm: Print something before calling abort() if KVM_RUN fails

It's a little unfriendly to call abort() without printing any sort of
error message. So turn the DPRINTK into an fprintf(stderr, ...).

Signed-off-by: Michael Ellerman <>...

db9eae1c 11/01/2011 11:52 pm Xu He Jie

kvm_init didn't set return value after create vm failed

And kvm_ioctl(s, KVM_CREATE_VM, 0)'s return value can be < -1,
so change the check of vmfd at label 'err'.

Signed-off-by: Xu He Jie <>
Signed-off-by: Anthony Liguori <>

1cae88b9 10/25/2011 02:26 am Avi Kivity

kvm: avoid reentring kvm_flush_coalesced_mmio_buffer()

mmio callbacks invoked by kvm_flush_coalesced_mmio_buffer() may
themselves indirectly call kvm_flush_coalesced_mmio_buffer().
Prevent reentering the function by checking a flag that indicates
we're processing coalesced mmio requests....

0461d5a6 10/04/2011 05:02 pm Luiz Capitulino

RunState: Rename enum values as generated by the QAPI

Next commit will convert the query-status command to use the
RunState type as generated by the QAPI.

In order to "transparently" replace the current enum by the QAPI
one, we have to make some changes to some enum values....

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

12d4536f 09/02/2011 06:34 pm Anthony Liguori

main: force enabling of I/O thread

Enabling the I/O thread by default seems like an important part of declaring
1.0. Besides allowing true SMP support with KVM, the I/O thread means that the
TCG VCPU doesn't have to multiplex itself with the I/O dispatch routines which...

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

2a1ac12b 08/05/2011 06:04 pm Jan Kiszka

kvm: Drop obsolete KVM_IOEVENTFD #ifdefs

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

ba4047cf 06/20/2011 09:18 pm Jan Kiszka

kvm: Drop KVM_CAP build dependencies

No longer needed with accompanied kernel headers. We are only left with
build dependencies that are controlled by kvm arch headers.

CC: Alexander Graf <>
Signed-off-by: Jan Kiszka <>...

1480b74f 06/20/2011 09:17 pm Jan Kiszka

kvm: Drop useless zero-initializations

Backing KVMState is alreay zero-initialized.

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

d4d6868f 05/09/2011 11:31 pm Alexander Graf

kvm: ppc: warn user on PAGE_SIZE mismatch

On PPC, the default PAGE_SIZE is 64kb. Unfortunately, the hardware
alignments don't match here: There are RAM and MMIO regions within
a single page when it's 64kb in size.

So the only way out for now is to tell the user that he should use 4k...

5300f1a5 05/05/2011 04:39 pm Michael S. Tsirkin

Merge remote branch 'origin/master' into pci

Conflicts:
exec.c

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

kvm: use qemu_free consistently

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

aa7f74d1 05/02/2011 03:38 pm Jan Kiszka

kvm: Install specialized interrupt handler

KVM only requires to set the raised IRQ in CPUState and to kick the
receiving vcpu if it is remote. Installing a specialized handler allows
potential future changes to the TCG code path without risking KVM side
effects....

51b0c606 05/02/2011 03:38 pm Michael Tokarev

fix crash in migration, 32-bit userspace on 64-bit host

This change fixes a long-standing immediate crash (memory corruption
and abort in glibc malloc code) in migration on 32bits.

The bug is present since this commit:

commit 692d9aca97b865b0f7903565274a52606910f129...
25254bbc 04/06/2011 11:08 pm Michael S. Tsirkin

kvm: halve number of set memory calls for vga

use the new api to reduce the number of these (expensive)
system calls.

Note: using this API, we should be able to
get rid of vga_dirty_log_xxx APIs. Using them doesn't
affect the performance though because we detects...

0fd542fb 04/06/2011 10:28 pm Michael S. Tsirkin

cpu: add set_memory flag to request dirty logging

Pass the flag to all cpu notifiers, doing
nothing at this point. Will be used by
follow-up patches.

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

51e8fa60 03/16/2011 10:11 pm Jan Kiszka

kvm: Consider EXIT_DEBUG unknown without CAP_SET_GUEST_DEBUG

Without KVM_CAP_SET_GUEST_DEBUG, we neither motivate the kernel to
report KVM_EXIT_DEBUG nor do we expect such exits. So fall through to
the arch code which will simply report an unknown exit reason....

7cbb533f 03/16/2011 10:11 pm Jan Kiszka

kvm: Keep KVM_RUN return value in separate variable

Avoid using 'ret' both for the return value of KVM_RUN as well as the
code kvm_cpu_exec is supposed to return. Both have no direct relation.

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

dc77d341 03/16/2011 10:11 pm Jan Kiszka

kvm: Reorder error handling of KVM_RUN

Test for general errors first as this is the slower path.

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

d73cd8f4 03/16/2011 10:11 pm Jan Kiszka

kvm: Rework inner loop of kvm_cpu_exec

Let kvm_cpu_exec return EXCP_* values consistently and generate those
codes already inside its inner loop. This means we will now re-enter the
kernel while ret == 0.

Update kvm_handle_internal_error accordingly, but keep...

bb4ea393 03/16/2011 10:11 pm Jan Kiszka

kvm: Align kvm_arch_handle_exit to kvm_cpu_exec changes

Make the return code of kvm_arch_handle_exit directly usable for
kvm_cpu_exec. This is straightforward for x86 and ppc, just s390
would require more work. Avoid this for now by pushing the return code...

f2574737 03/16/2011 10:11 pm Jan Kiszka

kvm: x86: Push kvm_arch_debug to kvm_arch_handle_exit

There are no generic bits remaining in the handling of KVM_EXIT_DEBUG.
So push its logic completely into arch hands, i.e. only x86 so far.

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

d841b6c4 03/16/2011 10:11 pm Jan Kiszka

kvm: Mark VCPU state dirty on creation

This avoids that early cpu_synchronize_state calls try to retrieve an
uninitialized state from the kernel. That even causes a deadlock if
io-thread is enabled.

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

99036865 03/15/2011 06:19 am Jan Kiszka

kvm: Rename kvm_arch_process_irqchip_events to async_events

We will broaden the scope of this function on x86 beyond irqchip events.

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

fbc1c7e6 03/15/2011 06:19 am Jan Kiszka

kvm: Fix build warning when KVM_CAP_SET_GUEST_DEBUG is lacking

Original fix by David Gibson.

CC: David Gibson <>
Signed-off-by: Jan Kiszka <>
Signed-off-by: Marcelo Tosatti <>

e5896b12 02/14/2011 04:39 pm Anthony PERARD

Introduce log_start/log_stop in CPUPhysMemoryClient

In order to use log_start/log_stop with Xen as well in the vga code,
this two operations have been put in CPUPhysMemoryClient.

The two new functions cpu_physical_log_start,cpu_physical_log_stop are
used in hw/vga.c and replace the kvm_log_start/stop. With this, vga does...

6a7af8cb 02/14/2011 04:39 pm Jan Kiszka

kvm: Make kvm_state globally available

KVM-assisted devices need access to it but we have no clean channel to
distribute a reference. As a workaround until there is a better
solution, export kvm_state for global use, though use should remain
restricted to the mentioned scenario....

e07bbac5 02/14/2011 04:39 pm Jan Kiszka

Improve vm_stop reason declarations

Define and use dedicated constants for vm_stop reasons, they actually
have nothing to do with the EXCP_* defines used so far. At this chance,
specify more detailed reasons so that VM state change handlers can
evaluate them....

6792a57b 02/14/2011 04:39 pm Jan Kiszka

kvm: Separate TCG from KVM cpu execution

Mixing up TCG bits with KVM already led to problems around eflags
emulation on x86. Moreover, quite some code that TCG requires on cpu
enty/exit is useless for KVM. So dispatch between tcg_cpu_exec and
kvm_cpu_exec as early as possible....

8e045ac4 02/14/2011 04:39 pm Jan Kiszka

kvm: Remove unneeded memory slot reservation

The number of slots and the location of private ones changed several
times in KVM's early days. However, it's stable since 2.6.29 (our
required baseline), and slots 8..11 are no longer reserved since then.
So remove this unneeded restriction....

748a680b 02/14/2011 04:39 pm Jan Kiszka

kvm: Report proper error on GET_VCPU_MMAP_SIZE failures

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

a1b87fe0 02/14/2011 04:39 pm Jan Kiszka

kvm: Provide sigbus services arch-independently

Provide arch-independent kvm_on_sigbus* stubs to remove the #ifdef'ery
from cpus.c. This patch also fixes --disable-kvm build by providing the
missing kvm_on_sigbus_vcpu kvm-stub.

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

9ccfac9e 02/14/2011 04:39 pm Jan Kiszka

kvm: Unconditionally reenter kernel after IO exits

KVM requires to reenter the kernel after IO exits in order to complete
instruction emulation. Failing to do so will leave the kernel state
inconsistently behind. To ensure that we will get back ASAP, we issue a...

b30e93e9 02/14/2011 04:39 pm Jan Kiszka

kvm: Remove static return code of kvm_handle_io

Improve the readability of the exit dispatcher by moving the static
return value of kvm_handle_io to its caller.

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

cdea50ed 02/14/2011 04:39 pm Jan Kiszka

kvm: Leave kvm_cpu_exec directly after KVM_EXIT_SHUTDOWN

The reset we issue on KVM_EXIT_SHUTDOWN implies that we should also
leave the VCPU loop. As we now check for exit_request which is set by
qemu_system_reset_request, this bug is no longer critical. Still it's an...

b3a98367 02/01/2011 11:32 pm Anthony Liguori

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

aliguori: fix build with !defined(KVM_CAP_ASYNC_PF)

Signed-off-by: Anthony Liguori <>

d0dcac83 01/31/2011 11:03 am Stefan Hajnoczi

virtio-pci: Disable virtio-ioeventfd when !CONFIG_IOTHREAD

It is not possible to use virtio-ioeventfd when building without an I/O
thread. We rely on a signal to kick us out of vcpu execution. Timers
and AIO use SIGALRM and SIGUSR2 respectively. Unfortunately eventfd...

94a8d39a 01/23/2011 06:27 am Jan Kiszka

kvm: Consolidate must-have capability checks

Instead of splattering the code with #ifdefs and runtime checks for
capabilities we cannot work without anyway, provide central test
infrastructure for verifying their availability both at build and
runtime.

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

b0c883b5 01/23/2011 06:27 am Jan Kiszka

kvm: Flush coalesced mmio buffer on IO window exits

We must flush pending mmio writes if we leave kvm_cpu_exec for an IO
window. Otherwise we risk to loose those requests when migrating to a
different host during that window.

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

cad1e282 01/23/2011 06:27 am Jan Kiszka

kvm: Drop smp_cpus argument from init functions

No longer used.

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

73aaec4a 01/23/2011 06:27 am Jan Kiszka

kvm: Stop on all fatal exit reasons

Ensure that we stop the guest whenever we face a fatal or unknown exit
reason. If we stop, we also have to enforce a cpu loop exit.

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

bb44e0d1 01/23/2011 06:27 am Jan Kiszka

kvm: Improve reporting of fatal errors

Report KVM_EXIT_UNKNOWN, KVM_EXIT_FAIL_ENTRY, and KVM_EXIT_EXCEPTION
with more details to stderr. The latter two are so far x86-only, so move
them into the arch-specific handler. Integrate the Intel real mode
warning on KVM_EXIT_FAIL_ENTRY that qemu-kvm carries, but actually...

f5c848ee 01/23/2011 06:27 am Jan Kiszka

x86: Optionally dump code bytes on cpu_dump_state

Introduce the cpu_dump_state flag CPU_DUMP_CODE and implement it for
x86. This writes out the code bytes around the current instruction
pointer. Make use of this feature in KVM to help debugging fatal vm
exits....

a426e122 01/21/2011 06:12 pm Jan Kiszka

kvm: Fix coding style violations

No functional changes.

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

14a09518 01/21/2011 06:05 pm Lai Jiangshan

kvm: convert kvm_ioctl(KVM_CHECK_EXTENSION) to kvm_check_extension()

simple cleanup and use existing helper: kvm_check_extension().

Signed-off-by: Lai Jiangshan <>
Signed-off-by: Marcelo Tosatti <>

d2f2b8a7 01/10/2011 02:44 pm Stefan Hajnoczi

kvm: test for ioeventfd support on old kernels

There used to be a limit of 6 KVM io bus devices in the kernel.
On such a kernel, we can't use many ioeventfds for host notification
since the limit is reached too easily.

Add an API to test for this condition....

b2e0a138 12/02/2010 09:13 pm Michael S. Tsirkin

migration: stable ram block ordering

This makes ram block ordering under migration stable, ordered by offset.
This is especially useful for migration to exec, for debugging.

Signed-off-by: Michael S. Tsirkin <>
Tested-by: Jason Wang <>

983dfc3b 10/21/2010 12:15 am Huang Ying

Add RAM -> physical addr mapping in MCE simulation

In QEMU-KVM, physical address != RAM address. While MCE simulation
needs physical address instead of RAM address. So
kvm_physical_memory_addr_from_ram() is implemented to do the
conversion, and it is invoked before being filled in the IA32_MCi_ADDR...

e78815a5 09/25/2010 02:26 pm Andreas Färber

Introduce qemu_madvise()

vl.c has a Sun-specific hack to supply a prototype for madvise(),
but the call site has apparently moved to arch_init.c.

Haiku doesn't implement madvise() in favor of posix_madvise().
OpenBSD and Solaris 10 don't implement posix_madvise() but madvise()....

e945fb76 08/23/2010 11:10 pm Anthony Liguori

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

44f1a3d8 08/11/2010 12:25 am Cam Macdonell

Add function to assign ioeventfd to MMIO.

Signed-off-by: Cam Macdonell <>
Signed-off-by: Anthony Liguori <>

14542fea 08/05/2010 03:57 pm Gleb Natapov

kvm: remove guest triggerable abort()

This abort() condition is easily triggerable by a guest if it configures
pci bar with unaligned address that overlaps main memory.

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

70fedd76 08/05/2010 03:57 pm Alex Williamson

kvm: Don't walk memory_size == 0 slots in kvm_client_migration_log

If we've unregistered a memory area, we should avoid calling
qemu_get_ram_ptr() on the left over phys_offset cruft in the
slot array. Now that we support removing ramblocks, the
phys_offset ram_addr_t can go away and cause a lookup fault...

3c638d06 07/22/2010 06:52 am Jan Kiszka

Rework debug exception processing for gdb use

Guest debugging is currently broken under CONFIG_IOTHREAD. The reason is
inconsistent or even lacking signaling the debug events from the source
VCPU to the main loop and the gdbstub.

This patch addresses the issue by pushing this signaling into a...

be41cbe0 06/28/2010 07:06 pm Jan Kiszka

kvm: Switch kvm_update_guest_debug to run_on_cpu

Guest debugging under KVM is currently broken once io-threads are
enabled. Easily fixable by switching the fake on_vcpu to the real
run_on_cpu implementation.

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

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

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

2705d56a 05/11/2010 08:02 pm Jan Kiszka

kvm: synchronize state from cpu context

It is not safe to retrieve the KVM internal state of a given cpu
while its potentially modifying it.

Queue the request to run on cpu context, similarly to qemu-kvm.

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

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

273faf1b 05/11/2010 08:02 pm Marcelo Tosatti

kvm: set cpu_single_env around KVM_RUN ioctl

Zero cpu_single_env before leaving global lock protection, and
restore on return.

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

8369e01c 04/28/2010 07:41 pm Marcelo Tosatti

kvm: port qemu-kvm's bitmap scanning

Which is significantly faster.

Signed-off-by: Marcelo Tosatti <>

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

7c80eef8 04/26/2010 05:28 pm Marcelo Tosatti

kvm: handle internal error

Port qemu-kvm's KVM_EXIT_INTERNAL_ERROR handling to upstream.

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

98c8573e 04/19/2010 09:59 pm Paolo Bonzini

provide a stub version of kvm-all.c if !CONFIG_KVM

This allows limited use of kvm functions (which will return ENOSYS)
even in once-compiled modules. The patch also improves a bit the error
messages for KVM initialization.

Signed-off-by: Paolo Bonzini <>...

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

0104dcac 04/01/2010 10:51 pm Alexander Graf

S390: Tell user why VM creation failed

The KVM kernel module on S390 refuses to create a VM when the switch_amode
kernel parameter is not used.

Since that is not exactly obvious, let's give the user a nice warning.

Signed-off-by: Alexander Graf <>...

ca821806 04/01/2010 09:56 pm Michael S. Tsirkin

kvm: add API to set ioeventfd

Comment on kvm usage: rather than require users to do if (kvm_enabled())
and/or ifdefs, this patch adds an API that, internally, is defined to
stub function on non-kvm build, and checks kvm_enabled for non-kvm
run.

While rest of qemu code still uses if (kvm_enabled()), I think this...

d745bef8 03/29/2010 10:23 pm Blue Swirl

Move KVM and Xen global flags to vl.c

Signed-off-by: Blue Swirl <>

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

85199474 02/22/2010 07:04 pm Marcelo Tosatti

kvm-all.c: define smp_wmb and use it for coalesced mmio

Acked-by: "Michael S. Tsirkin" <>
Signed-off-by: Marcelo Tosatti <>
Signed-off-by: Avi Kivity <>