From nobody Sun Feb 8 13:38:43 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1654618731; cv=none; d=zohomail.com; s=zohoarc; b=nyL6x4o+vF3jDQo9T+fai72M2R5R+F6KCoWPQYuNKbySgpAbm3zEz0UoGrXY+riU1IrGUte7dYZde/QvM/n3T6wb9/VRrSGf2V9f7pntcE26E5m2n1ndPQ6gnVJdz4zlRL7EsIfXmMyXYOhQofrubP2LEpeV1iAaf/f0dd7FEPM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1654618731; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Sender:Subject:To; bh=cCHZBHXR/PqWACKSFr0roDG21WQtMTI6CP2Xtm03HYY=; b=KNChBUIYhmA4WKZXWN7ktti7WVmDAXXChRD/VKK6WT9tKXmdP904kPnvrmubUC5Yt4Z3DMAwaYHkJD1J2mXDDBz6vRQOHeWPI2EIOd5Twg+vwwRasjOm8qbipecBluJb8MiNRODVfCBjTtmKJp1TSnwn59otXOQhMPoWvRCIBYU= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1654618731766506.0575413254752; Tue, 7 Jun 2022 09:18:51 -0700 (PDT) Received: from localhost ([::1]:60132 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nybus-0003PH-0i for importer@patchew.org; Tue, 07 Jun 2022 12:18:50 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:50664) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nybkD-0007cH-9r for qemu-devel@nongnu.org; Tue, 07 Jun 2022 12:07:49 -0400 Received: from frasgout.his.huawei.com ([185.176.79.56]:2605) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nybkB-0004fE-6n for qemu-devel@nongnu.org; Tue, 07 Jun 2022 12:07:49 -0400 Received: from fraeml710-chm.china.huawei.com (unknown [172.18.147.206]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4LHZwm25h3z67hRB; Wed, 8 Jun 2022 00:06:32 +0800 (CST) Received: from lhreml710-chm.china.huawei.com (10.201.108.61) by fraeml710-chm.china.huawei.com (10.206.15.59) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Tue, 7 Jun 2022 18:07:44 +0200 Received: from SecurePC-101-06.china.huawei.com (10.122.247.231) by lhreml710-chm.china.huawei.com (10.201.108.61) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.1.2375.24; Tue, 7 Jun 2022 17:07:43 +0100 To: , "Michael S . Tsirkin" , "Ben Widawsky" CC: Paolo Bonzini , , , , Marcel Apfelbaum , Igor Mammedov , Markus Armbruster , Mark Cave-Ayland , "Adam Manzanares" , Tong Zhang , Shameerali Kolothum Thodi Subject: [PATCH v3] hw/cxl: Fix missing write mask for HDM decoder target list registers Date: Tue, 7 Jun 2022 17:07:47 +0100 Message-ID: <20220607160747.21084-1-Jonathan.Cameron@huawei.com> X-Mailer: git-send-email 2.32.0 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Originating-IP: [10.122.247.231] X-ClientProxiedBy: lhreml703-chm.china.huawei.com (10.201.108.52) To lhreml710-chm.china.huawei.com (10.201.108.61) X-CFilter-Loop: Reflected Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=185.176.79.56; envelope-from=jonathan.cameron@huawei.com; helo=frasgout.his.huawei.com X-Spam_score_int: -25 X-Spam_score: -2.6 X-Spam_bar: -- X-Spam_report: (-2.6 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Reply-to: Jonathan Cameron From: Jonathan Cameron via X-ZM-MESSAGEID: 1654618733388100001 Content-Type: text/plain; charset="utf-8" Without being able to write these registers, no interleaving is possible. More refined checks of HDM register state on commit to follow. Signed-off-by: Jonathan Cameron Reviewed-by: Ben Widawsky --- v3: Actually pass the parameter to the call... v2: (Ben Widawsky) - Correctly set a tighter write mask for the endpoint devices where this register has a different use. =20 hw/cxl/cxl-component-utils.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/hw/cxl/cxl-component-utils.c b/hw/cxl/cxl-component-utils.c index 7985c9bfca..2208284ee6 100644 --- a/hw/cxl/cxl-component-utils.c +++ b/hw/cxl/cxl-component-utils.c @@ -154,7 +154,8 @@ static void ras_init_common(uint32_t *reg_state, uint32= _t *write_msk) reg_state[R_CXL_RAS_ERR_CAP_CTRL] =3D 0x00; } =20 -static void hdm_init_common(uint32_t *reg_state, uint32_t *write_msk) +static void hdm_init_common(uint32_t *reg_state, uint32_t *write_msk, + enum reg_type type) { int decoder_count =3D 1; int i; @@ -174,6 +175,12 @@ static void hdm_init_common(uint32_t *reg_state, uint3= 2_t *write_msk) write_msk[R_CXL_HDM_DECODER0_SIZE_LO + i * 0x20] =3D 0xf0000000; write_msk[R_CXL_HDM_DECODER0_SIZE_HI + i * 0x20] =3D 0xffffffff; write_msk[R_CXL_HDM_DECODER0_CTRL + i * 0x20] =3D 0x13ff; + if (type =3D=3D CXL2_DEVICE) { + write_msk[R_CXL_HDM_DECODER0_TARGET_LIST_LO + i * 0x20] =3D 0x= f0000000; + } else { + write_msk[R_CXL_HDM_DECODER0_TARGET_LIST_LO + i * 0x20] =3D 0x= ffffffff; + } + write_msk[R_CXL_HDM_DECODER0_TARGET_LIST_HI + i * 0x20] =3D 0xffff= ffff; } } =20 @@ -239,7 +246,7 @@ void cxl_component_register_init_common(uint32_t *reg_s= tate, uint32_t *write_msk } =20 init_cap_reg(HDM, 5, 1); - hdm_init_common(reg_state, write_msk); + hdm_init_common(reg_state, write_msk, type); =20 if (caps < 5) { return; --=20 2.32.0