x86/insn-eval: Introduce insn_get_modrm_reg_ptr()
authorKirill A. Shutemov <kirill@shutemov.name>
Tue, 30 Nov 2021 18:49:31 +0000 (21:49 +0300)
committerDave Hansen <dave.hansen@linux.intel.com>
Tue, 30 Nov 2021 22:53:04 +0000 (14:53 -0800)
commitd5ec1877df6da6a14bbc353aff50689528930dd2
treea5e6b273c022191205ade9be185fa33e83b97b3d
parent23ef731e4365196bfc186358eb4f6265d60ab352
x86/insn-eval: Introduce insn_get_modrm_reg_ptr()

The helper returns a pointer to the register indicated by
ModRM byte.

It's going to replace vc_insn_get_reg() in the SEV MMIO
implementation. TDX MMIO implementation will also use it.

Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Signed-off-by: Dave Hansen <dave.hansen@linux.intel.com>
Reviewed-by: Andi Kleen <ak@linux.intel.com>
Reviewed-by: Tony Luck <tony.luck@intel.com>
Tested-by: Joerg Roedel <jroedel@suse.de>
Acked-by: Tom Lendacky <thomas.lendacky@amd.com>
Link: https://lkml.kernel.org/r/20211130184933.31005-3-kirill.shutemov@linux.intel.com
arch/x86/include/asm/insn-eval.h
arch/x86/lib/insn-eval.c