All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PULL 0/6] efi patch queue 2017-07-03
@ 2017-07-03 14:05 Alexander Graf
  2017-07-03 21:11 ` Tom Rini
  0 siblings, 1 reply; 9+ messages in thread
From: Alexander Graf @ 2017-07-03 14:05 UTC (permalink / raw)
  To: u-boot

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 at 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(-)

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [U-Boot] [PULL 0/6] efi patch queue 2017-07-03
  2017-07-03 14:05 [U-Boot] [PULL 0/6] efi patch queue 2017-07-03 Alexander Graf
@ 2017-07-03 21:11 ` Tom Rini
  2017-07-03 22:12   ` [U-Boot] [PATCH v2 1/1] efi_loader: abort on unsupported relocation type Heinrich Schuchardt
  2017-07-04  5:27   ` [U-Boot] [PULL 0/6] efi patch queue 2017-07-03 Alexander Graf
  0 siblings, 2 replies; 9+ messages in thread
From: Tom Rini @ 2017-07-03 21:11 UTC (permalink / raw)
  To: u-boot

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 at gmx.de <xypron.glpk@gmx.de>
Date:   Sun Jun 25 20:45:36 2017 +0200

    efi_loader: abort on unsupported relocation type


-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20170703/ad10f269/attachment.sig>

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [U-Boot] [PATCH v2 1/1] efi_loader: abort on unsupported relocation type
  2017-07-03 21:11 ` Tom Rini
@ 2017-07-03 22:12   ` Heinrich Schuchardt
  2017-07-04  5:27   ` [U-Boot] [PULL 0/6] efi patch queue 2017-07-03 Alexander Graf
  1 sibling, 0 replies; 9+ messages in thread
From: Heinrich Schuchardt @ 2017-07-03 22:12 UTC (permalink / raw)
  To: u-boot

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,
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [U-Boot] [PULL 0/6] efi patch queue 2017-07-03
  2017-07-03 21:11 ` Tom Rini
  2017-07-03 22:12   ` [U-Boot] [PATCH v2 1/1] efi_loader: abort on unsupported relocation type Heinrich Schuchardt
@ 2017-07-04  5:27   ` Alexander Graf
  2017-07-04  6:00     ` Heinrich Schuchardt
  2017-07-04 11:24     ` Tom Rini
  1 sibling, 2 replies; 9+ messages in thread
From: Alexander Graf @ 2017-07-04  5:27 UTC (permalink / raw)
  To: u-boot



> 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

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [U-Boot] [PULL 0/6] efi patch queue 2017-07-03
  2017-07-04  5:27   ` [U-Boot] [PULL 0/6] efi patch queue 2017-07-03 Alexander Graf
@ 2017-07-04  6:00     ` Heinrich Schuchardt
  2017-07-04  7:00       ` Alexander Graf
  2017-07-04 11:24     ` Tom Rini
  1 sibling, 1 reply; 9+ messages in thread
From: Heinrich Schuchardt @ 2017-07-04  6:00 UTC (permalink / raw)
  To: u-boot

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

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [U-Boot] [PULL 0/6] efi patch queue 2017-07-03
  2017-07-04  6:00     ` Heinrich Schuchardt
@ 2017-07-04  7:00       ` Alexander Graf
  0 siblings, 0 replies; 9+ messages in thread
From: Alexander Graf @ 2017-07-04  7:00 UTC (permalink / raw)
  To: u-boot



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

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [U-Boot] [PULL 0/6] efi patch queue 2017-07-03
  2017-07-04  5:27   ` [U-Boot] [PULL 0/6] efi patch queue 2017-07-03 Alexander Graf
  2017-07-04  6:00     ` Heinrich Schuchardt
@ 2017-07-04 11:24     ` Tom Rini
  2017-07-04 11:51       ` Alexander Graf
  1 sibling, 1 reply; 9+ messages in thread
From: Tom Rini @ 2017-07-04 11:24 UTC (permalink / raw)
  To: u-boot

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.

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20170704/ed25be65/attachment.sig>

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [U-Boot] [PULL 0/6] efi patch queue 2017-07-03
  2017-07-04 11:24     ` Tom Rini
@ 2017-07-04 11:51       ` Alexander Graf
  2017-07-04 11:59         ` Tom Rini
  0 siblings, 1 reply; 9+ messages in thread
From: Alexander Graf @ 2017-07-04 11:51 UTC (permalink / raw)
  To: u-boot



> 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

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [U-Boot] [PULL 0/6] efi patch queue 2017-07-03
  2017-07-04 11:51       ` Alexander Graf
@ 2017-07-04 11:59         ` Tom Rini
  0 siblings, 0 replies; 9+ messages in thread
From: Tom Rini @ 2017-07-04 11:59 UTC (permalink / raw)
  To: u-boot

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.

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20170704/a41a417d/attachment.sig>

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2017-07-04 11:59 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-07-03 14:05 [U-Boot] [PULL 0/6] efi patch queue 2017-07-03 Alexander Graf
2017-07-03 21:11 ` Tom Rini
2017-07-03 22:12   ` [U-Boot] [PATCH v2 1/1] efi_loader: abort on unsupported relocation type Heinrich Schuchardt
2017-07-04  5:27   ` [U-Boot] [PULL 0/6] efi patch queue 2017-07-03 Alexander Graf
2017-07-04  6:00     ` Heinrich Schuchardt
2017-07-04  7:00       ` Alexander Graf
2017-07-04 11:24     ` Tom Rini
2017-07-04 11:51       ` Alexander Graf
2017-07-04 11:59         ` Tom Rini

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.