Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 20 Sep 2014 14:24:48 +0000 (UTC)
From:      Konstantin Belousov <kib@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org
Subject:   svn commit: r271905 - in stable/10/sys: amd64/amd64 i386/i386
Message-ID:  <201409201424.s8KEOmXZ028021@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: kib
Date: Sat Sep 20 14:24:48 2014
New Revision: 271905
URL: http://svnweb.freebsd.org/changeset/base/271905

Log:
  MFC r271716:
  Presence of any VM_PROT bits in the permission argument on x86 implies
  that the entry is readable and valid.
  
  Approved by:	re (gjb)

Modified:
  stable/10/sys/amd64/amd64/pmap.c
  stable/10/sys/i386/i386/pmap.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/amd64/amd64/pmap.c
==============================================================================
--- stable/10/sys/amd64/amd64/pmap.c	Sat Sep 20 13:48:52 2014	(r271904)
+++ stable/10/sys/amd64/amd64/pmap.c	Sat Sep 20 14:24:48 2014	(r271905)
@@ -3845,7 +3845,8 @@ pmap_protect(pmap_t pmap, vm_offset_t sv
 	pt_entry_t *pte, PG_G, PG_M, PG_RW, PG_V;
 	boolean_t anychanged, pv_lists_locked;
 
-	if ((prot & VM_PROT_READ) == VM_PROT_NONE) {
+	KASSERT((prot & ~VM_PROT_ALL) == 0, ("invalid prot %x", prot));
+	if (prot == VM_PROT_NONE) {
 		pmap_remove(pmap, sva, eva);
 		return;
 	}

Modified: stable/10/sys/i386/i386/pmap.c
==============================================================================
--- stable/10/sys/i386/i386/pmap.c	Sat Sep 20 13:48:52 2014	(r271904)
+++ stable/10/sys/i386/i386/pmap.c	Sat Sep 20 14:24:48 2014	(r271905)
@@ -3161,7 +3161,8 @@ pmap_protect(pmap_t pmap, vm_offset_t sv
 	pt_entry_t *pte;
 	boolean_t anychanged, pv_lists_locked;
 
-	if ((prot & VM_PROT_READ) == VM_PROT_NONE) {
+	KASSERT((prot & ~VM_PROT_ALL) == 0, ("invalid prot %x", prot));
+	if (prot == VM_PROT_NONE) {
 		pmap_remove(pmap, sva, eva);
 		return;
 	}



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201409201424.s8KEOmXZ028021>