Thread (13 messages) 13 messages, 4 authors, 2017-10-11
DORMANTno replies
Revisions (24)
  1. v1 [diff vs current]
  2. v1 [diff vs current]
  3. v1 [diff vs current]
  4. v1 [diff vs current]
  5. v1 [diff vs current]
  6. v1 [diff vs current]
  7. v1 [diff vs current]
  8. v1 current
  9. v2 [diff vs current]
  10. v2 [diff vs current]
  11. v2 [diff vs current]
  12. v2 [diff vs current]
  13. v3 [diff vs current]
  14. v4 [diff vs current]
  15. v4 [diff vs current]
  16. v5 [diff vs current]
  17. v5 [diff vs current]
  18. v5 [diff vs current]
  19. v5 [diff vs current]
  20. v5 [diff vs current]
  21. v5 [diff vs current]
  22. v5 [diff vs current]
  23. v6 [diff vs current]
  24. v6 [diff vs current]

[PATCH 1/3] arm64: mm: Support Common Not Private translations

From: Vladimir Murzin <hidden>
Date: 2017-10-11 08:49:09

On 10/10/17 16:19, James Morse wrote:
Hi Vladimir,

On 09/10/17 13:55, Vladimir Murzin wrote:
quoted
Common Not Private (CNP) is a feature of ARMv8.2 extension which
allows translation table entries to be shared between different PEs in
the same inner shareable domain, so the hardware can use this fact to
optimise the caching of such entries in the TLB.
quoted
diff --git a/arch/arm64/kernel/cpufeature.c b/arch/arm64/kernel/cpufeature.c
index 21e2c95..8d098a1 100644
--- a/arch/arm64/kernel/cpufeature.c
+++ b/arch/arm64/kernel/cpufeature.c
@@ -1211,6 +1224,14 @@ cpufeature_pan_not_uao(const struct arm64_cpu_capabilities *entry, int __unused)
 	return (cpus_have_const_cap(ARM64_HAS_PAN) && !cpus_have_const_cap(ARM64_HAS_UAO));
 }
 
+#ifdef CONFIG_ARM64_CNP
+static int cpu_enable_cnp(void *__unused)
+{
+	cpu_replace_ttbr1(swapper_pg_dir);
All the other callers of cpu_replace_ttbr1() wrap swapper_pg_dir in lm_alias().
I'm pretty sure this is so that virt_to_phys() works when swapper_pg_dir's
address is in the vmalloc range.

CONFIG_DEBUG_VIRTUAL should catch problems like this.
Indeed it did!

(Nit: you shouldn't need the #ifdeffery, the only caller of this function is in
the same file, so the compiler should do the right thing)
I'll look into it.

Thanks
Vladimir
quoted
+	return 0;
+}
+#endif /* CONFIG_ARM64_CNP */
+
 /*
  * We emulate only the following system register space.
  * Op0 = 0x3, CRn = 0x0, Op1 = 0x0, CRm = [0, 4 - 7]
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help