Statistics
| Branch: | Revision:

root / kvm-all.c @ 34b5d2c6

History | View | Annotate | Download (52.1 kB)

# Date Author Comment
bdc44640 09/03/2013 01:25 pm Andreas Färber

cpu: Use QTAILQ for CPU list

Introduce CPU_FOREACH(), CPU_FOREACH_SAFE() and CPU_NEXT() shorthand
macros.

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

b5d54bd4 08/30/2013 01:21 am Anthony Liguori

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

  • qemu-kvm/uq/master:
    kvm-stub: fix compilation
    kvm: shorten the parameter list for get_real_device()
    kvm: i386: fix LAPIC TSC deadline timer save/restore
    kvm-all.c: max_cpus should not exceed KVM vcpu limit...
7dc52526 08/20/2013 07:38 pm Marcelo Tosatti

kvm-all.c: max_cpus should not exceed KVM vcpu limit

maxcpus, which specifies the maximum number of hotpluggable CPUs,
should not exceed KVM's vcpu limit.

Signed-off-by: Marcelo Tosatti <>
[Reword message. - Paolo]
Signed-off-by: Paolo Bonzini <>

354678c5 08/20/2013 07:37 pm Jan Kiszka

kvm: Simplify kvm_handle_io

Now that cpu_in/out is just a wrapper around address_space_rw, we can
also call the latter directly. As host endianness == guest endianness,
there is no need for the memory access helpers st*_p/ld*_p as well.

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

ca916d37 08/09/2013 10:19 pm Vincenzo Maffione

kvm: add KVM_IRQFD_FLAG_RESAMPLE support

Added an EventNotifier* parameter to
kvm-all.c:kvm_irqchip_add_irqfd_notifier(), in order to give KVM
another eventfd to be used as "resamplefd". See the documentation
in the linux kernel sources in Documentation/virtual/kvm/api.txt...

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

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

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

kvm: Change kvm_{insert,remove}_breakpoint() argument to CPUState

CPUArchState is no longer directly used since converting CPU loops to
CPUState.

Prepares for changing GDBState::c_cpu to CPUState.

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

80b7cd73 07/09/2013 10:20 pm Andreas Färber

kvm: Free current_cpu identifier

Since CPU loops are done as last step in kvm_{insert,remove}_breakpoint()
and kvm_remove_all_breakpoints(), we do not need to distinguish between
invoking CPU and iterated CPUs and can thereby free the identifier for
use as a global variable....

1d5791f4 07/09/2013 10:20 pm Andreas Färber

kvm: Change kvm_remove_all_breakpoints() argument to CPUState

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

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

c3ab4c9c 07/07/2013 07:19 pm Anthony Liguori

Merge remote-tracking branch 'bonzini/iommu-for-anthony' into staging

  1. By Paolo Bonzini (50) and others
  2. Via Paolo Bonzini
    • bonzini/iommu-for-anthony: (66 commits)
      exec: change some APIs to take AddressSpaceDispatch
      exec: remove cur_map
      exec: put memory map in AddressSpaceDispatch...
dfde4e6e 07/04/2013 06:42 pm Paolo Bonzini

memory: add ref/unref calls

Add ref/unref calls at the following places:

- places where memory regions are stashed by a listener and
used outside the BQL (including in Xen or KVM).

- memory_region_find callsites

