Received: by 2002:ab2:7407:0:b0:1f4:b336:87c4 with SMTP id e7csp67216lqn; Thu, 11 Apr 2024 14:08:35 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCV3w8iVQHnVZA3CnuIC+PbrytZ46/DLYu0UTg4LnIwSNmy5oRrq/JvEZwtKXbknATJ5Ui4JkC/8wvCpEWdr3paPU4pf1BgIKSw5d+nE0A== X-Google-Smtp-Source: AGHT+IFVxczgmesRs+wWQVZxvQKZN287LmDxp7YNjDMTCKeb5JLq3WxTdTMMvB6zHd0GuASDM1GD X-Received: by 2002:a05:6a00:14cb:b0:6ed:89c1:5e0c with SMTP id w11-20020a056a0014cb00b006ed89c15e0cmr998311pfu.34.1712869715659; Thu, 11 Apr 2024 14:08:35 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712869715; cv=pass; d=google.com; s=arc-20160816; b=B7tn+0Irp0n8CQlPgPI0xHS1zL8SjGQtvdYqdvA/Y1XcRL2h3S6dnTNX/wF1rx9Iky VQE1xmN1E0W5tWUSBH9kXfx1Ksia8ailOBSmLzsQy5Er/3OSK5cs40bjconsZqJj2j+R eM2yIu5mHlucVpzUYMBKspU/LyL+19G1YAwc9RUfRo1gQ7eZGKvwgX7YAzvzCpLsfGkS Dk31sVEUC0/ZKgESz+HBM3k9P/mtosWu1sl5ABrYksuCE0uKDtER4Fm371FYmh8pvBDa zkQufmUs7aXxix7hlV3vJ6wqeEHGHIniiamwmJFL1I00bmM1CfxYnTW8NSnVliscLVHw IvGg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:organization:references :in-reply-to:message-id:subject:cc:to:from:date:dkim-signature; bh=Ste3hs898oY4JymCpqkQPQ+wOzAfJMHAg0dyCH1Yuu0=; fh=nNgMSg1CBo7t1jwb0TWq7UvjAJGFvKRVSONPifHgO/8=; b=nLtbttuSf29r0LIq/aAA8ARsy86UYxczQyswbXFCXCq45K/TJyYO30WT5/YbARRpcU qhK5sIvhuv5s3IQYCA23+oSUNg7KtldxlmYThId6RhH31biigCexO/fiikWtQ6VjT2Xy x0kRuclmDMnV4lTdzBgHpDmPyFj/5eEV1STu5J04HT/rqbwDGBztP5Ja4yoyS4KFkNW8 ysaemFPPN2G+TpkdVLBzVRAxtHEqH+aaO2rCrW9QmD36DcR3sy81FCeoBgfrlbWCKWz1 JprtQQfU+MaPqaS2DZU1cicxtOMe4m0gparGNIxv91ERbiaTNFqtdOqMPdWGy5mqww23 ptvg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b="OF74/pDH"; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-141295-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-141295-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id n5-20020a637205000000b005dc48827a3asi1900051pgc.227.2024.04.11.14.08.35 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 11 Apr 2024 14:08:35 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-141295-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b="OF74/pDH"; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-141295-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-141295-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 10752B2C030 for ; Thu, 11 Apr 2024 17:42:26 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 6327F15B561; Thu, 11 Apr 2024 16:13:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="OF74/pDH" Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.16]) (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 235571514C7 for ; Thu, 11 Apr 2024 16:13:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.16 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712852004; cv=none; b=qCDwvvqW3DQZoNnzHNcafwORaFoDqcwetGHqnlg0pwVBT+dSOmJWEDxUFzyzz4NPXBFp4zhTpYeJLtdlSBYM1fn8UtFdkocSEaK0A9QSJFT7crRXBTZVs8HT+XutXdnsIcXRrRGjxmWddQZBK7QMPqqj9PowGjtxks4qYQmxvl4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712852004; c=relaxed/simple; bh=tCCBcJnRbz3n4CBXmbeZiDjsy06LWfoWVjBmcrN/U7A=; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=ri2C2lm/+uNWWOiqCP8nsBNHZSpEHBTjo9UEIC+bivv1WSOjwb/wI0wezkpiNc8vCCGbcww0dKT1jl1+pnqX2aFivh+TGoax3b9bhEJFAlrqmeli+XsUxgJadiReMRk8dhNaQFKkycFYYpS+I1smayHRprMcnagmfjGeGworVWQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=none smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=OF74/pDH; arc=none smtp.client-ip=198.175.65.16 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux.intel.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1712852003; x=1744388003; h=date:from:to:cc:subject:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=tCCBcJnRbz3n4CBXmbeZiDjsy06LWfoWVjBmcrN/U7A=; b=OF74/pDH0aFmGTWnSXcLkMEm4dYxIPYfUtG3xHcmwwTYsdHtO4qlJA+C iOiWcISOH+p5b4q7i4TxuQh1KBOo7O0dfq49Md9CuWtoPJ4w/b3sG5D64 Kgqewzt1mrguQmUIbXqcSFt2Sm7Y7RDGjXbHNpvpKvUVXX+DUSAw6pjDh D774ain/d715tSeuqQmRJZ+VWwKgcfu8de3FS6rXHifj7IpJLYbD5Rdx8 q5oFwHVi0rMJ2tifdSla9KEPynJXicSN38vYMqSl10gpZFftThyZSd+x8 nLV8ZxhPmiFz7QAFfoqph7wWuIOKlBsFiSxSS+3o/XVa0d/u06vkBwSSI w==; X-CSE-ConnectionGUID: Ypri3OcVSZWMbBK5MDtoHg== X-CSE-MsgGUID: m2Tq9zuIRg6MB/22ruhyPw== X-IronPort-AV: E=McAfee;i="6600,9927,11041"; a="8405198" X-IronPort-AV: E=Sophos;i="6.07,193,1708416000"; d="scan'208";a="8405198" Received: from orviesa001.jf.intel.com ([10.64.159.141]) by orvoesa108.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Apr 2024 09:13:19 -0700 X-CSE-ConnectionGUID: wmsppSE+T3KmTbVvEwIwYw== X-CSE-MsgGUID: 78q6r7BoSc6CYStYktSTHg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.07,193,1708416000"; d="scan'208";a="58364178" Received: from jacob-builder.jf.intel.com (HELO jacob-builder) ([10.54.39.125]) by smtpauth.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Apr 2024 09:13:19 -0700 Date: Thu, 11 Apr 2024 09:17:49 -0700 From: Jacob Pan To: "Tian, Kevin" Cc: Baolu Lu , "iommu@lists.linux.dev" , "Liu, Yi L" , Joerg Roedel , Will Deacon , Robin Murphy , "linux-kernel@vger.kernel.org" , jacob.jun.pan@linux.intel.com Subject: Re: [PATCH 2/2] iommu/vt-d: Remove caching mode check before devtlb flush Message-ID: <20240411091749.20afae6b@jacob-builder> In-Reply-To: References: <20240407144232.190355-1-baolu.lu@linux.intel.com> <20240407144232.190355-2-baolu.lu@linux.intel.com> <20240408140329.6290377f@jacob-builder> <20240409103146.0d155e45@jacob-builder> <20240410091955.5c00e411@jacob-builder> Organization: OTC X-Mailer: Claws Mail 3.17.5 (GTK+ 2.24.32; x86_64-pc-linux-gnu) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Hi Kevin, On Wed, 10 Apr 2024 23:23:57 +0000, "Tian, Kevin" wrote: > > From: Jacob Pan > > Sent: Thursday, April 11, 2024 12:20 AM > > > > Hi Kevin, > > > > On Wed, 10 Apr 2024 00:32:06 +0000, "Tian, Kevin" > > wrote: > > > > > > From: Jacob Pan > > > > Sent: Wednesday, April 10, 2024 1:32 AM > > > > > > > > If the guest uses SL page tables in vIOMMU, we don;t expose ATS to > > > > the guest. So ATS is not relevant here, does't matter map or unmap. > > > > > > > > > > ATS is orthogonal to SL vs. FL. Where is this restriction coming > > > from? > > For practical purposes, what would be the usage to have SL in the guest > > and ATS enabled. i.e. shadowing SL but directly expose ATS? > > > > ATS is about the protocol between device and iommu to look up > translations. Why does it care about internal paging layout in > iommu? > Maybe the original intent was missed, I was suggesting the devTLB flush should be based on ATS cap (as you said here) not map/unmap. - /* - * In caching mode, changes of pages from non-present to present require - * flush. However, device IOTLB doesn't need to be flushed in this case. - */ - if (!cap_caching_mode(iommu->cap) || !map) - iommu_flush_dev_iotlb(domain, addr, mask); + iommu_flush_dev_iotlb(domain, addr, mask); Thanks, Jacob