From nobody Sat Sep 26 20:50:45 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=1788350693; cv=none; d=zohomail.com; s=zohoarc; b=fULjtobTnWD7DGEeuvvz2LwSUaBMCFVC6Rem7fjirX3yGhKBBXKeP9g65+yZPImcgEsmY/CWmDIZFosFI9rvXT0PlWWIsHCSwp6xtor69NykugHCYH/EZS09Tu5wWHWTzCBSgCixeg5asuzfs7vIGeEGt1PvjlIY0skqgXsnvns= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1788350693; 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=pH3G939DzcQw9XZQ2ox4honL/Bo1JBOKbYmXh2s86dk=; b=l2M43QgU4wJC2R3yGyse5WMHrO0s6ppg0QzfHAoJ7yuzLJOXouZmOkuo0UEj6XTeV0daESwwquQqiw4cx7432yjWlf6eWkFdWdgPCDUILwSxeLjoHbSw4+CpViAdjFG+suexFGi8cMLWj+dkfzhThUqGwUvTAvQQxIfmU6Ck/dQ= 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 lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1788350693300189.4213150672473; Wed, 2 Sep 2026 05:04:53 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1x1jhp-0002VN-9D; Wed, 02 Sep 2026 08:04:41 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1x1jhf-0002UC-2d for qemu-devel@nongnu.org; Wed, 02 Sep 2026 08:04:31 -0400 Received: from mail-wr1-x434.google.com ([2a00:1450:4864:20::434]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1x1jhd-0007hM-Ax for qemu-devel@nongnu.org; Wed, 02 Sep 2026 08:04:30 -0400 Received: by mail-wr1-x434.google.com with SMTP id ffacd0b85a97d-482f2ee53e7so622169f8f.1 for ; Wed, 02 Sep 2026 05:04:28 -0700 (PDT) Received: from simon-macbookpro.tugraz.local (tug-swl-225-161.tugraz.at. [129.27.225.161]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-484492cdc37sm6504420f8f.34.2026.09.02.05.04.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 02 Sep 2026 05:04:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1788350668; x=1788955468; 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:content-type; bh=pH3G939DzcQw9XZQ2ox4honL/Bo1JBOKbYmXh2s86dk=; b=otpL3jRGpn0oiO8CGyCka9UH5Gl9P5/JMzNsMiq5tOTojrdtE4Y7zmLYJjNW9G+rhk Xvd2PMx7vi/Z50LBfy4d/kNbJP4PU9//Tm+dPq7Izm4WiQFHRefSwRXxXFr+Tc/9l9Mc bdMg+G8FmSxphv9g1a0e4AtQEAdQ5kh0ixHc3N74LX+iZz/Is2yPPAbordxpjOOoE9la su7z0A4talDiWAMhjzfWh0NqjvrzsT+ZYurGQT/fK/5OgBTUJ/FBR2SFuZmAlmG5vWOx eDmObZwj53sxDl71Nu8L4p1QOjDJsv6nG9iaMghfIcrH53u8TIai52LCy9+uPDIsZYB5 MQog== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1788350668; x=1788955468; 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:content-type; bh=pH3G939DzcQw9XZQ2ox4honL/Bo1JBOKbYmXh2s86dk=; b=mgGwHON5wNvzvbA2pxiZo/RikT0gjahbg1fJez7BfqpAdp5ROLFGAC/TZMky3i8Xue QVdoR0BkrDBtOA7q9uAGcqMHwZow1WoqKOgejqb0eRMz0AlBh4LgLEUoyJ75kJuKG/aH g/DiaAiikK1d6JeQKlN3RURQnbTBOvFSf3eWg4IQIHzhzu+g3782ZA7wqlxwa1Vab1RK la8aBaGnzbUQhRJf/GRNJSoYzWUDWwHm+ynKN3yk4+nZcicQYxJGd5XCESInJUlqQXSP dgE8FGOpXiu3QF9GA0T7pVxF3JPIsYWT7B5PnOej7E2gNNlzACvLqAzvVTrffQix6muU DVsQ== X-Gm-Message-State: AFuF++kTWnzC6BH62TGZRSOR3XlkuZ+ibTETgnRhSNoSmKeBWpnFqQl+ BNdSchxNgZ+gUSC3oxWVS5HqpnfTp8U05VqpBDwtQJty/n6BrOyn+WzqMmFIIGSY2ik= X-Gm-Gg: AYBFou3Y0OCaPBeigbeNmf/fcmpEzx25Gc2n1xluUf90jMq/ye0Tj3+WzCbjYcbLjtc myvA+ybKGGNYNLKBmo1sfxhsYG9TkR6YIuqQjnF7ooNHI8AlqPZXnyvUVXOaWeCm7upylXzKJm4 nyMjvyyNSR8JAjjNZYCH+UrjS5jiHxZEWmPBMeDWBG+iN9+u6L0htlXwBAMj/I+mdfVkhyp8UDh uJzcT/8r3i+Of+a0PhNoEfm3pb4Z6p4oZ+zBuORFdaNs2gtMmTMD3HDR6xSCTnrYn5y0b67AATa XIWKM5oX7EUUojTLwBqnwJwq58bdjPyXHstanTQcIspPWhAHq8De28H7N5hwIoDSMZgfkJqC8mH 4pbuImquWQQhFct0aW+uaN29vNagAxGMeDsGuc7t10FhNZ83a98Y8c4TXshRpW4FRe2spoNKFHQ Z8dCqia0amWiBBEzNze+iZBK80UYaomJubeoNXYSNPrPhgib9iaSejMBRgAUvYzExm2E4BtMIco oClmIUsqs1p1wFqIWOmWdT3owqwI10Wl7CPpIJW8gaJVdB4ebd+8Qrb44Z7WAHatsQxBTaDzFcN kAZEbjitMbkoOKmsN9z8y12tVZYeQtk= X-Received: by 2002:a05:6000:2586:b0:482:ea2b:c5a3 with SMTP id ffacd0b85a97d-48488efe58bmr7275725f8f.3.1788350667673; Wed, 02 Sep 2026 05:04:27 -0700 (PDT) From: Simon Scherer To: qemu-devel@nongnu.org Cc: pbonzini@redhat.com, richard.henderson@linaro.org, Simon Scherer Subject: [PATCH 1/2] target/i386: Update FPU tag word for FSTP Date: Wed, 2 Sep 2026 14:04:18 +0200 Message-ID: <20260902120419.212855-2-scherer.simon89@gmail.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260902120419.212855-1-scherer.simon89@gmail.com> References: <20260902120419.212855-1-scherer.simon89@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=lists1p.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::434; envelope-from=scherer.simon89@gmail.com; helo=mail-wr1-x434.google.com X-Spam_score_int: -17 X-Spam_score: -1.8 X-Spam_bar: - X-Spam_report: (-1.8 / 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_ENVFROM_END_DIGIT=0.25, 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: 1788350695844154100 Content-Type: text/plain; charset="utf-8" FSTP ST(i) copies the value in ST(0) into ST(i) and then pops the register stack. ST(i) should end up marked valid in the FPU tag word and the old ST(0) should end up marked empty. helper_fmov_STN_ST0() copies the value into ST(i) but never touches its tag. So if ST(i) happened to be tagged empty beforehand, it is still wrongly tagged empty afterwards. Mark the destination tag to valid in helper_fmov_STN_ST0(). This also fixes FST ST(i), which shares the same helper. Resolves: https://gitlab.com/qemu-project/qemu/-/work_items/4400 Signed-off-by: Simon Scherer --- target/i386/tcg/fpu_helper.c | 1 + 1 file changed, 1 insertion(+) diff --git a/target/i386/tcg/fpu_helper.c b/target/i386/tcg/fpu_helper.c index b812125efa..6ccc3c3b4e 100644 --- a/target/i386/tcg/fpu_helper.c +++ b/target/i386/tcg/fpu_helper.c @@ -510,6 +510,7 @@ void helper_fmov_ST0_STN(CPUX86State *env, int st_index) void helper_fmov_STN_ST0(CPUX86State *env, int st_index) { ST(st_index) =3D ST0; + env->fptags[(env->fpstt + st_index) & 7] =3D 0; } =20 void helper_fxchg_ST0_STN(CPUX86State *env, int st_index) --=20 2.53.0 From nobody Sat Sep 26 20:50:45 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=1788350717; cv=none; d=zohomail.com; s=zohoarc; b=Yawl0ovQYjAwYIa3HXPbo2TBYLp8ER7Xr/wLBs4qP5FA2/Y3XOpjJ8Wh9D/EnNsqUZftZmjvSrxI48XT60WdAj1CXgp60oTNeT2kjd033NQZQUPAA5PQPqAQ7lm8m56FPUl1WWJCvklFDDnuJPlzypT0o+QU4ut07niKpZ1QSHc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1788350717; 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=4A2M/98xuuK7dzXHs7G0KQ/0Yn0HODH/YqQwMvlBc+U=; b=cIOUjZveMwYUcdYFV4N9mUijW4lGZinEqrj5M/1/6h6bLDX/JwrICbPksKngEXcPUraXRKarEZoBregtFtd0mkoJQG5q6bdhV5g2a2wYb+iw99j+QTblgVrNI4AgWTjAgX+j6ETJo7ilAlzqZqUkI5VetBjNMy23VgrCKAzlRmc= 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 lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1788350717244177.25529903461324; Wed, 2 Sep 2026 05:05:17 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1x1jhm-0002V6-UL; Wed, 02 Sep 2026 08:04:39 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1x1jhg-0002UV-FF for qemu-devel@nongnu.org; Wed, 02 Sep 2026 08:04:32 -0400 Received: from mail-wm1-x32d.google.com ([2a00:1450:4864:20::32d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1x1jhf-0007hR-0C for qemu-devel@nongnu.org; Wed, 02 Sep 2026 08:04:32 -0400 Received: by mail-wm1-x32d.google.com with SMTP id 5b1f17b1804b1-4921eed3fa2so8298215e9.0 for ; Wed, 02 Sep 2026 05:04:30 -0700 (PDT) Received: from simon-macbookpro.tugraz.local (tug-swl-225-161.tugraz.at. [129.27.225.161]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-484492cdc37sm6504420f8f.34.2026.09.02.05.04.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 02 Sep 2026 05:04:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1788350669; x=1788955469; 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:content-type; bh=4A2M/98xuuK7dzXHs7G0KQ/0Yn0HODH/YqQwMvlBc+U=; b=HSI5cnguB49m1YWgA00kc/Xe2GaJwukqJ94mSgw20myIz7W99PT8ua71LHcKNV4/Xa G9lc9Ie38wpnhAxvf8sbjFCF0OB5gRBV3cy5vsqZGyxJKEmGxFLDtrnLaWbrxYoVLaru ptYZOfgOPxa9V0ZcpPElE2/g6dIsQwDPbHEJ6dA5kbEwZVAKoxR1YFNvFLA7eeMgxHrQ 3jyB7SKvNCPOqG1sXMR4JHlQ8dZdqMXB9WryaVvxtCg7YExDtPQCISQay0afIkzmMkAe McGmAu+7mYGBvN5XhUGN30Sp0mDMB3f9LlukuLZX/IlFqg6/k4QMEsKO3BRA/OxOAYZM QwlA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1788350669; x=1788955469; 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:content-type; bh=4A2M/98xuuK7dzXHs7G0KQ/0Yn0HODH/YqQwMvlBc+U=; b=DVHhA+yGG3s7bFhUKoQo41nfYdfGQfRCvjPNwsmfMLwOxi5k9ZZSiK0T1CN0oxF6tN WfI5pASvgAetsi7q0fdCLRBPoQsCQXtmJt1gUUR88Xk2oHiSCDATr+f869W71Qoyq9qQ FMT/32DoeUZ71/PSrB/rH/RsiauNAnipXmVtMMPR1vDCfVbCwjd9tiS/uaghgXwaSu2Z u6x/l04nbuCPSk21p17aWpskTYtfALornvWariFaB0WmmFOWCfI2oWpPujsf7USf+C7V wTEWfRi0jNhVtCnUk2LXmGBQVZr+VjAoTUIiaRaoYPuc1bJqsyy+Yi/Hj8Q0VQD9jXQW JLzg== X-Gm-Message-State: AFuF++ka70DXBdh/us6wgy1BzeqM34ZHvsL9+Om7RSKW4KT7uVGR+iXD YW091YnuQHcnZRy7TUxmQn4KlrWQOWaXdF9RD1S2T1hjWia5hqNLY5yyQSVEZ69v6CE= X-Gm-Gg: AR+sD10WSu03tNf2/n2EvHftsBKs2bjEd6F4XmoQycll0B7OaPJpZXoMQYFbtOIb7e2 ufhxFcD1OTFpKM7eAYZbLi/zXRW/fGMJJFDE9wwzXLhWQ72KGgLF387wEkCGRhVZFbb41HAA4ww fX7KNYcvG3m8bVMToLYDf96vZMxx2nUYEb7w0n13IO2HV61Opl9EkbjH6Oqc1LlQA18SuAFPrXl RQi5RRnF7KoXxFgnTBbsF2dTl1nw0UYY5k05yJpo1mwjiH1nB4AMBvtNJL4q6gAzseInUuZhpnV eB5LOCpXMZrQ/8yJbnFYkwWfZXW1Y4QdkSl7kVJqqtESDapjEnStyVQl4PWbtkfLpXWqoIC2wPa YxF0p/J9EZhwxcBRfvMiFnWQFV3Z92x3AQe3GVRsI7w5wi3n5Chxj5ggbDvpcwP/h7jZdOhKq2o UDVAzu7zCXOAEwAur458WfpVX+mQyBvmgSGYsKulZMZGQ5EtxgpQQsO0iv31+lOEPTeEM90N6t4 /qU6XSidGWYlbIG7XVPJKWarJH9S/fFoj3P083osKonvmG/H1aeyOFAd2ZtkpSfvpheUjnpSx9+ BLv8Z8/5PboPv9Km8iF4OyfkBHVCdL0= X-Received: by 2002:a05:600c:310e:b0:49c:e3ad:41d3 with SMTP id 5b1f17b1804b1-49ce55906cfmr58088705e9.0.1788350669094; Wed, 02 Sep 2026 05:04:29 -0700 (PDT) From: Simon Scherer To: qemu-devel@nongnu.org Cc: pbonzini@redhat.com, richard.henderson@linaro.org, Simon Scherer Subject: [PATCH 2/2] target/i386: Update FPU tag word for FXCH Date: Wed, 2 Sep 2026 14:04:19 +0200 Message-ID: <20260902120419.212855-3-scherer.simon89@gmail.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260902120419.212855-1-scherer.simon89@gmail.com> References: <20260902120419.212855-1-scherer.simon89@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=lists1p.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::32d; envelope-from=scherer.simon89@gmail.com; helo=mail-wm1-x32d.google.com X-Spam_score_int: -17 X-Spam_score: -1.8 X-Spam_bar: - X-Spam_report: (-1.8 / 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_ENVFROM_END_DIGIT=0.25, 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: 1788350719301158500 Content-Type: text/plain; charset="utf-8" FXCH ST(i) exchanges the contents of ST(0) and ST(i). Both registers receive a new value, so both should end up marked valid in the FPU tag word, regardless of what they were tagged before the swap. helper_fxchg_ST0_STN() swaps the two values but never touches either register's tag. So if either register happened to be tagged empty beforehand, it is still wrongly tagged empty afterwards. Mark both ST0 and ST(st_index) valid after the swap. Resolves: https://gitlab.com/qemu-project/qemu/-/work_items/4400 Signed-off-by: Simon Scherer --- target/i386/tcg/fpu_helper.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/target/i386/tcg/fpu_helper.c b/target/i386/tcg/fpu_helper.c index 6ccc3c3b4e..9df9f2f375 100644 --- a/target/i386/tcg/fpu_helper.c +++ b/target/i386/tcg/fpu_helper.c @@ -520,6 +520,8 @@ void helper_fxchg_ST0_STN(CPUX86State *env, int st_inde= x) tmp =3D ST(st_index); ST(st_index) =3D ST0; ST0 =3D tmp; + env->fptags[env->fpstt] =3D 0; + env->fptags[(env->fpstt + st_index) & 7] =3D 0; } =20 /* FPU operations */ --=20 2.53.0