powerpc/mm: Flush radix process translations when setting MMU type
PATCH v2 1/1 powerpc/mm: Flush radix process translations when setting MMU type
Radix guests do normally invalidate process-scoped translations when a new pid is allocated but migrated guests do not invalidate these so migrated guests crash sometime, especially easy to reproduce with migration happening within first 10 seconds after the guest boot start on the same machine.
This adds the "Invalidate process-scoped translations" flush to fix radix guests migration.
---
Changes:
v2:
* removed PPC_TLBIE_5() from the !(old&PATH_HR) case as it is pointless on hash
---
Not so sure that "process-scoped translations" only require flushing at pid allocation and migration.
--- arch/powerpc/mm/pgtable_64.c | 2 ++ 1 file changed, 2 insertions(+)
arch/powerpc/mm/pgtable_64.c +2 -0
@@ -471,6 +471,8 @@ void mmu_partition_table_set_entry(unsigned int lpid, unsigned long dw0,if (old &PATB_HR ) { asm volatile(PPC_TLBIE_5(%0,%1,2,0,1) : : "r" (TLBIEL_INVAL_SET_LPID), "r" (lpid)); + asm volatile(PPC_TLBIE_5(%0,%1,2,1,1) : : + "r" (TLBIEL_INVAL_SET_LPID), "r" (lpid));trace_tlbie (lpid,0 ,TLBIEL_INVAL_SET_LPID , lpid,2 ,0 ,1 ); }else { asm volatile(PPC_TLBIE_5(%0,%1,2,0,0) : :
Signature · 1 line
2.11.0
Quoted 32 lines · Alexey Kardashevskiy
Radix guests do normally invalidate process-scoped translations when a new pid is allocated but migrated guests do not invalidate these so migrated guests crash sometime, especially easy to reproduce with migration happening within first 10 seconds after the guest boot start on the same machine.
This adds the "Invalidate process-scoped translations" flush to fix radix guests migration.
Signed-off-by Alexey Kardashevskiy <[email protected]>---
Changes:
v2:
* removedPPC_TLBIE_5()from the !(old&PATH_HR) case as it is pointless on hash---
Not so sure that "process-scoped translations" only require flushing at pid allocation and migration.
--- arch/powerpc/mm/pgtable_64.c | 2 ++ 1 file changed, 2 insertions(+)arch/powerpc/mm/pgtable_64.c +0
-0
arch/powerpc/mm/pgtable_64.c void mmu_partition_table_set_entry(unsigned int lpid, unsigned long dw0, · line 478
Quoted 8 lines
arch/powerpc/mm/pgtable_64.c +2
-0@@ -471,6 +471,8 @@ void mmu_partition_table_set_entry(unsigned int lpid, unsigned long dw0,if (old &PATB_HR ) { asm volatile(PPC_TLBIE_5(%0,%1,2,0,1) : : "r" (TLBIEL_INVAL_SET_LPID), "r" (lpid)); + asm volatile(PPC_TLBIE_5(%0,%1,2,1,1) : : + "r" (TLBIEL_INVAL_SET_LPID), "r" (lpid));trace_tlbie (lpid,0 ,TLBIEL_INVAL_SET_LPID , lpid,2 ,0 ,1 ); }else { asm volatile(PPC_TLBIE_5(%0,%1,2,0,0) : :
This patch fixes for me a VM migration crash on POWER9.
Thanks,
Laurent
Daniel Henrique Barboza
Tested-byQuoted 27 lines · Laurent Vivier
Quoted 26 lines · Alexey Kardashevskiy
Radix guests do normally invalidate process-scoped translations when a new pid is allocated but migrated guests do not invalidate these so migrated guests crash sometime, especially easy to reproduce with migration happening within first 10 seconds after the guest boot start on the same machine.
This adds the "Invalidate process-scoped translations" flush to fix radix guests migration.
Signed-off-by Alexey Kardashevskiy <[email protected]>---
Changes:
v2:
* removedPPC_TLBIE_5()from the !(old&PATH_HR) case as it is pointless on hash---
Not so sure that "process-scoped translations" only require flushing at pid allocation and migration.
--- arch/powerpc/mm/pgtable_64.c | 2 ++ 1 file changed, 2 insertions(+)
Quoted 15 lines
Quoted 6 lines
arch/powerpc/mm/pgtable_64.c +0
-0arch/powerpc/mm/pgtable_64.c void mmu_partition_table_set_entry(unsigned int lpid, unsigned long dw0, · line 478
Quoted 8 lines
arch/powerpc/mm/pgtable_64.c +2
-0@@ -471,6 +471,8 @@ void mmu_partition_table_set_entry(unsigned int lpid, unsigned long dw0,if (old &PATB_HR ) { asm volatile(PPC_TLBIE_5(%0,%1,2,0,1) : : "r" (TLBIEL_INVAL_SET_LPID), "r" (lpid)); + asm volatile(PPC_TLBIE_5(%0,%1,2,1,1) : : + "r" (TLBIEL_INVAL_SET_LPID), "r" (lpid));trace_tlbie (lpid,0 ,TLBIEL_INVAL_SET_LPID , lpid,2 ,0 ,1 ); }else { asm volatile(PPC_TLBIE_5(%0,%1,2,0,0) : :This patch fixes for me a VM migration crash on POWER9.
Same here.
Quoted 6 lines
Tested-by Laurent Vivier <[email protected]>Thanks,
Laurent
Quoted 48 lines · Daniel Henrique Barboza
Quoted 28 lines · Laurent Vivier
Quoted 27 lines · Alexey Kardashevskiy
Radix guests do normally invalidate process-scoped translations when a new pid is allocated but migrated guests do not invalidate these so migrated guests crash sometime, especially easy to reproduce with migration happening within first 10 seconds after the guest boot start on
the same machine.This adds the "Invalidate process-scoped translations" flush to fix radix guests migration.
Signed-off-by Alexey Kardashevskiy <[email protected]>---
Changes:
v2:
* removedPPC_TLBIE_5()from the !(old&PATH_HR) case as it is pointless on hash---
Not so sure that "process-scoped translations" only require flushing at pid allocation and migration.
---
arch/powerpc/mm/pgtable_64.c| 2 ++1 file changed, 2 insertions(+)Quoted 16 lines
Quoted 7 lines
arch/powerpc/mm/pgtable_64.c +0
-0@@ -471,6 +471,8 @@ void mmu_partition_table_set_entry(unsigned int lpid, unsigned long dw0, if (old & PATB_HR) {Quoted 8 lines
asm volatile(PPC_TLBIE_5(%0,%1,2,0,1) : :
"r" (TLBIEL_INVAL_SET_LPID), "r" (lpid)); + asm volatile(PPC_TLBIE_5(%0,%1,2,1,1) : :
+ "r" (TLBIEL_INVAL_SET_LPID), "r" (lpid));trace_tlbie(lpid, 0, TLBIEL_INVAL_SET_LPID, lpid, 2, 0, 1); } else {
asm volatile(PPC_TLBIE_5(%0,%1,2,0,0) : :This patch fixes for me a VM migration crash on POWER9.
Quoted 6 lines
Same here.
Quoted 2 lines
Tested-by Laurent Vivier <[email protected]>
Any hope to have this patch merged soon?
It fixes a real problem and migration of VM is not reliable without it.
Thanks,
Laurent
Michael Ellerman
reviewerQuoted 14 lines · Laurent Vivier
Quoted 13 lines · Daniel Henrique Barboza
Quoted 12 lines · Laurent Vivier
Quoted 11 lines · Alexey Kardashevskiy
Radix guests do normally invalidate process-scoped translations when a new pid is allocated but migrated guests do not invalidate these so migrated guests crash sometime, especially easy to reproduce with migration happening within first 10 seconds after the guest boot start on
the same machine.This adds the "Invalidate process-scoped translations" flush to fix radix guests migration.
Signed-off-by Alexey Kardashevskiy <[email protected]>
...
Quoted 6 lines
Quoted 2 lines
Quoted 2 lines
Tested-by Laurent Vivier <[email protected]>Any hope to have this patch merged soon?
It fixes a real problem and migration of VM is not reliable without it.
Sorry it got lost in the merge window / rc1 madness. It's in my fixes branch now and heading to Linus.
cheers
Michael Ellerman
AppliedQuoted 6 lines · Alexey Kardashevskiy
Radix guests do normally invalidate process-scoped translations when a new pid is allocated but migrated guests do not invalidate these so migrated guests crash sometime, especially easy to reproduce with migration happening within first 10 seconds after the guest boot start on the same machine.
Quoted 6 lines
This adds the "Invalidate process-scoped translations" flush to fix radix guests migration.
Signed-off-by Alexey Kardashevskiy <[email protected]>Tested-by Laurent Vivier <[email protected]>
Applied to powerpc fixes, thanks.
https://git.kernel.org/powerpc/c/62e984ddfd6b056d399e24113f5e6a
cheers