xen/arm: Allow a privileged domain to map foreign page from DOMID_XEN
authorJulien Grall <julien.grall@arm.com>
Fri, 21 Dec 2018 16:26:47 +0000 (16:26 +0000)
committerStefano Stabellini <sstabellini@kernel.org>
Fri, 21 Dec 2018 17:44:33 +0000 (09:44 -0800)
commit615897bc6c01c862a4136816f1354acbab2d40c2
tree46cca87df2710cf5d7480939341b4e0c2ea345fb
parent0178f4416c61c4e87bfad5c5b41b537d165321fe
xen/arm: Allow a privileged domain to map foreign page from DOMID_XEN

For auto-translated domain, the only way to map a page to itself is the
using the foreign map API. The current code does not allow mapping page from
special page (such as DOMID_XEN).

As xentrace buffers are shared using DOMID_XEN, it is not possible to use
tracing for Arm.

This could be solved by using the helper get_pg_owner(). This helper will
be able to get a reference on DOMID_XEN and therefore allow mapping for
privileged domain.

This patch replace the call to rcu_lock_domain_by_any_id() with
get_pg_owner(). For consistency, all the call to rcu_unlock_domain are
replaced by put_pg_owner().

Signed-off-by: Julien grall <julien.grall@arm.com>
Reviewed-by: Andrii Anisov <andrii_anisov@epam.com>
Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
xen/arch/arm/mm.c