[U-Boot] [PULL 0/6] efi patch queue 2017-07-03

Hi Tom,
This is my current patch queue for efi. Please pull.
Alex
The following changes since commit 8d6040c725bfa40fba1bd6b5f356ee713c1ac7d1:
pico-imx7d: Remove bouncing email (2017-06-29 21:30:16 -0400)
are available in the git repository at:
git://github.com/agraf/u-boot.git tags/signed-efi-next
for you to fetch changes up to a88456645ec60570d37c8be5877614a16467b790:
efi_loader: efi_handle_protocol set attributes (2017-07-03 14:41:14 +0200)
---------------------------------------------------------------- Patch queue for efi - 2017-07-03
Highlights this time: bugfixes. With these changes, OpenBSD should be more happy.
---------------------------------------------------------------- Alexander Graf (1): efi_loader: Add check for fallback fdt memory reservation
Jonathan Gray (2): efi_loader: run CreateEvent() notify function based on flags efi_loader: check CreateEvent() parameters
Masahiro Yamada (1): efi_loader: add static to local functions
xypron.glpk@gmx.de (2): efi_loader: abort on unsupported relocation type efi_loader: efi_handle_protocol set attributes
cmd/bootefi.c | 6 ++++++ include/efi_api.h | 3 +++ lib/efi_loader/efi_boottime.c | 38 ++++++++++++++++++++++++++------------ lib/efi_loader/efi_image_loader.c | 10 ++++++++-- 4 files changed, 43 insertions(+), 14 deletions(-)

On Mon, Jul 03, 2017 at 04:05:56PM +0200, Alexander Graf wrote:
Hi Tom,
This is my current patch queue for efi. Please pull.
Alex
The following changes since commit 8d6040c725bfa40fba1bd6b5f356ee713c1ac7d1:
pico-imx7d: Remove bouncing email (2017-06-29 21:30:16 -0400)
are available in the git repository at:
git://github.com/agraf/u-boot.git tags/signed-efi-next
for you to fetch changes up to a88456645ec60570d37c8be5877614a16467b790:
efi_loader: efi_handle_protocol set attributes (2017-07-03 14:41:14 +0200)
This gives me: w+(orangepi_plus) ../lib/efi_loader/efi_image_loader.c: In function ?efi_load_pe?: w+(orangepi_plus) ../lib/efi_loader/efi_image_loader.c:177:18: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
On tons and tons of boards, with gcc-6.3.
Its bisects down to: commit 2689085257feda5ed96f84c1c5b595553e38eac7 Author: xypron.glpk@gmx.de xypron.glpk@gmx.de Date: Sun Jun 25 20:45:36 2017 +0200
efi_loader: abort on unsupported relocation type

