KVM: Fix guest register corruption on paravirt hypercall
The hypercall code mixes up the ->cache_regs() and ->decache_regs() callbacks, resulting in guest register corruption. Signed-off-by: Dor Laor <dor.laor@qumranet.com> Signed-off-by: Avi Kivity <avi@qumranet.com>
This commit is contained in:
parent
dc87c3985e
commit
9b22bf5783
1 changed files with 2 additions and 2 deletions
|
@ -1177,7 +1177,7 @@ int kvm_hypercall(struct kvm_vcpu *vcpu, struct kvm_run *run)
|
|||
{
|
||||
unsigned long nr, a0, a1, a2, a3, a4, a5, ret;
|
||||
|
||||
kvm_arch_ops->decache_regs(vcpu);
|
||||
kvm_arch_ops->cache_regs(vcpu);
|
||||
ret = -KVM_EINVAL;
|
||||
#ifdef CONFIG_X86_64
|
||||
if (is_long_mode(vcpu)) {
|
||||
|
@ -1204,7 +1204,7 @@ int kvm_hypercall(struct kvm_vcpu *vcpu, struct kvm_run *run)
|
|||
;
|
||||
}
|
||||
vcpu->regs[VCPU_REGS_RAX] = ret;
|
||||
kvm_arch_ops->cache_regs(vcpu);
|
||||
kvm_arch_ops->decache_regs(vcpu);
|
||||
return 1;
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(kvm_hypercall);
|
||||
|
|
Loading…
Reference in a new issue