From: Fengyuan <15fengyuan@gmail.com>
To: Tao Tang <tangtao1634@phytium.com.cn>,
Fabiano Rosas <farosas@suse.de>,
Laurent Vivier <lvivier@redhat.com>,
Paolo Bonzini <pbonzini@redhat.com>
Cc: Chao Liu <chao.liu.zevorn@gmail.com>, qemu-devel@nongnu.org
Subject: Re: [PATCH RFC v1 0/2] tests/qtest: Add Intel IOMMU bare-metal test using iommu-testdev
Date: Thu, 5 Feb 2026 17:35:34 +0800 [thread overview]
Message-ID: <ac09572b-778e-4a6d-a080-aaa25decf977@gmail.com> (raw)
In-Reply-To: <e43203cf-58aa-4642-8a2f-94b7a4a212ec@phytium.com.cn>
Hi Tao,
Thanks for the attention!
On 2/4/2026 9:14 PM, Tao Tang wrote:
> Hi Fengyuan,
>
> On 2026/2/4 11:06, Fengyuan Yu wrote:
>> Hi,
>>
>> This patch series adds a bare-metal qtest for the Intel IOMMU (VT-d) using
>> the iommu-testdev framework. The test exercises address translation paths
>> without requiring a full guest OS boot.
>>
>> Motivation
>> ----------
>>
>> The Intel IOMMU implementation in QEMU supports various translation modes
>> including pass-through and translated (4-level paging) modes. Currently,
>> comprehensive testing of these translation paths requires booting a full
>> guest OS with appropriate drivers, which is time-consuming and makes
>> regression testing difficult.
>>
>> This new test fills that gap by using iommu-testdev to trigger DMA
>> transactions and validate the IOMMU's translation logic directly.
>>
>> Test Coverage
>> -------------
>>
>> The new test provides:
>> - Legacy pass-through mode (identity mapping)
>> - Legacy translated mode with 4-level page table walks
>> - Root Entry Table and Context Entry Table configuration
>> - Complete 48-bit address space translation
>> - End-to-end DMA verification with memory validation
>>
>> Testing
>> -------
>>
>> QTEST_QEMU_BINARY=./build/qemu-system-x86_64 \
>> ./build/tests/qtest/iommu-intel-test --tap -k
>>
>> Thanks,
>> Fengyuan
>
>
> Thanks for working on VT-d qtests. As a first-time patch contributor, you’ve
> already done a great job with good cover letter and commit messages to
> accurately summarize your work.
>
>
> It seems that your code cannot be applied to the latest master branch. And I
> also noticed multiple lines >80 columns (some > 90). QEMU style says try to keep
> lines to 80 columns, only going a bit over when wrapping would harm readability
> but never > 90 columns.
>
> ../tests/qtest/libqos/qos-intel-iommu.c: In function ‘qvtd_build_root_entry’:
> ../tests/qtest/libqos/qos-intel-iommu.c:168:31: error:
> ‘VTD_CONTEXT_ENTRY_SLPTPTR’ undeclared (first use in this function); did you
> mean ‘VTD_CONTEXT_ENTRY_SSPTPTR’?
> 168 | lo = (context_table_ptr & VTD_CONTEXT_ENTRY_SLPTPTR) |
> VTD_CONTEXT_ENTRY_P;
> | ^~~~~~~~~~~~~~~~~~~~~~~~~
> | VTD_CONTEXT_ENTRY_SSPTPTR
> ../tests/qtest/libqos/qos-intel-iommu.c:168:31: note: each undeclared identifier
> is reported only once for each function it appears in
> ../tests/qtest/libqos/qos-intel-iommu.c: In function ‘qvtd_build_context_entry’:
> ../tests/qtest/libqos/qos-intel-iommu.c:190:25: error:
> ‘VTD_CONTEXT_ENTRY_SLPTPTR’ undeclared (first use in this function); did you
> mean ‘VTD_CONTEXT_ENTRY_SSPTPTR’?
> 190 | (slptptr & VTD_CONTEXT_ENTRY_SLPTPTR);
> | ^~~~~~~~~~~~~~~~~~~~~~~~~
> | VTD_CONTEXT_ENTRY_SSPTPTR
> ../tests/qtest/libqos/qos-intel-iommu.c: In function
> ‘qvtd_setup_translation_tables’:
> ../tests/qtest/libqos/qos-intel-iommu.c:239:36: error: ‘VTD_SL_R’ undeclared
> (first use in this function); did you mean ‘VTD_SS_R’?
> 239 | pml4_entry = QVTD_PT_L3_BASE | VTD_SL_R | VTD_SL_W;
> | ^~~~~~~~
> | VTD_SS_R
> ../tests/qtest/libqos/qos-intel-iommu.c:239:47: error: ‘VTD_SL_W’ undeclared
> (first use in this function); did you mean ‘VTD_SS_W’?
> 239 | pml4_entry = QVTD_PT_L3_BASE | VTD_SL_R | VTD_SL_W;
> | ^~~~~~~~
> | VTD_SS_W
> [92/2328] Compiling C object libblock.a.p/block.c.o
>
>
>
> Besides when submitting patches it’s a good idea to read `docs/devel/submitting-
> a-patch.rst`. It may be a bit long, but making sure the code builds cleanly and
> running scripts/checkpatch.pl for style checks beforehand can help avoid many
> basic issues.
>
>
Thank you for your reply, and I sincerely apologize for my oversight.
I have identified the issue: since I started development on iommu-testdev
earlier, some Intel IOMMU macro definitions changed during my development,
causing them to be undefined.
I will include comprehensive CI/CD checks and patch verification in v2.
> Finally I think CC the experts on x86 and VT-d emulation might be a more
> efficient way to review this sereis patch.
>
> M: Paolo Bonzini <pbonzini@redhat.com>
> R: Zhao Liu <zhao1.liu@intel.com>
>
> M: Michael S. Tsirkin <mst@redhat.com>
> R: Jason Wang <jasowang@redhat.com>
> R: Yi Liu <yi.l.liu@intel.com>
> R: Clément Mathieu--Drif <clement.mathieu--drif@eviden.com>
>
>
Okay, I will cc these reviewers in v2 submission.
Thanks,
Fengyuan
> Anyway I'm looking forward to your v2 patches.
>
> Best regards,
>
> Tao
>
prev parent reply other threads:[~2026-02-05 9:36 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-04 3:06 [PATCH RFC v1 0/2] tests/qtest: Add Intel IOMMU bare-metal test using iommu-testdev Fengyuan Yu
2026-02-04 3:06 ` [PATCH RFC v1 1/2] tests/qtest/libqos: Add Intel IOMMU helper library Fengyuan Yu
2026-02-04 7:31 ` Chao Liu
2026-02-05 9:20 ` Fengyuan
2026-02-04 3:06 ` [PATCH RFC v1 2/2] tests/qtest: Add Intel IOMMU bare-metal test Fengyuan Yu
2026-02-04 7:43 ` Chao Liu
2026-02-05 9:18 ` Fengyuan
2026-02-04 13:14 ` [PATCH RFC v1 0/2] tests/qtest: Add Intel IOMMU bare-metal test using iommu-testdev Tao Tang
2026-02-05 9:35 ` Fengyuan [this message]
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=ac09572b-778e-4a6d-a080-aaa25decf977@gmail.com \
--to=15fengyuan@gmail.com \
--cc=chao.liu.zevorn@gmail.com \
--cc=farosas@suse.de \
--cc=lvivier@redhat.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=tangtao1634@phytium.com.cn \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.