From nobody Fri Mar 27 04:03:43 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1771529100; cv=none; d=zohomail.com; s=zohoarc; b=WKTiCeyaHw8EpjWx+hFWR1VgEh0hs0uK9GeUr9lUfYaLsqsLcf9QaOrX5btomEa52+mGrMvXyo00RMtbkWi4QUuZKrAATPA0H0pd7ctonXCkd6p063qep7OVN1Bnm4CjTu1AfosTvpoey3/juMM5L9DI23P8NdbW4DbFZWYvfb0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1771529100; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=ORxZRk5GfpOpGN2karLQcvtsyotrG6XvafLw6XoTvc0=; b=Nshf8icg8U3gprci35b+yX/sonvl0Tfu1D6iVVQg+zWf555osNbRoo0KaSv3ULJznXAexsNi7rCZqka/nyjwH/g0lxljJc+B/hzjK4z37TDelKli775ROsbpt9p1Qd5oLXlPleXYXqmlF46xq6peUFs2rXe2Ux3oS+urEr9cdfk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1771529100865352.9938961192004; Thu, 19 Feb 2026 11:25:00 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vt9cw-0006uv-GD; Thu, 19 Feb 2026 14:23:54 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vt9ce-0005Y6-Jh for qemu-devel@nongnu.org; Thu, 19 Feb 2026 14:23:36 -0500 Received: from mail-wm1-x32c.google.com ([2a00:1450:4864:20::32c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1vt9cc-0008VC-N7 for qemu-devel@nongnu.org; Thu, 19 Feb 2026 14:23:36 -0500 Received: by mail-wm1-x32c.google.com with SMTP id 5b1f17b1804b1-48375f1defeso9550955e9.0 for ; Thu, 19 Feb 2026 11:23:34 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-43796ac8209sm51744567f8f.30.2026.02.19.11.23.31 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 19 Feb 2026 11:23:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1771529013; x=1772133813; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=ORxZRk5GfpOpGN2karLQcvtsyotrG6XvafLw6XoTvc0=; b=IcwkkuTBphib60DwL8NMvlxJYaPwnmp1SjoxW5UL+wzm7AAqI4npRrlSR3KWN2vR7N sc0N7Anen7mcg6DZ5az/YfTA/gSzmXX5TpO5YcpJfaCylD04PwFsu/3AAE46PKCQQ5EY utEXTZax+/jZ3I1+EroD/ud7iekp9mKRQzBUcKaHcURANS1WwyAp5T6kTbzgc0ZJGO6N GoiYf4KnFon8O1qmM5c0nYesxli1vvXPlgfcWQODyMpA3riQIx2EBLhVwxE7J9wsQvUH ywhXAwTk0gCWiXIQ7aGAnZ47H+Lyk8/wXk1/oC1htZ8OENQHmL6WcGxioD/OUzrgMa6J W3Ww== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1771529013; x=1772133813; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=ORxZRk5GfpOpGN2karLQcvtsyotrG6XvafLw6XoTvc0=; b=o1KKYfmNQWkQgQEf6T0hpgmdtOHke6nGeaCL1tbrvuezZobBE9XNKG8iSS/3FGPa8v V7kyoCXAu9AUfzEzqwuocRkEiGMCfdClfhz1Ompn22eTj1ct0YvAviBA959Ljn1/hyPV b32nNh6d6OfXfmD5/9DUjYeM0cSUDDypNskiityPaghtmrAjqxLmEa5Vc9lTbqvfQtw/ +53z6NDp6VcDbY8uHlW/KMMWeXo0eUc7ImOaUCVC2gDhR5IebEkYjqjC47bPow/ZG91S OhbErwaCdJT+SNT3hxFjc4MfV7NEQux1vfwSN7K0/ydksj4pXKwAi/P5u1X+WvvuIZ8M Vjuw== X-Gm-Message-State: AOJu0YwtTTwcAjbR50Ru5jzrF/nOA0kparKSqZLFBq/NzEXJNmnSDpKc Y4JRvfRGbFDqREzHe/S3iJTu6LklD2EiYFRMx+K+FabUw46QZgOHzzUYLaHtIhF7fuuz+Qoz9eE 1MirvNL87gw== X-Gm-Gg: AZuq6aKrF67cw288mIiPRss4l09jmOpuBIwim3Kf3XO81G5Xw+SRnw05ohCPhE7MmNA V7d/Djt2kg14QnASw6ItWjOf1XO8BWvwZH7JrPilQO6/R5uof3RPTH8jNq2k9RJxw1gjbip7lwg rZ6sJGs+Mc1+WdAuU1c50GjKue2u4SB4Fi5sCwEGX7ALQNmA4o4Y2yUh7urhwCuWITDDa05/7zb UZbcN02GWAMhIVU4Hr5VnKa7pezrLyQTdSHL685jxSaB3p4t4XYegEOYnhfSyc3IDphihfWTUri CVxU0+H3Xiwp7jrnse14+XR6F17INvqJxRtvRoxRjdzB0QvRJAL7kChKaYpmYWosvzQF84xe31m I+W2ajbm/jjBYKtoBpXyExJxcobou8+dbVnuBVXXuENmEbkK1UkCBCJNsl4dOH61mY1PenwtCVE ec3kkQcanl3dsydNvGlX8dcfeC5wK4/RZcm1/PHsHYyRKP+PrJaU9huKRNxNUCdTGHZjuBY/N8 X-Received: by 2002:a05:6000:2dca:b0:436:1a23:3949 with SMTP id ffacd0b85a97d-43958df369dmr14018313f8f.10.1771529012724; Thu, 19 Feb 2026 11:23:32 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Pierrick Bouvier , Richard Henderson , qemu-s390x@nongnu.org, =?UTF-8?q?Alex=20Benn=C3=A9e?= , qemu-riscv@nongnu.org, qemu-ppc@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Paolo Bonzini , Zhao Liu Subject: [PATCH v2 30/50] target/i386: Expand 64-bit definitions when TARGET_LONG_BITS == 64 Date: Thu, 19 Feb 2026 20:19:32 +0100 Message-ID: <20260219191955.83815-31-philmd@linaro.org> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260219191955.83815-1-philmd@linaro.org> References: <20260219191955.83815-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::32c; envelope-from=philmd@linaro.org; helo=mail-wm1-x32c.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1771529102552154100 Where both gdb_read/write_register() functions check for 'TARGET_LONG_BITS =3D=3D 64' we can expand the following definitions: ldtul_p() -> ldq_p() gdb_get_regl() -> gdb_get_reg64() Do the same in i386_cpu_gdb_get_egprs(): check TARGET_LONG_BITS to effectively inline gdb_get_regl(). Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Pierrick Bouvier --- target/i386/gdbstub.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/target/i386/gdbstub.c b/target/i386/gdbstub.c index f358bcf9e86..f1ce90a046e 100644 --- a/target/i386/gdbstub.c +++ b/target/i386/gdbstub.c @@ -129,7 +129,7 @@ int x86_cpu_gdb_read_register(CPUState *cs, GByteArray = *mem_buf, int n) return gdb_get_reg64(mem_buf, env->regs[gpr_map[n]] & 0xffffffffUL); } else { - return gdb_get_regl(mem_buf, 0); + return gdb_get_reg64(mem_buf, 0); } } else { return gdb_get_reg32(mem_buf, env->regs[gpr_map32[n]]); @@ -283,9 +283,9 @@ int x86_cpu_gdb_write_register(CPUState *cs, uint8_t *m= em_buf, int n) if (n < CPU_NB_REGS) { if (TARGET_LONG_BITS =3D=3D 64) { if (env->hflags & HF_CS64_MASK) { - env->regs[gpr_map[n]] =3D ldtul_p(mem_buf); + env->regs[gpr_map[n]] =3D ldq_p(mem_buf); } else if (n < CPU_NB_REGS32) { - env->regs[gpr_map[n]] =3D ldtul_p(mem_buf) & 0xffffffffUL; + env->regs[gpr_map[n]] =3D ldq_p(mem_buf) & 0xffffffffUL; } return sizeof(target_ulong); } else if (n < CPU_NB_REGS32) { @@ -449,8 +449,10 @@ static int i386_cpu_gdb_get_egprs(CPUState *cs, GByteA= rray *mem_buf, int n) /* EGPRs can be only directly accessible in 64-bit mode. */ if (env->hflags & HF_CS64_MASK) { return gdb_get_reg64(mem_buf, env->regs[gpr_map[n + CPU_NB_REG= S]]); + } else if (TARGET_LONG_BITS =3D=3D 64) { + return gdb_get_reg64(mem_buf, 0); } else { - return gdb_get_regl(mem_buf, 0); + return gdb_get_reg32(mem_buf, 0); } } =20 --=20 2.52.0