From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S970189AbdDTLZg (ORCPT ); Thu, 20 Apr 2017 07:25:36 -0400 Received: from ozlabs.org ([103.22.144.67]:59905 "EHLO ozlabs.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S967395AbdDTLZe (ORCPT ); Thu, 20 Apr 2017 07:25:34 -0400 From: Michael Ellerman To: David Laight , "'Christophe Leroy'" , Benjamin Herrenschmidt , Paul Mackerras , Scott Wood Cc: "linuxppc-dev\@lists.ozlabs.org" , "linux-kernel\@vger.kernel.org" Subject: RE: [PATCH] powerpc/32: Move entry_32 functions just after HEAD functions. In-Reply-To: <063D6719AE5E284EB5DD2968C1650D6DCFFD56A5@AcuExch.aculab.com> References: <20170418070126.A18EF67952@localhost.localdomain> <063D6719AE5E284EB5DD2968C1650D6DCFFD56A5@AcuExch.aculab.com> User-Agent: Notmuch/0.21 (https://notmuchmail.org) Date: Thu, 20 Apr 2017 21:25:32 +1000 Message-ID: <878tmv48yb.fsf@concordia.ellerman.id.au> MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org David Laight writes: > From: Christophe Leroy >> By default, PPC8xx PINs an ITLB on the first 8M of memory in order >> to avoid any ITLB miss on kernel code. >> However, with some debug functions like DEBUG_PAGEALLOC and >> (soon to come) DEBUG_RODATA, the PINned TLB is invalidated soon >> after startup so ITLB missed start to happen also on the kernel code. >> >> In order to avoid any ITLB miss in a critical section, we have to >> ensure that their is no page boundary crossed between the setup of >> a new value in SRR0/SRR1 and the associated RFI. This cannot be done >> easily if entry_32 functions sits in the middle of other .text >> functions. By placing entry_32 just after the .head section (as already >> done for entry_64 on PPC64), we can more easily ensure the issue >> doesn't happen. > > Shouldn't this be done by putting all the functions that 'matter' > into a named section instead of relying on the order of the input files? > (Which is what I think this is doing.) Yeah that is fragile if there's nothing more to it. I'm not sure if we need a special section. If the functions that must not cross a page boundary are aligned to a page boundary (with .align) then that would also work wouldn't it? cheers