Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F108680150
D41760.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D41760.diff
View Options
diff --git a/sys/arm64/arm64/identcpu.c b/sys/arm64/arm64/identcpu.c
--- a/sys/arm64/arm64/identcpu.c
+++ b/sys/arm64/arm64/identcpu.c
@@ -2259,6 +2259,31 @@
/* Log features before APs are released and start printing to the dmesg. */
SYSINIT(cpu_features, SI_SUB_SMP - 1, SI_ORDER_ANY, cpu_features_sysinit, NULL);
+static void
+tcr_set_e0pd1(void *arg __unused)
+{
+ uint64_t tcr;
+
+ tcr = READ_SPECIALREG(tcr_el1);
+ tcr |= TCR_E0PD1;
+ WRITE_SPECIALREG(tcr_el1, tcr);
+ isb();
+}
+
+/* Enable support for more recent architecture features */
+static void
+cpu_feat_support(void *arg __unused)
+{
+ /*
+ * If FEAT_E0PD is supported use it to cause faults without a page
+ * table walk if userspace tries to access kernel memory.
+ */
+ if (ID_AA64MMFR2_E0PD_VAL(kern_cpu_desc.id_aa64mmfr2) !=
+ ID_AA64MMFR2_E0PD_NONE)
+ smp_rendezvous(NULL, tcr_set_e0pd1, NULL, NULL);
+}
+SYSINIT(cpu_feat_support, SI_SUB_SMP, SI_ORDER_ANY, cpu_feat_support, NULL);
+
#ifdef COMPAT_FREEBSD32
static u_long
parse_cpu_features_hwcap32(void)
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, Jan 28, 6:44 AM (4 h, 7 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
16256409
Default Alt Text
D41760.diff (1 KB)
Attached To
Mode
D41760: arm64: Enable FEAT_E0PD when supported
Attached
Detach File
Event Timeline
Log In to Comment