git: 728d9f322935 - main - arm64/pmap: Fix invalidate_icache condition in stage2 fault

From: Andrew Turner <andrew_at_FreeBSD.org>
Date: Wed, 09 Sep 2026 14:23:11 UTC
The branch main has been updated by andrew:

URL: https://cgit.FreeBSD.org/src/commit/?id=728d9f322935905c09236e8312b3268b6ff8691b

commit 728d9f322935905c09236e8312b3268b6ff8691b
Author:     Kajetan Puchalski <kajetan.puchalski@arm.com>
AuthorDate: 2026-09-08 11:21:52 +0000
Commit:     Andrew Turner <andrew@FreeBSD.org>
CommitDate: 2026-09-08 03:05:28 +0000

    arm64/pmap: Fix invalidate_icache condition in stage2 fault
    
    pmap_stage2_fault is supposed to invalidate the icache if it is
    accessing an executable page. Instead, the condition currently checks
    whether execution is disallowed at any EL. Make it check whether
    execution is allowed at any EL to match the intended behaviour.
    
    Signed-off-by: Kajetan Puchalski <kajetan.puchalski@arm.com>
    Reviewed by:    andrew
    Sponsored by:   Arm Ltd
    Pull Request:   https://github.com/freebsd/freebsd-src/pull/2416
---
 sys/arm64/arm64/pmap.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sys/arm64/arm64/pmap.c b/sys/arm64/arm64/pmap.c
index f9b3217c9678..38beb5270f50 100644
--- a/sys/arm64/arm64/pmap.c
+++ b/sys/arm64/arm64/pmap.c
@@ -9761,7 +9761,7 @@ fault_exec:
 			 * of Coherency.
 			 */
 			if ((pte & ATTR_S2_XN_MASK) !=
-			    ATTR_S2_XN(ATTR_S2_XN_NONE)) {
+			    ATTR_S2_XN(ATTR_S2_XN_ALL)) {
 				invalidate_icache();
 			}
 			pmap_set_bits(ptep, ATTR_AF | ATTR_DESCR_VALID);