Re: [edk2-devel] [PATCH v1 1/1] ArmPkg: CpuDxe: Sync GCD Capabilities With Page Table Attributes

2023-05-15 Thread Ni, Ray
All,
Can you check if the meeting time is ok for you?

It will be in this week:
* PDT Wednesday 07:00
* Paris Wednesday 16:00
* Shanghai Wednesday 22:00


From: devel@edk2.groups.io  on behalf of Taylor Beebe 

Sent: Thursday, May 11, 2023 0:10
To: devel@edk2.groups.io; o...@linux.microsoft.com; Ard Biesheuvel; Kinney, 
Michael D
Cc: Ni, Ray; Leif Lindholm; Ard Biesheuvel; Sami Mujawar; Michael Kubacki; Sean 
Brogan
Subject: Re: [edk2-devel] [PATCH v1 1/1] ArmPkg: CpuDxe: Sync GCD Capabilities 
With Page Table Attributes

Can we schedule the meeting for Wednesday 5/17? I will be out the
following week and would like to attend.

Thanks :)

On 5/9/2023 7:59 AM, Oliver Smith-Denny wrote:
> On 5/8/2023 11:59 PM, Ard Biesheuvel wrote:
>> On Tue, 9 May 2023 at 04:04, Kinney, Michael D
>>  wrote:
>>>
>>> I would prefer next week as well.
>>>
>>> Mike
>>>
>>
>> Next week, i can only do Wednesday. The week after (22-26), the time
>> slot works for me on any day of the week.
>>
>
> Weds works from our side, the week after also works perfectly well
> any day. Thanks for the flexibility and willingness to meet.
>
> For reference for this specific patch, this bz may help cache in
> some info: https://bugzilla.tianocore.org/show_bug.cgi?id=753. The
> mail links are largely dead, of course, but can be found on other
> mailing list retention sites (maybe in the future we will have PRs
> and discussions to reference :).
>
> Thanks,
> Oliver
>
>
>
>
>








-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#104911): https://edk2.groups.io/g/devel/message/104911
Mute This Topic: https://groups.io/mt/98505340/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: 
https://edk2.groups.io/g/devel/leave/9847357/21656/1706620634/xyzzy 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [PATCH v2 1/1] MdePkg/Base.h: Simply alignment expressions

2023-05-15 Thread Pedro Falcato
On Tue, May 16, 2023 at 2:46 AM gaoliming via groups.io
 wrote:
>
> Pedro:
>
> > -邮件原件-
> > 发件人: devel@edk2.groups.io  代表 Pedro Falcato
> > 发送时间: 2023年5月15日 23:15
> > 收件人: devel@edk2.groups.io
> > 抄送: Pedro Falcato ; Michael D Kinney
> > ; Liming Gao ;
> > Zhiguang Liu ; Marvin Häuser
> > 
> > 主题: [edk2-devel] [PATCH v2 1/1] MdePkg/Base.h: Simply alignment
> > expressions
> >
> > Simplify ALIGN_VALUE and ALIGN_VALUE_ADDEND into simpler expressions.
> >
> > ALIGN_VALUE can simply be a (value + (align - 1)) & ~align
> > expression, which works for any power of 2 alignment and generates
> > smaller code sequences. For instance:
> >   ALIGN_VALUE(15, 16) = (15 + 15) & ~16 = 16
> >   ALIGN_VALUE(16, 16) = (16 + 15) & ~16 = 16
> >
> > Old codegen:
> >   movq%rdi, %rax
> >   negq%rax
> >   andl$15, %eax
> >   addq%rdi, %rax
> >
> > New codegen:
> >   leaq15(%rdi), %rax
> >   andq$-16, %rax
> >
> > ALIGN_VALUE_ADDEND can simply use a bitwise NOT of Value to get the
> > addend for alignment, as, for instance:
> >   ~15 & (16 - 1) = 1
> >   15 + 1 = 16
> >
>
> >   ~15 & (16 - 1) = 1
> Its value should be zero, not 1. I also verify the updated ALIGN_VALUE_ADDEND.
> Its value is incorrect. Please double check.

Hi Liming, you're 100% right. There was a mixup when we were
discussing this optimization, and I got the mental calculations wrong
there.
Two's complement is definitely what we want, as one's complement is
always off by one (from what we want).

So negation (-) works beautifully, as seen in the old codegen (we
figured this out from the compiler's output).

Sent a v3.

-- 
Pedro


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#104910): https://edk2.groups.io/g/devel/message/104910
Mute This Topic: https://groups.io/mt/98918981/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




[edk2-devel] [PATCH v3 1/1] MdePkg/Base.h: Simplify alignment expressions

2023-05-15 Thread Pedro Falcato
Simplify ALIGN_VALUE and ALIGN_VALUE_ADDEND into simpler expressions.

ALIGN_VALUE can simply be a (value + (align - 1)) & ~align
expression, which works for any power of 2 alignment and generates
smaller code sequences. For instance:
ALIGN_VALUE(15, 16) = (15 + 15) & ~16 = 16
ALIGN_VALUE(16, 16) = (16 + 15) & ~16 = 16

Old codegen:
movq%rdi, %rax
negq%rax
andl$15, %eax
addq%rdi, %rax

New codegen:
leaq15(%rdi), %rax
andq$-16, %rax

ALIGN_VALUE_ADDEND can simply use the negation of Value to get the
addend for alignment, as, for instance:
-15 & (16 - 1) = 1
15 + 1 = 16

This change does not necessarily affect the end result, as the GCC and
clang compilers were already able to see through things and optimize
them into optimal instruction sequences, in the ALIGN_VALUE_ADDEND case.

Cc: Michael D Kinney 
Cc: Liming Gao 
Cc: Zhiguang Liu 
Cc: Marvin Häuser 
Signed-off-by: Pedro Falcato 
---
Changes:
- Correct the ADDEND macro to use negation and not a binary NOT (thanks 
Liming!)
 MdePkg/Include/Base.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/MdePkg/Include/Base.h b/MdePkg/Include/Base.h
index 6597e441a6e2..a070593a360d 100644
--- a/MdePkg/Include/Base.h
+++ b/MdePkg/Include/Base.h
@@ -931,7 +931,7 @@ STATIC_ASSERT (ALIGNOF (__VERIFY_INT32_ENUM_SIZE) == sizeof 
(__VERIFY_INT32_ENUM
 
   @return  Addend to round Value up to alignment boundary Alignment.
 **/
-#define ALIGN_VALUE_ADDEND(Value, Alignment)  (((Alignment) - (Value)) & 
((Alignment) - 1U))
+#define ALIGN_VALUE_ADDEND(Value, Alignment)  ((-(Value)) & ((Alignment) - 1U))
 
 /**
   Rounds a value up to the next boundary using a specified alignment.
@@ -945,7 +945,7 @@ STATIC_ASSERT (ALIGNOF (__VERIFY_INT32_ENUM_SIZE) == sizeof 
(__VERIFY_INT32_ENUM
   @return  A value up to the next boundary.
 
 **/
-#define ALIGN_VALUE(Value, Alignment)  ((Value) + ALIGN_VALUE_ADDEND (Value, 
Alignment))
+#define ALIGN_VALUE(Value, Alignment)  (((Value) + ((Alignment) - 1U)) & 
~(Alignment))
 
 /**
   Adjust a pointer by adding the minimum offset required for it to be aligned 
on
-- 
2.40.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#104909): https://edk2.groups.io/g/devel/message/104909
Mute This Topic: https://groups.io/mt/98918938/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




回复: [edk2-devel] Event: TianoCore Bug Triage - APAC / NAMO - Tuesday, May 16, 2023 #cal-reminder

2023-05-15 Thread gaoliming via groups.io
Few issues are submitted this week. I will cancel the meeting. 

 

Thanks

Liming

发件人: devel@edk2.groups.io  代表 Group Notification
发送时间: 2023年5月16日 9:30
收件人: devel@edk2.groups.io
主题: [edk2-devel] Event: TianoCore Bug Triage - APAC / NAMO - Tuesday, May 16, 
2023 #cal-reminder

 

Reminder: TianoCore Bug Triage - APAC / NAMO 

When:
Tuesday, May 16, 2023
6:30pm to 7:30pm
(UTC-07:00) America/Los Angeles 

Where:
https://teams.microsoft.com/l/meetup-join/19%3ameeting_OTk1YzJhN2UtOGQwNi00NjY4LWEwMTktY2JiODRlYTY1NmY0%40thread.v2/0?context=%7b%22Tid%22%3a%2246c98d88-e344-4ed4-8496-4ed7712e255d%22%2c%22Oid%22%3a%226e4ce4c4-1242-431b-9a51-92cd01a5df3c%22%7d
 

Organizer: Liming Gao gaolim...@byosoft.com.cn 

  

View Event  

Description:

TianoCore Bug Triage - APAC / NAMO

Hosted by Liming Gao

 


 

Microsoft Teams meeting 

Join on your computer or mobile app 

 

 Click here to join the meeting 

Join with a video conferencing device 

te...@conf.intel.com   

Video Conference ID: 116 062 094 0 

 

 Alternate VTC dialing instructions 

Or call in (audio only) 

  +1 916-245-6934,,77463821#   United States, 
Sacramento 

Phone Conference ID: 774 638 21# 

 

 Find a local number |   Reset 
PIN 

  Learn More |  

 Meeting options 





-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#104908): https://edk2.groups.io/g/devel/message/104908
Mute This Topic: https://groups.io/mt/98918499/21656
Mute #cal-reminder:https://edk2.groups.io/g/devel/mutehashtag/cal-reminder
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




回复: [edk2-devel] [PATCH v2 1/1] MdePkg/Base.h: Simply alignment expressions

2023-05-15 Thread gaoliming via groups.io
Pedro:

> -邮件原件-
> 发件人: devel@edk2.groups.io  代表 Pedro Falcato
> 发送时间: 2023年5月15日 23:15
> 收件人: devel@edk2.groups.io
> 抄送: Pedro Falcato ; Michael D Kinney
> ; Liming Gao ;
> Zhiguang Liu ; Marvin Häuser
> 
> 主题: [edk2-devel] [PATCH v2 1/1] MdePkg/Base.h: Simply alignment
> expressions
> 
> Simplify ALIGN_VALUE and ALIGN_VALUE_ADDEND into simpler expressions.
> 
> ALIGN_VALUE can simply be a (value + (align - 1)) & ~align
> expression, which works for any power of 2 alignment and generates
> smaller code sequences. For instance:
>   ALIGN_VALUE(15, 16) = (15 + 15) & ~16 = 16
>   ALIGN_VALUE(16, 16) = (16 + 15) & ~16 = 16
> 
> Old codegen:
>   movq%rdi, %rax
>   negq%rax
>   andl$15, %eax
>   addq%rdi, %rax
> 
> New codegen:
>   leaq15(%rdi), %rax
>   andq$-16, %rax
> 
> ALIGN_VALUE_ADDEND can simply use a bitwise NOT of Value to get the
> addend for alignment, as, for instance:
>   ~15 & (16 - 1) = 1
>   15 + 1 = 16
> 

>   ~15 & (16 - 1) = 1
Its value should be zero, not 1. I also verify the updated ALIGN_VALUE_ADDEND. 
Its value is incorrect. Please double check. 

Thanks
Liming

> This change does not necessarily affect the end result, as the GCC and
> clang compilers were already able to see through things and optimize
> them into optimal instruction sequences, in the ALIGN_VALUE_ADDEND case.
> 
> Cc: Michael D Kinney 
> Cc: Liming Gao 
> Cc: Zhiguang Liu 
> Cc: Marvin Häuser 
> Signed-off-by: Pedro Falcato 
> ---
> 
> v2:
>   Addressed concerns expressed on Discord by Marvin
>   - Added missing parens around Alignment in ALIGN_VALUE
>   - Replaced -1 with -1U, as in the other macros.
> 
>  MdePkg/Include/Base.h | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/MdePkg/Include/Base.h b/MdePkg/Include/Base.h
> index 6597e441a6e2..422f80aff53d 100644
> --- a/MdePkg/Include/Base.h
> +++ b/MdePkg/Include/Base.h
> @@ -931,7 +931,7 @@ STATIC_ASSERT (ALIGNOF
> (__VERIFY_INT32_ENUM_SIZE) == sizeof (__VERIFY_INT32_ENUM
> 
>@return  Addend to round Value up to alignment boundary Alignment.
>  **/
> -#define ALIGN_VALUE_ADDEND(Value, Alignment)  (((Alignment) - (Value))
> & ((Alignment) - 1U))
> +#define ALIGN_VALUE_ADDEND(Value, Alignment)  ((~(Value)) &
> ((Alignment) - 1U))
> 
>  /**
>Rounds a value up to the next boundary using a specified alignment.
> @@ -945,7 +945,7 @@ STATIC_ASSERT (ALIGNOF
> (__VERIFY_INT32_ENUM_SIZE) == sizeof (__VERIFY_INT32_ENUM
>@return  A value up to the next boundary.
> 
>  **/
> -#define ALIGN_VALUE(Value, Alignment)  ((Value) +
> ALIGN_VALUE_ADDEND (Value, Alignment))
> +#define ALIGN_VALUE(Value, Alignment)  (((Value) + ((Alignment) - 1U)) &
> ~(Alignment))
> 
>  /**
>Adjust a pointer by adding the minimum offset required for it to be aligned
> on
> --
> 2.40.1
> 
> 
> 
> 
> 





-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#104907): https://edk2.groups.io/g/devel/message/104907
Mute This Topic: https://groups.io/mt/98918460/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




[edk2-devel] Event: TianoCore Bug Triage - APAC / NAMO - Tuesday, May 16, 2023 #cal-reminder

2023-05-15 Thread Group Notification
*Reminder: TianoCore Bug Triage - APAC / NAMO*

*When:*
Tuesday, May 16, 2023
6:30pm to 7:30pm
(UTC-07:00) America/Los Angeles

*Where:*
https://teams.microsoft.com/l/meetup-join/19%3ameeting_OTk1YzJhN2UtOGQwNi00NjY4LWEwMTktY2JiODRlYTY1NmY0%40thread.v2/0?context=%7b%22Tid%22%3a%2246c98d88-e344-4ed4-8496-4ed7712e255d%22%2c%22Oid%22%3a%226e4ce4c4-1242-431b-9a51-92cd01a5df3c%22%7d

*Organizer:* Liming Gao gaolim...@byosoft.com.cn ( 
gaolim...@byosoft.com.cn?subject=Re:%20Event:%20TianoCore%20Bug%20Triage%20-%20APAC%20%2F%20NAMO
 )

View Event ( https://edk2.groups.io/g/devel/viewevent?eventid=1890529 )

*Description:*

TianoCore Bug Triage - APAC / NAMO

Hosted by Liming Gao



Microsoft Teams meeting

*Join on your computer or mobile app*

Click here to join the meeting ( 
https://teams.microsoft.com/l/meetup-join/19%3ameeting_OTk1YzJhN2UtOGQwNi00NjY4LWEwMTktY2JiODRlYTY1NmY0%40thread.v2/0?context=%7b%22Tid%22%3a%2246c98d88-e344-4ed4-8496-4ed7712e255d%22%2c%22Oid%22%3a%226e4ce4c4-1242-431b-9a51-92cd01a5df3c%22%7d
 )

*Join with a video conferencing device*

te...@conf.intel.com

Video Conference ID: 116 062 094 0

Alternate VTC dialing instructions ( 
https://conf.intel.com/teams/?conf=1160620940=teams=conf.intel.com=test_call
 )

*Or call in (audio only)*

+1 916-245-6934,,77463821# ( tel:+19162456934,,77463821# ) United States, 
Sacramento

Phone Conference ID: 774 638 21#

Find a local number ( 
https://dialin.teams.microsoft.com/d195d438-2daa-420e-b9ea-da26f9d1d6d5?id=77463821
 ) | Reset PIN ( https://mysettings.lync.com/pstnconferencing )

Learn More ( https://aka.ms/JoinTeamsMeeting ) | Meeting options ( 
https://teams.microsoft.com/meetingOptions/?organizerId=b286b53a-1218-4db3-bfc9-3d4c5aa7669e=46c98d88-e344-4ed4-8496-4ed7712e255d=19_meeting_OTUyZTg2NjgtNDhlNS00ODVlLTllYTUtYzg1OTNjNjdiZjFh@thread.v2=0=en-US
 )


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#104906): https://edk2.groups.io/g/devel/message/104906
Mute This Topic: https://groups.io/mt/98918208/21656
Mute #cal-reminder:https://edk2.groups.io/g/devel/mutehashtag/cal-reminder
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




[edk2-devel] 回复: 回复: 回复: [edk2-stable202305] [PATCH] MdeModulePkg/Core/Pei: set AprioriCount=0 before walking through next FV

2023-05-15 Thread gaoliming via groups.io
Wendy:
  I agree this is bug fix in PeiCore to support more than one FV images those 
all have apriori list.

  If no other comments, I will merge it for this stable tag 202305. 

Thanks
Liming
> -邮件原件-
> 发件人: devel@edk2.groups.io  代表 Wendy Liao
> via groups.io
> 发送时间: 2023年5月15日 13:18
> 收件人: gaoliming ; devel@edk2.groups.io
> 抄送: 'Leon Chen' ; 'Tim Lewis'
> 
> 主题: Re: 回复: 回复: [edk2-devel] [PATCH] MdeModulePkg/Core/Pei: set
> AprioriCount=0 before walking through next FV
> 
> Hi Liming,
> 
> Merged https://github.com/tianocore/edk2/pull/4397
> Thank you.
> 
> Best Regards,
> 
> Wendy Liao
> Insyde Software Corp.
> Phone: +886-2-6608-3688 Ext.8731
> 
> gaoliming 於 2023/05/11 上午 10:53 寫道:
> > Wendy:
> >I understand the problem now. Your fix is correct. Reviewed-by: Liming
> Gao 
> >
> >This is a bug fix. I suggest to merge it for this stable tag 202305.
> >
> > Thanks
> > Liming
> >> -邮件原件-
> >> 发件人: devel@edk2.groups.io  代表 Wendy
> Liao
> >> via groups.io
> >> 发送时间: 2023年5月11日 10:23
> >> 收件人: gaoliming ; devel@edk2.groups.io
> >> 抄送: 'Leon Chen' ; 'Tim Lewis'
> >> 
> >> 主题: Re: 回复: [edk2-devel] [PATCH] MdeModulePkg/Core/Pei: set
> >> AprioriCount=0 before walking through next FV
> >>
> >> Hi gaoliming,
> >>
> >> DiscoverPeimsAndOrderWithApriori () will not reset Private->AprioriCount
> >> to Zero when CoreFileHandle->ScanFv = TRUE.
> >> DiscoverPeimsAndOrderWithApriori () {
> >> ...
> >> if (CoreFileHandle->ScanFv) {
> >>   Private->CurrentFvFileHandles = CoreFileHandle->FvFileHandles;
> >>   return;
> >> }
> >> ...
> >> }
> >> After go through all FV and the last FV has one or more Apriori Peim,
> >> Private->AprioriCount will not be reset to 0 anymore.
> >>
> >> Scan loop 1
> >> [FV1]
> >> Before DiscoverPeimsAndOrderWithApriori () : Private->AprioriCount = 0,
> >> CoreFileHandle->ScanFv = FALSE
> >> After DiscoverPeimsAndOrderWithApriori (): Private->AprioriCount =
> >> 2, CoreFileHandle->ScanFv = TRUE
> >> [FV2]
> >> Before DiscoverPeimsAndOrderWithApriori () : Private->AprioriCount = 2,
> >> CoreFileHandle->ScanFv = FALSE
> >> After DiscoverPeimsAndOrderWithApriori (): Private->AprioriCount =
> >> 0, CoreFileHandle->ScanFv = TRUE
> >> ...
> >> [FVn]
> >> Before DiscoverPeimsAndOrderWithApriori () : Private->AprioriCount = 0,
> >> CoreFileHandle->ScanFv = FALSE
> >> After DiscoverPeimsAndOrderWithApriori (): Private->AprioriCount =
> >> 1, CoreFileHandle->ScanFv = TRUE
> >>
> >> Scan loop 2
> >> [FV1]
> >> Before DiscoverPeimsAndOrderWithApriori () : Private->AprioriCount = 1,
> >> CoreFileHandle->ScanFv = TRUE
> >> After DiscoverPeimsAndOrderWithApriori (): Private->AprioriCount =
> >> 1, CoreFileHandle->ScanFv = TRUE
> >>
> >> Best Regards,
> >>
> >> Wendy Liao
> >> Insyde Software Corp.
> >> Phone: +886-2-6608-3688 Ext.8731
> >>
> >> gaoliming 於 2023/05/11 上午 09:32 寫道:
> >>> Wendy:
> >>> DiscoverPeimsAndOrderWithApriori () has the logic to reset
> >> Private->AprioriCount as zero.
> >>> It will set the real AprioriCount for each FV when this FV first 
> >>> scans,
> >> then dispatch the peims in the apriori list.
> >>> So, I don't think there is the issue here. Do you find the real
> >> functionality issue?
> >>> Thanks
> >>> Liming
>  -邮件原件-
>  发件人: devel@edk2.groups.io  代表 Wendy
> >> Liao
>  via groups.io
>  发送时间: 2023年5月10日 14:23
>  收件人: devel@edk2.groups.io
>  抄送: Leon Chen ; Tim Lewis
>  
>  主题: [edk2-devel] [PATCH] MdeModulePkg/Core/Pei: set
> AprioriCount=0
>  before walking through next FV
> 
> 
>  REF:https://bugzilla.tianocore.org/show_bug.cgi?id=4438
> 
>  The main dispatch loop in PeiDispatcher() goes through each FV and
>  calls DiscoverPeimsAndOrderWithApriori() to search Apriori file to
>  reorder all PEIMs then do the PEIM dispatched.
> 
>  DiscoverPeimsAndOrderWithApriori() calculates Apriori file count for
>  every FV once and set Private->AprioriCount, but Private->AprioriCount
>  doesn't be set to 0 before dispatch loop walking through the next FV.
> 
>  It causes the peim which sort on less than Private->AprioriCount and
>  depex is not satisfied would be dispatched when dispatch loop go
> through
>  to a scaned FV, even the peim is not set in APRIORI file.
> 
>  Cc: Leon Chen 
>  Cc: Tim Lewis 
>  Reported-by: Esther Lee 
>  Signed-off-by: Wendy Liao 
> 
>  ---
>  MdeModulePkg/Core/Pei/Dispatcher/Dispatcher.c | 1 +
>  1 file changed, 1 insertion(+)
> 
>  diff --git a/MdeModulePkg/Core/Pei/Dispatcher/Dispatcher.c
>  b/MdeModulePkg/Core/Pei/Dispatcher/Dispatcher.c
>  index d8284f9f4f..5f32ebb560 100644
>  --- a/MdeModulePkg/Core/Pei/Dispatcher/Dispatcher.c
>  +++ b/MdeModulePkg/Core/Pei/Dispatcher/Dispatcher.c
>  @@ -1630,6 +1630,7 @@ PeiDispatcher (
>    Private->CurrentFileHandle= NULL;
>    

[edk2-devel] 回复: [PATCH] MdePkg Include: Fix typos

2023-05-15 Thread gaoliming via groups.io
Giri:
 Edk2 CI enables SpellCheck. Seemly, those typos are not detected by CI. So, I 
want to confirm which tool do you use. 

 This patch is good. But, the first changes the existing MACRO name. I am not 
sure whether there is any code impact. 

Thanks
Liming
> -邮件原件-
> 发件人: Giri Mudusuru 
> 发送时间: 2023年5月15日 10:49
> 收件人: gaoliming 
> 抄送: devel@edk2.groups.io; Michael D Kinney
> ; Zhiguang Liu ;
> Andrew Fish ; Giri Mudusuru 
> 主题: Re: [PATCH] MdePkg Include: Fix typos
> 
> Hi Liming,
> 
> These typos are found during reviews, sync with open source and other debug.
> Just kept running list and then a simple search and replace in repo.
> 
> I have fix for other packages too, just starting with MdePkg to get some
> feedback on size of patch (number of files etc)
> 
> I am using VS Code IDE with Code Spell Checker plugin which highlights any
> typos.
> 
> Thanks,
> -Giri
> 
> > On May 15, 2023, at 7:10 AM, gaoliming 
> wrote:
> >
> > Giri:
> >  How do you find these typos? Which tool do you use to scan the code?
> >
> > Thanks
> > Liming
> >> -邮件原件-
> >> 发件人: Giri Mudusuru 
> >> 发送时间: 2023年5月12日 18:25
> >> 收件人: devel@edk2.groups.io
> >> 抄送: Giri Mudusuru ; Michael D Kinney
> >> ; Liming Gao ;
> >> Zhiguang Liu ; Andrew Fish 
> >> 主题: [PATCH] MdePkg Include: Fix typos
> >>
> >> compatability->compatibility
> >> EFI_MEDIA_CHNAGED->EFI_MEDIA_CHANGED
> >> Funtion->Function
> >> exhausive->exhaustive
> >> Propery->Property
> >> StartAdress->StartAddress
> >> sucessful->successful
> >> writting->writing
> >>
> >> Cc: Michael D Kinney 
> >> Cc: Liming Gao 
> >> Cc: Zhiguang Liu 
> >> Cc: Andrew Fish 
> >> Signed-off-by: Giri Mudusuru 
> >> ---
> >> MdePkg/Include/IndustryStandard/Acpi10.h  |  2 +-
> >> MdePkg/Include/Library/DebugLib.h | 50
> >> +--
> >> MdePkg/Include/Library/PerformanceLib.h   |  2 +-
> >> MdePkg/Include/Library/PostCodeLib.h  | 12 ++---
> >> MdePkg/Include/Library/ReportStatusCodeLib.h  | 26 +-
> >> MdePkg/Include/Library/S3PciLib.h |  4 +-
> >> MdePkg/Include/Library/S3PciSegmentLib.h  |  4 +-
> >> MdePkg/Include/Library/UefiLib.h  |  2 +-
> >> MdePkg/Include/Protocol/BlockIo.h |  4 +-
> >> MdePkg/Include/Protocol/BlockIo2.h|  6 +--
> >> MdePkg/Include/Protocol/BlockIoCrypto.h   |  2 +-
> >> MdePkg/Include/Protocol/DiskIo.h  |  4 +-
> >> MdePkg/Include/Protocol/DiskIo2.h |  6 +--
> >> MdePkg/Include/Protocol/Ip4.h |  4 +-
> >> MdePkg/Include/Protocol/Ip6.h |  4 +-
> >> .../Protocol/NetworkInterfaceIdentifier.h |  4 +-
> >> MdePkg/Include/Protocol/Pkcs7Verify.h |  2 +-
> >> MdePkg/Include/Protocol/RamDisk.h |  2 +-
> >> MdePkg/Include/Protocol/ScsiIo.h  |  2 +-
> >> MdePkg/Include/Protocol/ScsiPassThru.h|  2 +-
> >> MdePkg/Include/Protocol/ServiceBinding.h  |  2 +-
> >> MdePkg/Include/Protocol/Shell.h   |  2 +-
> >> MdePkg/Include/Protocol/ShellDynamicCommand.h |  2 +-
> >> MdePkg/Include/Protocol/Tcp4.h|  4 +-
> >> MdePkg/Include/Protocol/Tcp6.h|  4 +-
> >> MdePkg/Include/Protocol/Udp4.h|  4 +-
> >> MdePkg/Include/Protocol/Udp6.h|  4 +-
> >> MdePkg/Include/Protocol/UfsDeviceConfig.h |  2 +-
> >> MdePkg/Include/Protocol/UgaDraw.h |  2 +-
> >> MdePkg/Include/Protocol/Usb2HostController.h  |  2 +-
> >> MdePkg/Include/Protocol/UsbHostController.h   |  2 +-
> >> 31 files changed, 87 insertions(+), 87 deletions(-)
> >>
> >> diff --git a/MdePkg/Include/IndustryStandard/Acpi10.h
> >> b/MdePkg/Include/IndustryStandard/Acpi10.h
> >> index 9cc02edb3e..5a47f8a54c 100644
> >> --- a/MdePkg/Include/IndustryStandard/Acpi10.h
> >> +++ b/MdePkg/Include/IndustryStandard/Acpi10.h
> >> @@ -321,7 +321,7 @@ typedef struct {
> >> #define
> >>
> EFI_ACPI_MEMORY_RESOURCE_SPECIFIC_FLAG_ADDRESS_RANGE_MEMOR
> >> Y(0 << 3)
> >>
> >> #define
> >>
> EFI_ACPI_MEMORY_RESOURCE_SPECIFIC_FLAG_ADDRESS_RANGE_RESERV
> >> ED  (1 << 3)
> >>
> >> #define
> >> EFI_ACPI_MEMORY_RESOURCE_SPECIFIC_FLAG_ADDRESS_RANGE_ACPI
> >> (2 << 3)
> >>
> >> -#define
> >> EFI_APCI_MEMORY_RESOURCE_SPECIFIC_FLAG_ADDRESS_RANGE_NVS
> >> (3 << 3)
> >>
> >> +#define
> >> EFI_ACPI_MEMORY_RESOURCE_SPECIFIC_FLAG_ADDRESS_RANGE_NVS
> >> (3 << 3)
> >>
> >> //
> >>
> >> // Bit [5]: Memory to I/O Translation, _TTP
> >>
> >> //
> >>
> >> diff --git a/MdePkg/Include/Library/DebugLib.h
> >> b/MdePkg/Include/Library/DebugLib.h
> >> index f0c9f64487..56c9e0c781 100644
> >> --- a/MdePkg/Include/Library/DebugLib.h
> >> +++ b/MdePkg/Include/Library/DebugLib.h
> >> @@ -185,8 +185,8 @@ DebugBPrint (
> >>
> >>
> >>   Print a message of the form "ASSERT ():
> >> \n"
> >>
> >>   to the debug output device.  If
> >> DEBUG_PROPERTY_ASSERT_BREAKPOINT_ENABLED bit of
> >>
> >> -  PcdDebugProperyMask is set then CpuBreakpoint() is called. Otherwise,
> > if
> >>
> >> 

[edk2-devel] Intel's build_bios.py and PYTHONHOME

2023-05-15 Thread Rebecca Cran
I've been starting to use the build_bios.py script in Platform\Intel in 
edk2-platforms to build images for my UpXtreme board.


In my Windows installation, it's complaining that PYTHON_HOME / 
PYTHONHOME isn't set - but I'm not sure why it expects that because 
python.exe is in my %PATH% and so could be executed directly.


Is setting up PYTHONHOME something that's commonly done in Python 
installations, and is PATH commonly _not_ updated to include the 
location of python.exe? I'm trying to figure out if it's a leftover from 
Python 2.x, or if my configuration is non-standard.



--

Rebecca Cran



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#104903): https://edk2.groups.io/g/devel/message/104903
Mute This Topic: https://groups.io/mt/98917232/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




[edk2-devel] [PATCH] MdeModulePkg/DxeCore: Allow relocation of images with large address

2023-05-15 Thread Jeff Brasen via groups.io
Add PCD to control if modules with start addresses in PE/COFF > 0x10
attempt to load at specified address.
If a module has an address in this range and there is untested memory
DxeCore will attempt to promote all memory to tested which bypasses any
memory testing that would occur later in boot.

There are several existing AARCH64 option roms that have base addresses
of 0x18000.

Signed-off-by: Jeff Brasen 
Reviewed-by: Ashish Singhal 
---
 MdeModulePkg/Core/Dxe/DxeMain.inf   | 1 +
 MdeModulePkg/Core/Dxe/Image/Image.c | 4 +++-
 MdeModulePkg/MdeModulePkg.dec   | 7 +++
 3 files changed, 11 insertions(+), 1 deletion(-)

diff --git a/MdeModulePkg/Core/Dxe/DxeMain.inf 
b/MdeModulePkg/Core/Dxe/DxeMain.inf
index 35d5bf0dee..16871f2021 100644
--- a/MdeModulePkg/Core/Dxe/DxeMain.inf
+++ b/MdeModulePkg/Core/Dxe/DxeMain.inf
@@ -187,6 +187,7 @@
   gEfiMdeModulePkgTokenSpaceGuid.PcdHeapGuardPropertyMask   ## 
CONSUMES
   gEfiMdeModulePkgTokenSpaceGuid.PcdCpuStackGuard   ## 
CONSUMES
   gEfiMdeModulePkgTokenSpaceGuid.PcdFwVolDxeMaxEncapsulationDepth   ## 
CONSUMES
+  gEfiMdeModulePkgTokenSpaceGuid.PcdImageLargeAddressLoad   ## 
CONSUMES
 
 # [Hob]
 # RESOURCE_DESCRIPTOR   ## CONSUMES
diff --git a/MdeModulePkg/Core/Dxe/Image/Image.c 
b/MdeModulePkg/Core/Dxe/Image/Image.c
index 9dbfb2a1fa..6bc3a549ae 100644
--- a/MdeModulePkg/Core/Dxe/Image/Image.c
+++ b/MdeModulePkg/Core/Dxe/Image/Image.c
@@ -680,7 +680,9 @@ CoreLoadPeImage (
);
   }
 } else {
-  if ((Image->ImageContext.ImageAddress >= 0x10) || 
Image->ImageContext.RelocationsStripped) {
+  if ((PcdGetBool (PcdImageLargeAddressLoad) && 
((Image->ImageContext.ImageAddress) >= 0x10)) ||
+  Image->ImageContext.RelocationsStripped)
+  {
 Status = CoreAllocatePages (
AllocateAddress,
(EFI_MEMORY_TYPE)(Image->ImageContext.ImageCodeMemoryType),
diff --git a/MdeModulePkg/MdeModulePkg.dec b/MdeModulePkg/MdeModulePkg.dec
index 95dd077e19..6fd1bd7b8f 100644
--- a/MdeModulePkg/MdeModulePkg.dec
+++ b/MdeModulePkg/MdeModulePkg.dec
@@ -1116,6 +1116,13 @@
   # @Prompt Output MMIO address of Trace Hub message.
   
gEfiMdeModulePkgTokenSpaceGuid.PcdTraceHubDebugMmioAddress|0|UINT64|0x30001058
 
+  ## Indicates if images with large load address (>0x10) should attempted 
to load at specified location.
+  #  If enabled, attempt to allocate at specfied location will be attempted 
with a fall back to any address.
+  #   TRUE  - UEFI will attempt to load at specified location.
+  #   FALSE - UEFI will load at any address
+  # @Prompt Enable large address image loading.
+  
gEfiMdeModulePkgTokenSpaceGuid.PcdImageLargeAddressLoad|TRUE|BOOLEAN|0x30001059
+
 [PcdsFixedAtBuild, PcdsPatchableInModule]
   ## Dynamic type PCD can be registered callback function for Pcd setting 
action.
   #  PcdMaxPeiPcdCallBackNumberPerPcdEntry indicates the maximum number of 
callback function
-- 
2.25.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#104902): https://edk2.groups.io/g/devel/message/104902
Mute This Topic: https://groups.io/mt/98916659/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




[edk2-devel] Now: Tools, CI, Code base construction meeting series - Monday, May 15, 2023 #cal-notice

2023-05-15 Thread Group Notification
*Tools, CI, Code base construction meeting series*

*When:*
Monday, May 15, 2023
4:30pm to 5:30pm
(UTC-07:00) America/Los Angeles

*Where:*
https://github.com/tianocore/edk2/discussions/2614

View Event ( https://edk2.groups.io/g/devel/viewevent?eventid=1890534 )

*Description:*

TianoCore community,

Microsoft and Intel will be hosting a series of open meetings to discuss build, 
CI, tools, and other related topics. If you are interested, have ideas/opinions 
please join us. These meetings will be Monday 4:30pm Pacific Time on Microsoft 
Teams.

MS Teams Link in following discussion: * 
https://github.com/tianocore/edk2/discussions/2614

Anyone is welcome to join.

* tianocore/edk2: EDK II (github.com)
* tianocore/edk2-basetools: EDK II BaseTools Python tools as a PIP module 
(github.com) https://github.com/tianocore/edk2-basetools
* tianocore/edk2-pytool-extensions: Extensions to the edk2 build system 
allowing for a more robust and plugin based build system and tool execution 
environment (github.com) https://github.com/tianocore/edk2-pytool-extensions
* tianocore/edk2-pytool-library: Python library package that supports UEFI 
development (github.com) https://github.com/tianocore/edk2-pytool-library

MS Teams Browser Clients * 
https://docs.microsoft.com/en-us/microsoftteams/get-clients?tabs=Windows#browser-client


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#104901): https://edk2.groups.io/g/devel/message/104901
Mute This Topic: https://groups.io/mt/98916359/21656
Mute #cal-notice:https://edk2.groups.io/g/devel/mutehashtag/cal-notice
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




[edk2-devel] Event: Tools, CI, Code base construction meeting series - Monday, May 15, 2023 #cal-reminder

2023-05-15 Thread Group Notification
*Reminder: Tools, CI, Code base construction meeting series*

*When:*
Monday, May 15, 2023
4:30pm to 5:30pm
(UTC-07:00) America/Los Angeles

*Where:*
https://github.com/tianocore/edk2/discussions/2614

View Event ( https://edk2.groups.io/g/devel/viewevent?eventid=1890534 )

*Description:*

TianoCore community,

Microsoft and Intel will be hosting a series of open meetings to discuss build, 
CI, tools, and other related topics. If you are interested, have ideas/opinions 
please join us. These meetings will be Monday 4:30pm Pacific Time on Microsoft 
Teams.

MS Teams Link in following discussion: * 
https://github.com/tianocore/edk2/discussions/2614

Anyone is welcome to join.

* tianocore/edk2: EDK II (github.com)
* tianocore/edk2-basetools: EDK II BaseTools Python tools as a PIP module 
(github.com) https://github.com/tianocore/edk2-basetools
* tianocore/edk2-pytool-extensions: Extensions to the edk2 build system 
allowing for a more robust and plugin based build system and tool execution 
environment (github.com) https://github.com/tianocore/edk2-pytool-extensions
* tianocore/edk2-pytool-library: Python library package that supports UEFI 
development (github.com) https://github.com/tianocore/edk2-pytool-library

MS Teams Browser Clients * 
https://docs.microsoft.com/en-us/microsoftteams/get-clients?tabs=Windows#browser-client


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#104900): https://edk2.groups.io/g/devel/message/104900
Mute This Topic: https://groups.io/mt/98892820/21656
Mute #cal-reminder:https://edk2.groups.io/g/devel/mutehashtag/cal-reminder
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [PATCH v3] MinPlatformPkg: Update ACPI 6.5 definition

2023-05-15 Thread Ankit Sinha
Thank you Aryeh.

Reviewed-by: Ankit Sinha

> -Original Message-
> From: Chen, Aryeh 
> Sent: Wednesday, May 10, 2023 8:58 PM
> To: devel@edk2.groups.io
> Cc: Chen, Aryeh ; Chiu, Chasel
> ; Desimone, Nathaniel L
> ; Oram, Isaac W
> ; Gao, Liming ;
> Dong, Eric ; Yao, Jiewen ;
> Sinha, Ankit 
> Subject: [PATCH v3] MinPlatformPkg: Update ACPI 6.5 definition
> 
> From: Aryeh Chen 
> 
> https://bugzilla.tianocore.org/show_bug.cgi?id=4442
> 
> Update ACPI 6.5 definition on MinPlatformPkg
> 
> Cc: Chasel Chiu 
> Cc: Nate DeSimone 
> Cc: Isaac Oram 
> Cc: Liming Gao 
> Cc: Eric Dong 
> Cc: Jiewen Yao 
> Cc: Ankit Sinha
> 
> Signed-off-by: Aryeh Chen 
> ---
>  Platform/Intel/MinPlatformPkg/Acpi/AcpiTables/AcpiPlatform.c
> | 154 ++--
>  Platform/Intel/MinPlatformPkg/Acpi/AcpiTables/Facs/Facs.c
>  |
> 8 +-
>  Platform/Intel/MinPlatformPkg/Acpi/AcpiTables/Fadt/Fadt.c
>  |
> 46 +++---
>  Platform/Intel/MinPlatformPkg/Acpi/AcpiTables/Hpet/Hpet.c
> |   4 +-
> 
> Platform/Intel/MinPlatformPkg/Acpi/Library/DxeAslUpdateLib/DxeAslUpdat
> eLib.c  |   2 +-
>  Platform/Intel/MinPlatformPkg/MinPlatformPkg.dec 
>  |   2
> +-
> 
> Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/DxeCheckA
> cpi.c   | 154 ++--
> 
> Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/DxeCheckA
> cpiMadt.c   | 150 +--
> 
> Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/DxeCheckD
> maProtection.c  |   4 +-
> 
> Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/DxeCheckTc
> gTrustedBoot.c |   2 +-
> 
> Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/DxeTestPoi
> ntCheckLib.c   |   2 +-
>  11 files changed, 264 insertions(+), 264 deletions(-)
> 
> diff --git a/Platform/Intel/MinPlatformPkg/Acpi/AcpiTables/AcpiPlatform.c
> b/Platform/Intel/MinPlatformPkg/Acpi/AcpiTables/AcpiPlatform.c
> index e967031a3b..2f2c96f907 100644
> --- a/Platform/Intel/MinPlatformPkg/Acpi/AcpiTables/AcpiPlatform.c
> +++ b/Platform/Intel/MinPlatformPkg/Acpi/AcpiTables/AcpiPlatform.c
> @@ -27,9 +27,9 @@ typedef struct {
>  // Define Union of IO APIC & Local APIC structure;
> 
>  //
> 
>  typedef union {
> 
> -  EFI_ACPI_6_3_PROCESSOR_LOCAL_APIC_STRUCTURE   AcpiLocalApic;
> 
> -  EFI_ACPI_6_3_IO_APIC_STRUCTUREAcpiIoApic;
> 
> -  EFI_ACPI_6_3_PROCESSOR_LOCAL_X2APIC_STRUCTURE AcpiLocalx2Apic;
> 
> +  EFI_ACPI_6_5_PROCESSOR_LOCAL_APIC_STRUCTURE   AcpiLocalApic;
> 
> +  EFI_ACPI_6_5_IO_APIC_STRUCTUREAcpiIoApic;
> 
> +  EFI_ACPI_6_5_PROCESSOR_LOCAL_X2APIC_STRUCTURE AcpiLocalx2Apic;
> 
>struct {
> 
>  UINT8 Type;
> 
>  UINT8 Length;
> 
> @@ -38,8 +38,8 @@ typedef union {
> 
> 
>  #pragma pack()
> 
> 
> 
> -extern EFI_ACPI_6_3_FIRMWARE_ACPI_CONTROL_STRUCTURE Facs;
> 
> -extern EFI_ACPI_6_3_FIXED_ACPI_DESCRIPTION_TABLEFadt;
> 
> +extern EFI_ACPI_6_5_FIRMWARE_ACPI_CONTROL_STRUCTURE Facs;
> 
> +extern EFI_ACPI_6_5_FIXED_ACPI_DESCRIPTION_TABLEFadt;
> 
>  extern EFI_ACPI_HIGH_PRECISION_EVENT_TIMER_TABLE_HEADER Hpet;
> 
>  extern EFI_ACPI_WSMT_TABLE Wsmt;
> 
> 
> 
> @@ -92,16 +92,16 @@ AppendCpuMapTableEntry (
>)
> 
>  {
> 
>EFI_STATUSStatus;
> 
> -  EFI_ACPI_6_3_PROCESSOR_LOCAL_APIC_STRUCTURE   *LocalApicPtr;
> 
> -  EFI_ACPI_6_3_PROCESSOR_LOCAL_X2APIC_STRUCTURE *LocalX2ApicPtr;
> 
> +  EFI_ACPI_6_5_PROCESSOR_LOCAL_APIC_STRUCTURE   *LocalApicPtr;
> 
> +  EFI_ACPI_6_5_PROCESSOR_LOCAL_X2APIC_STRUCTURE *LocalX2ApicPtr;
> 
>UINT8 Type;
> 
> 
> 
>Status = EFI_SUCCESS;
> 
>Type = ((ACPI_APIC_STRUCTURE_PTR *)ApicPtr)->AcpiApicCommon.Type;
> 
> -  LocalApicPtr = (EFI_ACPI_6_3_PROCESSOR_LOCAL_APIC_STRUCTURE
> *)(&((ACPI_APIC_STRUCTURE_PTR *)ApicPtr)->AcpiLocalApic);
> 
> -  LocalX2ApicPtr = (EFI_ACPI_6_3_PROCESSOR_LOCAL_X2APIC_STRUCTURE
> *)(&((ACPI_APIC_STRUCTURE_PTR *)ApicPtr)->AcpiLocalx2Apic);
> 
> +  LocalApicPtr = (EFI_ACPI_6_5_PROCESSOR_LOCAL_APIC_STRUCTURE
> *)(&((ACPI_APIC_STRUCTURE_PTR *)ApicPtr)->AcpiLocalApic);
> 
> +  LocalX2ApicPtr = (EFI_ACPI_6_5_PROCESSOR_LOCAL_X2APIC_STRUCTURE
> *)(&((ACPI_APIC_STRUCTURE_PTR *)ApicPtr)->AcpiLocalx2Apic);
> 
> 
> 
> -  if(Type == EFI_ACPI_6_3_PROCESSOR_LOCAL_APIC) {
> 
> +  if(Type == EFI_ACPI_6_5_PROCESSOR_LOCAL_APIC) {
> 
>  if(!mX2ApicEnabled) {
> 
>LocalApicPtr->Flags=
> (UINT8)CpuApicIdOrderTable[LocalApicCounter].Flags;
> 
>LocalApicPtr->ApicId   =
> (UINT8)CpuApicIdOrderTable[LocalApicCounter].ApicId;
> 
> @@ -112,7 +112,7 @@ AppendCpuMapTableEntry (
>LocalApicPtr->AcpiProcessorUid = (UINT8)0xFF;
> 
>Status = EFI_UNSUPPORTED;
> 
>  }
> 
> -  } else if(Type == EFI_ACPI_6_3_PROCESSOR_LOCAL_X2APIC) {
> 
> +  } else if(Type == EFI_ACPI_6_5_PROCESSOR_LOCAL_X2APIC) {
> 
>  if(mX2ApicEnabled) {
> 
>LocalX2ApicPtr->Flags=
> 

Re: [edk2-devel] [PATCH edk2-platforms 1/1] Platform/Intel: Fix type mismatches from prototypes in BoardBdsHookLib.c

2023-05-15 Thread Isaac Oram
Reviewed-by: Isaac Oram 

-Original Message-
From: devel@edk2.groups.io  On Behalf Of Rebecca Cran
Sent: Sunday, May 14, 2023 10:54 PM
To: devel@edk2.groups.io; Dong, Eric ; Oram, Isaac W 
; Gao, Liming ; Chaganty, 
Rangasai V ; Desimone, Nathaniel L 

Cc: Rebecca Cran 
Subject: [edk2-devel] [PATCH edk2-platforms 1/1] Platform/Intel: Fix type 
mismatches from prototypes in BoardBdsHookLib.c

Add EFIAPI to the implementations of:

BdsBeforeConsoleAfterTrustedConsoleCallback
BdsBeforeConsoleBeforeEndOfDxeGuidCallback
BdsAfterConsoleReadyBeforeBootOptionCallback

This makes them match the prototypes, and avoids an -Wlto-type-mismatch warning.

Signed-off-by: Rebecca Cran 
---
 Platform/Intel/BoardModulePkg/Library/BoardBdsHookLib/BoardBdsHookLib.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git 
a/Platform/Intel/BoardModulePkg/Library/BoardBdsHookLib/BoardBdsHookLib.c 
b/Platform/Intel/BoardModulePkg/Library/BoardBdsHookLib/BoardBdsHookLib.c
index e866f70bc336..bc80badb3e01 100644
--- a/Platform/Intel/BoardModulePkg/Library/BoardBdsHookLib/BoardBdsHookLib.c
+++ b/Platform/Intel/BoardModulePkg/Library/BoardBdsHookLib/BoardBdsHook
+++ Lib.c
@@ -1273,6 +1273,7 @@ BdsReadyToBootCallback (
   @param[in] ContextPointer to the context data registered to the Event.
 **/
 VOID
