From owner-svn-src-stable@freebsd.org Tue May 8 10:56:07 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6FECDFB17D2; Tue, 8 May 2018 10:56:07 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1C40B6C4E3; Tue, 8 May 2018 10:56:07 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F2CA729563; Tue, 8 May 2018 10:56:06 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w48Au6eS045281; Tue, 8 May 2018 10:56:06 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w48Au6Tw045279; Tue, 8 May 2018 10:56:06 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201805081056.w48Au6Tw045279@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 8 May 2018 10:56:06 +0000 (UTC) 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 X-SVN-Group: stable-11 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in stable/11/sys/x86: acpica include X-SVN-Commit-Revision: 333361 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 May 2018 10:56:07 -0000 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;