From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id EEA68C53219 for ; Wed, 29 Jul 2026 08:07:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: Content-Type:In-Reply-To:From:References:Cc:To:Subject:MIME-Version:Date: Message-ID:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=rVmfuxGQAbsjKlDU5GQ3A3OdPgAdkHWkiIgYGbY8YHs=; b=xxwX+JouswhJtCMc/WSCn46jJ2 fbR7ZE6DjIYUVObo0H4O9iGfWJ3zV1U1qfWVOGZsoo3VyasyfV3zeO4lOVq0IS0pUXgErtzPKXJ58 6j2KYFqw9j4TH8dqTzwdvNH5TZK1i2mF4KOF6SozLk+bLsu1hZ+ubR6PLJMyeox4lxY/T+UXe+RGK cYGxGPSG79tkSSP8wiktdIeDWjvVYIvFXHTcWyXI7vasap6PCyb0RR6OlMQQy2RL1sgdRRF1CArMV MXNqEtmilvdNAdFKtdsj3QKMchms2iMKg2SGaPIvRtCmb2GiGTpe9083Ujfpjn78CRoASlUrqcD8z 3iUYr5UA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.99.1 #2 (Red Hat Linux)) id 1wozJy-00000007CV6-004k; Wed, 29 Jul 2026 08:07:23 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.99.1 #2 (Red Hat Linux)) id 1wozJt-00000007CUl-42So for linux-arm-kernel@lists.infradead.org; Wed, 29 Jul 2026 08:07:20 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id AEB94169C; Wed, 29 Jul 2026 01:07:12 -0700 (PDT) Received: from [192.168.178.24] (usa-sjc-mx-foss1.foss.arm.com [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id AB2CB3F66F; Wed, 29 Jul 2026 01:07:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=arm.com; s=foss; t=1785312436; bh=i7PzkEehVu75EIC0APFs4hTtDTk14MQooNuNPKdMABQ=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=kCiN/vwi8GU+jvEG4eydMgSMVsQ2h8LtD9QF1NjLDD3kUSOB469NTPI6HK3Ec4OCH lKiR7aQWYwFxR8imPiElpVNCSTX5payzo/ZciWfDJzyAh+RTBnZlepTAzndloWo4my 5+qyE/Szo6JsyB7f6bgldX8zH4nbgtEQ+/bbx5bQ= Message-ID: <2eaa5334-5677-4b52-9459-63005cfcc23f@arm.com> Date: Wed, 29 Jul 2026 10:07:12 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v4 08/10] arm_mpam: add MPAM-Fb MSC firmware access support To: Jonathan Cameron Cc: Lorenzo Pieralisi , Hanjun Guo , Sudeep Holla , Catalin Marinas , Will Deacon , "Rafael J . Wysocki" , Len Brown , James Morse , Ben Horgan , Reinette Chatre , Fenghua Yu , Srivathsa L Rao , Ganapatrao Kulkarni , Trilok Soni , Srinivas Ramana , Niyas Sait , Lee Trager , linux-acpi@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org References: <20260723155454.1760823-1-andre.przywara@arm.com> <20260723155454.1760823-9-andre.przywara@arm.com> <20260728002252.77064c3b@jic23-huawei> Content-Language: en-GB From: Andre Przywara In-Reply-To: <20260728002252.77064c3b@jic23-huawei> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.9.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20260729_010718_329217_B8D8F71F X-CRM114-Status: GOOD ( 31.76 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Hi Jonathan, On 7/28/26 01:22, Jonathan Cameron wrote: > On Thu, 23 Jul 2026 17:54:52 +0200 > Andre Przywara 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 > Just a couple of suggestions that you can ignore if you like > > Reviewed-by: Jonathan Cameron 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