+EFIAPI
 BdsBeforeConsoleAfterTrustedConsoleCallback (
   IN EFI_EVENT  Event,
   IN VOID   *Context
@@ -1294,6 +1295,7 @@ BdsBeforeConsoleAfterTrustedConsoleCallback (
   @param[in] ContextPointer to the context data registered to the Event.
 **/
 VOID
+EFIAPI
 BdsBeforeConsoleBeforeEndOfDxeGuidCallback (
   IN EFI_EVENT  Event,
   IN VOID   *Context
@@ -1311,6 +1313,7 @@ BdsBeforeConsoleBeforeEndOfDxeGuidCallback (
   @param[in] ContextPointer to the context data registered to the Event.
 **/
 VOID
+EFIAPI
 BdsAfterConsoleReadyBeforeBootOptionCallback (
   IN EFI_EVENT  Event,
   IN VOID   *Context
--
2.39.2








-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#104898): https://edk2.groups.io/g/devel/message/104898
Mute This Topic: https://groups.io/mt/98897921/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [PATCH v7] MinPlatformPkg: Update HWSignature filed in FACS

2023-05-15 Thread Ankit Sinha
Reviewed-by: Ankit Sinha

> -Original Message-
> From: Ke, VincentX 
> Sent: Thursday, May 11, 2023 3:00 AM
> To: devel@edk2.groups.io
> Cc: Ke, VincentX ; Chiu, Chasel
> ; Desimone, Nathaniel L
> ; Oram, Isaac W
> ; Gao, Liming ;
> Dong, Eric ; Sinha, Ankit 
> Subject: [PATCH v7] MinPlatformPkg: Update HWSignature filed in FACS
> 
> From: VincentX Ke 
> 
> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4428
> 
> Calculating CRC based on each ACPI table.
> Update HWSignature filed in FACS based on CRC while ACPI table changed.
> 
> Change-Id: Ic0ca66ff10cda0fbcd0683020fab1bc9aea9b78c
> Signed-off-by: VincentX Ke 
> Cc: Chasel Chiu 
> Cc: Nate DeSimone 
> Cc: Isaac Oram 
> Cc: Liming Gao 
> Cc: Eric Dong 
> Cc: Ankit Sinha
> Signed-off-by: VincentX Ke 
> ---
>  Platform/Intel/MinPlatformPkg/Acpi/AcpiTables/AcpiPlatform.c   | 287
> +++-
>  Platform/Intel/MinPlatformPkg/Acpi/AcpiTables/AcpiPlatform.inf |   1 +
>  2 files changed, 223 insertions(+), 65 deletions(-)
> 
> diff --git a/Platform/Intel/MinPlatformPkg/Acpi/AcpiTables/AcpiPlatform.c
> b/Platform/Intel/MinPlatformPkg/Acpi/AcpiTables/AcpiPlatform.c
> index e967031a3b..3dca6f99f7 100644
> --- a/Platform/Intel/MinPlatformPkg/Acpi/AcpiTables/AcpiPlatform.c
> +++ b/Platform/Intel/MinPlatformPkg/Acpi/AcpiTables/AcpiPlatform.c
> @@ -1191,98 +1191,255 @@ PlatformUpdateTables (
>  }
> 
> 
> 
>  /**
> 
> -  This function calculates RCR based on PCI Device ID and Vendor ID from the
> devices
> 
> -  available on the platform.
> 
> -  It also includes other instances of BIOS change to calculate CRC and
> provides as
> 
> -  HWSignature filed in FADT table.
> 
> +  This function calculates CRC based on each offset in the ACPI table.
> 
> +
> 
> +  @param[in] Table  The ACPI table required to calculate CRC.
> 
> +
> 
> +  @retval CRC   A pointer to allocate UINT32 that
> 
> +contains the CRC32 data.
> 
> +**/
> 
> +UINT32
> 
> +AcpiTableCrcCalculator (
> 
> +  IN  EFI_ACPI_COMMON_HEADER  *Table
> 
> +  )
> 
> +{
> 
> +  EFI_STATUS  Status;
> 
> +  UINT32  CRC;
> 
> +
> 
> +  Status = EFI_SUCCESS;
> 
> +  CRC= 0;
> 
> +
> 
> +  //
> 
> +  // Calculate CRC value.
> 
> +  //
> 
> +  if (Table->Signature ==
> EFI_ACPI_6_5_FIRMWARE_ACPI_CONTROL_STRUCTURE_SIGNATURE) {
> 
> +//
> 
> +// Zero HardwareSignature field before Calculating FACS CRC
> 
> +//
> 
> +((EFI_ACPI_6_5_FIRMWARE_ACPI_CONTROL_STRUCTURE *)Table)-
> >HardwareSignature = 0;
> 
> +  }
> 
> +
> 
> +  Status = gBS->CalculateCrc32 ((UINT8 *)Table, (UINTN)Table->Length,
> );
> 
> +  return CRC;
> 
> +}
> 
> +
> 
> +/**
> 
> +  This function count ACPI tables in RSDT/XSDT and return the result.
> 
> +
> 
> +  @param[in] SdtACPI XSDT/RSDT.
> 
> +  @param[in] TablePointerSize   Size of table pointer:
> 
> +4(RSDT) or 8(XSDT).
> 
> +
> 
> +  @retval TableCountThe total number of ACPI tables in
> 
> +RSDT or XSDT.
> 
> +**/
> 
> +UINTN
> 
> +CountTableInSDT (
> 
> +  IN  EFI_ACPI_DESCRIPTION_HEADER  *Sdt,
> 
> +  IN  UINTNTablePointerSize
> 
> +  )
> 
> +{
> 
> +  UINTN   Index;
> 
> +  UINTN   TableCount;
> 
> +  UINTN   EntryCount;
> 
> +  UINT64  EntryPtr;
> 
> +  UINTN   BasePtr;
> 
> +  EFI_ACPI_COMMON_HEADER  *Table;
> 
> +
> 
> +  EntryCount = (Sdt->Length - sizeof (EFI_ACPI_DESCRIPTION_HEADER)) /
> TablePointerSize;
> 
> +  BasePtr= (UINTN)(Sdt + 1);
> 
> +
> 
> +  for (Index = 0, TableCount = 0; Index < EntryCount; Index++) {
> 
> +EntryPtr = 0;
> 
> +Table= NULL;
> 
> +CopyMem (, (VOID *)(BasePtr + Index * TablePointerSize),
> TablePointerSize);
> 
> +Table = (EFI_ACPI_COMMON_HEADER *)((UINTN)(EntryPtr));
> 
> +if (Table) {
> 
> +  TableCount++;
> 
> +}
> 
> +
> 
> +if (Table->Signature ==
> EFI_ACPI_6_5_FIXED_ACPI_DESCRIPTION_TABLE_SIGNATURE) {
> 
> +  CopyMem ((VOID *), (VOID *)Table, sizeof
> (EFI_ACPI_6_5_FIXED_ACPI_DESCRIPTION_TABLE));
> 
> +  if (Fadt.FirmwareCtrl || Fadt.XFirmwareCtrl) {
> 
> +TableCount++;
> 
> +  }
> 
> +
> 
> +  if (Fadt.Dsdt || Fadt.XDsdt) {
> 
> +TableCount++;
> 
> +  }
> 
> +}
> 
> +  }
> 
> +
> 
> +  return TableCount;
> 
> +}
> 
> +
> 
> +/**
> 
> +  This function calculates CRC based on each ACPI table.
> 
> +  It also calculates CRC and provides as HWSignature filed in FACS.
> 
>  **/
> 
>  VOID
> 
> -IsHardwareChange (
> 
> +IsAcpiTableChange (
> 
>VOID
> 
>)
> 
>  {
> 
> -  EFI_STATUSStatus;
> 
> -  UINTN Index;
> 
> -  UINTN HandleCount;
> 
> -  EFI_HANDLE*HandleBuffer;
> 
> -  EFI_PCI_IO_PROTOCOL   *PciIo;
> 
> -  UINT32CRC;
> 
> -  UINT32*HWChange;
> 
> -  UINTN

[edk2-devel] [PATCH edk2-non-osi 1/1] Platform/Qemu/Sbsa: Update TF-A binaries to enable FEAT_FGT

2023-05-15 Thread Marcin Juszkiewicz via groups.io
Update the TF-A binaries to have FEAT_FGT support.

This support was merged into TF-A:

https://review.trustedfirmware.org/c/TF-A/trusted-firmware-a/+/19459

This allows SBSA Reference Platform to boot Linux on "max" cpu.

Signed-off-by: Marcin Juszkiewicz 
---
 Platform/Qemu/Sbsa/Readme.md |  31 ++-
 Platform/Qemu/Sbsa/bl1.bin   | Bin 19461 -> 19413 bytes
 Platform/Qemu/Sbsa/fip.bin   | Bin 58098 -> 58098 bytes
 3 files changed, 14 insertions(+), 17 deletions(-)

diff --git a/Platform/Qemu/Sbsa/Readme.md b/Platform/Qemu/Sbsa/Readme.md
index aaf920e12daa..d044297dd693 100644
--- a/Platform/Qemu/Sbsa/Readme.md
+++ b/Platform/Qemu/Sbsa/Readme.md
@@ -4,32 +4,29 @@ Qemu SBSA TF-A binaries
 These binaries have been created from the mainline TF-A
 code checked out at the following commit ID:
 
-commit 5fdb2e5471c6ae564ea60d986505418134e7516f
-Merge: e550fa127 ccc61e100
-Author: Olivier Deprez 
-Date:   Tue Mar 21 10:46:41 2023 +0100
+commit dcf430656ca8ef964fa55ad9eb81cf838c7837f2 (tag: v2.9-rc0)
+Merge: 3011e1afe b1af2676f
+Author: Manish Pandey 
+Date:   Thu May 11 13:41:35 2023 +0200
 
-Merge changes I924ea85d,I22e128c4,I7a5cfaac into integration
+Merge "docs(psci): expound runtime instrumentation docs" into integration
 
-* changes:
-  feat(mt8195): add support for SMC from OP-TEE
-  feat(mediatek): add SMC handler for EMI MPU
-  feat(mediatek): add SiP service for OP-TEE
 
 This ensures that the following feature for qemu_sbsa platform is
 merged upstream and is included in the build:
 
-commit 226f4c8e35c4441e80ad523b9105eab4ca630396
-Author: Chen Baozi 
-Date:   Wed Feb 22 06:58:39 2023 +
+commit c598692d0c6a79dd10c34d5a4a740c90261cfc65
+Author: Marcin Juszkiewicz 
+Date:   Tue Feb 14 09:27:59 2023 +0100
 
-feat(qemu): add "neoverse-n1" cpu support
+fix(qemu-sbsa): enable FGT
 
-Add support to qemu "neoverse-n1" cpu for "qemu_sbsa" ('sbsa-ref')
-platform.
+QEMU 7.2+ has FEAT_FGT support added to 'max' cpu.
 
-Signed-off-by: Chen Baozi 
-Change-Id: I4620e879c71115451ae91a1643812d89ec7c071f
+So let's enable it to make Debian 'bookworm' kernel boot on sbsa-ref/max 
setup.
+
+Signed-off-by: Marcin Juszkiewicz 
+Change-Id: I49fb3e742b69ce7be5666e0144525dde21a68238
 
 
 NOTE: No modifications to the source code have been done.
diff --git a/Platform/Qemu/Sbsa/bl1.bin b/Platform/Qemu/Sbsa/bl1.bin
index 
51b22511db2ea1ef51afe282e43680cc3defbe3e..4a5bd925ae43430e72281001ee5b39f8bc124f3a
 100755
GIT binary patch
delta 2565
zcmZ`)4^R~66@TCEa@;8(_XjTsvU{M#JN`#5huFvpS~a6-l*=U6I5{xX(wHh}G9u})
zXfiQloMCx4C5~|lrg7wITkGXAWhO>&+Qy{qG}2sKI(7nRreQix1*CeK^ZIt#V;nkx
z`SyFi-}}Ayz5TxL?Y;gsi}o-#m^z1hA2~AxnR(GKYWV1s8GfU7?B4+@=`&*iC(YUIfa(a0SkqPlL08m{3T`svuZ6sXl5Y$?LKlsRhNrvdV6tET`
zxSmFrI^kpgKo{F>y~smwly`(4(Pz7-98a(u_Ir%5qK=Rm9P#!`{c#@DOXQEY51qZj
zYuv?tiI#%fxvJ)yu4nx#3GZ)Qs?OLU_Dey_X%Fe;NV#h0Vf<>YdWP`1M55;g<$R0A
zG!Gt8fR-@<{KpAr$)Hj^=Q)ZEoa4EpOVyuHgayDc#%G1d<9UkkZHgKMsMIUjoTnbw
zS8;fpDf;T3LzGF=^pa+bW?gqBPraE)ICZ;AR296+InyTvaOli6QN4o|3+@
z=d_2W7s|1C`{lDQqKn_n0{A9h!`9#@d>tDKrwandjZ0`Zx!E>++~j1N@oCc$b|^ez
z;u%|o|4j996REh^{3MHFlevR^j$fKrv-9Y(Y+y*|M6Q!}lyJ*>)VEXKgrr!OuCy
z;Xqn_9%JAaBxRU~gBJwon*tC*TxwPH`LvC6XRtIqZ{s^A2r4Fdz$GZ#7_c7#h1Ae)
z0tbHmJtUVp!XWrv4uS);H!h(n>MAzZ2M)_IO-Gl)5Agj9cqRQ+?}uL}ddBGJk}upx
zo0Yr*5%PhYqH5RRCT&@g{}r}n6gu7`Z-)t58fbZ@$T6Ol!Sfl*vPbEpwKGem9H*2W
zX$PkyoXmK}bzNWJqJGCl-(dZHsSq67Md$B?m;}mj8a6Kytpe3O2zNhV!~{5H81TfR
z9c%(;=sApAGt214c4ms~BkaqpXKQgL^F=m*4c4bPe;J0YZFE>AHqpB7L83>yYyoPb
zQBjT^$DKBxdzryX47|P7b+Pg5ppH>X6wgz?j2CT1YaQ`K!z<9RWO1AQyx|mj$
z-gB@-WfT=yQy0_mV799HH2rw@Fho17H6PyS`8*S)@hRmEO^RM@c3UqVc
zX-|>;6>afh8w_a8bA1<6ZxA;_d9|D~UneTRB0SA!c{II>amNvs67I~Z=U5~hb-v43
zd$=w8&%E^l-JdajG4-D_#HA?1XK?${zjHU1hgas6vb3+u}dzVf4l32sW@E2l^
z^(0+9@r{h=PgnC%?K5){N5le47qQ(m`Y}Z+OZoI}qUTdwCHwX?{uQ3LV4Ae6V)#&~lu5PSb1J8RGA0EqA%{*c918TwYYLN}27`B7_TqoyBH-^Sk+6|rCAWKl88z`Wwe
zEKc%jo>tsh{95i&)?%JW_{AW!^lI}Uw8$yo(iSc3|ZIHL5$5c%V#2_}Bkae|wmE5(n!t
zIlaEcmIlMaDBS68PNLZYpmiQ@PhwKv$$l+~40SMxwOp2;J+t!Qu8;rNuYRo%~
zxyhLKZlcia@L$%au;wW76YPgBGGCU-TV
zRVA%Axk<<~;|bYN?{Cy24xSttytbG_*+--mtvE#=@^`yu_OKeYS{x2?5Hb*%w)1
k%(Dn!`u7d~z&9v(FG3idrAva{i#C)Tn50bb*huK)l5

delta 2741
zcmZ`)3s6+o8UD}SW!*&{`-0^m+`Hgw7gl+#SS)atM-->pL^f?2Ygq(>v<`@1M@tee
z*gS31T+b%hss*fxurZyfD;?>Cy3lmmj&)SXI+`|>#kP|s>I|TbtCH=1FT0FGCot!n
z|NH*O`S+avKiA(wUOGZ7pz0d$OL}((wCVmErHnsb18yGREC73z>m*w6$`
zHMm^>_5iN2Xn03FZnASIxI*k@01(XpZ<--n+=;l%s1(ZpE;vzto(I1Vog4t}N*wQt
z|0yJ}dH$rwE=<<(#lhul%1GSE
zActE)Qkp2~W~<3yKH|2Q)5LoQ2!5cHVj4VhI!VjKbC2V`W#U=Hr$eEh8I1W09J35q
zStYavl;AvyIDrQd{T0@?X|2Ne-P38}N%YVF7z0d#2Q}93A-;=VK7ax_lRfF;QF#}m
zbw!lCyY*F!B-!+#O#oNf?pC^ZI}|d>@>y1VgI-aXVna$W$_#Mg7c@88kUX#F#24k5
z2G8tLJ~-DgHgJHNnMNYe*O*eWo>CzrgjN~J=fGE;-fLRx6C%0!yz)2f4{$9rAH
z5b`bh$~aN=*~hTgePXu=$$Ed;qvt1-aAKxL4buQh4*<2srgxrGfm=}V!)B$hjR5(+
z55QT9C)=Q~oUI&=a-WXi9H7bC
zwZu=Wv@E$uo3zy=pN?pMK>kcEx+fLJ9NM8fKyv6k9jjaSWvEB0Qy2E%B+Cao=?Z-z

Re: [edk2-devel] [PATCH v1 0/1] Maintainers.txt: Update reviewers and maintainer for FdtLib

2023-05-15 Thread Chiu, Chasel

Thanks Liming!

> -Original Message-
> From: gaoliming 
> Sent: Sunday, May 14, 2023 6:01 PM
> To: devel@edk2.groups.io; Chiu, Chasel ; Guo, Gua
> 
> Cc: 'Andrew Fish' ; 'Leif Lindholm'
> ; Kinney, Michael D 
> Subject: 回复: [edk2-devel] [PATCH v1 0/1] Maintainers.txt: Update reviewers
> and maintainer for FdtLib
> 
> Chasel:
>   I just merge it.
> 
> Thanks
> Liming
> > -邮件原件-
> > 发件人: devel@edk2.groups.io  代表 Chiu, Chasel
> > 发送时间: 2023年5月12日 15:15
> > 收件人: devel@edk2.groups.io; Chiu, Chasel ; Gao,
> > Liming ; Guo, Gua 
> > 抄送: 'Andrew Fish' ; 'Leif Lindholm'
> > ; Kinney, Michael D
> > 
> > 主题: Re: [edk2-devel] [PATCH v1 0/1] Maintainers.txt: Update reviewers
> > and maintainer for FdtLib
> >
> >
> > Hi Liming,
> >
> > PR has been updated with all RB:
> > https://github.com/tianocore/edk2/pull/4389/commits
> >
> > Thanks,
> > Chasel
> >
> >
> > > -Original Message-
> > > From: devel@edk2.groups.io  On Behalf Of Chiu,
> > Chasel
> > > Sent: Friday, May 12, 2023 12:11 AM
> > > To: devel@edk2.groups.io; Gao, Liming ;
> > > Guo, Gua 
> > > Cc: 'Andrew Fish' ; 'Leif Lindholm'
> > > ; Kinney, Michael D
> > 
> > > Subject: Re: [edk2-devel] [PATCH v1 0/1] Maintainers.txt: Update
> > > reviewers
> > and
> > > maintainer for FdtLib
> > >
> > >
> > > Thanks Liming!
> > >
> > > > -Original Message-
> > > > From: devel@edk2.groups.io  On Behalf Of
> > > > gaoliming via groups.io
> > > > Sent: Thursday, May 11, 2023 7:45 PM
> > > > To: Chiu, Chasel ; devel@edk2.groups.io;
> > > > Guo, Gua 
> > > > Cc: 'Andrew Fish' ; 'Leif Lindholm'
> > > > ; Kinney, Michael D
> > > > 
> > > > Subject: 回复: [edk2-devel] [PATCH v1 0/1] Maintainers.txt: Update
> > > > reviewers and maintainer for FdtLib
> > > >
> > > > Chasel:
> > > >   I agree to merge this change together with code change for this
> > > > stable
> > tag.
> > > >
> > > > Thanks
> > > > Liming
> > > > > -邮件原件-
> > > > > 发件人: Chiu, Chasel 
> > > > > 发送时间: 2023年5月12日 10:35
> > > > > 收件人: devel@edk2.groups.io; Guo, Gua ; Gao,
> > > Liming
> > > > > 
> > > > > 抄送: Andrew Fish ; Leif Lindholm
> > > > > ; Kinney, Michael D
> > > > > 
> > > > > 主题: RE: [edk2-devel] [PATCH v1 0/1] Maintainers.txt: Update
> > > > > reviewers
> > > > and
> > > > > maintainer for FdtLib
> > > > >
> > > > >
> > > > > Hi Liming,
> > > > >
> > > > > We are considering this is a missing when merging FdtLib support 
> > > > > earlier.
> > > > > Do we need to wait for Stewards approval for adding maintainers?
> > > > >
> > > > > Thanks,
> > > > > Chasel
> > > > >
> > > > >
> > > > > > -Original Message-
> > > > > > From: devel@edk2.groups.io  On Behalf Of
> > > > > > Guo,
> > > > > Gua
> > > > > > Sent: Thursday, May 11, 2023 7:31 PM
> > > > > > To: devel@edk2.groups.io; Gao, Liming
> > > > > > 
> > > > > > Subject: Re: [edk2-devel] [PATCH v1 0/1] Maintainers.txt:
> > > > > > Update
> > > > reviewers
> > > > > and
> > > > > > maintainer for FdtLib
> > > > > >
> > > > > > Hi Liming,
> > > > > >
> > > > > > Do you know whether for code freeze also include
> > > > > > Maintainers.txt update
> > > > ?
> > > > > > Or maybe we can submit it once the change approve.
> > > > > >
> > > > > > Thanks,
> > > > > > Gua
> > > > > > -Original Message-
> > > > > > From: Guo, Gua 
> > > > > > Sent: Friday, May 12, 2023 10:11 AM
> > > > > > To: devel@edk2.groups.io
> > > > > > Cc: Guo, Gua 
> > > > > > Subject: [PATCH v1 0/1] Maintainers.txt: Update reviewers and
> > > > > > maintainer
> > > > > for
> > > > > > FdtLib
> > > > > >
> > > > > > From: Gua Guo 
> > > > > >
> > > > > > V1
> > > > > >   PR: https://github.com/tianocore/edk2/pull/4389
> > > > > >   Maintainer: Benny Lin 
> > > > > >   Reviewer: Gua Guo 
> > > > > >   Reviewer: Chasel Chiu 
> > > > > >   Reviewer: James Lu 
> > > > > >
> > > > > > Gua Guo (1):
> > > > > >   Maintainers.txt: Update reviewers and maintainers for FdtLib.
> > Update
> > > > > > reviewers and maintainers for FdtLib.
> > > > > >
> > > > > >  Maintainers.txt | 8 
> > > > > >  1 file changed, 8 insertions(+)
> > > > > >
> > > > > > --
> > > > > > 2.39.2.windows.1
> > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > >
> > > >
> > > >
> > > >
> > > >
> > > >
> > > >
> > >
> > >
> > >
> > >
> > >
> >
> >
> >
> > 
> >
> 
> 



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#104895): https://edk2.groups.io/g/devel/message/104895
Mute This Topic: https://groups.io/mt/98911699/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




[edk2-devel] [PATCH 4/4] ReadMe.rst: Update the list of submodules used in EDK II

2023-05-15 Thread Rebecca Cran
Update the list of submodules used in EDK II, since several have been
added in recent years.

Signed-off-by: Rebecca Cran 
---
 ReadMe.rst | 6 ++
 1 file changed, 6 insertions(+)

diff --git a/ReadMe.rst b/ReadMe.rst
index 56bf928cdf1b..cad7d5c5a314 100644
--- a/ReadMe.rst
+++ b/ReadMe.rst
@@ -251,6 +251,12 @@ as much as possible. Currently EDK II contains the 
following submodules
 -  MdeModulePkg/Universal/RegularExpressionDxe/oniguruma
 -  MdeModulePkg/Library/BrotliCustomDecompressLib/brotli
 -  BaseTools/Source/C/BrotliCompress/brotli
+-  MdePkg/Library/BaseFdtLib/libfdt
+-  MdePkg/Library/MipiSysTLib/mipisyst
+-  RedfishPkg/Library/JsonLib/jansson
+-  UnitTestFrameworkPkg/Library/CmockaLib/cmocka
+-  UnitTestFrameworkPkg/Library/GoogleTestLib/googletest
+-  UnitTestFrameworkPkg/Library/SubhookLib/subhook
 
 ArmSoftFloatLib is actually required by OpensslLib. It's inevitable
 in openssl-1.1.1 (since stable201905) for floating point parameter
-- 
2.39.2



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#104894): https://edk2.groups.io/g/devel/message/104894
Mute This Topic: https://groups.io/mt/98906823/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




[edk2-devel] [PATCH 2/4] ReadMe.rst: Fix link to Python-2.0 license

2023-05-15 Thread Rebecca Cran
The Python-2.0 license is now at
https://opensource.org/license/pythonsoftfoundation-php/ .

Update ReadMe.rst to fix the link.

Signed-off-by: Rebecca Cran 
---
 ReadMe.rst | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/ReadMe.rst b/ReadMe.rst
index c1010b38ccd3..9ef1d432eca6 100644
--- a/ReadMe.rst
+++ b/ReadMe.rst
@@ -137,7 +137,7 @@ To make a contribution to a TianoCore project, follow these 
steps.
 -  BSD (2-clause): http://opensource.org/licenses/BSD-2-Clause
 -  BSD (3-clause): http://opensource.org/licenses/BSD-3-Clause
 -  MIT: http://opensource.org/licenses/MIT
--  Python-2.0: http://opensource.org/licenses/Python-2.0
+-  Python-2.0: https://opensource.org/license/pythonsoftfoundation-php
 -  Zlib: http://opensource.org/licenses/Zlib
 
 For documentation:
-- 
2.39.2



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#104892): https://edk2.groups.io/g/devel/message/104892
Mute This Topic: https://groups.io/mt/98906821/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




[edk2-devel] [PATCH 3/4] ReadMe.rst: Improve some grammar

2023-05-15 Thread Rebecca Cran
Improve some of the grammar in ReadMe.rst.

Signed-off-by: Rebecca Cran 
---
 ReadMe.rst | 10 +-
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/ReadMe.rst b/ReadMe.rst
index 9ef1d432eca6..56bf928cdf1b 100644
--- a/ReadMe.rst
+++ b/ReadMe.rst
@@ -243,8 +243,8 @@ Definitions for sample patch email
 Submodules
 --
 
-Submodule in EDK II is allowed but submodule chain should be avoided
-as possible as we can. Currently EDK II contains the following submodules
+Submodules in EDK II are allowed but submodule chains should be avoided
+as much as possible. Currently EDK II contains the following submodules
 
 -  CryptoPkg/Library/OpensslLib/openssl
 -  ArmPkg/Library/ArmSoftFloatLib/berkeley-softfloat-3
@@ -257,8 +257,8 @@ in openssl-1.1.1 (since stable201905) for floating point 
parameter
 conversion, but should be dropped once there's no such need in future
 release of openssl.
 
-To get a full, buildable EDK II repository, use following steps of git
-command
+To get a full, buildable EDK II repository, use the following git
+commands
 
 .. code-block:: bash
 
@@ -267,7 +267,7 @@ command
   git submodule update --init
   cd ..
 
-If there's update for submodules, use following git commands to get
+If there's an update for submodules, use the following git commands to get
 the latest submodules code.
 
 .. code-block:: bash
-- 
2.39.2



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#104893): https://edk2.groups.io/g/devel/message/104893
Mute This Topic: https://groups.io/mt/98906822/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




[edk2-devel] [PATCH 0/4] ReadMe.rst improvements/fixes

2023-05-15 Thread Rebecca Cran
Make some improvements to ReadMe.rst:

- Avoid a potential redirect from http to https.
- Fix Python-2.0 license link.
- Improve grammar in a couple of paragraphs.
- Update the list of submodules.

Rebecca Cran (4):
  ReadMe.rst: Update link to tianocore.org to use https
  ReadMe.rst: Fix link to Python-2.0 license
  ReadMe.rst: Improve some grammar
  ReadMe.rst: Update the list of submodules used in EDK II

 ReadMe.rst | 20 +---
 1 file changed, 13 insertions(+), 7 deletions(-)

-- 
2.39.2



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#104890): https://edk2.groups.io/g/devel/message/104890
Mute This Topic: https://groups.io/mt/98906818/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




[edk2-devel] [PATCH 1/4] ReadMe.rst: Update link to tianocore.org to use https

2023-05-15 Thread Rebecca Cran
Update the link to tianocore.org to use https and avoid a potential
redirect from http to https.

Signed-off-by: Rebecca Cran 
---
 ReadMe.rst | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/ReadMe.rst b/ReadMe.rst
index ed1d4822459b..c1010b38ccd3 100644
--- a/ReadMe.rst
+++ b/ReadMe.rst
@@ -105,7 +105,7 @@ are listed in `Maintainers.txt `__.
 Resources
 -
 
--  `TianoCore `__
+-  `TianoCore `__
 -  `EDK
II `__
 -  `Getting Started with EDK
-- 
2.39.2



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#104891): https://edk2.groups.io/g/devel/message/104891
Mute This Topic: https://groups.io/mt/98906819/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [PATCH 1/1] MdePkg/Base.h: Simply alignment expressions

2023-05-15 Thread Rebecca Cran
I wasn’t aware of the history, so I agree with keeping it.

— 
Rebecca Cran

On Mon, May 15, 2023, at 9:29 AM, Pedro Falcato wrote:
> On Mon, May 15, 2023 at 4:20 PM Marvin Häuser  wrote:
>>
>> Well, I explicitly added this macro as a prerequisite to code used in our 
>> new PE library (remember this patch was initially sent in 2021). We still 
>> require it downstream, but obviously upstream is not interested in the 
>> related contributions that were to follow at the time.
>>
>> Gerd picked it up because he wanted to attempt to re-try contributing the 
>> new PE library, but I haven't heard from him in weeks.
>>
>> Design-wise, I agree it could be removed again. However, there first was a 
>> downstream burden when adding it (as we needed to rewrite our history to 
>> drop our downstream patch in favour of the upstream solution). Now 
>> introducing another downstream burden *again* to remove the macro that was 
>> added only a few weeks back would be a sign of poor management and planning.
>
> I don't agree with the removal of the macro. It's useful enough to
> consumers of Base.h, and clearly there's code that is indeed actively
> using it.
>
> It's also a single line of code.
>
> -- 
> Pedro
>
>
> 


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#104889): https://edk2.groups.io/g/devel/message/104889
Mute This Topic: https://groups.io/mt/98904940/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [PATCH 1/1] MdePkg/Base.h: Simply alignment expressions

2023-05-15 Thread Pedro Falcato
On Mon, May 15, 2023 at 4:20 PM Marvin Häuser  wrote:
>
> Well, I explicitly added this macro as a prerequisite to code used in our new 
> PE library (remember this patch was initially sent in 2021). We still require 
> it downstream, but obviously upstream is not interested in the related 
> contributions that were to follow at the time.
>
> Gerd picked it up because he wanted to attempt to re-try contributing the new 
> PE library, but I haven't heard from him in weeks.
>
> Design-wise, I agree it could be removed again. However, there first was a 
> downstream burden when adding it (as we needed to rewrite our history to drop 
> our downstream patch in favour of the upstream solution). Now introducing 
> another downstream burden *again* to remove the macro that was added only a 
> few weeks back would be a sign of poor management and planning.

I don't agree with the removal of the macro. It's useful enough to
consumers of Base.h, and clearly there's code that is indeed actively
using it.

It's also a single line of code.

-- 
Pedro


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#104888): https://edk2.groups.io/g/devel/message/104888
Mute This Topic: https://groups.io/mt/98904940/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [PATCH 1/1] Maintainers: add myself as reviewer for sbsa-ref

2023-05-15 Thread Pedro Falcato
+CC Mike Kinney
Please use BaseTools/Scripts/GetMaintainers.py in the future to get
the correct CC's for your patches!

On Mon, May 15, 2023 at 3:34 PM Marcin Juszkiewicz
 wrote:
>
> At Linaro I work on sbsa-ref, know direction it goes.
>
> May not get code details each time.
>
> Signed-off-by: Marcin Juszkiewicz 
> ---
>  Maintainers.txt | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/Maintainers.txt b/Maintainers.txt
> index 24918d1c6ede..d1d75fe6c940 100644
> --- a/Maintainers.txt
> +++ b/Maintainers.txt
> @@ -375,6 +375,7 @@ M: Ard Biesheuvel 
>  M: Leif Lindholm 
>  R: Graeme Gregory 
>  R: Radoslaw Biernacki 
> +R: Marcin Juszkiewicz 
>
>  Raspberry Pi platforms and silicon
>  F: Platform/RaspberryPi/
> --
> 2.40.1
>
>
>
> 
> Groups.io Links: You receive all messages sent to this group.
> View/Reply Online (#104882): https://edk2.groups.io/g/devel/message/104882
> Mute This Topic: https://groups.io/mt/98904609/5946980
> Group Owner: devel+ow...@edk2.groups.io
> Unsubscribe: https://edk2.groups.io/g/devel/unsub [pedro.falc...@gmail.com]
> 
>
>


-- 
Pedro


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#104887): https://edk2.groups.io/g/devel/message/104887
Mute This Topic: https://groups.io/mt/98904609/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [PATCH 1/1] MdePkg/Base.h: Simply alignment expressions

2023-05-15 Thread Marvin Häuser
Well, I explicitly added this macro as a prerequisite to code used in our new 
PE library (remember this patch was initially sent in 2021). We still require 
it downstream, but obviously upstream is not interested in the related 
contributions that were to follow at the time.

Gerd picked it up because he wanted to attempt to re-try contributing the new 
PE library, but I haven't heard from him in weeks.

Design-wise, I agree it could be removed again. However, there first was a 
downstream burden when adding it (as we needed to rewrite our history to drop 
our downstream patch in favour of the upstream solution). Now introducing 
another downstream burden *again* to remove the macro that was added only a few 
weeks back would be a sign of poor management and planning.

Best regards,
Marvin

> On 15. May 2023, at 17:15, Rebecca Cran  wrote:
> 
> On 5/15/23 08:45, Pedro Falcato wrote:
>> -#define ALIGN_VALUE_ADDEND(Value, Alignment)  (((Alignment) - (Value)) & 
>> ((Alignment) - 1U))
>> +#define ALIGN_VALUE_ADDEND(Value, Alignment)  ((~(Value)) & ((Alignment) - 
>> 1U))
>>/**
>>Rounds a value up to the next boundary using a specified alignment.
>> @@ -945,7 +945,7 @@ STATIC_ASSERT (ALIGNOF (__VERIFY_INT32_ENUM_SIZE) == 
>> sizeof (__VERIFY_INT32_ENUM
>>@return  A value up to the next boundary.
>>**/
>> -#define ALIGN_VALUE(Value, Alignment)  ((Value) + ALIGN_VALUE_ADDEND 
>> (Value, Alignment))
>> +#define ALIGN_VALUE(Value, Alignment)  (((Value) + (Alignment - 1)) & 
>> ~(Alignment))
> 
> Since ALIGN_VALUE_ADDEND is only used in ALIGN_VALUE, it should probably be 
> deleted instead of updated.
> 
> 
> -- 
> 
> Rebecca Cran
> 



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#104886): https://edk2.groups.io/g/devel/message/104886
Mute This Topic: https://groups.io/mt/98904940/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [PATCH 1/1] MdePkg/Base.h: Simply alignment expressions

2023-05-15 Thread Rebecca Cran

On 5/15/23 08:45, Pedro Falcato wrote:

-#define ALIGN_VALUE_ADDEND(Value, Alignment)  (((Alignment) - (Value)) & 
((Alignment) - 1U))
+#define ALIGN_VALUE_ADDEND(Value, Alignment)  ((~(Value)) & ((Alignment) - 1U))
  
  /**

Rounds a value up to the next boundary using a specified alignment.
@@ -945,7 +945,7 @@ STATIC_ASSERT (ALIGNOF (__VERIFY_INT32_ENUM_SIZE) == sizeof 
(__VERIFY_INT32_ENUM
@return  A value up to the next boundary.
  
  **/

-#define ALIGN_VALUE(Value, Alignment)  ((Value) + ALIGN_VALUE_ADDEND (Value, 
Alignment))
+#define ALIGN_VALUE(Value, Alignment)  (((Value) + (Alignment - 1)) & 
~(Alignment))


Since ALIGN_VALUE_ADDEND is only used in ALIGN_VALUE, it should probably 
be deleted instead of updated.



--

Rebecca Cran



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#104885): https://edk2.groups.io/g/devel/message/104885
Mute This Topic: https://groups.io/mt/98904940/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




[edk2-devel] [PATCH v2 1/1] MdePkg/Base.h: Simply alignment expressions

2023-05-15 Thread Pedro Falcato
Simplify ALIGN_VALUE and ALIGN_VALUE_ADDEND into simpler expressions.

ALIGN_VALUE can simply be a (value + (align - 1)) & ~align
expression, which works for any power of 2 alignment and generates
smaller code sequences. For instance:
ALIGN_VALUE(15, 16) = (15 + 15) & ~16 = 16
ALIGN_VALUE(16, 16) = (16 + 15) & ~16 = 16

Old codegen:
movq%rdi, %rax
negq%rax
andl$15, %eax
addq%rdi, %rax

New codegen:
leaq15(%rdi), %rax
andq$-16, %rax

ALIGN_VALUE_ADDEND can simply use a bitwise NOT of Value to get the
addend for alignment, as, for instance:
~15 & (16 - 1) = 1
15 + 1 = 16

This change does not necessarily affect the end result, as the GCC and
clang compilers were already able to see through things and optimize
them into optimal instruction sequences, in the ALIGN_VALUE_ADDEND case.

Cc: Michael D Kinney 
Cc: Liming Gao 
Cc: Zhiguang Liu 
Cc: Marvin Häuser 
Signed-off-by: Pedro Falcato 
---

v2:
Addressed concerns expressed on Discord by Marvin
- Added missing parens around Alignment in ALIGN_VALUE
- Replaced -1 with -1U, as in the other macros.

 MdePkg/Include/Base.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/MdePkg/Include/Base.h b/MdePkg/Include/Base.h
index 6597e441a6e2..422f80aff53d 100644
--- a/MdePkg/Include/Base.h
+++ b/MdePkg/Include/Base.h
@@ -931,7 +931,7 @@ STATIC_ASSERT (ALIGNOF (__VERIFY_INT32_ENUM_SIZE) == sizeof 
(__VERIFY_INT32_ENUM
 
   @return  Addend to round Value up to alignment boundary Alignment.
 **/
-#define ALIGN_VALUE_ADDEND(Value, Alignment)  (((Alignment) - (Value)) & 
((Alignment) - 1U))
+#define ALIGN_VALUE_ADDEND(Value, Alignment)  ((~(Value)) & ((Alignment) - 1U))
 
 /**
   Rounds a value up to the next boundary using a specified alignment.
@@ -945,7 +945,7 @@ STATIC_ASSERT (ALIGNOF (__VERIFY_INT32_ENUM_SIZE) == sizeof 
(__VERIFY_INT32_ENUM
   @return  A value up to the next boundary.
 
 **/
-#define ALIGN_VALUE(Value, Alignment)  ((Value) + ALIGN_VALUE_ADDEND (Value, 
Alignment))
+#define ALIGN_VALUE(Value, Alignment)  (((Value) + ((Alignment) - 1U)) & 
~(Alignment))
 
 /**
   Adjust a pointer by adding the minimum offset required for it to be aligned 
on
-- 
2.40.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#104884): https://edk2.groups.io/g/devel/message/104884
Mute This Topic: https://groups.io/mt/98905642/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




[edk2-devel] [PATCH 1/1] MdePkg/Base.h: Simply alignment expressions

2023-05-15 Thread Pedro Falcato
Simplify ALIGN_VALUE and ALIGN_VALUE_ADDEND into simpler expressions.

ALIGN_VALUE can simply be a (value + (align - 1)) & ~align
expression, which works for any power of 2 alignment and generates
smaller code sequences. For instance:
ALIGN_VALUE(15, 16) = (15 + 15) & ~16 = 16
ALIGN_VALUE(16, 16) = (16 + 15) & ~16 = 16

Old codegen:
movq%rdi, %rax
negq%rax
andl$15, %eax
addq%rdi, %rax

New codegen:
leaq15(%rdi), %rax
andq$-16, %rax

ALIGN_VALUE_ADDEND can simply use a bitwise NOT of Value to get the
addend for alignment, as, for instance:
~15 & (16 - 1) = 1
15 + 1 = 16

This change does not necessarily affect the end result, as the GCC and
clang compilers were already able to see through things and optimize
them into optimal instruction sequences, in the ALIGN_VALUE_ADDEND case.

Cc: Michael D Kinney 
Cc: Liming Gao 
Cc: Zhiguang Liu 
Cc: Marvin Häuser 
Signed-off-by: Pedro Falcato 
---
 MdePkg/Include/Base.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/MdePkg/Include/Base.h b/MdePkg/Include/Base.h
index 6597e441a6e2..eba1178e3497 100644
--- a/MdePkg/Include/Base.h
+++ b/MdePkg/Include/Base.h
@@ -931,7 +931,7 @@ STATIC_ASSERT (ALIGNOF (__VERIFY_INT32_ENUM_SIZE) == sizeof 
(__VERIFY_INT32_ENUM
 
   @return  Addend to round Value up to alignment boundary Alignment.
 **/
-#define ALIGN_VALUE_ADDEND(Value, Alignment)  (((Alignment) - (Value)) & 
((Alignment) - 1U))
+#define ALIGN_VALUE_ADDEND(Value, Alignment)  ((~(Value)) & ((Alignment) - 1U))
 
 /**
   Rounds a value up to the next boundary using a specified alignment.
@@ -945,7 +945,7 @@ STATIC_ASSERT (ALIGNOF (__VERIFY_INT32_ENUM_SIZE) == sizeof 
(__VERIFY_INT32_ENUM
   @return  A value up to the next boundary.
 
 **/
-#define ALIGN_VALUE(Value, Alignment)  ((Value) + ALIGN_VALUE_ADDEND (Value, 
Alignment))
+#define ALIGN_VALUE(Value, Alignment)  (((Value) + (Alignment - 1)) & 
~(Alignment))
 
 /**
   Adjust a pointer by adding the minimum offset required for it to be aligned 
on
-- 
2.40.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#104883): https://edk2.groups.io/g/devel/message/104883
Mute This Topic: https://groups.io/mt/98904940/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




[edk2-devel] [PATCH 1/1] Maintainers: add myself as reviewer for sbsa-ref

2023-05-15 Thread Marcin Juszkiewicz
At Linaro I work on sbsa-ref, know direction it goes.

May not get code details each time.

Signed-off-by: Marcin Juszkiewicz 
---
 Maintainers.txt | 1 +
 1 file changed, 1 insertion(+)

diff --git a/Maintainers.txt b/Maintainers.txt
index 24918d1c6ede..d1d75fe6c940 100644
--- a/Maintainers.txt
+++ b/Maintainers.txt
@@ -375,6 +375,7 @@ M: Ard Biesheuvel 
 M: Leif Lindholm 
 R: Graeme Gregory 
 R: Radoslaw Biernacki 
+R: Marcin Juszkiewicz 
 
 Raspberry Pi platforms and silicon
 F: Platform/RaspberryPi/
-- 
2.40.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#104882): https://edk2.groups.io/g/devel/message/104882
Mute This Topic: https://groups.io/mt/98904609/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [PATCH] RedfishPkg/RedfishPlatformConfigDxe: Fix string assert issue

2023-05-15 Thread Igor Kulchytskyy via groups.io
Reviewed-by: Igor Kulchytskyy 

-Original Message-
From: Nickle Wang 
Sent: Monday, May 15, 2023 12:25 AM
To: devel@edk2.groups.io
Cc: Abner Chang ; Igor Kulchytskyy 
Subject: [EXTERNAL] [PATCH] RedfishPkg/RedfishPlatformConfigDxe: Fix string 
assert issue


**CAUTION: The e-mail below is from an external source. Please exercise caution 
before opening attachments, clicking links, or following guidance.**

When calling SetValue() with string type input, there is
assertion of providing zero string ID to HII string function.
Fix this issue by creating string ID for input string buffer.
Fix Unicode and Ascii code convert issue together.
Add text op-code support

Signed-off-by: Nickle Wang 
Cc: Abner Chang 
Cc: Igor Kulchytskyy 
---
 .../RedfishPlatformConfigDxe.h|  14 +++
 .../RedfishPlatformConfigImpl.h   |  16 +++
 .../RedfishPlatformConfigDxe.c| 116 --
 .../RedfishPlatformConfigImpl.c   |  50 +---
 4 files changed, 169 insertions(+), 27 deletions(-)

diff --git a/RedfishPkg/RedfishPlatformConfigDxe/RedfishPlatformConfigDxe.h 
b/RedfishPkg/RedfishPlatformConfigDxe/RedfishPlatformConfigDxe.h
index 67697ecda787..c86bc6e9ce2d 100644
--- a/RedfishPkg/RedfishPlatformConfigDxe/RedfishPlatformConfigDxe.h
+++ b/RedfishPkg/RedfishPlatformConfigDxe/RedfishPlatformConfigDxe.h
@@ -78,4 +78,18 @@ typedef struct {
 #define REDFISH_PLATFORM_CONFIG_DEBUGDEBUG_VERBOSE
 #define REDFISH_MENU_PATH_SIZE   8

+/**
+  Convert input unicode string to ascii string. It's caller's
+  responsibility to free returned buffer using FreePool().
+
+  @param[in]  UnicodeString Unicode string to be converted.
+
+  @retval CHAR8 *   Ascii string on return.
+
+**/
+CHAR8 *
+StrToAsciiStr (
+  IN  EFI_STRING  UnicodeString
+  );
+
 #endif
diff --git a/RedfishPkg/RedfishPlatformConfigDxe/RedfishPlatformConfigImpl.h 
b/RedfishPkg/RedfishPlatformConfigDxe/RedfishPlatformConfigImpl.h
index 9ef032748663..9f4312decf50 100644
--- a/RedfishPkg/RedfishPlatformConfigDxe/RedfishPlatformConfigImpl.h
+++ b/RedfishPkg/RedfishPlatformConfigDxe/RedfishPlatformConfigImpl.h
@@ -250,6 +250,22 @@ ProcessPendingList (
   IN  LIST_ENTRY  *PendingList
   );

+/**
+  Delete a string from HII Package List by given HiiHandle.
+
+  @param[in]  StringId   Id of the string in HII database.
+  @param[in]  HiiHandle  The HII package list handle.
+
+  @retval EFI_SUCCESSThe string was deleted successfully.
+  @retval EFI_INVALID_PARAMETER  StringId is zero.
+
+**/
+EFI_STATUS
+HiiDeleteString (
+  IN  EFI_STRING_ID   StringId,
+  IN  EFI_HII_HANDLE  HiiHandle
+  );
+
 /**
   Retrieves a unicode string from a string package in a given language. The
   returned string is allocated using AllocatePool().  The caller is responsible
diff --git a/RedfishPkg/RedfishPlatformConfigDxe/RedfishPlatformConfigDxe.c 
b/RedfishPkg/RedfishPlatformConfigDxe/RedfishPlatformConfigDxe.c
index d3902f4127c1..1172d1094b06 100644
--- a/RedfishPkg/RedfishPlatformConfigDxe/RedfishPlatformConfigDxe.c
+++ b/RedfishPkg/RedfishPlatformConfigDxe/RedfishPlatformConfigDxe.c
@@ -1172,6 +1172,7 @@ HiiValueToRedfishValue (
   UINTN  Index;
   UINTN  Count;
   EFI_STRING_ID  *StringIdArray;
+  CHAR8  NullChar;

   if ((HiiHandle == NULL) || (HiiStatement == NULL) || (Value == NULL) || 
(RedfishValue == NULL) || IS_EMPTY_STRING (FullSchema)) {
 return EFI_INVALID_PARAMETER;
@@ -1180,6 +1181,7 @@ HiiValueToRedfishValue (
   StringIdArray = NULL;
   Count = 0;
   Status= EFI_SUCCESS;
+  NullChar  = '\0';

   switch (HiiStatement->Operand) {
 case EFI_IFR_ONE_OF_OP:
@@ -1205,9 +1207,18 @@ HiiValueToRedfishValue (
 break;
   }

-  RedfishValue->Type = RedfishValueTypeString;
-  RedfishValue->Value.Buffer = AllocatePool (StrLen ((CHAR16 
*)Value->Buffer) + 1);
-  UnicodeStrToAsciiStrS ((CHAR16 *)Value->Buffer, 
RedfishValue->Value.Buffer, StrLen ((CHAR16 *)Value->Buffer) + 1);
+  if (Value->Buffer == NULL) {
+RedfishValue->Value.Buffer = AllocateCopyPool (sizeof (NullChar), 
);
+  } else {
+RedfishValue->Value.Buffer = StrToAsciiStr ((EFI_STRING)Value->Buffer);
+  }
+
+  if (RedfishValue->Value.Buffer == NULL) {
+Status = EFI_OUT_OF_RESOURCES;
+break;
+  }
+
+  RedfishValue->Type = RedfishValueTypeString;
   break;
 case EFI_IFR_CHECKBOX_OP:
 case EFI_IFR_NUMERIC_OP:
@@ -1256,6 +1267,30 @@ HiiValueToRedfishValue (

   FreePool (StringIdArray);
   break;
+case EFI_IFR_TEXT_OP:
+  //
+  // Use text two as the value
+  //
+  if (HiiStatement->ExtraData.TextTwo == 0x00) {
+Status = EFI_NOT_FOUND;
+break;
+  }
+
+  RedfishValue->Value.Buffer = HiiGetRedfishAsciiString (HiiHandle, 
FullSchema, HiiStatement->ExtraData.TextTwo);
+  if (RedfishValue->Value.Buffer == NULL) {
+//

Re: [edk2-devel] [PATCH edk2-platforms 1/2] Platform/Intel/WhiskeylakeOpenBoardPkg: Fix ALIGN16 macro

2023-05-15 Thread Rebecca Cran

On 5/15/23 07:22, Pedro Falcato wrote:


As I mentioned on Discord, ALIGN16 should not need a branch like this.
I propose switching ALIGN16 to use ALIGN_VALUE, or if you need compat
with older edk2s, even:

#define ALIGN16(size) (((size) + 15) & -16)

Which is a common enough pattern that it hopefully is self-explanatory.


Thanks. I realized ALIGN16 isn't even used anymore, so I've just sent 
out a v2 patch to just delete them.



--

Rebecca Cran



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#104880): https://edk2.groups.io/g/devel/message/104880
Mute This Topic: https://groups.io/mt/98897866/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




[edk2-devel] [PATCH edk2-platforms v2 1/2] Platform/Intel: Delete ALIGN16 macro

2023-05-15 Thread Rebecca Cran
The IS_ALIGNED macro defined in PlatformBoardConfig.h conflicts with the
definition from MdePkg/Include/Base.h.

Since the definitions in CometlakeOpenBoardPkg and
WhiskeylakeOpenBoardPkg aren't used, delete them.

Signed-off-by: Rebecca Cran 
---
 
Platform/Intel/CometlakeOpenBoardPkg/CometlakeURvp/Include/PlatformBoardConfig.h
 | 3 ---
 
Platform/Intel/WhiskeylakeOpenBoardPkg/WhiskeylakeURvp/Include/PlatformBoardConfig.h
 | 3 ---
 2 files changed, 6 deletions(-)

diff --git 
a/Platform/Intel/CometlakeOpenBoardPkg/CometlakeURvp/Include/PlatformBoardConfig.h
 
b/Platform/Intel/CometlakeOpenBoardPkg/CometlakeURvp/Include/PlatformBoardConfig.h
index 4d286b897ad7..10f4d8d45861 100644
--- 
a/Platform/Intel/CometlakeOpenBoardPkg/CometlakeURvp/Include/PlatformBoardConfig.h
+++ 
b/Platform/Intel/CometlakeOpenBoardPkg/CometlakeURvp/Include/PlatformBoardConfig.h
@@ -15,9 +15,6 @@
 #include 
 #include 
 
-#define IS_ALIGNED(addr, size) (((addr) & (size - 1)) ? 0 : 1)
-#define ALIGN16(size)  (IS_ALIGNED(size, 16) ? size : ((size + 16) & 
0xFFF0))
-
 #define BOARD_CONFIG_BLOCK_PEI_PREMEM_VERSION  0x0001
 #define BOARD_CONFIG_BLOCK_PEI_POSTMEM_VERSION 0x0001
 #define BOARD_CONFIG_BLOCK_DXE_VERSION 0x0001
diff --git 
a/Platform/Intel/WhiskeylakeOpenBoardPkg/WhiskeylakeURvp/Include/PlatformBoardConfig.h
 
b/Platform/Intel/WhiskeylakeOpenBoardPkg/WhiskeylakeURvp/Include/PlatformBoardConfig.h
index 44b4059f8ebf..e8bd003af79c 100644
--- 
a/Platform/Intel/WhiskeylakeOpenBoardPkg/WhiskeylakeURvp/Include/PlatformBoardConfig.h
+++ 
b/Platform/Intel/WhiskeylakeOpenBoardPkg/WhiskeylakeURvp/Include/PlatformBoardConfig.h
@@ -15,9 +15,6 @@
 #include 
 #include 
 
-#define IS_ALIGNED(addr, size) (((addr) & (size - 1)) ? 0 : 1)
-#define ALIGN16(size)  (IS_ALIGNED(size, 16) ? size : ((size + 16) & 
0xFFF0))
-
 #define BOARD_CONFIG_BLOCK_PEI_PREMEM_VERSION  0x0001
 #define BOARD_CONFIG_BLOCK_PEI_POSTMEM_VERSION 0x0001
 #define BOARD_CONFIG_BLOCK_DXE_VERSION 0x0001
-- 
2.39.2



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#104878): https://edk2.groups.io/g/devel/message/104878
Mute This Topic: https://groups.io/mt/98903763/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




[edk2-devel] [PATCH edk2-platforms v2 2/2] Platform/Intel/WhiskeylakeOpenBoardPkg: Delete unused include files

2023-05-15 Thread Rebecca Cran
The following include files appear to be unused, since the build system
uses the corresponding files under WhiskeylakeOpenBoardPkg/Include
instead:

WhiskeylakeOpenBoardPkg/UpXtreme/Include/Library/PeiPlatformHookLib.h
WhiskeylakeOpenBoardPkg/UpXtreme/Include/Library/PeiPlatformLib.h
WhiskeylakeOpenBoardPkg/UpXtreme/Include/PlatformBoardConfig.h
WhiskeylakeOpenBoardPkg/UpXtreme/Include/PlatformInfo.h

Since they're unused and could cause confusion, delete them.

Signed-off-by: Rebecca Cran 
---
 
Platform/Intel/WhiskeylakeOpenBoardPkg/UpXtreme/Include/Library/PeiPlatformHookLib.h
 | 131 
 
Platform/Intel/WhiskeylakeOpenBoardPkg/UpXtreme/Include/Library/PeiPlatformLib.h
 |  38 --
 Platform/Intel/WhiskeylakeOpenBoardPkg/UpXtreme/Include/PlatformBoardConfig.h  
  | 103 ---
 Platform/Intel/WhiskeylakeOpenBoardPkg/UpXtreme/Include/PlatformInfo.h 
  |  42 ---
 4 files changed, 314 deletions(-)

diff --git 
a/Platform/Intel/WhiskeylakeOpenBoardPkg/UpXtreme/Include/Library/PeiPlatformHookLib.h
 
b/Platform/Intel/WhiskeylakeOpenBoardPkg/UpXtreme/Include/Library/PeiPlatformHookLib.h
deleted file mode 100644
index febccdf48282..
--- 
a/Platform/Intel/WhiskeylakeOpenBoardPkg/UpXtreme/Include/Library/PeiPlatformHookLib.h
+++ /dev/null
@@ -1,131 +0,0 @@
-/** @file
-  UP Xtreme Platform Hook library.
-
-  Copyright (c) 2020, Intel Corporation. All rights reserved.
-  SPDX-License-Identifier: BSD-2-Clause-Patent
-**/
-
-#ifndef _PEI_PLATFORM_HOOK_LIB_H_
-#define _PEI_PLATFORM_HOOK_LIB_H_
-
-#include 
-#include 
-#include 
-
-// EC Command to provide one byte of debug indication
-#define BSSB_DEBUG_INDICATION 0xAE
-/**
-  Configure EC for specific devices
-
-  @param[in] PchLan   - The PchLan of PCH_SETUP variable.
-  @param[in] BootMode - The current boot mode.
-**/
-VOID
-EcInit (
-  IN UINT8PchLan,
-  IN EFI_BOOT_MODEBootMode
-  );
-
-/**
-  Checks if Premium PMIC present
-
-  @retval  TRUE  if present
-  @retval  FALSE it discrete/other PMIC
-**/
-BOOLEAN
-IsPremiumPmicPresent (
-  VOID
-  );
-
-/**
-  Pmic Programming to supprort LPAL Feature
-
-  @retval NONE
-**/
-VOID
-PremiumPmicDisableSlpS0Voltage (
-  VOID
-  );
-
-/**
-Pmic Programming to supprort LPAL Feature
-  @retval NONE
-**/
-VOID
-PremiumPmicEnableSlpS0Voltage(
-  VOID
-  );
-
-/**
-  Do platform specific programming pre-memory. For example, EC init, Chipset 
programming
-
-  @retval  Status
-**/
-EFI_STATUS
-PlatformSpecificInitPreMem (
-  VOID
-  );
-
-/**
-  Do platform specific programming post-memory.
-
-  @retval  Status
-**/
-EFI_STATUS
-PlatformSpecificInit (
-  VOID
-  );
-
-/**
-  Configure GPIO and SIO Before Memory is ready.
-
-  @retval  EFI_SUCCESS   Operation success.
-**/
-EFI_STATUS
-BoardInitPreMem (
-  VOID
-  );
-
-/**
-  Configure GPIO and SIO
-
-  @retval  EFI_SUCCESS   Operation success.
-**/
-EFI_STATUS
-BoardInit (
-  VOID
-  );
-
-/**
-Voltage Margining Routine
-
-@retval  EFI_SUCCESS   Operation success
-**/
-EFI_STATUS
-VoltageMarginingRoutine(
-  VOID
-  );
-
-/**
-  Detect recovery mode
-
-  @retval  EFI_SUCCESS   System in Recovery Mode
-  @retval  EFI_UNSUPPORTED   System doesn't support Recovery Mode
-  @retval  EFI_NOT_FOUND System is not in Recovery Mode
-**/
-EFI_STATUS
-IsRecoveryMode (
-  VOID
-  );
-
-/**
-  Early board Configuration before Memory is ready.
-
-  @retval  EFI_SUCCESS  Operation success.
-**/
-EFI_STATUS
-BoardInitEarlyPreMem (
-  VOID
-  );
-
-#endif
diff --git 
a/Platform/Intel/WhiskeylakeOpenBoardPkg/UpXtreme/Include/Library/PeiPlatformLib.h
 
b/Platform/Intel/WhiskeylakeOpenBoardPkg/UpXtreme/Include/Library/PeiPlatformLib.h
deleted file mode 100644
index 2514d2ec444b..
--- 
a/Platform/Intel/WhiskeylakeOpenBoardPkg/UpXtreme/Include/Library/PeiPlatformLib.h
+++ /dev/null
@@ -1,38 +0,0 @@
-/** @file
-  UP Xtreme platform library.
-
-  Copyright (c) 2020, Intel Corporation. All rights reserved.
-  SPDX-License-Identifier: BSD-2-Clause-Patent
-**/
-
-#ifndef _PEI_PLATFORM_LIB_H_
-#define _PEI_PLATFORM_LIB_H_
-
-#define PEI_DEVICE_DISABLED 0
-#define PEI_DEVICE_ENABLED  1
-
-typedef struct {
-  UINT8   Register;
-  UINT32  Value;
-} PCH_GPIO_DEV;
-
-//
-// GPIO Initialization Data Structure
-//
-typedef struct{
-  PCH_GPIO_DEV Use_Sel;
-  PCH_GPIO_DEV Use_Sel2;
-  PCH_GPIO_DEV Use_Sel3;
-  PCH_GPIO_DEV Io_Sel;
-  PCH_GPIO_DEV Io_Sel2;
-  PCH_GPIO_DEV Io_Sel3;
-  PCH_GPIO_DEV Lvl;
-  PCH_GPIO_DEV Lvl2;
-  PCH_GPIO_DEV Lvl3;
-  PCH_GPIO_DEV Inv;
-  PCH_GPIO_DEV Blink;
-  PCH_GPIO_DEV Rst_Sel;
-  PCH_GPIO_DEV Rst_Sel2;
-} GPIO_INIT_STRUCT;
-
-#endif
diff --git 
a/Platform/Intel/WhiskeylakeOpenBoardPkg/UpXtreme/Include/PlatformBoardConfig.h 
b/Platform/Intel/WhiskeylakeOpenBoardPkg/UpXtreme/Include/PlatformBoardConfig.h
deleted file mode 100644
index db6024a1e49d..
--- 
a/Platform/Intel/WhiskeylakeOpenBoardPkg/UpXtreme/Include/PlatformBoardConfig.h
+++ /dev/null
@@ 

[edk2-devel] [PATCH edk2-platforms v2 0/2] Platform/Intel: Delete ALIGN16 macro and unused include files

2023-05-15 Thread Rebecca Cran
Delete the ALIGN16 macro definitions in
Platform/Intel/{WhiskeylakeOpenBoardPkg,CometlakeOpenBoardPkg} since
they were causing a build breakage since March, and aren't used anymore.

Delete include files in WhiskeylakeOpenBoardPkg which appear to be unused.


Changes from v1 to v2
=

Instead of fixing the ALIGN16 macro, just delete it.
In addition to the one in WhiskeylakeOpenBoardPkg, also delete the
definition in CometlakeOpenBoardPkg.

Rebecca Cran (2):
  Platform/Intel: Delete ALIGN16 macro
  Platform/Intel/WhiskeylakeOpenBoardPkg: Delete unused include files

 
Platform/Intel/CometlakeOpenBoardPkg/CometlakeURvp/Include/PlatformBoardConfig.h
 |   3 -
 
Platform/Intel/WhiskeylakeOpenBoardPkg/UpXtreme/Include/Library/PeiPlatformHookLib.h
 | 131 
 
Platform/Intel/WhiskeylakeOpenBoardPkg/UpXtreme/Include/Library/PeiPlatformLib.h
 |  38 --
 Platform/Intel/WhiskeylakeOpenBoardPkg/UpXtreme/Include/PlatformBoardConfig.h  
  | 103 ---
 Platform/Intel/WhiskeylakeOpenBoardPkg/UpXtreme/Include/PlatformInfo.h 
  |  42 ---
 
Platform/Intel/WhiskeylakeOpenBoardPkg/WhiskeylakeURvp/Include/PlatformBoardConfig.h
 |   3 -
 6 files changed, 320 deletions(-)
 delete mode 100644 
Platform/Intel/WhiskeylakeOpenBoardPkg/UpXtreme/Include/Library/PeiPlatformHookLib.h
 delete mode 100644 
Platform/Intel/WhiskeylakeOpenBoardPkg/UpXtreme/Include/Library/PeiPlatformLib.h
 delete mode 100644 
Platform/Intel/WhiskeylakeOpenBoardPkg/UpXtreme/Include/PlatformBoardConfig.h
 delete mode 100644 
Platform/Intel/WhiskeylakeOpenBoardPkg/UpXtreme/Include/PlatformInfo.h

-- 
2.39.2



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#104877): https://edk2.groups.io/g/devel/message/104877
Mute This Topic: https://groups.io/mt/98903762/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [PATCH v5 0/2] Qemu/Sbsa versioning

2023-05-15 Thread Rebecca Cran

Thanks. For the series:

Reviewed-by: Rebecca Cran 


On 5/15/23 07:47, Marcin Juszkiewicz wrote:

Qemu has versioning for sbsa-ref platform. TF-A reads it from provided
DeviceTree and provides as SMC.

Version 0.0 (QEMU 8.0)  provides platform version information.
Version 0.1 (in review) provides GIC information.

Next versions will bring more changes to make use of development done
during last years.

Requires "SbsaQemu: make GIC base address Pcds dynamic" by Leif
Lindholm to be able to change values with those from QEMU.

QEMU part: https://lists.gnu.org/archive/html/qemu-arm/2023-05/msg00517.html
TF-A part: https://review.trustedfirmware.org/c/TF-A/trusted-firmware-a/+/20871

Changes since v4:
- SMC calls use SmcResult variable (UINTN)
- PcdSet* calls use Result var (RETURN_STATUS)
- fixed "are we on 0.0" check

Marcin Juszkiewicz (2):
   Platform/SbsaQemu: read platform version
   Platform/SbsaQemu: read GIC base from TF-A

  Platform/Qemu/SbsaQemu/SbsaQemu.dsc   |  3 +
  .../SbsaQemuPlatformDxe/SbsaQemuPlatformDxe.c | 58 +++
  .../SbsaQemuPlatformDxe.inf   |  9 +++
  Silicon/Qemu/SbsaQemu/SbsaQemu.dec|  3 +
  4 files changed, 73 insertions(+)




-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#104876): https://edk2.groups.io/g/devel/message/104876
Mute This Topic: https://groups.io/mt/98903526/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




[edk2-devel] [PATCH v5 2/2] Platform/SbsaQemu: read GIC base from TF-A

2023-05-15 Thread Marcin Juszkiewicz
Qemu has versioning for sbsa-ref platform. TF-A reads data from provided
DeviceTree and provides as SMC.

This change adds reading GIC base addresses into EDK2.

Signed-off-by: Marcin Juszkiewicz 
---
 .../SbsaQemuPlatformDxe/SbsaQemuPlatformDxe.c | 30 +++
 .../SbsaQemuPlatformDxe.inf   |  4 +++
 2 files changed, 34 insertions(+)

diff --git 
a/Silicon/Qemu/SbsaQemu/Drivers/SbsaQemuPlatformDxe/SbsaQemuPlatformDxe.c 
b/Silicon/Qemu/SbsaQemu/Drivers/SbsaQemuPlatformDxe/SbsaQemuPlatformDxe.c
index 39f5639d0a28..889270c76344 100644
--- a/Silicon/Qemu/SbsaQemu/Drivers/SbsaQemuPlatformDxe/SbsaQemuPlatformDxe.c
+++ b/Silicon/Qemu/SbsaQemu/Drivers/SbsaQemuPlatformDxe/SbsaQemuPlatformDxe.c
@@ -25,6 +25,8 @@
 #define SIP_FUNCTION_ID(n) (SIP_FUNCTION   | (n))
 
 #define SIP_SVC_VERSION  SIP_FUNCTION_ID(1)
+#define SIP_SVC_GET_GICD SIP_FUNCTION_ID(2)
+#define SIP_SVC_GET_GICR SIP_FUNCTION_ID(3)
 
 EFI_STATUS
 EFIAPI
@@ -79,5 +81,33 @@ InitializeSbsaQemuPlatformDxe (
 
   DEBUG ((DEBUG_INFO, "Platform version: %d.%d\n", Arg0, Arg1));
 
+  /* If we are on platform version 0.0 then there is no more data for us in 
DeviceTree */
+  if ((Arg0 == 0) && (Arg1 == 0))
+  {
+return EFI_SUCCESS;
+  }
+
+  SmcResult = ArmCallSmc0 (SIP_SVC_GET_GICD, , NULL, NULL);
+  if (SmcResult == SMC_ARCH_CALL_SUCCESS)
+  {
+Result = PcdSet64S (PcdGicDistributorBase, Arg0);
+ASSERT_RETURN_ERROR (Result);
+  }
+
+  Arg0 = PcdGet64 (PcdGicDistributorBase);
+
+  DEBUG ((DEBUG_INFO, "GICD base: 0x%x\n", Arg0));
+
+  SmcResult = ArmCallSmc0 (SIP_SVC_GET_GICR, , NULL, NULL);
+  if (SmcResult == SMC_ARCH_CALL_SUCCESS)
+  {
+Result = PcdSet64S (PcdGicRedistributorsBase, Arg0);
+ASSERT_RETURN_ERROR (Result);
+  }
+
+  Arg0 = PcdGet64 (PcdGicRedistributorsBase);
+
+  DEBUG ((DEBUG_INFO, "GICR base: 0x%x\n", Arg0));
+
   return EFI_SUCCESS;
 }
diff --git 
a/Silicon/Qemu/SbsaQemu/Drivers/SbsaQemuPlatformDxe/SbsaQemuPlatformDxe.inf 
b/Silicon/Qemu/SbsaQemu/Drivers/SbsaQemuPlatformDxe/SbsaQemuPlatformDxe.inf
index 1f2c8a9dd6af..545794a8c7ff 100644
--- a/Silicon/Qemu/SbsaQemu/Drivers/SbsaQemuPlatformDxe/SbsaQemuPlatformDxe.inf
+++ b/Silicon/Qemu/SbsaQemu/Drivers/SbsaQemuPlatformDxe/SbsaQemuPlatformDxe.inf
@@ -41,6 +41,10 @@
   gArmVirtSbsaQemuPlatformTokenSpaceGuid.PcdPlatformVersionMajor
   gArmVirtSbsaQemuPlatformTokenSpaceGuid.PcdPlatformVersionMinor
 
+  gArmTokenSpaceGuid.PcdGicDistributorBase
+  gArmTokenSpaceGuid.PcdGicRedistributorsBase
+
+
 [Depex]
   TRUE
 
-- 
2.40.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#104875): https://edk2.groups.io/g/devel/message/104875
Mute This Topic: https://groups.io/mt/98903528/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




[edk2-devel] [PATCH v5 1/2] Platform/SbsaQemu: read platform version

2023-05-15 Thread Marcin Juszkiewicz
Qemu has versioning for sbsa-ref platform. TF-A reads it from provided
DeviceTree and provides as SMC.

This change adds reading platform version into EDK2.

Signed-off-by: Marcin Juszkiewicz 
---
 Platform/Qemu/SbsaQemu/SbsaQemu.dsc   |  3 ++
 .../SbsaQemuPlatformDxe/SbsaQemuPlatformDxe.c | 28 +++
 .../SbsaQemuPlatformDxe.inf   |  5 
 Silicon/Qemu/SbsaQemu/SbsaQemu.dec|  3 ++
 4 files changed, 39 insertions(+)

diff --git a/Platform/Qemu/SbsaQemu/SbsaQemu.dsc 
b/Platform/Qemu/SbsaQemu/SbsaQemu.dsc
index 0bd0df4f0239..b88729ad8ad6 100644
--- a/Platform/Qemu/SbsaQemu/SbsaQemu.dsc
+++ b/Platform/Qemu/SbsaQemu/SbsaQemu.dsc
@@ -558,6 +558,9 @@ DEFINE NETWORK_HTTP_BOOT_ENABLE   = FALSE
   gArmVirtSbsaQemuPlatformTokenSpaceGuid.PcdChassisAssetTag|L"AT"
   gArmVirtSbsaQemuPlatformTokenSpaceGuid.PcdChassisSKU|L"SK"
 
+  gArmVirtSbsaQemuPlatformTokenSpaceGuid.PcdPlatformVersionMajor|0x0
+  gArmVirtSbsaQemuPlatformTokenSpaceGuid.PcdPlatformVersionMinor|0x0
+
 

 #
 # Components Section - list of all EDK II Modules needed by this Platform
diff --git 
a/Silicon/Qemu/SbsaQemu/Drivers/SbsaQemuPlatformDxe/SbsaQemuPlatformDxe.c 
b/Silicon/Qemu/SbsaQemu/Drivers/SbsaQemuPlatformDxe/SbsaQemuPlatformDxe.c
index b7270a07abbd..39f5639d0a28 100644
--- a/Silicon/Qemu/SbsaQemu/Drivers/SbsaQemuPlatformDxe/SbsaQemuPlatformDxe.c
+++ b/Silicon/Qemu/SbsaQemu/Drivers/SbsaQemuPlatformDxe/SbsaQemuPlatformDxe.c
@@ -7,15 +7,25 @@
 *
 **/
 
+#include 
 #include 
 #include 
 #include 
 #include 
 #include 
 #include 
+#include 
 
 #include 
 
+/* those probably should go into IndustryStandard/ArmStdSmc.h */
+#define SMC_FASTCALL   0x8000
+#define SMC64_FUNCTION (SMC_FASTCALL   | 0x4000)
+#define SIP_FUNCTION   (SMC64_FUNCTION | 0x0200)
+#define SIP_FUNCTION_ID(n) (SIP_FUNCTION   | (n))
+
+#define SIP_SVC_VERSION  SIP_FUNCTION_ID(1)
+
 EFI_STATUS
 EFIAPI
 InitializeSbsaQemuPlatformDxe (
@@ -26,6 +36,10 @@ InitializeSbsaQemuPlatformDxe (
   EFI_STATUS Status;
   UINTN  Size;
   VOID*  Base;
+  UINTN  Arg0;
+  UINTN  Arg1;
+  UINTN  SmcResult;
+  RETURN_STATUS  Result;
 
   DEBUG ((DEBUG_INFO, "%a: InitializeSbsaQemuPlatformDxe called\n", 
__FUNCTION__));
 
@@ -51,5 +65,19 @@ InitializeSbsaQemuPlatformDxe (
 return Status;
   }
 
+  SmcResult = ArmCallSmc0 (SIP_SVC_VERSION, , , NULL);
+  if (SmcResult == SMC_ARCH_CALL_SUCCESS)
+  {
+Result = PcdSet32S (PcdPlatformVersionMajor, Arg0);
+ASSERT_RETURN_ERROR (Result);
+Result = PcdSet32S (PcdPlatformVersionMinor, Arg1);
+ASSERT_RETURN_ERROR (Result);
+  }
+
+  Arg0 = PcdGet32 (PcdPlatformVersionMajor);
+  Arg1 = PcdGet32 (PcdPlatformVersionMinor);
+
+  DEBUG ((DEBUG_INFO, "Platform version: %d.%d\n", Arg0, Arg1));
+
   return EFI_SUCCESS;
 }
diff --git 
a/Silicon/Qemu/SbsaQemu/Drivers/SbsaQemuPlatformDxe/SbsaQemuPlatformDxe.inf 
b/Silicon/Qemu/SbsaQemu/Drivers/SbsaQemuPlatformDxe/SbsaQemuPlatformDxe.inf
index 21d2135f6d17..1f2c8a9dd6af 100644
--- a/Silicon/Qemu/SbsaQemu/Drivers/SbsaQemuPlatformDxe/SbsaQemuPlatformDxe.inf
+++ b/Silicon/Qemu/SbsaQemu/Drivers/SbsaQemuPlatformDxe/SbsaQemuPlatformDxe.inf
@@ -20,6 +20,7 @@
   SbsaQemuPlatformDxe.c
 
 [Packages]
+  ArmPkg/ArmPkg.dec
   ArmVirtPkg/ArmVirtPkg.dec
   EmbeddedPkg/EmbeddedPkg.dec
   MdeModulePkg/MdeModulePkg.dec
@@ -27,6 +28,7 @@
   Silicon/Qemu/SbsaQemu/SbsaQemu.dec
 
 [LibraryClasses]
+  ArmSmcLib
   PcdLib
   DebugLib
   NonDiscoverableDeviceRegistrationLib
@@ -36,6 +38,9 @@
   gArmVirtSbsaQemuPlatformTokenSpaceGuid.PcdPlatformAhciBase
   gArmVirtSbsaQemuPlatformTokenSpaceGuid.PcdPlatformAhciSize
 
+  gArmVirtSbsaQemuPlatformTokenSpaceGuid.PcdPlatformVersionMajor
+  gArmVirtSbsaQemuPlatformTokenSpaceGuid.PcdPlatformVersionMinor
+
 [Depex]
   TRUE
 
diff --git a/Silicon/Qemu/SbsaQemu/SbsaQemu.dec 
b/Silicon/Qemu/SbsaQemu/SbsaQemu.dec
index 9448852967b6..5182978cf56d 100644
--- a/Silicon/Qemu/SbsaQemu/SbsaQemu.dec
+++ b/Silicon/Qemu/SbsaQemu/SbsaQemu.dec
@@ -67,3 +67,6 @@
   
gArmVirtSbsaQemuPlatformTokenSpaceGuid.PcdChassisManufacturer|L""|VOID*|0x011B
   
gArmVirtSbsaQemuPlatformTokenSpaceGuid.PcdChassisAssetTag|L""|VOID*|0x011C
   gArmVirtSbsaQemuPlatformTokenSpaceGuid.PcdChassisSKU|L""|VOID*|0x011D
+
+  
gArmVirtSbsaQemuPlatformTokenSpaceGuid.PcdPlatformVersionMajor|0x0|UINT32|0x011E
+  
gArmVirtSbsaQemuPlatformTokenSpaceGuid.PcdPlatformVersionMinor|0x0|UINT32|0x011F
-- 
2.40.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#104873): https://edk2.groups.io/g/devel/message/104873
Mute This Topic: https://groups.io/mt/98903525/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: 

[edk2-devel] [PATCH v5 0/2] Qemu/Sbsa versioning

2023-05-15 Thread Marcin Juszkiewicz
Qemu has versioning for sbsa-ref platform. TF-A reads it from provided
DeviceTree and provides as SMC.

Version 0.0 (QEMU 8.0)  provides platform version information.
Version 0.1 (in review) provides GIC information.

Next versions will bring more changes to make use of development done
during last years.

Requires "SbsaQemu: make GIC base address Pcds dynamic" by Leif
Lindholm to be able to change values with those from QEMU.

QEMU part: https://lists.gnu.org/archive/html/qemu-arm/2023-05/msg00517.html
TF-A part: https://review.trustedfirmware.org/c/TF-A/trusted-firmware-a/+/20871

Changes since v4:
- SMC calls use SmcResult variable (UINTN)
- PcdSet* calls use Result var (RETURN_STATUS)
- fixed "are we on 0.0" check

Marcin Juszkiewicz (2):
  Platform/SbsaQemu: read platform version
  Platform/SbsaQemu: read GIC base from TF-A

 Platform/Qemu/SbsaQemu/SbsaQemu.dsc   |  3 +
 .../SbsaQemuPlatformDxe/SbsaQemuPlatformDxe.c | 58 +++
 .../SbsaQemuPlatformDxe.inf   |  9 +++
 Silicon/Qemu/SbsaQemu/SbsaQemu.dec|  3 +
 4 files changed, 73 insertions(+)

-- 
2.40.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#104874): https://edk2.groups.io/g/devel/message/104874
Mute This Topic: https://groups.io/mt/98903526/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [PATCH 2/2] Platform/SbsaQemu: read GIC base from TF-A

2023-05-15 Thread Marcin Juszkiewicz

W dniu 15.05.2023 o 15:14, Rebecca Cran pisze:

On 5/15/23 04:24, Marcin Juszkiewicz wrote:

+  /* If we are on platform version 0.0 then there is no more data for 
us in DeviceTree */

+  if ((Arg0 == 0) & (Arg1 == 0))
+  {
+    return EFI_SUCCESS;
+  }


Should that be "&&" instead of "&"?


Ops, yes. Always forgetting does C has "if ( (this) and (that) )" and 
then use wrong &/&& variant.





-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#104872): https://edk2.groups.io/g/devel/message/104872
Mute This Topic: https://groups.io/mt/98900381/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [PATCH edk2-platforms 1/2] Platform/Intel/WhiskeylakeOpenBoardPkg: Fix ALIGN16 macro

2023-05-15 Thread Pedro Falcato
On Mon, May 15, 2023 at 6:43 AM Rebecca Cran  wrote:
>
> The IS_ALIGNED macro defined in PlatformBoardConfig.h conflicts with the
> definition from MdePkg/Include/Base.h. Delete it, and switch to
> ADDRESS_IS_ALIGNED.
>
> Signed-off-by: Rebecca Cran 
> ---
>  
> Platform/Intel/WhiskeylakeOpenBoardPkg/WhiskeylakeURvp/Include/PlatformBoardConfig.h
>  | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git 
> a/Platform/Intel/WhiskeylakeOpenBoardPkg/WhiskeylakeURvp/Include/PlatformBoardConfig.h
>  
> b/Platform/Intel/WhiskeylakeOpenBoardPkg/WhiskeylakeURvp/Include/PlatformBoardConfig.h
> index 44b4059f8ebf..4872a0afc65a 100644
> --- 
> a/Platform/Intel/WhiskeylakeOpenBoardPkg/WhiskeylakeURvp/Include/PlatformBoardConfig.h
> +++ 
> b/Platform/Intel/WhiskeylakeOpenBoardPkg/WhiskeylakeURvp/Include/PlatformBoardConfig.h
> @@ -15,8 +15,7 @@
>  #include 
>  #include 
>
> -#define IS_ALIGNED(addr, size) (((addr) & (size - 1)) ? 0 : 1)
> -#define ALIGN16(size)  (IS_ALIGNED(size, 16) ? size : ((size + 16) & 
> 0xFFF0))
> +#define ALIGN16(size)  (ADDRESS_IS_ALIGNED(size, 16) ? size : ((size 
> + 16) & 0xFFF0))

