From patchwork Mon Jun 18 15:23:00 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Graf X-Patchwork-Id: 139001 Delivered-To: patch@linaro.org Received: by 2002:a2e:970d:0:0:0:0:0 with SMTP id r13-v6csp4083378lji; Mon, 18 Jun 2018 08:25:11 -0700 (PDT) X-Google-Smtp-Source: ADUXVKLrzvJHUoNDQ06OWu86LhXVQ+KippD4ihRJMmIMbNtn5ajVhWSPhHY5POl55Vtbx3bowLNS X-Received: by 2002:a50:dac9:: with SMTP id s9-v6mr11578624edj.241.1529335511520; Mon, 18 Jun 2018 08:25:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529335511; cv=none; d=google.com; s=arc-20160816; b=RrECXh90emCWQg2EbBrPSmECHNnVp0jypLktJ7lb25nSo0Qx3vPH6WogaZ4ODyXfsL T8vgKWGYqyqV5NgAVivMRuNyBMFFyKK8cyKk2krAXgdB3B02ZahAIsYeVExsXyw0Wm+s wjVuQ1P7ZJe9iMZ+xsowoBd+uC+52xMPxhna3aM/7wXtlDbjmVLwRJCYLJJIuWzVxu8w Q5/ShQ+I/z/bmK4tt1HpyYyj7dqR7XJbo9R89wXmRUqrcQCy1gIWWZD8beHaJzsgV2Ue JqoGTfX4Jf9fAN8IQAXCebd1zNgYo6bBKG82fxYH1mwLX4eoExYUKvNbfV5kIRHS3eZ8 lNbA== 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=fN6+6R5CbPCznLTUaaGsMx5JTio6TQc5Kb0eLHcmpOBTy/Gu7US6Uo1j13JyDMaj9S SohnLqHgAF7vP82XNmWvvoGpLdkuo1deVj17Eeol5ExkeQapK0j0cLLVZELWrYwQFMFj DJNVhXrtn81JYRV6hCrSwjf1z9e5ydk22aB/WI7Vd69LApB48cPDOQQ/Wcyyb+zmvtBh Hv5f8NwKQzUQVCkZKxyC+G8TM5sfM3NyS9lOr83lP0vjyfffFwbZsOkR35O6lmaOx5nD JwR45jwtF/dOBf0OyTvJhjeLtIxz0WXCzuqAtAUBfjellnG6fRbHIFb1pwCohqg7k9O1 u4SQ== 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 z20-v6si7366581edr.56.2018.06.18.08.25.11; Mon, 18 Jun 2018 08:25:11 -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 2BDF1C21EC9; Mon, 18 Jun 2018 15:23:41 +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 CFF01C21E9F; Mon, 18 Jun 2018 15:23:19 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id BA6E6C21E63; Mon, 18 Jun 2018 15:23:17 +0000 (UTC) Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) by lists.denx.de (Postfix) with ESMTPS id 60494C21DFA for ; Mon, 18 Jun 2018 15:23:17 +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 C9A49AF69; Mon, 18 Jun 2018 15:23:16 +0000 (UTC) From: Alexander Graf To: u-boot@lists.denx.de Date: Mon, 18 Jun 2018 17:23:00 +0200 Message-Id: <20180618152315.34233-7-agraf@suse.de> X-Mailer: git-send-email 2.12.3 In-Reply-To: <20180618152315.34233-1-agraf@suse.de> References: <20180618152315.34233-1-agraf@suse.de> Cc: Heinrich Schuchardt , Andy Shevchenko Subject: [U-Boot] [PATCH v4 06/21] 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