From: Paolo Bonzini Date: Thu, 9 May 2024 13:55:47 +0000 (+0200) Subject: target/i386: rdpkru/wrpkru are no-prefix instructions X-Git-Tag: v7.2.12~16 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=e6000bd7c7cfdd0fc224531e2971e482bbecd1ad;p=thirdparty%2Fqemu.git target/i386: rdpkru/wrpkru are no-prefix instructions Reject 0x66/0xf3/0xf2 in front of them. Cc: qemu-stable@nongnu.org Reviewed-by: Richard Henderson Signed-off-by: Paolo Bonzini (cherry picked from commit 40a3ec7b5ffde500789d016660a171057d6b467c) Signed-off-by: Michael Tokarev --- diff --git a/target/i386/tcg/translate.c b/target/i386/tcg/translate.c index fe57e7bf4d7..0fb61fc8968 100644 --- a/target/i386/tcg/translate.c +++ b/target/i386/tcg/translate.c @@ -6059,7 +6059,8 @@ static bool disas_insn(DisasContext *s, CPUState *cpu) gen_ldst_modrm(env, s, modrm, ot, OR_TMP0, 1); break; case 0xee: /* rdpkru */ - if (prefixes & PREFIX_LOCK) { + if (s->prefix & (PREFIX_LOCK | PREFIX_DATA + | PREFIX_REPZ | PREFIX_REPNZ)) { goto illegal_op; } tcg_gen_trunc_tl_i32(s->tmp2_i32, cpu_regs[R_ECX]); @@ -6067,7 +6068,8 @@ static bool disas_insn(DisasContext *s, CPUState *cpu) tcg_gen_extr_i64_tl(cpu_regs[R_EAX], cpu_regs[R_EDX], s->tmp1_i64); break; case 0xef: /* wrpkru */ - if (prefixes & PREFIX_LOCK) { + if (s->prefix & (PREFIX_LOCK | PREFIX_DATA + | PREFIX_REPZ | PREFIX_REPNZ)) { goto illegal_op; } tcg_gen_concat_tl_i64(s->tmp1_i64, cpu_regs[R_EAX],