From patchwork Mon Jun 18 14:08:34 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 138960 Delivered-To: patch@linaro.org Received: by 2002:a2e:970d:0:0:0:0:0 with SMTP id r13-v6csp4010817lji; Mon, 18 Jun 2018 07:18:50 -0700 (PDT) X-Google-Smtp-Source: ADUXVKLQWrcaxrLnyoyz245quwAdsdD13tcquSqF7QobYJ9Yr4kTawuQ/EKum+77zPehAAQITka2 X-Received: by 2002:a50:b043:: with SMTP id i61-v6mr11203802edd.309.1529331530625; Mon, 18 Jun 2018 07:18:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529331530; cv=none; d=google.com; s=arc-20160816; b=PLm7pKsUwudHFGDzVcokVvPcMfX62Swd5PXDRhhm+mASUaSTsGwIVC/Cfp42Oetvob 1XESSFbHjwJ0jx1NmATALBJ0AdpFmp8O332N6RgZV4umMriUnXhqdBUfdbpce+b8Sb/a gCjQyMXMCpuHjDRntfR1Kqeh5m9H/67YlYGIL0AKyT783c1DoW59KWIX1+CgqOGLwQPj AAcN0YcMhlDZ8ugqJGZDGKcguRqB0xwaOT039++EL4+JCiAHUsBm1vmLQYhdQtPv8Usc oSCD7ZloKNtuVCagbQhJq2UPxFCp3pgbhOELhxW9LIrKDEOoasmdCi2RRUHsj2VLqpnO R6AQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:list-subscribe:list-help :list-post:list-archive:list-unsubscribe:list-id:precedence:subject :cc:to:from:references:message-id:in-reply-to:date:mime-version :arc-authentication-results; bh=5nrvehXPuULsKmK4ZtNJjvor+7rWt0X0m4w2s5jcmXQ=; b=k0khc22YLESLxLs8KUFsjh491/ak0B5Jef/7Yp06gt/GZMC6C0NsxTGaExIUZKsmTi GkMp2/HbqlBXkfVGZhThWABzlhLygsT/M7QXSRVQyzo3rPDpDKnOPffQuALtOeuXzwfM lVRArlrT40ALPInc5w9gnZ0+TOXYwzgvcUBN9vSz/XdT+GWznQ+DJUmeofoYhnVP/DnH VgnDGwbH9br1cHMXwazpmSNmEOi31nkJXyCt1CVFUene1kJj0h/hEQHwskReAxBmS0M/ B8ksb/r2j8O7LHCqRwjitlHVqlzZWfEqs/0T2ZKvQTT0Rtk2ID7CPJzOBq3HV/8auhPX Lkag== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from lists.denx.de (dione.denx.de. [81.169.180.215]) by mx.google.com with ESMTP id g10-v6si6003355edi.309.2018.06.18.07.18.50; Mon, 18 Jun 2018 07:18: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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: by lists.denx.de (Postfix, from userid 105) id 3A927C21EB9; Mon, 18 Jun 2018 14:15:12 +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=RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL 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 74AE1C21EB9; Mon, 18 Jun 2018 14:13:32 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id B0490C21E7F; Mon, 18 Jun 2018 14:10:09 +0000 (UTC) Received: from mail-yw0-f202.google.com (mail-yw0-f202.google.com [209.85.161.202]) by lists.denx.de (Postfix) with ESMTPS id 808E3C21DFA for ; Mon, 18 Jun 2018 14:10:05 +0000 (UTC) Received: by mail-yw0-f202.google.com with SMTP id d129-v6so12859457ywe.4 for ; Mon, 18 Jun 2018 07:10:05 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:date:in-reply-to:message-id :references:subject:from:to:cc; bh=Di4jzXE3MzyExxj/o92QaW3wxf6sRY1AvQ8YVijoQUw=; b=mLq193m4WgJn8RCtXmsm++Y1BDgpJTrZgQFDB9m9/ShsWnsBY6HlbEzbHjyKMXEJrU WgWEgA5W6ynQS2QTg1GokGj+WQpoa5ursvCsTEeyrFiYBSJeDhPZSxBI0A0xmxX/UmQG vNrNbsW3DaEcQRgrdennEo9nL3wFv08voHpYr7xwo3ks2yJUkrz043Rup1mWcbj5bQjA gsDZQYHqat0FQXl2qjHSPbxVDqm01qWFKZIDQkoCAOA31Rj6D9PkohYKgqpnBH/UvgjX FLm+I2wU5x9iAY6CpxNW+JmS+3LDBzzV2DC/Dt4Ki8VtpRROwyRXvZTRLnZ7ktMkAUft 1LTw== X-Gm-Message-State: APt69E3XKx5rmKzU0QxKvDSq02YmpMO/gYOxfeeyKN3YHHGgVdP7R4cE uG0RuOrRokjvAVhUgZL+QX+PYzA= MIME-Version: 1.0 X-Received: by 2002:a0d:e6d7:: with SMTP id p206-v6mr3454069ywe.37.1529331004606; Mon, 18 Jun 2018 07:10:04 -0700 (PDT) Date: Mon, 18 Jun 2018 08:08:34 -0600 In-Reply-To: <20180618140835.195901-1-sjg@chromium.org> Message-Id: <20180618140835.195901-30-sjg@chromium.org> References: <20180618140835.195901-1-sjg@chromium.org> X-Mailer: git-send-email 2.18.0.rc1.244.gcf134e6275-goog From: Simon Glass To: U-Boot Mailing List Cc: Andy Shevchenko , Heinrich Schuchardt , Alexander Graf Subject: [U-Boot] [PATCH v8 29/30] efi_loader: Pass address to fs_read() 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: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" From: Alexander Graf The fs_read() function wants to get an address rather than the pointer to a buffer. So let's convert the passed buffer from pointer back a the address to make efi_loader on sandbox happier. Signed-off-by: Alexander Graf Reviewed-by: Simon Glass Signed-off-by: Simon Glass --- Changes in v8: None Changes in v7: None Changes in v6: None Changes in v5: None Changes in v4: None Changes in v3: None Changes in v2: None lib/efi_loader/efi_file.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/efi_loader/efi_file.c b/lib/efi_loader/efi_file.c index e6a15bcb52..2107730ba5 100644 --- a/lib/efi_loader/efi_file.c +++ b/lib/efi_loader/efi_file.c @@ -9,6 +9,7 @@ #include #include #include +#include #include /* GUID for file system information */ @@ -232,8 +233,10 @@ static efi_status_t file_read(struct file_handle *fh, u64 *buffer_size, void *buffer) { loff_t actread; + /* fs_read expects buffer address, not pointer */ + uintptr_t buffer_addr = (uintptr_t)map_to_sysmem(buffer); - if (fs_read(fh->path, (ulong)buffer, fh->offset, + if (fs_read(fh->path, buffer_addr, fh->offset, *buffer_size, &actread)) return EFI_DEVICE_ERROR;