summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkettenis <kettenis@openbsd.org>2020-07-10 14:35:01 +0000
committerkettenis <kettenis@openbsd.org>2020-07-10 14:35:01 +0000
commitf0f36bcaeb9f3cb1c208273553377615c1c5928b (patch)
tree51e98465f6b5fdedfe30cc582de25192451208b9
parentChange users of IFQ_SET_MAXLEN() and IFQ_IS_EMPTY() to use the "new" API. (diff)
downloadwireguard-openbsd-f0f36bcaeb9f3cb1c208273553377615c1c5928b.tar.xz
wireguard-openbsd-f0f36bcaeb9f3cb1c208273553377615c1c5928b.zip
Use OPAL_REINIT_CPUS calls during early boot to set endianness and to
set the MMU to hash mode such that the full TLB is available on POWER9 CPUs.
-rw-r--r--sys/arch/powerpc64/powerpc64/machdep.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/sys/arch/powerpc64/powerpc64/machdep.c b/sys/arch/powerpc64/powerpc64/machdep.c
index a8d5406f46d..0ccbd0eb3ff 100644
--- a/sys/arch/powerpc64/powerpc64/machdep.c
+++ b/sys/arch/powerpc64/powerpc64/machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: machdep.c,v 1.46 2020/07/08 17:48:28 kettenis Exp $ */
+/* $OpenBSD: machdep.c,v 1.47 2020/07/10 14:35:01 kettenis Exp $ */
/*
* Copyright (c) 2020 Mark Kettenis <kettenis@openbsd.org>
@@ -125,6 +125,16 @@ init_powernv(void *fdt, void *tocbase)
fdt_node_property(node, "opal-entry-address", &prop);
opal_entry = bemtoh64((uint64_t *)prop);
fdt_node_property(node, "compatible", &prop);
+
+ opal_reinit_cpus(OPAL_REINIT_CPUS_HILE_BE);
+
+ /*
+ * The following call will fail on Power ISA 2.0x CPUs,
+ * but that is fine since they don't support Radix Tree
+ * translation. On Power ISA 3.0 CPUs this will make
+ * the full TLB available.
+ */
+ opal_reinit_cpus(OPAL_REINIT_CPUS_MMU_HASH);
}
/* At this point we can call OPAL runtime services and use printf(9). */