From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=2607:f8b0:4864:20::343; helo=mail-ot1-x343.google.com; envelope-from=ard.biesheuvel@linaro.org; receiver=edk2-devel@lists.01.org Received: from mail-ot1-x343.google.com (mail-ot1-x343.google.com [IPv6:2607:f8b0:4864:20::343]) (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 28E9521BADAB3 for ; Thu, 20 Dec 2018 02:38:44 -0800 (PST) Received: by mail-ot1-x343.google.com with SMTP id f18so1128365otl.11 for ; Thu, 20 Dec 2018 02:38:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=TLkjDxzzri2iAV0JqHuAqaE63zKdtbxe/mvLPO1iskI=; b=HV9tAz1m0zwIl5uvQzlXA9coAKkuG+FamYypzzI4pb2tn2OQqZ5PhVSpzPkn3wbqpe Fm5p4SWm26enwtryxcmV4bkEHuOxox9+fWGHFOOp5fkqEdr9x0iPksH38ETBTPOQTC7P yCjH5G2CwvuZXizCcxr8xLOM8glUugMaCXAS8= 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=TLkjDxzzri2iAV0JqHuAqaE63zKdtbxe/mvLPO1iskI=; b=FfeAa5HzuWDoZd/t+DEfsfUUa+slJasMcY1taZAFRZwuah4CykhyWwNuDZtzT2lRu3 SCtvCbO44FYeHLN1b+API93qtnwO+ZPvZZeKrBFA8cxZF3zBWvQa2lZrlgXNLiriQYwN NrUjkd5BqdoRMtrPEEjwTOIkGr715Uy6tZjpUnnlqJeN52dh6mr3JithxEIPcoacMXRI 1GFr3KvbcMVLadZ2645PXtYyy2qaREp3Gj1mXf0a4foH+Za4YopdTvXuz4aAgA+g34tS VhahmE1YK2sF0jzDAHhxCdRy2ZlLhRL0z5N4eKgy10wduHxQ5STfveFIdSxY8OcMG/X1 n/3w== X-Gm-Message-State: AA+aEWY37q30ODT79NAyDUkZOQ5e4asvA5yS/WgB9Y27NxSnFq5V7VZI dXSNNqmoYtM/9IjdmhK1h+8ccDspk3C3vaNt4KSbjD4vcLI= X-Google-Smtp-Source: AFSGD/USxFwArgGebvEWmQudGuCFWer+Z41YPDIxpORL652Om4hZPxWlfRrtoLQqK9mtIS5KvYJZ24R8nWq1403wFm0= X-Received: by 2002:a9d:7059:: with SMTP id x25mr18294920otj.35.1545302323887; Thu, 20 Dec 2018 02:38:43 -0800 (PST) MIME-Version: 1.0 References: <20181219205640.4704-1-ard.biesheuvel@linaro.org> In-Reply-To: <20181219205640.4704-1-ard.biesheuvel@linaro.org> From: Ard Biesheuvel Date: Thu, 20 Dec 2018 11:38:32 +0100 Message-ID: To: "edk2-devel@lists.01.org" Cc: Michael D Kinney , Liming Gao , Jian J Wang , Hao Wu , Leif Lindholm , Laszlo Ersek , Eric Auger , Andrew Jones , Philippe Mathieu-Daude Subject: Re: [PATCH v2 0/6] introduce MAX_ALLOC_ADDRESS to limit boot time allocations X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Dec 2018 10:38:45 -0000 Content-Type: text/plain; charset="UTF-8" On Wed, 19 Dec 2018 at 21:56, Ard Biesheuvel wrote: > > Since modifying MAX_ADDRESS to limit the memory used at boot time has > turned out to be intractible, this series proposes another approach to do > the same, by introducing MAX_ALLOC_ADDRESS for firmware internal use. > > I tested these patches with ArmVirtQemu in the following way: > - limit MAX_ALLOC_ADDRESS to 0xFFFFFFFF (4 GB) > - build QEMU_EFI.fd > - run it under mach-virt with 4 GB of DRAM and highmem=off > > This runs as expected, and produces a memory map ending in the following > lines > > BS_Data 00000000FFFFD000-00000000FFFFFFFF 0000000000000003 0000000000000008 > Available 0000000100000000-000000013FFFFFFF 0000000000040000 0000000000000008 > > which proves that the memory above the limit is recorded and reported by > the OS, but left untouched by the firmware memory allocation routines. > > Cc: Michael D Kinney > Cc: Liming Gao > Cc: Jian J Wang > Cc: Hao Wu > Cc: Leif Lindholm > Cc: Laszlo Ersek > Cc: Eric Auger > Cc: Andrew Jones > Cc: Philippe Mathieu-Daude > > Ard Biesheuvel (6): > MdePkg/Base: introduce MAX_ALLOC_ADDRESS > MdeModulePkg/Dxe/Gcd: disregard memory above MAX_ALLOC_ADDRESS > MdeModulePkg/Dxe/Page: take MAX_ALLOC_ADDRESS into account > ArmPkg/ArmMmuLib: take MAX_ALLOC_ADDRESS into account > ArmPlatformPkg/MemoryInitPeim: take MAX_ALLOC_ADDRESS into account > ArmVirtPkg/MemoryInitPeiLib: split memory HOB based on > MAX_ALLOC_ADDRESS > Pushed as 5c8bc8be9e5e..4a1500db2b42 Thanks all