xen/arm: check max_init_domid validity

Before trying to create a dom0less guest, check that max_init_domid
increment will generate a valid domain ID, lower than
DOMID_FIRST_RESERVED.

Signed-off-by: Bertrand Marquis <bertrand.marquis@arm.com>
Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
This commit is contained in:
Bertrand Marquis authored and Stefano Stabellini committed 2023-03-07 15:31:00 -08:00
1 parent 31270f11a9
commit 002641a8b7
1 file changed
+3
+3
View File
@@ -3879,6 +3879,9 @@ void __init create_domUs(void)
if ( !dt_device_is_compatible(node, "xen,domain") )
continue;
if ( (max_init_domid + 1) >= DOMID_FIRST_RESERVED )
panic("No more domain IDs available\n");
if ( dt_find_property(node, "xen,static-mem", NULL) )
flags |= CDF_staticmem;
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.