summaryrefslogtreecommitdiff
path: root/libkvm
AgeCommit message (Collapse)AuthorFilesLines
2009-10-26libkvm: kick out unneeded include fileIzik Eidus1-1/+0
Signed-off-by: Izik Eidus <ieidus@redhat.com>
2009-05-28kvm: libkvm: add ioctl wrappers for KVM_SET_MSIX_ENTRY_NR and KVM_SET_MSIX_ENTRYSheng Yang2-0/+32
Signed-off-by: Sheng Yang <sheng@linux.intel.com> Signed-off-by: Avi Kivity <avi@redhat.com> (cherry picked from commit 53dc8b3b16251e3753da65f7a295f3e58cf7219c) Signed-off-by: Chris Wright <chrisw@redhat.com> Bugzilla: 498085 Message-Id: <1242950943-30180-12-git-send-email-chrisw@redhat.com> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> RH-Upstream-status: applied Acked-by: Juan Quintela <quintela@redhat.com> Acked-by: Marcelo Tosatti <mtosatti@redhat.com> Acked-by: Don Dutile <ddutile@redhat.com>
2009-05-28kvm: libkvm: allocate unused gsi for irq routingSheng Yang3-1/+25
Notice here is a simple solution, can be replaced later. Signed-off-by: Sheng Yang <sheng@linux.intel.com> Signed-off-by: Avi Kivity <avi@redhat.com> (cherry picked from commit d50932ff61cf84bf9dc3688fd34e4d8e7384f184) Signed-off-by: Chris Wright <chrisw@redhat.com> Bugzilla: 498085 Message-Id: <1242950943-30180-8-git-send-email-chrisw@redhat.com> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> RH-Upstream-status: applied Acked-by: Marcelo Tosatti <mtosatti@redhat.com> Acked-by: Juan Quintela <quintela@redhat.com> Acked-by: Don Dutile <ddutile@redhat.com>
2009-05-28kvm: libkvm: user interface for MSI type irq routingSheng Yang2-19/+101
Signed-off-by: Sheng Yang <sheng@linux.intel.com> Signed-off-by: Avi Kivity <avi@redhat.com> (cherry picked from commit c366ef718e69eb868b79a2b9bfcfb723257a8ec3) Signed-off-by: Chris Wright <chrisw@redhat.com> Bugzilla: 498085 Message-Id: <1242950943-30180-7-git-send-email-chrisw@redhat.com> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> RH-Upstream-status: applied Acked-by: Marcelo Tosatti <mtosatti@redhat.com> Acked-by: Juan Quintela <quintela@redhat.com> Acked-by: Don Dutile <ddutile@redhat.com>
2009-05-28kvm: libkvm: support KVM_ASSIGN_DEV_IRQ and KVM_DEASSIGN_DEV_IRQ ioctlsMarcelo Tosatti2-5/+54
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com> Signed-off-by: Sheng Yang <sheng@linux.intel.com> Signed-off-by: Avi Kivity <avi@redhat.com> (cherry picked from commit 19d9a5828697ae0d52e20712e37bcb5b28930f81) Signed-off-by: Chris Wright <chrisw@redhat.com Bugzilla: 498085 Message-Id: <1242950943-30180-2-git-send-email-chrisw@redhat.com> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> RH-Upstream-status: applied Acked-by: Juan Quintela <quintela@redhat.com> Acked-by: Marcelo Tosatti <mtosatti@redhat.com> Acked-by: Don Dutile <ddutile@redhat.com>
2009-05-28kvm: libkvm: add deassign ioctlWeidong Han2-0/+27
Add this to support hot remove assigned device. Acked-by: Mark McLoughlin <markmc@redhat.com> Signed-off-by: Weidong Han <weidong.han@intel.com> Signed-off-by: Avi Kivity <avi@redhat.com> (cherry picked from commit 0512290fa039bfb8254df33bd5e1a8407add4211) Signed-off-by: Chris Wright <chrisw@redhat.com> Bugzilla: 498084 Message-Id: <1242950924-30161-8-git-send-email-chrisw@redhat.com> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> RH-Upstream-status: applied Acked-by: Juan Quintela <quintela@redhat.com> Acked-by: Marcelo Tosatti <mtosatti@redhat.com> Acked-by: Don Dutile <ddutile@redhat.com>
2009-05-28kvm: libkvm: Fix return of kvm_commit_irq_routes()Jan Kiszka1-0/+1
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Avi Kivity <avi@redhat.com> (cherry picked from commit 87fd0ddc20d317ba00311a7cce77635494e90ddf) Signed-off-by: Chris Wright <chrisw@redhat.com> Bugzilla: 498084 Message-Id: <1242950924-30161-7-git-send-email-chrisw@redhat.com> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> RH-Upstream-status: applied Acked-by: Juan Quintela <quintela@redhat.com> Acked-by: Marcelo Tosatti <mtosatti@redhat.com> Acked-by: Don Dutile <ddutile@redhat.com>
2009-05-28kvm: libkvm: support for irq routingAvi Kivity3-0/+173
Signed-off-by: Avi Kivity <avi@redhat.com> (cherry picked from commit 67e684f00b53b58e5f2067fd3379ae1b00e725bd) Signed-off-by: Chris Wright <chrisw@redhat.com> Bugzilla: 498084 Message-Id: <1242950924-30161-5-git-send-email-chrisw@redhat.com> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> RH-Upstream-status: applied Acked-by: Juan Quintela <quintela@redhat.com> Acked-by: Marcelo Tosatti <mtosatti@redhat.com> Acked-by: Don Dutile <ddutile@redhat.com>
2009-03-02handle IRQ status injection in userspaceGleb Natapov3-4/+19
This allows timers to keep track of injected and coalesced interrupts. upstrem commit: ea1b668e7684dc43e9d198ba0b25fe47a0b2acd2 Signed-off-by: Gleb Natapov <gleb@redhat.com> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> RH-Upstream-status: applied(kvm/master) Bugzilla: 487595 Acked-by: Eduardo Habkost <ehabkost@redhat.com> Acked-by: Marcelo Tosatti <mtosatti@redhat.com>
2009-01-11kvm: libkvm: don't install anythingAvi Kivity1-1/+6
Current installation only installs partial headers, which confuses upstream qemu. Nothing uses it, so disable it. Signed-off-by: Avi Kivity <avi@redhat.com>
2008-12-31kvm: libkvm: pit not reinject supportMarcelo Tosatti2-0/+21
[avi: adjust for kernel api changes] Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com> Signed-off-by: Avi Kivity <avi@redhat.com>
2008-12-25kvm: libkvm: add missing 'break' for s390Avi Kivity1-0/+1
Signed-off-by: Avi Kivity <avi@redhat.com>
2008-12-17kvm: qemu: Switch to new guest debug interfaceJan Kiszka3-8/+21
This patch switches both libkvm as well as the qemu pieces over to the new guest debug interface. It comes with full support for software-based breakpoints (via guest code modification), hardware-assisted breakpoints and watchpoints (x86-only so far). Breakpoint management is done inside qemu-kvm, transparently to gdbstub and also avoiding that the gdb frontend takes over. This allows for running debuggers inside the guest while guest debugging it active, because the host can cleanly tell apart host- and guest-originated breakpoint events. Yet improvable are x86 corner cases when using single-step ("forgotten" debug flags on the guest's stack). And, of course, the yet empty non-x86 helper functions have to be populated. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Christian Ehrhardt <ehrhardt@linux.vnet.ibm.com> Signed-off-by: Avi Kivity <avi@redhat.com>
2008-12-14kvm: libkvm: check for slot overlap using 64-bit arithmeticAvi Kivity1-2/+2
otherwise, a slot that ends on the 4GB boundary wraps around, resulting in a false positive, and leading to an early failure when attempting to get the bios slot's dirty log (which doesn't have dirty logging enabled). fixed broken display on 32-bit userspace. Signed-off-by: Avi Kivity <avi@redhat.com>
2008-12-14kvm: qemu: Switch to KVM_CAP_USER_NMIJan Kiszka2-4/+6
Adopt to new KVM_CAP_USER_NMI interface for injecting NMIs from qemu user space. As this capability is only provided on archs actually requiring it, we can also drop a lot of empty arch stubs. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Avi Kivity <avi@redhat.com>
2008-12-14kvm: libkvm: Add the stub for kvm_{create, destroy}_memory_alias for ia64.root1-0/+13
Signed-off-by: Xiantao Zhang <xiantao.zhang@intel.com> Signed-off-by: Avi Kivity <avi@redhat.com>
2008-12-09kvm: libkvm: export KVM_CAP_DESTROY_MEMORY_REGION_WORKSAvi Kivity2-0/+22
Signed-off-by: Avi Kivity <avi@redhat.com>
2008-11-26kvm: qemu: Cleanup user space NMI injectionJan Kiszka2-29/+4
Cleanup redundant check for an open NMI window before injecting. This will no longer be supported by the kernel, and it was broken by design anyway. This change still allows to run the user space against older kernel modules. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Avi Kivity <avi@redhat.com>
2008-11-18kvm: libkvm: pass opague cpu state through libkvm instead of int vcpuJes Sorensen3-23/+23
Change code to pass around opague pointer to CPUState through libkvm, avoiding conversion from CPUState to int vcpu and back in the callbacks into qemu. Signed-off-by: Jes Sorensen <jes@sgi.com> Signed-off-by: Avi Kivity <avi@redhat.com>
2008-11-13kvm: libkvm: raise max vcpus to 256 for ia64Jes Sorensen1-4/+7
Signed-off-by: Jes Sorensen <jes@sgi.com> Signed-off-by: Avi Kivity <avi@redhat.com>
2008-11-02kvm: user: ppc: remove build flagsHollis Blanchard1-2/+0
Remove -m32 build flag. Although necessary when building for a 32-bit target with a biarch toolchain that defaults to 64-bit output, it naturally breaks 64-bit builds. Also remove -D__powerpc__. I'm not sure why I added that in the first place; that is automatically defined by GCC (for both 32- and 64-bit targets). Signed-off-by: Hollis Blanchard <hollisb@us.ibm.com> Signed-off-by: Avi Kivity <avi@redhat.com>
2008-10-30kvm: libkvm: device assignment: add ioctl wrappersAmit Shah2-0/+52
[muli: return -errno instead of ioctl retval] Signed-off-by: Amit Shah <amit.shah@redhat.com> Signed-off-by: Muli Ben-Yehuda <muli@il.ibm.com> Signed-off-by: Avi Kivity <avi@redhat.com>
2008-10-10kvm: libkvm: change full memory logging to use the per-slot refcounting apiAvi Kivity1-7/+8
this allows full memory logging (for migration) and partial memory logging (for vga tracking) to coexist. Signed-off-by: Avi Kivity <avi@redhat.com>
2008-10-10kvm: add api to enable or disable dirty logging on a per-slot basisAvi Kivity2-0/+48
the api counts the number of requests to log a slot, so that multiple simultaneous users can be supported. when the last user disappears, dirty logging is disabled. Signed-off-by: Avi Kivity <avi@redhat.com>
2008-10-10kvm: libkvm: change the logging functions to be able to reset the log bitAvi Kivity1-8/+17
currently, the memory logging functions aren't able to clear flags, and they don't maintain the slot flags field correctly. Fix by passing a mask which indicates which bits are to be set or reset. Signed-off-by: Avi Kivity <avi@redhat.com>
2008-10-10kvm: libkvm: add memory registration debugging tracesAvi Kivity1-1/+15
Signed-off-by: Avi Kivity <avi@redhat.com>
2008-10-02kvm: libkvm: ppc: fix file header in libkvm-powerpc.cChristian Ehrhardt1-9/+5
It came up in the review of the s390 libkvm code that we have some broken headers too. Signed-off-by: Christian Ehrhardt <ehrhardt@linux.vnet.ibm.com> Signed-off-by: Avi Kivity <avi@redhat.com>
2008-10-01kvm: qemu: Enable NMI support for user space irqchipJan Kiszka2-0/+54
Make use of the new KVM_NMI IOCTL to push NMIs into the KVM guest if the user space APIC emulation or some other source raised them. In order to use the 'nmi' monitor command which asynchroniously injects NMIs for the given CPU, a new service called kvm_inject_interrupt is required. This will invoke cpu_interrupt on the target VCPU, working around the fact that the QEMU service is not thread-safe. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Avi Kivity <avi@redhat.com>
2008-09-28kvm: libkvm: kvm_dirty_pages_log_change: do not forget to set .slotUri Lublin1-0/+1
The default for .slot is 0, which is wrong for all other kvm-slots. This fixes enabling/disabling kvm dirty page logging. Signed-off-by: Uri Lublin <uril@qumranet.com> Signed-off-by: Avi Kivity <avi@redhat.com>
2008-09-24kvm: qemu: unregister memory area depending on their flagsGlauber Costa2-0/+15
Signed-off-by: Glauber Costa <glommer@redhat.com> Signed-off-by: Avi Kivity <avi@redhat.com>
2008-09-24kvm: libkvm: add debuging facilities to memory registration at libkvmGlauber Costa1-0/+13
Signed-off-by: Glauber Costa <glommer@redhat.com> Signed-off-by: Avi Kivity <avi@redhat.com>
2008-09-24kvm: libkvm: substitute is_allocated_mem with more general is_containing_regionGlauber Costa2-24/+14
is_allocated_mem is a function that checks if every relevant aspect of the memory slot match (start and size). Replace it with a more generic function that checks if a memory region is totally contained into another. The former case is also covered. Signed-off-by: Glauber Costa <glommer@redhat.com> Signed-off-by: Avi Kivity <avi@redhat.com>
2008-09-24kvm: libkvm: do not use mem_hole anymore.Glauber Costa2-69/+2
memory holes are totally evil. Right now they work for some basic tests, but had never been stressed enough. Using memory holes leaves open questions like: * what happens if a area being registered span two slots? * what happens if there is already data in the slots? also, the code behaves badly if the piece to be removed lies in the boundaries of the current slot. Luckily, we don't really need it. Remove it, and make sure we never hit it. Signed-off-by: Glauber Costa <glommer@redhat.com> Signed-off-by: Avi Kivity <avi@redhat.com>
2008-09-23libkvm: kvm_init: check kvm context allocation and zero itUri Lublin1-0/+3
Signed-off-by: Uri Lublin <uril@qumranet.com> Signed-off-by: Avi Kivity <avi@redhat.com>
2008-09-13kvm: libkvm: Modify userspace memory slot limit to 32Sheng Yang1-1/+1
To keep consistent with kernel space. Signed-off-by: Sheng Yang <sheng.yang@intel.com> Signed-off-by: Avi Kivity <avi@qumranet.com>
2008-09-11kvm: libkvm: rename kvm_register_userspace_phys_memGlauber Costa2-2/+2
Change its name to kvm_register_phys_mem(). Signed-off-by: Glauber Costa <glommer@redhat.com> Signed-off-by: Avi Kivity <avi@qumranet.com>
2008-09-11kvm: libkvm: merge destroy phys mem functionsGlauber Costa1-28/+17
kvm_destroy_userspace_phys_mem() and kvm_destroy_phys_mem() can be merged into a single function, now that kernel allocation is no more. Signed-off-by: Glauber Costa <glommer@redhat.com> Signed-off-by: Avi Kivity <avi@qumranet.com>
2008-09-11kvm: libkvm: remove user_alloc field from slot representationGlauber Costa2-25/+16
All allocations are "user" now. So we don't need this field anymore. Signed-off-by: Glauber Costa <glommer@redhat.com> Signed-off-by: Avi Kivity <avi@qumranet.com>
2008-09-11kvm: libkvm: get rid of kvm_create_userspace_phys_memGlauber Costa1-11/+4
It is just kvm_create_phys_mem() right now. Signed-off-by: Glauber Costa <glommer@redhat.com> Signed-off-by: Avi Kivity <avi@qumranet.com>
2008-09-11kvm: libkvm: remove create_kernel_phys_memGlauber Costa6-67/+3
Wipe out create_kernel_phys_mem(), and all of its users. Signed-off-by: Glauber Costa <glommer@redhat.com> Signed-off-by: Avi Kivity <avi@qumranet.com>
2008-09-11kvm: libkvm: remove KVM_CAP_USER_MEMORY from libkvm.c.Glauber Costa1-18/+0
One of them is left, which is the initial check. Code that does ioctl checking is left to be removed in a future commit. Signed-off-by: Glauber Costa <glommer@redhat.com> Signed-off-by: Avi Kivity <avi@qumranet.com>
2008-09-11kvm: libkvm: start removing kernel memory functionsGlauber Costa6-161/+5
kvm_arch_create_default_phys_mem and kvm_alloc_kernel_memory are legacy. Remove them, and their callers. The whole removal will be split for bisectability. These ones goes first because they are only called at initialization Signed-off-by: Glauber Costa <glommer@redhat.com> Signed-off-by: Avi Kivity <avi@qumranet.com>
2008-08-31kvm: libkvm: Call kvm_show_regs() on failed vmentryMohammed Gamal1-0/+1
Call kvm_show_regs() on failed vmentry Signed-off-by: Mohammed Gamal <m.gamal005@gmail.com> Signed-off-by: Avi Kivity <avi@qumranet.com>
2008-08-25kvm: libkvm: add kvm_has_sync_mmuAnthony Liguori2-0/+11
This patch adds a kvm_has_sync_mmu routine to libkvm. This allows userspace to query the existence of mmu notifiers which is important for ballooning since madvise() is not safe from userspace without it. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com> Signed-off-by: Avi Kivity <avi@qumranet.com>
2008-08-25kvm: libkvm: fix indentationAmit Shah1-1/+1
Fix indentation style in libkvm.c to match the rest of the file. Signed-off-by: Amit Shah <amit.shah@qumranet.com> Signed-off-by: Avi Kivity <avi@qumranet.com>
2008-07-19kvm: libkvm: s390 portCarsten Otte7-1/+214
Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com> Signed-off-by: Avi Kivity <avi@qumranet.com>
2008-06-18kvm: libkvm: export init for coalesced MMIO supportCarlo Marcelo Arenas Belon1-0/+9
complement 2680f3df932a3119880a692609943587ecc8f409 to export the definition for kvm_init_coalesced_mmio as it is used by the per arch libkvm as shown by the following warning : libkvm-x86.c: In function 'kvm_arch_create': libkvm-x86.c:182: warning: implicit declaration of function 'kvm_init_coalesced_mmio' Signed-off-by: Carlo Marcelo Arenas Belon <carenas@sajinet.com.pe> Signed-off-by: Avi Kivity <avi@qumranet.com>
2008-06-09kvm: libkvm: add API for destroying userspace physical memory slotBen-Ami Yassour1-1/+33
Signed-off-by: Ben-Ami Yassour <benami@il.ibm.com> Signed-off-by: Avi Kivity <avi@qumranet.com>
2008-06-04kvm: libkvm: coalesced support (ia64 part)Laurent Vivier2-0/+9
This patch enables coalesced MMIO for ia64 architecture. WARNING: this has not been tested. Signed-off-by: Laurent Vivier <Laurent.Vivier@bull.net> Signed-off-by: Avi Kivity <avi@qumranet.com>
2008-06-04kvm: libkvm: coalesced MMIO support (powerpc part)Laurent Vivier2-0/+13
This patch enables coalesced MMIO for powerpc architecture. WARNING: this has not been tested. Signed-off-by: Laurent Vivier <Laurent.Vivier@bull.net> Signed-off-by: Avi Kivity <avi@qumranet.com>