From: Baolu Lu <baolu.lu@linux.intel.com>
To: Bjorn Helgaas <helgaas@kernel.org>
Cc: baolu.lu@linux.intel.com, "Bjorn Helgaas" <bhelgaas@google.com>,
"Joerg Roedel" <jroedel@suse.de>,
"Matt Fagnani" <matt.fagnani@bell.net>,
"Christian König" <christian.koenig@amd.com>,
"Jason Gunthorpe" <jgg@nvidia.com>,
"Kevin Tian" <kevin.tian@intel.com>,
"Vasant Hegde" <vasant.hegde@amd.com>,
"Tony Zhu" <tony.zhu@intel.com>,
linux-pci@vger.kernel.org, iommu@lists.linux.dev,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3 1/1] PCI: Add translated request only flag for pci_enable_pasid()
Date: Tue, 31 Jan 2023 20:56:13 +0800 [thread overview]
Message-ID: <030e66e0-fb54-b77d-5094-4786684ba97d@linux.intel.com> (raw)
In-Reply-To: <20230130183810.GA1692786@bhelgaas>
On 2023/1/31 2:38, Bjorn Helgaas wrote:
>> PCI: Add translated request only flag for pci_enable_pasid()
>>
>> The PCIe fabric routes Memory Requests based on the TLP address, ignoring
>> the PASID. In order to ensure system integrity, commit 201007ef707a ("PCI:
>> Enable PASID only when ACS RR & UF enabled on upstream path") requires
>> some ACS features being supported on device's upstream path when enabling
>> PCI/PASID.
>>
>> However, above change causes the Linux kernel boots to black screen on a
>> system with below graphic device:
> We need a PCIe concept-level description of the issue first, i.e., in
> terms of DMA, PASID, ACS, etc. Then we can mention the AMD GPU issue
> as an instance.
How about below description?
PCIe endpoints can use ATS to request DMA remapping hardware to
translate an IOVA to its mapped physical address. If the translation is
missing or the permissions are insufficient, the PRI is used to trigger
an I/O page fault. The IOMMU driver will fill the mapping with desired
permissions and return the translated address to the device.
The translated address is specified by the IOMMU driver. The IOMMU
driver ensures that the address is a DMA buffer address instead of any
P2P address in the PCI fabric. Therefore, any translated memory request
will eventually be routed to IOMMU regardless of whether there is ACS
control in the up-streaming path.
AMD GPU is one of those devices. Furthermore, it always uses translated
memory requests for PASID.
>
>> 00:01.0 VGA compatible controller: Advanced Micro Devices, Inc.
>> [AMD/ATI] Wani [Radeon R5/R6/R7 Graphics] (rev ca)
>> (prog-if 00 [VGA controller])
>> DeviceName: ATI EG BROADWAY
>> Subsystem: Hewlett-Packard Company Device 8332
>>
>> The kernel trace looks like below:
>>
>> Call Trace:
>> <TASK>
>> amd_iommu_attach_device+0x2e0/0x300
>> __iommu_attach_device+0x1b/0x90
>> iommu_attach_group+0x65/0xa0
>> amd_iommu_init_device+0x16b/0x250 [iommu_v2]
>> kfd_iommu_resume+0x4c/0x1a0 [amdgpu]
>> kgd2kfd_resume_iommu+0x12/0x30 [amdgpu]
>> kgd2kfd_device_init.cold+0x346/0x49a [amdgpu]
>> amdgpu_amdkfd_device_init+0x142/0x1d0 [amdgpu]
>> amdgpu_device_init.cold+0x19f5/0x1e21 [amdgpu]
>> ? _raw_spin_lock_irqsave+0x23/0x50
>> amdgpu_driver_load_kms+0x15/0x110 [amdgpu]
>> amdgpu_pci_probe+0x161/0x370 [amdgpu]
>> local_pci_probe+0x41/0x80
>> pci_device_probe+0xb3/0x220
>> really_probe+0xde/0x380
>> ? pm_runtime_barrier+0x50/0x90
>> __driver_probe_device+0x78/0x170
>> driver_probe_device+0x1f/0x90
>> __driver_attach+0xce/0x1c0
>> ? __pfx___driver_attach+0x10/0x10
>> bus_for_each_dev+0x73/0xa0
>> bus_add_driver+0x1ae/0x200
>> driver_register+0x89/0xe0
>> ? __pfx_init_module+0x10/0x10 [amdgpu]
>> do_one_initcall+0x59/0x230
>> do_init_module+0x4a/0x200
>> __do_sys_init_module+0x157/0x180
>> do_syscall_64+0x5b/0x80
>> ? handle_mm_fault+0xff/0x2f0
>> ? do_user_addr_fault+0x1ef/0x690
>> ? exc_page_fault+0x70/0x170
>> entry_SYSCALL_64_after_hwframe+0x72/0xdc
> The stack trace doesn't seem like it shows a failure, so I'm not sure
> it's useful this time. If it is, we can at least strip out the
> irrelevant pieces.
I will drop above from the commit message.
>
>> The AMD iommu driver allocates a new domain (called v2 domain) for the
> "v2 domain" needs to be something greppable -- an identifier,
> filename, etc.
>
The code reads,
2052 if (iommu_feature(iommu, FEATURE_GT) &&
2053 iommu_feature(iommu, FEATURE_PPR)) {
2054 iommu->is_iommu_v2 = true;
So, how about
..The AMD GPU has a private interface to its own AMD IOMMU, which could
be detected by the FEATURE_GT && FEATURE_PPR features. The AMD iommu
driver allocates a special domain for the GPU device ..
?
Best regards,
baolu
next prev parent reply other threads:[~2023-01-31 12:56 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-01-14 7:34 [PATCH v3 1/1] PCI: Add translated request only flag for pci_enable_pasid() Lu Baolu
2023-01-16 15:42 ` Jason Gunthorpe
2023-01-27 11:30 ` Linux kernel regression tracking (Thorsten Leemhuis)
2023-01-27 17:30 ` Bjorn Helgaas
2023-01-28 7:52 ` Tian, Kevin
2023-01-29 8:42 ` Baolu Lu
2023-01-30 18:38 ` Bjorn Helgaas
2023-01-30 18:47 ` Jason Gunthorpe
2023-01-31 23:50 ` Bjorn Helgaas
2023-02-01 2:28 ` Jason Gunthorpe
2023-01-31 12:25 ` Baolu Lu
2023-02-01 16:58 ` Bjorn Helgaas
2023-02-02 3:08 ` Baolu Lu
2023-02-02 20:12 ` Bjorn Helgaas
2023-02-02 20:45 ` Jason Gunthorpe
2023-02-03 18:20 ` Bjorn Helgaas
2023-02-03 18:52 ` Jason Gunthorpe
2023-02-06 4:28 ` Tian, Kevin
2023-01-31 12:56 ` Baolu Lu [this message]
2023-02-01 0:14 ` Bjorn Helgaas
2023-02-01 2:36 ` Jason Gunthorpe
2023-02-01 14:09 ` Jonathan Cameron
2023-02-01 5:18 ` Vasant Hegde
2023-02-01 5:51 ` Baolu Lu
2023-02-01 5:59 ` Baolu Lu
2023-02-01 6:31 ` Baolu Lu
2023-02-01 14:22 ` Jason Gunthorpe
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=030e66e0-fb54-b77d-5094-4786684ba97d@linux.intel.com \
--to=baolu.lu@linux.intel.com \
--cc=bhelgaas@google.com \
--cc=christian.koenig@amd.com \
--cc=helgaas@kernel.org \
--cc=iommu@lists.linux.dev \
--cc=jgg@nvidia.com \
--cc=jroedel@suse.de \
--cc=kevin.tian@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=matt.fagnani@bell.net \
--cc=tony.zhu@intel.com \
--cc=vasant.hegde@amd.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox