Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp434657ybl; Thu, 12 Dec 2019 21:44:50 -0800 (PST) X-Google-Smtp-Source: APXvYqw1LvNAM/r3taHcOnqxSTCHwSKOZKq66/9sBa7NAk7geV0+K+x8VWlFmhsUGn+f2n/jAFC1 X-Received: by 2002:a05:6830:15d9:: with SMTP id j25mr12196157otr.279.1576215890735; Thu, 12 Dec 2019 21:44:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576215890; cv=none; d=google.com; s=arc-20160816; b=ZFK5wVD4RdHua81tfaFOtUXDGMUIP/BBL/IHnkj/3us79ieszbZPZrjGsCyHQZFdvj /CukmVYUdAFmnCFkKXFaK8r8MpUpB2yfpRvmJ73srtV6KObh5YVv3XMiHfyzJxsrt0qC 2D95gKO8xMltBhh9GRM45o7eFQtvTdnc6SNURSK4BKcZT9zGhxAwB1qktpehnxdz9x+u ERLv0DqwR4vLjBGUBpsm+ALaJBMIvCS7njDL0vRRH1mMkp0dWrAMN+H0hgYu2z7gt/h3 phdNinmpS+lMbdnze2ggYP3yYy+paIew+OoLBo1XfkKAYtv8I6CNw6YUTsczTe+pHGpN oj2w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:mail-followup-to :reply-to:message-id:subject:cc:to:from:date:dkim-signature; bh=cwi+j/3c3L6Rt5/e01jNkvMX57Zg4McK7tkL0V4Tb6w=; b=HDD9Xps4AwxpRoeHi3uzEemhvYjqlw4vu2qrJ5zQCmGOMExwS/pHgzG/Hx5zCrGeQ+ EZJ1xXoCdDDkiQF0rYlSxMEcOgR5pzTdNHFEPSJ5Um7/OD93CtRBocmJnQejs8Mc6K8f nZ5+Q0jCxujFg3N5xTgKgIO1IZrYFnCx2lh7+pAeCZLoNBb9rgJNKXK74uwt9NuSkWhh F4t1TtsZ/i/CuY/+4i9mZbGh161y69OCQERqUgRnFLpc+1cw1fnDh1j+ApSXotShSzfb pMhXkiPw+PEBVbuh0jwD4KIzTqNZU4/dH5mPMzuDSQPiXispfu0+CFnNuzfXmbzWyrBQ lh9A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=B373uGGV; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o13si4694673otp.27.2019.12.12.21.44.36; Thu, 12 Dec 2019 21:44:50 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=B373uGGV; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732122AbfLMFmo (ORCPT + 99 others); Fri, 13 Dec 2019 00:42:44 -0500 Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120]:50615 "EHLO us-smtp-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1732100AbfLMFmo (ORCPT ); Fri, 13 Dec 2019 00:42:44 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1576215762; h=from:from:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=cwi+j/3c3L6Rt5/e01jNkvMX57Zg4McK7tkL0V4Tb6w=; b=B373uGGV4dPCawv4SthG2SvD3WV1gllnIb5gtaEZ/xmGZ91KIinzo1HeMgW11byhlxOubo TTSAnV/houIWE2jRdzw6hbTxro4Vb3+pOMOGpGARcQrc8PBMoAORl33t49qH82BCwnPzJL 7ND5aPnTIrmnSqV1l6BFBMYxo413dSg= Received: from mail-pg1-f200.google.com (mail-pg1-f200.google.com [209.85.215.200]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-408-0_j0QVrdPgiNZMbtGlkdwg-1; Fri, 13 Dec 2019 00:42:39 -0500 X-MC-Unique: 0_j0QVrdPgiNZMbtGlkdwg-1 Received: by mail-pg1-f200.google.com with SMTP id p1so745414pgg.19 for ; Thu, 12 Dec 2019 21:42:39 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:reply-to :mail-followup-to:references:mime-version:content-disposition :content-transfer-encoding:in-reply-to; bh=cwi+j/3c3L6Rt5/e01jNkvMX57Zg4McK7tkL0V4Tb6w=; b=oF3D9tETRD8s6emj1o+M1YxUPRe66zXZGuIUibLGe+nro4xgSqJ5fVvvyIGQAqIXs6 +L/GZPVq2yv/kcuDoJz0K73jFIHK/IFxtXUGJtZ6bNXUPjwrGn0W3NgFHJkQc39pBzTc BpjG/NgnR6c4ni3d/ZkjNOrNf+xEOl5u6DHMsFkLusGqTQGtvq3VMGWti+TZ9VxHYToU tYIpnGR9I1I+G6LNvv+PceiGCa0NDeLnAn8RJINqVPEWrLC2x+pXoyzeP+9l7PYYeMuo 7bJz267OypmQcFRmyfTwa35Tw/Z8N6IHUcVrHu5/OjbPqB8z0J6E6aPVEmyZVCL04RuP yDEw== X-Gm-Message-State: APjAAAX2OUUnzVl6IlCRfC70cpmvhn4+lA/UV0567mv56UdzEdT2+BPC YFLSm3qX6n3sL0ojhUPnV1SFc3fj2P2ZmPT4Gf0u/yQP54sMjbflVIs3fCiVHRaqVH6tQxCocj9 Rzb61QLsiCqSYLAXq44L+SmWf X-Received: by 2002:a17:902:8601:: with SMTP id f1mr13902160plo.291.1576215758092; Thu, 12 Dec 2019 21:42:38 -0800 (PST) X-Received: by 2002:a17:902:8601:: with SMTP id f1mr13902137plo.291.1576215757695; Thu, 12 Dec 2019 21:42:37 -0800 (PST) Received: from localhost (ip70-163-223-149.ph.ph.cox.net. [70.163.223.149]) by smtp.gmail.com with ESMTPSA id t5sm7910818pje.6.2019.12.12.21.42.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 Dec 2019 21:42:36 -0800 (PST) Date: Thu, 12 Dec 2019 22:42:17 -0700 From: Jerry Snitselaar To: Lu Baolu Cc: Joerg Roedel , David Woodhouse , ashok.raj@intel.com, jacob.jun.pan@intel.com, kevin.tian@intel.com, iommu@lists.linux-foundation.org, linux-kernel@vger.kernel.org, stable@vger.kernel.org Subject: Re: [PATCH 1/1] iommu/vt-d: Fix dmar pte read access not set error Message-ID: <20191213054217.sykaftujydkaa4r2@cantor> Reply-To: Jerry Snitselaar Mail-Followup-To: Lu Baolu , Joerg Roedel , David Woodhouse , ashok.raj@intel.com, jacob.jun.pan@intel.com, kevin.tian@intel.com, iommu@lists.linux-foundation.org, linux-kernel@vger.kernel.org, stable@vger.kernel.org References: <20191211014015.7898-1-baolu.lu@linux.intel.com> <20191212014952.vlrmxrk2cebwxjnp@cantor> <6f3bcad9-b9b3-b349-fdad-ce53a79a665b@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <6f3bcad9-b9b3-b349-fdad-ce53a79a665b@linux.intel.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu Dec 12 19, Lu Baolu wrote: >Hi, > >On 12/12/19 9:49 AM, Jerry Snitselaar wrote: >>On Wed Dec 11 19, Lu Baolu wrote: >>>If the default DMA domain of a group doesn't fit a device, it >>>will still sit in the group but use a private identity domain. >>>When map/unmap/iova_to_phys come through iommu API, the driver >>>should still serve them, otherwise, other devices in the same >>>group will be impacted. Since identity domain has been mapped >>>with the whole available memory space and RMRRs, we don't need >>>to worry about the impact on it. >>> >>>Link: https://www.spinics.net/lists/iommu/msg40416.html >>>Cc: Jerry Snitselaar >>>Reported-by: Jerry Snitselaar >>>Fixes: 942067f1b6b97 ("iommu/vt-d: Identify default domains >>>replaced with private") >>>Cc: stable@vger.kernel.org # v5.3+ >>>Signed-off-by: Lu Baolu >> >>Reviewed-by: Jerry Snitselaar > >Can you please try this fix and check whether it can fix your problem? >If it helps, do you mind adding a Tested-by? > >Best regards, >baolu > Tested-by: Jerry Snitselaar >> >>>--- >>>drivers/iommu/intel-iommu.c | 8 -------- >>>1 file changed, 8 deletions(-) >>> >>>diff --git a/drivers/iommu/intel-iommu.c b/drivers/iommu/intel-iommu.c >>>index 0c8d81f56a30..b73bebea9148 100644 >>>--- a/drivers/iommu/intel-iommu.c >>>+++ b/drivers/iommu/intel-iommu.c >>>@@ -5478,9 +5478,6 @@ static int intel_iommu_map(struct >>>iommu_domain *domain, >>>    int prot = 0; >>>    int ret; >>> >>>-    if (dmar_domain->flags & DOMAIN_FLAG_LOSE_CHILDREN) >>>-        return -EINVAL; >>>- >>>    if (iommu_prot & IOMMU_READ) >>>        prot |= DMA_PTE_READ; >>>    if (iommu_prot & IOMMU_WRITE) >>>@@ -5523,8 +5520,6 @@ static size_t intel_iommu_unmap(struct >>>iommu_domain *domain, >>>    /* Cope with horrid API which requires us to unmap more than the >>>       size argument if it happens to be a large-page mapping. */ >>>    BUG_ON(!pfn_to_dma_pte(dmar_domain, iova >> VTD_PAGE_SHIFT, &level)); >>>-    if (dmar_domain->flags & DOMAIN_FLAG_LOSE_CHILDREN) >>>-        return 0; >>> >>>    if (size < VTD_PAGE_SIZE << level_to_offset_bits(level)) >>>        size = VTD_PAGE_SIZE << level_to_offset_bits(level); >>>@@ -5556,9 +5551,6 @@ static phys_addr_t >>>intel_iommu_iova_to_phys(struct iommu_domain *domain, >>>    int level = 0; >>>    u64 phys = 0; >>> >>>-    if (dmar_domain->flags & DOMAIN_FLAG_LOSE_CHILDREN) >>>-        return 0; >>>- >>>    pte = pfn_to_dma_pte(dmar_domain, iova >> VTD_PAGE_SHIFT, &level); >>>    if (pte) >>>        phys = dma_pte_addr(pte); >>>-- >>>2.17.1 >>> >> >_______________________________________________ >iommu mailing list >iommu@lists.linux-foundation.org >https://lists.linuxfoundation.org/mailman/listinfo/iommu