summaryrefslogtreecommitdiff
path: root/libkvm
AgeCommit message (Collapse)AuthorFilesLines
2008-06-04kvm: libkvm: coalesced MMIO support (x86 part)Laurent Vivier2-0/+6
This patch enables coalesced MMIO for x86 architecture. Signed-off-by: Laurent Vivier <Laurent.Vivier@bull.net> Signed-off-by: Avi Kivity <avi@qumranet.com>
2008-06-04kvm: libkvm: coalesced MMIO support (common part)Laurent Vivier3-0/+81
This patch introduces in libkvm the common part of coalesced MMIO interface. It checks the coalesced MMIO availability with ioctl(KVM_CHECK_EXTENSION). If KVM_CAP_COALESCED_MMIO is available, it processes the MMIO ring buffer at the return of ioctl(KVM_RUN). It defines kvm_register_coalesced_mmio() to register a coalesced MMIO zone, and kvm_unregister_coalesced_mmio() to unregister it. Signed-off-by: Laurent Vivier <Laurent.Vivier@bull.net> Signed-off-by: Avi Kivity <avi@qumranet.com>
2008-05-21kvm: qemu: fix compilation w/out KVM_CAP_MP_STATEChris Wright1-0/+9
Add kvm_reset_mpstate inline function and only call it when KVM_CAP_MP_STATE is defined. qemu/qemu-kvm-x86.c:677: error: unknown field `mp_state' specified in initializer qemu/qemu-kvm-x86.c:677: error: `KVM_MP_STATE_UNINITIALIZED' undeclared (first use in this function) ... Signed-off-by: Chris Wright <chrisw@sous-sol.org> Signed-off-by: Avi Kivity <avi@qumranet.com>
2008-05-04kvm: qemu: ppc: Update GPR type to match kernel interface changesHollis Blanchard1-4/+9
Signed-off-by: Hollis Blanchard <hollisb@us.ibm.com> Signed-off-by: Avi Kivity <avi@qumranet.com>
2008-05-02kvm: libkvm: remove kvm->physical_memoryAvi Kivity2-6/+0
As guest memory can be discontiguous, kvm->physical_memory is meaningless. Luckily it is no longer used, so we can remove it. Signed-off-by: Avi Kivity <avi@qumranet.com>
2008-05-02kvm: libkvm: kvm_show_code() for ROM codeJan Kiszka1-11/+12
Userland-located memory is not unconditionally available via kvm->physical_memory + guest_address. To let kvm_show_code also dump useful information when, e.g., some problem in ROM (BIOS...) occurs, this patch tries to obtain the memory content via the mmio_read callback. If the callback fails, the code byte is marked as invalid. This patch also removes the check for protected mode and dumps the code in any case - I didn't find the reason for this restriction. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Avi Kivity <avi@qumranet.com>
2008-04-30kvm: libkvm: dump all errors to stderrJan Kiszka2-4/+4
Minor cleanup I came across while reverting printf instrumentations. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Avi Kivity <avi@qumranet.com>
2008-04-27kvm: configure: have libkvm use the sanitized header directoryAvi Kivity1-3/+3
Otherwise, it picks up a random kernel directory and misbuilds. Signed-off-by: Avi Kivity <avi@qumranet.com>
2008-04-27kvm: configure: Remove test suite config.mak from libkvm buildJerone Young1-1/+0
This is a relic of the big userspace refactoring, but today libkvm does should not include settings from the test suite. This patch resolves this and removes the overwriting of setting from the main config.mak with test suite settings. Signed-off-by: Jerone Young <jyoung5@us.ibm.com> Signed-off-by: Avi Kivity <avi@qumranet.com>
2008-04-27kvm: libkvm: initialize no_pit_creationMarcelo Tosatti1-0/+1
Valgrind caught this: ==11754== Conditional jump or move depends on uninitialised value(s) ==11754== at 0x50C9BC: kvm_create_pit (libkvm-x86.c:153) ==11754== by 0x50CA7F: kvm_arch_create (libkvm-x86.c:178) ==11754== by 0x50AB31: kvm_create (libkvm.c:383) ==11754== by 0x4EE691: kvm_qemu_create_context (qemu-kvm.c:616) ==11754== by 0x412031: main (vl.c:9653) Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com> Signed-off-by: Avi Kivity <avi@qumranet.com>
2008-04-15kvm: libkvm: remove declarations of kvm_*_pit() on non-x86Jerone Young1-0/+2
These do not have a PIT. Signed-off-by: Hollis Blanchard <hollisb@us.ibm.com> Signed-off-by: Jerone Young <jyoung5@us.ibm.com> Signed-off-by: Avi Kivity <avi@qumranet.com>
2008-04-13kvm: libkvm: Add libkvm interface to get/set the mpstate.Marcelo Tosatti2-0/+38
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com> Signed-off-by: Avi Kivity <avi@qumranet.com>
2008-04-03kvm: qemu: separate thread for IO handlingMarcelo Tosatti1-3/+0
Move IO processing from vcpu0 to a dedicated thread. This removes load on vcpu0 by allowing better cache locality and also improves latency. Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com> Signed-off-by: Avi Kivity <avi@qumranet.com>
2008-03-28kvm: libkvm: export kvm_disable_pit_creation to support -no-kvm-pitCarlo Marcelo Arenas Belon1-0/+10
qemu/qemu-kvm.c: In function `kvm_qemu_create_context': qemu/qemu-kvm.c:549: warning: implicit declaration of function `kvm_disable_pit_creation' Signed-off-by: Carlo Marcelo Arenas Belon <carenas@sajinet.com.pe> Signed-off-by: Avi Kivity <avi@qumranet.com>
2008-03-16kvm: libkvm: Move kvm_get_pit() to libkvm.c common codeJerone Young3-9/+12
This fixes compilation issues for PowerPC and other non x86 archs that do not have in kernel pit. The pit code is added into the kvm_context in kvm-common.h and the error causing the issue is coming from a definition in qemu. This seems to be the proper fix as there is also a common function: kvm_irqchip_in_kernel for in kernel irq that handles this the same way. Signed-off-by: Jerone Young <jyoung5@us.ibm.com> Signed-off-by: Avi Kivity <avi@qumranet.com>
2008-03-07kvm: libkvm: Add interface for PIT save/restore supportingSheng Yang2-0/+56
Signed-off-by: Sheng Yang <sheng.yang@intel.com> Signed-off-by: Avi Kivity <avi@qumranet.com>
2008-03-07kvm: qemu: Add option for enable/disable in kernel PITSheng Yang1-0/+9
Signed-off-by: Sheng Yang <sheng.yang@intel.com> Signed-off-by: Avi Kivity <avi@qumranet.com>
2008-03-07kvm: libkvm: Add Support for in-kernel PIT modelSheng Yang3-0/+34
Signed-off-by: Sheng Yang <sheng.yang@intel.com> Signed-off-by: Avi Kivity <avi@qumranet.com>
2008-02-24kvm: libkvm: avoid losing errno if post_kvm_run() calls libcAvi Kivity1-2/+5
Signed-off-by: Avi Kivity <avi@qumranet.com>
2008-02-24kvm: qemu: Allow kvm to use more than 4 VCPUsAnthony Liguori1-1/+1
This patch actually allows KVM to be used with more than 4 VCPUs. The change in qemu-kvm.c was pretty difficult to find because it was using an open coded array size of 4. I changed that array to be 256 since that's the real maximum on x86 and the additional storage space is a pretty trivial cost. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> Signed-off-by: Avi Kivity <avi@qumranet.com>
2008-02-21kvm: qemu: fix kvm_create_memory_aliasUri Lublin2-6/+43
There was a mix up between memory-slots and alias-slots. There was a high probability that two independent aliases will override one another. Fixed by keeping the alias slots separate from the memory slots, and by removing phys_addr from parameter list. Signed-off-by: Uri Lublin <uril@qumranet.com> Signed-off-by: Avi Kivity <avi@qumranet.com>
2008-02-11kvm: libkvm: don't sign-extend userspace addressesAvi Kivity1-1/+1
this breaks 32-bit host userspace on 64-bit host kernels. Signed-off-by: Avi Kivity <avi@qumranet.com>
2008-01-28kvm: libkvm: add vcpu to arguments of powerpc libkvm callbacksJerone Young2-6/+8
This patch adds vcpu as an argmunent for powerpc specific callbacks: powerpc_dcr_read powerpc_dcr_write Signed-off-by: Jerone Young <jyoung5@us.ibm.com> Signed-off-by: Avi Kivity <avi@qumranet.com>
2008-01-20kvm: libkvm: add more regs to kvm_show_regs for powerpcChristian Ehrhardt1-0/+4
This adds some registers useful for guest debugging to the powerpc code for kvm_show_regs in libkvm. Signed-off-by: Christian Ehrhardt <ehrhardt@linux.vnet.ibm.com> Signed-off-by: Avi Kivity <avi@qumranet.com>
2008-01-15kvm: libkvm/qemu: ppc: fill kvm_callback with dcr_read/dcr_write callbacksChristian Ehrhardt2-6/+6
This patch adds the callback assignment and handlers for powerpc_dcr_read and ppc_dcr_write which are called from libkvm. This is the part of the patch that changes already submitted code. Signed-off-by: Christian Ehrhardt <ehrhardt@linux.vnet.ibm.com> Signed-off-by: Avi Kivity <avi@qumranet.com>
2008-01-09kvm: libkvm: Add function kvm_create_kernel_phys_mem to libkvm-powerpc.cJerone Young1-0/+7
Function kvm_create_kernel_phys_mem was missing from powerpc causing a undefined definition when linking to libkvm when compiled for powerpc. Signed-off-by: Jerone Young <jyoung5@us.ibm.com> Acked-by: Hollis Blanchard <hollisb@us.ibm.com> Signed-off-by: Avi Kivity <avi@qumranet.com>
2008-01-09Revert "kvm: configure: allow building against pristine kernel source directory"Avi Kivity1-2/+2
This reverts commit 86d1a737fc444373f94d465fbc7d0aa5f712c068, which causes build failures. Signed-off-by: Avi Kivity <avi@qumranet.com>
2008-01-08kvm: configure: allow building against pristine kernel source directoryHollis Blanchard1-2/+2
Create an "asm" symlink from libkvm into the kernel source directory. This allows one to use kernel trees built with the O= option. Signed-off-by: Hollis Blanchard <hollisb@us.ibm.com> Signed-off-by: Avi Kivity <avi@qumranet.com>
2008-01-08kvm: qemu: phys_mem_bitmap: remove obsolete unused functionsUri Lublin1-51/+0
Obsoleted by ca3d8e095246e848a5ecd7600ff84106335b19e4. Signed-off-by: Uri Lublin <uril@qumranet.com> Signed-off-by: Avi Kivity <avi@qumranet.com>
2008-01-03kvm: libkcm: fix up kvm-powerpc.h in libkvmJerone Young1-3/+9
This patch fixes up kvm-powerpc.h. Adds proper preamble and use kvm_page_size as opposed to defining the pages size. Signed-off-by: Jerone Young <jyoung5@us.ibm.com> Signed-off-by: Avi Kivity <avi@qumranet.com>
2008-01-03kvm: libkvm: add powerpc libkvm support codeJerone Young2-3/+74
While the kernel code has not yet made it upstream, after seeing the skeleton patches making it in over the holiday, I decided to send this since it's for the most part stable with what we are hacking away with in kernel. Signed-off-by: Jerone Young <jyoung5@us.ibm.com> Signed-off-by: Avi Kivity <avi@qumranet.com>
2007-12-30kvm: libkvm: fix mungled default case for switch in kvm_arch_runCarlo Marcelo Arenas Belon1-1/+2
This patch corrects 03f1b5e137e7e4c8dd51dbaea6779be853f4fde0, that modified the logic behind kvm_arch_run because of a mangled endif which accidentally included the default entry for the switch. kvm_arch_run as defined in 4f19bdea03330641fd48514ea84d1ed1bf431507 was affected by returning 0 by default instead of 1 and reporting the following warning at compile time : libkvm-x86.c:201:9: warning: extra tokens at end of #endif directive Signed-off-by: Carlo Marcelo Arenas Belon <carenas@sajinet.com.pe> Signed-off-by: Avi Kivity <avi@qumranet.com>
2007-12-26kvm: libkvm: support for tpr access reportingAvi Kivity3-1/+119
this adds support for enabling and disabling the tpr access reporting facility, as well as a callback that is triggered whenever the tpr is accessed. Signed-off-by: Avi Kivity <avi@qumranet.com>
2007-12-19kvm: libkvm: initial skeleton for libkvm powerpc supportJerone Young4-0/+67
This patch is to add initial skelton code for powerpc. No big implimentations as kernel code is still being worked out. But it can be a good template for other architectures. Once kernel code makes it upstream (and is for the most part finalized) then implimentaions will follow. Signed-off-by: Jerone Young <jyoung5@us.ibm.com> Signed-off-by: Avi Kivity <avi@qumranet.com>
2007-12-19kvm: libkvm: simplify mmio callbackChristian Ehrhardt2-51/+14
Merging the read[bwlq]/write[bwlq] callback callback pointers to mmio_read/write functions simplifies the callback interface. On the qemu side it now uses the cpu_physical_memory_rw function. Additionally this patch merges the RedHat 7.1 mmio workaround that was spread to two code locations. qemu/ and user/ also updated. Signed-off-by: Christian Ehrhardt <ehrhardt@linux.vnet.ibm.com> Signed-off-by: Avi Kivity <avi@qumranet.com>
2007-12-18kvm: libkvm: fix NULL pointer dereference in kvm_destroy_phys_mem()Carlo Marcelo Arenas Belon1-4/+3
The following patch eliminates the uninitialized mem pointer, using instead the corresponding entry from the slots array to fix : libkvm.c:580: warning: 'mem' is used uninitialized in this function Also changes the formatting type for phys_addr to long to prevent : libkvm.c:581: warning: format '%llx' expects type 'long long unsigned int' , but argument 5 has type 'long unsigned int' Signed-off-by: Carlo Marcelo Arenas Belon <carenas@sajinet.com.pe> Signed-off-by: Avi Kivity <avi@qumranet.com>
2007-12-18kvm: libkvm: get_slot(): fix is-address-in-range checkUri Lublin1-1/+1
For any slot the slot's allowed addresses are from start to (start+size-1). The address start+size is outside of the slot's address range. This fixes migration for 32 bit hosts. One of the slots (the bios) is mapped at the top of the address space and its start+size is 0. For that slot get_slot() failed. Signed-off-by: Uri Lublin <uril@qumranet.com> Signed-off-by: Avi Kivity <avi@qumranet.com>
2007-12-11kvm: libkvm/qemu: get exist-page-bitmap based on address range not slotUri Lublin2-0/+27
Same as with dirty-page-bitmap. Signed-off-by: Izik Eidus <izike@qumranet.com> Signed-off-by: Avi Kivity <avi@qumranet.com>
2007-12-11kvm: libkvm/qemu: get dirty-page-bitmap based on address range not slotUri Lublin2-1/+30
Since c79baa60813812e8d0e34d998d609e848c093000 qemu does not know about slots, it uses addresses. Getting the dirty-page-bitmap needs to adapt to that change. The user (qemu) requests (from libkvm) dirty page log for all pages within a specific address range (specifically [0,phys_ram_size-1]). libkvm iterates through all slots in the address range, calling a qemu-kvm callback to update qemu's bytemap for each slot within the requested range. Signed-off-by: Izik Eidus <izike@qumranet.com> Signed-off-by: Uri Lublin <uril@qumranet.com> Signed-off-by: Avi Kivity <avi@qumranet.com>
2007-12-11kvm: libkvm: deleted old mem_regions[] from kvm_contextUri Lublin2-5/+1
Replaced mem_regions[] usage with newer slots[]. Signed-off-by: Uri Lublin <uril@qumranet.com> Signed-off-by: Avi Kivity <avi@qumranet.com>
2007-12-11kvm: libkvm: save slot's flagsUri Lublin3-10/+19
In order to be able to turn dirty page logging on/off. Signed-off-by: Uri Lublin <uril@qumranet.com> Signed-off-by: Avi Kivity <avi@qumranet.com>
2007-12-11kvm: libkvm: Add two kernel memory allocation interfacesZhang Xiantao1-0/+12
Add two kernel memory allocation interfaces, although it is not required for ia64. Just leave it as blank for compile pass. Signed-off-by: Zhang Xiantao <xiantao.zhang@intel.com> Signed-off-by: Avi Kivity <avi@qumranet.com>
2007-12-05kvm: libkvm: remove kvm abi 10 headerAvi Kivity1-59/+0
Signed-off-by: Avi Kivity <avi@qumranet.com>
2007-12-04kvm: libkvm: remove abi 10 compatibilityAvi Kivity3-200/+1
Signed-off-by: Avi Kivity <avi@qumranet.com>
2007-12-04kvm: libkvm: make declaration of kvm_set&get_cr8 declaration x86 specificZhang Xiantao1-23/+23
Placing the declaration of kvm_set&get_cr8 declaration under the constraints of x86. Signed-off-by: Zhang Xiantao <xiantao.zhang@intel.com> Signed-off-by: Avi Kivity <avi@qumranet.com>
2007-12-04kvm: libkvm: Moving set and get shadow pages to x86 arch.Zhang Xiantao3-51/+49
Move kvm_{set,get}_shadow_pages to arch-x86 for libkvm Signed-off-by: Zhang Xiantao <xiantao.zhang@intel.com> Signed-off-by: Avi Kivity <avi@qumranet.com>
2007-12-04kvm: libkvm: Add kvm-ia64.h.Zhang Xiantao2-0/+34
This patch adds kvm-ia64.h, and use getpagesize to get host page size, since ia64 can use multiple type of page size in kernel. Signed-off-by: Zhang Xiantao <xiantao.zhang@intel.com> Signed-off-by: Avi Kivity <avi@qumranet.com>
2007-12-04kvm: libkvm: add libkvm-ia64.c, required by ia64 arch compile.Zhang Xiantao2-0/+87
Signed-off-by: Zhang Xiantao <xiantao.zhang@intel.com> Signed-off-by: Avi Kivity <avi@qumranet.com>
2007-12-02kvm: libkvm: fix incorrect page count calculation when enabling dirty loggingIzik Eidus1-1/+1
(found by me and Uri Lublin) Signed-off-by: Izik Eidus <izike@qumranet.com> Signed-off-by: Avi Kivity <avi@qumranet.com>
2007-11-26kvm: libkvm: add ifdefs to libkvm.h to pervent warnings for other archsJerone Young1-0/+4
This patch adds ifdefs around x86 specific functions to pervent compilers warnings for other archs. Signed-off-by: Jerone Young <jyoung5@us.ibm.com> Signed-off-by: Avi Kivity <avi@qumranet.com>