Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp951357rwb; Tue, 27 Sep 2022 06:42:55 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6aL1g+7nOJHPNevGNo6k3k4aGpFYVXHQql6SiejsnlLJxb2ou6YyG8U2n3q4D361RV5IEK X-Received: by 2002:a17:90a:ce8d:b0:205:e3c1:df45 with SMTP id g13-20020a17090ace8d00b00205e3c1df45mr1160528pju.72.1664286175492; Tue, 27 Sep 2022 06:42:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1664286175; cv=none; d=google.com; s=arc-20160816; b=f44YROV9PdC/YOIQuvhF4UHVvhlwUI1fUsv3meVyCEf1gQ0lIv7l6gWMM0o6U5PaIX zeXmFWS7mV8c9jycih0gbP03Ns/Hdhbu3ycIx1ZE9VvdrOXU+aJDu5aYrbaIhi1L9IE1 5tuSNmSPJaXIZuBMO95Jt1XSi/SScBjpODQXsxTit6rqDIF5Kc4eqIRCvWc9rUckUNlr 69o4a9hoZ6V3z3r66dQt2nnkBngcLfQQQzIvC1DCWPxFhLWR/MshbvDWzYrw+4N1zifs kNi/JFzS/Cl+szsskqmhL36mJTDq8HP28zqcJt6ez8WMTffXwUmCvXJfsrfizjdFGoMt s8aA== 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=/aH2gcFAvMkC4dN5ZbxdXmb/yda8CDpfjwcWlpsGSi0=; b=AVvHjQs2UH6khBxm7yabnY20DxnPaWD/k/kVknoORly8tSjYBcunQzl3koWKFxoGGE OcAjkFJ7MrOYaUZqJY1CKRe8pgWkLFeprbo+jVmtx7+7JX9U8cde9vp/70gAka31ooRI JN5V/CoL/t3umu99cLADiPxv9nTOQfyZMdXkfQfSmC8azFx8Yf2T4MQF1BMbGWYHNLy/ PrBrQesQHtuEfX8vnf7c7sGCpvjTO3OzH2j9zT0jjNdRL6Df8afFyYtCx2eju75dfYKs opgcSKVNQpoiUQzzsQlY+eUiBP2nT51XoiKyw6tbCEQAtc1bjUlkGBh7xFHAD7N80Za3 7RJA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=XRjCWqex; 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 k3-20020a170902ce0300b00179eed9bdf2si1564007plg.497.2022.09.27.06.42.43; Tue, 27 Sep 2022 06:42:55 -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=XRjCWqex; 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 S230153AbiI0Mwx (ORCPT + 99 others); Tue, 27 Sep 2022 08:52:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38028 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229734AbiI0Mwv (ORCPT ); Tue, 27 Sep 2022 08:52:51 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D61F2B1B84 for ; Tue, 27 Sep 2022 05:52:50 -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=/aH2gcFAvMkC4dN5ZbxdXmb/yda8CDpfjwcWlpsGSi0=; b=XRjCWqexzatOWCyqh1VtZSDXwE GYN5kw85MzU16gIhDn0UJ3FipIMR67bgrEQpYJo9wCv2ypV9gyeXV4CqqzDO50OJ3TBQSfQ43ozjg 2HXgF0RC1pTIzvdczWrCFS/pLyHW+ZAiiC+71gWDtPNNF6SLhPShYQnRI44mdI5gTYGkwEey1mHkG IIhj3jv6M9DDAv0BVZDo1OSIJaFYb+fKitW05fnNDsMnTa4QTu8QtyEPfRBK5+VM7L0BtRbQlChgg kpm3SBSzs/VN+0yfTIv3Lx67OpMlx5MjLgQHyB9LqKQd1s3W75tsNWJsaxbnC2hSpK235nkfQ9Q/o QAfu4SEw==; 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 1odA4b-00BRVw-R5; Tue, 27 Sep 2022 12:52:29 +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) server-digest SHA256) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id 6C432300205; Tue, 27 Sep 2022 14:52:25 +0200 (CEST) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 0BD5320424F6E; Tue, 27 Sep 2022 14:52:25 +0200 (CEST) Date: Tue, 27 Sep 2022 14:52:24 +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 23/23] x86/process: Reset hardware history in context switch Message-ID: References: <20220909231205.14009-1-ricardo.neri-calderon@linux.intel.com> <20220909231205.14009-24-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-24-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:05PM -0700, Ricardo Neri wrote: > +void reset_hardware_history(void) > +{ > + if (!static_cpu_has(X86_FEATURE_HRESET)) > + return; > + > + asm volatile("mov %0, %%eax;" __ASM_HRESET "\n" : : > + "r" (hardware_history_features) : "%rax"); > +} asm_inline volatile (ALTERNATIVE("", __ASM_HRESET, X86_FEATURE_HRESET) : : "a" (hardware_history_features) : "memory");