From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 763BAC4CEC7 for ; Fri, 13 Sep 2019 15:02:42 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 4E90221479 for ; Fri, 13 Sep 2019 15:02:42 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=intel-com.20150623.gappssmtp.com header.i=@intel-com.20150623.gappssmtp.com header.b="XcrIfAGL" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2390482AbfIMPCl (ORCPT ); Fri, 13 Sep 2019 11:02:41 -0400 Received: from mail-oi1-f195.google.com ([209.85.167.195]:37052 "EHLO mail-oi1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2390376AbfIMPCl (ORCPT ); Fri, 13 Sep 2019 11:02:41 -0400 Received: by mail-oi1-f195.google.com with SMTP id 11so2906508oix.4 for ; Fri, 13 Sep 2019 08:02:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=FL1GjXU4OxVtgje4G6mCeYw5JgQRyVmMHSk6LS6L6h0=; b=XcrIfAGLgnCngGnqO1DJcdE95s67blXTpvCmuoC4POiBmx1B9clK5ZNugaQYZJsHUK LRRlS7On0v8cTv9pXBKg5amy+FZZUlwUL7z05OwVEHx82wbE3R4S2AW1N/pUtqyq+coe IxqcEgPQZzwzDUjxbbqdywUSKT8qPsXxZunO4CUbU0DklVvrpC3nBd3ULVxpo/T9HIUV CxZ18AffXR0nlOKPGBkl6EiS3GhbOs46/HGXTUldnrXoG2kQLecamfhdRyIzxHQX4Ta4 86UKX/JIqHw9xYUfiv4/nwCOTRYSHTLVvwAOG3sBbWBbBCNaCkJREJNSrKCEVbUnh+Ms xEtQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=FL1GjXU4OxVtgje4G6mCeYw5JgQRyVmMHSk6LS6L6h0=; b=G68TAIBx3KxiqV8lpzn0KAZ9i4ASpvWrfeHwtBw7zQgMHXZuAS6I5daw4FwlEPvcW8 goNeCPRi19H3dCCS3ZZ6FgpRcZWtrssd7y2Mqgbsz4aK/MwhDo6g1ryctOs9dXUK2Qb6 oPpo/su2A+zGgqXm5/RGBiUiiw/qYgbmKascJwQVudO/NycynMgWUT+x7be8OnsAa3zF T9g6tEq/CbhuhElcMt2MtwMkp89fHA9QhKFLUFTo3uvUM3DMedEi4M08OlyksmGQQEgF QBGT+QmfF9UiuIoO1e3SXBJrPrI3aiIpO12wXHh8iaPPm4n4ffpb9La9ifkSv0EJZMBp xotQ== X-Gm-Message-State: APjAAAXMed9c2qk+6gjxlcqobqKvdVWfjgY2+HVALai22jAPq9/Lerv6 +pfR6QAFXyXTzle3ruBJPy9DluUPFjcgz943psDU1A== X-Google-Smtp-Source: APXvYqyeEJXWj7rpxrv1qz+5i2zLZaF/SLL5wmnwCw6eD+cUG7FsoCaEJNlzjXu8gUdNFX/hYHgq60QKgMlpEmp2U7Y= X-Received: by 2002:aca:4b05:: with SMTP id y5mr2670978oia.70.1568386960199; Fri, 13 Sep 2019 08:02:40 -0700 (PDT) MIME-Version: 1.0 References: <156712993795.1616117.3781864460118989466.stgit@dwillia2-desk3.amr.corp.intel.com> <156712996407.1616117.11409311856083390862.stgit@dwillia2-desk3.amr.corp.intel.com> In-Reply-To: From: Dan Williams Date: Fri, 13 Sep 2019 08:02:26 -0700 Message-ID: Subject: Re: [PATCH v5 05/10] x86, efi: Add efi_fake_mem support for EFI_MEMORY_SP To: Ard Biesheuvel Cc: Thomas Gleixner , "Rafael J. Wysocki" , "the arch/x86 maintainers" , Borislav Petkov , Ingo Molnar , "H. Peter Anvin" , Dave Hansen , Peter Zijlstra , Vishal L Verma , Linux Kernel Mailing List , linux-efi Content-Type: text/plain; charset="UTF-8" Sender: linux-efi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-efi@vger.kernel.org On Fri, Sep 13, 2019 at 6:02 AM Ard Biesheuvel wrote: > > On Fri, 30 Aug 2019 at 03:07, Dan Williams wrote: > > > > Given that EFI_MEMORY_SP is platform BIOS policy descision for marking > > decision Fixed. > > > memory ranges as "reserved for a specific purpose" there will inevitably > > be scenarios where the BIOS omits the attribute in situations where it > > is desired. Unlike other attributes if the OS wants to reserve this > > memory from the kernel the reservation needs to happen early in init. So > > early, in fact, that it needs to happen before e820__memblock_setup() > > which is a pre-requisite for efi_fake_memmap() that wants to allocate > > memory for the updated table. > > > > Introduce an x86 specific efi_fake_memmap_early() that can search for > > attempts to set EFI_MEMORY_SP via efi_fake_mem and update the e820 table > > accordingly. > > > > Is this early enough? The EFI stub runs before this, and allocates > memory as well. Unless I'm missing something the stub only allocates where the kernel will land. That should be handled by the new mem_avoid_memmap() extensions to consider "efi_fake_mem" in its exclusions.