From patchwork Thu Feb 4 01:44:03 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 376183 Delivered-To: patch@linaro.org Received: by 2002:a17:906:48d2:0:0:0:0 with SMTP id d18csp912658ejt; Wed, 3 Feb 2021 18:19:33 -0800 (PST) X-Google-Smtp-Source: ABdhPJybugeLOIEmYC0oDIkYRNjV+DaellRV8p/EzVbHW+agL00VwJoLywHKQdUrGKy8HdV/U10X X-Received: by 2002:a25:7009:: with SMTP id l9mr9440796ybc.118.1612405173834; Wed, 03 Feb 2021 18:19:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612405173; cv=none; d=google.com; s=arc-20160816; b=ERU4PFpuj71HbHnYyx6qkh9pGoNKPkOqT3TLueC7e0ijZug3f2U15SpKZ9zBGmy/QG 8NUuM/irAPrbf9Xv7hJGeF31FYc+yWe2t0vBBJfGLWEcIqtWZUQT83koUcmVVrQga+al G+QCGoZKQSyX9t1AMnbeH4yb7j9Qe6kD1PXnfIhEOlguYBr2RuoV+f8HnKc3aEmlfjJC v4BmSS20Frb9IjUBTNPY6IVExadkus6VMgSmvT4nHpFlJUgTKMIJDmC/D7DdHOV8YOHb f9QUAVLrTZDWa+kamcSA92n49kNUoA237CjF+FP7AoUxCC2yydP9v64C/GuTgn86llrr AlLg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc: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:to:from :dkim-signature; bh=jQllLPStMSpXHN7NTbXqzAr+6+LQfKhn+prBrsPItko=; b=lA2yx28olWOV8x/1/S7ukkCGUGOcWYJTmZzMnpOLuVVFP1nSO9WNj/yCbhuoUUFxhE Xfl6IPECFMYI2OnxOUjxbmcqNU7CftfKjtWVrSbNKo0DSIKDOkFTrjNPG1PMpH3G3yWl +bO/JGvtcdpnyf/IL4fUC19xnsv0YVVGR6lZtCQb52F1QXyna1CnNJngZrMf4Cbi8xVE r//OdbLhoDNxLlM1drZpnhEIjB2V6GZl2BUphpXbbG6KCHQnD7Y/TmTXo000A9I8Lewq YwvlGkb9fGur5ZvEwj8xrm2OSmcuyJIyWHp74agHtn6sjzoppbrPox4AcN/IyMw6jifG ooZQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=T7gx58sf; 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 j126si3544564ybb.41.2021.02.03.18.19.33 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 03 Feb 2021 18:19:33 -0800 (PST) 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=T7gx58sf; 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]:39268 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l7UF2-0002kB-VX for patch@linaro.org; Wed, 03 Feb 2021 21:19:33 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:44618) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l7Tin-0005B9-BM for qemu-devel@nongnu.org; Wed, 03 Feb 2021 20:46:15 -0500 Received: from mail-pl1-x62c.google.com ([2607:f8b0:4864:20::62c]:34560) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l7Tid-0003sM-Sp for qemu-devel@nongnu.org; Wed, 03 Feb 2021 20:46:13 -0500 Received: by mail-pl1-x62c.google.com with SMTP id u15so904047plf.1 for ; Wed, 03 Feb 2021 17:46:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=jQllLPStMSpXHN7NTbXqzAr+6+LQfKhn+prBrsPItko=; b=T7gx58sfcOcVq3/jelk2LUWq3qrkCIfnRtVKOXZMyibprPGKIvN5uVRVt9A3vdnonF i+SKczPklN2tuolzwPWwgzGJ49sbRoK2W515hMKauRkGOrp60A6CHZLKPJvoPExdIh9T NyYzVRoMEt27boiANqqY8pbGv822rGEQLv2t61YvwF+78YqqdaUs96hiEQfxnueVzl9E Bb3Fonaw34qt086HoGjfp7Q+ZTMmb/49rxnjwH27HSzAI2dWTqUiHe12OhOGIJI/ZubE io+5N/I7TKJUhzE68/bhdVuJ4QqYghVLr22x8mJCNK6YgrDcG1XDV4nsVIcusTRsMvxt QBuw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=jQllLPStMSpXHN7NTbXqzAr+6+LQfKhn+prBrsPItko=; b=PWMw3eC26PsN7mBhiNoryUjkf17OC9EKFQt4Oif5Qh8NLivUWiHYJNrDjatE0Mc4Xx uWhTO+sKyJ+bCKqvIZ0Hpq9rPCrgqfRlMpTmU7yVxtoshR7Ca22VwJ/L5896Beuyl0C0 yJ0nr5TzNq43wRCmmE0pWPNAaHK+0YuIXORD8E9NfDKr5IQsaTwe+QuTJ5t153i4HU2c MoCcoS+X+kro1JD3qwWXxApHBUVt8XXfM7rNnGr7e4tuR+qShoQMsGpeaULZmtyvbmug bV6EDPOVkxjiEjWCnoTU6PO5OooT4fGkqUv0L+donrSPL4sdUt4G+XFdO11nhI7zRQhx NkjA== X-Gm-Message-State: AOAM531z560PejwkgqYkLxaAntpvoaIGO4MAG5CLmb5obTThpH8kwhZb ehaJXqHdNFwURtrYBWpSKkrwKo1oNRfTDXBA X-Received: by 2002:a17:90a:ce89:: with SMTP id g9mr5786744pju.42.1612403162730; Wed, 03 Feb 2021 17:46:02 -0800 (PST) Received: from localhost.localdomain (cpe-66-27-222-29.hawaii.res.rr.com. [66.27.222.29]) by smtp.gmail.com with ESMTPSA id q132sm3835462pfq.171.2021.02.03.17.46.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Feb 2021 17:46:02 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v2 27/93] tcg/tci: Fix TCG_REG_R4 misusage Date: Wed, 3 Feb 2021 15:44:03 -1000 Message-Id: <20210204014509.882821-28-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210204014509.882821-1-richard.henderson@linaro.org> References: <20210204014509.882821-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::62c; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x62c.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.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: sw@weilnetz.de Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" This was removed from tcg_target_reg_alloc_order and tcg_target_call_iarg_regs on the assumption that it was the stack. This was incorrectly copied from i386. For tci, the stack is R15. By adding R4 back to tcg_target_call_iarg_regs, adjust the other entries so that 6 (or 12) entries are still present in the array, and adjust the numbers in the interpreter. Signed-off-by: Richard Henderson --- tcg/tci.c | 8 ++++---- tcg/tci/tcg-target.c.inc | 7 +------ 2 files changed, 5 insertions(+), 10 deletions(-) -- 2.25.1 Reviewed-by: Alex Bennée diff --git a/tcg/tci.c b/tcg/tci.c index e0d815e4b2..935eb87330 100644 --- a/tcg/tci.c +++ b/tcg/tci.c @@ -511,14 +511,14 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState *env, tci_read_reg(regs, TCG_REG_R1), tci_read_reg(regs, TCG_REG_R2), tci_read_reg(regs, TCG_REG_R3), + tci_read_reg(regs, TCG_REG_R4), tci_read_reg(regs, TCG_REG_R5), tci_read_reg(regs, TCG_REG_R6), tci_read_reg(regs, TCG_REG_R7), tci_read_reg(regs, TCG_REG_R8), tci_read_reg(regs, TCG_REG_R9), tci_read_reg(regs, TCG_REG_R10), - tci_read_reg(regs, TCG_REG_R11), - tci_read_reg(regs, TCG_REG_R12)); + tci_read_reg(regs, TCG_REG_R11)); tci_write_reg(regs, TCG_REG_R0, tmp64); tci_write_reg(regs, TCG_REG_R1, tmp64 >> 32); #else @@ -526,8 +526,8 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState *env, tci_read_reg(regs, TCG_REG_R1), tci_read_reg(regs, TCG_REG_R2), tci_read_reg(regs, TCG_REG_R3), - tci_read_reg(regs, TCG_REG_R5), - tci_read_reg(regs, TCG_REG_R6)); + tci_read_reg(regs, TCG_REG_R4), + tci_read_reg(regs, TCG_REG_R5)); tci_write_reg(regs, TCG_REG_R0, tmp64); #endif break; diff --git a/tcg/tci/tcg-target.c.inc b/tcg/tci/tcg-target.c.inc index 7e3bed811e..aba7f75ad1 100644 --- a/tcg/tci/tcg-target.c.inc +++ b/tcg/tci/tcg-target.c.inc @@ -181,9 +181,7 @@ static const int tcg_target_reg_alloc_order[] = { TCG_REG_R1, TCG_REG_R2, TCG_REG_R3, -#if 0 /* used for TCG_REG_CALL_STACK */ TCG_REG_R4, -#endif TCG_REG_R5, TCG_REG_R6, TCG_REG_R7, @@ -206,19 +204,16 @@ static const int tcg_target_call_iarg_regs[] = { TCG_REG_R1, TCG_REG_R2, TCG_REG_R3, -#if 0 /* used for TCG_REG_CALL_STACK */ TCG_REG_R4, -#endif TCG_REG_R5, - TCG_REG_R6, #if TCG_TARGET_REG_BITS == 32 /* 32 bit hosts need 2 * MAX_OPC_PARAM_IARGS registers. */ + TCG_REG_R6, TCG_REG_R7, TCG_REG_R8, TCG_REG_R9, TCG_REG_R10, TCG_REG_R11, - TCG_REG_R12, #endif };