Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 26 Jun 2019 17:16:26 +0000 (UTC)
From:      Konstantin Belousov <kib@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r349427 - head/sys/amd64/amd64
Message-ID:  <201906261716.x5QHGQYB071841@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: kib
Date: Wed Jun 26 17:16:26 2019
New Revision: 349427
URL: https://svnweb.freebsd.org/changeset/base/349427

Log:
  amd64 pmap: Fix pkru handling in pmap_remove().
  
  When pmap_pkru_on_remove() is called, the sva argument value was
  advanced.  Clear PKRU earlier when sva still specifies the start of
  the region.
  
  Noted and reviewed by:	alc
  Sponsored by:	The FreeBSD Foundation
  MFC after:	3 days

Modified:
  head/sys/amd64/amd64/pmap.c

Modified: head/sys/amd64/amd64/pmap.c
==============================================================================
--- head/sys/amd64/amd64/pmap.c	Wed Jun 26 16:56:56 2019	(r349426)
+++ head/sys/amd64/amd64/pmap.c	Wed Jun 26 17:16:26 2019	(r349427)
@@ -4998,6 +4998,7 @@ pmap_remove(pmap_t pmap, vm_offset_t sva, vm_offset_t 
 
 	pmap_delayed_invl_start();
 	PMAP_LOCK(pmap);
+	pmap_pkru_on_remove(pmap, sva, eva);
 
 	/*
 	 * special handling of removing one page.  a very
@@ -5091,7 +5092,6 @@ pmap_remove(pmap_t pmap, vm_offset_t sva, vm_offset_t 
 out:
 	if (anyvalid)
 		pmap_invalidate_all(pmap);
-	pmap_pkru_on_remove(pmap, sva, eva);
 	PMAP_UNLOCK(pmap);
 	pmap_delayed_invl_finish();
 	vm_page_free_pages_toq(&free, true);



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