Received: by 2002:ab2:7903:0:b0:1fb:b500:807b with SMTP id a3csp1062602lqj; Mon, 3 Jun 2024 09:04:48 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXAgfsH4UOBXArvN99+gW+JlBLWtTN1Zs/tY3sj+SGLYdsfB7q/RE5tzIE54D2a+7wwjbmqEd7rnhCgHOifvc/qXKfnaQt8pPP+/rAGuA== X-Google-Smtp-Source: AGHT+IE+HKCcfqHLrf+bmd88o72WH7C/cOLaB5pq6+8/MO39DU1g4XaE1YvUL3CgFpJ5WU7pjOUR X-Received: by 2002:a05:6a20:1585:b0:1b2:5674:2225 with SMTP id adf61e73a8af0-1b26f205176mr10162865637.28.1717430687888; Mon, 03 Jun 2024 09:04:47 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717430687; cv=pass; d=google.com; s=arc-20160816; b=0o9l4/R4W2bG8cWmwSRdgfwqC+t6M6IS986r2kImqqOLUaSmVmN4fLwsIIgAAfHbC6 4V9Av2Xtr/VfdEInAPooiYyagvBVetn4GlEzZhh2lBdK19hJPWqbpnG0TMuyQqGF9c8R vwBFClFk9CPGQUrDyxkdCO8ivVsaep0/98UWKhNwM/lEFsYcqBDYiiC0kcdhProi1DES CZl/3CUyl64dNypVL8Ty1S411/lhZ4+yEy1EjuFbi2WXkJ0gpQ4zN2qBHVAiVTk9pltw 5Y2fTNaIyrF96bMpuP1rSO6cgx8/q3eykdDdHG60mGsFY9a2p19XVOiNs8JY4+1vyC8y JfhA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:dkim-signature; bh=f4CtsuGBihSzdd0SJ8gAHpAHczj8H8mPNw0h+P0X5eQ=; fh=dOccceLsmwsKT0orR6HDl5FOoy3/qgvOGaOm1ypwnzI=; b=LYl1m5oLU50TaS6zQCTSHLj+inVnrBkJASz9pBTPezHG9PJpN4c6B2Nt7KZYmdfvg9 E4/nHyIden+SYB3KU+tn6RMI/nlpv3fYAJrmTjwScgGbEdicszY7CyPWbPkUwIH1YsPS FWsSrlnA8B/SoeimCXEzlAlqX2QzQnyhmvsmbHttCWyXIQm7ZOvYNyErJw1QYdi9uV8e xDkYWX1Yg+GGqLK+QWHOurX1r9AACraGX5OrbJEkgtKEIRNyv79VtVebNSL28f8tTqGd PuTZDLLXKFz8CCc9NyvSmSPrKG7inuQ6cMgxS0EHGBRuJEjMfRAGtipPBU1asH54UevB HKzA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=LYLQOazg; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-199405-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-199405-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id 41be03b00d2f7-6c35bbbf842si396598a12.504.2024.06.03.09.04.47 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 03 Jun 2024 09:04:47 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-199405-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=LYLQOazg; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-199405-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-199405-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id A65A028239E for ; Mon, 3 Jun 2024 16:03:42 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 2F5E41353FF; Mon, 3 Jun 2024 16:03:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="LYLQOazg" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 54EA227269; Mon, 3 Jun 2024 16:03:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717430615; cv=none; b=M7o4bvwFA1/NiCjQ7C3d64U2bFJ2xzg6o229tUCuUoG3o4FqfiR6ce7vkJ/xOfH/oNofMJIld/rmSMcmgD3EbwPD9ETXFsQeYHnMdNYqnyyPYSc84UebKOX+A1NgNaHfpoh79rLtjwmk1PYP6+CvhhFSOQpBjw7OyXkVfcKlsJM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717430615; c=relaxed/simple; bh=lQyrMYvJvqu0yiAIygYCncuMTdVtDI0csy12c7vRrNY=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=K3WuwwV2dDWu887GNCqZ1+YgjtOQgHCXxytV2Q0nfB2eqsDOa4oFtfSvFcUft5s3JsYfeTPDPLsNqHfOogkPYb2uoznWA93jC6p6uoRRFTx20j8wrt8cTJ9pZOFURaF885GwClH/yP8cJAQYcHBrUmxMflsQUlb5SAU1nDmHs2Q= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=LYLQOazg; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id C9C59C2BD10; Mon, 3 Jun 2024 16:03:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1717430614; bh=lQyrMYvJvqu0yiAIygYCncuMTdVtDI0csy12c7vRrNY=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=LYLQOazgr83Ax/HeYjYQeHuUmq9TpTFR8kYj1j4SF+nLWxwQei9ozYv/XORqEgDtd mFpHJP4dhslUserCc1H7qfeCHK+rNtxbPOqRHb+DZqIpfDTSpudBIlx9L7k+I54au4 5m4S8qxppRkxqV3xmrGYZWuGzousHrPZYC6YwRWmwnYgYFtITta7eeS4+f0Z2Z8egZ XjFdC9vFk+xU+TdKElxEBH06Bs8qBv8uu27YUFUTSTg1cvoC2W3xrgXtuiBwWxHkdY OOeiFD3afhyEdNruWjeET7rq/zc+95nj7nGIVUSpXHOA1P2GxPozSgbqoCZaFUazUw fzRmbouyit32Q== Received: by mail-oa1-f48.google.com with SMTP id 586e51a60fabf-250ff991197so607fac.1; Mon, 03 Jun 2024 09:03:34 -0700 (PDT) X-Forwarded-Encrypted: i=1; AJvYcCW4W9xuKSUESG6rnUl0UpW0MOi3fjOHXNF8R5MOpTVHkouu9zdkEDo/DQdjeYMgjR+UylYsb00YKjJ3gl0qzCG0OUyqdOucIDLTASaB9gHMUh08aZKPe2MXQ8QpFXvwsmuYC3+mViM= X-Gm-Message-State: AOJu0YxPUjB0/FOVqV+IN9PLMBWZJiCOSy2AnWQLp77qB0LYpyeN+XOH g0A63wLoqbvNJGM8594KEawE5LOJNWOSCyIS5fOyQIlAl70u3w0TWqAChI4um+Z0EL0mWjxxD4r qOfK3gb4N4Zsk22OYrdg/dsR09y8= X-Received: by 2002:a05:6870:d892:b0:24f:ddd5:a21d with SMTP id 586e51a60fabf-2508be4806dmr9882822fac.5.1717430614083; Mon, 03 Jun 2024 09:03:34 -0700 (PDT) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240531230004.1334127-1-srinivas.pandruvada@linux.intel.com> In-Reply-To: <20240531230004.1334127-1-srinivas.pandruvada@linux.intel.com> From: "Rafael J. Wysocki" Date: Mon, 3 Jun 2024 18:03:23 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] cpufreq: intel_pstate: Fix unchecked HWP MSR access To: Srinivas Pandruvada Cc: rafael@kernel.org, viresh.kumar@linaro.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, Sebastian Andrzej Siewior Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Sat, Jun 1, 2024 at 1:00=E2=80=AFAM Srinivas Pandruvada wrote: > > Fix unchecked MSR access error for processors with no HWP support. On > such processors, maximum frequency can be changed by the system firmware > using ACPI event ACPI_PROCESSOR_NOTIFY_HIGEST_PERF_CHANGED. This results > in accessing HWP MSR 0x771. > > Call Trace: > > generic_exec_single+0x58/0x120 > smp_call_function_single+0xbf/0x110 > rdmsrl_on_cpu+0x46/0x60 > intel_pstate_get_hwp_cap+0x1b/0x70 > intel_pstate_update_limits+0x2a/0x60 > acpi_processor_notify+0xb7/0x140 > acpi_ev_notify_dispatch+0x3b/0x60 > > HWP MSR 0x771 can be only read on a CPU which supports HWP and enabled. > Hence intel_pstate_get_hwp_cap() can only be called when hwp_active is > true. > > Reported-by: Sebastian Andrzej Siewior > Closes: https://lore.kernel.org/linux-pm/20240529155740.Hq2Hw7be@linutron= ix.de/ > Fixes: e8217b4bece3 ("cpufreq: intel_pstate: Update the maximum CPU frequ= ency consistently") > Tested-by: Sebastian Andrzej Siewior > Signed-off-by: Srinivas Pandruvada > --- > drivers/cpufreq/intel_pstate.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/drivers/cpufreq/intel_pstate.c b/drivers/cpufreq/intel_pstat= e.c > index 4b986c044741..65d3f79104bd 100644 > --- a/drivers/cpufreq/intel_pstate.c > +++ b/drivers/cpufreq/intel_pstate.c > @@ -1153,7 +1153,8 @@ static void intel_pstate_update_policies(void) > static void __intel_pstate_update_max_freq(struct cpudata *cpudata, > struct cpufreq_policy *policy) > { > - intel_pstate_get_hwp_cap(cpudata); > + if (hwp_active) > + intel_pstate_get_hwp_cap(cpudata); > > policy->cpuinfo.max_freq =3D READ_ONCE(global.no_turbo) ? > cpudata->pstate.max_freq : cpudata->pstate.turbo_= freq; > -- Applied as 6.10-rc material, thanks!