From patchwork Thu Sep 5 08:27:55 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sughosh Ganu X-Patchwork-Id: 825613 Delivered-To: patch@linaro.org Received: by 2002:adf:a345:0:b0:367:895a:4699 with SMTP id d5csp186484wrb; Thu, 5 Sep 2024 01:28:38 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCXskZR0Pzxo71Q18YXnQJi9U9Jc2VxhuY0VwScsjfxALTEYyaDAqGBcxdMmT4xeO8eU1mS3uA==@linaro.org X-Google-Smtp-Source: AGHT+IFIKospcLR8Mq7EOnXFzlAQU8U1IKYZ01KBU5pxhDTqpWTr+LzTRHFEFb+JWCZKSbQQxmX2 X-Received: by 2002:a2e:511a:0:b0:2f6:5f0a:9d00 with SMTP id 38308e7fff4ca-2f65f0a9f7dmr25636291fa.1.1725524918705; Thu, 05 Sep 2024 01:28:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1725524918; cv=none; d=google.com; s=arc-20240605; b=cUeGcGQZpzzDPXWmCQzipzn2ae+Qsa1sKX0baSFaNvi2oCNytJASpGXY3jUjWYMthw 4bdWiOWU/+h9ERcUsVgtGxBBJT25vLY71gSbvW5Hlh943uSbnfy3kDy8l/FkN5RF6rUs qs8A7pRwo6jik3YTjKUJHlcP0F1ZXnrvkBeD4m1kkph4ebpsZymOK5HPTyKtZb+O95GE g73ysu7oUt1fqbZD56iR7FNrK8BGOht8X8pIwmAGJvBObwitvgMRu/QofIGCBLDZGai+ UFfKWOWHbC60Ihdiuw2zvN1UfNFvlXpRW5NLLf4vrb5kvFni5Oft6fa6Wkrah7jUQuKP FVTg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:message-id:date:subject:cc:to:from; bh=kOhoY+9XiwPZH/ANk5JcvllmtHTd5b5vgwhO6MElHpE=; fh=Yh6jInHiU9e+TO5M9i/oIR5gBlW6gP+dCGqjtMGAO4w=; b=GbWrzdKSjRgpgjZz0Hg7irPEeWU5Qd0OPz1Pc0sgftDKi/NrWVHhOwEDwmRkgkh8+5 v/cYUGn9W1wYFzif0MURpnuE2I8zsjyHKk/k5mSym506C3NKmYFcxXF20PE5Ujyou5bu sgIdotabrz7KJ5vCbPwLxVW00ScIsHkk/eDZLUZMJlsN2FKx7sBJjRS4bkRbf0+xyAv2 9gIB63B5y2q+/sxhrj3EVKSR2F6762C1EBVEX0QF5HVrlY6eAkl4JoQFA+7HBWp/HM0d ggcljDnW06KM82StaSv3JRmd/S1TwC9KON2tQMCrJ3CZwyLR8zelSya7nW7S/e6YGNzm /cQw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from phobos.denx.de (phobos.denx.de. [2a01:238:438b:c500:173d:9f52:ddab:ee01]) by mx.google.com with ESMTPS id 4fb4d7f45d1cf-5c3cc6a8b60si1126565a12.468.2024.09.05.01.28.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Sep 2024 01:28:38 -0700 (PDT) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; Authentication-Results: mx.google.com; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 6AE0588C1B; Thu, 5 Sep 2024 10:28:37 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Received: by phobos.denx.de (Postfix, from userid 109) id C679788C1C; Thu, 5 Sep 2024 10:28:36 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-1.2 required=5.0 tests=BAYES_00, RCVD_IN_VALIDITY_RPBL_BLOCKED,RCVD_IN_VALIDITY_SAFE_BLOCKED, SPF_HELO_NONE,SPF_SOFTFAIL,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.2 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by phobos.denx.de (Postfix) with ESMTP id BD9F088C0C for ; Thu, 5 Sep 2024 10:28:34 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=fail smtp.mailfrom=sughosh.ganu@linaro.org Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 961D7FEC; Thu, 5 Sep 2024 01:29:00 -0700 (PDT) Received: from a079122.blr.arm.com (a079122.arm.com [10.162.17.48]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id E3F383F66E; Thu, 5 Sep 2024 01:28:31 -0700 (PDT) From: Sughosh Ganu To: u-boot@lists.denx.de Cc: Ilias Apalodimas , Heinrich Schuchardt , Simon Glass , Tom Rini , Bin Meng Subject: [PATCH 00/16] Make EFI memory allocations synchronous with LMB Date: Thu, 5 Sep 2024 13:57:55 +0530 Message-Id: <20240905082811.1585467-1-sughosh.ganu@linaro.org> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean This is part two of the series to have the EFI and LMB modules have a coherent view of memory. Part one of this goal was to change the LMB module to have a global and persistent memory map. Those patches have now been applied to the next branch. These patches are changing the EFI memory allocation API's such that they rely on the LMB module to allocate RAM memory. This fixes the current scenario where the EFI memory module has no visibility of the allocations/reservations made by the LMB module. One thing to note here is that this is limited to the RAM memory region, i.e. the EFI_CONVENTIONAL_MEMORY type. Any other memory type that is to be added to the EFI memory map, still gets handled by the EFI memory module. Note: To be applied on top of the next branch. Sughosh Ganu (16): lmb: add versions of the lmb API with flags lmb: add a flag to allow suppressing memory map change notification efi: memory: use the lmb API's for allocating and freeing memory event: add event to notify lmb memory map changes lib: Kconfig: add a config symbol for getting lmb memory map updates add a function to check if an address is in RAM memory lmb: notify of any changes to the LMB memory map efi_memory: add an event handler to update memory map ti: k3: remove efi_add_known_memory() function definition stm32mp: remove efi_add_known_memory() function definition lmb: allow for boards to specify memory map layerscape: use the lmb API's to add RAM memory x86: e820: use the lmb API for adding RAM memory efi_memory: do not add RAM memory to the memory map lmb: remove call to efi_lmb_reserve() test: event: update the expected event dump output arch/arm/cpu/armv8/fsl-layerscape/cpu.c | 8 +- arch/arm/mach-k3/common.c | 11 -- arch/arm/mach-stm32mp/dram_init.c | 11 -- arch/x86/lib/e820.c | 47 ++++-- common/board_r.c | 5 + common/event.c | 2 + include/efi_loader.h | 12 +- include/event.h | 14 ++ include/lmb.h | 11 ++ lib/Kconfig | 30 ++++ lib/efi_loader/Kconfig | 3 + lib/efi_loader/efi_memory.c | 184 ++++++++---------------- lib/lmb.c | 146 +++++++++++++------ test/py/tests/test_event_dump.py | 1 + 14 files changed, 276 insertions(+), 209 deletions(-)