Date: Tue, 8 May 2018 10:56:06 +0000 (UTC) From: Konstantin Belousov <kib@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r333361 - in stable/11/sys/x86: acpica include Message-ID: <201805081056.w48Au6Tw045279@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: kib Date: Tue May 8 10:56:06 2018 New Revision: 333361 URL: https://svnweb.freebsd.org/changeset/base/333361 Log: MFC r333125: Turn off IBRS on suspend. Approved by: re (marius) Modified: stable/11/sys/x86/acpica/acpi_wakeup.c stable/11/sys/x86/include/x86_var.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/x86/acpica/acpi_wakeup.c ============================================================================== --- stable/11/sys/x86/acpica/acpi_wakeup.c Tue May 8 10:18:24 2018 (r333360) +++ stable/11/sys/x86/acpica/acpi_wakeup.c Tue May 8 10:56:06 2018 (r333361) @@ -190,6 +190,10 @@ acpi_sleep_machdep(struct acpi_softc *sc, int state) { ACPI_STATUS status; struct pcb *pcb; +#ifdef __amd64__ + struct pcpu *pc; + int i; +#endif if (sc->acpi_wakeaddr == 0ul) return (-1); /* couldn't alloc wake memory */ @@ -217,6 +221,14 @@ acpi_sleep_machdep(struct acpi_softc *sc, int state) if (!CPU_EMPTY(&suspcpus) && suspend_cpus(suspcpus) == 0) { device_printf(sc->acpi_dev, "Failed to suspend APs\n"); return (0); /* couldn't sleep */ + } +#endif +#ifdef __amd64__ + hw_ibrs_active = 0; + cpu_stdext_feature3 = 0; + CPU_FOREACH(i) { + pc = pcpu_find(i); + pc->pc_ibpb_set = 0; } #endif Modified: stable/11/sys/x86/include/x86_var.h ============================================================================== --- stable/11/sys/x86/include/x86_var.h Tue May 8 10:18:24 2018 (r333360) +++ stable/11/sys/x86/include/x86_var.h Tue May 8 10:56:06 2018 (r333361) @@ -81,7 +81,8 @@ extern int _ufssel; extern int _ugssel; extern int use_xsave; extern uint64_t xsave_mask; -extern int pti; +extern int pti; +extern int hw_ibrs_active; struct pcb; struct thread;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201805081056.w48Au6Tw045279>