Received: by 2002:a05:7412:3784:b0:e2:908c:2ebd with SMTP id jk4csp2222881rdb; Tue, 3 Oct 2023 14:19:30 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGzY7+PT2E+2SfXhVWLWvS6GZvjM68ZUkhcQxGstlCfkA6+ytWirpjeqYyKOp9CsVrLL0UE X-Received: by 2002:a17:902:7246:b0:1c5:dfe9:b209 with SMTP id c6-20020a170902724600b001c5dfe9b209mr698794pll.62.1696367969739; Tue, 03 Oct 2023 14:19:29 -0700 (PDT) Return-Path: Received: from howler.vger.email (howler.vger.email. [2620:137:e000::3:4]) by mx.google.com with ESMTPS id x5-20020a170902b40500b001c62b51ac0fsi2184411plr.306.2023.10.03.14.19.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 03 Oct 2023 14:19:29 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) client-ip=2620:137:e000::3:4; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=b9HiIIfF; arc=fail (signature failed); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 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 (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id 16C5C8024604; Tue, 3 Oct 2023 14:19:28 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232084AbjJCVT1 (ORCPT + 99 others); Tue, 3 Oct 2023 17:19:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37846 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232372AbjJCVT0 (ORCPT ); Tue, 3 Oct 2023 17:19:26 -0400 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.9]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C98AAB8 for ; Tue, 3 Oct 2023 14:19:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1696367962; x=1727903962; h=message-id:date:subject:to:cc:references:from: in-reply-to:content-transfer-encoding:mime-version; bh=wYmghnREyGADBnCdXV7hnwtpJ2FWCyybKB5jYjpDIvo=; b=b9HiIIfFor7VqmjKD21YTCAq35zqa/YlAQUFS0W7hEcMrmZjEGAQd8DY PlcxBKG2B6yzQCCjefeThtpUm6VV+UbaCNog+FpfoogYnSzPCaOCKmG1T ARXl3hPX7Le7KKgSXv1pSV7BvP/6dwOE9q7oCEhQ0wSAlgzpYXNc4+O16 3u0277C+5aK2+kR1Hyqyj5qF02NP8NI/lJ5kumjBU0FqCNFlgVdSRrM9U Y097TDKWausEn2TYTcDRQUCCmo3OM3Vxp6DXUK9fYaOO1tqQrKtXrWmIV MTOm/ghL9mvFhO1bnrGzXx0LcFs5JHe9DF4VgaxY9W5gUZdSPKjFXvxAx Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10852"; a="1577381" X-IronPort-AV: E=Sophos;i="6.03,198,1694761200"; d="scan'208";a="1577381" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orvoesa101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Oct 2023 14:19:22 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10852"; a="841505336" X-IronPort-AV: E=Sophos;i="6.03,198,1694761200"; d="scan'208";a="841505336" Received: from orsmsx601.amr.corp.intel.com ([10.22.229.14]) by FMSMGA003.fm.intel.com with ESMTP/TLS/AES256-GCM-SHA384; 03 Oct 2023 14:19:21 -0700 Received: from orsmsx610.amr.corp.intel.com (10.22.229.23) by ORSMSX601.amr.corp.intel.com (10.22.229.14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.32; Tue, 3 Oct 2023 14:19:20 -0700 Received: from orsmsx611.amr.corp.intel.com (10.22.229.24) by ORSMSX610.amr.corp.intel.com (10.22.229.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.32; Tue, 3 Oct 2023 14:19:20 -0700 Received: from ORSEDG602.ED.cps.intel.com (10.7.248.7) by orsmsx611.amr.corp.intel.com (10.22.229.24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.32 via Frontend Transport; Tue, 3 Oct 2023 14:19:14 -0700 Received: from NAM02-SN1-obe.outbound.protection.outlook.com (104.47.57.46) by edgegateway.intel.com (134.134.137.103) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.32; Tue, 3 Oct 2023 14:19:14 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Nu2H0KfQyZBGclL9WFGRCTcUwlIZBbaCehAAqIAzoqBvdSb60raUi8foblvUkpg99ZzNKZ1uDPKGeX0TD97je7iZHmRyFAGbz+PjzOMACefS89bAfkBJoLnyrhXsGdpo+nawFUNkKQuv/NQPdpAhEkO/xG7gTxmYuKEHuhm3XvQ2zm9G5PQlM+9ie1b0ofW7NFeTbDMI1NKQIsBGZW9qDixgT+L4aBmPhqzqhtJrX8NwFT5omZebfpeiHs50T/rBxXT7esYyDjVCs0FtcnHjSc740QNqS2JvJzFKZAZOX/9848WCJYoogQWctVU6iikoFl7cwm7fva8kRkpbzF70mg== 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=czFlKaJWpElfDWQRT1SChGKDm510UO+FmylBUZwA8fQ=; b=Rw9rcTx71ApGbVwNjytneD9GcwtQeQwv64h5ZGs623hBnUkGgGra6VxoRG906q4vKSArpswP3QI6VtIdwWkls3Vzg0ElY/CZ6MaGKNmKfBcLOO+z+v3fbs0PLYQtR/A06sddufOhJjuVHS2kt03XSqEg9aW2jsD2tlFiL3OZtIBWtdTzu7fiZrmu0JtWyT/RnROyu60+MS+kP7/FjY3jVGmiMmkzQGR5H1vzLHJVtWdzMvpxQAUCO3kpOraf7eKtude1vk5mNLik/PnQOC21k3PeiBpSeQNEIs5SA/JAkEisKuX7wPhO+jjYHNLOYKunz7W1C5zmZMhHsHKe7bYNbw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; Received: from SJ2PR11MB7573.namprd11.prod.outlook.com (2603:10b6:a03:4d2::10) by SA1PR11MB7132.namprd11.prod.outlook.com (2603:10b6:806:29e::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6838.26; Tue, 3 Oct 2023 21:19:12 +0000 Received: from SJ2PR11MB7573.namprd11.prod.outlook.com ([fe80::bd70:f215:4a97:c84e]) by SJ2PR11MB7573.namprd11.prod.outlook.com ([fe80::bd70:f215:4a97:c84e%6]) with mapi id 15.20.6838.033; Tue, 3 Oct 2023 21:19:12 +0000 Message-ID: <45ac8c02-5188-9599-ad5a-380197ce7251@intel.com> Date: Tue, 3 Oct 2023 14:19:08 -0700 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Firefox/102.0 Thunderbird/102.15.1 Subject: Re: [PATCH v6 16/24] x86/resctrl: Make resctrl_mounted checks explicit Content-Language: en-US To: James Morse , , CC: Fenghua Yu , Thomas Gleixner , Ingo Molnar , Borislav Petkov , H Peter Anvin , Babu Moger , , D Scott Phillips OS , , , , , , , Jamie Iles , Xin Hao , , , References: <20230914172138.11977-1-james.morse@arm.com> <20230914172138.11977-17-james.morse@arm.com> From: Reinette Chatre In-Reply-To: <20230914172138.11977-17-james.morse@arm.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-ClientProxiedBy: MW4PR04CA0360.namprd04.prod.outlook.com (2603:10b6:303:8a::35) To SJ2PR11MB7573.namprd11.prod.outlook.com (2603:10b6:a03:4d2::10) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ2PR11MB7573:EE_|SA1PR11MB7132:EE_ X-MS-Office365-Filtering-Correlation-Id: 74a1e7cd-6cbd-4e2a-bfbb-08dbc45663a1 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 2i/OOmB7QAoweleCeQuVTIy+x3D+Uh1Dzyb33V7eowERK4v5qRMtMnLvLZqvd5E88mnAsebXgoWanGb+eodB0neXcR3sJdwB0pFLRB7jtgrn1WA8yfgT4R/9IN5LpkfbDviGhJnGKdEIJb9W5j0hve9NXLFU5R1W41EPALCxD0+Pp3t/ukpMlF87F+8V43wjor1dKo4C0bDTwfhsCz4DDJ0tr9n7l94mDsbGydkmq8ZI0LJQPRFbJ4CUrvoxcV+cWcE+PIrSJSxy2B0TwrKSnOnrhag12o/fLDQlb6aTZtP4lqlHct000rFP/mSwk9rcuLdyYKFwiyXtgYoVGdza64WJllWi0ySnO22L8G8QP7d0eGCryU01UEzkShmlpa7sPco8PO3ryUX5GQo3X1uacmO759SEwRA2reFZL3vhWjWidtz86Typv/x/sicoH787ALqZM8ldmPCmD9By/r8PBV0MBiqQs9LbT1X1BWemBnyEn4kh1lCPR8cnBQgka7zKq98avkLJjN6a7s/UKyeGahRgoZi8RdhKdsWWFjlxadoFLfeah8Xv4iWBLgDptAqPh8ullNDqzKWH87VjCL6TkFT56EVWja4BTkXMfB6m72DxVJgDpSkhNPMUb0ChAdKU8QFXEiSdUX+6LE/9PJc2bA== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SJ2PR11MB7573.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(39860400002)(376002)(346002)(396003)(366004)(136003)(230922051799003)(1800799009)(64100799003)(451199024)(186009)(6486002)(53546011)(6512007)(6506007)(478600001)(2616005)(82960400001)(2906002)(7416002)(26005)(41300700001)(316002)(44832011)(66946007)(5660300002)(66556008)(66476007)(8936002)(54906003)(4326008)(8676002)(36756003)(86362001)(38100700002)(31696002)(31686004)(6666004)(45980500001)(43740500002);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?YmJqU3BzczRkSTI4NUVaVmUvOGhVSW03QjJLbWwrMjBSVkpWSWJrRmRjVjI3?= =?utf-8?B?enVQdXlsTnQya0I0RlFhKytMTVlVM3BXVWZ0Wm5lMnN0cE5pTndDWi9OTHlU?= =?utf-8?B?Nkx0Y1puNUxZRDBIUXhNb0thL0NNSXdMcG84NUpsLzh6bm5pWUJqSmJQSk5u?= =?utf-8?B?V2pOTkpQYW5ZR0NXUXRPVUN3ZHAwbG9sVUFhM2d1a3JraVpXWmFaL0J5OHBO?= =?utf-8?B?OTBNVGsvRzBLakVFR0QxblpNc2RrZEdBV2duZGwzSUt2UVdVTUFnMXZ2TnBn?= =?utf-8?B?SnpZa1c5RkxtdHJaR2doWXpzVFN4UUZDV1I5cnVXRWF3a0g1eWVKeFN0aTlY?= =?utf-8?B?YVBoWFY3bzFoNWFUTlAzRGRpYkY0c09hSzA5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aGc9PQ==?= X-MS-Exchange-CrossTenant-Network-Message-Id: 74a1e7cd-6cbd-4e2a-bfbb-08dbc45663a1 X-MS-Exchange-CrossTenant-AuthSource: SJ2PR11MB7573.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Oct 2023 21:19:12.2085 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: wGFENaWPR1D06FRDvGOUly1bY3SDYrzQvX6v6oJhBuE7bMqQLoPMv182GKoXsgOOX5dhRo5CtC74SBei+COzl+0v1bwm9wk2k4CRDQc8YY0= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA1PR11MB7132 X-OriginatorOrg: intel.com X-Spam-Status: No, score=-3.2 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A, RCVD_IN_DNSWL_BLOCKED,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-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Tue, 03 Oct 2023 14:19:28 -0700 (PDT) Hi James, On 9/14/2023 10:21 AM, James Morse wrote: > The rdt_enable_key is switched when resctrl is mounted, and used to > prevent a second mount of the filesystem. It also enables the > architecture's context switch code. > > This requires another architecture to have the same set of static-keys, > as resctrl depends on them too. The existing users of these static-keys > are implicitly also checking if the filesystem is mounted. > > Make the resctrl_mounted checks explicit: resctrl can keep track of > whether it has been mounted once. This doesn't need to be combined with > whether the arch code is context switching the CLOSID. > > rdt_mon_enable_key is never used just to test that resctrl is mounted, > but does also have this implication. Add a resctrl_mounted to all uses > of rdt_mon_enable_key. This will allow rdt_mon_enable_key to be swapped > with a helper in a subsequent patch. > > This will allow the static-key changing to be moved behind resctrl_arch_ > calls. > > Reviewed-by: Shaopeng Tan > Tested-by: Shaopeng Tan > Tested-By: Peter Newman > Signed-off-by: James Morse > > --- Reviewed-by: Reinette Chatre Reinette