[PATCH 1/3] arm64: cpufeature: Force HWCAP to be based on the sysreg visible to user-space

Suzuki K Poulose suzuki.poulose at arm.com
Mon Sep 12 08:20:56 PDT 2022


On 09/09/2022 17:59, James Morse wrote:
> arm64 advertises hardware features to user-space via HWCAPs, and by
> emulating access to the CPUs id registers. The cpufeature code has a
> sanitised system-wide view of an id register, and a sanitised user-space
> view of an id register, where some features use their 'safe' value
> instead of the hardware value.
> 
> It is currently possible for a HWCAP to be advertised where the user-space
> view of the id register does not show the feature as supported.
> Erratum workaround need to remove both the HWCAP, and the feature from
> the user-space view of the id register. This involves duplicating the
> code, and spreading it over cpufeature.c and cpu_errata.c.
> 
> Make the HWCAP code use the user-space view of id registers. This ensures
> the values never diverge, and allows erratum workaround to remove HWCAP
> by modifying the user-space view of the id register.

That sounds good to me.

> 
> Signed-off-by: James Morse <james.morse at arm.com>

Reviewed-by: Suzuki K Poulose <suzuki.poulose at arm.com>



More information about the linux-arm-kernel mailing list