From: Paul Mackerras Date: Tue, 6 Aug 2013 04:15:19 +0000 (+1000) Subject: KVM: PPC: Book3S PR: Make instruction fetch fallback work for system calls X-Git-Tag: v3.12-rc1~143^2~5^2~2 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8b23de29489fd63fce753db9d53055e4bbf8f616;p=pandora-kernel.git KVM: PPC: Book3S PR: Make instruction fetch fallback work for system calls It turns out that if we exit the guest due to a hcall instruction (sc 1), and the loading of the instruction in the guest exit path fails for any reason, the call to kvmppc_ld() in kvmppc_get_last_inst() fetches the instruction after the hcall instruction rather than the hcall itself. This in turn means that the instruction doesn't get recognized as an hcall in kvmppc_handle_exit_pr() but gets passed to the guest kernel as a sc instruction. That usually results in the guest kernel getting a return code of 38 (ENOSYS) from an hcall, which often triggers a BUG_ON() or other failure. This fixes the problem by adding a new variant of kvmppc_get_last_inst() called kvmppc_get_last_sc(), which fetches the instruction if necessary from pc - 4 rather than pc. Signed-off-by: Paul Mackerras Signed-off-by: Alexander Graf --- Reading git-diff-tree failed