From nobody Sun Apr 12 05:51:25 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=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1771075126; cv=none; d=zohomail.com; s=zohoarc; b=KQHmiFKuoA2MxpVldBl80NrLxBrIQ872K5CN9l1Td8qTFT5Zq2/PjsthNfyVEpyJJf0zc5exB8BC1cOaRsR8L5wsNdtU5Lnfyl5J11iaD9HRsufZCEDSwUQL2FiNL8vPCefDx4+EVH+tLtJOxEk7Sr6KIOHg50VjX74AM4l9HWo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1771075126; h=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=fNoZb4bp9DmDOYZJ/ogzsqn+KnRGtybuYeAcnSj4TvA=; b=k7yAlkNyTXiwDUG1Yb78HPsZ2XDqrifU9hAJ0T46yrYow+tHL+3nH6Oy98x2yScPJ+WL8YpOZCb/RbNK06PKG1vURIsI9qTsKCMW2Wwhd6m7uJBqX2C2d+BOkoTdMI5S5th4+8BU/UGvuWQst8UqU3tOj8PAAfKoe4FbJBnWv08= 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 1771075126070588.3542112978728; Sat, 14 Feb 2026 05:18:46 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vrFWy-0005fH-IU; Sat, 14 Feb 2026 08:17:52 -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 1vrFWV-0005Tg-LO for qemu-devel@nongnu.org; Sat, 14 Feb 2026 08:17:26 -0500 Received: from mail-wm1-x334.google.com ([2a00:1450:4864:20::334]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1vrFWS-0007uc-TD for qemu-devel@nongnu.org; Sat, 14 Feb 2026 08:17:23 -0500 Received: by mail-wm1-x334.google.com with SMTP id 5b1f17b1804b1-4836f363ad2so19516545e9.1 for ; Sat, 14 Feb 2026 05:17:20 -0800 (PST) Received: from archlinux (dynamic-092-224-176-164.92.224.pool.telefonica.de. [92.224.176.164]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-43796ac800esm13340471f8f.27.2026.02.14.05.17.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 14 Feb 2026 05:17:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1771075039; x=1771679839; 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=fNoZb4bp9DmDOYZJ/ogzsqn+KnRGtybuYeAcnSj4TvA=; b=QTQMRFV25fwdy2wlplrB5rWLdUO+s26wywb6ApTiDlPkgqs8yORGKf5csHCViza5tC vqmFHbhFP6Tp+yL+9a+oNHkLwcDqVpXIkGBQgQ4LI5Js6GhPp4/7YIQpe0ZRlGhkTsn8 +ZEjRhsKsHEc1IHNFUfg1+Xmj2psleiH1mSbXMMVnHJkC7O0besWz081ILKwpfqqlqAJ 8SqJgsl4PCAMI8FBtYr8gFaHdAUSmBvB3tfcECH8GORQqMN9awdHh64gaY+UKWfWkeIx +n699rkWgGBdM1usqQiQkuVQzk/EI9/rMnJzEs5g535P3et7kbFvoz5BYUaDplUpOL8l o5YQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1771075039; x=1771679839; 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=fNoZb4bp9DmDOYZJ/ogzsqn+KnRGtybuYeAcnSj4TvA=; b=CwdvbaY9Yd3IMxY6bhmDtbBvVxdhkp11d2pbr0AsnmPfN/wAgOl4VaJpvNg/miusbw IK56A1/wcBdaUa4EVBpYbK8a69N3gGfuPO2GF8MXGXX+ly5lI9SYLSmwBQ/mxYPL6Nz0 slxUTEFWpV7cbwb2NReWqb8obYK2NxTA8KHAHYn49h8o4qsJDEOdMpMknxtBlQ9hBC8O 1cUbU9HGfy02eQNgkgQ8jH7EzuqS2JubAFuBAqwNzYFHMChLAnPubttkrOp8ZOy34XwD GuhDlm4WJfPQri0utrstUiJW4DBulT9lYRx+8Vp+uKMEUQumFxv+Ha4+YmvSyP2L3WWE swnw== X-Gm-Message-State: AOJu0Yy0y2ytOrYxq6V5X8d6barVfI3VzzXTUegiG0008yADFJBFE087 Zghl622L0WAPJUs14005d0KJxiBs8LWp6dAcHXc4tmJE6rFYaVpBON2zSOGcLw== X-Gm-Gg: AZuq6aKIM9kvKTOA7cKR9cERpZYUnMwpUx8IquOcnsAfPK9SFzYic9EoFhS4IL6fXdv 7pohsCYfQmlhazAu+YyEyeIxEveuynq6VDUdmIq+YRBld895rkbazAsWmGzxXpgzNDfjhqaJVqs RS0A+AS6tTUw/M/f/nnyZVl6n1p759n0YFdtL2KtdQFaBv3eyxxw97bJDCLjhB3Cz/KD7hia1U7 POqof/eb9vu8HE7fsNKq9UT+PK0maeNTykIROoceACK33U5U2H29BQ8p8U0u/5qFzDHgUxO7gPA 0JOM4ZeSSH2tfM3Rxdz39oll7HBeBN2ii2cIDRuoQWQUhz3JSdY9wJrEUqbvu73jc2AB1Zm7+Ji C47lo0wxh/id8pcxtWCDTLhrUkJqEzbyHBhXpyhZlYtF9diCMmAEjd9Lx6Ye7P8LNawyhr7xFXy xqfN5csnPE9cwpti1Zb83qUBXdViru6WBrehOw1JUcOXjya2QaftyAXXxXYxLJjSL1OsVHIicSK ZRnbBTR1vxUyaVo X-Received: by 2002:a05:600c:190c:b0:477:5af7:6fa with SMTP id 5b1f17b1804b1-48373a59a74mr70610875e9.32.1771075038598; Sat, 14 Feb 2026 05:17:18 -0800 (PST) From: Bernhard Beschow To: qemu-devel@nongnu.org Cc: Cameron Esfahani , Magnus Kulke , Roman Bolshakov , Phil Dennis-Jordan , Wei Liu , Mohamed Mediouni , Bernhard Beschow Subject: [PATCH 1/3] target/i386/emulate/x86_decode: Fix compiler warning Date: Sat, 14 Feb 2026 14:16:57 +0100 Message-ID: <20260214131659.31378-2-shentey@gmail.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260214131659.31378-1-shentey@gmail.com> References: <20260214131659.31378-1-shentey@gmail.com> MIME-Version: 1.0 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::334; envelope-from=shentey@gmail.com; helo=mail-wm1-x334.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, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham 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 @gmail.com) X-ZM-MESSAGEID: 1771075128821154100 Content-Type: text/plain; charset="utf-8" When compiling for i386-softmmu under MSYS2, GCC emits the following warnin= g: In function 'get_reg_val', inlined from 'calc_modrm_operand64' at ../src/target/i386/emulate/x86= _decode.c:1796:15: ../src/target/i386/emulate/x86_decode.c:1703:5: error: 'memcpy' forming o= ffset [4, 7] is out of the bounds [0, 4] of object 'val' with type 'target_= ulong' {aka 'unsigned int'} [-Werror=3Darray-bounds=3D] 1703 | memcpy(&val, | ^~~~~~~~~~~~ 1704 | get_reg_ref(env, reg, rex_present, is_extended, size), | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1705 | size); | ~~~~~ ../src/target/i386/emulate/x86_decode.c: In function 'calc_modrm_operand6= 4': ../src/target/i386/emulate/x86_decode.c:1702:18: note: 'val' declared here 1702 | target_ulong val =3D 0; | ^~~ In the calc_modrm_operand64() case the compiler sees size =3D=3D 8 to be me= m-copied to a target_ulong variable which is only 4 bytes wide in case of i386-softm= mu. Note that when size !=3D 1, get_reg_ref() always returns a pointer to an 8 = byte register, regardless of the target_ulong size. Fix the compiler warning by always providing 8 bytes of storage by means of uint64_t. Fixes: 77a2dba45cc9 ("target/i386/emulate: stop overloading decode->op[N].p= tr") cc: qemu-stable Signed-off-by: Bernhard Beschow Reviewed-by: Mohamed Mediouni > Reviewed-by: Wei Liu (Microsoft) --- target/i386/emulate/x86_decode.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/i386/emulate/x86_decode.c b/target/i386/emulate/x86_dec= ode.c index d037ed1142..6ad03b71b0 100644 --- a/target/i386/emulate/x86_decode.c +++ b/target/i386/emulate/x86_decode.c @@ -1699,7 +1699,7 @@ void *get_reg_ref(CPUX86State *env, int reg, int rex_= present, target_ulong get_reg_val(CPUX86State *env, int reg, int rex_present, int is_extended, int size) { - target_ulong val =3D 0; + uint64_t val =3D 0; memcpy(&val, get_reg_ref(env, reg, rex_present, is_extended, size), size); --=20 2.53.0 From nobody Sun Apr 12 05:51:25 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=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1771075104; cv=none; d=zohomail.com; s=zohoarc; b=eTVMexIzN+UHphDDArTORW8nP8EaHEBvgpJRUFuavuzIbS79DNMe8z/deNKYq7GXFnqW6ETLqauO9FD7mLgJfApqMGoT6EBdu8iqlCL3ENdOdET03h6pwl7kScg6xL0QnmToeB1KZ3RCYWKDdxdtKDMRtqr+ZivWBkEJunR0Rac= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1771075104; h=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=yMv+L0cpevCd1h8t6bpXrKu22mF1AowIc+cuUvHrjXM=; b=VYW7RXH/Ni//+pAWXdyfG6T5uiIYNmoVvwz+GT4ReBeQ2CBT0roRKP22/hH8N2wd/yWzqtDRCDWb4I38IFBflGTcYWK/LgqUDRC/3IXrDfrPxmnqcX/cmuncRAQ4wO1PGFLwnmkVTeF0E9NC4TBP1AdHeMEta8vs2Xw3VPZrKDQ= 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 1771075104212989.5605168685946; Sat, 14 Feb 2026 05:18:24 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vrFWb-0005W7-1a; Sat, 14 Feb 2026 08:17:29 -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 1vrFWW-0005U7-PD for qemu-devel@nongnu.org; Sat, 14 Feb 2026 08:17:26 -0500 Received: from mail-wr1-x42b.google.com ([2a00:1450:4864:20::42b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1vrFWU-0007v5-9J for qemu-devel@nongnu.org; Sat, 14 Feb 2026 08:17:24 -0500 Received: by mail-wr1-x42b.google.com with SMTP id ffacd0b85a97d-4376c0bffc1so1305886f8f.0 for ; Sat, 14 Feb 2026 05:17:21 -0800 (PST) Received: from archlinux (dynamic-092-224-176-164.92.224.pool.telefonica.de. [92.224.176.164]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-43796ac800esm13340471f8f.27.2026.02.14.05.17.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 14 Feb 2026 05:17:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1771075040; x=1771679840; 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=yMv+L0cpevCd1h8t6bpXrKu22mF1AowIc+cuUvHrjXM=; b=cBhAP0ib91NMtUO1ZG3VQdb4buD3TpwkXdjxQwSHzNF5PmO6/0iAaUcCDa469eoPhp +x5Zp82LcPqBD+Ju+ab+tCV/nOJtaEo0pEs9XiBh0XZkOoFw09ylvV3XLEyRFIFCuw5Y 140wJn/0Pb0+8AKQSqOoHT24/zXw171+1fUYlqA/sclX9EFpiNo4KFdDEy6JFR1MXjWn H9GMouagdY0lZeCCeGBK2dar7Vl+0256rsAufaDzbaBDU5aZHluy/am7bzupCLYb0SsL 6nFNchtSDTIPugvmUz2+37D/jZA68mlcEf3Vv70cgL1dQpC4r9tnRUaimSOmIxYI/1Gg EVYA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1771075040; x=1771679840; 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=yMv+L0cpevCd1h8t6bpXrKu22mF1AowIc+cuUvHrjXM=; b=ZIK64/OPhQvinI8G4JgqB/qVdxEYTqh+F3QNkEUfwBycZRGGg4zEZoq/1DJPaK/KvB weuvmu+h1vdY9LTqNEQAXIYMrmvonYdKbdAB1+faDi52qIQQ1XL3NBd7HkRdn113vayX gGagZv0e1A+QlRiRXgylRXrbUYwc9w+44Z2WQ2uxYEcAwNIkRQtJ5qs+PuZXiiB4lz+I AF/fRJEtxd3BdbVb2l/wsaHeYyfkilIE23Yk9ha2/1DANtztqI2De98aGTRuoMpc8c/O xCD1QgPHb5Op/cMQyJ6ADhXk31Siwf+chff8oU6XFT355cmuOHQJy691mgC44nk9Gr1X HTzQ== X-Gm-Message-State: AOJu0YxbqGkfEh1IgTMZ52CNR0893AGWhRzrFrHKsWJ8CXoQ/ePsRNbO 3Ap9i4djSpNnek9yWRJFTTt27s94UVtLO3DXVUCcZia5apq4cjeFdu/524UJcw== X-Gm-Gg: AZuq6aLW0SGB8YB9AjbqmPTWrTZUUTyh6Atgvkj80fPxRtlUucYbFoTd6FiChWRDHli bHTG4DCIvT3JictkGiIY5g/BUQ1Vmnhxdks9Azxu9A2EL+uJi9FQ2tm8NSsl4qoa54AiXnXU4ES CVz6w0FMm/czHQcQxeGJuHRXAE16tY5bf9V0WoInvv/YeWXKAcvJs6JD7Hd/S7DUYlEJYV6ZYZo nnYsC/ejxLaaOx6HXy5AUWs2Dj7I4trctKjtirRwCWGJN4EpAEj/gHFbkylA6Yq+9O1c0MxPh1V f0WcvZjyiii1LGvXAR57AuqlhHNgsCItBGkukA4MXI/FVFqgFLAM4ZB7wo+3ARNV+qQTj98h/+o KTyxwAVjIRIa3/jKL83Jk8uQpjqy6R7v9qM/s82Hkqs8YXdMxK82oe77Dr1qC9ngzt9npy5tFxi 5TaUM5owj22CRqUHOUc6OY5d67j81ZOOj4InqVIJ50VPX4KIl3iLaesxQGQvb8GfsPVsPWUU6DS 5u09cmFaziylSaB X-Received: by 2002:a5d:5d06:0:b0:437:6f0c:2ed with SMTP id ffacd0b85a97d-4379790f0a9mr9220903f8f.34.1771075039750; Sat, 14 Feb 2026 05:17:19 -0800 (PST) From: Bernhard Beschow To: qemu-devel@nongnu.org Cc: Cameron Esfahani , Magnus Kulke , Roman Bolshakov , Phil Dennis-Jordan , Wei Liu , Mohamed Mediouni , Bernhard Beschow Subject: [PATCH 2/3] target/i386/hvf/x86_mmu: Fix compiler warning Date: Sat, 14 Feb 2026 14:16:58 +0100 Message-ID: <20260214131659.31378-3-shentey@gmail.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260214131659.31378-1-shentey@gmail.com> References: <20260214131659.31378-1-shentey@gmail.com> MIME-Version: 1.0 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::42b; envelope-from=shentey@gmail.com; helo=mail-wr1-x42b.google.com X-Spam_score_int: -10 X-Spam_score: -1.1 X-Spam_bar: - X-Spam_report: (-1.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, FORGED_GMAIL_RCVD=1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no 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 @gmail.com) X-ZM-MESSAGEID: 1771075106616154100 Content-Type: text/plain; charset="utf-8" When reusing the code in WHPX, GCC emits the following warning when compili= ng for i386-softmmu under MSYS2: In file included from ../src/target/i386/emulate/x86_mmu.c:20: ../src/target/i386/emulate/x86_mmu.c: In function 'vmx_write_mem': ../src/target/i386/emulate/x86_mmu.c:251:25: error: format '%llx' expects= argument of type 'long long unsigned int', but argument 3 has type 'target= _ulong' {aka 'unsigned int'} [-Werror=3Dformat=3D] 251 | VM_PANIC_EX("%s: mmu_gva_to_gpa %llx failed\n", __fun= c__, gva); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ = ~~~ | = | | = target_ulong {aka unsigned int} ../src/target/i386/emulate/panic.h:34:12: note: in definition of macro 'V= M_PANIC_EX' 34 | printf(__VA_ARGS__); \ | ^~~~~~~~~~~ ../src/target/i386/emulate/x86_mmu.c:251:48: note: format string is defin= ed here 251 | VM_PANIC_EX("%s: mmu_gva_to_gpa %llx failed\n", __fun= c__, gva); | ~~~^ | | | long long unsigned= int | %x Fix the warning by reusing the target-specific macro TARGET_FMT_lx which ex= ists for this exact purpose. Fixes: c97d6d2cdf97 ("i386: hvf: add code base from Google's QEMU repositor= y") cc: qemu-stable Signed-off-by: Bernhard Beschow Reviewed-by: Mohamed Mediouni > Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Wei Liu (Microsoft) --- target/i386/hvf/x86_mmu.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/target/i386/hvf/x86_mmu.c b/target/i386/hvf/x86_mmu.c index afc5c17d5d..fe44d2edf4 100644 --- a/target/i386/hvf/x86_mmu.c +++ b/target/i386/hvf/x86_mmu.c @@ -244,7 +244,8 @@ void vmx_write_mem(CPUState *cpu, target_ulong gva, voi= d *data, int bytes) int copy =3D MIN(bytes, 0x1000 - (gva & 0xfff)); =20 if (!mmu_gva_to_gpa(cpu, gva, &gpa)) { - VM_PANIC_EX("%s: mmu_gva_to_gpa %llx failed\n", __func__, gva); + VM_PANIC_EX("%s: mmu_gva_to_gpa " TARGET_FMT_lx " failed\n", + __func__, gva); } else { address_space_write(&address_space_memory, gpa, MEMTXATTRS_UNSPECIFIED, data, copy); @@ -265,7 +266,8 @@ void vmx_read_mem(CPUState *cpu, void *data, target_ulo= ng gva, int bytes) int copy =3D MIN(bytes, 0x1000 - (gva & 0xfff)); =20 if (!mmu_gva_to_gpa(cpu, gva, &gpa)) { - VM_PANIC_EX("%s: mmu_gva_to_gpa %llx failed\n", __func__, gva); + VM_PANIC_EX("%s: mmu_gva_to_gpa " TARGET_FMT_lx " failed\n", + __func__, gva); } address_space_read(&address_space_memory, gpa, MEMTXATTRS_UNSPECIF= IED, data, copy); --=20 2.53.0 From nobody Sun Apr 12 05:51:25 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=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1771075123; cv=none; d=zohomail.com; s=zohoarc; b=NSRZ/oq8zyN7Y70Wbh32eQQVQgHErIR6yWskJSdA/AtI2hw9ftzeQCRX3Mw/A7OIjrdzhf0/gkLYA1SdfSkDlLTA9qrrKdkPUJ8HDCBpTJFpS3rns4a7pgQm8HEl1q9tJH+L5kAJkFlOPuN4RwGmg2v67j9d7aI/WuOKZKg6qWw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1771075123; h=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=uz2Q2r2Kx3bjbyNSueRh5MEBau+EbL1eCrXfzJbXPkc=; b=iOvWbXJhG9dMo189VNdm1iC9XM0iohq0cDRTmxNKFjy0LzSrnHeox9rJbl4dhni81XjHfCiB2cuflqHd7NwTiCcay/RFgiitQ0Jj6oVFLdGSuFrWTiaahkumUDcoqJDpAIDHXw/2V2qOF0Mgx24djg2C6ZlyU0JQ7tqjvYoO42U= 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 1771075123483724.5614050813807; Sat, 14 Feb 2026 05:18:43 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vrFWt-0005Wc-GI; Sat, 14 Feb 2026 08:17:49 -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 1vrFWX-0005UC-CX for qemu-devel@nongnu.org; Sat, 14 Feb 2026 08:17:26 -0500 Received: from mail-wr1-x431.google.com ([2a00:1450:4864:20::431]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1vrFWV-0007y4-Th for qemu-devel@nongnu.org; Sat, 14 Feb 2026 08:17:25 -0500 Received: by mail-wr1-x431.google.com with SMTP id ffacd0b85a97d-435f177a8f7so1907353f8f.1 for ; Sat, 14 Feb 2026 05:17:23 -0800 (PST) Received: from archlinux (dynamic-092-224-176-164.92.224.pool.telefonica.de. [92.224.176.164]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-43796ac800esm13340471f8f.27.2026.02.14.05.17.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 14 Feb 2026 05:17:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1771075042; x=1771679842; 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=uz2Q2r2Kx3bjbyNSueRh5MEBau+EbL1eCrXfzJbXPkc=; b=Smchuys8tzugLYRJJvtFvGNYbjGYPkFgPjAGxDfEHh7QiBGbLGJ0Rcktm8iEcZhmbm lAnwP8va8J0jRcyXMkT/XM50BNcHn0PQQ/SzWS3kzTyUMyPK7cbjoXgRdfO9ALM42khU 6cw5QmD92r/CgC0QbUs87jAi3bOaeOZZYegxSXE4We2JZmBMDJYo9PJx6EsDtbccDohQ PN55BlT7J7TlKadDeUmSs9NN0zj+1czZimK1wClx3qdxX0krHbd3prCT4G9SbmU8sTPm OoFBjkw5gZtPTE3G+446Fr3xaFNSJ/6rAHEgODvli0FvikpsVqAgcEGWy5ib/W3HHzly n/IQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1771075042; x=1771679842; 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=uz2Q2r2Kx3bjbyNSueRh5MEBau+EbL1eCrXfzJbXPkc=; b=qITWwQlhcKPZMkS5jzpUA/Bxhtg2Ik0ces4RrXBFInpe0BuSHR8pOt5BxUWrID4By7 8l7mfajNOrghP68eGZnTHPfAEriqw4E9ebqNIT82f1UmMzu3LxwKtxHa3WBVH+oTfGWa aY7XbVZotAMyarl1N6k+BlCcrhF4P3ty1rUA/k7rRE9dGpaD3YP/QhT5QM/3ktuHQcDF jRFpWNNLYAd2beJpvQOwQriwmED4aTJN5qyRQeF6apEv6/V77JRie+R1KvMjO4zOioeP gluypZUXaaaDivRzfUs3XiLC5XbJ2MLSGTCC72/V/ZCQug8W3xu3vF39W+aXR04pQ6Ql AWeg== X-Gm-Message-State: AOJu0YxJw3uLS/o9vWGbpiX5ifcaDxpUb4VfgTObkP8oclI0tQx6mQ8t YCK89X7PI4ACaHmfVuQ4GK5qfUUl5BoQadqAEsbE3AtAkFrIEU9riPv0hhAskgOb X-Gm-Gg: AZuq6aJeM3/0r983ipxdXhyAsVY1YQ4N1Fx2/UpCLkV2OnBtwaUEgHG6t5laIPuLsin raFJjHBSHqmL9Q4YTB8BWuypvrnOTclCBrn0C0/ekmh4sr7i9jk+jjl/Gz/qNfMfqSCqtmP512g wWa1WAtvA4wc5vYzvj76CHC7VP0pSpqluG6smfBRIAbhX1bGw+40VvhuImQdDt9+woa2ZC/pcLp OgJ3G4Lb81P2Ouv4kCWkOUwNWrj/CLgKEmpdiUG3PvE1xmXtDGtI9ESehzkNpDhbH19uQRKSvT4 5WFMfgDt83plcosb62EuK1PeH6Nk2w6YD5aWac1+YpV0d3zHpSucqa6HnYA7e8WtbHOHEcGZCFo DhNEGpNABuVdE+aMWXhIZqiwY6YZoh+TjFJKfziTFwkF6LL17XKozZ5Fx+memuu9Ap44mG+l+Xt Xi6Y1ehkFM4Qrd4nqb+1Nw7SlxsiPdpqW8IzEKIEHMBNY248rPJUKGvIipHUZo6kWaVAFvP93OQ Dv0t17PqXj9LnVM X-Received: by 2002:a05:6000:2387:b0:435:9a50:bbb4 with SMTP id ffacd0b85a97d-4379dbae64dmr3963260f8f.59.1771075041860; Sat, 14 Feb 2026 05:17:21 -0800 (PST) From: Bernhard Beschow To: qemu-devel@nongnu.org Cc: Cameron Esfahani , Magnus Kulke , Roman Bolshakov , Phil Dennis-Jordan , Wei Liu , Mohamed Mediouni , Bernhard Beschow Subject: [PATCH 3/3] target/i386/emulate/x86_decode: Actually use stream in decode_instruction_stream() Date: Sat, 14 Feb 2026 14:16:59 +0100 Message-ID: <20260214131659.31378-4-shentey@gmail.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260214131659.31378-1-shentey@gmail.com> References: <20260214131659.31378-1-shentey@gmail.com> MIME-Version: 1.0 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::431; envelope-from=shentey@gmail.com; helo=mail-wr1-x431.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, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham 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 @gmail.com) X-ZM-MESSAGEID: 1771075125010158500 Content-Type: text/plain; charset="utf-8" Compared to decode_instruction(), decode_instruction_stream() has an additi= onal stream parameter which avoids some guest memory accesses during instruction decoding. Both functions defer the actual work to decode_opcode() which wou= ld set the stream pointer to zero such that decode_instruction_stream() essent= ially behaved like decode_instruction(). Given that all callers of decode_instruction_stream() properly zero-initialize the decode parameter, = the memset() call can be moved into decode_instruction() which is the only other user of decode_opcode(). This preserves the non-zero stream pointer which avoids extra guest memory accesses. Fixes: 1e25327b244a ("target/i386/emulate: Allow instruction decoding from = stream") cc: qemu-stable Signed-off-by: Bernhard Beschow Reviewed-by: Mohamed Mediouni > Reviewed-by: Wei Liu (Microsoft) --- target/i386/emulate/x86_decode.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/target/i386/emulate/x86_decode.c b/target/i386/emulate/x86_dec= ode.c index 6ad03b71b0..7bbcd2a9a2 100644 --- a/target/i386/emulate/x86_decode.c +++ b/target/i386/emulate/x86_decode.c @@ -2088,8 +2088,6 @@ static void decode_opcodes(CPUX86State *env, struct x= 86_decode *decode) =20 static uint32_t decode_opcode(CPUX86State *env, struct x86_decode *decode) { - memset(decode, 0, sizeof(*decode)); - decode_prefix(env, decode); set_addressing_size(env, decode); set_operand_size(env, decode); @@ -2101,6 +2099,8 @@ static uint32_t decode_opcode(CPUX86State *env, struc= t x86_decode *decode) =20 uint32_t decode_instruction(CPUX86State *env, struct x86_decode *decode) { + memset(decode, 0, sizeof(*decode)); + return decode_opcode(env, decode); } =20 --=20 2.53.0