Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp657428pxj; Thu, 10 Jun 2021 09:33:05 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyyVk6FmfDb85Ucsa0iVyvxAWOVn+dBFz+luOOpIyeuU/pWveGuskxUgwjwl6vz3ZW2aavq X-Received: by 2002:a05:6402:b11:: with SMTP id bm17mr307416edb.109.1623342785525; Thu, 10 Jun 2021 09:33:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623342785; cv=none; d=google.com; s=arc-20160816; b=uvnmY6Bx/pbajPUKEedFj19Hw1GDJkbQ8kfp41v06ba8MLQ7RXQ5jgHZrXnNrIJSY0 OqLlY7702mTrVDlWZQtPCVSr4jC5R820xfb8iM7awdYNyiFjEMVbkFA9HvqJarchVDdU ht0ZzeVthqL2g3tbkC95G1XoSGXTQ4x4o1lcxdbAYoaMvs17s1wjc7qWocLw+nBnegLY c4z/8N26r6ft/830QcolyvLpsvnugY/eHgdjIUzWsHaCWRLQ9OjS29uwRaajAHkrjwRF YH4kPKPg9aUV0BIoDxgXDsOoTfkYMiPdT3e4uLaYuaA4RV1brubi3h0yFIauQ3T3XbZ4 PjVA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:references:cc :to:subject:from; bh=AHcvFP5CW8HHvyQ52W+B1KPoIyPdFGXGeJzN3Ph+RVU=; b=tK49AllUHo21wp613AXh15FqrbvMir8IVLIBf4HXPFp6/8H2JL8vffrradyGneSARA ayQnAh7IhbSTs1SSzCVnZ9bZ4BQLXrX78+DrDFgBBPWxhOJXMAIuheoL7AJ2XcOu9Hur X4SJSLznpckO1NuG206HqMY1KkZ46ctEjUkMX0eF6QYGlBkmzTJpT9haO1TB1L/d7TIh AoF5sS/e5wqWIGej/6eOFiTc2UvPax+cBjVqm+F+hfTkHoyzjjfpBkXJx1F13vRIM8Ds oPL0BAaa1t+pt3xyKtNarV4k1DLdOHljg4Ve2lyTzRD1LrgmCLT9PGAFGMBgYX6Vb7Jj qKlQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id t23si2733718ejj.290.2021.06.10.09.32.40; Thu, 10 Jun 2021 09:33:05 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230445AbhFJQdc (ORCPT + 99 others); Thu, 10 Jun 2021 12:33:32 -0400 Received: from frasgout.his.huawei.com ([185.176.79.56]:3204 "EHLO frasgout.his.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230280AbhFJQdb (ORCPT ); Thu, 10 Jun 2021 12:33:31 -0400 Received: from fraeml705-chm.china.huawei.com (unknown [172.18.147.206]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4G18Pt73ckz6H6jZ; Fri, 11 Jun 2021 00:22:10 +0800 (CST) Received: from lhreml724-chm.china.huawei.com (10.201.108.75) by fraeml705-chm.china.huawei.com (10.206.15.54) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2176.2; Thu, 10 Jun 2021 18:31:33 +0200 Received: from [10.47.80.201] (10.47.80.201) by lhreml724-chm.china.huawei.com (10.201.108.75) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.2; Thu, 10 Jun 2021 17:31:32 +0100 From: John Garry Subject: Re: [PATCH v11 0/3] Enhance IOMMU default DMA mode build options To: Joerg Roedel CC: , , , , , , , , , References: <1623158308-180604-1-git-send-email-john.garry@huawei.com> Message-ID: <4c1f02c5-fc6c-997f-19de-081efbb96566@huawei.com> Date: Thu, 10 Jun 2021 17:25:36 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.1.2 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="utf-8"; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [10.47.80.201] X-ClientProxiedBy: lhreml749-chm.china.huawei.com (10.201.108.199) To lhreml724-chm.china.huawei.com (10.201.108.75) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 09/06/2021 09:15, Joerg Roedel wrote: > On Tue, Jun 08, 2021 at 09:18:25PM +0800, John Garry wrote: >> Zhen Lei (3): >> iommu: Enhance IOMMU default DMA mode build options >> iommu/vt-d: Add support for IOMMU default DMA mode build options >> iommu/amd: Add support for IOMMU default DMA mode build options > So I like the idea, but can we go a step further and get (mostly) rid of > the driver-specific setup code for lazy/non-lazy mode? This can happen > in the dma-iommu code and the drivers only need to keep the support for > their legacy command line options. The AMD driver just maintains a flag and a print for the strict mode setting. The Intel driver still maintains some lazy vs strict config, depending on the platform: - DMAR caching mode set means that we enforce strict mode globally - workaround for ironlake gpu means that we enforce strict mode globally So there isn't much driver-specific setup remaining, and I can't see the intel stuff being moved into dma-iommu.c or asbtracted (for that). We could prob replace the driver-specific logs with new logs in iommu.c, and do away with maintaining the proprietary driver strict mode flags. That's if we're ok with replacing the driver-specific logs, though. Thanks, John