On 12.11.2021 12:23, Roger Pau Monné wrote: > On Fri, Nov 12, 2021 at 10:47:59AM +0100, Jan Beulich wrote: >> Merely setting bit 0 in the bitmap is insufficient, as then Dom0 will >> still have DID 0 allocated to it, because of the zero-filling of >> domid_map[]. Set slot 0 to DOMID_INVALID to keep DID 0 from getting >> used. > > Shouldn't the whole domid_map be initialized to DOMID_INVALID to > prevent dom0 matching against any unused slot? > > Similarly cleanup_domid_map should set the slot to DOMID_INVALID.
I don't think so, that's the purpose of setting the bit in domid_bitmap. The problem really was only with setting a bit in that bitmap without invalidating the corresponding slot. This said, I can still see value in doing as you suggest, but as a separate change with a different justification. In fact domid_bitmap is kind of redundant now anyway; aiui it was the thing that existed first. Then domid_map[] was simply added, rather than fully replacing the original bitmap. Jan