History | View | Annotate | Download (6.1 kB)
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 <mst@redhat.com>Reviewed-by: Amos Kong <akong@redhat.com>Signed-off-by: Avi Kivity <avi@redhat.com>
kvm: Drop unused kvm_pit_in_kernel
This is now implied by kvm_irqchip_in_kernel.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
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...
kvm: Add kvm_has_pit_state2 helper
To be used for in-kernel PIT emulation.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>Signed-off-by: Avi Kivity <avi@redhat.com>
kvm: Implement kvm_irqchip_in_kernel like kvm_enabled
To both avoid that kvm_irqchip_in_kernel always has to be paired withkvm_enabled and that the former ends up in a function call, implement itlike the latter. This means keeping the state in a global variable and...
kvm: Introduce core services for in-kernel irqchip support
Add the basic infrastructure to active in-kernel irqchip support, injectinterrupts into these models, and maintain IRQ routes.
Routing is optional and depends on the host arch supportingKVM_CAP_IRQ_ROUTING. When it's not available on x86, we looe the HPET as...
kvm: x86: Establish IRQ0 override control
KVM is forced to disable the IRQ0 override when we run with in-kernelirqchip but without IRQ routing support of the kernel. Set the fwcfgvalue correspondingly. This aligns us with qemu-kvm.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
kvm: x86: Add user space part for in-kernel APIC
This introduces the alternative APIC device which makes use of KVM'sin-kernel device model. External NMI injection via LINT1 is emulated bychecking the current state of the in-kernel APIC, only injecting a NMI...
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 <avi@redhat.com>
kvm: x86: Pass KVMState to kvm_arch_get_supported_cpuid
kvm_arch_get_supported_cpuid checks for global cpuid restrictions, itdoes not require any CPUState reference. Changing its interface allowsto call it before any VCPU is initialized.
CC: Eduardo Habkost <ehabkost@redhat.com>...
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.
kvm: Rename kvm_arch_process_irqchip_events to async_events
We will broaden the scope of this function on x86 beyond irqchip events.
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 areused in hw/vga.c and replace the kvm_log_start/stop. With this, vga does...
kvm: Make kvm_state globally available
KVM-assisted devices need access to it but we have no clean channel todistribute a reference. As a workaround until there is a bettersolution, export kvm_state for global use, though use should remainrestricted to the mentioned scenario....
kvm: Drop return values from kvm_arch_pre/post_run
We do not check them, and the only arch with non-empty implementationsalways returns 0 (this is also true for qemu-kvm).
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>CC: Alexander Graf <agraf@suse.de>...
kvm: Provide sigbus services arch-independently
Provide arch-independent kvm_on_sigbus* stubs to remove the #ifdef'eryfrom cpus.c. This patch also fixes --disable-kvm build by providing themissing kvm_on_sigbus_vcpu kvm-stub.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>...
kvm: Consolidate must-have capability checks
Instead of splattering the code with #ifdefs and runtime checks forcapabilities we cannot work without anyway, provide central testinfrastructure for verifying their availability both at build andruntime.
kvm: Drop smp_cpus argument from init functions
No longer used.
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 notificationsince the limit is reached too easily.
Add an API to test for this condition....
Add RAM -> physical addr mapping in MCE simulation
In QEMU-KVM, physical address != RAM address. While MCE simulationneeds physical address instead of RAM address. Sokvm_physical_memory_addr_from_ram() is implemented to do theconversion, and it is invoked before being filled in the IA32_MCi_ADDR...
MCE: Relay UCR MCE to guest
Port qemu-kvm's
commit 4b62fff1101a7ad77553147717a8bd3bf79df7efAuthor: Huang Ying <ying.huang@intel.com>Date: Mon Sep 21 10:43:25 2009 +0800
UCR (uncorrected recovery) MCE is supported in recent Intel CPUs,...
Add function to assign ioeventfd to MMIO.
Signed-off-by: Cam Macdonell <cam@cs.ualberta.ca>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
kvm: Extend kvm_arch_get_supported_cpuid() to support index
Would use it later for XSAVE related CPUID.
Signed-off-by: Sheng Yang <sheng@linux.intel.com>Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
kvm: Enable XSAVE live migration support
Move stdbool.h
Move inclusion of stdbool.h to common header files, instead of includingin an ad-hoc manner.
Signed-off-by: Paul Brook <paul@codesourcery.com>
Do not stop VM if emulation failed in userspace.
Continue vcpu execution in case emulation failure happened while vcpuwas in userspace. In this case #UD will be injected into the guestallowing guest OS to kill offending process and continue.
Signed-off-by: Gleb Natapov <gleb@redhat.com>...
kvm: enable smp > 1
Process INIT/SIPI requests and enable -smp > 1.
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>Signed-off-by: Avi Kivity <avi@redhat.com>
KVM: x86: Add debug register saving and restoring
Make use of the new KVM_GET/SET_DEBUGREGS to save/restore the x86 debugregisters.
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 errormessages for KVM initialization.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>...
move around definitions in kvm.h that do not require CPUState
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
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 tostub function on non-kvm build, and checks kvm_enabled for non-kvmrun.
While rest of qemu code still uses if (kvm_enabled()), I think this...
Allow various header files to be included from non-CPU code
Allow balloon.h, gdbstub.h and kvm.h to be included fromnon-CPU code.
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Disable phsyical memory handling in userspace emulation.
Code to handle physical memory access is not meaningful in usrmode emulation,so disable it.
KVM: Rework VCPU state writeback API
This grand cleanup drops all reset and vmsave/load relatedsynchronization points in favor of four(!) generic hooks:
- cpu_synchronize_all_states in qemu_savevm_state_complete (initial sync from kernel before vmsave)...
KVM: Rework of guest debug state writing
So far we synchronized any dirty VCPU state back into the kernel beforeupdating the guest debug state. This was a tribute to a deficite in x86kernels before 2.6.33. But as this is an arch-dependent issue, it isbetter handle in the x86 part of KVM and remove the writeback point for...
Fix mingw32 build
kvm: consume internal signal with sigtimedwait
Change the way the internal qemu signal, used for communication betweeniothread and vcpus, is handled.
Block and consume it with sigtimedwait on the outer vcpu loop, whichallows more precise timing control....
kvm: move kvm to use memory notifiers
remove direct kvm calls from exec.c, makekvm use memory notifiers framework instead.
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>Acked-by: Avi Kivity <avi@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
kvm: Flush coalesced MMIO buffer periodly
The default action of coalesced MMIO is, cache the writing in buffer, until:1. The buffer is full.2. Or the exit to QEmu due to other reasons.
But this would result in a very late writing in some condition.1. The each time write to MMIO content is small....
kvm: x86: Add support for VCPU event states
This patch extends the qemu-kvm state sync logic with support forKVM_GET/SET_VCPU_EVENTS, giving access to yet missing exception,interrupt and NMI states.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
kvm: Add arch reset handler
Will be required by succeeding changes.
kvm: Move KVM mp_state accessors to i386-specific code
Unbreaks PowerPC and S390 KVM builds.
Signed-off-by: Hollis Blanchard <hollisb@us.ibm.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Revert "Get rid of _t suffix"
In the very least, a change like this requires discussion on the list.
The naming convention is goofy and it causes a massive merge problem. Somethinglike this must be presented on the list first so people can provide input...
Get rid of _t suffix
Some not so obvious bits, slirp and Xen were left alone for the timebeing.
Signed-off-by: malc <av1474@comtv.ru>
Fix sys-queue.h conflict for good
Problem: Our file sys-queue.h is a copy of the BSD file, but there aresome additions and it's not entirely compatible. Because of that, there havebeen conflicts with system headers on BSD systems. Some hacks have beenintroduced in the commits 15cc9235840a22c289edbe064a9b3c19c5f49896,...
kvm: Simplify cpu_synchronize_state()
cpu_synchronize_state() is a little unreadable since the 'modified'argument isn't self-explanatory. Simplify it by making it alwayssynchronize the kernel state into qemu, and automatically flush theregisters back to the kernel if they've been synchronized on this...
provide tests for pit in kernel and irqchip in kernel
KVM can have an in-kernel pit or irqchip. While we don't implement ityet, having a way for test for it (that always returns zero) will allow usto reuse code in qemu-kvm that tests for it.
Signed-off-by: Glauber Costa <glommer@redhat.com>...
kvm: Rework VCPU synchronization
During startup and after reset we have to synchronize user space to thein-kernel KVM state. Namely, we need to transfer the VCPU registers whenthey change due to VCPU as well as APIC reset.
This patch refactors the required hooks so that kvm_init_vcpu registers...
kvm: x86: Save/restore KVM-specific CPU states
Save and restore all so far neglected KVM-specific CPU states. Handlingthe TSC stabilizes migration in KVM mode. The interrupt_bitmap andmp_state are currently unused, but will become relevant for in-kernel...
kvm: Introduce kvm_set_migration_log
Introduce a global dirty logging flag that enforces logging for allslots. This can be used by the live migration code to enable/disableglobal logging withouth destroying the per-slot setting.
kvm: Rework dirty bitmap synchronization
Extend kvm_physical_sync_dirty_bitmap() so that is can sync acrossmultiple slots. Useful for updating the whole dirty log duringmigration. Moreover, properly pass down errors the whole call chain.
kvm: Add support for querying supported cpu features
kvm does not support all cpu features; add support for dunamically queryingthe supported feature set.
Signed-off-by: Avi Kivity <avi@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Introduce kvm_check_extension to check if KVM extensions are supported
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
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...
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 regionsby reporting invalid parameters. This reveals several inconsistencies inthe vga code, patch to fix them follows later in this series....
Guest debugging support for KVM (Jan Kiszka)
This is a backport of the guest debugging support for the KVMaccelerator that is now part of the KVM tree. It implements the reworkedKVM kernel API for guest debugging (KVM_CAP_SET_GUEST_DEBUG) which isnot yet part of any mainline kernel but will probably be 2.6.30 stuff....
kvm: sync vcpu state during initialization (Hollis Blanchard)
Currently on x86, qemu initializes CPUState but KVM ignores it and does itsown vcpu initialization. However, PowerPC KVM needs to be able to set theinitial register state to support the -kernel and -append options....
KVM: Coalesced MMIO support
MMIO exits are more expensive in KVM or Xen than in QEMU because theyinvolve, at least, privilege transitions. However, MMIO writeoperations can be effectively batched if those writes do not have sideeffects.
Good examples of this include VGA pixel operations when in a planar...
Add virtio-balloon support
This adds a VirtIO based balloon driver. It uses madvise() to actually balloonthe memory when possible.
Until 2.6.27, KVM forced memory pinning so we must disable ballooning unless thekernel actually supports it when using KVM. It's always safe when using TCG....
kvm: Introduce kvm logging interface (Glauber Costa)
Introduce functions to control logging of memory regions.We select regions based on its start address, aguest_physical_addr (target_phys_addr_t, in qemu nomenclature).
The main user of this interface right now is VGA optimization...
Define kvm_ioctl in the same way as ioctl
The third argument to ioctl is a ... which allows any value to be passed. Inpractice, glibc always treats the argument as a void *.
Do the same thing for the kvm ioctls to keep things consistent with atraditional ioctl....
Add missing files to KVM commit.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5629 c046a42c-6fe2-441c-8c8c-71466251a162