From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gate.crashing.org (gate.crashing.org [63.228.1.57]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id CDDA82C01D4 for ; Sun, 9 Jun 2013 17:46:02 +1000 (EST) Message-ID: <1370763946.14883.24.camel@pasglop> Subject: Re: [PATCH v2 2/2] powerpc/hibernate: PPC64 fix user threads access to kernel space From: Benjamin Herrenschmidt To: Wang Dongsheng-B40534 Date: Sun, 09 Jun 2013 17:45:46 +1000 In-Reply-To: References: <1370755352-29901-1-git-send-email-dongsheng.wang@freescale.com> <1370760236.3766.481.camel@pasglop> Content-Type: text/plain; charset="UTF-8" Mime-Version: 1.0 Cc: Wood Scott-B07421 , "johannes@sipsolutions.net" , "anton@enomsg.org" , "linuxppc-dev@lists.ozlabs.org" List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , On Sun, 2013-06-09 at 07:44 +0000, 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 boot kernel has left "something" there (though I wouldn't expect it to have run userspace it's not completely impossible). Cheers, Ben.