Page MenuHomeFreeBSD

D54595.diff
No OneTemporary

D54595.diff

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
@@ -772,6 +772,18 @@
identify_cpu(0);
identify_hypervisor_smbios();
+ /*
+ * If the SMBIOS method doesn't work, we can still check if we booted
+ * into EL1 on an EL2-capable CPU.
+ */
+ if (boot_el == CURRENTEL_EL_EL1) {
+ /* Check if EL2 is implemented. */
+ uint64_t pfr0;
+ pfr0 = READ_SPECIALREG(id_aa64pfr0_el1);
+ if (ID_AA64PFR0_EL2_VAL(pfr0) != ID_AA64PFR0_EL2_NONE)
+ vm_guest = VM_GUEST_VM;
+ }
+
update_special_regs(0);
/* Set the pcpu data, this is needed by pmap_bootstrap */

File Metadata

Mime Type
text/plain
Expires
Wed, Apr 29, 10:22 AM (6 h, 20 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
32343143
Default Alt Text
D54595.diff (769 B)

Event Timeline