]> xenbits.xensource.com Git - people/tklengyel/xen.git/commit
IOREQ: refine when to send mapcache invalidation request
authorJan Beulich <jbeulich@suse.com>
Thu, 18 Feb 2021 12:11:19 +0000 (13:11 +0100)
committerJan Beulich <jbeulich@suse.com>
Thu, 18 Feb 2021 12:11:19 +0000 (13:11 +0100)
commit588d961d15d1af5b51d7c33b5278ac7269a961ef
treebe7719082a5f62a351cb9483b09cd9e17aab32c2
parent7a4133feaf42000923eb9d84badb6b171625f137
IOREQ: refine when to send mapcache invalidation request

XENMEM_decrease_reservation isn't the only means by which pages can get
removed from a guest, yet all removals ought to be signaled to qemu. Put
setting of the flag into the central p2m_remove_page() underlying all
respective hypercalls as well as a few similar places, mainly in PoD
code.

Additionally there's no point sending the request for the local domain
when the domain acted upon is a different one. The latter domain's ioreq
server mapcaches need invalidating. We assume that domain to be paused
at the point the operation takes place, so sending the request in this
case happens from the hvm_do_resume() path, which as one of its first
steps calls handle_hvm_io_completion().

Even without the remote operation aspect a single domain-wide flag
doesn't do: Guests may e.g. decrease-reservation on multiple vCPU-s in
parallel. Each of them needs to issue an invalidation request in due
course, in particular because exiting to guest context should not happen
before the request was actually seen by (all) the emulator(s).

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Paul Durrant <paul@xen.org>
Acked-by: Julien Grall <jgrall@amazon.com>
xen/arch/arm/p2m.c
xen/arch/arm/traps.c
xen/arch/x86/hvm/hypercall.c
xen/arch/x86/mm/p2m-pod.c
xen/arch/x86/mm/p2m.c
xen/common/ioreq.c
xen/include/xen/ioreq.h
xen/include/xen/sched.h