From: "xypron.glpk@gmx.de" xypron.glpk@gmx.de
If a relocation type is not supported loading the EFI binary should be aborted.
Writing a message only is insufficient.
Signed-off-by: Heinrich Schuchardt xypron.glpk@gmx.de --- v2 Use (uintptr_t) to convert a pointer to an integer. This avoids 'warning: cast from pointer to integer of different size' on 32bit systems. --- lib/efi_loader/efi_image_loader.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/lib/efi_loader/efi_image_loader.c b/lib/efi_loader/efi_image_loader.c index 3262d76bca..607feff4e9 100644 --- a/lib/efi_loader/efi_image_loader.c +++ b/lib/efi_loader/efi_image_loader.c @@ -26,7 +26,7 @@ efi_status_t EFIAPI efi_return_handle(void *handle, efi_guid_t *protocol, return EFI_SUCCESS; }
-static void efi_loader_relocate(const IMAGE_BASE_RELOCATION *rel, +static efi_status_t efi_loader_relocate(const IMAGE_BASE_RELOCATION *rel, unsigned long rel_size, void *efi_reloc) { const IMAGE_BASE_RELOCATION *end; @@ -63,11 +63,13 @@ static void efi_loader_relocate(const IMAGE_BASE_RELOCATION *rel, default: printf("Unknown Relocation off %x type %x\n", offset, type); + return EFI_LOAD_ERROR; } relocs++; } rel = (const IMAGE_BASE_RELOCATION *)relocs; } + return EFI_SUCCESS; }
void __weak invalidate_icache_all(void) @@ -171,7 +173,11 @@ void *efi_load_pe(void *efi, struct efi_loaded_image *loaded_image_info) }
/* Run through relocations */ - efi_loader_relocate(rel, rel_size, efi_reloc); + if (EFI_SUCCESS != efi_loader_relocate(rel, rel_size, efi_reloc)) { + efi_free_pages((uintptr_t) efi_reloc, + (virt_size + EFI_PAGE_MASK) >> EFI_PAGE_SHIFT); + return NULL; + }
/* Flush cache */ flush_cache((ulong)efi_reloc,

Am 03.07.2017 um 23:11 schrieb Tom Rini trini@konsulko.com:
On Mon, Jul 03, 2017 at 04:05:56PM +0200, Alexander Graf wrote:
Hi Tom,
This is my current patch queue for efi. Please pull.
Alex
The following changes since commit 8d6040c725bfa40fba1bd6b5f356ee713c1ac7d1:
pico-imx7d: Remove bouncing email (2017-06-29 21:30:16 -0400)
are available in the git repository at:
git://github.com/agraf/u-boot.git tags/signed-efi-next
for you to fetch changes up to a88456645ec60570d37c8be5877614a16467b790:
efi_loader: efi_handle_protocol set attributes (2017-07-03 14:41:14 +0200)
This gives me: w+(orangepi_plus) ../lib/efi_loader/efi_image_loader.c: In function ?efi_load_pe?: w+(orangepi_plus) ../lib/efi_loader/efi_image_loader.c:177:18: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
On tons and tons of boards, with gcc-6.3.
Do you know why Travis didn't catch this? Do we need to update the gcc version used there maybe?
Alex

On 07/04/2017 07:27 AM, Alexander Graf wrote:
Am 03.07.2017 um 23:11 schrieb Tom Rini trini@konsulko.com:
On Mon, Jul 03, 2017 at 04:05:56PM +0200, Alexander Graf wrote:
Hi Tom,
This is my current patch queue for efi. Please pull.
Alex
The following changes since commit 8d6040c725bfa40fba1bd6b5f356ee713c1ac7d1:
pico-imx7d: Remove bouncing email (2017-06-29 21:30:16 -0400)
are available in the git repository at:
git://github.com/agraf/u-boot.git tags/signed-efi-next
for you to fetch changes up to a88456645ec60570d37c8be5877614a16467b790:
efi_loader: efi_handle_protocol set attributes (2017-07-03 14:41:14 +0200)
This gives me: w+(orangepi_plus) ../lib/efi_loader/efi_image_loader.c: In function ?efi_load_pe?: w+(orangepi_plus) ../lib/efi_loader/efi_image_loader.c:177:18: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
On tons and tons of boards, with gcc-6.3.
Do you know why Travis didn't catch this? Do we need to update the gcc version used there maybe?
Alex
The problem was only detectable when building a 32bit target.
So you would have to teach Travis to build on 32bit and on 64bit.
Best regards
Heinrich

On 04.07.17 08:00, Heinrich Schuchardt wrote:
On 07/04/2017 07:27 AM, Alexander Graf wrote:
Am 03.07.2017 um 23:11 schrieb Tom Rini trini@konsulko.com:
On Mon, Jul 03, 2017 at 04:05:56PM +0200, Alexander Graf wrote:
Hi Tom,
This is my current patch queue for efi. Please pull.
Alex
The following changes since commit 8d6040c725bfa40fba1bd6b5f356ee713c1ac7d1:
pico-imx7d: Remove bouncing email (2017-06-29 21:30:16 -0400)
are available in the git repository at:
git://github.com/agraf/u-boot.git tags/signed-efi-next
for you to fetch changes up to a88456645ec60570d37c8be5877614a16467b790:
efi_loader: efi_handle_protocol set attributes (2017-07-03 14:41:14 +0200)
This gives me: w+(orangepi_plus) ../lib/efi_loader/efi_image_loader.c: In function ?efi_load_pe?: w+(orangepi_plus) ../lib/efi_loader/efi_image_loader.c:177:18: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
On tons and tons of boards, with gcc-6.3.
Do you know why Travis didn't catch this? Do we need to update the gcc version used there maybe?
Alex
The problem was only detectable when building a 32bit target.
So you would have to teach Travis to build on 32bit and on 64bit.
Travis builds 32bit targets today :). It even runtime tests them through QEMU with efi_loader.
Alex

