From patchwork Thu Jun 14 18:22:27 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Graf X-Patchwork-Id: 138601 Delivered-To: patch@linaro.org Received: by 2002:a2e:970d:0:0:0:0:0 with SMTP id r13-v6csp2450955lji; Thu, 14 Jun 2018 11:22:41 -0700 (PDT) X-Google-Smtp-Source: ADUXVKKVavGXOzwgLB0TmKg5bnXMP1qgllvF+YotnhK2v1UIgoFq6u65lBkyO1f4xDRfwFTpQf9f X-Received: by 2002:a50:a0a7:: with SMTP id 36-v6mr3506161edo.258.1529000561195; Thu, 14 Jun 2018 11:22:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529000561; cv=none; d=google.com; s=arc-20160816; b=bwrTg+6Rm7kyn3v6LZ2HqP2KrJXs1qe2iEZCJfeuGgwUm7yvXp1xbkaM46asvKnsA6 LLb3lz1vuqiVag1N36iPCc3b7zn8jyHK6ofdULTOaEDOqN7CBl+dAVQ3JyAbiniJp7q0 GlJx6ewUBje6NWhdk7nVaQa2BfL4yBTdeCRZsmXNnQaMzdKYl/LFkvbfdtcLOkV3Tn3N qug5vDVJ7cEjqu+Ex9nt10HYS/7vfCKstJjuAH0Q/jh0zAmG5QRJ96rzyJIDqgVNsxoN Qjzz1n2W9w6VyCOmXCvQ08O+sGmrz1hsGWvg8YzaCaLwQMfcLk+txoe1YuCff2AsksOi hsBQ== 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=RlF+jt67ow/jqPEXDmKd56wemk7qBje17l1GPYKcShVYRz6OQDLCjxZAHJ0hqnhkAI QTt771uf1mgpj2z0Kf459D3MLE957wj/OR7gj9VVrctj/u//j3UH7w+3LCHMZ1Hj/tKs 61WP8zyAzbEjW7gBAsfwAz/0CjUNyUUN+oA5rMK/Bxozs02ug5wd8Y3iQR+hz/fJlHe2 8VipP5CYKnsxsr/Woc1i5QpvtxZCubIGzZAcnqjdEk8tRe0BpATZalGdQmvYnjB2WiWn FnSAywm7Pj5HQ3I72JJYsQp8xgkTfHi39Zl6L1M6V9ZkslZMKnCjScaePNPQQ0SXOq7x vktQ== 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 m10-v6si4537079edp.378.2018.06.14.11.22.40; Thu, 14 Jun 2018 11:22:41 -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 CF735C21DC1; Thu, 14 Jun 2018 18:22:39 +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 0D593C21C29; Thu, 14 Jun 2018 18:22:37 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 6EC8EC21DB3; Thu, 14 Jun 2018 18:22:35 +0000 (UTC) Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) by lists.denx.de (Postfix) with ESMTPS id 0F3A7C21C27 for ; Thu, 14 Jun 2018 18:22: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 A0321AFB2; Thu, 14 Jun 2018 18:22:34 +0000 (UTC) From: Alexander Graf To: u-boot@lists.denx.de Date: Thu, 14 Jun 2018 20:22:27 +0200 Message-Id: <20180614182232.78201-7-agraf@suse.de> X-Mailer: git-send-email 2.12.3 In-Reply-To: <20180614182232.78201-1-agraf@suse.de> References: <20180614182232.78201-1-agraf@suse.de> Cc: Heinrich Schuchardt , Andy Shevchenko Subject: [U-Boot] [PATCH v2 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