Received: by 2002:a25:23cc:0:0:0:0:0 with SMTP id j195csp1217202ybj; Tue, 5 May 2020 15:38:39 -0700 (PDT) X-Google-Smtp-Source: APiQypKRnxtDN6WD4jKFjgGkjlLnTD22IcBUdHpUFE9MCBxo8c1tjt8OtEj6rgxSldf6vysjswSr X-Received: by 2002:aa7:d60a:: with SMTP id c10mr4814816edr.66.1588718319237; Tue, 05 May 2020 15:38:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588718319; cv=none; d=google.com; s=arc-20160816; b=YC+za/u+LcanTp/FQaOWpHfv48p+RPikVi2EeWRfR1boYsGHMwprgk2IA6PVlupwmi Ma9ZgykrZgM99c3h49beQARNnZHc1uuEIMqvBkBtdPNKNYdEvX2+gT/lh2GF0/ARf6uN yHhiEI+H3M5np5xZBTGDhPm2QhJZFaTeIC97zHnW4klbm53SmoyxUohY0LTF6Rwj/hAQ yb+7i63/8f3TA3noK0RMaU70RiuEVFegngpu51LiaZGcIf6ddz+NfGz51PigjjCTFRIZ wm+dBO1toaWcGRGEwZyDk3a+BTqJGZ9ZfZLRMIc7c0P1jUuRcjr40setXFniLN5CqZjl ESyw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :ironport-sdr:ironport-sdr; bh=7HkTKiYrGOpalziK96oH9FG1Ms/9YAJRjqr/FK6YLgY=; b=yMu29rbioQNszrJgXyljoDnICOhC2x8OpeXnntcREsK5vtL0AVsu799WU2+sv+lzhh u9q9akRCqN4pyjjU0epdvV+SNmnVLVkNal9jlqePNpOOJDxLXgEfAps4oMzkRYhmOEKM f2Kd7U1tYAuBXNnX6ht5dx0/Fqh8lPidwVM3aKMS6SQS4OurllZzGGKGJpLyA6M/27ov RGo32atzMAbfy95fhCjVsz9wiXNQwMAkU+qNwwDDzUKkwd+sK/p5WeHRuKE2ApKRHp1D YCdYvavwt73RpdZKRKaV9bSuM6xF/cOADc9Qy0mZTbS/kHfZQ9PZnuTPatxhKQ9mQqwJ n/vw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d16si1680eds.428.2020.05.05.15.38.13; Tue, 05 May 2020 15:38:39 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729423AbgEEWgs (ORCPT + 99 others); Tue, 5 May 2020 18:36:48 -0400 Received: from mga09.intel.com ([134.134.136.24]:41849 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729388AbgEEWgq (ORCPT ); Tue, 5 May 2020 18:36:46 -0400 IronPort-SDR: QlSsmB7rfGKazkHD/RNkmNyE6I/fexW09WE7tN7IUfpozREFbj2huUAzxD18/XVz9eUD9irl7e 7nxp1GptR4SA== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 May 2020 15:36:46 -0700 IronPort-SDR: pPCIxxcq51Eki5YNNUFkcxD4KPLR2e7x2RGPsvQDt4fVnaX8xAp7p54a71R52JjArZYSE0e6xk YeyzE9Vj09ZA== X-IronPort-AV: E=Sophos;i="5.73,357,1583222400"; d="scan'208";a="284410842" Received: from rchatre-s.jf.intel.com ([10.54.70.76]) by fmsmga004-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 May 2020 15:36:45 -0700 From: Reinette Chatre To: tglx@linutronix.de, fenghua.yu@intel.com, bp@alien8.de, tony.luck@intel.com Cc: kuo-lang.tseng@intel.com, mingo@redhat.com, babu.moger@amd.com, hpa@zytor.com, x86@kernel.org, linux-kernel@vger.kernel.org, Reinette Chatre , Borislav Petkov Subject: [PATCH V2 3/7] x86/resctrl: Remove unnecessary RMID checks Date: Tue, 5 May 2020 15:36:14 -0700 Message-Id: X-Mailer: git-send-email 2.21.0 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The cache and memory bandwidth monitoring properties are read using CPUID on every CPU. After the information is read from the system a sanity check is run to (1) ensure that the RMID data is initialized for the boot CPU in case the information was not available on the boot CPU and (2) the boot CPU's RMID is set to the minimum of RMID obtained from all CPUs. Every known platform that supports resctrl has the same maximum RMID on all CPUs. Both sanity checks found in x86_init_cache_qos() can thus safely be removed. Suggested-by: Borislav Petkov Signed-off-by: Reinette Chatre --- arch/x86/kernel/cpu/common.c | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/arch/x86/kernel/cpu/common.c b/arch/x86/kernel/cpu/common.c index a8f0f22ee5c1..556a96d05a6c 100644 --- a/arch/x86/kernel/cpu/common.c +++ b/arch/x86/kernel/cpu/common.c @@ -1354,20 +1354,6 @@ static void generic_identify(struct cpuinfo_x86 *c) #endif } -static void x86_init_cache_qos(struct cpuinfo_x86 *c) -{ - /* - * The heavy lifting of max_rmid and cache_occ_scale are handled - * in get_cpu_cap(). Here we just set the max_rmid for the boot_cpu - * in case CQM bits really aren't there in this CPU. - */ - if (c != &boot_cpu_data) { - boot_cpu_data.x86_cache_max_rmid = - min(boot_cpu_data.x86_cache_max_rmid, - c->x86_cache_max_rmid); - } -} - /* * Validate that ACPI/mptables have the same information about the * effective APIC id and update the package map. @@ -1480,7 +1466,6 @@ static void identify_cpu(struct cpuinfo_x86 *c) #endif x86_init_rdrand(c); - x86_init_cache_qos(c); setup_pku(c); /* -- 2.21.0