[PATCH v1] arm64: errata: pass REVIDR when matching target implementation CPUs

Khushit Shah posted 1 patch 3 weeks, 5 days ago
arch/arm64/kernel/cpu_errata.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
[PATCH v1] arm64: errata: pass REVIDR when matching target implementation CPUs
Posted by Khushit Shah 3 weeks, 5 days ago
When target implementation CPUs are provided, is_affected_midr_range()
accidentally passed the MIDR as both arguments to __is_affected_midr_range(),
so the REVIDR mask check operated on the wrong register.

Pass REVIDR as intended.

Fixes: 86edf6bdcf05 ("smccc/kvm_guest: Enable errata based on implementation CPUs")
Cc: stable@vger.kernel.org
Signed-off-by: Khushit Shah <khushit.shah@nutanix.com>
---
 arch/arm64/kernel/cpu_errata.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm64/kernel/cpu_errata.c b/arch/arm64/kernel/cpu_errata.c
index 5db8f0619e4b..b33dccfafaf8 100644
--- a/arch/arm64/kernel/cpu_errata.c
+++ b/arch/arm64/kernel/cpu_errata.c
@@ -82,7 +82,7 @@ is_affected_midr_range(const struct arm64_cpu_capabilities *entry, int scope)
 
 	for (i = 0; i < target_impl_cpu_num; i++) {
 		if (__is_affected_midr_range(entry, target_impl_cpus[i].midr,
-					     target_impl_cpus[i].midr))
+					     target_impl_cpus[i].revidr))
 			return true;
 	}
 	return false;
-- 
2.39.3
Re: [PATCH v1] arm64: errata: pass REVIDR when matching target implementation CPUs
Posted by Will Deacon 3 weeks, 2 days ago
On Mon, 31 Aug 2026 10:54:44 +0000, Khushit Shah wrote:
> When target implementation CPUs are provided, is_affected_midr_range()
> accidentally passed the MIDR as both arguments to __is_affected_midr_range(),
> so the REVIDR mask check operated on the wrong register.
> 
> Pass REVIDR as intended.
> 
> 
> [...]

Applied to arm64 (for-next/fixes), thanks!

[1/1] arm64: errata: pass REVIDR when matching target implementation CPUs
      https://git.kernel.org/arm64/c/5541432e09dc

Cheers,
-- 
Will

https://fixes.arm64.dev
https://next.arm64.dev
https://will.arm64.dev
Re: [PATCH v1] arm64: errata: pass REVIDR when matching target implementation CPUs
Posted by Zenghui Yu 3 weeks, 3 days ago
On 8/31/26 6:54 PM, Khushit Shah wrote:
> When target implementation CPUs are provided, is_affected_midr_range()
> accidentally passed the MIDR as both arguments to __is_affected_midr_range(),
> so the REVIDR mask check operated on the wrong register.
> 
> Pass REVIDR as intended.
> 
> Fixes: 86edf6bdcf05 ("smccc/kvm_guest: Enable errata based on implementation CPUs")
> Cc: stable@vger.kernel.org
> Signed-off-by: Khushit Shah <khushit.shah@nutanix.com>
> ---
>  arch/arm64/kernel/cpu_errata.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/arch/arm64/kernel/cpu_errata.c b/arch/arm64/kernel/cpu_errata.c
> index 5db8f0619e4b..b33dccfafaf8 100644
> --- a/arch/arm64/kernel/cpu_errata.c
> +++ b/arch/arm64/kernel/cpu_errata.c
> @@ -82,7 +82,7 @@ is_affected_midr_range(const struct arm64_cpu_capabilities *entry, int scope)
>  
>  	for (i = 0; i < target_impl_cpu_num; i++) {
>  		if (__is_affected_midr_range(entry, target_impl_cpus[i].midr,
> -					     target_impl_cpus[i].midr))
> +					     target_impl_cpus[i].revidr))
>  			return true;
>  	}
>  	return false;

Reviewed-by: Zenghui Yu (Huawei) <zenghui.yu@linux.dev>

Thanks,
Zenghui
Re: [PATCH v1] arm64: errata: pass REVIDR when matching target implementation CPUs
Posted by Marc Zyngier 3 weeks, 3 days ago
On Mon, 31 Aug 2026 11:54:44 +0100,
Khushit Shah <khushit.shah@nutanix.com> wrote:
> 
> When target implementation CPUs are provided, is_affected_midr_range()
> accidentally passed the MIDR as both arguments to __is_affected_midr_range(),
> so the REVIDR mask check operated on the wrong register.
> 
> Pass REVIDR as intended.
> 
> Fixes: 86edf6bdcf05 ("smccc/kvm_guest: Enable errata based on implementation CPUs")
> Cc: stable@vger.kernel.org
> Signed-off-by: Khushit Shah <khushit.shah@nutanix.com>

Acked-by: Marc Zyngier <maz@kernel.org>

	M.

-- 
Jazz isn't dead. It just smells funny.