From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1D5FBEB64D8 for ; Thu, 22 Jun 2023 09:51:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230454AbjFVJvb (ORCPT ); Thu, 22 Jun 2023 05:51:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50570 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230342AbjFVJvI (ORCPT ); Thu, 22 Jun 2023 05:51:08 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 73583AD05; Thu, 22 Jun 2023 02:41:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=GIRkJ9xBSI9qzG3Aq2E0VHbn9jmHIdB63mJn4oOnJd4=; b=Vsylbf9yg8HFGDmU9o87kvXJFj YIDeQUSpR3gmRDEb6wu2lIngamtpNoncgU7ddfm2nw7xNYMw25rqynfQwQnZqXsd/x+VEb2tR1YaP +U/AFc6F4G/pVeK8F5q/B2LjcfP5praVDbvAx/4XZES8OncCKktL3v65nsZhsWpbh0KRPg2A9OKGE qNI1PSjFAW9OllGkC0/Z/ygZ0SMDzWWjMd/g6lgGpkRm9iCl5Aw1pJ6s0kzYTpTo7guKRb/wATGNl +w+Ji0ejwNG0RLTKU1AbbBJb6qIAN8svTx4o8nORDlMWJ/QKyxULK2QxKDqswNGDk2bDd1EekDlyJ MBZUIFtA==; Received: from j130084.upc-j.chello.nl ([24.132.130.84] helo=noisy.programming.kicks-ass.net) by casper.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1qCGo9-00FTiX-86; Thu, 22 Jun 2023 09:40:54 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id 0577E300338; Thu, 22 Jun 2023 11:40:52 +0200 (CEST) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id D6D8324216AD3; Thu, 22 Jun 2023 11:40:51 +0200 (CEST) Date: Thu, 22 Jun 2023 11:40:51 +0200 From: Peter Zijlstra To: Josh Poimboeuf Cc: Waiman Long , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , "H. Peter Anvin" , Pawan Gupta , Jacob Pan , Len Brown , linux-kernel@vger.kernel.org, x86@kernel.org, linux-pm@vger.kernel.org, Robin Jarry , Joe Mario Subject: Re: [PATCH v3 2/3] intel_idle: Sync up the SPEC_CTRL MSR value to x86_spec_ctrl_current Message-ID: <20230622094051.GF4253@hirez.programming.kicks-ass.net> References: <20230622003603.1188364-1-longman@redhat.com> <20230622003603.1188364-3-longman@redhat.com> <20230622054633.ulrurzzvzjijvdhn@treble> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230622054633.ulrurzzvzjijvdhn@treble> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jun 21, 2023 at 10:46:33PM -0700, Josh Poimboeuf wrote: > On Wed, Jun 21, 2023 at 08:36:02PM -0400, Waiman Long wrote: > > When intel_idle_ibrs() is called, it modifies the SPEC_CTRL MSR to > > 0 in order disable IBRS. However, the new MSR value isn't reflected > > in x86_spec_ctrl_current which is at odd with the other code that > > keep track of its state in that percpu variable. Fix that by updating > > x86_spec_ctrl_current percpu value to always match the content of the > > SPEC_CTRL MSR. > > Is this fixing an actual bug or is there some other reason for doing > this? No actual bug, he did this for his debugfs file -- which is no longer part of the series. With that on, you can observe the x86_spec_ctrl_current value while idle. Arguably that's not even inconsistent because we disable/enable the thing with IRQs disabled, so nothing can observe the difference.