diff options
author | Avi Kivity <avi@qumranet.com> | 2008-05-21 15:34:25 +0300 |
---|---|---|
committer | Avi Kivity <avi@qumranet.com> | 2008-06-06 21:08:25 +0300 |
commit | 33e3885de25148e00595c4dd808d6eb15db2edcf (patch) | |
tree | d7bc06e1ff57b59d70b23ee4b175e0ae2f45e708 /block/genhd.c | |
parent | f20d2752980c144c82649eb18746ef0c29f508dd (diff) |
KVM: x86 emulator: fix hypercall return value on AMD
The hypercall instructions on Intel and AMD are different. KVM allows the
guest to choose one or the other (the default is Intel), and if the guest
chooses incorrectly, KVM will patch it at runtime to select the correct
instruction. This allows live migration between Intel and AMD machines.
This patching occurs in the x86 emulator. The current code also executes
the hypercall. Unfortunately, the tail end of the x86 emulator code also
executes, overwriting the return value of the hypercall with the original
contents of rax (which happens to be the hypercall number).
Fix not by executing the hypercall in the emulator context; instead let the
guest reissue the patched instruction and execute the hypercall via the
normal path.
Signed-off-by: Avi Kivity <avi@qumranet.com>
Diffstat (limited to 'block/genhd.c')
0 files changed, 0 insertions, 0 deletions