Commit 2ea07188 authored by Linus Torvalds's avatar Linus Torvalds

Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/avi/kvm

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/avi/kvm:
  KVM: SVM: Fix FPU leak while emulating clts
  KVM: SVM: Unload guest fpu on vcpu_put()
  KVM: x86 emulator: Use emulator_write_emulated and not emulator_write_std
  KVM: x86 emulator: fix the saving of of the eip value
  KVM: x86 emulator: fix JMP_REL
parents 9c8ff4f4 404fb881
...@@ -1188,8 +1188,7 @@ int emulate_invlpg(struct kvm_vcpu *vcpu, gva_t address) ...@@ -1188,8 +1188,7 @@ int emulate_invlpg(struct kvm_vcpu *vcpu, gva_t address)
int emulate_clts(struct kvm_vcpu *vcpu) int emulate_clts(struct kvm_vcpu *vcpu)
{ {
vcpu->cr0 &= ~X86_CR0_TS; kvm_x86_ops->set_cr0(vcpu, vcpu->cr0 & ~X86_CR0_TS);
kvm_x86_ops->set_cr0(vcpu, vcpu->cr0);
return X86EMUL_CONTINUE; return X86EMUL_CONTINUE;
} }
......
...@@ -663,6 +663,7 @@ static void svm_vcpu_put(struct kvm_vcpu *vcpu) ...@@ -663,6 +663,7 @@ static void svm_vcpu_put(struct kvm_vcpu *vcpu)
wrmsrl(host_save_user_msrs[i], svm->host_user_msrs[i]); wrmsrl(host_save_user_msrs[i], svm->host_user_msrs[i]);
rdtscll(vcpu->host_tsc); rdtscll(vcpu->host_tsc);
kvm_put_guest_fpu(vcpu);
} }
static void svm_vcpu_decache(struct kvm_vcpu *vcpu) static void svm_vcpu_decache(struct kvm_vcpu *vcpu)
......
...@@ -448,8 +448,7 @@ struct operand { ...@@ -448,8 +448,7 @@ struct operand {
#define JMP_REL(rel) \ #define JMP_REL(rel) \
do { \ do { \
_eip += (int)(rel); \ register_address_increment(_eip, rel); \
_eip = ((op_bytes == 2) ? (uint16_t)_eip : (uint32_t)_eip); \
} while (0) } while (0)
/* /*
...@@ -1147,7 +1146,7 @@ x86_emulate_memop(struct x86_emulate_ctxt *ctxt, struct x86_emulate_ops *ops) ...@@ -1147,7 +1146,7 @@ x86_emulate_memop(struct x86_emulate_ctxt *ctxt, struct x86_emulate_ops *ops)
} }
register_address_increment(_regs[VCPU_REGS_RSP], register_address_increment(_regs[VCPU_REGS_RSP],
-dst.bytes); -dst.bytes);
if ((rc = ops->write_std( if ((rc = ops->write_emulated(
register_address(ctxt->ss_base, register_address(ctxt->ss_base,
_regs[VCPU_REGS_RSP]), _regs[VCPU_REGS_RSP]),
&dst.val, dst.bytes, ctxt->vcpu)) != 0) &dst.val, dst.bytes, ctxt->vcpu)) != 0)
...@@ -1359,6 +1358,7 @@ x86_emulate_memop(struct x86_emulate_ctxt *ctxt, struct x86_emulate_ops *ops) ...@@ -1359,6 +1358,7 @@ x86_emulate_memop(struct x86_emulate_ctxt *ctxt, struct x86_emulate_ops *ops)
} }
src.val = (unsigned long) _eip; src.val = (unsigned long) _eip;
JMP_REL(rel); JMP_REL(rel);
op_bytes = ad_bytes;
goto push; goto push;
} }
case 0xe9: /* jmp rel */ case 0xe9: /* jmp rel */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment