How to expose caching policy to a para-virtualized guest?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

We're trying to implement Vulkan with virtio-gpu, and that API exposes
the difference between cached and uncached mappings to userspace (i.e,
some older GPUs can't snoop the CPU's caches).

We need to make sure that the guest and host caching attributes are
aligned, or there's a proper API between the virtio driver and device
to ensure coherence.

One issue that needs to be addressed is the caching policy is variable
dependent on the VM configuration and architecture.  For example, on
x86, it looks like a MTRR controls whether the guest caching attribute
predominates[1].  On ARM, it looks like the MMU registers control
whether the guest can override the host attribute, but in general it's
most restrictive attribute that makes a difference[2].  Let me if
that's incorrect.

I'm wondering if there's some standard kernel API to query such
attributes.  For example, something like
arch_does_guest_attribute_matter() or arch_can_guest_flush() would do
the trick.  Without this, we may need to introduce VIRTIO_GPU_F_*
flags set by the host, but that may make the already giant QEMU
command line even bigger.

[1] https://lwn.net/Articles/646712/
[2]  https://events.static.linuxfound.org/sites/events/files/slides/slides_10.pdf



[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux