Re: [edk2-devel] [PATCH V8 21/47] OvmfPkg/PlatformPei: Refactor AddressWidthInitialization

2022-03-15 Thread Min Xu
On March 15, 2022 4:04 PM, Gerd Hofmann wrote:
> 
> On Sat, Mar 12, 2022 at 09:53:46AM +0800, Min Xu wrote:
> > +/**
> > +  Initialize the mPhysMemAddressWidth variable, based on guest RAM size.
> > +**/
> 
> That comment isn't correct any more, the global variables are in
> PlatformInfoHob now (there are probably more cases like this).
Thanks for reminder. They will be updated in the next version.

Thanks
Min


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




Re: [edk2-devel] **NOTICE** EDK II CI downloading gcc_arm_linux tools Failing

2022-03-15 Thread Sami Mujawar
Hi Bob,

The gcc_arm_linux tools failure was due to a broken download link for the 
toolchain. I noticed this issue while trying to merge 
https://edk2.groups.io/g/devel/message/87538. However, the download link should 
now be restored as I was able to merge a change yesterday evening.

I am not sure if you would need to retrigger the stalled pull request for the 
CI to proceed.
If you still find that the gcc_arm_linux tools are failing, please do let me 
know.

Regards,

Sami Mujawar




From:  on behalf of "Bob Feng via groups.io" 

Reply to: "devel@edk2.groups.io" , "bob.c.f...@intel.com" 

Date: Wednesday, 16 March 2022 at 01:37
To: "devel@edk2.groups.io" , "Kinney, Michael D" 
, Sean Brogan 
Subject: Re: [edk2-devel] **NOTICE** EDK II CI downloading gcc_arm_linux tools 
Failing

Hi Sean,

Do you have anything update for this issue?

Thanks,
Bob

From: Feng, Bob C 
Sent: Wednesday, March 16, 2022 9:35 AM
To: devel@edk2.groups.io; Kinney, Michael D ; Sean 
Brogan 
Cc: Feng, Bob C 
Subject: [edk2-devel] **NOTICE** EDK II CI downloading gcc_arm_linux tools 
Failing


Hello,



The EDK II CI downloading gcc_arm_linux tools failing right now that cause some 
of the CI build task failed.



First failure occurred on 3-15-2022.



The issue is being worked.



Thank you for your patience.



Best Regards,
Bob Feng




-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#87622): https://edk2.groups.io/g/devel/message/87622
Mute This Topic: https://groups.io/mt/89813403/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 27/37] UefiCpuPkg: Update AddressEncMask in CpuPageTable

2022-03-15 Thread Min Xu
Sure. The empty line will be removed in the next version in the next version.

From: Ni, Ray 
Sent: Tuesday, March 15, 2022 4:03 PM
To: Xu, Min M ; devel@edk2.groups.io
Subject: Re: [edk2-devel] [PATCH V7 27/37] UefiCpuPkg: Update AddressEncMask in 
CpuPageTable


Can you please remove the empty line added in GetPageTableEntry()? Can you 
please check whether it can pass uncrustify check?

With that addressed, Reviewed-by: Ray Ni 
ray...@intel.com


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




Re: [edk2-devel] [PATCH V8 18/47] OvmfPkg/PlatformPei: Move global variables to PlatformInfoHob

2022-03-15 Thread Min Xu
On March 15, 2022 3:57 PM, Gerd Hoffmann wrote:
> 
> > diff --git a/OvmfPkg/PlatformPei/AmdSev.c
> > b/OvmfPkg/PlatformPei/AmdSev.c index fb7e21ec140f..c180383b42b0
> 100644
> > --- a/OvmfPkg/PlatformPei/AmdSev.c
> > +++ b/OvmfPkg/PlatformPei/AmdSev.c
> > @@ -24,6 +24,8 @@
> >
> >  #include "Platform.h"
> >
> > +extern EFI_HOB_PLATFORM_INFO  mPlatformInfoHob;
> 
> Move that line to Platform.h?
Sure. It will be moved to Platform.h in the next version.
> 
> Otherwise looks good.
> Acked-by: Gerd Hoffmann 

Thanks
Min


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




[edk2-devel] [PATCH v1 0/1] SMM memory management: Inspect memory guarded with pool headers

2022-03-15 Thread Kun Qin
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3488

Current free pool routine from PiSmmCore will inspect memory guard status
for target buffer without considering pool headers. This could lead to
`IsMemoryGuarded` function to return incorrect results.

i.e. A 0-sized pool that is configured to be near tail guard page, it
could cause the returned region points into a guard page, which is legal.
However, trying to free this 0 sized pool will cause `IsMemoryGuarded` to
access guard page, which leads to page fault.

This change will inspect memory guarded with pool headers. This can avoid
errors when a pool content happens to be on a page boundary.

Patch v1 branch: https://github.com/kuqin12/edk2/tree/mm_zero_sized_pool

Cc: Jiewen Yao 
Cc: Eric Dong 
Cc: Ray Ni 
Cc: Jian J Wang 
Cc: Liming Gao 

Kun Qin (1):
  MdeModulePkg: PiSmmCore: Inspect memory guarded with pool headers

 MdeModulePkg/Core/PiSmmCore/Pool.c | 10 +-
 1 file changed, 5 insertions(+), 5 deletions(-)

-- 
2.35.1.windows.2



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




[edk2-devel] [PATCH v1 1/1] MdeModulePkg: PiSmmCore: Inspect memory guarded with pool headers

2022-03-15 Thread Kun Qin
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3488

Current free pool routine from PiSmmCore will inspect memory guard status
for target buffer without considering pool headers. This could lead to
`IsMemoryGuarded` function to return incorrect results.

In that sense, allocating a 0 sized pool could cause an allocated buffer
directly points into a guard page, which is legal. However, trying to
free this pool will cause the routine changed in this commit to read XP
pages, which leads to page fault.

This change will inspect memory guarded with pool headers. This can avoid
errors when a pool content happens to be on a page boundary.

Cc: Jiewen Yao 
Cc: Eric Dong 
Cc: Ray Ni 
Cc: Jian J Wang 
Cc: Liming Gao 

Signed-off-by: Kun Qin 
---
 MdeModulePkg/Core/PiSmmCore/Pool.c | 10 +-
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/MdeModulePkg/Core/PiSmmCore/Pool.c 
b/MdeModulePkg/Core/PiSmmCore/Pool.c
index 96ebe811c669..e1ff40a8ea55 100644
--- a/MdeModulePkg/Core/PiSmmCore/Pool.c
+++ b/MdeModulePkg/Core/PiSmmCore/Pool.c
@@ -382,11 +382,6 @@ SmmInternalFreePool (
 return EFI_INVALID_PARAMETER;
   }
 
-  MemoryGuarded = IsHeapGuardEnabled () &&
-  IsMemoryGuarded ((EFI_PHYSICAL_ADDRESS)(UINTN)Buffer);
-  HasPoolTail = !(MemoryGuarded &&
-  ((PcdGet8 (PcdHeapGuardPropertyMask) & BIT7) == 0));
-
   FreePoolHdr = (FREE_POOL_HEADER *)((POOL_HEADER *)Buffer - 1);
   ASSERT (FreePoolHdr->Header.Signature == POOL_HEAD_SIGNATURE);
   ASSERT (!FreePoolHdr->Header.Available);
@@ -394,6 +389,11 @@ SmmInternalFreePool (
 return EFI_INVALID_PARAMETER;
   }
 
