Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 15 Nov 2022 12:38:06 GMT
From:      Andrew Turner <andrew@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   git: 0b976be033c2 - main - Disable superpage use for stage 2 arm64 mappings
Message-ID:  <202211151238.2AFCc6Ds087545@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by andrew:

URL: https://cgit.FreeBSD.org/src/commit/?id=0b976be033c2d7ad774da341e66aa69bfdb7f0ce

commit 0b976be033c2d7ad774da341e66aa69bfdb7f0ce
Author:     Andrew Turner <andrew@FreeBSD.org>
AuthorDate: 2022-11-07 11:21:42 +0000
Commit:     Andrew Turner <andrew@FreeBSD.org>
CommitDate: 2022-11-15 12:33:39 +0000

    Disable superpage use for stage 2 arm64 mappings
    
    When modifying a stage 2 mapping we may need to call into the
    hypervisor to invalidate the TLB. Until it is known if the cost of
    this operation is less than the performance gains superpages offers
    disable their use.
    
    Reviewed by:    kib. markj
    Sponsored by:   Innovate UK
    Sponsored by:   The FreeBSD Foundation
    Differential Revision: https://reviews.freebsd.org/D37299
---
 sys/arm64/arm64/pmap.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/sys/arm64/arm64/pmap.c b/sys/arm64/arm64/pmap.c
index 8a73fb1c5180..1fefcb491e06 100644
--- a/sys/arm64/arm64/pmap.c
+++ b/sys/arm64/arm64/pmap.c
@@ -685,8 +685,15 @@ pmap_pte_exists(pmap_t pmap, vm_offset_t va, int level, const char *diag)
 }
 
 bool
-pmap_ps_enabled(pmap_t pmap __unused)
+pmap_ps_enabled(pmap_t pmap)
 {
+	/*
+	 * Promotion requires a hypervisor call when the kernel is running
+	 * in EL1. To stop this disable superpage support on non-stage 1
+	 * pmaps for now.
+	 */
+	if (pmap->pm_stage != PM_STAGE1)
+		return (false);
 
 	return (superpages_enabled != 0);
 }



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