Commit e42c682
KVM: SVM: avoid emulation with stale next_rip
svm->next_rip is reset in svm_vcpu_run() only after calling
svm_exit_handlers_fastpath(), which will cause SVM's
skip_emulated_instruction() to write a stale RIP.
We can move svm_exit_handlers_fastpath towards the end of
svm_vcpu_run(). To align VMX with SVM, keep svm_complete_interrupts()
close as well.
Suggested-by: Sean Christopherson <sean.j.christopherson@intel.com>
Cc: Paul K. <kronenpj@kronenpj.dyndns.org>
Reviewed-by: Vitaly Kuznetsov <vkuznets@redhat.com>
Signed-off-by: Wanpeng Li <wanpengli@tencent.com>
[Also move vmcb_mark_all_clean before any possible write to the VMCB.
- Paolo]1 parent d831de1 commit e42c682
1 file changed
Lines changed: 3 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2938 | 2938 | | |
2939 | 2939 | | |
2940 | 2940 | | |
2941 | | - | |
2942 | | - | |
2943 | 2941 | | |
2944 | 2942 | | |
2945 | 2943 | | |
| |||
3504 | 3502 | | |
3505 | 3503 | | |
3506 | 3504 | | |
3507 | | - | |
3508 | 3505 | | |
3509 | 3506 | | |
3510 | 3507 | | |
| |||
3518 | 3515 | | |
3519 | 3516 | | |
3520 | 3517 | | |
| 3518 | + | |
3521 | 3519 | | |
3522 | 3520 | | |
3523 | 3521 | | |
| |||
3537 | 3535 | | |
3538 | 3536 | | |
3539 | 3537 | | |
3540 | | - | |
| 3538 | + | |
| 3539 | + | |
3541 | 3540 | | |
3542 | 3541 | | |
3543 | 3542 | | |
| |||
0 commit comments