From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752708AbbCUArV (ORCPT ); Fri, 20 Mar 2015 20:47:21 -0400 Received: from mail-by2on0131.outbound.protection.outlook.com ([207.46.100.131]:13312 "EHLO na01-by2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752501AbbCUArU (ORCPT ); Fri, 20 Mar 2015 20:47:20 -0400 Message-ID: <1426898829.27998.256.camel@freescale.com> Subject: Re: [PATCH v2 11/11] powerpc/8xx: Add support for TASK_SIZE greater than 0x80000000 From: Scott Wood To: Christophe Leroy CC: Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman , , , "Joakim Tjernlund" Date: Fri, 20 Mar 2015 19:47:09 -0500 In-Reply-To: <20150120095736.518681A5E86@localhost.localdomain> References: <20150120095736.518681A5E86@localhost.localdomain> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.12.10-0ubuntu1~14.10.1 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Originating-IP: [2601:2:5800:3f7:12bf:48ff:fe84:c9a0] X-ClientProxiedBy: BY2PR04CA0005.namprd04.prod.outlook.com (10.255.247.15) To BLUPR03MB1475.namprd03.prod.outlook.com (25.163.81.17) Authentication-Results: c-s.fr; dkim=none (message not signed) header.d=none; X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BLUPR03MB1475;UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BLUPR03MB262; X-Microsoft-Antispam-PRVS: X-Forefront-Antispam-Report: BMV:1;SFV:NSPM;SFS:(10019020)(6009001)(377424004)(51704005)(24454002)(62966003)(77156002)(87976001)(36756003)(86362001)(50466002)(110136001)(50986999)(33646002)(23676002)(76176999)(50226001)(42186005)(2950100001)(122386002)(103116003)(92566002)(46102003)(5820100001)(47776003)(19580405001);DIR:OUT;SFP:1102;SCL:1;SRVR:BLUPR03MB1475;H:[IPv6:2601:2:5800:3f7:12bf:48ff:fe84:c9a0];FPR:;SPF:None;MLV:sfv;LANG:en; X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(601004)(5005006)(5002010);SRVR:BLUPR03MB1475;BCL:0;PCL:0;RULEID:;SRVR:BLUPR03MB1475; X-Forefront-PRVS: 05220145DE X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Mar 2015 00:47:15.5314 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BLUPR03MB1475 X-OriginatorOrg: freescale.com Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 2015-01-20 at 10:57 +0100, Christophe Leroy wrote: > By default, TASK_SIZE is set to 0x80000000 for PPC_8xx, which is most likely > sufficient for most cases. However, kernel configuration allows to set TASK_SIZE > to another value, so the 8xx shall handle it. > > Signed-off-by: Christophe Leroy > > --- > v2: no change > > arch/powerpc/kernel/head_8xx.S | 25 +++++++++++++++++++------ > 1 file changed, 19 insertions(+), 6 deletions(-) > > diff --git a/arch/powerpc/kernel/head_8xx.S b/arch/powerpc/kernel/head_8xx.S > index ead6448..92a6456 100644 > --- a/arch/powerpc/kernel/head_8xx.S > +++ b/arch/powerpc/kernel/head_8xx.S > @@ -48,6 +48,19 @@ > mtspr spr, reg > #endif > > +/* Macro to test if an address is a kernel address */ > +#if CONFIG_TASK_SIZE <= 0x80000000 > +#define IS_KERNEL(tmp, addr) \ > + andis. tmp, addr, 0x8000 /* Address >= 0x80000000 */ > +#define BRANCH_UNLESS_KERNEL(label) beq label > +#else This works if CONFIG_TASK_SIZE == 0x80000000, but what if it's less, and you have a kernel address < 0x80000000? -Scott