From patchwork Wed Aug 8 09:54:32 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 143612 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp651836ljj; Wed, 8 Aug 2018 03:30:00 -0700 (PDT) X-Google-Smtp-Source: AA+uWPzCYDHC4fsv+OfGUomvyK+sA8lJCkzMDm5NIsGg0yEn/kEXdPDpoc5PQMMhFabz3AZLyE4h X-Received: by 2002:a50:b0c1:: with SMTP id j59-v6mr2547590edd.267.1533724200663; Wed, 08 Aug 2018 03:30:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533724200; cv=none; d=google.com; s=arc-20160816; b=i0sx3jgyOAIb1+eijbqIK8Se3gtugbg0k24uSX+sKdrWokAnYATBiNRSHKAt8gOXl1 t6zdkLsAC3uln/qFkgckqoIKW54i0CdhSQaOn/lZ/4Oqsnmy+hxagsS1MjDSr06P6TnN nSxlt2ciRD9y+r8wOw+W6K6phJdy7STAg/tFYcTme8kBDJldAvltJYArobyz3heiUfnC 4NMGd4QDMQi3G2j+ypP1VyFMZDNPX7TL6RMbjno56LEsv8Zg2jmW2xAmCu6RgSYndw++ y8JScSkzNcH+wA3EWpdNJGDv3eE6MLchW4Ve2racSCDhvGK9ej6QTDIwG6dnf5T0nBbo wTJA== 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:mime-version:message-id:in-reply-to:date :arc-authentication-results; bh=kRqSo3gLyIXeM4maVThLmbXf7/kdH3DHbYVNzqflO0k=; b=HI5E6ia0mFBLvlVuXdOtQVKTV4HDOfcHnN2gBeylqP96shTgx2Z1hsPviQ7hRRLf8S 5UV217V+o8t53SlSoqa3MMk47G+WvC55rbUd2g+c1q2pjzh/SRUiNrPxM/km7uZRX+tu YvvTo+TGh4+8wN5JilMNSLNBtHm6BtH6tCqBzia0gvfhVu0OrbXEYg5jQAmBqKQv5xBf 1wkL4LWUTMabolnNSQ7604yao0TzEmryXeW905HzmcCEIx84318SwgIuVLjF7Zc+eAMp +m8xVFmgaKAvD5NnFJ65K9COBXDHpg7CHSmuN+r62c+FdkTJG4V12OdgIlLIg8ht5p8e 0XnA== 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=REJECT sp=REJECT dis=QUARANTINE) 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 w30-v6si1090793eda.448.2018.08.08.03.30.00; Wed, 08 Aug 2018 03:30:00 -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=REJECT sp=REJECT dis=QUARANTINE) header.from=chromium.org Received: by lists.denx.de (Postfix, from userid 105) id 28074C21FFB; Wed, 8 Aug 2018 09:59: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=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 8B184C22002; Wed, 8 Aug 2018 09:57:17 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id D176EC21FCB; Wed, 8 Aug 2018 09:55:13 +0000 (UTC) Received: from mail-qk0-f202.google.com (mail-qk0-f202.google.com [209.85.220.202]) by lists.denx.de (Postfix) with ESMTPS id 92973C21FFC for ; Wed, 8 Aug 2018 09:55:09 +0000 (UTC) Received: by mail-qk0-f202.google.com with SMTP id w8-v6so1699334qkf.8 for ; Wed, 08 Aug 2018 02:55:09 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:in-reply-to:message-id:mime-version :references:subject:from:to:cc; bh=yrrtEbcsuylKdi/4rOk42gDcL7WRGE0A1lEkfsN9d0A=; b=penh85Y1FxbXo7GPEd5wS6ZKkw1aVBNBsZw+GgXZJa1vSL7CnVrTXKd5/t51FVK9Ad imUsAwxaKJyGHN/ZZECP0dxeRC4FNBlO7Dz4a3QF5ua34FrQkXRBeXGkZbnoZbCbWA+U g7bGvhSkb/1lRcf9qVGUYgqQeEO4dwo1WVtWnwcE0UlUSK2Zy6j/cOo5/rzwjy9FeijW ZG3xkGqZB8DLk0pq04/HOhAUFdoIfDfd62iX7MTo7U457rBL9nu7KiughckuOBIS+edK OTnU8+Caxnd85OtTi1lViXt/J2qoafM7++3Mg+dLFYj/u4mgi1hVFH4IM0xsoGqEIDhy Lbnw== X-Gm-Message-State: AOUpUlFGtrl7k9vXfTyFztWhUM3Qynguvh3PXQIAgZdqjVYFqEFGxSXF jDEOI1wIa7D9x1GVgGFWwcgUB6M= X-Received: by 2002:a37:8704:: with SMTP id j4-v6mr1178920qkd.9.1533722108789; Wed, 08 Aug 2018 02:55:08 -0700 (PDT) Date: Wed, 8 Aug 2018 03:54:32 -0600 In-Reply-To: <20180808095433.230882-1-sjg@chromium.org> Message-Id: <20180808095433.230882-18-sjg@chromium.org> Mime-Version: 1.0 References: <20180808095433.230882-1-sjg@chromium.org> X-Mailer: git-send-email 2.18.0.597.ga71716f1ad-goog From: Simon Glass To: U-Boot Mailing List Cc: Andy Shevchenko , Heinrich Schuchardt , Alexander Graf Subject: [U-Boot] [PATCH v9 17/18] 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 v9: None 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 e6a15bcb523..2107730ba5a 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;