Previously Xen had stopped processing Device Trees if an empty
(size == 0) memory bank was found.
Commit 5a37207df52066efefe419c677b089a654d37afc changed this behavior to
ignore such banks. Unfortunately this means these empty nodes are
visible to code which accesses the device trees. Have domain_build also
ignore these entries.
Signed-off-by: Elliott Mitchell <ehem+xen@m5p.com>
---
Looking at this, I think the problem is likely even larger than this and
really needs a proper solution closer to the core of the device-tree
code. Likely either all device-tree handling code needs to be audited
for ignoring zero-size entries, or the core should take care of these and
nothing outside of xen/common/device_tree.c should ever see these (except
perhaps to confirm such entries exist as flags). Notably this is the
*second* location where zero-size device-tree entries need to be ignored,
action might be worthwhile before a third is confirmed.
---
xen/arch/arm/domain_build.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c
index e824ba34b0..0b83384bd3 100644
--- a/xen/arch/arm/domain_build.c
+++ b/xen/arch/arm/domain_build.c
@@ -1405,6 +1405,11 @@ static int __init handle_device(struct domain *d, struct dt_device_node *dev,
{
struct map_range_data mr_data = { .d = d, .p2mt = p2mt };
res = dt_device_get_address(dev, i, &addr, &size);
+
+ /* Some DT may describe empty bank, ignore them */
+ if ( !size )
+ continue;
+
if ( res )
{
printk(XENLOG_ERR "Unable to retrieve address %u for %s\n",
--
--
(\___(\___(\______ --=> 8-) EHM <=-- ______/)___/)___/)
\BS ( | ehem+sigmsg@m5p.com PGP 87145445 | ) /
\_CS\ | _____ -O #include <stddisclaimer.h> O- _____ | / _/
8A19\___\_|_/58D2 7E3D DDF4 7BA6 <-PGP-> 41D1 B375 37D0 8714\_|_/___/5445