From patchwork Thu Jun 14 16:33:29 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Graf X-Patchwork-Id: 138581 Delivered-To: patch@linaro.org Received: by 2002:a2e:970d:0:0:0:0:0 with SMTP id r13-v6csp2338010lji; Thu, 14 Jun 2018 09:36:30 -0700 (PDT) X-Google-Smtp-Source: ADUXVKIJ1+TXPyiACberxKtyS6rXca8yWo9dYsPclfI6NFAsLcnITl22IwyLJOAldnra1rA4BWwg X-Received: by 2002:aa7:d60f:: with SMTP id c15-v6mr3251745edr.301.1528994190755; Thu, 14 Jun 2018 09:36:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528994190; cv=none; d=google.com; s=arc-20160816; b=X5FtqZs3Kh1NlbYbe7jVIWISPV8fu3U7b8s0SLZ2+kXRCvVHPtTuFr9k34h3s3dMMF nTHwFj9vb0JBsMpBDSJmmzKvso31CTQzUIVcZKd4Frv+oS/bSkSR80Oq4iHjuyHPT0t1 faWE35aa4bR7ibAwAJuD946vX29A00No4TzQ0W/5FGosXBCs8rzdRY2MxA+5gQEJjaxO 4rHUhcVUIYIolfMhNNfCJJtPcIL28GJWsJl5MltXQpmW6iXbJ57vRmztbtOD6rmywUNJ XpnpoYtW0N8jQEVFuSQj8HZ4rV8y2LVFY35p4BVDgL2tc28u+nxDZk0dxIpRNxBPbBD7 TSUQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:cc:references:in-reply-to:message-id :date:to:from:arc-authentication-results; bh=YdXjBEeCo2jVBjedPIAZnNd95MPouVnNFn/qHEnIfnQ=; b=M6c6lsw2JYbaUiocPaG+Yd+8GX9o14wZjRgPlbBSM3PFkBCKUNRL5quTYIPjFkg0B+ t08SAzq5t/uSmIKZ2LQo2cFRrwXPlql+AKmoBDDBUzBb6xw7YIct7XkEkmXiIAE/IlHk NfIOCXLr7XdLWDcm5Wjl5tHH0jUdOCODExqRh/qmptwkUNCyXsnyUYdDCIyhO5ASJ8Aa 6hb33ZXFXwT+CnZPB9MZwwk8gsBtjxWT0yYFz89k75yCHuFdfj9uwoBleBD9OT2ET3qV veSeQzVBlE7VBQ8nxBZyu6XvHMaKFpOW37u2DjZpA8oiy9JjWbqGnSwrc3Brp+mMafnU uyrQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de Return-Path: Received: from lists.denx.de (dione.denx.de. [81.169.180.215]) by mx.google.com with ESMTP id x58-v6si1103357edx.441.2018.06.14.09.36.30; Thu, 14 Jun 2018 09:36:30 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) client-ip=81.169.180.215; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de Received: by lists.denx.de (Postfix, from userid 105) id D175BC21C2C; Thu, 14 Jun 2018 16:35:21 +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=none 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 0B2D1C21E39; Thu, 14 Jun 2018 16:33:42 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 3D65FC21CB6; Thu, 14 Jun 2018 16:33:35 +0000 (UTC) Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) by lists.denx.de (Postfix) with ESMTPS id 8B27AC21DD3 for ; Thu, 14 Jun 2018 16:33:35 +0000 (UTC) X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay1.suse.de (charybdis-ext-too.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id C6152AF7F; Thu, 14 Jun 2018 16:33:34 +0000 (UTC) From: Alexander Graf To: u-boot@lists.denx.de Date: Thu, 14 Jun 2018 18:33:29 +0200 Message-Id: <20180614163334.46827-7-agraf@suse.de> X-Mailer: git-send-email 2.12.3 In-Reply-To: <20180614163334.46827-1-agraf@suse.de> References: <20180614163334.46827-1-agraf@suse.de> Cc: Heinrich Schuchardt Subject: [U-Boot] [PATCH 06/11] efi_loader: Allow SMBIOS tables in highmem 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" We try hard to make sure that SMBIOS tables live in the lower 32bit. However, when we can not find any space at all there, we should not error out but instead just fall back to map them in the full address space instead. Signed-off-by: Alexander Graf --- lib/efi_loader/efi_smbios.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/lib/efi_loader/efi_smbios.c b/lib/efi_loader/efi_smbios.c index 7c3fc8af0b..932f7582ec 100644 --- a/lib/efi_loader/efi_smbios.c +++ b/lib/efi_loader/efi_smbios.c @@ -26,8 +26,15 @@ efi_status_t efi_smbios_register(void) /* Reserve 4kiB page for SMBIOS */ ret = efi_allocate_pages(EFI_ALLOCATE_MAX_ADDRESS, EFI_RUNTIME_SERVICES_DATA, 1, &dmi); - if (ret != EFI_SUCCESS) - return ret; + + if (ret != EFI_SUCCESS) { + /* Could not find space in lowmem, use highmem instead */ + ret = efi_allocate_pages(EFI_ALLOCATE_ANY_PAGES, + EFI_RUNTIME_SERVICES_DATA, 1, &dmi); + + if (ret != EFI_SUCCESS) + return ret; + } /* * Generate SMBIOS tables - we know that efi_allocate_pages() returns