x86/svm: Improve diagnostics when svm_get_insn_len() fails
authorAndrew Cooper <andrew.cooper3@citrix.com>
Fri, 30 Nov 2018 13:50:54 +0000 (13:50 +0000)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Fri, 1 Feb 2019 11:25:32 +0000 (11:25 +0000)
commitb58ddf5ed9deca528fadc4befd07b21b98e040a4
treee55a05691d5ab404e5c30f7251c69299c33858a7
parent411900525f49f15ca85854b768353a27c87bf1b8
x86/svm: Improve diagnostics when svm_get_insn_len() fails

Sadly, a lone:

  (XEN) emulate.c:156:d2v0 svm_get_insn_len: Mismatch between expected and actual instruction: eip = fffff804564139c0

on the console is of no use trying to identify what went wrong.  Dump as much
state as we can to help identify what went wrong.

  (XEN) Insn mismatch: Expected opcode 0xf0031, modrm 0, got nrip_len 3, emul_len 3
  (XEN) SVM Insn len emulation failed (1): d1v0 64bit @ 0008:0010475f -> 0f 01 f9 0f 31 5b 31 ff 31 c0 e9 c2 db ff ff 00

Drop the debug-only early exit if the sources of length disagree, because the
only effect it has it to avoid the more detailed analysis of what went wrong.

Reported-by: Paul Durrant <paul.durrant@citrix.com>
Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Acked-by: Brian Woods <brian.woods@amd.com>
Reviewed-by: Paul Durrant <paul.durrant@citrix.com>
Release-acked-by: Juergen Gross <jgross@suse.com>
xen/arch/x86/hvm/svm/emulate.c