From owner-svn-src-head@FreeBSD.ORG Mon Aug 19 15:12:37 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 71716533; Mon, 19 Aug 2013 15:12:37 +0000 (UTC) (envelope-from raj@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 5EB5D24C7; Mon, 19 Aug 2013 15:12:37 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7JFCbqK005938; Mon, 19 Aug 2013 15:12:37 GMT (envelope-from raj@svn.freebsd.org) Received: (from raj@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7JFCb32005933; Mon, 19 Aug 2013 15:12:37 GMT (envelope-from raj@svn.freebsd.org) Message-Id: <201308191512.r7JFCb32005933@svn.freebsd.org> From: Rafal Jaworowski Date: Mon, 19 Aug 2013 15:12:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r254532 - in head/sys/arm: arm include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Aug 2013 15:12:37 -0000 Author: raj Date: Mon Aug 19 15:12:36 2013 New Revision: 254532 URL: http://svnweb.freebsd.org/changeset/base/254532 Log: Clear all L2 PTE protection bits before their configuration. Revise L2_S_PROT_MASK to include all of the protection bits. Notice that clearing these bits does not always take away the corresponding permissions (for example, permission is granted when the bit is cleared). The bits are cleared but are to be set or left cleared accordingly in pmap_set_prot(), pmap_enter_locked(), etc. Clear L2_XN along with L2_S_PROT_MASK in pmap_set_prot() so that all permissions related bits are cleared before actual configuration. Submitted by: Zbigniew Bodek Reviewed by: gber Sponsored by: The FreeBSD Foundation, Semihalf Modified: head/sys/arm/arm/pmap-v6.c head/sys/arm/include/pmap.h Modified: head/sys/arm/arm/pmap-v6.c ============================================================================== --- head/sys/arm/arm/pmap-v6.c Mon Aug 19 14:56:17 2013 (r254531) +++ head/sys/arm/arm/pmap-v6.c Mon Aug 19 15:12:36 2013 (r254532) @@ -1046,7 +1046,7 @@ static void pmap_set_prot(pt_entry_t *ptep, vm_prot_t prot, uint8_t user) { - *ptep &= ~L2_S_PROT_MASK; + *ptep &= ~(L2_S_PROT_MASK | L2_XN); if (!(prot & VM_PROT_EXECUTE)) *ptep |= L2_XN; Modified: head/sys/arm/include/pmap.h ============================================================================== --- head/sys/arm/include/pmap.h Mon Aug 19 14:56:17 2013 (r254531) +++ head/sys/arm/include/pmap.h Mon Aug 19 15:12:36 2013 (r254532) @@ -390,7 +390,7 @@ extern int pmap_needs_pte_sync; #define L2_S_PROT_U (L2_AP0(2)) /* user read */ #define L2_S_REF (L2_AP0(1)) /* reference flag */ -#define L2_S_PROT_MASK (L2_S_PROT_U|L2_S_PROT_R) +#define L2_S_PROT_MASK (L2_S_PROT_U|L2_S_PROT_R|L2_APX) #define L2_S_EXECUTABLE(pte) (!(pte & L2_XN)) #define L2_S_WRITABLE(pte) (!(pte & L2_APX)) #define L2_S_REFERENCED(pte) (!!(pte & L2_S_REF))