-/* $OpenBSD: cpu.c,v 1.70 2022/09/15 01:57:52 jsg Exp $ */
+/* $OpenBSD: cpu.c,v 1.71 2022/10/04 19:41:21 kettenis Exp $ */
/*
* Copyright (c) 2016 Dale Rahn <drahn@dalerahn.com>
cpu_init(void)
{
uint64_t id_aa64mmfr1, sctlr;
+ uint64_t id_aa64pfr0;
uint64_t tcr;
WRITE_SPECIALREG(ttbr0_el1, pmap_kernel()->pm_pt0pa);
WRITE_SPECIALREG(sctlr_el1, sctlr);
}
+ /* Enable DIT. */
+ id_aa64pfr0 = READ_SPECIALREG(id_aa64pfr0_el1);
+ if (ID_AA64PFR0_DIT(id_aa64pfr0) >= ID_AA64PFR0_DIT_IMPL)
+ __asm volatile (".arch armv8.4-a; msr dit, #1");
+
/* Initialize debug registers. */
WRITE_SPECIALREG(mdscr_el1, DBG_MDSCR_TDCC);
WRITE_SPECIALREG(oslar_el1, 0);
-/* $OpenBSD: machdep.c,v 1.73 2022/10/03 19:32:22 kettenis Exp $ */
+/* $OpenBSD: machdep.c,v 1.74 2022/10/04 19:41:21 kettenis Exp $ */
/*
* Copyright (c) 2014 Patrick Wildt <patrick@blueri.se>
* Copyright (c) 2021 Mark Kettenis <kettenis@openbsd.org>
tf->tf_sp = stack;
tf->tf_lr = pack->ep_entry;
tf->tf_elr = pack->ep_entry; /* ??? */
- tf->tf_spsr = PSR_M_EL0t;
+ tf->tf_spsr = PSR_M_EL0t | PSR_DIT;
retval[1] = 0;
}