Commit Graph

17019 Commits

Author SHA1 Message Date
Cohen, Eugene 3a2e6a740d SecurityPkg : Fix Rsa2048Sha256GuidedSectionExtractLib issue
This issue causes section extraction overrun and possible hang due to bad output size calculation.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: "Cohen, Eugene" <eugene@hp.com>
Reviewed-by: "Zhang, Chao B" <chao.b.zhang@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18625 6f19259b-4bc3-4df7-8a09-765794883524
2015-10-19 02:53:22 +00:00
Laszlo Ersek fcb636ea42 OvmfPkg: VirtioBlkDxe: reset device at ExitBootServices()
(1) VirtioLib allocates the virtio ring in EfiBootServicesData memory.
    (This is intentional.) Code that executes after ExitBootServices() is
    permitted to reuse such memory.

(2) The hypervisor is allowed to look at, and act upon, a live virtio ring
    at any time, even without explicit virtio kicks from the guest.

Should boot loader code or kernel code, running between ExitBootServices()
and the kernel's own virtio drivers resetting the device, overwrite the
pages that used to contain the virtio ring before ExitBootServices(), QEMU
could theoretically interpret that unrelated data as garbage ring
contents, and abort the guest.

Although we have seen no such reports, better be prudent and reset the
device in an ExitBootServices() event handler. Among other things, this
causes QEMU to forget about the device's virtio ring.

Cc: Jordan Justen <jordan.l.justen@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18624 6f19259b-4bc3-4df7-8a09-765794883524
2015-10-16 19:52:24 +00:00
Laszlo Ersek fbc80813ee OvmfPkg: VirtioScsiDxe: reset device at ExitBootServices()
(1) VirtioLib allocates the virtio ring in EfiBootServicesData memory.
    (This is intentional.) Code that executes after ExitBootServices() is
    permitted to reuse such memory.

(2) The hypervisor is allowed to look at, and act upon, a live virtio ring
    at any time, even without explicit virtio kicks from the guest.

Should boot loader code or kernel code, running between ExitBootServices()
and the kernel's own virtio drivers resetting the device, overwrite the
pages that used to contain the virtio ring before ExitBootServices(), QEMU
could theoretically interpret that unrelated data as garbage ring
contents, and abort the guest.

Although we have seen no such reports, better be prudent and reset the
device in an ExitBootServices() event handler. Among other things, this
causes QEMU to forget about the device's virtio ring.

Cc: Jordan Justen <jordan.l.justen@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18623 6f19259b-4bc3-4df7-8a09-765794883524
2015-10-16 19:52:18 +00:00
Michael Kinney f3e34b9d8c OvmfPkg: Sec: Fix SOURCE_DEBUG_ENABLE ASSERT()
The update to the LocalApicLib instances to make sure the Local APIC is
initialized before use (SVN r18595 / git commit 6d72ff7d9d) generates an
ASSERT() when SOURCE_DEBUG_ENABLE is enabled for OVMF.

The fix is to initialize the Local APIC Timer and mask it before
initializing the DebugAgent.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Michael Kinney <michael.d.kinney@intel.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Regression-tested-by: Laszlo Ersek <lersek@redhat.com>
[lersek@redhat.com: rewrap code comment, rewrap commit msg, add precise
 commit ref]

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18622 6f19259b-4bc3-4df7-8a09-765794883524
2015-10-16 16:48:24 +00:00
Laszlo Ersek 5efb28784f MdeModulePkg: SmbiosDxe: soften DEBUG messages about table reallocation
These messages don't report errors, hence they should be emitted as
EFI_D_INFO (or EFI_D_VERBOSE even).

Cc: Star Zeng <star.zeng@intel.com>
Cc: Drew Jones <drjones@redhat.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18621 6f19259b-4bc3-4df7-8a09-765794883524
2015-10-16 15:46:42 +00:00
Laszlo Ersek fcdfd249ec MdeModulePkg: FaultTolerantWriteDxe: clean up some "success" messages
The "success" messages in FtwRestart(), FtwAbort(), and FtwGetLastWrite()
should be logged on EFI_D_INFO level. We can also unify their format with
the __FUNCTION__ macro.

