Statistics
| Branch: | Revision:

root / kvm-all.c @ feature-archipelago

History | View | Annotate | Download (53.2 kB)

# Date Author Comment
9fbee91a 02/27/2014 06:00 pm Peter Maydell

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

  • remotes/kvm/uq/master:
    KVM: Use return value for error print

Signed-off-by: Peter Maydell <>

d6032e06 02/26/2014 07:20 pm Christoffer Dall

kvm: Introduce kvm_arch_irqchip_create

Introduce kvm_arch_irqchip_create an arch-specific hook in preparation
for architecture-specific use of the device control API to create IRQ
chips.

Following patches will implement the ARM irqchip create method to prefer...

0a6a7cca 02/26/2014 07:20 pm Christoffer Dall

kvm: Common device control API functions

Introduces two simple functions:
int kvm_device_ioctl(int fd, int type, ...);
int kvm_create_device(KVMState *s, uint64_t type, bool test);

These functions wrap the basic ioctl-based interactions with KVM in a...

521f438e 02/21/2014 12:19 pm Alexander Graf

KVM: Use return value for error print

Commit 94ccff13 introduced a more verbose failure message and retry
operations on KVM VM creation. However, it ended up using a variable
for its failure message that hasn't been initialized yet.

Fix it to use the value it meant to set....

bc1c7217 02/07/2014 01:51 am Peter Maydell

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

  • remotes/kvm/uq/master:
    target-i386: Move KVM default-vendor hack to instance_init
    target-i386: Don't change x86_def_t struct on cpu_x86_register()
    target-i386: Eliminate CONFIG_KVM #ifdefs...
977c7b6d 02/03/2014 06:33 pm Radim Krčmář

kvm: print suberror on all internal errors

KVM introduced internal error exit reason and suberror at the same time,
and later extended it with internal error data.
QEMU does not report suberror on hosts between these two events because
we check for the extension. (half a year in 2009, but it is misleading)...

850bbe1b 02/01/2014 11:08 pm Peter Maydell

Merge remote-tracking branch 'remotes/awilliam/tags/vfio-pci-for-qemu-20140128.0' into staging

vfio-pci updates include:
- Destroy MemoryRegions on device teardown
- Print warnings around PCI option ROM failures
- Skip bogus mappings from 64bit BAR sizing...

0169c511 01/25/2014 01:52 am Anthony Liguori

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

  • qemu-kvm/uq/master:
    kvm: always update the MPX model specific register
    KVM: fix addr type for KVM_IOEVENTFD
    KVM: Retry KVM_CREATE_VM on EINTR
    mempath prefault: fix off-by-one error
    kvm: x86: Separately write feature control MSR on reset...
47c16ed5 01/17/2014 08:12 pm Alexey Kardashevskiy

kvm: initialize qemu_host_page_size

There is a HOST_PAGE_ALIGN macro which makes sense for KVM accelerator
but it uses qemu_host_page_size/qemu_host_page_mask which initialized
for TCG only.

This moves qemu_host_page_size/qemu_host_page_mask initialization from...

584f2be7 01/15/2014 01:58 pm Alexey Kardashevskiy

KVM: fix addr type for KVM_IOEVENTFD

The @addr here is a guest physical address and can easily be bigger
than 4G.

This changes uint32_t to hwaddr.

Cc:
Cc: Michael S. Tsirkin <>
Signed-off-by: Alexey Kardashevskiy <>...

94ccff13 01/15/2014 01:58 pm thomas knych

KVM: Retry KVM_CREATE_VM on EINTR

Upstreaming this change from Android (https://android-review.googlesource.com/54211).

On heavily loaded machines with many VM instances we see KVM_CREATE_VM
failing with EINTR on this path:

kvm_dev_ioctl_create_vm -> kvm_create_vm -> kvm_init_mmu_notifier -> mmu_notifier_register -> do_mmu_notifier_register -> mm_take_all_locks...

747afd5b 01/13/2014 03:04 pm Juan Quintela

kvm: use directly cpu_physical_memory_* api for tracking dirty pages

Performance is important in this function, and we want to optimize even further.

Signed-off-by: Juan Quintela <>
Reviewed-by: Orit Wasserman <>

c9dd46fc 01/13/2014 03:04 pm Juan Quintela

kvm: refactor start address calculation

Signed-off-by: Juan Quintela <>
Reviewed-by: Orit Wasserman <>

5ff7fb77 01/13/2014 03:04 pm Juan Quintela

memory: move bitmap synchronization to its own function

We want to have all the functions that handle directly the dirty
bitmap near. We will change it later.

Signed-off-by: Juan Quintela <>
Reviewed-by: Orit Wasserman <>

fb541ca5 11/25/2013 12:28 pm Alex Williamson

kvm: Query KVM for available memory slots

KVM reports the number of available memory slots (KVM_CAP_NR_MEMSLOTS)
using the extension interface. Both x86 and s390 implement this, ARM
and powerpc do not yet enable it. Convert the static slots array to
be dynamically allocated, supporting more slots when available....

3e4be9c2 09/23/2013 07:52 pm Anthony Liguori

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

  1. By Alexey Kardashevskiy (3) and others
  2. Via Paolo Bonzini
    • qemu-kvm/uq/master:
      target-i386: add feature kvm_pv_unhalt
      linux-headers: update to 3.12-rc1
      target-i386: forward CPUID cache leaves when -cpu host is used...
670436ce 09/20/2013 01:37 pm Andrew Jones

kvm: warn if num cpus is greater than num recommended

The comment in kvm_max_vcpus() states that it's using the recommended
procedure from the kernel API documentation to get the max number
of vcpus that kvm supports. It is, but by always returning the
maximum number supported. The maximum number should only be used...

76fe21de 09/20/2013 01:37 pm Alexey Kardashevskiy

kvm irqfd: support direct msimessage to irq translation

On PPC64 systems MSI Messages are translated to system IRQ in a PCI
host bridge. This is already supported for emulated MSI/MSIX but
not for irqfd where the current QEMU allocates IRQ numbers from
irqchip and maps MSIMessages to IRQ in the host kernel....

91138037 09/12/2013 07:45 pm Markus Armbruster

exec: Simplify the guest physical memory allocation hook

Make it a generic hook rather than a KVM hook. Less code and
ifdeffery.

Since the only user of the hook is old S390 KVM, there's hope we can
get rid of it some day.

Acked-by: Christian Borntraeger <>...

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