All of lore.kernel.org
 help / color / mirror / Atom feed
* How to expose caching policy to a para-virtualized guest?
@ 2019-12-11  1:32 Gurchetan Singh
  2019-12-11 11:08 ` Marc Zyngier
  0 siblings, 1 reply; 4+ messages in thread
From: Gurchetan Singh @ 2019-12-11  1:32 UTC (permalink / raw)
  To: kvm, maz, pbonzini; +Cc: Gerd Hoffmann

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2019-12-12  0:31 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-12-11  1:32 How to expose caching policy to a para-virtualized guest? Gurchetan Singh
2019-12-11 11:08 ` Marc Zyngier
2019-12-11 23:34   ` Gurchetan Singh
2019-12-12  0:31     ` Marc Zyngier

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.