Cc: Star Zeng <star.zeng@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Drew Jones <drjones@redhat.com>
Suggested-by: Star Zeng <star.zeng@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18620 6f19259b-4bc3-4df7-8a09-765794883524
2015-10-16 15:46:37 +00:00
Laszlo Ersek 8a4b243578 MdeModulePkg: FaultTolerantWriteDxe: mellow DEBUGs about workspace reinit
The IsValidWorkSpace() function checks if the working block header of the
workspace is valid. A mismatch detected by this function is not
necessarily an error; it can happen with an as-yet unwritten flash chip,
which is e.g. common and normal when a new ArmVirtQemu virtual machine is
booted. Therefore downgrade the message emitted by IsValidWorkSpace() from
EFI_D_ERROR to EFI_D_INFO, and change the wording from "error" to
"mismatch".

The only caller of IsValidWorkSpace(), InitFtwProtocol(), handles all of
the following cases:

(1) IsValidWorkSpace() succeeds for the working block -- this is normal
    operation,

(2) IsValidWorkSpace() fails for the working block, but succeeds for the
    spare block -- InitFtwProtocol() then restores the working block from
    the spare block,

(3) IsValidWorkSpace() fails for both the working and spare blocks --
    InitFtwProtocol() reinitializes the full workspace.

In cases (2) and (3), InitFtwProtocol() logs additional messages about the
branch taken. Their current level is EFI_D_ERROR, but the messages are
arguably informative, not necessarily error reports.

Downgrade these messages from EFI_D_ERROR to EFI_D_INFO, so that they
don't clutter the debug output when the PcdDebugPrintErrorLevel mask only
enables EFI_D_ERROR (i.e., in a "silent" build).

These messages have annoyed / confused users; see for example:
- https://bugzilla.redhat.com/show_bug.cgi?id=1270279

Cc: Star Zeng <star.zeng@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Drew Jones <drjones@redhat.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18619 6f19259b-4bc3-4df7-8a09-765794883524
2015-10-16 15:46:32 +00:00
Laszlo Ersek 582085eb1f ArmPlatformPkg: NorFlashDxe: mellow DEBUG messages about flash reinit
The ValidateFvHeader() function checks several conditions against the
firmware volume header. Failure of the first of these checks, reported as
"No Firmware Volume header present", is a common situation for unformatted
flash images, especially when a new virtual machine is created.

Similarly, "Variable Store Guid non-compatible" is common when the
firmware binary is switched from Secure Boot-incapable to Secure
Boot-capable, or vice versa.

The only caller of ValidateFvHeader(), NorFlashFvbInitialize(), handles
all these mismatches by installing a new FVB header. It also emits
another, loud ERROR message (which is even less justified when it is
triggered by (BootMode == BOOT_WITH_DEFAULT_SETTINGS)).

Downgrade these messages from EFI_D_ERROR to EFI_D_INFO, so that they
don't clutter the debug output when the PcdDebugPrintErrorLevel mask only
enables EFI_D_ERROR (i.e., in a "silent" build).

These messages have annoyed / confused users; see for example:
- https://bugzilla.redhat.com/show_bug.cgi?id=1270279
- http://thread.gmane.org/gmane.comp.bios.edk2.devel/2772/focus=2869

Cc: Leif Lindholm <leif.lindholm@linaro.org>
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Drew Jones <drjones@redhat.com>
Cc: Yehuda Yitschak <yehuday@marvell.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18618 6f19259b-4bc3-4df7-8a09-765794883524
2015-10-16 15:46:28 +00:00
Mark Rutland f813662589 ArmVirtPkg: include BaseStackCheckLib also for AARCH64
Some AArch64 toolchains also invoke the software stack checker
functions on certain code - so include BaseStackCheckLib for
AARCH64 as well as for ARM. Since this was the only difference
between [LibraryClasses.ARM] and [LibraryClasses.AARCH64],
merge the two into the existing [LibraryClasses.common].

