From: Nicolin Chen <nicolinc@nvidia.com>
To: Shameerali Kolothum Thodi <shameerali.kolothum.thodi@huawei.com>
Cc: Eric Auger <eric.auger@redhat.com>,
Mostafa Saleh <smostafa@google.com>,
"qemu-arm@nongnu.org" <qemu-arm@nongnu.org>,
"qemu-devel@nongnu.org" <qemu-devel@nongnu.org>,
Peter Maydell <peter.maydell@linaro.org>,
"Jason Gunthorpe" <jgg@nvidia.com>,
Jean-Philippe Brucker <jean-philippe@linaro.org>,
Moritz Fischer <mdf@kernel.org>,
Michael Shavit <mshavit@google.com>,
"Andrea Bolognani" <abologna@redhat.com>,
"Michael S. Tsirkin" <mst@redhat.com>,
"Peter Xu" <peterx@redhat.com>
Subject: Re: nested-smmuv3 topic, Sep 2024
Date: Mon, 30 Sep 2024 12:43:41 -0700 [thread overview]
Message-ID: <Zvr/bf7KgLN1cjOl@Asurada-Nvidia> (raw)
In-Reply-To: <e06e0a8a89d74d88b653d4f49d0b08fe@huawei.com>
On Mon, Sep 30, 2024 at 10:45:31AM +0000, Shameerali Kolothum Thodi wrote:
> > -----Original Message-----
> > From: Nicolin Chen <nicolinc@nvidia.com>
> > Sent: Thursday, September 5, 2024 9:37 PM
> > To: Shameerali Kolothum Thodi <shameerali.kolothum.thodi@huawei.com>
> > Cc: Eric Auger <eric.auger@redhat.com>; Mostafa Saleh
> > <smostafa@google.com>; qemu-arm@nongnu.org; qemu-
> > devel@nongnu.org; Peter Maydell <peter.maydell@linaro.org>; Jason
> > Gunthorpe <jgg@nvidia.com>; Jean-Philippe Brucker <jean-
> > philippe@linaro.org>; Moritz Fischer <mdf@kernel.org>; Michael Shavit
> > <mshavit@google.com>; Andrea Bolognani <abologna@redhat.com>;
> > Michael S. Tsirkin <mst@redhat.com>; Peter Xu <peterx@redhat.com>
> > Subject: Re: nested-smmuv3 topic, Sep 2024
> >
> > Hi Shameer,
> >
> > Thanks for the reply!
> >
> > On Thu, Sep 05, 2024 at 12:55:52PM +0000, Shameerali Kolothum Thodi
> > wrote:
> > > > The main takeaway from the discussion is to
> > > > 1) Turn the vSMMU module into a pluggable one, like intel-iommu
> > > > 2) Move the per-SMMU pxb bus and device auto-assign into libvirt
> > > >
> > > > Apart from the multi-vSMMU thing, there's basic nesting series:
> > > > 0) Keep updating to the latest kernel uAPIs to support nesting
> > >
> > > By this you mean the old HWPT based nested-smmuv3 support?
> >
> > HWPT + vIOMMU. The for-viommu/virq branches that I shared in my
> > kernel series have those changes. Invalidations is done via the
> > vIOMMU infrastructure.
> >
> > > >
> > > > I was trying to do all these three, but apparently too ambitious.
> > > > The kernel side of work is still taking a lot of my bandwidth. So
> > > > far I had almost-zero progress on task (1) and completely-zero on
> > > > task (2).
> > > >
> > > > <-- Help Needed --->
> > > > So, I'm wondering if anyone(s) might have some extra bandwidth in
> > > > the following months helping these two tasks, either of which can
> > > > be a standalone project I think.
> > > >
> > > > For task (0), I think I can keep updating the uAPI part, although
> > > > it'd need some help for reviews, which I was hoping to occur after
> > > > Intel sends the QEMU nesting backend patches. Once we know how big
> > > > the rework is going to be, we may need to borrow some help at that
> > > > point once again..
> > >
> > > I might have some bandwidth starting October and can take a look at
> > > task 1 above. I haven't gone through the VIOMMU API model completely
> > > yet and plan to do that soon.
> >
>
> I had an initial look at this and also had some discussions with Eric at KVM
> Forum(Thanks Eric!).
Wow, thank both of you!
> Going through the code, is it ok to introduce a "pci-bus" for the proposed
> nested SMMUv3 device which will create the link between the SMMUv3 dev
> and the associated root complex(pxb-pcie).
>
> Something like below,
>
> -device pxb-pcie,id=pcie.1,bus_nr=2,bus=pcie.0 \
> -device arm-nested-smmuv3,pci-bus=pcie.1 \
> -device pcie-root-port,id=pcie.port1,bus=pcie.1 \
> -device vfio-pci,host=0000:75:00.1, bus=pcie.port1 \
> ...
> -device pxb-pcie,id=pcie.2,bus_nr=8,bus=pcie.0 \
> -device arm-nested-smmuv3,pci-bus=pcie.2 \
> -device pcie-root-port,id=pcie.port2,bus=pcie.2 \
> -device vfio-pci,host=0000:75:00.2, bus=pcie.port2 \
>
> This way we can invoke the pci_setup_iommu() with the
> right PCIBus during the nested SMMUv3 device realize fn.
>
> Please let me know, if this works/scales with all the use cases we have.
That looks nice to me. Hopefully, IORT or Device Tree would be
easy to tie to the corresponding pci-bus as well..
> Also Eric mentioned that when he initially added the support for SMMUv3,
> the initial approach was -device based solution, but later changed to machine
> option instead based on review comments. I managed to find the link where
> this change was proposed(by Peter),
>
> https://lore.kernel.org/all/CAFEAcA_H+sraWNVhEZc48eS11n6dC9CyEwTL44tPERiPBO+hbw@mail.gmail.com/
>
> I hope the use cases we now have make it reasonable to introduce a "-device arm-nested-smmuv3" model.
> Please let me know if there are still objections to going this way.
I assume so. With multiple smmuv3 devices in the VM, we would need
this kinda flexibility to create them.
And FYI, I also found some resource in NVIDIA who will help me on
the QEMU workload, including our remaining task -- libvirt. I'll
align with them in the days ahead, and will keep all of us updated
after.
Thanks!
Nicolin
next prev parent reply other threads:[~2024-09-30 19:44 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-09-05 8:26 nested-smmuv3 topic, Sep 2024 Nicolin Chen
2024-09-05 12:55 ` Shameerali Kolothum Thodi via
2024-09-05 12:55 ` Shameerali Kolothum Thodi via
2024-09-05 20:36 ` Nicolin Chen
2024-09-30 10:45 ` Shameerali Kolothum Thodi via
2024-09-30 10:45 ` Shameerali Kolothum Thodi via
2024-09-30 19:43 ` Nicolin Chen [this message]
2024-09-06 11:50 ` Mostafa Saleh
2024-09-06 18:54 ` Nicolin Chen
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=Zvr/bf7KgLN1cjOl@Asurada-Nvidia \
--to=nicolinc@nvidia.com \
--cc=abologna@redhat.com \
--cc=eric.auger@redhat.com \
--cc=jean-philippe@linaro.org \
--cc=jgg@nvidia.com \
--cc=mdf@kernel.org \
--cc=mshavit@google.com \
--cc=mst@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=peterx@redhat.com \
--cc=qemu-arm@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=shameerali.kolothum.thodi@huawei.com \
--cc=smostafa@google.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.