x86/svm: Drop enum instruction_index and simplify svm_get_insn_len()
authorAndrew Cooper <andrew.cooper3@citrix.com>
Thu, 13 Dec 2018 17:01:24 +0000 (17:01 +0000)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Fri, 1 Feb 2019 11:25:32 +0000 (11:25 +0000)
commit411900525f49f15ca85854b768353a27c87bf1b8
tree4c9fdd5cffd8f670385292a621cc4109efa4da6a
parentd178114c596bd0e55d727a50e08351fd54b7578e
x86/svm: Drop enum instruction_index and simplify svm_get_insn_len()

Passing a 32-bit integer index into an array with entries containing less than
32 bits of data is wasteful, and creates an unnecessary error condition of
passing an out-of-range index.

The width of the X86EMUL_OPC() encoding is currently 20 bits for the
instructions used, which leaves room for a modrm byte.  Drop opc_tab[]
entirely, and encode the expected opcode/modrm information directly.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Acked-by: Brian Woods <brian.woods@amd.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
Release-acked-by: Juergen Gross <jgross@suse.com>
xen/arch/x86/hvm/svm/emulate.c
xen/include/asm-x86/hvm/svm/emulate.h