RE: [PATCH v2 2/2] powerpc/hibernate: PPC64 fix user threads access to kernel space

2013-06-09 Thread Wang Dongsheng-B40534
msg.org > Cc: Wood Scott-B07421; ga...@kernel.crashing.org; linuxppc- > d...@lists.ozlabs.org; Wang Dongsheng-B40534 > Subject: [PATCH v2 2/2] powerpc/hibernate: PPC64 fix user threads access > to kernel space > > If PID is used in the TLB, after hibernation resume, the user > th

RE: [PATCH v2 2/2] powerpc/hibernate: PPC64 fix user threads access to kernel space

2013-06-09 Thread Wang Dongsheng-B40534
v@lists.ozlabs.org > Subject: Re: [PATCH v2 2/2] powerpc/hibernate: PPC64 fix user threads > access to kernel space > > On Sun, 2013-06-09 at 07:44 +, Wang Dongsheng-B40534 wrote: > > So we just need set set_context() in restore_mmu_context(). > > > >

Re: [PATCH v2 2/2] powerpc/hibernate: PPC64 fix user threads access to kernel space

2013-06-09 Thread Benjamin Herrenschmidt
On Sun, 2013-06-09 at 07:44 +, Wang Dongsheng-B40534 wrote: > So we just need set set_context() in restore_mmu_context(). > > void restore_mmu_context(struct mm_struct *next) { > set_context(next->context.id, next->pgd); > } We probably also want to flush the TLB, just in case the boo

RE: [PATCH v2 2/2] powerpc/hibernate: PPC64 fix user threads access to kernel space

2013-06-09 Thread Wang Dongsheng-B40534
v@lists.ozlabs.org > Subject: Re: [PATCH v2 2/2] powerpc/hibernate: PPC64 fix user threads > access to kernel space > > On Sun, 2013-06-09 at 13:22 +0800, Wang Dongsheng wrote: > > If PID is used in the TLB, after hibernation resume, the user threads > > will access to ke

Re: [PATCH v2 2/2] powerpc/hibernate: PPC64 fix user threads access to kernel space

2013-06-08 Thread Benjamin Herrenschmidt
On Sun, 2013-06-09 at 13:22 +0800, Wang Dongsheng wrote: > If PID is used in the TLB, after hibernation resume, the user > threads will access to kernel space. .../... I think the explanation is way more convoluted and confusing here than anything else. Simply say that upon resume from hibernat

[PATCH v2 2/2] powerpc/hibernate: PPC64 fix user threads access to kernel space

2013-06-08 Thread Wang Dongsheng
If PID is used in the TLB, after hibernation resume, the user threads will access to kernel space. We must restore PID register, because TLB will use PID. The hibernation suspend flow is trapped from user space to kernel space, the PID register is user thread pid. The hibernation resume is begin