[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[xen staging] xen/dt: Don't advertise Xen static-heap region to hwdom



commit 0ff1b302b8ad1f8f3f44fb0783d29ff6535371e9
Author:     Michal Orzel <michal.orzel@xxxxxxx>
AuthorDate: Thu Oct 29 11:28:41 2026 +0100
Commit:     Michal Orzel <michal.orzel@xxxxxxx>
CommitDate: Fri Oct 30 10:54:55 2026 +0100

    xen/dt: Don't advertise Xen static-heap region to hwdom
    
    bootinfo.reserved_mem is used to store different types of memory that
    Xen considers as reserved: domU static mem, normal /reserved-memory,
    FDT memreserve and Xen static heap. make_memory_node(), invoked during
    FDT generation for a hwdom for reserved memory, only skips the domU
    static memory and FDT memreserve. This results in advertising Xen static
    heap (if used) to a hwdom as /memory. This memory is not mapped in P2M
    and guest attempt to access it fails. Interestingly, if the
    /reserved-memory node is placed after /chosen, there is no problem because
    of the check at the beginning of make_memory_node() that finds the first
    memory range using the correct type.
    
    Fixes: 4596329291f5 ("docs, xen/arm: Introduce static heap memory")
    Signed-off-by: Michal Orzel <michal.orzel@xxxxxxx>
    Reviewed-by: Oleksii Kurochko <oleksii.kurochko@xxxxxxxxx>
    Reviewed-by: Kuan-Wei Chiu <visitorckw@xxxxxxxxx>
---
 xen/common/device-tree/domain-build.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/xen/common/device-tree/domain-build.c 
b/xen/common/device-tree/domain-build.c
index 30a59abfa7..634a26946c 100644
--- a/xen/common/device-tree/domain-build.c
+++ b/xen/common/device-tree/domain-build.c
@@ -541,8 +541,7 @@ int __init make_memory_node(const struct kernel_info 
*kinfo, int addrcells,
         u64 start = mem->bank[i].start;
         u64 size = mem->bank[i].size;
 
-        if ( (mem->bank[i].type == MEMBANK_STATIC_DOMAIN) ||
-             (mem->bank[i].type == MEMBANK_FDT_RESVMEM) )
+        if ( mem->bank[i].type != MEMBANK_DEFAULT )
             continue;
 
         nr_cells += reg_size;
--
generated by git-patchbot for /home/xen/git/xen.git#staging



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.