-/* $OpenBSD: cpu.c,v 1.56 2021/10/24 17:52:28 mpi Exp $ */
+/* $OpenBSD: cpu.c,v 1.57 2021/11/22 19:22:59 kettenis Exp $ */
/*
* Copyright (c) 2016 Dale Rahn <drahn@dalerahn.com>
struct fdt_attach_args *faa = aux;
struct cpu_info *ci;
uint64_t mpidr = READ_SPECIALREG(mpidr_el1);
+ uint64_t midr = READ_SPECIALREG(midr_el1);
uint64_t id_aa64mmfr1, sctlr;
uint32_t opp;
int timeout = 10000;
int len;
+ /* XXX SMP on Apple CPUs is busted. */
+ if (CPU_IMPL(midr) == CPU_IMPL_APPLE)
+ ci->ci_smt_id = 1;
+
len = OF_getprop(ci->ci_node, "enable-method",
buf, sizeof(buf));
if (strcmp(buf, "psci") == 0) {
-/* $OpenBSD: cpu.h,v 1.22 2021/07/06 09:34:06 kettenis Exp $ */
+/* $OpenBSD: cpu.h,v 1.23 2021/11/22 19:22:59 kettenis Exp $ */
/*
* Copyright (c) 2016 Dale Rahn <drahn@dalerahn.com>
*
int ci_node;
struct cpu_info *ci_self;
+#define __HAVE_CPU_TOPOLOGY
+ u_int32_t ci_smt_id;
+ u_int32_t ci_core_id;
+ u_int32_t ci_pkg_id;
+
struct proc *ci_curproc;
struct pmap *ci_curpm;
struct proc *ci_fpuproc;