[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID:
 <OSZPR01MB87982433DCC67E55C90297F28BFAA@OSZPR01MB8798.jpnprd01.prod.outlook.com>
Date: Wed, 29 Oct 2025 07:24:20 +0000
From: "Shaopeng Tan (Fujitsu)" <tan.shaopeng@...itsu.com>
To: 'James Morse' <james.morse@....com>, "linux-kernel@...r.kernel.org"
	<linux-kernel@...r.kernel.org>, "linux-arm-kernel@...ts.infradead.org"
	<linux-arm-kernel@...ts.infradead.org>, "linux-acpi@...r.kernel.org"
	<linux-acpi@...r.kernel.org>
CC: D Scott Phillips OS <scott@...amperecomputing.com>,
	"carl@...amperecomputing.com" <carl@...amperecomputing.com>,
	"lcherian@...vell.com" <lcherian@...vell.com>, "bobo.shaobowang@...wei.com"
	<bobo.shaobowang@...wei.com>, "baolin.wang@...ux.alibaba.com"
	<baolin.wang@...ux.alibaba.com>, Jamie Iles <quic_jiles@...cinc.com>, Xin Hao
	<xhao@...ux.alibaba.com>, "peternewman@...gle.com" <peternewman@...gle.com>,
	"dfustini@...libre.com" <dfustini@...libre.com>, "amitsinght@...vell.com"
	<amitsinght@...vell.com>, David Hildenbrand <david@...hat.com>, Dave Martin
	<dave.martin@....com>, Koba Ko <kobak@...dia.com>, Shanker Donthineni
	<sdonthineni@...dia.com>, "fenghuay@...dia.com" <fenghuay@...dia.com>,
	"baisheng.gao@...soc.com" <baisheng.gao@...soc.com>, Jonathan Cameron
	<jonathan.cameron@...wei.com>, Rob Herring <robh@...nel.org>, Rohit Mathew
	<rohit.mathew@....com>, Rafael Wysocki <rafael@...nel.org>, Len Brown
	<lenb@...nel.org>, Lorenzo Pieralisi <lpieralisi@...nel.org>, Hanjun Guo
	<guohanjun@...wei.com>, Sudeep Holla <sudeep.holla@....com>, Catalin Marinas
	<catalin.marinas@....com>, Will Deacon <will@...nel.org>, Greg Kroah-Hartman
	<gregkh@...uxfoundation.org>, Danilo Krummrich <dakr@...nel.org>, Jeremy
 Linton <jeremy.linton@....com>, Gavin Shan <gshan@...hat.com>, Lecopzer Chen
	<lecopzerc@...dia.com>, Ben Horgan <ben.horgan@....com>
Subject: RE: [PATCH v3 10/29] arm_mpam: Add cpuhp callbacks to probe MSC
 hardware
> Because an MSC can only by accessed from the CPUs in its cpu-affinity set we
> need to be running on one of those CPUs to probe the MSC hardware.
> 
> Do this work in the cpuhp callback. Probing the hardware will only happen
> before MPAM is enabled, walk all the MSCs and probe those we can reach that
> haven't already been probed as each CPU's online call is made.
> 
> This adds the low-level MSC register accessors.
> 
> Once all MSCs reported by the firmware have been probed from a CPU in their
> respective cpu-affinity set, the probe-time cpuhp callbacks are replaced.  The
> replacement callbacks will ultimately need to handle save/restore of the
> runtime MSC state across power transitions, but for now there is nothing to do
> in them: so do nothing.
> 
> The architecture's context switch code will be enabled by a static-key, this can
> be set by mpam_enable(), but must be done from process context, not a cpuhp
> callback because both take the cpuhp lock.
> Whenever a new MSC has been probed, the mpam_enable() work is scheduled
> to test if all the MSCs have been probed. If probing fails, mpam_disable() is
> scheduled to unregister the cpuhp callbacks and free memory.
> 
> CC: Lecopzer Chen <lecopzerc@...dia.com>
> Signed-off-by: James Morse <james.morse@....com>
> Reviewed-by: Jonathan Cameron <jonathan.cameron@...wei.com>
> Reviewed-by: Ben Horgan <ben.horgan@....com>
> Reviewed-by: Fenghua Yu <fenghuay@...dia.com>
> Reviewed-by: Gavin Shan <gshan@...hat.com>
> Tested-by: Fenghua Yu <fenghuay@...dia.com>
Reviewed-by: Shaopeng Tan <tan.shaopeng@...fujitsu.com>
Powered by blists - more mailing lists
 
