Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp281276ybl; Thu, 12 Dec 2019 18:14:34 -0800 (PST) X-Google-Smtp-Source: APXvYqz3DrJaEkySHfBuoIcDtv9zJaCcJcwOKEg9/sQ7uD2s+WT3qGq2yMJ4cwq+PPi2A2IkHEZN X-Received: by 2002:a9d:760f:: with SMTP id k15mr11819842otl.65.1576203274673; Thu, 12 Dec 2019 18:14:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576203274; cv=none; d=google.com; s=arc-20160816; b=XMXCYUROiThQyafMeYifYU52z+he2CiIjy+ZmDT1vLXkIOOLBQws6lCgFBjbZ5Ix5Z bHbsUgwNVU+5pdbKK39TJZW7T7jS7wbFpo9otdBp/igBjpcY9s6mluRMwYj7MH8RpWKK qenigvnwHsBVBcTaqQmvFYnfSkjve/mT0JI1GpK+RVIuySZDHiZXJAaB1xZxR9zpotP9 Am158vwswSfgAPgkmLZztJgiwV9h5lWUp2s74TU8ZlN/kmocbzhKcFQx8cSIRZC7PknX 8LWgQmwzwXNhSHU0BNca79fHGbmBCUrD3OICacRsBGvatcJV5IHGFNYRcxD4EWtFPdaD TCVw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:to:subject:cc; bh=hbWjtPey/EqyZHiHBwv8h+98ju4kZkAzoCe9iWbvAZI=; b=f1/UCKY46clxT07LvqlNinZLLa0d/61Mc21oc1RJ5JO4KhBIlrMBL7eVcRUuArqUNT zylWGCzYBY7nDM7+Aw3T8BMFm/rStflsadK9IgeqP00ftR19HG4FeNjGX6vHXTW9NlJX PEfgyVBeJcYnKJVa6LUeGXtC2b/yINcTPU8381INcgaq3SgrJpurAW0o4aqgNp1u3b06 O0pkalK11a0p7BD4p7gtBwvOWVfxGiYJVenVekte4h9r1xQGX6GvxV4RliCV9oK+siad 7mt7A5qACj3NIIg1qMXaWSmqzc6B2E4OyAEEQDUF+f11dRxiaj2MW+it7egkOYIc3jPL W/rw== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x126si4176184oix.53.2019.12.12.18.14.21; Thu, 12 Dec 2019 18:14:34 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731916AbfLMCNp (ORCPT + 99 others); Thu, 12 Dec 2019 21:13:45 -0500 Received: from mga05.intel.com ([192.55.52.43]:26956 "EHLO mga05.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727778AbfLMCNp (ORCPT ); Thu, 12 Dec 2019 21:13:45 -0500 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 12 Dec 2019 18:13:43 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.69,308,1571727600"; d="scan'208";a="226146129" Received: from allen-box.sh.intel.com (HELO [10.239.159.136]) ([10.239.159.136]) by orsmga002.jf.intel.com with ESMTP; 12 Dec 2019 18:13:41 -0800 Cc: baolu.lu@linux.intel.com Subject: Re: [PATCH 1/1] iommu/vt-d: Fix dmar pte read access not set error To: 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> <20191213003013.gc3zg3fpzpjntnzg@cantor> From: Lu Baolu Message-ID: <7d58da5b-3f55-72b2-0638-ae561446d207@linux.intel.com> Date: Fri, 13 Dec 2019 10:12:54 +0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.2.1 MIME-Version: 1.0 In-Reply-To: <20191213003013.gc3zg3fpzpjntnzg@cantor> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, On 12/13/19 8:30 AM, Jerry Snitselaar wrote: > 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 >> > > I'm testing with this patch, my patch that moves the direct mapping call, > and Alex's patch for the ISA bridge. It solved the 2 iommu mapping errors > I was seeing with default passthrough, I no longer see all the dmar pte > read access errors, and the system boots allowing me to login. I'm tracking > down 2 issues at the moment. With passthrough I see a problem with 01:00.4 > that I mentioned in the earlier email: > > [   78.978573] uhci_hcd: USB Universal Host Controller Interface driver > [   78.980842] uhci_hcd 0000:01:00.4: UHCI Host Controller > [   78.982738] uhci_hcd 0000:01:00.4: new USB bus registered, assigned > bus number 3 > [   78.985222] uhci_hcd 0000:01:00.4: detected 8 ports > [   78.986907] uhci_hcd 0000:01:00.4: port count misdetected? forcing to > 2 ports > [   78.989316] uhci_hcd 0000:01:00.4: irq 16, io base 0x00003c00 > [   78.994634] uhci_hcd 0000:01:00.4: DMAR: 32bit DMA uses non-identity > mapping > [   7 0000:01:00.4: unable to allocate consistent memory for frame list > [   79.499891] uhci_hcd 0000:01:00.4: startup error -16 > [   79.501588] uhci_hcd 0000:01:00.4: USB bus 3 deregistered > [   79.503494] uhci_hcd 0000:01:00.4: init 0000:01:00.4 fail, -16 > [   79.505497] uhci_hcd: probe of 0000:01:00.4 failed with error -16 > > If I boot the system with iommu=nopt I see an iommu map failure due to > the prot check in __domain_mapping: > > [   40.940589] pci 0000:00:1f.0: iommu_group_add_device: calling > iommu_group_create_direct_mappings > [   40.943558] pci 0000:00:1f.0: iommu_group_create_direct_mappings: > iterating through mappings > [   40.946402] pci 0000:00:1f.0: iommu_group_create_direct_mappings: > calling apply_resv_region > [   40.949184] pci 0000:00:1f.0: iommu_group_create_direct_mappings: > entry type is direct > [   40.951819] DMAR: intel_iommu_map: enter > [   40.953128] DMAR: __domain_mapping: prot & > (DMA_PTE_READ|DMA_PTE_WRITE) == 0 > [   40.955486] DMAR: domain_mapping: __domain_mapping failed > [   40.957348] DMAR: intel_iommu_map: domain_pfn_mapping returned -22 > [   40.959466] DMAR: intel_iommu_map: leave > [   40.959468] iommu: iommu_map: ops->map failed iova 0x0 pa > 0x0000000000000000 pgsize 0x1000 > [   40.963511] pci 0000:00:1f.0: iommu_group_create_direct_mappings: > iommu_map failed > [   40.966026] pci 0000:00:1f.0: iommu_group_create_direct_mappings: > leaving func > [   40.968487] pci 0000:00:1f.0: iommu_group_add_device: calling > __iommu_attach_device > [   40.971016] pci 0000:00:1f.0: Adding to iommu group 19 > [   40.972731] pci 0000:00:1f.0: DMAR: domain->type is dma > > /sys/kernel/iommu_groups/19 > [root@hp-dl388g8-07 19]# cat reserved_regions 0x0000000000000000 > 0x0000000000ffffff direct > 0x00000000bdf6e000 0x00000000bdf84fff direct > 0x00000000fee00000 0x00000000feefffff msi > > 00:1f.0 ISA bridge: Intel Corporation C600/X79 series chipset LPC > Controller This seems to be another issue? Best regards, baolu