From patchwork Sat Apr 8 02:42:32 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 671451 Delivered-To: patch@linaro.org Received: by 2002:a5d:4d08:0:0:0:0:0 with SMTP id z8csp606969wrt; Fri, 7 Apr 2023 19:45:05 -0700 (PDT) X-Google-Smtp-Source: AKy350aIodNhunadVkPL1es7kVNAcOVe7Q4hbyfsKlEW64XApGH6Ir/asQKHCn9wNAyT7zjNWCCb X-Received: by 2002:a05:6214:d0f:b0:5e6:ceb5:7980 with SMTP id 15-20020a0562140d0f00b005e6ceb57980mr5499590qvh.22.1680921905590; Fri, 07 Apr 2023 19:45:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680921905; cv=none; d=google.com; s=arc-20160816; b=eE4hcxoI6YmBtPIZ8fAgTF+3o1DCKaMyq8B+5FY4zlwU1s91iyN7ecZndcbhr71kKR 3J736jY+e6wC7TNtRo97nw9SZaMls+0vZWfYIzngq7CmJstnA7YL6TJgn4EP1Qu8FVWY ErdI4yJAXZ12A5wZ7G1vAXTuDph//v3oFGwrQ8oeGddK8NS5aIvPjKF/N6dYiGPtTgfm g6gHD/JzpknDYf3Otyb7ERJWdnddpGlYVi9vbnfJQDKayxNMglnWwYckv7TJwExZOGMd zrMBNrYaOo0A3Xlo+fssYPcqZ4DAnRNSR3oZhQFYQluPaMJJW+L17ZdjppRY55c9n2pv cAbg== 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=rcNEhGFLchqZMB3huLw45XXaPWISEFJfrSvpuPV2BPc=; b=pYm+FrBHH9pRHnWa/XgdT3vbKRfuBj9ksfmjs0fACwsDUnH7XfeQ2jARRFXbNCgxHO tChWTaSigQj6+mI7I27KPP9rPv/swKNCh9Clc0NLDEWWEVlOdHBHBQrvASOcc3LujElF z2+bNe/2TqSLCqNHnW1U96AxnA02EBkwSIsNf0CEkgJ6tieNcgo/5FCE90V+aWQUMIpy x8RfiP1OWWGCGvtN8WY4YdrW4kGEprewQiGcEpsDMbwRHL0aiCli6PVo+9fQZkqucnU6 RCnlQcUqV08sRGwTgmk9uYuAcp1PnoZreuQhJXEYP1rxTtg0jaxBcy/f94CfH6EFh+rA Zq4g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Ea1zZYA0; 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 j62-20020a37b941000000b007465ee094b1si3763129qkf.30.2023.04.07.19.45.05 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 07 Apr 2023 19:45:05 -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=Ea1zZYA0; 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 1pkyXz-0006x1-Gn; Fri, 07 Apr 2023 22:43:23 -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 1pkyXy-0006vM-6U for qemu-devel@nongnu.org; Fri, 07 Apr 2023 22:43:22 -0400 Received: from mail-pl1-x62b.google.com ([2607:f8b0:4864:20::62b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pkyXt-0005Wo-MQ for qemu-devel@nongnu.org; Fri, 07 Apr 2023 22:43:21 -0400 Received: by mail-pl1-x62b.google.com with SMTP id e13so56707plc.12 for ; Fri, 07 Apr 2023 19:43:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1680921796; 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=rcNEhGFLchqZMB3huLw45XXaPWISEFJfrSvpuPV2BPc=; b=Ea1zZYA0y6DU1+Jpk3XYzqWFvMO+AsIyzT5p0CZL7dUA/MpgPrTLPHQlxxWoNkempS X9MT4q+4VuYPzo7OcJXGP+PTuDdVH8riWLRr7CtGHbkafQ47ETQOHtsnRl59TPodpW6I EPOSlxf/IAmKkoofGDfUiPNIPv5T5i1lPES3JqOIfHWb+vpehaBEeqMvFXytmlRQzsGB jcl6KmkbAjr8P2bjBz1ZwFWy/rVJdU0q5YFOiadGHD4HzrIE/okBTXSJ8SIHHzBbJD58 d/sUkyq/0D54H27FNVV4jwZz75Kn3T1hn5YvNJs+WblO/fIKuemmmpW3g/YjkSa/NRwP aGyQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680921796; 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=rcNEhGFLchqZMB3huLw45XXaPWISEFJfrSvpuPV2BPc=; b=nVPZCqTF8+F4Hcf/OA4wmH4p7Mm0EulqnhGHN4UVV3OfvEsGX5JzGMnIHPKJmloyPO DKC5qdaaxMrC6FrQwUv51MnsxBPJTYEKKQYetX8rCT/s/0myJzTam1enuRUZl5foGftj lyYweRu/9qmiw7kQeuB9bFFSkU6CJQPL13Y2xMGqmrAlIOkCtQ6b8GzyNff9UVfY6gBa Eif9SwyUoIHcpdEKN9qubHiAxaMXB2TpvqsE+Z3cviShy2V9BaQwTxX19SzYh9psPesd JnCYO/4IRBBoB5ktKwg9QYmQR5n5j/ZQw1iQohLzmiZo8UuKxb0B0SOLXcFhoVdhxL4h Z4nw== X-Gm-Message-State: AAQBX9d1G9tgw6upGTnrABoWjp7WawgMJSvUzicB7VJ1tfcxPuJU/D/q 9KtfO+amNgflQZKIlrLF0ffvB7IMhbS6oYcKfPI= X-Received: by 2002:a17:902:f94d:b0:1a1:f95a:2505 with SMTP id kx13-20020a170902f94d00b001a1f95a2505mr8481645plb.29.1680921796286; Fri, 07 Apr 2023 19:43:16 -0700 (PDT) Received: from stoup.. ([2602:ae:1541:f901:8bb4:5a9d:7ab7:b4b8]) by smtp.gmail.com with ESMTPSA id d9-20020a170902c18900b0019d397b0f18sm3530780pld.214.2023.04.07.19.43.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 07 Apr 2023 19:43:15 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org, qemu-s390x@nongnu.org, qemu-riscv@nongnu.org, qemu-ppc@nongnu.org Subject: [PATCH for-8.0] tcg/i386: Adjust assert in tcg_out_addi_ptr Date: Fri, 7 Apr 2023 19:42:32 -0700 Message-Id: <20230408024314.3357414-2-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230408024314.3357414-1-richard.henderson@linaro.org> References: <20230408024314.3357414-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::62b; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x62b.google.com X-Spam_score_int: 4 X-Spam_score: 0.4 X-Spam_bar: / X-Spam_report: (0.4 / 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, SUSPICIOUS_RECIPS=2.51 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: 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 We can arrive here on _WIN64 because Int128 is passed by reference. Change the assert to check that the immediate is in range, instead of attempting to check the host ABI. Fixes: 6a6d772e30d ("tcg: Introduce tcg_out_addi_ptr") Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1581 Signed-off-by: Richard Henderson --- tcg/i386/tcg-target.c.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tcg/i386/tcg-target.c.inc b/tcg/i386/tcg-target.c.inc index 4444eb9234..5a151fe64a 100644 --- a/tcg/i386/tcg-target.c.inc +++ b/tcg/i386/tcg-target.c.inc @@ -1082,7 +1082,7 @@ static void tcg_out_addi_ptr(TCGContext *s, TCGReg rd, TCGReg rs, tcg_target_long imm) { /* This function is only used for passing structs by reference. */ - tcg_debug_assert(TCG_TARGET_REG_BITS == 32); + tcg_debug_assert(imm == (int32_t)imm); tcg_out_modrm_offset(s, OPC_LEA, rd, rs, imm); }