diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2015-08-14 20:27:52 -0400 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2015-08-14 20:27:52 -0400 |
| commit | 45e38cff4fce8d6871b5fa5e734e4dc9814d6056 (patch) | |
| tree | 4b926c3ca494c2f17ba15a46173ff869457a06d9 | |
| parent | 8394a1b7151c54c6be66551a0ca1041b398029b6 (diff) | |
| parent | d7add05458084a5e3d65925764a02ca9c8202c1e (diff) | |
Merge tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm
Pull KVM fixes from Paolo Bonzini:
"Just two very small & simple patches"
* tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm:
KVM: x86: Use adjustment in guest cycles when handling MSR_IA32_TSC_ADJUST
KVM: x86: zero IDT limit on entry to SMM
| -rw-r--r-- | arch/x86/kvm/x86.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c index 5ef2560075bf..8f0f6eca69da 100644 --- a/arch/x86/kvm/x86.c +++ b/arch/x86/kvm/x86.c | |||
| @@ -2105,7 +2105,7 @@ int kvm_set_msr_common(struct kvm_vcpu *vcpu, struct msr_data *msr_info) | |||
| 2105 | if (guest_cpuid_has_tsc_adjust(vcpu)) { | 2105 | if (guest_cpuid_has_tsc_adjust(vcpu)) { |
| 2106 | if (!msr_info->host_initiated) { | 2106 | if (!msr_info->host_initiated) { |
| 2107 | s64 adj = data - vcpu->arch.ia32_tsc_adjust_msr; | 2107 | s64 adj = data - vcpu->arch.ia32_tsc_adjust_msr; |
| 2108 | kvm_x86_ops->adjust_tsc_offset(vcpu, adj, true); | 2108 | adjust_tsc_offset_guest(vcpu, adj); |
| 2109 | } | 2109 | } |
| 2110 | vcpu->arch.ia32_tsc_adjust_msr = data; | 2110 | vcpu->arch.ia32_tsc_adjust_msr = data; |
| 2111 | } | 2111 | } |
| @@ -6327,6 +6327,7 @@ static void process_smi_save_state_64(struct kvm_vcpu *vcpu, char *buf) | |||
| 6327 | static void process_smi(struct kvm_vcpu *vcpu) | 6327 | static void process_smi(struct kvm_vcpu *vcpu) |
| 6328 | { | 6328 | { |
| 6329 | struct kvm_segment cs, ds; | 6329 | struct kvm_segment cs, ds; |
| 6330 | struct desc_ptr dt; | ||
| 6330 | char buf[512]; | 6331 | char buf[512]; |
| 6331 | u32 cr0; | 6332 | u32 cr0; |
| 6332 | 6333 | ||
| @@ -6359,6 +6360,10 @@ static void process_smi(struct kvm_vcpu *vcpu) | |||
| 6359 | 6360 | ||
| 6360 | kvm_x86_ops->set_cr4(vcpu, 0); | 6361 | kvm_x86_ops->set_cr4(vcpu, 0); |
| 6361 | 6362 | ||
| 6363 | /* Undocumented: IDT limit is set to zero on entry to SMM. */ | ||
| 6364 | dt.address = dt.size = 0; | ||
| 6365 | kvm_x86_ops->set_idt(vcpu, &dt); | ||
| 6366 | |||
| 6362 | __kvm_set_dr(vcpu, 7, DR7_FIXED_1); | 6367 | __kvm_set_dr(vcpu, 7, DR7_FIXED_1); |
| 6363 | 6368 | ||
| 6364 | cs.selector = (vcpu->arch.smbase >> 4) & 0xffff; | 6369 | cs.selector = (vcpu->arch.smbase >> 4) & 0xffff; |
