Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 82327606A325 for ; Wed, 2 Dec 2026 00:59:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=D+j/ITe1 Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xYYh4-0008Kx-2q; Tue, 01 Dec 2026 19:59:34 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xYYh2-0008Kc-Lt; Tue, 01 Dec 2026 19:59:32 -0500 Received: from sea.source.kernel.org ([2600:3c0a:e001:78e:0:1991:8:25]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xYYgz-00084d-T8; Tue, 01 Dec 2026 19:59:31 -0500 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) by sea.source.kernel.org (Postfix) with ESMTP id 99EB0408A9; Wed, 2 Dec 2026 00:59:28 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 287501F00893; Wed, 2 Dec 2026 00:59:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796173168; bh=UG1qlPGWwEn4tmgUO7pAACQVkNuGZfqrIuQXiKi/KNY=; h=Date:From:To:Cc:Subject:In-Reply-To:References; b=D+j/ITe19Y4EwA4ph0hEX7mzkjLTmU0hd8Nnh4a+ocairojuyk967BdoUTPwwIvU3 FZAhpSylTZMGmhXzL7kv5hAz1DTVg07Tf4eMU6cNgnRU1yCdCg5iJ3Jbp0wXjhN/wp hTLU7/bz+9BTE5j+SVMPcH7qumy7vAI1W0KOVlIug7899XzX7sSEruVt8CpLVzq/qw Y7xASJG6Q/iHfyxS2eb45qnF3xyJ/o+obgZpo8EMHyfKn7GNAIO6PobTHM3E3kRrWk 3sZJI/xq+pXx1x/ikrzv4uFJ1drYCtulFBxldSOpwQGVMbW2RclBGwd1VoPZNt+iRK PBoy4ng0ZRSdQ== Date: Wed, 2 Dec 2026 00:59:23 +0000 From: Jonathan Cameron To: Jinjie Ruan Cc: Jinjie Ruan <2118537295@qq.com>, , , , , , , , , , Subject: Re: [PATCH 07/37] hw/arm/mpam: Add mpam-msc-mem memory-side MSC subtype Message-ID: <20261202005923.07423c50@jic23-hlaptop> In-Reply-To: <9ff1fccc-a803-47ae-9fce-8ce6d70e0372@huawei.com> References: <20261016094733.1898485-1-2118537295@qq.com> <20261103010508.4e123573@jic23-hlaptop> <9ff1fccc-a803-47ae-9fce-8ce6d70e0372@huawei.com> X-Mailer: Claws Mail 4.4.0 (GTK 3.24.52; x86_64-pc-linux-gnu) X-Archived-By: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Received-SPF: pass client-ip=2600:3c0a:e001:78e:0:1991:8:25; envelope-from=jic23@kernel.org; helo=sea.source.kernel.org X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-arm@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-arm-bounces+qemu-arm=archiver.kernel.org@nongnu.org X-Spam-Status: No, score=-17.3 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_PASS, SPF_PASS,USER_AGENT_SANE_2 autolearn=ham autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on aws-us-west-2-korg-listserv-alma10-1 On Tue, 1 Dec 2026 18:11:10 +0800 Jinjie Ruan wrote: > =E5=9C=A8 2026/11/3 9:05, Jonathan Cameron =E5=86=99=E9=81=93: > > On Fri, 16 Oct 2026 17:47:01 +0800 > > Jinjie Ruan <2118537295@qq.com> wrote: > > =20 > >> From: Jonathan Cameron =20 >=20 >=20 > Hi Jonathan, >=20 > >> > >> Add the mpam-msc-mem subtype for memory-side components. Its > >> realize assembles the identity view of MPAMF_IDR (PARTID space, > >> optional RIS support, HAS_ESR/HAS_EXTD_ESR, HAS_PARTID_NRW when > >> the internal PARTID space is smaller) plus IIDR/AIDR, and > >> advertises no partitioning features yet: the bandwidth controls > >> come with the MBW patch. > >> > >> Based on an RFC series by Jonathan Cameron. > >> > >> Signed-off-by: Jonathan Cameron > >> Signed-off-by: Jinjie Ruan =20 > >=20 > > Just some minor comments, mostly about comments I left lying around > > that I now don't see any purpose in keeping. > >=20 > > =20 > >> --- > >> hw/arm/mpam.c | 68 +++++++++++++++++++++++++++++++++++++++++++++++++++ > >> 1 file changed, 68 insertions(+) > >> > >> diff --git a/hw/arm/mpam.c b/hw/arm/mpam.c > >> index b1d6472..8a85c3b 100644 > >> --- a/hw/arm/mpam.c > >> +++ b/hw/arm/mpam.c > >> @@ -260,8 +260,15 @@ typedef struct MPAMMSCState { > >> =20 > >> } MPAMMSCState; > >> =20 > >> +typedef struct MPAMMSCMemState { > >> + MPAMMSCState parent; > >> +} MPAMMSCMemState; > >> + > >> DECLARE_INSTANCE_CHECKER(MPAMMSCState, MPAM_MSC_DEVICE, TYPE_MPAM_MSC= ); > >> =20 > >> +DECLARE_INSTANCE_CHECKER(MPAMMSCMemState, MPAM_MSC_MEM_DEVICE, > >> + TYPE_MPAM_MSC_MEM); > >> + > >> static uint64_t mpam_msc_read_reg(void *opaque, hwaddr offset, > >> unsigned size) > >> { > >> @@ -367,6 +374,52 @@ static void mpam_msc_realize(DeviceState *dev, Er= ror **errp) > >> sysbus_init_mmio(SYS_BUS_DEVICE(dev), &s->mr); > >> } > >> =20 > >> +static void mpam_msc_mem_realize(DeviceState *dev, Error **errp) > >> +{ MPAMMSCState *s =3D MPAM_MSC_DEVICE(dev); > >> + int i; > >> + > >> + mpam_msc_realize(dev, errp); > >> + > >> + for (i =3D 0; i < s->num_ris; i++) { =20 > > for (int i =3D 0; .. =20 >=20 > OK. >=20 > > =20 > >> + Mpamf *mpamf =3D &s->mpamf[i]; > >> + > >> + mpamf->idr =3D FIELD_DP64(mpamf->idr, MPAMF_IDR, PART_ID_MAX, > >> + s->num_partid - 1); > >> + /* No PCMG for now */ > >> + mpamf->idr =3D FIELD_DP64(mpamf->idr, MPAMF_IDR, PMG_MAX, 0); > >> + mpamf->idr =3D FIELD_DP64(mpamf->idr, MPAMF_IDR, EXT, 1); =20 > >=20 > > I guess if being flexible this would emulate with and without > > EXT, but meh, not sure it adds much value. =20 >=20 > It seems that this EXT bit only affects whether MPAMF_IDR is 32-bit or > 64-bit? >=20 > Maybe we implement it as 64-bit but use default values for the upper 32 > bits. I'd emulate with EXT always set. Forwards looking approach. Agreed that we can do that and use defaults to make life easy. I don't think this one is particular important for testing but could be wro= ng. >=20 > > =20 > >> + mpamf->idr =3D FIELD_DP64(mpamf->idr, MPAMF_IDR, HAS_RIS, s->= num_ris > 1); > >> + mpamf->idr =3D FIELD_DP64(mpamf->idr, MPAMF_IDR, RIS_MAX, > >> + s->num_ris > 1 ? s->num_ris - 1 : 0= ); > >> + /* Optional - test with and without */ =20 > >=20 > > Should drop that comment, or add the ability to test with and without = =20 >=20 > OK, will drop the comment. >=20 > > - honestly I'm not sure which field that was even referring too as > > kind of applies to all the HAS_ ones. =20 >=20 >=20 > Does it mean that error reporting on invalid parameters is not implemente= d? I can't remember :( Jonathan