Received: by 2002:a05:7412:251c:b0:e2:908c:2ebd with SMTP id w28csp1977056rda; Tue, 24 Oct 2023 08:43:06 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHfnNx+uBveyGNzNjKVhQEFY8AvPL7eMYgZFJEXr+IcjvTiOU0wP1FpuvXYdyRsIpC9XgPU X-Received: by 2002:a05:6a20:e109:b0:163:2da1:387f with SMTP id kr9-20020a056a20e10900b001632da1387fmr3903344pzb.50.1698162185772; Tue, 24 Oct 2023 08:43:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698162185; cv=none; d=google.com; s=arc-20160816; b=fqVRgHbc8IBUXIaywRzkMW4RRr+wJxTdvffhPF0VhNH9C/XkGpwj3j+wDvpmXq/Noc 0A4hH6EguelDJi+QwN8JOIPPbLwcAeNhRywtnti6ueOaqBQioIlbmRnYkxMQKmCwU/xU g7TV6pQefM4+Oc4eqUiG/GQlWHg6gw6RHlnq9BQdpW1imLfxCZwSD6IxXjtjA0w0XMo7 JFurUTDrFxF9HylAAKn2ruQY0O/2d/frenTXWsHmGKfmsAjJLyudnt0YA4jXgbzdBGTV 1zJiBPC5O1Maw1itlB4ywK/j0TPuAqwTgMWReemW0yVqeRF9EQiGLPQ2PVM9HiV6mB9b dvSQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:organization:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=Q4Gb9m6ihcBB/+CtvxyCOQvQZrQhZFtK1k8F6tfDTN4=; fh=ypTqfWCncMzTgW9e+QYpxR8FFBLfxgWufBF0DpGRIbo=; b=nJYYG2mGe5SX81EIQZsvGf5tmz0YARdXMuBMGdJdoiI36EEQISSyiKqfkjPq45irZ8 JuIHEOiiZYa9GgB7UxsTXCLIheA4TghO2+fxPnlsWI7h95mjit88CFavDVnGd1CJAu8f PKGOl12BJzPbLTYqwfhL33YseM1JKiAr1ExzVdE+SpLzQPfP47k6tpM9fJQXS9e+uuzs PTNFKs+gMvA04qSLYr4ZCmlorBLClXPuL1AT7J5pAdF0C70cBtOKnhLNvVDkJByWgOAL 0XQVGH8H4s23VNb6mA759l4pj72nk1L+4nNBLrAtaRqoWS5M10Vo3d6s1OGBnyIUZQsx Em7w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=mwVzgn+5; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id t15-20020a63954f000000b0058990e98429si8910342pgn.146.2023.10.24.08.43.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Oct 2023 08:43:05 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=mwVzgn+5; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 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 snail.vger.email (Postfix) with ESMTP id C91E9802B076; Tue, 24 Oct 2023 08:43:04 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1343648AbjJXPnC (ORCPT + 99 others); Tue, 24 Oct 2023 11:43:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35650 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234241AbjJXPnB (ORCPT ); Tue, 24 Oct 2023 11:43:01 -0400 Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.24]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 77D4BA3; Tue, 24 Oct 2023 08:42:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1698162179; x=1729698179; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=TR0MsODDCDld/9hD7QPnERhiZ/gxH5leUiM0oaDfwbI=; b=mwVzgn+5pw/LzBLPCXjnMT/FmEnuYa0rlpvb2Q/bvSJS41OQI5FFi5m7 30Lm3rSBC9e0FfQpUeRG6c4qMqv/ZMSuzsCqpWt4b5+xTtvF8Zsm7ssby YgV3UmamB4JuZScqA1oKNb2B206VpyeclqpO+jogJuoPDqoZIfw7W6AkR 9hGojjKAu8Ul8lM/oIXXNscpb3UGxu51TYb6J1EqFAoBMqq47awDljmGU vwaTo20gJnJPUHvMl3/gZrmAnsc9w/9RcmEUEScs17NH84qaAH6qGl/2P GL6EcdsuJmwYSoo/jDkY1Dv8aDjRjYivDOiRxu53hnDwmC9nDjRjJHQPe w==; X-IronPort-AV: E=McAfee;i="6600,9927,10873"; a="389946496" X-IronPort-AV: E=Sophos;i="6.03,248,1694761200"; d="scan'208";a="389946496" Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Oct 2023 08:36:50 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10873"; a="1089891583" X-IronPort-AV: E=Sophos;i="6.03,248,1694761200"; d="scan'208";a="1089891583" Received: from smile.fi.intel.com ([10.237.72.54]) by fmsmga005.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Oct 2023 08:32:44 -0700 Received: from andy by smile.fi.intel.com with local (Exim 4.97-RC3) (envelope-from ) id 1qvJOa-00000008Jsh-3eUI; Tue, 24 Oct 2023 18:32:40 +0300 Date: Tue, 24 Oct 2023 18:32:40 +0300 From: Andy Shevchenko To: Russell King Cc: linux-pm@vger.kernel.org, loongarch@lists.linux.dev, linux-acpi@vger.kernel.org, linux-arch@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-riscv@lists.infradead.org, kvmarm@lists.linux.dev, x86@kernel.org, linux-csky@vger.kernel.org, linux-doc@vger.kernel.org, linux-ia64@vger.kernel.org, linux-parisc@vger.kernel.org, Salil Mehta , Jean-Philippe Brucker , jianyong.wu@arm.com, justin.he@arm.com, James Morse , Greg Kroah-Hartman , "Rafael J. Wysocki" , Yury Norov , Rasmus Villemoes , Thomas Gleixner , Peter Zijlstra Subject: Re: [PATCH 38/39] cpumask: Add enabled cpumask for present CPUs that can be brought online Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo X-Spam-Status: No, score=-4.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,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 (snail.vger.email [0.0.0.0]); Tue, 24 Oct 2023 08:43:05 -0700 (PDT) On Tue, Oct 24, 2023 at 04:19:24PM +0100, Russell King wrote: > From: James Morse > > The 'offline' file in sysfs shows all offline CPUs, including those > that aren't present. User-space is expected to remove not-present CPUs > from this list to learn which CPUs could be brought online. > > CPUs can be present but not-enabled. These CPUs can't be brought online > until the firmware policy changes, which comes with an ACPI notification > that will register the CPUs. > > With only the offline and present files, user-space is unable to > determine which CPUs it can try to bring online. Add a new CPU mask > that shows this based on all the registered CPUs. ... > +static ssize_t print_cpus_enabled(struct device *dev, > + struct device_attribute *attr, char *buf) > +{ > + return sysfs_emit(buf, "%*pbl\n", cpumask_pr_args(cpu_enabled_mask)); > +} > +static DEVICE_ATTR(enabled, 0444, print_cpus_enabled, NULL); Hmm... DEVICE_ATTR_RO() ? -- With Best Regards, Andy Shevchenko