summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Merge commit 'a0fb002c6462d21ceb9eac8c5772e469ec189374' into upstream-mergeAvi Kivity2009-12-071-0/+11
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit 'a0fb002c6462d21ceb9eac8c5772e469ec189374': kvm: x86: Add support for VCPU event states kvm: x86: Fix merge artifact of f8d926e9 about mp_state targe-ppc: Sync CPU state for KVM target-ppc: Get MMU state on register sync qemu: cleanup unused macros in cirrus qemu: make cirrus init value pci spec compliant Conflicts: kvm-all.c target-i386/kvm.c Signed-off-by: Avi Kivity <avi@redhat.com>
| * kvm: x86: Add support for VCPU event statesJan Kiszka2009-12-031-0/+11
| | | | | | | | | | | | | | | | | | This patch extends the qemu-kvm state sync logic with support for KVM_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>
* | Merge commit '40ff6d7e8dceca227e7f8a3e8e0d58b2c66d19b4' into upstream-mergeAvi Kivity2009-12-071-1/+1
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit '40ff6d7e8dceca227e7f8a3e8e0d58b2c66d19b4': Don't leak file descriptors qemu-img: There is more than one host device driver qcow2: Fix some more qemu_malloc fallout qcow2: Store exact backing format length virtio-blk: Implement rerror option ide: Implement rerror option Conflicts: posix-aio-compat.c Extended qemu_set_cloexec() to compatfd.c. Signed-off-by: Avi Kivity <avi@redhat.com>
| * Don't leak file descriptorsKevin Wolf2009-12-031-1/+1
| | | | | | | | | | | | | | | | We're leaking file descriptors to child processes. Set FD_CLOEXEC on file descriptors that don't need to be passed to children to stop this misbehaviour. Signed-off-by: Kevin Wolf <kwolf@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* | Merge commit '0e607a80d323ba9f46dee71cd07380c4eb5c2b0a' into upstream-mergeAvi Kivity2009-11-221-0/+2
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit '0e607a80d323ba9f46dee71cd07380c4eb5c2b0a': (22 commits) kvm: x86: Refactor use of interrupt_bitmap kvm: Add arch reset handler Enable migration without shared storage from the monitor Block live migration Expose a mechanism to trace block writes char: rename qemu_chr_reset to qemu_chr_generic_open char: Remove special init_reset handling char: don't limit data sent to backends to 1k per buffer ARM PB-A8 support LAN9118 emulation mips_r4k: fix reset PPC64: map Uni-North AGP bus aka fix Linux boot PPC64: Partial fix to Linux crash: revert to old devfn PCI: make duplicate devfn allocation fatal Do not execute shell scripts directly mips malta: fix indentation target-mips: fix indentation mips-malta: fix reset mips: fix cpu_reset memory leak fix make clean targets ... Carry changes to qemu-kvm-x86.c. Signed-off-by: Avi Kivity <avi@redhat.com>
| * kvm: Add arch reset handlerJan Kiszka2009-11-171-0/+2
| | | | | | | | | | | | | | Will be required by succeeding changes. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* | Merge commit '91011d4f3b7c311a42b842f6682ac64a2372d2b7' into upstream-mergeAvi Kivity2009-11-221-20/+0
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit '91011d4f3b7c311a42b842f6682ac64a2372d2b7': pci: Fix function pci_default_write_config mips: fix CPU reset Fix PPC crash ARM MPCore tweaks Realview/EB procid hacks pci: fix the conversion of config field from array to pointer qemu_system_reset: we need to call it before loadvm/migration fdc: fix vmstate variable passed vnc: improve capslock handling. e1000 fix: read access to some registers is missing. Fix 32-bit overflow in parallels image support kvm ppc: Remove unused label kvm: Move KVM mp_state accessors to i386-specific code virtio-blk: Pass read errors to the guest savevm: Delete existing snapshots in all images Fix incoming migration fix type in CFLAGS name Conflicts: hw/pci.c Signed-off-by: Avi Kivity <avi@redhat.com>
| * kvm: Move KVM mp_state accessors to i386-specific codeHollis Blanchard2009-11-121-20/+0
| | | | | | | | | | | | | | Unbreaks PowerPC and S390 KVM builds. Signed-off-by: Hollis Blanchard <hollisb@us.ibm.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* | use upstream kvm_vcpu_ioctlGlauber Costa2009-10-221-3/+0
| | | | | | | | | | Signed-off-by: Glauber Costa <glommer@redhat.com> Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
* | use handle_io upstream version.Glauber Costa2009-10-201-0/+2
| | | | | | | | | | | | | | We can use upstream version of handle_io, there called kvm_handle_io() Signed-off-by: Glauber Costa <glommer@redhat.com> Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
* | Merge commit 'd549db5a732ef2ec145b84c5008a7585cf17cf67' into upstream-mergeMarcelo Tosatti2009-10-141-0/+2
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit 'd549db5a732ef2ec145b84c5008a7585cf17cf67': (27 commits) unlock iothread mutex before running kvm ioctl TARGET_I386 is always defined if TARGET_X86_64 is defined slirp: fix !CONFIG_SLIRP compilation ide: BMDMAState don't need a pci_dev field anymore ide: cmd646 ->unit has just the value that we want ide: cmd646 we can get the pci device with container_of ide: 'secondary' field is only used by cmd646 ide: PCIIDEState type field is not needed anymore ide: split cmd646 and piix from pci.c ide: export needed ide-pci functions for split ide: create ide/pci.h for common ide pci definitions ide: remove uselsess casts from void * ide: Remove duplicated definitions ide: Remove cast in pci_register_bar ide: change cast to DO_UPCAST Fix bswap in comment Move dependency generation falgs out of configure configure: clean up temporary dependency files winwave: pause/restore playing upon seeing VOICE_DISABLE/ENABLE winwave: close event handle and delete wait object after closing HWAVEOUT ... Conflicts: vl.c Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
| * unlock iothread mutex before running kvm ioctlGlauber Costa2009-10-121-0/+2
| | | | | | | | | | | | | | | | | | Without this, kvm will hold the mutex while it issues its run ioctl, and never be able to step out of it, causing a deadlock. Patchworks-ID: 35359 Signed-off-by: Glauber Costa <glommer@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* | use a more upstream friendly version of irqchip-in-kernel testGlauber Costa2009-10-131-0/+2
| | | | | | | | | | | | | | | | | | | | Upstream now has tests for irqchip_in_kernel. It differs from our signature, as it does not take any parameter. For consistency, convert our usage. Also, use a field in KVMState to store it, so we can have the exact same function as qemu upstream does. Signed-off-by: Glauber Costa <glommer@redhat.com> Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
* | Merge commit '7cd9eee0f6fd6953114068dd98d91fca1237880b' into upstream-mergeAvi Kivity2009-10-051-1/+11
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit '7cd9eee0f6fd6953114068dd98d91fca1237880b': piix_pci: kill PIIX3IrqState convert pci bridge to qdev support inplace allocation for pci bus, split irq init. switch ide bus to inplace allocation. switch usb bus to inplace allocation. switch scsi bus to inplace allocation. allow qdev busses allocations be inplace temporary fix for on_vcpu kvm: Fix guest single-stepping gdbstub: x86: Switch 64/32 bit registers dynamically Signed-off-by: Avi Kivity <avi@redhat.com>
| * temporary fix for on_vcpuGlauber Costa2009-10-051-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Recent changes made on_vcpu hit the abort() path, even with the IO thread disabled. This is because cpu_single_env is no longer set when we call this function. Although the correct fix is a little bit more complicated that that, the recent thread in which I proposed qemu_queue_work (which fixes that, btw), is likely to go on a quite different direction. So for the benefit of those using guest debugging, I'm proposing this simple fix in the interim. Signed-off-by: Glauber Costa <glommer@redhat.com> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
| * kvm: Fix guest single-steppingJan Kiszka2009-10-051-1/+7
| | | | | | | | | | | | | | | | Hopefully the last regression of 4c0960c0: KVM_SET_GUEST_DEBUG requires properly synchronized guest registers (on x86: eflags) on entry. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
| * Revert "Get rid of _t suffix"Anthony Liguori2009-10-011-23/+23
| | | | | | | | | | | | | | | | | | | | | | | | 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. Something like this _must_ be presented on the list first so people can provide input and cope with it. This reverts commit 99a0949b720a0936da2052cb9a46db04ffc6db29. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
| * Get rid of _t suffixmalc2009-10-011-23/+23
| | | | | | | | | | | | | | Some not so obvious bits, slirp and Xen were left alone for the time being. Signed-off-by: malc <av1474@comtv.ru>
* | Merge commit 'afcea8cbdea8180b42093377b2c700d1b7f20b7c' into upstream-mergeAvi Kivity2009-09-211-9/+9
|\| | | | | | | | | | | | | * commit 'afcea8cbdea8180b42093377b2c700d1b7f20b7c': ioports: remove unused env parameter and compile only once Signed-off-by: Avi Kivity <avi@redhat.com>
| * ioports: remove unused env parameter and compile only onceBlue Swirl2009-09-201-9/+9
| | | | | | | | | | | | | | The CPU state parameter is not used, remove it and adjust callers. Now we can compile ioport.c once for all targets. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* | Merge commit '72cf2d4f0e181d0d3a3122e04129c58a95da713e' into upstream-mergeMarcelo Tosatti2009-09-141-6/+6
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit '72cf2d4f0e181d0d3a3122e04129c58a95da713e': Fix sys-queue.h conflict for good Try to fix BSD breakage by 806b60248218bd5f74a8b070f5a99a864e8e51c6 Include sys-queue.h early to override system queue definitions on BSD Unbreak BSD: use qemu_fdatasync instead of fdatasync Use proper format conversion specifier when printing size_t value audio: remove lsbindex/popcount in favour of host-utils's ctz32 alsa: poll mode handling oss: poll mode handling audio: poll mode infrastructure gus: Do not manually free the state, qdev does it for us oss: Unbreak mmaping the ability to mmap oss fd on Linux Conflicts: exec.c kvm.h sysemu.h vl.c Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
| * Fix sys-queue.h conflict for goodBlue Swirl2009-09-121-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: Our file sys-queue.h is a copy of the BSD file, but there are some additions and it's not entirely compatible. Because of that, there have been conflicts with system headers on BSD systems. Some hacks have been introduced in the commits 15cc9235840a22c289edbe064a9b3c19c5f49896, f40d753718c72693c5f520f0d9899f6e50395e94, 96555a96d724016e13190b28cffa3bc929ac60dc and 3990d09adf4463eca200ad964cc55643c33feb50 but the fixes were fragile. Solution: Avoid the conflict entirely by renaming the functions and the file. Revert the previous hacks. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* | Merge commit '4c0960c0c483fffc5f8e1dab169d946ac295bf44' into upstream-mergeAvi Kivity2009-08-301-0/+13
|\| | | | | | | | | | | | | | | | | | | | | * commit '4c0960c0c483fffc5f8e1dab169d946ac295bf44': kvm: Simplify cpu_synchronize_state() Conflicts: hw/apic.c target-i386/machine.c Signed-off-by: Avi Kivity <avi@redhat.com>
| * kvm: Simplify cpu_synchronize_state()Avi Kivity2009-08-271-0/+14
| | | | | | | | | | | | | | | | | | | | | | cpu_synchronize_state() is a little unreadable since the 'modified' argument isn't self-explanatory. Simplify it by making it always synchronize the kernel state into qemu, and automatically flush the registers back to the kernel if they've been synchronized on this exit. Signed-off-by: Avi Kivity <avi@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* | Use kvm_has_sync_mmu from upstreamGlauber Costa2009-08-041-0/+3
| | | | | | | | | | | | | | they have it, and it does the same as we do. Signed-off-by: Glauber Costa <glommer@redhat.com> Signed-off-by: Avi Kivity <avi@redhat.com>
* | Use coalesce memory regions functions from upstreamGlauber Costa2009-08-041-1/+1
| | | | | | | | | | | | | | Delete ours, they do the same thing. Signed-off-by: Glauber Costa <glommer@redhat.com> Signed-off-by: Avi Kivity <avi@redhat.com>
* | Merge commit '4c955388572068c57bb8cd205b61fa5dfa1a84f1' into upstream-mergeAvi Kivity2009-07-291-12/+1
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit '4c955388572068c57bb8cd205b61fa5dfa1a84f1': Define ENOTSUP anywhere it isn't defined Revert "Fake dirty loggin when it's not there" Fix out of tree build broken by 791e08c753a9f9be3c3880b4ea83b6dfa4b6ccad Fix typo WIN32 -> _WIN32 set SEARCH_PATH for the linker script from output of ld --verbose -v generate LDFLAGS for *-linux-user and *-bsd-user in a single place in configure our build system don't support mips little endian linux-user or bsd-user Don't build option roms on Mac OS X multiboot.bin is a generated file use cc-option for optionrom Use quiet-command for building optionrom move cc-option definition to rules.mak Generate config-host.h from config-host.mak Signed-off-by: Avi Kivity <avi@redhat.com>
| * Revert "Fake dirty loggin when it's not there"Anthony Liguori2009-07-271-12/+1
| | | | | | | | | | | | | | | | | | This reverts commit bd8367761236cd5c435598aeb2f1b8240c09b059. PPC should just implement dirty logging so we can avoid all the fall-out from this changeset. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* | Merge commit 'fc5d642fcae392bbc9fed9ac6bc78ac29ed48372' into upstream-mergeAvi Kivity2009-07-291-9/+12
|\| | | | | | | | | | | | | | | | | | | | | | | * commit 'fc5d642fcae392bbc9fed9ac6bc78ac29ed48372': Fix broken build slirp: Use monotonic clock if available (v2) slirp: Remove UDP protocol emulation (talk, cuseeme) qemu: msix nit: clear msix_entries_nr on error Fix build failure in on_vcpu() Signed-off-by: Avi Kivity <avi@redhat.com>
| * Fix broken buildLuiz Capitulino2009-07-271-9/+9
| | | | | | | | | | | | | | | | | | The only caller of on_vcpu() is protected by ifdef KVM_CAP_SET_GUEST_DEBUG, so protect on_vcpu() too otherwise QEMU may not to build. Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* | Merge commit 'baef8a666c137fae513a195c8abeb80e1806d7bd' into upstream-mergeAvi Kivity2009-07-291-4/+7
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit 'baef8a666c137fae513a195c8abeb80e1806d7bd': QEMU BOCHS bios patches to use maxcpus value. Introduce -smp , maxcpus= flag to specify maximum number of CPUS. Use Little Endian for Dirty Log Use 64bit pointer for dirty log HPET fixes for reg writes slirp: Fix guestfwd for incoming data Conflicts: pc-bios/bios.bin (dropped) Signed-off-by: Avi Kivity <avi@redhat.com>
| * Use Little Endian for Dirty LogAlexander Graf2009-07-271-4/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We currently use host endian long types to store information in the dirty bitmap. This works reasonably well on Little Endian targets, because the u32 after the first contains the next 32 bits. On Big Endian this breaks completely though, forcing us to be inventive here. So Ben suggested to always use Little Endian, which looks reasonable. We only have dirty bitmap implemented in Little Endian targets so far and since PowerPC would be the first Big Endian platform, we can just as well switch to Little Endian always with little effort without breaking existing targets. This is the userspace part of the patch. It shouldn't change anything for existing targets, but help PowerPC. It replaces my older patch called "Use 64bit pointer for dirty log". Signed-off-by: Alexander Graf <agraf@suse.de> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
| * Use 64bit pointer for dirty logAlexander Graf2009-07-271-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Dirty logs currently get written with native "long" size. On little endian it doesn't matter if we use uint64_t instead though, because we'd still end up using the right bytes. On big endian, this does become a bigger problem, so we need to ensure that kernel and userspace talk the same language, which means getting rid of "long" and using a defined size instead. So I decided to use 64 bit types at all times. This doesn't break existing targets but will in conjunction with a patch I'll send to the KVM ML make dirty logs work with 32 bit userspace on 64 kernel with big endian. Signed-off-by: Alexander Graf <agraf@suse.de> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* | Merge commit 'f07918fdff76ace82b1ca3e53bbcddef069eb314' into upstream-mergeAvi Kivity2009-07-281-0/+13
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit 'f07918fdff76ace82b1ca3e53bbcddef069eb314': Add getfd and closefd monitor commands Add SCM_RIGHTS support to unix socket character devices Make tcp_chr_read() use recvmsg() sparc64 really implement itlb/dtlb automatic replacement writes sparc64 name mmu registers and general cleanup Give the kernel more room PPC: Round VGA BIOS size to page boundary Fix period initialization provide tests for pit in kernel and irqchip in kernel qemu-thread: use pthread_equal Link bios files when building out of tree signrom.sh: portability fix notify io_thread at the end of rx handling Conflicts: qemu-monitor.hx Signed-off-by: Avi Kivity <avi@redhat.com>
| * provide tests for pit in kernel and irqchip in kernelGlauber Costa2009-07-221-0/+13
| | | | | | | | | | | | | | | | | | KVM can have an in-kernel pit or irqchip. While we don't implement it yet, having a way for test for it (that always returns zero) will allow us to reuse code in qemu-kvm that tests for it. Signed-off-by: Glauber Costa <glommer@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* | Merge commit '452e475196a3f8b6b96d16bbaca727ebc1278a97' into upstream-mergeAvi Kivity2009-07-281-8/+43
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit '452e475196a3f8b6b96d16bbaca727ebc1278a97': (55 commits) introduce on_vcpu qemu-io: reject invalid pattern qemu-io: Rework alloc command qmu-img: fix qemu-img convert to generate a valid image when the source referenced a backing file vmdk: Fix backing file handling use struct initializer for audio.c Add save/restore support to the LSI logic SCSI device model. Handle BH's queued by AIO completions in qemu_aio_flush() Fake dirty loggin when it's not there Use correct input constant Fix warning in kvm-all.c Set PVR in sregs Enable PPC KVM for non-embedded Sparc32: convert Sun4c interrupt controller to qdev Sparc32: convert SBI to qdev Fix CONFIG_PROFILER Sparc32/64: use 64 bit type for memory size qdev: add 64 bit type Sparc64: refactor kernel init Sparc64: refactor CPU init ... Conflicts: kvm-all.c Signed-off-by: Avi Kivity <avi@redhat.com>
| * introduce on_vcpuGlauber Costa2009-07-221-6/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | on_vcpu is a qemu-kvm function that will make sure that a specific piece of code will run on a requested cpu. We don't need that because we're restricted to -smp 1 right now, but those days are likely to end soon. So for the benefit of having qemu-kvm share more code with us, I'm introducing our own version of on_vcpu(). Right now, we either run a function on the current cpu, or abort the execution, because it would mean something is seriously wrong. As an example code, I "ported" kvm_update_guest_debug to use it, with some slight differences from qemu-kvm. This is probably 0.12 material Signed-off-by: Glauber Costa <glommer@redhat.com> CC: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
| * Fake dirty loggin when it's not thereAlexander Graf2009-07-221-1/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Some KVM platforms don't support dirty logging yet, like IA64 and PPC, so in order to still have screen updates on those, we need to fake it. This patch just tells the getter function for dirty bitmaps, that all pages within a slot are dirty when the slot has dirty logging enabled. That way we can implement dirty logging on those platforms sometime when it drags down performance, but share the rest of the code with dirty logging capable platforms. Signed-off-by: Alexander Graf <agraf@suse.de> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
| * Fix warning in kvm-all.cAlexander Graf2009-07-221-1/+1
| | | | | | | | | | | | | | This fixes a warning I stumbled across while compiling qemu on PPC64. Signed-off-by: Alexander Graf <agraf@suse.de> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* | check extensionGlauber Costa2009-07-211-0/+2
| | | | | | | | | | | | | | use upstream check_extension code Signed-off-by: Glauber Costa <glommer@redhat.com> Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
* | reuse kvm_ioctlGlauber Costa2009-07-211-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Start using kvm_ioctl's code. For type safety, delete fd from kvm_context entirely, so the compiler can play along with us helping to detect errors I might have made. Signed-off-by: Glauber Costa <glommer@redhat.com> Also, we were slightly different from qemu upstream in handling error code from ioctl, since we were always testing for -1, while kvm_vm_ioctl returns -errno. We already did this in most of the call sites, so this patch has the big advantage of simplifying call sites. Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
* | reuse kvm_vm_ioctlGlauber Costa2009-07-211-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Start using kvm_vm_ioctl's code. For type safety, delete vm_fd from kvm_context entirely, so the compiler can play along with us helping to detect errors I might have made. Also, we were slightly different from qemu upstream in handling error code from ioctl, since we were always testing for -1, while kvm_vm_ioctl returns -errno. We already did this in most of the call sites, so this patch has the big advantage of simplifying call sites. Diffstat says: 4 files changed, 58 insertions(+), 134 deletions(-) Signed-off-by: Glauber Costa <glommer@redhat.com> Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
* | reuse upstream breakpoint codeGlauber Costa2009-07-141-1/+4
| | | | | | | | | | | | | | | | | | Drop KVM_UPSTREAM around functions we intend to reuse. This allow us to share code in kvm-all.c, that is equal in qemu-kvm.c Signed-off-by: Glauber Costa <glommer@redhat.com> CC: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
* | Do not compile qemu-kvm.c and qemu-kvm-x86.cGlauber Costa2009-07-141-0/+2
| | | | | | | | | | | | | | Instead, include them from upstream files Signed-off-by: Glauber Costa <glommer@redhat.com> Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
* | replace USE_KVM with CONFIG_KVMGlauber Costa2009-07-141-0/+2
|/ | | | | | | | | | Make things less confuse, and we have KVM_UPSTREAM to differentiate between the two versions anyway. kvm-all.c and kvm.c gets compiled now, but protected with KVM_UPSTREAM too, so no function in there gets visible in the final binary Signed-off-by: Glauber Costa <glommer@redhat.com> Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
* Revert "Introduce reset notifier order"Jan Kiszka2009-06-291-1/+1
| | | | | | | | | This reverts commit 8217606e6edb49591b4a6fd5a0d1229cebe470a9 (and updates later added users of qemu_register_reset), we solved the problem it originally addressed less invasively. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* kvm: Rework VCPU synchronizationJan Kiszka2009-06-291-23/+13
| | | | | | | | | | | | | | | During startup and after reset we have to synchronize user space to the in-kernel KVM state. Namely, we need to transfer the VCPU registers when they change due to VCPU as well as APIC reset. This patch refactors the required hooks so that kvm_init_vcpu registers its own per-VCPU reset handler and adds a cpu_synchronize_state to the APIC reset. That way we no longer depend on the new reset order (and can drop this disliked interface again) and we can even drop a KVM hook in main(). Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* kvm: Fix IRQ injection into full queueJan Kiszka2009-06-161-2/+1
| | | | | | | | | | | | | | | | | User space may only inject interrupts during kvm_arch_pre_run if ready_for_interrupt_injection is set in kvm_run. But that field is updated on exit from KVM_RUN, so we must ensure that we enter the kernel after potentially queuing an interrupt, otherwise we risk to loose one - like it happens with the current code against latest kernel modules (since kvm-86) that started to queue only a single interrupt. Fix the problem by reordering kvm_cpu_exec. Credits go to Gleb Natapov for analyzing the issue in details. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* kvm: Improve upgrade notes when facing unsupported kernelsJan Kiszka2009-06-071-3/+7
| | | | | | | | Users complained that it is not obvious what to do when kvm refuses to build or run due to an unsupported host kernel, so let's improve the hints. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
* kvm: x86: Save/restore KVM-specific CPU statesJan Kiszka2009-05-221-0/+20
| | | | | | | | | | | | | | Save and restore all so far neglected KVM-specific CPU states. Handling the TSC stabilizes migration in KVM mode. The interrupt_bitmap and mp_state are currently unused, but will become relevant for in-kernel irqchip support. By including proper saving/restoring already, we avoid having to increment CPU_SAVE_VERSION later on once again. v2: - initialize mp_state runnable (for the boot CPU) Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>