From: Jason Gunthorpe <jgg@ziepe.ca>
To: Gong Shuai <gong.shuai@sanechips.com.cn>
Cc: alex@ghiti.fr, andrew.jones@oss.qualcomm.com,
anup@brainfault.org, aou@eecs.berkeley.edu,
atish.patra@linux.dev, fangyu.yu@linux.alibaba.com,
gsh517025@gmail.com, iommu@lists.linux.dev, joro@8bytes.org,
kevin.tian@intel.com, kvm-riscv@lists.infradead.org,
kvm@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-riscv@lists.infradead.org, palmer@dabbelt.com,
pbonzini@redhat.com, pjw@kernel.org, robin.murphy@arm.com,
seanjc@google.com, tomasz.jeznach@linux.dev, will@kernel.org,
wu.fei9@sanechips.com.cn, zhao.qingye@sanechips.com.cn
Subject: Re: [RFC PATCH 02/12] iommufd: Add RISC-V IOMMU hwpt and vIOMMU types
Date: Fri, 16 Oct 2026 12:00:49 -0300 [thread overview]
Message-ID: <20261016150049.GG14213@ziepe.ca> (raw)
In-Reply-To: <20261016073020.10119-1-gong.shuai@sanechips.com.cn>
On Fri, Oct 16, 2026 at 03:30:20PM +0800, Gong Shuai wrote:
> Hi Jason,
>
> Thank you for your review.
>
> > > +/**
> > > + * struct iommu_hwpt_riscv - RISC-V IOMMU stage-1 page table data
> > > + * (IOMMU_HWPT_DATA_RISCV_S1)
> > > + * @tc: Guest device context translation control
> > > + * @iosatp: Guest device context stage-1 root page table pointer
> > > + */
> > > +struct iommu_hwpt_riscv {
> > > + __aligned_u64 tc;
> > > + __aligned_u64 iosatp;
> > > +};
> >
> > Like the others you need a spec reference explaining exactly what
> > these fields are.
>
> I'll add references to the device-context sections of the RISC-V IOMMU
> specification ("Leaf DDT entry", "Device-context fields", "Translation
> control (tc)", and "First-Stage context (fsc)"), and I'll also include
> detailed field information, as ARM does.
>
> Also, I'll rename the field from iosatp to fsc. It holds iosatp when
> PDTV=0 and process-directory-table pointer (pdtp) when PDTV=1, and the
> two share the same layout, so the name should cover both interpretations
> and the uAPI won't need to change when Process-Directory-Table (PDT)
> support is added.
You might be better off just to have a data[] array of the device
context. I prefer the fields are not parsed out in userspace..
Future specs may add more guest controlled bits and in other places?
Jason
_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv
WARNING: multiple messages have this Message-ID (diff)
From: Jason Gunthorpe <jgg@ziepe.ca>
To: Gong Shuai <gong.shuai@sanechips.com.cn>
Cc: alex@ghiti.fr, andrew.jones@oss.qualcomm.com,
anup@brainfault.org, aou@eecs.berkeley.edu,
atish.patra@linux.dev, fangyu.yu@linux.alibaba.com,
gsh517025@gmail.com, iommu@lists.linux.dev, joro@8bytes.org,
kevin.tian@intel.com, kvm-riscv@lists.infradead.org,
kvm@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-riscv@lists.infradead.org, palmer@dabbelt.com,
pbonzini@redhat.com, pjw@kernel.org, robin.murphy@arm.com,
seanjc@google.com, tomasz.jeznach@linux.dev, will@kernel.org,
wu.fei9@sanechips.com.cn, zhao.qingye@sanechips.com.cn
Subject: Re: [RFC PATCH 02/12] iommufd: Add RISC-V IOMMU hwpt and vIOMMU types
Date: Fri, 16 Oct 2026 12:00:49 -0300 [thread overview]
Message-ID: <20261016150049.GG14213@ziepe.ca> (raw)
In-Reply-To: <20261016073020.10119-1-gong.shuai@sanechips.com.cn>
On Fri, Oct 16, 2026 at 03:30:20PM +0800, Gong Shuai wrote:
> Hi Jason,
>
> Thank you for your review.
>
> > > +/**
> > > + * struct iommu_hwpt_riscv - RISC-V IOMMU stage-1 page table data
> > > + * (IOMMU_HWPT_DATA_RISCV_S1)
> > > + * @tc: Guest device context translation control
> > > + * @iosatp: Guest device context stage-1 root page table pointer
> > > + */
> > > +struct iommu_hwpt_riscv {
> > > + __aligned_u64 tc;
> > > + __aligned_u64 iosatp;
> > > +};
> >
> > Like the others you need a spec reference explaining exactly what
> > these fields are.
>
> I'll add references to the device-context sections of the RISC-V IOMMU
> specification ("Leaf DDT entry", "Device-context fields", "Translation
> control (tc)", and "First-Stage context (fsc)"), and I'll also include
> detailed field information, as ARM does.
>
> Also, I'll rename the field from iosatp to fsc. It holds iosatp when
> PDTV=0 and process-directory-table pointer (pdtp) when PDTV=1, and the
> two share the same layout, so the name should cover both interpretations
> and the uAPI won't need to change when Process-Directory-Table (PDT)
> support is added.
You might be better off just to have a data[] array of the device
context. I prefer the fields are not parsed out in userspace..
Future specs may add more guest controlled bits and in other places?
Jason
--
kvm-riscv mailing list
kvm-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kvm-riscv
WARNING: multiple messages have this Message-ID (diff)
From: Jason Gunthorpe <jgg@ziepe.ca>
To: Gong Shuai <gong.shuai@sanechips.com.cn>
Cc: alex@ghiti.fr, andrew.jones@oss.qualcomm.com,
anup@brainfault.org, aou@eecs.berkeley.edu,
atish.patra@linux.dev, fangyu.yu@linux.alibaba.com,
gsh517025@gmail.com, iommu@lists.linux.dev, joro@8bytes.org,
kevin.tian@intel.com, kvm-riscv@lists.infradead.org,
kvm@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-riscv@lists.infradead.org, palmer@dabbelt.com,
pbonzini@redhat.com, pjw@kernel.org, robin.murphy@arm.com,
seanjc@google.com, tomasz.jeznach@linux.dev, will@kernel.org,
wu.fei9@sanechips.com.cn, zhao.qingye@sanechips.com.cn
Subject: Re: [RFC PATCH 02/12] iommufd: Add RISC-V IOMMU hwpt and vIOMMU types
Date: Fri, 16 Oct 2026 12:00:49 -0300 [thread overview]
Message-ID: <20261016150049.GG14213@ziepe.ca> (raw)
In-Reply-To: <20261016073020.10119-1-gong.shuai@sanechips.com.cn>
On Fri, Oct 16, 2026 at 03:30:20PM +0800, Gong Shuai wrote:
> Hi Jason,
>
> Thank you for your review.
>
> > > +/**
> > > + * struct iommu_hwpt_riscv - RISC-V IOMMU stage-1 page table data
> > > + * (IOMMU_HWPT_DATA_RISCV_S1)
> > > + * @tc: Guest device context translation control
> > > + * @iosatp: Guest device context stage-1 root page table pointer
> > > + */
> > > +struct iommu_hwpt_riscv {
> > > + __aligned_u64 tc;
> > > + __aligned_u64 iosatp;
> > > +};
> >
> > Like the others you need a spec reference explaining exactly what
> > these fields are.
>
> I'll add references to the device-context sections of the RISC-V IOMMU
> specification ("Leaf DDT entry", "Device-context fields", "Translation
> control (tc)", and "First-Stage context (fsc)"), and I'll also include
> detailed field information, as ARM does.
>
> Also, I'll rename the field from iosatp to fsc. It holds iosatp when
> PDTV=0 and process-directory-table pointer (pdtp) when PDTV=1, and the
> two share the same layout, so the name should cover both interpretations
> and the uAPI won't need to change when Process-Directory-Table (PDT)
> support is added.
You might be better off just to have a data[] array of the device
context. I prefer the fields are not parsed out in userspace..
Future specs may add more guest controlled bits and in other places?
Jason
next prev parent reply other threads:[~2026-10-16 15:01 UTC|newest]
Thread overview: 63+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-15 6:52 [RFC PATCH 0/12] iommu/riscv: Add nested translation (vIOMMU) support Gong Shuai
2026-10-15 6:52 ` Gong Shuai
2026-10-15 6:52 ` Gong Shuai
2026-10-15 6:52 ` [RFC PATCH 01/12] iommu/riscv: Use DC.tc.V as the device context valid bit Gong Shuai
2026-10-15 6:52 ` Gong Shuai
2026-10-15 6:52 ` Gong Shuai
2026-10-15 6:52 ` [RFC PATCH 02/12] iommufd: Add RISC-V IOMMU hwpt and vIOMMU types Gong Shuai
2026-10-15 6:52 ` Gong Shuai
2026-10-15 6:52 ` Gong Shuai
2026-10-15 23:54 ` Jason Gunthorpe
2026-10-15 23:54 ` Jason Gunthorpe
2026-10-15 23:54 ` Jason Gunthorpe
2026-10-16 7:30 ` Gong Shuai
2026-10-16 7:30 ` Gong Shuai
2026-10-16 7:30 ` Gong Shuai
2026-10-16 15:00 ` Jason Gunthorpe [this message]
2026-10-16 15:00 ` Jason Gunthorpe
2026-10-16 15:00 ` Jason Gunthorpe
2026-10-15 6:52 ` [RFC PATCH 03/12] iommufd: Add RISC-V IOMMU cache invalidation data type Gong Shuai
2026-10-15 6:52 ` Gong Shuai
2026-10-15 6:52 ` Gong Shuai
2026-10-15 6:52 ` [RFC PATCH 04/12] iommu/riscv: Add vIOMMU object support Gong Shuai
2026-10-15 6:52 ` Gong Shuai
2026-10-15 6:52 ` Gong Shuai
2026-10-15 6:52 ` [RFC PATCH 05/12] iommu/riscv: Add nested domain allocation Gong Shuai
2026-10-15 6:52 ` Gong Shuai
2026-10-15 6:52 ` Gong Shuai
2026-10-15 6:52 ` [RFC PATCH 06/12] iommu/riscv: Add vIOMMU cache invalidation Gong Shuai
2026-10-15 6:52 ` Gong Shuai
2026-10-15 6:52 ` Gong Shuai
2026-10-15 6:52 ` [RFC PATCH 07/12] iommufd: Add RISC-V IOMMU hardware info type Gong Shuai
2026-10-15 6:52 ` Gong Shuai
2026-10-15 6:52 ` Gong Shuai
2026-10-15 23:55 ` Jason Gunthorpe
2026-10-15 23:55 ` Jason Gunthorpe
2026-10-15 23:55 ` Jason Gunthorpe
2026-10-16 7:43 ` Gong Shuai
2026-10-16 7:43 ` Gong Shuai
2026-10-16 7:43 ` Gong Shuai
2026-10-15 6:52 ` [RFC PATCH 08/12] iommu/riscv: Add riscv_iommu_hw_info Gong Shuai
2026-10-15 6:52 ` Gong Shuai
2026-10-15 6:52 ` Gong Shuai
2026-10-15 6:52 ` [RFC PATCH 09/12] iommu/riscv: Add riscv_iommu_attach_dev_nested Gong Shuai
2026-10-15 6:52 ` Gong Shuai
2026-10-15 6:52 ` Gong Shuai
2026-10-15 6:52 ` [RFC PATCH 10/12] RISC-V: KVM: Accept auto-mode interrupt files for IMSIC IRQ bypass Gong Shuai
2026-10-15 6:52 ` Gong Shuai
2026-10-15 6:52 ` Gong Shuai
2026-10-15 6:52 ` [RFC PATCH 11/12] iommu/riscv: Accept unpublished interrupt files in IRQ forwarding Gong Shuai
2026-10-15 6:52 ` Gong Shuai
2026-10-15 6:52 ` Gong Shuai
2026-10-15 6:52 ` [RFC PATCH 12/12] RISC-V: KVM: Forward MSIs for guests with a vIOMMU Gong Shuai
2026-10-15 6:52 ` Gong Shuai
2026-10-15 6:52 ` Gong Shuai
2026-10-16 0:00 ` [RFC PATCH 0/12] iommu/riscv: Add nested translation (vIOMMU) support Jason Gunthorpe
2026-10-16 0:00 ` Jason Gunthorpe
2026-10-16 0:00 ` Jason Gunthorpe
2026-10-16 9:16 ` Gong Shuai
2026-10-16 9:16 ` Gong Shuai
2026-10-16 9:16 ` Gong Shuai
2026-10-16 14:25 ` Jason Gunthorpe
2026-10-16 14:25 ` Jason Gunthorpe
2026-10-16 14:25 ` 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=20261016150049.GG14213@ziepe.ca \
--to=jgg@ziepe.ca \
--cc=alex@ghiti.fr \
--cc=andrew.jones@oss.qualcomm.com \
--cc=anup@brainfault.org \
--cc=aou@eecs.berkeley.edu \
--cc=atish.patra@linux.dev \
--cc=fangyu.yu@linux.alibaba.com \
--cc=gong.shuai@sanechips.com.cn \
--cc=gsh517025@gmail.com \
--cc=iommu@lists.linux.dev \
--cc=joro@8bytes.org \
--cc=kevin.tian@intel.com \
--cc=kvm-riscv@lists.infradead.org \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-riscv@lists.infradead.org \
--cc=palmer@dabbelt.com \
--cc=pbonzini@redhat.com \
--cc=pjw@kernel.org \
--cc=robin.murphy@arm.com \
--cc=seanjc@google.com \
--cc=tomasz.jeznach@linux.dev \
--cc=will@kernel.org \
--cc=wu.fei9@sanechips.com.cn \
--cc=zhao.qingye@sanechips.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.