As I mentioned on Discord, ALIGN16 should not need a branch like this.
I propose switching ALIGN16 to use ALIGN_VALUE, or if you need compat
with older edk2s, even:

#define ALIGN16(size) (((size) + 15) & -16)

Which is a common enough pattern that it hopefully is self-explanatory.

-- 
Pedro


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#104871): https://edk2.groups.io/g/devel/message/104871
Mute This Topic: https://groups.io/mt/98897866/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [PATCH 2/2] Platform/SbsaQemu: read GIC base from TF-A

2023-05-15 Thread Rebecca Cran

On 5/15/23 04:24, Marcin Juszkiewicz wrote:


+  /* If we are on platform version 0.0 then there is no more data for us in 
DeviceTree */
+  if ((Arg0 == 0) & (Arg1 == 0))
+  {
+return EFI_SUCCESS;
+  }


Should that be "&&" instead of "&"?


--

Rebecca Cran



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#104870): https://edk2.groups.io/g/devel/message/104870
Mute This Topic: https://groups.io/mt/98900381/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [PATCH 1/2] Platform/SbsaQemu: read platform version

2023-05-15 Thread Rebecca Cran

On 5/15/23 04:24, Marcin Juszkiewicz wrote:

+  Result = ArmCallSmc0 (SIP_SVC_VERSION, , , NULL);
+  if (Result == SMC_ARCH_CALL_SUCCESS)
+  {
+Result = PcdSet32S (PcdPlatformVersionMajor, Arg0);
+ASSERT_EFI_ERROR (Result);
+Result = PcdSet32S (PcdPlatformVersionMinor, Arg1);
+ASSERT_EFI_ERROR (Result);
+  }
+
+  Arg0 = PcdGet32 (PcdPlatformVersionMajor);
+  Arg1 = PcdGet32 (PcdPlatformVersionMinor);