+  MemoryGuarded = IsHeapGuardEnabled () &&
+  IsMemoryGuarded ((EFI_PHYSICAL_ADDRESS)(UINTN)FreePoolHdr);
+  HasPoolTail = !(MemoryGuarded &&
+  ((PcdGet8 (PcdHeapGuardPropertyMask) & BIT7) == 0));
+
   if (HasPoolTail) {
 PoolTail = HEAD_TO_TAIL (>Header);
 ASSERT (PoolTail->Signature == POOL_TAIL_SIGNATURE);
-- 
2.35.1.windows.2



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




[edk2-devel] Decompression Failed on EDK2 [ArmPlatformPrePiUniCore]

2022-03-15 Thread jit . loon . lim
Hi All,

I'm facing an issue after rebase the EDK2.
Since there are additional INF added to FDF file, I have updated the FV base 
address from 0x1000 to 0x2000.
However, it still failed to decompress the image during boot time as following:

INFO:ScrubbBg_Cmd: +quit
ing ECC
Bg_Cmd: Disconnected from running target Cortex-A53_SMP_0
Bg_Cmd: Jython script 
/tmp/arc_146321093/_0/regtest/embedded/uefi/ci_uefi_sdmmc_boot/agilex/atf_2_6_0_uefi_202011/load_s10_preloader_atf.py
 ... Finished
INFO:Error in response: 1f0002ff
NOTICE:  BL2: v2.6.0(debug):rel_socfpga_v2.6.0_22.03.01_rc1-dirty
NOTICE:  BL2: Built : 09:24:34, Mar 16 2022
INFO:BL2: Doing platform setup
INFO:BL2: Loading image id 3
INFO:Loading image id=3 at address 0x1000
INFO:Image id=3 loaded: 0x1000 - 0xb019
INFO:BL2: Loading image id 5
INFO:Loading image id=5 at address 0x2000
Bg_Cmd: VStream Server Stopped
Bg_Cmd: Waiting...
Bg_Cmd: DONE.
background command exiting
INFO:Image id=5 loaded: 0x2000 - 0x2010
NOTICE:  BL2: Booting BL31
INFO:Entry point address = 0x1000
INFO:SPSR = 0x3cd
NOTICE:  BL31: v2.6.0(release):rel_socfpga_v2.6.0_22.03.01_rc1
NOTICE:  BL31: Built : 12:09:21, Mar 15 2022
UEFI firmware (version 1.0 built at 22:58:01 on Mar 14 2022)
Decompress Failed - Invalid Parameter

ASSERT_EFI_ERROR (Status = Not Found)
ASSERT [ArmPlatformPrePiUniCore] 
/p/psg/swip/w/jitloonl/uefi_rebase/edk2/ArmPlatformPkg/PrePi/PrePi.c(152): 
!(((INTN)(RETURN_STATUS)(Status)) < 0)
Info: Paused test execution timeout monitor.
Info: Current time is Wed Mar 16 11:09:32 2022


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




Re: [edk2-devel] Debugging scripts: "Add support for gdb and lldb"

2022-03-15 Thread Andrew Fish via groups.io
Rebecca,

That would be awesome. I’m happy to help, and answer questions. 

 I’ve been kind of swamped in my day job lately so this would really help. 

Thanks,

Andrew Fish

> On Mar 15, 2022, at 8:48 PM, Rebecca Cran  wrote:
> 
> Given the lack of progress on this for many months, I was wondering if I 
> should perhaps take this over and work on the changes needed to get this 
> functionality committed?
> 
> -- 
> Rebecca Cran
> 
> 
> On 2/10/22 12:13, Rebecca Cran wrote:
>> Andrew: We discussed your patch from August last year in today's Community 
>> Meeting.
>> 
>> The patch is https://edk2.groups.io/g/devel/message/78906, but it sounds as 
>> though there needs to be a v2 to move the files into BaseTools/Scripts based 
>> on recent discussions.
>> 
>> 
>> Mike: it looks like there weren't actually any reviews on it, so it'll need 
>> to wait until after the freeze.
>> 
>> 
> 



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




Re: [edk2-devel] Debugging scripts: "Add support for gdb and lldb"

2022-03-15 Thread Rebecca Cran
Given the lack of progress on this for many months, I was wondering if I 
should perhaps take this over and work on the changes needed to get this 
functionality committed?


--
Rebecca Cran


On 2/10/22 12:13, Rebecca Cran wrote:
Andrew: We discussed your patch from August last year in today's 
Community Meeting.


The patch is https://edk2.groups.io/g/devel/message/78906, but it 
sounds as though there needs to be a v2 to move the files into 
BaseTools/Scripts based on recent discussions.



Mike: it looks like there weren't actually any reviews on it, so it'll 
need to wait until after the freeze.







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




Re: [edk2-devel] [PATCH V8 02/47] MdePkg: Introduce basic Tdx functions in BaseLib

2022-03-15 Thread Min Xu
On March 15, 2022 3:44 PM, Ni, Ray wrote:
> one more comment:
> the functions headers say "@return EFI_SUCCESS". Should we say "@retval 0"
> for a successful call?
Thanks for reminder. It will be updated in the next version.
> 
> +  to the host VMM, as selected by Leaf.
> +
> +  @param[in]  LeafLeaf number of TDCALL instruction
> +  @param[in]  Arg1Arg1
> +  @param[in]  Arg2Arg2
> +  @param[in]  Arg3Arg3
> +  @param[in,out]  Results  Returned result of the Leaf function
> +
> +  @return EFI_SUCCESS
> +  @return Other   See individual leaf functions
> +**/
> +UINTN
> +EFIAPI
> +TdCall (
> +  IN UINT64Leaf,
> +  IN UINT64Arg1,
> +  IN UINT64Arg2,
> +  IN UINT64Arg3,
> +  IN OUT VOID  *Results
> +  );
> +
> +/**
> +  TDVMALL is a leaf function 0 for TDCALL. It helps invoke services
> +from the
> +  host VMM to pass/receive information.
> +
> +  @param[in] LeafNumber of sub-functions
> +  @param[in] Arg1Arg1
> +  @param[in] Arg2Arg2
> +  @param[in] Arg3Arg3
> +  @param[in] Arg4Arg4
> +  @param[in,out] Results Returned result of the sub-function
> +
> +  @return EFI_SUCCESS
> +  @return Other   See individual sub-functions
> +
> +**/
> +UINTN
> +EFIAPI
> +TdVmCall (
> +  IN UINT64Leaf,
> +  IN UINT64Arg1,
> +  IN UINT64Arg2,
> +  IN UINT64Arg3,
> +  IN UINT64Arg4,
> +  IN OUT VOID  *Results
> +  );
> +
> 



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




Re: [edk2-devel] **NOTICE** EDK II CI downloading gcc_arm_linux tools Failing

2022-03-15 Thread Bob Feng
Hi Sean,

Do you have anything update for this issue?

Thanks,
Bob

From: Feng, Bob C 
Sent: Wednesday, March 16, 2022 9:35 AM
To: devel@edk2.groups.io; Kinney, Michael D ; Sean 
Brogan 
Cc: Feng, Bob C 
Subject: [edk2-devel] **NOTICE** EDK II CI downloading gcc_arm_linux tools 
Failing


Hello,



The EDK II CI downloading gcc_arm_linux tools failing right now that cause some 
of the CI build task failed.



First failure occurred on 3-15-2022.



The issue is being worked.



Thank you for your patience.



Best Regards,
Bob Feng



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




[edk2-devel] **NOTICE** EDK II CI downloading gcc_arm_linux tools Failing

2022-03-15 Thread Bob Feng
Hello,



The EDK II CI downloading gcc_arm_linux tools failing right now that cause some 
of the CI build task failed.



First failure occurred on 3-15-2022.



The issue is being worked.



Thank you for your patience.



Best Regards,
Bob Feng



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




Re: [edk2-devel] [PATCH V8 02/47] MdePkg: Introduce basic Tdx functions in BaseLib

2022-03-15 Thread Ni, Ray
Thanks.
I am ok with DB instructions for tdcall.

-Original Message-
From: Xu, Min M  
Sent: Wednesday, March 16, 2022 9:19 AM
To: Ni, Ray ; devel@edk2.groups.io
Cc: Kinney, Michael D ; Gao, Liming 
; Liu, Zhiguang ; Brijesh 
Singh ; Aktas, Erdem ; James 
Bottomley ; Yao, Jiewen ; Tom 
Lendacky ; Gerd Hoffmann 
Subject: RE: [edk2-devel] [PATCH V8 02/47] MdePkg: Introduce basic Tdx 
functions in BaseLib

On March 15, 2022 3:42 PM, Ni Ray wrote:
> +
> +%macro tdcall 0
> +db 0x66,0x0f,0x01,0xcc
> +%endmacro
> 
> 1. can you please check whether the tdcall instruction is supported by 
> latest NASM compiler?
I checked the NASM (2.15.05) doc 
https://www.nasm.us/xdoc/2.15.05/html/nasmdocb.html#section-B.1 but not find 
the tdcall instruction.
> 
> 
> +AsmCpuid (CPUID_VERSION_INFO, NULL, NULL, , NULL);
> +if ((Ecx & BIT31) == 0) {
> 
> 2. Can you please update CPUID_VERSION_INFO_ECX in 
> MdePkg/Include/Regiter/Intel/Cpuid.h for the BIT31?
Sure. It will be updated in the next version.
> 
> +  break;
> +}
> +
> +if (LargestEax < 0x21) {
> +  break;
> +}
> +
> +AsmCpuidEx (0x21, 0, , , , );
> +if (  (Ebx != SIGNATURE_32 ('I', 'n', 't', 'e'))
> +   || (Edx != SIGNATURE_32 ('l', 'T', 'D', 'X'))
> +   || (Ecx != SIGNATURE_32 (' ', ' ', ' ', ' ')))
> +{
> +  break;
> +}
> +
> 
> 3. Similar comment as #2.
Sure. It will be updated in the next version.
> 
> 
> +%macro tdcall 0
> +db 0x66,0x0f,0x01,0xcc
> +%endmacro
> 
> 4. similar comment as #1.
See my answer to comment #1.

Thanks
Min



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




Re: [edk2-devel] [PATCH V8 02/47] MdePkg: Introduce basic Tdx functions in BaseLib

2022-03-15 Thread Min Xu
On March 15, 2022 3:42 PM, Ni Ray wrote:
> +
> +%macro tdcall 0
> +db 0x66,0x0f,0x01,0xcc
> +%endmacro
> 
> 1. can you please check whether the tdcall instruction is supported by latest
> NASM compiler?
I checked the NASM (2.15.05) doc 
https://www.nasm.us/xdoc/2.15.05/html/nasmdocb.html#section-B.1 but not find 
the tdcall instruction.
> 
> 
> +AsmCpuid (CPUID_VERSION_INFO, NULL, NULL, , NULL);
> +if ((Ecx & BIT31) == 0) {
> 
> 2. Can you please update CPUID_VERSION_INFO_ECX in
> MdePkg/Include/Regiter/Intel/Cpuid.h for the BIT31?
Sure. It will be updated in the next version.
> 
> +  break;
> +}
> +
> +if (LargestEax < 0x21) {
> +  break;
> +}
> +
> +AsmCpuidEx (0x21, 0, , , , );
> +if (  (Ebx != SIGNATURE_32 ('I', 'n', 't', 'e'))
> +   || (Edx != SIGNATURE_32 ('l', 'T', 'D', 'X'))
> +   || (Ecx != SIGNATURE_32 (' ', ' ', ' ', ' ')))
> +{
> +  break;
> +}
> +
> 
> 3. Similar comment as #2.
Sure. It will be updated in the next version.
> 
> 
> +%macro tdcall 0
> +db 0x66,0x0f,0x01,0xcc
> +%endmacro
> 
> 4. similar comment as #1.
See my answer to comment #1.

Thanks
Min



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#87610): https://edk2.groups.io/g/devel/message/87610
Mute This Topic: https://groups.io/mt/89725391/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 - 03/15/2022 #cal-reminder

2022-03-15 Thread devel@edk2.groups.io Calendar
BEGIN:VCALENDAR
VERSION:2.0
PRODID:-//Groups.io Inc//Groups.io Calendar//EN
METHOD:PUBLISH
REFRESH-INTERVAL;VALUE=DURATION:PT1H
X-PUBLISHED-TTL:PT1H
CALSCALE:GREGORIAN
BEGIN:VTIMEZONE
TZID:America/Los_Angeles
LAST-MODIFIED:20201011T015911Z
TZURL:http://tzurl.org/zoneinfo-outlook/America/Los_Angeles
X-LIC-LOCATION:America/Los_Angeles
BEGIN:DAYLIGHT
TZNAME:PDT
TZOFFSETFROM:-0800
TZOFFSETTO:-0700
DTSTART:19700308T02
RRULE:FREQ=YEARLY;BYMONTH=3;BYDAY=2SU
END:DAYLIGHT
BEGIN:STANDARD
TZNAME:PST
TZOFFSETFROM:-0700
TZOFFSETTO:-0800
DTSTART:19701101T02
RRULE:FREQ=YEARLY;BYMONTH=11;BYDAY=1SU
END:STANDARD
END:VTIMEZONE
BEGIN:VEVENT
X-GIOIDS:Event:1238716 
UID:mlda.1580078539586725120.r...@groups.io
DTSTAMP:20220316T011501Z
ORGANIZER;CN=Liming Gao:mailto:gaolim...@byosoft.com.cn
DTSTART:20220316T013000Z
DTEND:20220316T023000Z
SUMMARY:TianoCore Bug Triage - APAC / NAMO
DESCRIPTION:TianoCore Bug Triage - APAC / NAMO\n\nHosted by Liming Gao\n\
 n
 \n\nMicrosoft Teams meeting\n\n*Join on your computer or mobile a
 pp*\n\nClick here to join the meeting ( https://teams.microsoft.com/l/mee
 tup-join/19%3ameeting_OTUyZTg2NjgtNDhlNS00ODVlLTllYTUtYzg1OTNjNjdiZjFh%40
 thread.v2/0?context=%7b%22Tid%22%3a%2246c98d88-e344-4ed4-8496-4ed7712e255
 d%22%2c%22Oid%22%3a%22b286b53a-1218-4db3-bfc9-3d4c5aa7669e%22%7d )\n\n*Jo
 in with a video conferencing device*\n\nte...@conf.intel.com\n\nVideo Con
 ference ID: 116 062 094 0\n\nAlternate VTC dialing instructions ( https:/
 /conf.intel.com/teams/?conf=1160620940=teams=conf.intel.com=te
 st_call )\n\n*Or call in (audio only)*\n\n+1 916-245-6934\,\,77463821# ( 
 tel:+19162456934\,\,77463821# ) United States\, Sacramento\n\nPhone Confe
 rence ID: 774 638 21#\n\nFind a local number ( https://dialin.teams.micro
 soft.com/d195d438-2daa-420e-b9ea-da26f9d1d6d5?id=77463821 ) | Reset PIN (
  https://mysettings.lync.com/pstnconferencing )\n\nLearn More ( https://a
 ka.ms/JoinTeamsMeeting ) | Meeting options ( https://teams.microsoft.com/
 meetingOptions/?organizerId=b286b53a-1218-4db3-bfc9-3d4c5aa7669e
 =46c98d88-e344-4ed4-8496-4ed7712e255d=19_meeting_OTUyZTg2NjgtNDh
 lNS00ODVlLTllYTUtYzg1OTNjNjdiZjFh@thread.v2=0=en-US )
LOCATION:https://teams.microsoft.com/l/meetup-join/19%3ameeting_OTk1YzJhN
 2UtOGQwNi00NjY4LWEwMTktY2JiODRlYTY1NmY0%40thread.v2/0?context=%7b%22Tid%2
 2%3a%2246c98d88-e344-4ed4-8496-4ed7712e255d%22%2c%22Oid%22%3a%226e4ce4c4-
 1242-431b-9a51-92cd01a5df3c%22%7d
SEQUENCE:2
END:VEVENT
END:VCALENDAR


invite.ics
Description: application/ics


Re: [edk2-devel] [PATCH 1/1] MdeModulePkg/VariableRuntimeDxe: avoid double VA conversion of FVB protocol

2022-03-15 Thread Marcin Wojtas
Hi Ard,

śr., 17 mar 2021 o 04:20 gaoliming  napisał(a):
>
> Ard:
>
> > -邮件原件-
> > 发件人: devel@edk2.groups.io  代表 Laszlo Ersek
> > 发送时间: 2021年3月16日 23:58
> > 收件人: Ard Biesheuvel ; devel@edk2.groups.io
> > 抄送: liming@intel.com; j...@solid-run.com; l...@nuviainc.com
> > 主题: Re: [edk2-devel] [PATCH 1/1] MdeModulePkg/VariableRuntimeDxe:
> > avoid double VA conversion of FVB protocol
> >
> > On 03/13/21 00:05, Ard Biesheuvel wrote:
> > > For historical reasons, the VariableRuntimeDxe performs virtual address
> > > conversion on the FVB protocol member pointers of the protocol instance
> > > that backs the EFI variable store. However, the driver that produces the
> > > actual instance should be doing this, as it is the owner, and provides
> > > the actual implementation of those methods.
> > >
> > > Unfortunately, we cannot simply change this: existing drivers may rely
> > > on this behavior, and so the variable driver should take care to only
> > > convert the pointers when necessary, but leave them alone when the owner
> > > is taking care of this.
>
> To answer Laszlo question, I want to know the impact for the simple fix.
>
> > >
> > > The virtual address switch event can be delivered in arbitrary order, and
> > > so we should take care of this in a way that does not rely on whether this
> > > driver converts its pointers either before or after the owner of the FVB
> > > protocol receives the event.
> > >
> > > So let's not convert the pointers at all when the event is delivered, but
> > > record the converted addresses in a shadow FVB protocol. This way, we can
> > > check when the variable driver is invoked at runtime whether the switch
> > > has occurred or not, and perform the switch if it hasn't.
> > >
> > > Signed-off-by: Ard Biesheuvel 
> > > ---
> > > Build tested only.
> > >
> > >  MdeModulePkg/Universal/Variable/RuntimeDxe/VariableDxe.c | 50
> > +---
> > >  1 file changed, 43 insertions(+), 7 deletions(-)
> > >
> > > diff --git a/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableDxe.c
> > b/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableDxe.c
> > > index 0fca0bb2a9b5..3d83ac4452ee 100644
> > > --- a/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableDxe.c
> > > +++ b/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableDxe.c
> > > @@ -37,6 +37,8 @@ EDKII_VAR_CHECK_PROTOCOL
> > mVarCheck  = { VarCheckRegis
> > >
> > VarCheckVariablePropertySet,
> > >
> > VarCheckVariablePropertyGet };
> > >
> > > +STATIC EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL
> > mFvbProtocolShadow;
> > > +
> > >  /**
> > >Some Secure Boot Policy Variable may update following other variable
> > changes(SecureBoot follows PK change, etc).
> > >Record their initial State when variable write service is ready.
> > > @@ -105,8 +107,26 @@ AcquireLockOnlyAtBootTime (
> > >IN EFI_LOCK *Lock
> > >)
> > >  {
> >
> > (1) Why is AcquireLockOnlyAtBootTime() the best place to add this?
> >
> > (Considering especially the leading comment, "This is a temperary
> > function that will be removed when EfiAcquireLock() in UefiLib can
> > handle the call in UEFI Runtimer driver in RT phase".)
> >
> > Obviously, I don't want to create more work for you! I just feel that,
> > if this is not the best place, we shouldn't overload this function with
> > a new responsibility.
> >
> > > +  EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL  *FvbInstance;
> > > +
> > >if (!AtRuntime ()) {
> > >  EfiAcquireLock (Lock);
> > > +  } else {
> > > +//
> > > +// Check whether we need to swap in the converted pointer values
> > for the
> > > +// FVB protocol methods
> > > +//
> > > +FvbInstance = mVariableModuleGlobal->FvbInstance;
> > > +if (FvbInstance != NULL &&
> > > +FvbInstance->GetBlockSize !=
> > mFvbProtocolShadow.GetBlockSize) {
> >
> > (2) It occurs to me that the following pattern (in a single-threaded
> > environment):
> >
> > if (a != b) {
> >   a = b;
> > }
> >
> > is just:
> >
> >   a = b;
> >
> > (the small CPU cost notwithstanding).
> >
> > And that puts this patch in a bit different light: it's not that we may
> > or may not convert. Instead, we *always* convert, the question is *when*
> > we apply the result of the conversion.
> >
> > Functionally, there is no difference, but to me mentally, there'd be a
> > difference, if we said "delay applying the runtime conversion until
> > first call".
> >
> > Anyway... just wanted to highlight this: we could drop the GetBlockSize
> > funcptr comparison. But, we don't have to.
> >
> > Given the reviews from Liming and Hao -- and thank you in the first
> > place for writing the patch! --, I won't really ask for a v2. I'd just
> > somehow prefer the compat logic to be elsewhere, rather than in
> > AcquireLockOnlyAtBootTime(). In the first place, I'm not clear what we
> > currently use AcquireLockOnlyAtBootTime() for.
> >
> > Up to the maintainers to decide whether this justifies v2. If not:

Re: 回复: [edk2-devel] Request for PI spec change

2022-03-15 Thread Kun Qin

Thank you for the help, Vincent!

Could you please let me know if there is anything I need to do in the 
meantime?


Regards,
Kun

On 3/15/2022 2:39 PM, Zimmer, Vincent wrote:

Sounds like we need to open a UEFI Forum Mantis under the PIWG in order to 
propagate this clean-up into the next PI specification based upon 
https://github.com/tianocore/edk2-staging/tree/BZ3794-expand_status_codes.  I 
can take care of that next step along w/ queuing up other topics for an 
upcoming PIWG meeting.

Vincent

-Original Message-
From: devel@edk2.groups.io  On Behalf Of Kun Qin
Sent: Tuesday, March 15, 2022 10:30 AM
To: devel@edk2.groups.io; Gao, Liming ; Kinney, Michael D 

Cc: af...@apple.com; l...@nuviainc.com; Liu, Zhiguang 
Subject: Re: 回复: [edk2-devel] Request for PI spec change

Thanks for the review, Liming.

Could you please also shed some light on what the next steps are?

Thanks,
Kun

On 3/1/2022 5:52 PM, gaoliming wrote:

Kun:
The change looks good to me. Reviewed-by: Liming Gao


Thanks
Liming

-邮件原件-
发件人: devel@edk2.groups.io  代表 Kun Qin
发送时间: 2022年3月2日 3:33
收件人: devel@edk2.groups.io; michael.d.kin...@intel.com
抄送: af...@apple.com; l...@nuviainc.com; gaolim...@byosoft.com.cn;
zhiguang@intel.com
主题: [edk2-devel] Request for PI spec change

Hi edk2 maintainers,

I have been trying to propose a PI spec change to extend status code
definitions.

The proposed PI spec change along with the code change around this
proposal are all pushed to edk2-staging repo:
https://github.com/tianocore/edk2-staging/tree/BZ3794-expand_status_c
od
es

Could you please help reviewing the change and provide feedback? If
there is anything I missed in the code-process, please let me know as well.

Thanks,
Kun

























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




Re: 回复: [edk2-devel] Request for PI spec change

2022-03-15 Thread Zimmer, Vincent
Sounds like we need to open a UEFI Forum Mantis under the PIWG in order to 
propagate this clean-up into the next PI specification based upon 
https://github.com/tianocore/edk2-staging/tree/BZ3794-expand_status_codes.  I 
can take care of that next step along w/ queuing up other topics for an 
upcoming PIWG meeting.

Vincent

-Original Message-
From: devel@edk2.groups.io  On Behalf Of Kun Qin
Sent: Tuesday, March 15, 2022 10:30 AM
To: devel@edk2.groups.io; Gao, Liming ; Kinney, 
Michael D 
Cc: af...@apple.com; l...@nuviainc.com; Liu, Zhiguang 
Subject: Re: 回复: [edk2-devel] Request for PI spec change

Thanks for the review, Liming.

Could you please also shed some light on what the next steps are?

Thanks,
Kun

On 3/1/2022 5:52 PM, gaoliming wrote:
> Kun:
>The change looks good to me. Reviewed-by: Liming Gao 
> 
>
> Thanks
> Liming
>> -邮件原件-
>> 发件人: devel@edk2.groups.io  代表 Kun Qin
>> 发送时间: 2022年3月2日 3:33
>> 收件人: devel@edk2.groups.io; michael.d.kin...@intel.com
>> 抄送: af...@apple.com; l...@nuviainc.com; gaolim...@byosoft.com.cn; 
>> zhiguang@intel.com
>> 主题: [edk2-devel] Request for PI spec change
>>
>> Hi edk2 maintainers,
>>
>> I have been trying to propose a PI spec change to extend status code 
>> definitions.
>>
>> The proposed PI spec change along with the code change around this 
>> proposal are all pushed to edk2-staging repo:
>> https://github.com/tianocore/edk2-staging/tree/BZ3794-expand_status_c
>> od
>> es
>>
>> Could you please help reviewing the change and provide feedback? If 
>> there is anything I missed in the code-process, please let me know as well.
>>
>> Thanks,
>> Kun
>>
>>
>>
>>
>>
>
>
>
>
> 
>
>







-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#87606): https://edk2.groups.io/g/devel/message/87606
Mute This Topic: https://groups.io/mt/89492903/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 V1 1/1] WhitleyOpenBoardPkg/JunctionCity: Build ACPI content

2022-03-15 Thread manickavasakam karpagavinayagam via groups.io
Isaac/Nate :

Using the patch reference, we manually updated the source. Below are the 
commits used in our testing source.

- edk2 - b24306f15daa2ff8510b06702114724b33895d3c (edk2-stable202202)
- edk2-non-osi - 0320db977fb27e63424b0953a3020bb81c89e8f0
- edk2-platforms - 7cd51aa3c1ee601e0bf56d34dcf054c38997 + the PATCH
- FSP - 478a80a7e7b170873c9fa7f55fecfd0e0bdaf63e

We are able to boot to Windows 2019 and RHEL 7.3. Also, confirmed that only one 
instance of StaticSkuDataDxe (Outside FSP) is present in the source.

InstallProtocolInterface: 5B1B31A1-9562-11D2-8E3F-00A0C969723B 68F098C0 PDB = 
c:\XXX\XXX\XXX\icx\ocp_mar14\whitley\Build\WhitleyOpenBoardPkg\DEBUG_VS2015\X64\WhitleyOpenBoardPkg\Uba\UbaMain\StaticSkuDataDxe\StaticSkuDataDxe\DEBUG\StaticSkuDataDxeBaseline.pdb

Thank you

-Manic

From: Manickavasakam Karpagavinayagam
Sent: Monday, March 14, 2022 4:27 PM
To: Isaac Oram ; devel@edk2.groups.io; Sureshkumar 
Ponnusamy 
Cc: Nate DeSimone ; Chasel Chiu 
; Harikrishna Doppalapudi 
Subject: RE: [EXTERNAL] [edk2-devel][edk2-platforms][PATCH V1 1/1] 
WhitleyOpenBoardPkg/JunctionCity: Build ACPI content


Isaac/Nate :



Extracted the patch (refer the attached patch) from this email. When trying to 
apply the patch on latest edk2-platform 
(7cd51aa3c1ee601e0bf56d34dcf054c38997), we are seeing patch apply failure.

It says conflict at line number 39 or 26 based on the patch command used.





[cid:image001.png@01D8387E.BAB330D0]



Please let us know EDKII-Platform commit you used for creating the patch ? 
Also, let us know which EDKII tag used by you to build the source ?



Thank you



-Manic



-Original Message-
From: Isaac Oram mailto:isaac.w.o...@intel.com>>
Sent: Friday, March 11, 2022 6:31 PM
To: devel@edk2.groups.io
Cc: Nate DeSimone 
mailto:nathaniel.l.desim...@intel.com>>; Chasel 
Chiu mailto:chasel.c...@intel.com>>; Manickavasakam 
Karpagavinayagam mailto:manickavasak...@ami.com>>
Subject: [EXTERNAL] [edk2-devel][edk2-platforms][PATCH V1 1/1] 
WhitleyOpenBoardPkg/JunctionCity: Build ACPI content





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



Use source versions of AcpiTables, AcpiPlatform, and StaticSkuDataDxe.



Cc: Nate DeSimone 
mailto:nathaniel.l.desim...@intel.com>>

Cc: Chasel Chiu mailto:chasel.c...@intel.com>>

Cc: Manickavasakam Karpagavinayagam 
mailto:manickavasak...@ami.com>>

Signed-off-by: Isaac Oram 
mailto:isaac.w.o...@intel.com>>

---

Platform/Intel/WhitleyOpenBoardPkg/JunctionCity/PlatformPkg.fdf  |  3 +

Platform/Intel/WhitleyOpenBoardPkg/JunctionCity/build_board.py   | 63 


Platform/Intel/WhitleyOpenBoardPkg/JunctionCity/build_config.cfg | 15 +

3 files changed, 81 insertions(+)



diff --git a/Platform/Intel/WhitleyOpenBoardPkg/JunctionCity/PlatformPkg.fdf 
b/Platform/Intel/WhitleyOpenBoardPkg/JunctionCity/PlatformPkg.fdf

index 0b919b5ea9..b72aa2b688 100644

--- a/Platform/Intel/WhitleyOpenBoardPkg/JunctionCity/PlatformPkg.fdf

+++ b/Platform/Intel/WhitleyOpenBoardPkg/JunctionCity/PlatformPkg.fdf

@@ -601,6 +601,7 @@ SET gMinPlatformPkgTokenSpaceGuid.PcdFlashAreaSize 
= 0x0100

   # UBA DXE common and board specific components

   #

   !include WhitleyOpenBoardPkg/Uba/UbaDxeCommon.fdf

+  INF $(RP_PKG)/Uba/UbaMain/StaticSkuDataDxe/StaticSkuDataDxe.inf

   INF 
$(RP_PKG)/$(BOARD_NAME)/Uba/TypeJunctionCity/Dxe/UsbOcUpdateDxe/UsbOcUpdateDxe.inf

   INF 
$(RP_PKG)/$(BOARD_NAME)/Uba/TypeJunctionCity/Dxe/IioCfgUpdateDxe/IioCfgUpdateDxe.inf

   INF 
$(RP_PKG)/$(BOARD_NAME)/Uba/TypeJunctionCity/Dxe/SlotDataUpdateDxe/SlotDataUpdateDxe.inf

@@ -682,6 +683,8 @@ SET gMinPlatformPkgTokenSpaceGuid.PcdFlashAreaSize 
= 0x0100

   INF  BoardModulePkg/LegacySioDxe/LegacySioDxe.inf

   INF  MdeModulePkg/Universal/Console/TerminalDxe/TerminalDxe.inf



+  INF  RuleOverride = ACPITABLE

+ WhitleyOpenBoardPkg/Features/Acpi/AcpiTables/AcpiTables10nm.inf

+  INF  WhitleyOpenBoardPkg/Features/Acpi/AcpiPlatform/AcpiPlatform.inf

   INF  WhitleyOpenBoardPkg/Features/AcpiVtd/AcpiVtd.inf

   INF  MinPlatformPkg/Acpi/AcpiSmm/AcpiSmm.inf



diff --git a/Platform/Intel/WhitleyOpenBoardPkg/JunctionCity/build_board.py 
b/Platform/Intel/WhitleyOpenBoardPkg/JunctionCity/build_board.py

index 33698f9809..72d0c5089a 100644

--- a/Platform/Intel/WhitleyOpenBoardPkg/JunctionCity/build_board.py

+++ b/Platform/Intel/WhitleyOpenBoardPkg/JunctionCity/build_board.py

@@ -25,6 +25,7 @@ def pre_build_ex(config, functions):

 :returns: nothing

 """

 print("pre_build_ex")

+

 config["BUILD_DIR_PATH"] = os.path.join(config["WORKSPACE"],

 'Build',

 config["PLATFORM_BOARD_PACKAGE"], 
@@ -55,6 +56,68 @@ def pre_build_ex(config, functions):



 if config.get("API_MODE_FSP_WRAPPER_BUILD", "FALSE") == "TRUE":

 

Re: 回复: [edk2-devel] Request for PI spec change

2022-03-15 Thread Kun Qin

Thanks for the review, Liming.

Could you please also shed some light on what the next steps are?

Thanks,
Kun

On 3/1/2022 5:52 PM, gaoliming wrote:

Kun:
   The change looks good to me. Reviewed-by: Liming Gao 


Thanks
Liming

-邮件原件-
发件人: devel@edk2.groups.io  代表 Kun Qin
发送时间: 2022年3月2日 3:33
收件人: devel@edk2.groups.io; michael.d.kin...@intel.com
抄送: af...@apple.com; l...@nuviainc.com; gaolim...@byosoft.com.cn;
zhiguang@intel.com
主题: [edk2-devel] Request for PI spec change

Hi edk2 maintainers,

I have been trying to propose a PI spec change to extend status code
definitions.

The proposed PI spec change along with the code change around this proposal
are all pushed to edk2-staging repo:
https://github.com/tianocore/edk2-staging/tree/BZ3794-expand_status_cod
es

Could you please help reviewing the change and provide feedback? If there is
anything I missed in the code-process, please let me know as well.

Thanks,
Kun
















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




Re: [edk2-devel] [PATCH 0/3] [RFC] consolidate compiler intrinsics

2022-03-15 Thread Pedro Falcato
Gerd,

Have you considered just pulling in LLVM's compiler-rt builtins? It
implements essentially everything we'll ever need for a GNU-like toolchain,
for all the architectures we support, and also has unit tests (
https://github.com/llvm/llvm-project/tree/main/compiler-rt/test/builtins/Unit
).

I think it would be a good idea considering it's guaranteed to be correct
and always implements whatever clang requires (and AFAIK clang always
requires what gcc requires).

Best regards,
Pedro

On Tue, Mar 15, 2022 at 12:23 PM Gerd Hoffmann  wrote:

> On Tue, Mar 01, 2022 at 08:18:17AM +0100, Gerd Hoffmann wrote:
> > This is an attept to start cleaning up the messy compiler intrinsics
> > situation.  Today we don't have a core intrinsics library, resulting
> > in everybody creating their own.  ArmPkg has one, CryptoPkg has one.
> > I'm sure there are many more.
> >
> > This doesn't make sense.  Given we can't avoid compiler intrinsics (as
> > proven by the existence of those libraries) we should better have them
> > as core library so we have to maintain a single version only.
> >
> > Given we already have BaseIoLibIntrinsic in MdePkg we can place the
> > compiler intrinsics there too.  This little patch series does just that:
> > It moves over the existing ArmPkg intrinsics, fixes them to build on
> > non-arm too, and adds additional bits from the CryptoPkg intrinsics.
>
> Ping.  How go forward with this?  I've posted it as RFC because
> I expected a more controversial discussion.  But seems everybody
> agrees this is a step into the right direction.
>
> So just merge this as-is?
>
> Yes, it passed CI (https://github.com/tianocore/edk2/pull/2542).
>
> take care,
>   Gerd
>
>
>
> 
>
>
>

-- 
Pedro Falcato


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




Re: [edk2-devel] [PATCH 0/3] [RFC] consolidate compiler intrinsics

2022-03-15 Thread Michael D Kinney
Hi Gerd,

Thanks for working on this.  I raised this topic in the new TianoCore build and 
CI 
meeting yesterday because the intrinsic libs are closely tied to the toolchains
supported by TianoCore.

I agree with the concept of moving the compiler intrinsics to a library in the 
MdePkg.

+ Sean Brogan

Sean mentioned that he has some addition work on intrinsic libs for Visual 
Studio
toolchains.  It would be good to see if this set of changes is aligned with 
those
efforts.

I see a few items that might be good to clean up at some point
* fltused should go into its own file.  Not related to the strcmp() API
* I see size_t defined in multiple places using different mappings.  Would be 
good to 
  define that in a single location.

Best regards,

Mike


> -Original Message-
> From: Gerd Hoffmann 
> Sent: Tuesday, March 15, 2022 5:23 AM
> To: devel@edk2.groups.io
> Cc: Lu, Xiaoyu1 ; Feng, Bob C ; 
> Rebecca Cran ; James
> Bottomley ; Sami Mujawar ; Justen, 
> Jordan L ; Aktas,
> Erdem ; Yao, Jiewen ; Supreeth 
> Venkatesh ; Boeuf,
> Sebastien ; Gao, Zhichao ; 
> Liu, Zhiguang ; Maciej
> Rabeda ; Ma, Maurice ; 
> Andrew Fish ; Ard Biesheuvel
> ; Tom Lendacky ; Peter 
> Grehan ; Sean Brogan
> ; Jiang, Guomin ; Bret 
> Barkelew ; Chen,
> Christine ; You, Benjamin ; 
> Schaefer, Daniel ; Gao,
> Liming ; Kinney, Michael D 
> ; Xu, Wei6 ; Wang, Jian
> J ; Wu, Jiaxin ; Fu, Siyuan 
> ; Dong, Guo
> ; kilian_ke...@hotmail.com; Chang, Abner 
> ; Oliver Steffen ;
> Leif Lindholm ; Brijesh Singh 
> ; Xu, Min M ; Ni, Ray
> ; Alexei Fedorov ; Julien Grall 
> ; Wang, Nickle
> ; Pawel Polawski ; Anthony Perard 
> 
> Subject: Re: [PATCH 0/3] [RFC] consolidate compiler intrinsics
> 
> On Tue, Mar 01, 2022 at 08:18:17AM +0100, Gerd Hoffmann wrote:
> > This is an attept to start cleaning up the messy compiler intrinsics
> > situation.  Today we don't have a core intrinsics library, resulting
> > in everybody creating their own.  ArmPkg has one, CryptoPkg has one.
> > I'm sure there are many more.
> >
> > This doesn't make sense.  Given we can't avoid compiler intrinsics (as
> > proven by the existence of those libraries) we should better have them
> > as core library so we have to maintain a single version only.
> >
> > Given we already have BaseIoLibIntrinsic in MdePkg we can place the
> > compiler intrinsics there too.  This little patch series does just that:
> > It moves over the existing ArmPkg intrinsics, fixes them to build on
> > non-arm too, and adds additional bits from the CryptoPkg intrinsics.
> 
> Ping.  How go forward with this?  I've posted it as RFC because
> I expected a more controversial discussion.  But seems everybody
> agrees this is a step into the right direction.
> 
> So just merge this as-is?
> 
> Yes, it passed CI (https://github.com/tianocore/edk2/pull/2542).
> 
> take care,
>   Gerd



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




Re: [edk2-devel] [PATCH v1 1/1] DynamicTablesPkg: Fix serial port namespace path in DBG2

2022-03-15 Thread Sami Mujawar
Hi All,

The GCC download link is now restored and the EDK2 CI is functional again.
This patch has been merged as a13dfc769bd7..c8ea48bdf955

Regards,

Sami Mujawar

On 14/03/2022, 15:00, "Sami Mujawar"  wrote:

Hi All,

Azure pipeline jobs are failing due to broken download link for the GCC Arm 
10.3-2021.07 compiler, see 
https://dev.azure.com/tianocore/edk2-ci/_build/results?buildId=44398=logs=9b8d87a5-bd93-5358-8ffa-588e312c4376=aacec3cc-93ca-52e0-9354-41df8e192656

I am working to get the download links fixed. In the meantime, some patches 
may not get merged in edk2. 
Apologies for the inconvenience.  

Regards,

Sami Mujawar


On 14/03/2022, 11:49, "Sunny Wang"  wrote:

I tested this patch as well and confirmed this patch fixed the FWTS 
failure below. Thanks, Sami.
- dbg2: DBG2 Device 'COM0' not found in ACPI object name space.

Tested-by: Sunny Wang 

-Original Message-
From: devel@edk2.groups.io  On Behalf Of 
Jagadeesh Ujja via groups.io
Sent: 14 March 2022 05:01
To: devel@edk2.groups.io; Sami Mujawar 
Cc: Alexei Fedorov ; Matteo Carlini 
; Akanksha Jain ; Ben Adderson 
; Pierre Gondois 
Subject: Re: [edk2-devel] [PATCH v1 1/1] DynamicTablesPkg: Fix serial 
port namespace path in DBG2

Hi Sami,
The patch is tested and looks good to me:

Tested-by: Jagadeesh Ujja 

On Fri, Mar 11, 2022 at 6:38 PM PierreGondois  
wrote:
>
> Hi Sami,
> The patch looks good to me:
>
> Reviewed-by: Pierre Gondois 
>
> On 3/10/22 18:39, Sami Mujawar wrote:
> > According to the Debug Port Table 2 (DBG2) specification,
> > February 17, 2021, the NamespaceString is a NULL terminated
> > ASCII string that consists of a fully qualified reference
> > to the object that represents the serial port device in the
> > ACPI namespace.
> >
> > The DBG2 table generator did not populate the full device
> > path for the serial port device, and this results in a FWTS
> > test failure.
> >
> > Therefore, populate the full namespace device path for the
> > serial port in DBG2 table.
> >
> > Signed-off-by: Sami Mujawar 
> > ---
> > The changes can be seen at:
> > 
https://github.com/samimujawar/edk2/tree/2105_dbg2_generator_namestring_issue_v1
> >
> >   DynamicTablesPkg/Library/Acpi/Arm/AcpiDbg2LibArm/Dbg2Generator.c 
| 10 +++---
> >   1 file changed, 7 insertions(+), 3 deletions(-)
> >
> > diff --git 
a/DynamicTablesPkg/Library/Acpi/Arm/AcpiDbg2LibArm/Dbg2Generator.c 
b/DynamicTablesPkg/Library/Acpi/Arm/AcpiDbg2LibArm/Dbg2Generator.c
> > index 
3d513dbd1fbe8c47d270a9e639b2797098201d91..f6dfb3d94c10980a0e7712ce9427648b69974061
 100644
> > --- 
a/DynamicTablesPkg/Library/Acpi/Arm/AcpiDbg2LibArm/Dbg2Generator.c
> > +++ 
b/DynamicTablesPkg/Library/Acpi/Arm/AcpiDbg2LibArm/Dbg2Generator.c
> > @@ -1,7 +1,7 @@
> >   /** @file
> > DBG2 Table Generator
> >
> > -  Copyright (c) 2017 - 2021, Arm Limited. All rights reserved.
> > +  Copyright (c) 2017 - 2022, Arm Limited. All rights reserved.
> >
> > SPDX-License-Identifier: BSD-2-Clause-Patent
> >
> > @@ -55,13 +55,17 @@ Requirements:
> >   */
> >   #define NAME_STR_DBG_PORT0  "COM0"
> >
> > +/** A string representing the full path name of the debug port 0.
> > +*/
> > +#define NAMESPACE_STR_DBG_PORT0  "\\_SB_.COM0"
> > +
> >   /** An UID representing the debug port 0.
> >   */
> >   #define UID_DBG_PORT0  0
> >
> >   /** The length of the namespace string.
> >   */
> > -#define DBG2_NAMESPACESTRING_FIELD_SIZE  sizeof 
(NAME_STR_DBG_PORT0)
> > +#define DBG2_NAMESPACESTRING_FIELD_SIZE  sizeof 
(NAMESPACE_STR_DBG_PORT0)
> >
> >   /** The PL011 UART address range length.
> >   */
> > @@ -166,7 +170,7 @@ DBG2_TABLE  AcpiDbg2 = {
> > 0,// {Template}: Serial Port Subtype
> > 0,// {Template}: Serial Port Base 
Address
> > PL011_UART_LENGTH,
> > -  NAME_STR_DBG_PORT0
> > +  NAMESPACE_STR_DBG_PORT0
> > )
> > }
> >   };
>
>
>
>
>









