From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4DCB1C433E3 for ; Fri, 14 Aug 2020 07:16:31 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 1BCFA20639 for ; Fri, 14 Aug 2020 07:16:31 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=amazon.co.uk header.i=@amazon.co.uk header.b="mOQC7TbC" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1BCFA20639 Authentication-Results: mail.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=amazon.co.uk Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1k6Twm-0006St-GF; Fri, 14 Aug 2020 07:16:16 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1k6Twm-0006So-1V for xen-devel@lists.xenproject.org; Fri, 14 Aug 2020 07:16:16 +0000 X-Inumbo-ID: ea522c24-4e4c-4e05-a2e4-25ebb388b03a Received: from smtp-fw-6001.amazon.com (unknown [52.95.48.154]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id ea522c24-4e4c-4e05-a2e4-25ebb388b03a; Fri, 14 Aug 2020 07:16:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amazon.co.uk; i=@amazon.co.uk; q=dns/txt; s=amazon201209; t=1597389375; x=1628925375; h=from:to:cc:date:message-id:references:in-reply-to: content-transfer-encoding:mime-version:subject; bh=j4llBa6Lpz/atsVhqJvcCUSnyjX22/m1Iv/zQvusq3c=; b=mOQC7TbCKWXXKuzjc60GkgFC0RLEcqdRTK2CKjWZOYUQsCKfm31f55vj eVEHAO0ERGBpBiHfrvztI5F+QehEhNffJYilG+desxJ5HMCHS5q/Os1gX r9PJe16P90QK6T9+FZBbzBIYS1ZBq0v5xDN+MKqRAKrRGtvVOYPMuVyZQ g=; X-IronPort-AV: E=Sophos;i="5.76,311,1592870400"; d="scan'208";a="49239214" Subject: RE: [PATCH v4 03/14] x86/iommu: convert VT-d code to use new page table allocator Thread-Topic: [PATCH v4 03/14] x86/iommu: convert VT-d code to use new page table allocator Received: from iad12-co-svc-p1-lb1-vlan3.amazon.com (HELO email-inbound-relay-2b-a7fdc47a.us-west-2.amazon.com) ([10.43.8.6]) by smtp-border-fw-out-6001.iad6.amazon.com with ESMTP; 14 Aug 2020 07:16:14 +0000 Received: from EX13MTAUEA001.ant.amazon.com (pdx4-ws-svc-p6-lb7-vlan2.pdx.amazon.com [10.170.41.162]) by email-inbound-relay-2b-a7fdc47a.us-west-2.amazon.com (Postfix) with ESMTPS id 8FFCAC05F6; Fri, 14 Aug 2020 07:16:13 +0000 (UTC) Received: from EX13D32EUC003.ant.amazon.com (10.43.164.24) by EX13MTAUEA001.ant.amazon.com (10.43.61.243) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Fri, 14 Aug 2020 07:16:13 +0000 Received: from EX13D32EUC003.ant.amazon.com (10.43.164.24) by EX13D32EUC003.ant.amazon.com (10.43.164.24) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Fri, 14 Aug 2020 07:16:12 +0000 Received: from EX13D32EUC003.ant.amazon.com ([10.43.164.24]) by EX13D32EUC003.ant.amazon.com ([10.43.164.24]) with mapi id 15.00.1497.006; Fri, 14 Aug 2020 07:16:12 +0000 From: "Durrant, Paul" To: "Tian, Kevin" , Paul Durrant , "xen-devel@lists.xenproject.org" CC: Jan Beulich Thread-Index: AQHWamUacjhbO8W3fkGXDLamh0t/Jqk3NaCQgAAKexA= Date: Fri, 14 Aug 2020 07:16:12 +0000 Message-ID: References: <20200804134209.8717-1-paul@xen.org> <20200804134209.8717-4-paul@xen.org> In-Reply-To: Accept-Language: en-GB, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-exchange-transport-fromentityheader: Hosted x-originating-ip: [10.43.165.145] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Precedence: Bulk X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.29 List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" > -----Original Message----- [snip] > > -static void iommu_free_page_table(struct page_info *pg) > > -{ > > - unsigned int i, next_level =3D PFN_ORDER(pg) - 1; > > - u64 pt_maddr =3D page_to_maddr(pg); > > - struct dma_pte *pt_vaddr, *pte; > > - > > - PFN_ORDER(pg) =3D 0; > > - pt_vaddr =3D (struct dma_pte *)map_vtd_domain_page(pt_maddr); > > - > > - for ( i =3D 0; i < PTE_NUM; i++ ) > > - { > > - pte =3D &pt_vaddr[i]; > > - if ( !dma_pte_present(*pte) ) > > - continue; > > - > > - if ( next_level >=3D 1 ) > > - iommu_free_pagetable(dma_pte_addr(*pte), next_level); > > - > > - dma_clear_pte(*pte); > > - iommu_sync_cache(pte, sizeof(struct dma_pte)); >=20 > I didn't see sync_cache in the new iommu_free_pgtables. Is it intended > (i.e. original flush is meaningless) or overlooked? >=20 The original v1 combined patch had the comment: NOTE: There is no need to clear and sync PTEs during teardown since the per= - device root entries will have already been cleared (when devices were de-assigned) so the page tables can no longer be accessed by the IOMM= U. I should have included that note in this one. I'll fix in v5. Paul > Thanks > Kevin