viridian: move flush hypercall implementation into separate function
authorPaul Durrant <pdurrant@amazon.com>
Fri, 4 Dec 2020 12:13:22 +0000 (13:13 +0100)
committerJan Beulich <jbeulich@suse.com>
Fri, 4 Dec 2020 12:13:22 +0000 (13:13 +0100)
commitc8117063f31370d4029cfb6abf15851e5394d12f
tree09093e2369600d879a617e7ca9f99e8b3988638f
parent7c8946dae39b544094d969ef902d49e8ea0ea973
viridian: move flush hypercall implementation into separate function

This patch moves the implementation of HVCALL_FLUSH_VIRTUAL_ADDRESS_SPACE/LIST
that is currently inline in viridian_hypercall() into a new hvcall_flush()
function.

The new function returns Xen erro values which are then dealt with
appropriately. A return value of -ERESTART translates to viridian_hypercall()
returning HVM_HCALL_preempted. Other return values translate to status codes
and viridian_hypercall() returning HVM_HCALL_completed. Currently the only
values, other than -ERESTART, returned by hvcall_flush() are 0 (indicating
success) or -EINVAL.

Signed-off-by: Paul Durrant <pdurrant@amazon.com>
Acked-by: Wei Liu <wl@xen.org>
xen/arch/x86/hvm/viridian/viridian.c