summaryrefslogtreecommitdiffstats
path: root/drivers
Commit message (Collapse)AuthorAgeFilesLines
* KVM: Disallow fork() and similar games when using a VMAvi Kivity2008-01-302-0/+10
| | | | | | We don't want the meaning of guest userspace changing under our feet. Signed-off-by: Avi Kivity <avi@qumranet.com>
* KVM: MMU: Rename 'release_page'Avi Kivity2008-01-301-4/+4
| | | | | | Rename the awkwardly named variable. Signed-off-by: Avi Kivity <avi@qumranet.com>
* KVM: MMU: Rename variables of type 'struct kvm_mmu_page *'Avi Kivity2008-01-301-154/+146
| | | | | | | | These are traditionally named 'page', but even more traditionally, that name is reserved for variables that point to a 'struct page'. Rename them to 'sp' (for "shadow page"). Signed-off-by: Avi Kivity <avi@qumranet.com>
* KVM: Remove gpa_to_hpa()Avi Kivity2008-01-302-19/+3
| | | | | | Converting last uses along the way. Signed-off-by: Avi Kivity <avi@qumranet.com>
* KVM: MMU: Remove gva_to_hpa()Avi Kivity2008-01-302-10/+0
| | | | | | No longer used. Signed-off-by: Avi Kivity <avi@qumranet.com>
* KVM: MMU: Simplify nonpaging_map()Avi Kivity2008-01-301-14/+10
| | | | | | Instead of passing an hpa, pass a regular struct page. Signed-off-by: Avi Kivity <avi@qumranet.com>
* KVM: MMU: Introduce gfn_to_gpa()Avi Kivity2008-01-302-2/+6
| | | | | | | | 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: MMU: Adjust page_header_update_slot() to accept a gfn instead of a gpaAvi Kivity2008-01-302-5/+5
| | | | Signed-off-by: Avi Kivity <avi@qumranet.com>
* KVM: MMU: Merge set_pte() and set_pte_common()Avi Kivity2008-01-301-20/+6
| | | | | | | Since set_pte() is now the only caller of set_pte_common(), merge the two functions. Signed-off-by: Avi Kivity <avi@qumranet.com>
* KVM: MMU: Remove set_pde()Avi Kivity2008-01-301-21/+4
| | | | | | It is now identical to set_pte(). Signed-off-by: Avi Kivity <avi@qumranet.com>
* KVM: MMU: Remove extra gaddr parameter from set_pte_common()Avi Kivity2008-01-302-20/+10
| | | | | | Similar information is available in the gfn parameter, so use that. Signed-off-by: Avi Kivity <avi@qumranet.com>
* KVM: MMU: Move pse36 handling to the guest walkerAvi Kivity2008-01-302-3/+9
| | | | Signed-off-by: Avi Kivity <avi@qumranet.com>
* KVM: MMU: Introduce and use gpte_to_gfn()Avi Kivity2008-01-301-8/+20
| | | | | | Instead of repretitively open-coding this. Signed-off-by: Avi Kivity <avi@qumranet.com>
* KVM: MMU: Code cleanupIzik Eidus2008-01-301-10/+10
| | | | | Signed-off-by: Izik Eidus <izike@qumranet.com> Signed-off-by: Avi Kivity <avi@qumranet.com>
* KVM: Don't bother the mmu if cr3 load doesn't change cr3Avi Kivity2008-01-303-1/+27
| | | | | | | If the guest requests just a tlb flush, don't take the vm lock and drop the mmu context pointlessly. Signed-off-by: Avi Kivity <avi@qumranet.com>
* KVM: MMU: Avoid unnecessary remote tlb flushes when guest updates a pteAvi Kivity2008-01-301-1/+26
| | | | | | | | If all we're doing is increasing permissions on a pte (typical for demand paging), then there's not need to flush remote tlbs. Worst case they'll get a spurious page fault. Signed-off-by: Avi Kivity <avi@qumranet.com>
* KVM: Add statistic for remote tlb flushesAvi Kivity2008-01-303-0/+5
| | | | Signed-off-by: Avi Kivity <avi@qumranet.com>
* KVM: MMU: Implement guest page fault bypass for nonpaeAvi Kivity2008-01-301-3/+6
| | | | | | | | I spent an hour worrying why I see so many guest page faults on FC6 i386. Turns out bypass wasn't implemented for nonpae. Implement it so it doesn't happen again. Signed-off-by: Avi Kivity <avi@qumranet.com>
* KVM: Split vcpu creation to avoid vcpu_load() before preemption setupAvi Kivity2008-01-303-9/+12
| | | | | | | | 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-303-33/+60
| | | | | | | | 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: Recalculate mmu pages needed for every memory region changeZhang Xiantao2008-01-303-17/+24
| | | | | | | | Instead of incrementally changing the mmu cache size for every memory slot operation, recalculate it from scratch. This is simpler and safer. Signed-off-by: Zhang Xiantao <xiantao.zhang@intel.com> Signed-off-by: Avi Kivity <avi@qumranet.com>
* KVM: x86 emulator: prefetch up to 15 bytes of the instruction executedAvi Kivity2008-01-302-2/+43
| | | | | | | Instead of fetching one byte at a time, prefetch 15 bytes (or until the next page boundary) to avoid guest page table walks. Signed-off-by: Avi Kivity <avi@qumranet.com>
* KVM: x86 emulator: retire ->write_std()Avi Kivity2008-01-302-21/+0
| | | | | | | | Theoretically used to acccess memory known to be ordinary RAM, it was never implemented. It is questionable whether it is possible to implement it correctly. Signed-off-by: Avi Kivity <avi@qumranet.com>
* KVM: MMU: Selectively set PageDirty when releasing guest memoryIzik Eidus2008-01-305-19/+33
| | | | | | | | | 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: MMU: Fix potential memory leak with smp real-modeIzik Eidus2008-01-301-1/+3
| | | | | | | | When we map a page, we check whether some other vcpu mapped it for us and if so, bail out. But we should decrease the refcount on the page as we do so. 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-303-3/+3
| | | | | 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: MMU: Remove unused variableAvi Kivity2008-01-301-1/+0
| | | | Signed-off-by: Avi Kivity <avi@qumranet.com>
* KVM: Simplify kvm_clear_guest_page()Izik Eidus2008-01-301-16/+2
| | | | | | | | 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-301-19/+5
| | | | | | | 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-301-1/+2
| | | | | | | | | 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-302-84/+84
| | | | | 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-302-109/+110
| | | | | 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-302-35/+35
| | | | | 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-302-69/+67
| | | | | 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-302-33/+33
| | | | | 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-302-13/+19
| | | | | | | 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-303-15/+40
| | | | | | | | 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-303-2/+1
| | | | | | | | | | | 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-303-1/+20
| | | | Signed-off-by: Avi Kivity <avi@qumranet.com>
* KVM: Extend stats support for VM statsAvi Kivity2008-01-303-24/+55
| | | | | | 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-302-0/+6
|
* KVM: Add fpu_reload counterAvi Kivity2008-01-302-0/+3
| | | | | | 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-304-5/+5
| | | | | | | | 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-303-36/+57
| | | | | | | | 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-302-2/+2
| | | | | | | 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-303-3/+4
| | | | | | | 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-303-23/+26
| | | | | | | 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-301-73/+73
| | | | | | | | 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>
OpenPOWER on IntegriCloud