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 Received: from smtp4.osuosl.org (smtp4.osuosl.org [140.211.166.137]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 5A29FC433EF for ; Wed, 16 Feb 2022 07:12:43 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id F21A2415FB; Wed, 16 Feb 2022 07:12:42 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id I5SmWBbDHgtd; Wed, 16 Feb 2022 07:12:42 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by smtp4.osuosl.org (Postfix) with ESMTPS id ED6E24159E; Wed, 16 Feb 2022 07:12:41 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id BE855C0011; Wed, 16 Feb 2022 07:12:41 +0000 (UTC) Received: from smtp2.osuosl.org (smtp2.osuosl.org [IPv6:2605:bc80:3010::133]) by lists.linuxfoundation.org (Postfix) with ESMTP id A6EDAC000B for ; Wed, 16 Feb 2022 07:12:40 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp2.osuosl.org (Postfix) with ESMTP id 775F0408D8 for ; Wed, 16 Feb 2022 07:12:40 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Authentication-Results: smtp2.osuosl.org (amavisd-new); dkim=pass (2048-bit key) header.d=intel.com Received: from smtp2.osuosl.org ([127.0.0.1]) by localhost (smtp2.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id uS2S0EZ688WN for ; Wed, 16 Feb 2022 07:12:38 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.8.0 Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by smtp2.osuosl.org (Postfix) with ESMTPS id 64F4C4010E for ; Wed, 16 Feb 2022 07:12:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1644995558; x=1676531558; h=message-id:date:mime-version:cc:subject:to:references: from:in-reply-to:content-transfer-encoding; bh=f1SXQpu92IOX79PPCsU+PF8QzhMB5xnZr5Wm6Vd3XBk=; b=FPq3x+ywNajS37KJdJbW7Enep+IXXV04gLtjaMSe/6Eojy8TnR/dtuCn O4DDFoFn7uLzwsXMWDkPXHzsogyBsSuvj876kxXOqbQLAhhHrjX9oTl6a scAl0TOcZlq7I3nbVcbKDaxrhU3/z3tCD+zVNNZcgirgr0C2rOC3MZqFQ A+h+y8McVAKcPf0N9zMS18iNEKas2+aS/nvzptABici3XCNRJmnP+jkFV Ft5ZMf7HmmlHT5eumxPc9FKOl/th/DBzwL5pZo2W50637xyHZOSITrqvn OJrXAeaIExxfr36S6+jGoa0DXFjfTea52NW4CeqQt6IuyrvJNjV4o7SSF w==; X-IronPort-AV: E=McAfee;i="6200,9189,10259"; a="250740934" X-IronPort-AV: E=Sophos;i="5.88,373,1635231600"; d="scan'208";a="250740934" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Feb 2022 23:12:37 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.88,373,1635231600"; d="scan'208";a="681390279" Received: from allen-box.sh.intel.com (HELO [10.239.159.118]) ([10.239.159.118]) by fmsmga001.fm.intel.com with ESMTP; 15 Feb 2022 23:12:35 -0800 Message-ID: Date: Wed, 16 Feb 2022 15:11:15 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.5.0 Subject: Re: [PATCH v2 09/11] iommu/vt-d: Remove commented code Content-Language: en-US To: "Tian, Kevin" , Christoph Hellwig References: <20220214025704.3184654-1-baolu.lu@linux.intel.com> <20220214025704.3184654-10-baolu.lu@linux.intel.com> <20220214073424.GE17411@lst.de> From: Lu Baolu In-Reply-To: Cc: "Raj, Ashok" , "linux-kernel@vger.kernel.org" , "iommu@lists.linux-foundation.org" , Jason Gunthorpe , Robin Murphy X-BeenThere: iommu@lists.linux-foundation.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Development issues for Linux IOMMU support List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Errors-To: iommu-bounces@lists.linux-foundation.org Sender: "iommu" On 2/16/22 11:45 AM, Tian, Kevin wrote: >> From: Christoph Hellwig >> Sent: Monday, February 14, 2022 3:34 PM >> >> On Mon, Feb 14, 2022 at 10:57:02AM +0800, Lu Baolu wrote: >>> This removes unnecessary commented code. >> Removing dead code is always good: >> >> Reviewed-by: Christoph Hellwig >> >> But someone might really want to take a look if draining makes sense here >> or not. > Looks that dead code has been there since intel-iommu driver was > firstly introduced in 2007. I don't know whether we can dig out > the reason (Baolu, can you have a check?) why it's only special > cased for read draining but not write draining. I cannot find any > such recommendation from VT-d spec. Emm, I have no idea either. Let me check it with the architecture experts. > > Looking at VT-d spec it stated that since VT-d major version 2 > drain is conducted automatically by hardware and above flags > are essentially ignored. > > Given that possibly a safer option is to always set read/write > draining flags before version 2 and skip it after. Best regards, baolu _______________________________________________ iommu mailing list iommu@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/iommu 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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id C3595C433EF for ; Wed, 16 Feb 2022 07:13:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229789AbiBPHN0 (ORCPT ); Wed, 16 Feb 2022 02:13:26 -0500 Received: from gmail-smtp-in.l.google.com ([23.128.96.19]:40336 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229741AbiBPHNW (ORCPT ); Wed, 16 Feb 2022 02:13:22 -0500 Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C360C39B for ; Tue, 15 Feb 2022 23:13:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1644995583; x=1676531583; h=message-id:date:mime-version:cc:subject:to:references: from:in-reply-to:content-transfer-encoding; bh=f1SXQpu92IOX79PPCsU+PF8QzhMB5xnZr5Wm6Vd3XBk=; b=ATRrynpQMkQciG3aqfxrgimfjp+R5uWC/M5mHdXiIH0vlWvYsUCMmNJ8 /bfrayBdxrqFG2URbs7AbTcEPwDtJdBCTS1LJimr/f60W0HzKFD7kjWXA H4DjAv4kQpagO7/wAHYRW38DvOJwBM4ulnovhA9oXm6ZBF+arRt8hPTdK VZhTlIFbU1ULPdoCBPeLELNIROAB4xhB+lO+s8Unpy0FdULxFIquqb9/Z pTeC9rfTzQvhaxH1QR8ERGmJHvc4idnhpJgn2HVB4gNghWr84o47fwSOT 1J9PLffJDq2XUS0fB9xG/CB1lY7Z9gP9LkfOVMU+Lat0uZJ5x44rlDU0V w==; X-IronPort-AV: E=McAfee;i="6200,9189,10259"; a="249371606" X-IronPort-AV: E=Sophos;i="5.88,373,1635231600"; d="scan'208";a="249371606" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Feb 2022 23:12:37 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.88,373,1635231600"; d="scan'208";a="681390279" Received: from allen-box.sh.intel.com (HELO [10.239.159.118]) ([10.239.159.118]) by fmsmga001.fm.intel.com with ESMTP; 15 Feb 2022 23:12:35 -0800 Message-ID: Date: Wed, 16 Feb 2022 15:11:15 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.5.0 Cc: baolu.lu@linux.intel.com, Joerg Roedel , "Raj, Ashok" , "Liu, Yi L" , Jacob Pan , Robin Murphy , Jason Gunthorpe , "iommu@lists.linux-foundation.org" , "linux-kernel@vger.kernel.org" Subject: Re: [PATCH v2 09/11] iommu/vt-d: Remove commented code Content-Language: en-US To: "Tian, Kevin" , Christoph Hellwig References: <20220214025704.3184654-1-baolu.lu@linux.intel.com> <20220214025704.3184654-10-baolu.lu@linux.intel.com> <20220214073424.GE17411@lst.de> From: Lu Baolu In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2/16/22 11:45 AM, Tian, Kevin wrote: >> From: Christoph Hellwig >> Sent: Monday, February 14, 2022 3:34 PM >> >> On Mon, Feb 14, 2022 at 10:57:02AM +0800, Lu Baolu wrote: >>> This removes unnecessary commented code. >> Removing dead code is always good: >> >> Reviewed-by: Christoph Hellwig >> >> But someone might really want to take a look if draining makes sense here >> or not. > Looks that dead code has been there since intel-iommu driver was > firstly introduced in 2007. I don't know whether we can dig out > the reason (Baolu, can you have a check?) why it's only special > cased for read draining but not write draining. I cannot find any > such recommendation from VT-d spec. Emm, I have no idea either. Let me check it with the architecture experts. > > Looking at VT-d spec it stated that since VT-d major version 2 > drain is conducted automatically by hardware and above flags > are essentially ignored. > > Given that possibly a safer option is to always set read/write > draining flags before version 2 and skip it after. Best regards, baolu