From patchwork Fri Jul 7 10:29:55 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 700017 Delivered-To: patch@linaro.org Received: by 2002:adf:fcc5:0:0:0:0:0 with SMTP id f5csp3793631wrs; Fri, 7 Jul 2023 03:30:51 -0700 (PDT) X-Google-Smtp-Source: APBJJlG7KxRzLw9o6k2m61rY9cDH9hu3KxiiAM9TkrqwBxboaTVrFJACnFGtKw8HeyFQDd0SDw6l X-Received: by 2002:a05:620a:31a3:b0:767:2e2b:b4ff with SMTP id bi35-20020a05620a31a300b007672e2bb4ffmr4670852qkb.52.1688725851403; Fri, 07 Jul 2023 03:30:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688725851; cv=none; d=google.com; s=arc-20160816; b=H3yahejJrbhW77/nYofvTEZEwslVC+YsuNNOhBgERVe+f5VdM1QHQkihoOeE25LemG 7w7xsPKxHnge/QtD37wLgqtUnX97BReJLi8CoIvgJy2rxMBfs/+zjw/30mVuxbM5Ozof PyWcRlYQhvfcIiwRe92V44WqTk2S3x8c2MKZLYIC7Bd0kv0ykIYfUhXbnmpIb3GbifPp v2NCNCnv5pb57mV7Hm1zJhzMqnOH9YJCKZbtPvzgjQpaC4wEZuDVDPHGAhPxgyew5zz9 QbURs01C4CeyK/J9XHtTL7KauVV7JS39gV5ogJxGaq1bgOqhj/BlUTY0M3+/0JkDH2rr OVxw== 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:message-id:date:subject:cc:to:from:dkim-signature; bh=Gj130Ggv0CLz7wN97AyXytE/rsONt1PH6rxWlgOhxnM=; fh=TtCgZ66/N8gcYChv/7jL6y0H4ktf2t4TbkT/u8v9Cwc=; b=BPog7k3zBaOBBwYd0i8cLi90i8idIexSHBZicUFX+VaDOUh34k8ezFESenKHdvLEI2 6ujRcA5u8Ch+ccRYrKKB6Ch9ULOaBtAXvqfUyW2Jx3OSOTvDwGOhSWpT01OMZLU2hi+M /VNef+aWS0jBDjkztXWZWbKMQ4ccAGkZ1nZfAV3Omz3EUsf/KNOWheFKOzK0mF/APDR1 HcoU4qAdIRmyTxKHo0/792b0b8lZ9IAbUgHwcazBDUvsPmsPGl9PiWHJOjgFu7A7GCYM kZzncpLlYSyX6xDbfrQY2SKtm+z+4Z5P4NpN//sieLRAWflwcYdYmJBurXrQsDud9eAB +Cgg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=D9WrGahN; 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 ou23-20020a05620a621700b007673d7d2cc5si2432678qkn.1.2023.07.07.03.30.51 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 07 Jul 2023 03:30:51 -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=D9WrGahN; 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 1qHiix-0005ao-HK; Fri, 07 Jul 2023 06:30:03 -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 1qHiiw-0005aP-Oi for qemu-devel@nongnu.org; Fri, 07 Jul 2023 06:30:02 -0400 Received: from mail-lf1-x134.google.com ([2a00:1450:4864:20::134]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qHiit-0005CP-RD for qemu-devel@nongnu.org; Fri, 07 Jul 2023 06:30:01 -0400 Received: by mail-lf1-x134.google.com with SMTP id 2adb3069b0e04-4f4b2bc1565so2699858e87.2 for ; Fri, 07 Jul 2023 03:29:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1688725798; x=1691317798; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=Gj130Ggv0CLz7wN97AyXytE/rsONt1PH6rxWlgOhxnM=; b=D9WrGahNLmXAIyHcUf+AUi6iRVwhRzm8anDt3lghNJRnfbpOEk2niiuda7x+sQ6892 3jwyEyrEhH/G55wVOrB4fAzMHib6L63e0KngMYNWRiSbByx3RrjCjAeVuZm7yJhiuDwV ADdrluHGKNdtdkle3T99GICzdBe7nG8y1fMajnYj9STm1YvdODrW+QtiJLi0XPN/3INt q0Eo3TG+G35Q8sf0DpdwA0db9d7c74BDZs453kSt76exLFmvclQ5gfLlOd3WTbJtfn0n KeuyJcs35DmKKrhXmm5OI+TtfiuH/i/eXEXPf1Vcv1FkVKK3UpPEuH4k4OxV3G97ZkLS jffA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688725798; x=1691317798; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=Gj130Ggv0CLz7wN97AyXytE/rsONt1PH6rxWlgOhxnM=; b=awMopfWmJNnHnVAw6XwLYyaRnuy0lDwAfQh5l/2Qd3jIiM0iJ7d6wO5CTamn5jdQhk q+sk9f3hODRNzE9wl2urUqr7mYv+mp9h396nidBnNiXQ72hZbUnl39VZhsA6GTN8uQRu QEHs/Eet57lDujUeqI05Db5ghQj/RIs7e7lEbjAShflknhPK9yNqzBq5Ur00hXpO0TIN txKGE1BrCM9J7kK9D36oFzMoU+UIh1Y2KHq+K4OsCr+X/ZjXlAQkTDoWyUNagys/8vWN WZVXvs8mPEZ3EqxOneRr2bUniyFytCnIzXqr9HNauzROU8Fzx/2BRFSoGsJuBSd98iUh ZsZg== X-Gm-Message-State: ABy/qLZp/9/oKQ3KylMQqqnAZTpwJY6BB4bcJFBTDwM/mnIB9nCIPRDs LajdHEKl6iRuMOeD7slMni+ViPMxwI3+ZJC/fno= X-Received: by 2002:a05:6512:214a:b0:4fa:d194:36be with SMTP id s10-20020a056512214a00b004fad19436bemr2975637lfr.65.1688725797965; Fri, 07 Jul 2023 03:29:57 -0700 (PDT) Received: from stoup.. ([91.223.100.9]) by smtp.gmail.com with ESMTPSA id u21-20020ac248b5000000b004fb73bea65esm629231lfg.25.2023.07.07.03.29.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 07 Jul 2023 03:29:57 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: peter.maydell@linaro.org, qemu-stable@nongnu.org Subject: [PATCH] tcg: Fix info_in_idx increment in layout_arg_by_ref Date: Fri, 7 Jul 2023 11:29:55 +0100 Message-Id: <20230707102955.5607-1-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::134; envelope-from=richard.henderson@linaro.org; helo=mail-lf1-x134.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 incremeneted 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; }