Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp4449327rdb; Mon, 11 Dec 2023 22:26:02 -0800 (PST) X-Google-Smtp-Source: AGHT+IGkayM5Gl5LvuknMGl+A+T3bwbLN0wpJUciaB5Xo/yTmf/NcLXKk2NlScrdHuuLl03g/Bgp X-Received: by 2002:a9d:62c2:0:b0:6d8:8007:d56f with SMTP id z2-20020a9d62c2000000b006d88007d56fmr5686083otk.28.1702362362143; Mon, 11 Dec 2023 22:26:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702362362; cv=none; d=google.com; s=arc-20160816; b=qD5hyytlNWUOb5LU9UyGL5i2O2/8oszZzCUQQz8SXugZbJrKgDOxJjNUGay+tlDgxT xQ88QGeDC4p6bSmuuLvtUyKkHO8rqEWBmsjxqrYX3lyPeZt84rrVg73bC0rkHlQa6PcO AWO52nYEcrAjoTWKbZZt61bc2mPjw8VkTJByRzg2kMfXp9JO3MZ7SnshP57iwYz8Hb3Z YD9zLSJfdpdMag1enjauXOfNhaMFNPXJVvKVrcwQXg4TyI2022/nHsp/Bk1Iry5b3iFW PXA6Ct35RFXXEkLOL5Szb9+RJ9nv9pYrTAkyeyAMGiusN9zNiK3xS68cNLuLoxUjIohK VPbA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:to:content-language:subject:cc:user-agent:mime-version :date:message-id:dkim-signature; bh=+e1poe8UAYm9xICMeRfTMGpQsC8V9OjlgedHG9H0Plg=; fh=TVibWF85LnPLzNJ9WuDZofsqNQ0017MGiYBvX2LAmps=; b=aGegWJ4frJp5qj1CDcGkWrHJAVLNsUJh7TjFRfpHqXxjds0LbRWZTY2Nkku5U0jBZm ELeCaJpQPDJ38mLCwAwVdnkD4bV2/HZypYDjEeQD8rw9h7OHHz9Qd86CywwSi0e3SNcn GxhDWGHAm3PaZLUAhrAwp2C8I2sPh4ovc2TAHXy2Z8190OeJ1weYqZlV1nYXpwH+pLBt FYnlIqTg2dTONZxyro40Avk7dKNlJx116S/g6QUa+dDK/lb9HdUbJQZBud9WjkPZy3B+ xvopIp0chNmkcI/H9LfG6sddr14USZw+oDU12+QqQwNZrlTk/U3nLM9PDzKsrSRpEObG JOWw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=mojpuUH6; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from groat.vger.email (groat.vger.email. [2620:137:e000::3:5]) by mx.google.com with ESMTPS id k1-20020a63d841000000b00584ca25959csi7200990pgj.540.2023.12.11.22.26.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 Dec 2023 22:26:02 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) client-ip=2620:137:e000::3:5; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=mojpuUH6; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id 8FB3C809A786; Mon, 11 Dec 2023 22:25:59 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230080AbjLLGZe (ORCPT + 99 others); Tue, 12 Dec 2023 01:25:34 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37932 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229515AbjLLGZc (ORCPT ); Tue, 12 Dec 2023 01:25:32 -0500 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.9]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 03E16BF for ; Mon, 11 Dec 2023 22:25:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1702362339; x=1733898339; h=message-id:date:mime-version:cc:subject:to:references: from:in-reply-to:content-transfer-encoding; bh=kACYgNP4fFKqMuvf/CAgyapT7zWGWBcU7fPSLJDh5J0=; b=mojpuUH6D8O5DyDyn11mph6ctrKVSxOsqUUpOGnDmWV7AxiF76RPiwKz tCA3w1FQDnxDwrarKeP29tmF+7z+KgxuGjb7FcrBobWF17r6+yaCWYC6m ClSVKDcJybI49XFXQeimwYqv2UmtqetdoRmqanT9pGc1js+kc11whyWWr vZBp8BBvtQq9oajbKbcMqB11ABG9DrkxhzOFsfCFLzI/VK+AgXCZdhgzB YLOoZ1wSXPX9Nie0ZaGJcO6v5OJ20UBMjXiiy4sskPz0SRSuPkUkZ6494 /wHs81gmTMK/y0aGz/j9tQRxl/CQEjSEjb2Y46l52d3+RcoZVMKrP0RUg A==; X-IronPort-AV: E=McAfee;i="6600,9927,10921"; a="1622586" X-IronPort-AV: E=Sophos;i="6.04,269,1695711600"; d="scan'208";a="1622586" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmvoesa103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Dec 2023 22:25:39 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10921"; a="802347749" X-IronPort-AV: E=Sophos;i="6.04,269,1695711600"; d="scan'208";a="802347749" Received: from allen-box.sh.intel.com (HELO [10.239.159.127]) ([10.239.159.127]) by orsmga008.jf.intel.com with ESMTP; 11 Dec 2023 22:25:35 -0800 Message-ID: Date: Tue, 12 Dec 2023 14:20:56 +0800 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Cc: baolu.lu@linux.intel.com, "iommu@lists.linux.dev" , "linux-kernel@vger.kernel.org" Subject: Re: [PATCH v2 4/6] iommu/vt-d: Remove 1:1 mappings from identity domain Content-Language: en-US To: "Tian, Kevin" , Joerg Roedel , Will Deacon , Robin Murphy , Jason Gunthorpe References: <20231205012203.244584-1-baolu.lu@linux.intel.com> <20231205012203.244584-5-baolu.lu@linux.intel.com> <1161d8aa-9fcc-4e9e-a7d3-c461fee19a54@linux.intel.com> From: Baolu Lu In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (groat.vger.email [0.0.0.0]); Mon, 11 Dec 2023 22:25:59 -0800 (PST) On 12/11/23 11:58 AM, Tian, Kevin wrote: >>> there are two cases above which mandates IDENTITY. Have you confirmed >>> that those platforms support hardware passthrough? otherwise this >> change >>> is broken. >> Those two cases should be hardware quirks for SoC-integrated devices. It >> makes no reason that a quirk requires IOMMU passthrough translation, but >> the hardware doesn't support it. >> >> If, unfortunately, those quirks turn out to be workarounds for a poorly >> designed device driver, we should remove those quirks and request the >> device driver to utilize the DMA ownership framework to achieve the same >> functionality within the driver itself. >> > if that is the case you should fix the drivers first before breaking them. > > But at a glance looks those two quirks are just fine. > > For Azalia sound device the problem is that BIOS enables a dedicated > DMAR for it but allocates zero TLB entries to cause deadlock. This > implies a hw passthrough mode otherwise it's still broken. Yes. It's safe for Azalia sound device. > > For GFX it's a workaround added since day one. there is even still > an option CONFIG_INTEL_IOMMU_BROKEN_GFX_WA available. But > now its meaning is really disabling IOMMU instead of using identity. > > sounds like IDENTMAP_GFX can be fully removed now: > > #ifdef CONFIG_INTEL_IOMMU_BROKEN_GFX_WA > dmar_map_gfx = 0; > #endif We should already remove the workaround for the 2.6 kernel. :-) It's default "n". Therefore, if any gfx driver still needs this workaround, there should already be a bug report. > > if (!dmar_map_gfx) > iommu_identity_mapping |= IDENTMAP_GFX; So with above cleaned up, we have no need to worry about drivers that are not capable of handling remapped dma address any more. Did I miss anything? Best regards, baolu