From patchwork Mon Jun 18 14:08:26 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 138967 Delivered-To: patch@linaro.org Received: by 2002:a2e:970d:0:0:0:0:0 with SMTP id r13-v6csp4018653lji; Mon, 18 Jun 2018 07:26:02 -0700 (PDT) X-Google-Smtp-Source: ADUXVKKxWBXovXvwG+oV6DKefsGcnXeCSsxceUlbgPyFwVagc9+9W26uijF6c9H9inEI6WoYZ41s X-Received: by 2002:a50:f416:: with SMTP id r22-v6mr11301679edm.94.1529331962819; Mon, 18 Jun 2018 07:26:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529331962; cv=none; d=google.com; s=arc-20160816; b=gA3B/TFyXQbF8ABHFRWEs0X0ipEOiJyDPk4T8axF3vg5KLgA7p3vFTqlx9ZhmS0y6i dUpFRnHq7lqemT2PUA861TkNvlnb2CHII5S4hXEym8Jv5ryhXuvRUXZGnFvBEU76YmM7 uxzF1MmXcPRFxAp1esTw7/o0SqjFyH93d6IxaoDi5Umd1Wwo1UOwovtwpvAvzgf0kVfO pUZTsKYuT70C6alZYFqQAAfc1q4F5cl1quqoLPJcqQo2NdbD3V0cDkOsii/+IkMxVaG1 fUydscIVI/7tbJOnnSaCDJLfkUxc4Zenc6XtT/ffdQtvnYOJF2F62matSyZ0Y0QFNhXN nEjA== 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=aDvWjjtg1DcRC/5hNWnqwEFkDZe80YR4Qczhr4RJu3U=; b=FhPH9qErcChc377YN1bqb/ZjsRwuBn7nJhaFKUpf6UW2oTLjZ657/xcGyb6ajs3J/K n1X2r3VEAKy0p7A/P/HMGVAPkMkbHf0jWGodYQn/yzc+F5B4LY5X13RVAMPWTs59+a63 cDt4zHxjOv6gSgnRbT0I66lsQ/Lr+svjG3eF1j8H+iOTYZKUsUz3aGtdejYMM8YYY3iP c9zR40al4IAEYI7CzT60oCSIj3CNIvFJ5IrDNlwNyEe5mDzamR9nZ48a7J90tgngiaap yolYfniEicYvuT6LHh2QHxfkfwkXb1ZlUeD2hYEyihUTLiGJSLCj+2+KFC4XToc25wO0 iT4w== 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 k32-v6si5999086edc.340.2018.06.18.07.26.02; Mon, 18 Jun 2018 07:26:02 -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 70B4AC21EF7; Mon, 18 Jun 2018 14:19:21 +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 A78A7C21EE7; Mon, 18 Jun 2018 14:19:19 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id F343AC21DFD; Mon, 18 Jun 2018 14:09:45 +0000 (UTC) Received: from mail-vk0-f74.google.com (mail-vk0-f74.google.com [209.85.213.74]) by lists.denx.de (Postfix) with ESMTPS id 95D0DC21EB4 for ; Mon, 18 Jun 2018 14:09:41 +0000 (UTC) Received: by mail-vk0-f74.google.com with SMTP id p83-v6so7073822vkf.9 for ; Mon, 18 Jun 2018 07:09:41 -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=hLKBwvNKsCn70e1WHmIcCO6AWcJeqg59aFNzpeOdJkM=; b=Z8N0zwZntyMvEY5fMtuWloKr6gtISBYu4YCVYdqDUPu1j8a/mMhKz2lCdgCinEWsYc y9qLTk7PnMIDdJpl7Vc7N9uvb72TI3/5xiXmKJI5oxNAsYqa7yrrAN/mFXo2Q+mfGciG HyNmmAginjWlevsZMrCiorliCjTxs64hKgzQ32Zj6ZMi8d+AQd/GWH42IvQtxUire6p9 nWXgGqhIC63HViGS9Kg9JHoGrA8IeTVEoQldneag5XenPHPO2VOvIqyKd2fsTy9exolD QuqFD69HqF7+BrxYCqC0iHPckSL8/xgRy0gVHCf67bttjw/JBlWomNdJD5pTznVoinFM j+5w== X-Gm-Message-State: APt69E3RzzB884ddF8v0fg/+Bt9WCI5Zgw9V1JYKQwOmQCoyXVnfXtz1 OQ2L7tPBtmPH1gmMLQ0qM62A6sI= MIME-Version: 1.0 X-Received: by 2002:ab0:52dd:: with SMTP id w29-v6mr5663223uaw.84.1529330980576; Mon, 18 Jun 2018 07:09:40 -0700 (PDT) Date: Mon, 18 Jun 2018 08:08:26 -0600 In-Reply-To: <20180618140835.195901-1-sjg@chromium.org> Message-Id: <20180618140835.195901-22-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 21/30] efi_loader: Use map_sysmem() in bootefi command 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 bootefi command gets a few addresses as values passed in. In sandbox, these values are in U-Boot address space, so we need to make sure we explicitly call map_sysmem() on them to be able to access them. 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 cmd/bootefi.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/cmd/bootefi.c b/cmd/bootefi.c index c89f83fb33..b62635f448 100644 --- a/cmd/bootefi.c +++ b/cmd/bootefi.c @@ -14,6 +14,7 @@ #include #include #include +#include #include #include #include @@ -452,7 +453,8 @@ static int do_bootefi(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) char *saddr; unsigned long addr; efi_status_t r; - void *fdt_addr; + unsigned long fdt_addr; + void *fdt; /* Allow unaligned memory access */ allow_unaligned(); @@ -469,11 +471,12 @@ static int do_bootefi(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) return CMD_RET_USAGE; if (argc > 2) { - fdt_addr = (void *)simple_strtoul(argv[2], NULL, 16); + fdt_addr = simple_strtoul(argv[2], NULL, 16); if (!fdt_addr && *argv[2] != '0') return CMD_RET_USAGE; /* Install device tree */ - r = efi_install_fdt(fdt_addr); + fdt = map_sysmem(fdt_addr, 0); + r = efi_install_fdt(fdt); if (r != EFI_SUCCESS) { printf("ERROR: failed to install device tree\n"); return CMD_RET_FAILURE; @@ -492,7 +495,7 @@ static int do_bootefi(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) addr = simple_strtoul(saddr, NULL, 16); else addr = CONFIG_SYS_LOAD_ADDR; - memcpy((char *)addr, __efi_helloworld_begin, size); + memcpy(map_sysmem(addr, size), __efi_helloworld_begin, size); } else #endif if (IS_ENABLED(CONFIG_BOOTEFI_TEST) && !strcmp(argv[1], "test")) { @@ -538,7 +541,7 @@ static int do_bootefi(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) } printf("## Starting EFI application at %08lx ...\n", addr); - r = do_bootefi_exec((void *)addr, bootefi_device_path, + r = do_bootefi_exec(map_sysmem(addr, 0), bootefi_device_path, bootefi_image_path); printf("## Application terminated, r = %lu\n", r & ~EFI_ERROR_MASK); From patchwork Mon Jun 18 14:08:31 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 138963 Delivered-To: patch@linaro.org Received: by 2002:a2e:970d:0:0:0:0:0 with SMTP id r13-v6csp4014462lji; Mon, 18 Jun 2018 07:22:17 -0700 (PDT) X-Google-Smtp-Source: ADUXVKJ7OL5AM+Y1+Xe7orYOPNA/OoAovhwdhsm5khQoxd+bm0zOS7LoDB9o2DtqUrXex3LiknDF X-Received: by 2002:a50:af66:: with SMTP id g93-v6mr11383216edd.220.1529331737390; Mon, 18 Jun 2018 07:22:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529331737; cv=none; d=google.com; s=arc-20160816; b=GFBmpGduY6GDz5/qpyePbEk1wHeVER60ER6zmOuPnP2s+yQqXYiGErF4avYRal+h12 XXL0T2q+qIqSXbYY95uveDlS+x5QYoOilJqWJmrmUPhD44Djq6RzzffW12R9lWGIsyqG 2tcFtDai9qq1G+qNsdwGgYvkgADj8dtl5HSApeBeiaEH55Nu6OOGZCz9MLv8U1NXHUXF aWVRucOhkUf7ZAMvvXD+2woSD31AKnPnKnrEd9ALnIVpRF//aidZfEggwjWY98rxm0Lw E8Q+qGfxb3OzK+B60eMuFd0sFmC+GrVdOgKgC6onkkn5fZYwjJtlM3HoA/E0sTb8AWy7 xKxg== 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=EKPXQe/Mff4yFYZlPm8i2m8g7Vo8j7sqP+jg6zlMBEc=; b=EVq5Zg/ltbz/R/TCLdjBV0HnYqXIhRX2RtJUHtFMG4VCmcxjEXZvGyYa9pMBu9kt6Z dZMKwOpCWGvuLxJzkLvlFndOSETxkqWJ/uvSdNN3l3XSclN58eNAJnV94yHLZbzIPEJi Zsq14bAVQTjGK0n2lmBYUg+AMk9VDueTIZFdDJ7QUYlT7LFiwvEuECVzhLHZyxR3y/o0 4PL9XAymRfHeq7Oi34UUY8kfZnvSnA4eDm9TTJq8H13bjWd0cQBIAVbyxq5YK0oGgmNh HTnfcKwpbnds9Sqj0H5NMJgU4H6KbNBeJ82V7nqOqMEHuHQNlhZqxy3o9n/qGyAekxic /pNQ== 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 g18-v6si7013750edh.52.2018.06.18.07.22.17; Mon, 18 Jun 2018 07:22:17 -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 F0DD0C21E68; Mon, 18 Jun 2018 14:14:23 +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 0D1D5C21ECA; Mon, 18 Jun 2018 14:12:09 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 0999FC21E9F; Mon, 18 Jun 2018 14:10:00 +0000 (UTC) Received: from mail-io0-f202.google.com (mail-io0-f202.google.com [209.85.223.202]) by lists.denx.de (Postfix) with ESMTPS id 5505DC21E50 for ; Mon, 18 Jun 2018 14:09:57 +0000 (UTC) Received: by mail-io0-f202.google.com with SMTP id x14-v6so13416710ioa.6 for ; Mon, 18 Jun 2018 07:09:57 -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=jOFGPF/4TSWjjtTuvhV9hgb8AqMpfxHCZGO7dHZPWJ4=; b=JJlKS2YxZ/YVrQdW5y6hFmp8Wg9sQ/73flK5Vr/eEwR2yOGWa/FU+Xj67xm3Yor0ns 5Hycrlj8mbLn91C8lZgOqC0MThsD8JsNQfrfSkHROfCMudd/nipmT8e3UltlNcx6GOiu LYptAM5xwPhTX0ZtyqcSG2unndmNHENMAfaiA1ezf9DAAYUM2VXN8NCYFUDDWl41K4Xo Vkh5zU60xQMATgVsE2B+/qrMc7am9TBXe+w+hc05JcOzqYkJbhQMHBLWbW906sJWIui7 u3I0wV9WbfNZ1UXdMtcgy9ohx7Dn0mNZ1Gnx8Otpb5VkgO3wjBWIAOKS+ME6WN0V4fqN Y4uw== X-Gm-Message-State: APt69E3D2Lr/MZBUWPjCPDX914t+0quqIYFSH1++sNVdSYwS1wY7w7oA c5T+jVSH+6DHmciHEKsFvpArttk= MIME-Version: 1.0 X-Received: by 2002:a24:2815:: with SMTP id h21-v6mr5071319ith.53.1529330996352; Mon, 18 Jun 2018 07:09:56 -0700 (PDT) Date: Mon, 18 Jun 2018 08:08:31 -0600 In-Reply-To: <20180618140835.195901-1-sjg@chromium.org> Message-Id: <20180618140835.195901-27-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 26/30] efi_loader: Use compiler constants for image loader 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 EFI image loader tries to determine which target architecture we're working with to only load PE binaries that match. So far this has worked based on CONFIG defines, because the target CPU was always indicated by a config define. With sandbox however, this is not longer true as all sandbox targets only encompass a single CONFIG option and so we need to use compiler defines to determine the CPU architecture. Signed-off-by: Alexander Graf 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_image_loader.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/efi_loader/efi_image_loader.c b/lib/efi_loader/efi_image_loader.c index d5dd8864d7..7e281f55e4 100644 --- a/lib/efi_loader/efi_image_loader.c +++ b/lib/efi_loader/efi_image_loader.c @@ -20,25 +20,25 @@ const efi_guid_t efi_simple_file_system_protocol_guid = const efi_guid_t efi_file_info_guid = EFI_FILE_INFO_GUID; static int machines[] = { -#if defined(CONFIG_ARM64) +#if defined(__aarch64__) IMAGE_FILE_MACHINE_ARM64, -#elif defined(CONFIG_ARM) +#elif defined(__arm__) IMAGE_FILE_MACHINE_ARM, IMAGE_FILE_MACHINE_THUMB, IMAGE_FILE_MACHINE_ARMNT, #endif -#if defined(CONFIG_X86_64) +#if defined(__x86_64__) IMAGE_FILE_MACHINE_AMD64, -#elif defined(CONFIG_X86) +#elif defined(__i386__) IMAGE_FILE_MACHINE_I386, #endif -#if defined(CONFIG_CPU_RISCV_32) +#if defined(__riscv) && (__riscv_xlen == 32) IMAGE_FILE_MACHINE_RISCV32, #endif -#if defined(CONFIG_CPU_RISCV_64) +#if defined(__riscv) && (__riscv_xlen == 64) IMAGE_FILE_MACHINE_RISCV64, #endif 0 }; From patchwork Mon Jun 18 14:08:33 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 138971 Delivered-To: patch@linaro.org Received: by 2002:a2e:970d:0:0:0:0:0 with SMTP id r13-v6csp4021704lji; Mon, 18 Jun 2018 07:29:04 -0700 (PDT) X-Google-Smtp-Source: ADUXVKKSMQ7aoOKr+up/5ruq5HWSPUS2L4F7YtK1NfBPeHhOCfP17umOnKOhJ1LDPUvsg2xB6Gy0 X-Received: by 2002:a50:82c1:: with SMTP id 59-v6mr11295561edg.114.1529332144437; Mon, 18 Jun 2018 07:29:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529332144; cv=none; d=google.com; s=arc-20160816; b=yUifbNKvxgWN1eBZp//evitIxZpQso6X5ixrvkNv28SdNSpQForeOYJIFBtJHiv6SK cOTBR9dLZg6ISkTxGL5AEDMCV9H1ARLq37L3SQzzODfFeylgWdMCLCzrzD7DyDwo5EWU IAJ7wvw/Tjsawo4N6eORG1TFJN0F4t2te01wn6c+ZyHRPuwZP7nyGVX9WGhEifhIFmtE x2z25UGOys+G4JbEG7csxThWij3fppqzSbyyQAwTOFV0tyE8cd10B3nktsTJonjeKxX3 5aBt5xe74J3ZoUU29/j9wpB2E17WnhB282c7lj10oIcTzilNe+S9uny3TtCf8GUXr4oG hNWA== 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=Q2VFWuNeqZIZARqyERICv/UP6soUhOI4/frh24BW4+I=; b=G/wuKXeANuj1T6glpatzmdaKe6Nd4tb8KLrufgrYVDYMEJI1JioxEXEDP68sGmOYrJ aNyGMjW91vMnMHYYO9t6Cs/fay4PyxKOZ0KWNfRqfBtL3C95Fp28hMiCuspbpqqtVXKk PIb8eSbok+9wsAEixMzNv0v0s0OZSBd8kCtYQB57nBGOXSeRCLHqyj1S7Rhh32Gx7bvq uEbwmyw/3vLdFPgLh3UFZkFVvwBjBI8Yttd+oRdlSwEbZ8fZIlu62xCy4CX1yKiPJqsv tElzAqOPy9kfMhdS/obEhR7YvkjZh4esNAe+S6wLNkUfPr9dazkgUoe3ItdXr1kZAmYH BxCw== 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 t7-v6si5262944edr.278.2018.06.18.07.29.04; Mon, 18 Jun 2018 07:29:04 -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 057DDC21F0F; Mon, 18 Jun 2018 14:22:18 +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 CE7AAC21EE4; Mon, 18 Jun 2018 14:22:16 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id A9313C21DDC; Mon, 18 Jun 2018 14:10:07 +0000 (UTC) Received: from mail-io0-f201.google.com (mail-io0-f201.google.com [209.85.223.201]) by lists.denx.de (Postfix) with ESMTPS id BC983C21DFF for ; Mon, 18 Jun 2018 14:10:02 +0000 (UTC) Received: by mail-io0-f201.google.com with SMTP id r10-v6so13375166ioh.7 for ; Mon, 18 Jun 2018 07:10:02 -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=hhrntG6epDs9xIWTX83i0oxjemnGPxrY8b940jIkTfk=; b=RZQ3yTizsmg/4zVEU0pQdE6D46QF1R8FJvSgyETf85QnX0aY2yQYKhwJqLwKK83TQX 0NkO5f3Jn8NavAFC48BiEYFZCRnhW6ryJeT8AIH5u16kf+W7aTmZABfGDW+OBqw0K9Fp fKZJfi9Xj8hT2fdvOEKtbU+1HshnZTRHRwuLEywQpsd/jlMEnGswQBL/mF0hJlYm+hK8 J92xqpkf+pejEL37xpq+stLAds7lMMwYDtlld3h4hqmFIvoFLmcSMCVS3pSYq0ei0hY7 cIsJLGmuBR7A9T4fwGD4tFXVyV1jAiVJmQDJPSmeHLI4EzKeVxLLt5jeyY3P4i/wtSMf 0Frw== X-Gm-Message-State: APt69E0QcfQGw4H4cGa4l68/wo1GYRD5EnkDMTNDVmqNSTYR6aOB0vwP +0YIviGgJxXUuvH8YtdkVg5FRsg= MIME-Version: 1.0 X-Received: by 2002:a24:455c:: with SMTP id y89-v6mr4953414ita.0.1529331001804; Mon, 18 Jun 2018 07:10:01 -0700 (PDT) Date: Mon, 18 Jun 2018 08:08:33 -0600 In-Reply-To: <20180618140835.195901-1-sjg@chromium.org> Message-Id: <20180618140835.195901-29-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 28/30] efi_loader: Disable miniapps on sandbox 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 In the sandbox environment we can not easily build efi stub binaries right now, so let's disable the respective test cases for the efi selftest suite. 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_selftest/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/efi_selftest/Makefile b/lib/efi_selftest/Makefile index 4fe404d88d..bf5c8199cb 100644 --- a/lib/efi_selftest/Makefile +++ b/lib/efi_selftest/Makefile @@ -41,7 +41,7 @@ endif # TODO: As of v2018.01 the relocation code for the EFI application cannot # be built on x86_64. -ifeq ($(CONFIG_X86_64),) +ifeq ($(CONFIG_X86_64)$(CONFIG_SANDBOX),) ifneq ($(CONFIG_CMD_BOOTEFI_SELFTEST),) 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;