From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D0B4B628 for ; Thu, 9 Mar 2023 02:06:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1678327577; x=1709863577; h=message-id:date:mime-version:cc:subject:to:references: from:in-reply-to:content-transfer-encoding; bh=vF2nj2/OYe2VSDrJh0vBQhjBrkwi0KFxwuhhKdnK85E=; b=BRKx/i8Gmo8p+0ySYYr0bsBjLInMUNrihzlo0qSb8OpXJJhX4cnll5mJ d5Me3a97oHkEakDoVh0bc/05vldV26hU8MnGj5V+kl8/ROZH2J0JyCKQn d34DqsRztT4dPFFDk+2s+dmm+wXO26jh2BBNiYJmOXHVb/8yR3zR/4Grb Dl6Yg4znCwqJE63YYRl5nZGFXy0YoPyzj5LVIl1Oru6sLZUWlVDimTS6+ mFGRM1PN/CIXjDLKO1uETNktX0NUJOeumO/HP8CS6DUQLt5z8iBaVWdeu 0F9/kGvyPt7WzrgeCSFJbF0uUTePDAkcDdg4V2vpTAdGtsZDtKMKjkHn7 Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10643"; a="363967268" X-IronPort-AV: E=Sophos;i="5.98,244,1673942400"; d="scan'208";a="363967268" Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Mar 2023 18:06:17 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10643"; a="679565192" X-IronPort-AV: E=Sophos;i="5.98,244,1673942400"; d="scan'208";a="679565192" Received: from allen-box.sh.intel.com (HELO [10.239.159.48]) ([10.239.159.48]) by fmsmga007.fm.intel.com with ESMTP; 08 Mar 2023 18:06:15 -0800 Message-ID: Date: Thu, 9 Mar 2023 10:05:16 +0800 Precedence: bulk X-Mailing-List: iommu@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.7.1 Cc: baolu.lu@linux.intel.com, kvm@vger.kernel.org, Nicolin Chen , Yi Liu Subject: Re: [PATCH v2 09/17] iommufd: Add enforced_cache_coherency to iommufd_hw_pagetable_alloc() Content-Language: en-US To: Jason Gunthorpe , iommu@lists.linux.dev, Kevin Tian , linux-kselftest@vger.kernel.org References: <9-v2-51b9896e7862+8a8c-iommufd_alloc_jgg@nvidia.com> From: Baolu Lu In-Reply-To: <9-v2-51b9896e7862+8a8c-iommufd_alloc_jgg@nvidia.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 3/8/23 8:35 AM, Jason Gunthorpe wrote: > Logically the HWPT should have the coherency set properly for the device > that it is being created for when it is created. > > This was happening implicitly if the immediate_attach was set because > iommufd_hw_pagetable_attach() does it as the first thing. > > Do it unconditionally so !immediate_attach works properly. > > Reviewed-by: Kevin Tian > Signed-off-by: Jason Gunthorpe Reviewed-by: Lu Baolu Best regards, baolu