Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F111883520
D43973.id134791.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
760 B
Referenced Files
None
Subscribers
None
D43973.id134791.diff
View Options
diff --git a/sys/arm64/arm64/machdep.c b/sys/arm64/arm64/machdep.c
--- a/sys/arm64/arm64/machdep.c
+++ b/sys/arm64/arm64/machdep.c
@@ -215,6 +215,14 @@
return (boot_el == 2 && (hcr_el2 & HCR_E2H) == 0);
}
+bool
+in_vhe(void)
+{
+ /* If we are currently in EL2 then must be in VHE */
+ return ((READ_SPECIALREG(CurrentEL) & CURRENTEL_EL_MASK) ==
+ CURRENTEL_EL_EL2);
+}
+
static void
cpu_startup(void *dummy)
{
diff --git a/sys/arm64/include/machdep.h b/sys/arm64/include/machdep.h
--- a/sys/arm64/include/machdep.h
+++ b/sys/arm64/include/machdep.h
@@ -48,6 +48,7 @@
void dbg_init(void);
bool has_hyp(void);
+bool in_vhe(void);
void initarm(struct arm64_bootparams *);
vm_offset_t parse_boot_param(struct arm64_bootparams *abp);
#ifdef FDT
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Mar 10, 7:02 PM (14 h, 49 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
17085654
Default Alt Text
D43973.id134791.diff (760 B)
Attached To
Mode
D43973: arm64: Add in_vhe() to find if the kernel is in VHE
Attached
Detach File
Event Timeline
Log In to Comment