At the same time, fix the grammar for the related comments.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Mark Rutland <mark.rutland@arm.com>
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Laszlo Ersek <lersek@redhat.com>
Cc: Leif Lindholm <leif.lindholm@linaro.org>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18617 6f19259b-4bc3-4df7-8a09-765794883524
2015-10-16 15:23:46 +00:00
Fu Siyuan c476450456 NetworkPkg: reset DHCP child when leaving PXE LoadFile.
The DHCP4 can have only one configured child instance so we need to reset
the DHCP4 child when leaving PXE driver's LoadFile() function, otherwise the
other programs which also need to use DHCP4 (like HTTP boot) will be impacted.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Fu Siyuan <siyuan.fu@intel.com>
Reviewed-by: Ye Ting <ting.ye@intel.com>
Reviewed-by: Sriram Subramanian <sriram-s@hpe.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18616 6f19259b-4bc3-4df7-8a09-765794883524
2015-10-16 07:18:51 +00:00
Fu Siyuan 30268f29bd MdeModulePkg: reset DHCP child when leaving PXE LoadFile.
The DHCP4 can have only one configured child instance so we need to reset
the DHCP4 child when leaving PXE driver's LoadFile() function, otherwise the
other programs which also need to use DHCP4 (like HTTP boot) will be impacted.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Fu Siyuan <siyuan.fu@intel.com>
Reviewed-by: Sriram Subramanian <sriram-s@hpe.com>
Reviewed-by: Ye Ting <ting.ye@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18615 6f19259b-4bc3-4df7-8a09-765794883524
2015-10-16 07:18:38 +00:00
Star Zeng fe3ca12d06 SecurityPkg: Use PcdSet##S to instead of PcdSet##
PcdSet## has no error status returned, then the caller has no idea about whether the set operation is successful or not.
PcdSet##S were added to return error status and PcdSet## APIs were put in ifndef DISABLE_NEW_DEPRECATED_INTERFACES condition.
To adopt PcdSet##S and further code development with DISABLE_NEW_DEPRECATED_INTERFACES defined, we need to Replace PcdSet## usage with PcdSet##S.

Normally, DynamicDefault PCD set is expected to be success, but DynamicHii PCD set failure is a legal case.
PcdTpmInitializationPolicy/PcdTcg2HashAlgorithmBitmap/PcdTpm2HashMask/PcdTpmInstanceGuid all have set operation in PEI phase,
PEI phase does not allow DynamicHii PCD set, so DynamicDefault is expected for them and use PcdSet##S to instead of PcdSet## and assert when set failure.

Cc: Jiewen Yao <jiewen.yao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18614 6f19259b-4bc3-4df7-8a09-765794883524
2015-10-16 01:46:19 +00:00
Star Zeng e90c57aa97 SecurityPkg AuthVariableLib: Add the missing gEfiAuthenticatedVariableGuid
There is no real build failure, as AuthVariableLib always links to variable driver.
But for code integrity, we should add it.

Cc: Jiewen Yao <jiewen.yao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18613 6f19259b-4bc3-4df7-8a09-765794883524
2015-10-16 01:32:48 +00:00
Star Zeng 9d366450b7 MdeModulePkg VariableRuntimeDxe: Add the missing gEfiImageSecurityDatabaseGuid
Otherwise there will be build failure if without VarCheckUefiLib linked.

Cc: Jiewen Yao <jiewen.yao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18612 6f19259b-4bc3-4df7-8a09-765794883524
2015-10-16 01:32:22 +00:00
Star Zeng 1cce53d384 MdeModulepkg VarCheckLib: Return NULL when no property set
to variable with wildcard name.

VarCheckLib has zeroed property for variable with wildcard name
and is waiting for property set. The code should return NULL
when no property set to variable with wildcard name, but not
return the zeroed property that will impact the functionality of
SetVariableCheck.

The issue does not appear with VarCheckUefiLib linked as the library
just has the expected property set.

Cc: Jiewen Yao <jiewen.yao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18611 6f19259b-4bc3-4df7-8a09-765794883524
2015-10-16 01:31:56 +00:00
Fu Siyuan bf9f7cea98 NetworkPkg: remove unnecessary timeout event when setting IPv6 address.
Use Ip6Cfg->SetData() to set IP6 manual address is asynchronous process and the
registered data notify event will be singled when process is done. So it's not
necessary to create another timeout event for the address setting.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Fu Siyuan <siyuan.fu@intel.com>
Reviewed-by: Ye Ting <ting.ye@intel.com>
Reviewed-by: Jiaxin Wu <jiaxin.wu@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18610 6f19259b-4bc3-4df7-8a09-765794883524
2015-10-15 06:42:50 +00:00
Qiu Shumin 48cb33ec30 ShellPkg: Fix ASCII input redirection does not work correctly.
When executing 'ls -b <a arg.txt' Shell cannot get the ASCII char in 'arg.txt' correctly. 
This patch updates the file read buffer size when read from ASCII file to fix the bug.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Qiu Shumin <shumin.qiu@intel.com>
Signed-off-by: Felix Poludov <Felixp@ami.com>
Signed-off-by: Oleksiy Yakovlev <Oleksiyy@ami.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>


