summaryrefslogtreecommitdiff
path: root/qemu-kvm.c
AgeCommit message (Collapse)AuthorFilesLines
2011-05-03qemu-kvm: Do not advertise MSI caps on lacking KVM supportJan Kiszka1-4/+0
As suggested by Michael Tsirkin: Move the check for GSI routing from kvm_msi_message_add to the MSI/MSI-X initalization. If it fails (and KVM is in in-kernel irqchip mode), do not advertise MSI at all. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
2011-04-27qemu-kvm: Move entry comparison into kvm_msi_update_messageJan Kiszka1-1/+13
Checking the the update chances the message content is a common task for both MSI types. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Avi Kivity <avi@redhat.com>
2011-04-27qemu-kvm: Move gsi bits from kvm_msix_vector_add to kvm_msi_add_messageJan Kiszka1-0/+11
Testing support and allocating a GSI for an MSI message is required both for MSI and MSI-X. At this chance, drop the aging version warning. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Avi Kivity <avi@redhat.com>
2011-04-27qemu-kvm: Refactor MSI core API of KVMJan Kiszka1-19/+13
Remove MSI-X from function names - the interface is valid for MSI as well - and use KVMMsiMessage as parameter. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Avi Kivity <avi@redhat.com>
2011-04-20qemu-kvm: Unbreak guest debuggingJan Kiszka1-30/+6
Align handling of guest debug exits to upstream by moving it completely to the arch section. This patch accounts for changed return codes in the exit handling code. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Avi Kivity <avi@redhat.com>
2011-04-20qemu-kvm: Process async MCE events in main loopJan Kiszka1-3/+6
This aligns qemu-kvm with upstream commit ab443475c9. Namely, we were missing a call to an equivalent of kvm_arch_process_async_events from the main loop. This adds a stripped down version of upstream's process_async_events until we switch over. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Avi Kivity <avi@redhat.com>
2011-04-20qemu-kvm: Synchronize states before resetJan Kiszka1-0/+2
This aligns qemu-kvm with upstream commit a7ada1510c. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Avi Kivity <avi@redhat.com>
2011-04-14Merge commit 'dc7a09cfe47679d89289101cc9eb387c45e48fe7' into upstream-mergeMarcelo Tosatti1-1/+1
* commit 'dc7a09cfe47679d89289101cc9eb387c45e48fe7': Expose thread_id in info cpus kvm: x86: Push kvm_arch_debug to kvm_arch_handle_exit Conflicts: cpu-defs.h exec.c monitor.c Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
2011-02-28qemu-kvm: Mark VCPU state dirty on creationJan Kiszka1-0/+1
This avoids that early cpu_synchronize_state calls try to retrieve an uninitialized state from the kernel, which even causes a deadlock. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Avi Kivity <avi@redhat.com>
2011-02-28Stop and show registers on errorGleb Natapov1-2/+2
Sync with upstream behaviour. Signed-off-by: Gleb Natapov <gleb@redhat.com> Signed-off-by: Avi Kivity <avi@redhat.com>
2011-02-16Merge commit '8cf71710f068f9c50ce420b1dd4ef71c2f9b2a8d' into upstream-mergeMarcelo Tosatti1-3/+3
* commit '8cf71710f068f9c50ce420b1dd4ef71c2f9b2a8d': Refactor debug and vmstop request interface Improve vm_stop reason declarations Fix a few coding style violations in cpus.c Refactor cpu_has_work/any_cpu_has_work in cpus.c Refactor kvm&tcg function names in cpus.c Conflicts: sysemu.h Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
2011-02-16Merge commit 'b30e93e9ec01c87d53fb0c777e4b0fa258e85ca8' into upstream-mergeMarcelo Tosatti1-1/+1
* commit 'b30e93e9ec01c87d53fb0c777e4b0fa258e85ca8': kvm: Remove static return code of kvm_handle_io Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
2011-02-13Close all block drivers on quitAvi Kivity1-0/+1
Following 2bc93fed76c89f7adaa0e5bb3, close all block drivers on quit. Fixes qcow2 data loss after quit due to qcowcache being volatile. Signed-off-by: Avi Kivity <avi@redhat.com>
2011-02-02Merge commit 'cad1e2827b616487e3574300f2eaeea13a355197' into upstream-mergeMarcelo Tosatti1-1/+1
* commit 'cad1e2827b616487e3574300f2eaeea13a355197': kvm: Drop smp_cpus argument from init functions kvm: x86: Fix !CONFIG_KVM_PARA build kvm: x86: Reset paravirtual MSRs Conflicts: kvm-all.c kvm.h Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
2011-01-21Merge commit 'd2f2b8a740c82319f9eea51ebed50815fbc3da3e' into upstream-mergeMarcelo Tosatti1-0/+2
* commit 'd2f2b8a740c82319f9eea51ebed50815fbc3da3e': kvm: test for ioeventfd support on old kernels virtio: move vmstate change tracking to core virtio-pci: Rename bugs field to flags qxl: tag as not hotpluggable vga: tag as not hotplugable. piix: tag as not hotpluggable. pci: allow devices being tagged as not hotpluggable. rtl8139: Use subsection to restrict migration after hotplug qdev: Track runtime machine modifications Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
2010-10-25qemu-kvm: use upstream sregs save/restore codeMarcelo Tosatti1-10/+0
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com> Signed-off-by: Avi Kivity <avi@redhat.com>
2010-10-25qemu-kvm: use upstream fpu/xsave/xcrs save/restore codeMarcelo Tosatti1-10/+10
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com> Signed-off-by: Avi Kivity <avi@redhat.com>
2010-10-25qemu-kvm: kill xsave/xcrs helpersMarcelo Tosatti1-24/+0
Use kvm_vcpu_ioctl directly instead. Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com> Signed-off-by: Avi Kivity <avi@redhat.com>
2010-10-20Merge commit 'c0532a76b407af4b276dc5a62d8178db59857ea6' into upstream-mergeMarcelo Tosatti1-134/+5
* commit 'c0532a76b407af4b276dc5a62d8178db59857ea6': MCE: Relay UCR MCE to guest Conflicts: kvm-stub.c target-i386/kvm.c Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
2010-10-20Merge commit 'e890261f671a0573efbc024972d8769423fc82fc' into upstream-mergeMarcelo Tosatti1-2/+2
* commit 'e890261f671a0573efbc024972d8769423fc82fc': Export qemu_ram_addr_from_host Conflicts: cpu-common.h exec.c Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
2010-10-20Merge commit 'e7701825e17d74913b0f1585d523cedaf1d6632a' into upstream-mergeMarcelo Tosatti1-62/+5
* commit 'e7701825e17d74913b0f1585d523cedaf1d6632a': kvm: x86: add mce support iothread: use signalfd signalfd compatibility Conflicts: target-i386/kvm.c Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
2010-10-14Avoid use of kvm_irq_routing_entry in hw/msix.cAvi Kivity1-0/+44
kvm_irq_routing_entry cannot be used when CONFIG_KVM is disabled; add a new interface to the kvm support code that uses scalars instead. Acked-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Avi Kivity <avi@redhat.com>
2010-10-14kvm: drop kvm_context parameter from msix-related kvm functionsAvi Kivity1-14/+19
The kvm_context parameter serves no useful purpose since it's a global (and all callers reference that global); on the other hand it prevents the build when kvm is not configured in since the kvm_context symbol is not defined. Remove the parameter and replace it by the global kvm_context in callees. Acked-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Avi Kivity <avi@redhat.com>
2010-10-08Fix SRAO/SRAR MCE injecting on guest without MCG_SER_PHuang Ying1-3/+3
On real machine, if MCG_SER_P in MSR_MCG_CAP is not set, SRAO/SRAR MCE should not be raised by hardware. This patch makes QEMU-KVM to follow the same rule. Reported-and-Reviewed-by: Hidetoshi Seto <seto.hidetoshi@jp.fujitsu.com> Signed-off-by: Huang Ying <ying.huang@intel.com> Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
2010-09-29qemu-kvm: explicit type conversion to avoid compilation failureShan Hai1-2/+2
The compilation failed using GCC-4.4.1 on mismatched types Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
2010-09-20Add RAM -> physical addr mapping in MCE simulationHuang Ying1-3/+10
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 MSR. Reported-by: Dean Nelson <dnelson@redhat.com> Signed-off-by: Huang Ying <ying.huang@intel.com> Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
2010-09-09Revert "qemu-kvm: drop posix-aio-compat.cs signalfd usage"Marcelo Tosatti1-1/+0
This reverts commit cb375ad1a62ba9de0207d144d0ad8ca1bee09d33. Breaks FC8 32/64 install. Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
2010-09-07qemu-kvm: drop posix-aio-compat.cs signalfd usageMarcelo Tosatti1-0/+1
Block SIGUSR2, which makes the signal be handled through qemu-kvm.c's signalfd. Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
2010-09-07qemu-kvm: use usptream eventfd codeMarcelo Tosatti1-50/+0
Upstream code is equivalent. Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
2010-09-06qemu-kvm.c: add braces where appropriateAvi Kivity1-62/+112
Adjust to comply with CODING_STYLE, at least where braces are concerned. Signed-off-by: Avi Kivity <avi@redhat.com> Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
2010-08-17make kvm_mutex_*lock staticPaolo Bonzini1-2/+2
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Avi Kivity <avi@redhat.com>
2010-06-23do not enter vcpu again if it was stopped during IOGleb Natapov1-0/+4
To prevent reentering vcpu after IO completion it is not enough to set env->stopped since it is checked only in main loop but control will not get there until next non-IO exit since kvm_run() will reenter vcpu to complete IO instruction. Solve this by sending self-signal to request exit after IO instruction completion. Signed-off-by: Gleb Natapov <gleb@redhat.com> Signed-off-by: Avi Kivity <avi@redhat.com>
2010-06-14qemu: kvm: Enable XSAVE live migration supportSheng Yang1-0/+24
Signed-off-by: Sheng Yang <sheng@linux.intel.com> Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
2010-06-07Print a user-friendly message on failed vmentryMohammed Gamal1-1/+19
This patch address bug report in https://bugs.launchpad.net/qemu/+bug/530077. Failed vmentries were handled with handle_unhandled() which prints a rather unfriendly message to the user. This patch separates handling vmentry failures from unknown exit reasons and prints a friendly message to the user. Signed-off-by: Mohammed Gamal <m.gamal005@gmail.com> Signed-off-by: Avi Kivity <avi@redhat.com>
2010-05-26Merge commit 'a875170167f75e63a11f68adc0a15b4e82a6c186' into upstream-mergeAvi Kivity1-3/+0
* commit 'a875170167f75e63a11f68adc0a15b4e82a6c186': Revert "Monitor: Return before exiting with 'quit'" Revert "monitor: Convert do_pci_device_hot_remove() to QObject" Conflicts: sysemu.h Signed-off-by: Avi Kivity <avi@redhat.com>
2010-05-05use upstream memslot management codeMarcelo Tosatti1-477/+4
Drop qemu-kvm's implementation in favour of qemu's, they are functionally equivalent. Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com> Signed-off-by: Avi Kivity <avi@redhat.com>
2010-05-05remove unused kvm_dirty_bitmap arrayMarcelo Tosatti1-11/+2
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com> Signed-off-by: Avi Kivity <avi@redhat.com>
2010-05-05remove unused kvm_get_dirty_pagesMarcelo Tosatti1-10/+2
And make kvm_unregister_memory_area static. Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com> Signed-off-by: Avi Kivity <avi@redhat.com>
2010-05-05remove support for !KVM_CAP_SET_TSS_ADDRMarcelo Tosatti1-18/+1
Kernels < 2.6.24 hardcoded slot 0 for the location of VMX rmode TSS pages. Remove support for it. Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com> Signed-off-by: Avi Kivity <avi@redhat.com>
2010-05-05remove alias supportMarcelo Tosatti1-134/+20
Aliases were added to workaround kvm's inability to destroy memory regions. This was fixed in 2.6.29, and advertised via KVM_CAP_DESTROY_MEMORY_REGION_WORKS. Also, alias support will be removed from the kernel in July 2010. Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com> Signed-off-by: Avi Kivity <avi@redhat.com>
2010-05-05qemu-kvm: event writeback can overwrite interrupts with -no-kvm-irqchipMarcelo Tosatti1-5/+4
Interrupts that are injected during a vcpu event save/writeback cycle are lost. Fix by writebacking the state before injecting interrupts. Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com> Signed-off-by: Avi Kivity <avi@redhat.com>
2010-05-05qemu-kvm: Process exit requests in kvm loopJan Kiszka1-0/+3
This unbreaks the monitor quit command for qemu-kvm. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Avi Kivity <avi@redhat.com>
2010-05-03Merge commit '7c80eef899ff0feb1ab6730d4dd3bc3aee046093' into upstream-mergeMarcelo Tosatti1-24/+2
* commit '7c80eef899ff0feb1ab6730d4dd3bc3aee046093': kvm: handle internal error target-i386: print EFER in cpu_dump_state Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
2010-04-28Ignore SRAO MCE if another MCE is being processedHuang Ying1-0/+28
In common cases, guest SRAO MCE will cause corresponding poisoned page be un-mapped in host and SIGBUS be sent to QEMU-KVM, then QEMU-KVM will relay the MCE to guest OS. But it is possible that the poisoned page is accessed in guest after un-mapped in host and before MCE is relayed to guest OS. So that, the SRAR SIGBUS is sent to QEMU-KVM before the SRAO SIGBUS, and if QEMU-KVM relays them to guest OS one by one, guest system may reset, because the SRAO MCE may be triggered while the SRAR MCE is being processed. In fact, the SRAO MCE can be ignored in this situation, so that the guest system is given opportunity to survive. Signed-off-by: Huang Ying <ying.huang@intel.com> Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
2010-04-12qemu-kvm: main_loop_wait now takes blocking/nonblocking argumentMarcelo Tosatti1-1/+1
Otherwise qemu-kvm iothread never sleeps on select(). Reported-by: "David S. Ahern" <daahern@cisco.com> Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
2010-04-06Merge commit 'd745bef890f9fa57298ae099365da8e8aa575cbd' into upstream-mergeMarcelo Tosatti1-1/+0
* commit 'd745bef890f9fa57298ae099365da8e8aa575cbd': (35 commits) Move KVM and Xen global flags to vl.c Move cpu_exec_init_all() declaration to qemu-common.h Allow various header files to be included from non-CPU code Adjust debug handling tcg/mips: fix branch offset during retranslation exec: remove dead code linux-user/ppc: use the Linux register layout qemu-io: fix aio help texts tcg/arm: Replace qemu_ld32u (left over from previous commit) Fix driftfix option Fix BSD and win32 builds Refactor numa mode setting pflash_cfi02: fix incorrect TARGET_FMT_lx/d use Compile vmware_vga only once tcg-mips: add guest base support tcg/mips: implement the not_i32 op the same way as gcc tcg-mips: implement nor be more specific in -mem-path error messages Add a missing #include for FreeBSD hosts error: Move qerror_report() from qemu-error.[ch] to qerror.[ch] ... Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
2010-03-24qemu-kvm: use reset handler for vcpusMarcelo Tosatti1-11/+14
Hook into the reset handlers instead of using custom code in qemu_kvm_system_reset. Also move kvm_arch_init_vcpu to kvm_create_vcpu. Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com> Signed-off-by: Avi Kivity <avi@redhat.com>
2010-03-24qemu-kvm: remove unused qemu_kvm_get_dirty_pagesMarcelo Tosatti1-5/+0
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com> Signed-off-by: Avi Kivity <avi@redhat.com>
2010-03-24qemu-kvm: use upstream kvm_flush_coalesced_mmio_bufferMarcelo Tosatti1-13/+1
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com> Signed-off-by: Avi Kivity <avi@redhat.com>
2010-03-24remove kvm_update_dirty_pages_log call from ram_save_blockMarcelo Tosatti1-14/+0
There is no need to update the dirty log from inside ram_save_block, since this happens through cpu_physical_sync_dirty_bitmap. In stage 3, where the VM is stopped, cpu_physical_sync_dirty_bitmap guarantees dirty log is synchronized before migration finishes. Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com> Signed-off-by: Avi Kivity <avi@redhat.com>