From patchwork Fri Jun 15 12:42:18 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Graf X-Patchwork-Id: 138681 Delivered-To: patch@linaro.org Received: by 2002:a2e:970d:0:0:0:0:0 with SMTP id r13-v6csp801524lji; Fri, 15 Jun 2018 05:46:50 -0700 (PDT) X-Google-Smtp-Source: ADUXVKKWTBLFwCdz7cQrkIVPr7znz9n0VO1lnDuCIk4zu+c+MqRVnPwTveKyfeZoATUzx5i6SWCo X-Received: by 2002:a50:eb48:: with SMTP id z8-v6mr1800691edp.7.1529066810191; Fri, 15 Jun 2018 05:46:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529066810; cv=none; d=google.com; s=arc-20160816; b=Ac82FTEMoxaBwByDQGJ8lxyKcPf2pKUYV8aFUHK1QlC9Tt3oX0Z2cHn/JBrKrhtcLO srukQzPrXQSjqJOfCqgbXRxxEp5f2sbmNiDjWM6c6VgwJ+naqQGYNQtX3Q+0Bq86SO4Z BlnbVq1V1zl3j76OLQmPd4w1A8V6p3HRWH0Nl1kRYMx+U5Log5r3r1+t+i9M7gD8H1iV dKKqgTki7lBM0Q5PVXLLNrW5zlYCazP/BzEQ0Ae5NZ6Nc6+GEUPkCIF/s2sKVudZBeiy FYQ3RobKC3YaYy2jzfNfQjGEX8zGrY5H3nYpKhPXJy9JBF72UJlj1tSaYNnTz261DSQX QCJA== 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=sWRGq96AxqX2AuRxObNooWxu5dOrz8M+GHzvQTpU3TnmI9wpIlc0E/EiXd27L1J3Ld Tbvl+RdzMuWiq4eHpe+CVguAzvnxFi1p1ut3hvVC0JPYi/KmycObAaHCr68s3yXYotJo 1Ari1zn6vepfqkeczO+HOn48xBy59nJpDcRMdcADXlq6jSw5HXiHKtdRm1O47U43g1Jc /d7VfeH5Yv/qpmpkcQY47l11lBONG5Bmzd8uQkkrvsDsJnT1OoOHcv5dxCzo6vR0LBDI AmPk4dHO/Gc0IKa5BTJhv3AsMvW7W4VPPqWufbKMmS8uYxNnAZBY+z/jQs2e4ZUrEBKc f70w== 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 f38-v6si4806118edd.281.2018.06.15.05.46.49; Fri, 15 Jun 2018 05:46:50 -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 C71BDC21EEF; Fri, 15 Jun 2018 12:44:40 +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 1DAA3C21F1C; Fri, 15 Jun 2018 12:42:38 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 4C5C6C21E30; Fri, 15 Jun 2018 12:42:32 +0000 (UTC) Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) by lists.denx.de (Postfix) with ESMTPS id 9D458C21E62 for ; Fri, 15 Jun 2018 12:42:31 +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 EDBDBAF45; Fri, 15 Jun 2018 12:42:30 +0000 (UTC) From: Alexander Graf To: u-boot@lists.denx.de Date: Fri, 15 Jun 2018 14:42:18 +0200 Message-Id: <20180615124229.35310-7-agraf@suse.de> X-Mailer: git-send-email 2.12.3 In-Reply-To: <20180615124229.35310-1-agraf@suse.de> References: <20180615124229.35310-1-agraf@suse.de> Cc: Andy Shevchenko , Heinrich Schuchardt Subject: [U-Boot] [PATCH v3 06/17] 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