aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAge
* KVM: Portability: Move cpuid structures to <asm/kvm.h>Jerone Young2008-01-30
| | | | | | | | | | | This patch moves structures: kvm_cpuid_entry kvm_cpuid from include/linux/kvm.h to include/asm-x86/kvm.h Signed-off-by: Jerone Young <jyoung5@us.ibm.com> Signed-off-by: Avi Kivity <avi@qumranet.com>
* KVM: Portability: Move kvm_sregs and msr structures to <asm/kvm.h>Jerone Young2008-01-30
| | | | | | | | | | | | Move structures: kvm_sregs kvm_msr_entry kvm_msrs kvm_msr_list from include/linux/kvm.h to include/asm-x86/kvm.h Signed-off-by: Avi Kivity <avi@qumranet.com>
* KVM: Portability: Move kvm_segment & kvm_dtable structure to <asm/kvm.h>Jerone Young2008-01-30
| | | | | | | | | | This patch moves structures: kvm_segment kvm_dtable from include/linux/kvm.h to include/asm-x86/kvm.h Signed-off-by: Jerone Young <jyoung5@us.ibm.com> Signed-off-by: Avi Kivity <avi@qumranet.com>
* KVM: Portability: Move structure lapic_state to <asm/kvm.h>Jerone Young2008-01-30
| | | | | | | | This patch moves structure lapic_state from include/linux/kvm.h to include/asm-x86/kvm.h Signed-off-by: Jerone Young <jyoung5@us.ibm.com> Signed-off-by: Avi Kivity <avi@qumranet.com>
* KVM: Portability: Move kvm_regs to <asm/kvm.h>Jerone Young2008-01-30
| | | | | | | | | This patch moves structure kvm_regs to include/asm-x86/kvm.h. Each architecture will need to create there own version of this structure. Signed-off-by: Jerone Young <jyoung5@us.ibm.com> Signed-off-by: Avi Kivity <avi@qumranet.com>
* KVM: Portability: Move x86 pic strutcturesJerone Young2008-01-30
| | | | | | | | | | | This patch moves structures: kvm_pic_state kvm_ioapic_state to inclue/asm-x86/kvm.h. Signed-off-by: Jerone Young <jyoung5@us.ibm.com> Signed-off-by: Avi Kivity <avi@qumranet.com>
* KVM: Portability: Move kvm_memory_alias to asm/kvm.hJerone Young2008-01-30
| | | | | | | | | This patch moves sturct kvm_memory_alias from include/linux/kvm.h to include/asm-x86/kvm.h. Also have include/linux/kvm.h include include/asm/kvm.h. Signed-off-by: Jerone Young <jyoung5@us.ibm.com> Signed-off-by: Avi Kivity <avi@qumranet.com>
* KVM: Move misplaced commentHollis Blanchard2008-01-30
| | | | | Signed-off-by: Hollis Blanchard <hollisb@us.ibm.com> Signed-off-by: Avi Kivity <avi@qumranet.com>
* KVM: Correct consistent typo: "destory" -> "destroy"Hollis Blanchard2008-01-30
| | | | | Signed-off-by: Hollis Blanchard <hollisb@us.ibm.com> Signed-off-by: Avi Kivity <avi@qumranet.com>
* KVM: Remove unused "rmap_overflow" variableHollis Blanchard2008-01-30
| | | | | Signed-off-by: Hollis Blanchard <hollisb@us.ibm.com> Signed-off-by: Avi Kivity <avi@qumranet.com>
* KVM: MMU: Remove unused variableAvi Kivity2008-01-30
| | | | Signed-off-by: Avi Kivity <avi@qumranet.com>
* KVM: Simplify kvm_clear_guest_page()Izik Eidus2008-01-30
| | | | | | | | Use kvm_write_guest_page() with empty_zero_page, instead of doing kmap and memset. Signed-off-by: Izik Eidus <izike@qumranet.com> Signed-off-by: Avi Kivity <avi@qumranet.com>
* KVM: MMU: Change guest pte access to kvm_{read,write}_guest()Izik Eidus2008-01-30
| | | | | | | Things are simpler and more regular this way. Signed-off-by: Izik Eidus <izike@qumranet.com> Signed-off-by: Avi Kivity <avi@qumranet.com>
* KVM: VMX: Force seg.base == (seg.sel << 4) in real modeJan Kiszka2008-01-30
| | | | | | | | | Ensure that segment.base == segment.selector << 4 when entering the real mode on Intel so that the CPU will not bark at us. This fixes some old protected mode demo from http://www.x86.org/articles/pmbasics/tspec_a1_doc.htm. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Avi Kivity <avi@qumranet.com>
* KVM: Portability: Move some function declarations to x86.hZhang Xiantao2008-01-30
| | | | | Signed-off-by: Zhang Xiantao <xiantao.zhang@intel.com> Signed-off-by: Avi Kivity <avi@qumranet.com>
* KVM: Move some static inline functions out from kvm.h into x86.hZhang Xiantao2008-01-30
| | | | | Signed-off-by: Zhang Xiantao <xiantao.zhang@intel.com> Signed-off-by: Avi Kivity <avi@qumranet.com>
* KVM: Portability: Move vcpu regs enumeration definition to x86.hZhang Xiantao2008-01-30
| | | | | Signed-off-by: Zhang Xiantao <xiantao.zhang@intel.com> Signed-off-by: Avi Kivity <avi@qumranet.com>
* KVM: Portability: Move struct kvm_x86_ops definition to x86.hZhang Xiantao2008-01-30
| | | | | Signed-off-by: Zhang Xiantao <xiantao.zhang@intel.com> Signed-off-by: Avi Kivity <avi@qumranet.com>
* KVM: Portability: Move some macro definitions from kvm.h to x86.hZhang Xiantao2008-01-30
| | | | | Signed-off-by: Zhang Xiantao <xiantao.zhang@intel.com> Signed-off-by: Avi Kivity <avi@qumranet.com>
* KVM: Portability: MMU initialization and teardown splitZhang Xiantao2008-01-30
| | | | | | | Move out kvm_mmu init and exit functionality from kvm_main.c Signed-off-by: Zhang Xiantao <xiantao.zhang@intel.com> Signed-off-by: Avi Kivity <avi@qumranet.com>
* KVM: Portability: Move kvm_vcpu_ioctl_get_dirty_log to arch-specific fileZhang Xiantao2008-01-30
| | | | | | | | Meanwhile keep the interface in common, and leave as more logic in common as possible. Signed-off-by: Zhang Xiantao <xiantao.zhang@intel.com> Signed-off-by: Avi Kivity <avi@qumranet.com>
* KVM: Make unloading of FPU state when putting vcpu arch-independentAmit Shah2008-01-30
| | | | | | | | | | | Instead of having each architecture do it individually, we do this in the arch-independent code (just x86 as of now). [avi: add svm to the mix, which was added to mainline during the 2.6.24-rc process] Signed-off-by: Amit Shah <amit.shah@qumranet.com> Signed-off-by: Avi Kivity <avi@qumranet.com>
* KVM: MMU: Add some mmu statisticsAvi Kivity2008-01-30
| | | | Signed-off-by: Avi Kivity <avi@qumranet.com>
* KVM: Extend stats support for VM statsAvi Kivity2008-01-30
| | | | | | This is in addition to the current virtual cpu statistics. Signed-off-by: Avi Kivity <avi@qumranet.com>
* KVM: Add instruction emulation statisticsAvi Kivity2008-01-30
|
* KVM: Add fpu_reload counterAvi Kivity2008-01-30
| | | | | | Measure the number of times we switch the fpu state. Signed-off-by: Avi Kivity <avi@qumranet.com>
* KVM: Replace 'light_exits' stat with 'host_state_reload'Avi Kivity2008-01-30
| | | | | | | | This is a little more accurate (since it counts actual reloads, not potential reloads), and reverses the sense of the statistic to measure a bad event like most of the other stats (e.g. we want to minimize all counters). Signed-off-by: Avi Kivity <avi@qumranet.com>
* KVM: Portability: Add two hooks to handle kvm_create and destroy vmZhang Xiantao2008-01-30
| | | | | | | | Add two arch hooks to handle kvm_create_vm and kvm destroy_vm. Now, just put io_bus init and destory in common. Signed-off-by: Zhang Xiantao <xiantao.zhang@intel.com> Signed-off-by: Avi Kivity <avi@qumranet.com>
* KVM: Remove __init attributes for kvm_init_debug and kvm_init_msr_listZhang Xiantao2008-01-30
| | | | | | | Since their callers are not declared with __init. Signed-off-by: Zhang Xiantao <xiantao.zhang@intel.com> Signed-off-by: Avi Kivity <avi@qumranet.com>
* KVM: Remove ptr comparisons to 0Joe Perches2008-01-30
| | | | | | | Fix sparse warnings "Using plain integer as NULL pointer" Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: Avi Kivity <avi@qumranet.com>
* KVM: Portability: Make kvm_vcpu_ioctl_translate arch dependentZhang Xiantao2008-01-30
| | | | | | | Move kvm_vcpu_ioctl_translate to arch, since mmu would be put under arch. Signed-off-by: Zhang Xiantao <xiantao.zhang@intel.com> Signed-off-by: Avi Kivity <avi@qumranet.com>
* KVM: VMX: Consolidate register usage in vmx_vcpu_run()Avi Kivity2008-01-30
| | | | | | | | We pass vcpu, vmx->fail, and vmx->launched to assembly code, but all three are fields within vmx. Consolidate by only passing in vmx and offsets for the rest. Signed-off-by: Avi Kivity <avi@qumranet.com>
* KVM: Portability: move KVM_CHECK_EXTENSIONZhang Xiantao2008-01-30
| | | | | | | | | Make KVM_CHECK_EXTENSION code into a function, all archs can define its capability independently. Signed-off-by: Zhang Xiantao <xiantao.zhang@intel.com> Acked-by: Carsten Otte <cotte@de.ibm.com> Signed-off-by: Avi Kivity <avi@qumranet.com>
* KVM: x86 emulator: modify 'lods', and 'stos' not to depend on CR2Sheng Yang2008-01-30
| | | | | | | | The current 'lods' and 'stos' is depending on incoming CR2 rather than decode memory address from registers. Signed-off-by: Sheng Yang <sheng.yang@intel.com> Signed-off-by: Avi Kivity <avi@qumranet.com>
* KVM: Portability: Move x86 specific code from kvm_init() to kvm_arch()Zhang Xiantao2008-01-30
| | | | | | Signed-off-by: Zhang Xiantao <xiantao.zhang@intel.com> Acked-by: Carsten Otte <cotte@de.ibm.com> Signed-off-by: Avi Kivity <avi@qumranet.com>
* KVM: Portability: Combine kvm_init and kvm_init_x86Zhang Xiantao2008-01-30
| | | | | | | | Will be called once arch module registers itself. Signed-off-by: Zhang Xiantao <xiantao.zhang@intel.com> Acked-by: Carsten Otte <cotte@de.ibm.com> Signed-off-by: Avi Kivity <avi@qumranet.com>
* KVM: Portability: Add vcpu and hardware management arch hooksZhang Xiantao2008-01-30
| | | | | | | | | | | | | | | | | | | | | | Add the following hooks: void decache_vcpus_on_cpu(int cpu); int kvm_arch_vcpu_init(struct kvm_vcpu *vcpu); void kvm_arch_vcpu_uninit(struct kvm_vcpu *vcpu); void kvm_arch_vcpu_free(struct kvm_vcpu *vcpu); void kvm_arch_vcpu_load(struct kvm_vcpu *vcpu, int cpu); void kvm_arch_vcpu_put(struct kvm_vcpu *vcpu); struct kvm_vcpu *kvm_arch_vcpu_create(struct kvm *kvm, unsigned int id); void kvm_arch_vcpu_destory(struct kvm_vcpu *vcpu); int kvm_arch_vcpu_reset(struct kvm_vcpu *vcpu); void kvm_arch_hardware_enable(void *garbage); void kvm_arch_hardware_disable(void *garbage); int kvm_arch_hardware_setup(void); void kvm_arch_hardware_unsetup(void); void kvm_arch_check_processor_compat(void *rtn); Signed-off-by: Zhang Xiantao <xiantao.zhang@intel.com> Signed-off-by: Avi Kivity <avi@qumranet.com>
* KVM: Portability: Move kvm_x86_ops to x86.cZhang Xiantao2008-01-30
| | | | | | Signed-off-by: Zhang Xiantao <xiantao.zhang@intel.com> Acked-by: Carsten Otte <cotte@de.ibm.com> Signed-off-by: Avi Kivity <avi@qumranet.com>
* KVM: Portability: Move some includes to x86.cZhang Xiantao2008-01-30
| | | | | | | | | Move some includes to x86.c from kvm_main.c, since the related functions have been moved to x86.c Signed-off-by: Zhang Xiantao <xiantao.zhang@intel.com> Acked-by: Carsten Otte <cotte@de.ibm.com> Signed-off-by: Avi Kivity <avi@qumranet.com>
* KVM: Change kvm_{read,write}_guest() to use copy_{from,to}_user()Izik Eidus2008-01-30
| | | | | | | | | This changes kvm_write_guest_page/kvm_read_guest_page to use copy_to_user/read_from_user, as a result we get better speed and better dirty bit tracking. Signed-off-by: Izik Eidus <izike@qumranet.com> Signed-off-by: Avi Kivity <avi@qumranet.com>
* KVM: introduce gfn_to_hva()Izik Eidus2008-01-30
| | | | | | | Convert a guest frame number to the corresponding host virtual address. Signed-off-by: Izik Eidus <izike@qumranet.com> Signed-off-by: Avi Kivity <avi@qumranet.com>
* KVM: add kvm_is_error_hva()Izik Eidus2008-01-30
| | | | | | | | Check for the "error hva", an address outside the user address space that signals a bad gfn. Signed-off-by: Izik Eidus <izike@qumranet.com> Signed-off-by: Avi Kivity <avi@qumranet.com>
* KVM: Simplify CPU_TASKS_FROZEN cpu notifier handlingAvi Kivity2008-01-30
| | | | Signed-off-by: Avi Kivity <avi@qumranet.com>
* KVM: x86 emulator: remove 8 bytes operands emulator for call near instructionIzik Eidus2008-01-30
| | | | | | | it is removed beacuse it isnt supported on a real host Signed-off-by: Izik Eidus <izike@qumranet.com> Signed-off-by: Avi Kivity <avi@qumranet.com>
* KVM: VMX: wbinvd exitingEddie Dong2008-01-30
| | | | | | | | | Add wbinvd VM Exit support to prepare for pass-through device cache emulation and also enhance real time responsiveness. Signed-off-by: Yaozu (Eddie) Dong <eddie.dong@intel.com> Signed-off-by: Avi Kivity <avi@qumranet.com>
* KVM: VMX: Comment VMX primary/secondary exec ctl definitionsEddie Dong2008-01-30
| | | | | | | Add comments for secondary/primary Processor-Based VM-execution controls. Signed-off-by: Yaozu (Eddie) Dong <eddie.dong@intel.com> Signed-off-by: Avi Kivity <avi@qumranet.com>
* KVM: Fix faults during injection of real-mode interruptsAvi Kivity2008-01-30
| | | | | | | | If vmx fails to inject a real-mode interrupt while fetching the interrupt redirection table, it fails to record this in the vectoring information field. So we detect this condition and do it ourselves. Signed-off-by: Avi Kivity <avi@qumranet.com>
* KVM: VMX: Read & store IDT_VECTORING_INFO_FIELDAvi Kivity2008-01-30
| | | | | | | We'll want to write to it in order to fix real-mode irq injection problems, but it is a read-only field. Storing it in a variable solves that issue. Signed-off-by: Avi Kivity <avi@qumranet.com>
* KVM: VMX: Use vmx to inject real-mode interruptsAvi Kivity2008-01-30
| | | | | | | | | | | | Instead of injecting real-mode interrupts by writing the interrupt frame into guest memory, abuse vmx by injecting a software interrupt. We need to pretend the software interrupt instruction had a length > 0, so we have to adjust rip backward. This lets us not to mess with writing guest memory, which is complex and also sleeps. Signed-off-by: Avi Kivity <avi@qumranet.com>
* KVM: Add make_page_dirty() to kvm_clear_guest_page()Dor Laor2008-01-30
| | | | | | | | Every write access to guest pages should be tracked. Signed-off-by: Dor Laor <dor.laor@qumranet.com> Signed-off-by: Izik Eidus <izike@qumranet.com> Signed-off-by: Avi Kivity <avi@qumranet.com>