Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/813656/?format=api
{ "id": 813656, "url": "http://patchwork.ozlabs.org/api/patches/813656/?format=api", "web_url": "http://patchwork.ozlabs.org/project/uboot/patch/20170913220546.19560-13-robdclark@gmail.com/", "project": { "id": 18, "url": "http://patchwork.ozlabs.org/api/projects/18/?format=api", "name": "U-Boot", "link_name": "uboot", "list_id": "u-boot.lists.denx.de", "list_email": "u-boot@lists.denx.de", "web_url": null, "scm_url": null, "webscm_url": null, "list_archive_url": "", "list_archive_url_format": "", "commit_url_format": "" }, "msgid": "<20170913220546.19560-13-robdclark@gmail.com>", "list_archive_url": null, "date": "2017-09-13T22:05:35", "name": "[U-Boot,v3,12/21] efi_loader: support load_image() from a file-path", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": false, "hash": "a1b5c344d06ee2693051816085a0abf3cd80b24c", "submitter": { "id": 18760, "url": "http://patchwork.ozlabs.org/api/people/18760/?format=api", "name": "Rob Clark", "email": "robdclark@gmail.com" }, "delegate": { "id": 3400, "url": "http://patchwork.ozlabs.org/api/users/3400/?format=api", "username": "agraf", "first_name": "Alexander", "last_name": "Graf", "email": "agraf@suse.de" }, "mbox": "http://patchwork.ozlabs.org/project/uboot/patch/20170913220546.19560-13-robdclark@gmail.com/mbox/", "series": [ { "id": 2990, "url": "http://patchwork.ozlabs.org/api/series/2990/?format=api", "web_url": "http://patchwork.ozlabs.org/project/uboot/list/?series=2990", "date": "2017-09-13T22:05:23", "name": "efi_loader: enough UEFI for standard distro boot", "version": 3, "mbox": "http://patchwork.ozlabs.org/series/2990/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/813656/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/813656/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<u-boot-bounces@lists.denx.de>", "X-Original-To": "incoming@patchwork.ozlabs.org", "Delivered-To": "patchwork-incoming@bilbo.ozlabs.org", "Authentication-Results": [ "ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=lists.denx.de\n\t(client-ip=81.169.180.215; helo=lists.denx.de;\n\tenvelope-from=u-boot-bounces@lists.denx.de;\n\treceiver=<UNKNOWN>)", "ozlabs.org;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n\tunprotected) header.d=gmail.com header.i=@gmail.com\n\theader.b=\"hK8snWTQ\"; dkim-atps=neutral" ], "Received": [ "from lists.denx.de (dione.denx.de [81.169.180.215])\n\tby ozlabs.org (Postfix) with ESMTP id 3xsx114Q97z9sxR\n\tfor <incoming@patchwork.ozlabs.org>;\n\tThu, 14 Sep 2017 08:19:49 +1000 (AEST)", "by lists.denx.de (Postfix, from userid 105)\n\tid 5CC2AC226F5; Wed, 13 Sep 2017 22:10:17 +0000 (UTC)", "from lists.denx.de (localhost [IPv6:::1])\n\tby lists.denx.de (Postfix) with ESMTP id 1F01AC225FA;\n\tWed, 13 Sep 2017 22:08:09 +0000 (UTC)", "by lists.denx.de (Postfix, from userid 105)\n\tid ED6FBC2260B; Wed, 13 Sep 2017 22:06:33 +0000 (UTC)", "from mail-qk0-f194.google.com (mail-qk0-f194.google.com\n\t[209.85.220.194])\n\tby lists.denx.de (Postfix) with ESMTPS id D13F4C2249C\n\tfor <u-boot@lists.denx.de>; Wed, 13 Sep 2017 22:06:29 +0000 (UTC)", "by mail-qk0-f194.google.com with SMTP id g128so957177qke.0\n\tfor <u-boot@lists.denx.de>; Wed, 13 Sep 2017 15:06:29 -0700 (PDT)", "from localhost ([2601:184:4780:aac0:25f8:dd96:a084:785a])\n\tby smtp.gmail.com with ESMTPSA id\n\te18sm10524005qtc.59.2017.09.13.15.06.27\n\t(version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256);\n\tWed, 13 Sep 2017 15:06:27 -0700 (PDT)" ], "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=FREEMAIL_FROM,\n\tRCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL,\n\tT_DKIM_INVALID\n\tautolearn=unavailable autolearn_force=no version=3.4.0", "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;\n\th=from:to:cc:subject:date:message-id:in-reply-to:references;\n\tbh=DKsVzCsw32z5Rh0dgOU0MOQ8zk25bcDzhP7cBWZSGfE=;\n\tb=hK8snWTQ6Oq22BXpaDq1Rb8Qa54S6PkYPwJQngcJh0HNCuqEbXbV5uk2ixJXY2D466\n\tJeD9Jk8wM33oPPEw+Aci8/a+gMG8bDAE8hfJbhEXv8wJNB82Zwy9qrofQXtWc6mLsvuB\n\t+Fjl/DczCysZgAamaZMsvpKIlE2AMjqWiFYvP3PhUvAkGuRG0x4XRzzahH4fIOXDwgBO\n\tdiZNEi+iaglcRUn8RQymKxOkKVhZC2EOnKfywLk1oln+O9q1ny/9DQwOhOhJqUl9rV2U\n\tcwJgW/Vs2Ks0QC3aWXrXB8Xe7+7ci7ydAZ344e70GLXzmXFsm1YixasCBLLQCbG1UKsL\n\tBGhg==", "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to\n\t:references;\n\tbh=DKsVzCsw32z5Rh0dgOU0MOQ8zk25bcDzhP7cBWZSGfE=;\n\tb=XeqrwZRPbfFurrq3AquDq4yvbOv9Nr9+z04lk50e/K7glV0qM8uXKzy4aR8syDyPt2\n\tD1daQna/IAfxvKAYPDHcfwbMwBk2G/0AdiYMI0qem6+gvt12JiNfmj7TX+josQjZMTWB\n\tXwufRoky9Y5P4QtDdnpAyVgWtDM86coX05NGuw2WzRJzfPAzfjl/9f1ZYUO7XzzHJ7y7\n\tc/psiXMSfdP43v31y3HsMt3HbKMcHRTZJJRqmaG4PYBPr8/LDWNUZLlCUgS/k799jkn+\n\tQX+IuHnvSVbNefqKQA/lNBFNnYvejVMsQTry5cM2u/aiVkATMnMGqetCo1/kmGx7HIai\n\tLt0Q==", "X-Gm-Message-State": "AHPjjUhXSYqhNH22h0HmW7kEfjymxBNxsEqKqbaKVbcfXh6pXgAOTgSm\n\tf9fFpXWrX2kZSWqn3Kc=", "X-Google-Smtp-Source": "AOwi7QAXyA9uFecgFbXq8WmQ3UV0RcGPf/h3dCPI4OS+vmVHsIEjZ3IWYy4f9SCmSTcpI9n6PiOcMw==", "X-Received": "by 10.55.12.16 with SMTP id 16mr25384238qkm.213.1505340388536;\n\tWed, 13 Sep 2017 15:06:28 -0700 (PDT)", "From": "Rob Clark <robdclark@gmail.com>", "To": "U-Boot Mailing List <u-boot@lists.denx.de>", "Date": "Wed, 13 Sep 2017 18:05:35 -0400", "Message-Id": "<20170913220546.19560-13-robdclark@gmail.com>", "X-Mailer": "git-send-email 2.13.5", "In-Reply-To": "<20170913220546.19560-1-robdclark@gmail.com>", "References": "<20170913220546.19560-1-robdclark@gmail.com>", "Cc": "Heinrich Schuchardt <xypron.glpk@gmx.de>", "Subject": "[U-Boot] [PATCH v3 12/21] efi_loader: support load_image() from a\n\tfile-path", "X-BeenThere": "u-boot@lists.denx.de", "X-Mailman-Version": "2.1.18", "Precedence": "list", "List-Id": "U-Boot discussion <u-boot.lists.denx.de>", "List-Unsubscribe": "<https://lists.denx.de/options/u-boot>,\n\t<mailto:u-boot-request@lists.denx.de?subject=unsubscribe>", "List-Archive": "<http://lists.denx.de/pipermail/u-boot/>", "List-Post": "<mailto:u-boot@lists.denx.de>", "List-Help": "<mailto:u-boot-request@lists.denx.de?subject=help>", "List-Subscribe": "<https://lists.denx.de/listinfo/u-boot>,\n\t<mailto:u-boot-request@lists.denx.de?subject=subscribe>", "MIME-Version": "1.0", "Content-Type": "text/plain; charset=\"utf-8\"", "Content-Transfer-Encoding": "base64", "Errors-To": "u-boot-bounces@lists.denx.de", "Sender": "\"U-Boot\" <u-boot-bounces@lists.denx.de>" }, "content": "Previously we only supported the case when the EFI application loaded\nthe image into memory for us. But fallback.efi does not do this.\n\nSigned-off-by: Rob Clark <robdclark@gmail.com>\n---\n lib/efi_loader/efi_boottime.c | 85 +++++++++++++++++++++++++++++++++++--------\n 1 file changed, 70 insertions(+), 15 deletions(-)", "diff": "diff --git a/lib/efi_loader/efi_boottime.c b/lib/efi_loader/efi_boottime.c\nindex 837e61d8fe..ec40f41bcb 100644\n--- a/lib/efi_loader/efi_boottime.c\n+++ b/lib/efi_loader/efi_boottime.c\n@@ -762,6 +762,47 @@ void efi_setup_loaded_image(struct efi_loaded_image *info, struct efi_object *ob\n \tlist_add_tail(&obj->link, &efi_obj_list);\n }\n \n+static efi_status_t load_image_from_path(struct efi_device_path *file_path,\n+\t\t\t\t\t void **buffer)\n+{\n+\tstruct efi_file_info *info = NULL;\n+\tstruct efi_file_handle *f;\n+\tstatic efi_status_t ret;\n+\tuint64_t bs;\n+\n+\tf = efi_file_from_path(file_path);\n+\tif (!f)\n+\t\treturn EFI_DEVICE_ERROR;\n+\n+\tbs = 0;\n+\tEFI_CALL(ret = f->getinfo(f, (efi_guid_t *)&efi_file_info_guid,\n+\t\t\t\t &bs, info));\n+\tif (ret == EFI_BUFFER_TOO_SMALL) {\n+\t\tinfo = malloc(bs);\n+\t\tEFI_CALL(ret = f->getinfo(f, (efi_guid_t *)&efi_file_info_guid,\n+\t\t\t\t\t &bs, info));\n+\t}\n+\tif (ret != EFI_SUCCESS)\n+\t\tgoto error;\n+\n+\tret = efi_allocate_pool(EFI_LOADER_DATA, info->file_size, buffer);\n+\tif (ret)\n+\t\tgoto error;\n+\n+\tEFI_CALL(ret = f->read(f, &info->file_size, *buffer));\n+\n+error:\n+\tfree(info);\n+\tEFI_CALL(f->close(f));\n+\n+\tif (ret != EFI_SUCCESS) {\n+\t\tefi_free_pool(*buffer);\n+\t\t*buffer = NULL;\n+\t}\n+\n+\treturn ret;\n+}\n+\n static efi_status_t EFIAPI efi_load_image(bool boot_policy,\n \t\t\t\t\t efi_handle_t parent_image,\n \t\t\t\t\t struct efi_device_path *file_path,\n@@ -769,25 +810,40 @@ static efi_status_t EFIAPI efi_load_image(bool boot_policy,\n \t\t\t\t\t unsigned long source_size,\n \t\t\t\t\t efi_handle_t *image_handle)\n {\n-\tstatic struct efi_object loaded_image_info_obj = {\n-\t\t.protocols = {\n-\t\t\t{\n-\t\t\t\t.guid = &efi_guid_loaded_image,\n-\t\t\t},\n-\t\t},\n-\t};\n \tstruct efi_loaded_image *info;\n \tstruct efi_object *obj;\n \n \tEFI_ENTRY(\"%d, %p, %p, %p, %ld, %p\", boot_policy, parent_image,\n \t\t file_path, source_buffer, source_size, image_handle);\n-\tinfo = malloc(sizeof(*info));\n-\tloaded_image_info_obj.protocols[0].protocol_interface = info;\n-\tobj = malloc(sizeof(loaded_image_info_obj));\n-\tmemset(info, 0, sizeof(*info));\n-\tmemcpy(obj, &loaded_image_info_obj, sizeof(loaded_image_info_obj));\n-\tobj->handle = info;\n-\tinfo->file_path = file_path;\n+\n+\tinfo = calloc(1, sizeof(*info));\n+\tobj = calloc(1, sizeof(*obj));\n+\n+\tif (!source_buffer) {\n+\t\tstruct efi_device_path *dp, *fp;\n+\t\tefi_status_t ret;\n+\n+\t\tret = load_image_from_path(file_path, &source_buffer);\n+\t\tif (ret != EFI_SUCCESS) {\n+\t\t\tfree(info);\n+\t\t\tfree(obj);\n+\t\t\treturn EFI_EXIT(ret);\n+\t\t}\n+\n+\t\t/*\n+\t\t * split file_path which contains both the device and\n+\t\t * file parts:\n+\t\t */\n+\t\tefi_dp_split_file_path(file_path, &dp, &fp);\n+\n+\t\tefi_setup_loaded_image(info, obj, dp, fp);\n+\t} else {\n+\t\t/* In this case, file_path is the \"device\" path, ie.\n+\t\t * something like a HARDWARE_DEVICE:MEMORY_MAPPED\n+\t\t */\n+\t\tefi_setup_loaded_image(info, obj, file_path, NULL);\n+\t}\n+\n \tinfo->reserved = efi_load_pe(source_buffer, info);\n \tif (!info->reserved) {\n \t\tfree(info);\n@@ -796,7 +852,6 @@ static efi_status_t EFIAPI efi_load_image(bool boot_policy,\n \t}\n \n \t*image_handle = info;\n-\tlist_add_tail(&obj->link, &efi_obj_list);\n \n \treturn EFI_EXIT(EFI_SUCCESS);\n }\n", "prefixes": [ "U-Boot", "v3", "12/21" ] }