On 08.03.2021 15:12, Julien Grall wrote: > On 08/03/2021 11:56, Luca Fancellu wrote: >> This patch prevents the dom0 to be loaded skipping its >> building and going forward to build domUs when the dom0 >> kernel is not found and at least one domU is present. > > As you are skipping dom0, the domid 0 will not be usable for another > domain. I can see a few issues: > 1) The first domU created will now be considered as the hardware > domain (see domain_create()). > 2) There are still a few hardcoded use of d->domain_id == 0 in the > codebase (I could spot at least on in the RTDS code). > 3) Not all the code seems to be able to cope with hardware_domain is > NULL (although most of it looks to be only reachable by x86)? > 4) is_hardware_domain() will return true when passing NULL. It is > not clear whether one may pass NULL here. > > For 2), ideally this needs to be fixed. But we may also want to reserve > domid 0 just for sanity.
+1 to reserving ID zero in such a case. Jan