From nobody Wed Nov 19 03:20:49 2025 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 header.i=teddy.astie@vates.tech; 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; dmarc=pass(p=reject dis=none) header.from=vates.tech ARC-Seal: i=1; a=rsa-sha256; t=1762961895; cv=none; d=zohomail.com; s=zohoarc; b=JQQMpg1FVsQ5+zH+SK3PQaER+g5y0uryu/G2I75u1jOrTztKjxwP57HpJXZ+bGge04WjGGLu+22C1Pgy/Yzskmm2NnfmEbL5qvKesYT+uuCRoQyrzf+tWvpGqyXjb19e+U1xdgmSL+OQDdxgWhqxfz2rvJf+UHvYbBlgG+3VdxI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1762961895; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=kCjQ/w4mi64pHFYbQXYYAj4/n0muw09kfLASyhbwR3Y=; b=i7GD3yaiIBYXRr0kJXmheyW2uOxTrvDTuJWj+VjU8cXaEjcTmaOF0GM7ScoNjKKtDrmkEet+L3bLDIqshZtdqQf8zG0njALyIkEytrEVfDRzKJdfyTZZWI9Ji4fzEOCVhhIpvAU39M0db5q7XYpZO5lm+5iqmK2DpOOeRxs6/1A= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass header.i=teddy.astie@vates.tech; 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; dmarc=pass header.from= (p=reject dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1762961895421826.2521023589258; Wed, 12 Nov 2025 07:38:15 -0800 (PST) Received: from list by lists.xenproject.org with outflank-mailman.1160078.1488310 (Exim 4.92) (envelope-from ) id 1vJCv4-00089e-Ov; Wed, 12 Nov 2025 15:38:02 +0000 Received: by outflank-mailman (output) from mailman id 1160078.1488310; Wed, 12 Nov 2025 15:38:02 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1vJCv4-00089X-Lu; Wed, 12 Nov 2025 15:38:02 +0000 Received: by outflank-mailman (input) for mailman id 1160078; Wed, 12 Nov 2025 15:38:00 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1vJCv2-0007vC-HH for xen-devel@lists.xenproject.org; Wed, 12 Nov 2025 15:38:00 +0000 Received: from mail136-17.atl41.mandrillapp.com (mail136-17.atl41.mandrillapp.com [198.2.136.17]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 912f6e0e-bfdd-11f0-9d18-b5c5bf9af7f9; Wed, 12 Nov 2025 16:38:00 +0100 (CET) Received: from pmta11.mandrill.prod.atl01.rsglab.com (localhost [127.0.0.1]) by mail136-17.atl41.mandrillapp.com (Mailchimp) with ESMTP id 4d66x00cdYzPm0Zms for ; Wed, 12 Nov 2025 15:37:56 +0000 (GMT) Received: from [37.26.189.201] by mandrillapp.com id 98f689ac8ef6429eba55bb534baecc65; Wed, 12 Nov 2025 15:37:56 +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" X-Inumbo-ID: 912f6e0e-bfdd-11f0-9d18-b5c5bf9af7f9 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mandrillapp.com; s=mte1; t=1762961876; x=1763231876; bh=kCjQ/w4mi64pHFYbQXYYAj4/n0muw09kfLASyhbwR3Y=; h=From:Subject:To:Cc:Message-Id:In-Reply-To:References:Feedback-ID: Date:MIME-Version:Content-Type:Content-Transfer-Encoding:CC:Date: Subject:From; b=J0hi8lk5FCgyJsaDLkkVsDEOmpJGDK7vPr06fWvfA2+bO7hhLghFQ+lPH163R+25m 3gJw1Ru3vVU5ZoKgyStzHbuf+Js+IJS+3QOBY66ccblc+S9RwTdUtn/OHs0t6r1IwD MnclgqeawIFwfgInb6DBTNFMtwPAYE9Mfm2XUHKOvJCrsxyIaI6DkypTmCAkJdzjXi 5RkQCUFwRX4/IK7BGbI8ovOcDEBp47WGb9xRSOzGDMxb6E1IovPvXxnPP80gE0P+wr Aep/USDeXGxSPKKX9v6/t9ErEzaFBQD94VUWqKbujnKN69IVQfqP4hacQVlSmKgIuT MyalPI2MgJZQw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vates.tech; s=mte1; t=1762961876; x=1763222376; i=teddy.astie@vates.tech; bh=kCjQ/w4mi64pHFYbQXYYAj4/n0muw09kfLASyhbwR3Y=; h=From:Subject:To:Cc:Message-Id:In-Reply-To:References:Feedback-ID: Date:MIME-Version:Content-Type:Content-Transfer-Encoding:CC:Date: Subject:From; b=vgaj0LtADCuCvad7mQ7zgjGaGFNrB9WaMwLciqRruKy7vqv61JGa2eSZ7jspe8rdj qF5PlAmFpMICfzH8SHu+dY+D7Z6XdhIWPhd++wJH9n5ORxrE0yrAruneXAQBdoGB1b NBTPR+u44I+rk33Hm9mM9Ks+KWBy7nBPAQ+iLs6ask57Mh8vU/rmHpu0n/krm/9duZ Yhz6etH5dsBMNonBO2fxPDwOKs9mFfMdpKvUHeBtemBsRpFyLXomUw1hv+7uAWzk8m zShoZql9b/d13CoMMp4WFb81LfUIno/EiMgNBYap5XHHgd4q9RS3Q3DHUZsiBUyPxf O02sYDc7HPxxg== From: "Teddy Astie" Subject: =?utf-8?Q?[PATCH=202/2]=20amd/iommu:=20Remove=20dead=20non-atomic=20update=20checking?= X-Mailer: git-send-email 2.51.2 X-Bm-Disclaimer: Yes X-Bm-Milter-Handled: 4ffbd6c1-ee69-4e1b-aabd-f977039bd3e2 X-Bm-Transport-Timestamp: 1762961874950 To: xen-devel@lists.xenproject.org Cc: "Teddy Astie" , "Jan Beulich" , "Andrew Cooper" , "=?utf-8?Q?Roger=20Pau=20Monn=C3=A9?=" , "Jason Andryuk" Message-Id: In-Reply-To: References: X-Native-Encoded: 1 X-Report-Abuse: =?UTF-8?Q?Please=20forward=20a=20copy=20of=20this=20message,=20including=20all=20headers,=20to=20abuse@mandrill.com.=20You=20can=20also=20report=20abuse=20here:=20https://mandrillapp.com/contact/abuse=3Fid=3D30504962.98f689ac8ef6429eba55bb534baecc65?= X-Mandrill-User: md_30504962 Feedback-ID: 30504962:30504962.20251112:md Date: Wed, 12 Nov 2025 15:37:56 +0000 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @mandrillapp.com) (identity teddy.astie@vates.tech) X-ZM-MESSAGEID: 1762961897868158500 Content-Type: text/plain; charset="utf-8" When updating a DTE, amd_iommu_setup_domain_device() would check if the update had been non-atomic (i.e rc > 0) and throw a warning if such non-atomic update could be dangerous. However since commit 3fc44151d83d, rc can no longer be positive, making this branch unreachable code. No functional change intended. Signed-off-by: Teddy Astie Reviewed-by: Jan Beulich Reviewed-by: Jason Andryuk --- xen/drivers/passthrough/amd/pci_amd_iommu.c | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/xen/drivers/passthrough/amd/pci_amd_iommu.c b/xen/drivers/pass= through/amd/pci_amd_iommu.c index 3a14770855..02eee4e658 100644 --- a/xen/drivers/passthrough/amd/pci_amd_iommu.c +++ b/xen/drivers/passthrough/amd/pci_amd_iommu.c @@ -225,24 +225,6 @@ static int __must_check amd_iommu_setup_domain_device( spin_unlock_irqrestore(&iommu->lock, flags); return rc; } - if ( rc && - domain !=3D pdev->domain && - /* - * By non-atomically updating the DTE's domain ID field last, - * during a short window in time TLB entries with the old dom= ain - * ID but the new page tables may have been inserted. This c= ould - * affect I/O of other devices using this same (old) domain I= D. - * Such updating therefore is not a problem if this was the o= nly - * device associated with the old domain ID. Diverting I/O o= f any - * of a dying domain's devices to the quarantine page tables = is - * intended anyway. - */ - !pdev->domain->is_dying && - pdev->domain !=3D dom_io && - (any_pdev_behind_iommu(pdev->domain, pdev, iommu) || - pdev->phantom_stride) ) - AMD_IOMMU_WARN(" %pp: reassignment may cause %pd data corrupti= on\n", - &PCI_SBDF(pdev->seg, bus, devfn), pdev->domain); =20 /* * Check remaining settings are still in place from an earlier call --=20 2.51.2 -- Teddy Astie | Vates XCP-ng Developer XCP-ng & Xen Orchestra - Vates solutions web: https://vates.tech