Module Name:    src
Committed By:   riastradh
Date:           Tue Apr  2 22:37:34 UTC 2024

Modified Files:
        src/share/mk: bsd.own.mk
        src/sys/arch/aarch64/include: sljit_machdep.h
        src/sys/modules: Makefile

Log Message:
bsd.own.mk: Enable MKLSJIT on aarch64.

Make sure there's only one copy of the conditional, in bsd.own.mk;
just make sys/modules/Makefile conditional on MKSLJIT so we don't
have to keep these in sync.

As a workaround for PR 58106, tweak the conditional definition of
SLJIT_CACHE_FLUSH to use cpu_icache_sync_range only in _HARDKERNEL,
and use __builtin___clear_cache in userland and in rump kernels.

PR 58103: bpfjit.kmod is not built on aarch64


To generate a diff of this commit:
cvs rdiff -u -r1.1364 -r1.1365 src/share/mk/bsd.own.mk
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/aarch64/include/sljit_machdep.h
cvs rdiff -u -r1.284 -r1.285 src/sys/modules/Makefile

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/share/mk/bsd.own.mk
diff -u src/share/mk/bsd.own.mk:1.1364 src/share/mk/bsd.own.mk:1.1365
--- src/share/mk/bsd.own.mk:1.1364	Mon Apr  1 22:23:14 2024
+++ src/share/mk/bsd.own.mk	Tue Apr  2 22:37:34 2024
@@ -1,4 +1,4 @@
-#	$NetBSD: bsd.own.mk,v 1.1364 2024/04/01 22:23:14 christos Exp $
+#	$NetBSD: bsd.own.mk,v 1.1365 2024/04/02 22:37:34 riastradh Exp $
 
 # This needs to be before bsd.init.mk
 .if defined(BSD_MK_COMPAT_FILE)
@@ -1391,9 +1391,10 @@ _MKVARS.no= \
 ${var}?=	${${var}.${MACHINE_ARCH}:U${${var}.${MACHINE}:Uno}}
 .endfor
 
-.if ${MACHINE_ARCH} == "i386" || \
-    ${MACHINE_ARCH} == "x86_64" || \
-    ${MACHINE_ARCH} == "sparc"
+.if ${MACHINE_ARCH} == "aarch64" || \
+    ${MACHINE_ARCH} == "i386"    || \
+    ${MACHINE_ARCH} == "sparc"   || \
+    ${MACHINE_ARCH} == "x86_64"
 MKSLJIT=	yes
 .endif
 

Index: src/sys/arch/aarch64/include/sljit_machdep.h
diff -u src/sys/arch/aarch64/include/sljit_machdep.h:1.3 src/sys/arch/aarch64/include/sljit_machdep.h:1.4
--- src/sys/arch/aarch64/include/sljit_machdep.h:1.3	Fri Dec 11 18:03:33 2020
+++ src/sys/arch/aarch64/include/sljit_machdep.h	Tue Apr  2 22:37:34 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: sljit_machdep.h,v 1.3 2020/12/11 18:03:33 skrll Exp $	*/
+/*	$NetBSD: sljit_machdep.h,v 1.4 2024/04/02 22:37:34 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 2014 Alexander Nasonov.
@@ -43,7 +43,12 @@
 
 #define SLJIT_CONFIG_ARM_64 1
 
-#ifdef _KERNEL
+#ifdef _HARDKERNEL
+/*
+ * XXX Currently sys/rump/include/machine/cpu.h doesn't have
+ * ci_cpufuncs for cpu_icache_sync_range, so we do this only for
+ * non-rump kernels for now.
+ */
 #define SLJIT_CACHE_FLUSH(from, to) \
 	cpu_icache_sync_range((vaddr_t)(from), (vsize_t)((to) - (from)))
 #else

Index: src/sys/modules/Makefile
diff -u src/sys/modules/Makefile:1.284 src/sys/modules/Makefile:1.285
--- src/sys/modules/Makefile:1.284	Thu Mar 21 02:36:02 2024
+++ src/sys/modules/Makefile	Tue Apr  2 22:37:34 2024
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.284 2024/03/21 02:36:02 riastradh Exp $
+#	$NetBSD: Makefile,v 1.285 2024/04/02 22:37:34 riastradh Exp $
 
 .include <bsd.own.mk>
 
@@ -261,15 +261,9 @@ SUBDIR+=	ubsec
 .endif
 
 .if ${MKSLJIT} != "no"
-# No modules for 32-bit arm, mips and powerpc yet.
-.if ${MACHINE_ARCH} == "aarch64" || \
-    ${MACHINE_ARCH} == "i386"    || \
-    ${MACHINE_ARCH} == "sparc"   || \
-    ${MACHINE_ARCH} == "x86_64"
 SUBDIR+=	bpfjit
 SUBDIR+=	sljit
 .endif
-.endif
 
 #
 # ACPI modules

Reply via email to