x86emul: prepare for AVX512F S/G insns
authorJan Beulich <jbeulich@suse.com>
Thu, 4 Jul 2019 15:43:09 +0000 (17:43 +0200)
committerJan Beulich <jbeulich@suse.com>
Thu, 4 Jul 2019 15:43:09 +0000 (17:43 +0200)
commite8af03bf9a3281e55b832cd801528392a9a7d9af
treea056178753303eef27c38789d7106c597d154798
parent92b80e3e3dfacf389cff797580b3806576051dfd
x86emul: prepare for AVX512F S/G insns

They require getting modrm_reg and sib_index set correctly in the EVEX
case, to account for the high 16 [XYZ]MM registers when used as
addressing index register. Extend the adjustments to modrm_rm as well,
such that x86_insn_modrm() would correctly report register numbers (this
was a latent issue only as we don't currently have callers of that
function which would care about an EVEX case).

The adjustment in turn requires dropping the assertion from decode_gpr()
as well as re-introducing the explicit masking, as we now need to
actively mask off the high bit when a GPR is meant.

_decode_gpr() invocations also need slight adjustments, when invoked in
generic code ahead of the main switch(). All other uses of modrm_reg and
modrm_rm already get suitably masked where necessary.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
xen/arch/x86/x86_emulate/x86_emulate.c
xen/arch/x86/x86_emulate/x86_emulate.h