Linux Kernel Selftest development
 help / color / mirror / Atom feed
From: Shuai Xue <xueshuai@linux.alibaba.com>
To: Nicolin Chen <nicolinc@nvidia.com>, Jason Gunthorpe <jgg@nvidia.com>
Cc: "Alex Williamson" <alex@shazbot.org>,
	"Christian König" <christian.koenig@amd.com>,
	dri-devel@lists.freedesktop.org, iommu@lists.linux.dev,
	"Joerg Roedel" <joro@8bytes.org>,
	"Kevin Tian" <kevin.tian@intel.com>,
	kvm@vger.kernel.org, linaro-mm-sig@lists.linaro.org,
	linux-kselftest@vger.kernel.org, linux-media@vger.kernel.org,
	"Robin Murphy" <robin.murphy@arm.com>,
	"Shuah Khan" <shuah@kernel.org>,
	"Sumit Semwal" <sumit.semwal@linaro.org>,
	"Will Deacon" <will@kernel.org>,
	"Krishnakant Jaju" <kjaju@nvidia.com>,
	"Leon Romanovsky" <leon@kernel.org>,
	"Matt Ochs" <mochs@nvidia.com>,
	patches@lists.linux.dev, "Simona Vetter" <simona.vetter@ffwll.ch>,
	"Vivek Kasireddy" <vivek.kasireddy@intel.com>,
	"Xu Yilun" <yilun.xu@linux.intel.com>
Subject: Re: [PATCH 0/9] Initial DMABUF support for iommufd
Date: Thu, 13 Nov 2025 14:33:01 +0800	[thread overview]
Message-ID: <29f0cddc-3c23-4ab1-92d9-8c9918ddc187@linux.alibaba.com> (raw)
In-Reply-To: <aQ4x7UiMMCB0m0dH@Asurada-Nvidia>

Hi, Nicolin

在 2025/11/8 01:52, Nicolin Chen 写道:
> On Fri, Nov 07, 2025 at 12:49:32PM -0400, Jason Gunthorpe wrote:
>> This is on github: https://github.com/jgunthorpe/linux/commits/iommufd_dmabuf
>>
>> v2:
>>   - Rebase on Leon's v7
>>   - Fix mislocking in an iopt_fill_domain() error path
> 
> I have verified this v2 using the branch above, by drafting a QEMU
> patch for dmabuf on top of Shameer's vSMMU v5 series:
> https://github.com/nicolinc/qemu/commits/wip/iommufd_dmabuf/
> 
> With that, I see GPU BAR memory be correctly fetched in the QEMU:
> vfio_region_dmabuf Device 0009:01:00.0, region "0009:01:00.0 BAR 0", offset: 0x0, size: 0x1000000
> vfio_region_dmabuf Device 0009:01:00.0, region "0009:01:00.0 BAR 2", offset: 0x0, size: 0x44f00000
> vfio_region_dmabuf Device 0009:01:00.0, region "0009:01:00.0 BAR 4", offset: 0x0, size: 0x17a0000000
> 
> Tested-by: Nicolin Chen <nicolinc@nvidia.com>

I tested with your QEMU branch and this v2 branch, and observed
the following:

**QEMU successfully maps the BAR regions via dmabuf:**

vfio_region_mmap Region 0008:01:00.0 BAR 0 mmaps[0] [0x0 - 0x3ffffff]
vfio_region_dmabuf Device 0008:01:00.0, region "0008:01:00.0 BAR 0", offset: 0x0, size: 0x4000000
vfio_region_mmap Region 0008:01:00.0 BAR 2 mmaps[0] [0x0 - 0x3fffffffff]
vfio_region_dmabuf Device 0008:01:00.0, region "0008:01:00.0 BAR 2", offset: 0x0, size: 0x4000000000
vfio_region_mmap Region 0008:01:00.0 BAR 4 mmaps[0] [0x0 - 0x2e41efffff]
vfio_region_dmabuf Device 0008:01:00.0, region "0008:01:00.0 BAR 4", offset: 0x0, size: 0x2e41f00000

**IOMMUFD backend successfully maps the DMA regions:**

iommufd_backend_map_file_dma  iommufd=303 ioas=2 iova=0x30000000000 size=0xb90000 fd=306 start=0 readonly=0 (0)
vfio_listener_region_add_ram region_add [ram] 0x30000b91000 - 0x30003ffffff [0xffcae8b91000]
iommufd_backend_map_file_dma  iommufd=303 ioas=2 iova=0x30000b91000 size=0x346f000 fd=306 start=12128256 readonly=0 (0)
vfio_listener_region_add_ram region_add [ram] 0x2c000000000 - 0x2ffffffffff [0xff8ac0000000]
iommufd_backend_map_file_dma  iommufd=303 ioas=2 iova=0x2c000000000 size=0x4000000000 fd=307 start=0 readonly=0 (0)
vfio_listener_region_add_ram region_add [ram] 0x28000000000 - 0x2ae41efffff [0xff5c7e000000]
iommufd_backend_map_file_dma  iommufd=303 ioas=2 iova=0x28000000000 size=0x2e41f00000 fd=308 start=0 readonly=0 (0)

