Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/813655/?format=api
{ "id": 813655, "url": "http://patchwork.ozlabs.org/api/patches/813655/?format=api", "web_url": "http://patchwork.ozlabs.org/project/uboot/patch/20170913220546.19560-18-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-18-robdclark@gmail.com>", "list_archive_url": null, "date": "2017-09-13T22:05:40", "name": "[U-Boot,v3,17/21] efi_loader: set loaded image code/data type properly", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": false, "hash": "92128abc749e91a379ae5b883bdb4c40b5ecf35c", "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-18-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/813655/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/813655/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=\"foB516/u\"; dkim-atps=neutral" ], "Received": [ "from lists.denx.de (dione.denx.de [81.169.180.215])\n\tby ozlabs.org (Postfix) with ESMTP id 3xsx0y1h4nz9sxR\n\tfor <incoming@patchwork.ozlabs.org>;\n\tThu, 14 Sep 2017 08:19:46 +1000 (AEST)", "by lists.denx.de (Postfix, from userid 105)\n\tid E4589C226F5; Wed, 13 Sep 2017 22:12:57 +0000 (UTC)", "from lists.denx.de (localhost [IPv6:::1])\n\tby lists.denx.de (Postfix) with ESMTP id 40E09C225FD;\n\tWed, 13 Sep 2017 22:11:57 +0000 (UTC)", "by lists.denx.de (Postfix, from userid 105)\n\tid 17966C2257F; Wed, 13 Sep 2017 22:06:49 +0000 (UTC)", "from mail-qt0-f196.google.com (mail-qt0-f196.google.com\n\t[209.85.216.196])\n\tby lists.denx.de (Postfix) with ESMTPS id 63472C2257F\n\tfor <u-boot@lists.denx.de>; Wed, 13 Sep 2017 22:06:45 +0000 (UTC)", "by mail-qt0-f196.google.com with SMTP id t46so942220qtj.3\n\tfor <u-boot@lists.denx.de>; Wed, 13 Sep 2017 15:06:45 -0700 (PDT)", "from localhost ([2601:184:4780:aac0:25f8:dd96:a084:785a])\n\tby smtp.gmail.com with ESMTPSA id\n\tr22sm10509933qtj.94.2017.09.13.15.06.42\n\t(version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256);\n\tWed, 13 Sep 2017 15:06:43 -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=agLKFCHofSoXSGDDqTTx4I8hvrEJSirlG3r1W1vdczo=;\n\tb=foB516/ulBHjib94ZrsVYqhzw3uZcuLZcZlSTWH6WP5fuzhMeTAFA3Q2EUpskGE40x\n\tbQ7PogzK5WQbF8L7omsf4Ocd62CJLHZbXaFIRvJaZcz7K+3Q3Iz8pDQmi40uxcfDJqhR\n\tOClMkakuH51TESRRd8L2aO39l8zVSH33+zVOQKQD5MIRilHEEFHrYOTN+E4kuqHy31Di\n\tNWNkzMvmFTCy3fNif2lv22nD0kgQk3omU9ljkHr5TjXIQD0Tsy49qxawYt09ZpYeTHT/\n\tmyOPwlaXCA7rJuZi8DoTpDKP5kEhzCUwn3GwaD0FP+RsmKlbpSA/Ctteilz1c2rdmOls\n\tIoxg==", "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=agLKFCHofSoXSGDDqTTx4I8hvrEJSirlG3r1W1vdczo=;\n\tb=LhZ+g8eszlbJ5eCbwlMwbWCgAilNWUoVn/oDJUGWg/5mV1ROc4JOo751xrCwvl1BU6\n\tbm+Qz+8PzaS8XWdmsNxfsVAnzZ3yDN1P5/6CULIkTQ+jxUFv6qcEEeLSKy1B3z/1PaZL\n\tfw1MnocisExnUICNOer+sZy43xnmpnIBPT8sbo9DYKYTsyGHx7kutCUtUdXEmDVujq9C\n\tbnpg5jaOm/8zhuT041KyisHSE4mUhrbhhQkO2HMTcupgb0ueb0140/jCyHnt8WTIoG+s\n\tNJwhh2s2zOyqnsxGtfkpsAY1vQiKXegW7uXI+CCjBAiDV0BfYDZn5SLSUVEdoXkrhnET\n\t76HA==", "X-Gm-Message-State": "AHPjjUgfsofeHKCTucPczz5gHZax6d9TqlnKsttQbNx5ofdTJMwjL+8G\n\tV+CPjtHUVatKqdxDPYU=", "X-Google-Smtp-Source": "AOwi7QDc56FegPvAG5DvC/nWPH3eye95MZJcR6fa7RishxT/BSiwdBqaTmQy8wRQ9/S2IKSKg4ftDw==", "X-Received": "by 10.200.35.204 with SMTP id r12mr18317907qtr.95.1505340404103; \n\tWed, 13 Sep 2017 15:06:44 -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:40 -0400", "Message-Id": "<20170913220546.19560-18-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 17/21] efi_loader: set loaded image code/data\n\ttype properly", "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": "These should be set according to the image type. Shell.efi and SCT.efi\nuse these fields to determine what sort of image they are loading.\n\nSigned-off-by: Rob Clark <robdclark@gmail.com>\n---\n include/pe.h | 6 ++++++\n lib/efi_loader/efi_image_loader.c | 22 ++++++++++++++++++++++\n 2 files changed, 28 insertions(+)", "diff": "diff --git a/include/pe.h b/include/pe.h\nindex deb35a0ea4..4ef3e92efa 100644\n--- a/include/pe.h\n+++ b/include/pe.h\n@@ -62,6 +62,12 @@ typedef struct _IMAGE_DATA_DIRECTORY {\n \n #define IMAGE_NUMBEROF_DIRECTORY_ENTRIES 16\n \n+/* PE32+ Subsystem type for EFI images */\n+#define IMAGE_SUBSYSTEM_EFI_APPLICATION 10\n+#define IMAGE_SUBSYSTEM_EFI_BOOT_SERVICE_DRIVER 11\n+#define IMAGE_SUBSYSTEM_EFI_RUNTIME_DRIVER 12\n+#define IMAGE_SUBSYSTEM_SAL_RUNTIME_DRIVER 13\n+\n typedef struct _IMAGE_OPTIONAL_HEADER64 {\n \tuint16_t Magic; /* 0x20b */\n \tuint8_t MajorLinkerVersion;\ndiff --git a/lib/efi_loader/efi_image_loader.c b/lib/efi_loader/efi_image_loader.c\nindex 242e6a504b..af29cc4f04 100644\n--- a/lib/efi_loader/efi_image_loader.c\n+++ b/lib/efi_loader/efi_image_loader.c\n@@ -94,6 +94,7 @@ void *efi_load_pe(void *efi, struct efi_loaded_image *loaded_image_info)\n \tunsigned long virt_size = 0;\n \tbool can_run_nt64 = true;\n \tbool can_run_nt32 = true;\n+\tuint16_t image_type;\n \n #if defined(CONFIG_ARM64)\n \tcan_run_nt32 = false;\n@@ -139,6 +140,7 @@ void *efi_load_pe(void *efi, struct efi_loaded_image *loaded_image_info)\n \t\tentry = efi_reloc + opt->AddressOfEntryPoint;\n \t\trel_size = opt->DataDirectory[rel_idx].Size;\n \t\trel = efi_reloc + opt->DataDirectory[rel_idx].VirtualAddress;\n+\t\timage_type = opt->Subsystem;\n \t} else if (can_run_nt32 &&\n \t\t (nt->OptionalHeader.Magic == IMAGE_NT_OPTIONAL_HDR32_MAGIC)) {\n \t\tIMAGE_OPTIONAL_HEADER32 *opt = &nt->OptionalHeader;\n@@ -152,12 +154,32 @@ void *efi_load_pe(void *efi, struct efi_loaded_image *loaded_image_info)\n \t\tentry = efi_reloc + opt->AddressOfEntryPoint;\n \t\trel_size = opt->DataDirectory[rel_idx].Size;\n \t\trel = efi_reloc + opt->DataDirectory[rel_idx].VirtualAddress;\n+\t\timage_type = opt->Subsystem;\n \t} else {\n \t\tprintf(\"%s: Invalid optional header magic %x\\n\", __func__,\n \t\t nt->OptionalHeader.Magic);\n \t\treturn NULL;\n \t}\n \n+\tswitch (image_type) {\n+\tcase IMAGE_SUBSYSTEM_EFI_APPLICATION:\n+\t\tloaded_image_info->image_code_type = EFI_LOADER_CODE;\n+\t\tloaded_image_info->image_data_type = EFI_LOADER_DATA;\n+\t\tbreak;\n+\tcase IMAGE_SUBSYSTEM_EFI_BOOT_SERVICE_DRIVER:\n+\t\tloaded_image_info->image_code_type = EFI_BOOT_SERVICES_CODE;\n+\t\tloaded_image_info->image_data_type = EFI_BOOT_SERVICES_DATA;\n+\t\tbreak;\n+\tcase IMAGE_SUBSYSTEM_EFI_RUNTIME_DRIVER:\n+\tcase IMAGE_SUBSYSTEM_SAL_RUNTIME_DRIVER:\n+\t\tloaded_image_info->image_code_type = EFI_RUNTIME_SERVICES_CODE;\n+\t\tloaded_image_info->image_data_type = EFI_RUNTIME_SERVICES_DATA;\n+\t\tbreak;\n+\tdefault:\n+\t\tprintf(\"%s: invalid image type: %u\\n\", __func__, image_type);\n+\t\tbreak;\n+\t}\n+\n \t/* Load sections into RAM */\n \tfor (i = num_sections - 1; i >= 0; i--) {\n \t\tIMAGE_SECTION_HEADER *sec = §ions[i];\n", "prefixes": [ "U-Boot", "v3", "17/21" ] }