git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18609 6f19259b-4bc3-4df7-8a09-765794883524
2015-10-15 02:43:31 +00:00
Qiu Shumin da6b8feb22 ShellPkg: Use safe string functions to refine 'Tftp.c' code.
Safe string functions can help avoid potential buffer overflow. This patch replaces the StrCpy with StCpyS.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Qiu Shumin <shumin.qiu@intel.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>


git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18608 6f19259b-4bc3-4df7-8a09-765794883524
2015-10-15 02:19:14 +00:00
Eric Dong 7bf301dbc5 MdeModulePkg DriverSampleDxe: Add optional ";" to keep consistent with existed vfr op-code.
Refine the sample code,  add extra ";" to keep consistent for the condition opcode in different use cases.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Eric Dong <eric.dong@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18607 6f19259b-4bc3-4df7-8a09-765794883524
2015-10-15 01:04:08 +00:00
Eric Dong c0c300a15c BaseTools VfrCompiler: In order to keep consistent, add an optional ";" for condition op-code.
Current grammar for suppressif opcode not consistent in statement and option case, this patch fixed this issue. The same case also existed for other condition opcodes.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Eric Dong <eric.dong@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18606 6f19259b-4bc3-4df7-8a09-765794883524
2015-10-15 01:03:47 +00:00
Eric Dong 84db9040cc IntelFrameworkModulePkg BdsDxe: Use PcdSet##S to replace PcdSet##
PcdSet## has no error status returned, then the caller has no idea about whether the set operation is successful or not.
PcdSet##S were added to return error status and PcdSet## APIs were put in ifndef DISABLE_NEW_DEPRECATED_INTERFACES condition.
To adopt PcdSet##S and further code development with DISABLE_NEW_DEPRECATED_INTERFACES defined, we need to Replace PcdSet## usage with PcdSet##S.

Normally, DynamicDefault PCD set is expected to be success, but DynamicHii PCD set failure is a legal case.
So for DynamicDefault, we add assert when set failure. For DynamicHii, we add logic to handle it.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Eric Dong <eric.dong@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18605 6f19259b-4bc3-4df7-8a09-765794883524
2015-10-15 00:57:45 +00:00
Eric Dong 291422d78b Update register hot key logic, return EFI_ALREADY_START status if same hot key already existed.
In current case, if one key was requested to register twice, browser will override old hot key with new one. This behavior is not user friendly.
Now update the logic, return EFI_ALREADY_STARTED for this case. If user still want to override it, he must unregistered it first.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Eric Dong <eric.dong@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18604 6f19259b-4bc3-4df7-8a09-765794883524
2015-10-15 00:57:20 +00:00
Eric Dong 377680ae64 MdeModulePkg: Use PcdSet##S to replace PcdSet##
PcdSet## has no error status returned, then the caller has no idea about whether the set operation is successful or not.
PcdSet##S were added to return error status and PcdSet## APIs were put in ifndef DISABLE_NEW_DEPRECATED_INTERFACES condition.
To adopt PcdSet##S and further code development with DISABLE_NEW_DEPRECATED_INTERFACES defined, we need to Replace PcdSet## usage with PcdSet##S.

Normally, DynamicDefault PCD set is expected to be success, but DynamicHii PCD set failure is a legal case.
So for DynamicDefault, we add assert when set failure. For DynamicHii, we add logic to handle it.

Cc: Star Zeng <star.zeng@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Eric Dong <eric.dong@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18603 6f19259b-4bc3-4df7-8a09-765794883524
2015-10-15 00:56:41 +00:00
Liming Gao 1e69581335 BaseTools: Fix the issue to support windows root directory
Use os.path.relpath to get the relative directory instead of directly trim it.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18602 6f19259b-4bc3-4df7-8a09-765794883524
2015-10-14 09:43:43 +00:00
Yonghong Zhu af9785a9ed BaseTools: Fixed an error reported during generating report
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18601 6f19259b-4bc3-4df7-8a09-765794883524
2015-10-12 06:02:09 +00:00
Hess Chen 8145b63e97 BaseTool/UPT: Fix two wrong imports for UPT
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Hess Chen <hesheng.chen@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18600 6f19259b-4bc3-4df7-8a09-765794883524
2015-10-10 05:46:00 +00:00
Star Zeng ca49b6f9bf MdeModulePkg PiDxeS3BootScriptLib: Use PcdSet64S to instead of PcdSet64
PcdSet## has no error status returned, then the caller has no idea about whether the set operation is successful or not.
PcdSet##S were added to return error status and PcdSet## APIs were put in ifndef DISABLE_NEW_DEPRECATED_INTERFACES condition.
To adopt PcdSet##S and further code development with DISABLE_NEW_DEPRECATED_INTERFACES defined, we need to Replace PcdSet## usage with PcdSet##S.