**However, the guest kernel crashes during PCI initialization:**

[    1.422280] acpi PNP0A08:01: ECAM area [mem 0x4010100000-0x40102fffff] reserved by PNP0C02:00^M
[    1.422907] acpi PNP0A08:01: ECAM at [mem 0x4010100000-0x40102fffff] for [bus 01-02]^M
[    1.423541] ------------[ cut here ]------------^M
[    1.423905] kernel BUG at mm/vmalloc.c:109!^M
[    1.424240] Internal error: Oops - BUG: 00000000f2000800 [#1] SMP^M
[    1.424724] Modules linked in:^M
[    1.424972] CPU: 19 PID: 1 Comm: swapper/0 Not tainted 6.6.102-5.100_rc1.1.al8.aarch64+64k #1^M
[    1.425647] Hardware name: QEMU KVM Virtual Machine, BIOS 0.0.0 02/06/2015^M
[    1.426201] pstate: 01401005 (nzcv daif +PAN -UAO -TCO +DIT +SSBS BTYPE=--)^M
[    1.426751] pc : vmap_pte_range+0x158/0x2b8^M
[    1.427101] lr : vmap_pte_range+0x178/0x2b8^M
[    1.427455] sp : ffff800083fcf6d0^M
[    1.427758] x29: ffff800083fcf6d0 x28: 0068000040820713 x27: 0000000000004083^M
[    1.428328] x26: ffff800083fcf7d4 x25: 0068000040820713 x24: 000000000000003f^M
[    1.428895] x23: 0068000000000713 x22: 0010000000000001 x21: ffffffbffe801000^M
[    1.429460] x20: ffffffc000040000 x19: ffff0018f9010020 x18: ffffffffffffffff^M
[    1.430034] x17: 75625b20726f6620 x16: 5d66666666663230 x15: 0000000000000002^M
[    1.430599] x14: 0000000000000000 x13: ffff0000c96ccf36 x12: 75625b20726f6620^M
[    1.431189] x11: 000000000000002e x10: 000003bffe800000 x9 : ffff800080341544^M
[    1.431802] x8 : ffff0000c96b8b80 x7 : ffff0018f9000000 x6 : ffff800083fcf7d4^M
[    1.432376] x5 : 000000000000003f x4 : 0068000000000713 x3 : 0000000000000000^M
[    1.432936] x2 : fffffffffe7d1000 x1 : ffff0031fff81380 x0 : 0000000000000008^M
[    1.433495] Call trace:^M
[    1.433689]  vmap_pte_range+0x158/0x2b8^M
[    1.433996]  vmap_range_noflush+0x19c/0x260^M
[    1.434323]  ioremap_page_range+0x20/0x30^M
[    1.434636]  pci_remap_iospace+0x78/0x90^M
[    1.434960]  acpi_pci_probe_root_resources+0x124/0x260^M
[    1.435378]  pci_acpi_root_prepare_resources+0x20/0xd0^M
[    1.435814]  acpi_pci_root_create+0x94/0x2e8^M
[    1.436154]  pci_acpi_scan_root+0x98/0x130^M
[    1.436474]  acpi_pci_root_add+0x15c/0x2f8^M
[    1.436795]  acpi_bus_attach+0x1bc/0x338^M
[    1.437104]  acpi_dev_for_one_check+0x38/0x48^M
[    1.437444]  device_for_each_child+0x60/0xb8^M
[    1.437799]  acpi_dev_for_each_child+0x40/0x70^M
[    1.438148]  acpi_bus_attach+0x234/0x338^M
[    1.438454]  acpi_dev_for_one_check+0x38/0x48^M
[    1.438796]  device_for_each_child+0x60/0xb8^M
[    1.439148]  acpi_dev_for_each_child+0x40/0x70^M
[    1.439531]  acpi_bus_attach+0x234/0x338^M
[    1.439854]  acpi_bus_scan+0x68/0x208^M
[    1.440142]  acpi_scan_init+0xd0/0x2b8^M
[    1.440445]  acpi_init+0x80/0x140^M
[    1.440704]  do_one_initcall+0x48/0x348^M
[    1.441010]  do_initcalls+0x104/0x200^M
[    1.441305]  kernel_init_freeable+0x128/0x2a0^M
[    1.441645]  kernel_init+0x28/0x1e8^M
[    1.441943]  ret_from_fork+0x10/0x20^M
[    1.442231] Code: 97f3ddf6 aa0003e1 b4fffa41 d503201f (d4210000) ^M

Could you share more details for testing?, e.g. QEMU cmdline,
Guest kernel version.

I'd like to compare with my setup to identify the difference.

Thanks.
Shuai

  reply	other threads:[~2025-11-13  6:33 UTC|newest]

Thread overview: 45+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-07 16:49 [PATCH 0/9] Initial DMABUF support for iommufd Jason Gunthorpe
2025-11-07 16:49 ` [PATCH 1/9] vfio/pci: Add vfio_pci_dma_buf_iommufd_map() Jason Gunthorpe
2025-11-20  7:49   ` Tian, Kevin
2025-11-20 17:34   ` Nicolin Chen
2025-11-07 16:49 ` [PATCH 2/9] iommufd: Add DMABUF to iopt_pages Jason Gunthorpe
2025-11-07 18:02   ` Nicolin Chen
2025-11-20  7:55   ` Tian, Kevin
2025-11-21 14:27     ` Jason Gunthorpe
2025-11-07 16:49 ` [PATCH 3/9] iommufd: Do not map/unmap revoked DMABUFs Jason Gunthorpe
2025-11-07 18:30   ` Nicolin Chen
2025-11-20  7:56   ` Tian, Kevin
2025-11-07 16:49 ` [PATCH 4/9] iommufd: Allow a DMABUF to be revoked Jason Gunthorpe
2025-11-13 23:26   ` Nicolin Chen
2025-11-20  7:58   ` Tian, Kevin
2025-11-07 16:49 ` [PATCH 5/9] iommufd: Allow MMIO pages in a batch Jason Gunthorpe
2025-11-13 23:28   ` Nicolin Chen
2025-11-20  7:59   ` Tian, Kevin
2025-11-20 14:59     ` Jason Gunthorpe
2025-11-07 16:49 ` [PATCH 6/9] iommufd: Have pfn_reader process DMABUF iopt_pages Jason Gunthorpe
2025-11-13 23:39   ` Nicolin Chen
2025-11-18 19:38     ` Jason Gunthorpe
2025-11-20  8:04   ` Tian, Kevin
2025-11-21  0:47     ` Jason Gunthorpe
2025-11-21 14:33       ` Jason Gunthorpe
2025-11-07 16:49 ` [PATCH 7/9] iommufd: Have iopt_map_file_pages convert the fd to a file Jason Gunthorpe
2025-11-13 23:43   ` Nicolin Chen
2025-11-20  8:05   ` Tian, Kevin
2025-11-07 16:49 ` [PATCH 8/9] iommufd: Accept a DMABUF through IOMMU_IOAS_MAP_FILE Jason Gunthorpe
2025-11-14  0:05   ` Nicolin Chen
2025-11-18 19:44     ` Jason Gunthorpe
2025-11-18 19:57       ` Nicolin Chen
2025-11-20  8:06   ` Tian, Kevin
2025-11-07 16:49 ` [PATCH 9/9] iommufd/selftest: Add some tests for the dmabuf flow Jason Gunthorpe
2025-11-07 19:43   ` Nicolin Chen
2025-11-18 19:25     ` Jason Gunthorpe
2025-11-20  8:06       ` Tian, Kevin
2025-11-07 17:52 ` [PATCH 0/9] Initial DMABUF support for iommufd Nicolin Chen
2025-11-13  6:33   ` Shuai Xue [this message]
2025-11-13  7:34     ` Nicolin Chen
2025-11-13 11:32       ` Shuai Xue
2025-11-13 17:44         ` Nicolin Chen
2025-11-13 18:37 ` Alex Williamson
2025-11-17 15:50   ` Jason Gunthorpe
2025-11-18  5:37     ` Kasireddy, Vivek
2025-11-18 14:59       ` 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=29f0cddc-3c23-4ab1-92d9-8c9918ddc187@linux.alibaba.com \
    --to=xueshuai@linux.alibaba.com \
    --cc=alex@shazbot.org \
    --cc=christian.koenig@amd.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=iommu@lists.linux.dev \
    --cc=jgg@nvidia.com \
    --cc=joro@8bytes.org \
    --cc=kevin.tian@intel.com \
    --cc=kjaju@nvidia.com \
    --cc=kvm@vger.kernel.org \
    --cc=leon@kernel.org \
    --cc=linaro-mm-sig@lists.linaro.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=mochs@nvidia.com \
    --cc=nicolinc@nvidia.com \
    --cc=patches@lists.linux.dev \
    --cc=robin.murphy@arm.com \
    --cc=shuah@kernel.org \
    --cc=simona.vetter@ffwll.ch \
    --cc=sumit.semwal@linaro.org \
    --cc=vivek.kasireddy@intel.com \
    --cc=will@kernel.org \
    --cc=yilun.xu@linux.intel.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