From: Will Deacon <will@kernel.org>
Date: Thu, 4 Jan 2024 12:28:46 +0000 (+0000)
Subject: Merge branch 'for-next/fixes' into for-next/core
X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=db32cf8e280b46726065c518e90761bb0229bacf;p=users%2Fwilly%2Fxarray.git

Merge branch 'for-next/fixes' into for-next/core

Merge in arm64 fixes queued for 6.7 so that kpti_install_ng_mappings()
can be updated to use arm64_kernel_unmapped_at_el0() instead of checking
the ARM64_UNMAP_KERNEL_AT_EL0 CPU capability directly.

* for-next/fixes:
  arm64: mm: Always make sw-dirty PTEs hw-dirty in pte_modify
  perf/arm-cmn: Fail DTC counter allocation correctly
  arm64: Avoid enabling KPTI unnecessarily
---

db32cf8e280b46726065c518e90761bb0229bacf
diff --cc arch/arm64/kernel/cpufeature.c
index 73b10e64b9df,91d2d6714969..01a4c1d7fc09
--- a/arch/arm64/kernel/cpufeature.c
+++ b/arch/arm64/kernel/cpufeature.c
@@@ -1843,6 -1839,10 +1843,10 @@@ static int __init __kpti_install_ng_map
  
  static void __init kpti_install_ng_mappings(void)
  {
+ 	/* Check whether KPTI is going to be used */
 -	if (!cpus_have_cap(ARM64_UNMAP_KERNEL_AT_EL0))
++	if (!arm64_kernel_unmapped_at_el0())
+ 		return;
+ 
  	/*
  	 * We don't need to rewrite the page-tables if either we've done
  	 * it already or we have KASLR enabled and therefore have not