KVM: Handle guest page faults when emulating mmio
authorAvi Kivity <avi@qumranet.com>
Tue, 17 Apr 2007 07:53:22 +0000 (10:53 +0300)
committerAvi Kivity <avi@qumranet.com>
Thu, 3 May 2007 07:52:29 +0000 (10:52 +0300)
commitc9047f533373e934b96d19d6a3d313ca2132fbe5
treee64c9ed660d71321dcc9fb9d035fbc45a42fcaba
parent364b625b561b1dd74e6fa696949ae3de28999a66
KVM: Handle guest page faults when emulating mmio

Usually, guest page faults are detected by the kvm page fault handler,
which detects if they are shadow faults, mmio faults, pagetable faults,
or normal guest page faults.

However, in ceratin circumstances, we can detect a page fault much later.
One of these events is the following combination:

- A two memory operand instruction (e.g. movsb) is executed.
- The first operand is in mmio space (which is the fault reported to kvm)
- The second operand is in an ummaped address (e.g. a guest page fault)

The Windows 2000 installer does such an access, an promptly hangs.  Fix
by adding the missing page fault injection on that path.

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