From patchwork Sat Jul 15 13:52:49 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 703231 Delivered-To: patch@linaro.org Received: by 2002:a5d:4e4d:0:b0:314:25da:8dc4 with SMTP id r13csp157647wrt; Sat, 15 Jul 2023 06:56:50 -0700 (PDT) X-Google-Smtp-Source: APBJJlHxkc/Aj2qg0I+Nj/EMhMzmBkZQqvEhD7DtEN+wYyAW5cbXLhP6GbXx91xJTFE4RJeP9mVJ X-Received: by 2002:ac8:59c4:0:b0:403:9a00:2edb with SMTP id f4-20020ac859c4000000b004039a002edbmr10129742qtf.47.1689429409887; Sat, 15 Jul 2023 06:56:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689429409; cv=none; d=google.com; s=arc-20160816; b=wkVlsGZj71ZHbmaUhUYHlfRyLvW+FLUy9mqnU6RB7bhNobdK7kHwmhZTnufdVBAcJH SAr90ZzhRsZzXDXWDiFStXWPTTzChzCBChWeLOaOVfYQWNiiFshXF3GWA3eAmEqXQN3C XTjdsJGsMBMzRvp2Wj/LQhqG36FG+ULrJdiuqdL5DlbOoqSO5pGjygma7WSJpVvOI1Pd A/cUqdfmgNsXdA9Rtu1needactCOB13MNwZlJSOcBqjexRVxG6K1vMTW1kaUGuDEPEnI JBzX7OMpg54rrrONZJ7xJR4orE3ltagb8JZ8lg255mqbnZEzV7xrQEfhT2OC2gbe/ZGZ DTrQ== 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=jzyDMcbYQjI8gvZN9VCzZxgmLv/k9AezEb13MRPeL3k=; fh=mAPHO5VzBjR9OURwpC+NZR+4x+NBl0VD/Lm/8apGT4I=; b=ILDnL6F/uzCIIbM5OtbZcvTqFjuZQXD3v8Nk2zeFczqLyZLzx45ZYTD851Tl813n6F IE2Rrl7BR+jneglJpfwljfMrhpOhaq1MT1EobZBGGSDH3TuvUbEXoSsu8cHB6gRwfWVx FVmqN/ssvWjAwY4qVZ5z4PBcVmEUmtu5lE3CXSN1Qe9m+Dg5l7l1I66jkfV2dmpQnV2Y yIGZRJA+GF9KV8gktQHCmcakNcFDtjhVn0+F446aWLcv5c7X6YDnV7J5hxHTrlQFVNK1 ouIIka5Hg5cDzedfCmsfetCoHXaZRbenzIXjQ1iy0ofj4boXM5Qtrqotqi8dKjR7KrYO DxbQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Fmcyln+Z; 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 f13-20020ac87f0d000000b00403b0f5c273si5752330qtk.696.2023.07.15.06.56.49 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sat, 15 Jul 2023 06:56:49 -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=Fmcyln+Z; 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 1qKfj1-0004YD-5C; Sat, 15 Jul 2023 09:54:19 -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 1qKfiM-00045E-Rc for qemu-devel@nongnu.org; Sat, 15 Jul 2023 09:53:40 -0400 Received: from mail-wr1-x42b.google.com ([2a00:1450:4864:20::42b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qKfiK-0001H1-Pb for qemu-devel@nongnu.org; Sat, 15 Jul 2023 09:53:38 -0400 Received: by mail-wr1-x42b.google.com with SMTP id ffacd0b85a97d-316eabffaa6so2378501f8f.2 for ; Sat, 15 Jul 2023 06:53:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1689429215; x=1692021215; 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=jzyDMcbYQjI8gvZN9VCzZxgmLv/k9AezEb13MRPeL3k=; b=Fmcyln+ZV6z4yTSqqk0nZ7i+ji8JuvQzRcnLaGEtGvk/z3R0xhffEqwITyGBGBrGp2 ESFPM5Zpa3YnysJTGviEBXgxKrQlbDTXAslXvxqlLrNt7lmFObAw/8YBTwkK+q+Rvi8K Mvb9sfCMGu64gdr1oztj+UEfiQOiNZKzdzq7wIkwr903ZYdjR3V80QROK4EvdquXm+pf vZ77EPB0qJ4DKvQ53TrjaJ18wGXad3mA6Hb1KWX8gFkoZj+7FXbLWczKipfK9gP8gZIO yKMbVBNlahgVli9IeuHaoY4mTUfu98olmxh9zmnAUR3fP1It9lPpnEWtJhqoDA9jYS28 rXrQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689429215; x=1692021215; 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=jzyDMcbYQjI8gvZN9VCzZxgmLv/k9AezEb13MRPeL3k=; b=k7Ub6rFEJHGVVLSWT407oYggR+xrjeNC09KFPj4cWy6Pm80Xvw2zz12okbdP3GDeBS 9dBR181tRfrGU22kNqSjzHuJhzaVkgIrtKxvp2nPlt15oDw8/++RYoBAV6HD8q+1FtO3 vc+umLe+QOXfRXsiqBCs6u5BQQ9nVZJFAXK0CjapAqMhvkmUvJ4PlkViMUTDVReo6wOH u2igKHcSKsfk2L5j81vNv+BGT0V2bsFDohMQ/XKYMJ4trE9WE7Br9BDPa8chdcXjVrtU pHy871pvZGJIFORsCLdO9NGQvKhje6u5RvvM1w0v/fYakmwv5+nQZ3h//2zAdje0wBhE 18wg== X-Gm-Message-State: ABy/qLYX03GQjWUAt4BvzvPmfXrZ5tSyk3o+mMHVhvpRq4l92o6eVKs7 i1NEtAkoq4eVb/RSPIU4oY8PYqjqWckTpRINbeF/1g== X-Received: by 2002:a5d:4d02:0:b0:314:17cc:31d0 with SMTP id z2-20020a5d4d02000000b0031417cc31d0mr5713624wrt.34.1689429215149; Sat, 15 Jul 2023 06:53:35 -0700 (PDT) Received: from stoup.lan ([51.219.12.49]) by smtp.gmail.com with ESMTPSA id k10-20020a5d66ca000000b00313f9085119sm13838014wrw.113.2023.07.15.06.53.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 15 Jul 2023 06:53:34 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: qemu-stable@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Peter Maydell Subject: [PULL 19/47] tcg: Fix info_in_idx increment in layout_arg_by_ref Date: Sat, 15 Jul 2023 14:52:49 +0100 Message-Id: <20230715135317.7219-20-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230715135317.7219-1-richard.henderson@linaro.org> References: <20230715135317.7219-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42b; envelope-from=richard.henderson@linaro.org; helo=mail-wr1-x42b.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é Tested-by: Peter Maydell --- 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; }