* [PATCH kernel v2] powerpc/mm: Flush radix process translations when setting MMU type
@ 2018-02-01 5:09 Alexey Kardashevskiy
2018-02-07 14:33 ` Laurent Vivier
2018-02-14 5:43 ` [kernel, " Michael Ellerman
0 siblings, 2 replies; 6+ messages in thread
From: Alexey Kardashevskiy @ 2018-02-01 5:09 UTC (permalink / raw)
To: linuxppc-dev
Cc: Alexey Kardashevskiy, Benjamin Herrenschmidt, Michael Ellerman,
Paul Mackerras
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 <aik@ozlabs.ru>
---
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(+)
diff --git a/arch/powerpc/mm/pgtable_64.c b/arch/powerpc/mm/pgtable_64.c
index c9a623c..d75dd52 100644
--- a/arch/powerpc/mm/pgtable_64.c
+++ b/arch/powerpc/mm/pgtable_64.c
@@ -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) : :
--
2.11.0
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH kernel v2] powerpc/mm: Flush radix process translations when setting MMU type
2018-02-01 5:09 [PATCH kernel v2] powerpc/mm: Flush radix process translations when setting MMU type Alexey Kardashevskiy
@ 2018-02-07 14:33 ` Laurent Vivier
2018-02-07 17:49 ` Daniel Henrique Barboza
2018-02-14 5:43 ` [kernel, " Michael Ellerman
1 sibling, 1 reply; 6+ messages in thread
From: Laurent Vivier @ 2018-02-07 14:33 UTC (permalink / raw)
To: Alexey Kardashevskiy, linuxppc-dev
On 01/02/2018 06:09, Alexey Kardashevskiy wrote:
> 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 <aik@ozlabs.ru>
> ---
> 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(+)
>
> diff --git a/arch/powerpc/mm/pgtable_64.c b/arch/powerpc/mm/pgtable_64.c
> index c9a623c..d75dd52 100644
> --- a/arch/powerpc/mm/pgtable_64.c
> +++ b/arch/powerpc/mm/pgtable_64.c
> @@ -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.
Tested-by: Laurent Vivier <lvivier@redhat.com>
Thanks,
Laurent
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH kernel v2] powerpc/mm: Flush radix process translations when setting MMU type
2018-02-07 14:33 ` Laurent Vivier
@ 2018-02-07 17:49 ` Daniel Henrique Barboza
2018-02-13 11:25 ` Laurent Vivier
0 siblings, 1 reply; 6+ messages in thread
From: Daniel Henrique Barboza @ 2018-02-07 17:49 UTC (permalink / raw)
To: Laurent Vivier, Alexey Kardashevskiy, linuxppc-dev
On 02/07/2018 12:33 PM, Laurent Vivier wrote:
> On 01/02/2018 06:09, Alexey Kardashevskiy wrote:
>> 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 <aik@ozlabs.ru>
>> ---
>> 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(+)
>>
>> diff --git a/arch/powerpc/mm/pgtable_64.c b/arch/powerpc/mm/pgtable_64.c
>> index c9a623c..d75dd52 100644
>> --- a/arch/powerpc/mm/pgtable_64.c
>> +++ b/arch/powerpc/mm/pgtable_64.c
>> @@ -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.
Tested-by: Daniel Henrique Barboza <danielhb@linux.vnet.ibm.com>
>
> Tested-by: Laurent Vivier <lvivier@redhat.com>
>
> Thanks,
> Laurent
>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH kernel v2] powerpc/mm: Flush radix process translations when setting MMU type
2018-02-07 17:49 ` Daniel Henrique Barboza
@ 2018-02-13 11:25 ` Laurent Vivier
2018-02-14 13:36 ` Michael Ellerman
0 siblings, 1 reply; 6+ messages in thread
From: Laurent Vivier @ 2018-02-13 11:25 UTC (permalink / raw)
To: Daniel Henrique Barboza, Alexey Kardashevskiy, linuxppc-dev
On 07/02/2018 18:49, Daniel Henrique Barboza wrote:
>
>
> On 02/07/2018 12:33 PM, Laurent Vivier wrote:
>> On 01/02/2018 06:09, Alexey Kardashevskiy wrote:
>>> 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 <aik@ozlabs.ru>
>>> ---
>>> 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(+)
>>>
>>> diff --git a/arch/powerpc/mm/pgtable_64.c b/arch/powerpc/mm/pgtable_64.c
>>> index c9a623c..d75dd52 100644
>>> --- a/arch/powerpc/mm/pgtable_64.c
>>> +++ b/arch/powerpc/mm/pgtable_64.c
>>> @@ -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.
>
> Tested-by: Daniel Henrique Barboza <danielhb@linux.vnet.ibm.com>
>
>>
>> Tested-by: Laurent Vivier <lvivier@redhat.com>
Any hope to have this patch merged soon?
It fixes a real problem and migration of VM is not reliable without it.
Thanks,
Laurent
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [kernel, v2] powerpc/mm: Flush radix process translations when setting MMU type
2018-02-01 5:09 [PATCH kernel v2] powerpc/mm: Flush radix process translations when setting MMU type Alexey Kardashevskiy
2018-02-07 14:33 ` Laurent Vivier
@ 2018-02-14 5:43 ` Michael Ellerman
1 sibling, 0 replies; 6+ messages in thread
From: Michael Ellerman @ 2018-02-14 5:43 UTC (permalink / raw)
To: Alexey Kardashevskiy, linuxppc-dev; +Cc: Alexey Kardashevskiy
On Thu, 2018-02-01 at 05:09:44 UTC, Alexey Kardashevskiy wrote:
> 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 <aik@ozlabs.ru>
> Tested-by: Laurent Vivier <lvivier@redhat.com>
> Tested-by: Daniel Henrique Barboza <danielhb@linux.vnet.ibm.com>
Applied to powerpc fixes, thanks.
https://git.kernel.org/powerpc/c/62e984ddfd6b056d399e24113f5e6a
cheers
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH kernel v2] powerpc/mm: Flush radix process translations when setting MMU type
2018-02-13 11:25 ` Laurent Vivier
@ 2018-02-14 13:36 ` Michael Ellerman
0 siblings, 0 replies; 6+ messages in thread
From: Michael Ellerman @ 2018-02-14 13:36 UTC (permalink / raw)
To: Laurent Vivier, Daniel Henrique Barboza, Alexey Kardashevskiy,
linuxppc-dev
Laurent Vivier <lvivier@redhat.com> writes:
> On 07/02/2018 18:49, Daniel Henrique Barboza wrote:
>> On 02/07/2018 12:33 PM, Laurent Vivier wrote:
>>> On 01/02/2018 06:09, Alexey Kardashevskiy wrote:
>>>> 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 <aik@ozlabs.ru>
...
>>>
>>> Tested-by: Laurent Vivier <lvivier@redhat.com>
>
> 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
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2018-02-14 13:36 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-02-01 5:09 [PATCH kernel v2] powerpc/mm: Flush radix process translations when setting MMU type Alexey Kardashevskiy
2018-02-07 14:33 ` Laurent Vivier
2018-02-07 17:49 ` Daniel Henrique Barboza
2018-02-13 11:25 ` Laurent Vivier
2018-02-14 13:36 ` Michael Ellerman
2018-02-14 5:43 ` [kernel, " Michael Ellerman
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).