From patchwork Tue Nov 5 11:19:14 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 840791 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:1ace:b0:37d:45d0:187 with SMTP id i14csp287022wry; Tue, 5 Nov 2024 03:25:56 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCU7TQWqrh4NPheSNhfEU3HgIyKNzhk0d6wMDAZkWW8q3HXpuslbs1CrgUP+WDbkhqOV2u3GLA==@linaro.org X-Google-Smtp-Source: AGHT+IFhfwCEEOva7sllKwOJoxjHmQ+8Sd7aLQjSMvA9rXmeaYitK5aaDZrU0sOHL3mkHNV0T7ss X-Received: by 2002:ac8:58ca:0:b0:461:db6:b939 with SMTP id d75a77b69052e-461716a1133mr282610441cf.12.1730805956743; Tue, 05 Nov 2024 03:25:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1730805956; cv=none; d=google.com; s=arc-20240605; b=YQ0G9TytHf1H8OPIm1MTAt5wujNy2r4UylEnflFjaPpqSvs9Xc1GAEguG1FNjZQrXv RyglPSKY+MON14oL8C9LaH/7dcPOuZEjWQFAIe2EBCB84VM6jrm4jlSmu3u2yyj5jO8r WLVKFWYcSKqYGK+nomGYBVL4pyLd1Tu4u3+G4Xmy967Dll9zBCkcgviGUZmdZKLj7wk1 LGrt7EBU+x5TZnGVxuSqB5HLq6uqBKnB87O0SwWDjkbF4dqFl3xs+CzozEbKxINDEqnA drMM32NPqMwdCMp8s45JGCZgV5YK8HgSimYCEPDCp/7YyWsfp01eGOYm6G2sk2JnZX65 IPSw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=4CpB0XbZQLncselzyyj8L+Ydlxu2Z7NIO+QmbjnCCQ4=; fh=PnYt+qEB9tAfMKoqBm2xjKOFpYyFFGPudh5cVIoieJM=; b=E6yMrCo6sqHw/AXKxL8nF9lyLLjh3BnFUdpljLE3zvmhnzx+EqGDmUYgm8oNW++Gea eZ24UK7TUs58FPJ4WIO7BHybex7aKk0LVqRiQ50jj2AuafNj/ucsJ0TRlP8Pu5wlMZfw bN0Ns+2L7PPf2UjPzW4SfHEnBjuY8Ar79Fh+/5Gf4yRoerjzqYmAeiwVdvNMbStePSVP Z7n84AA3bL9QU1bHBLJqQBnks4oSGcyrNGDQK8LXSdCkU5Ey+VFpCOduDOd73iUqefyL eo+/Il7lPBriJUwi0PVOove6pm2QiQJZUqOup1u5B718bAwPs8XjXC1H8+jJGPxfYSMQ 7tmw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=z7RuK1bV; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id d75a77b69052e-462ad0d0768si148415911cf.189.2024.11.05.03.25.56 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 05 Nov 2024 03:25:56 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=z7RuK1bV; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1t8HbI-0004UZ-N2; Tue, 05 Nov 2024 06:19:56 -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 1t8HbE-0004TS-Qd for qemu-devel@nongnu.org; Tue, 05 Nov 2024 06:19:53 -0500 Received: from mail-wm1-x32e.google.com ([2a00:1450:4864:20::32e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1t8Hb9-00075j-7Y for qemu-devel@nongnu.org; Tue, 05 Nov 2024 06:19:52 -0500 Received: by mail-wm1-x32e.google.com with SMTP id 5b1f17b1804b1-431ac30d379so43593975e9.1 for ; Tue, 05 Nov 2024 03:19:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1730805583; x=1731410383; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=4CpB0XbZQLncselzyyj8L+Ydlxu2Z7NIO+QmbjnCCQ4=; b=z7RuK1bVXxL3OF5gUx4lemw9FYwALvtg55ON7sr19qhjaYnOk6tnCU2qCSIhoyi7aP 0c4A21Jg1jv78KPC205McRz1NlvBBhg0mPZDa4Y289dbmZp7J0+sCnD4QA5ObCrteMxA 2q0hM4ZTXz/CSov1jQh2UhZVukOUHrvVENGAXmzEDOIl9e/T8kF3OlgiIrStCuBEVPHT AmoxtbEIQJ1K3rmEMDZTBUbB7tdKz5ROlWP3mHt9j6xOdWMBVs8bw3LjS455HAEmHFpC I4kvgZe09lhBla3C4AX1mLg3Kg4WG3o4Ag2Y6rF3mQshPnSusuhQmswNNBJ00p3xcer2 pMPg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730805583; x=1731410383; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=4CpB0XbZQLncselzyyj8L+Ydlxu2Z7NIO+QmbjnCCQ4=; b=JBUrHt7p1WyQN28L6s8MXOrEcxTqCDlGBdxSPrRIYJ2CZFShiOYXGbejV/fbeWsktS O88qY6Ld/rAVi7yZjoUOiguC1llwH8zBDzEYft2nMbuSoJxOih38HMXvFIhSQXOOvQAw elJCxqRkWB8WUOraVlhecY9EPM/UpVmkb9CQYFZqSOgMDfXAKqKCa9EBirtOqRTPqhr3 ExKyx+eooREZxMfji0/sIudTEbhJV723ki+YxA0i4YrK7KX1oytTAgaWvj3/7vZmojWF daZJ3FqNFrouoDjq7IoVIbxN7q5r2N9J602ZJyppS23RGLhzd/NEsxvmwUpp/vmDrfi5 vROw== X-Gm-Message-State: AOJu0YzhYE3649NELdsfGOlk80eA2uPfXsDYMiqGwxzbU+akZBj4q7Zz FDY0Qn5aJrefBD8//w8BmipxYos4ekAPaZkUizwEiFYRtoeTLbR4uBEIWSYe8fWvOZxvaKKsY8z D X-Received: by 2002:a05:600c:34cd:b0:431:157a:986e with SMTP id 5b1f17b1804b1-4319acb8d3amr283664825e9.20.1730805583224; Tue, 05 Nov 2024 03:19:43 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-432a3688813sm16354555e9.1.2024.11.05.03.19.42 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Nov 2024 03:19:42 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 10/31] target/m68k: Initialize float_status fields in gdb set/get functions Date: Tue, 5 Nov 2024 11:19:14 +0000 Message-Id: <20241105111935.2747034-11-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241105111935.2747034-1-peter.maydell@linaro.org> References: <20241105111935.2747034-1-peter.maydell@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32e; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x32e.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=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: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org In cf_fpu_gdb_get_reg() and cf_fpu_gdb_set_reg() we use a temporary float_status variable to pass to floatx80_to_float64() and float64_to_floatx80(), but we don't initialize it, meaning that those functions could access uninitialized data. Zero-init the structs. (We don't need to set a NaN-propagation rule here because we don't use these with a 2-argument fpu operation.) Signed-off-by: Peter Maydell Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Message-id: 20241025141254.2141506-11-peter.maydell@linaro.org --- target/m68k/helper.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/target/m68k/helper.c b/target/m68k/helper.c index 9d3db8419de..9bfc6ae97c0 100644 --- a/target/m68k/helper.c +++ b/target/m68k/helper.c @@ -36,7 +36,7 @@ static int cf_fpu_gdb_get_reg(CPUState *cs, GByteArray *mem_buf, int n) CPUM68KState *env = &cpu->env; if (n < 8) { - float_status s; + float_status s = {}; return gdb_get_reg64(mem_buf, floatx80_to_float64(env->fregs[n].d, &s)); } switch (n) { @@ -56,7 +56,7 @@ static int cf_fpu_gdb_set_reg(CPUState *cs, uint8_t *mem_buf, int n) CPUM68KState *env = &cpu->env; if (n < 8) { - float_status s; + float_status s = {}; env->fregs[n].d = float64_to_floatx80(ldq_be_p(mem_buf), &s); return 8; }