I didn't notice this before, but PcdSet32S returns a RETURN_STATUS, not 
UINTN so Result should be type RETURN_STATUS (and probably a different 
variable used for the result of ArmCallSmc0).


Also, you should use ASSERT_RETURN_ERROR not ASSERT_EFI_ERROR (I checked 
ArmVirtPkg/Library/ArmVirtTimerFdtClientLib/ArmVirtTimerFdtClientLib.c 
to see how error handling is done there).



--
Rebecca Cran



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#104869): https://edk2.groups.io/g/devel/message/104869
Mute This Topic: https://groups.io/mt/98900379/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: 回复: 回复: [edk2-devel] [PATCH] MdeModulePkg/Core/Pei: set AprioriCount=0 before walking through next FV

2023-05-15 Thread Wendy Liao via groups.io

Hi Liming,

Merged https://github.com/tianocore/edk2/pull/4397
Thank you.

Best Regards,

Wendy Liao
Insyde Software Corp.
Phone: +886-2-6608-3688 Ext.8731

gaoliming 於 2023/05/11 上午 10:53 寫道:

Wendy:
   I understand the problem now. Your fix is correct. Reviewed-by: Liming Gao 


   This is a bug fix. I suggest to merge it for this stable tag 202305.

Thanks
Liming

-邮件原件-
发件人: devel@edk2.groups.io  代表 Wendy Liao
via groups.io
发送时间: 2023年5月11日 10:23
收件人: gaoliming ; devel@edk2.groups.io
抄送: 'Leon Chen' ; 'Tim Lewis'

