On Tue, Apr 21, 2020 at 03:26:01PM +0100, Catalin Marinas wrote: > Even if the ID_AA64PFR1_EL1 register advertises the presence of MTE, it > is not guaranteed that the memory system on the SoC supports the > feature. In the absence of system-wide MTE support, the behaviour is > undefined and the kernel should not enable the MTE memory type in > MAIR_EL1. > > For FDT, add an 'arm,armv8.5-memtag' property to the /memory nodes and > check for its presence during MTE probing. For example: > > memory@80000000 { > device_type = "memory"; > arm,armv8.5-memtag; > reg = <0x00000000 0x80000000 0 0x80000000>, > <0x00000008 0x80000000 0 0x80000000>; > }; > > If the /memory nodes are not present in DT or if at least one node does > not support MTE, the feature will be disabled. On EFI systems, it is > assumed that the memory description matches the EFI memory map (if not, > it is considered a firmware bug). > > MTE is not currently supported on ACPI systems. > > Signed-off-by: Catalin Marinas <catalin.marinas@xxxxxxx> > Cc: Rob Herring <Rob.Herring@xxxxxxx> > Cc: Mark Rutland <mark.rutland@xxxxxxx> > Cc: Will Deacon <will@xxxxxxxxxx> > Cc: Suzuki K Poulose <Suzuki.Poulose@xxxxxxx> This patch turns out to be incomplete. While it does not expose the HWCAP2_MTE to user when the above DT property is not present, it still allows user access to the ID_AA64PFR1_EL1.MTE field (via MRS emulations) since it is marked as visible. -- Catalin