From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.223.130]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 682F3225408 for ; Thu, 25 Sep 2025 09:33:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=195.135.223.130 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1758792787; cv=none; b=tMIzEiZx0jk3g4MyHYzzzIraJzoEAwPIwMTH2qoMGlnqCqQMfrsVCr2UVhDRKmo/Ns92N5eEm1gyNiQRmIpCmCc1xs2eb3fAWQHLLKeegE2q2McgSHiusO9EbyqcqoxlP9jrSuLUa0+hX97etBLSx5KB7FKV3+oSWjjLDg/NX2o= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1758792787; c=relaxed/simple; bh=+r7/EFuu/Z4+g80XOn67kdjppy2mS5EV6emp4qNg3J8=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=nbUomuMW4HsERodLoXVnI5DIFSXuxjfHaEQE0Fs6JzYNf/w4DId0JgJMYA58I/SNOsBpZzMueT0V6lx+kJ/dDVPCyI+sRaaaf7B7nJNNPLwsyIyxT311bGRna+kwn8I9pmoa3CFlwACoqQS7spyRGLX7VDFSXIBQ5tuZHv8YBh4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=suse.de; spf=pass smtp.mailfrom=suse.de; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b=Qn1Wh4DD; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=wes68xN3; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b=Qn1Wh4DD; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=wes68xN3; arc=none smtp.client-ip=195.135.223.130 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=suse.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="Qn1Wh4DD"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="wes68xN3"; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="Qn1Wh4DD"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="wes68xN3" Received: from imap1.dmz-prg2.suse.org (unknown [10.150.64.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 58B454E624; Thu, 25 Sep 2025 09:32:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1758792778; h=from:from:reply-to: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=PktsIKsXT7+WofBjDIwf6iQfwyP9CFogd6p16sia/gQ=; b=Qn1Wh4DDYle+RfyQF6cuLRawJoaacWpKkQtAwZ/8906+o4FSfhGe8DZYISx04MwIHczF+j ttZJdjtHDGEj2vWNED1HKxNXSV1t8HdmX3t/tY8UjvK4Olx1l5V5jcp/Ibz96R6Iz1uhxG yBycnKOlJeZ6swJQXK06LJNE1Tr8Rek= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1758792778; h=from:from:reply-to: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=PktsIKsXT7+WofBjDIwf6iQfwyP9CFogd6p16sia/gQ=; b=wes68xN3HKt4ysa7pijHIcKrJPMnh189kIxorhTj28QtII11L2cPWpE76KIgHVJg5tCczJ K0NHosrQJlpiOJCA== Authentication-Results: smtp-out1.suse.de; none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1758792778; h=from:from:reply-to: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=PktsIKsXT7+WofBjDIwf6iQfwyP9CFogd6p16sia/gQ=; b=Qn1Wh4DDYle+RfyQF6cuLRawJoaacWpKkQtAwZ/8906+o4FSfhGe8DZYISx04MwIHczF+j ttZJdjtHDGEj2vWNED1HKxNXSV1t8HdmX3t/tY8UjvK4Olx1l5V5jcp/Ibz96R6Iz1uhxG yBycnKOlJeZ6swJQXK06LJNE1Tr8Rek= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1758792778; h=from:from:reply-to: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=PktsIKsXT7+WofBjDIwf6iQfwyP9CFogd6p16sia/gQ=; b=wes68xN3HKt4ysa7pijHIcKrJPMnh189kIxorhTj28QtII11L2cPWpE76KIgHVJg5tCczJ K0NHosrQJlpiOJCA== Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 015FE13869; Thu, 25 Sep 2025 09:32:56 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id 8MShOUgM1WjnWwAAD6G6ig (envelope-from ); Thu, 25 Sep 2025 09:32:56 +0000 Message-ID: <3d2252ef-92a2-4717-a472-3e5b275419ce@suse.de> Date: Thu, 25 Sep 2025 12:32:54 +0300 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2 01/29] ACPI / PPTT: Add a helper to fill a cpumask from a processor container To: James Morse , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-acpi@vger.kernel.org Cc: D Scott Phillips OS , carl@os.amperecomputing.com, lcherian@marvell.com, bobo.shaobowang@huawei.com, tan.shaopeng@fujitsu.com, baolin.wang@linux.alibaba.com, Jamie Iles , Xin Hao , peternewman@google.com, dfustini@baylibre.com, amitsinght@marvell.com, David Hildenbrand , Dave Martin , Koba Ko , Shanker Donthineni , fenghuay@nvidia.com, baisheng.gao@unisoc.com, Jonathan Cameron , Rob Herring , Rohit Mathew , Rafael Wysocki , Len Brown , Lorenzo Pieralisi , Hanjun Guo , Sudeep Holla , Catalin Marinas , Will Deacon , Greg Kroah-Hartman , Danilo Krummrich References: <20250910204309.20751-1-james.morse@arm.com> <20250910204309.20751-2-james.morse@arm.com> Content-Language: en-US From: Stanimir Varbanov In-Reply-To: <20250910204309.20751-2-james.morse@arm.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spamd-Result: default: False [-4.30 / 50.00]; BAYES_HAM(-3.00)[100.00%]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_SHORT(-0.20)[-0.997]; MIME_GOOD(-0.10)[text/plain]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; RCVD_TLS_ALL(0.00)[]; RCPT_COUNT_TWELVE(0.00)[33]; MIME_TRACE(0.00)[0:+]; TO_DN_SOME(0.00)[]; FUZZY_RATELIMITED(0.00)[rspamd.com]; MID_RHS_MATCH_FROM(0.00)[]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; FROM_HAS_DN(0.00)[]; R_RATELIMIT(0.00)[to_ip_from(RLj7mp877dpkcx5p1r49fdbjkp)]; FROM_EQ_ENVFROM(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; RCVD_COUNT_TWO(0.00)[2]; DBL_BLOCKED_OPENRESOLVER(0.00)[imap1.dmz-prg2.suse.org:helo] X-Spam-Flag: NO X-Spam-Level: X-Spam-Score: -4.30 Hi James, On 9/10/25 11:42 PM, James Morse wrote: > The ACPI MPAM table uses the UID of a processor container specified in > the PPTT to indicate the subset of CPUs and cache topology that can > access each MPAM System Component (MSC). > > This information is not directly useful to the kernel. The equivalent > cpumask is needed instead. > > Add a helper to find the processor container by its id, then walk > the possible CPUs to fill a cpumask with the CPUs that have this > processor container as a parent. > > CC: Dave Martin > Reviewed-by: Sudeep Holla > Signed-off-by: James Morse > --- > Changes since v1: > * Replaced commit message with wording from Dave. > * Fixed a stray plural. > * Moved further down in the file to make use of get_pptt() helper. > * Added a break to exit the loop early. > > Changes since RFC: > * Removed leaf_flag local variable from acpi_pptt_get_cpus_from_container() > > Changes since RFC: > * Dropped has_leaf_flag dodging of acpi_pptt_leaf_node() > * Added missing : in kernel-doc > * Made helper return void as this never actually returns an error. > --- > drivers/acpi/pptt.c | 83 ++++++++++++++++++++++++++++++++++++++++++++ > include/linux/acpi.h | 3 ++ > 2 files changed, 86 insertions(+) > > + > +/** > + * acpi_pptt_get_cpus_from_container() - Populate a cpumask with all CPUs in a > + * processor container > + * @acpi_cpu_id: The UID of the processor container. > + * @cpus: The resulting CPU mask. > + * > + * Find the specified Processor Container, and fill @cpus with all the cpus > + * below it. > + * > + * Not all 'Processor' entries in the PPTT are either a CPU or a Processor > + * Container, they may exist purely to describe a Private resource. CPUs > + * have to be leaves, so a Processor Container is a non-leaf that has the > + * 'ACPI Processor ID valid' flag set. > + * > + * Return: 0 for a complete walk, or an error if the mask is incomplete. Leftover, drop this. > + */ > +void acpi_pptt_get_cpus_from_container(u32 acpi_cpu_id, cpumask_t *cpus) > +{ > + struct acpi_pptt_processor *cpu_node; > + struct acpi_table_header *table_hdr; > + struct acpi_subtable_header *entry; regards, ~Stan