主题: Re: 回复: [edk2-devel] [PATCH] MdeModulePkg/Core/Pei: set
AprioriCount=0 before walking through next FV

Hi gaoliming,

DiscoverPeimsAndOrderWithApriori () will not reset Private->AprioriCount
to Zero when CoreFileHandle->ScanFv = TRUE.
DiscoverPeimsAndOrderWithApriori () {
...
if (CoreFileHandle->ScanFv) {
  Private->CurrentFvFileHandles = CoreFileHandle->FvFileHandles;
  return;
}
...
}
After go through all FV and the last FV has one or more Apriori Peim,
Private->AprioriCount will not be reset to 0 anymore.

Scan loop 1
[FV1]
Before DiscoverPeimsAndOrderWithApriori () : Private->AprioriCount = 0,
CoreFileHandle->ScanFv = FALSE
After DiscoverPeimsAndOrderWithApriori (): Private->AprioriCount =
2, CoreFileHandle->ScanFv = TRUE
[FV2]
Before DiscoverPeimsAndOrderWithApriori () : Private->AprioriCount = 2,
CoreFileHandle->ScanFv = FALSE
After DiscoverPeimsAndOrderWithApriori (): Private->AprioriCount =
0, CoreFileHandle->ScanFv = TRUE
...
[FVn]
Before DiscoverPeimsAndOrderWithApriori () : Private->AprioriCount = 0,
CoreFileHandle->ScanFv = FALSE
After DiscoverPeimsAndOrderWithApriori (): Private->AprioriCount =
1, CoreFileHandle->ScanFv = TRUE

Scan loop 2
[FV1]
Before DiscoverPeimsAndOrderWithApriori () : Private->AprioriCount = 1,
CoreFileHandle->ScanFv = TRUE
After DiscoverPeimsAndOrderWithApriori (): Private->AprioriCount =
1, CoreFileHandle->ScanFv = TRUE

Best Regards,

Wendy Liao
Insyde Software Corp.
Phone: +886-2-6608-3688 Ext.8731

