]> www.infradead.org Git - users/dwmw2/linux.git/commit
KVM: x86/xen: Reconcile fast and slow paths for runstate update runstate-cleanup
authorDavid Woodhouse <dwmw@amazon.co.uk>
Thu, 24 Nov 2022 11:10:56 +0000 (11:10 +0000)
committerDavid Woodhouse <dwmw@amazon.co.uk>
Thu, 24 Nov 2022 11:10:56 +0000 (11:10 +0000)
commit255e1831c743fe20715c45c70469ebcc6b25e5a4
treee8ee6c145693c6f7fe84f96838d4013b9ac56f7a
parentda5f28e10aa7df1a925dbc10656cc89d9c061358
KVM: x86/xen: Reconcile fast and slow paths for runstate update

Instead of having a completely separate fast path for the case where the
guest's runstate_info fits entirely in a page, recognise the similarity.

In both cases, the @update_bit pointer points to the byte containing the
XEN_RUNSTATE_UPDATE flag directly in the guest, via one of the GPCs.

In both cases, the actual guest structure (compat or not) is built up
from the fields in @vx, following preset pointers to the state and times
fields. The only difference is whether those pointers point to the kernel
stack (in the split case) or to guest memory directly via the GPC.

We can unify it by just setting the rs_state and rs_times pointers up
accordingly for each case. Then the only real difference is that dual
memcpy which can be made conditional, so the whole of that separate
fast path can go away, disappearing into the slow path without actually
doing the slow part.

Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
arch/x86/kvm/xen.c