Re: [edk2] Latest SVN Update Breaks Link

2018-12-02 Thread Gao, Liming
David:
  You can switch to git Edk2. Most people uses GitHub edk2. 

  And, you are right. When you update the code from old version, please type 
edksetup.bat Reconfig to configure them.  

Thanks
Liming
>-Original Message-
>From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of
>David F.
>Sent: Sunday, December 02, 2018 2:50 PM
>To: edk2 developers list 
>Subject: Re: [edk2] Latest SVN Update Breaks Link
>
>So digging in I saw there were in the .S files, and didn't look like
>building.  So, stumbling around, I finally looked at the Conf templates and
>saw new entries for nasm and such.  I went through the process of updating
>all my tool defs, setting up the PYTHON_HOME and NASM_PREFIX directories,
>and seems to build now except my own batch file didn't do what it normally
>does and give me a SUCCESS or FAILURE message so I know if all the nonsense
>on the screen should be looked at or not.   So looking a bit more "where
>build" I see it's not using a batch file which will break everyone's batch
>files since a "call" is now needed.  I think the errorlevel is returned
>from the call so it's sample to add call.
>
>In short, you'll need to update build Conf if updating from older version
>and adjust your batch files to use "call" for build.
>
>On Sat, Dec 1, 2018 at 7:37 PM David F.  wrote:
>
>> Hi,
>>
>> My last SVN update was from July 2018.   I just did one Yesterday now my
>> build breaks linking with:
>>
>> LibC.lib(Main.obj) : error LNK2001: unresolved external symbol SetJump
>> BaseLib.lib(LongJump.obj) : error LNK2001: unresolved external symbol
>> InternalLongJump
>>
>> The build is using VS2008 and the target is for X64.
>>
>> Any ideas?
>>
>>
>>
>>
>>
>___
>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] [RFC] Proposal to add edk2-apps repository

2018-12-02 Thread krishnaLee
Ruiyu,

At 2018-11-30 11:40:06, "Ni, Ruiyu"  wrote:
>I don't prefer edk2-libc unless we have a strategy/plan to make ordinary C 
>developer easy by promoting the std-c pkg.
>The other reason I prefer edk2-app is then ShellPkg might be moved to that new 
>repo.

I used to think ShellPkg can also develop apps has no dependency on it or 
libc,it would be a big app-container,but it seems its name will be 
mis-understanding...
I think your idea has the same function,and it's much better.


thanks,
krishna.








>> -Original Message-
>> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of
>> krishnaLee
>> Sent: Friday, November 30, 2018 9:45 AM
>> To: edk2-devel@lists.01.org
>> Subject: Re: [edk2] [RFC] Proposal to add edk2-apps repository
>> 
>> Kinney,
>> I always think there may be two kinds of apps:
>> 1,some apps have dependency on 
>> uefi_shell(shell-lib,efi_shell_protocol,...they
>> usually execute under uefi_shell),I would call them "uefi_shell_application";
>> 2,some apps have no dependency on uefi_shell(such as apps in
>> MdeModulePkg/Application),I would call them "standard_uefi_application".
>> 
>> The "AppPkg / StdLib / StdLibPrivateInternalFiles" packages are usually used 
>> by
>> uefi_shell_application,I think they can all move to ShellPkg,no need to 
>> create
>> new package ?
>> 
>> 
>> Thanks,
>> krishna.
>> 
>> At 2018-11-30 08:46:58, "Kinney, Michael D" 
>> wrote:
>> >Leif,
>> >
>> >I did consider the edk2-libc name.  The port of Python 2.7 is in the
>> >AppPkg as well and it uses libc.
>> >
>> >So the content of this new package is a combination of libc And apps
>> >that use libc.
>> >
>> >I am definitely open to alternate names.  2 options so far:
>> >
>> >* edk2-apps
>> >* edk2-libc
>> >
>> >Thanks,
>> >
>> >Mike
>> >
>> >> -Original Message-
>> >> From: Leif Lindholm [mailto:leif.lindh...@linaro.org]
>> >> Sent: Thursday, November 29, 2018 2:41 PM
>> >> To: Kinney, Michael D 
>> >> Cc: edk2-devel@lists.01.org
>> >> Subject: Re: [edk2] [RFC] Proposal to add edk2-apps repository
>> >>
>> >> On Thu, Nov 29, 2018 at 05:58:08PM +, Kinney, Michael D wrote:
>> >> > Hello,
>> >> >
>> >> > I would like to propose the creation of a new repository called
>> >> > edk2-apps.  This repository would initially be used to host the
>> >> > following packages from the edk2 repository:
>> >> >
>> >> > * AppPkg
>> >> > * StdLib
>> >> > * StdLibPrivateInternalFiles
>> >>
>> >> Let me start by saying I 100% back moving these out of the main edk2
>> >> repository.
>> >>
>> >> > These 3 packages provide support for the libc along with
>> >> > applications that depend on libc.  None of the other packages in
>> >> > the edk2 repository use these packages, so these 3 package can be
>> >> > safely moved without any impacts to platform firmware builds.
>> >> > Build configurations that do use libc features can clone the
>> >> > edk2-apps repository and add it to PACKAGES_PATH.
>> >>
>> >> I must confess to never having properly understood the scope of
>> >> AppPkg to begin with.
>> >>
>> >> AppPkg/Applications/Hello does not appear to have any further (real)
>> >> dependency on libc than MdeModulePkg/Application/HelloWorld/, and .
>> >>
>> >> And certainly MdeModulePkg/Applications contain plenty of ...
>> >> applications.
>> >>
>> >> So, if the purpose is simply to provide some examples of application
>> >> written to libc rather than UEFI - should this be edk2- libc instead?
>> >>
>> >> Best Regards,
>> >>
>> >> Leif
>> >>
>> >> > The history of these 3 packages would be preserved when importing
>> >> > the content into edk2-apps.  After The import is verified, these 3
>> >> > packages would be deleted from the edk2 repository.
>> >> >
>> >> > This proposal helps reduce the size of the edk2 repository and
>> >> > focuses edk2 repository on packages used to provide UEFI/PI
>> >> > conformant firmware.
>> >> >
>> >> > If there are no concerns with this proposal, I will enter a
>> >> > Tianocore BZs for the two steps.
>> >> >
>> >> > Best regards,
>> >> >
>> >> > Mike
>> >> > ___
>> >> > 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
>> ___
>> 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


[edk2] [PATCH v4 0/2] Remove DuetPkg and unused tools

2018-12-02 Thread Shenglei Zhang
DuetPkg depends on Legacy BIOS to provide a UEFI environment.
It was invented in the era when UEFI environment is hard to find.
Since now UEFI is very popular in PC area, we could stop the
official support of this package and remove it from the master.
And moreover, the tools only used by DuetPkg can also be removed.
https://bugzilla.tianocore.org/show_bug.cgi?id=1322

The changes are placed in
https://github.com/shenglei10/edk2/commits/duet

v2:Remove these tools in Makefile and GNUmakefile.

v3:Change the commit order.

v4:Remove these tools in BinWrappers/PosixLike/ and
   UserManuals.

Cc: Ruiyu Ni 
Cc: Hao Wu 
Cc: Yonghong Zhu 
Cc: Liming Gao 
Shenglei Zhang (2):
  DuetPkg: Remove DuetPkg
  BaseTools: Remove tools only used by DuetPkg

 BaseTools/Source/BinaryFiles.txt  |4 -
 BaseTools/Source/C/BootSectImage/GNUmakefile  |   21 -
 BaseTools/Source/C/BootSectImage/Makefile |   22 -
 .../Source/C/BootSectImage/bootsectimage.c|  955 --
 BaseTools/Source/C/BootSectImage/fat.h|  152 -
 BaseTools/Source/C/BootSectImage/mbr.h|   58 -
 BaseTools/Source/C/EfiLdrImage/EfiLdrImage.c  |  319 --
 BaseTools/Source/C/EfiLdrImage/GNUmakefile|   21 -
 BaseTools/Source/C/EfiLdrImage/Makefile   |   22 -
 BaseTools/Source/C/GNUmakefile|5 -
 BaseTools/Source/C/GenBootSector/FatFormat.h  |  152 -
 .../Source/C/GenBootSector/GenBootSector.c|  823 -
 .../Source/C/GenBootSector/GetDrvNumOffset.c  |   73 -
 BaseTools/Source/C/GenBootSector/Makefile |   22 -
 BaseTools/Source/C/GenPage/GNUmakefile|   21 -
 BaseTools/Source/C/GenPage/GenPage.c  |  441 ---
 BaseTools/Source/C/GenPage/Makefile   |   22 -
 BaseTools/Source/C/GenPage/VirtualMemory.h|  122 -
 .../Source/C/GnuGenBootSector/FatFormat.h |  152 -
 .../Source/C/GnuGenBootSector/GNUmakefile |   21 -
 .../C/GnuGenBootSector/GnuGenBootSector.c |  455 ---
 BaseTools/Source/C/Makefile   |4 -
 BaseTools/toolsetup.bat   |4 -
 DuetPkg/AcpiResetDxe/Reset.c  |  212 --
 DuetPkg/AcpiResetDxe/Reset.inf|   47 -
 DuetPkg/BiosVideoThunkDxe/BiosVideo.c | 2822 -
 DuetPkg/BiosVideoThunkDxe/BiosVideo.h |  504 ---
 DuetPkg/BiosVideoThunkDxe/BiosVideo.inf   |   50 -
 DuetPkg/BiosVideoThunkDxe/ComponentName.c |  166 -
 DuetPkg/BiosVideoThunkDxe/LegacyBiosThunk.c   |  220 --
 .../BiosVideoThunkDxe/VesaBiosExtensions.h|  457 ---
 DuetPkg/BootSector/BootSector.inf |   79 -
 DuetPkg/BootSector/FILE.LST   |   39 -
 DuetPkg/BootSector/GNUmakefile|  140 -
 DuetPkg/BootSector/Gpt.S  |  297 --
 DuetPkg/BootSector/Gpt.asm|  294 --
 DuetPkg/BootSector/Makefile   |  173 -
 DuetPkg/BootSector/Mbr.S  |  262 --
 DuetPkg/BootSector/Mbr.asm|  261 --
 DuetPkg/BootSector/bin/Gpt.com|  Bin 512 -> 0 bytes
 DuetPkg/BootSector/bin/Mbr.com|  Bin 512 -> 0 bytes
 DuetPkg/BootSector/bin/Readme.txt |8 -
 DuetPkg/BootSector/bin/St16_64.com|  Bin 4096 -> 0 bytes
 DuetPkg/BootSector/bin/St32_64.com|  Bin 4096 -> 0 bytes
 DuetPkg/BootSector/bin/Start.com  |  Bin 4096 -> 0 bytes
 DuetPkg/BootSector/bin/Start16.com|  Bin 4096 -> 0 bytes
 DuetPkg/BootSector/bin/Start32.com|  Bin 4096 -> 0 bytes
 DuetPkg/BootSector/bin/Start64.com|  Bin 4096 -> 0 bytes
 DuetPkg/BootSector/bin/bootsect.com   |  Bin 512 -> 0 bytes
 DuetPkg/BootSector/bin/bs16.com   |  Bin 512 -> 0 bytes
 DuetPkg/BootSector/bin/bs32.com   |  Bin 512 -> 0 bytes
 DuetPkg/BootSector/bin/efi32.com  |  Bin 139264 -> 0 bytes
 DuetPkg/BootSector/bin/efi32.com2 |  Bin 4096 -> 0 bytes
 DuetPkg/BootSector/bin/efi64.com  |  Bin 139264 -> 0 bytes
 DuetPkg/BootSector/bin/efi64.com2 |  Bin 4096 -> 0 bytes
 DuetPkg/BootSector/bootsect.S |  303 --
 DuetPkg/BootSector/bootsect.asm   |  301 --
 DuetPkg/BootSector/bs16.S |  291 --
 DuetPkg/BootSector/bs16.asm   |  288 --
 DuetPkg/BootSector/bs32.S |  312 --
 DuetPkg/BootSector/bs32.asm   |  310 --
 DuetPkg/BootSector/efi32.S| 1176 ---
 DuetPkg/BootSector/efi32.asm  |  582 
 DuetPkg/BootSector/efi64.S| 1385 
 DuetPkg/BootSector/efi64.asm  |  787 -
 DuetPkg/BootSector/st16_64.S  | 1142 ---
 DuetPkg/BootSector/st16_64.asm| 1140 ---
 DuetPkg/BootSector/st32_64.S  | 1157 ---
 DuetPkg/BootSector/st32_64.asm| 1156 ---
 DuetPkg/BootSector/start.S|  919 --
 DuetPkg/BootSector/star

Re: [edk2] [Patch v1 1/1] BaseTools: create and use a standard shared variable for '*'

2018-12-02 Thread Zhu, Yonghong
Hi Jaben,

In this patch, it also changed the mathematics multiplicative '*' (used in 
expression) to  TAB_STAR, is it by on purpose? 
Eg:
-NonLetterOpLst = ['+', '-', '*', '/', '%', '&', '|', '^', '~', '<<', '>>', 
'!', '=', '>', '<', '?', ':']
+NonLetterOpLst = ['+', '-', TAB_STAR, '/', '%', '&', '|', '^', '~', '<<', 
'>>', '!', '=', '>', '<', '?', ':']

Best Regards,
Zhu Yonghong

-Original Message-
From: Carsey, Jaben 
Sent: Friday, November 16, 2018 11:40 PM
To: edk2-devel@lists.01.org
Cc: Zhu, Yonghong ; Gao, Liming 
Subject: [Patch v1 1/1] BaseTools: create and use a standard shared variable 
for '*'

add a variable for the string '*' and then use it instead of lots of '*'

Cc: Yonghong Zhu 
Cc: Liming Gao 
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Jaben Carsey 
---
 BaseTools/Source/Python/AutoGen/AutoGen.py | 54 
++--
 BaseTools/Source/Python/AutoGen/BuildEngine.py | 10 ++--
 BaseTools/Source/Python/BPDG/GenVpd.py | 14 ++---
 BaseTools/Source/Python/Common/DataType.py |  1 +
 BaseTools/Source/Python/Common/Expression.py   |  4 +-
 BaseTools/Source/Python/Common/Misc.py |  2 +-
 BaseTools/Source/Python/Common/ToolDefClassObject.py   | 23 +
 BaseTools/Source/Python/Common/VpdInfoFile.py  |  8 +--
 BaseTools/Source/Python/GenFds/FdfParser.py|  5 +-
 BaseTools/Source/Python/GenFds/GenFds.py   |  2 +-
 BaseTools/Source/Python/GenFds/GenFdsGlobalVariable.py |  8 +--
 BaseTools/Source/Python/GenFds/Section.py  |  2 +-
 BaseTools/Source/Python/Workspace/DscBuildData.py  |  6 +--
 13 files changed, 70 insertions(+), 69 deletions(-)

diff --git a/BaseTools/Source/Python/AutoGen/AutoGen.py 
b/BaseTools/Source/Python/AutoGen/AutoGen.py
index f3560bfc787d..25417c447061 100644
--- a/BaseTools/Source/Python/AutoGen/AutoGen.py
+++ b/BaseTools/Source/Python/AutoGen/AutoGen.py
@@ -1438,7 +1438,7 @@ class PlatformAutoGen(AutoGen):
 PcdValue = Sku.DefaultValue
 if PcdValue == "":
 PcdValue  = Pcd.DefaultValue
-if Sku.VpdOffset != '*':
+if Sku.VpdOffset != TAB_STAR:
 if PcdValue.startswith("{"):
 Alignment = 8
 elif PcdValue.startswith("L"):
@@ -1462,7 +1462,7 @@ class PlatformAutoGen(AutoGen):
 VpdFile.Add(Pcd, SkuName, Sku.VpdOffset)
 SkuValueMap[PcdValue].append(Sku)
 # if the offset of a VPD is *, then it need to be 
fixed up by third party tool.
-if not NeedProcessVpdMapFile and Sku.VpdOffset == "*":
+if not NeedProcessVpdMapFile and Sku.VpdOffset == 
TAB_STAR:
 NeedProcessVpdMapFile = True
 if self.Platform.VpdToolGuid is None or 
self.Platform.VpdToolGuid == '':
 EdkLogger.error("Build", FILE_NOT_FOUND, \ @@ 
-1522,7 +1522,7 @@ class PlatformAutoGen(AutoGen):
 PcdValue = Sku.DefaultValue
 if PcdValue == "":
 PcdValue  = DscPcdEntry.DefaultValue
-if Sku.VpdOffset != '*':
+if Sku.VpdOffset != TAB_STAR:
 if PcdValue.startswith("{"):
 Alignment = 8
 elif PcdValue.startswith("L"):
@@ -1545,7 +1545,7 @@ class PlatformAutoGen(AutoGen):
 SkuValueMap[PcdValue] = []
 VpdFile.Add(DscPcdEntry, SkuName, 
Sku.VpdOffset)
 SkuValueMap[PcdValue].append(Sku)
-if not NeedProcessVpdMapFile and Sku.VpdOffset 
== "*":
+if not NeedProcessVpdMapFile and Sku.VpdOffset 
== TAB_STAR:
 NeedProcessVpdMapFile = True
 if DscPcdEntry.DatumType == TAB_VOID and 
PcdValue.startswith("L"):
 UnicodePcdArray.add(DscPcdEntry) @@ -1573,7 
+1573,7 @@ class PlatformAutoGen(AutoGen):
 if os.path.exists(VpdMapFilePath):
 VpdFile.Read(VpdMapFilePath)
 
-# Fixup "*" offset
+# Fixup TAB_STAR offset
 for pcd in VpdSkuMap:
 vpdinfo = VpdFile.GetVpdInfo(pcd)
 if vpdinfo is None:
@@ -2210,15 +2210,15 @@ class PlatformAutoGen(AutoGen):
 def CalculatePriorityValue(self, Key):
 Target, ToolChain, Arch, CommandType, Attr = Key.split('_')
 Priorit

Re: [edk2] [edk2-test][Patch 3/3] uefi-sct/SctPkg:Add VerifySignature() Conf Test

2018-12-02 Thread Jin, Eric
Hello Supreeth,

Thank you for the comments.
V2 will be sent out. All clean up will be merged into the  patch 1/3 with INF 
version update.

Best Regards
Eric

-Original Message-
From: Supreeth Venkatesh  
Sent: Saturday, December 1, 2018 6:28 AM
To: Jin, Eric ; edk2-devel@lists.01.org
Subject: Re: [edk2-test][Patch 3/3] uefi-sct/SctPkg:Add VerifySignature() Conf 
Test

Commit message to mention what this patch is imlementing.

In addition, there is cleanup to remove #if 0 block below.
Both of this should be in commit message.

On Thu, 2018-11-29 at 16:46 +0800, Eric Jin wrote:
> Cc: Supreeth Venkatesh 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Eric Jin 
> ---
>  .../EFI/Protocol/PKCS7Verify/BlackBoxTest/Guid.c   |   5 +-
>  .../EFI/Protocol/PKCS7Verify/BlackBoxTest/Guid.h   |  16 ++
>  .../BlackBoxTest/Pkcs7BBTestConformance.c  | 303
> -
>  .../PKCS7Verify/BlackBoxTest/Pkcs7BBTestMain.c |   2 -
>  4 files changed, 319 insertions(+), 7 deletions(-)
> 
> diff --git a/uefi-
> sct/SctPkg/TestCase/UEFI/EFI/Protocol/PKCS7Verify/BlackBoxTest/Guid.c
> b/uefi-
> sct/SctPkg/TestCase/UEFI/EFI/Protocol/PKCS7Verify/BlackBoxTest/Guid.c
> index 4d433c3..8f6546a 100644
> --- a/uefi-
> sct/SctPkg/TestCase/UEFI/EFI/Protocol/PKCS7Verify/BlackBoxTest/Guid.c
> +++ b/uefi-
> sct/SctPkg/TestCase/UEFI/EFI/Protocol/PKCS7Verify/BlackBoxTest/Guid.c
> @@ -36,7 +36,10 @@ EFI_GUID gPkcs7BBTestConformanceAssertionGuid007 = 
> EFI_TEST_PKCS7BBTESTCONFORMAN  EFI_GUID 
> gPkcs7BBTestConformanceAssertionGuid008 = 
> EFI_TEST_PKCS7BBTESTCONFORMANCE_ASSERTION_008_GUID;
>  EFI_GUID gPkcs7BBTestConformanceAssertionGuid009 = 
> EFI_TEST_PKCS7BBTESTCONFORMANCE_ASSERTION_009_GUID;
>  EFI_GUID gPkcs7BBTestConformanceAssertionGuid010 = 
> EFI_TEST_PKCS7BBTESTCONFORMANCE_ASSERTION_010_GUID;
> -
> +EFI_GUID gPkcs7BBTestConformanceAssertionGuid011 =
> EFI_TEST_PKCS7BBTESTCONFORMANCE_ASSERTION_011_GUID;
> +EFI_GUID gPkcs7BBTestConformanceAssertionGuid012 =
> EFI_TEST_PKCS7BBTESTCONFORMANCE_ASSERTION_012_GUID;
> +EFI_GUID gPkcs7BBTestConformanceAssertionGuid013 =
> EFI_TEST_PKCS7BBTESTCONFORMANCE_ASSERTION_013_GUID;
> +EFI_GUID gPkcs7BBTestConformanceAssertionGuid014 =
> EFI_TEST_PKCS7BBTESTCONFORMANCE_ASSERTION_014_GUID;
>  
>  EFI_GUID gPkcs7BBTestFunctionAssertionGuid001 = 
> EFI_TEST_PKCS7BBTESTFUNCTION_ASSERTION_001_GUID;
>  EFI_GUID gPkcs7BBTestFunctionAssertionGuid002 = 
> EFI_TEST_PKCS7BBTESTFUNCTION_ASSERTION_002_GUID;
> diff --git a/uefi-
> sct/SctPkg/TestCase/UEFI/EFI/Protocol/PKCS7Verify/BlackBoxTest/Guid.h
> b/uefi-
> sct/SctPkg/TestCase/UEFI/EFI/Protocol/PKCS7Verify/BlackBoxTest/Guid.h
> index 32a00f6..f8d1b8f 100644
> --- a/uefi-
> sct/SctPkg/TestCase/UEFI/EFI/Protocol/PKCS7Verify/BlackBoxTest/Guid.h
> +++ b/uefi-
> sct/SctPkg/TestCase/UEFI/EFI/Protocol/PKCS7Verify/BlackBoxTest/Guid.h
> @@ -65,6 +65,22 @@ extern EFI_GUID
> gPkcs7BBTestConformanceAssertionGuid009;
>  { 0xb136e016, 0x4f80, 0x44bd, {0xba, 0xb0, 0x1c, 0x34, 0x8a, 0x2d, 
> 0xa1, 0x8a }}  extern EFI_GUID 
> gPkcs7BBTestConformanceAssertionGuid010;
>  
> +#define EFI_TEST_PKCS7BBTESTCONFORMANCE_ASSERTION_011_GUID \ { 
> +0xa58f3626, 0xf16e, 0x4cd5, { 0xba, 0x12, 0x7a, 0x9d, 0xd6, 0x9a,
> 0x7a, 0x71 }}
> +extern EFI_GUID gPkcs7BBTestConformanceAssertionGuid011;
> +
> +#define EFI_TEST_PKCS7BBTESTCONFORMANCE_ASSERTION_012_GUID \ { 
> +0xbe4a0bf2, 0x2d46, 0x4d96, { 0xa6, 0x11, 0x21, 0x99, 0xa5, 0x5f,
> 0xa4, 0xee }}
> +extern EFI_GUID gPkcs7BBTestConformanceAssertionGuid012;
> +
> +#define EFI_TEST_PKCS7BBTESTCONFORMANCE_ASSERTION_013_GUID \ { 
> +0xc0536a27, 0x304e, 0x497a, { 0xa5, 0xe3, 0x94, 0x11, 0x38, 0x53,
> 0x6e, 0x40 }}
> +extern EFI_GUID gPkcs7BBTestConformanceAssertionGuid013;
> +
> +#define EFI_TEST_PKCS7BBTESTCONFORMANCE_ASSERTION_014_GUID \ { 
> +0x8c5aa0e8, 0x17ff, 0x49cd, { 0x8f, 0xec, 0x37, 0xc3, 0xfd, 0x5f,
> 0x77, 0x0 }}
> +extern EFI_GUID gPkcs7BBTestConformanceAssertionGuid014;
> +
>  
>  #define EFI_TEST_PKCS7BBTESTFUNCTION_ASSERTION_001_GUID \  { 
> 0x5c0eec50, 0xa6ea, 0x413c, {0x8a, 0x46, 0x4a, 0xd1, 0x4a, 0x77, 0x76, 
> 0xf1 }} diff --git a/uefi- 
> sct/SctPkg/TestCase/UEFI/EFI/Protocol/PKCS7Verify/BlackBoxTest/Pkcs7B
> BTestConformance.c b/uefi-
> sct/SctPkg/TestCase/UEFI/EFI/Protocol/PKCS7Verify/BlackBoxTest/Pkcs7B
> BTestConformance.c
> index b7bc19b..ce7d5bb 100644
> --- a/uefi-
> sct/SctPkg/TestCase/UEFI/EFI/Protocol/PKCS7Verify/BlackBoxTest/Pkcs7B
> BTestConformance.c
> +++ b/uefi-
> sct/SctPkg/TestCase/UEFI/EFI/Protocol/PKCS7Verify/BlackBoxTest/Pkcs7B
> BTestConformance.c
> @@ -278,10 +278,6 @@ BBTestVerifyBufferConformanceTest (
>   Status
>   );
>  
> -
> -
> -
> -
>// Signed data embedded in SignedData but InData is not NULL
>AllowedDb[0] = DbEntry1;
>RevokedDb[0] = NULL;
> @@ -507,4 +503,303 @@ BBTestVerifyBufferConformanceTest (
>return EFI_SUCCESS;
>  }
>  
> +EFI_STATUS
> +BBTestVerifySignatureConformanceTest (
> +  IN EFI_BB

[edk2] [Patch 2/2] UefiCpuPkg/Cpuid: Add code to support new definition.

2018-12-02 Thread Eric Dong
Add code to support new definitions added for SDM 2018'11
version.

Cc: Ruiyu Ni 
Cc: Laszlo Ersek 
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Eric Dong 
---
 UefiCpuPkg/Application/Cpuid/Cpuid.c | 147 +--
 1 file changed, 142 insertions(+), 5 deletions(-)

diff --git a/UefiCpuPkg/Application/Cpuid/Cpuid.c 
b/UefiCpuPkg/Application/Cpuid/Cpuid.c
index b44266e538..da87f0aef4 100644
--- a/UefiCpuPkg/Application/Cpuid/Cpuid.c
+++ b/UefiCpuPkg/Application/Cpuid/Cpuid.c
@@ -153,6 +153,7 @@ CPUID_CACHE_INFO_DESCRIPTION  mCpuidCacheInfoDescription[] 
= {
   { 0xEC , "Cache", "3rd-level cache: 24MByte, 24-way set associative, 64 
byte line size" },
   { 0xF0 , "Prefetch" , "64-Byte prefetching" },
   { 0xF1 , "Prefetch" , "128-Byte prefetching" },
+  { 0xFE , "General"  , "CPUID leaf 2 does not report TLB descriptor 
information; use CPUID leaf 18H to query TLB and other address translation 
parameters." },
   { 0xFF , "General"  , "CPUID leaf 2 does not report cache descriptor 
information, use CPUID leaf 4 to query cache parameters" }
 };
 
@@ -557,6 +558,12 @@ CpuidThermalPowerManagement (
   PRINT_BIT_FIELD (Eax, HWP_Energy_Performance_Preference);
   PRINT_BIT_FIELD (Eax, HWP_Package_Level_Request);
   PRINT_BIT_FIELD (Eax, HDC);
+  PRINT_BIT_FIELD (Eax, TurboBoostMaxTechnology30);
+  PRINT_BIT_FIELD (Eax, HWPCapabilities);
+  PRINT_BIT_FIELD (Eax, HWPPECIOverride);
+  PRINT_BIT_FIELD (Eax, FlexibleHWP);
+  PRINT_BIT_FIELD (Eax, FastAccessMode);
+  PRINT_BIT_FIELD (Eax, IgnoringIdleLogicalProcessorHWPRequest);
   PRINT_BIT_FIELD (Ebx, InterruptThresholds);
   PRINT_BIT_FIELD (Ecx, HardwareCoordinationFeedback);
   PRINT_BIT_FIELD (Ecx, PerformanceEnergyBias);
@@ -574,6 +581,8 @@ CpuidStructuredExtendedFeatureFlags (
   UINT32   Eax;
   CPUID_STRUCTURED_EXTENDED_FEATURE_FLAGS_EBX  Ebx;
   CPUID_STRUCTURED_EXTENDED_FEATURE_FLAGS_ECX  Ecx;
+  CPUID_STRUCTURED_EXTENDED_FEATURE_FLAGS_EDX  Edx;
+
   UINT32   SubLeaf;
 
   if (CPUID_STRUCTURED_EXTENDED_FEATURE_FLAGS > gMaximumBasicFunction) {
@@ -589,11 +598,11 @@ CpuidStructuredExtendedFeatureFlags (
 AsmCpuidEx (
   CPUID_STRUCTURED_EXTENDED_FEATURE_FLAGS,
   SubLeaf,
-  NULL, &Ebx.Uint32, &Ecx.Uint32, NULL
+  NULL, &Ebx.Uint32, &Ecx.Uint32, &Edx.Uint32
   );
-if (Ebx.Uint32 != 0 || Ecx.Uint32 != 0) {
+if (Ebx.Uint32 != 0 || Ecx.Uint32 != 0 || Edx.Uint32 != 0) {
   Print (L"CPUID_STRUCTURED_EXTENDED_FEATURE_FLAGS (Leaf %08x, Sub-Leaf 
%08x)\n", CPUID_STRUCTURED_EXTENDED_FEATURE_FLAGS, SubLeaf);
-  Print (L"  EAX:%08x  EBX:%08x  ECX:%08x  EDX:%08x\n", Eax, Ebx.Uint32, 
Ecx.Uint32, 0);
+  Print (L"  EAX:%08x  EBX:%08x  ECX:%08x  EDX:%08x\n", Eax, Ebx.Uint32, 
Ecx.Uint32, Edx.Uint32);
   PRINT_BIT_FIELD (Ebx, FSGSBASE);
   PRINT_BIT_FIELD (Ebx, IA32_TSC_ADJUST);
   PRINT_BIT_FIELD (Ebx, SGX);
@@ -610,20 +619,39 @@ CpuidStructuredExtendedFeatureFlags (
   PRINT_BIT_FIELD (Ebx, DeprecateFpuCsDs);
   PRINT_BIT_FIELD (Ebx, MPX);
   PRINT_BIT_FIELD (Ebx, RDT_A);
+  PRINT_BIT_FIELD (Ebx, AVX512F);
+  PRINT_BIT_FIELD (Ebx, AVX512DQ);
   PRINT_BIT_FIELD (Ebx, RDSEED);
   PRINT_BIT_FIELD (Ebx, ADX);
   PRINT_BIT_FIELD (Ebx, SMAP);
+  PRINT_BIT_FIELD (Ebx, AVX512_IFMA);
   PRINT_BIT_FIELD (Ebx, CLFLUSHOPT);
   PRINT_BIT_FIELD (Ebx, CLWB);
   PRINT_BIT_FIELD (Ebx, IntelProcessorTrace);
+  PRINT_BIT_FIELD (Ebx, AVX512PF);
+  PRINT_BIT_FIELD (Ebx, AVX512ER);
+  PRINT_BIT_FIELD (Ebx, AVX512CD);
   PRINT_BIT_FIELD (Ebx, SHA);
+  PRINT_BIT_FIELD (Ebx, AVX512BW);
+  PRINT_BIT_FIELD (Ebx, AVX512VL);
+
   PRINT_BIT_FIELD (Ecx, PREFETCHWT1);
+  PRINT_BIT_FIELD (Ecx, AVX512_VBMI);
   PRINT_BIT_FIELD (Ecx, UMIP);
   PRINT_BIT_FIELD (Ecx, PKU);
   PRINT_BIT_FIELD (Ecx, OSPKE);
+  PRINT_BIT_FIELD (Ecx, AVX512_VPOPCNTDQ);
   PRINT_BIT_FIELD (Ecx, MAWAU);
   PRINT_BIT_FIELD (Ecx, RDPID);
   PRINT_BIT_FIELD (Ecx, SGX_LC);
+
+  PRINT_BIT_FIELD (Edx, AVX512_4VNNIW);
+  PRINT_BIT_FIELD (Edx, AVX512_4FMAPS);
+  PRINT_BIT_FIELD (Edx, EnumeratesSupportForIBRSAndIBPB);
+  PRINT_BIT_FIELD (Edx, EnumeratesSupportForSTIBP);
+  PRINT_BIT_FIELD (Edx, EnumeratesSupportForL1D_FLUSH);
+  PRINT_BIT_FIELD (Edx, EnumeratesSupportForCapability);
+  PRINT_BIT_FIELD (Edx, EnumeratesSupportForSSBD);
 }
   }
 }
@@ -681,6 +709,7 @@ CpuidArchitecturalPerformanceMonitoring (
   PRINT_BIT_FIELD (Ebx, AllBranchMispredictRetired);
   PRINT_BIT_FIELD (Edx, FixedFunctionPerformanceCounters);
   PRINT_BIT_FIELD (Edx, FixedFunctionPerformanceCounterWidth);
+  PRINT_BIT_FIELD (Edx, AnyThreadDeprecation);
 }
 
 /**
@@ -747,6 +776,7 @@ CpuidExtendedStateSubLeaf (
   PRINT_BIT_FIELD (Eax, XSAVES);
   PRINT_VALUE (Ebx, EnabledSaveStateSize_XCR0_IA32_XSS);
   PRINT_BIT_FIELD (Ecx, XCR0);
+  PRINT_BIT_F

[edk2] [Patch 1/2] UefiCpuPkg/Cpuid.h: Sync CPUID definition to latest SDM.

2018-12-02 Thread Eric Dong
Update CPUID definition to follow SDM 2018'11 version, changes Include:
1. Add new fields to the existed data structure, impact CPUIDs include:
  1. CPUID_THERMAL_POWER_MANAGEMENT 0x06
   CPUID_THERMAL_POWER_MANAGEMENT_EAX
  2. CPUID_STRUCTURED_EXTENDED_FEATURE_FLAGS0x07
   CPUID_STRUCTURED_EXTENDED_FEATURE_FLAGS_EBX
   CPUID_STRUCTURED_EXTENDED_FEATURE_FLAGS_ECX
  3. CPUID_ARCHITECTURAL_PERFORMANCE_MONITORING  0x0A
   CPUID_ARCHITECTURAL_PERFORMANCE_MONITORING_EDX
  4. CPUID_EXTENDED_STATE   0x0D
   CPUID_EXTENDED_STATE_MAIN_LEAF_EAX
   CPUID_EXTENDED_STATE_SUB_LEAF_ECX
  5. CPUID_INTEL_RDT_ALLOCATION 0x10
   CPUID_INTEL_RDT_ALLOCATION_ENUMERATION_SUB_LEAF_EBX
  6. CPUID_INTEL_SGX0x12
   CPUID_INTEL_SGX_CAPABILITIES_0_SUB_LEAF_EAX

2. Add new data structures which not existed before, impact CPUID includes:
  1. CPUID_STRUCTURED_EXTENDED_FEATURE_FLAGS0x07
   CPUID_STRUCTURED_EXTENDED_FEATURE_FLAGS_EDX

3. Remove fields which defined before, impact CPUID includes:
  1. CPUID_INTEL_RDT_ALLOCATION 0x10
   CPUID_INTEL_RDT_ALLOCATION_L3_CACHE_SUB_LEAF0x01
 CPUID_INTEL_RDT_ALLOCATION_L3_CACHE_SUB_LEAF_ECX

4. Add new sub leaf which not existed before, impact CPUID includes:
  1. CPUID_INTEL_RDT_ALLOCATION 0x10
   CPUID_INTEL_RDT_ALLOCATION_MEMORY_BANDWIDTH_SUB_LEAF0x03

5. Add new CPUIDs which not exist before, new CPUIDs include:
  1. CPUID_DETERMINISTIC_ADDRESS_TRANSLATION_PARAMETERS 0x18
  2. CPUID_V2_EXTENDED_TOPOLOGY_ENUMERATION 0x1F

Cc: Ruiyu Ni 
Cc: Laszlo Ersek 
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Eric Dong 
---
 UefiCpuPkg/Include/Register/Cpuid.h | 620 ++--
 1 file changed, 597 insertions(+), 23 deletions(-)

diff --git a/UefiCpuPkg/Include/Register/Cpuid.h 
b/UefiCpuPkg/Include/Register/Cpuid.h
index 5eb9650553..81ae5afd17 100644
--- a/UefiCpuPkg/Include/Register/Cpuid.h
+++ b/UefiCpuPkg/Include/Register/Cpuid.h
@@ -6,7 +6,7 @@
   If a register returned is a single 32-bit value, then a data structure is
   not provided for that register.
 
-  Copyright (c) 2015 - 2016, Intel Corporation. All rights reserved.
+  Copyright (c) 2015 - 2018, Intel Corporation. All rights reserved.
   This program and the accompanying materials are licensed and made available 
under
   the terms and conditions of the BSD License which accompanies this 
distribution.
   The full text of the license may be found at
@@ -17,7 +17,7 @@
 
   @par Specification Reference:
   Intel(R) 64 and IA-32 Architectures Software Developer's Manual, Volume 2A,
-  September 2016, CPUID instruction.
+  November 2018, CPUID instruction.
 
 **/
 
@@ -707,6 +707,8 @@ typedef union {
0xEC  Cache3rd-level cache: 24MByte, 24-way 
set associative, 64 byte line size
0xF0  Prefetch 64-Byte prefetching
0xF1  Prefetch 128-Byte prefetching
+   0xFE  General  CPUID leaf 2 does not report TLB 
descriptor information; use CPUID
+leaf 18H to query TLB and other 
address translation parameters.
0xFF  General  CPUID leaf 2 does not report cache 
descriptor information,
 use CPUID leaf 4 to query cache 
parameters
   
@@ -1182,7 +1184,33 @@ typedef union {
 /// IA32_THREAD_STALL MSRs are supported if set.
 ///
 UINT32  HDC:1;
-UINT32  Reserved3:18;
+///
+/// [Bit 14] Intel Turbo Boost Max Technology 3.0 available.
+///
+UINT32  TurboBoostMaxTechnology30:1;
+///
+/// [Bit 15] HWP Capabilities.
+/// Highest Performance change is supported if set.
+///
+UINT32  HWPCapabilities:1;
+///
+/// [Bit 16] HWP PECI override is supported if set.
+///
+UINT32  HWPPECIOverride:1;
+///
+/// [Bit 17] Flexible HWP is supported if set.
+///
+UINT32  FlexibleHWP:1;
+///
+/// [Bit 18] Fast access mode for the IA32_HWP_REQUEST MSR is supported if 
set.
+///
+UINT32  FastAccessMode:1;
+UINT32  Reserved4:1;
+///
+/// [Bit 20] Ignoring Idle Logical Processor HWP request is supported if 
set.
+///
+UINT32  IgnoringIdleLogicalProcessorHWPRequest:1;
+UINT32  Reserved5:11;
   } Bits;
   ///
   /// All bit fields as a 32-bit value
@@ -1369,7 +1397,14 @@ typedef union {
 /// Allocation capability if 1.
 ///
 UINT32  RDT_A:1;
-UINT32  Reserved2:2;
+///
+/// [Bit 16] AVX512F.
+///
+UINT32  AVX512F:1;
+///
+/// [Bit 17] AVX512DQ.
+///
+UINT32  AVX512DQ:1;
 ///
 /// [Bit 18] If 1 indicates the processor supports the RDSEED instruction.
 ///
@@ -

Re: [edk2] [PATCH v2 0/2] StandaloneMM: Update permissions for Standalone MM drivers memory area

2018-12-02 Thread Sughosh Ganu
hi Achin,

On Sun Dec 02, 2018 at 12:15:47AM +0530, Achin Gupta wrote:
> Hi Sughosh,
> 
> On Sat, Dec 01, 2018 at 09:56:52AM +0530, Sughosh Ganu wrote:
> > hi Achin,
> > 
> > On Sat Dec 01, 2018 at 05:08:50AM +0530, Achin Gupta wrote:
> > > Hi Sughosh,
> > > 
> > > +Jiewen
> > > 
> > > I took the patches for a spin and it looks like the FVP port is broken. 
> > > Some
> > > reasons are:
> > > 
> > > 1. The build breaks due to a reference to ArmMmuLib in StandaloneMmPkg.dsc
> > > 2. There is a broken dependency on PL011UartClockLib in 
> > > StandaloneMmPkg.dsc
> > > 3. GCC flags to enforce strict alignment and no fp are required in
> > >StandaloneMmPkg.dsc to avoid a runtime fault
> > > 4. There is a data structre in StandaloneMmCoreEntryPoint.c that needs to 
> > > be
> > >memzeroed due to the alignment checks
> > > 
> > > Even after these fixes, I am unable to boot the MM SP. The SP boots with 
> > > the
> > > previous revision of your patches and the above fixes. Something has 
> > > broken
> > > between the two. I am suspecting the MMU library for S-EL0.
> > 
> > I had tested the patches which i had sent out for ArmPkg changes with
> > the error handling and error reporting feature on sgi575 before
> > posting the patches. In addition to the changes that you mention, i
> > was required to make a couple of more changes in the StandadloneMm
> > description file.
> > 
> > 1) 
> > StandaloneMmMmuLib|ArmPkg/Library/StandaloneMmMmuLib/ArmMmuStandaloneMmLib.inf
> > 
> > This was changed from ArmMmuLib which was used earlier.
> 
> yes! this was the change i was referring to in 1.
> 
> > 
> > 2) 
> > PeCoffExtraActionLib|StandaloneMmPkg/Library/StandaloneMmPeCoffExtraActionLib/StandaloneMmPeCoffExtraActionLib.inf
> > 
> > I had changed this to reflect the change made in the patch
> > StandaloneMM: Update permissions for Standalone MM drivers memory area
> 
> Doh! of course it does not work without this change. Thanks! Could you roll it
> in your patchstack?
> 
> > 
> > Can you please confirm that you tested with these two additional
> > changes made. Meanwhile, I will incorporate your review comments which
> > you make below. Thanks.
> 
> I was able to initialise the SP on the FVP and the MM communication driver
> initialised correctly. I did not test the MM SP further. I have pushed my
> changes on top of your patches here [1]. Could you please check they work for
> you as well and include the relevant changes in the next rev of your 
> patchstack?

Sure. I will post these fixes as well. I will post it as a separate
series, since the contents are pretty different from the other two
patches. Thanks.

-sughosh


> 
> cheers,
> Achin
> 
> [1] https://github.com/achingupta/edk2/commits/ag/stmm_perm_v2
> 
> > 
> > -sughosh
> > 
> > > 
> > > Lets sort this out first. Apart from this, could you move this library 
> > > into
> > > an AArch64 directory as is the case for other Arm specific libraries
> > > e.g. StandaloneMmCoreEntryPoint/AArch64
> > > 
> > > cheers,
> > > Achin
> > > 
> > > On Tue, Nov 27, 2018 at 11:52:53AM +0530, Sughosh Ganu wrote:
> > > > Changes since v1:
> > > > A new patch has been added to reflect the library class added for
> > > > changing the MMU attributes in StandaloneMM image, based on review
> > > > comments from Ard Biesheuvel.
> > > > 
> > > > 
> > > > These patches needs to be applied on top of the following patch series
> > > >  - "ArmPkg related changes for StandaloneMM package".
> > > > 
> > > > 
> > > > Sughosh Ganu (2):
> > > >   StandaloneMM: Include the newly added library class for MMU functions
> > > >   StandaloneMM: Update permissions for Standalone MM drivers memory area
> > > > 
> > > >  .../StandaloneMmCoreEntryPoint.inf |   2 +-
> > > >  .../StandaloneMmPeCoffExtraActionLib.inf   |  18 +-
> > > >  .../StandaloneMmPeCoffExtraActionLib.c | 222 
> > > > +
> > > >  3 files changed, 234 insertions(+), 8 deletions(-)
> > > >  copy 
> > > > ArmPkg/Library/RvdPeCoffExtraActionLib/RvdPeCoffExtraActionLib.inf => 
> > > > StandaloneMmPkg/Library/StandaloneMmPeCoffExtraActionLib/StandaloneMmPeCoffExtraActionLib.inf
> > > >  (72%)
> > > >  create mode 100644 
> > > > StandaloneMmPkg/Library/StandaloneMmPeCoffExtraActionLib/StandaloneMmPeCoffExtraActionLib.c
> > > > 
> > > > -- 
> > > > 2.7.4
> > > > 
> > 
> > -- 
> > -sughosh

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


[edk2] [Patch 0/2] Update CPUID related definition.

2018-12-02 Thread Eric Dong
Update CPUID definition to follow SDM 2018'11 version, changes Include:
1. Add new fields to the existed data structure, impact CPUIDs include:
  1. CPUID_THERMAL_POWER_MANAGEMENT 0x06
   CPUID_THERMAL_POWER_MANAGEMENT_EAX
  2. CPUID_STRUCTURED_EXTENDED_FEATURE_FLAGS0x07
   CPUID_STRUCTURED_EXTENDED_FEATURE_FLAGS_EBX
   CPUID_STRUCTURED_EXTENDED_FEATURE_FLAGS_ECX
  3. CPUID_ARCHITECTURAL_PERFORMANCE_MONITORING  0x0A
   CPUID_ARCHITECTURAL_PERFORMANCE_MONITORING_EDX
  4. CPUID_EXTENDED_STATE   0x0D
   CPUID_EXTENDED_STATE_MAIN_LEAF_EAX
   CPUID_EXTENDED_STATE_SUB_LEAF_ECX
  5. CPUID_INTEL_RDT_ALLOCATION 0x10
   CPUID_INTEL_RDT_ALLOCATION_ENUMERATION_SUB_LEAF_EBX
  6. CPUID_INTEL_SGX0x12
   CPUID_INTEL_SGX_CAPABILITIES_0_SUB_LEAF_EAX

2. Add new data structures which not existed before, impact CPUID includes:
  1. CPUID_STRUCTURED_EXTENDED_FEATURE_FLAGS0x07
   CPUID_STRUCTURED_EXTENDED_FEATURE_FLAGS_EDX

3. Remove fields which defined before, impact CPUID includes:
  1. CPUID_INTEL_RDT_ALLOCATION 0x10
   CPUID_INTEL_RDT_ALLOCATION_L3_CACHE_SUB_LEAF0x01
 CPUID_INTEL_RDT_ALLOCATION_L3_CACHE_SUB_LEAF_ECX

4. Add new sub leaf which not existed before, impact CPUID includes:
  1. CPUID_INTEL_RDT_ALLOCATION 0x10
   CPUID_INTEL_RDT_ALLOCATION_MEMORY_BANDWIDTH_SUB_LEAF0x03

5. Add new CPUIDs which not exist before, new CPUIDs include:
  1. CPUID_DETERMINISTIC_ADDRESS_TRANSLATION_PARAMETERS 0x18
  2. CPUID_V2_EXTENDED_TOPOLOGY_ENUMERATION 0x1F

Also update Cpuid application in UefiCpuPkg/Application folder.

Cc: Ruiyu Ni 
Cc: Laszlo Ersek 
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Eric Dong 

Eric Dong (2):
  UefiCpuPkg/Cpuid.h: Sync CPUID definition to latest SDM.
  UefiCpuPkg/Cpuid: Add code to support new definition.

 UefiCpuPkg/Application/Cpuid/Cpuid.c | 147 -
 UefiCpuPkg/Include/Register/Cpuid.h  | 620 +--
 2 files changed, 739 insertions(+), 28 deletions(-)

-- 
2.15.0.windows.1

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


[edk2] [PATCH v3 0/2] StandaloneMM: Update permissions for Standalone MM drivers memory area

2018-12-02 Thread Sughosh Ganu
Changes since v2:
Incorporate review comments from Achin to move
StandaloneMmPeCoffExtraActionLib.c under AArch64 directory.

Changes since v1:
A new patch has been added to reflect the library class added for
changing the MMU attributes in StandaloneMM image, based on review
comments from Ard Biesheuvel.

Sughosh Ganu (2):
  StandaloneMM: Include the newly added library class for MMU functions
  StandaloneMM: Update permissions for Standalone MM drivers memory area

 
StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/StandaloneMmCoreEntryPoint.inf

   |   2 +-
 ArmPkg/Library/RvdPeCoffExtraActionLib/RvdPeCoffExtraActionLib.inf => 
StandaloneMmPkg/Library/StandaloneMmPeCoffExtraActionLib/StandaloneMmPeCoffExtraActionLib.inf
 |  18 +-
 
StandaloneMmPkg/Library/StandaloneMmPeCoffExtraActionLib/AArch64/StandaloneMmPeCoffExtraActionLib.c
 | 222 

 3 files changed, 234 insertions(+), 8 deletions(-)
 copy ArmPkg/Library/RvdPeCoffExtraActionLib/RvdPeCoffExtraActionLib.inf => 
StandaloneMmPkg/Library/StandaloneMmPeCoffExtraActionLib/StandaloneMmPeCoffExtraActionLib.inf
 (72%)
 create mode 100644 
StandaloneMmPkg/Library/StandaloneMmPeCoffExtraActionLib/AArch64/StandaloneMmPeCoffExtraActionLib.c

-- 
2.7.4


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


[edk2] [PATCH v3 1/2] StandaloneMM: Include the newly added library class for MMU functions

2018-12-02 Thread Sughosh Ganu
The MMU functions needed for StandaloneMM image are now exported
through a separate library class. Make the corresponding change in the
core's entry point inf file so that it references the correct library
class for modifying the MMU attributes.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Sughosh Ganu 
---
 
StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/StandaloneMmCoreEntryPoint.inf
 | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git 
a/StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/StandaloneMmCoreEntryPoint.inf
 
b/StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/StandaloneMmCoreEntryPoint.inf
index 66184c4a00f3..3222cd359f3e 100644
--- 
a/StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/StandaloneMmCoreEntryPoint.inf
+++ 
b/StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/StandaloneMmCoreEntryPoint.inf
@@ -45,7 +45,7 @@ [LibraryClasses]
   DebugLib
 
 [LibraryClasses.AARCH64]
-  ArmMmuLib
+  StandaloneMmMmuLib
   ArmSvcLib
 
 [Guids]
-- 
2.7.4

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


[edk2] [PATCH v3 2/2] StandaloneMM: Update permissions for Standalone MM drivers memory area

2018-12-02 Thread Sughosh Ganu
The StandaloneMM image executes in S-EL0 on reference Arm platforms
and is deployed by the trusted firmware as BL32 image. Memory for the
Standalone MM drivers is marked as RW+XN initially, allowing the
drivers to be loaded into the memory. Once loaded, the memory
attributes need to be changed to RO+XN for rodata sections and RO+X
for code sections.

Achieve this through the extra action 'UpdatePeCoffPermissions' to
request the privileged firmware in EL3 to update the permissions.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Sughosh Ganu 
---
 ArmPkg/Library/RvdPeCoffExtraActionLib/RvdPeCoffExtraActionLib.inf => 
StandaloneMmPkg/Library/StandaloneMmPeCoffExtraActionLib/StandaloneMmPeCoffExtraActionLib.inf
 |  18 +-
 
StandaloneMmPkg/Library/StandaloneMmPeCoffExtraActionLib/AArch64/StandaloneMmPeCoffExtraActionLib.c
 | 222 

 2 files changed, 233 insertions(+), 7 deletions(-)

diff --git a/ArmPkg/Library/RvdPeCoffExtraActionLib/RvdPeCoffExtraActionLib.inf 
b/StandaloneMmPkg/Library/StandaloneMmPeCoffExtraActionLib/StandaloneMmPeCoffExtraActionLib.inf
similarity index 72%
copy from ArmPkg/Library/RvdPeCoffExtraActionLib/RvdPeCoffExtraActionLib.inf
copy to 
StandaloneMmPkg/Library/StandaloneMmPeCoffExtraActionLib/StandaloneMmPeCoffExtraActionLib.inf
index 3be0237a3689..eef3d7c6e253 100644
--- a/ArmPkg/Library/RvdPeCoffExtraActionLib/RvdPeCoffExtraActionLib.inf
+++ 
b/StandaloneMmPkg/Library/StandaloneMmPeCoffExtraActionLib/StandaloneMmPeCoffExtraActionLib.inf
@@ -16,9 +16,9 @@
 #**/
 
 [Defines]
-  INF_VERSION= 0x00010005
-  BASE_NAME  = RvdUnixPeCoffExtraActionLib
-  FILE_GUID  = 5EDEB7E7-EA55-4E92-8216-335AC98A3B11
+  INF_VERSION= 0x0001000A
+  BASE_NAME  = StandaloneMmPeCoffExtraActionLib
+  FILE_GUID  = 8B40543B-9588-48F8-840C-5A60E6DB1B03
   MODULE_TYPE= BASE
   VERSION_STRING = 1.0
   LIBRARY_CLASS  = PeCoffExtraActionLib
@@ -30,12 +30,16 @@ [Defines]
 #
 
 [Sources.common]
-  RvdPeCoffExtraActionLib.c
+  AArch64/StandaloneMmPeCoffExtraActionLib.c
 
 [Packages]
-  MdePkg/MdePkg.dec
   ArmPkg/ArmPkg.dec
+  MdePkg/MdePkg.dec
+  StandaloneMmPkg/StandaloneMmPkg.dec
+
+[FeaturePcd]
+  gStandaloneMmPkgTokenSpaceGuid.PcdStandaloneMmEnable
 
 [LibraryClasses]
-  DebugLib
-  SemihostLib
+  StandaloneMmMmuLib
+  PcdLib
diff --git 
a/StandaloneMmPkg/Library/StandaloneMmPeCoffExtraActionLib/AArch64/StandaloneMmPeCoffExtraActionLib.c
 
b/StandaloneMmPkg/Library/StandaloneMmPeCoffExtraActionLib/AArch64/StandaloneMmPeCoffExtraActionLib.c
new file mode 100644
index ..1c9fec201916
--- /dev/null
+++ 
b/StandaloneMmPkg/Library/StandaloneMmPeCoffExtraActionLib/AArch64/StandaloneMmPeCoffExtraActionLib.c
@@ -0,0 +1,222 @@
+/**@file
+
+Copyright (c) 2006 - 2009, Intel Corporation. All rights reserved.
+Portions copyright (c) 2008 - 2010, Apple Inc. All rights reserved.
+Portions copyright (c) 2011 - 2018, ARM Ltd. All rights reserved.
+
+This program and the accompanying materials
+are licensed and made available under the terms and conditions of the BSD 
License
+which accompanies this distribution.  The full text of the license may be 
found at
+http://opensource.org/licenses/bsd-license.php
+
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+
+#include 
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+typedef RETURN_STATUS (*REGION_PERMISSION_UPDATE_FUNC) (
+  IN  EFI_PHYSICAL_ADDRESS  BaseAddress,
+  IN  UINT64Length
+  );
+
+STATIC
+RETURN_STATUS
+UpdatePeCoffPermissions (
+  IN  CONST PE_COFF_LOADER_IMAGE_CONTEXT  *ImageContext,
+  IN  REGION_PERMISSION_UPDATE_FUNC   NoExecUpdater,
+  IN  REGION_PERMISSION_UPDATE_FUNC   ReadOnlyUpdater
+  )
+{
+  RETURN_STATUS Status;
+  EFI_IMAGE_OPTIONAL_HEADER_PTR_UNION   Hdr;
+  EFI_IMAGE_OPTIONAL_HEADER_UNION   HdrData;
+  UINTN Size;
+  UINTN ReadSize;
+  UINT32SectionHeaderOffset;
+  UINTN NumberOfSections;
+  UINTN Index;
+  EFI_IMAGE_SECTION_HEADER  SectionHeader;
+  PE_COFF_LOADER_IMAGE_CONTEXT  TmpContext;
+  EFI_PHYSICAL_ADDRESS  Base;
+
+  //
+  // We need to copy ImageContext since PeCoffLoaderGetImageInfo ()
+  // will mangle the ImageAddress field
+  //
+  CopyMem (&TmpContext, ImageContext, sizeof (TmpContext));
+
+  if (TmpContext.PeCoffHeaderOffset == 0) {
+Status = PeCoffLoaderGetImageInfo (&TmpContext);
+if (RETURN_ERROR (Status)) {
+  DEBUG ((DEBUG_ERROR,
+  

[edk2] [PATCH 0/5] StandaloneMmPkg: Miscellaneous fixes

2018-12-02 Thread Sughosh Ganu
Miscellaneous fixes in StandaloneMmPkg code.

This patcheset is to be applied on top of the following patchset
"StandaloneMM: Update permissions for Standalone MM drivers memory area"


Achin Gupta (5):
  StandaloneMmPkg: Add missing dependency on PL011UartClockLib
  StandaloneMmPkg: Enforce alignment check for AArch64
  StandaloneMmPkg: Zero data structure explicitly
  StandaloneMmPkg: Replace dependency on ArmMmuLib
  StandaloneMmPkg: Update dependency on PeCoffExtraActionLib

 StandaloneMmPkg/StandaloneMmPkg.dsc
 | 8 +---
 
StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/AArch64/StandaloneMmCoreEntryPoint.c
 | 3 ++-
 2 files changed, 7 insertions(+), 4 deletions(-)

-- 
2.7.4


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