-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#87601): https://edk2.groups.io/g/devel/message/87601
Mute This Topic: https://groups.io/mt/89691998/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 09/10] MdeModulePkg: Update PciEnumeratorSupport to ignore OptionRom if needed

2022-03-15 Thread Gerd Hoffmann
On Sun, Mar 13, 2022 at 08:41:10AM +0800, Min Xu wrote:
> RFC: https://bugzilla.tianocore.org/show_bug.cgi?id=3429
> 
> Function of UpdatePciInfo() in PciEnumeratorSupport.c is used to update
> the bar information for those incompatible PCI device. It is the right
> place to check if the OptionRom need to be ignored.
> 
> According to "Table 20. ACPI 2.0 & 3.0 QWORD Address Space Descriptor
> Usage" in PI Spec 1.7, Type-specific flags can be set to 0 when Address
> Translation Offset == 6 to skip device option ROM (do not probe option
> rom BAR).
> 
> Cc: Jian J Wang 
> Cc: Liming Gao 
> Cc: Hao A Wu 
> Cc: Ray Ni 
> Cc: Brijesh Singh 
> Cc: Erdem Aktas 
> Cc: James Bottomley 
> Cc: Jiewen Yao 
> Cc: Tom Lendacky 
> Cc: Gerd Hoffmann 
> Signed-off-by: Min Xu 

Acked-by: Gerd Hoffmann 



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#87600): https://edk2.groups.io/g/devel/message/87600
Mute This Topic: https://groups.io/mt/89743616/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 08/10] OvmfPkg/IncompatiblePciDeviceSupportDxe: Ignore OptionRom in Td guest

