Re: [edk2] [patch] MdeModulePkg/Xhci: add 1ms delay before access MMIO reg during reset

2016-09-19 Thread Tian, Feng
Leif & Mike

I will help to submit another tracker to Bugzilla to track this request.

1. create below new clear time definitions
2. remove those separate definitions in modules to get code clean.

Thanks
Feng

-Original Message-
From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of Leif 
Lindholm
Sent: Thursday, September 15, 2016 6:20 PM
To: Kinney, Michael D 
Cc: Tian, Feng ; edk2-devel@lists.01.org; Zeng, Star 

Subject: Re: [edk2] [patch] MdeModulePkg/Xhci: add 1ms delay before access MMIO 
reg during reset

On Wed, Sep 14, 2016 at 05:14:19PM +, Kinney, Michael D wrote:
> MdePkg/Include/Library/UefiLib.h does have some helper macros for 
> setting timer events periods that are in 100 nS units:
> 
>   #define EFI_TIMER_PERIOD_MICROSECONDS(Microseconds) 
> MultU64x32((UINT64)(Microseconds), 10)
>   #define EFI_TIMER_PERIOD_MILLISECONDS(Milliseconds) 
> MultU64x32((UINT64)(Milliseconds), 1)
>   #define EFI_TIMER_PERIOD_SECONDS(Seconds)   
> MultU64x32((UINT64)(Seconds), 1000)
> 
> I believe the examples you show are for use with the gBS->Stall() 
> service which is in 1 uS units.

Correct.

> Maybe we should consider some additional macros in UefiLib.h
> 
>   #define EFI_STALL_PERIOD_MICROSECONDS(Microseconds) (Microseconds)
>   #define EFI_STALL_PERIOD_MILLISECONDS(Milliseconds) ((Milliseconds) * 1000)
>   #define EFI_STALL_PERIOD_SECONDS(Seconds)   ((Seconds) * 100)
> 
> Or maybe some macros that actually do the call to gBS->Stall() too.
> 
>   #define EFI_STALL_MICROSECONDS(Microseconds) gBS->Stall (Microseconds)
>   #define EFI_STALL_MILLISECONDS(Milliseconds) gBS->Stall ((Milliseconds) * 
> 1000)
>   #define EFI_STALL_SECONDS(Seconds)   gBS->Stall ((Seconds) * 
> 100)
> 

Either (or both) of those two look good to me. The latter has the benefit of a 
smaller call site, at the cost of perhaps obscuring the dependency on 
UefiRuntimeServicesTableLib.

> The other method of generating timed delays for PEI/DXE/SMM modules is 
> using the Services in MdePkg/Include/Library/TimerLib.h:
> 
>   UINTN
>   EFIAPI
>   NanoSecondDelay (
> IN  UINTN NanoSeconds
> );
> 
>   UINTN
>   EFIAPI
>   MicroSecondDelay (
> IN  UINTN MicroSeconds
> );
> 
> If we wanted macros helper to use these services to match UEFI ones, 
> maybe add the following to TimerLib.h:
> 
>   #define DELAY_NANOSECONDS(Nanoseconds)   NanoSecondDelay (Nanoseconds)
>   #define DELAY_MICROSECONDS(Microseconds) MicroSecondDelay (Microseconds)
>   #define DELAY_MILLISECONDS(Milliseconds) MicroSecondDelay ((Microseconds) * 
> 1000)
>   #define DELAY_SECONDS(Seconds)   MicroSecondDelay ((Microseconds) * 
> 100) 

I'm less concerned about those, but it could make sense for completeness.

> Do you think it would improve the maintenance of the code if macros 
> like these were used consistently?

It would certainly be good to reduce duplication, and consistency would help 
with the readability of the code. (Which is good for
reviewing.)

Regards,

Leif
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH v2 2/3] MdePkg/BaseMemoryLib*: add missing ASSERT()s

2016-09-19 Thread Wu, Hao A
Hi Ard,

The NULL checks for the input Guids in APIs CopyGuid(), CompareGuid() and
IsZeroGuid() are implicitly done within calls to BaseLib APIs
ReadUnaligned64() and WriteUnaligned64().

So I think the functions behavior matches with their comments. What do you
think?

Best Regards,
Hao Wu

