All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chao Liu <chao.liu.zevorn@gmail.com>
To: Tao Tang <tangtao1634@phytium.com.cn>
Cc: Alistair Francis <alistair.francis@wdc.com>,
	Daniel Henrique Barboza <dbarboza@ventanamicro.com>,
	Palmer Dabbelt <palmer@dabbelt.com>,
	Weiwei Li <liwei1518@gmail.com>,
	Liu Zhiwei <zhiwei_liu@linux.alibaba.com>,
	Fabiano Rosas <farosas@suse.de>,
	Laurent Vivier <lvivier@redhat.com>,
	Paolo Bonzini <pbonzini@redhat.com>,
	qemu-devel@nongnu.org, qemu-riscv@nongnu.org,
	hust-os-kernel-patches@googlegroups.com
Subject: Re: [RFC PATCH v2 2/2] tests/qtest: Add RISC-V IOMMU bare-metal test
Date: Tue, 3 Feb 2026 11:44:09 +0800	[thread overview]
Message-ID: <aYFvCaE4MQyRcRIm@b962e8cb79b7> (raw)
In-Reply-To: <47268fe5-32cd-4d97-bdcd-2d349d3bfc2a@phytium.com.cn>

Hi Tao,

On Fri, Jan 30, 2026 at 11:49:11AM +0800, Tao Tang wrote:
> Hi Chao,
> 
> On 2026/1/29 17:39, Chao Liu wrote:
> > Add a qtest suite for the RISC-V IOMMU PCI device on the virt machine.
> > The test exercises bare, S-stage, G-stage, and nested translation paths
> > using iommu-testdev and the qos-riscv-iommu helpers.
> > 
> > The test validates:
> > - Device context (DC) configuration
> > - SV39 page table walks for S-stage translation
> > - SV39x4 page table walks for G-stage translation
> > - Nested translation combining both stages
> > - FCTL register constraints
> > 
> > This provides regression coverage for the RISC-V IOMMU implementation
> > without requiring a full guest OS boot.
> > 
> > Signed-off-by: Chao Liu <chao.liu.zevorn@gmail.com>
> > ---
> >   MAINTAINERS                    |   1 +
> >   tests/qtest/iommu-riscv-test.c | 279 +++++++++++++++++++++++++++++++++
> >   tests/qtest/meson.build        |   5 +-
> >   3 files changed, 284 insertions(+), 1 deletion(-)
> >   create mode 100644 tests/qtest/iommu-riscv-test.c
> > 
> > diff --git a/MAINTAINERS b/MAINTAINERS
> > index 830f56376b..73daaad841 100644
> > --- a/MAINTAINERS
> > +++ b/MAINTAINERS
> > @@ -349,6 +349,7 @@ F: common-user/host/riscv*
> >   F: tests/functional/riscv32
> >   F: tests/functional/riscv64
> >   F: tests/tcg/riscv64/
> > +F: tests/qtest/iommu-riscv-test.c
> >   RISC-V XThead* extensions
> >   M: Christoph Muellner <christoph.muellner@vrull.eu>
> > diff --git a/tests/qtest/iommu-riscv-test.c b/tests/qtest/iommu-riscv-test.c
> > new file mode 100644
> > index 0000000000..5a86b18db9
> > --- /dev/null
> > +++ b/tests/qtest/iommu-riscv-test.c
> > @@ -0,0 +1,279 @@
> > +/*
> > + * QTest testcase for RISC-V IOMMU with iommu-testdev
> > + *
> > + * This QTest file is used to test the RISC-V IOMMU with iommu-testdev so that
> > + * we can test RISC-V IOMMU without any guest kernel or firmware.
> > + *
> > + * Copyright (c) 2026 Chao Liu <chao.liu.zevorn@gmail.com>
> > + *
> > + * SPDX-License-Identifier: GPL-2.0-or-later
> > + */
> > +
> > +#include "qemu/osdep.h"
> > +#include "libqtest.h"
> > +#include "libqos/pci.h"
> 
> 
> libqtest.h and libqos/pci.h are redundant because they are already pulled in
> by libqos/generic-pcihost.h (libqos/pci.h itself includes libqtest.h)
> 
> 
Thanks for the review. I'ill fix this in v3.

Thanks,
Chao

> Besides
> 
> Reviewed-by: Tao Tang <tangtao1634@phytium.com.cn>
> 
> 
> Thanks,
> 
> Tao
> 
> > +#include "libqos/generic-pcihost.h"
> > +#include "hw/pci/pci_regs.h"
> > +#include "hw/misc/iommu-testdev.h"
> > +#include "hw/riscv/riscv-iommu-bits.h"
> > +#include "libqos/qos-riscv-iommu.h"
> > +#include "libqos/riscv-iommu.h"
> > +
> > +#define DMA_LEN           4
> 


  reply	other threads:[~2026-02-03  3:45 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-29  9:39 [RFC PATCH v2 0/2] tests/qtest: Add RISC-V IOMMU bare-metal test using iommu-testdev Chao Liu
2026-01-29  9:39 ` [RFC PATCH v2 1/2] tests/qtest/libqos: Add RISC-V IOMMU helper library Chao Liu
2026-01-30  3:46   ` Tao Tang
2026-02-03  2:33     ` Chao Liu
2026-01-29  9:39 ` [RFC PATCH v2 2/2] tests/qtest: Add RISC-V IOMMU bare-metal test Chao Liu
2026-01-30  3:49   ` Tao Tang
2026-02-03  3:44     ` Chao Liu [this message]
2026-02-02 19:09   ` Fabiano Rosas
2026-02-03  3:52     ` Chao Liu

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=aYFvCaE4MQyRcRIm@b962e8cb79b7 \
    --to=chao.liu.zevorn@gmail.com \
    --cc=alistair.francis@wdc.com \
    --cc=dbarboza@ventanamicro.com \
    --cc=farosas@suse.de \
    --cc=hust-os-kernel-patches@googlegroups.com \
    --cc=liwei1518@gmail.com \
    --cc=lvivier@redhat.com \
    --cc=palmer@dabbelt.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-riscv@nongnu.org \
    --cc=tangtao1634@phytium.com.cn \
    --cc=zhiwei_liu@linux.alibaba.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 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.