From patchwork Tue Jan 24 09:26:37 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: tip-bot2 for Thomas Gleixner X-Patchwork-Id: 47615 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp2051481wrn; Tue, 24 Jan 2023 01:27:21 -0800 (PST) X-Google-Smtp-Source: AMrXdXtjICOE9Gs8OnmWbw9BlPj4/b8Ohcg7CdGmzc3IL4p4D1A1wNNjdhb136ZzuoMRaUJKzYIC X-Received: by 2002:a17:90b:35c9:b0:229:8344:2a59 with SMTP id nb9-20020a17090b35c900b0022983442a59mr28234226pjb.13.1674552441674; Tue, 24 Jan 2023 01:27:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674552441; cv=none; d=google.com; s=arc-20160816; b=uBAO1Y7hJtZkqYqJOHcAiHbIub8aVkx1tTrluQGyH2KtDN0jm0HRnh2GD1HkfK/7j/ zIgcwuCjTXzsDeRy+yHT6J9LLBHMDR7S5rlJ7ijlDCeYKEAA1FwbIt+3nZ/dEdc/pce8 keprp9Jz17ZFhuIXL964J80aHeNqQMt3iufkQCbGDsTNAtk5b8rhmj+waGu+lTjgDw6o LTU3MSkXwjZ53Dtj3pdxwZSAepOjUk/PKGF4ZX2W0dUgSaZKM/9PvXQVzkDV3QYNJowG ZzHn8/f5dXMQYhn1Ene4ge+sO9Qx2sis34OjqHq5VYY8CjcrxJzkuaIUXm4m45qMLM1i 6sMA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:robot-unsubscribe :robot-id:message-id:mime-version:references:in-reply-to:cc:subject :to:reply-to:sender:from:dkim-signature:dkim-signature:date; bh=YQBy7IN/YvfkXQt6TRd6rZ2ywPAj5eyVw6ULbuH+9WE=; b=eUiR8+SEOwCoc6KFzOzMMT9gqWPquBof7uB07w1G5VvHvo5IOLLBWgfhRke3mmviff gr6z19FKxLsSd680iT9oBlFqUkp9Z7Z6/SP2yRC+00Jd+TwTplXOYNutxoO5oqf6BPYH 5oEknL4T9alDWJchwxzNsiCXiMr/qXw2alOMdrw78fUusD8WI1UxhB/kRKWbrIAv3hG7 7r6F2zn/azWw6IScl6m+frgMqjTQdXy57aK6DOA34TDaTjIVV7hu8hjZm19fizf+TzNX G5GASCQk/02/iRb33GUYaxjbDoDnseRH8D/oeq+N1YoYZHPoz/seNgDD69b7aKeEQVPs 3Ddg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=TDl3FMaa; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=0XKLPW4R; 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=QUARANTINE dis=NONE) header.from=linutronix.de Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id v11-20020a17090a520b00b00223b10927f9si13742110pjh.18.2023.01.24.01.27.10; Tue, 24 Jan 2023 01:27:21 -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=@linutronix.de header.s=2020 header.b=TDl3FMaa; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=0XKLPW4R; 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=QUARANTINE dis=NONE) header.from=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233494AbjAXJ05 (ORCPT + 99 others); Tue, 24 Jan 2023 04:26:57 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55048 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233239AbjAXJ0l (ORCPT ); Tue, 24 Jan 2023 04:26:41 -0500 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 080D572A5; Tue, 24 Jan 2023 01:26:41 -0800 (PST) Date: Tue, 24 Jan 2023 09:26:37 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1674552397; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=YQBy7IN/YvfkXQt6TRd6rZ2ywPAj5eyVw6ULbuH+9WE=; b=TDl3FMaa9Fm93uXb6nTCYPffBSfZwBT3YZPV8ec3OOTZA+stXstBzojMIYkh+WpCYsWjjk tDdePkmorL1YL9nIrRuwSWWCyvtqXbGrp/eLsliGKnG+JMXcidfxrl7drsJ8sp/lK1oJ5y pQ38fRFyxEV+cmVHnlC2A6aM+H0WFQhEqiMeXnnKAID0MOcKpKBeabqSHvU66DwrCLuytm ciNvNg1iO0nR9ResZq1NXuHc6IQp5J97WAzmw1IysJ1Rrv9Mj8QFnImlrgH5Ffg/m1plJ8 JkkbfBp0rQUcvFZKpRh6AYjXLgZRuYLaxCS//+v+PbRJc+M+5AEtJSzLe+cGWw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1674552397; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=YQBy7IN/YvfkXQt6TRd6rZ2ywPAj5eyVw6ULbuH+9WE=; b=0XKLPW4RWqk6aQTFkXM+BqlmM3LF6eTr6GdKng47HSPgkmPNe5Ds2TMqFvgaAuaPWAo1Z6 8DQS2xNmmdBl/lCA== From: "tip-bot2 for Babu Moger" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: x86/cache] x86/resctrl: Add __init attribute to rdt_get_mon_l3_config() Cc: Babu Moger , "Borislav Petkov (AMD)" , Reinette Chatre , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20230113152039.770054-8-babu.moger@amd.com> References: <20230113152039.770054-8-babu.moger@amd.com> MIME-Version: 1.0 Message-ID: <167455239706.4906.14594774721679630568.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails 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_PASS 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?1754923164856437476?= X-GMAIL-MSGID: =?utf-8?q?1755895501032233483?= The following commit has been merged into the x86/cache branch of tip: Commit-ID: bd334c86b5d70e5d1c6169991802e62c828d6f38 Gitweb: https://git.kernel.org/tip/bd334c86b5d70e5d1c6169991802e62c828d6f38 Author: Babu Moger AuthorDate: Fri, 13 Jan 2023 09:20:33 -06:00 Committer: Borislav Petkov (AMD) CommitterDate: Mon, 23 Jan 2023 17:40:11 +01:00 x86/resctrl: Add __init attribute to rdt_get_mon_l3_config() In an upcoming change, rdt_get_mon_l3_config() needs to call rdt_cpu_has() to query the monitor related features. It cannot be called right now because rdt_cpu_has() has the __init attribute but rdt_get_mon_l3_config() doesn't. Add the __init attribute to rdt_get_mon_l3_config() that is only called by get_rdt_mon_resources() that already has the __init attribute. Also make rdt_cpu_has() available to by rdt_get_mon_l3_config() via the internal header file. Signed-off-by: Babu Moger Signed-off-by: Borislav Petkov (AMD) Reviewed-by: Reinette Chatre Link: https://lore.kernel.org/r/20230113152039.770054-8-babu.moger@amd.com Signed-off-by: Borislav Petkov (AMD) --- arch/x86/kernel/cpu/resctrl/core.c | 2 +- arch/x86/kernel/cpu/resctrl/internal.h | 1 + arch/x86/kernel/cpu/resctrl/monitor.c | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/arch/x86/kernel/cpu/resctrl/core.c b/arch/x86/kernel/cpu/resctrl/core.c index b4fc851..030d3b4 100644 --- a/arch/x86/kernel/cpu/resctrl/core.c +++ b/arch/x86/kernel/cpu/resctrl/core.c @@ -728,7 +728,7 @@ static int __init set_rdt_options(char *str) } __setup("rdt", set_rdt_options); -static bool __init rdt_cpu_has(int flag) +bool __init rdt_cpu_has(int flag) { bool ret = boot_cpu_has(flag); struct rdt_options *o; diff --git a/arch/x86/kernel/cpu/resctrl/internal.h b/arch/x86/kernel/cpu/resctrl/internal.h index fdbbf66..f16b8bc 100644 --- a/arch/x86/kernel/cpu/resctrl/internal.h +++ b/arch/x86/kernel/cpu/resctrl/internal.h @@ -512,6 +512,7 @@ void closid_free(int closid); int alloc_rmid(void); void free_rmid(u32 rmid); int rdt_get_mon_l3_config(struct rdt_resource *r); +bool __init rdt_cpu_has(int flag); void mon_event_count(void *info); int rdtgroup_mondata_show(struct seq_file *m, void *arg); void mon_event_read(struct rmid_read *rr, struct rdt_resource *r, diff --git a/arch/x86/kernel/cpu/resctrl/monitor.c b/arch/x86/kernel/cpu/resctrl/monitor.c index 77538ab..5665ab9 100644 --- a/arch/x86/kernel/cpu/resctrl/monitor.c +++ b/arch/x86/kernel/cpu/resctrl/monitor.c @@ -763,7 +763,7 @@ static void l3_mon_evt_init(struct rdt_resource *r) list_add_tail(&mbm_local_event.list, &r->evt_list); } -int rdt_get_mon_l3_config(struct rdt_resource *r) +int __init rdt_get_mon_l3_config(struct rdt_resource *r) { unsigned int mbm_offset = boot_cpu_data.x86_cache_mbm_width_offset; struct rdt_hw_resource *hw_res = resctrl_to_arch_res(r);