Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp962469rwb; Tue, 27 Sep 2022 06:51:07 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7aASIikJgVVvp8XBE1JCSDyukDHqAH9kNiizP40KLALCc4EP26Jd+LqSfl2ukqBDN345ek X-Received: by 2002:a17:902:b907:b0:178:9d11:c978 with SMTP id bf7-20020a170902b90700b001789d11c978mr27275094plb.90.1664286666724; Tue, 27 Sep 2022 06:51:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1664286666; cv=none; d=google.com; s=arc-20160816; b=VOdS0xe9L6JjCcim88E9+Ftln/t7k0r7Od014hZaKw6sRaNoN2lpJiFzmPM/hKXuSN vBoLH0Ac4gPnlafWnN8tvGrc63OTKkHTWPiw/u7nDx/3TPSLxgZ1BFNrNrURqOvQ7lc/ EK1dVkiwCTidQejaqdqzqVk/Mm2JYFL6Jc1FCSJgzQKPidh3DxsjeT+MIwyzcGSCvXm2 hBg/qEn+EGaYsq31GEztmzAWNWPdGUjVV6uXPmzoD1SXlg87feMJYMLVRd+1LOqZf/5h ZZiENLXemEaGqXga+WgkHhHAwWhwVTZUF+OXlI44Bm1JXc5JZbwkIXT+mOedMCr6qRtE L1kA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=pXB424lDn1hFN24n6cTbpmppnRXapviGsBP0Dd9v8gU=; b=J3Yh1p9o6607wIV8ehuLqUn3Zlng+1v/QwV4ArDzM+AkD1c6nJsUSYSE5Iou8KMCLK q1NqwfE5cEjtjQmOzyiBSeyv/ywsNJhZJVwa9eecZiVWazAJPpewM0qUDJ/TKX+A+Thp 6ShzpzGBGojjeRXu0JotA9bqH7zKxhK6W0Y3JMYzAoHa60Tn71kGulD0ag78JiRUKxX4 Cq4clkFU1DS3K+xOI2TAFCz78N6edXeUA0SxS4C5IwLRCOyo6AhIkU9BW7NGVWuL0xDL l7PBJc+USGU0rapXT001N41kuz0uf1sD3gJhNjfj3fniZXZys0nECwZFMdzpjqSYr+5u 5tmg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=coNiGvWl; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b1-20020a056a00114100b00542258e82a0si2344048pfm.68.2022.09.27.06.50.53; Tue, 27 Sep 2022 06:51:06 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=coNiGvWl; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232190AbiI0MEh (ORCPT + 99 others); Tue, 27 Sep 2022 08:04:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37922 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232184AbiI0MEf (ORCPT ); Tue, 27 Sep 2022 08:04:35 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 85BF59F for ; Tue, 27 Sep 2022 05:04:31 -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=pXB424lDn1hFN24n6cTbpmppnRXapviGsBP0Dd9v8gU=; b=coNiGvWlXAt2Mq9+nmtXyp1TGZ krR8TYJItVs/xfQ6OkLRHJzUdWInvLCp38xUVCLrga/JgottSFvxL/ClOWzvM/1zFPHvos5xGAVOs 3SteKqjV6/nbu0mdNkzyFE1YTEKYkyh6CTd4SCogCyzlyyeeNVgmbJfFJp2Z/HawUoXCLwoKBdvOp ztI8+F9qUjxnay8Tyqhd6UITv2LSfum0uJaocKtwIVH3n9DcySZ5UlENfenkkOW6rx9B1l4o1U8dG jt+kSkEdRZbhsIZEGbApxK+HSk0OXaUf1v6DjczGJtXjRgzFshfSSjl6b8f+lUVvHoIHyLDzn+4uE 2uTtOd9A==; 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 1od9Jj-00BPEA-NP; Tue, 27 Sep 2022 12:04:03 +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 68D1F3001D6; Tue, 27 Sep 2022 14:03:59 +0200 (CEST) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 4F5332BDDB522; Tue, 27 Sep 2022 14:03:59 +0200 (CEST) Date: Tue, 27 Sep 2022 14:03:59 +0200 From: Peter Zijlstra To: Ricardo Neri Cc: Juri Lelli , Vincent Guittot , Ricardo Neri , "Ravi V. Shankar" , Ben Segall , Daniel Bristot de Oliveira , Dietmar Eggemann , Len Brown , Mel Gorman , "Rafael J. Wysocki" , Srinivas Pandruvada , Steven Rostedt , Tim Chen , Valentin Schneider , x86@kernel.org, linux-kernel@vger.kernel.org, "Tim C . Chen" Subject: Re: [RFC PATCH 22/23] x86/hreset: Configure history reset Message-ID: References: <20220909231205.14009-1-ricardo.neri-calderon@linux.intel.com> <20220909231205.14009-23-ricardo.neri-calderon@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220909231205.14009-23-ricardo.neri-calderon@linux.intel.com> X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Sep 09, 2022 at 04:12:04PM -0700, Ricardo Neri wrote: > +static u32 hardware_history_features __read_mostly; __ro_after_init ? > +static __always_inline void setup_hreset(struct cpuinfo_x86 *c) > +{ > + if (!cpu_feature_enabled(X86_FEATURE_HRESET)) > + return; > + > + /* > + * Use on all CPUs the hardware history features that the boot > + * CPU supports. > + */ > + if (c == &boot_cpu_data) > + hardware_history_features = cpuid_ebx(0x20); > + > + if (!hardware_history_features) > + return; > + > + wrmsrl(MSR_IA32_HW_HRESET_ENABLE, hardware_history_features); > + > + pr_info_once("x86/cpu: Intel History Reset (HRESET) activated\n"); > +} > + > /* These bits should not change their value after CPU init is finished. */ > static const unsigned long cr4_pinned_mask = > X86_CR4_SMEP | X86_CR4_SMAP | X86_CR4_UMIP |