Re: [U-Boot] [PATCH 03/23] efi_loader: support 16 protocols per efi_object

2017-09-02 Thread Alexander Graf


> Am 02.09.2017 um 20:14 schrieb Rob Clark :
> 
>> On Thu, Aug 31, 2017 at 10:01 AM, Alexander Graf  wrote:
>>> On 08/27/2017 12:51 AM, Heinrich Schuchardt wrote:
>>> 
>>> 8 protocols per efi_object is insufficient for iPXE.
>>> 
>>> Signed-off-by: Heinrich Schuchardt 
>>> ---
>>>  include/efi_loader.h | 4 ++--
>>>  1 file changed, 2 insertions(+), 2 deletions(-)
>>> 
>>> diff --git a/include/efi_loader.h b/include/efi_loader.h
>>> index 6f71a6202b..e8fb4fbb0a 100644
>>> --- a/include/efi_loader.h
>>> +++ b/include/efi_loader.h
>>> @@ -99,8 +99,8 @@ struct efi_handler {
>>>  struct efi_object {
>>>/* Every UEFI object is part of a global object list */
>>>struct list_head link;
>>> -   /* We support up to 8 "protocols" an object can be accessed
>>> through */
>>> -   struct efi_handler protocols[8];
>>> +   /* We support up to 16 "protocols" an object can be accessed
>>> through */
>>> +   struct efi_handler protocols[16];
>> 
>> 
>> Can you try to convert it into a list instead? Leif tried to make the UEFI
>> Shell work and stumbled over the same limitation, so I guess a static array
>> won't cut it for long.
>> 
> 
> Can we go w/ fixed 16 protocols length for now?  A list is a
> definitely a better option, and it will be easier after "efi_loader:
> refactor boot device and loaded_image handling" (which gets rid of the
> statically initialized efi_object's).  After that we can drop the
> fixed length array and add an 'void append_protocol(efiobj, guid,
> handle)'  helper fairly easily.

Sure, of course :)

Alex

> 
> BR,
> -R

___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH 03/23] efi_loader: support 16 protocols per efi_object

2017-09-02 Thread Rob Clark
On Thu, Aug 31, 2017 at 10:01 AM, Alexander Graf  wrote:
> On 08/27/2017 12:51 AM, Heinrich Schuchardt wrote:
>>
>> 8 protocols per efi_object is insufficient for iPXE.
>>
>> Signed-off-by: Heinrich Schuchardt 
>> ---
>>   include/efi_loader.h | 4 ++--
>>   1 file changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/include/efi_loader.h b/include/efi_loader.h
>> index 6f71a6202b..e8fb4fbb0a 100644
>> --- a/include/efi_loader.h
>> +++ b/include/efi_loader.h
>> @@ -99,8 +99,8 @@ struct efi_handler {
>>   struct efi_object {
>> /* Every UEFI object is part of a global object list */
>> struct list_head link;
>> -   /* We support up to 8 "protocols" an object can be accessed
>> through */
>> -   struct efi_handler protocols[8];
>> +   /* We support up to 16 "protocols" an object can be accessed
>> through */
>> +   struct efi_handler protocols[16];
>
>
> Can you try to convert it into a list instead? Leif tried to make the UEFI
> Shell work and stumbled over the same limitation, so I guess a static array
> won't cut it for long.
>

Can we go w/ fixed 16 protocols length for now?  A list is a
definitely a better option, and it will be easier after "efi_loader:
refactor boot device and loaded_image handling" (which gets rid of the
statically initialized efi_object's).  After that we can drop the
fixed length array and add an 'void append_protocol(efiobj, guid,
handle)'  helper fairly easily.

BR,
-R
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH 03/23] efi_loader: support 16 protocols per efi_object

2017-09-01 Thread Alexander Graf



On 01.09.17 03:45, Heinrich Schuchardt wrote:

On 08/31/2017 04:01 PM, Alexander Graf wrote:

On 08/27/2017 12:51 AM, Heinrich Schuchardt wrote:

8 protocols per efi_object is insufficient for iPXE.

Signed-off-by: Heinrich Schuchardt 
---
   include/efi_loader.h | 4 ++--
   1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/include/efi_loader.h b/include/efi_loader.h
