aboutsummaryrefslogtreecommitdiff
path: root/arch/x86
AgeCommit message (Collapse)AuthorFilesLines
2011-01-12KVM: MMU: rename 'no_apf' to 'prefault'Xiao Guangrong3-12/+13
It's the speculative path if 'no_apf = 1' and we will specially handle this speculative path in the later patch, so 'prefault' is better to fit the sense. Signed-off-by: Xiao Guangrong <[email protected]> Signed-off-by: Avi Kivity <[email protected]>
2011-01-12KVM: SVM: Add clean-bit for LBR stateJoerg Roedel1-0/+2
This patch implements the clean-bit for all LBR related state. This includes the debugctl, br_from, br_to, last_excp_from, and last_excp_to msrs. Signed-off-by: Joerg Roedel <[email protected]> Signed-off-by: Avi Kivity <[email protected]>
2011-01-12KVM: SVM: Add clean-bit for CR2 registerJoerg Roedel1-2/+3
This patch implements the clean-bit for the cr2 register in the vmcb. Signed-off-by: Joerg Roedel <[email protected]> Signed-off-by: Avi Kivity <[email protected]>
2011-01-12KVM: SVM: Add clean-bit for Segements and CPLJoerg Roedel1-0/+2
This patch implements the clean-bit defined for the cs, ds, ss, an es segemnts and the current cpl saved in the vmcb. Signed-off-by: Joerg Roedel <[email protected]> Signed-off-by: Avi Kivity <[email protected]>
2011-01-12KVM: SVM: Add clean-bit for GDT and IDTJoerg Roedel1-0/+3
This patch implements the clean-bit for the base and limit of the gdt and idt in the vmcb. Signed-off-by: Joerg Roedel <[email protected]> Signed-off-by: Avi Kivity <[email protected]>
2011-01-12KVM: SVM: Add clean-bit for DR6 and DR7Joerg Roedel1-0/+4
This patch implements the clean-bit for the dr6 and dr7 debug registers in the vmcb. Signed-off-by: Joerg Roedel <[email protected]> Signed-off-by: Avi Kivity <[email protected]>
2011-01-12KVM: SVM: Add clean-bit for control registersJoerg Roedel1-0/+7
This patch implements the CRx clean-bit for the vmcb. This bit covers cr0, cr3, cr4, and efer. Signed-off-by: Joerg Roedel <[email protected]> Signed-off-by: Avi Kivity <[email protected]>
2011-01-12KVM: SVM: Add clean-bit for NPT stateJoerg Roedel1-0/+3
This patch implements the clean-bit for all nested paging related state in the vmcb. Signed-off-by: Joerg Roedel <[email protected]> Signed-off-by: Avi Kivity <[email protected]>
2011-01-12KVM: SVM: Add clean-bit for interrupt stateJoerg Roedel1-1/+7
This patch implements the clean-bit for all interrupt related state in the vmcb. This corresponds to vmcb offset 0x60-0x67. Signed-off-by: Joerg Roedel <[email protected]> Signed-off-by: Avi Kivity <[email protected]>
2011-01-12KVM: SVM: Add clean-bit for the ASIDJoerg Roedel1-0/+3
This patch implements the clean-bit for the asid in the vmcb. Signed-off-by: Joerg Roedel <[email protected]> Signed-off-by: Avi Kivity <[email protected]>
2011-01-12KVM: SVM: Add clean-bit for IOPM_BASE and MSRPM_BASEJoerg Roedel1-0/+1
This patch adds the clean bit for the physical addresses of the MSRPM and the IOPM. It does not need to be set in the code because the only place where these values are changed is the nested-svm vmrun and vmexit path. These functions already mark the complete VMCB as dirty. Signed-off-by: Joerg Roedel <[email protected]> Signed-off-by: Avi Kivity <[email protected]>
2011-01-12KVM: SVM: Add clean-bit for intercetps, tsc-offset and pause filter countJoerg Roedel1-0/+7
This patch adds the clean-bit for intercepts-vectors, the TSC offset and the pause-filter count to the appropriate places. The IO and MSR permission bitmaps are not subject to this bit. Signed-off-by: Joerg Roedel <[email protected]> Signed-off-by: Avi Kivity <[email protected]>
2011-01-12KVM: SVM: Add clean-bits infrastructure codeRoedel, Joerg2-1/+33
This patch adds the infrastructure for the implementation of the individual clean-bits. Signed-off-by: Joerg Roedel <[email protected]> Signed-off-by: Avi Kivity <[email protected]>
2011-01-12KVM: MMU: Avoid dropping accessed bit while removing write accessTakuya Yoshikawa1-1/+1
One more "KVM: MMU: Don't drop accessed bit while updating an spte." Sptes are accessed by both kvm and hardware. This patch uses update_spte() to fix the way of removing write access. Signed-off-by: Takuya Yoshikawa <[email protected]> Signed-off-by: Avi Kivity <[email protected]>
2011-01-12KVM: VMX: Return 0 from a failed VMREADAvi Kivity1-2/+2
If we execute VMREAD during reboot we'll just skip over it. Instead of returning garbage, return 0, which has a much smaller chance of confusing the code. Otherwise we risk a flood of debug printk()s which block the reboot process if a serial console or netconsole is enabled. Signed-off-by: Avi Kivity <[email protected]>
2011-01-12KVM: Don't spin on virt instruction faults during rebootAvi Kivity1-2/+6
Since vmx blocks INIT signals, we disable virtualization extensions during reboot. This leads to virtualization instructions faulting; we trap these faults and spin while the reboot continues. Unfortunately spinning on a non-preemptible kernel may block a task that reboot depends on; this causes the reboot to hang. Fix by skipping over the instruction and hoping for the best. Signed-off-by: Avi Kivity <[email protected]>
2011-01-12KVM: SVM: Use get_host_vmcb function in svm_get_msr for TSCJoerg Roedel1-7/+2
This patch replaces the open-coded vmcb-selection for the TSC calculation with the new get_host_vmcb helper function introduced in this patchset. Signed-off-by: Joerg Roedel <[email protected]> Signed-off-by: Marcelo Tosatti <[email protected]>
2011-01-12KVM: SVM: Add manipulation functions for misc interceptsJoerg Roedel1-33/+51
This patch wraps changes to the misc intercepts of SVM into seperate functions to abstract nested-svm better and prepare the implementation of the vmcb-clean-bits feature. Signed-off-by: Joerg Roedel <[email protected]> Signed-off-by: Marcelo Tosatti <[email protected]>
2011-01-12KVM: SVM: Add manipulation functions for exception interceptsJoerg Roedel1-29/+29
This patch wraps changes to the exception intercepts of SVM into seperate functions to abstract nested-svm better and prepare the implementation of the vmcb-clean-bits feature. Signed-off-by: Joerg Roedel <[email protected]> Signed-off-by: Marcelo Tosatti <[email protected]>
2011-01-12KVM: SVM: Add manipulation functions for DRx interceptsJoerg Roedel2-46/+61
This patch wraps changes to the DRx intercepts of SVM into seperate functions to abstract nested-svm better and prepare the implementation of the vmcb-clean-bits feature. Signed-off-by: Joerg Roedel <[email protected]> Signed-off-by: Marcelo Tosatti <[email protected]>
2011-01-12KVM: SVM: Add manipulation functions for CRx interceptsRoedel, Joerg2-62/+73
This patch wraps changes to the CRx intercepts of SVM into seperate functions to abstract nested-svm better and prepare the implementation of the vmcb-clean-bits feature. Signed-off-by: Joerg Roedel <[email protected]> Signed-off-by: Marcelo Tosatti <[email protected]>
2011-01-12KVM: SVM: Add function to recalculate intercept masksJoerg Roedel1-17/+26
This patch adds a function to recalculate the effective intercepts masks when the vcpu is in guest-mode and either the host or the guest intercept masks change. Signed-off-by: Joerg Roedel <[email protected]> Signed-off-by: Marcelo Tosatti <[email protected]>
2011-01-12KVM: X86: Don't report L2 emulation failures to user-spaceJoerg Roedel1-4/+10
This patch prevents that emulation failures which result from emulating an instruction for an L2-Guest results in being reported to userspace. Without this patch a malicious L2-Guest would be able to kill the L1 by triggering a race-condition between an vmexit and the instruction emulator. With this patch the L2 will most likely only kill itself in this situation. Signed-off-by: Joerg Roedel <[email protected]> Signed-off-by: Marcelo Tosatti <[email protected]>
2011-01-12KVM: SVM: Make Use of the generic guest-mode functionsJoerg Roedel1-23/+21
This patch replaces the is_nested logic in the SVM module with the generic notion of guest-mode. Signed-off-by: Joerg Roedel <[email protected]> Signed-off-by: Marcelo Tosatti <[email protected]>
2011-01-12KVM: X86: Introduce generic guest-mode representationJoerg Roedel2-0/+16
This patch introduces a generic representation of guest-mode fpr a vcpu. This currently only exists in the SVM code. Having this representation generic will help making the non-svm code aware of nesting when this is necessary. Signed-off-by: Joerg Roedel <[email protected]> Signed-off-by: Marcelo Tosatti <[email protected]>
2011-01-12KVM: Pull extra page fault information into struct x86_exceptionAvi Kivity6-41/+40
Currently page fault cr2 and nesting infomation are carried outside the fault data structure. Instead they are placed in the vcpu struct, which results in confusion as global variables are manipulated instead of passing parameters. Fix this issue by adding address and nested fields to struct x86_exception, so this struct can carry all information associated with a fault. Signed-off-by: Avi Kivity <[email protected]> Tested-by: Joerg Roedel <[email protected]> Tested-by: Gleb Natapov <[email protected]> Signed-off-by: Marcelo Tosatti <[email protected]>
2011-01-12KVM: Push struct x86_exception into walk_addr()Avi Kivity1-18/+14
Signed-off-by: Avi Kivity <[email protected]> Signed-off-by: Marcelo Tosatti <[email protected]>
2011-01-12KVM: Push struct x86_exception info the various gva_to_gpa variantsAvi Kivity4-47/+51
Signed-off-by: Avi Kivity <[email protected]> Signed-off-by: Marcelo Tosatti <[email protected]>
2011-01-12KVM: x86 emulator: simplify exception generationAvi Kivity1-90/+50
Immediately after we generate an exception, we want a X86EMUL_PROPAGATE_FAULT constant, so return it from the generation functions. Signed-off-by: Avi Kivity <[email protected]> Signed-off-by: Marcelo Tosatti <[email protected]>
2011-01-12KVM: x86 emulator: tighen up ->read_std() and ->write_std() error checksAvi Kivity1-8/+8
Instead of checking for X86EMUL_PROPAGATE_FAULT, check for any error, making the callers more reliable. Signed-off-by: Avi Kivity <[email protected]> Signed-off-by: Marcelo Tosatti <[email protected]>
2011-01-12KVM: x86 emulator: drop dead pf injection in emulate_popf()Avi Kivity1-8/+0
If rc == X86EMUL_PROPAGATE_FAULT, we would have returned earlier. Signed-off-by: Avi Kivity <[email protected]> Signed-off-by: Marcelo Tosatti <[email protected]>
2011-01-12KVM: x86 emulator: make emulator memory callbacks return full exceptionAvi Kivity3-96/+84
This way, they can return #GP, not just #PF. Signed-off-by: Avi Kivity <[email protected]> Signed-off-by: Marcelo Tosatti <[email protected]>
2011-01-12KVM: x86 emulator: introduce struct x86_exception to communicate faultsAvi Kivity3-12/+38
Introduce a structure that can contain an exception to be passed back to main kvm code. Signed-off-by: Avi Kivity <[email protected]> Signed-off-by: Marcelo Tosatti <[email protected]>
2011-01-12KVM: MMU: delay flush all tlbs on sync_page pathXiao Guangrong1-2/+10
Quote from Avi: | I don't think we need to flush immediately; set a "tlb dirty" bit somewhere | that is cleareded when we flush the tlb. kvm_mmu_notifier_invalidate_page() | can consult the bit and force a flush if set. Signed-off-by: Xiao Guangrong <[email protected]> Signed-off-by: Marcelo Tosatti <[email protected]>
2011-01-12KVM: MMU: abstract invalid guest pte mappingXiao Guangrong2-37/+37
Introduce a common function to map invalid gpte Signed-off-by: Xiao Guangrong <[email protected]> Signed-off-by: Marcelo Tosatti <[email protected]>
2011-01-12KVM: MMU: remove 'clear_unsync' parameterXiao Guangrong3-8/+7
Remove it since we can judge it by using sp->unsync Signed-off-by: Xiao Guangrong <[email protected]> Signed-off-by: Marcelo Tosatti <[email protected]>
2011-01-12KVM: MMU: rename 'reset_host_protection' to 'host_writable'Lai Jiangshan2-9/+9
Rename it to fit its sense better Signed-off-by: Lai Jiangshan <[email protected]> Signed-off-by: Xiao Guangrong <[email protected]> Signed-off-by: Marcelo Tosatti <[email protected]>
2011-01-12KVM: MMU: don't drop spte if overwrite it from W to ROXiao Guangrong1-11/+9
We just need flush tlb if overwrite a writable spte with a read-only one. And we should move this operation to set_spte() for sync_page path Signed-off-by: Xiao Guangrong <[email protected]> Signed-off-by: Marcelo Tosatti <[email protected]>
2011-01-12KVM: MMU: fix forgot flush tlbs on sync_page pathXiao Guangrong1-0/+1
We should flush all tlbs after drop spte on sync_page path since Quote from Avi: | sync_page | drop_spte | kvm_mmu_notifier_invalidate_page | kvm_unmap_rmapp | spte doesn't exist -> no flush | page is freed | guest can write into freed page? KVM-Stable-Tag. Signed-off-by: Xiao Guangrong <[email protected]> Signed-off-by: Marcelo Tosatti <[email protected]>
2011-01-12KVM: Add instruction-set-specific exit qualifications to kvm_exit traceAvi Kivity4-2/+25
The exit reason alone is insufficient to understand exactly why an exit occured; add ISA-specific trace parameters for additional information. Because fetching these parameters is expensive on vmx, and because these parameters are fetched even if tracing is disabled, we fetch the parameters via a callback instead of as traditional trace arguments. Signed-off-by: Avi Kivity <[email protected]>
2011-01-12KVM: Record instruction set in kvm_exit tracepointAvi Kivity3-4/+9
exit_reason's meaning depend on the instruction set; record it so a trace taken on one machine can be interpreted on another. Signed-off-by: Avi Kivity <[email protected]>
2011-01-12KVM: VMX: Fold __vmx_vcpu_run() into vmx_vcpu_run()Avi Kivity1-38/+25
cea15c2 ("KVM: Move KVM context switch into own function") split vmx_vcpu_run() to prevent multiple copies of the context switch from being generated (causing problems due to a label). This patch folds them back together again and adds the __noclone attribute to prevent the label from being duplicated. Signed-off-by: Avi Kivity <[email protected]>
2011-01-12KVM: x86 emulator: do not perform address calculations on linear addressesAvi Kivity1-1/+2
Linear addresses are supposed to already have segment checks performed on them; if we play with these addresses the checks become invalid. Signed-off-by: Avi Kivity <[email protected]> Signed-off-by: Marcelo Tosatti <[email protected]>
2011-01-12KVM: x86 emulator: preserve an operand's segment identityAvi Kivity2-52/+59
Currently the x86 emulator converts the segment register associated with an operand into a segment base which is added into the operand address. This loss of information results in us not doing segment limit checks properly. Replace struct operand's addr.mem field by a segmented_address structure which holds both the effetive address and segment. This will allow us to do the limit check at the point of access. Signed-off-by: Avi Kivity <[email protected]> Signed-off-by: Marcelo Tosatti <[email protected]>
2011-01-12KVM: x86 emulator: drop DPRINTF()Avi Kivity1-6/+1
Failed emulation is reported via a tracepoint; the cmps printk is pointless. Signed-off-by: Avi Kivity <[email protected]> Signed-off-by: Marcelo Tosatti <[email protected]>
2011-01-12KVM: x86 emulator: drop unused #ifndef __KERNEL__Avi Kivity1-7/+0
Signed-off-by: Avi Kivity <[email protected]> Signed-off-by: Marcelo Tosatti <[email protected]>
2011-01-12KVM: VMX: Inform user about INTEL_TXT dependencyShane Wang1-1/+4
Inform user to either disable TXT in the BIOS or do TXT launch with tboot before enabling KVM since some BIOSes do not set FEATURE_CONTROL_VMXON_ENABLED_OUTSIDE_SMX bit when TXT is enabled. Signed-off-by: Shane Wang <[email protected]> Signed-off-by: Marcelo Tosatti <[email protected]>
2011-01-12KVM: MMU: don't mark spte notrap if reserved bit setXiao Guangrong1-6/+11
If reserved bit is set, we need inject the #PF with PFEC.RSVD=1, but shadow_notrap_nonpresent_pte injects #PF with PFEC.RSVD=0 only Signed-off-by: Xiao Guangrong <[email protected]> Signed-off-by: Marcelo Tosatti <[email protected]>
2011-01-12KVM: Mask KVM_GET_SUPPORTED_CPUID data with Linux cpuid infoAvi Kivity1-0/+9
This allows Linux to mask cpuid bits if, for example, nx is enabled on only some cpus. Signed-off-by: Avi Kivity <[email protected]> Signed-off-by: Marcelo Tosatti <[email protected]>
2011-01-12KVM: SVM: Replace svm_has() by standard Linux cpuid accessorsAvi Kivity1-10/+5
Instead of querying cpuid directly, use the Linux accessors (boot_cpu_has, etc.). This allows the things like the clearcpuid kernel command line to work (when it's fixed wrt scattered cpuid bits). Acked-by: Joerg Roedel <[email protected]> Signed-off-by: Avi Kivity <[email protected]> Signed-off-by: Marcelo Tosatti <[email protected]>