Skip to content

Commit

Permalink
xen/arm: Skip Xen specific nodes/properties from hwdom /chosen node
Browse files Browse the repository at this point in the history
Skip the following Xen specific host device tree nodes/properties
from being included into hardware domain /chosen node:
 - xen,static-heap: this property informs Xen about memory regions
   reserved exclusively as static heap,
 - xen,domain-shared-memory-v1: node with this compatible informs Xen
   about static shared memory region for a domain. Xen exposes a different
   node (under /reserved-memory with compatible "xen,shared-memory-v1") to
   let domain know about the shared region,
 - xen,evtchn-v1: node with this compatible informs Xen about static
   event channel configuration for a domain. Xen does not expose
   information about static event channels to domUs and dom0 case was
   overlooked (by default nodes from host dt are copied to dom0 fdt unless
   explicitly marked to be skipped), since the author's idea was not to
   expose it (refer docs/misc/arm/device-tree/booting.txt, "Static Event
   Channel"). Even if we wanted to expose the static event channel
   information, the current node is in the wrong format (i.e. contains
   phandle to domU node not visible by dom0). Lastly, this feature is
   marked as tech-preview and there is no Linux dt binding in place.

Signed-off-by: Michal Orzel <[email protected]>
Release-acked-by: Henry Wang <[email protected]>
Reviewed-by: Stefano Stabellini <[email protected]>
Acked-by: Julien Grall <[email protected]>
  • Loading branch information
orzelmichal authored and jgrall committed Sep 15, 2023
1 parent b5a6010 commit 290f823
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions xen/arch/arm/domain_build.c
Original file line number Diff line number Diff line change
Expand Up @@ -1149,7 +1149,7 @@ static int __init write_properties(struct domain *d, struct kernel_info *kinfo,
* * remember xen,dom0-bootargs if we don't already have
* bootargs (from module #1, above).
* * remove bootargs, xen,dom0-bootargs, xen,xen-bootargs,
* linux,initrd-start and linux,initrd-end.
* xen,static-heap, linux,initrd-start and linux,initrd-end.
* * remove stdout-path.
* * remove bootargs, linux,uefi-system-table,
* linux,uefi-mmap-start, linux,uefi-mmap-size,
Expand All @@ -1158,7 +1158,8 @@ static int __init write_properties(struct domain *d, struct kernel_info *kinfo,
*/
if ( dt_node_path_is_equal(node, "/chosen") )
{
if ( dt_property_name_is_equal(prop, "xen,xen-bootargs") ||
if ( dt_property_name_is_equal(prop, "xen,static-heap") ||
dt_property_name_is_equal(prop, "xen,xen-bootargs") ||
dt_property_name_is_equal(prop, "linux,initrd-start") ||
dt_property_name_is_equal(prop, "linux,initrd-end") ||
dt_property_name_is_equal(prop, "stdout-path") ||
Expand Down Expand Up @@ -2304,6 +2305,8 @@ static int __init handle_node(struct domain *d, struct kernel_info *kinfo,
static const struct dt_device_match skip_matches[] __initconst =
{
DT_MATCH_COMPATIBLE("xen,domain"),
DT_MATCH_COMPATIBLE("xen,domain-shared-memory-v1"),
DT_MATCH_COMPATIBLE("xen,evtchn-v1"),
DT_MATCH_COMPATIBLE("xen,xen"),
DT_MATCH_COMPATIBLE("xen,multiboot-module"),
DT_MATCH_COMPATIBLE("multiboot,module"),
Expand Down

0 comments on commit 290f823

Please sign in to comment.