Received: by 2002:a05:6a10:2785:0:0:0:0 with SMTP id ia5csp490110pxb; Thu, 14 Jan 2021 10:40:40 -0800 (PST) X-Google-Smtp-Source: ABdhPJx9b46yhMRsZq5dGmGhcMznDDcjhrR+grvoHWz7yCobSH2Q/g724hNU79wC3ozlIbKA3Qi8 X-Received: by 2002:a17:907:20a6:: with SMTP id pw6mr6389513ejb.73.1610649640584; Thu, 14 Jan 2021 10:40:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1610649640; cv=none; d=google.com; s=arc-20160816; b=WNOq02SNTulv8czV5bb4ef32sS4hiHrx8y7Oghx59JOL2L1chQDOBxJ0loUYQAwZ4Q ljtR5h5Uvi6Vyak/XARZa71XyB5rhdzkU/xSRsXoNiEgWEe5lpC3aqTgVPAIPxP6sWro WpkV8z9XL2TkOBFkorSpCE8FQaQOiqUDA2Fsa8t5JQ3CtOeNkETJFZwlUkbG2DAC8258 6n0vL3yf0qdvxNxnA4zDRinPiZnciyzW/3eVJPJ/NAqFJW5FfJsg+PJ7HKdIgNVcqBXF UQPec+1zYd2QMqG0d94Rivu0Bfau+0t2/JSY0P3RJnc4LDNzfl/Xih1vrex4ZFdjG3ph lGoA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=wjFPhre16JAbXYmYeke5uUR5hejH/ZPJIhT9f0OvOCE=; b=MlWNMWuHZQS6RP/iABbFHclSlp2/clUTTH/zFPjpPEA7k0QTebFM6JouUUAHDVQmFR 5pWaB81O/o28ETywis4JYorLRZscRxrz6yuK5ZMj4uXhVA3ftFl7KDw70j7UDUp2Vj11 U6nzfMcyKwEK4NA4l9uaVEILEcpRyp5vnztOLZHMp93du+kKEPqg9Fdv+9p6ZisGDER3 H1EaMFbL4tDPw/dvcwlrk49y4EN4hfdNa68ve+wgDdl8N9y9vJgcWSDMyrEOItth4duT neMwnmafaLotwzLW4PMsoz3D5n+BiVqqIDndvdeDTDpANd1Z2KibWsovevTTESPZOPpm 2oEA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id t21si3568088edi.2.2021.01.14.10.40.15; Thu, 14 Jan 2021 10:40:40 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727805AbhANSiW (ORCPT + 99 others); Thu, 14 Jan 2021 13:38:22 -0500 Received: from mail.kernel.org ([198.145.29.99]:50812 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726131AbhANSiW (ORCPT ); Thu, 14 Jan 2021 13:38:22 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 1A80423B1A; Thu, 14 Jan 2021 18:37:39 +0000 (UTC) Date: Thu, 14 Jan 2021 18:37:37 +0000 From: Catalin Marinas To: Marc Zyngier Cc: Srinivas Ramana , will@kernel.org, pajay@qti.qualcomm.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org, linux-arm-msm@vger.kernel.org Subject: Re: [PATCH 0/3] arm64: cpufeature: Add filter function to control Message-ID: <20210114183737.GG16561@gaia> References: <1610152163-16554-1-git-send-email-sramana@codeaurora.org> <6dfdf691b5ed57df81c4c61422949af5@misterjones.org> <7b53c01dd5afcb29679c3a9cf72407a9@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <7b53c01dd5afcb29679c3a9cf72407a9@kernel.org> User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jan 14, 2021 at 08:20:52AM +0000, Marc Zyngier wrote: > On 2021-01-14 07:15, Srinivas Ramana wrote: > > On 1/11/2021 5:40 AM, Marc Zyngier wrote: > > > On 2021-01-09 00:29, Srinivas Ramana wrote: > > > > This patchset adds a control function for cpufeature framework > > > > so that the feature can be controlled at runtime. > > > > > > > > Defer PAC on boot core and use the filter function added to disable > > > > PAC from command line. This will help toggling the feature on systems > > > > that do not support PAC or where PAC needs to be disabled at runtime, > > > > without modifying the core kernel. [...] > > > I've been working for some time on a similar series to allow a feature > > > set to be disabled during the early boot phase, initially to prevent > > > booting a kernel with VHE, but the mechanism is generic enough to > > > deal with most architectural features. > > > > > > I took the liberty to lift your first patch and to add it to my > > > series[1], > > > further allowing PAuth to be disabled at boot time on top of BTI and > > > VHE. > > > > > > I'd appreciate your comments on this. > > > > Thanks for sending this series. It seems to be more flexible compared > > you what we did. > > Following your discussion on allowing EXACT ftr_reg values. > > > > Btw, do you have plan to add MTE in similar lines to control the > > feature? > > We may be needing this on some systems. > > I don't have any need for this at the moment, as my initial goal was > to enable a different boot flow for VHE. The BTI "support" was added > as a way to demonstrate the use of __read_sysreg_by_encoding(), and > your patches were a good opportunity to converge on a single solution. > > But if you write the patches that do that, I can add them to the series, > and Catalin/Will can decide whether they want to take them. For MTE it's trickier (probably similar to VHE) as we do the setup early in proc.S before we hit the cpufeature infrastructure. So far we haven't agreed on disabling MTE means - is it disabled completely (no Normal Tagged memory type) or we just need to disable tag checking? The former is required if we expect buggy hardware (SoC-level, not necessarily CPU). The latter, at least for the kernel, is already handled via the kasan.mode cmdline. For user, we can disable the tagged address ABI via sysctl (or kernel cmdline) and it indirectly disabled MTE since the C library detects this. -- Catalin