From patchwork Tue Jan 8 22:31:20 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 155039 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp50455jaa; Tue, 8 Jan 2019 14:59:18 -0800 (PST) X-Google-Smtp-Source: ALg8bN7VYMaZsyEeIQFB4pZ4QZUCvWyER83w1DRJSV0BpCd8SpEtalWq4iT78J5G3z3xxRuMDMB3 X-Received: by 2002:a1c:9dc4:: with SMTP id g187mr3319999wme.152.1546988358091; Tue, 08 Jan 2019 14:59:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1546988358; cv=none; d=google.com; s=arc-20160816; b=INjFm++Fq3ZO7H0nD2aKjHusFg6JIVCc5NxkKofHrsEpI8nQh092IfpBNUt04NvyB7 zjo0nIZiFTvLH3ldALvb79NSseh9J6JjGmigv16eWnlinDVItDSV6H7SyDHjzuNPnJrI b6/qdSSYaemhAFN/7vFVp/YuwwhNojVut1AHtqePGqHNW8FkUpRoguj3GjAoQ+y0ZUg8 1s/v2Qzb2VgJt0HshXBqXl484APfblTEpZuvT8h41iytf1IwRq4ihC1iB0ujbDaUKr/S FXoy+bi3MDWYWAkTJSIGKkz9Sd7UAjeJJ0a96hHofMs9dIfSC6LAYBrukBIcsysatItQ U+DA== 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:subject:references:in-reply-to :message-id:date:to:from:dkim-signature; bh=Y+pdCEdbsU3nNMbRtt2E6v/yS6MnA/Ob8unhe6A5OEI=; b=FVgKxlZKfyk93bGgFwsV9KLaxKqRloUbwyfx5mXLTAr1OtLBl4PQtBvw6nrKpAYbyr +sphNAHT4/pCARfXbkIF6Vw8xhRe3gLN4wqKRV64j9LKKSZrK555bJD0oo5M7eHNoCSF ziiKoDJvE3JEO1HE6wT0joRzYRebG4mvOU3IeI8jPiaF/iZWW3WruafUdMXyctMXg3WF 9GBl43+uJJakJg5fd6c2p9WBSiou5Xhj9QIUYwzXM/Yar+rVFOqDsGi8OUfi56p1aV0o S6IdtXM3ynN1bImjSSj7rrFZG/FfKXMCg6sUfjv8gvansiJgU26a9t7GN19FwmlOhnou c+hQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b="D/9zyi+k"; 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=fail (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 h70si40042951wrh.88.2019.01.08.14.59.17 for (version=TLS1 cipher=AES128-SHA bits=128/128); Tue, 08 Jan 2019 14:59:18 -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=fail header.i=@linaro.org header.s=google header.b="D/9zyi+k"; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([127.0.0.1]:46505 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gh0L7-0000d7-3f for patch@linaro.org; Tue, 08 Jan 2019 17:59:17 -0500 Received: from eggs.gnu.org ([209.51.188.92]:52881) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ggzvH-0000RG-Qa for qemu-devel@nongnu.org; Tue, 08 Jan 2019 17:32:36 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ggzvH-00050K-0g for qemu-devel@nongnu.org; Tue, 08 Jan 2019 17:32:35 -0500 Received: from mail-pf1-x441.google.com ([2607:f8b0:4864:20::441]:33238) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ggzvG-0004zS-QW for qemu-devel@nongnu.org; Tue, 08 Jan 2019 17:32:34 -0500 Received: by mail-pf1-x441.google.com with SMTP id c123so2630570pfb.0 for ; Tue, 08 Jan 2019 14:32:34 -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; bh=Y+pdCEdbsU3nNMbRtt2E6v/yS6MnA/Ob8unhe6A5OEI=; b=D/9zyi+kGlPQG0+qzVrztVcZXsKMlhFoLRoTPvLcaXTZnDCnGJqCpPtG/KdiPq29ny O9WRD5tJCKoeWkEDZcR08+ge/y5R4zc6nmaxHlEksSzdENJ82Hl20AtNdyJII2PmqIve PgXADgRbIBhUBKh1qDxoEvBVKrzZ/+CSQj7J8= 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; bh=Y+pdCEdbsU3nNMbRtt2E6v/yS6MnA/Ob8unhe6A5OEI=; b=c3Z/bQ9cAWbiOU6pskqDPYts5+kTadKracYO5ObVDXbksSL0GmLZUcuYrA5PQquRpJ GWhoiR+U5SaGMLxI2wouO8WfBmwl2H8nlhbq47UNSgvJiHKmZlI59egel5rpkjc5Pn9Y 5lruM/tQVp+35Tmf5g/9y+xOLa0xcW7VLAfJ2QFq1dlPYPfnfrnv9obcsQz4OXKvd/Lk Q+dV82xJSPOpE2f+kqxs/Zs8TnL03Kq3gHdS57LLWM1RKMD3VkgKX0dSohY4i3AHvNMz lDhMG8qKY5faRhcBJQqR+Vk1RHcQT29Qx+uP+fZ/+adWaxqbQHXfAqE/zWaowqYfLya1 8sTQ== X-Gm-Message-State: AJcUukc9aFGNANEjii+NG2QsJBoTjKAJhIhF1ytx/n4cO5ne57qOA7J9 pOlexK2NfMNzG9tYFZUhqJWWlA7SGgE= X-Received: by 2002:a62:140a:: with SMTP id 10mr3444846pfu.157.1546986753592; Tue, 08 Jan 2019 14:32:33 -0800 (PST) Received: from cloudburst.lan (2001-44b8-2176-c800-8cc6-2630-7d99-5ef1.static.ipv6.internode.on.net. [2001:44b8:2176:c800:8cc6:2630:7d99:5ef1]) by smtp.gmail.com with ESMTPSA id w128sm100686177pfw.79.2019.01.08.14.32.31 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 08 Jan 2019 14:32:32 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Date: Wed, 9 Jan 2019 08:31:20 +1000 Message-Id: <20190108223129.5570-23-richard.henderson@linaro.org> X-Mailer: git-send-email 2.17.2 In-Reply-To: <20190108223129.5570-1-richard.henderson@linaro.org> References: <20190108223129.5570-1-richard.henderson@linaro.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::441 Subject: [Qemu-devel] [PATCH v3 22/31] target/arm: Decode TBID from TCR X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peter.maydell@linaro.org Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Use TBID in aa64_va_parameters depending on the data parameter. This automatically updates all existing users of the function. Signed-off-by: Richard Henderson --- target/arm/internals.h | 1 + target/arm/helper.c | 14 +++++++++++--- 2 files changed, 12 insertions(+), 3 deletions(-) -- 2.17.2 Reviewed-by: Peter Maydell diff --git a/target/arm/internals.h b/target/arm/internals.h index acd99b579c..a6fd4582b2 100644 --- a/target/arm/internals.h +++ b/target/arm/internals.h @@ -950,6 +950,7 @@ typedef struct ARMVAParameters { unsigned tsz : 8; unsigned select : 1; bool tbi : 1; + bool tbid : 1; bool epd : 1; bool hpd : 1; bool using16k : 1; diff --git a/target/arm/helper.c b/target/arm/helper.c index 28322ae109..cc3c0d47c8 100644 --- a/target/arm/helper.c +++ b/target/arm/helper.c @@ -9749,7 +9749,7 @@ ARMVAParameters aa64_va_parameters_both(CPUARMState *env, uint64_t va, { uint64_t tcr = regime_tcr(env, mmu_idx)->raw_tcr; uint32_t el = regime_el(env, mmu_idx); - bool tbi, epd, hpd, using16k, using64k; + bool tbi, tbid, epd, hpd, using16k, using64k; int select, tsz; /* Bit 55 is always between the two regions, and is canonical for @@ -9763,10 +9763,11 @@ ARMVAParameters aa64_va_parameters_both(CPUARMState *env, uint64_t va, using16k = extract32(tcr, 15, 1); if (mmu_idx == ARMMMUIdx_S2NS) { /* VTCR_EL2 */ - tbi = hpd = false; + tbi = tbid = hpd = false; } else { tbi = extract32(tcr, 20, 1); hpd = extract32(tcr, 24, 1); + tbid = extract32(tcr, 29, 1); } epd = false; } else if (!select) { @@ -9776,6 +9777,7 @@ ARMVAParameters aa64_va_parameters_both(CPUARMState *env, uint64_t va, using16k = extract32(tcr, 15, 1); tbi = extract64(tcr, 37, 1); hpd = extract64(tcr, 41, 1); + tbid = extract64(tcr, 51, 1); } else { int tg = extract32(tcr, 30, 2); using16k = tg == 1; @@ -9784,6 +9786,7 @@ ARMVAParameters aa64_va_parameters_both(CPUARMState *env, uint64_t va, epd = extract32(tcr, 23, 1); tbi = extract64(tcr, 38, 1); hpd = extract64(tcr, 42, 1); + tbid = extract64(tcr, 52, 1); } tsz = MIN(tsz, 39); /* TODO: ARMv8.4-TTST */ tsz = MAX(tsz, 16); /* TODO: ARMv8.2-LVA */ @@ -9792,6 +9795,7 @@ ARMVAParameters aa64_va_parameters_both(CPUARMState *env, uint64_t va, .tsz = tsz, .select = select, .tbi = tbi, + .tbid = tbid, .epd = epd, .hpd = hpd, .using16k = using16k, @@ -9802,7 +9806,11 @@ ARMVAParameters aa64_va_parameters_both(CPUARMState *env, uint64_t va, ARMVAParameters aa64_va_parameters(CPUARMState *env, uint64_t va, ARMMMUIdx mmu_idx, bool data) { - return aa64_va_parameters_both(env, va, mmu_idx); + ARMVAParameters ret = aa64_va_parameters_both(env, va, mmu_idx); + + /* Present TBI as a composite with TBID. */ + ret.tbi &= (data || !ret.tbid); + return ret; } static ARMVAParameters aa32_va_parameters(CPUARMState *env, uint32_t va,