Re: [PATCH 0/8] KVM: xen: update shared_info and vcpu_info handling

From: David Woodhouse
Date: Thu Sep 14 2023 - 05:15:35 EST


On Thu, 2023-09-14 at 08:49 +0000, Paul Durrant wrote:
> From: Paul Durrant <pdurrant@xxxxxxxxxx>
>
> Currently we treat the shared_info page as guest memory and the VMM informs
> KVM of its location using a GFN. However it is not guest memory as such;
> it's an overlay page. So we pointlessly invalidate and re-cache a mapping
> to the *same page* of memory every time the guest requests that shared_info
> be mapped into its address space. Let's avoid doing that by modifying the
> pfncache code to allow activation using a fixed userspace HVA as well as
> a GPA.

Looks sane to me in general; thanks.

The changes to the pfncache ended up being a little bit more than I
originally anticipated when I said you just needed to disable the
GPA→uHVA lookup via memslots which was about 10 lines... but I think
it's still true that it's worth using the pfncache to avoid reproducing
the intricate mmu_notifier invalidations.

Attachment: smime.p7s
Description: S/MIME cryptographic signature