[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH for-9.1 09/19] target/i386: move 60-BF opcodes to new decoder
|
From: |
Paolo Bonzini |
|
Subject: |
Re: [PATCH for-9.1 09/19] target/i386: move 60-BF opcodes to new decoder |
|
Date: |
Wed, 24 Apr 2024 13:13:01 +0200 |
On Thu, Apr 11, 2024 at 5:05 PM Zhao Liu <zhao1.liu@intel.com> wrote:
> HMM, I met Guest boot failure on this patch because of ata unrecognized.
> I haven't located the exact error yet, so let me post my log first.
> If there are other means I can use to dig further, I'd be happy to try
> that too.
>
> # Command (boot a ubuntu Guest via TCG)
>
> ./qemu/build/qemu-system-x86_64 \
> -smp 1 \
> -name ubuntu -m 4G \
> -cpu max -accel tcg \
> -hda ../img_qemu/test.qcow2 -nographic \
> -kernel ../img_qemu/kernel/vmlinuz-6.4.0-rc6+ \
> -initrd ../img_qemu/kernel/initrd.img-6.4.0-rc6+ \
> -append "root=/dev/sda ro console=ttyS0" \
> -qmp unix:/tmp/qmp-sock,server=on,wait=off
The issue is that INS and OUTS are using the incorrect operand size.
While at it I also made OUTS a bit more similar to OUT:
diff --git a/target/i386/tcg/decode-new.c.inc b/target/i386/tcg/decode-new.c.inc
index 0951b042dfa..46682cfe070 100644
--- a/target/i386/tcg/decode-new.c.inc
+++ b/target/i386/tcg/decode-new.c.inc
@@ -1544,8 +1544,8 @@ static const X86OpEntry opcodes_root[256] = {
[0x6B] = X86_OP_ENTRY3(IMUL3, G,v, E,v, I,b, sextT0),
[0x6C] = X86_OP_ENTRYrr(INS, Y,b, 2,w), /* DX */
[0x6D] = X86_OP_ENTRYrr(INS, Y,z, 2,w), /* DX */
- [0x6E] = X86_OP_ENTRYrr(OUTS, 2,w, X,b), /* DX */
- [0x6F] = X86_OP_ENTRYrr(OUTS, 2,w, X,b), /* DX */
+ [0x6E] = X86_OP_ENTRYrr(OUTS, X,b, 2,w), /* DX */
+ [0x6F] = X86_OP_ENTRYrr(OUTS, X,z, 2,w), /* DX */
[0x78] = X86_OP_ENTRYr(Jcc, J,b),
[0x79] = X86_OP_ENTRYr(Jcc, J,b),
@@ -1592,7 +1592,7 @@ static void gen_INC(
static void gen_INS(DisasContext *s, CPUX86State *env, X86DecodedInsn *decode)
{
- MemOp ot = decode->op[0].ot;
+ MemOp ot = decode->op[1].ot;
TCGv_i32 port = tcg_temp_new_i32();
tcg_gen_trunc_tl_i32(port, s->T1);
@@ -2310,10 +2310,10 @@ static void gen_OUT(
static void gen_OUTS(DisasContext *s, CPUX86State *env, X86DecodedInsn *decode)
{
- MemOp ot = decode->op[2].ot;
+ MemOp ot = decode->op[1].ot;
TCGv_i32 port = tcg_temp_new_i32();
- tcg_gen_trunc_tl_i32(port, s->T0);
+ tcg_gen_trunc_tl_i32(port, s->T1);
tcg_gen_ext16u_i32(port, port);
if (!gen_check_io(s, ot, port, SVM_IOIO_STR_MASK)) {
return;
(sorry about any word breaking)
- [PATCH for-9.1 08/19] target/i386: allow instructions with more than one immediate, (continued)
- [PATCH for-9.1 15/19] target/i386: port extensions of one-byte opcodes to new decoder, Paolo Bonzini, 2024/04/09
- [PATCH for-9.1 11/19] target/i386: move C0-FF opcodes to new decoder (except for x87), Paolo Bonzini, 2024/04/09
- [PATCH for-9.1 14/19] target/i386: move BSWAP to new decoder, Paolo Bonzini, 2024/04/09
- [PATCH for-9.1 19/19] target/i386: remove duplicate prefix decoding, Paolo Bonzini, 2024/04/09
- [PATCH for-9.1 12/19] target/i386: merge and enlarge a few ranges for call to disas_insn_new, Paolo Bonzini, 2024/04/09