From patchwork Mon Mar 2 17:58:21 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 184098 Delivered-To: patch@linaro.org Received: by 2002:a92:1f12:0:0:0:0:0 with SMTP id i18csp2683828ile; Mon, 2 Mar 2020 10:02:12 -0800 (PST) X-Google-Smtp-Source: ADFU+vsmNYAtKOpfWWltZnVsmQ9t4sb+lP416gZv08lMyl7q5KqbMSslYfWjOZ4Fbs4qzYVxE6cW X-Received: by 2002:a37:341:: with SMTP id 62mr405433qkd.335.1583172132435; Mon, 02 Mar 2020 10:02:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1583172132; cv=none; d=google.com; s=arc-20160816; b=LDDzE5t1DFFJTuEbUW1SFShlXqaoNybiuFCfE3ocD8U+rIldL4lZ4NnXzN35zuapPj tplVebQzCc/Obr1NMumZb0gCrlAXGlY2VrYThazYgS74/Vf+r88Kzo0zAy9eSMJaHL68 WiDDDVd2OshKGcluFRjHnE/Qlv4VT6hljvqmx4a12csPl1XC+K6l7AaTUXVslh5rNurx ooqss+hi/aT5yDC8Mz+ru2CZertpkWzsS7ll3Jygoodlw7JDQrqwas6ly7xEwBDueU8t cuGDMnwhlqtyZV4vGDJ9G5lRUPj1gY2qDm9qFWb6HCXn62h9t1FFDgmIYp8H2v9xD/jZ bZtw== 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=SmyuQTNOfGklwQG6G7fcasvxH7i/TWvMZQATgc7JYwI=; b=zrvkJ3txCodphZzRXKx9PmtkzfPeqib2pVK5bDbl4EJ1Hs/UzV61JiB06lnIFFg+qh hPy0zjudFEOTlL9bxtXRm1U4smHWCZqdbbjfnYISPpGpKPmTgGX8h4XZHAkHikOzXrsC 41jhjdhrOmi8s/UWznn+dXmE8cQ63fhk00xklhP2AznMrMHVbfw2hTJvLC0VaOz+IvDN T2kNFHII6jJFXYbqEo74iO4YRGkzmE2mIdHvWRf0XBoxjhsvMIpUCeymLGvAQFVmLtTm ijaMBOLP2r8LkPct/CTYgJlHlBIhUpuDjs+ehDSvpDSO+0BvrOPlsV2qolxReKQO24g1 4gFA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=E5zlf7qR; 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 d69si6720804qke.361.2020.03.02.10.02.12 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 02 Mar 2020 10:02:12 -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=E5zlf7qR; 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]:36416 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j8pON-0004xK-Ui for patch@linaro.org; Mon, 02 Mar 2020 13:02:11 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:39012) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j8pKt-0006af-7n for qemu-devel@nongnu.org; Mon, 02 Mar 2020 12:58:36 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j8pKs-0007XY-B0 for qemu-devel@nongnu.org; Mon, 02 Mar 2020 12:58:35 -0500 Received: from mail-pj1-x1044.google.com ([2607:f8b0:4864:20::1044]:37685) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1j8pKs-0007XC-5w for qemu-devel@nongnu.org; Mon, 02 Mar 2020 12:58:34 -0500 Received: by mail-pj1-x1044.google.com with SMTP id o2so103952pjp.2 for ; Mon, 02 Mar 2020 09:58: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 :mime-version:content-transfer-encoding; bh=SmyuQTNOfGklwQG6G7fcasvxH7i/TWvMZQATgc7JYwI=; b=E5zlf7qRFUNGm3M6JUSO6MuqSa1+o82//RPtACzUuRGMfuZRUdAgDjWO6A7Yj/M5Fy aDA7br2lBM9O2I5cOS8eK93fwtjc7WAaSMIzhMqsjXo3rTcWRpC7EMpx9hGXR6jIcJV6 H0FSDPHAJKVhYMb2djE9OrxuEVWiOPrxCELpxJSW+JV95dRPE4T2TfZNvzEoPUB/eCOB 4RzwzreuFzaoraSP+7NLi4eSFrZEhX1/0EfKX61v5mKLg4qw6xkeXigX8NRq3V0kKGTN mV6D76TKRPxShHToU9d5rjyi8mEwwyFImSfVvAnzBZJv39HPtKRUnwleNzWZYJB6iFvN AUeQ== 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=SmyuQTNOfGklwQG6G7fcasvxH7i/TWvMZQATgc7JYwI=; b=IfGzUQvY6EQoTYHNWQxqBZMS0QzRj/DTNXAOxBZs+PZZyGoeBSBtqqI7M8sDnFAJUB z4h9OdX7y3RZU+5MAmSCdb2VWGexDp+8fndP7NnU8DEdmNgS296hMA4MSTU5lyHN4T6M V4FZwPr/K5CcW84wIC5TQnIwNJLfQ1U6pnQv2CgW6R7miIygyOG+f7laxfnrI6xQ06ER pNfGRwLRAquZVKipqh2q5K1JHU39nrBbxcQRX/9TugfeE7Hpw7mvz1WbESrL72QULeVI 0y8g4JzF6acPIMPW5BObpjBrClYaTHJofXiX4O30eQ1r42izFhF+b6/S1QnZN3qaAxxQ 1IBQ== X-Gm-Message-State: ANhLgQ0j8idw2aqddX/QSxcbL9Fw8r9dd9WdqS/M1DHFgYsRqCLR0nsb VFidcrb/VmfkDA/QHLIelCGgEwGyiMo= X-Received: by 2002:a17:90a:6545:: with SMTP id f5mr130697pjs.42.1583171912913; Mon, 02 Mar 2020 09:58:32 -0800 (PST) Received: from localhost.localdomain (97-126-123-70.tukw.qwest.net. [97.126.123.70]) by smtp.gmail.com with ESMTPSA id s18sm99510pjp.24.2020.03.02.09.58.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 Mar 2020 09:58:32 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v2 1/9] target/arm: Replicate TBI/TBID bits for single range regimes Date: Mon, 2 Mar 2020 09:58:21 -0800 Message-Id: <20200302175829.2183-2-richard.henderson@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200302175829.2183-1-richard.henderson@linaro.org> References: <20200302175829.2183-1-richard.henderson@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::1044 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: peter.maydell@linaro.org, qemu-arm@nongnu.org Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Replicate the single TBI bit from TCR_EL2 and TCR_EL3 so that we can unconditionally use pointer bit 55 to index into our composite TBI1:TBI0 field. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- target/arm/helper.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) -- 2.20.1 Reviewed-by: Philippe Mathieu-Daudé diff --git a/target/arm/helper.c b/target/arm/helper.c index 6be9ffa09e..37ffe06c05 100644 --- a/target/arm/helper.c +++ b/target/arm/helper.c @@ -10316,7 +10316,8 @@ static int aa64_va_parameter_tbi(uint64_t tcr, ARMMMUIdx mmu_idx) } else if (mmu_idx == ARMMMUIdx_Stage2) { return 0; /* VTCR_EL2 */ } else { - return extract32(tcr, 20, 1); + /* Replicate the single TBI bit so we always have 2 bits. */ + return extract32(tcr, 20, 1) * 3; } } @@ -10327,7 +10328,8 @@ static int aa64_va_parameter_tbid(uint64_t tcr, ARMMMUIdx mmu_idx) } else if (mmu_idx == ARMMMUIdx_Stage2) { return 0; /* VTCR_EL2 */ } else { - return extract32(tcr, 29, 1); + /* Replicate the single TBID bit so we always have 2 bits. */ + return extract32(tcr, 29, 1) * 3; } }