mirror of
https://github.com/xen-project/xen.git
synced 2026-10-30 03:00:05 +01:00
x86emul: support SHA insns
Signed-off-by: Jan Beulich <jbeulich@suse.com> Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
This commit is contained in:
1 parent
b732d99910
commit
fe39a9ffcd
2 files changed
+19
No files matched your search
@@ -373,6 +373,7 @@ static const struct {
|
||||
[0x37 ... 0x3f] = { .simd_size = simd_packed_int },
|
||||
[0x40] = { .simd_size = simd_packed_int },
|
||||
[0x41] = { .simd_size = simd_packed_int, .two_op = 1 },
|
||||
[0xc8 ... 0xcd] = { .simd_size = simd_other },
|
||||
[0xdb] = { .simd_size = simd_packed_int, .two_op = 1 },
|
||||
[0xdc ... 0xdf] = { .simd_size = simd_packed_int },
|
||||
[0xf0] = { .two_op = 1 },
|
||||
@@ -404,6 +405,7 @@ static const struct {
|
||||
[0x4a ... 0x4b] = { .simd_size = simd_packed_fp, .four_op = 1 },
|
||||
[0x4c] = { .simd_size = simd_packed_int, .four_op = 1 },
|
||||
[0x60 ... 0x63] = { .simd_size = simd_packed_int, .two_op = 1 },
|
||||
[0xcc] = { .simd_size = simd_other },
|
||||
[0xdf] = { .simd_size = simd_packed_int, .two_op = 1 },
|
||||
[0xf0] = {},
|
||||
};
|
||||
@@ -1500,6 +1502,7 @@ static bool vcpu_has(
|
||||
#define vcpu_has_smap() vcpu_has( 7, EBX, 20, ctxt, ops)
|
||||
#define vcpu_has_clflushopt() vcpu_has( 7, EBX, 23, ctxt, ops)
|
||||
#define vcpu_has_clwb() vcpu_has( 7, EBX, 24, ctxt, ops)
|
||||
#define vcpu_has_sha() vcpu_has( 7, EBX, 29, ctxt, ops)
|
||||
#define vcpu_has_rdpid() vcpu_has( 7, ECX, 22, ctxt, ops)
|
||||
|
||||
#define vcpu_must_have(feat) \
|
||||
@@ -7187,6 +7190,16 @@ x86_emulate(
|
||||
host_and_vcpu_must_have(sse4_2);
|
||||
goto simd_0f38_common;
|
||||
|
||||
case X86EMUL_OPC(0x0f38, 0xc8): /* sha1nexte xmm/m128,xmm */
|
||||
case X86EMUL_OPC(0x0f38, 0xc9): /* sha1msg1 xmm/m128,xmm */
|
||||
case X86EMUL_OPC(0x0f38, 0xca): /* sha1msg2 xmm/m128,xmm */
|
||||
case X86EMUL_OPC(0x0f38, 0xcb): /* sha256rnds2 XMM0,xmm/m128,xmm */
|
||||
case X86EMUL_OPC(0x0f38, 0xcc): /* sha256msg1 xmm/m128,xmm */
|
||||
case X86EMUL_OPC(0x0f38, 0xcd): /* sha256msg2 xmm/m128,xmm */
|
||||
host_and_vcpu_must_have(sha);
|
||||
op_bytes = 16;
|
||||
goto simd_0f38_common;
|
||||
|
||||
case X86EMUL_OPC_66(0x0f38, 0xdb): /* aesimc xmm/m128,xmm */
|
||||
case X86EMUL_OPC_VEX_66(0x0f38, 0xdb): /* vaesimc xmm/m128,xmm */
|
||||
case X86EMUL_OPC_66(0x0f38, 0xdc): /* aesenc xmm/m128,xmm,xmm */
|
||||
@@ -7571,6 +7584,11 @@ x86_emulate(
|
||||
dst.type = OP_NONE;
|
||||
break;
|
||||
|
||||
case X86EMUL_OPC(0x0f3a, 0xcc): /* sha1rnds4 $imm8,xmm/m128,xmm */
|
||||
host_and_vcpu_must_have(sha);
|
||||
op_bytes = 16;
|
||||
goto simd_0f3a_common;
|
||||
|
||||
case X86EMUL_OPC_66(0x0f3a, 0xdf): /* aeskeygenassist $imm8,xmm/m128,xmm */
|
||||
case X86EMUL_OPC_VEX_66(0x0f3a, 0xdf): /* vaeskeygenassist $imm8,xmm/m128,xmm */
|
||||
host_and_vcpu_must_have(aesni);
|
||||
|
||||
@@ -87,6 +87,7 @@
|
||||
#define cpu_has_hle boot_cpu_has(X86_FEATURE_HLE)
|
||||
#define cpu_has_rtm boot_cpu_has(X86_FEATURE_RTM)
|
||||
#define cpu_has_pdcm boot_cpu_has(X86_FEATURE_PDCM)
|
||||
#define cpu_has_sha boot_cpu_has(X86_FEATURE_SHA)
|
||||
|
||||
enum _cache_type {
|
||||
CACHE_TYPE_NULL = 0,
|
||||
|
||||