public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Heinrich Schuchardt <xypron.glpk@gmx.de>
To: u-boot@lists.denx.de
Subject: [PATCH] image.h: isolate android_image_* functions from tooling
Date: Sun, 8 Mar 2020 19:32:42 +0100	[thread overview]
Message-ID: <27e5e664-e975-e78d-90ba-6a59bda5ef7f@gmx.de> (raw)
In-Reply-To: <20200308001118.2466-1-erosca@de.adit-jv.com>

On 3/8/20 1:11 AM, Eugeniu Rosca wrote:
> On Feb. 16, 2020, Tom reported [1] build failure of U-Boot in-tree
> tooling after applying https://patchwork.ozlabs.org/cover/1229663/
> ("[v6,0/7] rsa: extend rsa_verify() for UEFI secure boot").
>
> Later on, Heinrich stressed the urgency of the issue in
> https://patchwork.ozlabs.org/patch/1250858/#2379069:
>
>   >>>>>>>>>
>   We should finalize the topic as it stops EFI patches from being merged
>   >>>>>>>>>
>
> On the surface, the problem is caused by U-Boot commits [2-3], which
> employed 'u32' in 'include/image.h', while historically U-Boot tooling
> stayed agnostic on the {u,s}{8,16,32} types.
>
> Thanks to Tom, Yamada-san and Heinrich, the following solutions have
> been put head-to-head ('+' pros, '-' cons):
>
>   A. Use an equivalent fixed-size type, i.e. s/u32/uint32_t/ in both
>      android function prototypes (image.h) and definitions (c file):
>      + quick and low-line-count
>      - creates a 'soup' of fixed-sized types in the Android C file
>      - will confuse contributors
>      - is going against Linux kernel best practices [4]
>
>   B. Guard Android functions by '!defined(USE_HOSTCC)' in image.h:
>      + quick and low-line-count
>      + reflects the reality (no android function is used by tooling)
>      + zero impact on other subsystems
>      - ifdeffery may look annoying (pre-existing problem of image.h)
>
>   C. Make {u8,u16,u32} available in U-Boot tooling:
>      + quick and low-line-count
>      + [Yamada-san][5]:
>        * forbidding u32 for tools is questionable to me
>        * Linux kernel and Barebox use {u8,u16,u32} for the tools space
>      - breaks U-Boot tradition?
>      - has larger impact than [A] and [B]
>      - adds type complexity/inconsistency in the tooling space
>
>   D. [Yamada-san] Refactor the headers to minimize the code shared
>      between U-Boot space and tooling space:
>      + probably the long-term solution
>      - high effort
>      - can be seen/done as an incremental update on top of [B]
>
> Looking at the above, [B] looks like the natural way to go forward.
>
> [1] https://patchwork.ozlabs.org/patch/1238245/#2363052
> [2] commit 7f2531502c74c0 ("image: android: Add routine to get dtbo params")
> [3] commit c3bfad825a71ea ("image: android: Add functions for handling dtb field")
> [4] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=e6176fa4728fb6d
>      ("checkpatch: add --strict warning for c99 fixed size typedefs : int<size>_t")
> [5] https://patchwork.ozlabs.org/patch/1238245/#2363340
>
> Cc: Masahiro Yamada <masahiroy@kernel.org>
> Cc: Heinrich Schuchardt <xypron.glpk@gmx.de>
> Cc: Sam Protsenko <joe.skb7@gmail.com>
> Cc: Lokesh Vutla <lokeshvutla@ti.com>
> Cc: Simon Glass <sjg@chromium.org>
> Cc: AKASHI Takahiro <takahiro.akashi@linaro.org>
> Reported-by: Tom Rini <trini@konsulko.com>
> Signed-off-by: Eugeniu Rosca <erosca@de.adit-jv.com>

The patch is sufficient to overcome the build errors occurring with
Takahiro's RSA and secure boot patches.
https://patchwork.ozlabs.org/project/uboot/list/?series=&submitter=61166

Tested-by: Heinrich Schuchardt <xpyron.glpk@gmx.de>

  reply	other threads:[~2020-03-08 18:32 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-08  0:11 [PATCH] image.h: isolate android_image_* functions from tooling Eugeniu Rosca
2020-03-08 18:32 ` Heinrich Schuchardt [this message]
2020-03-12 16:48 ` Tom Rini

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=27e5e664-e975-e78d-90ba-6a59bda5ef7f@gmx.de \
    --to=xypron.glpk@gmx.de \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox