From patchwork Sun Jul 9 18:28:50 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 700897 Delivered-To: patch@linaro.org Received: by 2002:adf:fcc5:0:0:0:0:0 with SMTP id f5csp4829250wrs; Sun, 9 Jul 2023 11:39:19 -0700 (PDT) X-Google-Smtp-Source: APBJJlFrT1R+CdZPy2aLUxZrbHzXE01ONjEUDKubmAmRFTfmQ+9TKt9tqjrEaTPLfWgOov8eiSPc X-Received: by 2002:a05:622a:14d0:b0:401:e0d8:25f with SMTP id u16-20020a05622a14d000b00401e0d8025fmr12517452qtx.10.1688927959183; Sun, 09 Jul 2023 11:39:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688927959; cv=none; d=google.com; s=arc-20160816; b=xt+0R8v/01Y3Oj3kwyOZi4EosK7MomJfog2aA/LcaAoj7O/hMNF64TSi9tbNd9tHrg TC7/oUeP5picCi8w4A+Cx3q/L3RvpGNDtPcpN5Gq79zEHjmpPit3VQYTko3JzytduJoL 2gTzHiAwi33mZdChLQBNQUb76X3b/TKiRGf3SJKlIsbqJ212lIQBigReHY3e4TQGa95F 0DK3T8xMghINuYaxeX4oe4KBPZdAvmO1v2lz0ymPrrAqwiqatLOAUf6CTTvUQwWgmd2o uQ8Tozzbi3KIpAWsXvhU6kkp6cY28hOAyZSLdm/dkY7xorEGNCA6t5a42XR0J7ehwDtW 2wNA== 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=GmJTDSEgSrtTohr1MbVZJalsJuXSKLY93/s3bemsL1U=; fh=dyH+DdFMi8k2sPXOmS3UUGWfB6OR3s2W6BGu4WYq11c=; b=amT2kDztX4Hbwpxm91+b+bFLgEy21lkeMeoN+U1FSY3072St+VriEExXQd1abmbOg5 bp5Ed3aMsxLpSLZPugeg3vVD/yKhzpta9i7umMzZgDCRpL1aS5Fb0RNB4vOLdiyjY2Hn AntlzBiJVEeaXIgMdcMOpcuJsypVBEoBrASFM+v8aVei5WByCK5cZ534yyB56TFmqmfF B5r0Sntzdny5J9pLP7wChLjyjfNEGw9R1wGDiw6qdkljgBxjYZu6zYunaP4IU05jOHQv lYylSAIOJ+t3p4MZ9poa/Xe8IcVSKsit172bYPhV9Hd8x3WIklTqOOCZhK5OqRRMx0oZ yuxg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=AfhCl+Yk; 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 j14-20020ac85c4e000000b0040346e20104si4724948qtj.407.2023.07.09.11.39.19 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sun, 09 Jul 2023 11:39:19 -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=AfhCl+Yk; 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 1qIZAn-0008U9-Vd; Sun, 09 Jul 2023 14:30:18 -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 1qIZAi-0008Ry-KU for qemu-devel@nongnu.org; Sun, 09 Jul 2023 14:30:12 -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 1qIZAg-00013C-Gn for qemu-devel@nongnu.org; Sun, 09 Jul 2023 14:30:12 -0400 Received: by mail-wm1-x32d.google.com with SMTP id 5b1f17b1804b1-3fbea14706eso37892875e9.2 for ; Sun, 09 Jul 2023 11:30:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1688927409; x=1691519409; 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=GmJTDSEgSrtTohr1MbVZJalsJuXSKLY93/s3bemsL1U=; b=AfhCl+Yk3w2R2+3deLfpYUF2wrww1AVyLtpx7r30hKyeue/kX7bjY8Be+hXa6umU+V 8vfkSbZ9V+KTcoIOu4YoVuQdaTbr/GhwkQ8JH+toIRv4uE0WEiAQ+AaDh5ZYmDFvU2ph LCmJ5x5sx1yKx3O5694IAnVk/okCElzVvIzNkZQzfrVqhyYkgGiFp8HdHuACQThTFp6h 3t/3y0blv/G4nJ7/0Sf8HqhApdR/6fDtp0wFRjC8goAj/GA5Iv0CGyULXCp+dGzOOOBO v5yK1UYoNgPYob4yxiiyBZjsf1Vbx8PLTN23ocbvt3sD81RDTYMJE4iv+Ccu2EoNGksS /K5w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688927409; x=1691519409; 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=GmJTDSEgSrtTohr1MbVZJalsJuXSKLY93/s3bemsL1U=; b=kM/xGapwzYpLQ1HRn2rMIf9YKEg659Evaue3+3xCtWRukG/MNCPofuGAzfMQXWXd3p flSu873sKuNMrs71MLMgNko2P+A06yWN+k4NId2IxpAjrl+4QsL0h23Z0siD/cZwKrNf tZHmfcKXxnU3ooEaPVQiMU63KnK5A98jJk8kNcbwKv+1+4VgznT8mu8PJYR92fVvDdk9 0KgTBvu8NpqpxS1pVa7b/XlH4zDYliGYrOEh02GWvSu1Nxmf7/s0AvQ8+x4PTA25Tzsu Ajf7Y8SYQdnlrDdkv75RxTyLljcuk3amM1/CX5yvHWMQPbdIdJS2e+mSLtRtwo4VoNzP XaUg== X-Gm-Message-State: ABy/qLar8PyBltuqMdui0IuabBai8z5pQIjNrd6UPgCUfj1POCD+FGdH LFkKVeDjtxGwJ1TzWu+PYDd/iQUD28AI6StKua5I3Q== X-Received: by 2002:a1c:7404:0:b0:3f9:82f:bad5 with SMTP id p4-20020a1c7404000000b003f9082fbad5mr9589536wmc.35.1688927409224; Sun, 09 Jul 2023 11:30:09 -0700 (PDT) Received: from stoup.. ([148.252.133.210]) by smtp.gmail.com with ESMTPSA id q15-20020a7bce8f000000b003fbe791a0e8sm8317108wmj.0.2023.07.09.11.30.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 09 Jul 2023 11:30:08 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: laurent@vivier.eu, qemu-stable@nongnu.org, =?utf-8?q?Philippe_Mathieu-Da?= =?utf-8?q?ud=C3=A9?= Subject: [PATCH 19/45] tcg: Fix info_in_idx increment in layout_arg_by_ref Date: Sun, 9 Jul 2023 19:28:50 +0100 Message-Id: <20230709182934.309468-39-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230709182934.309468-1-richard.henderson@linaro.org> References: <20230709182934.309468-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32d; envelope-from=richard.henderson@linaro.org; helo=mail-wm1-x32d.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, T_SCC_BODY_TEXT_LINE=-0.01 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 Off by one error, failing to take into account that layout_arg_1 already incremented info_in_idx for the first piece. We only need care for the n-1 TCG_CALL_ARG_BY_REF_N pieces here. Cc: qemu-stable@nongnu.org Fixes: 313bdea84d2 ("tcg: Add TCG_CALL_{RET,ARG}_BY_REF") Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1751 Signed-off-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé --- tcg/tcg.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tcg/tcg.c b/tcg/tcg.c index a0628fe424..652e8ea6b9 100644 --- a/tcg/tcg.c +++ b/tcg/tcg.c @@ -1083,7 +1083,7 @@ static void layout_arg_by_ref(TCGCumulativeArgs *cum, TCGHelperInfo *info) .ref_slot = cum->ref_slot + i, }; } - cum->info_in_idx += n; + cum->info_in_idx += n - 1; /* i=0 accounted for in layout_arg_1 */ cum->ref_slot += n; }