From: Zhao Liu <zhao1.liu@intel.com>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: qemu-devel@nongnu.org, Zhao Liu <zhao1.liu@intel.com>
Subject: Re: [PATCH 10/20] target/i386/tcg: implement JMPABS instruction
Date: Wed, 26 Aug 2026 22:30:08 +0800 [thread overview]
Message-ID: <ao74cFO91SLv9WVB@intel.com> (raw)
In-Reply-To: <20260825122921.431739-11-pbonzini@redhat.com>
On Tue, Aug 25, 2026 at 02:29:11PM +0200, Paolo Bonzini wrote:
> Date: Tue, 25 Aug 2026 14:29:11 +0200
> From: Paolo Bonzini <pbonzini@redhat.com>
> Subject: [PATCH 10/20] target/i386/tcg: implement JMPABS instruction
> X-Mailer: git-send-email 2.55.0
>
> This is the same as an indirect jump, just with immediate operand.
> The requirement of W=0 and 0x67 are already available in the decoder.
>
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> ---
> target/i386/tcg/decode-new.h | 3 +++
> target/i386/tcg/decode-new.c.inc | 4 ++++
> 2 files changed, 7 insertions(+)
>
> diff --git a/target/i386/tcg/decode-new.h b/target/i386/tcg/decode-new.h
> index c974ca9d7c5..4998712e86d 100644
> --- a/target/i386/tcg/decode-new.h
> +++ b/target/i386/tcg/decode-new.h
> @@ -184,6 +184,9 @@ typedef enum X86InsnCheck {
>
> /* No REX2 prefix allowed */
> X86_CHECK_no_rex2 = 8192,
> +
> + /* No 0x67 prefix allowed */
> + X86_CHECK_no_adr = 16384,
> } X86InsnCheck;
>
> typedef enum X86InsnSpecial {
> diff --git a/target/i386/tcg/decode-new.c.inc b/target/i386/tcg/decode-new.c.inc
> index 1f59fd665f7..d215d28cec5 100644
> --- a/target/i386/tcg/decode-new.c.inc
> +++ b/target/i386/tcg/decode-new.c.inc
> @@ -1991,6 +1991,7 @@ static const X86OpEntry opcodes_root[256] = {
>
> #ifdef TARGET_X86_64
> static const X86OpEntry opcodes_rex2_map0_A0toAF[16] = {
> + [1] = X86_OP_ENTRY1(JMP_m, I,q, p_00 chk2(W0, no_adr)),
> };
Maybe it should use X86_OP_ENTRYr? since JMPABS doesn't need to write
back.
Just a simple test:
#include <stdio.h>
int main(void)
{
__asm__ volatile (
/* JMPABS: REX2(M0=0,W=0) = D5 00, opcode A1, then imm64 target */
".byte 0xd5, 0x00, 0xa1\n\t"
".quad 1f\n\t"
"ud2\n\t" /* this should be skipped */
"1:\n\t");
puts("JMPABS -- OK");
return 0;
}
And this hits an abort():
$ ./build/qemu-x86_64 /tmp/jmpabs
**
ERROR:../target/i386/tcg/emit.c.inc:380:gen_writeback: code should not be reached
Bail out! ERROR:../target/i386/tcg/emit.c.inc:380:gen_writeback: code should not be reached
Aborted (core dumped)
more GDB backtrace:
Thread 1 "qemu-x86_64" received signal SIGABRT, Aborted.
__pthread_kill_implementation (no_tid=0, signo=6, threadid=140737352460800) at ./nptl/pthread_kill.c:44
44 ./nptl/pthread_kill.c: No such file or directory.
#0 __pthread_kill_implementation (no_tid=0, signo=6, threadid=140737352460800) at ./nptl/pthread_kill.c:44
#1 __pthread_kill_internal (signo=6, threadid=140737352460800) at ./nptl/pthread_kill.c:78
#2 __GI___pthread_kill (threadid=140737352460800, signo=signo@entry=6) at ./nptl/pthread_kill.c:89
#3 0x00007ffff7242476 in __GI_raise (sig=sig@entry=6) at ../sysdeps/posix/raise.c:26
#4 0x00007ffff72287f3 in __GI_abort () at ./stdlib/abort.c:79
#5 0x00007ffff76e3b57 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#6 0x00007ffff773d70f in g_assertion_message_expr () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#7 0x0000555555664f37 in gen_writeback (s=s@entry=0x7fffffffd240, decode=decode@entry=0x7fffffffd0b0, opn=opn@entry=0, v=<optimized out>) at ../target/i386/tcg/emit.c.inc:380
#8 0x0000555555677778 in disas_insn (cpu=0x55555593e780, s=0x7fffffffd240) at ../target/i386/tcg/decode-new.c.inc:3682
#9 i386_tr_translate_insn (dcbase=0x7fffffffd240, cpu=0x55555593e780) at ../target/i386/tcg/translate.c:3608
#10 0x00005555555d7962 in translator_loop (cpu=0x55555593e780, tb=0x7fffe80d0700 <code_gen_buffer+853715>, max_insns=0x7fffffffd4cc, pc=<optimized out>, host_pc=<optimized out>, ops=ops@entry=0x5555557dc5a0 <i386_tr_ops>, db=0x7fffffffd240, addr_type=TCG_TYPE_I64) at ../accel/tcg/translator.c:178
#11 0x000055555567b212 in x86_translate_code (cpu=<optimized out>, tb=<optimized out>, max_insns=<optimized out>, pc=<optimized out>, host_pc=<optimized out>) at ../target/i386/tcg/translate.c:3699
#12 0x00005555555d6644 in setjmp_gen_code (env=env@entry=0x5555559427f0, tb=tb@entry=0x7fffe80d0700 <code_gen_buffer+853715>, pc=pc@entry=4198710, host_pc=0x401136, max_insns=max_insns@entry=0x7fffffffd4cc, ti=<optimized out>) at ../accel/tcg/translate-all.c:251
#13 0x00005555555d6b0e in tb_gen_code (cpu=cpu@entry=0x55555593e780, s=...) at ../accel/tcg/translate-all.c:324
#14 0x00005555555cec1a in cpu_exec_loop (cpu=cpu@entry=0x55555593e780, sc=<optimized out>) at ../accel/tcg/cpu-exec.c:973
#15 0x00005555555ced99 in cpu_exec_setjmp (cpu=cpu@entry=0x55555593e780, sc=<optimized out>) at ../accel/tcg/cpu-exec.c:1019
#16 0x00005555555cf381 in cpu_exec (cpu=cpu@entry=0x55555593e780) at ../accel/tcg/cpu-exec.c:1045
#17 0x0000555555622c80 in cpu_loop (env=env@entry=0x5555559427f0) at ../linux-user/x86_64/../i386/cpu_loop.c:217
#18 0x00005555555a1d17 in main (argc=<optimized out>, argv=<optimized out>, envp=<optimized out>) at ../linux-user/main.c:1010
Regards,
Zhao
next prev parent reply other threads:[~2026-08-26 14:30 UTC|newest]
Thread overview: 38+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-25 12:29 [PATCH 00/20] target/i386/tcg: implement APX Paolo Bonzini
2026-08-25 12:29 ` [PATCH 01/20] target/i386/tcg: do not reuse cc_srcT Paolo Bonzini
2026-08-25 23:09 ` Richard Henderson
2026-08-25 12:29 ` [PATCH 02/20] target/i386/tcg: inline gen_ext_tl Paolo Bonzini
2026-08-25 23:09 ` Richard Henderson
2026-08-25 12:29 ` [PATCH 03/20] target/i386/tcg: simplify return value of gen_prepare_cc Paolo Bonzini
2026-08-25 12:29 ` [PATCH 04/20] target/i386/tcg: move check bits out of validate_vex Paolo Bonzini
2026-08-25 12:29 ` [PATCH 05/20] target/i386/tcg: add APX support to XSAVE/XRSTOR Paolo Bonzini
2026-09-08 2:10 ` Chang S. Bae
2026-08-25 12:29 ` [PATCH 06/20] target/i386/tcg: treat VEX as disabling high-byte registers Paolo Bonzini
2026-08-25 12:29 ` [PATCH 07/20] target/i386/tcg: add definition for REX2 prefix Paolo Bonzini
2026-09-08 2:10 ` Chang S. Bae
2026-08-25 12:29 ` [PATCH 08/20] target/i386/tcg: mark XSAVE* as not allowing REX2 Paolo Bonzini
2026-09-08 2:10 ` Chang S. Bae
2026-08-25 12:29 ` [PATCH 09/20] target/i386/tcg: decode REX2 prefix Paolo Bonzini
2026-09-08 2:10 ` Chang S. Bae
2026-08-25 12:29 ` [PATCH 10/20] target/i386/tcg: implement JMPABS instruction Paolo Bonzini
2026-08-26 14:30 ` Zhao Liu [this message]
2026-08-27 6:33 ` Paolo Bonzini
2026-08-25 12:29 ` [PATCH 11/20] target/i386/tcg: fetch modrm early Paolo Bonzini
2026-08-25 12:29 ` [PATCH 12/20] target/i386/tcg: move VEX validation early Paolo Bonzini
2026-08-28 8:32 ` Zhao Liu
2026-08-25 12:29 ` [PATCH 13/20] target/i386/tcg: extend VEX.vvvv parsing for APX Paolo Bonzini
2026-08-25 12:29 ` [PATCH 14/20] target/i386/tcg: decode EVEX prefix Paolo Bonzini
2026-08-28 9:10 ` Zhao Liu
2026-08-25 12:29 ` [PATCH 15/20] target/i386/tcg: add ZU writeback Paolo Bonzini
2026-08-25 12:29 ` [PATCH 16/20] target/i386/tcg: add decode functionality for APX Paolo Bonzini
2026-09-01 14:56 ` Zhao Liu
2026-09-02 6:55 ` Zhao Liu
2026-08-25 12:29 ` [PATCH 17/20] target/i386/tcg: implement CCMP/CTEST Paolo Bonzini
2026-09-02 6:06 ` Zhao Liu
2026-08-25 12:29 ` [PATCH 18/20] target/i386/tcg: decode APX instructions Paolo Bonzini
2026-09-02 7:27 ` Zhao Liu
2026-08-25 12:29 ` [PATCH 19/20] target/i386/tcg: mark APX as supported Paolo Bonzini
2026-09-02 9:15 ` Zhao Liu
2026-08-25 12:29 ` [PATCH 20/20] target/i386/tcg: optimize CCMP Paolo Bonzini
2026-09-02 9:29 ` Zhao Liu
2026-09-08 2:10 ` [PATCH 00/20] target/i386/tcg: implement APX Chang S. Bae
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ao74cFO91SLv9WVB@intel.com \
--to=zhao1.liu@intel.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.