From: Gleb Natapov Date: Thu, 20 Dec 2012 14:57:47 +0000 (+0200) Subject: KVM: VMX: handle IO when emulation is due to #GP in real mode. X-Git-Tag: v3.9-rc1~97^2~71 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0ca1b4f4ba3a9f75bb099ccaf6c4bd8bb6db7a74;p=pandora-kernel.git KVM: VMX: handle IO when emulation is due to #GP in real mode. With emulate_invalid_guest_state=0 if a vcpu is in real mode VMX can enter the vcpu with smaller segment limit than guest configured. If the guest tries to access pass this limit it will get #GP at which point instruction will be emulated with correct segment limit applied. If during the emulation IO is detected it is not handled correctly. Vcpu thread should exit to userspace to serve the IO, but it returns to the guest instead. Since emulation is not completed till userspace completes the IO the faulty instruction is re-executed ad infinitum. The patch fixes that by exiting to userspace if IO happens during instruction emulation. Reported-by: Alex Williamson Signed-off-by: Gleb Natapov Signed-off-by: Marcelo Tosatti --- Reading git-diff-tree failed