On Tue, Jul 04, 2017 at 07:27:39AM +0200, Alexander Graf wrote:
Am 03.07.2017 um 23:11 schrieb Tom Rini trini@konsulko.com:
On Mon, Jul 03, 2017 at 04:05:56PM +0200, Alexander Graf wrote:
Hi Tom,
This is my current patch queue for efi. Please pull.
Alex
The following changes since commit 8d6040c725bfa40fba1bd6b5f356ee713c1ac7d1:
pico-imx7d: Remove bouncing email (2017-06-29 21:30:16 -0400)
are available in the git repository at:
git://github.com/agraf/u-boot.git tags/signed-efi-next
for you to fetch changes up to a88456645ec60570d37c8be5877614a16467b790:
efi_loader: efi_handle_protocol set attributes (2017-07-03 14:41:14 +0200)
This gives me: w+(orangepi_plus) ../lib/efi_loader/efi_image_loader.c: In function ?efi_load_pe?: w+(orangepi_plus) ../lib/efi_loader/efi_image_loader.c:177:18: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
On tons and tons of boards, with gcc-6.3.
Do you know why Travis didn't catch this? Do we need to update the gcc version used there maybe?
Are you sure it didn't catch it? It's a warning only and that doesn't cause the job to fail.

Am 04.07.2017 um 13:24 schrieb Tom Rini trini@konsulko.com:
On Tue, Jul 04, 2017 at 07:27:39AM +0200, Alexander Graf wrote:
Am 03.07.2017 um 23:11 schrieb Tom Rini trini@konsulko.com:
On Mon, Jul 03, 2017 at 04:05:56PM +0200, Alexander Graf wrote:
Hi Tom,
This is my current patch queue for efi. Please pull.
Alex
The following changes since commit 8d6040c725bfa40fba1bd6b5f356ee713c1ac7d1:
pico-imx7d: Remove bouncing email (2017-06-29 21:30:16 -0400)
are available in the git repository at:
git://github.com/agraf/u-boot.git tags/signed-efi-next
for you to fetch changes up to a88456645ec60570d37c8be5877614a16467b790:
efi_loader: efi_handle_protocol set attributes (2017-07-03 14:41:14 +0200)
This gives me: w+(orangepi_plus) ../lib/efi_loader/efi_image_loader.c: In function ?efi_load_pe?: w+(orangepi_plus) ../lib/efi_loader/efi_image_loader.c:177:18: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
On tons and tons of boards, with gcc-6.3.
Do you know why Travis didn't catch this? Do we need to update the gcc version used there maybe?
Are you sure it didn't catch it? It's a warning only and that doesn't cause the job to fail.
Ah, so that's why! Maybe we should start to introduce -Werror by default?
Alex

On Tue, Jul 04, 2017 at 01:51:47PM +0200, Alexander Graf wrote:
Am 04.07.2017 um 13:24 schrieb Tom Rini trini@konsulko.com:
On Tue, Jul 04, 2017 at 07:27:39AM +0200, Alexander Graf wrote:
Am 03.07.2017 um 23:11 schrieb Tom Rini trini@konsulko.com:
On Mon, Jul 03, 2017 at 04:05:56PM +0200, Alexander Graf wrote:
Hi Tom,
This is my current patch queue for efi. Please pull.
Alex
The following changes since commit 8d6040c725bfa40fba1bd6b5f356ee713c1ac7d1:
pico-imx7d: Remove bouncing email (2017-06-29 21:30:16 -0400)
are available in the git repository at:
git://github.com/agraf/u-boot.git tags/signed-efi-next
for you to fetch changes up to a88456645ec60570d37c8be5877614a16467b790:
efi_loader: efi_handle_protocol set attributes (2017-07-03 14:41:14 +0200)
This gives me: w+(orangepi_plus) ../lib/efi_loader/efi_image_loader.c: In function ?efi_load_pe?: w+(orangepi_plus) ../lib/efi_loader/efi_image_loader.c:177:18: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
On tons and tons of boards, with gcc-6.3.
Do you know why Travis didn't catch this? Do we need to update the gcc version used there maybe?
Are you sure it didn't catch it? It's a warning only and that doesn't cause the job to fail.
Ah, so that's why! Maybe we should start to introduce -Werror by default?
I've been toying with that idea but first we need to fix the warnings that we have ;) And then make it easy enough to disable during local development.
participants (3)
-
Alexander Graf
-
Heinrich Schuchardt
-
Tom Rini