From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-it1-x142.google.com (mail-it1-x142.google.com [IPv6:2607:f8b0:4864:20::142]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 40D58212777BF for ; Sat, 8 Jun 2019 00:20:26 -0700 (PDT) Received: by mail-it1-x142.google.com with SMTP id m3so6137337itl.1 for ; Sat, 08 Jun 2019 00:20:26 -0700 (PDT) MIME-Version: 1.0 References: <155925716254.3775979.16716824941364738117.stgit@dwillia2-desk3.amr.corp.intel.com> <155925718351.3775979.13546720620952434175.stgit@dwillia2-desk3.amr.corp.intel.com> In-Reply-To: From: Ard Biesheuvel Date: Sat, 8 Jun 2019 09:20:13 +0200 Message-ID: Subject: Re: [PATCH v2 4/8] x86, efi: Reserve UEFI 2.8 Specific Purpose Memory for dax List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: linux-nvdimm-bounces@lists.01.org Sender: "Linux-nvdimm" To: Dan Williams Cc: linux-efi , kbuild test robot , linux-nvdimm , the arch/x86 maintainers , Linux Kernel Mailing List , Mike Rapoport , Linux-MM , Ingo Molnar , Borislav Petkov , "H. Peter Anvin" , Darren Hart , Thomas Gleixner , Andy Shevchenko List-ID: On Fri, 7 Jun 2019 at 19:34, Dan Williams wrote: > > On Fri, Jun 7, 2019 at 8:23 AM Dan Williams wrote: > > > > On Fri, Jun 7, 2019 at 5:29 AM Ard Biesheuvel wrote: > [..] > > > > #ifdef CONFIG_EFI_APPLICATION_RESERVED > > > > static inline bool is_efi_application_reserved(efi_memory_desc_t *md) > > > > { > > > > return md->type == EFI_CONVENTIONAL_MEMORY > > > > && (md->attribute & EFI_MEMORY_SP); > > > > } > > > > #else > > > > static inline bool is_efi_application_reserved(efi_memory_desc_t *md) > > > > { > > > > return false; > > > > } > > > > #endif > > > > > > I think this policy decision should not live inside the EFI subsystem. > > > EFI just gives you the memory map, and mangling that information > > > depending on whether you think a certain memory attribute should be > > > ignored is the job of the MM subsystem. > > > > The problem is that we don't have an mm subsystem at the time a > > decision needs to be made. The reservation policy needs to be deployed > > before even memblock has been initialized in order to keep kernel > > allocations out of the reservation. I agree with the sentiment I just > > don't see how to practically achieve an optional "System RAM" vs > > "Application Reserved" routing decision without an early (before > > e820__memblock_setup()) conditional branch. > > I can at least move it out of include/linux/efi.h and move it to > arch/x86/include/asm/efi.h since it is an x86 specific policy decision > / implementation for now. No, that doesn't make sense to me. If it must live in the EFI subsystem, I'd prefer it to be in the core code, not in x86 specific code, since there is nothing x86 specific about it. Perhaps a efi=xxx command line option would be in order to influence the builtin default, but it can be a followup patch independent of this series. _______________________________________________ Linux-nvdimm mailing list Linux-nvdimm@lists.01.org https://lists.01.org/mailman/listinfo/linux-nvdimm