diff options
author | Michael Ellerman <mpe@ellerman.id.au> | 2017-02-14 09:18:29 +0300 |
---|---|---|
committer | Michael Ellerman <mpe@ellerman.id.au> | 2017-02-14 09:18:29 +0300 |
commit | da0e7e6276968fcc61ac7484d0026cd5fdd94dc3 (patch) | |
tree | 79a03731cca75ab4a41e7e7162288b22150811a3 /arch/powerpc/mm/pgtable_64.c | |
parent | a05ef161cdd22faccffe06f21fc8f1e249565385 (diff) | |
parent | ab9bad0ead9ab179ace09988a3f1cfca122eb7c2 (diff) | |
download | linux-da0e7e6276968fcc61ac7484d0026cd5fdd94dc3.tar.xz |
Merge branch 'topic/ppc-kvm' into next
Merge the topic branch we're sharing with the kvm-ppc tree.
Diffstat (limited to 'arch/powerpc/mm/pgtable_64.c')
-rw-r--r-- | arch/powerpc/mm/pgtable_64.c | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/arch/powerpc/mm/pgtable_64.c b/arch/powerpc/mm/pgtable_64.c index 4ee9c9d18760..db93cf747a03 100644 --- a/arch/powerpc/mm/pgtable_64.c +++ b/arch/powerpc/mm/pgtable_64.c @@ -458,13 +458,23 @@ void __init mmu_partition_table_init(void) void mmu_partition_table_set_entry(unsigned int lpid, unsigned long dw0, unsigned long dw1) { + unsigned long old = be64_to_cpu(partition_tb[lpid].patb0); + partition_tb[lpid].patb0 = cpu_to_be64(dw0); partition_tb[lpid].patb1 = cpu_to_be64(dw1); - /* Global flush of TLBs and partition table caches for this lpid */ + /* + * Global flush of TLBs and partition table caches for this lpid. + * The type of flush (hash or radix) depends on what the previous + * use of this partition ID was, not the new use. + */ asm volatile("ptesync" : : : "memory"); - asm volatile(PPC_TLBIE_5(%0,%1,2,0,0) : : - "r" (TLBIEL_INVAL_SET_LPID), "r" (lpid)); + if (old & PATB_HR) + asm volatile(PPC_TLBIE_5(%0,%1,2,0,1) : : + "r" (TLBIEL_INVAL_SET_LPID), "r" (lpid)); + else + asm volatile(PPC_TLBIE_5(%0,%1,2,0,0) : : + "r" (TLBIEL_INVAL_SET_LPID), "r" (lpid)); asm volatile("eieio; tlbsync; ptesync" : : : "memory"); } EXPORT_SYMBOL_GPL(mmu_partition_table_set_entry); |