Hi, On Tue, 10 Nov 2026 at 11:53, Igor Torrente <[email protected]> wrote: > > Is the problem that: > > - the guest requests allocation of a BO with exclusive_vm_root_gem = > guest_vm > > - the host passes that allocation through > > - the host exports a dmabuf from the allocation (which fails) > > - the host imports a dmabuf from the allocation (?) > > - the guest requests the BO be attached to guest_vm > > > > i.e. is the problem that some host implementations (virglrenderer) > > handle BO allocation exclusively via an export/import interface? > > I was testing and checking a few things. This patch needs at least a > rewording, but maybe we can drop it entirely. > > The virtio_gpu part of Virglrenderer used to create a transitory export > to mmap the BO and attach it to the guest VM (not import, as I previously > wrote). > With resource_map, this transitory mapping is now obsolete. > > Vpipe still shares buffers with the client through FDs (even non-shareable > BOs). > It seems that this is an expectation of the protocol. I will check to see if > we > can avoid this for non-shareable (exclusive-VM) cases.
Yeah. If we can/should extend vpipe to not do this, that seems like a better path forward. > Lastly, if I’m not mistaken, CrosVM’s sandbox separates the GPU device into > another > process, making the export necessary (possibly even for non-shareable BOs). > This may > or may not be an issue. If allocation and rendering are performed by two separate processes, then either they share a VM, in which case they can pass GEM handles rather than FDs - or they don't share a VM, in which case the buffer isn't exclusive to a single VM. In either case, I'm glad the performance delta is pretty small. I would be in favour of masking it out from userspace: when we get to the point where we need to improve performance, we can look at doing something structurally different. Allowing exports of 'private' BOs from the kernel feels like opening a door we'll regret later. Cheers, Daniel
