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=-16.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=ham 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 C1C89C433F5 for ; Thu, 9 Sep 2021 08:57:53 +0000 (UTC) Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 0D31C610A3 for ; Thu, 9 Sep 2021 08:57:53 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 0D31C610A3 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=chromium.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=lists.denx.de Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id B43408325E; Thu, 9 Sep 2021 10:57:43 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="KHUV2CTW"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 9E8048319C; Thu, 9 Sep 2021 10:57:38 +0200 (CEST) Received: from mail-wm1-x331.google.com (mail-wm1-x331.google.com [IPv6:2a00:1450:4864:20::331]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id A925883202 for ; Thu, 9 Sep 2021 10:57:28 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@google.com Received: by mail-wm1-x331.google.com with SMTP id u19-20020a7bc053000000b002f8d045b2caso813391wmc.1 for ; Thu, 09 Sep 2021 01:57:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=Jsu3joOytKWFWuwqP5+oKFDCNSvImLfTgPndt+ZBhjw=; b=KHUV2CTWoMeUt50agwjLJ2ZpiPcIGPCrh9WUy5Esp2cvPx14sNG9BpoL9Upkr7UxVd D3Nkp/jaPsiOHLuyLxZ9N7Pc7NJrPKmeskW/e7VRIjHgp/S9Kkxp7FTLCnYCWk9gkMA2 mfY9mdI618pF5NjGbzEdGpmbUF1ew/agLj0T4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=Jsu3joOytKWFWuwqP5+oKFDCNSvImLfTgPndt+ZBhjw=; b=jk0Md7hvReGqW9+LVtUR5ZBkwnE79URPDEY5JHU4fpAj3fb4w+msmERLkBg9+NoiaA aw394N4LPnDIq1z9WcAiztEnZmwMxiu3xk/BdopUQfFXV8NVZR01LPV/305KjLel0QB8 6H3GszLZ9Ut3S6v8pONRk45CcNqFJj9gnL4SP6m1DnYyTRVmTrptYLTj9wPi3bbY6XJG l+HGA+EQrRw1uV6uGxAUgo0WNxDfSAUeV+QYgQ7fYxqoALdrZWEhGFEjQiSfrp0GDIYP pFiCBm3F6ez722E8KmCAe4/8TheU3VI6PBIO3DewswH6/o6QSIHYbXaqzNvzezWjWnb1 h2/w== X-Gm-Message-State: AOAM531w2tiL8VvCrrczPTyiJUnSMR5iBmeeTXqqKBU+8Hwh5avPirww phEWRcHaIYH/xuWRzwlarNFc/Um8ff5PqxRGxBOydw== X-Google-Smtp-Source: ABdhPJy4jKp0dt+XMYKJCs7VPt8v13mU/wVbmYJKjDmFLOfmsncNccakVZARdiB1QqdeqOHryF8vGItqLgI8ww23AGI= X-Received: by 2002:a1c:7417:: with SMTP id p23mr1751391wmc.116.1631177847827; Thu, 09 Sep 2021 01:57:27 -0700 (PDT) MIME-Version: 1.0 References: <20210908133405.696481-1-sjg@chromium.org> <20210908073355.3.I64a9f2e15201e8dba68a24e903cc1ac59237169e@changeid> In-Reply-To: From: Simon Glass Date: Thu, 9 Sep 2021 02:57:14 -0600 Message-ID: Subject: Re: [PATCH 03/35] x86: Show some EFI info with the bdinfo command To: Heinrich Schuchardt Cc: Ilias Apalodimas , Bin Meng , Tom Rini , Christian Melki , U-Boot Mailing List Content-Type: text/plain; charset="UTF-8" X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 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.2 at phobos.denx.de X-Virus-Status: Clean Hi Heinrich, On Wed, 8 Sept 2021 at 11:34, Heinrich Schuchardt wrote: > > > > On 9/8/21 3:33 PM, Simon Glass wrote: > > It is useful to see some basic EFI info with the command as it forms part > > of the information about a board. > > > > Add a hook for this and show the table address as a start. > > > > While here, fix an invalid cast in setup_efi_info(). > > > > Signed-off-by: Simon Glass > > --- > > > > arch/x86/cpu/efi/payload.c | 13 +++++++++++-- > > arch/x86/include/asm/efi.h | 7 +++++++ > > arch/x86/lib/Makefile | 1 + > > arch/x86/lib/bdinfo.c | 22 ++++++++++++++++++++++ > > 4 files changed, 41 insertions(+), 2 deletions(-) > > create mode 100644 arch/x86/lib/bdinfo.c > > > > diff --git a/arch/x86/cpu/efi/payload.c b/arch/x86/cpu/efi/payload.c > > index 9a73b768e9b..3a9f7d72868 100644 > > --- a/arch/x86/cpu/efi/payload.c > > +++ b/arch/x86/cpu/efi/payload.c > > @@ -280,15 +280,24 @@ void setup_efi_info(struct efi_info *efi_info) > > } > > efi_info->efi_memdesc_size = map->desc_size; > > efi_info->efi_memdesc_version = map->version; > > - efi_info->efi_memmap = (u32)(map->desc); > > + efi_info->efi_memmap = (ulong)(map->desc); > > When converting a pointer to integer we use (uintptr_t). Generally in U-Boot it is ulong so I try to be consistent here. Anyway, u32 is clearly not right for a 64-bit build as it gives warnings. > > arch/x86/include/asm/bootparam.h defines efi_info->efi_memmap as u32. > This type is too small to hold a pointer. > > > efi_info->efi_memmap_size = size - sizeof(struct efi_entry_memmap); > > > > #ifdef CONFIG_EFI_STUB_64BIT > > efi_info->efi_systab_hi = table->sys_table >> 32; > > - efi_info->efi_memmap_hi = (u64)(u32)(map->desc) >> 32; > > + efi_info->efi_memmap_hi = (u64)(ulong)map->desc >> 32; > > You should not use two fields to hold a single pointer. > > Please, replace all of these duplicate fields. We do need to be compatible with what the kernel expects, otherwise there is no point in filling out this information. Regards, Simon