2022-03-15 Thread Gerd Hoffmann
On Sun, Mar 13, 2022 at 08:41:09AM +0800, Min Xu wrote:
> RFC: https://bugzilla.tianocore.org/show_bug.cgi?id=3429
> 
> Host VMM may inject OptionRom which is untrusted in Td guest. So PCI
> OptionRom needs to be ignored if it is Td guest. According to
> "Table 20. ACPI 2.0 & 3.0 QWORD Address Space Descriptor Usage"
> PI spec 1.7, type-specific flags can be set to 0 when Address
> Translation Offset == 6 to skip device option ROM.
> 
> Cc: Michael D Kinney 
> Cc: Brijesh Singh 
> Cc: Erdem Aktas 
> Cc: James Bottomley 
> Cc: Jiewen Yao 
> Cc: Tom Lendacky 
> Cc: Gerd Hoffmann 
> Signed-off-by: Min Xu 

Acked-by: Gerd Hoffmann 



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#87599): https://edk2.groups.io/g/devel/message/87599
Mute This Topic: https://groups.io/mt/89743610/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 07/10] OvmfPkg/IncompatiblePciDeviceSupportDxe: Refine the configuration

2022-03-15 Thread Gerd Hoffmann
On Sun, Mar 13, 2022 at 08:41:08AM +0800, Min Xu wrote:
> RFC: https://bugzilla.tianocore.org/show_bug.cgi?id=3429
> 
> MMIO64_PREFERENCE is a fixed length data structure which contains one
> AddressSpaceDesc and one EndDesc. This patch removes MMIO64_PREFERENCE
> and create AddressSpaceDesc and EndDesc respectively. This change
> gives the chance to add more AddressSpaceDesc when CheckDevice is
> called.
> 
> Cc: Michael D Kinney 
> Cc: Brijesh Singh 
> Cc: Erdem Aktas 
> Cc: James Bottomley 
> Cc: Jiewen Yao 
> Cc: Tom Lendacky 
> Cc: Gerd Hoffmann 
> Signed-off-by: Min Xu 

Acked-by: Gerd Hoffmann 



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#87598): https://edk2.groups.io/g/devel/message/87598
Mute This Topic: https://groups.io/mt/89743609/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 06/10] OvmfPkg: Update DxeAcpiTimerLib to read HostBridgeDevId in PlatformInfoHob

2022-03-15 Thread Gerd Hoffmann
On Sun, Mar 13, 2022 at 08:41:07AM +0800, Min Xu wrote:
> RFC: https://bugzilla.tianocore.org/show_bug.cgi?id=3429
> 
> The entrypoint of DxeAcpiTimerLib checks HostBridgeDevId by reading
> PcdOvmfHostBridgePciDevId. If the DevId is not set, ASSERT is
> triggered. Normally this DevId is set in PlatformPei which is executed
> in PEI phase.
> 
> This patch-set is introducing PEI-less boot which means PEI phase is
> skipped. So there is no chance to set this DevId. Instead HostBridgeDevId
> is set in PlatformInfoHob. So we can check if PlatformInfoHob exists and
> if HostBridgeDevId is set in this Hob.

Acked-by: Gerd Hoffmann 

take care,
  Gerd



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




[edk2-devel] [PATCH v3 5/5] NetworkPkg/HttpDxe: Detect HTTP/1.0 servers

2022-03-15 Thread Oliver Steffen
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2720

Force connection close before the next request if
the server identifies as version 1.0.

Signed-off-by: Oliver Steffen 
---
 NetworkPkg/HttpDxe/HttpImpl.c | 8 
 1 file changed, 8 insertions(+)

diff --git a/NetworkPkg/HttpDxe/HttpImpl.c b/NetworkPkg/HttpDxe/HttpImpl.c
index d40d55ac92ad..623e029c606e 100644
--- a/NetworkPkg/HttpDxe/HttpImpl.c
+++ b/NetworkPkg/HttpDxe/HttpImpl.c
@@ -1105,6 +1105,14 @@ HttpResponseWorker (
   HttpInstance->CacheLen = BodyLen;
 }
 