Normally, DynamicDefault PCD set is expected to be success, but DynamicHii PCD set failure is a legal case.
For this case, PcdS3BootScriptTablePrivateDataPtr and PcdS3BootScriptTablePrivateSmmDataPtr are expected to be DynamicDefault,
so use PcdSet64S to instead of PcdSet64 and assert when set failure.

Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18599 6f19259b-4bc3-4df7-8a09-765794883524
2015-10-10 02:53:41 +00:00
Qiu Shumin 938d65a58a ShellPkg: Print error message when Shell set environment variable fail.
If you try to 'set' a read only environment variable and it fails without printing any information.
This patch add error message printing when 'set' environment variable fails.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Qiu Shumin <shumin.qiu@intel.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18598 6f19259b-4bc3-4df7-8a09-765794883524
2015-10-10 01:19:43 +00:00
Ard Biesheuvel 485b306654 MdePkg/PeCoffLoader: fix handling of ARM MOVW/MOVT instruction relocs
Advance the *FixupData pointer after use in the second relocation pass
for runtime when handling ARM MOVW/MOVT immediate relocations.

Note that using FixupData is somewhat pointless for relocations targeting
instructions rather than data items, since the program cannot typically
modify its own instructions, and the second pass should be performed
unconditionally. But let's just fix it for now.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
Reviewed-by: Liming Gao <liming.gao@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18597 6f19259b-4bc3-4df7-8a09-765794883524
2015-10-09 18:55:41 +00:00
Ard Biesheuvel 94762ddef6 BaseTools/PeCoffLoader: fix handling of ARM MOVW/MOVT instruction relocs
The handling of ARM MOVW/MOVT relocations sets the FixupData twice (once
incorrectly), but fails to advance the *FixupData pointer afterwards.
This is not actually a problem, since the fixup data is never used but
let's fix it anyway in case anyone reuses this code.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
Reviewed-by: Liming Gao <liming.gao@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18596 6f19259b-4bc3-4df7-8a09-765794883524
2015-10-09 18:55:28 +00:00
Hao Wu 6d72ff7d9d UefiCpuPkg BaseXApic(X2)Lib: Add ASSERT if local APIC not software enabled
Add an ASSERT in GetApicTimerState() to check if the local APIC is
software enabled.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Hao Wu <hao.a.wu@intel.com>
Reviewed-by: Jeff Fan <jeff.fan@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18595 6f19259b-4bc3-4df7-8a09-765794883524
2015-10-09 07:04:26 +00:00
Hao Wu f17e2f8c9e UefiCpuPkg: Add ASSERT to handle local APIC not config properly
When the local APIC is not configurated properly, function
GetApicTimerInitCount() in LocalApicLib may return zero, which will lead
to a divide by zero exception in SecPeiDxeTimerLibUefiCpu.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Hao Wu <hao.a.wu@intel.com>
Reviewed-by: Jeff Fan <jeff.fan@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18594 6f19259b-4bc3-4df7-8a09-765794883524
2015-10-09 07:04:00 +00:00
Hao Wu 53fa8748fd MdePkg: Add ASSERT to handle local APIC not config properly
When the local APIC is not configurated properly, function
InternalX86GetInitTimerCount() may return zero, which will lead to a
divide by zero exception in SecPeiDxeTimerLibCpu.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Hao Wu <hao.a.wu@intel.com>
Reviewed-by: Jeff Fan <jeff.fan@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18593 6f19259b-4bc3-4df7-8a09-765794883524
2015-10-09 07:03:24 +00:00
Thomas Palmer 9ad48dd148 SecurityPkg: Clean up unused files in RngDxe
Clean up files in RngDxe/IA32 and RngDxe/X64 that are subsumed
by files in BaseRngLib.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Thomas Palmer <thomas.palmer@hpe.com>
Reviewed-by: Samer El-Haj-Mahmoud <elhaj@hpe.com>
Reviewed-by: Michael Kinney <michael.d.kinney@intel.com>
Reviewed-by: Chao Zhang <chao.b.zhang@intel.com>
Reviewed-by: Qin Long <qin.long@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18592 6f19259b-4bc3-4df7-8a09-765794883524
2015-10-09 06:03:34 +00:00
Thomas Palmer 3b60842ce7 SecurityPkg: Integrate new RngLib into RngDxe
Use the new RngLib to provide the IA32/X64 random data for RngDxe.
Remove x86 specific functions from RdRand files.
Simplify RngDxe by using WriteUnaligned64 for all platforms.
Use GetRandomNumber128 in RngDxe to leverage 128 bit support provided
by some HW RNG devices.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Thomas Palmer <thomas.palmer@hpe.com>
Reviewed-by: Samer El-Haj-Mahmoud <elhaj@hpe.com>
Reviewed-by: Michael Kinney <michael.d.kinney@intel.com>
Reviewed-by: Chao Zhang <chao.b.zhang@intel.com>
Reviewed-by: Qin Long <qin.long@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18591 6f19259b-4bc3-4df7-8a09-765794883524
2015-10-09 06:03:26 +00:00
Thomas Palmer c8b6f16d7d MdePkg: Create GetRandomNumber128 in RngLib
Declare GetRandomNumber128 in RngLib.h.
Create GetRandomNumber128 in BaseRngLib, which is simply calling
GetRandomNumber64 twice.

