Call cpu_speculation_init on i386 too. We don't have IBRS for i386, but

we do have the AMD DIS_IND method.
This commit is contained in:
maxv 2018-04-05 08:43:07 +00:00
parent ab8259cd20
commit 0ec930420c
2 changed files with 7 additions and 6 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: machdep.c,v 1.805 2018/04/03 07:20:52 christos Exp $ */
/* $NetBSD: machdep.c,v 1.806 2018/04/05 08:43:07 maxv Exp $ */
/*
* Copyright (c) 1996, 1997, 1998, 2000, 2004, 2006, 2008, 2009, 2017
@ -67,7 +67,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.805 2018/04/03 07:20:52 christos Exp $");
__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.806 2018/04/05 08:43:07 maxv Exp $");
#include "opt_beep.h"
#include "opt_compat_freebsd.h"
@ -1168,6 +1168,9 @@ init386(paddr_t first_avail)
cpu_probe(&cpu_info_primary);
cpu_init_msrs(&cpu_info_primary, true);
#ifndef XEN
cpu_speculation_init(&cpu_info_primary);
#endif
#ifdef PAE
use_pae = 1;

View File

@ -1,4 +1,4 @@
/* $NetBSD: cpu.c,v 1.154 2018/04/04 12:59:49 maxv Exp $ */
/* $NetBSD: cpu.c,v 1.155 2018/04/05 08:43:07 maxv Exp $ */
/*
* Copyright (c) 2000-2012 NetBSD Foundation, Inc.
@ -62,7 +62,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.154 2018/04/04 12:59:49 maxv Exp $");
__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.155 2018/04/05 08:43:07 maxv Exp $");
#include "opt_ddb.h"
#include "opt_mpbios.h" /* for MPDEBUG */
@ -848,9 +848,7 @@ cpu_hatch(void *v)
cpu_init_msrs(ci, true);
cpu_probe(ci);
#ifdef __x86_64__
cpu_speculation_init(ci);
#endif
ci->ci_data.cpu_cc_freq = cpu_info_primary.ci_data.cpu_cc_freq;
/* cpu_get_tsc_freq(ci); */