gaoliming 於 2023/05/11 上午 09:32 寫道:

Wendy:
DiscoverPeimsAndOrderWithApriori () has the logic to reset

Private->AprioriCount as zero.

It will set the real AprioriCount for each FV when this FV first scans,

then dispatch the peims in the apriori list.

So, I don't think there is the issue here. Do you find the real

functionality issue?

Thanks
Liming

-邮件原件-
发件人: devel@edk2.groups.io  代表 Wendy

Liao

via groups.io
发送时间: 2023年5月10日 14:23
收件人: devel@edk2.groups.io
抄送: Leon Chen ; Tim Lewis

主题: [edk2-devel] [PATCH] MdeModulePkg/Core/Pei: set AprioriCount=0
before walking through next FV


REF:https://bugzilla.tianocore.org/show_bug.cgi?id=4438

The main dispatch loop in PeiDispatcher() goes through each FV and
calls DiscoverPeimsAndOrderWithApriori() to search Apriori file to
reorder all PEIMs then do the PEIM dispatched.

DiscoverPeimsAndOrderWithApriori() calculates Apriori file count for
every FV once and set Private->AprioriCount, but Private->AprioriCount
doesn't be set to 0 before dispatch loop walking through the next FV.

It causes the peim which sort on less than Private->AprioriCount and
depex is not satisfied would be dispatched when dispatch loop go through
to a scaned FV, even the peim is not set in APRIORI file.

Cc: Leon Chen 
Cc: Tim Lewis 
Reported-by: Esther Lee 
Signed-off-by: Wendy Liao 

---
MdeModulePkg/Core/Pei/Dispatcher/Dispatcher.c | 1 +
1 file changed, 1 insertion(+)

diff --git a/MdeModulePkg/Core/Pei/Dispatcher/Dispatcher.c
b/MdeModulePkg/Core/Pei/Dispatcher/Dispatcher.c
index d8284f9f4f..5f32ebb560 100644
--- a/MdeModulePkg/Core/Pei/Dispatcher/Dispatcher.c
+++ b/MdeModulePkg/Core/Pei/Dispatcher/Dispatcher.c
@@ -1630,6 +1630,7 @@ PeiDispatcher (
  Private->CurrentFileHandle= NULL;
  Private->CurrentPeimCount = 0;
  Private->CurrentFvFileHandles = NULL;
+  Private->AprioriCount = 0;
}

//
--
2.29.2.windows.2


















-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#104868): https://edk2.groups.io/g/devel/message/104868
Mute This Topic: https://groups.io/mt/98820431/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [edk2-platforms][PATCH 1/2] ManageabilityPkg/IpmiFrb: IPMI FRB Driver

2023-05-15 Thread Attar, AbdulLateef (Abdul Lateef) via groups.io
[AMD Official Use Only - General]

Reviewed-by: Abdul Lateef Attar 

-Original Message-
From: Chang, Abner 
Sent: 13 May 2023 18:03
To: devel@edk2.groups.io
Cc: Isaac Oram ; Attar, AbdulLateef (Abdul Lateef) 
; Nickle Wang ; Tinh Nguyen 

Subject: [edk2-platforms][PATCH 1/2] ManageabilityPkg/IpmiFrb: IPMI FRB Driver

From: Abner Chang 

IpmiFrb is cloned from
edk2-platforms/Features/Intel/OutOfBandManagement/
IpmiFeaturePkg/Frb in order to consolidate
edk2 system manageability support in one place.
Uncustify is applied to C files and no functionalities are changed in this 
patch.

We will still keep the one under IpmiFeaturePkg/Frb until the reference to this 
instance are removed from platforms.

Signed-off-by: Abner Chang 
Cc: Isaac Oram 
Cc: Abdul Lateef Attar 
Cc: Nickle Wang 
Cc: Tinh Nguyen 
---
 .../ManageabilityPkg/ManageabilityPkg.dec |   5 +
 .../Universal/IpmiFrb/FrbDxe.inf  |  37 +++
 .../Universal/IpmiFrb/FrbPei.inf  |  37 +++
 .../Universal/IpmiFrb/FrbDxe.c| 212 ++
 .../Universal/IpmiFrb/FrbPei.c|  87 +++
 5 files changed, 378 insertions(+)
 create mode 100644 Features/ManageabilityPkg/Universal/IpmiFrb/FrbDxe.inf
 create mode 100644 Features/ManageabilityPkg/Universal/IpmiFrb/FrbPei.inf
 create mode 100644 Features/ManageabilityPkg/Universal/IpmiFrb/FrbDxe.c
 create mode 100644 Features/ManageabilityPkg/Universal/IpmiFrb/FrbPei.c

diff --git a/Features/ManageabilityPkg/ManageabilityPkg.dec 
b/Features/ManageabilityPkg/ManageabilityPkg.dec
index 38813c5f48..b0ca01094a 100644
--- a/Features/ManageabilityPkg/ManageabilityPkg.dec
+++ b/Features/ManageabilityPkg/ManageabilityPkg.dec
@@ -80,3 +80,8 @@
   
gManageabilityPkgTokenSpaceGuid.PcdManageabilityDxeMctpEnable|FALSE|BOOLEAN|0x1005
   
gManageabilityPkgTokenSpaceGuid.PcdManageabilityDxePldmSmbiosTransferEnable|FALSE|BOOLEAN|0x1006

+[PcdsDynamic, PcdsDynamicEx]
+
+gManageabilityPkgTokenSpaceGuid.PcdFRB2EnabledFlag|TRUE|BOOLEAN|0x2
+001
+  ## This is the timeout value in milliseconds, default set to 360
+milliseconds
+  # @Prompt IPMI Fault Resilient Booting timeout value in milliseconds.
+
+gManageabilityPkgTokenSpaceGuid.PcdFRBTimeoutValue|360|UINT16|0x200
+2
diff --git a/Features/ManageabilityPkg/Universal/IpmiFrb/FrbDxe.inf 
b/Features/ManageabilityPkg/Universal/IpmiFrb/FrbDxe.inf
new file mode 100644
index 00..ae57fe7697
--- /dev/null
+++ b/Features/ManageabilityPkg/Universal/IpmiFrb/FrbDxe.inf
@@ -0,0 +1,37 @@
+### @file
+# Component description file for IPMI FRB.
+#
+# Copyright (c) 2018 - 2019, Intel Corporation. All rights
+reserved. # # SPDX-License-Identifier: BSD-2-Clause-Patent # ###
+
+[defines]
+  INF_VERSION  = 0x00010005
+  BASE_NAME= FrbDxe
+  FILE_GUID= A142CEE5-99D5-4ECF-943E-D8F0DE3052AA
+  MODULE_TYPE  = DXE_DRIVER
+  VERSION_STRING   = 1.0
+  ENTRY_POINT  = FrbDxeEntryPoint
+
+[Sources]
+  FrbDxe.c
+
+[Packages]
+  ManageabilityPkg/ManageabilityPkg.dec
+  MdePkg/MdePkg.dec
+  MdeModulePkg/MdeModulePkg.dec
+
+[LibraryClasses]
+  UefiLib
+  BaseMemoryLib
+  DebugLib
+  IpmiCommandLib
+  MemoryAllocationLib
+  PcdLib
+  UefiBootServicesTableLib
+  UefiDriverEntryPoint
+
+[Depex]
+  TRUE
diff --git a/Features/ManageabilityPkg/Universal/IpmiFrb/FrbPei.inf 
b/Features/ManageabilityPkg/Universal/IpmiFrb/FrbPei.inf
new file mode 100644
index 00..89d633f32e
--- /dev/null
+++ b/Features/ManageabilityPkg/Universal/IpmiFrb/FrbPei.inf
@@ -0,0 +1,37 @@
+### @file
+# Component description file for IPMI FRB PEIM.
+#
+# Copyright (c) 2018 - 2019, Intel Corporation. All rights
+reserved. # # SPDX-License-Identifier: BSD-2-Clause-Patent # ###
+
+[defines]
+  INF_VERSION  = 0x00010005
+  BASE_NAME= FrbPei
+  FILE_GUID= 7CAAE1A7-0B37-4EEA-A432-2F203DA6F288
+  MODULE_TYPE  = PEIM
+  VERSION_STRING   = 1.0
+  ENTRY_POINT  = InitializeFrbPei
+
+[Sources]
+  FrbPei.c
+
+[Packages]
+  ManageabilityPkg/ManageabilityPkg.dec
+  MdePkg/MdePkg.dec
+
+[LibraryClasses]
+  BaseMemoryLib
+  DebugLib
+  IpmiCommandLib
+  PcdLib
+  PeimEntryPoint
+
+[Pcd]
+  gManageabilityPkgTokenSpaceGuid.PcdFRB2EnabledFlag
+  gManageabilityPkgTokenSpaceGuid.PcdFRBTimeoutValue
+
+[Depex]
+  TRUE
diff --git a/Features/ManageabilityPkg/Universal/IpmiFrb/FrbDxe.c 
b/Features/ManageabilityPkg/Universal/IpmiFrb/FrbDxe.c
new file mode 100644
index 00..46f741eed1
--- /dev/null
+++ b/Features/ManageabilityPkg/Universal/IpmiFrb/FrbDxe.c
@@ -0,0 +1,212 @@
+/** @file
+IPMI Fault Resilient Booting Driver.
+
+Copyright (c) 2018 - 2019, Intel Corporation. All rights reserved.
+SPDX-License-Identifier: BSD-2-Clause-Patent
+
+**/
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include  #include 
+#include  #include 
+
+/**
+  This routine disables the specified FRB timer.
+
+  @retval EFI_STATUS  EFI_SUCCESS  FRB timer was disabled
+ 

Re: [edk2-devel] [edk2-platforms][PATCH 1/2] ManageabilityPkg/IpmiBmcElog: IPMI BMC Elog Driver

2023-05-15 Thread Attar, AbdulLateef (Abdul Lateef) via groups.io
[AMD Official Use Only - General]

Reviewed-by: Abdul Lateef Attar 

-Original Message-
From: Chang, Abner 
Sent: 12 May 2023 15:28
To: devel@edk2.groups.io
Cc: Isaac Oram ; Attar, AbdulLateef (Abdul Lateef) 
; Nickle Wang ; Tinh Nguyen 

Subject: [edk2-platforms][PATCH 1/2] ManageabilityPkg/IpmiBmcElog: IPMI BMC 
Elog Driver

From: Abner Chang 

IpmiBmcElog is cloned from
edk2-platforms/Features/Intel/OutOfBandManagement/
IpmiFeaturePkg/BmcElog in order to consolidate
edk2 system manageability support in one place.
Uncustify is applied to C files and no functionalities are changed in this 
patch.

We will still keep the one under IpmiFeaturePkg/BmcElog until the reference to 
this instance are removed from platforms.

Signed-off-by: Abner Chang 
Cc: Isaac Oram 
Cc: Abdul Lateef Attar 
Cc: Nickle Wang 
Cc: Tinh Nguyen 
---
 .../Universal/IpmiBmcElog/BmcElog.inf |  33 +++
 .../Universal/IpmiBmcElog/BmcElog.c   | 192 ++
 2 files changed, 225 insertions(+)
 create mode 100644 Features/ManageabilityPkg/Universal/IpmiBmcElog/BmcElog.inf
 create mode 100644 Features/ManageabilityPkg/Universal/IpmiBmcElog/BmcElog.c

diff --git a/Features/ManageabilityPkg/Universal/IpmiBmcElog/BmcElog.inf 
b/Features/ManageabilityPkg/Universal/IpmiBmcElog/BmcElog.inf
new file mode 100644
index 00..4c28862fe5
--- /dev/null
+++ b/Features/ManageabilityPkg/Universal/IpmiBmcElog/BmcElog.inf
@@ -0,0 +1,33 @@
+### @file
+# Component description file for BMC ELOG.
+#
+# Copyright (c) 2018 - 2019, Intel Corporation. All rights
+reserved. # # SPDX-License-Identifier: BSD-2-Clause-Patent # ###
+
+[Defines]
+  INF_VERSION  = 0x00010005
+  BASE_NAME= BmcElog
+  FILE_GUID= A0FF2235-B652-45E3-B3D2-B20F3E714E6F
+  MODULE_TYPE  = DXE_DRIVER
+  PI_SPECIFICATION_VERSION = 0x0001000A
+  VERSION_STRING   = 1.0
+  ENTRY_POINT  = InitializeBmcElogLayer
+
+[Sources]
+  BmcElog.c
+
+[Packages]
+  ManageabilityPkg/ManageabilityPkg.dec
+  MdePkg/MdePkg.dec
+
+[LibraryClasses]
+  DebugLib
+  IpmiCommandLib
+  UefiBootServicesTableLib
+  UefiDriverEntryPoint
+
+[Depex]
+  TRUE
diff --git a/Features/ManageabilityPkg/Universal/IpmiBmcElog/BmcElog.c 
b/Features/ManageabilityPkg/Universal/IpmiBmcElog/BmcElog.c
new file mode 100644
index 00..ab179e9d49
--- /dev/null
+++ b/Features/ManageabilityPkg/Universal/IpmiBmcElog/BmcElog.c
@@ -0,0 +1,192 @@
+/** @file
+  BMC Event Log functions.
+
+Copyright (c) 2018 - 2019, Intel Corporation. All rights reserved.
+SPDX-License-Identifier: BSD-2-Clause-Patent
+
+**/
+
+#include 
+#include 
+#include 
+#include 
+#include  #include
+
+#include 
+#include 
+
+EFI_STATUS
+EFIAPI
+CheckIfSelIsFull (
+  VOID
+  );
+
+/**
+  This function erases event logs and waits unti complete.
+
+  @param [in]  ResvId  - Reserved ID
+
+  @retval  EFI_STATUS   EFI_SUCCESS
+EFI_NO_RESPONSE
+
+**/
+EFI_STATUS
+WaitTillErased (
+  IN  UINT8  *ResvId
+  )
+{
+  INTN Counter;
+  IPMI_CLEAR_SEL_REQUEST   ClearSel;
+  IPMI_CLEAR_SEL_RESPONSE  ClearSelResponse;
+
+  Counter = 0x200;
+  ZeroMem (, sizeof (ClearSelResponse));
+
+  while (TRUE) {
+ZeroMem (, sizeof (ClearSel));
+ClearSel.Reserve[0] = ResvId[0];
+ClearSel.Reserve[1] = ResvId[1];
+ClearSel.AscC   = 0x43;
+ClearSel.AscL   = 0x4C;
+ClearSel.AscR   = 0x52;
+ClearSel.Erase  = 0x00;
+
+IpmiClearSel (
+  ,
+  
+  );
+
+if ((ClearSelResponse.ErasureProgress & 0xf) == 1) {
+  return EFI_SUCCESS;
+}
+
+//
+//  If there is not a response from the BMC controller we need to return 
and not hang.
+//
+--Counter;
+if (Counter == 0x0) {
+  return EFI_NO_RESPONSE;
+}
+  }
+}
+
+/**
+  This function activates BMC event log.
+
+  @param [in] EnableElog  Enable/Disable event log  @param [out]
+ ElogStatus  return log status
+
+  @retval  EFI_STATUS
+
+**/
+EFI_STATUS
+EfiActivateBmcElog (
+  IN BOOLEAN   *EnableElog,
+  OUT BOOLEAN  *ElogStatus
+  )
+{
+  EFI_STATUSStatus;
+  UINT8 ElogStat;
+  IPMI_SET_BMC_GLOBAL_ENABLES_REQUEST   SetBmcGlobalEnables;
+  IPMI_GET_BMC_GLOBAL_ENABLES_RESPONSE  GetBmcGlobalEnables;
+  UINT8 CompletionCode;
+
+  Status   = EFI_SUCCESS;
+  ElogStat = 0;
+
+  Status = IpmiGetBmcGlobalEnables ();  if
+ (EFI_ERROR (Status)) {
+return Status;
+  }
+
+  if (EnableElog == NULL) {
+*ElogStatus =
+ GetBmcGlobalEnables.GetEnables.Bits.SystemEventLogging;
+  } else {
+if (Status == EFI_SUCCESS) {
+  if (*EnableElog) {
+ElogStat = 1;
+  }
+
+  CopyMem (, (UINT8 *) + 1, sizeof 
(UINT8));
+  SetBmcGlobalEnables.SetEnables.Bits.SystemEventLogging =
+ ElogStat;
+
+  Status = IpmiSetBmcGlobalEnables (, );
+}
+  }
+
+  return Status;
+}
+
+/**
+
+  

Re: [edk2-devel] [RFC PATCH v1 25/30] ArmVirtPkg: Add ArmCcaDxe for early DXE phase initialisation

2023-05-15 Thread Sami Mujawar
Hi Ard,

Thank you for the feedback.

Please find my response inline marked [SAMI].

Regards,

Sami Mujawar

On 10/05/2023, 13:09, "Ard Biesheuvel" mailto:a...@kernel.org>> wrote:


On Tue, 25 Apr 2023 at 18:05, Sami Mujawar mailto:sami.muja...@arm.com>> wrote:
>
> Add ArmCcaDxe for early DXE phase initialisation like setting
> up the monitor call conduit for Realm code
>
> The Realm code should use SMC as the conduit for monitor calls.
> Therefore, set the PcdMonitorConduitHvc to FALSE if the code is
> running in a Realm.
>
> Note: ArmCcaDxe is configured as an APRIORI DXE so that the DXE
> dispatcher can schedule this to be loaded at the very beginning
> of the Dxe phase. The DevicePathDxe.inf and Pcd.inf modules have
> also been included to satisfy the required dependencies.
>


Please find a way to achieve this without relying on APRIORI - this is
fragile and defeats the dependency based dispatch model that DXE is
based on.


IIUC the issue you are addressing is that the PCD must be set
correctly before any library that [transitively] depends on it is
used, right?


That simply means that the SMC/HVC functionality must be exposed as a
protocol rather than a library I.e., the 'monitor call' abstraction
library should be backed by a protocol, that could be implemented in
two different ways: using HVCs or using SMCs. The abstraction library
will DEPEX on the protocol, and nothing gets dispatched until one of
the two protocols is installed.


That gets rid of the dynamic PCD as well.
[SAMI] I think if we introduce an ArmVirt version of ArmMonitorLib (i.e. 
ArmVirtMonitorLib which is similar to ArmVirtPsciResetSystemLib). We can get 
rid of the APRIORI.
I will try to experiment by introducing an ArmVirtMonitorLib and remove the 
ARIORI setting in the v2 patch series. 
[/SAMI]

> Signed-off-by: Sami Mujawar  >
> ---
> ArmVirtPkg/ArmCcaDxe/ArmCcaDxe.c | 50 
> ArmVirtPkg/ArmCcaDxe/ArmCcaDxe.inf | 39 +++
> ArmVirtPkg/ArmVirtKvmTool.dsc | 5 +-
> ArmVirtPkg/ArmVirtKvmTool.fdf | 10 
> 4 files changed, 102 insertions(+), 2 deletions(-)
>
> diff --git a/ArmVirtPkg/ArmCcaDxe/ArmCcaDxe.c 
> b/ArmVirtPkg/ArmCcaDxe/ArmCcaDxe.c
> new file mode 100644
> index 
> ..36a74f2521d2d92d404c42e86d5d37dd31a1972d
> --- /dev/null
> +++ b/ArmVirtPkg/ArmCcaDxe/ArmCcaDxe.c
> @@ -0,0 +1,50 @@
> +/** @file
> + ArmCcaDxe
> +
> + Copyright (c) 2022 - 2023, ARM Ltd. All rights reserved.
> + SPDX-License-Identifier: BSD-2-Clause-Patent
> +
> +**/
> +
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +
> +/** Entrypoint of Arm CCA Dxe.
> +
> + @param [in] ImageHandle Image handle of this driver.
> + @param [in] SystemTable Pointer to the EFI System Table.
> +
> + @retval RETURN_SUCCESS Success.
> + @retval EFI_NOT_FOUND Required HOB not found.
> +**/
> +EFI_STATUS
> +EFIAPI
> +ArmCcaDxe (
> + IN EFI_HANDLE ImageHandle,
> + IN EFI_SYSTEM_TABLE *SystemTable
> + )
> +{
> + EFI_STATUS Status;
> +
> + if (!IsRealm ()) {
> + // Nothing to do here, return SUCCESS.
> + return EFI_SUCCESS;
> + }
> +
> + // Setup the conduit to be used by Realm code to SMC.
> + Status = PcdSetBoolS (PcdMonitorConduitHvc, FALSE);
> + if (EFI_ERROR (Status)) {
> + DEBUG ((DEBUG_ERROR, "ERROR - Failed to set PcdMonitorConduitHvc\n"));
> + ASSERT (0);
> + return Status;
> + }
> +
> + return Status;
> +}
> diff --git a/ArmVirtPkg/ArmCcaDxe/ArmCcaDxe.inf 
> b/ArmVirtPkg/ArmCcaDxe/ArmCcaDxe.inf
> new file mode 100644
> index 
> ..df110ae54ce54f792fe9cf9420334dd1e6a3fc2c
> --- /dev/null
> +++ b/ArmVirtPkg/ArmCcaDxe/ArmCcaDxe.inf
> @@ -0,0 +1,39 @@
> +## @file
> +# ArmCcaDxe
> +#
> +# Copyright (c) 2022 - 2023, Arm Limited. All rights reserved.
> +#
> +# SPDX-License-Identifier: BSD-2-Clause-Patent
> +#
> +##
> +
> +[Defines]
> + INF_VERSION = 0x0001001B
> + BASE_NAME = ArmCcaDxe
> + FILE_GUID = 6E474F73-7D50-46A8-9AEB-996B71599FE9
> + MODULE_TYPE = DXE_DRIVER
> + VERSION_STRING = 1.0
> + ENTRY_POINT = ArmCcaDxe
> +
> +[Sources]
> + ArmCcaDxe.c
> +
> +[LibraryClasses]
> + ArmCcaLib
> + BaseLib
> + DebugLib
> + HobLib
> + PcdLib
> + UefiDriverEntryPoint
> +
> +[Packages]
> + ArmPkg/ArmPkg.dec
> + ArmVirtPkg/ArmVirtPkg.dec
> + MdeModulePkg/MdeModulePkg.dec
> + MdePkg/MdePkg.dec
> +
> +[Pcd]
> + gArmTokenSpaceGuid.PcdMonitorConduitHvc
> +
> +[Depex]
> + TRUE
> diff --git a/ArmVirtPkg/ArmVirtKvmTool.dsc b/ArmVirtPkg/ArmVirtKvmTool.dsc
> index 
> 9bc857ea88d00431bf4223f588f908eab7561a19..acf4ede48da2d33d50b5593a857f3815f427707c
>  100644
> --- a/ArmVirtPkg/ArmVirtKvmTool.dsc
> +++ b/ArmVirtPkg/ArmVirtKvmTool.dsc
> @@ -404,9 +404,10 @@ [Components.common]
> #
> SecurityPkg/RandomNumberGenerator/RngDxe/RngDxe.inf
>
> -!if $(ARCH) == AARCH64
> +[Components.AARCH64]
> #
> # ACPI Support
> #
> ArmVirtPkg/KvmtoolCfgMgrDxe/ConfigurationManagerDxe.inf
> -!endif
> +
> + 

Re: [edk2-devel] [RFC PATCH v1 05/30] ArmPkg & ArmVirtPkg: Make PcdMonitorConduitHvc a dynamic PCD

2023-05-15 Thread Sami Mujawar
Hi Ard,

Thank you for the feedback.
Please find my response inline marked [SAMI].

Regards,

Sami Mujawar

On 10/05/2023, 12:39, "Ard Biesheuvel" mailto:a...@kernel.org>> wrote:


On Tue, 25 Apr 2023 at 18:04, Sami Mujawar mailto:sami.muja...@arm.com>> wrote:
>
> The monitor call conduit is fixed for a platform firmware in
> most scenarios. For a normal virtual machine guest firmware,
> the default conduit is HVC. However, for Arm CCA the Realm
> code must use SMC as the conduit.
>
> To have a common code base for Guest/Virtual firmware to be used
> by both normal VMs and Realm VMs, make PcdMonitorConduitHvc as a
> dynamic PCD. This allows the firmware to detect if it is running
> in a Realm and it can configure the PcdMonitorConduitHvc as FALSE
> (i.e. to use SMC as the conduit when running in a Realm).
>
> Also update the ArmVirtPkg/ArmVirtKvmTool.dsc workspace to move
> the PcdMonitorConduitHvc in the PcdsDynamic section to prevent
> the build from breaking.
>