A GetRandomNumber128 function allows platforms with 128bit HWRNGs to
save on IO overhead that comes from having to prime the HWRNG device
before each read operation.
Using the HWRNG installed on the HP ProLiant m400 moonshot cartridge,
this will save about 50ms per RAW Entropy operation as compared with
calling GetRandomNumber64 twice.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Thomas Palmer <thomas.palmer@hpe.com>
Reviewed-by: Samer El-Haj-Mahmoud <elhaj@hpe.com>
Reviewed-by: Michael Kinney <michael.d.kinney@intel.com>
Reviewed-by: Chao Zhang <chao.b.zhang@intel.com>
Reviewed-by: Qin Long <qin.long@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18590 6f19259b-4bc3-4df7-8a09-765794883524
2015-10-09 06:03:17 +00:00
Ard Biesheuvel 64df44b7e5 ArmVirtPkg/ArmVirtQemu: enable non-exec DXE stack for AARCH64
Enable the non-exec DXE stack feature when building for AARCH64.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18589 6f19259b-4bc3-4df7-8a09-765794883524
2015-10-08 18:52:33 +00:00
Ard Biesheuvel c82b808749 MdeModulePkg/DxeIplPeim: implement non-exec stack for ARM/AARCH64
Mark the DXE stack region as non-executable right before handing
off to the DXE core, by invoking the appropriate ArmLib function.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
Reviewed-by: Feng Tian <Feng.Tian@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18588 6f19259b-4bc3-4df7-8a09-765794883524
2015-10-08 18:52:25 +00:00
Ard Biesheuvel 4d9a4f62cf ArmPkg/ArmLib MMU: add functions to set/clear RO and XN bits on regions
Use the refactored UpdateRegionMapping () to traverse the translation
tables, splitting block entries along the way if required, and apply
a mask + or on each to set or clear the PXN/UXN/XN or RO bits.

For now, the 32-bit ARM versions remain unimplemented.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18587 6f19259b-4bc3-4df7-8a09-765794883524
2015-10-08 18:52:16 +00:00
Ard Biesheuvel 5ab77c6630 ArmPkg/AArch64Mmu: move page table traversal code to separate function
Move the page table traversal and splitting logic to a separate function
UpdateRegionMapping() and refactor it slightly so we can reuse it later to
implement non-executable regions, for the stack. This primarly involves
adding a value/mask pair to the function prototype that allows us to flip
arbitrary bits on each block entry as the page tables are traversed.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18586 6f19259b-4bc3-4df7-8a09-765794883524
2015-10-08 18:52:06 +00:00
Ard Biesheuvel 2afeabd1a9 ArmPkg/AArch64Mmu: use architecturally correct definitions for XN/UXN
The non-privileged execute never (UXN) page table bit defined for the
EL1&0 translation regime and the execute never (XN) bit defined for the
EL2 and EL3 translation regimes happen to share the same bit position,
but they are in fact defined distinctly by the architecture. So define
both bits explicitly, and add comments in places where we take advantage
of the fact that they share the same bit position.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18585 6f19259b-4bc3-4df7-8a09-765794883524
2015-10-08 18:51:56 +00:00
Liming Gao 094a67398f BaseTools: Update edksetup.sh to support multiple workspaces
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Wu Hao A <hao.a.wu@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18584 6f19259b-4bc3-4df7-8a09-765794883524
2015-10-08 09:29:56 +00:00
Liming Gao 485eb3a252 BaseTools: Update Edk2Setup.bat to support multiple workspaces
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Wu Hao A <hao.a.wu@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18583 6f19259b-4bc3-4df7-8a09-765794883524
2015-10-08 09:29:36 +00:00
Liming Gao dcc8078699 BaseTools: Update edksetup.bat to support multiple workspaces
1. Update edksetup.bat and toolsetup.bat to handle PACKAGES_PATH.
   BaseTools directory may be in PACKAGES_PATH instead of WORKSAPCE.
