[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20230509005634.qtuiodpirexbxu2k@box.shutemov.name>
Date: Tue, 9 May 2023 03:56:34 +0300
From: "Kirill A. Shutemov" <kirill@...temov.name>
To: Ard Biesheuvel <ardb@...nel.org>
Cc: "Kirill A. Shutemov" <kirill.shutemov@...ux.intel.com>,
Borislav Petkov <bp@...en8.de>,
Andy Lutomirski <luto@...nel.org>,
Dave Hansen <dave.hansen@...el.com>,
Sean Christopherson <seanjc@...gle.com>,
Andrew Morton <akpm@...ux-foundation.org>,
Joerg Roedel <jroedel@...e.de>,
Andi Kleen <ak@...ux.intel.com>,
Kuppuswamy Sathyanarayanan
<sathyanarayanan.kuppuswamy@...ux.intel.com>,
David Rientjes <rientjes@...gle.com>,
Vlastimil Babka <vbabka@...e.cz>,
Tom Lendacky <thomas.lendacky@....com>,
Thomas Gleixner <tglx@...utronix.de>,
Peter Zijlstra <peterz@...radead.org>,
Paolo Bonzini <pbonzini@...hat.com>,
Ingo Molnar <mingo@...hat.com>,
Dario Faggioli <dfaggioli@...e.com>,
Mike Rapoport <rppt@...nel.org>,
David Hildenbrand <david@...hat.com>,
Mel Gorman <mgorman@...hsingularity.net>,
marcelo.cerri@...onical.com, tim.gardner@...onical.com,
khalid.elmously@...onical.com, philip.cox@...onical.com,
aarcange@...hat.com, peterx@...hat.com, x86@...nel.org,
linux-mm@...ck.org, linux-coco@...ts.linux.dev,
linux-efi@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCHv10 04/11] efi/x86: Implement support for unaccepted memory
On Tue, May 09, 2023 at 12:11:41AM +0200, Ard Biesheuvel wrote:
> > @@ -1324,13 +1325,15 @@ void __init e820__memblock_setup(void)
> > * e820_table is not finalized and e820__end_of_ram_pfn() cannot be
> > * used to get correct RAM size.
> > */
> > - if (boot_params.unaccepted_memory) {
> > + if (efi.unaccepted != EFI_INVALID_TABLE_ADDR) {
> > + struct efi_unaccepted_memory *unaccepted;
> > unsigned long size;
> >
> > - /* One bit per 2MB */
> > - size = DIV_ROUND_UP(e820__end_of_ram_pfn() * PAGE_SIZE,
> > - PMD_SIZE * BITS_PER_BYTE);
> > - memblock_reserve(boot_params.unaccepted_memory, size);
> > + unaccepted = __va(efi.unaccepted);
> > +
> > + size = sizeof(struct efi_unaccepted_memory);
> > + size += unaccepted->size;
> > + memblock_reserve(efi.unaccepted, size);
> > }
> >
>
> This could be moved to generic code (but we'll need to use early_memremap())
I don't understand why early_memremap() is needed. EFI_LOADER_DATA already
mapped into direct mapping. We only need to reserve the memory so it
could not be reallocated for other things. Hm?
--
Kiryl Shutsemau / Kirill A. Shutemov
Powered by blists - more mailing lists