From patchwork Wed Feb 23 22:31:22 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 545219 X-Google-Smtp-Source: ABdhPJxyKZ0qOwpC6me0mw+e5NZIH76zg3XoTgHclis4q2qjC4a9SSxj3EFMbP7LegIc9FEJc+I3 X-Received: by 2002:a37:713:0:b0:49b:7d7a:60cd with SMTP id 19-20020a370713000000b0049b7d7a60cdmr1322822qkh.28.1645655739672; Wed, 23 Feb 2022 14:35:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1645655739; cv=none; d=google.com; s=arc-20160816; b=u7dIE8ijk8UtwvCKgbuvpQio2aEdKc+kJcX+tmK8IUluPVf6bBdJ4eLRydZHs5ffei 0ccP8rDsq0qqcuoAP84xhlZ+X1XpYtCVVhUMqDY2+mZjOPJtVRFpOlduX/5Dt9hPMZsU UkSXtNXpu6hQUJZJvWElgQC6pXMWY6RLqUA13xLPDYDZR3d88KioUuc18QbaQb36L585 W3RDDve4SG2xhJAQXEEKWTJgJWZ21dASou0acYlRTi/DAMgJnYy4sAfFPTzNnzEze6IA CsgPPuraqaK+YB8aPdoeqj+IKzeRFPNr+isORLr56DUYzCALcxd49BCh2WJn20xuWhVM 5F4Q== 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=E1rlJYYazfRdVeynNKa6RTb/vpD+L0sCNF3QpW/Zvp8=; b=MleRFkaTybfqm8CNS533+FOtFPg22To+lvfz1M9++D0oH1GkUBeWDw+8VfL+BbRMpI VgSA3prgnHOC6W7eLOcW/bBQN7GcDWtGiu2ErPX/hYtRp3FoFFrxlTt6xwm3DbWTbH5X XM1LieegGYiruw7RNUytGxqfSN15FBBrykjIzk7gVritF0x1kl2Yizfa8Zc12PQUls0e /ll/IEIMDfb3ScOZ1K2a9AW1DQJ4R1q0p9EIBrRdhB7BM8rzcmoMO6DHYJ7ekWxmLRva r76V+aP3DEulka3L02fdctTrgnETOGnPh19ZGL35QyjZz9MLjWU7oo6RSFnw6II4u+Lm VNVQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=Jb8iHIsI; 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 s19si629598qtk.469.2022.02.23.14.35.39 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 23 Feb 2022 14:35:39 -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=Jb8iHIsI; 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 ([::1]:38906 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nN0EV-00049Y-7Z for patch@linaro.org; Wed, 23 Feb 2022 17:35:39 -0500 Received: from eggs.gnu.org ([209.51.188.92]:59136) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nN0Al-0006TP-Pz for qemu-devel@nongnu.org; Wed, 23 Feb 2022 17:31:47 -0500 Received: from [2607:f8b0:4864:20::1032] (port=41617 helo=mail-pj1-x1032.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nN0Ai-0001C4-Oh for qemu-devel@nongnu.org; Wed, 23 Feb 2022 17:31:47 -0500 Received: by mail-pj1-x1032.google.com with SMTP id ev16-20020a17090aead000b001bc3835fea8so387082pjb.0 for ; Wed, 23 Feb 2022 14:31:44 -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=E1rlJYYazfRdVeynNKa6RTb/vpD+L0sCNF3QpW/Zvp8=; b=Jb8iHIsIPgJb0kC0LfCP9SJnJck4aqWMbmw/XpGeid3EnFq4BbyLek50qTwCz4jzsL MbLEYLA9kl71q2MqYL45ut7A977P1YFzlla+viEkLLGv53epD6EbGxqsR5YlLaOzc5Y0 2aiQAkjaUCgPaCIW/GMSfoI4py9OvHalkO2IQbrfzYd8jyGH4/qeXzLb4wlJSBkcIwhX s3HY8pubrIuFbaKlMonhNG7e+5DB0eClggee4SrKDdIkXjlLJLpshZj2CvwLMJQ1YcU1 yMv4tTvk90wGhhqvx7765UA1NM1EF3NPU4qRSP2hw6E2eeDUQtDQiGdGY3xvCEYAd20+ XTdQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=E1rlJYYazfRdVeynNKa6RTb/vpD+L0sCNF3QpW/Zvp8=; b=SFPp39gXT5OS/GtkTtX/0JsqRXr8QuQfwosv+E3neg6NBl9flsnP5npNim4b+97Mhi u6hQEbIaH/Sr5acALBoFVKkLKxTX2QlsO33whx+5wVbqeHg2CgRdyGHIutvHC3rf8SyC rSxILgAm4ne+f3pvx4TpyXiY5Y7XwniI8Mqdaw01IffZYac0Z+UQXibpA+XDj8gwMauA Tmnx3sJ2yT/6Gx+Wbr6J4j4AyUIYa161RieKKodBdMzwPpCNxWaaYnmY3bWtNudl2WgH f4UngNooIVj3C+fFge+ZxQqkmeB2w5Ne8Mz0qN/yuzAw2h5g1wvrrWc/rT+bdtdT8HpM Z/wg== X-Gm-Message-State: AOAM531CK4DtQeUgtGagmnBWLMVuKSYD5RvNHrMJ3nl5tABTAb+aVE93 4SoKk9Wr+HkoSQos6SuvihdRP6X5EZaaWw== X-Received: by 2002:a17:903:11cc:b0:14d:a0d5:76f with SMTP id q12-20020a17090311cc00b0014da0d5076fmr1687482plh.109.1645655503471; Wed, 23 Feb 2022 14:31:43 -0800 (PST) Received: from localhost.localdomain (cpe-50-113-46-110.hawaii.res.rr.com. [50.113.46.110]) by smtp.gmail.com with ESMTPSA id f8sm533815pfv.100.2022.02.23.14.31.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 23 Feb 2022 14:31:43 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v3 02/17] target/arm: Set TCR_EL1.TSZ for user-only Date: Wed, 23 Feb 2022 12:31:22 -1000 Message-Id: <20220223223137.114264-3-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220223223137.114264-1-richard.henderson@linaro.org> References: <20220223223137.114264-1-richard.henderson@linaro.org> MIME-Version: 1.0 X-Host-Lookup-Failed: Reverse DNS lookup failed for 2607:f8b0:4864:20::1032 (failed) Received-SPF: pass client-ip=2607:f8b0:4864:20::1032; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x1032.google.com X-Spam_score_int: -6 X-Spam_score: -0.7 X-Spam_bar: / X-Spam_report: (-0.7 / 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, PDS_HP_HELO_NORDNS=0.659, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no 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: , Cc: peter.maydell@linaro.org, qemu-arm@nongnu.org, alex.bennee@linaro.org Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Set this as the kernel would, to 48 bits, to keep the computation of the address space correct for PAuth. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- target/arm/cpu.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/target/arm/cpu.c b/target/arm/cpu.c index c085dc10ee..e251f0df4b 100644 --- a/target/arm/cpu.c +++ b/target/arm/cpu.c @@ -206,10 +206,11 @@ static void arm_cpu_reset(DeviceState *dev) aarch64_sve_zcr_get_valid_len(cpu, cpu->sve_default_vq - 1); } /* + * Enable 48-bit address space (TODO: take reserved_va into account). * Enable TBI0 but not TBI1. * Note that this must match useronly_clean_ptr. */ - env->cp15.tcr_el[1].raw_tcr = (1ULL << 37); + env->cp15.tcr_el[1].raw_tcr = 5 | (1ULL << 37); /* Enable MTE */ if (cpu_isar_feature(aa64_mte, cpu)) {