Re: [PATCH v7 3/4] arm64: Don't use KPTI where we have E0PD
From: Suzuki K Poulose <suzuki.poulose@arm.com>
Date: 2019-11-07 15:03:54
On 07/11/2019 14:37, Mark Brown wrote:
On Thu, Nov 07, 2019 at 12:01:10PM +0000, Suzuki K Poulose wrote:quoted
On 06/11/2019 13:00, Mark Brown wrote:quoted
quoted
+ /* + * E0PD does a similar job to KPTI so can be used instead + * where available. + */ + if (IS_ENABLED(CONFIG_ARM64_E0PD)) { + ftr = read_sysreg_s(SYS_ID_AA64MMFR2_EL1);quoted
I am trying to write down the rationale of checking this per-CPU.quoted
Given that this gets run on all individual CPUs, via unmap_kernel_at_el0() and the decision of choosing KPTI is affected by the lack of the E0PD feature when it is helpful, having CPU local check is fine. Also this gives us the advantage of choosing an nG mapping when the boot CPU indicates the need.Well, it's mainly the fact that this runs really early on in boot before the cpufeature code has fully initialized so as with the existing code immediately below for identifying TX1 we can't rely on the cpufeature code being done.
Yes, I acknowledge that. I was writing it down to clear why this was fine and why it has its own advantage. This may not be obvious for someone who reads it later. So having this in a comment helps to avoid staring at it. Suzuki _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel