From nobody Mon Nov 23 22:32:37 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; arc=pass (i=1 dmarc=pass fromdomain=epam.com); dmarc=pass(p=quarantine dis=none) header.from=epam.com ARC-Seal: i=2; a=rsa-sha256; t=1794829680; cv=pass; d=zohomail.com; s=zohoarc; b=Pglxs8AZbdpxifbxaAgcmLQ7K9L5Ghzl4g6rhV5+U6i6a8udEX1DCE9wJg2F1c2uz+nFcP6mG8iHZzu0FRRJnN288J9CoPvZPUsQcLebHpKFg9lRqCmWAwISRahKkOj8sGQWWP1WA8ndR+1JREAFDfiIg1pWbHFMmX38fHD00PA= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1794829680; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=immTEYJfnBn+7IOnXmZVu5RbPG4A0hrE9HawrdLUGCg=; b=g2cIHgKo1tfggwTDg+2vRrjc7E7PTE3YCy4S+BNHw629bY2JEJKrcpzTPpacJsYZDQs6hkDE9z+7YaXwfzdPwVP/L3jE1kL2r7hZeEp6b2aYeQCrkEC558oEtT+nL4AitKWxCoqAiM8Ps/+RpSUsWQHAwICOtOeSMFxUzKTYdYo= ARC-Authentication-Results: i=2; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; arc=pass (i=1 dmarc=pass fromdomain=epam.com); dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1794829680052319.1053089910358; Mon, 16 Nov 2026 03:48:00 -0800 (PST) Received: from list by lists.xenproject.org with outflank-mailman.1490779.1691735 (Exim 4.92) (envelope-from ) id 1xSvBE-0000LP-Hl; Mon, 16 Nov 2026 11:47:24 +0000 Received: by outflank-mailman (output) from mailman id 1490779.1691735; Mon, 16 Nov 2026 11:47:24 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1xSvBE-0000LI-Ea; Mon, 16 Nov 2026 11:47:24 +0000 Received: by outflank-mailman (input) for mailman id 1490779; Mon, 16 Nov 2026 11:47:22 +0000 Received: from mx.expurgate.net ([194.145.224.20]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1xSvBC-0000Jf-I5 for xen-devel@lists.xenproject.org; Mon, 16 Nov 2026 11:47:22 +0000 Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp id 1xSvBB-00EGJV-K6 for xen-devel@lists.xenproject.org; Mon, 16 Nov 2026 12:47:21 +0100 Received: from [10.42.69.9] (helo=localhost) by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from ) id 6afaed3d-8faa-0a2a0a5109dd-0a2a45098ea8-40 for ; Mon, 16 Nov 2026 12:47:21 +0100 Received: from [52.101.83.84] (helo=GVXPR05CU001.outbound.protection.outlook.com) by tlsNG-bad1c0.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1) (envelope-from ) id 6afaed48-be1a-0a2a45090019-34655354e443-3 for ; Mon, 16 Nov 2026 12:47:20 +0100 Received: from DB3PR0302MB9208.eurprd03.prod.outlook.com (2603:10a6:10:430::13) by AS8PR03MB7126.eurprd03.prod.outlook.com (2603:10a6:20b:23d::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.615.14; Mon, 16 Nov 2026 11:47:18 +0000 Received: from DB3PR0302MB9208.eurprd03.prod.outlook.com ([fe80::f257:38e:c0af:df28]) by DB3PR0302MB9208.eurprd03.prod.outlook.com ([fe80::f257:38e:c0af:df28%5]) with mapi id 15.21.0615.013; Mon, 16 Nov 2026 11:47:18 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=epam.com header.i="@epam.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:x-ms-exchange-senderadcheck" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=ofb6WerZKheaw37IZ3SdJORRnkCGu56O4/FyrtRYvMCNP7RMOqAHf7RnEfzTGjibxzwLJrsrt4bz9zAdgRZ10kE/sq97kj+xieMXWuqnwEi+62J4CkGkUpsXokYTPjGascc5aRvnNkBdQljfy7hXxGmDWHajkpGTeDLKKN13xRKSzC+tlOCoPzvu1T/WuDtLsEqEendRHW6EFF7G9hQ33f+BELx3reQTtHoydXV5FxUZFw6KkKktRJQC4ilBEJQGa/84gs8AuyJgIGsbMK+LNZDEwJgsvByyJZy4CPc6s2FcA5ZBiK5hUSQD1BjGIvxxgiGQ76o1Thao0PRS3MjC9A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=immTEYJfnBn+7IOnXmZVu5RbPG4A0hrE9HawrdLUGCg=; b=uYn3eCwTVw3EIGQc/wuR19J58gCM7l2QOVbDrN8jdPxuwoNJyIkJ0dQ245Jdm4/fN5DOhQBHm3nhaxGv5i8cwydziITQOdlvtZekFp283kp5hj9GDfX5wAKRRKOVFKFwB0nVbMCaJDotgWRslbnngufngFyIZEkT3Z/SaLKdygwO9S/pL4GNpRaK2NdXoGO78j/OuDEf5vpg1oM3mk5sGIush/yQKuL2igb3evPhpLPfQcqALpS+6bVt9pV3TXPZZbKjqzznI6Iw/zq/AJdOJrMktoN4S5+LVnIEumjt6W8B3uw37CjOi798czTloqGB3WUWC3HIPHFr5xRKXyVPqg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=epam.com; dmarc=pass action=none header.from=epam.com; dkim=pass header.d=epam.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=epam.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=immTEYJfnBn+7IOnXmZVu5RbPG4A0hrE9HawrdLUGCg=; b=qSOOd2trHPFfh8mSsJApB0EwQ150YVPwp/hGtrNun+Mx3xWMIJqkRNCVYkbj6HNmXcmI5q2tmqCN3ZLbjtcfRhSoMVCXDGdJ0zy2TMg9MaF8tNVbBV2NFeoiNExK8YCljv8fA2HV5x6j4oYLQkD2MvE/PAqW9vKXegd1DeXYxm0l3/rZVXPAcYphwkA3GL1f2zYKxmgPJx07Agn3K4tl8x9xBJbzNodeLh0HaiXPsRLoKNeOsng0jcDVeGDhlxcj9OiQPbSqP5X3GRxc7k23G5UkGyW4WlGLMfPV2f50krM5DqCl7TtSsfI4kkP2wGG351Z+O5vgVn7yE4O0PsLoKQ== From: Mykola Kvach To: "xen-devel@lists.xenproject.org" CC: Bertrand Marquis , Rahul Singh , Stefano Stabellini , Julien Grall , Michal Orzel , Volodymyr Babchuk Subject: [PATCH v2] arm/smmuv3: clean stream tables for non-coherent hardware Thread-Topic: [PATCH v2] arm/smmuv3: clean stream tables for non-coherent hardware Thread-Index: AQHddcA7KSg86rXuDUWg7Tm+9FjlvA== Date: Mon, 16 Nov 2026 11:47:18 +0000 Message-ID: <29e61dc16bff44403131d87a85c0050248d87309.1794829488.git.mykola_kvach@epam.com> Accept-Language: en-US, uk-UA Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: mx.microsoft.com 1; dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=epam.com; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: DB3PR0302MB9208:EE_|AS8PR03MB7126:EE_ x-ms-office365-filtering-correlation-id: be93d836-9774-4072-cfd1-08df43d75dda x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0;ARA:13230040|1800799024|376014|23010399003|366016|18002099003|6133799003|261009223027099003|11063799006|56012099006|10067099003|261102123227099003|261102124527099003|261028144727099003|261026140227099003|261021123027099003|261022105027099003|261021121427099003|261022075727099003|38070700021; x-microsoft-antispam-message-info: y6WK/lyHDfRPasCASlCDe6KK6WXJJWfkvHSiTW1+Ozqscqj3KaEszPMV/89zzNf7IitPcHdRwS9T1W25WeDPyyjAsKYEJkTyvtvTL0ji7Xg9hcJ2rBPYdS2fFGCCMt6fmzlpYqo0kFGb4Iswgn9W4boUpgW6YMQYxNGiX9kPVfep/1OJrinKeWVgjSV30YuRnClwiW3RiHxJDnaqDddKYM9cpWmct9EV2LYzMDNlsGW6ZXJ8+zdwuOaMIfOquXrNhXxLDDdwIfiqXfnwx/G/MeN/KroIKw4v5t1QI6TSEE0I3OFwwiQz5OQOLzHSTu3DmOzT46UJdbEZgfU58fNuntlLRqS7uiUdYEEDV3A4BJiRtxYTgE0sV+9wGKsJ4T0d58hCM4mii++Ky913iscQn7vUe3pLzxstgdYnGQfPj1WVAEgbC3oWf+rzZ3UiXTjistkcrPbp5dtGMpLytywv2YwBnNZWxHs4zBrzH1vN0dpXBScgYTrwh/zdS1uaD/c/c5LcW0lBL6JmphrXShRZEY/riAkGnEyKCj5IMTTB515EDJDra2pzTNzqSjHePBNdGXi8gERj9jf3HMMxngD9oRegIHLPe9nJO6KdDHJqAj3ROIPE1pPZ1Ss4uJudhu2nR6kUqgvFkyerFbpzHpo5sPItfAAUGH3Hu0FYa6VY+7+Wqcy11Vvf9SY2axymOuLV0U1QSSNDbaT0tYGbjAqzPw== x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DB3PR0302MB9208.eurprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(1800799024)(376014)(23010399003)(366016)(18002099003)(6133799003)(261009223027099003)(11063799006)(56012099006)(10067099003)(261102123227099003)(261102124527099003)(261028144727099003)(261026140227099003)(261021123027099003)(261022105027099003)(261021121427099003)(261022075727099003)(38070700021);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?utf-8?B?dHdzNEh1UGV5MVBpSGluejE0RytGWlc5N3FsQ0l1WVlwWWszcXVadmREcVd4?= =?utf-8?B?STg2TEZ1QzV1emM3cDRNT2pTSWN3UU9McHlFam1QclJUUUtqTEdmUFVHNjJp?= =?utf-8?B?c1NYNXBKNThTaGxaV09La0l2cnB4NzdjblVpS1JSV1U2MGR1MXBkR2dEL0RN?= =?utf-8?B?YnRtUzVXTlk2aVBBMlY4UGt5NU90VERtKzlpK3pwNWxvN1c5clVkdDVHYTJj?= =?utf-8?B?ZlFacVdMVDNPK2xlNVliTm5oRmV1RUgyOGdyWSt5c2hVUThGb1ZFdFN3cmxY?= =?utf-8?B?Zjh6Q0Zib3Z0aC9Qa0F2RjBaRU5CaWtmY1J3ZUtLU0lwem5BS0crV3JFcnpF?= =?utf-8?B?bVhhMXpVM2xSazh2cEkwdTJzYVJnek8yL2RxNDFFV25pOW9YQlFXMVppZ0lq?= =?utf-8?B?S1RrTDh1bDZHVXJYc3VKSi91YUUrc1NQeWRBU2Npd0hzR0MxZ25LQ2xkW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EdYSXJnYnkvZmY2YURIc3F3cG5r?= =?utf-8?Q?YQa3RFXzgDFeIGvtOC?= Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: epam.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: DB3PR0302MB9208.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: be93d836-9774-4072-cfd1-08df43d75dda X-MS-Exchange-CrossTenant-originalarrivaltime: 16 Nov 2026 11:47:18.1268 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: b41b72d0-4e9f-4c26-8a69-f949f367c91d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: ZalfXLlsML1KuGSjiq8odnUu8HiUYcQU2hWpGbruX36MKvuueWWwDyZoQjBs8eAHe+Nk/50elu+HoUiJlXGvew== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR03MB7126 X-purgate-ID: tlsNG-bad1c0/1794829641-BD4C3034-40B9BFEC/0/0 X-purgate-type: clean X-purgate-size: 6536 X-ZohoMail-DKIM: pass (identity @epam.com) X-ZM-MESSAGEID: 1794829680524158500 Xen's dmam_alloc_coherent() returns cacheable memory. A non-coherent SMMU cannot see writes that remain in the CPU cache. On Orange Pi 5 (RK3588S), NVMe initialization failed with C_BAD_STREAMID for SID 0x4100 while the CPU saw a populated L1 descriptor. Clean new stream tables before use. Clean updated STE data in arm_smmu_sync_ste_for_sid() before issuing CFGI_STE and CMD_SYNC. Keep both sync points around the dst[0] update. Clean the L2 table before writing its L1 pointer, then clean the pointer. Skip these cache operations on coherent SMMUs. See Arm IHI 0070G.b, sections 3.15 and 3.21.3.1. Fixes: 452ddbe3592b ("xen/arm: smmuv3: Add support for SMMUv3 driver") Assisted-by: Codex:GPT-6.1 Signed-off-by: Mykola Kvach Reviewed-by: Oleksandr Tyshchenko --- Changes in v2: - Rename arm_smmu_clean_strtab() to arm_smmu_clean_dcache(). - Pass the STE pointer and clean size to arm_smmu_sync_ste_for_sid(). Clean the given range there before CFGI_STE and CMD_SYNC. Keep the original clean ranges, both sync points around dst[0], and the explicit cleaning during table initialisation. --- xen/drivers/passthrough/arm/smmu-v3.c | 27 +++++++++++++++++++++++---- 1 file changed, 23 insertions(+), 4 deletions(-) diff --git a/xen/drivers/passthrough/arm/smmu-v3.c b/xen/drivers/passthroug= h/arm/smmu-v3.c index 232df2421c..945a18a7a1 100644 --- a/xen/drivers/passthrough/arm/smmu-v3.c +++ b/xen/drivers/passthrough/arm/smmu-v3.c @@ -637,6 +637,14 @@ static int arm_smmu_cmdq_issue_sync(struct arm_smmu_de= vice *smmu) } =20 /* Stream table manipulation functions */ +static void arm_smmu_clean_dcache(struct arm_smmu_device *smmu, + const void *ptr, size_t size) +{ + /* Xen's dmam_alloc_coherent() returns cacheable memory. */ + if (!(smmu->features & ARM_SMMU_FEAT_COHERENCY)) + (void)clean_dcache_va_range(ptr, size); +} + static void arm_smmu_write_strtab_l1_desc(__le64 *dst, struct arm_smmu_strtab_l1_desc = *desc) { @@ -649,7 +657,8 @@ arm_smmu_write_strtab_l1_desc(__le64 *dst, struct arm_s= mmu_strtab_l1_desc *desc) write_atomic(dst, cpu_to_le64(val)); } =20 -static void arm_smmu_sync_ste_for_sid(struct arm_smmu_device *smmu, u32 si= d) +static void arm_smmu_sync_ste_for_sid(struct arm_smmu_device *smmu, u32 si= d, + const __le64 *dst, size_t size) { struct arm_smmu_cmdq_ent cmd =3D { .opcode =3D CMDQ_OP_CFGI_STE, @@ -659,6 +668,7 @@ static void arm_smmu_sync_ste_for_sid(struct arm_smmu_d= evice *smmu, u32 sid) }, }; =20 + arm_smmu_clean_dcache(smmu, dst, size); arm_smmu_cmdq_issue_cmd(smmu, &cmd); arm_smmu_cmdq_issue_sync(smmu); } @@ -736,7 +746,8 @@ static void arm_smmu_write_strtab_ent(struct arm_smmu_m= aster *master, u32 sid, * the STE regardless of whether the old value was live. */ if (smmu) - arm_smmu_sync_ste_for_sid(smmu, sid); + arm_smmu_sync_ste_for_sid(smmu, sid, dst, + STRTAB_STE_DWORDS << 3); return; } =20 @@ -762,9 +773,9 @@ static void arm_smmu_write_strtab_ent(struct arm_smmu_m= aster *master, u32 sid, dst[1] |=3D cpu_to_le64(FIELD_PREP(STRTAB_STE_1_EATS, STRTAB_STE_1_EATS_TRANS)); =20 - arm_smmu_sync_ste_for_sid(smmu, sid); + arm_smmu_sync_ste_for_sid(smmu, sid, dst, STRTAB_STE_DWORDS << 3); write_atomic(&dst[0], cpu_to_le64(val)); - arm_smmu_sync_ste_for_sid(smmu, sid); + arm_smmu_sync_ste_for_sid(smmu, sid, dst, sizeof(*dst)); =20 /* It's likely that we'll want to use the new STE soon */ if (!(smmu->options & ARM_SMMU_OPT_SKIP_PREFETCH)) @@ -805,7 +816,10 @@ static int arm_smmu_init_l2_strtab(struct arm_smmu_dev= ice *smmu, u32 sid) } =20 arm_smmu_init_bypass_stes(desc->l2ptr, 1 << STRTAB_SPLIT); + /* Clean the L2 table before writing the L1 pointer. */ + arm_smmu_clean_dcache(smmu, desc->l2ptr, size); arm_smmu_write_strtab_l1_desc(strtab, desc); + arm_smmu_clean_dcache(smmu, strtab, STRTAB_L1_DESC_DWORDS << 3); return 0; } =20 @@ -1744,6 +1758,7 @@ static int __init arm_smmu_init_queues(struct arm_smm= u_device *smmu) static int arm_smmu_init_l1_strtab(struct arm_smmu_device *smmu) { unsigned int i; + size_t size; struct arm_smmu_strtab_cfg *cfg =3D &smmu->strtab_cfg; void *strtab =3D smmu->strtab_cfg.strtab; =20 @@ -1757,6 +1772,9 @@ static int arm_smmu_init_l1_strtab(struct arm_smmu_de= vice *smmu) strtab +=3D STRTAB_L1_DESC_DWORDS << 3; } =20 + size =3D cfg->num_l1_ents * (STRTAB_L1_DESC_DWORDS << 3); + arm_smmu_clean_dcache(smmu, cfg->strtab, size); + return 0; } =20 @@ -1823,6 +1841,7 @@ static int arm_smmu_init_strtab_linear(struct arm_smm= u_device *smmu) cfg->strtab_base_cfg =3D reg; =20 arm_smmu_init_bypass_stes(strtab, cfg->num_l1_ents); + arm_smmu_clean_dcache(smmu, strtab, size); return 0; } =20 --=20 2.53.0