summaryrefslogtreecommitdiff
path: root/include/sysemu/kvm.h
AgeCommit message (Collapse)AuthorFilesLines
2014-03-13Revert "KVM: Split QEMUMachine typedef into separate header"Andreas Färber1-1/+0
This reverts commit 9c06a1f79f959fffd09bfb7efc3d76051a6cd2da. The new header sysemu/qemumachine.h is undesired. Suggested-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Andreas Färber <afaerber@suse.de>
2014-03-05kvm: Add a new machine option kvm-typeAneesh Kumar K.V1-1/+1
Targets like ppc64 support different types of KVM, one which use hypervisor mode and the other which doesn't. Add a new machine option kvm-type that helps in selecting the respective ones We also add a new QEMUMachine callback get_vm_type that helps in mapping the string representation of kvm type specified. Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com> [agraf: spelling fixes, use error_report(), use qemumachine.h] Signed-off-by: Alexander Graf <agraf@suse.de>
2014-03-05KVM: Split QEMUMachine typedef into separate headerAlexander Graf1-0/+1
Older gcc versions (such as the one in SLES11) get confused when you declare a typedef on the same struct twice. To work around that limitation, let's extract the QEMUMachine typedef into a separate header file that is guarded by preprocessor duplicate include checks. This fixes the following type of compile errors for me: In file included from vl.c:125: include/hw/xen/xen.h:39: error: redefinition of typedef "QEMUMachine" include/sysemu/kvm.h:155: error: previous declaration of "QEMUMachine" was here Signed-off-by: Alexander Graf <agraf@suse.de>
2014-02-26kvm: Common device control API functionsChristoffer Dall1-0/+22
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 way similar to other KVM ioctl wrappers. Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Christoffer Dall <christoffer.dall@linaro.org> Message-id: 1392687720-26806-4-git-send-email-christoffer.dall@linaro.org Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2014-02-26kvm: Introduce kvm_arch_irqchip_createChristoffer Dall1-0/+12
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 the device control API over the older KVM_CREATE_IRQCHIP API. Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Christoffer Dall <christoffer.dall@linaro.org> Message-id: 1392687720-26806-3-git-send-email-christoffer.dall@linaro.org Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2013-09-23Merge remote-tracking branch 'qemu-kvm/uq/master' into stagingAnthony Liguori1-10/+19
# By Alexey Kardashevskiy (3) and others # 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 linux-headers: update to 3.11 kvm: fix traces to use %x instead of %d kvmvapic: Clear also physical ROM address when entering INACTIVE state kvmvapic: Enter inactive state on hardware reset kvmvapic: Catch invalid ROM size kvm irqfd: support direct msimessage to irq translation fix steal time MSR vmsd callback to proper opaque type kvm: warn if num cpus is greater than num recommended cpu: Move cpu state syncs up into cpu_dump_state() exec: always use MADV_DONTFORK Message-id: 1379694292-1601-1-git-send-email-pbonzini@redhat.com
2013-09-20kvm irqfd: support direct msimessage to irq translationAlexey Kardashevskiy1-0/+9
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. This adds a new direct mapping flag which tells the kvm_irqchip_add_msi_route() function that a new VIRQ should not be allocated, instead the value from MSIMessage::data should be used. It is up to the platform code to make sure that this contains a valid IRQ number as sPAPR does in spapr_pci.c. Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2013-09-20cpu: Move cpu state syncs up into cpu_dump_state()James Hogan1-10/+10
The x86 and ppc targets call cpu_synchronize_state() from their *_cpu_dump_state() callbacks to ensure that up to date state is dumped when KVM is enabled (for example when a KVM internal error occurs). Move this call up into the generic cpu_dump_state() function so that other KVM targets (namely MIPS) can take advantage of it. This requires kvm_cpu_synchronize_state() and cpu_synchronize_state() to be moved out of the #ifdef NEED_CPU_H in <sysemu/kvm.h> so that they're accessible to qom/cpu.c. Signed-off-by: James Hogan <james.hogan@imgtec.com> Cc: Andreas Färber <afaerber@suse.de> Cc: Alexander Graf <agraf@suse.de> Cc: Gleb Natapov <gleb@redhat.com> Cc: qemu-ppc@nongnu.org Cc: kvm@vger.kernel.org Signed-off-by: Gleb Natapov <gleb@redhat.com>
2013-09-12exec: Simplify the guest physical memory allocation hookMarkus Armbruster1-5/+0
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 <borntraeger@de.ibm.com> Signed-off-by: Markus Armbruster <armbru@redhat.com> Acked-by: Laszlo Ersek <lersek@redhat.com> Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com> Message-id: 1375276272-15988-5-git-send-email-armbru@redhat.com Signed-off-by: Anthony Liguori <anthony@codemonkey.ws>
2013-08-29Merge remote-tracking branch 'qemu-kvm/uq/master' into stable-1.5Anthony Liguori1-1/+2
* 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 kvm: Simplify kvm_handle_io kvm: x86: fix setting IA32_FEATURE_CONTROL with nested VMX disabled kvm: add KVM_IRQFD_FLAG_RESAMPLE support kvm: migrate vPMU state target-i386: remove tabs from target-i386/cpu.h Initialize IA32_FEATURE_CONTROL MSR in reset and migration Conflicts: target-i386/cpu.h target-i386/kvm.c aliguori: fixup trivial conflicts due to whitespace and added cpu argument Signed-off-by: Anthony Liguori <anthony@codemonkey.ws>
2013-08-09kvm: add KVM_IRQFD_FLAG_RESAMPLE supportVincenzo Maffione1-1/+2
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 (section 4.75) for more details. When the added parameter is passed NULL, the behaviour of the function is unchanged with respect to the previous versions. Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Vincenzo Maffione <v.maffione@gmail.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2013-07-26kvm: Change prototype of kvm_update_guest_debug()Stefan Weil1-1/+1
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 <sw@weilnetz.de> Acked-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Andreas Färber <afaerber@suse.de>
2013-07-23kvm: Change kvm_{insert,remove}_breakpoint() argument to CPUStateAndreas Färber1-2/+2
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 <afaerber@suse.de>
2013-07-09kvm: Change kvm_remove_all_breakpoints() argument to CPUStateAndreas Färber1-1/+1
Acked-by: Paolo Bonzini <pbonzini@redhat.com> Reviewed-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Andreas Färber <afaerber@suse.de>
2013-07-09kvm: Free current_cpu identifierAndreas Färber1-5/+5
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. Acked-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Andreas Färber <afaerber@suse.de>
2013-07-01KVM: PIC: Only commit irq routing when necessaryAlexander Graf1-0/+1
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 news it has on its routing maps. Instead, let's just synchronize the whole irq routing map as a whole when we're done constructing it. For things that change during runtime, we can still update the routing table on demand. Signed-off-by: Alexander Graf <agraf@suse.de>
2013-07-01KVM: Export kvm_init_irq_routingAlexander Graf1-0/+1
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(). Signed-off-by: Alexander Graf <agraf@suse.de>
2013-07-01KVM: Don't assume that mpstate exists with in-kernel PIC alwaysAlexander Graf1-0/+10
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 also means we support MP state. This assumption is not true anymore. Let's split up the two cases into two different variables. That way PPC can expose an in-kernel PIC, while not implementing MP state. Signed-off-by: Alexander Graf <agraf@suse.de> CC: Jan Kiszka <jan.kiszka@siemens.com>
2013-06-28kvm: Change kvm_cpu_exec() argument to CPUStateAndreas Färber1-1/+1
It no longer uses CPUArchState. Prepares for changing qemu_kvm_cpu_thread_fn() opaque to CPUState. Acked-by: Paolo Bonzini <pbonzini@redhat.com> Reviewed-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Andreas Färber <afaerber@suse.de>
2013-06-28kvm: Change kvm_set_signal_mask() argument to CPUStateAndreas Färber1-1/+1
CPUArchState is no longer needed. Prepares for changing qemu_kvm_init_cpu_signals() argument to CPUState. Acked-by: Paolo Bonzini <pbonzini@redhat.com> Reviewed-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Andreas Färber <afaerber@suse.de>
2013-06-28kvm: Change cpu_synchronize_state() argument to CPUStateAndreas Färber1-2/+2
Change Monitor::mon_cpu to CPUState as well. Reviewed-by: liguang <lig.fnst@cn.fujitsu.com> Acked-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Andreas Färber <afaerber@suse.de>
2013-06-28kvm: Change kvm_cpu_synchronize_state() argument to CPUStateAndreas Färber1-2/+2
It no longer relies on CPUArchState since 20d695a. Reviewed-by: liguang <lig.fnst@cn.fujitsu.com> Acked-by: Paolo Bonzini <pbonzini@redhat.com> Reviewed-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Andreas Färber <afaerber@suse.de>
2013-05-29kvm: add kvm_readonly_mem_enabledJordan Justen1-0/+10
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Message-id: 1369816047-16384-3-git-send-email-jordan.l.justen@intel.com Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2013-05-14osdep, kvm: rename low-level RAM allocation functionsPaolo Bonzini1-2/+2
This is preparatory to the introduction of a separate freeing API. Reported-by: Amos Kong <akong@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Reviewed-by: Amos Kong <akong@redhat.com> Message-id: 1368454796-14989-2-git-send-email-pbonzini@redhat.com Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2013-05-01cpu: Call cpu_synchronize_post_init() from DeviceClass::realize()Igor Mammedov1-10/+10
If hotplugged, synchronize CPU state to KVM. Signed-off-by: Igor Mammedov <imammedo@redhat.com> Reviewed-by: Eduardo Habkost <ehabkost@redhat.com> Signed-off-by: Andreas Färber <afaerber@suse.de>
2013-05-01cpu: Make kvm-stub.o available outside softmmuIgor Mammedov1-2/+2
It will provide stubs for *-user targets once softmmu-specific calls are attempted from common CPU code. Signed-off-by: Igor Mammedov <imammedo@redhat.com> Reviewed-by: Eduardo Habkost <ehabkost@redhat.com> Signed-off-by: Andreas Färber <afaerber@suse.de>
2013-04-19Merge remote-tracking branch 'mst/tags/for_anthony' into stagingAnthony Liguori1-4/+0
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. Signed-off-by: Michael S. Tsirkin <mst@redhat.com> # gpg: Signature made Mon 15 Apr 2013 05:42:24 PM CDT using RSA key ID D28D5469 # gpg: Can't check signature: public key not found # By Michael S. Tsirkin # Via Michael S. Tsirkin * mst/tags/for_anthony: pci: add pci test device kvm: support non datamatch ioeventfd kvm: support any size for pio eventfd kvm: remove unused APIs Message-id: cover.1366272004.git.mst@redhat.com Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2013-04-16cpu: Pass CPUState to *cpu_synchronize_post*()Igor Mammedov1-6/+6
... so it could be called without requiring CPUArchState. Signed-off-by: Igor Mammedov <imammedo@redhat.com> Reviewed-by: Eduardo Habkost <ehabkost@redhat.com> Signed-off-by: Andreas Färber <afaerber@suse.de>
2013-04-14kvm: remove unused APIsMichael S. Tsirkin1-4/+0
There are only used internally now, move them out of header and out of stub. Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2013-02-01accel: change {xen, kvm, tcg, qtest}_allowed from int to boolliguang1-1/+1
Signed-off-by: liguang <lig.fnst@cn.fujitsu.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2013-01-28kvm: Pass CPUState to kvm_on_sigbus_vcpu()Andreas Färber1-1/+1
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 <afaerber@suse.de> Reviewed-by: Gleb Natapov <gleb@redhat.com>
2013-01-27kvm: Create kvm_arch_vcpu_id() functionEduardo Habkost1-0/+3
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 <ehabkost@redhat.com> Acked-by: Gleb Natapov <gleb@redhat.com> Signed-off-by: Andreas Färber <afaerber@suse.de>
2013-01-27kvm: Add fake KVM_FEATURE_CLOCKSOURCE_STABLE_BIT for builds without KVMEduardo Habkost1-0/+1
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> Acked-by: Marcelo Tosatti <mtosatti@redhat.com> Signed-off-by: Andreas Färber <afaerber@suse.de>
2013-01-15kvm: Add fake KVM constants to avoid #ifdefs on KVM-specific codeEduardo Habkost1-0/+14
Any KVM-specific code that use these constants must check if kvm_enabled() is true before using them. Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> Reviewed-by: Gleb Natapov <gleb@redhat.com> Signed-off-by: Andreas Färber <afaerber@suse.de>
2013-01-15kvm: Pass CPUState to kvm_init_vcpu()Andreas Färber1-2/+3
CPUArchState is no longer needed, and it thereby no longer depends on NEED_CPU_H. Signed-off-by: Andreas Färber <afaerber@suse.de>
2012-12-23Merge branch 'master' of git://git.qemu.org/qemu into qom-cpuAndreas Färber1-0/+280
Adapt header include paths. Signed-off-by: Andreas Färber <afaerber@suse.de>
2012-12-19softmmu: move include files to include/sysemu/Paolo Bonzini1-0/+280
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>