From patchwork Fri Jun 22 08:38:26 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bin Meng X-Patchwork-Id: 933150 X-Patchwork-Delegate: bmeng.cn@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="YXZU7cY0"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 41BsM13X8Bz9s4V for ; Fri, 22 Jun 2018 18:34:53 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id D856AC22007; Fri, 22 Jun 2018 08:34:03 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=-0.0 required=5.0 tests=FREEMAIL_FROM, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id BD498C21FA3; Fri, 22 Jun 2018 08:33:45 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id AC011C21C2F; Fri, 22 Jun 2018 08:33:42 +0000 (UTC) Received: from mail-pg0-f66.google.com (mail-pg0-f66.google.com [74.125.83.66]) by lists.denx.de (Postfix) with ESMTPS id 1BC59C21C2C for ; Fri, 22 Jun 2018 08:33:42 +0000 (UTC) Received: by mail-pg0-f66.google.com with SMTP id a14-v6so2655180pgw.10 for ; Fri, 22 Jun 2018 01:33:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=5jGZp2iL5hMxMp4kXFXr5JGeXlEwK4NBDK2KLKirhQk=; b=YXZU7cY0YOAqjSkxXjV+ra63ctCRZ3k9c2qBCJQmsTfCyM0bf8klS10Hkuo4Th34rL Ftj563onM1cUvPumsiB84Fo7N3Tv42gqw8wyAwfxxSKbDMsjfIZeCjTR9QKVvCf31Fym nKcC/59iA+/BVwzuodoo9tct828CYBE3kGgqI6rxBG96egDaIiJCnSBrAgdUsczjlnoS Ie1dHrrTgi6ivVyzXl1u+08xBetU3HIzbUBdbWEfEET6GfED5nkBM+VmhUHmmJmN+DXD QqmA/mNrYJYjBMeRueer0D85lb/u/bo8FNaa6vEGU5laya0yJgevLAV7eQCq7wSkBhOU aYxw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=5jGZp2iL5hMxMp4kXFXr5JGeXlEwK4NBDK2KLKirhQk=; b=f3zaZb0UxFV8wCzn4bv6gMXXHwKJ23LJHYqnAPMqtoK3pEHinem85y55MAnTbJSsMk sG1uK5Yj5cjj7OwCjBdBrMsylKM1ufWurtWxWXaJfgiiU3OBcjqYZ9v5ww4Y3VkWQFZz E1hj0AkW8r8rWrUHPhIP/28trKlXbWb1JtFiUt4vmYhW6DF2u8WQ51fL4W8AW1Uu85Nb f/jhfJw3oCSEy53gbfRrGp9d0cFd8uRLkDFLqUitQIuHbchMvrUNmcpEL4KIiqgN1cWB yQd9yko0oLMXyFsKzQy/g0aropoGrD5t2mJtNdenC741cCqwXe5h9BmaLVAOAv+86jPJ PFWQ== X-Gm-Message-State: APt69E0VZjG2JFucYZOhV/sTlniRCiKmwZLKs2OiK3u8FO1YjSH4EaXE Hv+tgDHlJxtyJiAMIHpxnUw= X-Google-Smtp-Source: ADUXVKICvqJ9DJhTPerfu8UjfSBI8eZBm/16033FsxpkwJDta/ejfoKdWWPowVjuMBZWldZiEQpY4A== X-Received: by 2002:a63:8848:: with SMTP id l69-v6mr536271pgd.377.1529656420657; Fri, 22 Jun 2018 01:33:40 -0700 (PDT) Received: from ala-d2121-lx1.wrs.com (unknown-156-139.windriver.com. [147.11.156.139]) by smtp.gmail.com with ESMTPSA id y11-v6sm10219474pfn.92.2018.06.22.01.33.39 (version=TLS1_1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 22 Jun 2018 01:33:39 -0700 (PDT) From: Bin Meng To: Simon Glass , U-Boot Mailing List Date: Fri, 22 Jun 2018 01:38:26 -0700 Message-Id: <1529656712-3660-2-git-send-email-bmeng.cn@gmail.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1529656712-3660-1-git-send-email-bmeng.cn@gmail.com> References: <1529656712-3660-1-git-send-email-bmeng.cn@gmail.com> Cc: Alexander Graf Subject: [U-Boot] [PATCH 1/6] efi.h: Do not use config options X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" From: Alexander Graf Currently efi.h determines a few bits of its environment according to config options. This falls apart with the efi stub support which may result in efi.h getting pulled into the stub as well as real U-Boot code. In that case, one may be 32bit while the other one is 64bit. This patch changes the conditionals to use compiler provided defines instead. That way we always adhere to the build environment we're in and the definitions adjust automatically. Signed-off-by: Alexander Graf Reviewed-by: Bin Meng Tested-by: Bin Meng [bmeng: added some comments to describe the __x86_64__ check] Signed-off-by: Bin Meng Reviewed-by: Simon Glass --- include/efi.h | 24 +++++++++++------------- lib/efi/Makefile | 4 ++-- 2 files changed, 13 insertions(+), 15 deletions(-) diff --git a/include/efi.h b/include/efi.h index 2448dde..0fe15e6 100644 --- a/include/efi.h +++ b/include/efi.h @@ -19,12 +19,19 @@ #include #include -#if CONFIG_EFI_STUB_64BIT || (!defined(CONFIG_EFI_STUB) && defined(__x86_64__)) -/* EFI uses the Microsoft ABI which is not the default for GCC */ +/* + * EFI on x86_64 uses the Microsoft ABI which is not the default for GCC. + * + * There are two scenarios for EFI on x86_64: building a 64-bit EFI stub + * codes (CONFIG_EFI_STUB_64BIT) and building a 64-bit U-Boot (CONFIG_X86_64). + * Either needs to be properly built with the '-m64' compiler flag, and hence + * it is enough to only check the compiler provided define __x86_64__ here. + */ +#ifdef __x86_64__ #define EFIAPI __attribute__((ms_abi)) #else #define EFIAPI asmlinkage -#endif +#endif /* __x86_64__ */ struct efi_device_path; @@ -32,16 +39,7 @@ typedef struct { u8 b[16]; } efi_guid_t; -#define EFI_BITS_PER_LONG BITS_PER_LONG - -/* - * With 64-bit EFI stub, EFI_BITS_PER_LONG has to be 64. EFI_STUB is set - * in lib/efi/Makefile, when building the stub. - */ -#if defined(CONFIG_EFI_STUB_64BIT) && defined(EFI_STUB) -#undef EFI_BITS_PER_LONG -#define EFI_BITS_PER_LONG 64 -#endif +#define EFI_BITS_PER_LONG (sizeof(long) * 8) /* Bit mask for EFI status code with error */ #define EFI_ERROR_MASK (1UL << (EFI_BITS_PER_LONG - 1)) diff --git a/lib/efi/Makefile b/lib/efi/Makefile index f1a3929..a790d2d 100644 --- a/lib/efi/Makefile +++ b/lib/efi/Makefile @@ -7,11 +7,11 @@ obj-$(CONFIG_EFI_STUB) += efi_info.o CFLAGS_REMOVE_efi_stub.o := -mregparm=3 \ $(if $(CONFIG_EFI_STUB_64BIT),-march=i386 -m32) -CFLAGS_efi_stub.o := -fpic -fshort-wchar -DEFI_STUB \ +CFLAGS_efi_stub.o := -fpic -fshort-wchar \ $(if $(CONFIG_EFI_STUB_64BIT),-m64) CFLAGS_REMOVE_efi.o := -mregparm=3 \ $(if $(CONFIG_EFI_STUB_64BIT),-march=i386 -m32) -CFLAGS_efi.o := -fpic -fshort-wchar -DEFI_STUB \ +CFLAGS_efi.o := -fpic -fshort-wchar \ $(if $(CONFIG_EFI_STUB_64BIT),-m64) extra-$(CONFIG_EFI_STUB) += efi_stub.o efi.o From patchwork Fri Jun 22 08:38:27 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bin Meng X-Patchwork-Id: 933151 X-Patchwork-Delegate: bmeng.cn@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="iI7kLxLh"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 41BsM84Gvpz9s4V for ; Fri, 22 Jun 2018 18:35:00 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id 24992C21F93; Fri, 22 Jun 2018 08:34:19 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=-0.0 required=5.0 tests=FREEMAIL_FROM, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 95C80C21C2C; Fri, 22 Jun 2018 08:33:53 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 314B4C21F8E; Fri, 22 Jun 2018 08:33:47 +0000 (UTC) Received: from mail-pl0-f66.google.com (mail-pl0-f66.google.com [209.85.160.66]) by lists.denx.de (Postfix) with ESMTPS id 6C186C21C2C for ; Fri, 22 Jun 2018 08:33:43 +0000 (UTC) Received: by mail-pl0-f66.google.com with SMTP id w17-v6so3124604pll.9 for ; Fri, 22 Jun 2018 01:33:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=OYbrWE77H9/kC44/2pCjJ+iB4+/FuFyyrxN9BeabGAA=; b=iI7kLxLhtd3vKQZENYH1wzalkCjSRX4ts7JPizGbWXayT+RplTIBYd5oDT1GbYLcls 7J0GuTMC/SOry4nnF4LVF2rLhL/hpl+FIE64H0y2bjI9pFbs1dWe9xSsAJDsi8TXPajg 3vj9/gCkSS4l78sgmWN9tFqVVTLcYwseb05LVDP+JkxIdlTD+MXcjwG5grUKJh+krFc0 h1IDkFmrRtKahjaU0kOL8UJmiPx2kE9Ev6mT6mdx+YNuUGVDhXg9BnsxA9dza8JQulZz IY1ZMVk7uRHwQhSLWTvA+mooETP2DdOAOYJBjcf29esTYoD/PrRcVKfiI2q2CcSKf/XX NfFA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=OYbrWE77H9/kC44/2pCjJ+iB4+/FuFyyrxN9BeabGAA=; b=IfhQICKZrlpJkWtIQFe7jVZKwiVNTiXgC3cnxCwfga69Fg3JOfAOrvN7+lHuSwRIvM ghExmySEWZhZmJPw08a2n9pXoCOhLBzSoqLHXJAOrT/NxpQY2pEKw+bshQ0QOJ8kB5b9 CGvtttG3VCo2AID8LFdZ0C4IK+V+kEiQPiO5iBQM/wkA59jVJLHVINdyRfcVFkG3FTyE E3kCzldDLUt/GFbGBwLh1VBGwTh4gc3rAjUwrBso4GEVbW+ZLaaqicwQGxbGaaNxqyTp YXhZds9YVx9IAYt+7vXDilqsQj09cNhFinXxe80f9Sdsf8S1cI0hytc3vR1UuHF7EwW1 auAQ== X-Gm-Message-State: APt69E0NljWNTSA88oWFkvj9V9F6Gr+IXEF25nXjOL0m3ucxUIIXU+yX An4iRphAHCOHIlD0UW3UHlM= X-Google-Smtp-Source: ADUXVKLCj7GgLsq9oQ60XjfbGxZIiJn7c56YZ6kxUVbXZJ5sfJEDPh99FtzOjPADhQCJbBGNJ7sBJg== X-Received: by 2002:a17:902:6e01:: with SMTP id u1-v6mr701310plk.96.1529656422207; Fri, 22 Jun 2018 01:33:42 -0700 (PDT) Received: from ala-d2121-lx1.wrs.com (unknown-156-139.windriver.com. [147.11.156.139]) by smtp.gmail.com with ESMTPSA id y11-v6sm10219474pfn.92.2018.06.22.01.33.40 (version=TLS1_1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 22 Jun 2018 01:33:41 -0700 (PDT) From: Bin Meng To: Simon Glass , U-Boot Mailing List Date: Fri, 22 Jun 2018 01:38:27 -0700 Message-Id: <1529656712-3660-3-git-send-email-bmeng.cn@gmail.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1529656712-3660-1-git-send-email-bmeng.cn@gmail.com> References: <1529656712-3660-1-git-send-email-bmeng.cn@gmail.com> Cc: Bin Meng Subject: [U-Boot] [PATCH 2/6] x86: Change __kernel_size_t conditionals to use compiler provided defines X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" Since commit bb0bb91cf0aa ("efi_stub: Use efi_uintn_t"), EFI x86 64-bit payload does not work anymore. The call to GetMemoryMap() in efi_stub.c fails with return code EFI_INVALID_PARAMETER. Since the payload itself is still 32-bit U-Boot, efi_uintn_t gets wrongly interpreted as int, but it should actually be long in a 64-bit EFI environment. This changes the x86 __kernel_size_t conditionals to use compiler provided defines instead. That way we always adhere to the build environment we're in and the definitions adjust automatically. Fixes: bb0bb91cf0aa ("efi_stub: Use efi_uintn_t") Signed-off-by: Bin Meng Reviewed-by: Simon Glass --- arch/x86/include/asm/posix_types.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/arch/x86/include/asm/posix_types.h b/arch/x86/include/asm/posix_types.h index 717f6cb..dbcea7f 100644 --- a/arch/x86/include/asm/posix_types.h +++ b/arch/x86/include/asm/posix_types.h @@ -16,7 +16,8 @@ typedef int __kernel_pid_t; typedef unsigned short __kernel_ipc_pid_t; typedef unsigned short __kernel_uid_t; typedef unsigned short __kernel_gid_t; -#if CONFIG_IS_ENABLED(X86_64) +/* checking against __x86_64__ covers both 64-bit EFI stub and 64-bit U-Boot */ +#if defined(__x86_64__) typedef unsigned long __kernel_size_t; typedef long __kernel_ssize_t; #else From patchwork Fri Jun 22 08:38:28 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bin Meng X-Patchwork-Id: 933153 X-Patchwork-Delegate: bmeng.cn@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="pAjvv6M7"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 41BsNh4Jh2z9s4b for ; Fri, 22 Jun 2018 18:36:20 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id 2434DC21FA3; Fri, 22 Jun 2018 08:34:35 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=-0.0 required=5.0 tests=FREEMAIL_FROM, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 621ECC21FAC; Fri, 22 Jun 2018 08:33:54 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 5F2A5C2200D; Fri, 22 Jun 2018 08:33:48 +0000 (UTC) Received: from mail-pl0-f68.google.com (mail-pl0-f68.google.com [209.85.160.68]) by lists.denx.de (Postfix) with ESMTPS id EB40AC21F92 for ; Fri, 22 Jun 2018 08:33:44 +0000 (UTC) Received: by mail-pl0-f68.google.com with SMTP id o18-v6so2440287pll.12 for ; Fri, 22 Jun 2018 01:33:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=pv6ha9O4emKyIuta+wnzRYbtvz3/vf1KmYviV8xyIxg=; b=pAjvv6M7fb+0M21qr7l7vq8cYOO2RaA/Gwapdh4fEuMvhgzI9MFW7hgabKOlQiDFvY wNqfs4314YAON0JU/zR857zucKDzSDSHmv+qM9isyk+kSgktjl6GM5I6XxQw75oIpu8Z ci5Hx7keDdiRjKuKcUE5ZO39HlTBIB+9YcGnEg0nKIPFKJ1B3YLWLY7dSpTytESvEN5l E+1xLzi17kdBaDzixwVK4U0bwnEivPmS0jBxdDHE4tPP9N3hIiAOmBE8XwmXFT4O00pH 9sRrUEDwIjAYgcz/wqpJhRfE745JCUaKGsTKTl0kxux4jAED0XvJ5X25xf6pwTYPiGpe duyg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=pv6ha9O4emKyIuta+wnzRYbtvz3/vf1KmYviV8xyIxg=; b=pIR1iX+8bJgPSrdBGnPxyvVBHGmbi8AbC037INvEQF5lFS7gJTyEOVBAiJyu/AbgWZ s+s6jeJua4n7QLtsI8Ycm1oozl5Xt8cegRWr/XUn6/7YAdD/jO7aKOKNiJ3akqbDjd83 hH/7NX9A2vUN2aNvuU2DQQ3DLNLAce73mm8k21Du7/Y7xBnfMWkkbVCHpbkk9Nc424VK +CgeJ7Nk6YX6Hwv2AjmeqFAjj3wqYfGmMY4iZhcKxsvVUAaSTutl3/Somzb4z37mPoVz qKnGLKZmtk6Hm8gPT/axb0QdzRcLy+iqIRXtZGJbTEwxZx12OBlGOBsvvK45iiGlDhMX 4ISw== X-Gm-Message-State: APt69E0ZasJcyFQUmUn5KfJqT63+HYvRFN64V+0Ev9wGcC/of3vfj8Pz 1CTIM8EAsxpkdjZN11ksqIc= X-Google-Smtp-Source: ADUXVKJ5UZV3pD+sVXiyz6bo7J/d/swocK7gCozAoezLr0Txb98/jy1KNeZ+Vio/9TdHLBYi3TyLkA== X-Received: by 2002:a17:902:b195:: with SMTP id s21-v6mr696759plr.202.1529656423702; Fri, 22 Jun 2018 01:33:43 -0700 (PDT) Received: from ala-d2121-lx1.wrs.com (unknown-156-139.windriver.com. [147.11.156.139]) by smtp.gmail.com with ESMTPSA id y11-v6sm10219474pfn.92.2018.06.22.01.33.42 (version=TLS1_1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 22 Jun 2018 01:33:42 -0700 (PDT) From: Bin Meng To: Simon Glass , U-Boot Mailing List Date: Fri, 22 Jun 2018 01:38:28 -0700 Message-Id: <1529656712-3660-4-git-send-email-bmeng.cn@gmail.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1529656712-3660-1-git-send-email-bmeng.cn@gmail.com> References: <1529656712-3660-1-git-send-email-bmeng.cn@gmail.com> Cc: Alexander Graf Subject: [U-Boot] [PATCH 3/6] efi: stub: Move the use_uart assignment immediately after exit_boot_services() call X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" The use_uart assignment should follow immediately after the call to exit_boot_services(), in case we want some debug output after that. Signed-off-by: Bin Meng Reviewed-by: Simon Glass --- lib/efi/efi_stub.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/efi/efi_stub.c b/lib/efi/efi_stub.c index 262fc56..1b495ec 100644 --- a/lib/efi/efi_stub.c +++ b/lib/efi/efi_stub.c @@ -361,14 +361,14 @@ efi_status_t EFIAPI efi_main(efi_handle_t image, } } + /* The EFI UART won't work now, switch to a debug one */ + use_uart = true; + map.version = version; map.desc_size = desc_size; add_entry_addr(priv, EFIET_MEMORY_MAP, &map, sizeof(map), desc, size); add_entry_addr(priv, EFIET_END, NULL, 0, 0, 0); - /* The EFI UART won't work now, switch to a debug one */ - use_uart = true; - memcpy((void *)CONFIG_SYS_TEXT_BASE, _binary_u_boot_bin_start, (ulong)_binary_u_boot_bin_end - (ulong)_binary_u_boot_bin_start); From patchwork Fri Jun 22 08:38:29 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bin Meng X-Patchwork-Id: 933154 X-Patchwork-Delegate: bmeng.cn@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="JOfl3KYF"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 41BsNz1yvvz9s1B for ; Fri, 22 Jun 2018 18:36:35 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id 9FE2BC2204A; Fri, 22 Jun 2018 08:34:51 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=FREEMAIL_FROM, T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 6CE00C2200E; Fri, 22 Jun 2018 08:34:00 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id E13F2C21F92; Fri, 22 Jun 2018 08:33:50 +0000 (UTC) Received: from mail-pl0-f42.google.com (mail-pl0-f42.google.com [209.85.160.42]) by lists.denx.de (Postfix) with ESMTPS id 6D725C21F8E for ; Fri, 22 Jun 2018 08:33:46 +0000 (UTC) Received: by mail-pl0-f42.google.com with SMTP id 6-v6so3142683plb.0 for ; Fri, 22 Jun 2018 01:33:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=Xiau6EidzZkzBT96evsraPN/vMCHLiePHx4hh/L8az8=; b=JOfl3KYF2bjeouOQYUKeCQiQ8Vt8QYODx2NSdzMvy5/Xqj4V8s4lUojQ0rmrFC4iuV 7MgM2EowCXsNEk6EOHXa3Wq36JNXe15KKWba+rj4codlV5PM7klHhYa0nzoS08o63S7I ImSic6QQxDY/hjYBr1Y/epmXNuoDsxfbuRlccmpVIePw1frEyqohJZ+XViMF4qSXNwCz AOAtexwgw5578HcgEFzWD4appX7K4ioi0FsZz09ZZNoNS6Qko1wmaRhCnVba6fqudhTW F7F82xJ5sxCQ5VnM/0/cHDgyQeZJ/ean4qXt77EL58LNiTbEe5wpGQ01LBSoRfcUCT1a 2lug== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=Xiau6EidzZkzBT96evsraPN/vMCHLiePHx4hh/L8az8=; b=aTFOGWuiaz6+4aP0tylrCAupQRheNKa4YEe+R/vZaT/jubTsFMZ2vn2LzPuq8y0gJX MWZgnKPVLNKwX61AedtvPmw9LQM59RcwA9sm5pwaF5/cyGX2T9kkq8TvzxIK4NroAZq0 93zsx3jzW1ddLxpvz4DL70PQeOmN6Z7cSH2Q3YZqvoYHG4wmmS2J2WHhSCvlq7+Zlm4E q9qBZlJ6DjgNfNrVsak43SGUu798SEJRJfdYPFd7kdEbIXQKnJHWNFo94Ji3+D559HXI RNdfvdAOG1UhuPUv3oxrvTj42Iqab/LfqgtkCJICWzdGEuYLckTTQhJN58GZh+8+ysEV 4K5g== X-Gm-Message-State: APt69E3t+mOShD4gREwO9cnGlh+6gN/GtaBdGG5vzt71qm1KZYVTPFmb V6LCZn26lJ7bc5ZUD0qI5vZkMA== X-Google-Smtp-Source: ADUXVKIz5nP5kQE6+9QR5ibJa4yuIpCnSRTtEZYPu6tITxmZ+tNmnScugToQXaAVtG3XNlauC1+OFw== X-Received: by 2002:a17:902:a989:: with SMTP id bh9-v6mr681217plb.245.1529656425210; Fri, 22 Jun 2018 01:33:45 -0700 (PDT) Received: from ala-d2121-lx1.wrs.com (unknown-156-139.windriver.com. [147.11.156.139]) by smtp.gmail.com with ESMTPSA id y11-v6sm10219474pfn.92.2018.06.22.01.33.43 (version=TLS1_1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 22 Jun 2018 01:33:44 -0700 (PDT) From: Bin Meng To: Simon Glass , U-Boot Mailing List Date: Fri, 22 Jun 2018 01:38:29 -0700 Message-Id: <1529656712-3660-5-git-send-email-bmeng.cn@gmail.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1529656712-3660-1-git-send-email-bmeng.cn@gmail.com> References: <1529656712-3660-1-git-send-email-bmeng.cn@gmail.com> Cc: Bin Meng Subject: [U-Boot] [PATCH 4/6] x86: efi-x86_payload: Enable PRE_CONSOLE_BUFFER X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" Enable PRE_CONSOLE_BUFFER so that the full boot output can be viewed on the video console for the EFI payload. Signed-off-by: Bin Meng Reviewed-by: Simon Glass --- configs/efi-x86_payload32_defconfig | 2 ++ configs/efi-x86_payload64_defconfig | 2 ++ 2 files changed, 4 insertions(+) diff --git a/configs/efi-x86_payload32_defconfig b/configs/efi-x86_payload32_defconfig index 7f0cab0..5b6f125 100644 --- a/configs/efi-x86_payload32_defconfig +++ b/configs/efi-x86_payload32_defconfig @@ -6,6 +6,8 @@ CONFIG_FIT=y CONFIG_FIT_SIGNATURE=y CONFIG_USE_BOOTARGS=y CONFIG_BOOTARGS="root=/dev/sdb3 init=/sbin/init rootwait ro" +CONFIG_PRE_CONSOLE_BUFFER=y +CONFIG_PRE_CON_BUF_ADDR=0x100000 CONFIG_SYS_CONSOLE_INFO_QUIET=y CONFIG_DISPLAY_BOARDINFO_LATE=y CONFIG_LAST_STAGE_INIT=y diff --git a/configs/efi-x86_payload64_defconfig b/configs/efi-x86_payload64_defconfig index 8d7f3f0..71fdb5c 100644 --- a/configs/efi-x86_payload64_defconfig +++ b/configs/efi-x86_payload64_defconfig @@ -6,6 +6,8 @@ CONFIG_FIT=y CONFIG_FIT_SIGNATURE=y CONFIG_USE_BOOTARGS=y CONFIG_BOOTARGS="root=/dev/sdb3 init=/sbin/init rootwait ro" +CONFIG_PRE_CONSOLE_BUFFER=y +CONFIG_PRE_CON_BUF_ADDR=0x100000 CONFIG_SYS_CONSOLE_INFO_QUIET=y CONFIG_DISPLAY_BOARDINFO_LATE=y CONFIG_LAST_STAGE_INIT=y From patchwork Fri Jun 22 08:38:30 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bin Meng X-Patchwork-Id: 933155 X-Patchwork-Delegate: bmeng.cn@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="Y1gSvneI"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 41BsPK2Cmhz9s1B for ; Fri, 22 Jun 2018 18:36:53 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id 0B034C21F2F; Fri, 22 Jun 2018 08:35:23 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=-0.0 required=5.0 tests=FREEMAIL_FROM, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 8A9A9C2201E; Fri, 22 Jun 2018 08:34:18 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 6E29DC21F1F; Fri, 22 Jun 2018 08:33:51 +0000 (UTC) Received: from mail-pl0-f65.google.com (mail-pl0-f65.google.com [209.85.160.65]) by lists.denx.de (Postfix) with ESMTPS id E6EBFC21FE7 for ; Fri, 22 Jun 2018 08:33:47 +0000 (UTC) Received: by mail-pl0-f65.google.com with SMTP id k1-v6so3137083plt.2 for ; Fri, 22 Jun 2018 01:33:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=ETnlW356TZTkRqbBfFMTC81Ll6AYLfuuiaaTiJnaBR8=; b=Y1gSvneIZrp5jk4O+zUbrRCTeFOeVaaIpzei58RgCZ0ryIQxbG0AQkEZeUX0cZBO+x b+dB2YQg0wEtcVH/REFR9Lepl55NWsRWjcuGbF/HpjQidvVZW1CaQusGTj58EMj1aQqK dmF5gmQYFhXjgTRk4+oAe4bE1rbrcsE8DvL8jWON0ZmhNWPdNdjUUlw4UwhE+zeIQyVF DA9pxXFJXL+ywSWlAHtI/zVfc/28hm5UknwpC1MAMzSoUhQo0iP5CP5srmbHhcpUoIAt gsOu+zR4U1wo9G2B9IacyA2KiH4BfZEWhGRem8RYnSesQt/wF19gtQNYqIKdAWxaLODt ftiQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=ETnlW356TZTkRqbBfFMTC81Ll6AYLfuuiaaTiJnaBR8=; b=Cwh5EFoI2r/UXE2MoiI1e8BhUC1MR3oY1/qRFZ7qCuuBnvfSos0h0wzbcsvfdbTRaR JIACaofJOpg5d2s4ECY2G4rpEJJj7vS23M2LnAEqt12cC+zVxSOIoeqo6clyV2OxL/xB m3xoH2iEQ5zI9fC7iPWEExTjvC7moL+idUr/LbOThcJCvXLKBaQEdQAcnqtwVKu+3GpD NL84A9GuEfb9h6eYaGw3p30neLbcbPCN8y38P/cOVzBWOp9t0iMcFdQ5luG2hsn7MUmv v2Gp7T5ANDhm2sbQ7t65d/+xM3YPbA9SdfaHgD9jPHAYTRJoO1Y4k3zOxTWoEgAg74OM 6JRg== X-Gm-Message-State: APt69E2yuA4CaZ1v0S4zBjmrQ7HrHKBfKArmvtbtE/clp0En+HyX0hig SEbn5w4SZxTaHm/dWhENo3I= X-Google-Smtp-Source: ADUXVKLoCEPJXLJ//PQfx9r7cN60zrnomGvph6bjUJOhS7O9dwthMjLv/yMVcgffpNSGmihMcpFv5w== X-Received: by 2002:a17:902:bccc:: with SMTP id o12-v6mr673334pls.169.1529656426689; Fri, 22 Jun 2018 01:33:46 -0700 (PDT) Received: from ala-d2121-lx1.wrs.com (unknown-156-139.windriver.com. [147.11.156.139]) by smtp.gmail.com with ESMTPSA id y11-v6sm10219474pfn.92.2018.06.22.01.33.45 (version=TLS1_1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 22 Jun 2018 01:33:45 -0700 (PDT) From: Bin Meng To: Simon Glass , U-Boot Mailing List Date: Fri, 22 Jun 2018 01:38:30 -0700 Message-Id: <1529656712-3660-6-git-send-email-bmeng.cn@gmail.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1529656712-3660-1-git-send-email-bmeng.cn@gmail.com> References: <1529656712-3660-1-git-send-email-bmeng.cn@gmail.com> Cc: Bin Meng Subject: [U-Boot] [PATCH 5/6] x86: efi: payload: Count in conventional memory above 4GB in DRAM bank X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" At present in dram_init_banksize() it ignores conventional memory below 4GB. This leads to wrong DRAM size is printed during boot. Remove such limitation. Signed-off-by: Bin Meng Reviewed-by: Simon Glass --- arch/x86/cpu/efi/payload.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/arch/x86/cpu/efi/payload.c b/arch/x86/cpu/efi/payload.c index e3f0f82..4649bfe 100644 --- a/arch/x86/cpu/efi/payload.c +++ b/arch/x86/cpu/efi/payload.c @@ -109,11 +109,10 @@ int dram_init_banksize(void) desc < end && num_banks < CONFIG_NR_DRAM_BANKS; desc = efi_get_next_mem_desc(map, desc)) { /* - * We only use conventional memory below 4GB, and ignore + * We only use conventional memory and ignore * anything less than 1MB. */ if (desc->type != EFI_CONVENTIONAL_MEMORY || - desc->physical_start >= 1ULL << 32 || (desc->num_pages << EFI_PAGE_SHIFT) < 1 << 20) continue; gd->bd->bi_dram[num_banks].start = desc->physical_start; From patchwork Fri Jun 22 08:38:31 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bin Meng X-Patchwork-Id: 933152 X-Patchwork-Delegate: bmeng.cn@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="dblcfy3q"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 41BsNM6R76z9s4V for ; Fri, 22 Jun 2018 18:36:03 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id 95463C21C2F; Fri, 22 Jun 2018 08:35:07 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=-0.0 required=5.0 tests=FREEMAIL_FROM, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id E52A9C2201B; Fri, 22 Jun 2018 08:34:05 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 4A680C21E7E; Fri, 22 Jun 2018 08:33:53 +0000 (UTC) Received: from mail-pl0-f67.google.com (mail-pl0-f67.google.com [209.85.160.67]) by lists.denx.de (Postfix) with ESMTPS id 57576C21FC1 for ; Fri, 22 Jun 2018 08:33:49 +0000 (UTC) Received: by mail-pl0-f67.google.com with SMTP id 31-v6so3142593plc.4 for ; Fri, 22 Jun 2018 01:33:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=0MwhPLf0l79HXTcZdYSYHt6zRPXnGIhXdC6g9/kZJOU=; b=dblcfy3qOK2yN1fMdvE8xA51p1QQqxTxOWKZ1hh49IA/M/tt7N5Glu1dxX4HWbeNDm pFPOYbGZpTvwU3o+78nDMv5jsCHZAXcauJX6Qr7LK61EcnXrPOJVHbQEou79Uo+9yybd TLgNJcjIhbwO9PtLOwt7xvQ1bzSu2v6T6csB8LE2r+Ge8dczqZKNB23P3CmM4CUg9sUK EkixPYq6LOF3niWuE0OyKBooycJbWO+8yO4q4EkeAXGTJfG84/WwTpCn5ZGcjKyacZwi 48OUYoDJmtdUofP/5ePwkZ8xsZoPVg4L9mCRxoLdf6a4NINHSMRMovvYqEKtt15vrmVh pdgA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=0MwhPLf0l79HXTcZdYSYHt6zRPXnGIhXdC6g9/kZJOU=; b=DAuWLA+9oUdEZleX3dbIOfn1bP7hi5ZzlOGCw50/HaBzc9X281BMtszdww9h12FyAj 7HmoEU9Lror5mxPXpJNmds0dgBE17pJ/6ITtHRDvXuzyy82KrdwI1Ew+Tric1m8j26sn GO8qMfvinOkMxhn+zAKdXKQZ3yxVlqwBKblfsnSQCokq2S8OJSyGlMLBaZd+Uz8CfPR8 LsamY0FZJT7au6kgciansCqRSbTSkhyZ1O/7F+kHXd0nUwSMDR5YkX8/Mtve2xjvStLz Ae2gsPJfYR8OrxdOlogXytyREX1gtZinNlQ1lIt66POJVcLPtawCa68LlEXeN3I5fP6A YzUg== X-Gm-Message-State: APt69E1mmbeTFkYnTMsZQ7YOyjtkeDZm4SmX+f0xHBaV+nGmVJxP+EST 5FCtjE37sxBbc4QBKAjun3U= X-Google-Smtp-Source: ADUXVKKJJOzTl7Hz/niAoTmGoQL1CsSzAb4haZlYl2WCnDEcngRk++9cqgU4s0N58lqrdeq9+dGgQQ== X-Received: by 2002:a17:902:6b0b:: with SMTP id o11-v6mr687006plk.101.1529656428125; Fri, 22 Jun 2018 01:33:48 -0700 (PDT) Received: from ala-d2121-lx1.wrs.com (unknown-156-139.windriver.com. [147.11.156.139]) by smtp.gmail.com with ESMTPSA id y11-v6sm10219474pfn.92.2018.06.22.01.33.46 (version=TLS1_1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 22 Jun 2018 01:33:47 -0700 (PDT) From: Bin Meng To: Simon Glass , U-Boot Mailing List Date: Fri, 22 Jun 2018 01:38:31 -0700 Message-Id: <1529656712-3660-7-git-send-email-bmeng.cn@gmail.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1529656712-3660-1-git-send-email-bmeng.cn@gmail.com> References: <1529656712-3660-1-git-send-email-bmeng.cn@gmail.com> Cc: Bin Meng Subject: [U-Boot] [PATCH 6/6] cmd: efi: Fix wrong memory descriptor end address X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" Each entry of the EFI memory descriptors occupies map->desc_size, not sizeof(struct efi_mem_desc). Signed-off-by: Bin Meng Reviewed-by: Simon Glass --- cmd/efi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/efi.c b/cmd/efi.c index 2511c6c..6c1eb88 100644 --- a/cmd/efi.c +++ b/cmd/efi.c @@ -83,7 +83,7 @@ void *efi_build_mem_table(struct efi_entry_memmap *map, int size, bool skip_bs) prev = NULL; addr = 0; dest = base; - end = base + count; + end = (struct efi_mem_desc *)((ulong)base + count * map->desc_size); for (desc = base; desc < end; desc = efi_get_next_mem_desc(map, desc)) { bool merge = true; int type = desc->type;