Commit 9a1dfef
committed
KVM: x86: clear vcpu->run->hypercall.ret before exiting for KVM_EXIT_HYPERCALL
QEMU up to 9.2.0 is assuming that vcpu->run->hypercall.ret is 0 on exit and
it never modifies it when processing KVM_EXIT_HYPERCALL. Make this explicit
in the code, to avoid breakage when KVM starts modifying that field.
This in principle is not a good idea... It would have been much better if
KVM had set the field to -KVM_ENOSYS from the beginning, so that a dumb
userspace that does nothing on KVM_EXIT_HYPERCALL would tell the guest it
does not support KVM_HC_MAP_GPA_RANGE. However, breaking userspace is
a Very Bad Thing, as everybody should know.
Reported-by: Binbin Wu <binbin.wu@linux.intel.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>1 parent 10b2c8a commit 9a1dfef
2 files changed
+21
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3634 | 3634 | | |
3635 | 3635 | | |
3636 | 3636 | | |
| 3637 | + | |
| 3638 | + | |
| 3639 | + | |
| 3640 | + | |
| 3641 | + | |
| 3642 | + | |
| 3643 | + | |
3637 | 3644 | | |
3638 | 3645 | | |
3639 | 3646 | | |
| |||
3797 | 3804 | | |
3798 | 3805 | | |
3799 | 3806 | | |
| 3807 | + | |
| 3808 | + | |
| 3809 | + | |
| 3810 | + | |
| 3811 | + | |
| 3812 | + | |
| 3813 | + | |
3800 | 3814 | | |
3801 | 3815 | | |
3802 | 3816 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10052 | 10052 | | |
10053 | 10053 | | |
10054 | 10054 | | |
| 10055 | + | |
| 10056 | + | |
| 10057 | + | |
| 10058 | + | |
| 10059 | + | |
| 10060 | + | |
| 10061 | + | |
10055 | 10062 | | |
10056 | 10063 | | |
10057 | 10064 | | |
| |||
0 commit comments