Re: [edk2-devel] [Patch 1/2] OvmfPkg: Change default to disable MptScsi and PvScsi

2022-12-06 Thread Gerd Hoffmann
  Hi,

> A patch mentioned above set MPT_SCSI_ENABLE=FALSE, that removed
> support for LSI 53C1030 and SAS1068.
> These SCSI controllers were emulated  by VMware, Parallels and I guess
> VitualBox.
> This is generic setup for VMware VMs, as far as I remember.
> So the booting of such VMs (probably migrated from VMware  and others)
> was definitely broken.

Yes.  Problem is there is no maintainer for the driver.  There used to
be one, but the email address started bouncing.  So we updated
Maintainers.txt and flipped the switch to not build the unmaintained
drivers by default.

If debian is fine with shipping unmaintained software to its users you
can flip the config switches of course, at least as long as the drivers
are still in the tree.  The drivers are at risk of being removed though
in case we don't find a new maintainer within a year or two.

take care,
  Gerd



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




[edk2-devel] [PATCH 1/1] OvmfPkg/PlatformInitLib: pass through reservations from qemu

2022-12-06 Thread Gerd Hoffmann
qemu uses the etc/e820 fw_cfg file not only for memory, but
also for reservations.  Handle reservations by adding resource
descriptor hobs for them.

A typical qemu configuration has a small reservation between
lapic and flash:

  # sudo cat /proc/iomem
  [ ... ]
  fee0-fee00fff : Local APIC
  feffc000-feff : Reserved  <= HERE
  ffc0- : Reserved
  [ ... ]

Signed-off-by: Gerd Hoffmann 
---
 OvmfPkg/Library/PlatformInitLib/MemDetect.c | 16 
 1 file changed, 16 insertions(+)

diff --git a/OvmfPkg/Library/PlatformInitLib/MemDetect.c 
b/OvmfPkg/Library/PlatformInitLib/MemDetect.c
index b8feae4309de..a7a4e028ad50 100644
--- a/OvmfPkg/Library/PlatformInitLib/MemDetect.c
+++ b/OvmfPkg/Library/PlatformInitLib/MemDetect.c
@@ -228,6 +228,22 @@ PlatformScanOrAdd64BitE820Ram (
 ));
 }
   }
+} else if (E820Entry.Type == EfiAcpiAddressRangeReserved) {
+  if (AddHighHob) {
+DEBUG ((
+  DEBUG_INFO,
+  "%a: Reserved: Base=0x%Lx Length=0x%Lx\n",
+  __FUNCTION__,
+  E820Entry.BaseAddr,
+  E820Entry.Length
+  ));
+BuildResourceDescriptorHob (
+  EFI_RESOURCE_MEMORY_RESERVED,
+  0,
+  E820Entry.BaseAddr,
+  E820Entry.Length
+  );
+  }
 }
   }
 
-- 
2.38.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#97066): https://edk2.groups.io/g/devel/message/97066
Mute This Topic: https://groups.io/mt/95510762/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 4/4] MdePkg: Signal AfterReadyToBoot after ReadyToBoot

2022-12-06 Thread Dionna Glaze via groups.io
On Tue, Dec 6, 2022 at 5:26 PM gaoliming  wrote:
>
> Dionna:
>   I add my comments below.
>
> > -邮件原件-
> > 发件人: devel@edk2.groups.io  代表 Dionna Glaze
> > via groups.io
> > 发送时间: 2022年11月9日 5:16
> > 收件人: devel@edk2.groups.io
> > 抄送: Dionna Glaze ; Michael D Kinney
> > ; Ard Biesheuvel ; Gerd
> > Hoffman ; Jiewen Yao 
> > 主题: [edk2-devel] [PATCH v2 4/4] MdePkg: Signal AfterReadyToBoot after
> > ReadyToBoot
> >
> > The Uefi v2.9 specification adds this event group in section 3.1.7,
> > with its GUID defined in the Related Definitions section of
> > EFI_BOOT_SERVICES.CreateEventEx() in chapter 7.
> >
> > Cc: "Michael D Kinney" 
> > Cc: Ard Biesheuvel 
> > Cc: Gerd Hoffman 
> > Cc: Jiewen Yao 
> >
> > Signed-off-by: Dionna Glaze 
> > ---
> >  MdePkg/Include/Library/UefiLib.h  |  2 ++
> >  MdePkg/Library/UefiLib/UefiLib.inf|  1 +
> >  MdePkg/Library/UefiLib/UefiNotTiano.c | 18 ++
> >  3 files changed, 21 insertions(+)
> >
> > diff --git a/MdePkg/Include/Library/UefiLib.h
> > b/MdePkg/Include/Library/UefiLib.h
> > index be7da7fdf7..2c3342351e 100644
> > --- a/MdePkg/Include/Library/UefiLib.h
> > +++ b/MdePkg/Include/Library/UefiLib.h
> > @@ -890,6 +890,8 @@ UnicodeStringDisplayLength (
> >  /**
> >Create, Signal, and Close the Ready to Boot event using
> > EfiSignalEventReadyToBoot().
> >
> > +  If successful, then create, signal and close the After Ready to Boot 
> > event.
> > +
> >This function abstracts the signaling of the Ready to Boot Event. The
> > Framework moved
> >from a proprietary to UEFI 2.0 based mechanism. This library abstracts
> > the caller
> >from how this event is created to prevent to code form having to change
> > with the
> > diff --git a/MdePkg/Library/UefiLib/UefiLib.inf
> > b/MdePkg/Library/UefiLib/UefiLib.inf
> > index 01ed92092d..5c4064eafa 100644
> > --- a/MdePkg/Library/UefiLib/UefiLib.inf
> > +++ b/MdePkg/Library/UefiLib/UefiLib.inf
> > @@ -60,6 +60,7 @@
> >gEfiGlobalVariableGuid##
> > SOMETIMES_CONSUMES  ## Variable
> >gEfiAcpi20TableGuid   ##
> > SOMETIMES_CONSUMES  ## SystemTable
> >gEfiAcpi10TableGuid   ##
> > SOMETIMES_CONSUMES  ## SystemTable
> > +  gEfiEventAfterReadyToBootGuid ##
> > SOMETIMES_CONSUMES  ## Event
> >
> >  [Protocols]
> >gEfiDriverBindingProtocolGuid   ##
> > SOMETIMES_PRODUCES
> > diff --git a/MdePkg/Library/UefiLib/UefiNotTiano.c
> > b/MdePkg/Library/UefiLib/UefiNotTiano.c
> > index d84e91fd01..04fe42f9f7 100644
> > --- a/MdePkg/Library/UefiLib/UefiNotTiano.c
> > +++ b/MdePkg/Library/UefiLib/UefiNotTiano.c
> > @@ -208,6 +208,8 @@ EfiCreateEventReadyToBootEx (
> >  /**
> >Create, Signal, and Close the Ready to Boot event using
> > EfiSignalEventReadyToBoot().
> >
> > +  If successful, then create, signal and close the After Ready to Boot 
> > event.
> > +
> >This function abstracts the signaling of the Ready to Boot Event. The
> > Framework moved
> >from a proprietary to UEFI 2.0 based mechanism. This library abstracts
> > the caller
> >from how this event is created to prevent to code form having to change
> > with the
> > @@ -222,11 +224,27 @@ EfiSignalEventReadyToBoot (
> >  {
> >EFI_STATUS  Status;
> >EFI_EVENT   ReadyToBootEvent;
> > +  EFI_EVENT   AfterReadyToBootEvent;
> >
> >Status = EfiCreateEventReadyToBoot ();
> >if (!EFI_ERROR (Status)) {
> >  gBS->SignalEvent (ReadyToBootEvent);
> >  gBS->CloseEvent (ReadyToBootEvent);
> > +return;
> > +  }
> > +
> Return should not be here. This means ReadyToBoot event creates successfully 
> and return.
> But, the behavior should be ReadyToBoot and AfterReadyToBoot event both trig.
>

Thanks Gao, given Michael's feedback about this patch not making much
sense in the series that adds before_exit_boot_services, we decided to
go ahead and consider v1 of this series as final. Let's let Robert
Phelps take it from here, since they appear to need it such that
they're in a better position to test their implementation.

> Thanks
> Liming
> > +  /* Then immediately signal the after ready to boot event group */
> > +  Status = gBS->CreateEventEx (
> > +  EVT_NOTIFY_SIGNAL,
> > +  TPL_CALLBACK,
> > +  EfiEventEmptyFunction,
> > +  NULL,
> > +  ,
> > +  AfterReadyToBootEvent
> > +  );
> > +  if (!EFI_ERROR(Status)) {
> > +gBS->SignalEvent (AfterReadyToBootEvent);
> > +gBS->CloseEvent (AfterReadyToBootEvent);
> >}
> >  }
> >
> > --
> > 2.38.1.431.g37b22c650d-goog
> >
> >
> >
> > 
> >
>
>
>


-- 
-Dionna Glaze, PhD (she/her)


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

Re: [edk2-devel] [PATCH v4 1/1] MdePkg/BaseRngLib: Add a smoketest for RDRAND and check CPUID

2022-12-06 Thread Pedro Falcato
> Pedro:
>   To keep the same behavior, I suggest to only update
> BaseRngLibConstructor() API with TestRdRand, don't touch other APIs.

Liming,
the point is to fix the library's broken behavior, as previously discussed
in the ML, and documented in the commit message and the bugzilla.
Only updating BaseRngLibConstructor would do absolutely nothing.
ArchIsRngSupported needs updating because it's bogus.
The individual ArchGetRandomNumberN() do not *need* updating, but it's a
good idea to make sure that "Existing software depends on this always
returning TRUE" isn't actually reality.

Pedro


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




Re: [edk2-devel] [Patch 1/1] RedfishPkg: Remove overlapping private include path in DEC file

2022-12-06 Thread Nickle Wang via groups.io
Reviewed-by: Nickle Wang 

Regards,
Nickle

From: devel@edk2.groups.io  On Behalf Of Igor Kulchytskyy 
via groups.io
Sent: Tuesday, December 6, 2022 10:32 PM
To: Chang, Abner ; Michael D Kinney 
; devel@edk2.groups.io
Cc: Nickle Wang 
Subject: Re: [edk2-devel] [Patch 1/1] RedfishPkg: Remove overlapping private 
include path in DEC file

External email: Use caution opening links or attachments

Reviewed-by: Igor Kulchytskyy mailto:abner.ch...@amd.com>>

Get Outlook for Android

From: Chang, Abner mailto:abner.ch...@amd.com>>
Sent: Tuesday, December 6, 2022 3:23:56 AM
To: Michael D Kinney 
mailto:michael.d.kin...@intel.com>>; 
devel@edk2.groups.io 
mailto:devel@edk2.groups.io>>
Cc: Nickle Wang mailto:nick...@nvidia.com>>; Igor 
Kulchytskyy mailto:ig...@ami.com>>
Subject: [EXTERNAL] RE: [Patch 1/1] RedfishPkg: Remove overlapping private 
include path in DEC file


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

[AMD Official Use Only - General]

Reviewed-by: Abner Chang mailto:abner.ch...@amd.com>>

> -Original Message-
> From: Michael D Kinney 
> mailto:michael.d.kin...@intel.com>>
> Sent: Tuesday, December 6, 2022 8:45 AM
> To: devel@edk2.groups.io
> Cc: Chang, Abner mailto:abner.ch...@amd.com>>; Nickle 
> Wang
> mailto:nick...@nvidia.com>>; Igor Kulchytskyy 
> mailto:ig...@ami.com>>
> Subject: [Patch 1/1] RedfishPkg: Remove overlapping private include path in
> DEC file
>
> Caution: This message originated from an External Source. Use proper
> caution when opening attachments, clicking links, or responding.
>
>
> Update ReadfishPkg.dec to remove PrivateInclude from the
> [Includes.Common.Private] section.  The PrivateInclude directory does not
> contain any include files, and the PrivateInclude/Crt include path remaining 
> in
> the [Includes.Common.Private] section providing the include path required
> to access the CRT related include files by components within the RedfishPkg.
>
> Without this update, there are two forms of #include statements that can be
> used to include the CRT related include files.
> Include files should only be available using one form of #include statements.
>
> Cc: Abner Chang mailto:abner.ch...@amd.com>>
> Cc: Nickle Wang mailto:nick...@nvidia.com>>
> Cc: Igor Kulchytskyy mailto:ig...@ami.com>>
> Signed-off-by: Michael D Kinney 
> mailto:michael.d.kin...@intel.com>>
> ---
>  RedfishPkg/RedfishPkg.dec | 1 -
>  1 file changed, 1 deletion(-)
>
> diff --git a/RedfishPkg/RedfishPkg.dec b/RedfishPkg/RedfishPkg.dec index
> 0aa26883e220..d2b189b13d8c 100644
> --- a/RedfishPkg/RedfishPkg.dec
> +++ b/RedfishPkg/RedfishPkg.dec
> @@ -17,7 +17,6 @@ [Includes]
>Include
>
>  [Includes.Common.Private]
> -  PrivateInclude# Private header files for C RTL.
>PrivateInclude/Crt# Private header files for C RTL.
>Library/JsonLib   # Private header files for jansson
>  # configuration files.
> --
> 2.37.1.windows.1
-The information contained in this message may be confidential and proprietary 
to American Megatrends (AMI). This communication is intended to be read only by 
the individual or entity to whom it is addressed or by their designee. If the 
reader of this message is not the intended recipient, you are on notice that 
any distribution of this message, in any form, is strictly prohibited. Please 
promptly notify the sender by reply e-mail or by telephone at 770-246-8600, and 
then delete or destroy all copies of the transmission.



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




回复: [edk2-devel] 回复: [edk2-devel] 回复: [edk2-devel] FW: [PATCH] ShellPkg: Displaying SMBIOS Type38 fields in formatted manner

2022-12-06 Thread gaoliming via groups.io
Prakash:

 Please update the commit message title that should start with package name. 
The code logic looks good. 

 

Thanks

Liming

发件人: devel@edk2.groups.io  代表 Prakash K via groups.io
发送时间: 2022年12月5日 14:28
收件人: Prakash K ; devel@edk2.groups.io
主题: Re: [edk2-devel] 回复: [edk2-devel] 回复: [edk2-devel] FW: [PATCH] ShellPkg: 
Displaying SMBIOS Type38 fields in formatted manner

 

Hi Gaoliming,

Kindly let us the know the review status of the pull request.

Thanks,
Prakash K 





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




Re: [edk2-devel] [PATCH 3/4] MdeModulePkg/BmBoot: Skip removable media if it is not present

2022-12-06 Thread Wu, Hao A
Hello,

Could you help to co-work with BDS modules reviewers for reviewing this patch?

py BaseTools/Scripts/GetMaintainer.py 294ce61c3b1a63c89bd16a78f8e8b40e889dac5a
MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c
  Jian J Wang 
  Liming Gao 
  Zhichao Gao 
  Ray Ni 
  devel@edk2.groups.io

Best Regards,
Hao Wu

