]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit - arch/x86/kvm/emulate.c
KVM: x86 emulator: don't depend on cr2 for mov abs emulation
authorAvi Kivity <avi@qumranet.com>
Sun, 28 Oct 2007 14:34:25 +0000 (16:34 +0200)
committerAvi Kivity <avi@qumranet.com>
Wed, 30 Jan 2008 15:52:57 +0000 (17:52 +0200)
commitc7e75a3db4ecd952e7a5562cea1b27007bf0c01c
treea83547a4a40ff4c05a62ab5eb112d4417462d235
parentfe7935d49fbe33308c1b5f0e35137989da851010
KVM: x86 emulator: don't depend on cr2 for mov abs emulation

The 'mov abs' instruction family (opcodes 0xa0 - 0xa3) still depends on cr2
provided by the page fault handler.  This is wrong for several reasons:

- if an instruction accessed misaligned data that crosses a page boundary,
  and if the fault happened on the second page, cr2 will point at the
  second page, not the data itself.

- if we're emulating in real mode, or due to a FlexPriority exit, there
  is no cr2 generated.

So, this change adds decoding for this instruction form and drops reliance
on cr2.

Signed-off-by: Avi Kivity <avi@qumranet.com>
drivers/kvm/x86_emulate.c