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 A19EE606A31A for ; Wed, 2 Dec 2026 08:07:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key, unprotected) header.d=huawei.com header.i=@huawei.com header.a=rsa-sha256 header.s=dkim header.b=EiyXfKps Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xYfMX-00055r-50; Wed, 02 Dec 2026 03:06:49 -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 1xYfMU-00055C-UL; Wed, 02 Dec 2026 03:06:47 -0500 Received: from canpmsgout05.his.huawei.com ([113.46.200.220]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xYfMS-00089Q-8L; Wed, 02 Dec 2026 03:06:46 -0500 dkim-signature: v=1; a=rsa-sha256; d=huawei.com; s=dkim; c=relaxed/relaxed; q=dns/txt; h=From; bh=4yBmvuB3nfZr4UgcPd3yjfQDp0GJpJvavAsTu1NFICM=; b=EiyXfKps/wEIqZy3pZlKnXEGWs9Y4ZxV6sFXldaP36owDqsfTAcvfYKCRNww4uRAADOq7rABB U7hOgSs1EEoPOLmShdNnqtJy9Zm0vI5+V+5ypRC48eDYgCx5mJMFECRZVgwreUApRRETI1/oByH w565YtuKf8WIuFaobLxeuq4= Received: from mail.maildlp.com (unknown [172.19.163.104]) by canpmsgout05.his.huawei.com (SkyGuard) with ESMTPS id 4jfVgb5HRKz12LJb; Wed, 2 Dec 2026 16:05:47 +0800 (CST) Received: from kwepemk200008.china.huawei.com (unknown [7.202.194.74]) by mail.maildlp.com (Postfix) with ESMTPS id 4AAE74057F; Wed, 2 Dec 2026 16:06:31 +0800 (CST) Received: from [10.67.110.68] (10.67.110.68) by kwepemk200008.china.huawei.com (7.202.194.74) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.45; Wed, 2 Dec 2026 16:06:30 +0800 Message-ID: Date: Wed, 2 Dec 2026 16:06:30 +0800 X-Archived-By: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 12/37] hw/arm/mpam: Implement MBW bandwidth partitioning To: Jonathan Cameron , Jinjie Ruan <2118537295@qq.com> CC: , , , , , , , , , References: <20261016094733.1898485-1-2118537295@qq.com> <20261103013131.25c03bf4@jic23-hlaptop> From: Jinjie Ruan In-Reply-To: <20261103013131.25c03bf4@jic23-hlaptop> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit X-ClientProxiedBy: kwepems100002.china.huawei.com (7.221.188.206) To kwepemk200008.china.huawei.com (7.202.194.74) Received-SPF: pass client-ip=113.46.200.220; envelope-from=ruanjinjie@huawei.com; helo=canpmsgout05.his.huawei.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, 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,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_1 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 在 2026/11/3 9:31, Jonathan Cameron 写道: > On Fri, 16 Oct 2026 17:47:06 +0800 > Jinjie Ruan <2118537295@qq.com> wrote: > >> From: Jinjie Ruan >> >> Add the memory-bandwidth controls: MPAMF_MBW_IDR (16-bit BWA_WD >> fraction, MIN/MAX/PBM/PROP support, BWPBM_WD = MPAM_MBW_PART) >> with HAS_MBW_PART on the memory subtype, and read/write handling >> for MBW_MIN, MBW_MAX, MBW_PROP and the MBW_PBM bitmap per >> selected internal PARTID. >> >> Note the MBW_MIN write mask check references the CMIN mask -- >> a leftover fixed later by the CMIN/CASSOC patch. >> >> Signed-off-by: Jinjie Ruan > > I'm a bit amused that the Todo from my RFC is still here and > not fixed. Needs doing. > >> --- >> hw/arm/mpam.c | 73 +++++++++++++++++++++++++++++++++++++++++++++++++++ >> 1 file changed, 73 insertions(+) >> >> diff --git a/hw/arm/mpam.c b/hw/arm/mpam.c >> index 2b1401e..7c33ec4 100644 >> --- a/hw/arm/mpam.c >> +++ b/hw/arm/mpam.c > >> case A_MPAMF_MPAMCFG_CPBM0... >> (A_MPAMF_MPAMCFG_CPBM0 + ((MPAM_CACHE_PART + 31) / 32 - 1) * 4): >> { >> @@ -445,6 +490,22 @@ static void mpam_msc_write_reg(void *opaque, hwaddr offset, uint64_t value, >> mpamf->per_nrw_id[nrw_part_sel].cfg_cpbm[array_offset] = value; >> return; >> } >> + case A_MPAMF_MPAMCFG_MBW_PBM0... >> + (A_MPAMF_MPAMCFG_MBW_PBM0 + ((MPAM_MBW_PART + 31) / 32 - 1) * 4): >> + { >> + uint32_t array_offset; >> + >> + if (!FIELD_EX32(mpamf->idr, MPAMF_IDR, HAS_MBW_PART)) { >> + qemu_log_mask(LOG_UNIMP, >> + "MPAM: Unexpected write to MBW_PBM when !HAS_MBW_PART\n"); >> + return; >> + } >> + /* TODO: Figure out write mask to check this stays in write bits */ > > Indeed that needs doing. Wasn't I lazy in that RFC? :) Will update the author and do the todo. > > > >> + array_offset = (offset - A_MPAMF_MPAMCFG_MBW_PBM0) / sizeof(uint32_t); >> + >> + mpamf->per_nrw_id[nrw_part_sel].cfg_mbw_pbm[array_offset] = value; >> + return; >> + } >