> -Original Message-
> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of Ard
> Biesheuvel
> Sent: Monday, September 19, 2016 4:14 PM
> To: edk2-devel@lists.01.org; Gao, Liming
> Cc: vish...@qti.qualcomm.com; leif.lindh...@linaro.org; Ard Biesheuvel
> Subject: [edk2] [PATCH v2 2/3] MdePkg/BaseMemoryLib*: add missing
> ASSERT()s
> 
> Add the ASSERT() statements to CopyGuid (), CompareGuid() and
> IsZeroGuid() that are mentioned in the respective comments but
> were missing from the actual code.
> 
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Ard Biesheuvel 
> ---
>  MdePkg/Library/BaseMemoryLib/MemLibGuid.c   | 8 
>  MdePkg/Library/BaseMemoryLibMmx/MemLibGuid.c| 8 
>  MdePkg/Library/BaseMemoryLibOptDxe/MemLibGuid.c | 8 
>  MdePkg/Library/BaseMemoryLibOptPei/MemLibGuid.c | 8 
>  MdePkg/Library/BaseMemoryLibRepStr/MemLibGuid.c | 8 
>  MdePkg/Library/BaseMemoryLibSse2/MemLibGuid.c   | 8 
>  MdePkg/Library/PeiMemoryLib/MemLibGuid.c| 8 
>  MdePkg/Library/UefiMemoryLib/MemLibGuid.c   | 8 
>  8 files changed, 64 insertions(+)
> 
> diff --git a/MdePkg/Library/BaseMemoryLib/MemLibGuid.c
> b/MdePkg/Library/BaseMemoryLib/MemLibGuid.c
> index b2590f83caef..dff9bde653a9 100644
> --- a/MdePkg/Library/BaseMemoryLib/MemLibGuid.c
> +++ b/MdePkg/Library/BaseMemoryLib/MemLibGuid.c
> @@ -47,6 +47,9 @@ CopyGuid (
>IN CONST GUID  *SourceGuid
>)
>  {
> +  ASSERT (DestinationGuid != NULL);
> +  ASSERT (SourceGuid != NULL);
> +
>WriteUnaligned64 (
>  (UINT64*)DestinationGuid,
>  ReadUnaligned64 ((CONST UINT64*)SourceGuid)
> @@ -86,6 +89,9 @@ CompareGuid (
>UINT64  HighPartOfGuid1;
>UINT64  HighPartOfGuid2;
> 
> +  ASSERT (Guid1 != NULL);
> +  ASSERT (Guid2 != NULL);
> +
>LowPartOfGuid1  = ReadUnaligned64 ((CONST UINT64*) Guid1);
>LowPartOfGuid2  = ReadUnaligned64 ((CONST UINT64*) Guid2);
>HighPartOfGuid1 = ReadUnaligned64 ((CONST UINT64*) Guid1 + 1);
> @@ -164,6 +170,8 @@ IsZeroGuid (
>UINT64  LowPartOfGuid;
>UINT64  HighPartOfGuid;
> 
> +  ASSERT (Guid != NULL);
> +
>LowPartOfGuid  = ReadUnaligned64 ((CONST UINT64*) Guid);
>HighPartOfGuid = ReadUnaligned64 ((CONST UINT64*) Guid + 1);
> 
> diff --git a/MdePkg/Library/BaseMemoryLibMmx/MemLibGuid.c
> b/MdePkg/Library/BaseMemoryLibMmx/MemLibGuid.c
> index cbb385fddfba..60babaf0dc49 100644
> --- a/MdePkg/Library/BaseMemoryLibMmx/MemLibGuid.c
> +++ b/MdePkg/Library/BaseMemoryLibMmx/MemLibGuid.c
> @@ -47,6 +47,9 @@ CopyGuid (
>IN CONST GUID  *SourceGuid
>)
>  {
> +  ASSERT (DestinationGuid != NULL);
> +  ASSERT (SourceGuid != NULL);
> +
>WriteUnaligned64 (
>  (UINT64*)DestinationGuid,
>  ReadUnaligned64 ((CONST UINT64*)SourceGuid)
> @@ -86,6 +89,9 @@ CompareGuid (
>UINT64  HighPartOfGuid1;
>UINT64  HighPartOfGuid2;
> 
> +  ASSERT (Guid1 != NULL);
> +  ASSERT (Guid2 != NULL);
> +
>LowPartOfGuid1  = ReadUnaligned64 ((CONST UINT64*) Guid1);
>LowPartOfGuid2  = ReadUnaligned64 ((CONST UINT64*) Guid2);
>HighPartOfGuid1 = ReadUnaligned64 ((CONST UINT64*) Guid1 + 1);
> @@ -164,6 +170,8 @@ IsZeroGuid (
>UINT64  LowPartOfGuid;
>UINT64  HighPartOfGuid;
> 
> +  ASSERT (Guid != NULL);
> +
>LowPartOfGuid  = ReadUnaligned64 ((CONST UINT64*) Guid);
>HighPartOfGuid = ReadUnaligned64 ((CONST UINT64*) Guid + 1);
> 
> diff --git a/MdePkg/Library/BaseMemoryLibOptDxe/MemLibGuid.c
> b/MdePkg/Library/BaseMemoryLibOptDxe/MemLibGuid.c
> index cbb385fddfba..60babaf0dc49 100644
> --- a/MdePkg/Library/BaseMemoryLibOptDxe/MemLibGuid.c
> +++ b/MdePkg/Library/BaseMemoryLibOptDxe/MemLibGuid.c
> @@ -47,6 +47,9 @@ CopyGuid (
>IN CONST GUID  *SourceGuid
>)
>  {
> +  ASSERT (DestinationGuid != NULL);
> +  ASSERT (SourceGuid != NULL);
> +
>WriteUnaligned64 (
>  (UINT64*)DestinationGuid,
>  ReadUnaligned64 ((CONST UINT64*)SourceGuid)
> @@ -86,6 +89,9 @@ CompareGuid (
>UINT64  HighPartOfGuid1;
>UINT64  HighPartOfGuid2;
> 
> +  ASSERT (Guid1 != NULL);
> +  ASSERT (Guid2 != NULL);
> +
>LowPartOfGuid1  = ReadUnaligned64 ((CONST UINT64*) Guid1);
>LowPartOfGuid2  = ReadUnaligned64 ((CONST UINT64*) Guid2);
>HighPartOfGuid1 = ReadUnaligned64 ((CONST UINT64*) Guid1 + 1);
> @@ -164,6 +170,8 @@ IsZeroGuid (
>UINT64  LowPartOfGuid;
>UINT64  HighPartOfGuid;
> 
> +  ASSERT (Guid != NULL);
> +
>LowPartOfGuid  = ReadUnaligned64 ((CONST UINT64*) Guid);
>HighPartOfGuid = ReadUnaligned64 ((CONST UINT64*) Guid + 1);
> 
> diff --git a/MdePkg/Library/BaseMemoryLibOptPei/MemLibGuid.c
> 

Re: [edk2] Help Required legacy booting from an EFI

2016-09-19 Thread Laszlo Ersek
On 09/19/16 17:00, Saqib Khan wrote:
> Hello all, this is my first post to this list and i am very new to edk2
> development.
> 
> I started by building BootManagerMenuApp with following functionality
> 
>- Boot from BootManagerManueApp
>- Run an Helloworld EFI
>- Run windows 7 EFI to boot windows 7
> 
> Now i want to develop an EFI which will first run Helloworld EFI then it
> will boot windows 7 which is installed on legacy boot (NOT EFI).
> 
> I have looked through http://bluestop.org/edk2/docs/trunk/ documentation
> thoroughly but i am not able to get any thing for legacy boot from an EFI.
> 
> 
> It will be helpful if someone guide me the flow for legacy booting from an
> EFI .

You can add your EFI application to a SysPrep load option, then the
legacy-booted Windows OS to a normal Boot load option.

See "3.1.7 Required System Preparation Applications" in the UEFI-2.6
spec, about the ordering between SysPrep and Boot.

Furthermore, legacy boot can be triggered by using a BBS (BIOS Boot
Specification) device path in the Boot option. This devpath node
type is documented in UEFI-2.6 "Table 98. Device Node Table", and in the
Compatibility Support Module Specification, rev 0.98, "3.2.1 Legacy BIOS
Protocol", near BBS_BBS_DEVICE_PATH.

For legacy boot to work, your platform firmware must of course include a
Compatibility Support Module.

As an example platform, SeaBIOS can be built as a CSM, then embedded
into OVMF with the -D CSM_ENABLE build switch. (Grep
OvmfPkg/OvmfPkg*.{dsc,fdf} for CSM_ENABLE.)

Specifically for Windows 7 though, you don't need a full CSM in order to
boot it under UEFI. You can boot it in UEFI mode just fine, as long as
you have some VBE services installed in the C segment. Windows 7 will
run those functions in its internal real-mode emulator, for setting up
the display:

https://en.wikipedia.org/wiki/Virtual_DOS_machine

That is, the VBE functions will not be executed natively, they will be
interpreted / emulated.

We utilized this fact for booting UEFI Windows 7 without a CSM on QEMU,
on the virtual QXL video card; see OvmfPkg/QemuVideoDxe/VbeShim.*.

Thanks
Laszlo

___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


[edk2] Help Required legacy booting from an EFI

2016-09-19 Thread Saqib Khan
Hello all, this is my first post to this list and i am very new to edk2
development.

I started by building BootManagerMenuApp with following functionality

   - Boot from BootManagerManueApp
   - Run an Helloworld EFI
   - Run windows 7 EFI to boot windows 7

Now i want to develop an EFI which will first run Helloworld EFI then it
will boot windows 7 which is installed on legacy boot (NOT EFI).

I have looked through http://bluestop.org/edk2/docs/trunk/ documentation
thoroughly but i am not able to get any thing for legacy boot from an EFI.


It will be helpful if someone guide me the flow for legacy booting from an
EFI .

-- 
Regards
saqib khan
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] Ingebrigtsen: The End of Gmane?

2016-09-19 Thread Laszlo Ersek
On 09/06/16 18:20, Bruce Cran wrote:
> On 9/6/16 3:25 AM, Laszlo Ersek wrote:
> 
>> The gmane web interface is gone, and I'm unaware of anyone who has
>> picked up the archive and exposed it under the same URLs (via domain
>> name transfer etc). So, at the moment (to my knowledge) all our
>> historical gmane links are broken. Neither do I know how someone could
>> access edk2-devel messages that predate Mike's enablement of the
>> built-in  archive.
> 
> As of today, it seems a reboot is underway:
> http://home.gmane.org/2016/09/06/reboot-v1/
> 
> "I just re-enabled some of the URLs and traffic is flowing.
> 
> This rebuild is going to require an ongoing effort to bring it back to
> its former glory but we will get there shortly."
> 

Today I happened to click a gmane link "just in case", and incredibly,
it worked. The web archive is up again; it even looks almost identically
to the old one.

Laszlo
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] edk2 compile error

2016-09-19 Thread Laszlo Ersek
On 09/18/16 05:38, Chen, Farrah wrote:
> Hi,
> 
> When I compile xen with the latest commit in RHEL 6.7, it failed when make 
> tools. Errors showed when running edk2 build for OvmfPkgX64.
> Bisected and this error occurred from commit 
> 8c8b6fb02342f7aa78e611a5f0f63dcf8fbf48f2.
> 
> commit 8c8b6fb02342f7aa78e611a5f0f63dcf8fbf48f2
> Author: Wei Liu >
> Date:   Tue Sep 6 12:54:47 2016 +0100
> 
> Config.mk: update OVMF commit
> 
> Signed-off-by: Wei Liu wei.l...@citrix.com
> 
> 
> We have updated OVMF to the latest master and cleaned everything before 
> rebuilding.
> 
> 
> 
> Steps:
> 
> make clean
> 
> make xen -j8
> 
> ./configure --enable-ovmf
> 
> make tools -j8
> 
> Then the error occurred.
> 
> 
> 
> 
> 
> I also tried:
> 
> git clone https://github.com/tianocore/edk2.git
> 
> cd edk2
> 
> OvmfPkg/build.sh -a X64 -b DEBUG -n 4
> The same error occurred.
> .
> 
> log:
> ..
> Running edk2 build for OvmfPkgX64
> ..
> /home/www/builds_xen_unstable/xen-src-8c8b6fb0-20160912/tools/firmware/ovmf-dir-remote/Build/OvmfX64/DEBUG_GCC44/X64/UefiCpuPkg/Library/CpuExceptionHandlerLib/DxeCpuExceptionHandlerLib/OUTPUT/X64/ExceptionHandlerAsm.iii:173:
>  error: invalid combination of opcode and operands
> /home/www/builds_xen_unstable/xen-src-8c8b6fb0-20160912/tools/firmware/ovmf-dir-remote/Build/OvmfX64/DEBUG_GCC44/X64/UefiCpuPkg/Library/CpuExceptionHandlerLib/DxeCpuExceptionHandlerLib/OUTPUT/X64/ExceptionHandlerAsm.iii:175:
>  error: invalid combination of opcode and operands
> /home/www/builds_xen_unstable/xen-src-8c8b6fb0-20160912/tools/firmware/ovmf-dir-remote/Build/OvmfX64/DEBUG_GCC44/X64/UefiCpuPkg/Library/CpuExceptionHandlerLib/DxeCpuExceptionHandlerLib/OUTPUT/X64/ExceptionHandlerAsm.iii:177:
>  error: invalid combination of opcode and operands
> /home/www/builds_xen_unstable/xen-src-8c8b6fb0-20160912/tools/firmware/ovmf-dir-remote/Build/OvmfX64/DEBUG_GCC44/X64/UefiCpuPkg/Library/CpuExceptionHandlerLib/DxeCpuExceptionHandlerLib/OUTPUT/X64/ExceptionHandlerAsm.iii:179:
>  error: invalid combination of opcode and operands
> /home/www/builds_xen_unstable/xen-src-8c8b6fb0-20160912/tools/firmware/ovmf-dir-remote/Build/OvmfX64/DEBUG_GCC44/X64/UefiCpuPkg/Library/CpuExceptionHandlerLib/DxeCpuExceptionHandlerLib/OUTPUT/X64/ExceptionHandlerAsm.iii:313:
>  error: invalid combination of opcode and operands
> /home/www/builds_xen_unstable/xen-src-8c8b6fb0-20160912/tools/firmware/ovmf-dir-remote/Build/OvmfX64/DEBUG_GCC44/X64/UefiCpuPkg/Library/CpuExceptionHandlerLib/DxeCpuExceptionHandlerLib/OUTPUT/X64/ExceptionHandlerAsm.iii:315:
>  error: invalid combination of opcode and operands
> make[7]: Leaving directory 
> `/home/www/builds_xen_unstable/xen-src-8c8b6fb0-20160912/tools/firmware/ovmf-dir-remote/Build/OvmfX64/DEBUG_GCC44/X64/UefiCpuPkg/Library/CpuExceptionHandlerLib/DxeCpuExceptionHandlerLib'
> make[7]: *** 
> [/home/www/builds_xen_unstable/xen-src-8c8b6fb0-20160912/tools/firmware/ovmf-dir-remote/Build/OvmfX64/DEBUG_GCC44/X64/UefiCpuPkg/Library/CpuExceptionHandlerLib/DxeCpuExceptionHandlerLib/OUTPUT/X64/ExceptionHandlerAsm.obj]
>  Error 1
> 
> 
> build.py...
> : error 7000: Failed to execute command
> make tbuild 
> [/home/www/builds_xen_unstable/xen-src-8c8b6fb0-20160912/tools/firmware/ovmf-dir-remote/Build/OvmfX64/DEBUG_GCC44/X64/UefiCpuPkg/Library/CpuExceptionHandlerLib/DxeCpuExceptionHandlerLib]
> 
> 
> build.py...
> : error F002: Failed to build module
> 
> /home/www/builds_xen_unstable/xen-src-8c8b6fb0-20160912/tools/firmware/ovmf-dir-remote/UefiCpuPkg/Library/CpuExceptionHandlerLib/DxeCpuExceptionHandlerLib.inf
>  [X64, GCC44, DEBUG]
> 
> - Failed -

RHEL-6 does not have a nasm version that is recent enough to build edk2.
RHEL-6 ships nasm-2.07-*, but edk2 requires nasm-2.10 or later with the
GCC toolchain family.

Please see this mailing list thread:
https://www.mail-archive.com/edk2-devel@lists.01.org/msg14420.html

And the resultant docs commit:
https://github.com/tianocore/edk2/commit/9c4dbdff1d56

... Before anyone suggests otherwise, this was not a gratuitous version
requirement bump. The edk2 assembly code had already been there, the
nasm version bump only documented the status, after the fact.

For RHEL-6 specifically, I suggest to grab a recent enough nasm SRPM
from Fedora Koji, and rebuild / install that locally. Better yet, I
recommend upgrading to RHEL-7, whose nasm is good enough.

Thanks
Laszlo

___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] edk2 compile error

2016-09-19 Thread Wei Liu
Hi all

In order to make things clearer: this seems to be a problem in upstream
EDK2. Xen Project only tracks upstream, no additional patch is added on
top.

So, I deleted the irrelevant bits below.

On Sun, Sep 18, 2016 at 03:38:19AM +, Chen, Farrah wrote:

> I also tried:
> 
> git clone https://github.com/tianocore/edk2.git
> 
> cd edk2
> 
> OvmfPkg/build.sh -a X64 -b DEBUG -n 4
> The same error occurred.
> .
> 
> log:
> ..
> Running edk2 build for OvmfPkgX64
> ..
> /home/www/builds_xen_unstable/xen-src-8c8b6fb0-20160912/tools/firmware/ovmf-dir-remote/Build/OvmfX64/DEBUG_GCC44/X64/UefiCpuPkg/Library/CpuExceptionHandlerLib/DxeCpuExceptionHandlerLib/OUTPUT/X64/ExceptionHandlerAsm.iii:173:
>  error: invalid combination of opcode and operands
> /home/www/builds_xen_unstable/xen-src-8c8b6fb0-20160912/tools/firmware/ovmf-dir-remote/Build/OvmfX64/DEBUG_GCC44/X64/UefiCpuPkg/Library/CpuExceptionHandlerLib/DxeCpuExceptionHandlerLib/OUTPUT/X64/ExceptionHandlerAsm.iii:175:
>  error: invalid combination of opcode and operands
> /home/www/builds_xen_unstable/xen-src-8c8b6fb0-20160912/tools/firmware/ovmf-dir-remote/Build/OvmfX64/DEBUG_GCC44/X64/UefiCpuPkg/Library/CpuExceptionHandlerLib/DxeCpuExceptionHandlerLib/OUTPUT/X64/ExceptionHandlerAsm.iii:177:
>  error: invalid combination of opcode and operands
> /home/www/builds_xen_unstable/xen-src-8c8b6fb0-20160912/tools/firmware/ovmf-dir-remote/Build/OvmfX64/DEBUG_GCC44/X64/UefiCpuPkg/Library/CpuExceptionHandlerLib/DxeCpuExceptionHandlerLib/OUTPUT/X64/ExceptionHandlerAsm.iii:179:
>  error: invalid combination of opcode and operands
> /home/www/builds_xen_unstable/xen-src-8c8b6fb0-20160912/tools/firmware/ovmf-dir-remote/Build/OvmfX64/DEBUG_GCC44/X64/UefiCpuPkg/Library/CpuExceptionHandlerLib/DxeCpuExceptionHandlerLib/OUTPUT/X64/ExceptionHandlerAsm.iii:313:
>  error: invalid combination of opcode and operands
> /home/www/builds_xen_unstable/xen-src-8c8b6fb0-20160912/tools/firmware/ovmf-dir-remote/Build/OvmfX64/DEBUG_GCC44/X64/UefiCpuPkg/Library/CpuExceptionHandlerLib/DxeCpuExceptionHandlerLib/OUTPUT/X64/ExceptionHandlerAsm.iii:315:
>  error: invalid combination of opcode and operands
> make[7]: Leaving directory 
> `/home/www/builds_xen_unstable/xen-src-8c8b6fb0-20160912/tools/firmware/ovmf-dir-remote/Build/OvmfX64/DEBUG_GCC44/X64/UefiCpuPkg/Library/CpuExceptionHandlerLib/DxeCpuExceptionHandlerLib'
> make[7]: *** 
> [/home/www/builds_xen_unstable/xen-src-8c8b6fb0-20160912/tools/firmware/ovmf-dir-remote/Build/OvmfX64/DEBUG_GCC44/X64/UefiCpuPkg/Library/CpuExceptionHandlerLib/DxeCpuExceptionHandlerLib/OUTPUT/X64/ExceptionHandlerAsm.obj]
>  Error 1
> 
> 
> build.py...
> : error 7000: Failed to execute command
> make tbuild 
> [/home/www/builds_xen_unstable/xen-src-8c8b6fb0-20160912/tools/firmware/ovmf-dir-remote/Build/OvmfX64/DEBUG_GCC44/X64/UefiCpuPkg/Library/CpuExceptionHandlerLib/DxeCpuExceptionHandlerLib]
> 
> 
> build.py...
> : error F002: Failed to build module
> 
> /home/www/builds_xen_unstable/xen-src-8c8b6fb0-20160912/tools/firmware/ovmf-dir-remote/UefiCpuPkg/Library/CpuExceptionHandlerLib/DxeCpuExceptionHandlerLib.inf
>  [X64, GCC44, DEBUG]
> 
> - Failed -
> 
> 
> Thanks,
> Fan Chen
> 
> 
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


[edk2] [PATCH v2] MdeModulePkg/PciBusDxe: make OPROM BAR degradation configurable

2016-09-19 Thread Ard Biesheuvel
The 'universal' PCI bus driver in MdeModulePkg contains a quirk to
degrade 64-bit PCI MMIO BARs to 32-bit in the presence of an option
ROM on the same PCI controller.

This quirk is highly specific to not just the X64 architecture in general,
but to the PC platform in particular, given that only X64 platforms that
require legacy PC BIOS compatibility require it. However, making the
quirk dependent on the presence of the legacy BIOS protocol met with
resistance, due to the fact that it introduces a dependency on the
IntelFrameworkModulePkg package.

So instead, make the quirk configurable, by introducing a feature flag PCD
which defaults to TRUE only for X64.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel 
---
v2: followed the suggestion of Andrew Fish to introduce a new feature flag
PCD that controls the PCI BAR degradation behavior.

 MdeModulePkg/Bus/Pci/PciBusDxe/PciBusDxe.inf|  1 +
 MdeModulePkg/Bus/Pci/PciBusDxe/PciResourceSupport.c | 76 ++--
 MdeModulePkg/MdeModulePkg.dec   | 12 
 3 files changed, 52 insertions(+), 37 deletions(-)

diff --git a/MdeModulePkg/Bus/Pci/PciBusDxe/PciBusDxe.inf 
b/MdeModulePkg/Bus/Pci/PciBusDxe/PciBusDxe.inf
index 330ccc8cbffc..fc49f3d9412c 100644
--- a/MdeModulePkg/Bus/Pci/PciBusDxe/PciBusDxe.inf
+++ b/MdeModulePkg/Bus/Pci/PciBusDxe/PciBusDxe.inf
@@ -100,6 +100,7 @@ [FeaturePcd]
   gEfiMdeModulePkgTokenSpaceGuid.PcdPciBusHotplugDeviceSupport  ## CONSUMES
   gEfiMdeModulePkgTokenSpaceGuid.PcdPciBridgeIoAlignmentProbe   ## CONSUMES
   gEfiMdeModulePkgTokenSpaceGuid.PcdUnalignedPciIoEnable## CONSUMES
+  gEfiMdeModulePkgTokenSpaceGuid.PcdPciDegradeBarsForOptionRom  ## CONSUMES
 
 [Pcd]
   gEfiMdeModulePkgTokenSpaceGuid.PcdSrIovSystemPageSize ## 
SOMETIMES_CONSUMES
diff --git a/MdeModulePkg/Bus/Pci/PciBusDxe/PciResourceSupport.c 
b/MdeModulePkg/Bus/Pci/PciBusDxe/PciResourceSupport.c
index b0632d53b82b..37dc03e90358 100644
--- a/MdeModulePkg/Bus/Pci/PciBusDxe/PciResourceSupport.c
+++ b/MdeModulePkg/Bus/Pci/PciBusDxe/PciResourceSupport.c
@@ -1058,48 +1058,50 @@ DegradeResource (
   LIST_ENTRY   *NextChildNodeLink;
   PCI_RESOURCE_NODE*ResourceNode;
 
-  //
-  // If any child device has both option ROM and 64-bit BAR, degrade its 
PMEM64/MEM64
-  // requests in case that if a legacy option ROM image can not access 64-bit 
resources.
-  //
-  ChildDeviceLink = Bridge->ChildList.ForwardLink;
-  while (ChildDeviceLink != NULL && ChildDeviceLink != >ChildList) {
-PciIoDevice = PCI_IO_DEVICE_FROM_LINK (ChildDeviceLink);
-if (PciIoDevice->RomSize != 0) {
-  if (!IsListEmpty (>ChildList)) {  
-ChildNodeLink = Mem64Node->ChildList.ForwardLink;
-while (ChildNodeLink != >ChildList) {
-  ResourceNode = RESOURCE_NODE_FROM_LINK (ChildNodeLink);
-  NextChildNodeLink = ChildNodeLink->ForwardLink;
-
-  if ((ResourceNode->PciDev == PciIoDevice) &&
-  (ResourceNode->Virtual || 
!PciIoDevice->PciBar[ResourceNode->Bar].BarTypeFixed)
-  ) {
-RemoveEntryList (ChildNodeLink);
-InsertResourceNode (Mem32Node, ResourceNode);
+  if (FeaturePcdGet (PcdPciDegradeBarsForOptionRom)) {
+//
+// If any child device has both option ROM and 64-bit BAR, degrade its 
PMEM64/MEM64
+// requests in case that if a legacy option ROM image can not access 
64-bit resources.
+//
+ChildDeviceLink = Bridge->ChildList.ForwardLink;
+while (ChildDeviceLink != NULL && ChildDeviceLink != >ChildList) {
+  PciIoDevice = PCI_IO_DEVICE_FROM_LINK (ChildDeviceLink);
+  if (PciIoDevice->RomSize != 0) {
+if (!IsListEmpty (>ChildList)) {
+  ChildNodeLink = Mem64Node->ChildList.ForwardLink;
+  while (ChildNodeLink != >ChildList) {
+ResourceNode = RESOURCE_NODE_FROM_LINK (ChildNodeLink);
+NextChildNodeLink = ChildNodeLink->ForwardLink;
+
+if ((ResourceNode->PciDev == PciIoDevice) &&
+(ResourceNode->Virtual || 
!PciIoDevice->PciBar[ResourceNode->Bar].BarTypeFixed)
+) {
+  RemoveEntryList (ChildNodeLink);
+  InsertResourceNode (Mem32Node, ResourceNode);
+}
+ChildNodeLink = NextChildNodeLink;
   }
-  ChildNodeLink = NextChildNodeLink;
-}
-  }
+}
 
-  if (!IsListEmpty (>ChildList)) {  
-ChildNodeLink = PMem64Node->ChildList.ForwardLink;
-while (ChildNodeLink != >ChildList) {
-  ResourceNode = RESOURCE_NODE_FROM_LINK (ChildNodeLink);
-  NextChildNodeLink = ChildNodeLink->ForwardLink;
-
-  if ((ResourceNode->PciDev == PciIoDevice) &&
-  (ResourceNode->Virtual || 
!PciIoDevice->PciBar[ResourceNode->Bar].BarTypeFixed)
-  ) {
-RemoveEntryList (ChildNodeLink);
-InsertResourceNode (PMem32Node, 

[edk2] [PATCH v2 3/3] MdePkg/BaseMemoryLibOptDxe ARM|AARCH64: implement accelerated GUID functions

2016-09-19 Thread Ard Biesheuvel
As reported by Vishal, CompareGuid() is a hotspot, and switching from
BaseMemoryLibStm in ArmPkg/ to BaseMemoryLibOptDxe causes a noticeable
performance regression due to the fact that BaseMemoryLibOptDxe uses
unaligned accessors explicitly to implement CompareGuid() and the related
functions.

Since BaseMemoryLibOptDxe on ARM and AARCH64 can only be used in contexts
where unaligned accesses are allowed, reimplement these functions for ARM
and AARCH64 specifically, using wide accessors that can tolerate any
misalignment.

Reported-by: "Oliyil Kunnil, Vishal" 
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel 
---
 MdePkg/Library/BaseMemoryLibOptDxe/AArch64/CompareGuid.S   |  40 ++
 MdePkg/Library/BaseMemoryLibOptDxe/Arm/CompareGuid.S   |  66 +
 MdePkg/Library/BaseMemoryLibOptDxe/Arm/CompareGuid.asm |  69 +
 MdePkg/Library/BaseMemoryLibOptDxe/Arm/MemLibGuid.c| 152 

 MdePkg/Library/BaseMemoryLibOptDxe/BaseMemoryLibOptDxe.inf |   7 +-
 5 files changed, 333 insertions(+), 1 deletion(-)

diff --git a/MdePkg/Library/BaseMemoryLibOptDxe/AArch64/CompareGuid.S 
b/MdePkg/Library/BaseMemoryLibOptDxe/AArch64/CompareGuid.S
new file mode 100644
index ..9e1b55cdf589
--- /dev/null
+++ b/MdePkg/Library/BaseMemoryLibOptDxe/AArch64/CompareGuid.S
@@ -0,0 +1,40 @@
+//
+// Copyright (c) 2016, Linaro Limited
+// All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+// * Redistributions of source code must retain the above copyright
+//   notice, this list of conditions and the following disclaimer.
+// * Redistributions in binary form must reproduce the above copyright
+//   notice, this list of conditions and the following disclaimer in the
+//   documentation and/or other materials provided with the distribution.
+// * Neither the name of the Linaro nor the
+//   names of its contributors may be used to endorse or promote products
+//   derived from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//
+
+.text
+.align  5
+ASM_GLOBAL ASM_PFX(InternalMemCompareGuid)
+ASM_PFX(InternalMemCompareGuid):
+mov x2, xzr
+ldp x3, x4, [x0]
+cbz x1, 0f
+ldp x1, x2, [x1]
+0:  cmp x1, x3
+ccmpx2, x4, #0, eq
+csetw0, eq
+ret
diff --git a/MdePkg/Library/BaseMemoryLibOptDxe/Arm/CompareGuid.S 
b/MdePkg/Library/BaseMemoryLibOptDxe/Arm/CompareGuid.S
new file mode 100644
index ..dca79b423a40
--- /dev/null
+++ b/MdePkg/Library/BaseMemoryLibOptDxe/Arm/CompareGuid.S
@@ -0,0 +1,66 @@
+//
+// Copyright (c) 2016, Linaro Limited
+// All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+// * Redistributions of source code must retain the above copyright
+//   notice, this list of conditions and the following disclaimer.
+// * Redistributions in binary form must reproduce the above copyright
+//   notice, this list of conditions and the following disclaimer in the
+//   documentation and/or other materials provided with the distribution.
+// * Neither the name of the Linaro nor the
+//   names of its contributors may be used to endorse or promote products
+//   derived from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF 

[edk2] [PATCH v2 1/3] MdePkg/BaseMemoryLibOptDxe ARM: fix arithmetic bugs in CompareMem()

2016-09-19 Thread Ard Biesheuvel
Fix two bugs:
- Erroneous shift of 2 in a bytes to bits conversion.
- Use reverse subtract rather than negate for value that is subsequently
  used as operand #2 in a shift operation.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel 
---
 MdePkg/Library/BaseMemoryLibOptDxe/Arm/CompareMem.S | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/MdePkg/Library/BaseMemoryLibOptDxe/Arm/CompareMem.S 
b/MdePkg/Library/BaseMemoryLibOptDxe/Arm/CompareMem.S
index 951d15777a38..3aadebace30f 100644
--- a/MdePkg/Library/BaseMemoryLibOptDxe/Arm/CompareMem.S
+++ b/MdePkg/Library/BaseMemoryLibOptDxe/Arm/CompareMem.S
@@ -110,9 +110,9 @@ ASM_PFX(InternalMemCompareMem):
 bic src1, src1, #3
 bic src2, src2, #3
 add limit, limit, tmp1  // Adjust the limit for the extra.
-lsl tmp1, tmp1, #2  // Bytes beyond alignment -> bits.
+lsl tmp1, tmp1, #3  // Bytes beyond alignment -> bits.
 ldr data1, [src1], #4
-neg tmp1, tmp1  // Bits to alignment -32.
+rsb tmp1, tmp1, #32 // Bits to alignment -32.
 ldr data2, [src2], #4
 mov tmp2, #~0
 
-- 
2.7.4

___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


[edk2] [PATCH v2 2/3] MdePkg/BaseMemoryLib*: add missing ASSERT()s

2016-09-19 Thread Ard Biesheuvel
Add the ASSERT() statements to CopyGuid (), CompareGuid() and
IsZeroGuid() that are mentioned in the respective comments but
were missing from the actual code.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel 
---
 MdePkg/Library/BaseMemoryLib/MemLibGuid.c   | 8 
 MdePkg/Library/BaseMemoryLibMmx/MemLibGuid.c| 8 
 MdePkg/Library/BaseMemoryLibOptDxe/MemLibGuid.c | 8 
 MdePkg/Library/BaseMemoryLibOptPei/MemLibGuid.c | 8 
 MdePkg/Library/BaseMemoryLibRepStr/MemLibGuid.c | 8 
 MdePkg/Library/BaseMemoryLibSse2/MemLibGuid.c   | 8 
 MdePkg/Library/PeiMemoryLib/MemLibGuid.c| 8 
 MdePkg/Library/UefiMemoryLib/MemLibGuid.c   | 8 
 8 files changed, 64 insertions(+)

diff --git a/MdePkg/Library/BaseMemoryLib/MemLibGuid.c 
b/MdePkg/Library/BaseMemoryLib/MemLibGuid.c
index b2590f83caef..dff9bde653a9 100644
--- a/MdePkg/Library/BaseMemoryLib/MemLibGuid.c
+++ b/MdePkg/Library/BaseMemoryLib/MemLibGuid.c
@@ -47,6 +47,9 @@ CopyGuid (
   IN CONST GUID  *SourceGuid
   )
 {
+  ASSERT (DestinationGuid != NULL);
+  ASSERT (SourceGuid != NULL);
+
   WriteUnaligned64 (
 (UINT64*)DestinationGuid,
 ReadUnaligned64 ((CONST UINT64*)SourceGuid)
@@ -86,6 +89,9 @@ CompareGuid (
   UINT64  HighPartOfGuid1;
   UINT64  HighPartOfGuid2;
 
+  ASSERT (Guid1 != NULL);
+  ASSERT (Guid2 != NULL);
+
   LowPartOfGuid1  = ReadUnaligned64 ((CONST UINT64*) Guid1);
   LowPartOfGuid2  = ReadUnaligned64 ((CONST UINT64*) Guid2);
   HighPartOfGuid1 = ReadUnaligned64 ((CONST UINT64*) Guid1 + 1);
@@ -164,6 +170,8 @@ IsZeroGuid (
   UINT64  LowPartOfGuid;
   UINT64  HighPartOfGuid;
 
+  ASSERT (Guid != NULL);
+
   LowPartOfGuid  = ReadUnaligned64 ((CONST UINT64*) Guid);
   HighPartOfGuid = ReadUnaligned64 ((CONST UINT64*) Guid + 1);
 
diff --git a/MdePkg/Library/BaseMemoryLibMmx/MemLibGuid.c 
b/MdePkg/Library/BaseMemoryLibMmx/MemLibGuid.c
index cbb385fddfba..60babaf0dc49 100644
--- a/MdePkg/Library/BaseMemoryLibMmx/MemLibGuid.c
+++ b/MdePkg/Library/BaseMemoryLibMmx/MemLibGuid.c
@@ -47,6 +47,9 @@ CopyGuid (
   IN CONST GUID  *SourceGuid
   )
 {
+  ASSERT (DestinationGuid != NULL);
+  ASSERT (SourceGuid != NULL);
+
   WriteUnaligned64 (
 (UINT64*)DestinationGuid,
 ReadUnaligned64 ((CONST UINT64*)SourceGuid)
@@ -86,6 +89,9 @@ CompareGuid (
   UINT64  HighPartOfGuid1;
   UINT64  HighPartOfGuid2;
 
+  ASSERT (Guid1 != NULL);
+  ASSERT (Guid2 != NULL);
+
   LowPartOfGuid1  = ReadUnaligned64 ((CONST UINT64*) Guid1);
   LowPartOfGuid2  = ReadUnaligned64 ((CONST UINT64*) Guid2);
   HighPartOfGuid1 = ReadUnaligned64 ((CONST UINT64*) Guid1 + 1);
@@ -164,6 +170,8 @@ IsZeroGuid (
   UINT64  LowPartOfGuid;
   UINT64  HighPartOfGuid;
 
+  ASSERT (Guid != NULL);
+
   LowPartOfGuid  = ReadUnaligned64 ((CONST UINT64*) Guid);
   HighPartOfGuid = ReadUnaligned64 ((CONST UINT64*) Guid + 1);
 
diff --git a/MdePkg/Library/BaseMemoryLibOptDxe/MemLibGuid.c 
b/MdePkg/Library/BaseMemoryLibOptDxe/MemLibGuid.c
index cbb385fddfba..60babaf0dc49 100644
--- a/MdePkg/Library/BaseMemoryLibOptDxe/MemLibGuid.c
+++ b/MdePkg/Library/BaseMemoryLibOptDxe/MemLibGuid.c
@@ -47,6 +47,9 @@ CopyGuid (
   IN CONST GUID  *SourceGuid
   )
 {
+  ASSERT (DestinationGuid != NULL);
+  ASSERT (SourceGuid != NULL);
+
   WriteUnaligned64 (
 (UINT64*)DestinationGuid,
 ReadUnaligned64 ((CONST UINT64*)SourceGuid)
@@ -86,6 +89,9 @@ CompareGuid (
   UINT64  HighPartOfGuid1;
   UINT64  HighPartOfGuid2;
 
+  ASSERT (Guid1 != NULL);
+  ASSERT (Guid2 != NULL);
+
   LowPartOfGuid1  = ReadUnaligned64 ((CONST UINT64*) Guid1);
   LowPartOfGuid2  = ReadUnaligned64 ((CONST UINT64*) Guid2);
   HighPartOfGuid1 = ReadUnaligned64 ((CONST UINT64*) Guid1 + 1);
@@ -164,6 +170,8 @@ IsZeroGuid (
   UINT64  LowPartOfGuid;
   UINT64  HighPartOfGuid;
 
+  ASSERT (Guid != NULL);
+
   LowPartOfGuid  = ReadUnaligned64 ((CONST UINT64*) Guid);
   HighPartOfGuid = ReadUnaligned64 ((CONST UINT64*) Guid + 1);
 
diff --git a/MdePkg/Library/BaseMemoryLibOptPei/MemLibGuid.c 
b/MdePkg/Library/BaseMemoryLibOptPei/MemLibGuid.c
index cbb385fddfba..60babaf0dc49 100644
--- a/MdePkg/Library/BaseMemoryLibOptPei/MemLibGuid.c
+++ b/MdePkg/Library/BaseMemoryLibOptPei/MemLibGuid.c
@@ -47,6 +47,9 @@ CopyGuid (
   IN CONST GUID  *SourceGuid
   )
 {
+  ASSERT (DestinationGuid != NULL);
+  ASSERT (SourceGuid != NULL);
+
   WriteUnaligned64 (
 (UINT64*)DestinationGuid,
 ReadUnaligned64 ((CONST UINT64*)SourceGuid)
@@ -86,6 +89,9 @@ CompareGuid (
   UINT64  HighPartOfGuid1;
   UINT64  HighPartOfGuid2;
 
+  ASSERT (Guid1 != NULL);
+  ASSERT (Guid2 != NULL);
+
   LowPartOfGuid1  = ReadUnaligned64 ((CONST UINT64*) Guid1);
   LowPartOfGuid2  = ReadUnaligned64 ((CONST UINT64*) Guid2);
   HighPartOfGuid1 = ReadUnaligned64 ((CONST UINT64*) Guid1 + 1);
@@ -164,6 +170,8 @@ IsZeroGuid (
   UINT64  LowPartOfGuid;
   UINT64  HighPartOfGuid;
 
+  ASSERT (Guid != NULL);
+
   LowPartOfGuid  = ReadUnaligned64 

[edk2] [PATCH v2 0/3] MdePkg/BaseMemoryLibOptDxe: generic and ARM/AARCH64 fixes

2016-09-19 Thread Ard Biesheuvel
Some pending fixes for BaseMemoryLib* and BaseMemoryLibOptDxe, now resent
as a single series.

Patch #1 fixes an arithmetic bug in BaseMemoryLibOptDxe for ARM, which renders
it unusable at the moment.

Patch #2 adds some asserts that are mentioned in the respective comment blocks
but are missing from the code.

Patch #3 fixes a performance regressions observed by moving from the (soon to be
deprecated) BaseMemoryLibStm in ArmPkg to BaseMemoryLibOptDxe. The culprit has
been identified to be CompareGuid(), which needlessly uses unaligned accessors
(since this library can only be used in a context where unaligned accesses are
allowed)

Ard Biesheuvel (3):
  MdePkg/BaseMemoryLibOptDxe ARM: fix arithmetic bugs in CompareMem()
  MdePkg/BaseMemoryLib*: add missing ASSERT()s
  MdePkg/BaseMemoryLibOptDxe ARM|AARCH64: implement accelerated GUID
functions

 MdePkg/Library/BaseMemoryLib/MemLibGuid.c  |   8 ++
 MdePkg/Library/BaseMemoryLibMmx/MemLibGuid.c   |   8 ++
 MdePkg/Library/BaseMemoryLibOptDxe/AArch64/CompareGuid.S   |  40 ++
 MdePkg/Library/BaseMemoryLibOptDxe/Arm/CompareGuid.S   |  66 +
 MdePkg/Library/BaseMemoryLibOptDxe/Arm/CompareGuid.asm |  69 +
 MdePkg/Library/BaseMemoryLibOptDxe/Arm/CompareMem.S|   4 +-
 MdePkg/Library/BaseMemoryLibOptDxe/Arm/MemLibGuid.c| 152 

 MdePkg/Library/BaseMemoryLibOptDxe/BaseMemoryLibOptDxe.inf |   7 +-
 MdePkg/Library/BaseMemoryLibOptDxe/MemLibGuid.c|   8 ++
 MdePkg/Library/BaseMemoryLibOptPei/MemLibGuid.c|   8 ++
 MdePkg/Library/BaseMemoryLibRepStr/MemLibGuid.c|   8 ++
 MdePkg/Library/BaseMemoryLibSse2/MemLibGuid.c  |   8 ++
 MdePkg/Library/PeiMemoryLib/MemLibGuid.c   |   8 ++
 MdePkg/Library/UefiMemoryLib/MemLibGuid.c  |   8 ++
 14 files changed, 399 insertions(+), 3 deletions(-)
 create mode 100644 MdePkg/Library/BaseMemoryLibOptDxe/AArch64/CompareGuid.S
 create mode 100644 MdePkg/Library/BaseMemoryLibOptDxe/Arm/CompareGuid.S
 create mode 100644 MdePkg/Library/BaseMemoryLibOptDxe/Arm/CompareGuid.asm
 create mode 100644 MdePkg/Library/BaseMemoryLibOptDxe/Arm/MemLibGuid.c

-- 
2.7.4

___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel