|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [PATCH v4 09/28] x86emul: support TILERELEASE
This is relatively straightforward, and hence best suited to introduce a
few other general pieces.
Testing of this will be added once a sensible test can be put together,
i.e. when support for other insns is also there.
Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
---
v4: Use X86_EXC_*. Re-base.
v2: New.
--- a/tools/tests/x86_emulator/predicates.c
+++ b/tools/tests/x86_emulator/predicates.c
@@ -1343,6 +1343,7 @@ static const struct vex {
{ { 0x45 }, 2, T, R, pfx_66, Wn, Ln }, /* vpsrlv{d,q} */
{ { 0x46 }, 2, T, R, pfx_66, W0, Ln }, /* vpsravd */
{ { 0x47 }, 2, T, R, pfx_66, Wn, Ln }, /* vpsllv{d,q} */
+ { { 0x49, 0xc0 }, 2, F, N, pfx_no, W0, L0 }, /* tilerelease */
{ { 0x50 }, 2, T, R, pfx_no, W0, Ln }, /* vpdpbuud */
{ { 0x50 }, 2, T, R, pfx_66, W0, Ln }, /* vpdpbusd */
{ { 0x50 }, 2, T, R, pfx_f3, W0, Ln }, /* vpdpbsud */
--- a/tools/tests/x86_emulator/x86-emulate.c
+++ b/tools/tests/x86_emulator/x86-emulate.c
@@ -227,6 +227,10 @@ int emul_test_get_fpu(
break;
default:
return X86EMUL_UNHANDLEABLE;
+
+ case X86EMUL_FPU_tilecfg:
+ case X86EMUL_FPU_tile:
+ return cpu_has_amx_tile ? X86EMUL_OKAY : X86EMUL_UNHANDLEABLE;
}
return X86EMUL_OKAY;
}
--- a/xen/arch/x86/x86_emulate/private.h
+++ b/xen/arch/x86/x86_emulate/private.h
@@ -604,6 +604,7 @@ amd_like(const struct x86_emulate_ctxt *
#define vcpu_has_avx512_vp2intersect() (ctxt->cpuid->feat.avx512_vp2intersect)
#define vcpu_has_serialize() (ctxt->cpuid->feat.serialize)
#define vcpu_has_tsxldtrk() (ctxt->cpuid->feat.tsxldtrk)
+#define vcpu_has_amx_tile() (ctxt->cpuid->feat.amx_tile)
#define vcpu_has_sha512() (ctxt->cpuid->feat.sha512)
#define vcpu_has_sm3() (ctxt->cpuid->feat.sm3)
#define vcpu_has_sm4() (ctxt->cpuid->feat.sm4)
--- a/xen/arch/x86/x86_emulate/decode.c
+++ b/xen/arch/x86/x86_emulate/decode.c
@@ -363,6 +363,7 @@ static const struct ext0f38_table {
[0x43] = { .simd_size = simd_scalar_vexw, .d8s = d8s_dq },
[0x44] = { .simd_size = simd_packed_int, .two_op = 1, .d8s = d8s_vl },
[0x45 ... 0x47] = { .simd_size = simd_packed_int, .d8s = d8s_vl },
+ [0x49] = { .simd_size = simd_other, .two_op = 1 },
[0x4c] = { .simd_size = simd_packed_fp, .two_op = 1, .d8s = d8s_vl },
[0x4d] = { .simd_size = simd_scalar_vexw, .d8s = d8s_dq },
[0x4e] = { .simd_size = simd_packed_fp, .two_op = 1, .d8s = d8s_vl },
--- a/xen/arch/x86/x86_emulate/x86_emulate.c
+++ b/xen/arch/x86/x86_emulate/x86_emulate.c
@@ -6548,6 +6548,24 @@ x86_emulate(
generate_exception_if(vex.l, X86_EXC_UD);
goto simd_0f_avx;
+ case X86EMUL_OPC_VEX(0x0f38, 0x49):
+ generate_exception_if(!mode_64bit() || vex.l || vex.w, X86_EXC_UD);
+ if ( ea.type == OP_REG )
+ {
+ switch ( modrm )
+ {
+ case 0xc0: /* tilerelease */
+ vcpu_must_have(amx_tile);
+ get_fpu(X86EMUL_FPU_tilecfg);
+ op_bytes = 1; /* fake */
+ goto simd_0f_common;
+
+ default:
+ goto unrecognized_insn;
+ }
+ }
+ goto unimplemented_insn;
+
case X86EMUL_OPC_VEX (0x0f38, 0x50): /* vpdpbuud
[xy]mm/mem,[xy]mm,[xy]mm */
case X86EMUL_OPC_VEX_F3(0x0f38, 0x50): /* vpdpbsud
[xy]mm/mem,[xy]mm,[xy]mm */
case X86EMUL_OPC_VEX_F2(0x0f38, 0x50): /* vpdpbssd
[xy]mm/mem,[xy]mm,[xy]mm */
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |