Received: by 2002:ab2:1c04:0:b0:1f7:53ba:1ebe with SMTP id f4csp48959lqg; Fri, 26 Apr 2024 08:26:48 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVa50/k38KPCpzHWmnSH1AfoPXsD/aY/LjUF4cMx4o0OEgs5HqrLUFncah1ossIVkv7POeLxF11bDarRq+9vp7Qq6+qY9/u3N5o7j5HgA== X-Google-Smtp-Source: AGHT+IHN25L5QC5VCfqaJr/5Vg48VeSnwX3HW1Pgk4obwQdXyIwZCrmK2e+YtAjTFxdkKzmWwMdn X-Received: by 2002:a05:6300:808d:b0:1aa:48d1:2144 with SMTP id ap13-20020a056300808d00b001aa48d12144mr3172123pzc.52.1714145208250; Fri, 26 Apr 2024 08:26:48 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714145208; cv=pass; d=google.com; s=arc-20160816; b=Bn99Q5LBg6bLijnq1aZtEPd7phDYN1u5iohbB1m/EvBP1WOzqhoRGGbSHfAbwOEbZU u/96muwA+Fs+c3x/epQYLy1RApbvc2+8qZ1XChHnRDAV5jdRw76ZDcXGOotojboR42ys sU6ebrr7zfBumAXH/7rHqa93zdCHU6m4/GyqbQDAgOv8V6JLMmeSaEuSweY8Xs14nHu6 gJsx+DzmqtyybHlpOGL6KU7g1p9YT1eD3ZtgNQl4weEUrD6lApScBweXZq/jflBqGKgI 7AZP6eiGgku6nwYFVJUR0Zuk63of0LGTErHVzxBPR6c5bPUIEMuSyIidhFxZ3HCV43Th QXPw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from; bh=zX5w846arQ0HP77pfIxT5V9w7WHX5V8WQdrIONg25QQ=; fh=Vo4MxA0u7CmSKYL/GjcyKHwusyvU+nKR43bqJem+vcY=; b=rccYrtXYYZpUtfWo496sfc0zkFgZkElVeQKlFAoPk09FArKwoHwNx4uXL8/p2yII4Z DSItN1mgw+zTkjE20J8PCB47wrnFlCKKyt5HLybSsTw1hQUzFP5pTk33vXG1few3Nacp C52aqGLrQjgIaNwSbnpZ4yBBmBsfJCp2QmvY0SFUf+nIcj/H+shKNzd1qrZ+k3OlU4GD 7LSX935V5hVyJglfRYrloGnx3cxbEY2cQUIPkp+Okwn4hFZVhSuUAGtSTTx8t5DuoNHM c3ZC2CpGZ+4u5nLk3SbvrvqIa+06I6+Y5BkxKiBGq+yYM9sT0sjPCiiOPeyetIWN1EDt YBsw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=arm.com dmarc=pass fromdomain=arm.com); spf=pass (google.com: domain of linux-kernel+bounces-160246-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-160246-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id g27-20020a63565b000000b005f8074174fdsi12039569pgm.6.2024.04.26.08.26.47 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 26 Apr 2024 08:26:48 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-160246-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=arm.com dmarc=pass fromdomain=arm.com); spf=pass (google.com: domain of linux-kernel+bounces-160246-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-160246-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 4BCF0B25D34 for ; Fri, 26 Apr 2024 15:16:02 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 8C77B14D433; Fri, 26 Apr 2024 15:10:42 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A0E47172764 for ; Fri, 26 Apr 2024 15:10:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.140.110.172 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714144242; cv=none; b=h0HJv43Pd1xV0xy83LDzasYx8OZkeVQutehYJ5L4Yn/XhRBJ1LPUpBySYZxASRqNGQNeeq0yFzERveL6XrCc/qgrNflSiMFh40kC+k4aR/2VCD3rbryLZRk4wQc/yrUQ3RR+8rj1zko+oTrXz5z1A8F2Yp1oYS0gVbD3DRJfmgE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714144242; c=relaxed/simple; bh=OGiTs/KIXjacKSEoGZnK1rlWP0YeiH50gfXOkRW64y0=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=M/gZbHp0/xGvE2Ujvk1TCv/kfslOhG48Y236xCZxG2kQgV9uNX16x0l0+lWaTVyEenFzAEbSbAtzH3B2rvT3rwEiIhknmhhEFZRNyJNG0N/ljYdtTpPwvHQT/kyDbzoYyPnpWO30g1zj2xy+cXY6LxEty3huJzr745kUGm4rfjU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com; spf=pass smtp.mailfrom=arm.com; arc=none smtp.client-ip=217.140.110.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=arm.com Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 0DDFB1596; Fri, 26 Apr 2024 08:11:08 -0700 (PDT) Received: from e133380.cambridge.arm.com (e133380.arm.com [10.1.197.52]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 29F3C3F73F; Fri, 26 Apr 2024 08:10:37 -0700 (PDT) From: Dave Martin To: x86@kernel.org, linux-kernel@vger.kernel.org Cc: James Morse , Fenghua Yu , Reinette Chatre , Thomas Gleixner , Ingo Molnar , Borislav Petkov , H Peter Anvin , Babu Moger , shameerali.kolothum.thodi@huawei.com, D Scott Phillips OS , carl@os.amperecomputing.com, lcherian@marvell.com, bobo.shaobowang@huawei.com, "Shaopeng Tan (Fujitsu)" , baolin.wang@linux.alibaba.com, Jamie Iles , Xin Hao , Peter Newman , dfustini@baylibre.com, amitsinght@marvell.com, David Hildenbrand , Rex Nie Subject: [PATCH v2 28/35] x86/resctrl: Drop __init/__exit on assorted symbols Date: Fri, 26 Apr 2024 16:08:57 +0100 Message-Id: <20240426150904.8854-28-Dave.Martin@arm.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240426150904.8854-1-Dave.Martin@arm.com> References: <20240426150537.8094-1-Dave.Martin@arm.com> <20240426150904.8854-1-Dave.Martin@arm.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: James Morse Because ARM's MPAM controls are probed using MMIO, resctrl can't be initialised until enough CPUs are online to have determined the system-wide supported num_closid. Arm64 also supports 'late onlined secondaries', where only a subset of CPUs are online during boot. These two combine to mean the MPAM driver may not be able to initialise resctrl until user-space has brought 'enough' CPUs online. To allow MPAM to initialise resctrl after __init text has been free'd, remove all the __init markings from resctrl. The existing __exit markings cause these functions to be removed by the linker as it has never been possible to build resctrl as a module. MPAM has an error interrupt which causes the driver to reset and disable itself. Remove the __exit markings to allow the MPAM driver to tear down resctrl when an error occurs. Signed-off-by: James Morse --- arch/x86/kernel/cpu/resctrl/internal.h | 2 +- arch/x86/kernel/cpu/resctrl/monitor.c | 4 ++-- arch/x86/kernel/cpu/resctrl/rdtgroup.c | 8 ++++---- include/linux/resctrl.h | 4 ++-- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/arch/x86/kernel/cpu/resctrl/internal.h b/arch/x86/kernel/cpu/resctrl/internal.h index 3a3962736061..56218193a8ba 100644 --- a/arch/x86/kernel/cpu/resctrl/internal.h +++ b/arch/x86/kernel/cpu/resctrl/internal.h @@ -457,7 +457,7 @@ void closid_free(int closid); int alloc_rmid(u32 closid); void free_rmid(u32 closid, u32 rmid); int rdt_get_mon_l3_config(struct rdt_resource *r); -void __exit resctrl_mon_resource_exit(void); +void resctrl_mon_resource_exit(void); bool rdt_cpu_has(int flag); void mon_event_count(void *info); int rdtgroup_mondata_show(struct seq_file *m, void *arg); diff --git a/arch/x86/kernel/cpu/resctrl/monitor.c b/arch/x86/kernel/cpu/resctrl/monitor.c index e6aefed3225b..88634a5bef75 100644 --- a/arch/x86/kernel/cpu/resctrl/monitor.c +++ b/arch/x86/kernel/cpu/resctrl/monitor.c @@ -954,7 +954,7 @@ static int dom_data_init(struct rdt_resource *r) return err; } -static void __exit dom_data_exit(struct rdt_resource *r) +static void dom_data_exit(struct rdt_resource *r) { if (!r->mon_capable) return; @@ -1076,7 +1076,7 @@ int __init rdt_get_mon_l3_config(struct rdt_resource *r) return 0; } -void __exit resctrl_mon_resource_exit(void) +void resctrl_mon_resource_exit(void) { struct rdt_resource *r = resctrl_arch_get_resource(RDT_RESOURCE_L3); diff --git a/arch/x86/kernel/cpu/resctrl/rdtgroup.c b/arch/x86/kernel/cpu/resctrl/rdtgroup.c index 2516b0707269..e78fa33c87e2 100644 --- a/arch/x86/kernel/cpu/resctrl/rdtgroup.c +++ b/arch/x86/kernel/cpu/resctrl/rdtgroup.c @@ -2067,7 +2067,7 @@ static struct rftype *rdtgroup_get_rftype_by_name(const char *name) return NULL; } -static void __init thread_throttle_mode_init(void) +static void thread_throttle_mode_init(void) { struct rdt_resource *r = resctrl_arch_get_resource(RDT_RESOURCE_MBA); struct rftype *rft; @@ -3999,7 +3999,7 @@ static void rdtgroup_destroy_root(void) rdtgroup_default.kn = NULL; } -static void __init rdtgroup_setup_default(void) +static void rdtgroup_setup_default(void) { mutex_lock(&rdtgroup_mutex); @@ -4192,7 +4192,7 @@ void resctrl_offline_cpu(unsigned int cpu) * * Return: 0 on success or -errno */ -int __init resctrl_init(void) +int resctrl_init(void) { int ret = 0; @@ -4246,7 +4246,7 @@ int __init resctrl_init(void) return ret; } -void __exit resctrl_exit(void) +void resctrl_exit(void) { debugfs_remove_recursive(debugfs_resctrl); unregister_filesystem(&rdt_fs_type); diff --git a/include/linux/resctrl.h b/include/linux/resctrl.h index 329f68db38e1..189e6dbce33c 100644 --- a/include/linux/resctrl.h +++ b/include/linux/resctrl.h @@ -404,7 +404,7 @@ void resctrl_arch_reset_rmid_all(struct rdt_resource *r, struct rdt_domain *d); extern unsigned int resctrl_rmid_realloc_threshold; extern unsigned int resctrl_rmid_realloc_limit; -int __init resctrl_init(void); -void __exit resctrl_exit(void); +int resctrl_init(void); +void resctrl_exit(void); #endif /* _RESCTRL_H */ -- 2.34.1