aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/kvm/kvm.h
Commit message (Collapse)AuthorAgeFilesLines
* KVM: Move arch dependent files to new directory arch/x86/kvm/Avi Kivity2008-01-301-289/+0
| | | | | | | This paves the way for multiple architecture support. Note that while ioapic.c could potentially be shared with ia64, it is also moved. Signed-off-by: Avi Kivity <avi@qumranet.com>
* KVM: Portability: Move kvm_vm_stat to x86.hZhang Xiantao2008-01-301-10/+0
| | | | | | | | | This patch moves kvm_vm_stat to x86.h, and every arch can define its own kvm_vm_stat in $arch.h 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 round_robin_prev_vcpu and tss_addr to kvm_archZhang Xiantao2008-01-301-3/+0
| | | | | | | | This patches moves two fields round_robin_prev_vcpu and tss to kvm_arch. 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 vpic and vioapic to kvm_archZhang Xiantao2008-01-301-2/+0
| | | | | | | | This patches moves two fields vpid and vioapic to kvm_arch 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 mmu-related fields to kvm_archZhang Xiantao2008-01-301-8/+0
| | | | | | | | This patches moves mmu-related fields to kvm_arch. 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 memslot aliases to new struct kvm_archZhang Xiantao2008-01-301-9/+1
| | | | | | | | | This patches create kvm_arch to hold arch-specific kvm fileds and moves fields naliases and aliases to kvm_arch. 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 kvm_vcpu_stat to x86.hZhang Xiantao2008-01-301-22/+0
| | | | | | | | | This patches moves kvm_vcpu_stat to x86.h, so every arch can define its own kvm_vcpu_stat structure. 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: Expand the KVM_VCPU_COMM in kvm_vcpu structure.Zhang Xiantao2008-01-301-31/+22
| | | | | | | | | This patches removes KVM_COMM macro, original it is hold kvm_vcpu common fields. 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 kvm_vcpu definition back to kvm.hZhang Xiantao2008-01-301-105/+8
| | | | | | | | | This patches moves kvm_vcpu definition to kvm.h, and finally kvm.h includes x86.h. 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: Split mmu-related static inline functions to mmu.hZhang Xiantao2008-01-301-0/+1
| | | | | | | | | Since these functions need to know the details of kvm or kvm_vcpu structure, it can't be put in x86.h. Create mmu.h to hold them. 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 kvm{pic,ioapic} accesors to x86 specific codeZhang Xiantao2008-01-301-15/+3
| | | | | Signed-off-by: Zhang Xiantao <xiantao.zhang@intel.com> Signed-off-by: Avi Kivity <avi@qumranet.com>
* KVM: MMU: Fix inherited permissions for emulated guest pte updatesAvi Kivity2008-01-301-2/+2
| | | | | | | | When we emulate a guest pte write, we fail to apply the correct inherited permissions from the parent ptes. Now that we store inherited permissions in the shadow page, we can use that to update the pte permissions correctly. Signed-off-by: Avi Kivity <avi@qumranet.com>
* KVM: Portability: Stop including x86-specific headers in kvm_main.cHollis Blanchard2008-01-301-5/+4
| | | | | Signed-off-by: Hollis Blanchard <hollisb@us.ibm.com> Signed-off-by: Avi Kivity <avi@qumranet.com>
* KVM: Portability: Move IO device definitions to its own header fileHollis Blanchard2008-01-301-42/+0
| | | | | | Signed-off-by: Hollis Blanchard <hollisb@us.ibm.com> Acked-by: Carsten Otte <cotte@de.ibm.com> Signed-off-by: Avi Kivity <avi@qumranet.com>
* KVM: Portability: Move address types to their own header fileHollis Blanchard2008-01-301-19/+2
| | | | | | Signed-off-by: Hollis Blanchard <hollisb@us.ibm.com> Acked-by: Carsten Otte <cotte@de.ibm.com> Signed-off-by: Avi Kivity <avi@qumranet.com>
* KVM: Disallow fork() and similar games when using a VMAvi Kivity2008-01-301-0/+1
| | | | | | We don't want the meaning of guest userspace changing under our feet. Signed-off-by: Avi Kivity <avi@qumranet.com>
* KVM: Remove gpa_to_hpa()Avi Kivity2008-01-301-1/+0
| | | | | | Converting last uses along the way. Signed-off-by: Avi Kivity <avi@qumranet.com>
* KVM: MMU: Remove gva_to_hpa()Avi Kivity2008-01-301-1/+0
| | | | | | No longer used. Signed-off-by: Avi Kivity <avi@qumranet.com>
* KVM: MMU: Introduce gfn_to_gpa()Avi Kivity2008-01-301-0/+4
| | | | | | | | Converting a frame number to an address is tricky since the data type changes size. Introduce a function to do it. This fixes an actual bug when accessing guest ptes. Signed-off-by: Avi Kivity <avi@qumranet.com>
* KVM: Add statistic for remote tlb flushesAvi Kivity2008-01-301-0/+1
| | | | Signed-off-by: Avi Kivity <avi@qumranet.com>
* KVM: Split vcpu creation to avoid vcpu_load() before preemption setupAvi Kivity2008-01-301-0/+1
| | | | | | | | Split kvm_arch_vcpu_create() into kvm_arch_vcpu_create() and kvm_arch_vcpu_setup(), enabling preemption notification between the two. This mean that we can now do vcpu_load() within kvm_arch_vcpu_setup(). Signed-off-by: Avi Kivity <avi@qumranet.com>
* KVM: Portability: Split kvm_set_memory_region() to have an arch calloutZhang Xiantao2008-01-301-0/+4
| | | | | | | | Moving !user_alloc case to kvm_arch to avoid unnecessary code logic in non-x86 platform. Signed-off-by: Zhang Xiantao <xiantao.zhang@intel.com> Signed-off-by: Avi Kivity <avi@qumranet.com>
* KVM: MMU: Selectively set PageDirty when releasing guest memoryIzik Eidus2008-01-301-1/+2
| | | | | | | | | Improve dirty bit setting for pages that kvm release, until now every page that we released we marked dirty, from now only pages that have potential to get dirty we mark dirty. Signed-off-by: Izik Eidus <izike@qumranet.com> Signed-off-by: Avi Kivity <avi@qumranet.com>
* KVM: Move misplaced commentHollis Blanchard2008-01-301-4/+4
| | | | | 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-301-1/+1
| | | | | 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-301-1/+0
| | | | | Signed-off-by: Hollis Blanchard <hollisb@us.ibm.com> Signed-off-by: Avi Kivity <avi@qumranet.com>
* KVM: Portability: Move some function declarations to x86.hZhang Xiantao2008-01-301-84/+0
| | | | | 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-301-109/+0
| | | | | 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-301-35/+0
| | | | | 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-301-69/+0
| | | | | 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-301-33/+0
| | | | | 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-301-0/+5
| | | | | | | | 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: MMU: Add some mmu statisticsAvi Kivity2008-01-301-0/+6
| | | | Signed-off-by: Avi Kivity <avi@qumranet.com>
* KVM: Extend stats support for VM statsAvi Kivity2008-01-301-2/+12
| | | | | | 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-301-0/+2
|
* KVM: Add fpu_reload counterAvi Kivity2008-01-301-0/+1
| | | | | | 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-301-1/+1
| | | | | | | | 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-301-0/+4
| | | | | | | | 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 ptr comparisons to 0Joe Perches2008-01-301-1/+1
| | | | | | | 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-301-0/+3
| | | | | | | 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: Portability: move KVM_CHECK_EXTENSIONZhang Xiantao2008-01-301-0/+3
| | | | | | | | | 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: Portability: Move x86 specific code from kvm_init() to kvm_arch()Zhang Xiantao2008-01-301-2/+3
| | | | | | 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-301-2/+2
| | | | | | | | 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-301-0/+19
| | | | | | | | | | | | | | | | | | | | | | 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: add kvm_is_error_hva()Izik Eidus2008-01-301-0/+1
| | | | | | | | 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: Portability: Move x86 vcpu ioctl handlers to x86.cHollis Blanchard2008-01-301-0/+10
| | | | | Signed-off-by: Hollis Blanchard <hollisb@us.ibm.com> Signed-off-by: Avi Kivity <avi@qumranet.com>
* KVM: Portability: Move x86 FPU handling to x86.cHollis Blanchard2008-01-301-0/+3
| | | | | Signed-off-by: Hollis Blanchard <hollisb@us.ibm.com> Signed-off-by: Avi Kivity <avi@qumranet.com>
* KVM: Portability: Move x86 instruction emulation code to x86.cHollis Blanchard2008-01-301-0/+1
| | | | | Signed-off-by: Hollis Blanchard <hollisb@us.ibm.com> Signed-off-by: Avi Kivity <avi@qumranet.com>
* KVM: Portability: Make exported debugfs data architecture-specificHollis Blanchard2008-01-301-0/+7
| | | | | Signed-off-by: Hollis Blanchard <hollisb@us.ibm.com> Signed-off-by: Avi Kivity <avi@qumranet.com>
* KVM: VMX: Enable memory mapped TPR shadow (FlexPriority)Sheng Yang2008-01-301-0/+4
| | | | | | | | | | This patch based on CR8/TPR patch, and enable the TPR shadow (FlexPriority) for 32bit Windows. Since TPR is accessed very frequently by 32bit Windows, especially SMP guest, with FlexPriority enabled, we saw significant performance gain. Signed-off-by: Sheng Yang <sheng.yang@intel.com> Signed-off-by: Avi Kivity <avi@qumranet.com>