KVM: x86: improve reexecute_instruction
authorXiao Guangrong <xiaoguangrong@linux.vnet.ibm.com>
Sun, 13 Jan 2013 15:49:07 +0000 (23:49 +0800)
committerMarcelo Tosatti <mtosatti@redhat.com>
Tue, 22 Jan 2013 00:58:33 +0000 (22:58 -0200)
commit93c05d3ef25275829d421a255271595ac219a518
treeb987097751977ca63bd9a9ef53956cd0d14127c3
parent95b3cf69bdf8b27a02d878e24ca353cebb4e009e
KVM: x86: improve reexecute_instruction

The current reexecute_instruction can not well detect the failed instruction
emulation. It allows guest to retry all the instructions except it accesses
on error pfn

For example, some cases are nested-write-protect - if the page we want to
write is used as PDE but it chains to itself. Under this case, we should
stop the emulation and report the case to userspace

Reviewed-by: Gleb Natapov <gleb@redhat.com>
Signed-off-by: Xiao Guangrong <xiaoguangrong@linux.vnet.ibm.com>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
arch/x86/include/asm/kvm_host.h
arch/x86/kvm/paging_tmpl.h
arch/x86/kvm/x86.c