From patchwork Fri Jun 28 12:42:37 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 808261 Delivered-To: patch@linaro.org Received: by 2002:adf:fe0a:0:b0:362:4979:7f74 with SMTP id n10csp341935wrr; Fri, 28 Jun 2024 05:45:53 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCXI9K7NLOZQT0tFZilNPQrp9KEW3SYHmekK68PCSx+9UNNdD3lUgw0XCE1UlSY6YdgG6oZTNss0oD1RJgocbrhD X-Google-Smtp-Source: AGHT+IEF97/xjfeePovIur9ONjbI+pz1Tp3ylGunPTlzLP6YLCVluF0Whc8F0C9lFwObnV9y9IcF X-Received: by 2002:a05:6830:443:b0:700:b3a8:39ec with SMTP id 46e09a7af769-700b3a83b03mr16408831a34.6.1719578753399; Fri, 28 Jun 2024 05:45:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1719578753; cv=none; d=google.com; s=arc-20160816; b=PwYN3TNhMAcyY0gF+3UkfQ4FPX0uh9EcBAHAH6+OYao9Y1MfzB6ORYcwPBV1ZBURpU krJC/2j17ZpDrzf3QkiR7tHgusXY6O4RXSFAodaQethyQwhN1RN5oFj2j9dR7QYfyryy Mkx9foXi7N9jwHN3ib8bTEe0oDZI4enVhnZTl/hw/g9Yj8bv+5gg9o8N8eG5Gvq+BKnl 1QvWTk6TYgkxG5b/sZisWYQmO8bSjODnbWm8m0CYPlSHjqMFaY49yOMQ5wDv3lu3v41s xqRJu4QWsPCfY+66k5Cvw9HhozmE3NWv8WQHJ1GWQ6wZtM6qKWZcSQPXx1SaGgqib9qF rUeg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; 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:cc:to :from:dkim-signature; bh=bf4WpUP3pGX7br6bhDuGt9p7GApyU5+eBul3rNsS2rQ=; fh=feUDKKpLJcDhnf3QzhPgXboICSqWRyIbF2KiTCQPR1I=; b=DcMw/sjExbTl+UOZ33/yVfdWhwQVMny+qH9VlYsPzsu40zRSiTVynlKPqcc8IQWGn4 Ahtyamzo3MWTZHbhiDOiDRMUM4E7CFuMmCa7UD7P9u/ZjwwUAqj7QsDS6NbOKS4HRk3J rxkIcM411dfVH9iNu20ElSzA06kRshSzCjdwGUF1xD+RJ7eSS6sV+dqi6zhjHres1lVl UXg1WquEm45ok9LXZfsDFtesd5V34bGyq+IdGxYUxZA7ECsCvCEbQ7NN5e5krDb8GqsT +GDnfNQcRQoE4X3lvbBCBgjHrynkcSPMIf9L6bHJlEecCTuqlPM1S05A8t5qVm8m0GHj Iqxg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=dJ8kVG8+; 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id af79cd13be357-79d692f1cd6si174146285a.239.2024.06.28.05.45.53 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 28 Jun 2024 05:45:53 -0700 (PDT) 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=dJ8kVG8+; 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 Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sNAwy-00050y-PK; Fri, 28 Jun 2024 08:43:40 -0400 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 1sNAwU-0004n4-Gs for qemu-devel@nongnu.org; Fri, 28 Jun 2024 08:43:06 -0400 Received: from mail-ej1-x631.google.com ([2a00:1450:4864:20::631]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sNAwR-0005fB-EX for qemu-devel@nongnu.org; Fri, 28 Jun 2024 08:43:06 -0400 Received: by mail-ej1-x631.google.com with SMTP id a640c23a62f3a-a689ad8d1f6so73517066b.2 for ; Fri, 28 Jun 2024 05:43:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1719578582; x=1720183382; 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=bf4WpUP3pGX7br6bhDuGt9p7GApyU5+eBul3rNsS2rQ=; b=dJ8kVG8+/LAHdA2DUylJgR5ZA8TbZbU4iZWa45XkF72SChfAULXtgMvUzQojElbZ5t 6VBQ3zHDlsEQOUMILPA+ofLTmS4qqlrwo77rh8x5eC7+6XpQkBg5AtcZRa4+Mjgj3bxr WuaHvu08YE10aEUVYs/ptKNXqk46BQgbmCvv7q7BhbUTA9MZvN438d291hT0keNQCJ12 BbojqotxyfWLZkk3z9bDzpKtzCT9wu/Mft3R00yp6O+64GUBlD6BtlbUmAQ7GVcLHEWp 7Nevo3ziV16NlN/+HOB2ReZLbrtOi81hgn5ONaJIy4MG48Jp3hXx9kJTl/woKivBrHgp yTDw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719578582; x=1720183382; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=bf4WpUP3pGX7br6bhDuGt9p7GApyU5+eBul3rNsS2rQ=; b=Tj8nQTHMsXQYmqdAVfDE0KPz5xvYoNczMpM4DUpj1C++i8u/b0/X3nM5Mrh7lszQR8 cdIeYkW7kX9DcSBvfIE+EFfvKZCKstxueAYU9Cm21y8x2hpKcEdScVV1gQtyezmLftJR 7VhEpFeE8xN+t6THT0y3wto2BzqmdZi0xr6ilWqluN1m4iLuSNSN1LAUk4LVHM/CpWTN SfPVKXgXnN/q45hX2a2FCiULW3H1LmQL+VBS8jraduDSBeyOyxulwNtjLyGgzgeM9M47 JwJmzq/y0giUZ74gnP3fitfZSPKapeMXgtq3mJ7tXst9Bo/ToQKojLYlQBPoDz0MN5kC 35kQ== X-Gm-Message-State: AOJu0YxoVdh+3WcuTu0LQ/9h0BPzycdeqmmsDVauQHV+CCKal9U/BOEh 08/Fns5P4qnhQs4GbSxOyqhvKdo5RdTujbTYLBXRYg9bXs26Z0xl8PkwQUy5QYw= X-Received: by 2002:a17:907:c805:b0:a72:4a4f:23d6 with SMTP id a640c23a62f3a-a724a4f2491mr1248488166b.8.1719578581296; Fri, 28 Jun 2024 05:43:01 -0700 (PDT) Received: from draig.lan ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a72ab0b7dcfsm75779166b.209.2024.06.28.05.42.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 28 Jun 2024 05:42:59 -0700 (PDT) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id 2B5835F941; Fri, 28 Jun 2024 13:42:59 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: David Hildenbrand , Beraldo Leal , Eduardo Habkost , =?utf-8?q?Alex_Benn=C3=A9e?= , Wainer dos Santos Moschetta , qemu-arm@nongnu.org, Peter Xu , Mads Ynddal , Mahmoud Mandour , Pierrick Bouvier , Laurent Vivier , Paolo Bonzini , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Alexandre Iooss , Stefan Hajnoczi , Peter Maydell , Richard Henderson , Thomas Huth , Mark Cave-Ayland Subject: [PATCH 02/23] target/i386: fix gen_prepare_size_nz condition Date: Fri, 28 Jun 2024 13:42:37 +0100 Message-Id: <20240628124258.832466-3-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240628124258.832466-1-alex.bennee@linaro.org> References: <20240628124258.832466-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::631; envelope-from=alex.bennee@linaro.org; helo=mail-ej1-x631.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 Incorrect brace positions causes an unintended overflow on 32 bit builds and shenanigans result. Resolves: https://gitlab.com/qemu-project/qemu/-/issues/2413 Suggested-by: Mark Cave-Ayland Signed-off-by: Alex Bennée --- target/i386/tcg/translate.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/i386/tcg/translate.c b/target/i386/tcg/translate.c index ad1819815a..94f13541c3 100644 --- a/target/i386/tcg/translate.c +++ b/target/i386/tcg/translate.c @@ -877,7 +877,7 @@ static CCPrepare gen_prepare_sign_nz(TCGv src, MemOp size) return (CCPrepare) { .cond = TCG_COND_LT, .reg = src }; } else { return (CCPrepare) { .cond = TCG_COND_TSTNE, .reg = src, - .imm = 1ull << ((8 << size) - 1) }; + .imm = (1ull << (8 << size)) - 1 }; } }