Do you mean realm VMs will use SMC even for PSCI calls etc?
[SAMI] For Realm code a SMC is required for PSCI calls.
Following extract from Section A1.3 of the RMM A-bet0 specification 
(https://developer.arm.com/documentation/den0137/1-0bet0/?lang=en)

The RMM exposes the following interfaces, which are accessed via SMC 
instructions, to Realms:
* The Realm Services Interface (RSI), which provides services used to 
manage resources allocated to the
   Realm, and to request an attestation report.
* The Power State Coordination Interface (PSCI), which provides 
services used to control power states of
   VPEs within a Realm. Note that the HVC conduit for PSCI is not 
supported for Realms.

[/SAMI]

The change looks fine to me, given that other platforms that rely on
the default will still get a fixed PCD after this change.




> Signed-off-by: Sami Mujawar  >
> ---
> ArmPkg/ArmPkg.dec | 10 +-
> ArmPkg/Library/ArmMonitorLib/ArmMonitorLib.c | 4 ++--
> ArmVirtPkg/ArmVirtKvmTool.dsc | 4 ++--
> 3 files changed, 9 insertions(+), 9 deletions(-)
>
> diff --git a/ArmPkg/ArmPkg.dec b/ArmPkg/ArmPkg.dec
> index 
> f17ba913e6de1326d49b93d6a15378ff2f522d24..0730533e512d60fcba19c4cfa84944061d16f02e
>  100644
> --- a/ArmPkg/ArmPkg.dec
> +++ b/ArmPkg/ArmPkg.dec
> @@ -139,11 +139,6 @@ [PcdsFeatureFlag.common]
> # Define if the GICv3 controller should use the GICv2 legacy
> gArmTokenSpaceGuid.PcdArmGicV3WithV2Legacy|FALSE|BOOLEAN|0x0042
>
> - ## Define the conduit to use for monitor calls.
> - # Default PcdMonitorConduitHvc = FALSE, conduit = SMC
> - # If PcdMonitorConduitHvc = TRUE, conduit = HVC
> - gArmTokenSpaceGuid.PcdMonitorConduitHvc|FALSE|BOOLEAN|0x0047
> -
> [PcdsFeatureFlag.ARM]
> # Whether to map normal memory as non-shareable. FALSE is the safe choice, but
> # TRUE may be appropriate to fix performance problems if you don't care about
> @@ -393,6 +388,11 @@ [PcdsFixedAtBuild.common, PcdsDynamic.common]
> gArmTokenSpaceGuid.PcdPciBusMin|0x0|UINT32|0x0059
> gArmTokenSpaceGuid.PcdPciBusMax|0x0|UINT32|0x005A
>
> + ## Define the conduit to use for monitor calls.
> + # Default PcdMonitorConduitHvc = FALSE, conduit = SMC
> + # If PcdMonitorConduitHvc = TRUE, conduit = HVC
> + gArmTokenSpaceGuid.PcdMonitorConduitHvc|FALSE|BOOLEAN|0x0047
> +
> [PcdsDynamicEx]
> #
> # This dynamic PCD hold the GUID of a firmware FFS which contains
> diff --git a/ArmPkg/Library/ArmMonitorLib/ArmMonitorLib.c 
> b/ArmPkg/Library/ArmMonitorLib/ArmMonitorLib.c
> index 
> 741f5c615744dc5cc5381ff3848078f93858dd2b..221724125ce3a8f351a55a81f441409a99bcb5cf
>  100644
> --- a/ArmPkg/Library/ArmMonitorLib/ArmMonitorLib.c
> +++ b/ArmPkg/Library/ArmMonitorLib/ArmMonitorLib.c
> @@ -1,7 +1,7 @@
> /** @file
> Arm Monitor Library.
>
> - Copyright (c) 2022, Arm Limited. All rights reserved.
> + Copyright (c) 2022 - 2023, Arm Limited. All rights reserved.
>
> SPDX-License-Identifier: BSD-2-Clause-Patent
>
> @@ -26,7 +26,7 @@ ArmMonitorCall (
> IN OUT ARM_MONITOR_ARGS *Args
> )
> {
> - if (FeaturePcdGet (PcdMonitorConduitHvc)) {
> + if (PcdGetBool (PcdMonitorConduitHvc)) {
> ArmCallHvc ((ARM_HVC_ARGS *)Args);
> } else {
> ArmCallSmc ((ARM_SMC_ARGS *)Args);
> diff --git a/ArmVirtPkg/ArmVirtKvmTool.dsc b/ArmVirtPkg/ArmVirtKvmTool.dsc
> index 
> d2228a95726b24fe5c2edfbc84b1f5c23a85feba..467e5c166e1bbad3acbae78f53c225f5bac525a9
>  100644
> --- a/ArmVirtPkg/ArmVirtKvmTool.dsc
> +++ b/ArmVirtPkg/ArmVirtKvmTool.dsc
> @@ -117,8 +117,6 @@ [PcdsFeatureFlag.common]
> # Use MMIO for accessing RTC controller registers.
> gPcAtChipsetPkgTokenSpaceGuid.PcdRtcUseMmio|TRUE
>
> - gArmTokenSpaceGuid.PcdMonitorConduitHvc|TRUE
> -
> [PcdsFixedAtBuild.common]
> gEfiMdePkgTokenSpaceGuid.PcdDebugPrintErrorLevel|0x800F
>
> @@ -237,6 +235,8 @@ [PcdsDynamicDefault.common]
> gPcAtChipsetPkgTokenSpaceGuid.PcdRtcIndexRegister64|0x0
> gPcAtChipsetPkgTokenSpaceGuid.PcdRtcTargetRegister64|0x0
>
> + 

Re: [edk2-devel] [RFC PATCH v1 01/30] ArmVirtPkg: kvmtool: Add Emulated Runtime variable support

2023-05-15 Thread Sami Mujawar
Hi Ard,

Thank you for the feedback.

Please see my response inline marked [SAMI].

Regards,

Sami Mujawar

On 10/05/2023, 12:33, "Ard Biesheuvel" mailto:a...@kernel.org>> wrote:


On Tue, 25 Apr 2023 at 18:04, Sami Mujawar mailto:sami.muja...@arm.com>> wrote:
>
> Although Kvmtool supports a CFI flash interface, it is currently
> implemented using file backed support on the Host. This scenario
> requires the VMM to be within the trust boundary.
>
> In Confidential Compute Architecture the VMM is outside the trust
> boundary. For such architectures Emulated Runtime variable storage
> is desirable.
>
> Therefore, make Emulated Runtime variable storage as the default
> option and add a build flag ENABLE_CFI_FLASH to configure the
> firmware build to use the CFI Flash as the Variable storage.
>
> Signed-off-by: Sami Mujawar  >
> ---
> ArmVirtPkg/ArmVirtKvmTool.dsc | 22 +++-
> ArmVirtPkg/ArmVirtKvmTool.fdf | 4 +++-
> 2 files changed, 24 insertions(+), 2 deletions(-)
>
> diff --git a/ArmVirtPkg/ArmVirtKvmTool.dsc b/ArmVirtPkg/ArmVirtKvmTool.dsc
> index 
> d0afe1b49e250c554313c2077b89650d6f6d67cb..d2228a95726b24fe5c2edfbc84b1f5c23a85feba
>  100644
> --- a/ArmVirtPkg/ArmVirtKvmTool.dsc
> +++ b/ArmVirtPkg/ArmVirtKvmTool.dsc
> @@ -1,7 +1,7 @@
> # @file
> # Workspace file for KVMTool virtual platform.
> #
> -# Copyright (c) 2018 - 2022, ARM Limited. All rights reserved.
> +# Copyright (c) 2018 - 2023, ARM Limited. All rights reserved.
> #
> # SPDX-License-Identifier: BSD-2-Clause-Patent
> #


Please add a DEFINE for this variable at the start here.
And can we make it default to TRUE?
[SAMI] I have done some experiments and I think we can make this selection at 
runtime based on the CFI entry in the Kvmtool provided DT. I will submit a 
separate patch series that enables the dynamic detection of CFI flash and 
either uses the Nor Flash storage or Emulated Runtime variable. I can 
subsequently drop this patch from the RFC v2 series.
[/SAMI]

> @@ -50,7 +50,9 @@ [LibraryClasses.common]
> ArmVirtMemInfoLib|ArmVirtPkg/Library/KvmtoolVirtMemInfoLib/KvmtoolVirtMemInfoLib.inf
>
> TimerLib|ArmPkg/Library/ArmArchTimerLib/ArmArchTimerLib.inf
> +!ifdef ENABLE_CFI_FLASH
> VirtNorFlashPlatformLib|ArmVirtPkg/Library/NorFlashKvmtoolLib/NorFlashKvmtoolLib.inf
> +!endif
>
> CapsuleLib|MdeModulePkg/Library/DxeCapsuleLibNull/DxeCapsuleLibNull.inf
>
> @@ -156,6 +158,13 @@ [PcdsFixedAtBuild.common]
> #
> gEmbeddedTokenSpaceGuid.PcdPrePiCpuIoSize|16
>
> +!ifndef ENABLE_CFI_FLASH


Not sure what the difference is, but we tend to use


!if $(ENABLE_CFI_FLASH) == TRUE


(and use a local DEFINE - see above)
[SAMI] I think we can drop this patch once we have dynamic detection of the CFI 
flash interface.





> + # Emulate Runtime Variable storage
> + gEfiMdeModulePkgTokenSpaceGuid.PcdEmuVariableNvModeEnable|TRUE
> + gEfiMdeModulePkgTokenSpaceGuid.PcdMaxVariableSize|0x2000
> + gEfiMdeModulePkgTokenSpaceGuid.PcdMaxAuthVariableSize|0x2800
> +!endif
> +
> [PcdsPatchableInModule.common]
> #
> # This will be overridden in the code
> @@ -211,6 +220,7 @@ [PcdsDynamicDefault.common]
> gEfiMdeModulePkgTokenSpaceGuid.PcdSetupVideoHorizontalResolution|640
> gEfiMdeModulePkgTokenSpaceGuid.PcdSetupVideoVerticalResolution|480
>
> +!ifdef ENABLE_CFI_FLASH
> # Setup Flash storage variables
> gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableBase|0
> gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableSize|0x4
> @@ -218,6 +228,10 @@ [PcdsDynamicDefault.common]
> gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwWorkingSize|0x4
> gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareBase|0
> gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareSize|0x4
> +!else
> + # Emulate Runtime Variable storage
> + gEfiMdeModulePkgTokenSpaceGuid.PcdEmuVariableNvStoreReserved|0
> +!endif
>
> ## RTC Register address in MMIO space.
> gPcAtChipsetPkgTokenSpaceGuid.PcdRtcIndexRegister64|0x0
> @@ -263,7 +277,9 @@ [Components.common]
> MdeModulePkg/Universal/Variable/RuntimeDxe/VariableRuntimeDxe.inf {
> 
> NULL|MdeModulePkg/Library/VarCheckUefiLib/VarCheckUefiLib.inf
> +!ifdef ENABLE_CFI_FLASH
> NULL|EmbeddedPkg/Library/NvVarStoreFormattedLib/NvVarStoreFormattedLib.inf
> +!endif
> BaseMemoryLib|MdePkg/Library/BaseMemoryLib/BaseMemoryLib.inf
> }
>
> @@ -271,7 +287,9 @@ [Components.common]
> MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleRuntimeDxe.inf
> MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteDxe.inf {
> 
> +!ifdef ENABLE_CFI_FLASH
> NULL|ArmVirtPkg/Library/NorFlashKvmtoolLib/NorFlashKvmtoolLib.inf
> +!endif
> }
>
> MdeModulePkg/Universal/MonotonicCounterRuntimeDxe/MonotonicCounterRuntimeDxe.inf
> @@ -296,11 +314,13 @@ [Components.common]
> NULL|ArmVirtPkg/Library/ArmVirtTimerFdtClientLib/ArmVirtTimerFdtClientLib.inf
> }
>
> +!ifdef ENABLE_CFI_FLASH
> OvmfPkg/VirtNorFlashDxe/VirtNorFlashDxe.inf {
> 
> # don't use unaligned CopyMem () on the UEFI varstore NOR flash region
> 

[edk2-devel] [PATCH 1/2] Platform/SbsaQemu: read platform version

2023-05-15 Thread Marcin Juszkiewicz
Qemu has versioning for sbsa-ref platform. TF-A reads it from provided
DeviceTree and provides as SMC.

This change adds reading platform version into EDK2.

Signed-off-by: Marcin Juszkiewicz 
---
 Platform/Qemu/SbsaQemu/SbsaQemu.dsc   |  3 +++
 .../SbsaQemuPlatformDxe/SbsaQemuPlatformDxe.c | 27 +++
 .../SbsaQemuPlatformDxe.inf   |  5 
 Silicon/Qemu/SbsaQemu/SbsaQemu.dec|  3 +++
 4 files changed, 38 insertions(+)

diff --git a/Platform/Qemu/SbsaQemu/SbsaQemu.dsc 
b/Platform/Qemu/SbsaQemu/SbsaQemu.dsc
index 0bd0df4f0239..b88729ad8ad6 100644
--- a/Platform/Qemu/SbsaQemu/SbsaQemu.dsc
+++ b/Platform/Qemu/SbsaQemu/SbsaQemu.dsc
@@ -558,6 +558,9 @@ DEFINE NETWORK_HTTP_BOOT_ENABLE   = FALSE
   gArmVirtSbsaQemuPlatformTokenSpaceGuid.PcdChassisAssetTag|L"AT"
   gArmVirtSbsaQemuPlatformTokenSpaceGuid.PcdChassisSKU|L"SK"
 
+  gArmVirtSbsaQemuPlatformTokenSpaceGuid.PcdPlatformVersionMajor|0x0
+  gArmVirtSbsaQemuPlatformTokenSpaceGuid.PcdPlatformVersionMinor|0x0
+
 

 #
 # Components Section - list of all EDK II Modules needed by this Platform
diff --git 
a/Silicon/Qemu/SbsaQemu/Drivers/SbsaQemuPlatformDxe/SbsaQemuPlatformDxe.c 
b/Silicon/Qemu/SbsaQemu/Drivers/SbsaQemuPlatformDxe/SbsaQemuPlatformDxe.c
index b7270a07abbd..199766c7014a 100644
--- a/Silicon/Qemu/SbsaQemu/Drivers/SbsaQemuPlatformDxe/SbsaQemuPlatformDxe.c
+++ b/Silicon/Qemu/SbsaQemu/Drivers/SbsaQemuPlatformDxe/SbsaQemuPlatformDxe.c
@@ -7,15 +7,25 @@
 *
 **/
 
+#include 
 #include 
 #include 
 #include 
 #include 
 #include 
 #include 
+#include 
 
 #include 
 
+/* those probably should go into IndustryStandard/ArmStdSmc.h */
+#define SMC_FASTCALL   0x8000
+#define SMC64_FUNCTION (SMC_FASTCALL   | 0x4000)
+#define SIP_FUNCTION   (SMC64_FUNCTION | 0x0200)
+#define SIP_FUNCTION_ID(n) (SIP_FUNCTION   | (n))
+
+#define SIP_SVC_VERSION  SIP_FUNCTION_ID(1)
+
 EFI_STATUS
 EFIAPI
 InitializeSbsaQemuPlatformDxe (
@@ -26,6 +36,9 @@ InitializeSbsaQemuPlatformDxe (
   EFI_STATUS Status;
   UINTN  Size;
   VOID*  Base;
+  UINTN  Arg0;
+  UINTN  Arg1;
+  UINTN  Result;
 
   DEBUG ((DEBUG_INFO, "%a: InitializeSbsaQemuPlatformDxe called\n", 
__FUNCTION__));
 
@@ -51,5 +64,19 @@ InitializeSbsaQemuPlatformDxe (
 return Status;
   }
 
+  Result = ArmCallSmc0 (SIP_SVC_VERSION, , , NULL);
+  if (Result == SMC_ARCH_CALL_SUCCESS)
+  {
+Result = PcdSet32S (PcdPlatformVersionMajor, Arg0);
+ASSERT_EFI_ERROR (Result);
+Result = PcdSet32S (PcdPlatformVersionMinor, Arg1);
+ASSERT_EFI_ERROR (Result);
+  }
+
+  Arg0 = PcdGet32 (PcdPlatformVersionMajor);
+  Arg1 = PcdGet32 (PcdPlatformVersionMinor);
+
+  DEBUG ((DEBUG_INFO, "Platform version: %d.%d\n", Arg0, Arg1));
+
   return EFI_SUCCESS;
 }
diff --git 
a/Silicon/Qemu/SbsaQemu/Drivers/SbsaQemuPlatformDxe/SbsaQemuPlatformDxe.inf 
b/Silicon/Qemu/SbsaQemu/Drivers/SbsaQemuPlatformDxe/SbsaQemuPlatformDxe.inf
index 21d2135f6d17..1f2c8a9dd6af 100644
--- a/Silicon/Qemu/SbsaQemu/Drivers/SbsaQemuPlatformDxe/SbsaQemuPlatformDxe.inf
+++ b/Silicon/Qemu/SbsaQemu/Drivers/SbsaQemuPlatformDxe/SbsaQemuPlatformDxe.inf
@@ -20,6 +20,7 @@
   SbsaQemuPlatformDxe.c
 
 [Packages]
+  ArmPkg/ArmPkg.dec
   ArmVirtPkg/ArmVirtPkg.dec
   EmbeddedPkg/EmbeddedPkg.dec
   MdeModulePkg/MdeModulePkg.dec
@@ -27,6 +28,7 @@
   Silicon/Qemu/SbsaQemu/SbsaQemu.dec
 
 [LibraryClasses]
+  ArmSmcLib
   PcdLib
   DebugLib
   NonDiscoverableDeviceRegistrationLib
@@ -36,6 +38,9 @@
   gArmVirtSbsaQemuPlatformTokenSpaceGuid.PcdPlatformAhciBase
   gArmVirtSbsaQemuPlatformTokenSpaceGuid.PcdPlatformAhciSize
 
+  gArmVirtSbsaQemuPlatformTokenSpaceGuid.PcdPlatformVersionMajor
+  gArmVirtSbsaQemuPlatformTokenSpaceGuid.PcdPlatformVersionMinor
+
 [Depex]
   TRUE
 
diff --git a/Silicon/Qemu/SbsaQemu/SbsaQemu.dec 
b/Silicon/Qemu/SbsaQemu/SbsaQemu.dec
index 9448852967b6..5182978cf56d 100644
--- a/Silicon/Qemu/SbsaQemu/SbsaQemu.dec
+++ b/Silicon/Qemu/SbsaQemu/SbsaQemu.dec
@@ -67,3 +67,6 @@
   
gArmVirtSbsaQemuPlatformTokenSpaceGuid.PcdChassisManufacturer|L""|VOID*|0x011B
   
gArmVirtSbsaQemuPlatformTokenSpaceGuid.PcdChassisAssetTag|L""|VOID*|0x011C
   gArmVirtSbsaQemuPlatformTokenSpaceGuid.PcdChassisSKU|L""|VOID*|0x011D
+
+  
gArmVirtSbsaQemuPlatformTokenSpaceGuid.PcdPlatformVersionMajor|0x0|UINT32|0x011E
+  
gArmVirtSbsaQemuPlatformTokenSpaceGuid.PcdPlatformVersionMinor|0x0|UINT32|0x011F
-- 
2.40.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#104860): https://edk2.groups.io/g/devel/message/104860
Mute This Topic: https://groups.io/mt/98900379/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]

[edk2-devel] [PATCH 2/2] Platform/SbsaQemu: read GIC base from TF-A

2023-05-15 Thread Marcin Juszkiewicz
Qemu has versioning for sbsa-ref platform. TF-A reads data from provided
DeviceTree and provides as SMC.

This change adds reading GIC base addresses into EDK2.

Signed-off-by: Marcin Juszkiewicz 
---
 .../SbsaQemuPlatformDxe/SbsaQemuPlatformDxe.c | 30 +++
 .../SbsaQemuPlatformDxe.inf   |  4 +++
 2 files changed, 34 insertions(+)

diff --git 
a/Silicon/Qemu/SbsaQemu/Drivers/SbsaQemuPlatformDxe/SbsaQemuPlatformDxe.c 
b/Silicon/Qemu/SbsaQemu/Drivers/SbsaQemuPlatformDxe/SbsaQemuPlatformDxe.c
index 199766c7014a..1213268519c8 100644
--- a/Silicon/Qemu/SbsaQemu/Drivers/SbsaQemuPlatformDxe/SbsaQemuPlatformDxe.c
+++ b/Silicon/Qemu/SbsaQemu/Drivers/SbsaQemuPlatformDxe/SbsaQemuPlatformDxe.c
@@ -25,6 +25,8 @@
 #define SIP_FUNCTION_ID(n) (SIP_FUNCTION   | (n))
 
 #define SIP_SVC_VERSION  SIP_FUNCTION_ID(1)
+#define SIP_SVC_GET_GICD SIP_FUNCTION_ID(2)
+#define SIP_SVC_GET_GICR SIP_FUNCTION_ID(3)
 
 EFI_STATUS
 EFIAPI
@@ -78,5 +80,33 @@ InitializeSbsaQemuPlatformDxe (
 
   DEBUG ((DEBUG_INFO, "Platform version: %d.%d\n", Arg0, Arg1));
 
+  /* If we are on platform version 0.0 then there is no more data for us in 
DeviceTree */
+  if ((Arg0 == 0) & (Arg1 == 0))
+  {
+return EFI_SUCCESS;
+  }
+
+  Result = ArmCallSmc0 (SIP_SVC_GET_GICD, , NULL, NULL);
+  if (Result == SMC_ARCH_CALL_SUCCESS)
+  {
+Result = PcdSet64S (PcdGicDistributorBase, Arg0);
+ASSERT_EFI_ERROR (Result);
+  }
+
+  Arg0 = PcdGet64 (PcdGicDistributorBase);
+
+  DEBUG ((DEBUG_INFO, "GICD base: 0x%x\n", Arg0));
+
+  Result = ArmCallSmc0 (SIP_SVC_GET_GICR, , NULL, NULL);
+  if (Result == SMC_ARCH_CALL_SUCCESS)
+  {
+Result = PcdSet64S (PcdGicRedistributorsBase, Arg0);
+ASSERT_EFI_ERROR (Result);
+  }
+
+  Arg0 = PcdGet64 (PcdGicRedistributorsBase);
+
+  DEBUG ((DEBUG_INFO, "GICR base: 0x%x\n", Arg0));
+
   return EFI_SUCCESS;
 }
diff --git 
a/Silicon/Qemu/SbsaQemu/Drivers/SbsaQemuPlatformDxe/SbsaQemuPlatformDxe.inf 
b/Silicon/Qemu/SbsaQemu/Drivers/SbsaQemuPlatformDxe/SbsaQemuPlatformDxe.inf
index 1f2c8a9dd6af..545794a8c7ff 100644
--- a/Silicon/Qemu/SbsaQemu/Drivers/SbsaQemuPlatformDxe/SbsaQemuPlatformDxe.inf
+++ b/Silicon/Qemu/SbsaQemu/Drivers/SbsaQemuPlatformDxe/SbsaQemuPlatformDxe.inf
@@ -41,6 +41,10 @@
   gArmVirtSbsaQemuPlatformTokenSpaceGuid.PcdPlatformVersionMajor
   gArmVirtSbsaQemuPlatformTokenSpaceGuid.PcdPlatformVersionMinor
 
+  gArmTokenSpaceGuid.PcdGicDistributorBase
+  gArmTokenSpaceGuid.PcdGicRedistributorsBase
+
+
 [Depex]
   TRUE
 
-- 
2.40.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#104862): https://edk2.groups.io/g/devel/message/104862
Mute This Topic: https://groups.io/mt/98900381/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




[edk2-devel] [PATCH v4 0/2] Qemu/Sbsa versioning

2023-05-15 Thread Marcin Juszkiewicz
Qemu has versioning for sbsa-ref platform. TF-A reads it from provided
DeviceTree and provides as SMC.

Version 0.0 (QEMU 8.0)  provides platform version information.
Version 0.1 (in review) provides GIC information.

Next versions will bring more changes to make use of development done
during last years.

Requires "SbsaQemu: make GIC base address Pcds dynamic" by Leif
Lindholm to be able to change values with those from QEMU.

QEMU part: https://lists.gnu.org/archive/html/qemu-arm/2023-05/msg00517.html
TF-A part: https://review.trustedfirmware.org/c/TF-A/trusted-firmware-a/+/20871

Marcin Juszkiewicz (2):
  Platform/SbsaQemu: read platform version
  Platform/SbsaQemu: read GIC base from TF-A

 Platform/Qemu/SbsaQemu/SbsaQemu.dsc   |  3 +
 .../SbsaQemuPlatformDxe/SbsaQemuPlatformDxe.c | 57 +++
 .../SbsaQemuPlatformDxe.inf   |  9 +++
 Silicon/Qemu/SbsaQemu/SbsaQemu.dec|  3 +
 4 files changed, 72 insertions(+)

-- 
2.40.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#104861): https://edk2.groups.io/g/devel/message/104861
Mute This Topic: https://groups.io/mt/98900380/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [edk2-redfish-client][PATCH v2 0/3] Introduce resource addendum protocol

2023-05-15 Thread Chang, Abner via groups.io
[AMD Official Use Only - General]

Thanks for addressing my concerns.
Reviewed-by: Abner Chang  with below issues addressed.

1.  "__FUNCTION__" to "__func__" in debug macro.
2. The description of parameter JsonWithAddendum may confuse user.

>+/**
>+  This function calls EDKII_REDFISH_RESOURCE_ADDENDUM_PROTOCOL to get
>+  addendum data. It's call's responsibility to release JsonWithAddendum.
>+
>+  @param[in]   Uri  Uri of input resource.
>+  @param[in]   Schema   Redfish schema string.
>+  @param[in]   Version  Schema version string.
>+  @param[in]   JsonText Input resource in JSON format string.
>+  @param[out]  JsonWithAddendum The input resource with addendum value 
>attached.

The output resource with addendum value attached or is replaced in 
EDKII_REDFISH_RESOURCE_ADDENDUM_PROTOCOL.

Thanks
Abner

>+
>+  @retval EFI_SUCCESS  Addendum data is attached.
>+  @retval EFI_NOT_FOUNDNo addendum protocol is found in system.
>+  @retval EFI_UNSUPPORTED  No addendum data is required in given 
>schema.
>+  @retval Others   Some error happened.
>+
+**/
>+EFI_STATUS
>+RedfishGetAddendumData (

> -Original Message-
> From: Nickle Wang 
> Sent: Monday, May 15, 2023 3:38 PM
> To: devel@edk2.groups.io
> Cc: Chang, Abner ; Igor Kulchytskyy
> 
> Subject: [edk2-redfish-client][PATCH v2 0/3] Introduce resource addendum
> protocol
> 
> Caution: This message originated from an External Source. Use proper
> caution when opening attachments, clicking links, or responding.
> 
> 
> v2:
> Update protocol and library function description.
> 
> v1:
> Introduce EDKII_REDFISH_RESOURCE_ADDENDUM_PROTOCOL to Redfish
> feature driver.
> Feature driver uses this protocol to query OEM resource from platform in
> order to support Redfish OEM property. This protocol is also used to get
> addendum data that is required by BMC to manage Redfish BIOS service.
> 
> Signed-off-by: Nickle Wang 
> Cc: Abner Chang 
> Cc: Igor Kulchytskyy 
> 
> *** BLURB HERE ***
> 
> Nickle Wang (3):
>   RedfishClientPkg: Add Redfish Resource Addendum Protocol
>   RedfishClientPkg: Add Redfish Resource Addendum Library
>   RedfishClientPkg: Utilize RedfishAddendumLib
> 
>  RedfishClientPkg/RedfishClientPkg.dec |   2 +
>  RedfishClientPkg/RedfishClientLibs.dsc.inc|   4 +-
>  RedfishClientPkg/RedfishClientPkg.dsc |   2 +
>  .../Features/Bios/v1_0_9/Dxe/BiosDxe.inf  |   2 +
>  .../RedfishAddendumLib/RedfishAddendumLib.inf |  40 +++
>  .../Include/Library/RedfishAddendumLib.h  |  67 +
>  .../EdkIIRedfishResourceAddendumProtocol.h|  94 +++
>  .../Include/RedfishResourceCommon.h   |   2 +
>  .../Features/Bios/v1_0_9/Common/BiosCommon.c  | 100 +++
>  .../RedfishAddendumLib/RedfishAddendumLib.c   | 265
> ++
>  10 files changed, 577 insertions(+), 1 deletion(-)
>  create mode 100644
> RedfishClientPkg/Library/RedfishAddendumLib/RedfishAddendumLib.inf
>  create mode 100644
> RedfishClientPkg/Include/Library/RedfishAddendumLib.h
>  create mode 100644
> RedfishClientPkg/Include/Protocol/EdkIIRedfishResourceAddendumProtocol
> .h
>  create mode 100644
> RedfishClientPkg/Library/RedfishAddendumLib/RedfishAddendumLib.c
> 
> --
> 2.17.1


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#104859): https://edk2.groups.io/g/devel/message/104859
Mute This Topic: https://groups.io/mt/98898794/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [edk2-redfish-client][PATCH 2/3] RedfishClientPkg: Add Redfish Resource Addendum Library

2023-05-15 Thread Nickle Wang via groups.io
Thanks for your review comments, Abner!  Updated in version 2 patch-set.

Regards,
Nickle

> -Original Message-
> From: Chang, Abner 
> Sent: Monday, May 15, 2023 11:20 AM
> To: Nickle Wang ; devel@edk2.groups.io
> Cc: Igor Kulchytskyy 
> Subject: RE: [edk2-redfish-client][PATCH 2/3] RedfishClientPkg: Add Redfish
> Resource Addendum Library
> 
> External email: Use caution opening links or attachments
> 
> 
> [AMD Official Use Only - General]
> 
> Hi Nickle,
> I read though this patch and was confused by function naming and the function
> description in the function header.  I think we have to revise it and make the
> description of functionality clear for user to follow.
> 
> I apologize if we ever discussed this before however I don't have the 
> synchronous
> mind now.
> 
> 1. Protocol definitions
>This protocol is provided by platform that would like to add an additional 
> Redfish
> resource in "Oem" property or to add other platform specific property in the
> name other than "Oem".
>Both of two protocol interfaces give platform an chance to add "OEM" or 
> other
> Redfish property, however the naming of function prototypes are not 
> consistent.
> The naming of "OemCallback" and "ProvisioningCallback" are also not 
> consistent.
> 
> How do you think the naming below,
> 
> struct _EDKII_REDFISH_RESOURCE_ADDENDUM_PROTOCOL {
>   UINT64  Revision;
>   EDKII_REDFISH_RESOURCE_ADDENDUM_OEM
> AddAddendumOemRedfishResource;   ///<
>   EDKII_REDFISH_RESOURCE_ADDENDUM_OTHER
> AddAddendumOtherRedfishResource;   ///<
> };
> Would above look simple and clear? Also, please add some comments to these
> two functions if you are agree with this change.
> 
> 2. Function naming in the library,
> RedfishGetOemData ->  RedfishGetAddendumOemData
> RedfishGetAddendumData-> RedfishGetAddendumOtherData
> 
> 3. The current description in function header looks to me not quite clear. 
> Please
> elaborates some more functionality in the function header and parameters
> 
> 4. Shall we have to update readme.md?
> 
> Thanks
> Abner
> 
> 
> > -Original Message-
> > From: Nickle Wang 
> > Sent: Friday, May 12, 2023 3:23 PM
> > To: devel@edk2.groups.io
> > Cc: Chang, Abner ; Igor Kulchytskyy
> > 
> > Subject: [edk2-redfish-client][PATCH 2/3] RedfishClientPkg: Add
> > Redfish Resource Addendum Library
> >
> > Caution: This message originated from an External Source. Use proper
> > caution when opening attachments, clicking links, or responding.
> >
> >
> > Implement RedfishAddendumLib to support Redfish Resource Addendum
> > Protocol.
> > Feature driver calls this library to get addendum data before
> > providing data to Redfish service
> >
> > Signed-off-by: Nickle Wang 
> > Cc: Abner Chang 
> > Cc: Igor Kulchytskyy 
> > ---
> >  RedfishClientPkg/RedfishClientLibs.dsc.inc|   4 +-
> >  RedfishClientPkg/RedfishClientPkg.dsc |   2 +
> >  .../RedfishAddendumLib/RedfishAddendumLib.inf |  40 +++
> >  .../Include/Library/RedfishAddendumLib.h  |  65 +
> >  .../RedfishAddendumLib/RedfishAddendumLib.c   | 262
> > ++
> >  5 files changed, 372 insertions(+), 1 deletion(-)  create mode 100644
> > RedfishClientPkg/Library/RedfishAddendumLib/RedfishAddendumLib.inf
> >  create mode 100644
> > RedfishClientPkg/Include/Library/RedfishAddendumLib.h
> >  create mode 100644
> > RedfishClientPkg/Library/RedfishAddendumLib/RedfishAddendumLib.c
> >
> > diff --git a/RedfishClientPkg/RedfishClientLibs.dsc.inc
> > b/RedfishClientPkg/RedfishClientLibs.dsc.inc
> > index fe0c4b08..5ea38015 100644
> > --- a/RedfishClientPkg/RedfishClientLibs.dsc.inc
> > +++ b/RedfishClientPkg/RedfishClientLibs.dsc.inc
> > @@ -2,10 +2,11 @@
> >  # Redfish DSC include file for [LibraryClasses*] section of all 
> > Architectures.
> >  #
> >  # This file can be included to the [LibraryClasses*] section(s) of a
> > platform DSC file -# by using "!include RedfishPkg/RedfisLibs.dsc.inc"
> > to specify the library instances
> > +# by using "!include RedfishPkg/RedfishLibs.dsc.inc" to specify the
> > +library
> > instances
> >  # of EDKII network library classes.
> >  #
> >  # (C) Copyright 2021-2022 Hewlett Packard Enterprise Development
> > LP
> > +# Copyright (c) 2023, NVIDIA CORPORATION & AFFILIATES. All rights
> > reserved.
> >  #
> >  #SPDX-License-Identifier: BSD-2-Clause-Patent
> >  #
> > @@ -37,3 +38,4 @@
> >
> > EdkIIRedfishResourceConfigLib|RedfishClientPkg/Library/EdkIIRedfishRes
> > EdkIIRedfishResourceConfigLib|ou
> > rceConfigLib/EdkIIRedfishResourceConfigLib.inf
> >
> > RedfishEventLib|RedfishClientPkg/Library/RedfishEventLib/RedfishEventL
> > RedfishEventLib|ib.i
> > nf
> >
> > RedfishVersionLib|RedfishClientPkg/Library/RedfishVersionLib/RedfishVe
> > RedfishVersionLib|rsi
> > onLib.inf
> > +
> > RedfishAddendumLib|RedfishClientPkg/Library/RedfishAddendumLib/Redfi
> > shAddendumLib.inf
> > diff --git a/RedfishClientPkg/RedfishClientPkg.dsc
> > 

[edk2-devel] [edk2-redfish-client][PATCH v2 3/3] RedfishClientPkg: Utilize RedfishAddendumLib

2023-05-15 Thread Nickle Wang via groups.io
Bios feature driver utilizes RedfishAddendumLib and get additional data
before sending BIOS attributes to Redfish service.

Signed-off-by: Nickle Wang 
Cc: Abner Chang 
Cc: Igor Kulchytskyy 
---
 .../Features/Bios/v1_0_9/Dxe/BiosDxe.inf  |   2 +
 .../Include/RedfishResourceCommon.h   |   2 +
 .../Features/Bios/v1_0_9/Common/BiosCommon.c  | 100 ++
 3 files changed, 104 insertions(+)

diff --git a/RedfishClientPkg/Features/Bios/v1_0_9/Dxe/BiosDxe.inf 
b/RedfishClientPkg/Features/Bios/v1_0_9/Dxe/BiosDxe.inf
index 8c01a3b8..37346e50 100644
--- a/RedfishClientPkg/Features/Bios/v1_0_9/Dxe/BiosDxe.inf
+++ b/RedfishClientPkg/Features/Bios/v1_0_9/Dxe/BiosDxe.inf
@@ -1,6 +1,7 @@
 ## @file
 #
 #  (C) Copyright 2020-2022 Hewlett Packard Enterprise Development LP
+#  Copyright (c) 2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
 #
 #  SPDX-License-Identifier: BSD-2-Clause-Patent
 #
@@ -37,6 +38,7 @@
   RedfishResourceIdentifyLib
   UefiLib
   UefiDriverEntryPoint
+  RedfishAddendumLib
 
 [Protocols]
   gEdkIIRedfishConfigHandlerProtocolGuid  ## PRODUCED
diff --git a/RedfishClientPkg/Include/RedfishResourceCommon.h 
b/RedfishClientPkg/Include/RedfishResourceCommon.h
index c270f92b..b006755d 100644
--- a/RedfishClientPkg/Include/RedfishResourceCommon.h
+++ b/RedfishClientPkg/Include/RedfishResourceCommon.h
@@ -2,6 +2,7 @@
   Redfish feature driver common header file.
 
   (C) Copyright 2020-2022 Hewlett Packard Enterprise Development LP
+  Copyright (c) 2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
 
   SPDX-License-Identifier: BSD-2-Clause-Patent
 
@@ -30,6 +31,7 @@
 #include 
 #include 
 #include 
+#include 
 
 //
 // Protocols
diff --git a/RedfishClientPkg/Features/Bios/v1_0_9/Common/BiosCommon.c 
b/RedfishClientPkg/Features/Bios/v1_0_9/Common/BiosCommon.c
index 22074559..c7c77a02 100644
--- a/RedfishClientPkg/Features/Bios/v1_0_9/Common/BiosCommon.c
+++ b/RedfishClientPkg/Features/Bios/v1_0_9/Common/BiosCommon.c
@@ -2,6 +2,7 @@
   Redfish feature driver implementation - common functions
 
   (C) Copyright 2020-2022 Hewlett Packard Enterprise Development LP
+  Copyright (c) 2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
 
   SPDX-License-Identifier: BSD-2-Clause-Patent
 
@@ -265,6 +266,7 @@ ProvisioningBiosResource (
   )
 {
   CHAR8   *Json;
+  CHAR8   *JsonWithAddendum;
   EFI_STATUS  Status;
   EFI_STRING  NewResourceLocation;
   CHAR8   *EtagStr;
@@ -290,6 +292,38 @@ ProvisioningBiosResource (
 return Status;
   }
 
+  //
+  // Check and see if platform has OEM data or not
+  //
+  Status = RedfishGetOemData (
+ Private->Uri,
+ RESOURCE_SCHEMA,
+ RESOURCE_SCHEMA_VERSION,
+ Json,
+ 
+ );
+  if (!EFI_ERROR (Status) && (JsonWithAddendum != NULL)) {
+FreePool (Json);
+Json = JsonWithAddendum;
+JsonWithAddendum = NULL;
+  }
+
+  //
+  // Check and see if platform has addendum data or not
+  //
+  Status = RedfishGetAddendumData (
+ Private->Uri,
+ RESOURCE_SCHEMA,
+ RESOURCE_SCHEMA_VERSION,
+ Json,
+ 
+ );
+  if (!EFI_ERROR (Status) && (JsonWithAddendum != NULL)) {
+FreePool (Json);
+Json = JsonWithAddendum;
+JsonWithAddendum = NULL;
+  }
+
   Status = CreatePayloadToPostResource (Private->RedfishService, 
Private->Payload, Json, , );
   if (EFI_ERROR (Status)) {
 DEBUG ((DEBUG_ERROR, "%a, post Bios resource for %s failed: %r\n", 
__FUNCTION__, ConfigureLang, Status));
@@ -369,6 +403,7 @@ ProvisioningBiosExistResource (
   EFI_STRING  ConfigureLang;
   CHAR8   *EtagStr;
   CHAR8   *Json;
+  CHAR8   *JsonWithAddendum;
 
   if (Private == NULL) {
 return EFI_INVALID_PARAMETER;
@@ -401,6 +436,38 @@ ProvisioningBiosExistResource (
 goto ON_RELEASE;
   }
 
+  //
+  // Check and see if platform has OEM data or not
+  //
+  Status = RedfishGetOemData (
+ Private->Uri,
+ RESOURCE_SCHEMA,
+ RESOURCE_SCHEMA_VERSION,
+ Json,
+ 
+ );
+  if (!EFI_ERROR (Status) && (JsonWithAddendum != NULL)) {
+FreePool (Json);
+Json = JsonWithAddendum;
+JsonWithAddendum = NULL;
+  }
+
+  //
+  // Check and see if platform has addendum data or not
+  //
+  Status = RedfishGetAddendumData (
+ Private->Uri,
+ RESOURCE_SCHEMA,
+ RESOURCE_SCHEMA_VERSION,
+ Json,
+ 
+ );
+  if (!EFI_ERROR (Status) && (JsonWithAddendum != NULL)) {
+FreePool (Json);
+Json = JsonWithAddendum;
+JsonWithAddendum = NULL;
+  }
+
   DEBUG ((REDFISH_DEBUG_TRACE, "%a, provisioning existing resource for %s\n", 
__FUNCTION__, ConfigureLang));
   //
   // PUT back to instance
@@ -528,6 +595,7 @@ RedfishUpdateResourceCommon (
 {
   EFI_STATUS  Status;
   CHAR8   *Json;
+  CHAR8   

[edk2-devel] [edk2-redfish-client][PATCH v2 2/3] RedfishClientPkg: Add Redfish Resource Addendum Library

2023-05-15 Thread Nickle Wang via groups.io
Implement RedfishAddendumLib to support Redfish Resource Addendum Protocol.
Feature driver calls this library to get addendum data before providing
data to Redfish service

Signed-off-by: Nickle Wang 
Cc: Abner Chang 
Cc: Igor Kulchytskyy 
---
 RedfishClientPkg/RedfishClientLibs.dsc.inc|   4 +-
 RedfishClientPkg/RedfishClientPkg.dsc |   2 +
 .../RedfishAddendumLib/RedfishAddendumLib.inf |  40 +++
 .../Include/Library/RedfishAddendumLib.h  |  67 +
 .../RedfishAddendumLib/RedfishAddendumLib.c   | 265 ++
 5 files changed, 377 insertions(+), 1 deletion(-)
 create mode 100644 
RedfishClientPkg/Library/RedfishAddendumLib/RedfishAddendumLib.inf
 create mode 100644 RedfishClientPkg/Include/Library/RedfishAddendumLib.h
 create mode 100644 
RedfishClientPkg/Library/RedfishAddendumLib/RedfishAddendumLib.c

diff --git a/RedfishClientPkg/RedfishClientLibs.dsc.inc 
b/RedfishClientPkg/RedfishClientLibs.dsc.inc
index fe0c4b08..5ea38015 100644
--- a/RedfishClientPkg/RedfishClientLibs.dsc.inc
+++ b/RedfishClientPkg/RedfishClientLibs.dsc.inc
@@ -2,10 +2,11 @@
 # Redfish DSC include file for [LibraryClasses*] section of all Architectures.
 #
 # This file can be included to the [LibraryClasses*] section(s) of a platform 
DSC file
-# by using "!include RedfishPkg/RedfisLibs.dsc.inc" to specify the library 
instances
+# by using "!include RedfishPkg/RedfishLibs.dsc.inc" to specify the library 
instances
 # of EDKII network library classes.
 #
 # (C) Copyright 2021-2022 Hewlett Packard Enterprise Development LP
+# Copyright (c) 2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
 #
 #SPDX-License-Identifier: BSD-2-Clause-Patent
 #
@@ -37,3 +38,4 @@
   
EdkIIRedfishResourceConfigLib|RedfishClientPkg/Library/EdkIIRedfishResourceConfigLib/EdkIIRedfishResourceConfigLib.inf
   RedfishEventLib|RedfishClientPkg/Library/RedfishEventLib/RedfishEventLib.inf
   
RedfishVersionLib|RedfishClientPkg/Library/RedfishVersionLib/RedfishVersionLib.inf
+  
RedfishAddendumLib|RedfishClientPkg/Library/RedfishAddendumLib/RedfishAddendumLib.inf
diff --git a/RedfishClientPkg/RedfishClientPkg.dsc 
b/RedfishClientPkg/RedfishClientPkg.dsc
index 2b2149cc..d3b645b6 100644
--- a/RedfishClientPkg/RedfishClientPkg.dsc
+++ b/RedfishClientPkg/RedfishClientPkg.dsc
@@ -2,6 +2,7 @@
 # Redfish Client Package
 #
 # (C) Copyright 2021 Hewlett-Packard Enterprise Development LP.
+# Copyright (c) 2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
 #
 #SPDX-License-Identifier: BSD-2-Clause-Patent
 #
@@ -49,5 +50,6 @@
 
   
RedfishClientPkg/Library/RedfishFeatureUtilityLib/RedfishFeatureUtilityLib.inf
   RedfishClientPkg/PrivateLibrary/RedfishLib/RedfishLib.inf
+  RedfishClientPkg/Library/RedfishAddendumLib/RedfishAddendumLib.inf
 
   !include RedfishClientPkg/RedfishClient.dsc.inc
diff --git a/RedfishClientPkg/Library/RedfishAddendumLib/RedfishAddendumLib.inf 
b/RedfishClientPkg/Library/RedfishAddendumLib/RedfishAddendumLib.inf
new file mode 100644
index ..1ecfaa69
--- /dev/null
+++ b/RedfishClientPkg/Library/RedfishAddendumLib/RedfishAddendumLib.inf
@@ -0,0 +1,40 @@
+## @file
+#
+#  Copyright (c) 2022-2023, NVIDIA CORPORATION & AFFILIATES. All rights 
reserved.
+#
+#  SPDX-License-Identifier: BSD-2-Clause-Patent
+#
+##
+
+[Defines]
+  INF_VERSION= 0x00010006
+  BASE_NAME  = RedfishAddendumLib
+  FILE_GUID  = 7B227D39-746D-4247-8291-27B0FA79A7AF
+  MODULE_TYPE= DXE_DRIVER
+  VERSION_STRING = 1.0
+  LIBRARY_CLASS  = RedfishAddendumLib| DXE_DRIVER UEFI_DRIVER
+
+#
+#  VALID_ARCHITECTURES   = IA32 X64 EBC
+#
+
+[Sources]
+  RedfishAddendumLib.c
+
+[Packages]
+  MdePkg/MdePkg.dec
+  MdeModulePkg/MdeModulePkg.dec
+  RedfishPkg/RedfishPkg.dec
+  RedfishClientPkg/RedfishClientPkg.dec
+
+[LibraryClasses]
+  BaseLib
+  DebugLib
+  UefiBootServicesTableLib
+  MemoryAllocationLib
+  UefiLib
+  JsonLib
+
+[Protocols]
+  gEdkIIRedfishResourceAddendumProtocolGuid   ## CONSUMED ##
+
diff --git a/RedfishClientPkg/Include/Library/RedfishAddendumLib.h 
b/RedfishClientPkg/Include/Library/RedfishAddendumLib.h
new file mode 100644
index ..ae61c825
--- /dev/null
+++ b/RedfishClientPkg/Include/Library/RedfishAddendumLib.h
@@ -0,0 +1,67 @@
+/** @file
+  This file defines the Redfish addendum library interface.
+
+  Copyright (c) 2022-2023, NVIDIA CORPORATION & AFFILIATES. All rights 
reserved.
+
+  SPDX-License-Identifier: BSD-2-Clause-Patent
+
+**/
+
+#ifndef REDFISH_ADDENDUM_LIB_H_
+#define REDFISH_ADDENDUM_LIB_H_
+
+#include 
+#include 
+#include 
+
+/**
+  This function calls EDKII_REDFISH_RESOURCE_ADDENDUM_PROTOCOL to get
+  addendum data. It's call's responsibility to release JsonWithAddendum.
+
+  @param[in]   Uri  Uri of input resource.
+  @param[in]   Schema   Redfish schema string.
+  @param[in]   Version  Schema version string.
+  @param[in]   JsonText 

[edk2-devel] [edk2-redfish-client][PATCH v2 1/3] RedfishClientPkg: Add Redfish Resource Addendum Protocol

2023-05-15 Thread Nickle Wang via groups.io
Introduce Redfish Resource Addendum Protocol to Redfish feature driver.
Feature driver uses this protocol to query OEM resource from platform in
order to support Redfish OEM property. This protocol is also used to get
addendum data that is required by BMC to manage Redfish BIOS service.

Signed-off-by: Nickle Wang 
Cc: Abner Chang 
Cc: Igor Kulchytskyy 
---
 RedfishClientPkg/RedfishClientPkg.dec |  2 +
 .../EdkIIRedfishResourceAddendumProtocol.h| 94 +++
 2 files changed, 96 insertions(+)
 create mode 100644 
RedfishClientPkg/Include/Protocol/EdkIIRedfishResourceAddendumProtocol.h

diff --git a/RedfishClientPkg/RedfishClientPkg.dec 
b/RedfishClientPkg/RedfishClientPkg.dec
index c0ab30ab..84bceca3 100644
--- a/RedfishClientPkg/RedfishClientPkg.dec
+++ b/RedfishClientPkg/RedfishClientPkg.dec
@@ -43,6 +43,8 @@
   gEdkIIRedfishConfigLangMapProtocolGuid= { 0x1d9ba9fe, 0x5d5a, 0x4b66, 
{0x83, 0x5b, 0xe2, 0x5d, 0x13, 0x93, 0x4a, 0x9c } }
   ## Include/Protocol/EdkIIRedfishInterchangeData.h
   gEdkIIRedfishFeatureInterchangeDataProtocolGuid = { 0x4B8FF71C, 0x4A7B, 
0x9478, { 0xB7, 0x81, 0x35, 0x9B, 0x0A, 0xF2, 0x00, 0x91 } }
+  ## Include/Protocol/EdkIIRedfishResourceAddendumProtocol.h
+  gEdkIIRedfishResourceAddendumProtocolGuid = { 0xda36b12b, 0xaad4, 0x4e90, { 
0xba, 0xcb, 0xe3, 0xb5, 0x3b, 0x08, 0xbc, 0x54 } }
 
 [Guids]
   ## Include/Guid/RedfishClientPkgTokenSpace.h
diff --git 
a/RedfishClientPkg/Include/Protocol/EdkIIRedfishResourceAddendumProtocol.h 
b/RedfishClientPkg/Include/Protocol/EdkIIRedfishResourceAddendumProtocol.h
new file mode 100644
index ..da88fa29
--- /dev/null
+++ b/RedfishClientPkg/Include/Protocol/EdkIIRedfishResourceAddendumProtocol.h
@@ -0,0 +1,94 @@
+/** @file
+  This file defines the EDKII_REDFISH_RESOURCE_ADDENDUM_PROTOCOL interface.
+
+  Copyright (c) 2022-2023, NVIDIA CORPORATION & AFFILIATES. All rights 
reserved.
+
+  SPDX-License-Identifier: BSD-2-Clause-Patent
+
+**/
+
+#ifndef EDKII_REDFISH_RESOURCE_ADDENDUM_PROTOCOL_H_
+#define EDKII_REDFISH_RESOURCE_ADDENDUM_PROTOCOL_H_
+
+#include 
+
+typedef struct _EDKII_REDFISH_RESOURCE_ADDENDUM_PROTOCOL 
EDKII_REDFISH_RESOURCE_ADDENDUM_PROTOCOL;
+
+///
+/// The definition of REDFISH_SCHEMA_INFO
+///
+typedef struct {
+  CHAR8*Uri;
+  CHAR8*Schema;
+  CHAR8*Version;
+} REDFISH_RESOURCE_SCHEMA_INFO;
+
+/**
+  Edk2 platform Redfish Resource Addendum driver provides this interface to 
create addendum data
+  which is required by Redfish service to manage Redfish resource.
+
+  Redfish feature driver calls this interface with the JSON data on input and 
Redfish schema
+  information. The JSON data contains Redfish attributes that is created by 
feature driver.
+  Based those attributes, edk2 platform Redfish Resource Addendum driver 
appends addendum data
+  to it, or edk2 platform Redfish Resource Addendum driver replaces it with 
addendum data that
+  is required by Redfish service. Then Redfish feature driver sends JSON data 
to Redfish
+  service directly without modification.
+
+  @param[in]  This Pointer to 
EDKII_REDFISH_RESOURCE_ADDENDUM_PROTOCOL instance.
+  @param[in]  SchemaInfo   Redfish schema information.
+  @param[in,out]  Json On input, this is the Redfish data in given 
JSON in JSON object.
+   On output, This is the Redfish data with 
addendum information
+   which platform would like to add to Redfish 
service.
+
+  @retval EFI_SUCCESS  Addendum data is attached.
+  @retval EFI_UNSUPPORTED  No addendum data is required in given 
schema.
+  @retval Others   Some error happened.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EDKII_REDFISH_RESOURCE_ADDENDUM_DATA)(
+  IN EDKII_REDFISH_RESOURCE_ADDENDUM_PROTOCOL  *This,
+  IN REDFISH_RESOURCE_SCHEMA_INFO  *SchemaInfo,
+  IN OUT EDKII_JSON_VALUE  Json
+  );
+
+/**
+  Edk2 platform Redfish Resource Addendum driver provides this interface to 
create OEM data which
+  is specified by Redfish schema.
+
+  Redfish feature driver calls this interface with Redfish schema information. 
edk2 platform
+  Redfish Resource Addendum driver creates OEM data and return it to feature 
driver. Then feature
+  driver will append returned JSON data to "Oem" attribute. Feature driver 
sends Oem attribute
+  and all other attributes to Redfish service without modification.
+
+  @param[in]   This Pointer to 
EDKII_REDFISH_RESOURCE_ADDENDUM_PROTOCOL instance.
+  @param[in]   SchemaInfo   Redfish schema information.
+  @param[out]  Json This is the Redfish data which will be 
attached to OEM object in
+given schema.
+
+  @retval EFI_SUCCESS   OEM data is attached.
+  @retval EFI_UNSUPPORTED   No OEM data is required in given schema.
+  @retval OthersSome error happened.
+
+**/
+typedef
+EFI_STATUS

[edk2-devel] [edk2-redfish-client][PATCH v2 0/3] Introduce resource addendum protocol

2023-05-15 Thread Nickle Wang via groups.io
v2:
Update protocol and library function description.

v1:
Introduce EDKII_REDFISH_RESOURCE_ADDENDUM_PROTOCOL to Redfish feature driver.
Feature driver uses this protocol to query OEM resource from platform in
order to support Redfish OEM property. This protocol is also used to get
addendum data that is required by BMC to manage Redfish BIOS service.

Signed-off-by: Nickle Wang 
Cc: Abner Chang 
Cc: Igor Kulchytskyy 

*** BLURB HERE ***

Nickle Wang (3):
  RedfishClientPkg: Add Redfish Resource Addendum Protocol
  RedfishClientPkg: Add Redfish Resource Addendum Library
  RedfishClientPkg: Utilize RedfishAddendumLib

 RedfishClientPkg/RedfishClientPkg.dec |   2 +
 RedfishClientPkg/RedfishClientLibs.dsc.inc|   4 +-
 RedfishClientPkg/RedfishClientPkg.dsc |   2 +
 .../Features/Bios/v1_0_9/Dxe/BiosDxe.inf  |   2 +
 .../RedfishAddendumLib/RedfishAddendumLib.inf |  40 +++
 .../Include/Library/RedfishAddendumLib.h  |  67 +
 .../EdkIIRedfishResourceAddendumProtocol.h|  94 +++
 .../Include/RedfishResourceCommon.h   |   2 +
 .../Features/Bios/v1_0_9/Common/BiosCommon.c  | 100 +++
 .../RedfishAddendumLib/RedfishAddendumLib.c   | 265 ++
 10 files changed, 577 insertions(+), 1 deletion(-)
 create mode 100644 
RedfishClientPkg/Library/RedfishAddendumLib/RedfishAddendumLib.inf
 create mode 100644 RedfishClientPkg/Include/Library/RedfishAddendumLib.h
 create mode 100644 
RedfishClientPkg/Include/Protocol/EdkIIRedfishResourceAddendumProtocol.h
 create mode 100644 
RedfishClientPkg/Library/RedfishAddendumLib/RedfishAddendumLib.c

-- 
2.17.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#104854): https://edk2.groups.io/g/devel/message/104854
Mute This Topic: https://groups.io/mt/98898794/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-