[PATCH][Zesty] UBUNTU: SAUCE: powerpc: Only do ERAT invalidate

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[PATCH][Zesty] UBUNTU: SAUCE: powerpc: Only do ERAT invalidate

Breno Leitao
From: Michael Neuling <[hidden email]>

BugLink: https://bugs.launchpad.net/ubuntu/+bug/1700819

On P9 (Nimbus) DD2 and later, in radix mode, the move to the PID
register will implicitly invalidate the user space ERAT entries
and leave the kernel ones alone. Thus the only thing needed is
an isync() to synchronize this with subsequent uaccess's

Signed-off-by: Michael Neuling <[hidden email]>
Signed-off-by: Benjamin Herrenschmidt <[hidden email]>
Signed-off-by: Breno Leitao <[hidden email]>
---
 arch/powerpc/mm/mmu_context_book3s64.c | 15 ++++++++++-----
 1 file changed, 10 insertions(+), 5 deletions(-)

diff --git a/arch/powerpc/mm/mmu_context_book3s64.c b/arch/powerpc/mm/mmu_context_book3s64.c
index f6976b783b89..371b20f9de95 100644
--- a/arch/powerpc/mm/mmu_context_book3s64.c
+++ b/arch/powerpc/mm/mmu_context_book3s64.c
@@ -182,10 +182,15 @@ void destroy_context(struct mm_struct *mm)
 #ifdef CONFIG_PPC_RADIX_MMU
 void radix__switch_mmu_context(struct mm_struct *prev, struct mm_struct *next)
 {
- asm volatile("isync": : :"memory");
- mtspr(SPRN_PID, next->context.id);
- asm volatile("isync \n"
-     PPC_SLBIA(0x7)
-     : : :"memory");
+
+ if (cpu_has_feature(CPU_FTR_POWER9_DD1)) {
+ isync();
+ mtspr(SPRN_PID, next->context.id);
+ isync();
+ asm volatile(PPC_INVALIDATE_ERAT : : :"memory");
+ } else {
+ mtspr(SPRN_PID, next->context.id);
+ isync();
+ }
 }
 #endif
--
2.11.0


--
kernel-team mailing list
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/kernel-team
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

ACK/cmt / APPLIED[artful]: [PATCH][Zesty] UBUNTU: SAUCE: powerpc: Only do ERAT invalidate

Seth Forshee
On Tue, Jun 27, 2017 at 04:09:24PM -0300, Breno Leitao wrote:

> From: Michael Neuling <[hidden email]>
>
> BugLink: https://bugs.launchpad.net/ubuntu/+bug/1700819
>
> On P9 (Nimbus) DD2 and later, in radix mode, the move to the PID
> register will implicitly invalidate the user space ERAT entries
> and leave the kernel ones alone. Thus the only thing needed is
> an isync() to synchronize this with subsequent uaccess's
>
> Signed-off-by: Michael Neuling <[hidden email]>
> Signed-off-by: Benjamin Herrenschmidt <[hidden email]>
> Signed-off-by: Breno Leitao <[hidden email]>

Note to whoever applies this, this is now commit
74e27c6af56fe6898c3c8c451595746a992f0f0f in linux-next, so it can be
applied as a cherry-pick and not a sauce patch.

Acked-by: Seth Forshee <[hidden email]>

Also cherry picked from linux-next to artful/master-next and
unstable/master. Thanks!


--
kernel-team mailing list
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/kernel-team
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

ACK/cmt: [PATCH][Zesty] UBUNTU: SAUCE: powerpc: Only do ERAT invalidate

Stefan Bader-2
On 29.06.2017 23:07, Seth Forshee wrote:

> On Tue, Jun 27, 2017 at 04:09:24PM -0300, Breno Leitao wrote:
>> From: Michael Neuling <[hidden email]>
>>
>> BugLink: https://bugs.launchpad.net/ubuntu/+bug/1700819
>>
>> On P9 (Nimbus) DD2 and later, in radix mode, the move to the PID
>> register will implicitly invalidate the user space ERAT entries
>> and leave the kernel ones alone. Thus the only thing needed is
>> an isync() to synchronize this with subsequent uaccess's
>>
>> Signed-off-by: Michael Neuling <[hidden email]>
>> Signed-off-by: Benjamin Herrenschmidt <[hidden email]>
>> Signed-off-by: Breno Leitao <[hidden email]>
>
> Note to whoever applies this, this is now commit
> 74e27c6af56fe6898c3c8c451595746a992f0f0f in linux-next, so it can be
> applied as a cherry-pick and not a sauce patch.
>
> Acked-by: Seth Forshee <[hidden email]>
Also ACK from me but with the additional note that this now is upstream (same
SHA1) and different (was the same on next) commit msg: "powerpc: Only do ERAT
invalidate on radix context switch on P9 DD1"

-Stefan

>
> Also cherry picked from linux-next to artful/master-next and
> unstable/master. Thanks!
>
>



--
kernel-team mailing list
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/kernel-team

signature.asc (836 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

APPLIED: [PATCH][Zesty] UBUNTU: SAUCE: powerpc: Only do ERAT invalidate

Thadeu Lima de Souza Cascardo-3
In reply to this post by Breno Leitao
Applied to zesty master-next branch, as a cherry-pick of the upstream
commit.

Thanks.
Cascardo.

--
kernel-team mailing list
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/kernel-team
Loading...