-/* $OpenBSD: identcpu.c,v 1.119 2021/08/31 15:11:54 kettenis Exp $ */
+/* $OpenBSD: identcpu.c,v 1.120 2021/08/31 15:52:59 patrick Exp $ */
/* $NetBSD: identcpu.c,v 1.1 2003/04/26 18:39:28 fvdl Exp $ */
/*
#include <sys/sysctl.h>
#include "vmm.h"
+#include "pvbus.h"
#include <machine/cpu.h>
#include <machine/cpufunc.h>
+#if NPVBUS > 0
+#include <dev/pv/pvvar.h>
+#endif
+
void replacesmap(void);
void replacemeltdown(void);
uint64_t cpu_freq(struct cpu_info *);
ci->ci_model += ((ci->ci_signature >> 16) & 0x0f) << 4;
}
+#if NPVBUS > 0
+ /* Detect hypervisors early, attach the paravirtual bus later */
+ if (CPU_IS_PRIMARY(ci) && cpu_ecxfeature & CPUIDECX_HV)
+ pvbus_identify();
+#endif
+
if (ci->ci_feature_flags && ci->ci_feature_flags & CPUID_TSC) {
/* Has TSC, check if it's constant */
if (!strcmp(cpu_vendor, "GenuineIntel")) {
-/* $OpenBSD: mainbus.c,v 1.50 2020/05/14 13:07:11 kettenis Exp $ */
+/* $OpenBSD: mainbus.c,v 1.51 2021/08/31 15:52:59 patrick Exp $ */
/* $NetBSD: mainbus.c,v 1.1 2003/04/26 18:39:29 fvdl Exp $ */
/*
printf("\n");
-#if NPVBUS > 0
- /* Detect hypervisors early, attach the paravirtual bus later */
- if (cpu_ecxfeature & CPUIDECX_HV)
- pvbus_identify();
-#endif
-
#if NEFIFB > 0
efifb_cnremap();
#endif