Laszlo Ersek [Mon, 26 Oct 2015 14:58:26 +0000 (14:58 +0000)]
OvmfPkg: QemuFlashFvbServicesRuntimeDxe: remove FvbScratchSpace field
The ESAL_FWB_GLOBAL.FvbScratchSpace array is never initialized (it
contains garbage from AllocateRuntimePool()). Its element at subscript one
(=FVB_VIRTUAL), containing garbage as well, is converted to virtual
mapping. Then the array is never used again.
Laszlo Ersek [Mon, 26 Oct 2015 14:58:08 +0000 (14:58 +0000)]
OvmfPkg: QemuFlashFvbServicesRuntimeDxe: rewrap source code to 79 chars
Some of the line lengths in this driver are atrocious. While we have to
put up with the status quo outside of OvmfPkg, we can at least rewrap this
driver before refactoring it.
In the FvbInitialize() function there's no way around introducing two
local variables, just for the sake of sensibly rewrapping the code.
Furthermore, in "FwBlockService.c" the function comment blocks are now
indented; their original position causes diff to print bogus function
names at the top of hunks.
Qiu Shumin [Mon, 26 Oct 2015 13:28:01 +0000 (13:28 +0000)]
ShellPkg: Fix 'EfiShellExecute' doesn't get command status correctly.
1. Add a new function 'RunShellCommand' to return command status, thus 'EfiShellExecute' can get the command return status of 'CommandLine'.
2. Refine the code logic of 'EfiShellExecute' to make the new image of shell be loaded only if 'Environment' isn't NULL.
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Qiu Shumin <shumin.qiu@intel.com> Signed-off-by: Jin Eric <eric.jin@intel.com> Signed-off-by: Jaben Carsey <jaben.carsey@intel.com> Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18664 6f19259b-4bc3-4df7-8a09-765794883524
Yonghong Zhu [Mon, 26 Oct 2015 03:26:55 +0000 (03:26 +0000)]
BaseTools:added extern protocol/PPI/GUID definition in AutoGen for Library
We already added the extern declaration for protocols/PPI/GUID in AutoGen.h
file for driver, but missing this feature for the Library. so this patch
add it.
Ruiyu Ni [Fri, 23 Oct 2015 08:29:38 +0000 (08:29 +0000)]
MdeModulePkg: Fix a PciBusDxe hot plug bug
For a hot plug bridge with device attached, PciBusDxe driver reserves
the resources which equal to the total amount of padding resource
returned from HotPlug->GetResourcePadding() and the actual occupied
resource by the attached device. The behavior is incorrect.
Correct behavior is to reserve the bigger one between the padding
resource and the actual occupied resource.
Derek Lin [Fri, 23 Oct 2015 05:28:38 +0000 (05:28 +0000)]
MdeModulePkg Variable: Enhance variable performance by reading from existed memory cache.
Current variable driver already have memory cache to improve performance.
Change the code which read from physical MMIO address to read from memory cache.
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Derek Lin <derek.lin2@hpe.com> Reviewed-by: Samer El-Haj-Mahmoud <elhaj@hpe.com> Reviewed-by: Star Zeng <star.zeng@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18654 6f19259b-4bc3-4df7-8a09-765794883524
Qiu Shumin [Fri, 23 Oct 2015 02:03:20 +0000 (02:03 +0000)]
ShellPkg: Follow spec to remove the last '\' char in return name of GetCurDir().
In Shell spec 2.1 the return name of EFI_SHELL_PROTOCOL.GetCurDir() is defined as 'fs0:\current-dir' while in current implementation it's 'fs0:\current-dir\'.
To follow spec the patch removed the redundant '\' char.
Since it has been broken for a long time, some codes may depend on the broken behavior.
After this change 'EFI_SHELL_PROTOCOL.GetCurDir()' and 'UefiShellLib.ShellGetCurrentDir()'
will return a current directory string without tailing '\' (fs0:\current-dir), the value of Shell environment variable 'cwd' will become 'fs0:\current-dir' as well.
This patch has updated all the code in EDKII to make them depend on the new behavior.
Developers should check whether 'GetCurDir()' and 'ShellGetCurrentDir' are used in their source code.
Jordan Justen [Thu, 22 Oct 2015 06:01:02 +0000 (06:01 +0000)]
BaseTools/Scripts: Add PatchCheck.py script
This script can be used to check some expected rules for EDK II
patches. It only works on git formatted patches.
It checks both the commit message and the lines that are added in the
patch diff.
In the commit message it verifies line lengths, signature formats, and
the Contributed-under tag.
In the patch, it checks that line endings are CRLF for all files that
don't have a .sh extension. It verifies that no trailing whitespace is
present and that tab characters are not used.
Patch contributors should use this script prior to submitting their
patches. Package maintainers can also use it to verify incoming
patches.
It can also be run by specifying a git revision list, so actual patch
files are not always required.
For example, to checkout this last 5 patches in your git branch you
can run:
python PatchCheck.py HEAD~5..
Or, a shortcut (like git log):
python PatchCheck.py -5
The --oneline option works similar to git log --oneline.
Empty cdroms are not going to connect, avoid waiting for the backend to
switch to state 4, which is never going to happen, and return
error instead from XenPvBlockFrontInitialization(). Detect an
empty cdrom by looking at the "params" node on xenstore, which is set to
"" or "aio:" for empty drives by libxl.
Eric Dong [Wed, 21 Oct 2015 06:10:57 +0000 (06:10 +0000)]
MdeModulePkg SetupBrowserDxe: Save global variable values before nest function called.
The SendForm function can be called nest in it. This function also uses some global variables. So we must save global variable values before it been called again.
Old implementation miss to save some global variables, this patch fixed it.
Daryl McDaniel [Mon, 19 Oct 2015 21:39:46 +0000 (21:39 +0000)]
AppPkg: Add switch to cause stderr to be aliased to stdout.
Python, as distributed, sends its prompts and other interactive output
to stderr, which uses the platforms STDERR device for output. If STDERR output
is not visible, it may appear that Python has hung. Several people have
reported problems on platforms that don't enable STDERR. These include
platforms without a Setup utility and those without Setup options for STDERR.
This patch adds a command-line switch, -#, to Python. If this switch
is present, stderr will be aliased to stdout.
AppPkg/Applications/Python/PyMod-2.7.2/Modules/main.c: New file, modified
version of AppPkg/Applications/Python/Python-2.7.2/Modules/main.c. Add the -#
option which causes stderr to be aliased to stdout. Add a description of this
switch to the Help output.
AppPkg/Applications/Python/PythonCore.inf: Reference main.c from PyMod-2.7.2
instead of from Python-2.7.2 so that the modified version is used.
Michael Kinney [Mon, 19 Oct 2015 19:13:31 +0000 (19:13 +0000)]
UefiCpuPkg: Add PiSmmCpuDxeSmm module X64 files
Add module that initializes a CPU for the SMM environment and
installs the first level SMI handler. This module along with the
SMM IPL and SMM Core provide the services required for
DXE_SMM_DRIVERS to register hardware and software SMI handlers.
CPU specific features are abstracted through the SmmCpuFeaturesLib
Platform specific features are abstracted through the
SmmCpuPlatformHookLib
Several PCDs are added to enable/disable features and configure
settings for the PiSmmCpuDxeSmm module
[jeff.fan@intel.com: Fix code style issues reported by ECC]
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Michael Kinney <michael.d.kinney@intel.com> Reviewed-by: Jeff Fan <jeff.fan@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18647 6f19259b-4bc3-4df7-8a09-765794883524
Michael Kinney [Mon, 19 Oct 2015 19:13:13 +0000 (19:13 +0000)]
UefiCpuPkg: Add PiSmmCpuDxeSmm module IA32 files
Add module that initializes a CPU for the SMM environment and
installs the first level SMI handler. This module along with the
SMM IPL and SMM Core provide the services required for
DXE_SMM_DRIVERS to register hardware and software SMI handlers.
CPU specific features are abstracted through the SmmCpuFeaturesLib
Platform specific features are abstracted through the
SmmCpuPlatformHookLib
Several PCDs are added to enable/disable features and configure
settings for the PiSmmCpuDxeSmm module
[jeff.fan@intel.com: Fix code style issues reported by ECC]
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Michael Kinney <michael.d.kinney@intel.com> Reviewed-by: Jeff Fan <jeff.fan@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18646 6f19259b-4bc3-4df7-8a09-765794883524
Michael Kinney [Mon, 19 Oct 2015 19:12:53 +0000 (19:12 +0000)]
UefiCpuPkg: Add PiSmmCpuDxeSmm module no IA32/X64 files
Add module that initializes a CPU for the SMM environment and
installs the first level SMI handler. This module along with the
SMM IPL and SMM Core provide the services required for
DXE_SMM_DRIVERS to register hardware and software SMI handlers.
CPU specific features are abstracted through the SmmCpuFeaturesLib
Platform specific features are abstracted through the
SmmCpuPlatformHookLib
Several PCDs are added to enable/disable features and configure
settings for the PiSmmCpuDxeSmm module
Changes between [PATCH v1] and [PATCH v2]:
1) Swap PTE init order for QEMU compatibility.
Current PTE initialization algorithm works on HW but breaks QEMU
emulator. Update the PTE initialization order to be compatible
with both.
2) Update comment block that describes 32KB SMBASE alignment requirement
to match contents of Intel(R) 64 and IA-32 Architectures Software
Developer's Manual
3) Remove BUGBUG comment and call to ClearSmi() that is not required.
SMI should be cleared by root SMI handler.
[jeff.fan@intel.com: Fix code style issues reported by ECC]
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Michael Kinney <michael.d.kinney@intel.com> Cc: Laszlo Ersek <lersek@redhat.com> Cc: Paolo Bonzini <pbonzini@redhat.com>
[pbonzini@redhat.com: InitPaging: prepare PT before filling in PDE]
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Acked-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Jeff Fan <jeff.fan@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18645 6f19259b-4bc3-4df7-8a09-765794883524
Michael Kinney [Mon, 19 Oct 2015 19:12:04 +0000 (19:12 +0000)]
UefiCpuPkg: Add ACPI CPU Data include file
Add AcpuCpuData.h that defines a data structure that is shared between
modules and is required for ACPI S3 support.
APState field removed between V1 and V2 patch.
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Michael Kinney <michael.d.kinney@intel.com> Cc: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Jeff Fan <jeff.fan@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18642 6f19259b-4bc3-4df7-8a09-765794883524
Michael Kinney [Mon, 19 Oct 2015 19:11:15 +0000 (19:11 +0000)]
UefiCpuPkg: Add SmmCpuPlatformHookLib
Add SmmCpuPlatformHookLib that provides platform specific functions
that are used to initialize SMM and process SMIs. A Null instance
of this library is provided that should work for most platforms.
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Michael Kinney <michael.d.kinney@intel.com> Reviewed-by: Jeff Fan <jeff.fan@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18639 6f19259b-4bc3-4df7-8a09-765794883524
Michael Kinney [Mon, 19 Oct 2015 19:10:53 +0000 (19:10 +0000)]
UefiCpuPkg: Add SmmCpuFeaturesLib
Add SmmCpuFeaturesLib that provides CPU specific functions that are
used to initialize SMM and process SMIs. A functional implementation
of this library class is provided that is based on the
Intel(R) 64 and IA-32 Architectures Software Developer's Manual
[jeff.fan@intel.com: Fix code style issues reported by ECC]
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Michael Kinney <michael.d.kinney@intel.com> Reviewed-by: Jeff Fan <jeff.fan@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18638 6f19259b-4bc3-4df7-8a09-765794883524
Michael Kinney [Mon, 19 Oct 2015 19:10:32 +0000 (19:10 +0000)]
UefiCpuPkg: Add SecCore module and supporting library class and PCD
Add declaration of PlatformSecLib library class to DEC file
Add declaration of PcdPeiTemporaryRamStackSize PCD to DEC/UNI file
Add build of PlatformSecLibNull to DSC file
Add build of SecCore to DSC file
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Michael Kinney <michael.d.kinney@intel.com> Reviewed-by: Jeff Fan <jeff.fan@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18637 6f19259b-4bc3-4df7-8a09-765794883524
Michael Kinney [Mon, 19 Oct 2015 19:10:14 +0000 (19:10 +0000)]
UefiCpuPkg: Add SecCore module
Add SecCore module that uses the PlatformSecLib class for platform
specific actions. The SecCore module also uses a new PCD to
configure the size of the stack used in the SEC phase. If the
stack size PCD is set to 0, the stack is configured to use half
of the available temporary RAM.
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Michael Kinney <michael.d.kinney@intel.com> Reviewed-by: Jeff Fan <jeff.fan@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18636 6f19259b-4bc3-4df7-8a09-765794883524
Michael Kinney [Mon, 19 Oct 2015 19:09:56 +0000 (19:09 +0000)]
UefiCpuPkg: Add PlatformSecLib
Add PlatformSecLib class and PlatformSecLibNull instance
that is used by the SecCore. PlatformSecLibNull should
not be used in a platform build. Instead, it should be
used as a template for implementing a platform specific
instance of the PlatformSecLib library class.
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Michael Kinney <michael.d.kinney@intel.com> Reviewed-by: Jeff Fan <jeff.fan@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18635 6f19259b-4bc3-4df7-8a09-765794883524
Laszlo Ersek [Mon, 19 Oct 2015 19:08:47 +0000 (19:08 +0000)]
UefiCpuPkg: CpuDxe: broadcast MTRR changes to APs
The Quark_EDKII_v1.1.0/IA32FamilyCpuBasePkg/CpuArchDxe
driver applies any MTRR changes to APs, if the
EFI_MP_SERVICES_PROTOCOL is available. We should do the same.
Additionally, the broadcast should occur at MP startup as well,
not only when MTRR settings are changed. The inspiration is
taken from
Quark_EDKII_v1.1.0/IA32FamilyCpuBasePkg/CpuMpDxe/
(see the EarlyMpInit() function and its call sites in
"ProcessorConfig.c").
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Jeff Fan <jeff.fan@intel.com> Reviewed-by: Michael Kinney <michael.d.kinney@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18632 6f19259b-4bc3-4df7-8a09-765794883524
Michael Kinney [Mon, 19 Oct 2015 19:08:28 +0000 (19:08 +0000)]
UefiCpuPkg: CpuDxe: Wait for APs to enter idle loop
Address a race condition in first call to StartupAllAPs() with
SingleThread set to TRUE in the MP initialization. If the APs
have not entered their idle loop before StartupAllAPs() is called,
then some of the APs will be in an unexpected state, and
StartupAllAPs() will hang. This is the hang condition that is
only seen when SingleThread parameter is set to TRUE and
StartupAllAPs() is called very shortly after mAPsAlreadyInitFinished
is set to TRUE that releases the APs to complete their initialization.
An internal function has been added to check if all APs are in the
sleeping state in their idle loop. On the first call to
StartupAllAPs(), this internal function is used in a loop to make
sure the APs are in a state that is compatible with the use of
StartupAllAPs(). PcdCpuApInitTimeOutInMicroSeconds is used as the
maximum wait time for the APs to enter their idle loop. If all
APs have not entered their idle loop within the timeout, then
an ASSERT() is generated.
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Michael Kinney <michael.d.kinney@intel.com> Cc: Jeff Fan <jeff.fan@intel.com> Cc: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Jeff Fan <jeff.fan@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18631 6f19259b-4bc3-4df7-8a09-765794883524
Jeremy Linton [Mon, 19 Oct 2015 15:14:13 +0000 (15:14 +0000)]
Update the ACPI device information for ARM Juno.
These patches correct a number of problems with the JUNO ACPI tables.
First, put CCA attributes on the devices which can do DMA. This is
because the linux kernel now requires ARM64 devices specify a coherency
model. Without CCA the devices are unable to perform DMA.
Update the EHCI window to a full 64k as documented in the
Juno Platform SoC TRM. This makes it match the values used in some
other places.
Finally, add some _DSD entries for the SMSC ethernet chip.
The latter changes are required for the mainline kernels to use the adapter.
Star Zeng [Mon, 19 Oct 2015 06:41:28 +0000 (06:41 +0000)]
MdeModulePkg VarCheckLib: R18611 was thoughtless for property set
R18611 only updated the logic to return correct property
when no property set to variable with wildcard name.
But VariablePropertySet needs the pointer of property data for set.
So roll back the change in VariablePropertyGetWithWildcardName at R18611,
and check the property revision first in VariablePropertyGet and
SetVariableCheck before using the property data.
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@18626 6f19259b-4bc3-4df7-8a09-765794883524
Laszlo Ersek [Fri, 16 Oct 2015 19:52:24 +0000 (19:52 +0000)]
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
Laszlo Ersek [Fri, 16 Oct 2015 19:52:18 +0000 (19:52 +0000)]
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
Michael Kinney [Fri, 16 Oct 2015 16:48:24 +0000 (16:48 +0000)]
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 6d72ff7d9daf) 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.
Laszlo Ersek [Fri, 16 Oct 2015 15:46:37 +0000 (15:46 +0000)]
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
Laszlo Ersek [Fri, 16 Oct 2015 15:46:32 +0000 (15:46 +0000)]
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
Laszlo Ersek [Fri, 16 Oct 2015 15:46:28 +0000 (15:46 +0000)]
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
Mark Rutland [Fri, 16 Oct 2015 15:23:46 +0000 (15:23 +0000)]
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.
Fu Siyuan [Fri, 16 Oct 2015 07:18:51 +0000 (07:18 +0000)]
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
Fu Siyuan [Fri, 16 Oct 2015 07:18:38 +0000 (07:18 +0000)]
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
Star Zeng [Fri, 16 Oct 2015 01:46:19 +0000 (01:46 +0000)]
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
Star Zeng [Fri, 16 Oct 2015 01:31:56 +0000 (01:31 +0000)]
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
Fu Siyuan [Thu, 15 Oct 2015 06:42:50 +0000 (06:42 +0000)]
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
Qiu Shumin [Thu, 15 Oct 2015 02:43:31 +0000 (02:43 +0000)]
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.
Eric Dong [Thu, 15 Oct 2015 01:03:47 +0000 (01:03 +0000)]
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.
Eric Dong [Thu, 15 Oct 2015 00:57:45 +0000 (00:57 +0000)]
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
Eric Dong [Thu, 15 Oct 2015 00:57:20 +0000 (00:57 +0000)]
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.
Eric Dong [Thu, 15 Oct 2015 00:56:41 +0000 (00:56 +0000)]
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
Star Zeng [Sat, 10 Oct 2015 02:53:41 +0000 (02:53 +0000)]
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
Qiu Shumin [Sat, 10 Oct 2015 01:19:43 +0000 (01:19 +0000)]
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.
Ard Biesheuvel [Fri, 9 Oct 2015 18:55:41 +0000 (18:55 +0000)]
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.
Ard Biesheuvel [Fri, 9 Oct 2015 18:55:28 +0000 (18:55 +0000)]
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.
Hao Wu [Fri, 9 Oct 2015 07:04:00 +0000 (07:04 +0000)]
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
Hao Wu [Fri, 9 Oct 2015 07:03:24 +0000 (07:03 +0000)]
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
Thomas Palmer [Fri, 9 Oct 2015 06:03:26 +0000 (06:03 +0000)]
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
Thomas Palmer [Fri, 9 Oct 2015 06:03:17 +0000 (06:03 +0000)]
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
Ard Biesheuvel [Thu, 8 Oct 2015 18:52:16 +0000 (18:52 +0000)]
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.
Ard Biesheuvel [Thu, 8 Oct 2015 18:52:06 +0000 (18:52 +0000)]
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.
Ard Biesheuvel [Thu, 8 Oct 2015 18:51:56 +0000 (18:51 +0000)]
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.
Liming Gao [Thu, 8 Oct 2015 09:29:09 +0000 (09:29 +0000)]
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.
Li YangX [Thu, 8 Oct 2015 09:27:14 +0000 (09:27 +0000)]
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
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
DuetPkg: exit pci function loops early if device is not multi-function
When looping through all PCI functions, code should not look for functions
1-7 if function 0 is not present or if function 0 indicates the device is
not multifunction. Prior to this fix the code would use stale data in a
buffer to determine if a device is multifunction even if function 0 is not
present. This fixes a code bug and provides very small performance
improvements.
PCI 2.3 Specification states: They [multifunction devices] are also
required to always implement function 0 in the device. Implementing other
functions is optional and may be assigned in any order.
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Joseph Shifflett <joseph.shifflett@hpe.com> Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18575 6f19259b-4bc3-4df7-8a09-765794883524
MdeModulePkg: exit pci function loops early if device is not multi-function
When looping through all PCI functions, code should not look for functions
1-7 if function 0 is not present or if function 0 indicates the device is
not multifunction. Prior to this fix the code would use stale data in a
buffer to determine if a device is multifunction even if function 0 is not
present. This fixes a code bug and provides very small performance
improvements.
PCI 2.3 Specification states: They [multifunction devices] are also
required to always implement function 0 in the device. Implementing other
functions is optional and may be assigned in any order.
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Joseph Shifflett <joseph.shifflett@hpe.com> Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18574 6f19259b-4bc3-4df7-8a09-765794883524
Sudeep Holla [Tue, 6 Oct 2015 14:05:37 +0000 (14:05 +0000)]
ArmPlatformPkg/ArmJunoPkg/Madt.aslc: Fix MADT header version
Currently the MADT signature and revision is mapped to v1.0 macros
which results in MADT with incorrect entries in the header for Juno.
This patch fixes these EFI_ACPI_*_0_MULTIPLE_APIC_DESCRIPTION_TABLE
macros by using appropriate v5.0 versions.
Ard Biesheuvel [Tue, 6 Oct 2015 12:51:07 +0000 (12:51 +0000)]
ArmPkg/AArch64Mmu: remove cache maintenance for page tables
All our page tables are allocated from memory whose cacheability
attributes are inherited by the cacheability bits in the MMU control
register, so there is no need for explicit cache maintenance after
updating the page tables. And even if there were, Set/Way operations
are not appropriate anyway for ensuring that these changes make it to
main memory. So just remove the explicit cache maintenance completely.