From patchwork Mon Nov 28 13:20:58 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Neri X-Patchwork-Id: 26767 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp5659692wrr; Mon, 28 Nov 2022 05:18:09 -0800 (PST) X-Google-Smtp-Source: AA0mqf4bPQjz3BJyP+gosi2sB9Xj4ZnNKzfs5gV8rDLxnzQuBQL0k4dYh49dTYzq9TIp+OoiW3pQ X-Received: by 2002:a17:90b:3748:b0:218:e0bf:9385 with SMTP id ne8-20020a17090b374800b00218e0bf9385mr27703810pjb.208.1669641488923; Mon, 28 Nov 2022 05:18:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669641488; cv=none; d=google.com; s=arc-20160816; b=TzKaAsRpPAK5uoskg+EroC4a4FJVS5/A8sxCV6q4WZ1ztcApemUFF56blUGu5mP+Jq DShUf81kA3II57TVJJttcduq0QkKK78sEdUoX2LA/s3hqCrHrCdlfLCxxSgpHYkx/MVt mHCYIAicJ1PhS7bydf/1BGcKYK+GCZ9QpUyZoDgQ1C6loSttD7cR7eFphilNLnE7MiZj RUCKF3cHNp3RHgrclqUkswRgvEtOCFSzBPvxOoi7c9d9aufuQRX+8X8BKyRSKesk9PIa Y9oe92y4RKun9DnVoLv8AbCS2DRPLmhUhgKzAUHmvRlyX86swIK432Vvqs38T4h9teIv Fzow== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:in-reply-to:message-id:date:subject :cc:to:from:dkim-signature; bh=jfo3kb7/aroJhndJuKNk5BK4ugNx5UrtHD2JFuDdRJI=; b=Z56DzO58Ruf6XSi+hFx3fdXjgV6OH+Kqp6SxCOlC/yhbXU/RNK/dMaq+v97MsYddsK mKOQrlKbfSHw104luo8GqCZi3PQ1r+lybOIIrfBHl4EkwOYfx7g3qMkj9B0iVij14Qk3 /SRglAAcFiPB7UdK1myvPTvGRhOajuYDFcPCnier3j3mrDawcM1FtmdMN3M7fYEbmLIr h4A8Ehy0hieybyAo6RPBWpqIiNGuI9gBFa46vxJPzdYwOvWoAAHF82kp/MquWW1BXXCa nxeQC/v/fkMqI61pkU08puIMiRmDNqtaQeXj9Kd/wiVt2rJR+nuQdrTmdPriJvaroFsi MkWA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=d1X0izXQ; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id n31-20020a635c5f000000b00477b10def88si11669047pgm.696.2022.11.28.05.17.40; Mon, 28 Nov 2022 05:18:08 -0800 (PST) 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=@intel.com header.s=Intel header.b=d1X0izXQ; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231713AbiK1NO6 (ORCPT + 99 others); Mon, 28 Nov 2022 08:14:58 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40168 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231655AbiK1NNm (ORCPT ); Mon, 28 Nov 2022 08:13:42 -0500 Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8A3921DA5F; Mon, 28 Nov 2022 05:13:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1669641221; x=1701177221; h=from:to:cc:subject:date:message-id:in-reply-to: references; bh=U9TIyYUMDTGWF/am2zEWFCJshAZh6Eamp8JHDo02tn8=; b=d1X0izXQsq8bimLuxoByKBtb50BbTS+NFW017jW42z9oH2Kx7+MdQCvw DHnuol0lmQF9TtLyWyC9pnifMZ6+TH27FiVyCEb+1YQCl8zJxw0yR66sC 36dmkJm5y9XZnJlFOwIz2+5KvQjomBjdDvjFhNaRP5Ul8okM6MEXs4/ye USKMXdv4UnRDepjeAdDyn0KDAjbFBjzsgF4vL0iZlVu74c8/SwZwBbjts 8xc/pV7265ZSHrW0afZzECNLxJfa5oCmRb/fIJ9UcTwdmC9nc9xopYDm4 /SsGNA2pbDDXf4C+sMg/TOVhQyuget34YhnmjDe9LaDLPeCBNYsa7699Z g==; X-IronPort-AV: E=McAfee;i="6500,9779,10544"; a="401117261" X-IronPort-AV: E=Sophos;i="5.96,200,1665471600"; d="scan'208";a="401117261" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Nov 2022 05:13:36 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10544"; a="749381398" X-IronPort-AV: E=Sophos;i="5.96,200,1665471600"; d="scan'208";a="749381398" Received: from ranerica-svr.sc.intel.com ([172.25.110.23]) by fmsmga002.fm.intel.com with ESMTP; 28 Nov 2022 05:13:36 -0800 From: Ricardo Neri To: "Peter Zijlstra (Intel)" , Juri Lelli , Vincent Guittot Cc: 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, "Joel Fernandes (Google)" , linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, Ricardo Neri , "Tim C . Chen" Subject: [PATCH v2 20/22] x86/cpufeatures: Add feature bit for HRESET Date: Mon, 28 Nov 2022 05:20:58 -0800 Message-Id: <20221128132100.30253-21-ricardo.neri-calderon@linux.intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20221128132100.30253-1-ricardo.neri-calderon@linux.intel.com> References: <20221128132100.30253-1-ricardo.neri-calderon@linux.intel.com> X-Spam-Status: No, score=-4.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1750745994030889344?= X-GMAIL-MSGID: =?utf-8?q?1750745994030889344?= The HRESET instruction prevents the classification of the current task from influencing the classification of the next task when running serially on the same logical processor. Cc: Ben Segall Cc: Daniel Bristot de Oliveira Cc: Dietmar Eggemann Cc: Joel Fernandes (Google) Cc: Len Brown Cc: Mel Gorman Cc: Rafael J. Wysocki Cc: Srinivas Pandruvada Cc: Steven Rostedt Cc: Tim C. Chen Cc: Valentin Schneider Cc: x86@kernel.org Cc: linux-pm@vger.kernel.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Ricardo Neri --- Changes since v1: * None --- arch/x86/include/asm/cpufeatures.h | 1 + arch/x86/include/asm/msr-index.h | 4 +++- arch/x86/kernel/cpu/scattered.c | 1 + 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/arch/x86/include/asm/cpufeatures.h b/arch/x86/include/asm/cpufeatures.h index 80b2beafc81e..281a7c861b8d 100644 --- a/arch/x86/include/asm/cpufeatures.h +++ b/arch/x86/include/asm/cpufeatures.h @@ -308,6 +308,7 @@ #define X86_FEATURE_CALL_DEPTH (11*32+19) /* "" Call depth tracking for RSB stuffing */ #define X86_FEATURE_MSR_TSX_CTRL (11*32+20) /* "" MSR IA32_TSX_CTRL (Intel) implemented */ +#define X86_FEATURE_HRESET (11*32+21) /* Hardware history reset instruction */ /* Intel-defined CPU features, CPUID level 0x00000007:1 (EAX), word 12 */ #define X86_FEATURE_AVX_VNNI (12*32+ 4) /* AVX VNNI instructions */ diff --git a/arch/x86/include/asm/msr-index.h b/arch/x86/include/asm/msr-index.h index 96303330223b..7a3ff73164bd 100644 --- a/arch/x86/include/asm/msr-index.h +++ b/arch/x86/include/asm/msr-index.h @@ -1078,6 +1078,9 @@ #define MSR_IA32_HW_FEEDBACK_THREAD_CONFIG 0x17d4 #define MSR_IA32_HW_FEEDBACK_CHAR 0x17d2 +/* Hardware History Reset */ +#define MSR_IA32_HW_HRESET_ENABLE 0x17da + /* x2APIC locked status */ #define MSR_IA32_XAPIC_DISABLE_STATUS 0xBD #define LEGACY_XAPIC_DISABLED BIT(0) /* @@ -1085,5 +1088,4 @@ * disabling x2APIC will cause * a #GP */ - #endif /* _ASM_X86_MSR_INDEX_H */ diff --git a/arch/x86/kernel/cpu/scattered.c b/arch/x86/kernel/cpu/scattered.c index f53944fb8f7f..66bc5713644d 100644 --- a/arch/x86/kernel/cpu/scattered.c +++ b/arch/x86/kernel/cpu/scattered.c @@ -28,6 +28,7 @@ static const struct cpuid_bit cpuid_bits[] = { { X86_FEATURE_EPB, CPUID_ECX, 3, 0x00000006, 0 }, { X86_FEATURE_INTEL_PPIN, CPUID_EBX, 0, 0x00000007, 1 }, { X86_FEATURE_RRSBA_CTRL, CPUID_EDX, 2, 0x00000007, 2 }, + { X86_FEATURE_HRESET, CPUID_EAX, 22, 0x00000007, 1 }, { X86_FEATURE_CQM_LLC, CPUID_EDX, 1, 0x0000000f, 0 }, { X86_FEATURE_CQM_OCCUP_LLC, CPUID_EDX, 0, 0x0000000f, 1 }, { X86_FEATURE_CQM_MBM_TOTAL, CPUID_EDX, 1, 0x0000000f, 1 },