Zhi Wang
2025-Oct-01 21:13 UTC
[PATCH 0/2] rust: pci: expose is_virtfn() and reject VFs in nova-core
On 1.10.2025 17.48, Jason Gunthorpe wrote:> On Wed, Oct 01, 2025 at 08:09:37AM +0000, Zhi Wang wrote: >>>> But if the guest sees the passed-through VF as a PF, won't it try to >>>> do things it is not supposed to do like loading the GSP firmware (which >>>> is managed by the host)? >>> >> >> The guest driver will read PMC_BOOT_1 and check PMC_BOOT_1_VGPU_VF flag >> to tell if it is running on a VF or a PF. > > Yes exactly, and then novacore should modify its behavior and operate > the device in the different mode. > > It doesn't matter if a VM is involved or not, a VF driver running side > by side wit the PF driver should still work. > > There are use cases where people do this, eg they can stick the VF > into a linux container and use the SRIOV mechanism as a QOS control. > 'This container only gets 1/4 of a GPU' >Right, I also mentioned the same use cases of NIC/GPU in another reply to Danilo. But what I get is NVIDIA doesn't use bare metal VF to support linux container, it seems there have been other solutions. IMHO, it is not mandatory that we have to support VF driver on bare metal so far yet. Z.> Jason
Alexandre Courbot
2025-Oct-02 01:43 UTC
[PATCH 0/2] rust: pci: expose is_virtfn() and reject VFs in nova-core
On Thu Oct 2, 2025 at 6:13 AM JST, Zhi Wang wrote:> On 1.10.2025 17.48, Jason Gunthorpe wrote: >> On Wed, Oct 01, 2025 at 08:09:37AM +0000, Zhi Wang wrote: >>>>> But if the guest sees the passed-through VF as a PF, won't it try to >>>>> do things it is not supposed to do like loading the GSP firmware (which >>>>> is managed by the host)? >>>> >>> >>> The guest driver will read PMC_BOOT_1 and check PMC_BOOT_1_VGPU_VF flag >>> to tell if it is running on a VF or a PF. >> >> Yes exactly, and then novacore should modify its behavior and operate >> the device in the different mode. >> >> It doesn't matter if a VM is involved or not, a VF driver running side >> by side wit the PF driver should still work. >> >> There are use cases where people do this, eg they can stick the VF >> into a linux container and use the SRIOV mechanism as a QOS control. >> 'This container only gets 1/4 of a GPU' >> > > Right, I also mentioned the same use cases of NIC/GPU in another reply > to Danilo. But what I get is NVIDIA doesn't use bare metal VF to support > linux container, it seems there have been other solutions. IMHO, it is > not mandatory that we have to support VF driver on bare metal so far > yet.For my education, what gets in the way of supporting a VF on the bare metal if we already support it from inside a VM?
Jason Gunthorpe
2025-Oct-02 11:58 UTC
[PATCH 0/2] rust: pci: expose is_virtfn() and reject VFs in nova-core
On Wed, Oct 01, 2025 at 09:13:33PM +0000, Zhi Wang wrote:> Right, I also mentioned the same use cases of NIC/GPU in another reply > to Danilo. But what I get is NVIDIA doesn't use bare metal VF to support > linux container,I don't think it matter what "NVIDIA" does - this is the upstream architecture it should be followed unless there is some significant reason. Jason