include/public/memory.h: remove the XENMEM_rsrc_acq_caller_owned flag
authorPaul Durrant <paul.durrant@citrix.com>
Fri, 19 Jul 2019 12:25:45 +0000 (13:25 +0100)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Wed, 21 Aug 2019 11:32:06 +0000 (12:32 +0100)
commit7c7f7e8fba01f6cc985985173d0e69c6e6ecd56c
treee64402685f3a3fdf93e77ff4858296fcf1680d4b
parentee463ef4e067773c94b0e3266e0838ce93ac5ef6
include/public/memory.h: remove the XENMEM_rsrc_acq_caller_owned flag

When commit 3f8f1228 "x86/mm: add HYPERVISOR_memory_op to acquire guest
resources" introduced the concept of directly mapping some guest resources,
it was envisaged that the memory for some resources associated with a guest
may not actually be assigned to that guest, specifically the IOREQ server
resource introduces in commit 6e387461 "x86/hvm/ioreq: add a new mappable
resource type...". Such resources were dubbed "caller owned" and resulted
in the owned resources" and acquiring them resulted in the
XENMEM_rsrc_acq_caller_owned flag being passed back to the caller of the
memory op.

Unfortunately the implementation led to XSA-276, which was mitigated
by commit f6b6ae78 "x86/hvm/ioreq: fix page referencing" and then a related
memory accounting problem was worked around by commit e862e6ce
"x86/hvm/ioreq: use ref-counted target-assigned shared pages". This latter
commit removed the only instance of a "caller owned" resource, but the
flag was left in header and checked in one place in the core code.
This patch removes that now redundant check and removes the definition of
XENMEM_rsrc_acq_caller_owned from the public header. Also, since this was
the only flag defined for the XENMEM_acquire_resource memory op, it removes
the 'flags' field of struct xen_mem_acquire_resource and replaces it with
an equivalently sized 'pad' field.

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
xen/arch/x86/mm.c
xen/common/compat/memory.c
xen/common/memory.c
xen/include/asm-arm/mm.h
xen/include/asm-x86/mm.h
xen/include/public/memory.h