[{"id":1769362,"web_url":"http://patchwork.ozlabs.org/comment/1769362/","msgid":"<540b3b30-353e-2169-12cb-14a1d8a595be@gmx.de>","list_archive_url":null,"date":"2017-09-15T18:53:39","subject":"Re: [U-Boot] [U-Boot,v3,03/21] efi: add some missing __packed","submitter":{"id":61270,"url":"http://patchwork.ozlabs.org/api/people/61270/","name":"Heinrich Schuchardt","email":"xypron.glpk@gmx.de"},"content":"On 09/14/2017 12:05 AM, Rob Clark wrote:\n> All of the device-path related structures should be packed.  UEFI\n> defines the device-path as a byte-aligned data structure.\n> \n> Signed-off-by: Rob Clark <robdclark@gmail.com>\n> ---\n>  include/efi_api.h | 8 ++++----\n>  1 file changed, 4 insertions(+), 4 deletions(-)\n> \n> diff --git a/include/efi_api.h b/include/efi_api.h\n> index ec1b321e8e..175341348e 100644\n> --- a/include/efi_api.h\n> +++ b/include/efi_api.h\n> @@ -284,11 +284,11 @@ struct efi_device_path {\n>  \tu8 type;\n>  \tu8 sub_type;\n>  \tu16 length;\n> -};\n> +} __packed;\n>  \n>  struct efi_mac_addr {\n>  \tu8 addr[32];\n\nHello Alex, hello Rob,\n\n32 bytes is more than the 6 bytes than we need.\nWhy was the structure defined this way?\n\n> -};\n> +} __packed;\n>  \n>  #define DEVICE_PATH_TYPE_MESSAGING_DEVICE\t0x03\n>  #  define DEVICE_PATH_SUB_TYPE_MSG_MAC_ADDR\t0x0b\n> @@ -297,7 +297,7 @@ struct efi_device_path_mac_addr {\n>  \tstruct efi_device_path dp;\n>  \tstruct efi_mac_addr mac;\n>  \tu8 if_type;\n> -};\n> +} __packed;\n>  \n>  #define DEVICE_PATH_TYPE_MEDIA_DEVICE\t\t0x04\n>  #  define DEVICE_PATH_SUB_TYPE_FILE_PATH\t0x04\n> @@ -305,7 +305,7 @@ struct efi_device_path_mac_addr {\n>  struct efi_device_path_file_path {\n>  \tstruct efi_device_path dp;\n>  \tu16 str[32];\n\nWhere do we get this 32 from?\nCouldn't file/directory names be shorter (1 character) or longer (255\ncharacters)?\n\nRegards\n\nHeinrich\n\n> -};\n> +} __packed;\n>  \n>  #define BLOCK_IO_GUID \\\n>  \tEFI_GUID(0x964e5b21, 0x6459, 0x11d2, \\\n>","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>)","Received":["from lists.denx.de (dione.denx.de [81.169.180.215])\n\tby ozlabs.org (Postfix) with ESMTP id 3xv4Lh5qZkz9s7g\n\tfor <incoming@patchwork.ozlabs.org>;\n\tSat, 16 Sep 2017 04:54:04 +1000 (AEST)","by lists.denx.de (Postfix, from userid 105)\n\tid 7B848C21E5D; Fri, 15 Sep 2017 18:54:02 +0000 (UTC)","from lists.denx.de (localhost [IPv6:::1])\n\tby lists.denx.de (Postfix) with ESMTP id A9C48C21D95;\n\tFri, 15 Sep 2017 18:53:57 +0000 (UTC)","by lists.denx.de (Postfix, from userid 105)\n\tid C49EFC21D95; Fri, 15 Sep 2017 18:53:55 +0000 (UTC)","from mout.gmx.net (mout.gmx.net [212.227.15.15])\n\tby lists.denx.de (Postfix) with ESMTPS id 73C7FC21C62\n\tfor <u-boot@lists.denx.de>; Fri, 15 Sep 2017 18:53:55 +0000 (UTC)","from [192.168.8.100] ([188.29.165.107]) by mail.gmx.com (mrgmx001\n\t[212.227.17.190]) with ESMTPSA (Nemesis) id\n\t0MCcOw-1dkeGw0AOg-009Lsv; Fri, 15 Sep 2017 20:53:44 +0200"],"X-Spam-Checker-Version":"SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de","X-Spam-Level":"","X-Spam-Status":"No, score=-0.7 required=5.0 tests=FREEMAIL_FROM,\n\tRCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3,\n\tRCVD_IN_MSPIKE_WL autolearn=unavailable\n\tautolearn_force=no version=3.4.0","To":"Rob Clark <robdclark@gmail.com>,\n\tU-Boot Mailing List <u-boot@lists.denx.de>,\n\tAlexander Graf <agraf@suse.de>","References":"<20170913220546.19560-4-robdclark@gmail.com>","From":"Heinrich Schuchardt <xypron.glpk@gmx.de>","Message-ID":"<540b3b30-353e-2169-12cb-14a1d8a595be@gmx.de>","Date":"Fri, 15 Sep 2017 20:53:39 +0200","User-Agent":"Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101\n\tThunderbird/52.2.1","MIME-Version":"1.0","In-Reply-To":"<20170913220546.19560-4-robdclark@gmail.com>","Content-Language":"en-US","X-Provags-ID":"V03:K0:3/V8nyGEikkTeFb1/DYnLY08EHLcyGx6aQPUHTMizewzCiqjYp5\n\tnHgCS6gy+wuCyae19vr/4ylipebDNHlzMGIqhFqRrOHb67HVbPgBRfpJpNhdLbfkfOnv9xW\n\tInFYb/kDX5iDvbMFoxj7TsVW8xnKHNZDENCkYpyBmA/Pn5TLtr4oPkpOhw5Y5gg8XxHoJDm\n\tv+IjYHRf9HUg1hYqdyCaA==","X-UI-Out-Filterresults":"notjunk:1; V01:K0:fn4srxhRF5U=:dw5oBFuEa+UpucpXu+sUkt\n\t8ALkXhB8DgSA2OjnMZsXF3iDHqR2ecRFGKALmxWALfLKIv8U3d8V+keFUrpxnW+sRTQ+S/QOW\n\td9BBR7UkzXauJikaChCxHqQip4jE1z8NUP1F/426DYk6pNs2OoupklPNwWcPs5ZlIsG+lCZqz\n\t6YInEx7p+QOHQfmdp3dhHc4ZmXD/kedaiHh/eYacT5am0UL0IAdbaMis7UeRnv2uby1+A7aEz\n\tbTZn5LieMqYfrplLMzwdzkEsdvE7zmnz2Cn7O+jep3ddI+TVJjeKDxVI/vo6Xd1DUB258QHYd\n\tlt4kiGclMl/I0jboT48eKSru0v6czYRE2xkvp89poY4ecABwcAlTJ7nfngBVni/v6cU7UpP4o\n\tt1IrRPlha4Q/9jdFRJhUoqH43HA54ZhIaoswvXqW+fd3kt7XKs+YUQZerVTy5MwS0R28tEzhJ\n\t708cpqoy3ctedD2v+fSJsvxnD2H/puJqba8FVYhfhb0/P943W9LBh9/QqayQM5FMxEO9OkvKl\n\t+OmC+rZXcjpR0AxAZmJ9+ezbXcf0/t9WKa1VocOrqsp6XLjf2PjhHMKRdN79bjeEF1WCX8tVd\n\t/5yzJZmy8zoBYxsHBHOZsMZElP05xY3tnrLG3cUoAiQivzTV3J7H687ug/I4+izPVQVzL9S7y\n\tLMIjT+Mu0v9C+CfUonARDsyjvM62jCr1haSWrCXl0zJ0+TDvXKVk8XNvV0ikXweIylLLfjmho\n\tnlOwgPW/me9W7hkBMELV5E94PXNCULDfMX1z+DYLbGoiPnkbnktGO8GUKTn8ZGcH2vY0evIsF\n\teksMxqEJJVV1X4p/upzEYRAnXbKfNMf1saNxY2gYePiawwwRyE=","Cc":"Heinrich Schuchardt <xypron.glpk@gmx.de>, Peter Jones <pjones@redhat.com>","Subject":"Re: [U-Boot] [U-Boot,v3,03/21] efi: add some missing __packed","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>","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>"}},{"id":1769365,"web_url":"http://patchwork.ozlabs.org/comment/1769365/","msgid":"<CAF6AEGuvvPvuUxe0jPDzVHENVu3SksEL5br-v9KZxECP+4kLQg@mail.gmail.com>","list_archive_url":null,"date":"2017-09-15T18:58:26","subject":"Re: [U-Boot] [U-Boot,v3,03/21] efi: add some missing __packed","submitter":{"id":18760,"url":"http://patchwork.ozlabs.org/api/people/18760/","name":"Rob Clark","email":"robdclark@gmail.com"},"content":"On Fri, Sep 15, 2017 at 2:53 PM, Heinrich Schuchardt <xypron.glpk@gmx.de> wrote:\n> On 09/14/2017 12:05 AM, Rob Clark wrote:\n>> All of the device-path related structures should be packed.  UEFI\n>> defines the device-path as a byte-aligned data structure.\n>>\n>> Signed-off-by: Rob Clark <robdclark@gmail.com>\n>> ---\n>>  include/efi_api.h | 8 ++++----\n>>  1 file changed, 4 insertions(+), 4 deletions(-)\n>>\n>> diff --git a/include/efi_api.h b/include/efi_api.h\n>> index ec1b321e8e..175341348e 100644\n>> --- a/include/efi_api.h\n>> +++ b/include/efi_api.h\n>> @@ -284,11 +284,11 @@ struct efi_device_path {\n>>       u8 type;\n>>       u8 sub_type;\n>>       u16 length;\n>> -};\n>> +} __packed;\n>>\n>>  struct efi_mac_addr {\n>>       u8 addr[32];\n>\n> Hello Alex, hello Rob,\n>\n> 32 bytes is more than the 6 bytes than we need.\n> Why was the structure defined this way?\n>\n\nOff the top of my head, I'm not sure where that came from, maybe this\ndp node is meant to be variable length?  But I guess that is also a\nseparate patch.\n\n>> -};\n>> +} __packed;\n>>\n>>  #define DEVICE_PATH_TYPE_MESSAGING_DEVICE    0x03\n>>  #  define DEVICE_PATH_SUB_TYPE_MSG_MAC_ADDR  0x0b\n>> @@ -297,7 +297,7 @@ struct efi_device_path_mac_addr {\n>>       struct efi_device_path dp;\n>>       struct efi_mac_addr mac;\n>>       u8 if_type;\n>> -};\n>> +} __packed;\n>>\n>>  #define DEVICE_PATH_TYPE_MEDIA_DEVICE                0x04\n>>  #  define DEVICE_PATH_SUB_TYPE_FILE_PATH     0x04\n>> @@ -305,7 +305,7 @@ struct efi_device_path_mac_addr {\n>>  struct efi_device_path_file_path {\n>>       struct efi_device_path dp;\n>>       u16 str[32];\n>\n> Where do we get this 32 from?\n> Couldn't file/directory names be shorter (1 character) or longer (255\n> characters)?\n>\n\nyup, file-path nodes should be variable length (and are after my\npatches.. I have a later one that changes it to 'u16 str[]')\n\nI believe the hard-coded 32 is due to current staticly initialized\ndevice-path structs which go away with \"efi_loader: refactor boot\ndevice and loaded_image handling\"\n\nBR,\n-R","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=\"b8pNGseP\"; dkim-atps=neutral"],"Received":["from lists.denx.de (dione.denx.de [81.169.180.215])\n\tby ozlabs.org (Postfix) with ESMTP id 3xv4Rx27qFz9s7g\n\tfor <incoming@patchwork.ozlabs.org>;\n\tSat, 16 Sep 2017 04:58:37 +1000 (AEST)","by lists.denx.de (Postfix, from userid 105)\n\tid DC31DC21E5D; Fri, 15 Sep 2017 18:58:32 +0000 (UTC)","from lists.denx.de (localhost [IPv6:::1])\n\tby lists.denx.de (Postfix) with ESMTP id 8252DC21DE9;\n\tFri, 15 Sep 2017 18:58:30 +0000 (UTC)","by lists.denx.de (Postfix, from userid 105)\n\tid 8CD81C21DE9; Fri, 15 Sep 2017 18:58:28 +0000 (UTC)","from mail-lf0-f65.google.com (mail-lf0-f65.google.com\n\t[209.85.215.65])\n\tby lists.denx.de (Postfix) with ESMTPS id 07D7FC21D95\n\tfor <u-boot@lists.denx.de>; Fri, 15 Sep 2017 18:58:28 +0000 (UTC)","by mail-lf0-f65.google.com with SMTP id m199so1617391lfe.5\n\tfor <u-boot@lists.denx.de>; Fri, 15 Sep 2017 11:58:28 -0700 (PDT)","by 10.46.41.75 with HTTP; Fri, 15 Sep 2017 11:58:26 -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=mime-version:in-reply-to:references:from:date:message-id:subject:to\n\t:cc; bh=0WoKi/6V8kI3t3+NhWC7udrgm791mc6SxOhXV0EuNek=;\n\tb=b8pNGsePDBEKY62tO3hlZsey1eRzsqGUqFf+zGBLHWu3LwowGNQYgcGdhOetKNaf4y\n\t1bT2e0RHmPJoQh8p76I5O0aZCuKD/NlvF0qZfnMyeBvQdOeJLZPdjfuR+OW059LHKL2t\n\tkAna41iEEhtR11JX+nWNAH2w1JH4pGBm8Bclv3kFlOuC2EO1pexM1OA2QbKc60iMqAP1\n\tlJViEQzvyumK6S7ETBLbhRBUHMkKTeluzFuKFTkM5d7xbYtWooMogpR5qZb9NHFsztpo\n\t8+oEvvTYzIQSHhLI/EJArsqn9M0v7C2ASIO6FllZBeXvqkIdMj7MkNN+vQZToUr2iKAh\n\t8GPg==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:mime-version:in-reply-to:references:from:date\n\t:message-id:subject:to:cc;\n\tbh=0WoKi/6V8kI3t3+NhWC7udrgm791mc6SxOhXV0EuNek=;\n\tb=AbgTzQN8QRCSPcm7N4K3oT7JmsCFDEUuBVOSnC4S0GcIORWaoZ9UEeztv3UUb2Db6l\n\tCDRqu02EMaDC2wMQiXnyuMop4/0Q0dd406ZOdZHqpkuXe8VAxhG/PSjfbjY6+QTpkg1I\n\ti9Ixc8u4bCSZJ9sP6qpNASSnub5SKQDrHJO77NPb+XieH4aOOr/kWBUqo2s8WPdxEhXu\n\tBE5vZLWEa7FmKxnaKs0M9VM8WJHIG8upexwEQrZ703YGpblYSgtdpGqHyxBQYse6zt8P\n\t99vJG/ao7XpI8l5VyO7dypR2n4w2gv2rPN0+oLh5EDbvNZqk5tEX7sNJa2O7LjTl3ffT\n\trBrQ==","X-Gm-Message-State":"AHPjjUhJWYI2+h8sNe+wsZh2wPjVGr+RFn7AyssCVIwdJU1Lv85dtk5N\n\tubGsnoKvcFP5ISGFa9ug6P7IL9KfvwECsvl0i5M=","X-Google-Smtp-Source":"AOwi7QAIhwr0Ks6nPnaiTiBza1qZb+yEaBzBUzYic4OAoVPyjpA6BZpBaWIZqfZzgHhS4s5rPgxdDkMA+3KB8J2P5fA=","X-Received":"by 10.46.99.201 with SMTP id s70mr1672769lje.143.1505501907384; \n\tFri, 15 Sep 2017 11:58:27 -0700 (PDT)","MIME-Version":"1.0","In-Reply-To":"<540b3b30-353e-2169-12cb-14a1d8a595be@gmx.de>","References":"<20170913220546.19560-4-robdclark@gmail.com>\n\t<540b3b30-353e-2169-12cb-14a1d8a595be@gmx.de>","From":"Rob Clark <robdclark@gmail.com>","Date":"Fri, 15 Sep 2017 14:58:26 -0400","Message-ID":"<CAF6AEGuvvPvuUxe0jPDzVHENVu3SksEL5br-v9KZxECP+4kLQg@mail.gmail.com>","To":"Heinrich Schuchardt <xypron.glpk@gmx.de>","Cc":"U-Boot Mailing List <u-boot@lists.denx.de>,\n\tPeter Jones <pjones@redhat.com>","Subject":"Re: [U-Boot] [U-Boot,v3,03/21] efi: add some missing __packed","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>","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>"}},{"id":1772468,"web_url":"http://patchwork.ozlabs.org/comment/1772468/","msgid":"<150597748876.57816.13956219040485752700@achrid.arch.suse.de>","list_archive_url":null,"date":"2017-09-21T07:04:49","subject":"Re: [U-Boot] [U-Boot,v3,03/21] efi: add some missing __packed","submitter":{"id":1212,"url":"http://patchwork.ozlabs.org/api/people/1212/","name":"Alexander Graf","email":"agraf@suse.de"},"content":"> All of the device-path related structures should be packed.  UEFI\n> defines the device-path as a byte-aligned data structure.\n> \n> Signed-off-by: Rob Clark <robdclark@gmail.com>\n\nThanks, applied to efi-next\n\nAlex","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>)","Received":["from lists.denx.de (dione.denx.de [81.169.180.215])\n\tby ozlabs.org (Postfix) with ESMTP id 3xySSN2T2Qz9s7h\n\tfor <incoming@patchwork.ozlabs.org>;\n\tThu, 21 Sep 2017 17:10:44 +1000 (AEST)","by lists.denx.de (Postfix, from userid 105)\n\tid E2DC7C21F4B; Thu, 21 Sep 2017 07:05:39 +0000 (UTC)","from lists.denx.de (localhost [IPv6:::1])\n\tby lists.denx.de (Postfix) with ESMTP id 6F031C21F55;\n\tThu, 21 Sep 2017 07:05:15 +0000 (UTC)","by lists.denx.de (Postfix, from userid 105)\n\tid 17BD8C21F5D; Thu, 21 Sep 2017 07:04:52 +0000 (UTC)","from mx1.suse.de (mx2.suse.de [195.135.220.15])\n\tby lists.denx.de (Postfix) with ESMTPS id 1FD64C21EBC\n\tfor <u-boot@lists.denx.de>; Thu, 21 Sep 2017 07:04:50 +0000 (UTC)","from relay2.suse.de (charybdis-ext.suse.de [195.135.220.254])\n\tby mx1.suse.de (Postfix) with ESMTP id E2882ABDB;\n\tThu, 21 Sep 2017 07:04:49 +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=-2.3 required=5.0 tests=RCVD_IN_DNSWL_MED\n\tautolearn=unavailable autolearn_force=no version=3.4.0","X-Virus-Scanned":"by amavisd-new at test-mx.suse.de","From":"Alexander Graf <agraf@suse.de>","To":"Rob Clark <robdclark@gmail.com>","Date":"Thu, 21 Sep 2017 09:04:49 +0200","Message-Id":"<150597748876.57816.13956219040485752700@achrid.arch.suse.de>","X-Mailer":"git-send-email 2.12.3","In-Reply-To":"<20170913220546.19560-4-robdclark@gmail.com>","References":"<20170913220546.19560-4-robdclark@gmail.com>","MIME-Version":": 1.0","Cc":"U-Boot Mailing List <u-boot@lists.denx.de>","Subject":"Re: [U-Boot] [U-Boot,v3,03/21] efi: add some missing __packed","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>","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>"}},{"id":1779020,"web_url":"http://patchwork.ozlabs.org/comment/1779020/","msgid":"<20171003143453.3g2moggkwq7umpa4@redhat.com>","list_archive_url":null,"date":"2017-10-03T14:34:54","subject":"Re: [U-Boot] [U-Boot,v3,03/21] efi: add some missing __packed","submitter":{"id":43746,"url":"http://patchwork.ozlabs.org/api/people/43746/","name":"Peter Jones","email":"pjones@redhat.com"},"content":"On Fri, Sep 15, 2017 at 06:53:39PM +0000, Heinrich Schuchardt wrote:\n> On 09/14/2017 12:05 AM, Rob Clark wrote:\n> > All of the device-path related structures should be packed.  UEFI\n> > defines the device-path as a byte-aligned data structure.\n> > \n> > Signed-off-by: Rob Clark <robdclark@gmail.com>\n> > ---\n> >  include/efi_api.h | 8 ++++----\n> >  1 file changed, 4 insertions(+), 4 deletions(-)\n> > \n> > diff --git a/include/efi_api.h b/include/efi_api.h\n> > index ec1b321e8e..175341348e 100644\n> > --- a/include/efi_api.h\n> > +++ b/include/efi_api.h\n> > @@ -284,11 +284,11 @@ struct efi_device_path {\n> >  \tu8 type;\n> >  \tu8 sub_type;\n> >  \tu16 length;\n> > -};\n> > +} __packed;\n> >  \n> >  struct efi_mac_addr {\n> >  \tu8 addr[32];\n> \n> Hello Alex, hello Rob,\n> \n> 32 bytes is more than the 6 bytes than we need.\n> Why was the structure defined this way?\n\nIt probably *should* have been variable length in the spec, but it is\ndefined as 32-bytes.  But 6 is also not correct - it's right for\nethernet, but not for everything.  I suspect they picked the length of\nan IPoIB (Infiniband) MAC here.\n\n> \n> > -};\n> > +} __packed;\n> >  \n> >  #define DEVICE_PATH_TYPE_MESSAGING_DEVICE\t0x03\n> >  #  define DEVICE_PATH_SUB_TYPE_MSG_MAC_ADDR\t0x0b\n> > @@ -297,7 +297,7 @@ struct efi_device_path_mac_addr {\n> >  \tstruct efi_device_path dp;\n> >  \tstruct efi_mac_addr mac;\n> >  \tu8 if_type;\n> > -};\n> > +} __packed;\n> >  \n> >  #define DEVICE_PATH_TYPE_MEDIA_DEVICE\t\t0x04\n> >  #  define DEVICE_PATH_SUB_TYPE_FILE_PATH\t0x04\n> > @@ -305,7 +305,7 @@ struct efi_device_path_mac_addr {\n> >  struct efi_device_path_file_path {\n> >  \tstruct efi_device_path dp;\n> >  \tu16 str[32];\n> \n> Where do we get this 32 from?\n> Couldn't file/directory names be shorter (1 character) or longer (255\n> characters)?\n\nNote there's already another patch in this series fixing this.","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>)","ext-mx04.extmail.prod.ext.phx2.redhat.com;\n\tdmarc=none (p=none dis=none) header.from=redhat.com","ext-mx04.extmail.prod.ext.phx2.redhat.com;\n\tspf=fail smtp.mailfrom=pjones@redhat.com"],"Received":["from lists.denx.de (dione.denx.de [81.169.180.215])\n\tby ozlabs.org (Postfix) with ESMTP id 3y61lh4NGjz9t2Z\n\tfor <incoming@patchwork.ozlabs.org>;\n\tWed,  4 Oct 2017 01:35:11 +1100 (AEDT)","by lists.denx.de (Postfix, from userid 105)\n\tid 38291C21F5F; Tue,  3 Oct 2017 14:35:05 +0000 (UTC)","from lists.denx.de (localhost [IPv6:::1])\n\tby lists.denx.de (Postfix) with ESMTP id 4D6CFC21C93;\n\tTue,  3 Oct 2017 14:35:02 +0000 (UTC)","by lists.denx.de (Postfix, from userid 105)\n\tid 63096C21C93; Tue,  3 Oct 2017 14:35:00 +0000 (UTC)","from mx1.redhat.com (mx1.redhat.com [209.132.183.28])\n\tby lists.denx.de (Postfix) with ESMTPS id E719CC21C51\n\tfor <u-boot@lists.denx.de>; Tue,  3 Oct 2017 14:34:59 +0000 (UTC)","from smtp.corp.redhat.com\n\t(int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11])\n\t(using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby mx1.redhat.com (Postfix) with ESMTPS id 1F1837EAA4;\n\tTue,  3 Oct 2017 14:34:57 +0000 (UTC)","from redhat.com (dhcp-10-20-1-221.bss.redhat.com [10.20.1.221])\n\tby smtp.corp.redhat.com (Postfix) with ESMTPS id 0F9366031B;\n\tTue,  3 Oct 2017 14:34:55 +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,\n\tRCVD_IN_MSPIKE_WL,\n\tSPF_HELO_PASS autolearn=unavailable autolearn_force=no\n\tversion=3.4.0","DMARC-Filter":"OpenDMARC Filter v1.3.2 mx1.redhat.com 1F1837EAA4","Date":"Tue, 3 Oct 2017 10:34:54 -0400","From":"Peter Jones <pjones@redhat.com>","To":"Heinrich Schuchardt <xypron.glpk@gmx.de>","Message-ID":"<20171003143453.3g2moggkwq7umpa4@redhat.com>","References":"<20170913220546.19560-4-robdclark@gmail.com>\n\t<540b3b30-353e-2169-12cb-14a1d8a595be@gmx.de>","MIME-Version":"1.0","Content-Disposition":"inline","In-Reply-To":"<540b3b30-353e-2169-12cb-14a1d8a595be@gmx.de>","User-Agent":"NeoMutt/20170914 (1.9.0)","X-Scanned-By":"MIMEDefang 2.79 on 10.5.11.11","X-Greylist":"Sender IP whitelisted, not delayed by milter-greylist-4.5.16\n\t(mx1.redhat.com [10.5.110.28]); Tue, 03 Oct 2017 14:34:57 +0000 (UTC)","Cc":"U-Boot Mailing List <u-boot@lists.denx.de>","Subject":"Re: [U-Boot] [U-Boot,v3,03/21] efi: add some missing __packed","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>","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>"}}]