- creation of aliases and containers (only the aliased/contained...

40509f7f 07/03/2013 11:38 am Michael S. Tsirkin

kvm: skip system call when msi route is unchanged

Some guests do a large number of mask/unmask
calls which currently trigger expensive route update
system calls.
Detect that route in unchanged and skip the system call.

Reported-by: "Zhanghaoyu (A)" <>...

fa4ba923 07/03/2013 11:38 am Amos Kong

kvm: add detail error message when fail to add ioeventfd

I try to hotplug 28 * 8 multiple-function devices to guest with
old host kernel, ioeventfds in host kernel will be exhausted, then
qemu fails to allocate ioeventfds for blk/nic devices.

It's better to add detail error here....

0fbc2074 07/03/2013 11:38 am Michael S. Tsirkin

kvm: zero-initialize KVM_SET_GSI_ROUTING input

kvm_add_routing_entry makes an attempt to
zero-initialize any new routing entry.
However, it fails to initialize padding
within the u field of the structure
kvm_irq_routing_entry.

Other functions like kvm_irqchip_update_msi_route...

7b774593 07/01/2013 02:11 am Alexander Graf

KVM: Export kvm_init_irq_routing

On PPC, we can have different types of interrupt controllers, so we really
only know that we are going to use one when we created it.

Export kvm_init_irq_routing() to common code, so that we don't have to call
kvm_irqchip_create()....

d07cc1f1 07/01/2013 02:11 am Alexander Graf

KVM: MSI: Swap payload to native endianness

The usual MSI injection mechanism writes msi.data into memory using an
le32 wrapper. So on big endian guests, this swaps msg.data into the
expected byte order.

For irqfd however, we don't swap the payload right now, rendering...

cb925cf9 07/01/2013 02:11 am Alexander Graf

KVM: PIC: Only commit irq routing when necessary

The current logic updates KVM's view of our interrupt map every time we
change it. While this is nice and bullet proof, it slows things down
badly for me. QEMU spends about 3 seconds on every start telling KVM what...

215e79c0 07/01/2013 02:11 am Alexander Graf

KVM: Don't assume that mpstate exists with in-kernel PIC always

On PPC, we don't support MP state. So far it's not necessary and I'm
not convinced yet that we really need to support it ever.

However, the current idle logic in QEMU assumes that an in-kernel PIC...

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

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

kvm: Change kvm_set_signal_mask() argument to CPUState

CPUArchState is no longer needed.

Prepares for changing qemu_kvm_init_cpu_signals() argument to CPUState.

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

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

cpu: Turn cpu_dump_{state,statistics}() into CPUState hooks

Make cpustats monitor command available unconditionally.

Prepares for changing kvm_handle_internal_error() and kvm_cpu_exec()
arguments to CPUState.

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

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

kvm: Change kvm_handle_internal_error() argument to CPUState

It no longer uses CPUArchState.

Prepares for changing kvm_cpu_exec() argument to CPUState.

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

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

kvm: Change kvm_cpu_exec() argument to CPUState

It no longer uses CPUArchState.

Prepares for changing qemu_kvm_cpu_thread_fn() opaque to CPUState.

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

052e87b0 06/20/2013 05:32 pm Paolo Bonzini

memory: make section size a 128-bit integer

So far, the size of all regions passed to listeners could fit in 64 bits,
because artificial regions (containers and aliases) are eliminated by
the memory core, leaving only device regions which have reasonable sizes...

651eb0f4 06/03/2013 11:21 pm Xiao Guangrong

fix double free the memslot in kvm_set_phys_mem

Luiz Capitulino reported that guest refused to boot and qemu
complained with:
kvm_set_phys_mem: error unregistering overlapping slot: Invalid argument

It is caused by commit 235e8982ad that did double free for the memslot...

235e8982 05/29/2013 04:15 pm Jordan Justen

kvm: support using KVM_MEM_READONLY flag for regions

For readonly memory regions and rom devices in romd_mode,
we make use of the KVM_MEM_READONLY. A slot that uses
KVM_MEM_READONLY can be read from and code can execute from the
region, but writes will exit to qemu....

df9c8b75 05/29/2013 04:15 pm Jordan Justen

kvm: add kvm_readonly_mem_enabled

Signed-off-by: Jordan Justen <>
Reviewed-by: Paolo Bonzini <>
Message-id:
Signed-off-by: Anthony Liguori <>

6eebf958 05/14/2013 04:53 pm Paolo Bonzini

osdep, kvm: rename low-level RAM allocation functions

This is preparatory to the introduction of a separate freeing API.

Reported-by: Amos Kong <>
Signed-off-by: Paolo Bonzini <>
Reviewed-by: Amos Kong <>...

b76ac80a 05/03/2013 02:58 pm Kazuya Saito

kvm-all: add kvm_run_exit tracepoint

This patch enable us to know exit reason of KVM_RUN. It will help us
know where the trouble is caused.

Signed-off-by: Kazuya Saito <>
Reviewed-by: Paolo Bonzini <>
Signed-off-by: Stefan Hajnoczi <>

9c775729 05/03/2013 02:58 pm Kazuya Saito

kvm-all: add kvm_ioctl, kvm_vm_ioctl, kvm_vcpu_ioctl tracepoints

This patch adds tracepoints at ioctl to kvm. Tracing these ioctl is
useful for clarification whether the cause of troubles is qemu or kvm.

Signed-off-by: Kazuya Saito <>...

13eed94e 05/01/2013 02:04 pm Igor Mammedov

cpu: Call cpu_synchronize_post_init() from DeviceClass::realize()

If hotplugged, synchronize CPU state to KVM.

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

5dff24be 04/19/2013 04:38 pm Anthony Liguori

Merge remote-tracking branch 'mst/tags/for_anthony' into staging

pci: add pci test device

This adds a new device that we can use for testing PCI PIO and MMIO, with and
without ioeventfd in different configurations. FAST_MMIO will be added if/when
kvm supports it. Also included are minor cleanups in kvm APIs that it needs....

3f24a58f 04/16/2013 02:19 am Igor Mammedov

cpu: Pass CPUState to cpu_synchronize_post()

... so it could be called without requiring CPUArchState.

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

500ffd4a 04/14/2013 02:05 pm Michael S. Tsirkin

kvm: remove unused APIs

There are only used internally now, move them
out of header and out of stub.

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

44c3f8f7 04/14/2013 02:05 pm Michael S. Tsirkin

kvm: support any size for pio eventfd

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

41cb62c2 04/14/2013 02:05 pm Michael S. Tsirkin

kvm: support non datamatch ioeventfd

Adding restrictions just adds code.

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

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

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

cpu: Pass CPUState to cpu_interrupt()

Move it to qom/cpu.h to avoid issues with include order.

Change pc_acpi_smi_interrupt() opaque to X86CPU.

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

290adf38 01/28/2013 05:57 pm Andreas Färber

kvm: Pass CPUState to kvm_on_sigbus_vcpu()

Since commit 20d695a9254c1b086a456d3b79a3c311236643ba (kvm: Pass
CPUState to kvm_arch_*) CPUArchState is no longer needed.

Allows to change qemu_kvm_eat_signals() argument as well.

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

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

dabe3143 01/16/2013 02:25 am Michael S. Tsirkin

kvm: add stub for kvm_irqchip_update_msi_route

ppc64 build needs this stub to build with virtio enabled.

Signed-off-by: Michael S. Tsirkin <>
Tested-by: Andreas Färber <>
Signed-off-by: Anthony Liguori <>

55e5c285 01/15/2013 05:09 am Andreas Färber

cpu: Move cpu_index field to CPUState

Note that target-alpha accesses this field from TCG, now using a
negative offset. Therefore the field is placed last in CPUState.

Pass PowerPCCPU to [kvm]ppc_fixup_cpu() to facilitate this change.

Move common parts of mips cpu_state_reset() to mips_cpu_reset()....

504134d2 01/15/2013 05:09 am Andreas Färber

kvm: Pass CPUState to kvm_init_vcpu()

CPUArchState is no longer needed, and it thereby no longer depends on
NEED_CPU_H.

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

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

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

cpu: Move kvm_fd into CPUState

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

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

kvm: do not flush after deleting gsi

Deleting a GSI isn't necessary: it is enough
to stop using it. Delay flush until an entry is used.

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

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

752ced04 11/26/2012 08:53 pm Alexey Kardashevskiy

kvm: fix incorrect length in a loop over kvm dirty pages map

QEMU allocates a map enough for 4k pages. However the system page size
can be 64K (for example on POWER) and the host kernel uses only a small
part of it as one big stores a dirty flag for 16 pages 4K each,...

78021d6d 11/15/2012 12:15 am Jan Kiszka

kvm: Actually remove software breakpoints from list on cleanup

So far we only removed them from the guest, leaving its states in the
list. This made it impossible for gdb to re-enable breakpoints on the
same address after re-attaching.

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

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

cpus: Pass CPUState to run_on_cpu()

CPUArchState is no longer needed.

Move the declaration to include/qemu/cpu.h and add documentation.

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

c08d7424 10/31/2012 02:02 am Andreas Färber

cpus: Pass CPUState to qemu_cpu_kick()

CPUArchState is no longer needed there.

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

f6790af6 10/22/2012 03:50 pm Avi Kivity

memory: use AddressSpace for MemoryListener filtering

Using the AddressSpace type reduces confusion, as you can't accidentally
supply the MemoryRegion you're interested in.

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

95d2994a 10/22/2012 03:50 pm Avi Kivity

memory: manage coalesced mmio via a MemoryListener

Instead of calling a global function on coalesced mmio changes, which
routes the call to kvm if enabled, add coalesced mmio hooks to
MemoryListener and make kvm use that instead.

The motivation is support for multiple address spaces (which means we...

ad1ff3d9 10/15/2012 12:43 pm Avi Kivity

kvm: drop no-op MemoryListener callbacks

Removes quite a bit of useless code.

Signed-off-by: Avi Kivity <>

d22b096e 10/15/2012 12:43 pm Avi Kivity

kvm: use separate MemoryListeners for memory and I/O

The construct

if (address_space == get_system_memory()) {
// memory thing
} else {
// io thing
}

fails if we have more than two address spaces. Use a separate listener
for memory and I/O, and utilize MemoryListener's address space filtering to...

509e9c46 09/17/2012 06:21 pm Anthony Liguori

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

  • stefanha/trivial-patches:
    configure: fix seccomp check
    arch_init.c: add missing '%' symbols before PRIu64 in debug printfs
    kvm: Fix warning from static code analysis
    qapi: Fix enumeration typo error...
6d1cc321 09/14/2012 10:21 am Stefan Weil

kvm: Fix warning from static code analysis

Report from smatch:

kvm-all.c:1373 kvm_init(135) warn:
variable dereferenced before check 's' (see line 1360)

's' cannot by NULL (it was alloced using g_malloc0), so there is no need
to check it here.

Signed-off-by: Stefan Weil <>...

e333cd69 09/12/2012 12:15 am Jan Kiszka

kvm: Rename irqchip_inject_ioctl to irq_set_ioctl

This variable is no longer bound to irqchip, and the IOCTL sets the IRQ
level, does not directly inject it. No functional changes.

Reviewed-by: Peter Maydell <>
Signed-off-by: Jan Kiszka <>...

683d4b5d 09/12/2012 12:15 am Jan Kiszka

kvm: Stop flushing coalesced MMIO on vmexit

The memory subsystem will now take care of flushing whenever affected
regions are accessed or the memory mapping changes.

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

8732fbd2 09/12/2012 12:15 am Peter Maydell

kvm-all.c: Move init of irqchip_inject_ioctl out of kvm_irqchip_create()

Move the init of the irqchip_inject_ioctl field of KVMState out of
kvm_irqchip_create() and into kvm_init(), so that kvm_set_irq()
can be used even when no irqchip is created (for architectures...

3ab73842 09/10/2012 03:29 pm Jan Kiszka

kvm: Introduce kvm_has_intx_set_mask

Will be used by PCI device assignment code.

Signed-off-by: Jan Kiszka <>
Acked-by: Acked-by: Michael S. Tsirkin <>
Signed-off-by: Avi Kivity <>

cc57407e 09/10/2012 03:28 pm Jan Kiszka

kvm: Introduce kvm_irqchip_update_msi_route

This service allows to update an MSI route without releasing/reacquiring
the associated VIRQ. Will be used by PCI device assignment, later on
likely also by virtio/vhost and VFIO.

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

b131c74a 09/09/2012 05:03 pm Jan Kiszka

kvm: Clean up irqfd API

No need to expose the fd-based interface, everyone will already be fine
with the more handy EventNotifier variant. Rename the latter to clarify
that we are still talking about irqfds here.

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

62fe8331 09/09/2012 04:48 pm Christian Borntraeger

qemu: Use valgrind annotations to mark kvm guest memory as defined

valgrind with kvm produces a big amount of false positives regarding
"Conditional jump or move depends on uninitialised value(s)". This
happens because the guest memory is allocated with qemu_vmalloc which...

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

3889c3fa 08/09/2012 04:16 pm Peter Maydell

kvm: Rename kvm_irqchip_set_irq() to kvm_set_irq()

Rename the function kvm_irqchip_set_irq() to kvm_set_irq(),
since it can be used for sending (asynchronous) interrupts whether
there is a full irqchip model in the kernel or not. (We don't
include 'async' in the function name since asynchronous is the...

7ae26bd4 08/09/2012 04:16 pm Peter Maydell

kvm: Decouple 'async interrupt delivery' from 'kernel irqchip'

On x86 userspace delivers interrupts to the kernel asynchronously
(and therefore VCPU idle management is done in the kernel) if and
only if there is an in-kernel irqchip. On other architectures this...

3ed444e9 08/09/2012 04:16 pm Dunrong Huang

kvm: Check if smp_cpus exceeds max cpus supported by kvm

Add a helper function for fetching max cpus supported by kvm.

Make QEMU exit with an error message if smp_cpus exceeds limit
of VCPU count retrieved by invoking this helper function.

Signed-off-by: Dunrong Huang <>...

09f06a6c 07/18/2012 10:44 pm Anthony Liguori

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

  • qemu-kvm/uq/master:
    virtio: move common irqfd handling out of virtio-pci
    virtio: move common ioeventfd handling out of virtio-pci
    event_notifier: add event_notifier_set_handler
    memory: pass EventNotifier, not eventfd...
15b2bd18 07/12/2012 02:08 pm Paolo Bonzini

virtio: move common irqfd handling out of virtio-pci

All transports can use the same event handler for the irqfd, though the
exact mechanics of the assignment will be specific. Note that there
are three states: handled by the kernel, handled in userspace, disabled....

753d5e14 07/12/2012 02:08 pm Paolo Bonzini

memory: pass EventNotifier, not eventfd

Under Win32, EventNotifiers will not have event_notifier_get_fd, so we
cannot call it in common code such as hw/virtio-pci.c. Pass a pointer to
the notifier, and only retrieve the file descriptor in kvm-specific code....

fdec9918 07/10/2012 07:27 pm Christian Borntraeger

s390: autodetect map private

By default qemu will use MAP_PRIVATE for guest pages. This will write
protect pages and thus break on s390 systems that dont support this feature.
Therefore qemu has a hack to always use MAP_SHARED for s390. But MAP_SHARED
has other problems (no dirty pages tracking, a lot more swap overhead etc.)...

df410675 06/30/2012 02:02 am Alex Williamson

kvm: Don't abort on kvm_irqchip_add_msi_route()

Anyone using these functions has to be prepared that irqchip
support may not be present. It shouldn't be up to the core
code to determine whether this is a fatal error. Currently
code written as:

virq = kvm_irqchip_add_msi_route(...)...

ebd063d1 06/15/2012 04:41 pm Paolo Bonzini

kvm: add missing include files

These are included via monitor.h right now, add them explicitly.

Signed-off-by: Paolo Bonzini <>
Signed-off-by: Luiz Capitulino <>

d3d3bef0 06/06/2012 11:41 am Jan Kiszka

kvm: Fix build for non-CAP_IRQ_ROUTING targets

A type definition and a KVMState field initialization escaped the
required wrapping with KVM_CAP_IRQ_ROUTING. Also, we need to provide a
dummy kvm_irqchip_release_virq as virtio-pci references (but does not
use) it....

39853bbc 05/21/2012 07:22 pm Jan Kiszka

kvm: Introduce kvm_irqchip_add/remove_irqfd

Add services to associate an eventfd file descriptor as input with an
IRQ line as output. Such a line can be an input pin of an in-kernel
irqchip or a virtual line returned by kvm_irqchip_add_route.

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

1df186df 05/21/2012 07:22 pm Jan Kiszka

kvm: Rename kvm_irqchip_add_route to kvm_irqchip_add_irq_route

We will add kvm_irqchip_add_msi_route, so let's make the difference
clearer.

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

92b4e489 05/21/2012 07:22 pm Jan Kiszka

kvm: Introduce kvm_irqchip_add_msi_route

Add a service that establishes a static route from a virtual IRQ line to
an MSI message. Will be used for IRQFD and device assignment. As we will
use this service outside of CONFIG_KVM protected code, stub it properly....

1e2aa8be 05/21/2012 07:22 pm Jan Kiszka

kvm: Publicize kvm_irqchip_release_virq

This allows to drop routes created by kvm_irqchip_add_irq/msi_route
again.

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

e7b20308 05/21/2012 07:22 pm Jan Kiszka

kvm: Make kvm_irqchip_commit_routes an internal service

Automatically commit route changes after kvm_add_routing_entry and
kvm_irqchip_release_virq. There is no performance relevant use case for
which collecting multiple route changes is beneficial. This makes...

4a3adebb 05/17/2012 12:04 am Jan Kiszka

kvm: Add support for direct MSI injections

If the kernel supports KVM_SIGNAL_MSI, we can avoid the route-based
MSI injection mechanism.

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

a24b9106 05/17/2012 12:04 am Jan Kiszka

kvm: Enable in-kernel irqchip support by default

As MSI is now fully supported by KVM (/wrt available features in
upstream), we can finally enable the in-kernel irqchip by default.

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

04fa27f5 05/17/2012 12:04 am Jan Kiszka

kvm: Introduce basic MSI support for in-kernel irqchips

This patch basically adds kvm_irqchip_send_msi, a service for sending
arbitrary MSI messages to KVM's in-kernel irqchip models.

As the original KVM API requires us to establish a static route from a...