index 6f71a6202b..e8fb4fbb0a 100644
--- a/include/efi_loader.h
+++ b/include/efi_loader.h
@@ -99,8 +99,8 @@ struct efi_handler {
   struct efi_object {
   /* Every UEFI object is part of a global object list */
   struct list_head link;
-/* We support up to 8 "protocols" an object can be accessed
through */
-struct efi_handler protocols[8];
+/* We support up to 16 "protocols" an object can be accessed
through */
+struct efi_handler protocols[16];


Can you try to convert it into a list instead? Leif tried to make the
UEFI Shell work and stumbled over the same limitation, so I guess a
static array won't cut it for long.


Alex




Hello Alex,

is it safe to call malloc and free before efi_exit_boot_services?


Yes :). Before exiting boot services we're basically in normal U-Boot 
space with a U-Boot owned malloc region that we can allocate from.



Currently we do not check that boottime services are not called after
efi_exit_boot_services. Shouldn't every call to boottime services fail


Yes, IIUC it's simply illegal to call them afterwards.


thereafter? The spec says: "After successfully calling
ExitBootServices(), all boot services in the system are terminated."


I'm not sure. I'd be very surprised to see a payload actually call any 
boot service after exiting boot services. Runtime services is a 
different question, but those are very special anyway.



We definitively do not want to call malloc at runtime because all
available memory (except for EFI_MEMORY_RUNTIME) is managed by the
operating system.


Yes, but efi objects only exist during boot time. Runtime services don't 
expose protocols or objects.



Alex
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH 03/23] efi_loader: support 16 protocols per efi_object

2017-08-31 Thread Heinrich Schuchardt
On 08/31/2017 04:01 PM, Alexander Graf wrote:
> On 08/27/2017 12:51 AM, Heinrich Schuchardt wrote:
>> 8 protocols per efi_object is insufficient for iPXE.
>>
>> Signed-off-by: Heinrich Schuchardt 
>> ---
>>   include/efi_loader.h | 4 ++--
>>   1 file changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/include/efi_loader.h b/include/efi_loader.h
>> index 6f71a6202b..e8fb4fbb0a 100644
>> --- a/include/efi_loader.h
>> +++ b/include/efi_loader.h
>> @@ -99,8 +99,8 @@ struct efi_handler {
>>   struct efi_object {
>>   /* Every UEFI object is part of a global object list */
>>   struct list_head link;
>> -/* We support up to 8 "protocols" an object can be accessed
>> through */
>> -struct efi_handler protocols[8];
>> +/* We support up to 16 "protocols" an object can be accessed
>> through */
>> +struct efi_handler protocols[16];
> 
> Can you try to convert it into a list instead? Leif tried to make the
> UEFI Shell work and stumbled over the same limitation, so I guess a
> static array won't cut it for long.
> 
> 
> Alex
> 
> 

Hello Alex,

is it safe to call malloc and free before efi_exit_boot_services?

Currently we do not check that boottime services are not called after
efi_exit_boot_services. Shouldn't every call to boottime services fail
thereafter? The spec says: "After successfully calling
ExitBootServices(), all boot services in the system are terminated."

We definitively do not want to call malloc at runtime because all
available memory (except for EFI_MEMORY_RUNTIME) is managed by the
operating system.

Best regards

Heinrich

___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH 03/23] efi_loader: support 16 protocols per efi_object

2017-08-31 Thread Alexander Graf

On 08/27/2017 12:51 AM, Heinrich Schuchardt wrote:

8 protocols per efi_object is insufficient for iPXE.

Signed-off-by: Heinrich Schuchardt 
---
  include/efi_loader.h | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/include/efi_loader.h b/include/efi_loader.h
index 6f71a6202b..e8fb4fbb0a 100644
--- a/include/efi_loader.h
+++ b/include/efi_loader.h
@@ -99,8 +99,8 @@ struct efi_handler {
  struct efi_object {
/* Every UEFI object is part of a global object list */
struct list_head link;
-   /* We support up to 8 "protocols" an object can be accessed through */
-   struct efi_handler protocols[8];
+   /* We support up to 16 "protocols" an object can be accessed through */
+   struct efi_handler protocols[16];


Can you try to convert it into a list instead? Leif tried to make the 
UEFI Shell work and stumbled over the same limitation, so I guess a 
static array won't cut it for long.



Alex

___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH 03/23] efi_loader: support 16 protocols per efi_object

2017-08-31 Thread Simon Glass
On 27 August 2017 at 06:51, Heinrich Schuchardt  wrote:
> 8 protocols per efi_object is insufficient for iPXE.
>
> Signed-off-by: Heinrich Schuchardt 
> ---
>  include/efi_loader.h | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)

Reviewed-by: Simon Glass 
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


[U-Boot] [PATCH 03/23] efi_loader: support 16 protocols per efi_object

2017-08-26 Thread Heinrich Schuchardt
8 protocols per efi_object is insufficient for iPXE.

Signed-off-by: Heinrich Schuchardt 
---
 include/efi_loader.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/include/efi_loader.h b/include/efi_loader.h
index 6f71a6202b..e8fb4fbb0a 100644
--- a/include/efi_loader.h
+++ b/include/efi_loader.h
@@ -99,8 +99,8 @@ struct efi_handler {
 struct efi_object {
/* Every UEFI object is part of a global object list */
struct list_head link;
-   /* We support up to 8 "protocols" an object can be accessed through */
-   struct efi_handler protocols[8];
+   /* We support up to 16 "protocols" an object can be accessed through */
+   struct efi_handler protocols[16];
/* The object spawner can either use this for data or as identifier */
void *handle;
 };
-- 
2.14.1

___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot