Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755107AbbDWBql (ORCPT ); Wed, 22 Apr 2015 21:46:41 -0400 Received: from mail-bl2on0108.outbound.protection.outlook.com ([65.55.169.108]:53609 "EHLO na01-bl2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753963AbbDWBqk (ORCPT ); Wed, 22 Apr 2015 21:46:40 -0400 Authentication-Results: c-s.fr; dkim=none (message not signed) header.d=none; Message-ID: <1429753587.16357.9.camel@freescale.com> Subject: Re: [PATCH 3/3] powerpc/8xx: Implementation of PAGE_EXEC From: Scott Wood To: Christophe Leroy CC: Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman , , , "Joakim Tjernlund" Date: Wed, 22 Apr 2015 20:46:27 -0500 In-Reply-To: <77ae326f3637ae008e33875b7be792d64b24461f.1429696335.git.christophe.leroy@c-s.fr> References: <77ae326f3637ae008e33875b7be792d64b24461f.1429696335.git.christophe.leroy@c-s.fr> 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: DM2PR10CA0043.namprd10.prod.outlook.com (10.141.241.11) To BLUPR03MB1473.namprd03.prod.outlook.com (25.163.81.158) X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BLUPR03MB1473;UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BLUPR03MB423; X-Microsoft-Antispam-PRVS: X-Forefront-Antispam-Report: BMV:1;SFV:NSPM;SFS:(10019020)(6009001)(377424004)(51704005)(24454002)(103116003)(110136001)(50986999)(33646002)(76176999)(46102003)(50466002)(2950100001)(47776003)(86362001)(42186005)(23676002)(62966003)(77156002)(50226001)(122386002)(5820100001)(40100003)(36756003)(92566002)(87976001)(3826002);DIR:OUT;SFP:1102;SCL:1;SRVR:BLUPR03MB1473;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:BLUPR03MB1473;BCL:0;PCL:0;RULEID:;SRVR:BLUPR03MB1473; X-Forefront-PRVS: 0555EC8317 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Apr 2015 01:46:36.0510 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BLUPR03MB1473 X-OriginatorOrg: freescale.com Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2334 Lines: 52 On Wed, 2015-04-22 at 12:06 +0200, Christophe Leroy wrote: > diff --git a/arch/powerpc/include/asm/mmu-8xx.h b/arch/powerpc/include/asm/mmu-8xx.h > index d41200c..1407034 100644 > --- a/arch/powerpc/include/asm/mmu-8xx.h > +++ b/arch/powerpc/include/asm/mmu-8xx.h > @@ -27,6 +27,19 @@ > #define MI_Ks 0x80000000 /* Should not be set */ > #define MI_Kp 0x40000000 /* Should always be set */ > > +/* > + * All pages PP exec bits are set to 000, which means Execute for Supervisor > + * and no Execute for User. > + * Then we use the APG to say whether accesses are according to Page rules, > + * "all Supervisor" rules (Exec for all) and "all User" rules (Exec for noone) > + * Therefore, we define 4 APG groups. msb is _PAGE_EXEC, lsb is _PAGE_USER > + * 0 (00) => Not User, no exec => 11 (all accesses performed as user) > + * 1 (01) => User but no exec => 11 (all accesses performed as user) > + * 2 (10) => Not User, exec => 01 (rights according to page definition) > + * 3 (11) => User, exec => 00 (all accesses performed as supervisor) > + */ > +#define MI_APG_INIT 0xf4ffffff > + > /* The effective page number register. When read, contains the information > * about the last instruction TLB miss. When MI_RPN is written, bits in > * this register are used to create the TLB entry. > @@ -87,6 +100,19 @@ > #define MD_Ks 0x80000000 /* Should not be set */ > #define MD_Kp 0x40000000 /* Should always be set */ > > +/* > + * All pages PP exec bits are set to either 000 or 011, which means respectively > + * RW for Supervisor and no access for User, or RO for Supervisor and no access > + * for user. > + * Then we use the APG to say whether accesses are according to Page rules or > + * "all Supervisor" rules (Access to all) > + * Therefore, we define 2 APG groups. lsb is _PAGE_USER > + * 0 => No user => 01 (all accesses performed according to page definition) > + * 1 => User => 00 (all accesses performed as supervisor > + * according to page definition) > + */ > +#define MD_APG_INIT 0x4fffffff "exec" bits or data? -Scott -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/