+//
+// Check server's HTTP version.
+//
+if (AsciiStrnCmp (HttpHeaders, "HTTP/1.0", AsciiStrLen ("HTTP/1.0")) == 0) 
{
+  DEBUG ((DEBUG_VERBOSE, "HTTP: Server version is 1.0. Setting Connection 
close.\n"));
+  HttpInstance->ConnectionClose = TRUE;
+}
+
 //
 // Search for Status Code.
 //
-- 
2.35.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#87596): https://edk2.groups.io/g/devel/message/87596
Mute This Topic: https://groups.io/mt/89797773/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/5] NetworkPkg/HttpDxe: Decofigure Tcp4 before reconfiguring

2022-03-15 Thread Oliver Steffen
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2720

Check if the state of the HTTP instance is HTTP_STATE_TCP_CONNECTED, or
HTTP_STATE_TCP_CLOSED and de-configure the Tcp4 instance before
configuring it again.

Signed-off-by: Oliver Steffen 
---
 NetworkPkg/HttpDxe/HttpProto.c | 12 
 1 file changed, 12 insertions(+)

diff --git a/NetworkPkg/HttpDxe/HttpProto.c b/NetworkPkg/HttpDxe/HttpProto.c
index 9457dd2623d3..cd54c574044b 100644
--- a/NetworkPkg/HttpDxe/HttpProto.c
+++ b/NetworkPkg/HttpDxe/HttpProto.c
@@ -1086,6 +1086,18 @@ HttpConfigureTcp4 (
   Tcp4Option->EnableNagle   = TRUE;
   Tcp4CfgData->ControlOption= Tcp4Option;
 
+  if ((HttpInstance->State == HTTP_STATE_TCP_CONNECTED) ||
+  (HttpInstance->State == HTTP_STATE_TCP_CLOSED))
+  {
+Status = HttpInstance->Tcp4->Configure (HttpInstance->Tcp4, NULL);
+if (EFI_ERROR (Status)) {
+  DEBUG ((DEBUG_ERROR, "HttpConfigureTcp4(NULL) - %r\n", Status));
+  return Status;
+}
+
+HttpInstance->State = HTTP_STATE_TCP_UNCONFIGED;
+  }
+
   Status = HttpInstance->Tcp4->Configure (HttpInstance->Tcp4, Tcp4CfgData);
   if (EFI_ERROR (Status)) {
 DEBUG ((DEBUG_ERROR, "HttpConfigureTcp4 - %r\n", Status));
-- 
2.35.1



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




[edk2-devel] [PATCH v3 3/5] NetworkPkg/HttpDxe: Add ConnectionClose flag fo HTTP_PROTOCOL

2022-03-15 Thread Oliver Steffen
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2720

Add ConnectionClose flag to HTTP_PROTOCOL.
This boolean is FALSE by default. If set to TRUE, a reconfigure
of the Http instance is forced on the next request. The flag
is then reset.

Signed-off-by: Oliver Steffen 
---
 NetworkPkg/HttpDxe/HttpProto.h | 2 ++
 NetworkPkg/HttpDxe/HttpImpl.c  | 6 +-
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/NetworkPkg/HttpDxe/HttpProto.h b/NetworkPkg/HttpDxe/HttpProto.h
index 8ed99c7a02d3..620eb3915843 100644
--- a/NetworkPkg/HttpDxe/HttpProto.h
+++ b/NetworkPkg/HttpDxe/HttpProto.h
@@ -194,6 +194,8 @@ typedef struct _HTTP_PROTOCOL {
   EFI_TCP6_IO_TOKEN Tcp6TlsRxToken;
   EFI_TCP6_RECEIVE_DATA Tcp6TlsRxData;
   BOOLEAN   TlsIsRxDone;
+
+  BOOLEAN   ConnectionClose;
 } HTTP_PROTOCOL;
 
 typedef struct {
diff --git a/NetworkPkg/HttpDxe/HttpImpl.c b/NetworkPkg/HttpDxe/HttpImpl.c
index d64cd9e965c0..d8b014c94f3a 100644
--- a/NetworkPkg/HttpDxe/HttpImpl.c
+++ b/NetworkPkg/HttpDxe/HttpImpl.c
@@ -161,6 +161,7 @@ EfiHttpConfigure (
 HttpInstance->HttpVersion= HttpConfigData->HttpVersion;
 HttpInstance->TimeOutMillisec= HttpConfigData->TimeOutMillisec;
 HttpInstance->LocalAddressIsIPv6 = HttpConfigData->LocalAddressIsIPv6;
+HttpInstance->ConnectionClose= FALSE;
 
 if (HttpConfigData->LocalAddressIsIPv6) {
   CopyMem (
@@ -440,7 +441,8 @@ EfiHttpRequest (
   //
   ReConfigure = FALSE;
 } else {
-  if ((HttpInstance->RemotePort == RemotePort) &&
+  if ((HttpInstance->ConnectionClose == FALSE) &&
+  (HttpInstance->RemotePort == RemotePort) &&
   (AsciiStrCmp (HttpInstance->RemoteHost, HostName) == 0) &&
   (!HttpInstance->UseHttps || (HttpInstance->UseHttps &&
!TlsConfigure &&
@@ -649,6 +651,8 @@ EfiHttpRequest (
 }
   }
 
+  HttpInstance->ConnectionClose = FALSE;
+
   //
   // Transmit the request message.
   //
-- 
2.35.1



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




[edk2-devel] [PATCH v3 2/5] NetworkPkg/HttpDxe: Decofigure Tcp6 before reconfiguring

2022-03-15 Thread Oliver Steffen
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2720

Check if the state of the HTTP instance is HTTP_STATE_TCP_CONNECTED, or
HTTP_STATE_TCP_CLOSED and de-configure the Tcp6 instance before
configuring it again.

Signed-off-by: Oliver Steffen 
---
 NetworkPkg/HttpDxe/HttpProto.c | 12 
 1 file changed, 12 insertions(+)

diff --git a/NetworkPkg/HttpDxe/HttpProto.c b/NetworkPkg/HttpDxe/HttpProto.c
index cd54c574044b..33ae622c3f0b 100644
--- a/NetworkPkg/HttpDxe/HttpProto.c
+++ b/NetworkPkg/HttpDxe/HttpProto.c
@@ -1168,6 +1168,18 @@ HttpConfigureTcp6 (
   Tcp6Option->KeepAliveInterval = HTTP_KEEP_ALIVE_INTERVAL;
   Tcp6Option->EnableNagle   = TRUE;
 
+  if ((HttpInstance->State == HTTP_STATE_TCP_CONNECTED) ||
+  (HttpInstance->State == HTTP_STATE_TCP_CLOSED))
+  {
+Status = HttpInstance->Tcp6->Configure (HttpInstance->Tcp6, NULL);
+if (EFI_ERROR (Status)) {
+  DEBUG ((DEBUG_ERROR, "HttpConfigureTcp6(NULL) - %r\n", Status));
+  return Status;
+}
+
+HttpInstance->State = HTTP_STATE_TCP_UNCONFIGED;
+  }
+
   Status = HttpInstance->Tcp6->Configure (HttpInstance->Tcp6, Tcp6CfgData);
   if (EFI_ERROR (Status)) {
 DEBUG ((DEBUG_ERROR, "HttpConfigureTcp6 - %r\n", Status));
-- 
2.35.1



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




[edk2-devel] [PATCH v3 4/5] NetworkPkg/HttpDxe: Detect 'Connection: close' header

2022-03-15 Thread Oliver Steffen
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2720

Force connection close before the next request if
the server sends the 'Connection: close' header.

Signed-off-by: Oliver Steffen 
---
 NetworkPkg/HttpDxe/HttpImpl.c | 11 +++
 1 file changed, 11 insertions(+)

diff --git a/NetworkPkg/HttpDxe/HttpImpl.c b/NetworkPkg/HttpDxe/HttpImpl.c
index d8b014c94f3a..d40d55ac92ad 100644
--- a/NetworkPkg/HttpDxe/HttpImpl.c
+++ b/NetworkPkg/HttpDxe/HttpImpl.c
@@ -994,6 +994,7 @@ HttpResponseWorker (
   UINTN HdrLen;
   NET_FRAGMENT  Fragment;
   UINT32TimeoutValue;
+  UINTN index;
 
   if ((Wrap == NULL) || (Wrap->HttpInstance == NULL)) {
 return EFI_INVALID_PARAMETER;
@@ -1200,6 +1201,16 @@ HttpResponseWorker (
   FreePool (HttpHeaders);
   HttpHeaders = NULL;
 
+  for (index = 0; index < HttpMsg->HeaderCount; ++index) {
+if ((AsciiStriCmp ("Connection", HttpMsg->Headers[index].FieldName) == 
0) &&
+(AsciiStriCmp ("close", HttpMsg->Headers[index].FieldValue) == 0))
+{
+  DEBUG ((DEBUG_VERBOSE, "Http: 'Connection: close' header 
received.\n"));
+  HttpInstance->ConnectionClose = TRUE;
+  break;
+}
+  }
+
   //
   // Init message-body parser by header information.
   //
-- 
2.35.1



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




[edk2-devel] [PATCH v3 0/5] Http Fixes

2022-03-15 Thread Oliver Steffen
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2720

This set of patches fixes booting from HTTP/1.0 servers.
It also improves the interaction with HTTP/1.1 servers by recognizing
the 'Connection: close' header field, which fixes a problem with
servers that close the connection after a 404-error is encountered.

It also prevents triggering the TCP issue described in
https://bugzilla.tianocore.org/show_bug.cgi?id=3735
when booting from HTTP/1.0 servers.

PR: https://github.com/tianocore/edk2/pull/2564

Oliver Steffen (5):
  NetworkPkg/HttpDxe: Decofigure Tcp4 before reconfiguring
  NetworkPkg/HttpDxe: Decofigure Tcp6 before reconfiguring
  NetworkPkg/HttpDxe: Add ConnectionClose flag fo HTTP_PROTOCOL
  NetworkPkg/HttpDxe: Detect 'Connection: close' header
  NetworkPkg/HttpDxe: Detect HTTP/1.0 servers

 NetworkPkg/HttpDxe/HttpProto.h |  2 ++
 NetworkPkg/HttpDxe/HttpImpl.c  | 25 -
 NetworkPkg/HttpDxe/HttpProto.c | 24 
 3 files changed, 50 insertions(+), 1 deletion(-)

-- 
2.35.1



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




Re: [edk2-devel] [PATCH 0/3] [RFC] consolidate compiler intrinsics

2022-03-15 Thread Gerd Hoffmann
On Tue, Mar 01, 2022 at 08:18:17AM +0100, Gerd Hoffmann wrote:
> This is an attept to start cleaning up the messy compiler intrinsics
> situation.  Today we don't have a core intrinsics library, resulting
> in everybody creating their own.  ArmPkg has one, CryptoPkg has one.
> I'm sure there are many more.
> 
> This doesn't make sense.  Given we can't avoid compiler intrinsics (as
> proven by the existence of those libraries) we should better have them
> as core library so we have to maintain a single version only.
> 
> Given we already have BaseIoLibIntrinsic in MdePkg we can place the
> compiler intrinsics there too.  This little patch series does just that:
> It moves over the existing ArmPkg intrinsics, fixes them to build on
> non-arm too, and adds additional bits from the CryptoPkg intrinsics.

Ping.  How go forward with this?  I've posted it as RFC because
I expected a more controversial discussion.  But seems everybody
agrees this is a step into the right direction.

So just merge this as-is?

Yes, it passed CI (https://github.com/tianocore/edk2/pull/2542).

take care,
  Gerd



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




[edk2-devel] [Patch] BaseTools: Remove the redundant __FLEXIBLE_SIZE from PcdValueInit.c

2022-03-15 Thread Bob Feng
For the multiple SKU cases, basetools generates multiple redundant
__FLEXIBLE_SIZE statement that is from the same line in dsc file.

This behavior causes the generated PcdValueInit.c file to have huge size,
and the compilation time is very long.

This patch is going to fix this issue.

Signed-off-by: Bob Feng 
Cc: Liming Gao 
Cc: Yuwei Chen 
---
 BaseTools/Source/Python/Workspace/DscBuildData.py | 5 +
 1 file changed, 5 insertions(+)

diff --git a/BaseTools/Source/Python/Workspace/DscBuildData.py 
b/BaseTools/Source/Python/Workspace/DscBuildData.py
index d29b9bf13d..fc1e773417 100644
--- a/BaseTools/Source/Python/Workspace/DscBuildData.py
+++ b/BaseTools/Source/Python/Workspace/DscBuildData.py
@@ -1874,10 +1874,11 @@ class DscBuildData(PlatformBuildClassObject):
 FieldName = FieldName.split(']', 1)[1]
 FieldName = NewFieldName + FieldName
 while '[' in FieldName and not Pcd.IsArray():
 FieldName = FieldName.rsplit('[', 1)[0]
 CApp = CApp + '  __FLEXIBLE_SIZE(*Size, %s, %s, %d); 
// From %s Line %d Value %s\n' % (Pcd.DatumType, FieldName.strip("."), 
Array_Index + 1, FieldList[FieldName_ori][1], FieldList[FieldName_ori][2], 
FieldList[FieldName_ori][0])
+flexisbale_size_statement_cache = set()
 for skuname in Pcd.SkuOverrideValues:
 if skuname == TAB_COMMON:
 continue
 for defaultstorenameitem in Pcd.SkuOverrideValues[skuname]:
 CApp = CApp + "// SkuName: %s,  DefaultStoreName: %s \n" % 
(skuname, defaultstorenameitem)
@@ -1886,10 +1887,14 @@ class DscBuildData(PlatformBuildClassObject):
 ActualCap.append(index)
 for FieldList in 
[Pcd.SkuOverrideValues[skuname][defaultstorenameitem][index]]:
 if not FieldList:
 continue
 for FieldName in FieldList:
+fieldinfo = tuple(FieldList[FieldName])
+if fieldinfo in flexisbale_size_statement_cache:
+continue
+flexisbale_size_statement_cache.add(fieldinfo)
 FieldName = "." + FieldName
 IsArray = 
_IsFieldValueAnArray(FieldList[FieldName.strip(".")][0])
 if IsArray and not 
(FieldList[FieldName.strip(".")][0].startswith('{GUID') and 
FieldList[FieldName.strip(".")][0].endswith('}')):
 try:
 Value = 
ValueExpressionEx(FieldList[FieldName.strip(".")][0], TAB_VOID, 
self._GuidDict)(True)
-- 
2.29.1.windows.1



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




Re: [edk2-devel] [PATCH V8 30/47] MdePkg: Add EFI_RESOURCE_MEMORY_UNACCEPTED defition

2022-03-15 Thread Gerd Hoffmann
On Sat, Mar 12, 2022 at 09:53:55AM +0800, Min Xu wrote:
> RFC: https://bugzilla.tianocore.org/show_bug.cgi?id=3429
> 
> Add EFI_RESOURCE_MEMORY_UNACCEPTED definition in PiHob.h. This definition
> is for the unaccepted memory passed from Host VMM.
> 
> This is proposed in https://github.com/microsoft/mu_basecore/pull/66/
> files#diff-b20a11152d1ce9249c691be5690b4baf52069efadf2e2546cdd2eb663d80c9e4R237
> according to UEFI-Code-First.
> 
> The proposal was approved in 2021 in UEFI Mantis, and will be added to the
> new PI.next specification.

Acked-by: Gerd Hoffmann 



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




Re: [edk2-devel] [PATCH V8 29/47] OvmfPkg/PlatformInitLib: Move functions to Platform.c

2022-03-15 Thread Gerd Hoffmann
On Sat, Mar 12, 2022 at 09:53:54AM +0800, Min Xu wrote:
> BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=3863
> 
> Move functions in PlatformPei/Platform.c to PlatformInitLib/Platform.c.
> 
> Cc: Ard Biesheuvel 
> Cc: Jordan Justen 
> Cc: Brijesh Singh 
> Cc: Erdem Aktas 
> Cc: James Bottomley 
> Cc: Jiewen Yao 
> Cc: Tom Lendacky 
> Cc: Gerd Hoffmann 
> Cc: Sebastien Boeuf 
> Signed-off-by: Min Xu 

Acked-by: Gerd Hoffmann 



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




Re: [edk2-devel] [PATCH V8 28/47] OvmfPkg/PlatformInitLib: Create MemDetect.c

2022-03-15 Thread Gerd Hoffmann
On Sat, Mar 12, 2022 at 09:53:53AM +0800, Min Xu wrote:
> BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=3863
> 
> Move functions in PlatformPei\MemDetect.c to PlatformInitLib\MemDetect.c.
> 
> Cc: Ard Biesheuvel 
> Cc: Jordan Justen 
> Cc: Brijesh Singh 
> Cc: Erdem Aktas 
> Cc: James Bottomley 
> Cc: Jiewen Yao 
> Cc: Tom Lendacky 
> Cc: Gerd Hoffmann 
> Cc: Sebastien Boeuf 
> Signed-off-by: Min Xu 

Acked-by: Gerd Hoffmann 

> ---
>  OvmfPkg/Include/Library/PlatformInitLib.h |  37 +
>  OvmfPkg/Library/PlatformInitLib/MemDetect.c   | 842 ++
>  .../PlatformInitLib/PlatformInitLib.inf   |  49 +
>  OvmfPkg/PlatformPei/MemDetect.c   | 804 +
>  OvmfPkg/PlatformPei/Platform.h|  12 -
>  5 files changed, 929 insertions(+), 815 deletions(-)
>  create mode 100644 OvmfPkg/Library/PlatformInitLib/MemDetect.c
> 
> diff --git a/OvmfPkg/Include/Library/PlatformInitLib.h 
> b/OvmfPkg/Include/Library/PlatformInitLib.h
> index 9b99d4c1f514..2e4bb8140368 100644
> --- a/OvmfPkg/Include/Library/PlatformInitLib.h
> +++ b/OvmfPkg/Include/Library/PlatformInitLib.h
> @@ -132,4 +132,41 @@ PlatformAddReservedMemoryBaseSizeHob (
>IN BOOLEAN   Cacheable
>);
>  
> +VOID
> +EFIAPI
> +PlatformQemuUc32BaseInitialization (
> +  IN OUT EFI_HOB_PLATFORM_INFO  *PlatformInfoHob
> +  );
> +
> +UINT32
> +EFIAPI
> +PlatformGetSystemMemorySizeBelow4gb (
> +  IN EFI_HOB_PLATFORM_INFO  *PlatformInfoHob
> +  );
> +
> +/**
> +  Initialize the mPhysMemAddressWidth variable, based on guest RAM size.
> +**/
> +VOID
> +EFIAPI
> +PlatformAddressWidthInitialization (
> +  IN OUT EFI_HOB_PLATFORM_INFO  *PlatformInfoHob
> +  );
> +
> +/**
> +  Peform Memory Detection for QEMU / KVM
> +
> +**/
> +VOID
> +EFIAPI
> +PlatformQemuInitializeRam (
> +  IN EFI_HOB_PLATFORM_INFO  *PlatformInfoHob
> +  );
> +
> +VOID
> +EFIAPI
> +PlatformQemuInitializeRamForS3 (
> +  IN EFI_HOB_PLATFORM_INFO  *PlatformInfoHob
> +  );
> +
>  #endif // PLATFORM_INIT_LIB_H_
> diff --git a/OvmfPkg/Library/PlatformInitLib/MemDetect.c 
> b/OvmfPkg/Library/PlatformInitLib/MemDetect.c
> new file mode 100644
> index ..fbd3073bd3d1
> --- /dev/null
> +++ b/OvmfPkg/Library/PlatformInitLib/MemDetect.c
> @@ -0,0 +1,842 @@
> +/**@file
> +  Memory Detection for Virtual Machines.
> +
> +  Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.
> +  SPDX-License-Identifier: BSD-2-Clause-Patent
> +
> +Module Name:
> +
> +  MemDetect.c
> +
> +**/
> +
> +//
> +// The package level header files this module uses
> +//
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +
> +//
> +// The Library classes this module consumes
> +//
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +
> +VOID
> +EFIAPI
> +PlatformQemuUc32BaseInitialization (
> +  IN OUT EFI_HOB_PLATFORM_INFO  *PlatformInfoHob
> +  )
> +{
> +  UINT32  LowerMemorySize;
> +
> +  if (PlatformInfoHob->HostBridgeDevId == 0x /* microvm */) {
> +return;
> +  }
> +
> +  if (PlatformInfoHob->HostBridgeDevId == INTEL_Q35_MCH_DEVICE_ID) {
> +//
> +// On q35, the 32-bit area that we'll mark as UC, through variable MTRRs,
> +// starts at PcdPciExpressBaseAddress. The platform DSC is responsible 
> for
> +// setting PcdPciExpressBaseAddress such that describing the
> +// [PcdPciExpressBaseAddress, 4GB) range require a very small number of
> +// variable MTRRs (preferably 1 or 2).
> +//
> +ASSERT (FixedPcdGet64 (PcdPciExpressBaseAddress) <= MAX_UINT32);
> +PlatformInfoHob->Uc32Base = (UINT32)FixedPcdGet64 
> (PcdPciExpressBaseAddress);
> +return;
> +  }
> +
> +  if (PlatformInfoHob->HostBridgeDevId == CLOUDHV_DEVICE_ID) {
> +PlatformInfoHob->Uc32Size = CLOUDHV_MMIO_HOLE_SIZE;
> +PlatformInfoHob->Uc32Base = CLOUDHV_MMIO_HOLE_ADDRESS;
> +return;
> +  }
> +
> +  ASSERT (PlatformInfoHob->HostBridgeDevId == INTEL_82441_DEVICE_ID);
> +  //
> +  // On i440fx, start with the [LowerMemorySize, 4GB) range. Make sure one
> +  // variable MTRR suffices by truncating the size to a whole power of two,
> +  // while keeping the end affixed to 4GB. This will round the base up.
> +  //
> +  LowerMemorySize   = PlatformGetSystemMemorySizeBelow4gb 
> (PlatformInfoHob);
> +  PlatformInfoHob->Uc32Size = GetPowerOfTwo32 ((UINT32)(SIZE_4GB - 
> LowerMemorySize));
> +  PlatformInfoHob->Uc32Base = (UINT32)(SIZE_4GB - PlatformInfoHob->Uc32Size);
> +  //
> +  // Assuming that LowerMemorySize is at least 1 byte, Uc32Size is at most 
> 2GB.
> +  // Therefore mQemuUc32Base is at least 2GB.
> +  //
> +  ASSERT (PlatformInfoHob->Uc32Base >= BASE_2GB);
> +
> +  if (PlatformInfoHob->Uc32Base != LowerMemorySize) {
> +DEBUG ((
> +  DEBUG_VERBOSE,
> +  "%a: rounded UC32 base from 0x%x up to 0x%x, for "
> +  "an UC32 size of 

Re: [edk2-devel] [PATCH V8 27/47] OvmfPkg/PlatformPei: Refactor MiscInitialization

2022-03-15 Thread Gerd Hoffmann
On Sat, Mar 12, 2022 at 09:53:52AM +0800, Min Xu wrote:
> BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=3863
> 
> MiscInitialization is split into 2 functions:
>  - PlatformMiscInitialization is for PlatformInitLib.
>  - MiscInitialization calls PlatformMiscInitialization and then sets
>PCD. It is for PlatformPei.
> 
> Cc: Ard Biesheuvel 
> Cc: Jordan Justen 
> Cc: Brijesh Singh 
> Cc: Erdem Aktas 
> Cc: James Bottomley 
> Cc: Jiewen Yao 
> Cc: Tom Lendacky 
> Cc: Gerd Hoffmann 
> Cc: Sebastien Boeuf 
> Signed-off-by: Min Xu 

Acked-by: Gerd Hoffmann 



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




Re: [edk2-devel] [PATCH V8 26/47] OvmfPkg/PlatformPei: Refactor NoexecDxeInitialization

2022-03-15 Thread Gerd Hoffmann
On Sat, Mar 12, 2022 at 09:53:51AM +0800, Min Xu wrote:
> BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=3863
> 
> NoexecDxeInitialization is split into 2 functions:
>  - PlatformNoexecDxeInitialization is for PlatformInitLib
>  - NoexecDxeInitialization calls PlatformNoexecDxeInitialization and
>then sets PCD.

Acked-by: Gerd Hoffmann 



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#87584): https://edk2.groups.io/g/devel/message/87584
Mute This Topic: https://groups.io/mt/89725421/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 36/37] UefiCpuPkg: Setting initial-count register as the last step

2022-03-15 Thread Ni, Ray
Thanks for fixing this potential bug. Reviewed-by: Ray Ni 


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




Re: [edk2-devel] [PATCH V8 25/47] OvmfPkg/PlatformPei: Refactor MemMapInitialization

2022-03-15 Thread Gerd Hoffmann
On Sat, Mar 12, 2022 at 09:53:50AM +0800, Min Xu wrote:
> BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=3863
> 
> MemMapInitialization is split into 2 functions:
>  - PlatformMemMapInitialization is for PlatformInfoLib
>  - MemMapInitialization calls PlatformMemMapInitialization and then
>sets PCDs. It is for PlatformPei.
> 
> Cc: Ard Biesheuvel 
> Cc: Jordan Justen 
> Cc: Brijesh Singh 
> Cc: Erdem Aktas 
> Cc: James Bottomley 
> Cc: Jiewen Yao 
> Cc: Tom Lendacky 
> Cc: Gerd Hoffmann 
> Cc: Sebastien Boeuf 
> Signed-off-by: Min Xu 

Acked-by: Gerd Hoffmann 



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




Re: [edk2-devel] [PATCH V8 24/47] OvmfPkg/PlatformPei: Refactor InitializeRamRegions

2022-03-15 Thread Gerd Hoffmann
On Sat, Mar 12, 2022 at 09:53:49AM +0800, Min Xu wrote:
> BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=3863
> 
> InitializeRamRegions is refactored into 3 calls:
>  - PlatformQemuInitializeRam
>  - SevInitializeRam
>  - PlatformQemuInitializeRamForS3
> 
> SevInitializeRam is not in PlatformInitLib. Because in the first stage
> PlatformInitLib only support the basic platform featues.
> 
> PlatformQemuInitializeRamForS3 wraps the code which was previously in
> InitializeRamRegions (many code in 2 if-checks).
> 
> Cc: Ard Biesheuvel 
> Cc: Jordan Justen 
> Cc: Brijesh Singh 
> Cc: Erdem Aktas 
> Cc: James Bottomley 
> Cc: Jiewen Yao 
> Cc: Tom Lendacky 
> Cc: Gerd Hoffmann 
> Cc: Sebastien Boeuf 
> Signed-off-by: Min Xu 

Acked-by: Gerd Hoffmann 



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




Re: [edk2-devel] [PATCH V8 23/47] OvmfPkg/PlatformPei: Refactor QemuUc32BaseInitialization

2022-03-15 Thread Gerd Hoffmann
On Sat, Mar 12, 2022 at 09:53:48AM +0800, Min Xu wrote:
> BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=3863
> 
> Rename QemuUc32BaseInitialization to PlatformQemuUc32BaseInitialization.
> This function is for PlatformInitLib.
> 
> Cc: Ard Biesheuvel 
> Cc: Jordan Justen 
> Cc: Brijesh Singh 
> Cc: Erdem Aktas 
> Cc: James Bottomley 
> Cc: Jiewen Yao 
> Cc: Tom Lendacky 
> Cc: Gerd Hoffmann 
> Cc: Sebastien Boeuf 
> Signed-off-by: Min Xu 

Acked-by: Gerd Hoffmann 



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




Re: [edk2-devel] [PATCH V8 22/47] OvmfPkg/PlatformPei: Refactor MaxCpuCountInitialization

2022-03-15 Thread Gerd Hoffmann
  Hi,

> +/**
> +  Fetch the boot CPU count and the possible CPU count from QEMU, and expose
> +  them to UefiCpuPkg modules. Set the mMaxCpuCount variable.
> +**/

Another outdated comment.

take care,
  Gerd



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




Re: [edk2-devel] [PATCH V8 21/47] OvmfPkg/PlatformPei: Refactor AddressWidthInitialization

2022-03-15 Thread Gerd Hoffmann
On Sat, Mar 12, 2022 at 09:53:46AM +0800, Min Xu wrote:
> +/**
> +  Initialize the mPhysMemAddressWidth variable, based on guest RAM size.
> +**/

That comment isn't correct any more, the global variables are in
PlatformInfoHob now (there are probably more cases like this).

take care,
  Gerd



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#87578): https://edk2.groups.io/g/devel/message/87578
Mute This Topic: https://groups.io/mt/89725415/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 27/37] UefiCpuPkg: Update AddressEncMask in CpuPageTable

2022-03-15 Thread Ni, Ray
Can you please remove the empty line added in GetPageTableEntry()? Can you 
please check whether it can pass uncrustify check?

With that addressed, Reviewed-by: Ray Ni 


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




Re: [edk2-devel] [PATCH V8 20/47] OvmfPkg/PlatformPei: Refactor MiscInitialization for CloudHV

2022-03-15 Thread Gerd Hoffmann
On Sat, Mar 12, 2022 at 09:53:45AM +0800, Min Xu wrote:
> BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=3863
> 
> Refactor MiscInitialization for CloudHV to set PCD as other platforms
> do. Because in the following patch we will split the functions which
> set PCDs into two, one for PlatformInitLib, one for PlatformPei.
> 
> Cc: Ard Biesheuvel 
> Cc: Jordan Justen 
> Cc: Brijesh Singh 
> Cc: Erdem Aktas 
> Cc: James Bottomley 
> Cc: Jiewen Yao 
> Cc: Tom Lendacky 
> Cc: Gerd Hoffmann 
> Cc: Sebastien Boeuf 
> Signed-off-by: Min Xu 

Acked-by: Gerd Hoffmann 



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




Re: [edk2-devel] [PATCH V8 19/47] OvmfPkg/PlatformPei: Refactor MiscInitialization

2022-03-15 Thread Gerd Hoffmann
On Sat, Mar 12, 2022 at 09:53:44AM +0800, Min Xu wrote:
> BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=3863
> 
> In MiscInitialization Microvm looks a little weird. Other platforms
> call PcdSet16S to set the PcdOvmfHostBridgePciDevId with the value same
> as PlatformInfoHob->HostBridgeDevId. But Microvm doesn't follow this
> way. In switch-case 0x is Microvm, but set with
> MICROVM_PSEUDO_DEVICE_ID. So we have to add a new function
> ( MiscInitializationForMicrovm ) for Microvm and delete the code in
> MiscInitialization.
> 
> Cc: Ard Biesheuvel 
> Cc: Jordan Justen 
> Cc: Brijesh Singh 
> Cc: Erdem Aktas 
> Cc: James Bottomley 
> Cc: Jiewen Yao 
> Cc: Tom Lendacky 
> Cc: Gerd Hoffmann 
> Cc: Sebastien Boeuf 
> Signed-off-by: Min Xu 

Acked-by: Gerd Hoffmann 



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




Re: [edk2-devel] [PATCH V8 13/47] UefiCpuPkg: Enable Tdx support in MpInitLib

2022-03-15 Thread Ni, Ray
Min,
I don't quite understand.

Of all MP services, the TDX version only supports:
* GetNumberOfProcessors
* GetProcessorInfo

And even when TDX MP returns 3 or 4 threads from GetNumberOfProcessors(), 
StartupAllAPs() is an NOP.
Will that cause any issue?

Can you avoid running MP driver when TDX is enabled?

Thanks,
Ray


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




Re: [edk2-devel] [PATCH V8 18/47] OvmfPkg/PlatformPei: Move global variables to PlatformInfoHob

2022-03-15 Thread Gerd Hoffmann
> diff --git a/OvmfPkg/PlatformPei/AmdSev.c b/OvmfPkg/PlatformPei/AmdSev.c
> index fb7e21ec140f..c180383b42b0 100644
> --- a/OvmfPkg/PlatformPei/AmdSev.c
> +++ b/OvmfPkg/PlatformPei/AmdSev.c
> @@ -24,6 +24,8 @@
>  
>  #include "Platform.h"
>  
> +extern EFI_HOB_PLATFORM_INFO  mPlatformInfoHob;

Move that line to Platform.h?

Otherwise looks good.
Acked-by: Gerd Hoffmann 



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




Re: [edk2-devel] [PATCH V8 02/47] MdePkg: Introduce basic Tdx functions in BaseLib

2022-03-15 Thread Ni, Ray
one more comment:
the functions headers say "@return EFI_SUCCESS". Should we say "@retval 0" for 
a successful call?

+  to the host VMM, as selected by Leaf.
+
+  @param[in]  LeafLeaf number of TDCALL instruction
+  @param[in]  Arg1Arg1
+  @param[in]  Arg2Arg2
+  @param[in]  Arg3Arg3
+  @param[in,out]  Results  Returned result of the Leaf function
+
+  @return EFI_SUCCESS
+  @return Other   See individual leaf functions
+**/
+UINTN
+EFIAPI
+TdCall (
+  IN UINT64Leaf,
+  IN UINT64Arg1,
+  IN UINT64Arg2,
+  IN UINT64Arg3,
+  IN OUT VOID  *Results
+  );
+
+/**
+  TDVMALL is a leaf function 0 for TDCALL. It helps invoke services 
+from the
+  host VMM to pass/receive information.
+
+  @param[in] LeafNumber of sub-functions
+  @param[in] Arg1Arg1
+  @param[in] Arg2Arg2
+  @param[in] Arg3Arg3
+  @param[in] Arg4Arg4
+  @param[in,out] Results Returned result of the sub-function
+
+  @return EFI_SUCCESS
+  @return Other   See individual sub-functions
+
+**/
+UINTN
+EFIAPI
+TdVmCall (
+  IN UINT64Leaf,
+  IN UINT64Arg1,
+  IN UINT64Arg2,
+  IN UINT64Arg3,
+  IN UINT64Arg4,
+  IN OUT VOID  *Results
+  );
+




-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#87572): https://edk2.groups.io/g/devel/message/87572
Mute This Topic: https://groups.io/mt/89725391/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 11/37] UefiCpuPkg: Support TDX in BaseXApicX2ApicLib

2022-03-15 Thread Ni, Ray
Reviewed-by: Ray Ni 


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




Re: [edk2-devel] [PATCH V8 17/47] OvmfPkg/PlatformInitLib: Add hob functions

2022-03-15 Thread Gerd Hoffmann
On Sat, Mar 12, 2022 at 09:53:42AM +0800, Min Xu wrote:
> BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=3863
> 
> In this patch of PlatformInitLib, below hob functions are introduced:
>  - PlatformAddIoMemoryBaseSizeHob
>  - PlatformAddIoMemoryRangeHob
>  - PlatformAddMemoryBaseSizeHob
>  - PlatformAddMemoryRangeHob
>  - PlatformAddReservedMemoryBaseSizeHob
> 
> They correspond the below functions in OvmfPkg/PlatformPei:
>  - AddIoMemoryBaseSizeHob
>  - AddIoMemoryRangeHob
>  - AddMemoryBaseSizeHob
>  - AddMemoryRangeHob
>  - AddReservedMemoryBaseSizeHob
> 
> After above hob functions are introduced in PlatformInitLib,
> OvmfPkg/PlatformPei is refactored with this library.
> 
> Cc: Ard Biesheuvel 
> Cc: Jordan Justen 
> Cc: Brijesh Singh 
> Cc: Erdem Aktas 
> Cc: James Bottomley 
> Cc: Jiewen Yao 
> Cc: Tom Lendacky 
> Cc: Gerd Hoffmann 
> Signed-off-by: Min Xu 

Acked-by: Gerd Hoffmann 



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




Re: [edk2-devel] [PATCH V8 02/47] MdePkg: Introduce basic Tdx functions in BaseLib

2022-03-15 Thread Ni, Ray


+
+%macro tdcall 0
+db 0x66,0x0f,0x01,0xcc
+%endmacro

1. can you please check whether the tdcall instruction is supported by latest 
NASM compiler?


+AsmCpuid (CPUID_VERSION_INFO, NULL, NULL, , NULL);
+if ((Ecx & BIT31) == 0) {

2. Can you please update CPUID_VERSION_INFO_ECX in 
MdePkg/Include/Regiter/Intel/Cpuid.h for the BIT31?

+  break;
+}
+
+if (LargestEax < 0x21) {
+  break;
+}
+
+AsmCpuidEx (0x21, 0, , , , );
+if (  (Ebx != SIGNATURE_32 ('I', 'n', 't', 'e'))
+   || (Edx != SIGNATURE_32 ('l', 'T', 'D', 'X'))
+   || (Ecx != SIGNATURE_32 (' ', ' ', ' ', ' ')))
+{
+  break;
+}
+

3. Similar comment as #2.


+%macro tdcall 0
+db 0x66,0x0f,0x01,0xcc
+%endmacro

4. similar comment as #1.



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




Re: [edk2-devel] [PATCH V8 16/47] OvmfPkg: Create initial version of PlatformInitLib

2022-03-15 Thread Gerd Hoffmann
On Sat, Mar 12, 2022 at 09:53:41AM +0800, Min Xu wrote:
> BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=3863
> 
> There are 3 variants of PlatformPei in OvmfPkg:
>  - OvmfPkg/PlatformPei
>  - OvmfPkg/XenPlatformPei
>  - OvmfPkg/Bhyve/PlatformPei/PlatformPei.inf
> These PlatformPeis can share many common codes, such as
> Cmos / Hob / Memory / Platform related functions. This commit
> (and its following several patches) are to create a PlatformInitLib
> which wraps the common code called in above PlatformPeis.
> 
> In this initial version of PlatformInitLib, below Cmos related functions
> are introduced:
>  - PlatformCmosRead8
>  - PlatformCmosWrite8
>  - PlatformDebugDumpCmos
> 
> They correspond to the functions in OvmfPkg/PlatformPei:
>  - CmosRead8
>  - CmosWrite8
>  - DebugDumpCmos
> 
> Considering this PlatformInitLib will be used in SEC phase, global
> variables and dynamic PCDs are avoided. We use PlatformInfoHob
> to exchange information between functions.
> 
> EFI_HOB_PLATFORM_INFO is the data struct which contains the platform
> information, such as HostBridgeDevId, BootMode, S3Supported,
> SmmSmramRequire, etc.
> 
> After PlatformInitLib is created, OvmfPkg/PlatformPei is refactored
> with this library.
> 
> Cc: Ard Biesheuvel 
> Cc: Jordan Justen 
> Cc: Brijesh Singh 
> Cc: Erdem Aktas 
> Cc: James Bottomley 
> Cc: Jiewen Yao 
> Cc: Tom Lendacky 
> Cc: Gerd Hoffmann 
> Signed-off-by: Min Xu 

Acked-by: Gerd Hoffmann 



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#87568): https://edk2.groups.io/g/devel/message/87568
Mute This Topic: https://groups.io/mt/89725408/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 06/37] UefiCpuPkg/CpuExceptionHandler: Add base support for the #VE exception #ve

2022-03-15 Thread Min Xu
Oh, I can refactor the code in PeiDxeSmmCpuException.c and SecPeiCpuException.c 
with switch-case for VC/VE handling  together. It will be updated in the next 
version.

From: Ni, Ray 
Sent: Tuesday, March 15, 2022 3:17 PM
To: Xu, Min M ; devel@edk2.groups.io
Subject: Re: [edk2-devel] [PATCH V7 06/37] UefiCpuPkg/CpuExceptionHandler: Add 
base support for the #VE exception #ve


Reviewed-by: Ray Ni ray...@intel.com

Min, any reason that you don't change to switch-case for VC/VE handling 
together?


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




Re: [edk2-devel] [PATCH V7 06/37] UefiCpuPkg/CpuExceptionHandler: Add base support for the #VE exception #ve

2022-03-15 Thread Ni, Ray
Reviewed-by: Ray Ni 

Min, any reason that you don't change to switch-case for VC/VE handling 
together?


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




Re: [edk2-devel] [PATCH V7 04/37] UefiCpuPkg: Extend VmgExitLibNull to handle #VE exception #ve

2022-03-15 Thread Ni, Ray
Reviewed-by: Ray Ni 


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




Re: [edk2-devel] [PATCH V8 00/47] Enable Intel TDX in OvmfPkg (Config-A)

2022-03-15 Thread Min Xu
On March 15, 2022 11:55 AM, Gao Liming wrote:
> Min:
>   As Jiewen mentions, EFI_RESOURCE_MEMORY_UNACCEPTED will be in next
> public spec. So, it can't be added now.
> 
>   I suggest to add edk2 definition for this type in MdeModulePkg first, such 
> as
> EDKII_RESOURCE_MEMORY_UNACCEPTED. It can be removed after new spec is
> published.
> 
Thanks for the comments. In the patch EFI_RESOURCE_MEMORY_UNACCEPTED was 
defined in MdePkg/Include/Pi/PiHob.h.
I check the MdeModulePkg/Include but don't find some proper header files for 
this definition. 

Or can we define EFI_RESOURCE_MEMORY_UNACCEPTED in 
OvmfPkg/Library/PlatformInitLib/IntelTdx.c?
In current stage all the unaccepted memory passed from host VMM are all 
accepted in OvmfPkg/Library/PlatformInitLib/IntelTdx.c. After that these 
unaccepted memory hob are transferred to private memory hob. So currently 
EFI_RESOURCE_MEMORY_UNACCEPTED is only seen in above IntelTdx.c. 

[TDVF] Sec 7.3.1 defines the unaccepted memory resource HOB for DXE phase. But 
this is for the lazy-accept feature which will be implemented in the future.

What's your suggestion?

[TDVF] 
https://www.intel.com/content/dam/develop/external/us/en/documents/tdx-virtual-firmware-design-guide-rev-1.01.pdf

Thanks
Min


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




Re: [edk2-devel] [PATCH v2] MdePkg/AcpiXX.h: Update Error Severity type for Generic Error Status Block

2022-03-15 Thread Wu, Hao A
Hello,

Any feedback for the patch? Thanks in advance.

Best Regards,
Hao Wu

> -Original Message-
> From: Wu, Hao A 
> Sent: Tuesday, March 8, 2022 1:43 PM
> To: devel@edk2.groups.io
> Cc: Wu, Hao A ; Kinney, Michael D
> ; Gao, Liming ; Liu,
> Zhiguang ; Ni, Ray 
> Subject: [PATCH v2] MdePkg/AcpiXX.h: Update Error Severity type for Generic
> Error Status Block
> 
> Starting from ACPI Specification Version 5.1 Errata B, the term
> 'Correctable' is no longer being used as an error severity of the
> reported error in Chapter 18 APEI.
> 
> This commit will
> a) For Acpi40.h & Acpi50.h
> Add new macro EFI_ACPI_X_X_ERROR_SEVERITY_RECOVERABLE, since both the
> terms 'Correctable' and 'Recoverable' are used to denote the same error
> severity.
> 
> b) Header files starting from Acpi51.h to Acpi64.h
> Add new macro EFI_ACPI_X_X_ERROR_SEVERITY_RECOVERABLE.
> Keeps the origin EFI_ACPI_X_X_ERROR_SEVERITY_CORRECTABLE for
> compatibility
> consideration, but add comments to mark it as deprecated and should no
> longer be used.
> 
> Cc: Michael D Kinney 
> Cc: Liming Gao 
> Cc: Zhiguang Liu 
> Cc: Ray Ni 
> Signed-off-by: Hao A Wu 
> ---
>  MdePkg/Include/IndustryStandard/Acpi40.h |  3 ++-
>  MdePkg/Include/IndustryStandard/Acpi50.h |  3 ++-
>  MdePkg/Include/IndustryStandard/Acpi51.h | 10 --
>  MdePkg/Include/IndustryStandard/Acpi60.h | 10 --
>  MdePkg/Include/IndustryStandard/Acpi61.h | 10 --
>  MdePkg/Include/IndustryStandard/Acpi62.h | 10 --
>  MdePkg/Include/IndustryStandard/Acpi63.h | 10 --
>  MdePkg/Include/IndustryStandard/Acpi64.h | 10 --
>  8 files changed, 52 insertions(+), 14 deletions(-)
> 
> diff --git a/MdePkg/Include/IndustryStandard/Acpi40.h
> b/MdePkg/Include/IndustryStandard/Acpi40.h
> index 862113dff9..a2da09346f 100644
> --- a/MdePkg/Include/IndustryStandard/Acpi40.h
> +++ b/MdePkg/Include/IndustryStandard/Acpi40.h
> @@ -1,7 +1,7 @@
>  /** @file
> 
>ACPI 4.0 definitions from the ACPI Specification Revision 4.0a April 5, 
> 2010
> 
> 
> 
> -  Copyright (c) 2010 - 2018, Intel Corporation. All rights reserved.
> 
> +  Copyright (c) 2010 - 2022, Intel Corporation. All rights reserved.
> 
>SPDX-License-Identifier: BSD-2-Clause-Patent
> 
>  **/
> 
> 
> 
> @@ -690,6 +690,7 @@ typedef struct {
>  // Boot Error Severity types
> 
>  //
> 
>  #define EFI_ACPI_4_0_ERROR_SEVERITY_CORRECTABLE  0x00
> 
> +#define EFI_ACPI_4_0_ERROR_SEVERITY_RECOVERABLE  0x00
> 
>  #define EFI_ACPI_4_0_ERROR_SEVERITY_FATAL0x01
> 
>  #define EFI_ACPI_4_0_ERROR_SEVERITY_CORRECTED0x02
> 
>  #define EFI_ACPI_4_0_ERROR_SEVERITY_NONE 0x03
> 
> diff --git a/MdePkg/Include/IndustryStandard/Acpi50.h
> b/MdePkg/Include/IndustryStandard/Acpi50.h
> index be8f85f577..76706aa640 100644
> --- a/MdePkg/Include/IndustryStandard/Acpi50.h
> +++ b/MdePkg/Include/IndustryStandard/Acpi50.h
> @@ -2,7 +2,7 @@
>ACPI 5.0 definitions from the ACPI Specification Revision 5.0a November 13,
> 2013.
> 
> 
> 
>Copyright (c) 2014 Hewlett-Packard Development Company, L.P.
> 
> -  Copyright (c) 2011 - 2018, Intel Corporation. All rights reserved.
> 
> +  Copyright (c) 2011 - 2022, Intel Corporation. All rights reserved.
> 
>Copyright (c) 2020, ARM Ltd. All rights reserved.
> 
>SPDX-License-Identifier: BSD-2-Clause-Patent
> 
>  **/
> 
> @@ -1361,6 +1361,7 @@ typedef struct {
>  // Boot Error Severity types
> 
>  //
> 
>  #define EFI_ACPI_5_0_ERROR_SEVERITY_CORRECTABLE  0x00
> 
> +#define EFI_ACPI_5_0_ERROR_SEVERITY_RECOVERABLE  0x00
> 
>  #define EFI_ACPI_5_0_ERROR_SEVERITY_FATAL0x01
> 
>  #define EFI_ACPI_5_0_ERROR_SEVERITY_CORRECTED0x02
> 
>  #define EFI_ACPI_5_0_ERROR_SEVERITY_NONE 0x03
> 
> diff --git a/MdePkg/Include/IndustryStandard/Acpi51.h
> b/MdePkg/Include/IndustryStandard/Acpi51.h
> index d8ee3ef8f2..01ef544c3a 100644
> --- a/MdePkg/Include/IndustryStandard/Acpi51.h
> +++ b/MdePkg/Include/IndustryStandard/Acpi51.h
> @@ -2,7 +2,7 @@
>ACPI 5.1 definitions from the ACPI Specification Revision 5.1 Errata B 
> January,
> 2016.
> 
> 
> 
>Copyright (c) 2014 Hewlett-Packard Development Company, L.P.
> 
> -  Copyright (c) 2014 - 2018, Intel Corporation. All rights reserved.
> 
> +  Copyright (c) 2014 - 2022, Intel Corporation. All rights reserved.
> 
>(C) Copyright 2015 Hewlett Packard Enterprise Development LP
> 
>Copyright (c) 2020, ARM Ltd. All rights reserved.
> 
>SPDX-License-Identifier: BSD-2-Clause-Patent
> 
> @@ -1376,10 +1376,16 @@ typedef struct {
>  //
> 
>  // Boot Error Severity types
> 
>  //
> 
> -#define EFI_ACPI_5_1_ERROR_SEVERITY_CORRECTABLE  0x00
> 
> +#define EFI_ACPI_5_1_ERROR_SEVERITY_RECOVERABLE  0x00
> 
>  #define EFI_ACPI_5_1_ERROR_SEVERITY_FATAL0x01
> 
>  #define EFI_ACPI_5_1_ERROR_SEVERITY_CORRECTED0x02
> 
>  #define EFI_ACPI_5_1_ERROR_SEVERITY_NONE 0x03
> 
> +//
> 
> +// The term 'Correctable' is no longer being used as an error severity of the
> 
> +// reported error since ACPI