aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/arch/powerpc/include/asm/mmu.h
diff options
context:
space:
mode:
authorPaul Mackerras <paulus@ozlabs.org>2016-11-21 16:00:58 +1100
committerMichael Ellerman <mpe@ellerman.id.au>2016-11-23 10:32:11 +1100
commit9d66195807ac6cb8a14231fd055ff755977c5fca (patch)
tree1bfb452a5c1844a6e9f69b05d5b4448a20f6ddbc /arch/powerpc/include/asm/mmu.h
parentpowerpc/64: Add some more SPRs and SPR bits for POWER9 (diff)
downloadwireguard-linux-9d66195807ac6cb8a14231fd055ff755977c5fca.tar.xz
wireguard-linux-9d66195807ac6cb8a14231fd055ff755977c5fca.zip
powerpc/64: Provide functions for accessing POWER9 partition table
POWER9 requires the host to set up a partition table, which is a table in memory indexed by logical partition ID (LPID) which contains the pointers to page tables and process tables for the host and each guest. This factors out the initialization of the partition table into a single function. This code was previously duplicated between hash_utils_64.c and pgtable-radix.c. This provides a function for setting a partition table entry, which is used in early MMU initialization, and will be used by KVM whenever a guest is created. This function includes a tlbie instruction which will flush all TLB entries for the LPID and all caches of the partition table entry for the LPID, across the system. This also moves a call to memblock_set_current_limit(), which was in radix_init_partition_table(), but has nothing to do with the partition table. By analogy with the similar code for hash, the call gets moved to near the end of radix__early_init_mmu(). It now gets called when running as a guest, whereas previously it would only be called if the kernel is running as the host. Signed-off-by: Paul Mackerras <paulus@ozlabs.org> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Diffstat (limited to 'arch/powerpc/include/asm/mmu.h')
-rw-r--r--arch/powerpc/include/asm/mmu.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/arch/powerpc/include/asm/mmu.h b/arch/powerpc/include/asm/mmu.h
index e88368354e49..060b40b1bc3d 100644
--- a/arch/powerpc/include/asm/mmu.h
+++ b/arch/powerpc/include/asm/mmu.h
@@ -208,6 +208,11 @@ extern u64 ppc64_rma_size;
/* Cleanup function used by kexec */
extern void mmu_cleanup_all(void);
extern void radix__mmu_cleanup_all(void);
+
+/* Functions for creating and updating partition table on POWER9 */
+extern void mmu_partition_table_init(void);
+extern void mmu_partition_table_set_entry(unsigned int lpid, unsigned long dw0,
+ unsigned long dw1);
#endif /* CONFIG_PPC64 */
struct mm_struct;