Skip to contentSkip to conversation

powerpc/mm: Enable TLB flush during native_register_proc_table()

RFC In review Anshuman Khandual 2 participants 2 messages Jan 10, 2018 – Jan 15, 2018 PowerPC

lore
Share & tools
lore
#0 lore raw

RFC 1/1 powerpc/mm: Enable TLB flush during native_register_proc_table()

From: Anshuman Khandual <[email protected]>

Any changes to the partition table must be followed by appropriate TLB flush which is not happening at present in native_register_proc_table() path. Fix this by calling mmu_partition_table_set_entry() which does take care of TLB flushing after the partition table update.

---
- From code inspection
- Compile, boot tested without CONFIG_PPC_RADIX_MMU
- Though it seems to be not getting called from any where

 arch/powerpc/mm/hash_native_64.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
arch/powerpc/mm/hash_native_64.c +4 -2
index 640cf56..89be5a6 100644
@@ -758,12 +758,14 @@ static void native_flush_hash_range(unsigned long number, int local)
 static int native_register_proc_table(unsigned long base, unsigned long page_size,
 				      unsigned long table_size)
 {
-	unsigned long patb1 = base << 25; /* VSID */
+	unsigned long patb0, patb1;
 
+	patb1 = base << 25;	    /* VSID */
 	patb1 |= (page_size << 5);  /* sllp */
 	patb1 |= table_size;
 
-	partition_tb->patb1 = cpu_to_be64(patb1);
+	patb0 = be64_to_cpu(partition_tb[0].patb0);
+	mmu_partition_table_set_entry(0, patb0, patb1);
 	return 0;
 }
 
Signature · 1 line
1.8.3.1
#1 lore raw
Quoted 7 lines · Anshuman Khandual

From: Anshuman Khandual <[email protected]>

Any changes to the partition table must be followed by appropriate TLB flush which is not happening at present in native_register_proc_table() path. Fix this by calling mmu_partition_table_set_entry() which does take care of TLB flushing after the partition table update.

Quoted 5 lines

---
- From code inspection
- Compile, boot tested without CONFIG_PPC_RADIX_MMU
- Though it seems to be not getting called from any where

For hash the patb1 is zero and hence it is not called. This is left over from the segment table implementation. I guess we can remove native_register_proc_table.

Quoted 27 lines
 arch/powerpc/mm/hash_native_64.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
arch/powerpc/mm/hash_native_64.c +4 -2
index 640cf56..89be5a6 100644
@@ -758,12 +758,14 @@ static void native_flush_hash_range(unsigned long number, int local)
 static int native_register_proc_table(unsigned long base, unsigned long page_size,
 				      unsigned long table_size)
 {
-	unsigned long patb1 = base << 25; /* VSID */
+	unsigned long patb0, patb1;
 
+	patb1 = base << 25;	    /* VSID */
 	patb1 |= (page_size << 5);  /* sllp */
 	patb1 |= table_size;
 
-	partition_tb->patb1 = cpu_to_be64(patb1);
+	patb0 = be64_to_cpu(partition_tb[0].patb0);
+	mmu_partition_table_set_entry(0, patb0, patb1);
 	return 0;
 }
 
Signature · 1 line
1.8.3.1