From patchwork Fri Nov 4 20:00:36 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Moger, Babu" X-Patchwork-Id: 15776 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp610053wru; Fri, 4 Nov 2022 13:03:06 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7csBVOxM1aPYH8nX4yCEYSHnry8r87gTp+n1Xa4W+7tL90dDvT7WnVxIrzUQoSCDNUGtHz X-Received: by 2002:a17:90a:1690:b0:212:f865:4f0e with SMTP id o16-20020a17090a169000b00212f8654f0emr56684240pja.197.1667592186405; Fri, 04 Nov 2022 13:03:06 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1667592186; cv=pass; d=google.com; s=arc-20160816; b=zch8qwf4bd7CUYQB5gSmlhZxVXkqFPIMJKTf7m1GQ7IxKyXNBgQApTPEPns/R2wTVb i/ry39Sv/AhT28isjApVAaz2mDbvfeuokORtOotXZiZl1yNMDeyI8wTez/9KjrRSW4CL xYH2XSTNA/acDEuk5/W3aMw7QJri0VrF9/j+1gZCSdCI7tqkOhsEr+41H43yeUOgBLbC prWhb0Kwk3/bKwZM5hE37lnIu0UZJIUYPds/+zrBTDyJewamrfThzkd8u59M/Cg7w3FI GoAknIdcrORPvPGklomFbZ8tlO9ksMzCQhGe31QmsGuu6bLCPCSmctyiqvYVwjszSThG uHgw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:cc:to:from :subject:dkim-signature; bh=qUNml/GcRC1L5UbtzmycKFoVbdM/W6e2kLFg/9v8EUQ=; b=zrQCwJgCwvRB/sDAcOJWAn8y9yPSTKUxlyjTAk59IFWEbc1c+E49lgUNLN+bbV2jK0 UZ5xUe9B9lmFWEQ001ne80yvQT+p6C2gPWWpkgGcqRmbTc7PPmUkOwny151ItYwvD4uP aUkvENKdH5VWeJJ/4eEbOhtTSmnbNq8rjMwmzgGn40JJmSVOl3d4IX0JM6NhrSX4vwRD f2TleSLItGvPQkilJBZDU4bf31AmdrWiq3o+YJwfDHiKglWqbFKzQWSgsyUGdvRopfSv 04sa6xnArsOyLtiyfwL6lc/07AhVnc6yovXdpLXKKyPibaXm5UHQz/neLoyv5QmHXnaL Dndw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=SBNr7Na3; arc=pass (i=1 spf=pass spfdomain=amd.com dmarc=pass fromdomain=amd.com); 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amd.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h11-20020a056a001a4b00b0056be3109462si109804pfv.163.2022.11.04.13.02.51; Fri, 04 Nov 2022 13:03:06 -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=@amd.com header.s=selector1 header.b=SBNr7Na3; arc=pass (i=1 spf=pass spfdomain=amd.com dmarc=pass fromdomain=amd.com); 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amd.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229553AbiKDUA4 (ORCPT + 99 others); Fri, 4 Nov 2022 16:00:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48028 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229853AbiKDUAn (ORCPT ); Fri, 4 Nov 2022 16:00:43 -0400 Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12on2073.outbound.protection.outlook.com [40.107.237.73]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6DEED45A27; Fri, 4 Nov 2022 13:00:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=DUF15wbMHz57uMBdB4UM76cmLoCrjgAhEjxpkKeFCxTZaiWKlyBTd5vAzhxl0Odn6UDJPH3wRIboA22DL529Ofsz0D/sst3489G82nYgopL09dN9vMnLq3exdrLDIRht8/cPZSx4PcKqBs1I6ilEsJe/UcGAjOaOTbVoVnbCBiaefP5ZsdP6cbO+l/Jk9l2yzZcgQ+En2uZt4d37mWLw+z7niJI+EbYTCYHMZXjLPY4VlcX2q5cKYVbQvTp6oL+5aQpPYuZh8utZwSBD9J/tITEGrXreg2TAPsIgd7ZEyKml96gfrKPtRpqJMNEt3B37HRk8gZEaePdB4Hk+mKCY9g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=qUNml/GcRC1L5UbtzmycKFoVbdM/W6e2kLFg/9v8EUQ=; b=DwnMmyKMcKLFpqtHgezYjAXweBfk6QzloWuCQESlXyHS+FG1EWYPIs43Oj7/xHXfjRvp1Ig3YmNenduorXlXS9er8WQf9q/H+kRHqZMFU66CaGIppFVMnai5E16NLeJwDsyV8dpMlH7U4eId1LIJi+nWbfRtB20OXidWmsmo1PcNBw/GCbtMbJMplgwhHPlocZalYk9I2g8HbwYNvJUy9Pl9m0BQc++uBdr5yux/+wKS4VwM5OHSCHB3eDNDOiptXyuSQUckqcaStlcH2Cr29ZqKn0A+tXx3qVu50+8riajH+V67N9XBNUGzR+T0/HhbcgYcHZ4ZphPcYgMP3Msp2g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=quicinc.com smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=qUNml/GcRC1L5UbtzmycKFoVbdM/W6e2kLFg/9v8EUQ=; b=SBNr7Na3r74zjNGDPy8uSeUkrB+ykuCJuctecj6ZbVCDfflFBmuEEKw7sy16edc9MaSkVuPY/c6fXh6jv/CqibQXIrsEWzoZRWHWjBcKAmd3EYtBK5pXSUC4AOWx6zHdIXRq95k4fQe7Q4fNey5O3omKarpU+hMaHBj2vfdOhyI= Received: from DM6PR10CA0026.namprd10.prod.outlook.com (2603:10b6:5:60::39) by CH3PR12MB7644.namprd12.prod.outlook.com (2603:10b6:610:14f::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5791.22; Fri, 4 Nov 2022 20:00:39 +0000 Received: from DM6NAM11FT031.eop-nam11.prod.protection.outlook.com (2603:10b6:5:60:cafe::bc) by DM6PR10CA0026.outlook.office365.com (2603:10b6:5:60::39) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5791.22 via Frontend Transport; Fri, 4 Nov 2022 20:00:39 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by DM6NAM11FT031.mail.protection.outlook.com (10.13.172.203) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5791.20 via Frontend Transport; Fri, 4 Nov 2022 20:00:38 +0000 Received: from [127.0.1.1] (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Fri, 4 Nov 2022 15:00:36 -0500 Subject: [PATCH v8 06/13] x86/resctrl: Remove the init attribute for rdt_cpu_has() From: Babu Moger To: , , , , CC: , , , , , , , , , , , , , , , , , , , , , , , , Date: Fri, 4 Nov 2022 15:00:36 -0500 Message-ID: <166759203614.3281208.12929995949176975687.stgit@bmoger-ubuntu> In-Reply-To: <166759188265.3281208.11769277079826754455.stgit@bmoger-ubuntu> References: <166759188265.3281208.11769277079826754455.stgit@bmoger-ubuntu> User-Agent: StGit/1.1.dev103+g5369f4c MIME-Version: 1.0 X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB04.amd.com (10.181.40.145) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM6NAM11FT031:EE_|CH3PR12MB7644:EE_ X-MS-Office365-Filtering-Correlation-Id: bd087f91-cbd0-413d-a2ef-08dabe9f3ee4 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: HC7mWgj+EayOjw949XOVElJrgd/eLdAUzGDbFzbTOt76KfcpDgCW8yFwzMauYiyCtE0UwXeG15CtW0+oXTlCh5xW7ffEowDk2wL2L+W9NuqTTGus2apRJbfAMNWbeYZfoYJwS1ja+b7SIurw2YbMZ43fYWz9gaH/Swo4S/Ikpctrpbit2+EtsdKQMYGIUSUdq0h7T3mod5ylPdWLcRpFIQYznMpva6fCaSff6Rs0zIw31iJ2YK/EiRVeleuqGdPzCeQNLBikmk7p+lXA4gIttwaMS+Bqir23mNRQXHvjBOsjCYACa7P/OXEeCmU+jEZqdQrTc9LtGjJ/p90jGeSOA9yfI75nmPu+68+RF1Vu0wdiIJVwnaSzREnyxgqz8MXnOTT2nJSyyVRqeP4q9EXUYgtz1pLSu16S16zpWaWpgYc8QOV5aN8xEXzL9GuhMlnIsRUCK6J5W1TYnM/Xr6qEYx5gkpnOeOM3K54MNNB9+8Q7PUZgRD3LLczYNJ6GcQQ6osx/YBuN39jUiAo85SaHZ3X+xrP+CWuhGtI0b+jYuyrgWKO1IK8ely087vcCEpRgh/b42zWoOGWUMkFhps8RFRmj3dUkj5/zvacPOOf5r6vJtrLbAmKRrwOiIkM0kVjij7mbbxuUbHn7DdvIhY1WFl5ck1Me/dPJOElwaT4d6ZSbZfk0FsTDtV00Cns7F/1kSggMzAR7lkadPHk1Hor9zQ5Y3/EHiLzcPAOhqyhfVXxTXXFJrlQ+k2HFw+PBdX0IhcHPFasIzFjAxeGuW5gPvgTpCjWwRJrQkGJkEUcGf50CQ/mXfhOIvirg2k88tuIBhyxHMnmF5eEcCxKm+esMeA== X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230022)(4636009)(7916004)(376002)(39860400002)(346002)(396003)(136003)(451199015)(40470700004)(46966006)(36840700001)(16526019)(426003)(9686003)(186003)(83380400001)(336012)(26005)(47076005)(2906002)(82310400005)(40460700003)(70206006)(4326008)(7416002)(70586007)(478600001)(82740400003)(8676002)(36860700001)(81166007)(44832011)(103116003)(40480700001)(8936002)(41300700001)(5660300002)(316002)(86362001)(356005)(54906003)(110136005)(16576012)(33716001)(71626007)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Nov 2022 20:00:38.9970 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: bd087f91-cbd0-413d-a2ef-08dabe9f3ee4 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: DM6NAM11FT031.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH3PR12MB7644 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,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?1748597144462622465?= X-GMAIL-MSGID: =?utf-8?q?1748597144462622465?= The monitor code in resctrl/monitor.c needs to call rdt_cpu_has() to detect the monitor related features. It has the init attribute and cannot be called in non-init routines. Remove the init attribute and make it available for all the resctrl files. Signed-off-by: Babu Moger --- arch/x86/kernel/cpu/resctrl/core.c | 4 ++-- arch/x86/kernel/cpu/resctrl/internal.h | 1 + 2 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 6571d08e2b0d..b33a541f5c80 100644 --- a/arch/x86/kernel/cpu/resctrl/core.c +++ b/arch/x86/kernel/cpu/resctrl/core.c @@ -688,7 +688,7 @@ struct rdt_options { bool force_off, force_on; }; -static struct rdt_options rdt_options[] __initdata = { +static struct rdt_options rdt_options[] = { RDT_OPT(RDT_FLAG_CMT, "cmt", X86_FEATURE_CQM_OCCUP_LLC), RDT_OPT(RDT_FLAG_MBM_TOTAL, "mbmtotal", X86_FEATURE_CQM_MBM_TOTAL), RDT_OPT(RDT_FLAG_MBM_LOCAL, "mbmlocal", X86_FEATURE_CQM_MBM_LOCAL), @@ -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 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 16e3c6e03c79..e30e8b23f6b5 100644 --- a/arch/x86/kernel/cpu/resctrl/internal.h +++ b/arch/x86/kernel/cpu/resctrl/internal.h @@ -499,6 +499,7 @@ int rdtgroup_kn_mode_restore(struct rdtgroup *r, const char *name, umode_t mask); struct rdt_domain *rdt_find_domain(struct rdt_resource *r, int id, struct list_head **pos); +bool rdt_cpu_has(int flag); ssize_t rdtgroup_schemata_write(struct kernfs_open_file *of, char *buf, size_t nbytes, loff_t off); int rdtgroup_schemata_show(struct kernfs_open_file *of,