From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752022AbbDGIQD (ORCPT ); Tue, 7 Apr 2015 04:16:03 -0400 Received: from pegase1.c-s.fr ([93.17.236.30]:53013 "EHLO mailhub1.si.c-s.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751028AbbDGIQB (ORCPT ); Tue, 7 Apr 2015 04:16:01 -0400 Message-ID: <5523923F.2050502@c-s.fr> Date: Tue, 07 Apr 2015 10:15:59 +0200 From: leroy christophe User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:31.0) Gecko/20100101 Thunderbird/31.5.0 MIME-Version: 1.0 To: Scott Wood CC: Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman , linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, Joakim Tjernlund Subject: Re: [PATCH v2 11/11] powerpc/8xx: Add support for TASK_SIZE greater than 0x80000000 References: <20150120095736.518681A5E86@localhost.localdomain> <1426898829.27998.256.camel@freescale.com> In-Reply-To: <1426898829.27998.256.camel@freescale.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Le 21/03/2015 01:47, Scott Wood a écrit : > 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? > > You are right, I didn't realise that PAGE_OFFSET was also configurable and could be different from 0xC0000000. andis. (which is what is always used in the current kernel) can be used if CONFIG_TASK_SIZE <= 0x80000000 AND PAGE_OFFSET >= 0x80000000. I will resubmit the patch accordingly. Christophe From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mailhub1.si.c-s.fr (pegase1.c-s.fr [93.17.236.30]) by lists.ozlabs.org (Postfix) with ESMTP id 6C0B81A0406 for ; Tue, 7 Apr 2015 18:16:01 +1000 (AEST) Message-ID: <5523923F.2050502@c-s.fr> Date: Tue, 07 Apr 2015 10:15:59 +0200 From: leroy christophe MIME-Version: 1.0 To: Scott Wood Subject: Re: [PATCH v2 11/11] powerpc/8xx: Add support for TASK_SIZE greater than 0x80000000 References: <20150120095736.518681A5E86@localhost.localdomain> <1426898829.27998.256.camel@freescale.com> In-Reply-To: <1426898829.27998.256.camel@freescale.com> Content-Type: text/plain; charset=utf-8; format=flowed Cc: linux-kernel@vger.kernel.org, Paul Mackerras , linuxppc-dev@lists.ozlabs.org List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Le 21/03/2015 01:47, Scott Wood a écrit : > 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? > > You are right, I didn't realise that PAGE_OFFSET was also configurable and could be different from 0xC0000000. andis. (which is what is always used in the current kernel) can be used if CONFIG_TASK_SIZE <= 0x80000000 AND PAGE_OFFSET >= 0x80000000. I will resubmit the patch accordingly. Christophe