From patchwork Tue Mar 1 21:59:42 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 547259 Delivered-To: patch@linaro.org Received: by 2002:ac0:9f50:0:0:0:0:0 with SMTP id l16csp4062876imf; Tue, 1 Mar 2022 14:01:55 -0800 (PST) X-Google-Smtp-Source: ABdhPJyXyXAtb8YqANMi2i2vzUZ3AsITqeGyKVCE4F6MfkEkCP8LHFbM3oAnPyMv9wAAnveUSLNV X-Received: by 2002:a81:fc06:0:b0:2d6:4a8d:943f with SMTP id g6-20020a81fc06000000b002d64a8d943fmr27795031ywi.464.1646172115357; Tue, 01 Mar 2022 14:01:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646172115; cv=none; d=google.com; s=arc-20160816; b=iBY76eyIh5xNXbWMzbbfwa0m/QXAGEXop/Wy5DXIDG+Cbddr3MDEN4A1/tFGcWibzJ 0HbCI5maGTCPUfb5IeEuLV9gCVar24xzwhSVh9wzaM47tkXbYq0xVbXOqYcsXOOuiSeq OSxbcVbKQ9aF+VVtWOPrRdSTCYy/iCzKCrb/fY/aXUYR3BFXa0uS6c7Ivq8yE7R4vYmc x7wQQiT3lMkEmidSOQiu+m+AEzfkXGVKpBLJG+jjHSJHHRMnpzBkbq6vt0DhrET0+jG8 +fJlhIhrP6JDdVlAWb+zMtAV8HA3exZjVzAx9yllQJT1wrRFPdBa3FTutSqxyNrVSwpN aZwA== 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=PZbShhk2NkO2reCY/T9TCsTkqYGHwn5vsq2VrbkkjiyF6XtPX+krTeJPCQblolMHD8 7JEMobruMGZ5AG0Z0PiIoQ7qulh1LXuxb8Pi8VfQZWCE3nA7HzXNJk5j6jFriGHAo6pX G7ZId3L5P7Qbj5uT3Phh8CFockDRY1T0Yw4A6nnFhfrS7HSMTuDSPWhWst5/hkI+a8KN wd7bOeU9GA5eiyXPBms8WOgsM9I6KTZqMrjlp2OtJHcmQdAxHO8eDpbePJBawU8ghAYJ l/VlC0i97efdAHCGL0whRbF+tJoAYg6PLtHbgVTklkFZCyju4I5qy1phOwPkHDlBhSYO BXwg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=iWENCHPY; 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 o7-20020a0dcc07000000b002dc08ab6db5si110941ywd.51.2022.03.01.14.01.55 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 01 Mar 2022 14:01:55 -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=iWENCHPY; 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]:57998 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nPAZ8-0001HB-RU for patch@linaro.org; Tue, 01 Mar 2022 17:01:54 -0500 Received: from eggs.gnu.org ([209.51.188.92]:58238) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nPAXU-0001F9-Qv for qemu-devel@nongnu.org; Tue, 01 Mar 2022 17:00:13 -0500 Received: from [2607:f8b0:4864:20::62a] (port=44926 helo=mail-pl1-x62a.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nPAXT-0004wB-6B for qemu-devel@nongnu.org; Tue, 01 Mar 2022 17:00:12 -0500 Received: by mail-pl1-x62a.google.com with SMTP id q11so14577561pln.11 for ; Tue, 01 Mar 2022 14:00:07 -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=iWENCHPYZqKwbsB8w9uYNeYg9InVg6/l1aX3WDGZzSjCc5EK9ycc/+CwlktONCfPCa hPfYWpllMJqmgylTcktcbf6FC69B6wjIEoksowCHtRFj3XF6SZrz/NPJNE52UlaBnBdg D9VChukulTP79+uRMGFmtMKrKaopmQ0qUoobCkqFrrX3yjv4t1BLy12aBqpOQC4pH25U mcm6yfXmIVA7nkJpdKuFUfK/ZTg+wNWvqKMFMQPUsaqHAcbj7mneiZ+K/b/grOyIJ0te +/Q861Vlr3WcEEQPVRvCEtq9vh9bKisEEUQaFhTzN1j+yGLIYjNI9gZPBuC1aZeAuPKq qLIw== 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=5+tBV/QEn+BoTCVr4JXmtT+lSkYXmDweS87Fm0WzClpnm8CkyqlhUGGfzxz4YlmwRq AOHO4ieCsOFmQAEaTq0Lj81KfUN/SlDU2D464vP2ylvfwZ4BVHjSEho/f2/J8PuUEuHL eGRsJbqA76NO6Q/ecVv07xFUcZBcnH9TAUChbtb86tp2pPa5NqD+DzRgbVj7Uf0EnU0x UUYr2kaHc1ijhh4EvDIyn4l5T6GOJcUvxmHBhkBEIuuq/Y+xBWqU27PPmr0Yt/yJXqae WMIjVqtd5Mcm9LyQKv0OJkHWATIm+d+v3dQayHjflF3oU+5rA9H0CSk8e14BWxmu66xd uYnA== X-Gm-Message-State: AOAM532C4dQ9dFHYKeN+l3gIFxm7bMNMf6E7Fegf9tJtrkeQmPcsPklJ ExxopxuPhRUExeG9TY+1dkASk0n494/GnQ== X-Received: by 2002:a17:902:bd04:b0:151:6cec:4b3 with SMTP id p4-20020a170902bd0400b001516cec04b3mr11176922pls.106.1646172006144; Tue, 01 Mar 2022 14:00:06 -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 m4-20020a17090a7f8400b001bef3fc3938sm284392pjl.49.2022.03.01.14.00.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 01 Mar 2022 14:00:05 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v4 02/18] target/arm: Set TCR_EL1.TSZ for user-only Date: Tue, 1 Mar 2022 11:59:42 -1000 Message-Id: <20220301215958.157011-3-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220301215958.157011-1-richard.henderson@linaro.org> References: <20220301215958.157011-1-richard.henderson@linaro.org> MIME-Version: 1.0 X-Host-Lookup-Failed: Reverse DNS lookup failed for 2607:f8b0:4864:20::62a (failed) Received-SPF: pass client-ip=2607:f8b0:4864:20::62a; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x62a.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)) {