git: 4551cbbe9906 - main - amd64: Ignore 1GB mappings in pmap_advise()

From: Mark Johnston <markj_at_FreeBSD.org>
Date: Sat, 24 Sep 2022 13:38:18 UTC
The branch main has been updated by markj:

URL: https://cgit.FreeBSD.org/src/commit/?id=4551cbbe9906812556501c541fef0d88b0398b27

commit 4551cbbe9906812556501c541fef0d88b0398b27
Author:     Mark Johnston <markj@FreeBSD.org>
AuthorDate: 2022-09-24 13:20:48 +0000
Commit:     Mark Johnston <markj@FreeBSD.org>
CommitDate: 2022-09-24 13:28:41 +0000

    amd64: Ignore 1GB mappings in pmap_advise()
    
    This assertion can be triggered by usermode since vm_map_madvise()
    doesn't force advice to be applied to an entire largepage mapping.  I
    can't see any reason not to permit it, however, since MADV_DONTNEED and
    _FREE are advisory and we can simply do nothing when a 1GB mapping is
    encountered.
    
    Reviewed by:    alc, kib
    MFC after:      1 week
    Differential Revision:  https://reviews.freebsd.org/D36675
---
 sys/amd64/amd64/pmap.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/sys/amd64/amd64/pmap.c b/sys/amd64/amd64/pmap.c
index 358d016676d2..f4df664f0cca 100644
--- a/sys/amd64/amd64/pmap.c
+++ b/sys/amd64/amd64/pmap.c
@@ -9013,13 +9013,8 @@ pmap_advise(pmap_t pmap, vm_offset_t sva, vm_offset_t eva, int advice)
 		pdpe = pmap_pml4e_to_pdpe(pml4e, sva);
 		if ((*pdpe & PG_V) == 0)
 			continue;
-		if ((*pdpe & PG_PS) != 0) {
-			KASSERT(va_next <= eva,
-			    ("partial update of non-transparent 1G mapping "
-			    "pdpe %#lx sva %#lx eva %#lx va_next %#lx",
-			    *pdpe, sva, eva, va_next));
+		if ((*pdpe & PG_PS) != 0)
 			continue;
-		}
 
 		va_next = (sva + NBPDR) & ~PDRMASK;
 		if (va_next < sva)