From owner-svn-src-all@freebsd.org Sat Feb 1 17:30:46 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 81FEA1FD665; Sat, 1 Feb 2020 17:30:46 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4891MV2tcKz3KHQ; Sat, 1 Feb 2020 17:30:46 +0000 (UTC) (envelope-from cem@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 5E39725CB; Sat, 1 Feb 2020 17:30:46 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 011HUkHq039449; Sat, 1 Feb 2020 17:30:46 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 011HUki6039448; Sat, 1 Feb 2020 17:30:46 GMT (envelope-from cem@FreeBSD.org) Message-Id: <202002011730.011HUki6039448@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Sat, 1 Feb 2020 17:30:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357372 - head/sys/x86/cpufreq X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/sys/x86/cpufreq X-SVN-Commit-Revision: 357372 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Feb 2020 17:30:46 -0000 Author: cem Date: Sat Feb 1 17:30:45 2020 New Revision: 357372 URL: https://svnweb.freebsd.org/changeset/base/357372 Log: intel_hwpstate(4): Don't leak bound thread in error conditions I don't know why a Skylake CPU with the HWP feature bit present would trap on MSR reads of the HWP registers, but if this occurs, do not leave the attach thread bound. This could conceivably cause reported hangs, although I have no evidence that this is the cause. Reported by: ae@, Andreas Nilsson X-MFC-With: r357002 Modified: head/sys/x86/cpufreq/hwpstate_intel.c Modified: head/sys/x86/cpufreq/hwpstate_intel.c ============================================================================== --- head/sys/x86/cpufreq/hwpstate_intel.c Sat Feb 1 17:13:52 2020 (r357371) +++ head/sys/x86/cpufreq/hwpstate_intel.c Sat Feb 1 17:30:45 2020 (r357372) @@ -343,12 +343,20 @@ set_autonomous_hwp(struct hwp_softc *sc) } ret = rdmsr_safe(MSR_IA32_HWP_REQUEST, &sc->req); - if (ret) - return (ret); + if (ret) { + device_printf(dev, + "Failed to read HWP request MSR for cpu%d (%d)\n", + pc->pc_cpuid, ret); + goto out; + } ret = rdmsr_safe(MSR_IA32_HWP_CAPABILITIES, &caps); - if (ret) - return (ret); + if (ret) { + device_printf(dev, + "Failed to read HWP capabilities MSR for cpu%d (%d)\n", + pc->pc_cpuid, ret); + goto out; + } sc->high = IA32_HWP_CAPABILITIES_HIGHEST_PERFORMANCE(caps); sc->guaranteed = IA32_HWP_CAPABILITIES_GUARANTEED_PERFORMANCE(caps); @@ -372,7 +380,7 @@ set_autonomous_hwp(struct hwp_softc *sc) ret = wrmsr_safe(MSR_IA32_HWP_REQUEST, sc->req); if (ret) { device_printf(dev, - "Failed to setup autonomous HWP for cpu%d (file a bug)\n", + "Failed to setup autonomous HWP for cpu%d\n", pc->pc_cpuid); }