From: Andre Przywara <andre.przywara@arm.com>
To: Jonathan Cameron <jic23@kernel.org>
Cc: Lorenzo Pieralisi <lpieralisi@kernel.org>,
Hanjun Guo <guohanjun@huawei.com>,
Sudeep Holla <sudeep.holla@kernel.org>,
Catalin Marinas <catalin.marinas@arm.com>,
Will Deacon <will@kernel.org>,
"Rafael J . Wysocki" <rafael@kernel.org>,
Len Brown <lenb@kernel.org>, James Morse <james.morse@arm.com>,
Ben Horgan <ben.horgan@arm.com>,
Reinette Chatre <reinette.chatre@intel.com>,
Fenghua Yu <fenghuay@nvidia.com>,
Srivathsa L Rao <srivathsa.rao@oss.qualcomm.com>,
Ganapatrao Kulkarni <ganapatrao.kulkarni@oss.qualcomm.com>,
Trilok Soni <tsoni@quicinc.com>,
Srinivas Ramana <sramana@qti.qualcomm.com>,
Niyas Sait <niyas.sait@arm.com>, Lee Trager <lee@trager.us>,
linux-acpi@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v4 08/10] arm_mpam: add MPAM-Fb MSC firmware access support
Date: Wed, 29 Jul 2026 10:07:12 +0200 [thread overview]
Message-ID: <2eaa5334-5677-4b52-9459-63005cfcc23f@arm.com> (raw)
In-Reply-To: <20260728002252.77064c3b@jic23-huawei>
Hi Jonathan,
On 7/28/26 01:22, Jonathan Cameron wrote:
> On Thu, 23 Jul 2026 17:54:52 +0200
> Andre Przywara <andre.przywara@arm.com> wrote:
>
>> The Arm MPAM Firmware-backed (Fb) Profile document[1] describes an
>> alternative way of accessing the "Memory System Components" (MSC) in an
>> MPAM enabled system.
>>
>> Normally the MSCs are MMIO mapped, but in some implementations this
>> might not be possible (MSC located outside of the local socket, MSC
>> mapped secure-only) or desirable (direct MMIO access too slow or needs
>> to be mediated through a control processor). MPAM-fb standardises a
>> protocol to abstract MSC accesses, building on the SCMI protocol.
>>
>> Add functions that do an MSC read or write access by redirecting the
>> request through a firmware interface. For now this done via an ACPI
>> PCC shared memory and mailbox combination.
>>
>> Since the protocol used is only a small subset of the full SCMI spec,
>> and the SCMI protocol has no full ACPI support anyway, open-code the
>> (simple) SCMI message generation, for just the fields we need.
>>
>> [1] https://developer.arm.com/documentation/den0144/latest
>>
>> Signed-off-by: Andre Przywara <andre.przywara@arm.com>
> Just a couple of suggestions that you can ignore if you like
>
> Reviewed-by: Jonathan Cameron <jonathan.cameron@oss.qualcomm.com>
Thanks!
>
>> diff --git a/drivers/resctrl/mpam_fb.c b/drivers/resctrl/mpam_fb.c
>> new file mode 100644
>> index 000000000000..ec4bf0dd9182
>> --- /dev/null
>> +++ b/drivers/resctrl/mpam_fb.c
>> @@ -0,0 +1,197 @@
>> +// SPDX-License-Identifier: GPL-2.0
>> +// Copyright (C) 2024 Arm Ltd.
>
> Arm has either been working on this for rather a long time or that's a cut
> and paste. Even if 2024 is a good start given changes during revisions
> seems reasonable to include 2026 as well.
===================
Date: Tue May 21 11:26:16 2024 +0100
firmware: arm_scmi: add MPAM-FB SCMI protocol stub
========================
So yes, it's been in the making for a while, although in a different
shape and form.
But will surely add the current year to the range.
>> +struct mpam_fb_read_payload {
>> + u32 msc_id;
>> + u32 flags;
>> + u32 reg_offset;
>> +} __packed;
>> +
>> +struct mpam_fb_write_payload {
>
> Given these are only used in the specific functions that build the
> messages you could move the structure definitions to be local to those
> functions.
>
> Alternatively you could move all these to the header and get the advantage
> of using a union to get the maximum message size rather than a number
> currently picked out of the air.
A union sounds nice, but it feels a bit over the top, and I think
keeping the structs local to their users trumps this. After all this is
what mpam_fb.c does: deal with the protocol internals, without bothering
the rest of the code.
>
>> + u32 msc_id;
>> + u32 flags;
>> + u32 reg_offset;
>> + u32 value;
>> +} __packed;
>
>
>
>> diff --git a/drivers/resctrl/mpam_internal.h b/drivers/resctrl/mpam_internal.h
>> index b3a6ed9ed175..e4686ff0ba2e 100644
>> --- a/drivers/resctrl/mpam_internal.h
>> +++ b/drivers/resctrl/mpam_internal.h
>
> ...
>
>> +#define MPAM_FB_PROT_HEADER_LEN sizeof(u32)
>> +#define MPAM_FB_MAX_MSG_SIZE (MPAM_FB_PROT_HEADER_LEN + 4 * sizeof(u32))
>
> Doesn't seem to be used until patch 10. Might be more sensible to bring it
> in there. A spec reference might also be good for this. I think longest
> is current the MPAM_MSC_WRITE. A note above that one option would be
> to make this explicit by having the message structure definitions in this
> header.
Yes, but I will not boil the ocean, and just add a comment.
Thanks,
Andre
next prev parent reply other threads:[~2026-07-29 8:07 UTC|newest]
Thread overview: 51+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-23 15:54 [PATCH v4 00/10] arm_mpam: Add MPAM-Fb firmware support Andre Przywara
2026-07-23 15:54 ` [PATCH v4 01/10] arm_mpam: let low level MSC accessors return an error Andre Przywara
2026-07-27 22:12 ` Jonathan Cameron
2026-07-28 15:35 ` Andre Przywara
2026-07-23 15:54 ` [PATCH v4 02/10] arm_mpam: propagate MSC access errors for hw_probe functions Andre Przywara
2026-07-27 22:21 ` Jonathan Cameron
2026-07-23 15:54 ` [PATCH v4 03/10] arm_mpam: propagate MSC access errors for MBWU counters Andre Przywara
2026-07-27 22:37 ` Jonathan Cameron
2026-07-23 15:54 ` [PATCH v4 04/10] arm_mpam: propagate MSC access errors for msmon helpers Andre Przywara
2026-07-27 22:41 ` Jonathan Cameron
2026-07-23 15:54 ` [PATCH v4 05/10] arm_mpam: propagate MSC access errors for __ris_msmon_read() Andre Przywara
2026-07-24 10:02 ` Sudeep Holla
2026-07-24 11:17 ` Andre Przywara
2026-07-24 12:19 ` Sudeep Holla
2026-07-27 22:44 ` Jonathan Cameron
2026-07-23 15:54 ` [PATCH v4 06/10] arm_mpam: propagate MSC access errors for state saving function Andre Przywara
2026-07-24 10:07 ` Sudeep Holla
2026-07-24 11:19 ` Andre Przywara
2026-07-24 12:27 ` Sudeep Holla
2026-07-24 16:43 ` Ben Horgan
2026-07-27 22:51 ` Jonathan Cameron
2026-07-28 8:43 ` Ben Horgan
2026-07-27 22:46 ` Jonathan Cameron
2026-07-23 15:54 ` [PATCH v4 07/10] arm_mpam: prepare mon_sel locking for MPAM-Fb Andre Przywara
2026-07-24 16:56 ` Ben Horgan
2026-07-23 15:54 ` [PATCH v4 08/10] arm_mpam: add MPAM-Fb MSC firmware access support Andre Przywara
2026-07-24 9:55 ` Sudeep Holla
2026-07-24 11:17 ` Andre Przywara
2026-07-24 12:22 ` Sudeep Holla
2026-07-24 17:08 ` Ben Horgan
2026-07-24 18:03 ` Sudeep Holla
2026-07-28 12:27 ` Andre Przywara
2026-07-28 16:04 ` Andre Przywara
2026-07-27 23:22 ` Jonathan Cameron
2026-07-29 8:07 ` Andre Przywara [this message]
2026-07-28 6:27 ` Srivathsa L Rao
2026-07-28 16:19 ` Andre Przywara
[not found] ` <20260728100421.4047928-1-ritwick.sharma@arm.com>
2026-07-28 10:24 ` Andre Przywara
2026-07-23 15:54 ` [PATCH v4 09/10] arm_mpam: prevent MPAM-Fb accesses inside IRQ handler Andre Przywara
2026-07-24 16:52 ` Ben Horgan
2026-07-23 15:54 ` [PATCH v4 10/10] arm_mpam: detect and enable MPAM-Fb PCC support Andre Przywara
2026-07-24 10:18 ` Sudeep Holla
2026-07-27 12:48 ` Lorenzo Pieralisi
2026-07-27 13:20 ` Sudeep Holla
2026-07-27 13:33 ` Lorenzo Pieralisi
2026-07-27 13:39 ` Sudeep Holla
2026-07-27 13:39 ` Andre Przywara
2026-07-27 16:27 ` Srivathsa L Rao
2026-07-27 23:36 ` Jonathan Cameron
2026-07-29 8:56 ` Ben Horgan
2026-07-29 9:21 ` Andre Przywara
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=2eaa5334-5677-4b52-9459-63005cfcc23f@arm.com \
--to=andre.przywara@arm.com \
--cc=ben.horgan@arm.com \
--cc=catalin.marinas@arm.com \
--cc=fenghuay@nvidia.com \
--cc=ganapatrao.kulkarni@oss.qualcomm.com \
--cc=guohanjun@huawei.com \
--cc=james.morse@arm.com \
--cc=jic23@kernel.org \
--cc=lee@trager.us \
--cc=lenb@kernel.org \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lpieralisi@kernel.org \
--cc=niyas.sait@arm.com \
--cc=rafael@kernel.org \
--cc=reinette.chatre@intel.com \
--cc=sramana@qti.qualcomm.com \
--cc=srivathsa.rao@oss.qualcomm.com \
--cc=sudeep.holla@kernel.org \
--cc=tsoni@quicinc.com \
--cc=will@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox