Commit Graph

26074 Commits

Author SHA1 Message Date
Dandan Bi 9feffce9c6 IntelFrameworkModulePkg: Remove PcdFrameworkCompatibilitySupport usage
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1464

Currently Framework compatibility is not needed and
PcdFrameworkCompatibilitySupport will be removed from edk2.
So remove the usage of this PCD firstly.

Cc: Liming Gao <liming.gao@intel.com>
Signed-off-by: Dandan Bi <dandan.bi@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
2019-05-09 09:42:54 +08:00
Dandan Bi 8dc1f4ec0f FatPkg/FatPei: Remove PcdFrameworkCompatibilitySupport usage
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1464

Currently Framework compatibility is not needed and
PcdFrameworkCompatibilitySupport will be removed from edk2.
So remove the usage of this PCD firstly.

Cc: Ray Ni <ray.ni@intel.com>
Signed-off-by: Dandan Bi <dandan.bi@intel.com>
Reviewed-by: Ray Ni <ray.ni@intel.com>
2019-05-09 09:42:54 +08:00
Dandan Bi 1b72fd5121 BaseTools/VfrCompile: Remove framework VFR support
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1464

Currently there is no usage of framework VFR,
remove the support from VfrCompile.

Cc: Bob Feng <bob.c.feng@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Signed-off-by: Dandan Bi <dandan.bi@intel.com>
Reviewed-by: Bob Feng <bob.c.feng@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
2019-05-09 09:42:54 +08:00
Zhiguang Liu 792f0d4f12 EmulatorPkg: Support a second GOP window
Two GOP screens will be created if PcdEmuGop is set in
EmulatorPkg.dsc:
gEmulatorPkgTokenSpaceGuid.PcdEmuGop|L"GOP Window 1!GOP Window 2"

REF:https://bugzilla.tianocore.org/show_bug.cgi?id=1687
Signed-off-by: Zhiguang Liu <zhiguang.liu@intel.com>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Andrew Fish <afish@apple.com>
Cc: Ray Ni <ray.ni@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2019-05-08 16:21:49 +08:00
Liming Gao 23ea5bfea2 NetworkPkg: Add package level include DSC file
Platform DSC can include Network.dsc.inc to enable network features.

Signed-off-by: Liming Gao <liming.gao@intel.com>
Acked-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Siyuan Fu <siyuan.fu@intel.com>
2019-05-08 16:10:39 +08:00
Liming Gao 1e948802e7 NetworkPkg: Add DSC/FDF include segment files to NetworkPkg.
This patch provides a set of include segment files for platform owner to
easily enable/disable network stack support on their platform.

For DSC, there are:
- a "NetworkDefines.dsc.inc" for the [Defines] section(s),
- a "NetworkLibs.dsc.inc" for the [LibraryClasses*] section(s),
- a "NetworkPcds.dsc.inc" for the [Pcds*] section(s),
- a "NetworkComponents.dsc.inc" for the [Components*] section(s).
For FDF, there is:
- a "Network.fdf.inc" for the [Fv*] section(s).

These files can be added to the platform DSC/FDF file by using
  !include NetworkPkg/xxx
where "xxx" is the *.inc file name.

A platform DSC file can diverge from the defaults in
"NetworkDefines.dsc.inc" by setting the individual DEFINEs before
including "NetworkDefines.dsc.inc".
And, build command line ("-D FLAG=VALUE") can be used to enable or
disable related feature set, please check "NetworkDefines.dsc.inc"
for a detail description of each flag.

The default value of these flags are:
  DEFINE NETWORK_ENABLE                 = TRUE
  DEFINE NETWORK_SNP_ENABLE             = TRUE
  DEFINE NETWORK_IP4_ENABLE             = TRUE
  DEFINE NETWORK_IP6_ENABLE             = TRUE
  DEFINE NETWORK_TLS_ENABLE             = TRUE
  DEFINE NETWORK_HTTP_BOOT_ENABLE       = TRUE
  DEFINE NETWORK_ALLOW_HTTP_CONNECTIONS = FALSE
  DEFINE NETWORK_ISCSI_ENABLE           = TRUE
  DEFINE NETWORK_VLAN_ENABLE            = TRUE

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

Cc: Jiaxin Wu <jiaxin.wu@intel.com>
Cc: Ting Ye <ting.ye@intel.com>
Signed-off-by: Fu Siyuan <siyuan.fu@intel.com>
Signed-off-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Siyuan Fu <siyuan.fu@intel.com>
2019-05-08 16:10:39 +08:00
Liming Gao da815cf390 NetworkPkg DSC: Add the required ARM library to pass ARM build
Signed-off-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
2019-05-08 16:10:39 +08:00
Zhang, Shenglei a642e2b42e MdeModulePkg/DumpDynPcd: Add application to dump dynamic PCD settings
This is a shell application to dump dynamic PCD settings.
Type DumpDynPcd -?/h/H to get help information.
Type DumpDynPcd -v/V to get version information.
Type DumpDynPcd [PcdName] to get Pcd information.
https://bugzilla.tianocore.org/show_bug.cgi?id=1541

v2:1.Add static for global variables.
   2.Change the parameter amount of InternalStrnCatGrow in DumpDynPcd.c.
   3.Add open brace according to EDK II C Coding Standards Specification.
   4.Remove the dependency on ShellPkg.dec in DumpDynPcd.inf.

v3:Add static for all global variables and internal functions.

Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Cc: Eric Dong <eric.dong@intel.com>
Signed-off-by: Shenglei Zhang <shenglei.zhang@intel.com>
Reviewed-by: Hao A Wu <hao.a.wu@intel.com>
2019-05-08 14:15:40 +08:00
Fan, ZhijuX df7c81b5b2 BaseTools:The code used to test python module is moved to edksetup
BZ:https://bugzilla.tianocore.org/show_bug.cgi?id=1582

testing for presence of python modules should be done in edksetup
to reduce impact on subsequent build times.
This code currently exists in BaseTools/Tests/RunTest.py.

This patch is going to fix this issue.

Cc: Bob Feng <bob.c.feng@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Signed-off-by: Zhiju.Fan <zhijux.fan@intel.com>
Reviewed-by: Bob Feng <bob.c.feng@intel.com>
2019-05-08 09:41:43 +08:00
Fan, ZhijuX 26e2b295ec BaseTools:Remove unused BaseTools\Source\Python\UPT\Dll
BZ:https://bugzilla.tianocore.org/show_bug.cgi?id=1735

BaseTools runs from python source. It doesn't depend on
dll any more. So, DLL can be removed.

This patch is going to fix that issue.

Cc: Bob Feng <bob.c.feng@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Signed-off-by: Zhiju.Fan <zhijux.fan@intel.com>
Reviewed-by: Bob Feng <bob.c.feng@intel.com>
2019-05-08 09:41:42 +08:00
Fan, ZhijuX 0cb3f77153 BaseTools:ECC report errors on account of analyze special characters
BZ:https://bugzilla.tianocore.org/show_bug.cgi?id=1751

In case that a C function body contains the string of L'', L'\"',
L"\"", L''', L""", L"\"\"", L"\"^", L" \"", L"\" \"", ('L",\\\""')
ECC tool running under python3 interpreter will report error.
The antlr4 module misidentified this character

This patch is going to fix that issue.

Cc: Bob Feng <bob.c.feng@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Signed-off-by: Zhiju.Fan <zhijux.fan@intel.com>
Reviewed-by: Bob Feng <bob.c.feng@intel.com>
2019-05-08 09:41:42 +08:00
Fan, ZhijuX 8b4b2fb9a1 BaseTools:corrected error message for the DatumType error
BZ:https://bugzilla.tianocore.org/show_bug.cgi?id=1762

For structure Pcd, Its DatumType may be self-defined,
If the PCD DatumType format is incorrect,
this PCD DatumType error message is inappropriate.

This patch corrects the error message.

Cc: Bob Feng <bob.c.feng@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Signed-off-by: Zhiju.Fan <zhijux.fan@intel.com>
Reviewed-by: Bob Feng <bob.c.feng@intel.com>
2019-05-08 09:41:41 +08:00
Chu, Maggie f5245a1db1 SecurityPkg/OpalPassword: Add warning message for Secure Erase
https://bugzilla.tianocore.org/show_bug.cgi?id=1753
Add pop-up warning messages before secure erase action.
In order to notify user the secure erase action will take a longer time.
This change also fix some pop-up windows are unable to show up
complete message due to some strings are too long.

Signed-off-by: Maggie Chu <maggie.chu@intel.com>
Cc: Chao Zhang <chao.b.zhang@intel.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Reviewed-by: Eric Dong <eric.dong@intel.com>
2019-05-08 09:17:36 +08:00
Rebecca Cran fbb0ec7ea4 BaseTools: support arm64 as a platform name in addition to aarch64
Some systems such as FreeBSD identify the platform as 'arm64'
and not 'aarch64' as Linux does.

Signed-off-by: Rebecca Cran <rebecca@bluestop.org>
Reviewed-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Philippe Mathieu-Daude <philmd@redhat.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
[lersek@redhat.com: fix up DKIM damage in the "From:" address]
2019-05-03 11:00:34 +02:00
Michael D Kinney d027412258 Vlv2TbltDevicePkg: Remove NetworkPkg/IpSecDxe module
The following commit removed the NetworkPkg/IpSecDxe
module.

d55d9d0664

Update the MinnowMax platform DSC/FDF files to remove all
references to the NetworkPkg/IpSecDxe module.

Cc: Zailiang Sun <zailiang.sun@intel.com>
Cc: Yi Qian <yi.qian@intel.com>
Cc: Michael Kubacki <michael.a.kubacki@intel.com>
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
Reviewed-by: Michael Kubacki <michael.a.kubacki@intel.com>
2019-05-01 14:12:35 -07:00
Laszlo Ersek 727d7ebaa9 OvmfPkg/EnrollDefaultKeys: suppress incorrect compiler warning
When building OvmfPkg/EnrollDefaultKeys for IA32 with gcc-4.8 for the
DEBUG target (and possibly under other build configurations too), the
compiler incorrectly reports,

> OvmfPkg/EnrollDefaultKeys/EnrollDefaultKeys.c: In function
> 'ShellAppMain':
> OvmfPkg/EnrollDefaultKeys/EnrollDefaultKeys.c:631:10: error:
> 'SizeOfPkKek1' may be used uninitialized in this function
> [-Werror=maybe-uninitialized]
>    Status = EnrollListOfCerts (
>           ^
> OvmfPkg/EnrollDefaultKeys/EnrollDefaultKeys.c:703:12: error: 'PkKek1'
> may be used uninitialized in this function [-Werror=maybe-uninitialized]
>    FreePool (PkKek1);
>             ^
> cc1: all warnings being treated as errors

Suppress this warning, in the style suggested under
<https://bugzilla.tianocore.org/show_bug.cgi?id=607>.

Reported-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Fixes: be9470b3c9
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
2019-05-01 08:30:35 +02:00
Fan, ZhijuX 273190e189 BaseTools:Fixed an issue where the order of GuidS changed in guid.xref
BZ:https://bugzilla.tianocore.org/show_bug.cgi?id=1749

Add content to dsc
[PcdsPatchableInModule.common]
  gEfiMdeModulePkgTokenSpaceGuid.test1|FALSE

The order of file Guid.xref will change after increment build.
The root cause is set() is used in Get all the PCDS
the order of the data may change if set() is used

This patch is going to fix that issue.

Cc: Bob Feng <bob.c.feng@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Signed-off-by: Zhiju.Fan <zhijux.fan@intel.com>
Reviewed-by: Bob Feng <bob.c.feng@intel.com>
2019-05-01 10:57:05 +08:00
Feng, Bob C c4c8c340ef BaseTools: Add GCC flags to Basetool build.
BZ:https://bugzilla.tianocore.org/show_bug.cgi?id=1764

Some compiler flags restrict the compiler from making
arbitrary decisions while handling undefined C/C++ behaviors.
Therefore they can be used to fix some issues caused by undefined behavior.

For example, for GCC, the following flags are available:
-fno-delete-null-pointer-checks tells
the compiler NOT to assume that null pointer deference does not exist.
-fwrapv tells the compiler that signed overflow always wraps.

This patch is going to add these 2 build options to
BaseTool GCC build option.

Signed-off-by: Bob Feng <bob.c.feng@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
2019-05-01 10:21:56 +08:00
Bob Feng 0d6de095a5 BaseTools: split long line into multiple short lines.
BZ:https://bugzilla.tianocore.org/show_bug.cgi?id=1764

To be easy to review in future, split the long line into
multiple shorter lines.

Signed-off-by: Bob Feng <bob.c.feng@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
2019-05-01 10:21:48 +08:00
Michael D Kinney 80d28ddeb2 QuarkPlatformPkg/PlatformInit: Resolve ResetSystemLib name collision
Change function name from ResetSystem() to PlatformResetSystem()
to resolve name collision with ResetSystemLib.

Cc: Kelly Steele <kelly.steele@intel.com>
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
Reviewed-by: Kelly Steele <kelly.steele@intel.com>
2019-04-30 16:39:41 -07:00
Michael D Kinney 0edaa8c162 QuarkSocPkg/SmmAccessDxe: Set region to UC on SMRAM close
The following commit removed the unconditional UC setting
just prior to closing the SMRAM region.  This is a correct
change for most platforms.

bfc87aa78e

The Quark platforms still require this UC setting, so move
the UC setting into the Quark specific SMM Access Protocol
when the Close() service is called.

Cc: Kelly Steele <kelly.steele@intel.com>
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
Reviewed-by: Kelly Steele <kelly.steele@intel.com>
2019-04-30 16:39:40 -07:00
Michael D Kinney c793d24b01 QuarkPlatformPkg: Use uniprocessor MpInitLibUp
Update Quark DSC files to use MpInitLibUp instead
of DxeMpInitLib and PeiMpInitLib.

Cc: Kelly Steele <kelly.steele@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
Reviewed-by: Michael Kubacki <michael.a.kubacki@intel.com>
2019-04-30 16:39:40 -07:00
Michael D Kinney ba1362d882 UefiCpuPkg/CpuMpPei: Add missing CpuLib class
The CpuMpPei module uses a services from the CpuLib class,
but the CpuLib class is missing from the INF file.  This
update is required to use the new MpInitLibUp instance that
does not use the CpuLib class.

Cc: Eric Dong <eric.dong@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Cc: Laszlo Ersek <lersek@redhat.com>
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
2019-04-30 16:39:34 -07:00
Michael D Kinney 6dd88437b1 UefiCpuPkg/MpInitLibUp: Add uniprocessor MpInitLib
Add a new instance of the MpInitLib that is designed for
uniprocessor platforms that require the use of modules
that depend on the MP_SERVICES_PROTOCOL for dispatch
or to retrieve information about the boot processor.

Cc: Eric Dong <eric.dong@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Cc: Laszlo Ersek <lersek@redhat.com>
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
2019-04-30 16:39:34 -07:00
Michael D Kinney 24f4547c5c QuarkPlatformPkg: Set PcdSpeculationBarrierType to CPUID
Set PcdSpeculationBarrierType to use CPUID instead of the
default LFENCE in the BaseLib function SpeculationBarrier().
LFENCE requires SSE2, and Quark platforms do not support
SSE2.

Cc: Kelly Steele <kelly.steele@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
Reviewed-by: Michael Kubacki <michael.a.kubacki@intel.com>
2019-04-30 16:39:33 -07:00
Michael D Kinney aec7465689 MdePkg/BaseLib: Use PcdSpeculationBarrierType
Use PcdSpeculationBarrierType in the x86 implementation
of SpeculationBarrier() to select between AsmLfence(),
AsmCpuid(), and no operation.

Cc: Liming Gao <liming.gao@intel.com>
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Brian J. Johnson <brian.johnson@hpe.com>
2019-04-30 16:39:15 -07:00
Michael D Kinney a41b12574e MdePkg: Add PcdSpeculationBarrierType
Add gEfiMdePkgTokenSpaceGuid.PcdSpeculationBarrierType that
uses the PCD type FixedAtBuild.  This performs a build time
selection for the type of speculation barrier to use in the
BaseLib function SpeculationBarrier().  The recommended
speculation barrier for x86 is LFENCE and this is the default
value for this PCD.  x86 CPUs that do not support LFENCE must
select one of the other supported values which includes CPUID
and nothing.

Cc: Liming Gao <liming.gao@intel.com>
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Brian J. Johnson <brian.johnson@hpe.com>
2019-04-30 16:39:09 -07:00
Igor Druzhinin 0c40c9c925 OvmfPkg/XenSupport: turn off address decoding before BAR sizing
On Xen, hvmloader firmware leaves address decoding enabled for
enumerated PCI device before jumping into OVMF. OVMF seems to
expect it to be disabled and tries to size PCI BARs in several places
without disabling it which causes BAR64, for example, being
incorrectly placed by QEMU.

Fix it by disabling PCI address decoding explicitly before the
first attempt to size BARs on Xen.

Signed-off-by: Igor Druzhinin <igor.druzhinin@citrix.com>
Acked-by: Laszlo Ersek <lersek@redhat.com>
Acked-by: Anthony PERARD <anthony.perard@citrix.com>
2019-04-30 18:42:35 +02:00
Igor Druzhinin d63610df60 OvmfPkg/XenSupport: use a correct PCI host bridge aperture for BAR64
In case BAR64 is placed below 4G choose the correct aperture.
This fixes a failed assertion down the code path.

Acked-by: Anthony PERARD <anthony.perard@citrix.com>
Signed-off-by: Igor Druzhinin <igor.druzhinin@citrix.com>
2019-04-30 18:41:57 +02:00
Igor Druzhinin 27e4d6ae25 OvmfPkg/XenSupport: remove usage of prefetchable PCI host bridge aperture
This aperture doesn't exist in QEMU-XEN and hvmloader places BARs
in arbitrary order disregarding prefetchable bit. This makes
prefetchable and non-prefetchable BARs to follow each other that's
quite likely with PCI passthrough devices. In that case, the existing
code, that tries to work out aperture boundaries by reading hvmloader
BAR placement, will report a bogus prefetchable aperture which overlaps
with the regular one. It will eventually trigger an assertion in
DXE PCI initialization code.

Do the same thing as OVMF on QEMU-KVM and pass a non-existing aperture
there. It's not necessary to pass additional allocation flags as we set
ResourceAssigned flag on the root bridge which means they will be ignored.

Reviewed-by: Anthony PERARD <anthony.perard@citrix.com>
Signed-off-by: Igor Druzhinin <igor.druzhinin@citrix.com>
2019-04-30 18:41:57 +02:00
Laszlo Ersek 9fb2ce2f46 OvmfPkg/EnrollDefaultKeys: remove Red Hat's hard-coded PK/KEK1
The certificate

  "Red Hat Secure Boot (PK/KEK key 1)/emailAddress=secalert@redhat.com"
  SHA1: fd:fc:7f:3c:7e:f3:e0:57:76:ad:d7:98:78:21:6c:9b:e0:e1:95:97

is no longer referenced; remove it.

Cc: Anthony Perard <anthony.perard@citrix.com>
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Julien Grall <julien.grall@arm.com>
Bugzilla: https://bugzilla.tianocore.org/show_bug.cgi?id=1747
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Philippe Mathieu-Daude <philmd@redhat.com>
Acked-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Gary Lin <glin@suse.com>
2019-04-30 14:26:49 +02:00
Laszlo Ersek be9470b3c9 OvmfPkg/EnrollDefaultKeys: enroll PK/KEK1 from the Type 11 SMBIOS table
Disconnect the certificate that is enrolled as both Platform Key and first
Key Exchange Key from Red Hat: expect the hypervisor to specify it, as
part of SMBIOS.

Example usage with QEMU:

* Generate self-signed X509 certificate:

  openssl req \
    -x509 \
    -newkey rsa:2048 \
    -outform PEM \
    -keyout PkKek1.private.key \
    -out PkKek1.pem

  (where "PEM" simply means "DER + base64 + header + footer").

* Strip the header, footer, and newline characters; prepend the
  application prefix:

  sed \
    -e 's/^-----BEGIN CERTIFICATE-----$/4e32566d-8e9e-4f52-81d3-5bb9715f9727:/' \
    -e '/^-----END CERTIFICATE-----$/d' \
    PkKek1.pem \
  | tr -d '\n' \
  > PkKek1.oemstr

* Pass the certificate to EnrollDefaultKeys with the following QEMU
  option:

  -smbios type=11,value="$(< PkKek1.oemstr)"

  (Note: for the above option to work correctly, a QEMU version is needed
  that includes commit 950c4e6c94b1 ("opts: don't silently truncate long
  option values", 2018-05-09). The first upstream release with that commit
  was v3.0.0.

  Once <https://bugs.launchpad.net/qemu/+bug/1826200> is fixed, QEMU will
  learn to read the file directly; passing the blob on the command will be
  necessary no more.)

Cc: Anthony Perard <anthony.perard@citrix.com>
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Julien Grall <julien.grall@arm.com>
Bugzilla: https://bugzilla.tianocore.org/show_bug.cgi?id=1747
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Philippe Mathieu-Daude <philmd@redhat.com>
Acked-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Gary Lin <glin@suse.com>
2019-04-30 14:26:46 +02:00
Laszlo Ersek 392404167f OvmfPkg: introduce OVMF_PK_KEK1_APP_PREFIX_GUID
For the EnrollDefaultKeys application, the hypervisor is expected to add a
string entry to the "OEM Strings" (Type 11) SMBIOS table, with the
following format:

4e32566d-8e9e-4f52-81d3-5bb9715f9727:<Base64 X509 cert for PK and first KEK>

The string representation of the GUID at the front is the "application
prefix", in terms of QEMU commit
<https://git.qemu.org/?p=qemu.git;a=commit;h=2d6dcbf93fb0>.

Introduce this GUID in the usual manner.

Cc: Anthony Perard <anthony.perard@citrix.com>
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Julien Grall <julien.grall@arm.com>
Bugzilla: https://bugzilla.tianocore.org/show_bug.cgi?id=1747
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Philippe Mathieu-Daude <philmd@redhat.com>
Acked-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Gary Lin <glin@suse.com>
2019-04-30 14:26:45 +02:00
Laszlo Ersek c9727ff1df OvmfPkg/EnrollDefaultKeys: document the steps of the entry point function
The entry point function of EnrollDefaultKeys finishes with a sanity
check, verifying the values of the Secure Boot-related "control"
variables. Add a diagram to explain why we expect the values we do.

While at it, write comments on the rest of the entry point function.

Cc: Anthony Perard <anthony.perard@citrix.com>
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Julien Grall <julien.grall@arm.com>
Bugzilla: https://bugzilla.tianocore.org/show_bug.cgi?id=1747
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Philippe Mathieu-Daude <philmd@redhat.com>
Acked-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Gary Lin <glin@suse.com>
2019-04-30 14:26:43 +02:00
Laszlo Ersek 86bf2672a3 OvmfPkg/EnrollDefaultKeys: describe functions with leading comment blocks
The GetExact(), GetSettings(), PrintSettings(), and ShellAppMain()
functions lack leading comment blocks. Supply those.

While at it, make sure that every such comment block is preceded by two
blank lines.

Cc: Anthony Perard <anthony.perard@citrix.com>
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Julien Grall <julien.grall@arm.com>
Bugzilla: https://bugzilla.tianocore.org/show_bug.cgi?id=1747
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Philippe Mathieu-Daude <philmd@redhat.com>
Acked-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Gary Lin <glin@suse.com>
2019-04-30 14:26:42 +02:00
Laszlo Ersek 7eeaa7585a OvmfPkg/EnrollDefaultKeys: extract MICROSOFT_VENDOR_GUID
The GUID

  77FA9ABD-0359-4D32-BD60-28F4E78F784B

is specified in MSDN, at
<https://msdn.microsoft.com/en-us/ie/dn932805(v=vs.94)>, therefore it
deserves an entry in the package DEC file, and a header file under
"Include/Guid".

(Arguably, this GUID declaration / definition could even live under
SecurityPkg, but the edk2 tradition has been to hoist GUIDs,
protocols/PPIs, and lib classes from OvmfPkg to a core package only when
dependent C code is added to the core package.)

Cc: Anthony Perard <anthony.perard@citrix.com>
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Julien Grall <julien.grall@arm.com>
Bugzilla: https://bugzilla.tianocore.org/show_bug.cgi?id=1747
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Philippe Mathieu-Daude <philmd@redhat.com>
Acked-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Gary Lin <glin@suse.com>
2019-04-30 14:26:40 +02:00
Laszlo Ersek a79b115ade OvmfPkg/EnrollDefaultKeys: split out certificate and signature constants
A large portion of "EnrollDefaultKeys.c" is hex-encoded X509 certificates,
GUIDs, and signatures. These objects are constants, unlikely to see
changes anytime soon. Move them out of the way, to "AuthData.c", so we can
more easily work on functions in "EnrollDefaultKeys.c".

Cc: Anthony Perard <anthony.perard@citrix.com>
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Julien Grall <julien.grall@arm.com>
Bugzilla: https://bugzilla.tianocore.org/show_bug.cgi?id=1747
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Philippe Mathieu-Daude <philmd@redhat.com>
Acked-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Gary Lin <glin@suse.com>
2019-04-30 14:26:39 +02:00
Laszlo Ersek 1c9418fcaf OvmfPkg/EnrollDefaultKeys: extract typedefs to a header file
"EnrollDefaultKeys.c" defines three structure types: SINGLE_HEADER,
REPEATING_HEADER, and SETTINGS. The definitions are scattered over the C
file, and lack high-level summary comments.

Extract the structures to "EnrollDefaultKeys.h", and add the missing
comments.

Cc: Anthony Perard <anthony.perard@citrix.com>
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Julien Grall <julien.grall@arm.com>
Bugzilla: https://bugzilla.tianocore.org/show_bug.cgi?id=1747
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Philippe Mathieu-Daude <philmd@redhat.com>
Acked-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Gary Lin <glin@suse.com>
2019-04-30 14:26:37 +02:00
Laszlo Ersek a2491a6c82 OvmfPkg/EnrollDefaultKeys: remove unneeded EFIAPI call. conv. specifiers
The GetExact(), GetSettings(), PrintSettings() functions are only called
from within "EnrollDefaultKeys.c", and none of them take variable
arguments. Drop their EFIAPI calling convention specifiers.

Cc: Anthony Perard <anthony.perard@citrix.com>
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Julien Grall <julien.grall@arm.com>
Bugzilla: https://bugzilla.tianocore.org/show_bug.cgi?id=1747
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Philippe Mathieu-Daude <philmd@redhat.com>
Acked-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Gary Lin <glin@suse.com>
2019-04-30 14:26:35 +02:00
Laszlo Ersek e0d612356e OvmfPkg/EnrollDefaultKeys: clean up acronym capitalization in identifiers
According to the edk2 coding standards, "[w]hen all letters in an acronym
are capitalized, it makes the prior and subsequent words visually
difficult to distinguish".

Fix the spellings of three acronyms, accordingly:
- "KEK" (Key Exchange Key) should be written as "Kek", in "mMicrosoftKEK",
- "CA" (Certificate Authority) should be written as "Ca", in
  "mMicrosoftUefiCA",
- "PCA" (Production Certificate Authority) should be written as "Pca", in
  "mMicrosoftPCA".

Generate the changes with:

  sed --regexp-extended --in-place \
    --expression='s,\<mMicrosoftKEK\>,mMicrosoftKek,g' \
    --expression='s,\<mMicrosoftUefiCA\>,mMicrosoftUefiCa,g' \
    --expression='s,\<mMicrosoftPCA\>,mMicrosoftPca,g' \
    OvmfPkg/EnrollDefaultKeys/EnrollDefaultKeys.c

Cc: Anthony Perard <anthony.perard@citrix.com>
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Julien Grall <julien.grall@arm.com>
Bugzilla: https://bugzilla.tianocore.org/show_bug.cgi?id=1747
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Philippe Mathieu-Daude <philmd@redhat.com>
Acked-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Gary Lin <glin@suse.com>
2019-04-30 14:26:33 +02:00
Laszlo Ersek 32d1440aad OvmfPkg/EnrollDefaultKeys: clean up global variable name prefixes
In edk2, we should start the names of module-global variables with "m".
Rename the "RedHatPkKek1", "MicrosoftKEK", "MicrosoftPCA",
"MicrosoftUefiCA" variables accordingly, with the following command:

  sed --regexp-extended --in-place \
    --expression='s,\<(RedHatPkKek1|Microsoft(KEK|PCA|UefiCA))\>,m\1,g' \
    OvmfPkg/EnrollDefaultKeys/EnrollDefaultKeys.c

Cc: Anthony Perard <anthony.perard@citrix.com>
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Julien Grall <julien.grall@arm.com>
Bugzilla: https://bugzilla.tianocore.org/show_bug.cgi?id=1747
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Philippe Mathieu-Daude <philmd@redhat.com>
Acked-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Gary Lin <glin@suse.com>
2019-04-30 14:26:31 +02:00
Laszlo Ersek 85d96998a4 OvmfPkg/EnrollDefaultKeys: clean up minor whitespace wart
In edk2, we should spell "#pragma pack(...)" with a space character in
front of the opening parenthesis. Fix up locations that suggest otherwise.

Cc: Anthony Perard <anthony.perard@citrix.com>
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Julien Grall <julien.grall@arm.com>
Bugzilla: https://bugzilla.tianocore.org/show_bug.cgi?id=1747
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Philippe Mathieu-Daude <philmd@redhat.com>
Acked-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Gary Lin <glin@suse.com>
2019-04-30 14:26:29 +02:00
Laszlo Ersek 034dec6ca1 ArmVirtPkg: build EnrollDefaultKeys.efi
Having removed VALID_ARCHITECTURES from
"OvmfPkg/EnrollDefaultKeys/EnrollDefaultKeys.inf", it now makes sense to
reflect the related platform DSC bits from OvmfPkg to ArmVirtPkg.

Build "EnrollDefaultKeys.efi" as part of ArmVirtQemu and ArmVirtQemuKernel
(which are the ArmVirtPkg platforms that include SecureBootConfigDxe too).

Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Bugzilla: https://bugzilla.tianocore.org/show_bug.cgi?id=1747
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Philippe Mathieu-Daude <philmd@redhat.com>
Acked-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Gary Lin <glin@suse.com>
2019-04-30 14:26:27 +02:00
Laszlo Ersek 05d7f3c3fc OvmfPkg/EnrollDefaultKeys: refresh INF file
Bump INF_VERSION to the latest edk2 INF specification.

Regenerate FILE_GUID to distinguish this application from downstream-only
versions.

Remove the VALID_ARCHITECTURES comment as there is nothing ISA or platform
specific in the application.

Ensure all sections apart from [Defines] are alphabetically sorted.

Cc: Anthony Perard <anthony.perard@citrix.com>
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Julien Grall <julien.grall@arm.com>
Bugzilla: https://bugzilla.tianocore.org/show_bug.cgi?id=1747
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Philippe Mathieu-Daude <philmd@redhat.com>
Acked-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Gary Lin <glin@suse.com>
2019-04-30 14:26:25 +02:00
Laszlo Ersek 3defea06b2 OvmfPkg/EnrollDefaultKeys: update @file comment blocks
Refresh the sentence that states the purpose of the application.

Extend the copyright notice to the year 2019.

Replace the 2-clause BSD License banner with the BSD-2-Clause-Patent SPDX
ID.

Cc: Anthony Perard <anthony.perard@citrix.com>
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Julien Grall <julien.grall@arm.com>
Bugzilla: https://bugzilla.tianocore.org/show_bug.cgi?id=1747
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Philippe Mathieu-Daude <philmd@redhat.com>
Acked-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Gary Lin <glin@suse.com>
2019-04-30 14:26:24 +02:00
Laszlo Ersek b11636239f OvmfPkg: introduce EnrollDefaultKeys application
Add the OvmfPkg/EnrollDefaultKeys shell application source as it is at the
"edk2-20190308git89910a39dcfd-2.el8" tag in RHEL8's downstream "edk2"
package.

Further patches in this series will replace Red Hat-specific bits in the
application, with a conduit to pass in parameters directly from the host
side, on both QEMU and Xen.

(Note: at the moment, Xen doesn't support Secure Boot, due to lacking a
standards-conformant variable driver stack. However, that could change
soon
<https://fosdem.org/2019/schedule/event/vai_implementing_uefi_variable_services_in_qemu/>,
and then this facility will become useful on Xen too.)

The use case for this application (including why it is only being added to
the DSC files) is explained in detail in
<https://bugzilla.tianocore.org/show_bug.cgi?id=1747#c0>.

Cc: Anthony Perard <anthony.perard@citrix.com>
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Julien Grall <julien.grall@arm.com>
Bugzilla: https://bugzilla.tianocore.org/show_bug.cgi?id=1747
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Philippe Mathieu-Daude <philmd@redhat.com>
Acked-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Gary Lin <glin@suse.com>
2019-04-30 14:26:11 +02:00
Michael D Kinney 137cbff041 QuarkPlatformPkg/AcpiTables: Resolve iASL warnings
Resolve a few warnings from the latest iASL compilers.

Cc: Kelly Steele <kelly.steele@intel.com>
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
Reviewed-by: Kelly Steele <kelly.steele@intel.com>
2019-04-29 15:32:55 -07:00
Michael D Kinney 5c5d8d0b20 edk2: Update ReadMe.md and Maintainer.txt for edk2-libc repo
https://bugzilla.tianocore.org/show_bug.cgi?id=1734

The following packages have been moved to the new edk2-libc
repository.  Remove references to these packages from
Readme.md and Maintainers.txt.

* AppPkg
* StdLib
* StdLibPrivateInternalFiles

Cc: Jaben Carsey <jaben.carsey@intel.com>
Cc: Daryl McDaniel <edk2-lists@mc2research.org>
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
2019-04-29 13:06:59 -07:00
Michael D Kinney 964f432b9b edk2: Remove AppPkg, StdLib, StdLibPrivateInternalFiles
https://bugzilla.tianocore.org/show_bug.cgi?id=1734

Remove the following packages and move them to the new
edk2-libc repository

* AppPkg
* StdLib
* StdLibPrivateInternalFiles

Cc: Jaben Carsey <jaben.carsey@intel.com>
Cc: Daryl McDaniel <edk2-lists@mc2research.org>
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
Acked-by: Laszlo Ersek <lersek@redhat.com>
2019-04-29 13:06:36 -07:00
Marcin Wojtas e2d3a25f1a EmbeddedPkg: Extend NvVarStoreFormattedLib LIBRARY_CLASS
Latest change allowed to add dependency on NvVarStoreFormattedLib
for the DXE_DRIVER modules. Although effectively it is hooked
using the 'NULL' class, extend the LIBRARY_CLASS with according
type for consistency sake.

Signed-off-by: Marcin Wojtas <mw@semihalf.com>
Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
2019-04-29 15:34:16 +02:00