2. Introduce EDK_TOOLS_BIN env points to the windows binary tools dir.
   Windows BaseTools Win32 may be a separate directory.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Wu Hao A <hao.a.wu@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18582 6f19259b-4bc3-4df7-8a09-765794883524
2015-10-08 09:29:09 +00:00
Li YangX c4f52e128f BaseTools: Update ECC tool to support multiple workspaces
Update ECC to refer MultipleWorkspace class to convert
the file path from WORKSPACE and PACKAGES_PATH.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Li YangX <yangx.li@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18581 6f19259b-4bc3-4df7-8a09-765794883524
2015-10-08 09:28:51 +00:00
Hesheng Chen fb0f8067ea BaseTools: Update UPT tool to support multiple workspaces
Update UPT to refer MultipleWorkspace class to convert
the file path from WORKSPACE and PACKAGES_PATH.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Hesheng Chen <hesheng.chen@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18580 6f19259b-4bc3-4df7-8a09-765794883524
2015-10-08 09:28:15 +00:00
Li YangX 05cc51ad58 BaseTools: Update Build tool to support multiple workspaces
WORKSPACE is still kept.
New PACKAGES_PATH is introduced to specify the additional WORKSPACEs.
In PACKAGES_PATH, ';' is separator in Windows, ':' is separator in Linux.

Build directory is in WORKSPACE. Package, BaseTools and Conf directory
will be found from WORKSPACE and PACKAGES_PATH.

In implementation, BaseTools adds MultipleWorkspace class for
the file path conversion from WORKSPACE and PACKAGES_PATH.

Verify two tree layouts.
Root\edk2\MdePkg
Root\edk2\MdeMdeModulePkg
Root\edk2\...
1. set WORKSPACE=Root\edk2
2. set WORKSPACE=Root, and set PACKAGES_PATH=Root\edk2

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Li YangX <yangx.li@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18579 6f19259b-4bc3-4df7-8a09-765794883524
2015-10-08 09:27:14 +00:00
Jordan Justen 6fa04d934b EmulatorPkg/build.sh: Use GCC49 toolchain with GCC 5.*
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Cc: Andrew Fish <afish@apple.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18578 6f19259b-4bc3-4df7-8a09-765794883524
2015-10-08 05:51:57 +00:00
Gary Ching-Pang Lin 08df58ec30 OvmfPkg: raise DXEFV size to 9 MB
With gcc5 and enabling SECURE_BOOT and NETWORK_IP6, the build
failed with this error:

GenFv: ERROR 3000: Invalid
  the required fv image size 0x814c18 exceeds the set fv image size 0x800000

Raise the DXEFV size to 9 MB to fix the build error.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Gary Ching-Pang Lin <glin@suse.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Regression-tested-by: Laszlo Ersek <lersek@redhat.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18577 6f19259b-4bc3-4df7-8a09-765794883524
2015-10-07 11:53:07 +00:00
Supreeth Venkatesh c3a10e42e3 ArmPlatformPkg: Fixes for Juno ACPI
1. Change Interrupt for Juno PCI Routing table
Interrupt Number Reference:
http://www.arm.com/files/pdf/DDI0515D1a_juno_arm_development_platform_soc_trm.pdf
table 3-3 page 3-7
2. Support for PCI IO range with ACPI on JUNO

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Supreeth Venkatesh <supreeth.venkatesh@arm.com>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18576 6f19259b-4bc3-4df7-8a09-765794883524
2015-10-07 08:18:00 +00:00