> -Original Message-
> From: devel@edk2.groups.io  On Behalf Of Sean
> Rhodes
> Sent: Monday, December 5, 2022 5:18 PM
> To: devel@edk2.groups.io
> Cc: Matt DeVillier ; Wu, Hao A
> ; Ni, Ray ; Rhodes, Sean
> 
> Subject: [edk2-devel] [PATCH 3/4] MdeModulePkg/BmBoot: Skip removable
> media if it is not present
> 
> From: Matt DeVillier 
> 
> Only enumerate devices that have media present.
> 
> Cc: Hao A Wu 
> Cc: Ray Ni 
> Reviewed-by: Sean Rhodes 
> Signed-off-by: Matt DeVillier 
> Change-Id: I78a0b8be3e2f33edce2d43bbdd7670e6174d0ff8
> ---
>  MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c | 9 +
>  1 file changed, 9 insertions(+)
> 
> diff --git a/MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c
> b/MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c
> index 962892d38f..bde22fa659 100644
> --- a/MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c
> +++ b/MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c
> @@ -2218,6 +2218,15 @@ BmEnumerateBootOptions (
>  continue;
> 
>}
> 
> 
> 
> +  //
> 
> +  // Skip removable media if not present
> 
> +  //
> 
> +  if ((BlkIo->Media->RemovableMedia == TRUE) &&
> 
> +  (BlkIo->Media->MediaPresent == FALSE))
> 
> +  {
> 
> +continue;
> 
> +  }
> 
> +
> 
>Description = BmGetBootDescription (Handles[Index]);
> 
>BootOptions = ReallocatePool (
> 
>sizeof (EFI_BOOT_MANAGER_LOAD_OPTION) *
> (*BootOptionCount),
> 
> --
> 2.37.2
> 
> 
> 
> -=-=-=-=-=-=
> Groups.io Links: You receive all messages sent to this group.
> View/Reply Online (#96952): https://edk2.groups.io/g/devel/message/96952
> Mute This Topic: https://groups.io/mt/95465402/1768737
> Group Owner: devel+ow...@edk2.groups.io
> Unsubscribe: https://edk2.groups.io/g/devel/unsub [hao.a...@intel.com]
> -=-=-=-=-=-=
> 



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




Re: [edk2-devel] [PATCH 4/4] MdeModulePkg/UsbBusDxe: Adjust the MaxPacketLength to real world values

2022-12-06 Thread Wu, Hao A
I have concern for this patch.



It will make the implementation of XhcControlTransfer() no longer following the 
UEFI specification requirements on the EFI_USB2_HC_PROTOCOL.ControlTransfer() 
service:



Section 17.1.7 of UEFI spec Release 2.10:

EFI_INVALID_PARAMETER is returned if one of the following conditions is 
satisfied:

...

* MaximumPacketLength is not valid. If DeviceSpeed is EFI_USB_SPEED_LOW, then 
MaximumPacketLength

  must be 8. If DeviceSpeed is EFI_USB_SPEED_FULL or EFI_USB_SPEED_HIGH, then 
MaximumPac-

  ketLength must be 8, 16, 32, or 64. If DeviceSpeed is EFI_USB_SPEED_SUPER, 
then MaximumPacketLength

  must be 512.



My take is that it will need a UEFI spec update to integrate this proposed 
change.

Sorry Liming, could you help on the process of raising opens with regard to the 
UEFI specification? Thanks in advance.



Best Regards,

Hao Wu



> -Original Message-

> From: devel@edk2.groups.io  On Behalf Of Sean

> Rhodes

> Sent: Monday, December 5, 2022 5:18 PM

> To: devel@edk2.groups.io

> Cc: Rhodes, Sean ; Wu, Hao A

> ; Ni, Ray 

> Subject: [edk2-devel] [PATCH 4/4] MdeModulePkg/UsbBusDxe: Adjust the

> MaxPacketLength to real world values

>

> Adjusts the requirements for the MaxPacketLength to match what is seen on

> real world devices that do not follow the USB specification.

>

> This fixes enumeration on the multiple USB 3 devices made by SanDisk,

> Integral, Kingston and other generic brands.

>

> Cc: Hao A Wu mailto:hao.a...@intel.com>>

> Cc: Ray Ni mailto:ray...@intel.com>>

> Signed-off-by: Sean Rhodes 
> mailto:sean@starlabs.systems>>

> ---

>  MdeModulePkg/Bus/Pci/XhciDxe/Xhci.c | 11 ---

>  1 file changed, 4 insertions(+), 7 deletions(-)

>

> diff --git a/MdeModulePkg/Bus/Pci/XhciDxe/Xhci.c

> b/MdeModulePkg/Bus/Pci/XhciDxe/Xhci.c

> index 62535cad54..043b7d4cea 100644

> --- a/MdeModulePkg/Bus/Pci/XhciDxe/Xhci.c

> +++ b/MdeModulePkg/Bus/Pci/XhciDxe/Xhci.c

> @@ -906,19 +906,16 @@ XhcControlTransfer (

>  return EFI_INVALID_PARAMETER;

>

>}

>

>

>

> -  if ((MaximumPacketLength != 8)  && (MaximumPacketLength != 16) &&

>

> -  (MaximumPacketLength != 32) && (MaximumPacketLength != 64) &&

>

> -  (MaximumPacketLength != 512)

>

> -  )

>

> -  {

>

> +  // Check for valid maximum packet size

>

> +  if ((DeviceSpeed == EFI_USB_SPEED_SUPER) && (MaximumPacketLength >

> 1024)) {

>

>  return EFI_INVALID_PARAMETER;

>

>}

>

>

>

> -  if ((DeviceSpeed == EFI_USB_SPEED_LOW) && (MaximumPacketLength !=

> 8)) {

>

> +  if ((DeviceSpeed == EFI_USB_SPEED_HIGH) && (MaximumPacketLength >

> 512)) {

>

>  return EFI_INVALID_PARAMETER;

>

>}

>

>

>

> -  if ((DeviceSpeed == EFI_USB_SPEED_SUPER) && (MaximumPacketLength !=

> 512)) {

>

> +  if ((DeviceSpeed == EFI_USB_SPEED_FULL) && (MaximumPacketLength >

> 64)) {

>

>  return EFI_INVALID_PARAMETER;

>

>}

>

>

>

> --

> 2.37.2

>

>

>

> -=-=-=-=-=-=

> Groups.io Links: You receive all messages sent to this group.

> View/Reply Online (#96951): https://edk2.groups.io/g/devel/message/96951

> Mute This Topic: https://groups.io/mt/95465401/1768737

> Group Owner: devel+ow...@edk2.groups.io

> Unsubscribe: https://edk2.groups.io/g/devel/unsub [hao.a...@intel.com]

> -=-=-=-=-=-=

>




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




回复: [edk2-devel] [PATCH ovmf 1/5] MdePkg/Register/Amd: Define all bits from MSR_SEV_STATUS_REGISTER

2022-12-06 Thread gaoliming via groups.io
Alexey:


> -邮件原件-
> 发件人: devel@edk2.groups.io  代表 Alexey
> Kardashevskiy via groups.io
> 发送时间: 2022年12月1日 10:35
> 收件人: devel@edk2.groups.io
> 抄送: Ard Biesheuvel ; Jiewen Yao
> ; Jordan Justen ; Gerd
> Hoffmann ; Brijesh Singh ;
> Erdem Aktas ; James Bottomley
> ; Min Xu ; Tom Lendacky
> ; Alexey Kardashevskiy 
> 主题: [edk2-devel] [PATCH ovmf 1/5] MdePkg/Register/Amd: Define all bits
> from MSR_SEV_STATUS_REGISTER
> 
> We will need soon DebugSwap but others likely too.
> 
> Signed-off-by: Alexey Kardashevskiy 
> ---
>  MdePkg/Include/Register/Amd/Fam17Msr.h | 57 +++-
>  1 file changed, 56 insertions(+), 1 deletion(-)
> 
> diff --git a/MdePkg/Include/Register/Amd/Fam17Msr.h
> b/MdePkg/Include/Register/Amd/Fam17Msr.h
> index bb4e143e2456..f9474e6776f2 100644
> --- a/MdePkg/Include/Register/Amd/Fam17Msr.h
> +++ b/MdePkg/Include/Register/Amd/Fam17Msr.h
> @@ -121,7 +121,62 @@ typedef union {
>  ///
>  UINT32SevSnpBit : 1;
> 
> -UINT32Reserved2 : 29;
> +///
> +/// [Bit 3] The guest was run with the Virtual TOM feature enabled in
> SEV_FEATURES[1]
> +///
> +UINT32vTOM_Enabled : 1;
> +
This name doesn't follow name convention. You can create pull request to see
CI test result. 

Thanks
Liming
> +///
> +/// [Bit 4] The guest was run with the ReflectVC feature enabled in
> SEV_FEATURES[2]
> +///
> +UINT32ReflectVC : 1;
> +
> +///
> +/// [Bit 5] The guest was run with the Restricted Injection feature
> enabled in SEV_FEATURES[3]
> +///
> +UINT32RestrictedInjection : 1;
> +
> +///
> +/// [Bit 6] The guest was run with the Alternate Injection feature
> enabled in SEV_FEATURES[4]
> +///
> +UINT32AlternateInjection : 1;
> +
> +///
> +/// [Bit 7] This guest was run with debug register swapping enabled
in
> SEV_FEATURES[5]
> +///
> +UINT32DebugSwap : 1;
> +
> +///
> +/// [Bit 8]  This guest was run with the PreventHostIBS feature
> enabled in SEV_FEATURES[6]
> +///
> +UINT32PreventHostIBS : 1;
> +
> +///
> +/// [Bit 9] The guest was run with the BTB isolation feature enabled
in
> SEV_FEATURES[7]
> +///
> +UINT32SNPBTBIsolation : 1;
> +
> +///
> +/// [Bit 10]
> +///
> +UINT32Reserved0 : 1;
> +
> +///
> +/// [Bit 11] The guest was run with the Secure TSC feature enabled in
> SEV_FEATURES[9]
> +///
> +UINT32SecureTsc : 1;
> +
> +///
> +/// [Bits 12 13 14 15]
> +///
> +UINT32Reserved1 : 4;
> +
> +///
> +/// [Bit 16] The guest was run with the VMSA Register Protection
> feature enabled in SEV_FEATURES[14]
> +///
> +UINT32VmsaRegProt_Enabled : 1;
> +
> +UINT32Reserved2 : 15;
>} Bits;
>///
>/// All bit fields as a 32-bit value
> --
> 2.38.1
> 
> 
> 
> 
> 





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




回复: [edk2-devel] [PATCH v4 1/1] MdePkg/BaseRngLib: Add a smoketest for RDRAND and check CPUID

2022-12-06 Thread gaoliming via groups.io
Pedro:
  To keep the same behavior, I suggest to only update
BaseRngLibConstructor() API with TestRdRand, don't touch other APIs.

Thanks
Liming
> -邮件原件-
> 发件人: devel@edk2.groups.io  代表 Pedro Falcato
> 发送时间: 2022年11月23日 6:31
> 收件人: devel@edk2.groups.io
> 抄送: Pedro Falcato ; Michael D Kinney
> ; Liming Gao ;
> Zhiguang Liu ; Jason A . Donenfeld
> 
> 主题: [edk2-devel] [PATCH v4 1/1] MdePkg/BaseRngLib: Add a smoketest for
> RDRAND and check CPUID
> 
> RDRAND has notoriously been broken many times over its lifespan.
> Add a smoketest to RDRAND, in order to better sniff out potential
> security concerns.
> 
> Also add a proper CPUID test in order to support older CPUs which may
> not have it; it was previously being tested but then promptly ignored.
> 
> Testing algorithm inspired by linux's arch/x86/kernel/cpu/rdrand.c
> :x86_init_rdrand() per commit 049f9ae9..
> 
> Many thanks to Jason Donenfeld for relicensing his linux RDRAND detection
> code to MIT and the public domain.
> 
> >On Tue, Nov 22, 2022 at 2:21 PM Jason A. Donenfeld 
> wrote:
>   <..>
> >I (re)wrote that function in Linux. I hereby relicense it as MIT, and
> >also place it into public domain. Do with it what you will now.
> >
> >Jason
> 
> BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=4163
> 
> Signed-off-by: Pedro Falcato 
> Cc: Michael D Kinney 
> Cc: Liming Gao 
> Cc: Zhiguang Liu 
> Cc: Jason A. Donenfeld 
> ---
> v4: Added a doxygen comment to the TestRdRand() function
> v3: Addressed mailing list comments
> v2: Replaced the original v1 naive detection with a better, although still
not
> great, detection.
>  MdePkg/Library/BaseRngLib/Rand/RdRand.c | 99
> +++--
>  1 file changed, 91 insertions(+), 8 deletions(-)
> 
> diff --git a/MdePkg/Library/BaseRngLib/Rand/RdRand.c
> b/MdePkg/Library/BaseRngLib/Rand/RdRand.c
> index 070d41e2555f..ff99436dbbbd 100644
> --- a/MdePkg/Library/BaseRngLib/Rand/RdRand.c
> +++ b/MdePkg/Library/BaseRngLib/Rand/RdRand.c
> @@ -2,6 +2,7 @@
>Random number generator services that uses RdRand instruction access
>to provide high-quality random numbers.
> 
> +Copyright (c) 2022, Pedro Falcato. All rights reserved.
>  Copyright (c) 2021, NUVIA Inc. All rights reserved.
>  Copyright (c) 2015, Intel Corporation. All rights reserved.
> 
> @@ -22,6 +23,88 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
> 
>  STATIC BOOLEAN  mRdRandSupported;
> 
> +//
> +// Intel SDM says 10 tries is good enough for reliable RDRAND usage.
> +//
> +#define RDRAND_RETRIES  10
> +
> +#define RDRAND_TEST_SAMPLES  8
> +
> +#define RDRAND_MIN_CHANGE  5
> +
> +//
> +// Add a define for native-word RDRAND, just for the test.
> +//
> +#ifdef MDE_CPU_X64
> +#define AsmRdRand  AsmRdRand64
> +#else
> +#define AsmRdRand  AsmRdRand32
> +#endif
> +
> +/**
> +  Tests RDRAND for broken implementations.
> +
> +  @retval TRUE RDRAND is reliable (and hopefully safe).
> +  @retval FALSERDRAND is unreliable and should be disabled,
> despite CPUID.
> +
> +**/
> +STATIC
> +BOOLEAN
> +TestRdRand (
> +  VOID
> +  )
> +{
> +  //
> +  // Test for notoriously broken rdrand implementations that always
return
> the same
> +  // value, like the Zen 3 uarch (all-1s) or other several AMD families
on
> suspend/resume (also all-1s).
> +  // Note that this should be expanded to extensively test for other
sorts of
> possible errata.
> +  //
> +
> +  //
> +  // Our algorithm samples rdrand $RDRAND_TEST_SAMPLES times and
> expects
> +  // a different result $RDRAND_MIN_CHANGE times for reliable RDRAND
> usage.
> +  //
> +  UINTN   Prev;
> +  UINT8   Idx;
> +  UINT8   TestIteration;
> +  UINT32  Changed;
> +
> +  Changed = 0;
> +
> +  for (TestIteration = 0; TestIteration < RDRAND_TEST_SAMPLES;
> TestIteration++) {
> +UINTN  Sample;
> +//
> +// Note: We use a retry loop for rdrand. Normal users get this in
> BaseRng.c
> +// Any failure to get a random number will assume RDRAND does not
> work.
> +//
> +for (Idx = 0; Idx < RDRAND_RETRIES; Idx++) {
> +  if (AsmRdRand ()) {
> +break;
> +  }
> +}
> +
> +if (Idx == RDRAND_RETRIES) {
> +  DEBUG ((DEBUG_ERROR, "BaseRngLib/x86: CPU BUG: Failed to get
> an RDRAND random number - disabling\n"));
> +  return FALSE;
> +}
> +
> +if (TestIteration != 0) {
> +  Changed += Sample != Prev;
> +}
> +
> +Prev = Sample;
> +  }
> +
> +  if (Changed < RDRAND_MIN_CHANGE) {
> +DEBUG ((DEBUG_ERROR, "BaseRngLib/x86: CPU BUG: RDRAND not
> reliable - disabling\n"));
> +return FALSE;
> +  }
> +
> +  return TRUE;
> +}
> +
> +#undef AsmRdRand
> +
>  /**
>The constructor function checks whether or not RDRAND instruction is
> supported
>by the host hardware.
> @@ -46,10 +129,13 @@ BaseRngLibConstructor (
>// CPUID. A value of 1 indicates that processor support RDRAND
> instruction.
>//
>AsmCpuid (1, 0, 0, , 0);
> -  ASSERT ((RegEcx & RDRAND_MASK) == RDRAND_MASK);
> 
>mRdRandSupported = 

Re: [edk2-devel] [edk2-platform][PATCH V2 1/1] MdeModulePkg: SdMmcPciHcDxe: Fix issue that SD1.0 cards can't be recognized

2022-12-06 Thread Wu, Hao A
Sorry,

The proposed patch still causes CI test failure: 
https://github.com/tianocore/edk2/pull/3724.

Could you help to follow steps 10 and 11 in the below wiki page:
https://github.com/tianocore/tianocore.github.io/wiki/EDK-II-Development-Process#the-developer-process-for-the-edk-ii-project
to make sure the patch can pass the CI test? Thanks in advance.

Also, for below added code:
  ZeroMem (SwitchResp, 64 * sizeof (SwitchResp));
My take is that it will zero memories beyond the scope of local variable 
'SwitchResp', could you help to double check on this?

Best Regards,
Hao Wu

> -Original Message-
> From: Chevron Li 
> Sent: Tuesday, December 6, 2022 8:53 PM
> To: devel@edk2.groups.io
> Cc: Wu, Hao A ; Ni, Ray ; Wang,
> Jian J ; Gao, Liming ;
> shirley@bayhubtech.com; shaper@bayhubtech.com;
> xiaoguang...@bayhubtech.com; Chevron Li (WH)
> 
> Subject: [edk2-platform][PATCH V2 1/1] MdeModulePkg: SdMmcPciHcDxe:
> Fix issue that SD1.0 cards can't be recognized
> 
> From: "Chevron Li (WH)" 
> 
> 
> SD1.0 cards don't support CMD8 and CMD6
> 
> CMD8 result can be used to distinguish the card is SD1.0 or not.
> 
> CMD8 result can be used to decide following CMD6 is sent or skip.
> 
> 
> 
> Cc: Hao A Wu 
> 
> Cc: Ray Ni 
> 
> Cc: Jian J Wang 
> 
> Cc: Liming Gao 
> 
> Signed-off-by: Chevron Li 
> 
> ---
> 
> Changes in V2:
> 
> 1.Update description comment for input parameter 'SdVersion1'.
> 
> 2.Add variables initialize operation to avoid unexpected value.
> 
> 3.Use TRUE replace with 1 to assign value for BOOLEAN variable.
> 
> ---
> 
>  MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdDevice.c | 34 +--
> 
> 
>  1 file changed, 24 insertions(+), 10 deletions(-)
> 
> 
> 
> diff --git a/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdDevice.c
> b/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdDevice.c
> 
> index f5a3607e47..262f675ea2 100644
> 
> --- a/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdDevice.c
> 
> +++ b/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdDevice.c
> 
> @@ -1074,6 +1074,7 @@ SdGetTargetBusMode (
> 
>@param[in] Slot   The slot number of the SD card to send the
> command to.
> 
>@param[in] RcaThe relative device address to be assigned.
> 
>@param[in] S18A   The boolean to show if it's a UHS-I SD card.
> 
> +  @param[in] SdVersion1 The boolean to show if it's a Version 1 SD card.
> 
> 
> 
>@retval EFI_SUCCESS   The operation is done correctly.
> 
>@retval OthersThe operation fails.
> 
> @@ -1085,7 +1086,8 @@ SdCardSetBusMode (
> 
>IN EFI_SD_MMC_PASS_THRU_PROTOCOL  *PassThru,
> 
>IN UINT8  Slot,
> 
>IN UINT16 Rca,
> 
> -  IN BOOLEANS18A
> 
> +  IN BOOLEANS18A,
> 
> +  IN BOOLEANSdVersion1
> 
>)
> 
>  {
> 
>EFI_STATUS  Status;
> 
> @@ -1095,6 +1097,8 @@ SdCardSetBusMode (
> 
>SD_MMC_HC_PRIVATE_DATA  *Private;
> 
>SD_MMC_BUS_SETTINGS BusMode;
> 
> 
> 
> +  ZeroMem (SwitchResp, 64 * sizeof (SwitchResp));
> 
> +
> 
>Private = SD_MMC_HC_PRIVATE_FROM_THIS (PassThru);
> 
> 
> 
>Capability = >Capability[Slot];
> 
> @@ -1117,10 +1121,13 @@ SdCardSetBusMode (
> 
> 
> 
>//
> 
>// Get the supported bus speed from SWITCH cmd return data group #1.
> 
> +  // SdVersion1 don't support the SWITCH cmd
> 
>//
> 
> -  Status = SdCardSwitch (PassThru, Slot, 0xFF, 0xF, SdDriverStrengthIgnore,
> 0xF, FALSE, SwitchResp);
> 
> -  if (EFI_ERROR (Status)) {
> 
> -return Status;
> 
> +  if(SdVersion1 == FALSE) {
> 
> +Status = SdCardSwitch (PassThru, Slot, 0xFF, 0xF, SdDriverStrengthIgnore,
> 0xF, FALSE, SwitchResp);
> 
> +if (EFI_ERROR (Status)) {
> 
> +  return Status;
> 
> +}
> 
>}
> 
> 
> 
>SdGetTargetBusMode (Private, Slot, SwitchResp, S18A, );
> 
> @@ -1141,9 +1148,14 @@ SdCardSetBusMode (
> 
>  }
> 
>}
> 
> 
> 
> -  Status = SdCardSwitch (PassThru, Slot, BusMode.BusTiming, 0xF,
> BusMode.DriverStrength.Sd, 0xF, TRUE, SwitchResp);
> 
> -  if (EFI_ERROR (Status)) {
> 
> -return Status;
> 
> +  //
> 
> +  // SdVersion1 don't support the SWITCH cmd
> 
> +  //
> 
> +  if(SdVersion1 == FALSE){
> 
> +Status = SdCardSwitch (PassThru, Slot, BusMode.BusTiming, 0xF,
> BusMode.DriverStrength.Sd, 0xF, TRUE, SwitchResp);
> 
> +if (EFI_ERROR (Status)) {
> 
> +  return Status;
> 
> +}
> 
>}
> 
> 
> 
>Status = SdMmcSetDriverStrength (Private->PciIo, Slot,
> BusMode.DriverStrength.Sd);
> 
> @@ -1214,8 +1226,10 @@ SdCardIdentification (
> 
>UINT8  HostCtrl2;
> 
>UINTN  Retry;
> 
>BOOLEANForceVoltage33;
> 
> +  BOOLEANSdVersion1;
> 
> 
> 
>ForceVoltage33 = FALSE;
> 
> +  SdVersion1 = FALSE;
> 
> 
> 
>PciIo= Private->PciIo;
> 
>PassThru = >PassThru;
> 
> @@ -1231,12 +1245,12 @@ Voltage33Retry:
> 
>}
> 
> 
> 
>

回复: [edk2-devel] [PATCH 1/1] MdePkg: Fix typo of EFI_INVALID_PARAMETER in Protocol/UsbIo.h

2022-12-06 Thread gaoliming via groups.io
Reviewed-by: Liming Gao 

> -邮件原件-
> 发件人: devel@edk2.groups.io  代表 Rebecca Cran
> 发送时间: 2022年11月29日 20:27
> 收件人: devel@edk2.groups.io; Michael D Kinney
> ; Liming Gao ;
> Zhiguang Liu 
> 抄送: Rebecca Cran 
> 主题: [edk2-devel] [PATCH 1/1] MdePkg: Fix typo of
> EFI_INVALID_PARAMETER in Protocol/UsbIo.h
> 
> Fix typo of EFI_INVALID_PARAMETER in Protocol/UsbIo.h by adding a
> missing 'R'.
> 
> Signed-off-by: Rebecca Cran 
> ---
>  MdePkg/Include/Protocol/UsbIo.h | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/MdePkg/Include/Protocol/UsbIo.h
> b/MdePkg/Include/Protocol/UsbIo.h
> index 4816b9039e7e..a780b4e07b44 100644
> --- a/MdePkg/Include/Protocol/UsbIo.h
> +++ b/MdePkg/Include/Protocol/UsbIo.h
> @@ -105,7 +105,7 @@ EFI_STATUS
> 
>@retval EFI_SUCCESS   The control transfer has been
> successfully executed.
>@retval EFI_DEVICE_ERROR  The transfer failed. The transfer
> status is returned in Status.
> -  @retval EFI_INVALID_PARAMETE  One or more parameters are invalid.
> +  @retval EFI_INVALID_PARAMETER One or more parameters are invalid.
>@retval EFI_OUT_OF_RESOURCES  The request could not be completed
> due to a lack of resources.
>@retval EFI_TIMEOUT   The control transfer fails due to
> timeout.
> 
> @@ -148,7 +148,7 @@ EFI_STATUS
> 
>@retval EFI_SUCCESS   The bulk transfer has been
> successfully executed.
>@retval EFI_DEVICE_ERROR  The transfer failed. The transfer
> status is returned in Status.
> -  @retval EFI_INVALID_PARAMETE  One or more parameters are invalid.
> +  @retval EFI_INVALID_PARAMETER One or more parameters are invalid.
>@retval EFI_OUT_OF_RESOURCES  The request could not be submitted
> due to a lack of resources.
>@retval EFI_TIMEOUT   The control transfer fails due to
> timeout.
> 
> --
> 2.30.2
> 
> 
> 
> 
> 





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




回复: [edk2-devel] [PATCH 1/1] MdePkg: Fix typos and spacing in Library/PerformanceLib.h

2022-12-06 Thread gaoliming via groups.io
Reviewed-by: Liming Gao 

> -邮件原件-
> 发件人: devel@edk2.groups.io  代表 Rebecca Cran
> 发送时间: 2022年11月29日 20:23
> 收件人: devel@edk2.groups.io; Michael D Kinney
> ; Liming Gao ;
> Zhiguang Liu 
> 抄送: Rebecca Cran 
> 主题: [edk2-devel] [PATCH 1/1] MdePkg: Fix typos and spacing in
> Library/PerformanceLib.h
> 
> - Fix typos of "disable".
> - Fix typos of "performance".
> - Fix missing spaces.
> - Use comma instead of period when the sentence continues on the next
>   line.
> - Fix typo of "PERF_CORE_LOAD_IMAGE".
> 
> Signed-off-by: Rebecca Cran 
> ---
>  MdePkg/Include/Library/PerformanceLib.h | 62 ++--
>  1 file changed, 31 insertions(+), 31 deletions(-)
> 
> diff --git a/MdePkg/Include/Library/PerformanceLib.h
> b/MdePkg/Include/Library/PerformanceLib.h
> index 711e3fc06f4e..34ec956b9c0e 100644
> --- a/MdePkg/Include/Library/PerformanceLib.h
> +++ b/MdePkg/Include/Library/PerformanceLib.h
> @@ -352,7 +352,7 @@ LogPerformanceMeasurement (
>Begin Macro to measure the performance of StartImage in core.
> 
>If the PERFORMANCE_LIBRARY_PROPERTY_MEASUREMENT_ENABLED
> bit of PcdPerformanceLibraryPropertyMask is set,
> -  and the BIT1(dsiable PERF_CORE_START_IMAGE) of
> PcdPerformanceLibraryPropertyMask is not set.
> +  and the BIT1 (disable PERF_CORE_START_IMAGE) of
> PcdPerformanceLibraryPropertyMask is not set,
>then LogPerformanceMeasurement() is called.
> 
>  **/
> @@ -367,7 +367,7 @@ LogPerformanceMeasurement (
>End Macro to measure the performance of StartImage in core.
> 
>If the PERFORMANCE_LIBRARY_PROPERTY_MEASUREMENT_ENABLED
> bit of PcdPerformanceLibraryPropertyMask is set,
> -  and the BIT1 (dsiable PERF_CORE_START_IMAGE)of
> PcdPerformanceLibraryPropertyMask is not set.
> +  and the BIT1 (disable PERF_CORE_START_IMAGE) of
> PcdPerformanceLibraryPropertyMask is not set,
>then LogPerformanceMeasurement() is called.
> 
>  **/
> @@ -382,7 +382,7 @@ LogPerformanceMeasurement (
>Begin Macro to measure the performance of LoadImage in core.
> 
>If the PERFORMANCE_LIBRARY_PROPERTY_MEASUREMENT_ENABLED
> bit of PcdPerformanceLibraryPropertyMask is set,
> -  and the BIT2 (dsiable PERF_CORE_LOAD_IAMGE) of
> PcdPerformanceLibraryPropertyMask is not set.
> +  and the BIT2 (disable PERF_CORE_LOAD_IMAGE) of
> PcdPerformanceLibraryPropertyMask is not set,
>then LogPerformanceMeasurement() is called.
> 
>  **/
> @@ -397,7 +397,7 @@ LogPerformanceMeasurement (
>End Macro to measure the performance of LoadImage in core.
> 
>If the PERFORMANCE_LIBRARY_PROPERTY_MEASUREMENT_ENABLED
> bit of PcdPerformanceLibraryPropertyMask is set,
> -  and the BIT2 (dsiable PERF_CORE_LOAD_IAMGE) of
> PcdPerformanceLibraryPropertyMask is not set.
> +  and the BIT2 (disable PERF_CORE_LOAD_IMAGE) of
> PcdPerformanceLibraryPropertyMask is not set,
>then LogPerformanceMeasurement() is called.
> 
>  **/
> @@ -412,7 +412,7 @@ LogPerformanceMeasurement (
>Start Macro to measure the performance of DriverBinding Support in
core.
> 
>If the PERFORMANCE_LIBRARY_PROPERTY_MEASUREMENT_ENABLED
> bit of PcdPerformanceLibraryPropertyMask is set,
> -  and the BIT3 (dsiable PERF_CORE_DB_SUPPORT) of
> PcdPerformanceLibraryPropertyMask is not set.
> +  and the BIT3 (disable PERF_CORE_DB_SUPPORT) of
> PcdPerformanceLibraryPropertyMask is not set,
>then LogPerformanceMeasurement() is called.
> 
>  **/
> @@ -427,7 +427,7 @@ LogPerformanceMeasurement (
>End Macro to measure the performance of DriverBinding Support in core.
> 
>If the PERFORMANCE_LIBRARY_PROPERTY_MEASUREMENT_ENABLED
> bit of PcdPerformanceLibraryPropertyMask is set,
> -  and the BIT3 (dsiable PERF_CORE_DB_SUPPORT) of
> PcdPerformanceLibraryPropertyMask is not set.
> +  and the BIT3 (disable PERF_CORE_DB_SUPPORT) of
> PcdPerformanceLibraryPropertyMask is not set,
>then LogPerformanceMeasurement() is called.
> 
>  **/
> @@ -442,7 +442,7 @@ LogPerformanceMeasurement (
>Begin Macro to measure the performance of DriverBinding Start in core.
> 
>If the PERFORMANCE_LIBRARY_PROPERTY_MEASUREMENT_ENABLED
> bit of PcdPerformanceLibraryPropertyMask is set,
> -  and the BIT4 (dsiable PERF_CORE_DB_START) of
> PcdPerformanceLibraryPropertyMask is not set.
> +  and the BIT4 (disable PERF_CORE_DB_START) of
> PcdPerformanceLibraryPropertyMask is not set,
>then LogPerformanceMeasurement() is called.
> 
>  **/
> @@ -457,7 +457,7 @@ LogPerformanceMeasurement (
>End Macro to measure the performance of DriverBinding Start in core.
> 
>If the PERFORMANCE_LIBRARY_PROPERTY_MEASUREMENT_ENABLED
> bit of PcdPerformanceLibraryPropertyMask is set,
> -  and the BIT4 (dsiable PERF_CORE_DB_START) of
> PcdPerformanceLibraryPropertyMask is not set.
> +  and the BIT4 (disable PERF_CORE_DB_START) of
> PcdPerformanceLibraryPropertyMask is not set,
>then LogPerformanceMeasurement() is called.
> 
>  **/
> @@ -472,7 +472,7 @@ LogPerformanceMeasurement (
>Start Macro to measure the performance of DriverBinding Stop in core.
> 
>   

[edk2-devel] [PATCH v2] MdePkg/UnitTestHostBaseLib: Remove HOST_APPLICATION limitation

2022-12-06 Thread Zhiguang Liu
Remove HOST_APPLICATION limitation for UnitTestHostBaseLib, so that
this library can be used as BaseLib by Emulator.
Also, add some missing files

Cc: Michael D Kinney 
Cc: Liming Gao 
Signed-off-by: Ray Ni 
Signed-off-by: Zhiguang Liu 
---
 MdePkg/Library/BaseLib/UnitTestHostBaseLib.inf | 9 ++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/MdePkg/Library/BaseLib/UnitTestHostBaseLib.inf 
b/MdePkg/Library/BaseLib/UnitTestHostBaseLib.inf
index 09a610c31c..12a5cdcc0a 100644
--- a/MdePkg/Library/BaseLib/UnitTestHostBaseLib.inf
+++ b/MdePkg/Library/BaseLib/UnitTestHostBaseLib.inf
@@ -1,7 +1,8 @@
 ## @file
-#  Base Library implementation for use with host based unit tests.
+#  Base Library implementation for use with host based unit tests, and
+#  can also be used by emulation platforms such as EmulatorPkg.
 #
-#  Copyright (c) 2007 - 2021, Intel Corporation. All rights reserved.
+#  Copyright (c) 2007 - 2022, Intel Corporation. All rights reserved.
 #  Portions copyright (c) 2008 - 2009, Apple Inc. All rights reserved.
 #  Portions copyright (c) 2011 - 2013, ARM Ltd. All rights reserved.
 #  Copyright (c) 2020, Hewlett Packard Enterprise Development LP. All rights 
reserved.
@@ -18,7 +19,7 @@
   FILE_GUID  = 9555A0D3-09BA-46C4-A51A-45198E3C765E
   MODULE_TYPE= BASE
   VERSION_STRING = 1.1
-  LIBRARY_CLASS  = BaseLib|HOST_APPLICATION
+  LIBRARY_CLASS  = BaseLib
   LIBRARY_CLASS  = UnitTestHostBaseLib|HOST_APPLICATION
 
 #
@@ -128,6 +129,7 @@
   X86RdRand.c
   X86SpeculationBarrier.c
   X86UnitTestHost.c
+  IntelTdxNull.c
 
 [Sources.X64]
   X64/LongJump.nasm
@@ -168,6 +170,7 @@
   X64/RdRand.nasm
   ChkStkGcc.c  | GCC
   X86UnitTestHost.c
+  IntelTdxNull.c
 
 [Sources.EBC]
   Ebc/CpuBreakpoint.c
-- 
2.31.1.windows.1



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




回复: [edk2-devel] [PATCH v7 2/2] tools_def: add -fno-omit-frame-pointer to GCC48_{IA32,X64}_CC_FLAGS

2022-12-06 Thread gaoliming via groups.io
Gerd:
  I have no comments for this change. Acked-by: Liming Gao 


Thanks
Liming
> -邮件原件-
> 发件人: devel@edk2.groups.io  代表 Brian J.
> Johnson
> 发送时间: 2022年12月2日 0:18
> 收件人: devel@edk2.groups.io; kra...@redhat.com
> 抄送: Alexey Kardashevskiy ; Liming Gao
> ; Erdem Aktas ;
> Pawel Polawski ; Jordan Justen
> ; Ard Biesheuvel ;
> Yuwei Chen ; Tom Lendacky
> ; James Bottomley ;
> Oliver Steffen ; Jiewen Yao ;
> Min Xu ; Brijesh Singh ; Bob
> Feng 
> 主题: Re: [edk2-devel] [PATCH v7 2/2] tools_def: add
> -fno-omit-frame-pointer to GCC48_{IA32,X64}_CC_FLAGS
> 
> OK.  Doesn't look like a big impact.
> 
> Thanks,
> Brian J. Johnson
>  Original Message 
> From: Gerd Hoffmann [mailto:kra...@redhat.com]
> Sent: Thursday, December 1, 2022 at 2:38 AM
> To: Brian J. Johnson 
> Cc: devel@edk2.groups.io, Alexey Kardashevskiy , Liming
> Gao , Erdem Aktas ,
> Pawel Polawski , Jordan Justen
> , Ard Biesheuvel ,
> Yuwei Chen , Tom Lendacky
> , James Bottomley ,
> Oliver
> Steffen , Jiewen Yao , Min Xu
> , Brijesh Singh , Bob Feng
> 
> Subject: [edk2-devel] [PATCH v7 2/2] tools_def: add
> -fno-omit-frame-pointer to GCC48_{IA32,X64}_CC_FLAGS
> 
> On Wed, Nov 30, 2022 at 01:28:42PM -0600, Brian J. Johnson wrote:
> > Gerd,
> >
> > Sorry, gotta ask:  does this make much difference in the size of the
> > compiled code?  That's a constraint on many real-hardware X64 platforms,
> > especially for 32-bit code.
> 
> Quick test with OvmfPkg/OvmfPkgIa32X64.dsc (sec/pei ia32, dxe x64):
> 
> master branch:
> 
> FV Space Information
> SECFV [11%Full] 212992 (0x34000) total, 23728 (0x5cb0) used, 189264
> (0x2e350) free
> PEIFV [34%Full] 917504 (0xe) total, 319416 (0x4dfb8) used, 598088
> (0x92048) free
> DXEFV [49%Full] 12582912 (0xc0) total, 6268032 (0x5fa480) used,
> 6314880 (0x605b80) free
> FVMAIN_COMPACT [98%Full] 1753088 (0x1ac000) total, 1725328 (0x1a5390)
> used, 27760 (0x6c70) free
> 
> with patch applied:
> 
> FV Space Information
> SECFV [11%Full] 212992 (0x34000) total, 23728 (0x5cb0) used, 189264
> (0x2e350) free
> PEIFV [34%Full] 917504 (0xe) total, 319416 (0x4dfb8) used, 598088
> (0x92048) free
> DXEFV [50%Full] 12582912 (0xc0) total, 6335936 (0x60adc0) used,
> 6246976 (0x5f5240) free
> FVMAIN_COMPACT [99%Full] 1753088 (0x1ac000) total, 1738176 (0x1a85c0)
> used, 14912 (0x3a40) free
> 
> So slightly more for 64-bit code.
> 
> take care,
> Gerd
> 
> 
> 
> 
> 
> 
> 
> 
> 





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




回复: [edk2-devel] [PATCH v7 1/2] tools_def: remove GCC_IA32_CC_FLAGS/GCC_X64_CC_FLAGS

2022-12-06 Thread gaoliming via groups.io
Reviewed-by: Liming Gao 

> -邮件原件-
> 发件人: devel@edk2.groups.io  代表 Gerd
> Hoffmann
> 发送时间: 2022年11月30日 17:44
> 收件人: devel@edk2.groups.io
> 抄送: Alexey Kardashevskiy ; Liming Gao
> ; Erdem Aktas ;
> Pawel Polawski ; Jordan Justen
> ; Ard Biesheuvel ;
> Yuwei Chen ; Tom Lendacky
> ; James Bottomley ;
> Gerd Hoffmann ; Oliver Steffen ;
> Jiewen Yao ; Min Xu ; Brijesh
> Singh ; Bob Feng 
> 主题: [edk2-devel] [PATCH v7 1/2] tools_def: remove
> GCC_IA32_CC_FLAGS/GCC_X64_CC_FLAGS
> 
> They are not used anywhere.  Remove them.
> 
> Signed-off-by: Gerd Hoffmann 
> ---
>  BaseTools/Conf/tools_def.template | 2 --
>  1 file changed, 2 deletions(-)
> 
> diff --git a/BaseTools/Conf/tools_def.template
> b/BaseTools/Conf/tools_def.template
> index c4e4c7ded0af..73f95b2a3a9f 100755
> --- a/BaseTools/Conf/tools_def.template
> +++ b/BaseTools/Conf/tools_def.template
> @@ -1850,8 +1850,6 @@ NOOPT_*_*_OBJCOPY_ADDDEBUGFLAG =
> --add-gnu-debuglink=$(DEBUG_DIR)/$(MODULE_N
>  *_*_*_DTC_PATH = DEF(DTC_BIN)
> 
>  DEFINE GCC_ALL_CC_FLAGS= -g -Os -fshort-wchar
> -fno-builtin -fno-strict-aliasing -Wall -Werror -Wno-array-bounds -include
> AutoGen.h -fno-common
> -DEFINE GCC_IA32_CC_FLAGS   = DEF(GCC_ALL_CC_FLAGS) -m32
> -malign-double -freorder-blocks -freorder-blocks-and-partition -O2
> -mno-stack-arg-probe
> -DEFINE GCC_X64_CC_FLAGS= DEF(GCC_ALL_CC_FLAGS)
> -mno-red-zone -Wno-address -mno-stack-arg-probe
>  DEFINE GCC_ARM_CC_FLAGS= DEF(GCC_ALL_CC_FLAGS)
> -mlittle-endian -mabi=aapcs -fno-short-enums -funsigned-char
> -ffunction-sections -fdata-sections -fomit-frame-pointer -Wno-address
> -mthumb -mfloat-abi=soft -fno-pic -fno-pie
>  DEFINE GCC_LOONGARCH64_CC_FLAGS= DEF(GCC_ALL_CC_FLAGS)
> -mabi=lp64d -fno-asynchronous-unwind-tables -fno-plt -Wno-address
> -fno-short-enums -fsigned-char -ffunction-sections -fdata-sections
>  DEFINE GCC_ARM_CC_XIPFLAGS = -mno-unaligned-access
> --
> 2.38.1
> 
> 
> 
> 
> 





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




回复: [edk2-devel] [PATCH v2 4/4] MdePkg: Signal AfterReadyToBoot after ReadyToBoot

2022-12-06 Thread gaoliming via groups.io
Dionna:
  I add my comments below. 

> -邮件原件-
> 发件人: devel@edk2.groups.io  代表 Dionna Glaze
> via groups.io
> 发送时间: 2022年11月9日 5:16
> 收件人: devel@edk2.groups.io
> 抄送: Dionna Glaze ; Michael D Kinney
> ; Ard Biesheuvel ; Gerd
> Hoffman ; Jiewen Yao 
> 主题: [edk2-devel] [PATCH v2 4/4] MdePkg: Signal AfterReadyToBoot after
> ReadyToBoot
> 
> The Uefi v2.9 specification adds this event group in section 3.1.7,
> with its GUID defined in the Related Definitions section of
> EFI_BOOT_SERVICES.CreateEventEx() in chapter 7.
> 
> Cc: "Michael D Kinney" 
> Cc: Ard Biesheuvel 
> Cc: Gerd Hoffman 
> Cc: Jiewen Yao 
> 
> Signed-off-by: Dionna Glaze 
> ---
>  MdePkg/Include/Library/UefiLib.h  |  2 ++
>  MdePkg/Library/UefiLib/UefiLib.inf|  1 +
>  MdePkg/Library/UefiLib/UefiNotTiano.c | 18 ++
>  3 files changed, 21 insertions(+)
> 
> diff --git a/MdePkg/Include/Library/UefiLib.h
> b/MdePkg/Include/Library/UefiLib.h
> index be7da7fdf7..2c3342351e 100644
> --- a/MdePkg/Include/Library/UefiLib.h
> +++ b/MdePkg/Include/Library/UefiLib.h
> @@ -890,6 +890,8 @@ UnicodeStringDisplayLength (
>  /**
>Create, Signal, and Close the Ready to Boot event using
> EfiSignalEventReadyToBoot().
> 
> +  If successful, then create, signal and close the After Ready to Boot event.
> +
>This function abstracts the signaling of the Ready to Boot Event. The
> Framework moved
>from a proprietary to UEFI 2.0 based mechanism. This library abstracts
> the caller
>from how this event is created to prevent to code form having to change
> with the
> diff --git a/MdePkg/Library/UefiLib/UefiLib.inf
> b/MdePkg/Library/UefiLib/UefiLib.inf
> index 01ed92092d..5c4064eafa 100644
> --- a/MdePkg/Library/UefiLib/UefiLib.inf
> +++ b/MdePkg/Library/UefiLib/UefiLib.inf
> @@ -60,6 +60,7 @@
>gEfiGlobalVariableGuid##
> SOMETIMES_CONSUMES  ## Variable
>gEfiAcpi20TableGuid   ##
> SOMETIMES_CONSUMES  ## SystemTable
>gEfiAcpi10TableGuid   ##
> SOMETIMES_CONSUMES  ## SystemTable
> +  gEfiEventAfterReadyToBootGuid ##
> SOMETIMES_CONSUMES  ## Event
> 
>  [Protocols]
>gEfiDriverBindingProtocolGuid   ##
> SOMETIMES_PRODUCES
> diff --git a/MdePkg/Library/UefiLib/UefiNotTiano.c
> b/MdePkg/Library/UefiLib/UefiNotTiano.c
> index d84e91fd01..04fe42f9f7 100644
> --- a/MdePkg/Library/UefiLib/UefiNotTiano.c
> +++ b/MdePkg/Library/UefiLib/UefiNotTiano.c
> @@ -208,6 +208,8 @@ EfiCreateEventReadyToBootEx (
>  /**
>Create, Signal, and Close the Ready to Boot event using
> EfiSignalEventReadyToBoot().
> 
> +  If successful, then create, signal and close the After Ready to Boot event.
> +
>This function abstracts the signaling of the Ready to Boot Event. The
> Framework moved
>from a proprietary to UEFI 2.0 based mechanism. This library abstracts
> the caller
>from how this event is created to prevent to code form having to change
> with the
> @@ -222,11 +224,27 @@ EfiSignalEventReadyToBoot (
>  {
>EFI_STATUS  Status;
>EFI_EVENT   ReadyToBootEvent;
> +  EFI_EVENT   AfterReadyToBootEvent;
> 
>Status = EfiCreateEventReadyToBoot ();
>if (!EFI_ERROR (Status)) {
>  gBS->SignalEvent (ReadyToBootEvent);
>  gBS->CloseEvent (ReadyToBootEvent);
> +return;
> +  }
> +
Return should not be here. This means ReadyToBoot event creates successfully 
and return.
But, the behavior should be ReadyToBoot and AfterReadyToBoot event both trig.

Thanks
Liming
> +  /* Then immediately signal the after ready to boot event group */
> +  Status = gBS->CreateEventEx (
> +  EVT_NOTIFY_SIGNAL,
> +  TPL_CALLBACK,
> +  EfiEventEmptyFunction,
> +  NULL,
> +  ,
> +  AfterReadyToBootEvent
> +  );
> +  if (!EFI_ERROR(Status)) {
> +gBS->SignalEvent (AfterReadyToBootEvent);
> +gBS->CloseEvent (AfterReadyToBootEvent);
>}
>  }
> 
> --
> 2.38.1.431.g37b22c650d-goog
> 
> 
> 
> 
> 





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




Re: [edk2-devel] feature flag change notifications

2022-12-06 Thread dann frazier
Hi Liming,

  Thank you, that is appreciated. Going forward I'll let you know if I
trip over any not already documented.

  -dann

On Tue, Dec 6, 2022 at 5:59 PM gaoliming via groups.io
 wrote:
>
> Dann:
>   I base on new features to collect the incompatible changes, and add them 
> into the updated notes.
>
>   If you find any missing, please send the mail to me.
>
> Thanks
> Liming
> > -邮件原件-
> > 发件人: Kinney, Michael D 
> > 发送时间: 2022年12月6日 9:22
> > 收件人: devel@edk2.groups.io; dann.fraz...@canonical.com; Gao, Liming
> > 
> > 主题: RE: [edk2-devel] feature flag change notifications
> >
> > Hi Dann,
> >
> > These are reasonable requests.
> >
> > Adding Liming Gao who is currently responsible for the edk2 releases.
> >
> > Let's start with release notes and see if some of these can be added
> > to the release documentation and add to the edk2 release process
> > to clearly note these type of changes in future release notes.
> >
> > As far as #error and #warn.  Those are possible, but we would need
> > to do some analysis for the types of changes that would require
> > that behavior.  Your examples are useful as a starting point.
> >
> > Once concern is how many of those #error/#warn conditions will
> > build up over time and then a process to remove them after an
> > expiration period.
> >
> > Mike
> >
> > > -Original Message-
> > > From: devel@edk2.groups.io  On Behalf Of dann
> > frazier
> > > Sent: Monday, December 5, 2022 4:10 PM
> > > To: devel@edk2.groups.io
> > > Subject: [edk2-devel] feature flag change notifications
> > >
> > > Hi,
> > >   I maintain the edk2 packages in the Debian and Ubuntu
> > > distributions. A few times over the years I've had users report
> > > regressions that turned out to be due to upstream build flag
> > > changes. I wonder if it would be possible for upstream to communicate
> > > such changes - either via release notes or, where possible, as
> > > build-time checks - to us downstream projects. Here are the examples I
> > > recall:
> > >
> > > > commit 4de8d61bcec02a13ceed84f92b0cf3ea58adf9c5
> > > > Author: Gerd Hoffmann 
> > > > Date:   Wed Dec 15 12:39:20 2021 +0100
> > > >
> > > > OvmfPkg: rework TPM configuration
> > > >
> > >
> > > For this I needed to change -DTPM_ENABLE=TRUE to
> > -DTPM2_ENABLE=TRUE. I
> > > feel like a build-time check would've been a good way to communicate
> > > this one, e.g.:
> > >
> > > #ifdef TPM_ENABLE
> > > #error TPM_ENABLE has been renamed to TPM2_ENABLE
> > > #endif
> > >
> > > > commit 1631bb26ae991e530d3c96fe3161ea15144b358e
> > > > Author: Gary Lin 
> > > > Date:   Mon Jun 10 14:55:09 2019 +0800
> > > >
> > > > OvmfPkg/README: Update the network build flags
> > > >
> > > > The following network build flags changed due to the inclusion of
> > > > NetworkPkg/Network.fdf.inc.
> > > >
> > > Similar to the above, I needed to deal with this by setting
> > > -DNETWORK_HTTP_BOOT_ENABLE=TRUE instead of
> > -DHTTP_BOOT_ENABLE=TRUE. It
> > > seems like maybe an #error on the removed #define could've helped
> > > here as well.
> > >
> > > And finally:
> > >
> > > > commit 57783adfb579da32b1eeda77b2bec028a5e0b7b3
> > > > Author: Michael D Kinney 
> > > > Date:   Tue Jul 26 12:40:00 2022 -0700
> > > >
> > > > OvmfPkg: Change default to disable MptScsi and PvScsi
> > >
> > > With this types of change, it would be useful just to know this is
> > > coming and why so I can decide to either notify users of the change
> > > and/or override the default to avoid the regression. Would it be
> > > possible to describe such changes in the release notes at
> > > https://github.com/tianocore/edk2/releases - and, if not urgent,
> > > perhaps #warn of deprecation in the source for one stable release
> > > cycle?
> > >
> > >   -dann
> > >
> > >
> > >
> > >
>
>
>
>
>
> 
>
>


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




Re: [edk2-devel] feature flag change notifications

2022-12-06 Thread dann frazier
Hi Mike,

  Thanks for the consideration. I think the release notes are a
sufficient starting point.

  -dann

On Mon, Dec 5, 2022 at 6:22 PM Kinney, Michael D
 wrote:
>
> Hi Dann,
>
> These are reasonable requests.
>
> Adding Liming Gao who is currently responsible for the edk2 releases.
>
> Let's start with release notes and see if some of these can be added
> to the release documentation and add to the edk2 release process
> to clearly note these type of changes in future release notes.
>
> As far as #error and #warn.  Those are possible, but we would need
> to do some analysis for the types of changes that would require
> that behavior.  Your examples are useful as a starting point.
>
> Once concern is how many of those #error/#warn conditions will
> build up over time and then a process to remove them after an
> expiration period.
>
> Mike
>
> > -Original Message-
> > From: devel@edk2.groups.io  On Behalf Of dann frazier
> > Sent: Monday, December 5, 2022 4:10 PM
> > To: devel@edk2.groups.io
> > Subject: [edk2-devel] feature flag change notifications
> >
> > Hi,
> >   I maintain the edk2 packages in the Debian and Ubuntu
> > distributions. A few times over the years I've had users report
> > regressions that turned out to be due to upstream build flag
> > changes. I wonder if it would be possible for upstream to communicate
> > such changes - either via release notes or, where possible, as
> > build-time checks - to us downstream projects. Here are the examples I
> > recall:
> >
> > > commit 4de8d61bcec02a13ceed84f92b0cf3ea58adf9c5
> > > Author: Gerd Hoffmann 
> > > Date:   Wed Dec 15 12:39:20 2021 +0100
> > >
> > > OvmfPkg: rework TPM configuration
> > >
> >
> > For this I needed to change -DTPM_ENABLE=TRUE to -DTPM2_ENABLE=TRUE. I
> > feel like a build-time check would've been a good way to communicate
> > this one, e.g.:
> >
> > #ifdef TPM_ENABLE
> > #error TPM_ENABLE has been renamed to TPM2_ENABLE
> > #endif
> >
> > > commit 1631bb26ae991e530d3c96fe3161ea15144b358e
> > > Author: Gary Lin 
> > > Date:   Mon Jun 10 14:55:09 2019 +0800
> > >
> > > OvmfPkg/README: Update the network build flags
> > >
> > > The following network build flags changed due to the inclusion of
> > > NetworkPkg/Network.fdf.inc.
> > >
> > Similar to the above, I needed to deal with this by setting
> > -DNETWORK_HTTP_BOOT_ENABLE=TRUE instead of -DHTTP_BOOT_ENABLE=TRUE. It
> > seems like maybe an #error on the removed #define could've helped
> > here as well.
> >
> > And finally:
> >
> > > commit 57783adfb579da32b1eeda77b2bec028a5e0b7b3
> > > Author: Michael D Kinney 
> > > Date:   Tue Jul 26 12:40:00 2022 -0700
> > >
> > > OvmfPkg: Change default to disable MptScsi and PvScsi
> >
> > With this types of change, it would be useful just to know this is
> > coming and why so I can decide to either notify users of the change
> > and/or override the default to avoid the regression. Would it be
> > possible to describe such changes in the release notes at
> > https://github.com/tianocore/edk2/releases - and, if not urgent,
> > perhaps #warn of deprecation in the source for one stable release
> > cycle?
> >
> >   -dann
> >
> >
> > 
> >
>


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




Re: [edk2-devel] [PATCH] MdePkg/UnitTestHostBaseLib: Remove HOST_APPLICATION limitation

2022-12-06 Thread Zhiguang Liu
Hi Liming,
Sure, I will update the patch

Thanks
Zhiguang

> -Original Message-
> From: devel@edk2.groups.io  On Behalf Of
> gaoliming via groups.io
> Sent: Wednesday, December 7, 2022 9:02 AM
> To: devel@edk2.groups.io; Liu, Zhiguang ; Ni, Ray
> 
> Cc: Kinney, Michael D 
> Subject: 回复: [edk2-devel] [PATCH] MdePkg/UnitTestHostBaseLib: Remove
> HOST_APPLICATION limitation
> 
> Zhiguang and Ray:
>   Thanks for your sharing. It is OK to use UnitTestHostBaseLib in emulator
> platform.
>   Please also update the file header in module inf to describe this usage.
> 
> Thanks
> Liming
> > -邮件原件-
> > 发件人: devel@edk2.groups.io  代表 Zhiguang Liu
> > 发送时间: 2022年12月5日 13:53
> > 收件人: Ni, Ray ; devel@edk2.groups.io; Gao, Liming
> > 
> > 抄送: Kinney, Michael D 
> > 主题: Re: [edk2-devel] [PATCH] MdePkg/UnitTestHostBaseLib: Remove
> > HOST_APPLICATION limitation
> >
> > Hi Liming,
> > Like ray said, we are trying to use some baselib function in
> > EmulatorPkg, which is assembly code in normal BaseLib, and is mocked
> > in UnitTestBaseLib, such as AsmWriteMsr64 and AsmCpuid.
> >
> > Thanks
> > Zhiguang
> >
> > > -Original Message-
> > > From: Ni, Ray 
> > > Sent: Monday, December 5, 2022 1:38 PM
> > > To: devel@edk2.groups.io; Gao, Liming ;
> > > Liu, Zhiguang 
> > > Cc: Kinney, Michael D 
> > > Subject: RE: [edk2-devel] [PATCH] MdePkg/UnitTestHostBaseLib:
> Remove
> > > HOST_APPLICATION limitation
> > >
> > > Liming,
> > > We are running some code that requires MSR access (e.g.: MtrrLib) in
> > > EmulatorPkg.
> > >
> > > Thanks,
> > > Ray
> > >
> > > > -Original Message-
> > > > From: devel@edk2.groups.io  On Behalf Of
> > > > gaoliming via groups.io
> > > > Sent: Friday, December 2, 2022 5:48 PM
> > > > To: devel@edk2.groups.io; Liu, Zhiguang 
> > > > Cc: Kinney, Michael D ; Ni, Ray
> > > > 
> > > > Subject: 回复: [edk2-devel] [PATCH] MdePkg/UnitTestHostBaseLib:
> > > Remove
> > > > HOST_APPLICATION limitation
> > > >
> > > > Zhiguang:
> > > >   Can you explain more about the emulator usage model for this library?
> > > >
> > > > Thanks
> > > > Liming
> > > > > -邮件原件-
> > > > > 发件人: devel@edk2.groups.io  代表
> > Zhiguang
> > > Liu
> > > > > 发送时间: 2022年12月2日 14:25
> > > > > 收件人: devel@edk2.groups.io
> > > > > 抄送: Zhiguang Liu ; Michael D Kinney
> > > > > ; Liming Gao
> > > ;
> > > > > Ray Ni 
> > > > > 主题: [edk2-devel] [PATCH] MdePkg/UnitTestHostBaseLib: Remove
> > > > > HOST_APPLICATION limitation
> > > > >
> > > > > Remove HOST_APPLICATION limitation for UnitTestHostBaseLib, so
> > > > > that this library can be used as BaseLib by Emulator.
> > > > > Also, add some missing files
> > > > >
> > > > > Cc: Michael D Kinney 
> > > > > Cc: Liming Gao 
> > > > > Signed-off-by: Ray Ni 
> > > > > ---
> > > > >  MdePkg/Library/BaseLib/UnitTestHostBaseLib.inf | 6 --
> > > > >  1 file changed, 4 insertions(+), 2 deletions(-)
> > > > >
> > > > > diff --git a/MdePkg/Library/BaseLib/UnitTestHostBaseLib.inf
> > > > > b/MdePkg/Library/BaseLib/UnitTestHostBaseLib.inf
> > > > > index 09a610c31c..fefa2e79f6 100644
> > > > > --- a/MdePkg/Library/BaseLib/UnitTestHostBaseLib.inf
> > > > > +++ b/MdePkg/Library/BaseLib/UnitTestHostBaseLib.inf
> > > > > @@ -1,7 +1,7 @@
> > > > >  ## @file
> > > > >  #  Base Library implementation for use with host based unit tests.
> > > > >  #
> > > > > -#  Copyright (c) 2007 - 2021, Intel Corporation. All rights
> > > > > reserved.
> > > > > +#  Copyright (c) 2007 - 2022, Intel Corporation. All rights
> > > > > +reserved.
> > > > >  #  Portions copyright (c) 2008 - 2009, Apple Inc. All rights
> > > > reserved.
> > > > >  #  Portions copyright (c) 2011 - 2013, ARM Ltd. All rights
> > > > > reserved.  #  Copyright (c) 2020, Hewlett Packard Enterprise
> > > > > Development LP. All rights reserved. @@ -18,7 +18,7 @@
> > > > >FILE_GUID  =
> > > > > 9555A0D3-09BA-46C4-A51A-45198E3C765E
> > > > >MODULE_TYPE= BASE
> > > > >VERSION_STRING = 1.1
> > > > > -  LIBRARY_CLASS  =
> > BaseLib|HOST_APPLICATION
> > > > > +  LIBRARY_CLASS  = BaseLib
> > > > >LIBRARY_CLASS  =
> > > > > UnitTestHostBaseLib|HOST_APPLICATION
> > > > >
> > > > >  #
> > > > > @@ -128,6 +128,7 @@
> > > > >X86RdRand.c
> > > > >X86SpeculationBarrier.c
> > > > >X86UnitTestHost.c
> > > > > +  IntelTdxNull.c
> > > > >
> > > > >  [Sources.X64]
> > > > >X64/LongJump.nasm
> > > > > @@ -168,6 +169,7 @@
> > > > >X64/RdRand.nasm
> > > > >ChkStkGcc.c  | GCC
> > > > >X86UnitTestHost.c
> > > > > +  IntelTdxNull.c
> > > > >
> > > > >  [Sources.EBC]
> > > > >Ebc/CpuBreakpoint.c
> > > > > --
> > > > > 2.31.1.windows.1
> > > > >
> > > > >
> > > > >
> > > > >
> > > > >
> > > >
> > > >
> > > >
> > > >
> > > >
> > > >
> > > >
> >
> >
> >
> >
> >
> 
> 
> 
> 
> 
> 
> 



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#97048): 

[edk2-devel] 回复: [edk2][PATCH 0/2] Add Events introduced in UEFI 2.9

2022-12-06 Thread gaoliming via groups.io
Robert:
  EFI_EVENT_GROUP_AFTER_READY_TO_BOOT should be trig in 
Edk2\MdeModulePkg\Library\UefiBootManagerLib like ReadyToBoot event. 

Thanks
Liming
> -邮件原件-
> 发件人: Kinney, Michael D 
> 发送时间: 2022年11月9日 6:45
> 收件人: devel@edk2.groups.io; rob...@ami.com; Kinney, Michael D
> 
> 抄送: Gao, Liming ; Liu, Zhiguang
> ; Bi, Dandan 
> 主题: RE: [edk2][PATCH 0/2] Add Events introduced in UEFI 2.9
> 
> Hi Robert,
> 
> I do not see the signal of the after exit boot services event.
> 
> Thanks,
> 
> Mike
> 
> > -Original Message-
> > From: devel@edk2.groups.io  On Behalf Of Robert
> Phelps via groups.io
> > Sent: Tuesday, November 8, 2022 12:28 PM
> > To: devel@edk2.groups.io
> > Cc: Kinney, Michael D ; Gao, Liming
> ; Liu, Zhiguang
> > ; Bi, Dandan 
> > Subject: [edk2-devel] [edk2][PATCH 0/2] Add Events introduced in UEFI 2.9
> >
> > The following patches contain the new definitions for new events that
> > were added in UEFI 2.9: Before Exit Boot Services and After Ready to
> > Boot.  The second patch adds the call to signal the Before Exit Boot
> > Services Event in DxeMain.c and the addition of the GUID in the INF
> > file DxeMain.inf.
> >
> >
> > Cc: Michael D Kinney  [mdkinney]
> > Cc: Liming Gao  [lgao4]
> > Cc: Zhiguang Liu  [LiuZhiguang001]
> > Cc: Dandan Bi  [dandanbi]
> > Signed-off-by: Robert Phelps 
> >
> > Robert Phelps (2):
> >   MdePkg: Add New Event Definitions from UEFI 2.9
> >   MdeModulePkg: Added call to signal New Event
> >
> >  MdeModulePkg/Core/Dxe/DxeMain.inf   |  1 +
> >  MdeModulePkg/Core/Dxe/DxeMain/DxeMain.c |  2 ++
> >  MdePkg/Include/Guid/EventGroup.h| 10 ++
> >  MdePkg/MdePkg.dec   |  6 ++
> >  4 files changed, 19 insertions(+)
> >
> > --
> > 2.36.1.windows.1
> > -The information contained in this message may be confidential and
> proprietary to American Megatrends (AMI). This communication
> > is intended to be read only by the individual or entity to whom it is
> addressed or by their designee. If the reader of this
> > message is not the intended recipient, you are on notice that any
> distribution of this message, in any form, is strictly
> > prohibited. Please promptly notify the sender by reply e-mail or by
> telephone at 770-246-8600, and then delete or destroy all
> > copies of the transmission.
> >
> >
> > 
> >





-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#97047): https://edk2.groups.io/g/devel/message/97047
Mute This Topic: https://groups.io/mt/95507245/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 1/1] MdeModulePkg: Put USB DEBUGs that occur for bulk timeouts under VERBOSE

2022-12-06 Thread Wu, Hao A
Reviewed-by: Hao A Wu 
Will wait a couple of days before merging to see if comments from other 
reviewers.

Best Regards,
Hao Wu

> -Original Message-
> From: Rebecca Cran 
> Sent: Tuesday, December 6, 2022 10:31 PM
> To: devel@edk2.groups.io; Gao, Liming ; Ni,
> Ray ; Wang, Jian J ; Wu, Hao A
> 
> Cc: Rebecca Cran 
> Subject: [PATCH v2 1/1] MdeModulePkg: Put USB DEBUGs that occur for bulk
> timeouts under VERBOSE
> 
> With the pending commit of UsbNetworkPkg, it will become common for
> UsbBulkTransfer calls to timeout, given that the drivers are called from
> MnpSystemPoll every MNP_SYS_POLL_INTERVAL milliseconds: the drivers
> check for network packets by calling UsbBulkTransfer with a timeout of
> 1ms.
> 
> Avoid console spam by moving DEBUG messages that occur each time a bulk
> transfer request times out from DEBUG_ERROR to DEBUG_VERBOSE, for
> both
> EHCI and XHCI drivers.
> 
> Signed-off-by: Rebecca Cran 
> ---
>  MdeModulePkg/Bus/Pci/EhciDxe/Ehci.c  | 9 -
>  MdeModulePkg/Bus/Pci/EhciDxe/EhciSched.c | 2 +-
>  MdeModulePkg/Bus/Pci/XhciDxe/Xhci.c  | 9 -
>  MdeModulePkg/Bus/Pci/XhciDxe/XhciSched.c | 6 +++---
>  4 files changed, 20 insertions(+), 6 deletions(-)
> 
> diff --git a/MdeModulePkg/Bus/Pci/EhciDxe/Ehci.c
> b/MdeModulePkg/Bus/Pci/EhciDxe/Ehci.c
> index 0b7270f4e930..e903593b0198 100644
> --- a/MdeModulePkg/Bus/Pci/EhciDxe/Ehci.c
> +++ b/MdeModulePkg/Bus/Pci/EhciDxe/Ehci.c
> @@ -848,6 +848,7 @@ EhcBulkTransfer (
>URB  *Urb;
>EFI_TPL  OldTpl;
>EFI_STATUS   Status;
> +  UINTNDebugErrorLevel;
> 
>//
>// Validate the parameters
> @@ -932,7 +933,13 @@ EhcBulkTransfer (
>gBS->RestoreTPL (OldTpl);
> 
>if (EFI_ERROR (Status)) {
> -DEBUG ((DEBUG_ERROR, "EhcBulkTransfer: error - %r, transfer - %x\n",
> Status, *TransferResult));
> +if (Status == EFI_TIMEOUT) {
> +  DebugErrorLevel = DEBUG_VERBOSE;
> +} else {
> +  DebugErrorLevel = DEBUG_ERROR;
> +}
> +
> +DEBUG ((DebugErrorLevel, "EhcBulkTransfer: error - %r, transfer - %x\n",
> Status, *TransferResult));
>}
> 
>return Status;
> diff --git a/MdeModulePkg/Bus/Pci/EhciDxe/EhciSched.c
> b/MdeModulePkg/Bus/Pci/EhciDxe/EhciSched.c
> index 5da26afbe120..6967aabceb78 100644
> --- a/MdeModulePkg/Bus/Pci/EhciDxe/EhciSched.c
> +++ b/MdeModulePkg/Bus/Pci/EhciDxe/EhciSched.c
> @@ -702,7 +702,7 @@ EhcExecTransfer (
>}
> 
>if (!Finished) {
> -DEBUG ((DEBUG_ERROR, "EhcExecTransfer: transfer not finished
> in %dms\n", (UINT32)TimeOut));
> +DEBUG ((DEBUG_VERBOSE, "EhcExecTransfer: transfer not finished
> in %dms\n", (UINT32)TimeOut));
>  EhcDumpQh (Urb->Qh, NULL, FALSE);
> 
>  Status = EFI_TIMEOUT;
> diff --git a/MdeModulePkg/Bus/Pci/XhciDxe/Xhci.c
> b/MdeModulePkg/Bus/Pci/XhciDxe/Xhci.c
> index c05431ff30ec..15fb49f28fa0 100644
> --- a/MdeModulePkg/Bus/Pci/XhciDxe/Xhci.c
> +++ b/MdeModulePkg/Bus/Pci/XhciDxe/Xhci.c
> @@ -1242,6 +1242,7 @@ XhcBulkTransfer (
>UINT8  SlotId;
>EFI_STATUS Status;
>EFI_TPLOldTpl;
> +  UINTN  DebugErrorLevel;
> 
>//
>// Validate the parameters
> @@ -1304,7 +1305,13 @@ XhcBulkTransfer (
> 
>  ON_EXIT:
>if (EFI_ERROR (Status)) {
> -DEBUG ((DEBUG_ERROR, "XhcBulkTransfer: error - %r, transfer - %x\n",
> Status, *TransferResult));
> +if (Status == EFI_TIMEOUT) {
> +  DebugErrorLevel = DEBUG_VERBOSE;
> +} else {
> +  DebugErrorLevel = DEBUG_ERROR;
> +}
> +
> +DEBUG ((DebugErrorLevel, "XhcBulkTransfer: error - %r, transfer - %x\n",
> Status, *TransferResult));
>}
> 
>gBS->RestoreTPL (OldTpl);
> diff --git a/MdeModulePkg/Bus/Pci/XhciDxe/XhciSched.c
> b/MdeModulePkg/Bus/Pci/XhciDxe/XhciSched.c
> index 13b0400e83d7..13247f7b0dfc 100644
> --- a/MdeModulePkg/Bus/Pci/XhciDxe/XhciSched.c
> +++ b/MdeModulePkg/Bus/Pci/XhciDxe/XhciSched.c
> @@ -734,7 +734,7 @@ XhcDequeueTrbFromEndpoint (
>Dci = XhcEndpointToDci (Urb->Ep.EpAddr, (UINT8)(Urb->Ep.Direction));
>ASSERT (Dci < 32);
> 
> -  DEBUG ((DEBUG_INFO, "Stop Slot = %x,Dci = %x\n", SlotId, Dci));
> +  DEBUG ((DEBUG_VERBOSE, "Stop Slot = %x,Dci = %x\n", SlotId, Dci));
> 
>//
>// 1) Send Stop endpoint command to stop xHC from executing of the TDs
> on the endpoint
> @@ -3376,7 +3376,7 @@ XhcStopEndpoint (
>EVT_TRB_COMMAND_COMPLETION  *EvtTrb;
>CMD_TRB_STOP_ENDPOINT   CmdTrbStopED;
> 
> -  DEBUG ((DEBUG_INFO, "XhcStopEndpoint: Slot = 0x%x, Dci = 0x%x\n",
> SlotId, Dci));
> +  DEBUG ((DEBUG_VERBOSE, "XhcStopEndpoint: Slot = 0x%x, Dci = 0x%x\n",
> SlotId, Dci));
> 
>//
>// When XhcCheckUrbResult waits for the Stop_Endpoint completion, it
> also checks
> @@ -3497,7 +3497,7 @@ XhcSetTrDequeuePointer (
>CMD_SET_TR_DEQ_POINTER  CmdSetTRDeq;
>EFI_PHYSICAL_ADDRESSPhyAddr;
> 
> -  DEBUG ((DEBUG_INFO, "XhcSetTrDequeuePointer: Slot = 0x%x, Dci = 0x%x,
> Urb = 0x%x\n", SlotId, Dci, Urb));
> +  DEBUG ((DEBUG_VERBOSE, 

[edk2-devel] 回复: [PATCH] MdePkg: Update new Form Browser Action Request

2022-12-06 Thread gaoliming via groups.io
Robert:
  Will you also update SetupBrowser to support this new action?

Thanks
Liming
> -邮件原件-
> 发件人: Robert Phelps 
> 发送时间: 2022年11月9日 4:13
> 收件人: devel@edk2.groups.io
> 抄送: michael.d.kin...@intel.com; gaolim...@byosoft.com.cn;
> zhiguang@intel.com
> 主题: [PATCH] MdePkg: Update new Form Browser Action Request
> 
> The UEFI 2.9 specification added a new FORM_BROWSER_ACTION_REQUEST.
> This
> adds FORM_BROWSER_ACTION_REQUEST_QUESTION_APPLY.
> 
> 
> 
> Signed-off-by: Robert Phelps 
> ---
>  MdePkg/Include/Protocol/FormBrowser2.h | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/MdePkg/Include/Protocol/FormBrowser2.h
> b/MdePkg/Include/Protocol/FormBrowser2.h
> index 436a7723c1..7498dc2a07 100644
> --- a/MdePkg/Include/Protocol/FormBrowser2.h
> +++ b/MdePkg/Include/Protocol/FormBrowser2.h
> @@ -55,6 +55,7 @@ typedef UINTN EFI_BROWSER_ACTION_REQUEST;
>  #define EFI_BROWSER_ACTION_REQUEST_FORM_APPLY 6
> 
>  #define EFI_BROWSER_ACTION_REQUEST_FORM_DISCARD   7
> 
>  #define EFI_BROWSER_ACTION_REQUEST_RECONNECT  8
> 
> +#define EFI_BROWSER_ACTION_REQUEST_QUESTION_APPLY 9
> 
> 
> 
>  /**
> 
>Initialize the browser to display the specified configuration forms.
> 
> --
> 2.36.1.windows.1
> -The information contained in this message may be confidential and
> proprietary to American Megatrends (AMI). This communication is intended
to
> be read only by the individual or entity to whom it is addressed or by
their
> designee. If the reader of this message is not the intended recipient, you
are
> on notice that any distribution of this message, in any form, is strictly
> prohibited. Please promptly notify the sender by reply e-mail or by
telephone
> at 770-246-8600, and then delete or destroy all copies of the
transmission=




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




回复: [edk2-devel] [PATCH] MdePkg/UnitTestHostBaseLib: Remove HOST_APPLICATION limitation

2022-12-06 Thread gaoliming via groups.io
Zhiguang and Ray:
  Thanks for your sharing. It is OK to use UnitTestHostBaseLib in emulator 
platform. 
  Please also update the file header in module inf to describe this usage.

Thanks
Liming
> -邮件原件-
> 发件人: devel@edk2.groups.io  代表 Zhiguang Liu
> 发送时间: 2022年12月5日 13:53
> 收件人: Ni, Ray ; devel@edk2.groups.io; Gao, Liming
> 
> 抄送: Kinney, Michael D 
> 主题: Re: [edk2-devel] [PATCH] MdePkg/UnitTestHostBaseLib: Remove
> HOST_APPLICATION limitation
> 
> Hi Liming,
> Like ray said, we are trying to use some baselib function in EmulatorPkg,
> which is assembly code in normal BaseLib, and is mocked in UnitTestBaseLib,
> such as AsmWriteMsr64 and AsmCpuid.
> 
> Thanks
> Zhiguang
> 
> > -Original Message-
> > From: Ni, Ray 
> > Sent: Monday, December 5, 2022 1:38 PM
> > To: devel@edk2.groups.io; Gao, Liming ; Liu,
> > Zhiguang 
> > Cc: Kinney, Michael D 
> > Subject: RE: [edk2-devel] [PATCH] MdePkg/UnitTestHostBaseLib: Remove
> > HOST_APPLICATION limitation
> >
> > Liming,
> > We are running some code that requires MSR access (e.g.: MtrrLib) in
> > EmulatorPkg.
> >
> > Thanks,
> > Ray
> >
> > > -Original Message-
> > > From: devel@edk2.groups.io  On Behalf Of
> > > gaoliming via groups.io
> > > Sent: Friday, December 2, 2022 5:48 PM
> > > To: devel@edk2.groups.io; Liu, Zhiguang 
> > > Cc: Kinney, Michael D ; Ni, Ray
> > > 
> > > Subject: 回复: [edk2-devel] [PATCH] MdePkg/UnitTestHostBaseLib:
> > Remove
> > > HOST_APPLICATION limitation
> > >
> > > Zhiguang:
> > >   Can you explain more about the emulator usage model for this library?
> > >
> > > Thanks
> > > Liming
> > > > -邮件原件-
> > > > 发件人: devel@edk2.groups.io  代表
> Zhiguang
> > Liu
> > > > 发送时间: 2022年12月2日 14:25
> > > > 收件人: devel@edk2.groups.io
> > > > 抄送: Zhiguang Liu ; Michael D Kinney
> > > > ; Liming Gao
> > ;
> > > > Ray Ni 
> > > > 主题: [edk2-devel] [PATCH] MdePkg/UnitTestHostBaseLib: Remove
> > > > HOST_APPLICATION limitation
> > > >
> > > > Remove HOST_APPLICATION limitation for UnitTestHostBaseLib, so that
> > > > this library can be used as BaseLib by Emulator.
> > > > Also, add some missing files
> > > >
> > > > Cc: Michael D Kinney 
> > > > Cc: Liming Gao 
> > > > Signed-off-by: Ray Ni 
> > > > ---
> > > >  MdePkg/Library/BaseLib/UnitTestHostBaseLib.inf | 6 --
> > > >  1 file changed, 4 insertions(+), 2 deletions(-)
> > > >
> > > > diff --git a/MdePkg/Library/BaseLib/UnitTestHostBaseLib.inf
> > > > b/MdePkg/Library/BaseLib/UnitTestHostBaseLib.inf
> > > > index 09a610c31c..fefa2e79f6 100644
> > > > --- a/MdePkg/Library/BaseLib/UnitTestHostBaseLib.inf
> > > > +++ b/MdePkg/Library/BaseLib/UnitTestHostBaseLib.inf
> > > > @@ -1,7 +1,7 @@
> > > >  ## @file
> > > >  #  Base Library implementation for use with host based unit tests.
> > > >  #
> > > > -#  Copyright (c) 2007 - 2021, Intel Corporation. All rights
> > > > reserved.
> > > > +#  Copyright (c) 2007 - 2022, Intel Corporation. All rights
> > > > +reserved.
> > > >  #  Portions copyright (c) 2008 - 2009, Apple Inc. All rights
> > > reserved.
> > > >  #  Portions copyright (c) 2011 - 2013, ARM Ltd. All rights
> > > > reserved.  #  Copyright (c) 2020, Hewlett Packard Enterprise
> > > > Development LP. All rights reserved. @@ -18,7 +18,7 @@
> > > >FILE_GUID  =
> > > > 9555A0D3-09BA-46C4-A51A-45198E3C765E
> > > >MODULE_TYPE= BASE
> > > >VERSION_STRING = 1.1
> > > > -  LIBRARY_CLASS  =
> BaseLib|HOST_APPLICATION
> > > > +  LIBRARY_CLASS  = BaseLib
> > > >LIBRARY_CLASS  =
> > > > UnitTestHostBaseLib|HOST_APPLICATION
> > > >
> > > >  #
> > > > @@ -128,6 +128,7 @@
> > > >X86RdRand.c
> > > >X86SpeculationBarrier.c
> > > >X86UnitTestHost.c
> > > > +  IntelTdxNull.c
> > > >
> > > >  [Sources.X64]
> > > >X64/LongJump.nasm
> > > > @@ -168,6 +169,7 @@
> > > >X64/RdRand.nasm
> > > >ChkStkGcc.c  | GCC
> > > >X86UnitTestHost.c
> > > > +  IntelTdxNull.c
> > > >
> > > >  [Sources.EBC]
> > > >Ebc/CpuBreakpoint.c
> > > > --
> > > > 2.31.1.windows.1
> > > >
> > > >
> > > >
> > > >
> > > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> 
> 
> 
> 
> 





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




回复: [edk2-devel] feature flag change notifications

2022-12-06 Thread gaoliming via groups.io
Dann:
  I base on new features to collect the incompatible changes, and add them into 
the updated notes. 

  If you find any missing, please send the mail to me. 

Thanks
Liming
> -邮件原件-
> 发件人: Kinney, Michael D 
> 发送时间: 2022年12月6日 9:22
> 收件人: devel@edk2.groups.io; dann.fraz...@canonical.com; Gao, Liming
> 
> 主题: RE: [edk2-devel] feature flag change notifications
> 
> Hi Dann,
> 
> These are reasonable requests.
> 
> Adding Liming Gao who is currently responsible for the edk2 releases.
> 
> Let's start with release notes and see if some of these can be added
> to the release documentation and add to the edk2 release process
> to clearly note these type of changes in future release notes.
> 
> As far as #error and #warn.  Those are possible, but we would need
> to do some analysis for the types of changes that would require
> that behavior.  Your examples are useful as a starting point.
> 
> Once concern is how many of those #error/#warn conditions will
> build up over time and then a process to remove them after an
> expiration period.
> 
> Mike
> 
> > -Original Message-
> > From: devel@edk2.groups.io  On Behalf Of dann
> frazier
> > Sent: Monday, December 5, 2022 4:10 PM
> > To: devel@edk2.groups.io
> > Subject: [edk2-devel] feature flag change notifications
> >
> > Hi,
> >   I maintain the edk2 packages in the Debian and Ubuntu
> > distributions. A few times over the years I've had users report
> > regressions that turned out to be due to upstream build flag
> > changes. I wonder if it would be possible for upstream to communicate
> > such changes - either via release notes or, where possible, as
> > build-time checks - to us downstream projects. Here are the examples I
> > recall:
> >
> > > commit 4de8d61bcec02a13ceed84f92b0cf3ea58adf9c5
> > > Author: Gerd Hoffmann 
> > > Date:   Wed Dec 15 12:39:20 2021 +0100
> > >
> > > OvmfPkg: rework TPM configuration
> > >
> >
> > For this I needed to change -DTPM_ENABLE=TRUE to
> -DTPM2_ENABLE=TRUE. I
> > feel like a build-time check would've been a good way to communicate
> > this one, e.g.:
> >
> > #ifdef TPM_ENABLE
> > #error TPM_ENABLE has been renamed to TPM2_ENABLE
> > #endif
> >
> > > commit 1631bb26ae991e530d3c96fe3161ea15144b358e
> > > Author: Gary Lin 
> > > Date:   Mon Jun 10 14:55:09 2019 +0800
> > >
> > > OvmfPkg/README: Update the network build flags
> > >
> > > The following network build flags changed due to the inclusion of
> > > NetworkPkg/Network.fdf.inc.
> > >
> > Similar to the above, I needed to deal with this by setting
> > -DNETWORK_HTTP_BOOT_ENABLE=TRUE instead of
> -DHTTP_BOOT_ENABLE=TRUE. It
> > seems like maybe an #error on the removed #define could've helped
> > here as well.
> >
> > And finally:
> >
> > > commit 57783adfb579da32b1eeda77b2bec028a5e0b7b3
> > > Author: Michael D Kinney 
> > > Date:   Tue Jul 26 12:40:00 2022 -0700
> > >
> > > OvmfPkg: Change default to disable MptScsi and PvScsi
> >
> > With this types of change, it would be useful just to know this is
> > coming and why so I can decide to either notify users of the change
> > and/or override the default to avoid the regression. Would it be
> > possible to describe such changes in the release notes at
> > https://github.com/tianocore/edk2/releases - and, if not urgent,
> > perhaps #warn of deprecation in the source for one stable release
> > cycle?
> >
> >   -dann
> >
> >
> > 
> >





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




Re: [edk2-devel] [PATCH v4] NetworkPkg/WifiProfileSync: Add WiFi profile sync protocol support

2022-12-06 Thread Clark-williams, Zachary
++ Michal's coverage Michal and Lukasz

-Original Message-
From: Clark-williams, Zachary  
Sent: Tuesday, December 6, 2022 10:38 AM
To: devel@edk2.groups.io; Clark-williams, Zachary 
; Rabeda, Maciej ; 
Zimmer, Vincent ; Luo, Heng ; 
Kuo, Scottie ; Kuo, Ted ; Dutkiewicz, 
Michal ; Wu, Jiaxin ; 
Otcheretianski, Andrei ; Kasbekar, Saloni 
; Kinney, Michael D 
Cc: Alappat, Paul ; Patil, Ajit 
Subject: RE: [edk2-devel] [PATCH v4] NetworkPkg/WifiProfileSync: Add WiFi 
profile sync protocol support

Hey Maciej and All,

Is there any update in ability to review this patch for Wifi Profile Sync 
Protocol and Wifi Connection Manager?

Thank you,
Zack

-Original Message-
From: devel@edk2.groups.io  On Behalf Of Clark-williams, 
Zachary
Sent: Wednesday, November 2, 2022 8:58 AM
To: Rabeda, Maciej ; Zimmer, Vincent 
; Luo, Heng ; Kuo, Scottie 
; Kuo, Ted ; Dutkiewicz, Michal 
; devel@edk2.groups.io; Wu, Jiaxin 
; Otcheretianski, Andrei 
; Kasbekar, Saloni 
; Kinney, Michael D 
Cc: Alappat, Paul ; Patil, Ajit 
Subject: Re: [edk2-devel] [PATCH v4] NetworkPkg/WifiProfileSync: Add WiFi 
profile sync protocol support

Hey Maciej,

I can understand that and appreciate the attention you can spare for reviewing 
this change. 
If there are any peers you know who can/will want to review or have valuable 
input on this PR please feel free to send them an invite to review.

Thanks,
Zack

-Original Message-
From: Rabeda, Maciej 
Sent: Wednesday, November 2, 2022 5:35 AM
To: Clark-williams, Zachary ; Zimmer, Vincent 
; Luo, Heng ; Kuo, Scottie 
; Kuo, Ted ; Dutkiewicz, Michal 
; devel@edk2.groups.io; Wu, Jiaxin 
; Otcheretianski, Andrei 
; Kasbekar, Saloni 
; Kinney, Michael D 
Cc: Alappat, Paul ; Patil, Ajit 
Subject: RE: [edk2-devel] [PATCH v4] NetworkPkg/WifiProfileSync: Add WiFi 
profile sync protocol support

@Kinney, Michael D
With the amount of work around IPUs, I can hardly spare time (maybe 2h/week on 
average - including code).
My time for EDK2 is currently fully allocated to:
1. https://github.com/tianocore/edk2-staging/tree/HttpProxy (@Kasbekar, Saloni) 
2. NVMe-oF boot prototype under nvme.org umbrella (@Zimmer, Vincent)

@Clark-williams, Zachary
Your patch is non-trivial and requires understanding on my side. Based on that 
and the above, this will take time.

-Original Message-
From: Clark-williams, Zachary 
Sent: Tuesday, November 1, 2022 6:41 PM
To: Zimmer, Vincent ; Rabeda, Maciej 
; Luo, Heng ; Kuo, Scottie 
; Kuo, Ted ; Dutkiewicz, Michal 
; devel@edk2.groups.io; Wu, Jiaxin 
; Otcheretianski, Andrei 
Cc: Alappat, Paul ; Kasbekar, Saloni 
; Patil, Ajit 
Subject: RE: [edk2-devel] [PATCH v4] NetworkPkg/WifiProfileSync: Add WiFi 
profile sync protocol support

Great thank you Vincent, I will add them to the protocol header file and send 
an updated patch today.

-Original Message-
From: Zimmer, Vincent 
Sent: Tuesday, November 1, 2022 10:39 AM
To: Clark-williams, Zachary ; Rabeda, Maciej 
; Luo, Heng ; Kuo, Scottie 
; Kuo, Ted ; Dutkiewicz, Michal 
; devel@edk2.groups.io; Wu, Jiaxin 
; Otcheretianski, Andrei 
Cc: Alappat, Paul ; Kasbekar, Saloni 
; Patil, Ajit 
Subject: RE: [edk2-devel] [PATCH v4] NetworkPkg/WifiProfileSync: Add WiFi 
profile sync protocol support

That's great
If these links are not already in the .h files of the patch I'd add them.
Typically the uefi networking code leverages uefi spec or ietf rfc's or other 
public collateral.  Letting folks know the background of these interfaces with 
a reference should help consumers IMHO Vincent

-Original Message-
From: Clark-williams, Zachary 
Sent: Tuesday, November 1, 2022 10:35 AM
To: Zimmer, Vincent ; Rabeda, Maciej 
; Luo, Heng ; Kuo, Scottie 
; Kuo, Ted ; Dutkiewicz, Michal 
; devel@edk2.groups.io; Wu, Jiaxin 
; Otcheretianski, Andrei 
Cc: Alappat, Paul ; Kasbekar, Saloni 
; Patil, Ajit 
Subject: RE: [edk2-devel] [PATCH v4] NetworkPkg/WifiProfileSync: Add WiFi 
profile sync protocol support

Hey Vincent,

The documentation for describing the features in the PR description can be 
found in the CSME documentation found on the public accessible intel link below.

OCR - 
https://software.intel.com/sites/manageability/AMT_Implementation_and_Reference_Guide/default.htm?turl=WordDocuments%2Foneclickrecovery.htm

KVM - 
https://software.intel.com/sites/manageability/AMT_Implementation_and_Reference_Guide/default.htm?turl=WordDocuments%2Foneclickrecovery.htm

Thanks,
Zack

-Original Message-
From: Zimmer, Vincent 
Sent: Monday, October 31, 2022 2:16 PM
To: Clark-williams, Zachary 
Subject: RE: [edk2-devel] [PATCH v4] NetworkPkg/WifiProfileSync: Add WiFi 
profile sync protocol support

Quick question

Are the features described in " Enables KVM and One Click Recovery WLAN 
capability with WiFi Profile Sync feature and protocol. Adding 
WiFiProfileSyncProtocol, which supports the profilesync driver operations for 
transferring WiFi profiles from AMT to the Supplicant. WiFiConnectionManager 
will check for 

Re: [edk2-devel] [PATCH v4] NetworkPkg/WifiProfileSync: Add WiFi profile sync protocol support

2022-12-06 Thread Clark-williams, Zachary
Hey Maciej and All,

Is there any update in ability to review this patch for Wifi Profile Sync 
Protocol and Wifi Connection Manager?

Thank you,
Zack

-Original Message-
From: devel@edk2.groups.io  On Behalf Of Clark-williams, 
Zachary
Sent: Wednesday, November 2, 2022 8:58 AM
To: Rabeda, Maciej ; Zimmer, Vincent 
; Luo, Heng ; Kuo, Scottie 
; Kuo, Ted ; Dutkiewicz, Michal 
; devel@edk2.groups.io; Wu, Jiaxin 
; Otcheretianski, Andrei 
; Kasbekar, Saloni 
; Kinney, Michael D 
Cc: Alappat, Paul ; Patil, Ajit 
Subject: Re: [edk2-devel] [PATCH v4] NetworkPkg/WifiProfileSync: Add WiFi 
profile sync protocol support

Hey Maciej,

I can understand that and appreciate the attention you can spare for reviewing 
this change. 
If there are any peers you know who can/will want to review or have valuable 
input on this PR please feel free to send them an invite to review.

Thanks,
Zack

-Original Message-
From: Rabeda, Maciej 
Sent: Wednesday, November 2, 2022 5:35 AM
To: Clark-williams, Zachary ; Zimmer, Vincent 
; Luo, Heng ; Kuo, Scottie 
; Kuo, Ted ; Dutkiewicz, Michal 
; devel@edk2.groups.io; Wu, Jiaxin 
; Otcheretianski, Andrei 
; Kasbekar, Saloni 
; Kinney, Michael D 
Cc: Alappat, Paul ; Patil, Ajit 
Subject: RE: [edk2-devel] [PATCH v4] NetworkPkg/WifiProfileSync: Add WiFi 
profile sync protocol support

@Kinney, Michael D
With the amount of work around IPUs, I can hardly spare time (maybe 2h/week on 
average - including code).
My time for EDK2 is currently fully allocated to:
1. https://github.com/tianocore/edk2-staging/tree/HttpProxy (@Kasbekar, Saloni) 
2. NVMe-oF boot prototype under nvme.org umbrella (@Zimmer, Vincent)

@Clark-williams, Zachary
Your patch is non-trivial and requires understanding on my side. Based on that 
and the above, this will take time.

-Original Message-
From: Clark-williams, Zachary 
Sent: Tuesday, November 1, 2022 6:41 PM
To: Zimmer, Vincent ; Rabeda, Maciej 
; Luo, Heng ; Kuo, Scottie 
; Kuo, Ted ; Dutkiewicz, Michal 
; devel@edk2.groups.io; Wu, Jiaxin 
; Otcheretianski, Andrei 
Cc: Alappat, Paul ; Kasbekar, Saloni 
; Patil, Ajit 
Subject: RE: [edk2-devel] [PATCH v4] NetworkPkg/WifiProfileSync: Add WiFi 
profile sync protocol support

Great thank you Vincent, I will add them to the protocol header file and send 
an updated patch today.

-Original Message-
From: Zimmer, Vincent 
Sent: Tuesday, November 1, 2022 10:39 AM
To: Clark-williams, Zachary ; Rabeda, Maciej 
; Luo, Heng ; Kuo, Scottie 
; Kuo, Ted ; Dutkiewicz, Michal 
; devel@edk2.groups.io; Wu, Jiaxin 
; Otcheretianski, Andrei 
Cc: Alappat, Paul ; Kasbekar, Saloni 
; Patil, Ajit 
Subject: RE: [edk2-devel] [PATCH v4] NetworkPkg/WifiProfileSync: Add WiFi 
profile sync protocol support

That's great
If these links are not already in the .h files of the patch I'd add them.
Typically the uefi networking code leverages uefi spec or ietf rfc's or other 
public collateral.  Letting folks know the background of these interfaces with 
a reference should help consumers IMHO Vincent

-Original Message-
From: Clark-williams, Zachary 
Sent: Tuesday, November 1, 2022 10:35 AM
To: Zimmer, Vincent ; Rabeda, Maciej 
; Luo, Heng ; Kuo, Scottie 
; Kuo, Ted ; Dutkiewicz, Michal 
; devel@edk2.groups.io; Wu, Jiaxin 
; Otcheretianski, Andrei 
Cc: Alappat, Paul ; Kasbekar, Saloni 
; Patil, Ajit 
Subject: RE: [edk2-devel] [PATCH v4] NetworkPkg/WifiProfileSync: Add WiFi 
profile sync protocol support

Hey Vincent,

The documentation for describing the features in the PR description can be 
found in the CSME documentation found on the public accessible intel link below.

OCR - 
https://software.intel.com/sites/manageability/AMT_Implementation_and_Reference_Guide/default.htm?turl=WordDocuments%2Foneclickrecovery.htm

KVM - 
https://software.intel.com/sites/manageability/AMT_Implementation_and_Reference_Guide/default.htm?turl=WordDocuments%2Foneclickrecovery.htm

Thanks,
Zack

-Original Message-
From: Zimmer, Vincent 
Sent: Monday, October 31, 2022 2:16 PM
To: Clark-williams, Zachary 
Subject: RE: [edk2-devel] [PATCH v4] NetworkPkg/WifiProfileSync: Add WiFi 
profile sync protocol support

Quick question

Are the features described in " Enables KVM and One Click Recovery WLAN 
capability with WiFi Profile Sync feature and protocol. Adding 
WiFiProfileSyncProtocol, which supports the profilesync driver operations for 
transferring WiFi profiles from AMT to the Supplicant. WiFiConnectionManager 
will check for the WifiProfileSyncProtocol and if found will operate on the 
premise of a One Click Recovery, or KVM flow with a Wifi profile provided by 
AMT." in a public document?  Things like concept of profile sync?  I'm guessing 
they are since Linux probably does the same in the intel iwl driver?

Vincent

-Original Message-
From: devel@edk2.groups.io  On Behalf Of Clark-williams, 
Zachary
Sent: Monday, October 31, 2022 12:31 PM
To: Kinney, Michael D ; Rabeda, Maciej 
; Luo, Heng ; Kuo, Scottie 
; Kuo, 

[edk2-devel] MdeModulePkg/UefiBootManagerLib: Use hob size to process MemoryTypeInfo

2022-12-06 Thread Anbazhagan, Baraneedharan via groups.io
Current code relies on last entry in hob to be MaxMemoryType enum value
which keeps changing on new memory type definition. If the HOB is
created by binaries built with older Edk2, current code leads to hang
which could be avoided by using hob size.

Signed-off-by: Baraneedharan Anbazhagan 
anbazha...@hp.com
---
MdeModulePkg/Library/UefiBootManagerLib/BmMisc.c | 6 --
1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/MdeModulePkg/Library/UefiBootManagerLib/BmMisc.c 
b/MdeModulePkg/Library/UefiBootManagerLib/BmMisc.c
index a5e32ebdba..014e4557bf 100644
--- a/MdeModulePkg/Library/UefiBootManagerLib/BmMisc.c
+++ b/MdeModulePkg/Library/UefiBootManagerLib/BmMisc.c
@@ -140,6 +140,7 @@ BmSetMemoryTypeInformationVariable (
   UINT32   Current;
   UINT32   Next;
   EFI_HOB_GUID_TYPE*GuidHob;
+  UINTNNoOfEntries;
   BOOLEAN  MemoryTypeInformationModified;
   BOOLEAN  MemoryTypeInformationVariableExists;
   EFI_BOOT_MODEBootMode;
@@ -200,6 +201,7 @@ BmSetMemoryTypeInformationVariable (
   }
   VariableSize  = GET_GUID_HOB_DATA_SIZE (GuidHob);
+  NoOfEntries   = VariableSize / 
sizeof(EFI_MEMORY_TYPE_INFORMATION);
   PreviousMemoryTypeInformation = AllocateCopyPool (VariableSize, 
GET_GUID_HOB_DATA (GuidHob));
   if (PreviousMemoryTypeInformation == NULL) {
 return;
@@ -212,8 +214,8 @@ BmSetMemoryTypeInformationVariable (
   DEBUG ((DEBUG_INFO, " TypePages Pages Pages  \n"));
   DEBUG ((DEBUG_INFO, "==      \n"));
-  for (Index = 0; PreviousMemoryTypeInformation[Index].Type != 
EfiMaxMemoryType; Index++) {
-for (Index1 = 0; CurrentMemoryTypeInformation[Index1].Type != 
EfiMaxMemoryType; Index1++) {
+  for (Index = 0; Index < NoOfEntries; Index++) {
+for (Index1 = 0; Index1 < NoOfEntries; Index1++) {
   if (PreviousMemoryTypeInformation[Index].Type == 
CurrentMemoryTypeInformation[Index1].Type) {
 break;
   }
--
2.38.1.windows.1



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




Re: [edk2-devel] [Patch 1/2] OvmfPkg: Change default to disable MptScsi and PvScsi

2022-12-06 Thread Mike Maslenkin
Greetings All!

As I can see LSI_SCSI_ENABLE  related to LSI LSI_53C895A_PCI_DEVICE_ID
Vid/Did 0x1000:0x0012.
I guess it is some old Megaraid adapter.

A patch mentioned above set MPT_SCSI_ENABLE=FALSE, that removed
support for LSI 53C1030 and SAS1068.
These SCSI controllers were emulated  by VMware, Parallels and I guess
VitualBox.
This is generic setup for VMware VMs, as far as I remember.
So the booting of such VMs (probably migrated from VMware  and others)
was definitely broken.

Regards,
Mike.


On Tue, Dec 6, 2022 at 5:38 PM dann frazier  wrote:
>
> On Tue, Dec 06, 2022 at 06:56:49AM +0100, Gerd Hoffmann wrote:
> > On Mon, Dec 05, 2022 at 04:36:15PM -0700, dann frazier wrote:
> > > On Tue, Jul 26, 2022 at 12:46:39PM -0700, Michael D Kinney wrote:
> > > > The email addresses for the reviewers of the MptScsi and
> > > > PvScsi are no longer valid.  Disable the MptScsi and PvScsi
> > > > drivers in all DSC files until new maintainers/reviewers can
> > > > be identified.
> > >
> > > Hi Michael,
> > >
> > >   This seems likely to be the reason for the following regression
> > > report in Debian:
> > >
> > >   https://bugs.debian.org/1016359
> >
> > I'm not so sure about that.
> >
> > > > -  DEFINE PVSCSI_ENABLE   = TRUE
> > > > -  DEFINE MPT_SCSI_ENABLE = TRUE
> > > > +  DEFINE PVSCSI_ENABLE   = FALSE
> > > > +  DEFINE MPT_SCSI_ENABLE = FALSE
> > > >DEFINE LSI_SCSI_ENABLE = FALSE
> >
> > The bug report talks about lsilogic and virtio-scsi.
> >
> > lsilogic was already disabled by default before this patch.
> >
> > virtio-scsi support is included and there are no plans to change
> > that because it is a rather essential driver.  It works just fine
> > upstream, and there isn't even a config switch to disable it.
>
> Thanks Gerd - I'll work with the users to clarify via the bug (thanks
> for responding there as well btw).
>
>   -dann
>
>
> 
>
>


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




Re: [edk2-devel] [Patch 1/2] OvmfPkg: Change default to disable MptScsi and PvScsi

2022-12-06 Thread dann frazier
On Tue, Dec 06, 2022 at 06:56:49AM +0100, Gerd Hoffmann wrote:
> On Mon, Dec 05, 2022 at 04:36:15PM -0700, dann frazier wrote:
> > On Tue, Jul 26, 2022 at 12:46:39PM -0700, Michael D Kinney wrote:
> > > The email addresses for the reviewers of the MptScsi and
> > > PvScsi are no longer valid.  Disable the MptScsi and PvScsi
> > > drivers in all DSC files until new maintainers/reviewers can
> > > be identified.
> > 
> > Hi Michael,
> > 
> >   This seems likely to be the reason for the following regression
> > report in Debian:
> >   
> >   https://bugs.debian.org/1016359
> 
> I'm not so sure about that.
> 
> > > -  DEFINE PVSCSI_ENABLE   = TRUE
> > > -  DEFINE MPT_SCSI_ENABLE = TRUE
> > > +  DEFINE PVSCSI_ENABLE   = FALSE
> > > +  DEFINE MPT_SCSI_ENABLE = FALSE
> > >DEFINE LSI_SCSI_ENABLE = FALSE
> 
> The bug report talks about lsilogic and virtio-scsi.
> 
> lsilogic was already disabled by default before this patch.
> 
> virtio-scsi support is included and there are no plans to change
> that because it is a rather essential driver.  It works just fine
> upstream, and there isn't even a config switch to disable it.

Thanks Gerd - I'll work with the users to clarify via the bug (thanks
for responding there as well btw).

  -dann


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




Re: [edk2-devel] [Patch 1/1] RedfishPkg: Remove overlapping private include path in DEC file

2022-12-06 Thread Igor Kulchytskyy via groups.io
Reviewed-by: Igor Kulchytskyy mailto:abner.ch...@amd.com>>

Get Outlook for Android

From: Chang, Abner 
Sent: Tuesday, December 6, 2022 3:23:56 AM
To: Michael D Kinney ; devel@edk2.groups.io 

Cc: Nickle Wang ; Igor Kulchytskyy 
Subject: [EXTERNAL] RE: [Patch 1/1] RedfishPkg: Remove overlapping private 
include path in DEC file


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

[AMD Official Use Only - General]

Reviewed-by: Abner Chang 

> -Original Message-
> From: Michael D Kinney 
> Sent: Tuesday, December 6, 2022 8:45 AM
> To: devel@edk2.groups.io
> Cc: Chang, Abner ; Nickle Wang
> ; Igor Kulchytskyy 
> Subject: [Patch 1/1] RedfishPkg: Remove overlapping private include path in
> DEC file
>
> Caution: This message originated from an External Source. Use proper
> caution when opening attachments, clicking links, or responding.
>
>
> Update ReadfishPkg.dec to remove PrivateInclude from the
> [Includes.Common.Private] section.  The PrivateInclude directory does not
> contain any include files, and the PrivateInclude/Crt include path remaining 
> in
> the [Includes.Common.Private] section providing the include path required
> to access the CRT related include files by components within the RedfishPkg.
>
> Without this update, there are two forms of #include statements that can be
> used to include the CRT related include files.
> Include files should only be available using one form of #include statements.
>
> Cc: Abner Chang 
> Cc: Nickle Wang 
> Cc: Igor Kulchytskyy 
> Signed-off-by: Michael D Kinney 
> ---
>  RedfishPkg/RedfishPkg.dec | 1 -
>  1 file changed, 1 deletion(-)
>
> diff --git a/RedfishPkg/RedfishPkg.dec b/RedfishPkg/RedfishPkg.dec index
> 0aa26883e220..d2b189b13d8c 100644
> --- a/RedfishPkg/RedfishPkg.dec
> +++ b/RedfishPkg/RedfishPkg.dec
> @@ -17,7 +17,6 @@ [Includes]
>Include
>
>  [Includes.Common.Private]
> -  PrivateInclude# Private header files for C RTL.
>PrivateInclude/Crt# Private header files for C RTL.
>Library/JsonLib   # Private header files for jansson
>  # configuration files.
> --
> 2.37.1.windows.1
-The information contained in this message may be confidential and proprietary 
to American Megatrends (AMI). This communication is intended to be read only by 
the individual or entity to whom it is addressed or by their designee. If the 
reader of this message is not the intended recipient, you are on notice that 
any distribution of this message, in any form, is strictly prohibited. Please 
promptly notify the sender by reply e-mail or by telephone at 770-246-8600, and 
then delete or destroy all copies of the transmission.


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




[edk2-devel] [PATCH v2 1/1] MdeModulePkg: Put USB DEBUGs that occur for bulk timeouts under VERBOSE

2022-12-06 Thread Rebecca Cran
With the pending commit of UsbNetworkPkg, it will become common for
UsbBulkTransfer calls to timeout, given that the drivers are called from
MnpSystemPoll every MNP_SYS_POLL_INTERVAL milliseconds: the drivers
check for network packets by calling UsbBulkTransfer with a timeout of
1ms.

Avoid console spam by moving DEBUG messages that occur each time a bulk
transfer request times out from DEBUG_ERROR to DEBUG_VERBOSE, for both
EHCI and XHCI drivers.

Signed-off-by: Rebecca Cran 
---
 MdeModulePkg/Bus/Pci/EhciDxe/Ehci.c  | 9 -
 MdeModulePkg/Bus/Pci/EhciDxe/EhciSched.c | 2 +-
 MdeModulePkg/Bus/Pci/XhciDxe/Xhci.c  | 9 -
 MdeModulePkg/Bus/Pci/XhciDxe/XhciSched.c | 6 +++---
 4 files changed, 20 insertions(+), 6 deletions(-)

diff --git a/MdeModulePkg/Bus/Pci/EhciDxe/Ehci.c 
b/MdeModulePkg/Bus/Pci/EhciDxe/Ehci.c
index 0b7270f4e930..e903593b0198 100644
--- a/MdeModulePkg/Bus/Pci/EhciDxe/Ehci.c
+++ b/MdeModulePkg/Bus/Pci/EhciDxe/Ehci.c
@@ -848,6 +848,7 @@ EhcBulkTransfer (
   URB  *Urb;
   EFI_TPL  OldTpl;
   EFI_STATUS   Status;
+  UINTNDebugErrorLevel;
 
   //
   // Validate the parameters
@@ -932,7 +933,13 @@ EhcBulkTransfer (
   gBS->RestoreTPL (OldTpl);
 
   if (EFI_ERROR (Status)) {
-DEBUG ((DEBUG_ERROR, "EhcBulkTransfer: error - %r, transfer - %x\n", 
Status, *TransferResult));
+if (Status == EFI_TIMEOUT) {
+  DebugErrorLevel = DEBUG_VERBOSE;
+} else {
+  DebugErrorLevel = DEBUG_ERROR;
+}
+
+DEBUG ((DebugErrorLevel, "EhcBulkTransfer: error - %r, transfer - %x\n", 
Status, *TransferResult));
   }
 
   return Status;
diff --git a/MdeModulePkg/Bus/Pci/EhciDxe/EhciSched.c 
b/MdeModulePkg/Bus/Pci/EhciDxe/EhciSched.c
index 5da26afbe120..6967aabceb78 100644
--- a/MdeModulePkg/Bus/Pci/EhciDxe/EhciSched.c
+++ b/MdeModulePkg/Bus/Pci/EhciDxe/EhciSched.c
@@ -702,7 +702,7 @@ EhcExecTransfer (
   }
 
   if (!Finished) {
-DEBUG ((DEBUG_ERROR, "EhcExecTransfer: transfer not finished in %dms\n", 
(UINT32)TimeOut));
+DEBUG ((DEBUG_VERBOSE, "EhcExecTransfer: transfer not finished in %dms\n", 
(UINT32)TimeOut));
 EhcDumpQh (Urb->Qh, NULL, FALSE);
 
 Status = EFI_TIMEOUT;
diff --git a/MdeModulePkg/Bus/Pci/XhciDxe/Xhci.c 
b/MdeModulePkg/Bus/Pci/XhciDxe/Xhci.c
index c05431ff30ec..15fb49f28fa0 100644
--- a/MdeModulePkg/Bus/Pci/XhciDxe/Xhci.c
+++ b/MdeModulePkg/Bus/Pci/XhciDxe/Xhci.c
@@ -1242,6 +1242,7 @@ XhcBulkTransfer (
   UINT8  SlotId;
   EFI_STATUS Status;
   EFI_TPLOldTpl;
+  UINTN  DebugErrorLevel;
 
   //
   // Validate the parameters
@@ -1304,7 +1305,13 @@ XhcBulkTransfer (
 
 ON_EXIT:
   if (EFI_ERROR (Status)) {
-DEBUG ((DEBUG_ERROR, "XhcBulkTransfer: error - %r, transfer - %x\n", 
Status, *TransferResult));
+if (Status == EFI_TIMEOUT) {
+  DebugErrorLevel = DEBUG_VERBOSE;
+} else {
+  DebugErrorLevel = DEBUG_ERROR;
+}
+
+DEBUG ((DebugErrorLevel, "XhcBulkTransfer: error - %r, transfer - %x\n", 
Status, *TransferResult));
   }
 
   gBS->RestoreTPL (OldTpl);
diff --git a/MdeModulePkg/Bus/Pci/XhciDxe/XhciSched.c 
b/MdeModulePkg/Bus/Pci/XhciDxe/XhciSched.c
index 13b0400e83d7..13247f7b0dfc 100644
--- a/MdeModulePkg/Bus/Pci/XhciDxe/XhciSched.c
+++ b/MdeModulePkg/Bus/Pci/XhciDxe/XhciSched.c
@@ -734,7 +734,7 @@ XhcDequeueTrbFromEndpoint (
   Dci = XhcEndpointToDci (Urb->Ep.EpAddr, (UINT8)(Urb->Ep.Direction));
   ASSERT (Dci < 32);
 
-  DEBUG ((DEBUG_INFO, "Stop Slot = %x,Dci = %x\n", SlotId, Dci));
+  DEBUG ((DEBUG_VERBOSE, "Stop Slot = %x,Dci = %x\n", SlotId, Dci));
 
   //
   // 1) Send Stop endpoint command to stop xHC from executing of the TDs on 
the endpoint
@@ -3376,7 +3376,7 @@ XhcStopEndpoint (
   EVT_TRB_COMMAND_COMPLETION  *EvtTrb;
   CMD_TRB_STOP_ENDPOINT   CmdTrbStopED;
 
-  DEBUG ((DEBUG_INFO, "XhcStopEndpoint: Slot = 0x%x, Dci = 0x%x\n", SlotId, 
Dci));
+  DEBUG ((DEBUG_VERBOSE, "XhcStopEndpoint: Slot = 0x%x, Dci = 0x%x\n", SlotId, 
Dci));
 
   //
   // When XhcCheckUrbResult waits for the Stop_Endpoint completion, it also 
checks
@@ -3497,7 +3497,7 @@ XhcSetTrDequeuePointer (
   CMD_SET_TR_DEQ_POINTER  CmdSetTRDeq;
   EFI_PHYSICAL_ADDRESSPhyAddr;
 
-  DEBUG ((DEBUG_INFO, "XhcSetTrDequeuePointer: Slot = 0x%x, Dci = 0x%x, Urb = 
0x%x\n", SlotId, Dci, Urb));
+  DEBUG ((DEBUG_VERBOSE, "XhcSetTrDequeuePointer: Slot = 0x%x, Dci = 0x%x, Urb 
= 0x%x\n", SlotId, Dci, Urb));
 
   //
   // Send stop endpoint command to transit Endpoint from running to stop state
-- 
2.30.2



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




[edk2-devel] [PATCH v2 0/1] MdeModulePkg: Put USB DEBUGs that occur for bulk timeouts under VERBOSE

2022-12-06 Thread Rebecca Cran
*Changes between v1 and v2*

Only switch to DEBUG_VERBOSE for EFI_TIMEOUT errors.

Test Pull Request:  https://github.com/tianocore/edk2/pull/3705

---

MdeModulePkg: Put USB DEBUGs that occur for bulk timeouts under VERBOSE
   
With the pending commit of UsbNetworkPkg, it will become common for
UsbBulkTransfer calls to timeout, given that the drivers are called from
MnpSystemPoll every MNP_SYS_POLL_INTERVAL milliseconds: the drivers
check for network packets by calling UsbBulkTransfer with a timeout of
1ms.

Avoid console spam by moving DEBUG messages that occur each time a bulk
transfer request times out from DEBUG_ERROR to DEBUG_VERBOSE, for both
EHCI and XHCI drivers.

Rebecca Cran (1):
  MdeModulePkg: Put USB DEBUGs that occur for bulk timeouts under
VERBOSE

 MdeModulePkg/Bus/Pci/EhciDxe/Ehci.c  | 9 -
 MdeModulePkg/Bus/Pci/EhciDxe/EhciSched.c | 2 +-
 MdeModulePkg/Bus/Pci/XhciDxe/Xhci.c  | 9 -
 MdeModulePkg/Bus/Pci/XhciDxe/XhciSched.c | 6 +++---
 4 files changed, 20 insertions(+), 6 deletions(-)

-- 
2.30.2



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




[edk2-devel] [PATCH v1 4/5] UefiCpuPkg: Implements SmmCpuFeaturesLib for AMD Family

2022-12-06 Thread Abdul Lateef Attar via groups.io
From: Abdul Lateef Attar 

BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=4182

Implements interfaces to read and write save state
registers of AMD's processor family.
Initializes processor SMMADDR and MASK depends
on PcdSmrrEnable flag.
Program or corrects the IP once control returns from SMM.

Cc: Paul Grimes 
Cc: Garrett Kirkendall 
Cc: Abner Chang 
Cc: Eric Dong 
Cc: Ray Ni 
Cc: Rahul Kumar 
Signed-off-by: Abdul Lateef Attar 
---
 .../AmdSmmCpuFeaturesLib.inf  |   2 +
 .../SmmCpuFeaturesLib/Amd/SmramSaveState.h| 109 +
 .../SmmCpuFeaturesLib/Amd/SmmCpuFeaturesLib.c |  97 -
 .../SmmCpuFeaturesLib/Amd/SmramSaveState.c| 409 ++
 4 files changed, 612 insertions(+), 5 deletions(-)
 create mode 100644 UefiCpuPkg/Library/SmmCpuFeaturesLib/Amd/SmramSaveState.h
 create mode 100644 UefiCpuPkg/Library/SmmCpuFeaturesLib/Amd/SmramSaveState.c

diff --git a/UefiCpuPkg/Library/SmmCpuFeaturesLib/AmdSmmCpuFeaturesLib.inf 
b/UefiCpuPkg/Library/SmmCpuFeaturesLib/AmdSmmCpuFeaturesLib.inf
index 08ac0262022f..95eb31d16ead 100644
--- a/UefiCpuPkg/Library/SmmCpuFeaturesLib/AmdSmmCpuFeaturesLib.inf
+++ b/UefiCpuPkg/Library/SmmCpuFeaturesLib/AmdSmmCpuFeaturesLib.inf
@@ -21,6 +21,8 @@ [Sources]
   SmmCpuFeaturesLib.c

   SmmCpuFeaturesLibCommon.c

   Amd/SmmCpuFeaturesLib.c

+  Amd/SmramSaveState.c

+  Amd/SmramSaveState.h

 

 [Packages]

   MdePkg/MdePkg.dec

diff --git a/UefiCpuPkg/Library/SmmCpuFeaturesLib/Amd/SmramSaveState.h 
b/UefiCpuPkg/Library/SmmCpuFeaturesLib/Amd/SmramSaveState.h
new file mode 100644
index ..290ebdbc9227
--- /dev/null
+++ b/UefiCpuPkg/Library/SmmCpuFeaturesLib/Amd/SmramSaveState.h
@@ -0,0 +1,109 @@
+/** @file

+SMRAM Save State Map header file.

+

+Copyright (c) 2010 - 2019, Intel Corporation. All rights reserved.

+Copyright (C) 2022 Advanced Micro Devices, Inc. All rights reserved.

+SPDX-License-Identifier: BSD-2-Clause-Patent

+

+**/

+

+#ifndef SMRAM_SAVESTATE_H_

+#define SMRAM_SAVESTATE_H_

+

+#include 

+#include 

+#include 

+#include 

+#include 

+#include 

+#include 

+

+// EFER register LMA bit

+#define LMA  BIT10

+

+// Machine Specific Registers (MSRs)

+#define SMMADDR_ADDRESS  0xC0010112ul

+#define SMMMASK_ADDRESS  0xC0010113ul

+#define EFER_ADDRESS 0XC080ul

+

+// Macro used to simplify the lookup table entries of type 
CPU_SMM_SAVE_STATE_LOOKUP_ENTRY

+#define SMM_CPU_OFFSET(Field)  OFFSET_OF (AMD_SMRAM_SAVE_STATE_MAP, Field)

+

+// Macro used to simplify the lookup table entries of type 
CPU_SMM_SAVE_STATE_REGISTER_RANGE

+#define SMM_REGISTER_RANGE(Start, End)  { Start, End, End - Start + 1 }

+

+// Structure used to describe a range of registers

+typedef struct {

+  EFI_SMM_SAVE_STATE_REGISTERStart;

+  EFI_SMM_SAVE_STATE_REGISTEREnd;

+  UINTN  Length;

+} CPU_SMM_SAVE_STATE_REGISTER_RANGE;

+

+// Structure used to build a lookup table to retrieve the widths and offsets

+// associated with each supported EFI_SMM_SAVE_STATE_REGISTER value

+

+#define SMM_SAVE_STATE_REGISTER_SMMREVID_INDEX  1

+#define SMM_SAVE_STATE_REGISTER_MAX_INDEX   2

+

+typedef struct {

+  UINT8  Width32;

+  UINT8  Width64;

+  UINT16 Offset32;

+  UINT16 Offset64Lo;

+  UINT16 Offset64Hi;

+  BOOLEANWriteable;

+} CPU_SMM_SAVE_STATE_LOOKUP_ENTRY;

+

+/**

+  Read an SMM Save State register on the target processor.  If this function

+  returns EFI_UNSUPPORTED, then the caller is responsible for reading the

+  SMM Save Sate register.

+

+  @param[in]  CpuIndex  The index of the CPU to read the SMM Save State.  The

+value must be between 0 and the NumberOfCpus field in

+the System Management System Table (SMST).

+  @param[in]  Register  The SMM Save State register to read.

+  @param[in]  Width The number of bytes to read from the CPU save state.

+  @param[out] BufferUpon return, this holds the CPU register value read

+from the save state.

+

+  @retval EFI_SUCCESS   The register was read from Save State.

+  @retval EFI_INVALID_PARAMTER  Buffer is NULL.

+  @retval EFI_UNSUPPORTED   This function does not support reading 
Register.

+

+**/

+EFI_STATUS

+EFIAPI

+InternalSmmCpuFeaturesReadSaveStateRegister (

+  IN  UINTNCpuIndex,

+  IN  EFI_SMM_SAVE_STATE_REGISTER  Register,

+  IN  UINTNWidth,

+  OUT VOID *Buffer

+  );

+

+/**

+  Writes an SMM Save State register on the target processor.  If this function

+  returns EFI_UNSUPPORTED, then the caller is responsible for writing the

+  SMM Save Sate register.

+

+  @param[in] CpuIndex  The index of the CPU to write the SMM Save State.  The

+   value must be between 0 and the NumberOfCpus field in

+   the System Management System Table (SMST).

+  @param[in] Register  The SMM Save State 

[edk2-devel] [PATCH v1 5/5] UefiCpuPkg/AmdSmmCpuFeaturesLib: Handles S3 save state

2022-12-06 Thread Abdul Lateef Attar via groups.io
From: Abdul Lateef Attar 

BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=4182

Handles S3 save state restore condition.
Implements SmmCpuFeaturesCompleteSmmReadyToLock() to
sync all processor and update S3 resume entry point.

Cc: Paul Grimes 
Cc: Garrett Kirkendall 
Cc: Abner Chang 
Cc: Eric Dong 
Cc: Ray Ni 
Cc: Rahul Kumar 
Signed-off-by: Abdul Lateef Attar 
---
 .../AmdSmmCpuFeaturesLib.inf  |  1 +
 .../SmmCpuFeaturesLib/Amd/SmramSaveState.h| 19 +++
 .../SmmCpuFeaturesLib/Amd/SmmCpuFeaturesLib.c | 32 +++
 3 files changed, 52 insertions(+)

diff --git a/UefiCpuPkg/Library/SmmCpuFeaturesLib/AmdSmmCpuFeaturesLib.inf 
b/UefiCpuPkg/Library/SmmCpuFeaturesLib/AmdSmmCpuFeaturesLib.inf
index 95eb31d16ead..7fd559e91ad8 100644
--- a/UefiCpuPkg/Library/SmmCpuFeaturesLib/AmdSmmCpuFeaturesLib.inf
+++ b/UefiCpuPkg/Library/SmmCpuFeaturesLib/AmdSmmCpuFeaturesLib.inf
@@ -27,6 +27,7 @@ [Sources]
 [Packages]

   MdePkg/MdePkg.dec

   UefiCpuPkg/UefiCpuPkg.dec

+  MdeModulePkg/MdeModulePkg.dec

 

 [LibraryClasses]

   BaseLib

diff --git a/UefiCpuPkg/Library/SmmCpuFeaturesLib/Amd/SmramSaveState.h 
b/UefiCpuPkg/Library/SmmCpuFeaturesLib/Amd/SmramSaveState.h
index 290ebdbc9227..474a5dbd9765 100644
--- a/UefiCpuPkg/Library/SmmCpuFeaturesLib/Amd/SmramSaveState.h
+++ b/UefiCpuPkg/Library/SmmCpuFeaturesLib/Amd/SmramSaveState.h
@@ -17,6 +17,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
 #include 

 #include 

 #include 

+#include 

 

 // EFER register LMA bit

 #define LMA  BIT10

@@ -106,4 +107,22 @@ InternalSmmCpuFeaturesWriteSaveStateRegister (
   IN CONST VOID   *Buffer

   );

 

+/**

+  Initialize MP synchronization data.

+**/

+VOID

+EFIAPI

+InitializeMpSyncData (

+  VOID

+  );

+

+/**

+  Perform SMM MP sync Semaphores re-initialization in the S3 boot path.

+**/

+VOID

+EFIAPI

+SmmS3MpSemaphoreInit (

+  VOID

+  );

+

 #endif

diff --git a/UefiCpuPkg/Library/SmmCpuFeaturesLib/Amd/SmmCpuFeaturesLib.c 
b/UefiCpuPkg/Library/SmmCpuFeaturesLib/Amd/SmmCpuFeaturesLib.c
index 10bed4116397..b855573d9401 100644
--- a/UefiCpuPkg/Library/SmmCpuFeaturesLib/Amd/SmmCpuFeaturesLib.c
+++ b/UefiCpuPkg/Library/SmmCpuFeaturesLib/Amd/SmmCpuFeaturesLib.c
@@ -14,6 +14,9 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
 // The mode of the CPU at the time an SMI occurs

 extern UINT8  mSmmSaveStateRegisterLma;

 

+// SMM S3 resume state Ptr

+extern SMM_S3_RESUME_STATE  *mSmmS3ResumeState;

+

 /**

   Read an SMM Save State register on the target processor.  If this function

   returns EFI_UNSUPPORTED, then the caller is responsible for reading the

@@ -441,4 +444,33 @@ SmmCpuFeaturesCompleteSmmReadyToLock (
   VOID

   )

 {

+  if (mSmmS3ResumeState != NULL ) {

+mSmmS3ResumeState->SmmS3ResumeEntryPoint = 
(EFI_PHYSICAL_ADDRESS)(UINTN)SmmS3MpSemaphoreInit;

+  }

+}

+

+/**

+  Perform SMM MP sync Semaphores re-initialization in the S3 boot path.

+**/

+VOID

+EFIAPI

+SmmS3MpSemaphoreInit (

+  VOID

+  )

+{

+  InitializeMpSyncData ();

+

+  DEBUG ((DEBUG_INFO, "SMM S3 Return CS= %x\n", 
mSmmS3ResumeState->ReturnCs));

+  DEBUG ((DEBUG_INFO, "SMM S3 Return Entry Point   = %x\n", 
mSmmS3ResumeState->ReturnEntryPoint));

+  DEBUG ((DEBUG_INFO, "SMM S3 Return Context1  = %x\n", 
mSmmS3ResumeState->ReturnContext1));

+  DEBUG ((DEBUG_INFO, "SMM S3 Return Context2  = %x\n", 
mSmmS3ResumeState->ReturnContext2));

+  DEBUG ((DEBUG_INFO, "SMM S3 Return Stack Pointer = %x\n", 
mSmmS3ResumeState->ReturnStackPointer));

+

+  AsmDisablePaging64 (

+mSmmS3ResumeState->ReturnCs,

+(UINT32)mSmmS3ResumeState->ReturnEntryPoint,

+(UINT32)mSmmS3ResumeState->ReturnContext1,

+(UINT32)mSmmS3ResumeState->ReturnContext2,

+(UINT32)mSmmS3ResumeState->ReturnStackPointer

+);

 }

-- 
2.25.1



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




[edk2-devel] [PATCH v1 3/5] UefiCpuPkg: Initial implementation of AMD's SmmCpuFeaturesLib

2022-12-06 Thread Abdul Lateef Attar via groups.io
From: Abdul Lateef Attar 

BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=4182

Adds initial defination for AMD's SmmCpuFeaturesLib
library implementation.
All function's body either empty or just returns
value. Its initial skeleton of library implementation.

Cc: Paul Grimes 
Cc: Garrett Kirkendall 
Cc: Abner Chang 
Cc: Eric Dong 
Cc: Ray Ni 
Cc: Rahul Kumar 
Signed-off-by: Abdul Lateef Attar 
---
 UefiCpuPkg/UefiCpuPkg.dsc |   9 +
 .../AmdSmmCpuFeaturesLib.inf  |  37 ++
 .../SmmCpuFeaturesLib/Amd/SmmCpuFeaturesLib.c | 357 ++
 3 files changed, 403 insertions(+)
 create mode 100644 
UefiCpuPkg/Library/SmmCpuFeaturesLib/AmdSmmCpuFeaturesLib.inf
 create mode 100644 UefiCpuPkg/Library/SmmCpuFeaturesLib/Amd/SmmCpuFeaturesLib.c

diff --git a/UefiCpuPkg/UefiCpuPkg.dsc b/UefiCpuPkg/UefiCpuPkg.dsc
index 67b0ce46e455..8aeaf992af9b 100644
--- a/UefiCpuPkg/UefiCpuPkg.dsc
+++ b/UefiCpuPkg/UefiCpuPkg.dsc
@@ -2,6 +2,7 @@
 #  UefiCpuPkg Package

 #

 #  Copyright (c) 2007 - 2022, Intel Corporation. All rights reserved.

+#  Copyright (C) 2022 Advanced Micro Devices, Inc. All rights reserved.

 #

 #  SPDX-License-Identifier: BSD-2-Clause-Patent

 #

@@ -160,6 +161,7 @@ [Components.IA32, Components.X64]
   UefiCpuPkg/Library/RegisterCpuFeaturesLib/PeiRegisterCpuFeaturesLib.inf

   UefiCpuPkg/Library/RegisterCpuFeaturesLib/DxeRegisterCpuFeaturesLib.inf

   UefiCpuPkg/Library/SmmCpuPlatformHookLibNull/SmmCpuPlatformHookLibNull.inf

+  UefiCpuPkg/Library/SmmCpuFeaturesLib/AmdSmmCpuFeaturesLib.inf

   UefiCpuPkg/Library/SmmCpuFeaturesLib/SmmCpuFeaturesLib.inf

   UefiCpuPkg/Library/SmmCpuFeaturesLib/SmmCpuFeaturesLibStm.inf

   UefiCpuPkg/Library/SmmCpuFeaturesLib/StandaloneMmCpuFeaturesLib.inf

@@ -176,6 +178,13 @@ [Components.IA32, Components.X64]
 

   
SmmCpuFeaturesLib|UefiCpuPkg/Library/SmmCpuFeaturesLib/SmmCpuFeaturesLibStm.inf

   }

+  UefiCpuPkg/PiSmmCpuDxeSmm/PiSmmCpuDxeSmm.inf {

+

+  FILE_GUID = B7242C74-BD21-49EE-84B4-07162E8C080D

+

+  
SmmCpuFeaturesLib|UefiCpuPkg/Library/SmmCpuFeaturesLib/AmdSmmCpuFeaturesLib.inf

+  
SmmCpuPlatformHookLib|UefiCpuPkg/Library/SmmCpuPlatformHookLibNull/SmmCpuPlatformHookLibNull.inf

+  }

   UefiCpuPkg/Universal/Acpi/S3Resume2Pei/S3Resume2Pei.inf

   UefiCpuPkg/ResetVector/Vtf0/Bin/ResetVector.inf

   UefiCpuPkg/Library/SmmCpuRendezvousLib/SmmCpuRendezvousLib.inf

diff --git a/UefiCpuPkg/Library/SmmCpuFeaturesLib/AmdSmmCpuFeaturesLib.inf 
b/UefiCpuPkg/Library/SmmCpuFeaturesLib/AmdSmmCpuFeaturesLib.inf
new file mode 100644
index ..08ac0262022f
--- /dev/null
+++ b/UefiCpuPkg/Library/SmmCpuFeaturesLib/AmdSmmCpuFeaturesLib.inf
@@ -0,0 +1,37 @@
+## @file

+#  The CPU specific programming for PiSmmCpuDxeSmm module.

+#

+#  Copyright (c) 2009 - 2016, Intel Corporation. All rights reserved.

+#  Copyright (C) 2022 Advanced Micro Devices, Inc. All rights reserved.

+#  SPDX-License-Identifier: BSD-2-Clause-Patent

+#

+##

+

+[Defines]

+  INF_VERSION= 0x00010005

+  BASE_NAME  = SmmCpuFeaturesLib

+  MODULE_UNI_FILE= SmmCpuFeaturesLib.uni

+  FILE_GUID  = 5849E964-78EC-428E-8CBD-848A7E359134

+  MODULE_TYPE= DXE_SMM_DRIVER

+  VERSION_STRING = 1.0

+  LIBRARY_CLASS  = SmmCpuFeaturesLib

+  CONSTRUCTOR= SmmCpuFeaturesLibConstructor

+

+[Sources]

+  SmmCpuFeaturesLib.c

+  SmmCpuFeaturesLibCommon.c

+  Amd/SmmCpuFeaturesLib.c

+

+[Packages]

+  MdePkg/MdePkg.dec

+  UefiCpuPkg/UefiCpuPkg.dec

+

+[LibraryClasses]

+  BaseLib

+  PcdLib

+  MemoryAllocationLib

+  DebugLib

+

+[FeaturePcd]

+  gUefiCpuPkgTokenSpaceGuid.PcdSmrrEnable   ## CONSUMES

+  gUefiCpuPkgTokenSpaceGuid.PcdSmmFeatureControlEnable  ## CONSUMES

diff --git a/UefiCpuPkg/Library/SmmCpuFeaturesLib/Amd/SmmCpuFeaturesLib.c 
b/UefiCpuPkg/Library/SmmCpuFeaturesLib/Amd/SmmCpuFeaturesLib.c
new file mode 100644
index ..dc3fed0302d2
--- /dev/null
+++ b/UefiCpuPkg/Library/SmmCpuFeaturesLib/Amd/SmmCpuFeaturesLib.c
@@ -0,0 +1,357 @@
+/** @file

+Implementation specific to the SmmCpuFeatureLib library instance

+for AMD based platforms.

+

+Copyright (c) 2010 - 2019, Intel Corporation. All rights reserved.

+Copyright (c) Microsoft Corporation.

+Copyright (C) 2022 Advanced Micro Devices, Inc. All rights reserved.

+SPDX-License-Identifier: BSD-2-Clause-Patent

+

+**/

+

+#include 

+#include 

+

+/**

+  Read an SMM Save State register on the target processor.  If this function

+  returns EFI_UNSUPPORTED, then the caller is responsible for reading the

+  SMM Save Sate register.

+

+  @param[in]  CpuIndex  The index of the CPU to read the SMM Save State.  The

+value must be between 0 and the NumberOfCpus field in

+the System Management System Table (SMST).

+  @param[in]  Register  The SMM Save State 

[edk2-devel] [PATCH v1 1/5] UefiCpuPkg/SmmCpuFeaturesLib: Restructure arch-dependent code

2022-12-06 Thread Abdul Lateef Attar via groups.io
From: Abdul Lateef Attar 

BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=4182

moves Intel-specific code to the arch-dependent file.
Other processor families might have different
implementation of these functions.
Hence, moving out of the common file.

Cc: Abner Chang 
Cc: Garrett Kirkendall 
Cc: Paul Grimes 
Cc: Eric Dong 
Cc: Ray Ni 
Cc: Rahul Kumar 
Signed-off-by: Abdul Lateef Attar 
---
 .../IntelSmmCpuFeaturesLib.c  | 140 ++
 .../SmmCpuFeaturesLibCommon.c | 140 --
 2 files changed, 140 insertions(+), 140 deletions(-)

diff --git a/UefiCpuPkg/Library/SmmCpuFeaturesLib/IntelSmmCpuFeaturesLib.c 
b/UefiCpuPkg/Library/SmmCpuFeaturesLib/IntelSmmCpuFeaturesLib.c
index d5eaaa7a991e..994267f393b3 100644
--- a/UefiCpuPkg/Library/SmmCpuFeaturesLib/IntelSmmCpuFeaturesLib.c
+++ b/UefiCpuPkg/Library/SmmCpuFeaturesLib/IntelSmmCpuFeaturesLib.c
@@ -400,3 +400,143 @@ SmmCpuFeaturesSetSmmRegister (
 AsmWriteMsr64 (SMM_FEATURES_LIB_SMM_FEATURE_CONTROL, Value);

   }

 }

+

+/**

+  This function updates the SMRAM save state on the currently executing CPU

+  to resume execution at a specific address after an RSM instruction.  This

+  function must evaluate the SMRAM save state to determine the execution mode

+  the RSM instruction resumes and update the resume execution address with

+  either NewInstructionPointer32 or NewInstructionPoint.  The auto HALT restart

+  flag in the SMRAM save state must always be cleared.  This function returns

+  the value of the instruction pointer from the SMRAM save state that was

+  replaced.  If this function returns 0, then the SMRAM save state was not

+  modified.

+

+  This function is called during the very first SMI on each CPU after

+  SmmCpuFeaturesInitializeProcessor() to set a flag in normal execution mode

+  to signal that the SMBASE of each CPU has been updated before the default

+  SMBASE address is used for the first SMI to the next CPU.

+

+  @param[in] CpuIndex The index of the CPU to hook.  The value

+  must be between 0 and the NumberOfCpus

+  field in the System Management System 
Table

+  (SMST).

+  @param[in] CpuState Pointer to SMRAM Save State Map for the

+  currently executing CPU.

+  @param[in] NewInstructionPointer32  Instruction pointer to use if resuming to

+  32-bit execution mode from 64-bit SMM.

+  @param[in] NewInstructionPointerInstruction pointer to use if resuming to

+  same execution mode as SMM.

+

+  @retval 0This function did modify the SMRAM save state.

+  @retval > 0  The original instruction pointer value from the SMRAM save state

+   before it was replaced.

+**/

+UINT64

+EFIAPI

+SmmCpuFeaturesHookReturnFromSmm (

+  IN UINTN CpuIndex,

+  IN SMRAM_SAVE_STATE_MAP  *CpuState,

+  IN UINT64NewInstructionPointer32,

+  IN UINT64NewInstructionPointer

+  )

+{

+  return 0;

+}

+

+/**

+  Read an SMM Save State register on the target processor.  If this function

+  returns EFI_UNSUPPORTED, then the caller is responsible for reading the

+  SMM Save Sate register.

+

+  @param[in]  CpuIndex  The index of the CPU to read the SMM Save State.  The

+value must be between 0 and the NumberOfCpus field in

+the System Management System Table (SMST).

+  @param[in]  Register  The SMM Save State register to read.

+  @param[in]  Width The number of bytes to read from the CPU save state.

+  @param[out] BufferUpon return, this holds the CPU register value read

+from the save state.

+

+  @retval EFI_SUCCESS   The register was read from Save State.

+  @retval EFI_INVALID_PARAMETER  Buffer is NULL.

+  @retval EFI_UNSUPPORTED   This function does not support reading 
Register.

+

+**/

+EFI_STATUS

+EFIAPI

+SmmCpuFeaturesReadSaveStateRegister (

+  IN  UINTNCpuIndex,

+  IN  EFI_SMM_SAVE_STATE_REGISTER  Register,

+  IN  UINTNWidth,

+  OUT VOID *Buffer

+  )

+{

+  return EFI_UNSUPPORTED;

+}

+

+/**

+  Writes an SMM Save State register on the target processor.  If this function

+  returns EFI_UNSUPPORTED, then the caller is responsible for writing the

+  SMM Save Sate register.

+

+  @param[in] CpuIndex  The index of the CPU to write the SMM Save State.  The

+   value must be between 0 and the NumberOfCpus field in

+   the System Management System Table (SMST).

+  @param[in] Register  The SMM Save State register to write.

+  @param[in] Width The number of bytes to write to the CPU save state.

+  @param[in] BufferUpon 

[edk2-devel] [PATCH v1 0/5] Adds AmdSmmCpuFeaturesLib

2022-12-06 Thread Abdul Lateef Attar via groups.io
Implements SmmCpuFeaturesLib library class for AMD processor family.
Adds AMD processor families processor save state registers.
Implements required functions.
Handles S3 save state from SMM.

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

Cc: Paul Grimes 
Cc: Garrett Kirkendall 
Cc: Abner Chang 
Cc: Eric Dong 
Cc: Ray Ni 
Cc: Rahul Kumar 
Cc: Michael D Kinney 
Cc: Liming Gao 
Cc: Zhiguang Liu 

Abdul Lateef Attar (5):
  UefiCpuPkg/SmmCpuFeaturesLib: Restructure arch-dependent code
  MdePkg: Adds AMD SMRAM save state map
  UefiCpuPkg: Initial implementation of AMD's SmmCpuFeaturesLib
  UefiCpuPkg: Implements SmmCpuFeaturesLib for AMD Family
  UefiCpuPkg/AmdSmmCpuFeaturesLib: Handles S3 save state

 UefiCpuPkg/UefiCpuPkg.dsc |   9 +
 .../AmdSmmCpuFeaturesLib.inf  |  40 ++
 .../Include/Register/Amd/SmramSaveStateMap.h  | 194 +++
 .../SmmCpuFeaturesLib/Amd/SmramSaveState.h| 128 +
 .../SmmCpuFeaturesLib/Amd/SmmCpuFeaturesLib.c | 476 ++
 .../SmmCpuFeaturesLib/Amd/SmramSaveState.c| 409 +++
 .../IntelSmmCpuFeaturesLib.c  | 140 ++
 .../SmmCpuFeaturesLibCommon.c | 140 --
 MdePkg/MdePkg.ci.yaml |   3 +-
 9 files changed, 1398 insertions(+), 141 deletions(-)
 create mode 100644 
UefiCpuPkg/Library/SmmCpuFeaturesLib/AmdSmmCpuFeaturesLib.inf
 create mode 100644 MdePkg/Include/Register/Amd/SmramSaveStateMap.h
 create mode 100644 UefiCpuPkg/Library/SmmCpuFeaturesLib/Amd/SmramSaveState.h
 create mode 100644 UefiCpuPkg/Library/SmmCpuFeaturesLib/Amd/SmmCpuFeaturesLib.c
 create mode 100644 UefiCpuPkg/Library/SmmCpuFeaturesLib/Amd/SmramSaveState.c

-- 
2.25.1



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




Re: [edk2-devel] [PATCH v4 1/1] MdePkg/BaseRngLib: Add a smoketest for RDRAND and check CPUID

2022-12-06 Thread Pedro Falcato
Hi,

Ping. Is there a blocker here?

Pedro


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




[edk2-devel] [edk2-platform][PATCH 1/1] MdeModulePkg: SdMmcPciHcDxe: Fix issue that SD1.0 cards can't be recognized

2022-12-06 Thread Chevron Li
From: "Chevron Li (WH)" 


SD1.0 cards don't support CMD8 and CMD6

CMD8 result can be used to distinguish the card is SD1.0 or not.

CMD8 result can be used to decide following CMD6 is sent or skip.



Cc: Hao A Wu 

Cc: Ray Ni 

Cc: Jian J Wang 

Cc: Liming Gao 

Signed-off-by: Chevron Li 

---

 MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdDevice.c | 30 ---

 1 file changed, 20 insertions(+), 10 deletions(-)



diff --git a/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdDevice.c 
b/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdDevice.c

index f5a3607e47..281aa38170 100644

--- a/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdDevice.c

+++ b/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdDevice.c

@@ -1085,7 +1085,8 @@ SdCardSetBusMode (

   IN EFI_SD_MMC_PASS_THRU_PROTOCOL  *PassThru,

   IN UINT8  Slot,

   IN UINT16 Rca,

-  IN BOOLEANS18A

+  IN BOOLEANS18A,

+  IN BOOLEANSdVersion1

   )

 {

   EFI_STATUS  Status;

@@ -1117,10 +1118,13 @@ SdCardSetBusMode (

 

   //

   // Get the supported bus speed from SWITCH cmd return data group #1.

+  // SdVersion1 don't support the SWITCH cmd

   //

-  Status = SdCardSwitch (PassThru, Slot, 0xFF, 0xF, SdDriverStrengthIgnore, 
0xF, FALSE, SwitchResp);

-  if (EFI_ERROR (Status)) {

-return Status;

+  if(SdVersion1 == FALSE) {

+Status = SdCardSwitch (PassThru, Slot, 0xFF, 0xF, SdDriverStrengthIgnore, 
0xF, FALSE, SwitchResp);

+if (EFI_ERROR (Status)) {

+  return Status;

+}

   }

 

   SdGetTargetBusMode (Private, Slot, SwitchResp, S18A, );

@@ -1141,9 +1145,14 @@ SdCardSetBusMode (

 }

   }

 

-  Status = SdCardSwitch (PassThru, Slot, BusMode.BusTiming, 0xF, 
BusMode.DriverStrength.Sd, 0xF, TRUE, SwitchResp);

-  if (EFI_ERROR (Status)) {

-return Status;

+  //

+  // SdVersion1 don't support the SWITCH cmd

+  //

+  if(SdVersion1 == FALSE){

+Status = SdCardSwitch (PassThru, Slot, BusMode.BusTiming, 0xF, 
BusMode.DriverStrength.Sd, 0xF, TRUE, SwitchResp);

+if (EFI_ERROR (Status)) {

+  return Status;

+}

   }

 

   Status = SdMmcSetDriverStrength (Private->PciIo, Slot, 
BusMode.DriverStrength.Sd);

@@ -1214,6 +1223,7 @@ SdCardIdentification (

   UINT8  HostCtrl2;

   UINTN  Retry;

   BOOLEANForceVoltage33;

+  BOOLEANSdVersion1;

 

   ForceVoltage33 = FALSE;

 

@@ -1231,12 +1241,12 @@ Voltage33Retry:

   }

 

   //

-  // 2. Send Cmd8 to the device

+  // 2. Send Cmd8 to the device, the command will fail for SdVersion1;

   //

   Status = SdCardVoltageCheck (PassThru, Slot, 0x1, 0xFF);

   if (EFI_ERROR (Status)) {

+SdVersion1 = 1;

 DEBUG ((DEBUG_INFO, "SdCardIdentification: Executing Cmd8 fails with 
%r\n", Status));

-return Status;

   }

 

   //

@@ -1426,7 +1436,7 @@ Voltage33Retry:

   DEBUG ((DEBUG_INFO, "SdCardIdentification: Found a SD device at slot 
[%d]\n", Slot));

   Private->Slot[Slot].CardType = SdCardType;

 

-  Status = SdCardSetBusMode (PciIo, PassThru, Slot, Rca, ((Ocr & BIT24) != 0));

+  Status = SdCardSetBusMode (PciIo, PassThru, Slot, Rca, ((Ocr & BIT24) != 0), 
SdVersion1);

 

   return Status;

 



base-commit: 7bee2498910a9034faaf90802c49188afb7582dc

-- 

2.18.0.windows.1





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




[edk2-devel] 回复: [edk2-platform][PATCH 1/1] MdeModulePkg: SdMmcPciHcDxe: Fix issue that SD1.0 cards can't be recognized

2022-12-06 Thread Chevron Li (WH)
Thanks for your response.

I will update patch later according to your suggestions.

Answer your questions below.

BR,
Chevron

> -邮件原件-
> 发件人: Wu, Hao A 
> 发送时间: Tuesday, December 6, 2022 16:28
> 收件人: Chevron Li (WH) ;
> devel@edk2.groups.io
> 抄送: Ni, Ray ; Wang, Jian J ; Gao,
> Liming ; Shirley Her(SC)
> ; Shaper Liu (WH)
> ; XiaoGuang Yu (WH)
> 
> 主题: RE: [edk2-platform][PATCH 1/1] MdeModulePkg: SdMmcPciHcDxe: Fix
> issue that SD1.0 cards can't be recognized
> 
> Hello,
> 
> The proposed patch will cause CI test failure:
> https://github.com/tianocore/edk2/pull/3724. Could you help to resolve
> them?

Yes, I will update according to your suggestions.

> May I know what kind of tests have been performed for this patch? Have
> you tried with non SD1.0 cards and make sure that they still work fine after
> the patch?
> 

We have tested this patch with SD1.0 cards and SD2.0, SD3.0 cards, all of them 
can work right.
Test items are application level:
Such as card identify, create file, delete file.

> Also, serveral more inline comments below:
> 
> 
> > -Original Message-
> > From: Chevron Li 
> > Sent: Tuesday, December 6, 2022 2:48 PM
> > To: devel@edk2.groups.io
> > Cc: Wu, Hao A ; Ni, Ray ; Wang,
> > Jian J ; Gao, Liming
> > ; shirley@bayhubtech.com;
> > shaper@bayhubtech.com; xiaoguang...@bayhubtech.com; Chevron Li
> > (WH) 
> > Subject: [edk2-platform][PATCH 1/1] MdeModulePkg: SdMmcPciHcDxe:
> Fix
> > issue that SD1.0 cards can't be recognized
> >
> > From: "Chevron Li (WH)" 
> >
> >
> > SD1.0 cards don't support CMD8 and CMD6
> >
> > CMD8 result can be used to distinguish the card is SD1.0 or not.
> >
> > CMD8 result can be used to decide following CMD6 is sent or skip.
> >
> >
> >
> > Cc: Hao A Wu 
> >
> > Cc: Ray Ni 
> >
> > Cc: Jian J Wang 
> >
> > Cc: Liming Gao 
> >
> > Signed-off-by: Chevron Li 
> >
> > ---
> >
> >  MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdDevice.c | 30
> ---
> > 
> >
> >  1 file changed, 20 insertions(+), 10 deletions(-)
> >
> >
> >
> > diff --git a/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdDevice.c
> > b/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdDevice.c
> >
> > index f5a3607e47..281aa38170 100644
> >
> > --- a/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdDevice.c
> >
> > +++ b/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdDevice.c
> >
> > @@ -1085,7 +1085,8 @@ SdCardSetBusMode (
> >
> >IN EFI_SD_MMC_PASS_THRU_PROTOCOL  *PassThru,
> >
> >IN UINT8  Slot,
> >
> >IN UINT16 Rca,
> >
> > -  IN BOOLEANS18A
> >
> > +  IN BOOLEANS18A,
> >
> > +  IN BOOLEANSdVersion1
> 
> 
> For the newly added input parameter 'SdVersion1', please help to update
> the function description comments to reflect it.
> 
> 
> >
> >)
> >
> >  {
> >
> >EFI_STATUS  Status;
> >
> > @@ -1117,10 +1118,13 @@ SdCardSetBusMode (
> >
> >
> >
> >//
> >
> >// Get the supported bus speed from SWITCH cmd return data group #1.
> >
> > +  // SdVersion1 don't support the SWITCH cmd
> >
> >//
> >
> > -  Status = SdCardSwitch (PassThru, Slot, 0xFF, 0xF,
> > SdDriverStrengthIgnore, 0xF, FALSE, SwitchResp);
> >
> > -  if (EFI_ERROR (Status)) {
> >
> > -return Status;
> >
> > +  if(SdVersion1 == FALSE) {
> >
> > +Status = SdCardSwitch (PassThru, Slot, 0xFF, 0xF,
> > + SdDriverStrengthIgnore,
> > 0xF, FALSE, SwitchResp);
> 
> 
> The local variable 'SwitchResp' is an output parameter for SdCardSwitch().
> When SdVersion1 is TRUE, SdCardSwitch() call will be skipped and
> 'SwitchResp' will have uninitialized value.
> This will probably cause issues when 'SwitchResp' later being used as an input
> parameter for SdGetTargetBusMode() function call.
> Could you help to check on this?
> 
> 
> >
> > +if (EFI_ERROR (Status)) {
> >
> > +  return Status;
> >
> > +}
> >
> >}
> >
> >
> >
> >SdGetTargetBusMode (Private, Slot, SwitchResp, S18A, );
> >
> > @@ -1141,9 +1145,14 @@ SdCardSetBusMode (
> >
> >  }
> >
> >}
> >
> >
> >
> > -  Status = SdCardSwitch (PassThru, Slot, BusMode.BusTiming, 0xF,
> > BusMode.DriverStrength.Sd, 0xF, TRUE, SwitchResp);
> >
> > -  if (EFI_ERROR (Status)) {
> >
> > -return Status;
> >
> > +  //
> >
> > +  // SdVersion1 don't support the SWITCH cmd
> >
> > +  //
> >
> > +  if(SdVersion1 == FALSE){
> >
> > +Status = SdCardSwitch (PassThru, Slot, BusMode.BusTiming, 0xF,
> > BusMode.DriverStrength.Sd, 0xF, TRUE, SwitchResp);
> >
> > +if (EFI_ERROR (Status)) {
> >
> > +  return Status;
> >
> > +}
> >
> >}
> >
> >
> >
> >Status = SdMmcSetDriverStrength (Private->PciIo, Slot,
> > BusMode.DriverStrength.Sd);
> >
> > @@ -1214,6 +1223,7 @@ SdCardIdentification (
> >
> >UINT8  HostCtrl2;
> >
> >UINTN  Retry;
> >
> >BOOLEANForceVoltage33;
> >
> > +  BOOLEANSdVersion1;
> >
> >
> >
> >

[edk2-devel] [PATCH v2] Maintainer.txt: add myself as reviewer for bhyve's OvmfPkg

2022-12-06 Thread Corvin Köhne
Signed-off-by: Corvin Köhne 
Reviewed-by: Rebecca Cran 
Reviewed-by: Peter Grehan 
Cc: Andrew Fish 
Cc: Leif Lindholm 
Cc: Michael D Kinney 
Cc: devel@edk2.groups.io
---
 Maintainers.txt | 1 +
 1 file changed, 1 insertion(+)

diff --git a/Maintainers.txt b/Maintainers.txt
index 7e98083685..3ea9a4cca6 100644
--- a/Maintainers.txt
+++ b/Maintainers.txt
@@ -457,6 +457,7 @@ F: OvmfPkg/Library/ResetSystemLib/BaseResetShutdownBhyve.c
 F: OvmfPkg/Library/ResetSystemLib/BaseResetSystemLibBhyve.inf

 R: Rebecca Cran  [bcran]

 R: Peter Grehan  [grehan-freebsd]

+R: Corvin Köhne  [corvink]

 

 OvmfPkg: cloudhv-related modules

 F: OvmfPkg/CloudHv/

-- 
2.37.3.windows.1



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




[edk2-devel] [PATCH 1/3] ArmPkg: Fix typos

2022-12-06 Thread Dongdong Zhang
Fix some typos in ArmPkg directory.

Signed-off-by: Dongdong Zhang 
---
 ArmPkg/Drivers/ArmScmiDxe/ScmiDxe.c | 2 +-
 ArmPkg/Include/Library/OemMiscLib.h | 2 +-
 ArmPkg/Library/ArmDisassemblerLib/ThumbDisassembler.c   | 6 +++---
 ArmPkg/Library/ArmLib/AArch64/ArmLibSupport.S   | 2 +-
 ArmPkg/Library/ArmLib/AArch64/ArmLibSupportV8.S | 2 +-
 ArmPkg/Library/SemihostLib/Arm/GccSemihost.S| 2 +-
 ArmPkg/Library/StandaloneMmMmuLib/ArmMmuStandaloneMmLib.c   | 6 +++---
 ArmPkg/Universal/Smbios/OemMiscLibNull/OemMiscLib.c | 2 +-
 .../Smbios/ProcessorSubClassDxe/SmbiosProcessorArmCommon.c  | 2 +-
 9 files changed, 13 insertions(+), 13 deletions(-)

diff --git a/ArmPkg/Drivers/ArmScmiDxe/ScmiDxe.c 
b/ArmPkg/Drivers/ArmScmiDxe/ScmiDxe.c
index 1fc448b9bf..a9cff0c395 100644
--- a/ArmPkg/Drivers/ArmScmiDxe/ScmiDxe.c
+++ b/ArmPkg/Drivers/ArmScmiDxe/ScmiDxe.c
@@ -40,7 +40,7 @@ STATIC CONST SCMI_PROTOCOL_ENTRY  Protocols[] = {
  install Base, Clock and Performance protocols.
   @param[in] SystemTable A pointer to boot time system table.
 
-  @retval EFI_SUCCESS   Driver initalized successfully.
+  @retval EFI_SUCCESS   Driver initialized successfully.
   @retval EFI_UNSUPPORTED   If SCMI base protocol version is not supported.
   @retval !(EFI_SUCCESS)Other errors.
 **/
diff --git a/ArmPkg/Include/Library/OemMiscLib.h 
b/ArmPkg/Include/Library/OemMiscLib.h
index 541274999e..02af6afdc2 100644
--- a/ArmPkg/Include/Library/OemMiscLib.h
+++ b/ArmPkg/Include/Library/OemMiscLib.h
@@ -86,7 +86,7 @@ OemGetCpuFreq (
 
   @param ProcessorIndex  Index of the processor to get the information for.
   @param ProcessorStatus Processor status.
-  @param ProcessorCharacteristics Processor characteritics.
+  @param ProcessorCharacteristics Processor characteristics.
   @param MiscProcessorDataMiscellaneous processor information.
 
   @return  TRUE on success, FALSE on failure.
diff --git a/ArmPkg/Library/ArmDisassemblerLib/ThumbDisassembler.c 
b/ArmPkg/Library/ArmDisassemblerLib/ThumbDisassembler.c
index 6dae7a9121..7083f6f514 100644
--- a/ArmPkg/Library/ArmDisassemblerLib/ThumbDisassembler.c
+++ b/ArmPkg/Library/ArmDisassemblerLib/ThumbDisassembler.c
@@ -663,9 +663,9 @@ DisassembleThumbInstruction (
   // ITSTATE = cond:mask   OpCode[7:4]:OpCode[3:0]
   // ITSTATE[7:5] == cond[3:1]
   // ITSTATE[4] == 1st Instruction cond[0]
-  // ITSTATE[3] == 2st Instruction cond[0]
-  // ITSTATE[2] == 3st Instruction cond[0]
-  // ITSTATE[1] == 4st Instruction cond[0]
+  // ITSTATE[3] == 2nd Instruction cond[0]
+  // ITSTATE[2] == 3rd Instruction cond[0]
+  // ITSTATE[1] == 4th Instruction cond[0]
   // ITSTATE[0] == 1 4 instruction IT block. 0 means 0,1,2 or 3 
instructions
   // 1st one  in ITSTATE low bits defines the number of instructions
   Mask = (OpCode & 0xf);
diff --git a/ArmPkg/Library/ArmLib/AArch64/ArmLibSupport.S 
b/ArmPkg/Library/ArmLib/AArch64/ArmLibSupport.S
index ba0ec5682b..c402154e4c 100644
--- a/ArmPkg/Library/ArmLib/AArch64/ArmLibSupport.S
+++ b/ArmPkg/Library/ArmLib/AArch64/ArmLibSupport.S
@@ -20,7 +20,7 @@ ASM_FUNC(ArmReadMidr)
   ret
 
 ASM_FUNC(ArmCacheInfo)
-  mrs x0, ctr_el0 // Read from Cache Type Regiter (CTR)
+  mrs x0, ctr_el0 // Read from Cache Type Register (CTR)
   ret
 
 ASM_FUNC(ArmGetInterruptState)
diff --git a/ArmPkg/Library/ArmLib/AArch64/ArmLibSupportV8.S 
b/ArmPkg/Library/ArmLib/AArch64/ArmLibSupportV8.S
index 0ae75e4cb9..6a64219f67 100644
--- a/ArmPkg/Library/ArmLib/AArch64/ArmLibSupportV8.S
+++ b/ArmPkg/Library/ArmLib/AArch64/ArmLibSupportV8.S
@@ -23,7 +23,7 @@
 
 
 ASM_FUNC(ArmIsMpCore)
-  mrs   x0, mpidr_el1 // Read EL1 Multiprocessor Affinty Reg (MPIDR)
+  mrs   x0, mpidr_el1 // Read EL1 Multiprocessor Affinity Reg (MPIDR)
   and   x0, x0, #MPIDR_U_MASK // U Bit clear, the processor is part of a 
multiprocessor system
   lsr   x0, x0, #MPIDR_U_BIT
   eor   x0, x0, #1
diff --git a/ArmPkg/Library/SemihostLib/Arm/GccSemihost.S 
b/ArmPkg/Library/SemihostLib/Arm/GccSemihost.S
index d6f81ec2c9..b1992b605f 100644
--- a/ArmPkg/Library/SemihostLib/Arm/GccSemihost.S
+++ b/ArmPkg/Library/SemihostLib/Arm/GccSemihost.S
@@ -16,7 +16,7 @@
   BKPT 0xAB for ARMv7-M (Thumb-2 only)
 
   R0 - operation type
-  R1 - block containing all other parametes
+  R1 - block containing all other parameters
 
   lr - must be saved as svc instruction will cause an svc exception and write
the svc lr register. That happens to be the one we are using, so we must
diff --git a/ArmPkg/Library/StandaloneMmMmuLib/ArmMmuStandaloneMmLib.c 
b/ArmPkg/Library/StandaloneMmMmuLib/ArmMmuStandaloneMmLib.c
index d55aff7620..c61d6f7b77 100644
--- a/ArmPkg/Library/StandaloneMmMmuLib/ArmMmuStandaloneMmLib.c
+++ b/ArmPkg/Library/StandaloneMmMmuLib/ArmMmuStandaloneMmLib.c

[edk2-devel] [PATCH 3/3] ArmVirtPkg: Fix typos

2022-12-06 Thread Dongdong Zhang
Fix some typos in ArmVirtPkg directory.

Signed-off-by: Dongdong Zhang 
---
 ArmVirtPkg/ArmVirt.dsc.inc  | 2 +-
 .../Library/CloudHvVirtMemInfoLib/CloudHvVirtMemInfoLib.c   | 2 +-
 ArmVirtPkg/Library/QemuVirtMemInfoLib/QemuVirtMemInfoLib.c  | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/ArmVirtPkg/ArmVirt.dsc.inc b/ArmVirtPkg/ArmVirt.dsc.inc
index 462073517a..f1aa51c896 100644
--- a/ArmVirtPkg/ArmVirt.dsc.inc
+++ b/ArmVirtPkg/ArmVirt.dsc.inc
@@ -93,7 +93,7 @@
 
   #
   # It is not possible to prevent the ARM compiler from inserting calls to 
intrinsic functions.
-  # This library provides the instrinsic functions such a compiler may 
generate calls to.
+  # This library provides the intrinsic functions such a compiler may generate 
calls to.
   #
   NULL|ArmPkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf
 
diff --git a/ArmVirtPkg/Library/CloudHvVirtMemInfoLib/CloudHvVirtMemInfoLib.c 
b/ArmVirtPkg/Library/CloudHvVirtMemInfoLib/CloudHvVirtMemInfoLib.c
index 28a0c0b078..107ebbf3cd 100644
--- a/ArmVirtPkg/Library/CloudHvVirtMemInfoLib/CloudHvVirtMemInfoLib.c
+++ b/ArmVirtPkg/Library/CloudHvVirtMemInfoLib/CloudHvVirtMemInfoLib.c
@@ -103,7 +103,7 @@ CloudHvVirtMemInfoPeiLibConstructor (
   CurBase + CurSize - 1
   ));
 
-// We should build Hob seperately for the memory node except the first 
one
+// We should build Hob separately for the memory node except the first 
one
 if (CurBase != MemBase) {
   BuildResourceDescriptorHob (
 EFI_RESOURCE_SYSTEM_MEMORY,
diff --git a/ArmVirtPkg/Library/QemuVirtMemInfoLib/QemuVirtMemInfoLib.c 
b/ArmVirtPkg/Library/QemuVirtMemInfoLib/QemuVirtMemInfoLib.c
index 9cf43f06c0..464e7a6d04 100644
--- a/ArmVirtPkg/Library/QemuVirtMemInfoLib/QemuVirtMemInfoLib.c
+++ b/ArmVirtPkg/Library/QemuVirtMemInfoLib/QemuVirtMemInfoLib.c
@@ -27,7 +27,7 @@
 #define MACH_VIRT_PERIPH_SIZE  SIZE_128MB
 
 /**
-  Default library constructur that obtains the memory size from a PCD.
+  Default library constructor that obtains the memory size from a PCD.
 
   @return  Always returns RETURN_SUCCESS
 
-- 
2.17.1



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




[edk2-devel] [PATCH 2/3] ArmPlatformPkg: Fix typos

2022-12-06 Thread Dongdong Zhang
Fix some typos in ArmPlatformPkg directory.

Signed-off-by: Dongdong Zhang 
---
 ArmPlatformPkg/ArmPlatformPkg.dec   | 2 +-
 ArmPlatformPkg/Include/Library/LcdPlatformLib.h | 2 +-
 ArmPlatformPkg/Library/ArmMaliDp/ArmMaliDp.c| 2 +-
 ArmPlatformPkg/Library/PL111Lcd/PL111Lcd.c  | 4 ++--
 4 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/ArmPlatformPkg/ArmPlatformPkg.dec 
b/ArmPlatformPkg/ArmPlatformPkg.dec
index 7b5d7e6cb5..c905f97d2c 100644
--- a/ArmPlatformPkg/ArmPlatformPkg.dec
+++ b/ArmPlatformPkg/ArmPlatformPkg.dec
@@ -97,7 +97,7 @@
   gArmPlatformTokenSpaceGuid.PcdPL111LcdBase|0x0|UINT32|0x0026
   gArmPlatformTokenSpaceGuid.PcdArmHdLcdBase|0x0|UINT32|0x0027
 
-  ## Default size for display modes upto 1920x1080 (1920 * 1080 * 4 Bytes Per 
Pixel)
+  ## Default size for display modes up to 1920x1080 (1920 * 1080 * 4 Bytes Per 
Pixel)
   
gArmPlatformTokenSpaceGuid.PcdArmLcdDdrFrameBufferSize|0x7E9000|UINT32|0x0043
   ## If set, framebuffer memory will be reserved and mapped in the system RAM
   gArmPlatformTokenSpaceGuid.PcdArmLcdDdrFrameBufferBase|0x0|UINT64|0x0044
diff --git a/ArmPlatformPkg/Include/Library/LcdPlatformLib.h 
b/ArmPlatformPkg/Include/Library/LcdPlatformLib.h
index b5628ece56..2049e5ef60 100644
--- a/ArmPlatformPkg/Include/Library/LcdPlatformLib.h
+++ b/ArmPlatformPkg/Include/Library/LcdPlatformLib.h
@@ -220,7 +220,7 @@ typedef struct {
 
   @param[in] Handle  Handle to the LCD device instance.
 
-  @retval EFI_SUCCESSPlaform library initialized successfully.
+  @retval EFI_SUCCESSPlatform library initialized successfully.
   @retval !(EFI_SUCCESS) Other errors.
 **/
 EFI_STATUS
diff --git a/ArmPlatformPkg/Library/ArmMaliDp/ArmMaliDp.c 
b/ArmPlatformPkg/Library/ArmMaliDp/ArmMaliDp.c
index d01c910f6e..cea7ce2cc7 100644
--- a/ArmPlatformPkg/Library/ArmMaliDp/ArmMaliDp.c
+++ b/ArmPlatformPkg/Library/ArmMaliDp/ArmMaliDp.c
@@ -287,7 +287,7 @@ LcdInitialize (
   return EFI_SUCCESS;
 }
 
-/** Set ARM Mali DP in cofiguration mode.
+/** Set ARM Mali DP in configuration mode.
 
   The ARM Mali DP must be in the configuration mode for
   configuration of the H_INTERVALS, V_INTERVALS, SYNC_CONTROL
diff --git a/ArmPlatformPkg/Library/PL111Lcd/PL111Lcd.c 
b/ArmPlatformPkg/Library/PL111Lcd/PL111Lcd.c
index 07f9b0f6be..f0658b40dc 100644
--- a/ArmPlatformPkg/Library/PL111Lcd/PL111Lcd.c
+++ b/ArmPlatformPkg/Library/PL111Lcd/PL111Lcd.c
@@ -19,7 +19,7 @@
   @retval EFI_SUCCESS  Returns success if platform implements a
PL111 controller.
 
-  @retval EFI_NOT_FOUNDPL111 display controller not found the plaform.
+  @retval EFI_NOT_FOUNDPL111 display controller not found the platform.
 **/
 EFI_STATUS
 LcdIdentify (
@@ -73,7 +73,7 @@ LcdInitialize (
 
   @param[in] ModeNumbe   Display mode number.
 
-  @retval EFI_SUCCESSDisplay mode set successfuly.
+  @retval EFI_SUCCESSDisplay mode set successfully.
   @retval !(EFI_SUCCESS) Other errors.
 **/
 EFI_STATUS
-- 
2.17.1



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




[edk2-devel] [PATCH] Maintainer.txt: add myself as reviewer for bhyve's OvmfPkg

2022-12-06 Thread Corvin Köhne
Signed-off-by: Corvin Köhne 
Cc: Andrew Fish 
Cc: Leif Lindholm 
Cc: Michael D Kinney 
Cc: devel@edk2.groups.io
---
 Maintainers.txt | 1 +
 1 file changed, 1 insertion(+)

diff --git a/Maintainers.txt b/Maintainers.txt
index 7e98083685..3ea9a4cca6 100644
--- a/Maintainers.txt
+++ b/Maintainers.txt
@@ -457,6 +457,7 @@ F: OvmfPkg/Library/ResetSystemLib/BaseResetShutdownBhyve.c
 F: OvmfPkg/Library/ResetSystemLib/BaseResetSystemLibBhyve.inf

 R: Rebecca Cran  [bcran]

 R: Peter Grehan  [grehan-freebsd]

+R: Corvin Köhne  [corvink]

 

 OvmfPkg: cloudhv-related modules

 F: OvmfPkg/CloudHv/

-- 
2.34.1



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




[edk2-devel] [PATCH 0/3] Fix some typos

2022-12-06 Thread Dongdong Zhang
Hi all,

My focus was fixing typos in comments. Most of them
were found by spellchecker.

There are many similar spelling mistakes, so to avoid involving
too many modules at once, only the files in the 'ArmPkg',
'ArmPlatformPkg' and 'ArmVirtPkg' directories were modified this time.

Dongdong Zhang (3):
  ArmPkg: Fix typos
  ArmPlatformPkg: Fix typos
  ArmVirtPkg: Fix typos

 ArmPkg/Drivers/ArmScmiDxe/ScmiDxe.c | 2 +-
 ArmPkg/Include/Library/OemMiscLib.h | 2 +-
 ArmPkg/Library/ArmDisassemblerLib/ThumbDisassembler.c   | 6 +++---
 ArmPkg/Library/ArmLib/AArch64/ArmLibSupport.S   | 2 +-
 ArmPkg/Library/ArmLib/AArch64/ArmLibSupportV8.S | 2 +-
 ArmPkg/Library/SemihostLib/Arm/GccSemihost.S| 2 +-
 ArmPkg/Library/StandaloneMmMmuLib/ArmMmuStandaloneMmLib.c   | 6 +++---
 ArmPkg/Universal/Smbios/OemMiscLibNull/OemMiscLib.c | 2 +-
 .../Smbios/ProcessorSubClassDxe/SmbiosProcessorArmCommon.c  | 2 +-
 ArmPlatformPkg/ArmPlatformPkg.dec   | 2 +-
 ArmPlatformPkg/Include/Library/LcdPlatformLib.h | 2 +-
 ArmPlatformPkg/Library/ArmMaliDp/ArmMaliDp.c| 2 +-
 ArmPlatformPkg/Library/PL111Lcd/PL111Lcd.c  | 4 ++--
 ArmVirtPkg/ArmVirt.dsc.inc  | 2 +-
 .../Library/CloudHvVirtMemInfoLib/CloudHvVirtMemInfoLib.c   | 2 +-
 ArmVirtPkg/Library/QemuVirtMemInfoLib/QemuVirtMemInfoLib.c  | 2 +-
 16 files changed, 21 insertions(+), 21 deletions(-)

-- 
2.17.1



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




[edk2-devel] Access non-SMRAM memory regions from SMM

2022-12-06 Thread asallan3
Hi, I'm aware theres been implemented a PCD 
`gUefiCpuPkgTokenSpaceGuid.PcdCpuSmmRestrictedMemoryAccess` that blocks access 
to "any" type of non-SMRAM memory after SmmReadyToLock.

But I ran some tests and found out I can access some memory regions outside 
SMRAM, like address 0xFFFD0 for instance, and dereference a pointer to that 
address inside my Mm Handler without any problems, even though this is a 
non-SMRAM address and I have that PCD set to TRUE (Access to non-SMRAM memory 
is restricted).

However when I try to dereference a pointer to a memory region used by the OS I 
get an error saying `Access SMM communication forbidden address (0xC60)!`

So I'm wondering:

1) Is it blocked or not?
2) In what context I *can* access non-SMRAM memory regions from inside my mm 
Handler?
3) Is there any way to read these memory regions used by the OS from inside the 
mm Handler other than setting PcdCpuSmmRestrictedMemoryAccess to FALSE?

Any kind of help would be appreciated. Thanks!


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




回复: [edk2-devel] Event: TianoCore Bug Triage - APAC / NAMO - Tuesday, December 6, 2022 #cal-reminder

2022-12-06 Thread gaoliming via groups.io
Few issues are submitted. This week meeting is cancelled. 

 

Thanks

Liming

发件人: devel@edk2.groups.io  代表 Group Notification
发送时间: 2022年12月6日 10:30
收件人: devel@edk2.groups.io
主题: [edk2-devel] Event: TianoCore Bug Triage - APAC / NAMO - Tuesday, December 
6, 2022 #cal-reminder

 

Reminder: TianoCore Bug Triage - APAC / NAMO 

When:
Tuesday, December 6, 2022
6:30pm to 7:30pm
(UTC-08:00) America/Los Angeles 

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

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

  

View Event  

Description:

TianoCore Bug Triage - APAC / NAMO

Hosted by Liming Gao

 


 

Microsoft Teams meeting 

Join on your computer or mobile app 

 

 Click here to join the meeting 

Join with a video conferencing device 

te...@conf.intel.com   

Video Conference ID: 116 062 094 0 

 

 Alternate VTC dialing instructions 

Or call in (audio only) 

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

Phone Conference ID: 774 638 21# 

 

 Find a local number |   Reset 
PIN 

  Learn More |  

 Meeting options 





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




Re: [edk2-devel] [PATCH 1/2] EmulatorPkg: Add persistent memory in EmuThunkPpi

2022-12-06 Thread Ni, Ray
Reviewed-by: Ray Ni 

> -Original Message-
> From: Liu, Zhiguang 
> Sent: Tuesday, December 6, 2022 1:41 PM
> To: devel@edk2.groups.io
> Cc: Liu, Zhiguang ; Andrew Fish ;
> Ni, Ray 
> Subject: [PATCH 1/2] EmulatorPkg: Add persistent memory in EmuThunkPpi
> 
> The persistent memory is for PEIM to use, and won't lose during cold
> or warm reset. PcdPersistentMemorySize is only used by WinHost.c,
> other modules can check the persistent memory size using the field
> PersistentMemorySize.
> 
> Cc: Andrew Fish 
> Cc: Ray Ni 
> Signed-off-by: Zhiguang Liu 
> ---
>  EmulatorPkg/EmulatorPkg.dec|  3 ++-
>  EmulatorPkg/Include/Ppi/EmuThunk.h |  4 +++-
>  EmulatorPkg/Unix/Host/Host.c   | 13 +++--
>  EmulatorPkg/Unix/Host/Host.inf |  3 ++-
>  EmulatorPkg/Win/Host/WinHost.c | 11 ++-
>  EmulatorPkg/Win/Host/WinHost.inf   |  2 +-
>  6 files changed, 29 insertions(+), 7 deletions(-)
> 
> diff --git a/EmulatorPkg/EmulatorPkg.dec b/EmulatorPkg/EmulatorPkg.dec
> index b9c70b63b3..fe81652b04 100644
> --- a/EmulatorPkg/EmulatorPkg.dec
> +++ b/EmulatorPkg/EmulatorPkg.dec
> @@ -2,7 +2,7 @@
>  #
>  # This is the Emu Emulation Environment Platform
>  #
> -# Copyright (c) 2008 - 2019, Intel Corporation. All rights reserved.
> +# Copyright (c) 2008 - 2022, Intel Corporation. All rights reserved.
>  # Portions copyright (c) 2011, Apple Inc. All rights reserved.
>  # (C) Copyright 2020 Hewlett Packard Enterprise Development LP
>  #
> @@ -86,6 +86,7 @@
># The user ID and password are fixed as below.
> 
> gEmulatorPkgTokenSpaceGuid.PcdRedfishServieUserId|"admin"|VOID*|0x0
> 0001022
> 
> gEmulatorPkgTokenSpaceGuid.PcdRedfishServiePassword|"pwd123456"|VO
> ID*|0x1023
> +
> gEmulatorPkgTokenSpaceGuid.PcdPersistentMemorySize|0x400|UINT3
> 2|0x1024
> 
>  [PcdsFixedAtBuild, PcdsPatchableInModule]
>gEmulatorPkgTokenSpaceGuid.PcdEmuBootMode|1|UINT32|0x1006
> diff --git a/EmulatorPkg/Include/Ppi/EmuThunk.h
> b/EmulatorPkg/Include/Ppi/EmuThunk.h
> index c0e2bc6b98..cf29cf824c 100644
> --- a/EmulatorPkg/Include/Ppi/EmuThunk.h
> +++ b/EmulatorPkg/Include/Ppi/EmuThunk.h
> @@ -2,7 +2,7 @@
>Emulator Thunk to abstract OS services from pure EFI code
> 
>Copyright (c) 2008 - 2011, Apple Inc. All rights reserved.
> -
> +  Copyright (c) 2022, Intel Corporation. All rights reserved.
>SPDX-License-Identifier: BSD-2-Clause-Patent
> 
>  **/
> @@ -107,6 +107,8 @@ typedef struct {
>EMU_PEI_AUTOSCAN   MemoryAutoScan;
>EMU_PEI_FD_INFORMATION FirmwareDevices;
>EMU_PEI_THUNK_INTERFACEThunk;
> +  UINTN  PersistentMemorySize;
> +  UINT8  PersistentMemory[0];
>  } EMU_THUNK_PPI;
> 
>  extern EFI_GUID  gEmuThunkPpiGuid;
> diff --git a/EmulatorPkg/Unix/Host/Host.c b/EmulatorPkg/Unix/Host/Host.c
> index 38c01c84af..8d0be5b54b 100644
> --- a/EmulatorPkg/Unix/Host/Host.c
> +++ b/EmulatorPkg/Unix/Host/Host.c
> @@ -1,6 +1,6 @@
>  /*++ @file
> 
> -Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.
> +Copyright (c) 2006 - 2022, Intel Corporation. All rights reserved.
>  Portions copyright (c) 2008 - 2011, Apple Inc. All rights reserved.
>  SPDX-License-Identifier: BSD-2-Clause-Patent
> 
> @@ -102,6 +102,7 @@ main (
>CHAR16*FirmwareVolumesStr;
>UINTN *StackPointer;
>FILE  *GdbTempFile;
> +  EMU_THUNK_PPI *SecEmuThunkPpi;
> 
>//
>// Xcode does not support sourcing gdb scripts directly, so the Xcode XML
> @@ -137,7 +138,15 @@ main (
>//
>// PPIs pased into PEI_CORE
>//
> -  AddThunkPpi (EFI_PEI_PPI_DESCRIPTOR_PPI, ,
> );
> +  SecEmuThunkPpi = AllocateZeroPool (sizeof (EMU_THUNK_PPI) +
> FixedPcdGet32 (PcdPersistentMemorySize));
> +  if (SecEmuThunkPpi == NULL) {
> +printf ("ERROR : Can not allocate memory for SecEmuThunkPpi.
> Exiting.\n");
> +exit (1);
> +  }
> +
> +  CopyMem (SecEmuThunkPpi, , sizeof
> (EMU_THUNK_PPI));
> +  SecEmuThunkPpi->PersistentMemorySize = FixedPcdGet32
> (PcdPersistentMemorySize);
> +  AddThunkPpi (EFI_PEI_PPI_DESCRIPTOR_PPI, ,
> SecEmuThunkPpi);
> 
>SecInitThunkProtocol ();
> 
> diff --git a/EmulatorPkg/Unix/Host/Host.inf
> b/EmulatorPkg/Unix/Host/Host.inf
> index c479d2b7d0..f5ebbed683 100644
> --- a/EmulatorPkg/Unix/Host/Host.inf
> +++ b/EmulatorPkg/Unix/Host/Host.inf
> @@ -2,7 +2,7 @@
>  # Entry Point of Emu Emulator
>  #
>  # Main executable file of Unix Emulator that loads PEI core after 
> initialization
> finished.
> -# Copyright (c) 2008 - 2019, Intel Corporation. All rights reserved.
> +# Copyright (c) 2008 - 2022, Intel Corporation. All rights reserved.
>  # Portions copyright (c) 2008 - 2011, Apple Inc. All rights reserved.
>  #
>  #  SPDX-License-Identifier: BSD-2-Clause-Patent
> @@ -106,6 +106,7 @@
>gEmulatorPkgTokenSpaceGuid.PcdEmuFlashNvStorageFtwSpareBase
>gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareSize
>

Re: [edk2-devel] [PATCH] EmulatorPkg: Remove unnecessary dependency on EmbeddedPkg

2022-12-06 Thread Ni, Ray
Thanks for the cleaning up.
Reviewed-by: Ray Ni 

> -Original Message-
> From: Liu, Zhiguang 
> Sent: Tuesday, December 6, 2022 1:30 PM
> To: devel@edk2.groups.io
> Cc: Liu, Zhiguang ; Andrew Fish ;
> Ni, Ray 
> Subject: [PATCH] EmulatorPkg: Remove unnecessary dependency on
> EmbeddedPkg
> 
> EmulatorPkg doesn't need depend on EmbeddedPkg, so remove the
> dependency.
> 
> Cc: Andrew Fish 
> Cc: Ray Ni 
> Signed-off-by: Zhiguang Liu 
> ---
>  EmulatorPkg/EmulatorPkg.ci.yaml| 3 +--
>  .../Library/DxeEmuSerialPortLib/DxeEmuSerialPortLib.inf| 3 +--
>  .../Library/PeiEmuSerialPortLib/PeiEmuSerialPortLib.inf| 3 +--
>  3 files changed, 3 insertions(+), 6 deletions(-)
> 
> diff --git a/EmulatorPkg/EmulatorPkg.ci.yaml
> b/EmulatorPkg/EmulatorPkg.ci.yaml
> index 338d5fc2d3..6e9b2857cb 100644
> --- a/EmulatorPkg/EmulatorPkg.ci.yaml
> +++ b/EmulatorPkg/EmulatorPkg.ci.yaml
> @@ -5,7 +5,7 @@
>  # used for code analysis.
>  #
>  # Copyright (c) Microsoft Corporation
> -# Copyright (c) 2020, Intel Corporation. All rights reserved.
> +# Copyright (c) 2020 - 2022, Intel Corporation. All rights reserved.
>  # SPDX-License-Identifier: BSD-2-Clause-Patent
>  ##
>  {
> @@ -55,7 +55,6 @@
>  "EmulatorPkg/EmulatorPkg.dec",
>  "NetworkPkg/NetworkPkg.dec",
>  "RedfishPkg/RedfishPkg.dec",
> -"EmbeddedPkg/EmbeddedPkg.dec", ## is this one OK??
>  ],
>  # For host based unit tests
>  "AcceptableDependencies-HOST_APPLICATION":[
> diff --git
> a/EmulatorPkg/Library/DxeEmuSerialPortLib/DxeEmuSerialPortLib.inf
> b/EmulatorPkg/Library/DxeEmuSerialPortLib/DxeEmuSerialPortLib.inf
> index d91f7de181..dfdabde22a 100644
> --- a/EmulatorPkg/Library/DxeEmuSerialPortLib/DxeEmuSerialPortLib.inf
> +++ b/EmulatorPkg/Library/DxeEmuSerialPortLib/DxeEmuSerialPortLib.inf
> @@ -1,7 +1,7 @@
>  ## @file
>  #  Write only instance of Serial Port Library with empty functions.
>  #
> -#  Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.
> +#  Copyright (c) 2006 - 2022, Intel Corporation. All rights reserved.
>  #  Portions copyright (c) 2011, Apple Inc. All rights reserved.
>  #
>  #  SPDX-License-Identifier: BSD-2-Clause-Patent
> @@ -25,7 +25,6 @@
>  [Packages]
>MdePkg/MdePkg.dec
>EmulatorPkg/EmulatorPkg.dec
> -  EmbeddedPkg/EmbeddedPkg.dec
> 
>  [LibraryClasses]
>EmuThunkLib
> diff --git a/EmulatorPkg/Library/PeiEmuSerialPortLib/PeiEmuSerialPortLib.inf
> b/EmulatorPkg/Library/PeiEmuSerialPortLib/PeiEmuSerialPortLib.inf
> index 2f5e656fd7..7ef3e3baaf 100644
> --- a/EmulatorPkg/Library/PeiEmuSerialPortLib/PeiEmuSerialPortLib.inf
> +++ b/EmulatorPkg/Library/PeiEmuSerialPortLib/PeiEmuSerialPortLib.inf
> @@ -1,7 +1,7 @@
>  ## @file
>  #  Write only instance of Serial Port Library with empty functions.
>  #
> -#  Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.
> +#  Copyright (c) 2006 - 2022, Intel Corporation. All rights reserved.
>  #  Portions copyright (c) 2011, Apple Inc. All rights reserved.
>  #
>  #  SPDX-License-Identifier: BSD-2-Clause-Patent
> @@ -28,7 +28,6 @@
>  [Packages]
>MdePkg/MdePkg.dec
>EmulatorPkg/EmulatorPkg.dec
> -  EmbeddedPkg/EmbeddedPkg.dec
> 
>  [LibraryClasses]
>PeiServicesLib
> --
> 2.31.1.windows.1



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




Re: [edk2-devel] [PATCH 2/2] EmulatorPkg: Record Argc, Argv and Envp in EmuThunk Ppi

2022-12-06 Thread Ni, Ray
Reviewed-by: Ray Ni 

> -Original Message-
> From: Liu, Zhiguang 
> Sent: Tuesday, December 6, 2022 1:42 PM
> To: devel@edk2.groups.io
> Cc: Liu, Zhiguang ; Andrew Fish ;
> Ni, Ray 
> Subject: [PATCH 2/2] EmulatorPkg: Record Argc, Argv and Envp in EmuThunk
> Ppi
> 
> Record Argc, Argv and Envp in EmuThunk Ppi so that other modules
> can use these fields to change behavior depends on boot parameters
> or environment.
> 
> Cc: Andrew Fish 
> Cc: Ray Ni 
> Signed-off-by: Zhiguang Liu 
> ---
>  EmulatorPkg/Include/Ppi/EmuThunk.h | 3 +++
>  EmulatorPkg/Unix/Host/Host.c   | 3 +++
>  EmulatorPkg/Win/Host/WinHost.c | 3 +++
>  3 files changed, 9 insertions(+)
> 
> diff --git a/EmulatorPkg/Include/Ppi/EmuThunk.h
> b/EmulatorPkg/Include/Ppi/EmuThunk.h
> index cf29cf824c..c78ad692ed 100644
> --- a/EmulatorPkg/Include/Ppi/EmuThunk.h
> +++ b/EmulatorPkg/Include/Ppi/EmuThunk.h
> @@ -107,6 +107,9 @@ typedef struct {
>EMU_PEI_AUTOSCAN   MemoryAutoScan;
>EMU_PEI_FD_INFORMATION FirmwareDevices;
>EMU_PEI_THUNK_INTERFACEThunk;
> +  INTN   Argc;
> +  CHAR8  **Argv;
> +  CHAR8  **Envp;
>UINTN  PersistentMemorySize;
>UINT8  PersistentMemory[0];
>  } EMU_THUNK_PPI;
> diff --git a/EmulatorPkg/Unix/Host/Host.c b/EmulatorPkg/Unix/Host/Host.c
> index 8d0be5b54b..1f29dd00a3 100644
> --- a/EmulatorPkg/Unix/Host/Host.c
> +++ b/EmulatorPkg/Unix/Host/Host.c
> @@ -145,6 +145,9 @@ main (
>}
> 
>CopyMem (SecEmuThunkPpi, , sizeof
> (EMU_THUNK_PPI));
> +  SecEmuThunkPpi->Argc = Argc;
> +  SecEmuThunkPpi->Argv = Argv;
> +  SecEmuThunkPpi->Envp = Envp;
>SecEmuThunkPpi->PersistentMemorySize = FixedPcdGet32
> (PcdPersistentMemorySize);
>AddThunkPpi (EFI_PEI_PPI_DESCRIPTOR_PPI, ,
> SecEmuThunkPpi);
> 
> diff --git a/EmulatorPkg/Win/Host/WinHost.c
> b/EmulatorPkg/Win/Host/WinHost.c
> index 3b2fde297d..f639ba3b1b 100644
> --- a/EmulatorPkg/Win/Host/WinHost.c
> +++ b/EmulatorPkg/Win/Host/WinHost.c
> @@ -485,6 +485,9 @@ Returns:
>}
> 
>CopyMem (SecEmuThunkPpi, , sizeof
> (EMU_THUNK_PPI));
> +  SecEmuThunkPpi->Argc = Argc;
> +  SecEmuThunkPpi->Argv = Argv;
> +  SecEmuThunkPpi->Envp = Envp;
>SecEmuThunkPpi->PersistentMemorySize = FixedPcdGet32
> (PcdPersistentMemorySize);
>AddThunkPpi (EFI_PEI_PPI_DESCRIPTOR_PPI, ,
> SecEmuThunkPpi);
>AddThunkPpi (EFI_PEI_PPI_DESCRIPTOR_PPI, ,
> );
> --
> 2.31.1.windows.1



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




Re: [edk2-devel] [PATCH] UsbNetworkPkg: add USB network devices support

2022-12-06 Thread RichardHo [何明忠] via groups . io
Hi Rebecca,

Thanks for your response. I will fixed it next.

Thanks,
Richard

-Original Message-
From: Rebecca Cran 
Sent: 2022年12月5日 11:15 AM
To: devel@edk2.groups.io; Richard Ho (何明忠) 
Cc: Andrew Fish ; Leif Lindholm ; 
Michael D Kinney ; Michael Kubacki 
; Zhiguang Liu ; Liming 
Gao ; Tony Lo (羅金松) 
Subject: [EXTERNAL] Re: [edk2-devel] [PATCH] UsbNetworkPkg: add USB network 
devices support


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

On 9/1/22 23:24, RichardHo [何明忠] via groups.io wrote:
> +  DataLength = (UINTN)(Cpb->DataLen + (UINT32)Cpb->MediaheaderLen);
> +
> +  while (1) {
> +if (Counter >= 3) {
> +  StatCode = PXE_STATCODE_BUSY;
> +  break;
> +}
> +
> +Status = Nic->UsbEth->UsbEthTransmit (Cdb, Nic->UsbEth, (VOID 
> *)(UINTN)BulkOutData, );
> +if (EFI_ERROR (Status)) {
> +  StatCode =  PXE_STATFLAGS_COMMAND_FAILED;
> +}
> +
> +if (Status == EFI_INVALID_PARAMETER) {
> +  StatCode = PXE_STATCODE_INVALID_PARAMETER;
> +  break;
> +}
> +
> +if (Status == EFI_DEVICE_ERROR) {
> +  StatCode = PXE_STATCODE_DEVICE_FAILURE;
> +  break;
> +}
> +
> +if (!EFI_ERROR (Status)) {
> +  Nic->TxFrame++;
> +  StatCode = PXE_STATCODE_SUCCESS;
> +  break;
> +}
> +
> +Counter++;
> +  }

You need to set DataLength inside the while loop, otherwise on subsequent 
iterations DataLength will be whatever value UsbEthTransmit just set it to, 
which will likely be 0 since an error occurred.

--
Rebecca Cran
-The information contained in this message may be confidential and proprietary 
to American Megatrends (AMI). This communication is intended to be read only by 
the individual or entity to whom it is addressed or by their designee. If the 
reader of this message is not the intended recipient, you are on notice that 
any distribution of this message, in any form, is strictly prohibited. Please 
promptly notify the sender by reply e-mail or by telephone at 770-246-8600, and 
then delete or destroy all copies of the transmission.


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




Re: [edk2-devel] [edk2-platform][PATCH 1/1] MdeModulePkg: SdMmcPciHcDxe: Fix issue that SD1.0 cards can't be recognized

2022-12-06 Thread Wu, Hao A
Hello,

The proposed patch will cause CI test failure: 
https://github.com/tianocore/edk2/pull/3724. Could you help to resolve them?
May I know what kind of tests have been performed for this patch? Have you 
tried with non SD1.0 cards and make sure that they still work fine after the 
patch?

Also, serveral more inline comments below:


> -Original Message-
> From: Chevron Li 
> Sent: Tuesday, December 6, 2022 2:48 PM
> To: devel@edk2.groups.io
> Cc: Wu, Hao A ; Ni, Ray ; Wang,
> Jian J ; Gao, Liming ;
> shirley@bayhubtech.com; shaper@bayhubtech.com;
> xiaoguang...@bayhubtech.com; Chevron Li (WH)
> 
> Subject: [edk2-platform][PATCH 1/1] MdeModulePkg: SdMmcPciHcDxe: Fix
> issue that SD1.0 cards can't be recognized
> 
> From: "Chevron Li (WH)" 
> 
> 
> SD1.0 cards don't support CMD8 and CMD6
> 
> CMD8 result can be used to distinguish the card is SD1.0 or not.
> 
> CMD8 result can be used to decide following CMD6 is sent or skip.
> 
> 
> 
> Cc: Hao A Wu 
> 
> Cc: Ray Ni 
> 
> Cc: Jian J Wang 
> 
> Cc: Liming Gao 
> 
> Signed-off-by: Chevron Li 
> 
> ---
> 
>  MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdDevice.c | 30 ---
> 
> 
>  1 file changed, 20 insertions(+), 10 deletions(-)
> 
> 
> 
> diff --git a/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdDevice.c
> b/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdDevice.c
> 
> index f5a3607e47..281aa38170 100644
> 
> --- a/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdDevice.c
> 
> +++ b/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdDevice.c
> 
> @@ -1085,7 +1085,8 @@ SdCardSetBusMode (
> 
>IN EFI_SD_MMC_PASS_THRU_PROTOCOL  *PassThru,
> 
>IN UINT8  Slot,
> 
>IN UINT16 Rca,
> 
> -  IN BOOLEANS18A
> 
> +  IN BOOLEANS18A,
> 
> +  IN BOOLEANSdVersion1


For the newly added input parameter 'SdVersion1', please help to update the 
function description comments to reflect it.


> 
>)
> 
>  {
> 
>EFI_STATUS  Status;
> 
> @@ -1117,10 +1118,13 @@ SdCardSetBusMode (
> 
> 
> 
>//
> 
>// Get the supported bus speed from SWITCH cmd return data group #1.
> 
> +  // SdVersion1 don't support the SWITCH cmd
> 
>//
> 
> -  Status = SdCardSwitch (PassThru, Slot, 0xFF, 0xF, SdDriverStrengthIgnore,
> 0xF, FALSE, SwitchResp);
> 
> -  if (EFI_ERROR (Status)) {
> 
> -return Status;
> 
> +  if(SdVersion1 == FALSE) {
> 
> +Status = SdCardSwitch (PassThru, Slot, 0xFF, 0xF, SdDriverStrengthIgnore,
> 0xF, FALSE, SwitchResp);


The local variable 'SwitchResp' is an output parameter for SdCardSwitch().
When SdVersion1 is TRUE, SdCardSwitch() call will be skipped and 'SwitchResp' 
will have uninitialized value.
This will probably cause issues when 'SwitchResp' later being used as an input 
parameter for SdGetTargetBusMode() function call.
Could you help to check on this?


> 
> +if (EFI_ERROR (Status)) {
> 
> +  return Status;
> 
> +}
> 
>}
> 
> 
> 
>SdGetTargetBusMode (Private, Slot, SwitchResp, S18A, );
> 
> @@ -1141,9 +1145,14 @@ SdCardSetBusMode (
> 
>  }
> 
>}
> 
> 
> 
> -  Status = SdCardSwitch (PassThru, Slot, BusMode.BusTiming, 0xF,
> BusMode.DriverStrength.Sd, 0xF, TRUE, SwitchResp);
> 
> -  if (EFI_ERROR (Status)) {
> 
> -return Status;
> 
> +  //
> 
> +  // SdVersion1 don't support the SWITCH cmd
> 
> +  //
> 
> +  if(SdVersion1 == FALSE){
> 
> +Status = SdCardSwitch (PassThru, Slot, BusMode.BusTiming, 0xF,
> BusMode.DriverStrength.Sd, 0xF, TRUE, SwitchResp);
> 
> +if (EFI_ERROR (Status)) {
> 
> +  return Status;
> 
> +}
> 
>}
> 
> 
> 
>Status = SdMmcSetDriverStrength (Private->PciIo, Slot,
> BusMode.DriverStrength.Sd);
> 
> @@ -1214,6 +1223,7 @@ SdCardIdentification (
> 
>UINT8  HostCtrl2;
> 
>UINTN  Retry;
> 
>BOOLEANForceVoltage33;
> 
> +  BOOLEANSdVersion1;
> 
> 
> 
>ForceVoltage33 = FALSE;


Please help to assign a initial value for the newly added local variable 
'SdVersion1'.
If the card supports cmd8, this local variable will have uninitialized value 
when calling SdCardSetBusMode().


> 
> 
> 
> @@ -1231,12 +1241,12 @@ Voltage33Retry:
> 
>}
> 
> 
> 
>//
> 
> -  // 2. Send Cmd8 to the device
> 
> +  // 2. Send Cmd8 to the device, the command will fail for SdVersion1;
> 
>//
> 
>Status = SdCardVoltageCheck (PassThru, Slot, 0x1, 0xFF);
> 
>if (EFI_ERROR (Status)) {
> 
> +SdVersion1 = 1;


Please use "SdVersion1 = TRUE;".

Best Regards,
Hao Wu


> 
>  DEBUG ((DEBUG_INFO, "SdCardIdentification: Executing Cmd8 fails
> with %r\n", Status));
> 
> -return Status;
> 
>}
> 
> 
> 
>//
> 
> @@ -1426,7 +1436,7 @@ Voltage33Retry:
> 
>DEBUG ((DEBUG_INFO, "SdCardIdentification: Found a SD device at slot
> [%d]\n", Slot));
> 
>Private->Slot[Slot].CardType = SdCardType;
> 
> 
> 
> -  Status = SdCardSetBusMode (PciIo, PassThru, 

Re: [edk2-devel] [Patch 1/1] RedfishPkg: Remove overlapping private include path in DEC file

2022-12-06 Thread Chang, Abner via groups.io
[AMD Official Use Only - General]

Reviewed-by: Abner Chang 

> -Original Message-
> From: Michael D Kinney 
> Sent: Tuesday, December 6, 2022 8:45 AM
> To: devel@edk2.groups.io
> Cc: Chang, Abner ; Nickle Wang
> ; Igor Kulchytskyy 
> Subject: [Patch 1/1] RedfishPkg: Remove overlapping private include path in
> DEC file
> 
> Caution: This message originated from an External Source. Use proper
> caution when opening attachments, clicking links, or responding.
> 
> 
> Update ReadfishPkg.dec to remove PrivateInclude from the
> [Includes.Common.Private] section.  The PrivateInclude directory does not
> contain any include files, and the PrivateInclude/Crt include path remaining 
> in
> the [Includes.Common.Private] section providing the include path required
> to access the CRT related include files by components within the RedfishPkg.
> 
> Without this update, there are two forms of #include statements that can be
> used to include the CRT related include files.
> Include files should only be available using one form of #include statements.
> 
> Cc: Abner Chang 
> Cc: Nickle Wang 
> Cc: Igor Kulchytskyy 
> Signed-off-by: Michael D Kinney 
> ---
>  RedfishPkg/RedfishPkg.dec | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/RedfishPkg/RedfishPkg.dec b/RedfishPkg/RedfishPkg.dec index
> 0aa26883e220..d2b189b13d8c 100644
> --- a/RedfishPkg/RedfishPkg.dec
> +++ b/RedfishPkg/RedfishPkg.dec
> @@ -17,7 +17,6 @@ [Includes]
>Include
> 
>  [Includes.Common.Private]
> -  PrivateInclude# Private header files for C RTL.
>PrivateInclude/Crt# Private header files for C RTL.
>Library/JsonLib   # Private header files for jansson
>  # configuration files.
> --
> 2.37.1.windows.1


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


<>