On Mon, Jul 26, 2021 at 4:54 PM Kirill A. Shutemov <kirill@xxxxxxxxxxxxx> wrote: > > > > Is not the above code will accept the pages that are already accepted? > > No. This code will get called for all UNACCEPTED ranges in EFI table. > If such memory is accepted it is a bug. > > > It is accepting the pages in the same 2MB region that is before start > > and after end. We do not know what code/data is stored on those pages, > > right? This might cause security issues depending on what is stored on > > those pages. > > As I told above, it only get called for unaccepted memory and nothing can > be stored there before the point. Thanks Kirill! You are right, it looks like I messed up with round_up/down in my mind. Thanks for the clarification. > Yes, because we constructed the bitmap this way. Non-2M-aligned chunks get > accepted when we accept upfront when we populate the bitmap. > > See mark_unaccepted(). > > (mark_unaccepted() has few bugs that will be fixed in the next version) > > Have you looked at what __accept_pages() does? It only accept unaccepted > pages, according to the bitmap. Ahh, makes sense! Thanks for the explanation and sorry for my confusion, Kirill! -Erdem