Commit Graph

16984 Commits

Author SHA1 Message Date
Star Zeng 3c394a6775 MdeModulePkg SmbiosMeasurementDxe: Use SMBIOS table and GUID correctly
1. Smbios3Table used as SmbiosTable wrongly after SmbiosTable got from configuration table.
2. Use correct VendorGuid and VendorTable to measure.

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@18691 6f19259b-4bc3-4df7-8a09-765794883524
2015-10-29 01:10:18 +00:00
Michael Kinney d26a7a3fa2 UefiCpuPkg: SmmCpuFeaturesLib: Add MSR_SMM_FEATURE_CONTROL support
Add support for the reading and writing MSR_SMM_FEATURE_CONTROL
through the SmmCpuFeaturesIsSmmRegisterSupported(),
SmmCpuFeaturesGetSmmRegister(), and SmmCpuFeaturesSetSmmRegister()
functions.  This MSR is supported if the Family/Model is 06_3C,
06_45, or 06_46.

Cc: "Yao, Jiewen" <jiewen.yao@intel.com>
Cc: Jeff Fan <jeff.fan@intel.com>

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Michael Kinney <michael.d.kinney@intel.com>
Reviewed-by: "Yao, Jiewen" <jiewen.yao@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18690 6f19259b-4bc3-4df7-8a09-765794883524
2015-10-28 07:16:38 +00:00
Qiu Shumin c617380446 ShellPkg: Refine code by initializing local variable and adding ASSERT statement.
Add ASSERT statement and initialize local variable to make code more readable.

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@18689 6f19259b-4bc3-4df7-8a09-765794883524
2015-10-28 01:14:34 +00:00
Star Zeng ae658d9163 MdeModulePkg Variable: Move CacheVariable->InDeletedTransitionPtr NULL pointer check
This change is triggered by R18654 "Enhance variable performance by reading from existed memory cache"
that changed the code to use CacheVariable to improve performance.
So the CacheVariable->InDeletedTransitionPtr NULL pointer check needs to be moved to the place before
it is been used.

Cc: Shumin Qiu <shumin.qiu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Shumin Qiu <shumin.qiu@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18688 6f19259b-4bc3-4df7-8a09-765794883524
2015-10-28 00:48:43 +00:00
Yao, Jiewen 5b5e5674ae Publish FspHob to PEI Hob by default.
because most platforms use such logic.
PcdDataBaseHobGuid GuidHob is excluded because PCD database in FSP is different with the one in PEI.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: "Yao, Jiewen" <jiewen.yao@intel.com>
Reviewed-by: "Ma, Maurice" <maurice.ma@intel.com>
Reviewed-by: "Rangarajan, Ravi P" <ravi.p.rangarajan@intel.com>


git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18687 6f19259b-4bc3-4df7-8a09-765794883524
2015-10-27 23:10:49 +00:00
Michael Kinney 9838b0161d UefiCpuPkg: PiSmmCpuDxeSmm: Replace PcdSet## with PcdSet##S
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: "Yao, Jiewen" <jiewen.yao@intel.com>
Cc: Jeff Fan <jeff.fan@intel.com>

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@18686 6f19259b-4bc3-4df7-8a09-765794883524
2015-10-27 16:15:03 +00:00
Haojian Zhuang 7fe513896e MdePkg/BaseSynchronizationLib: fix AArch64 return values
Fix the wrong return value of both InternalSyncIncrement()
and InternalSyncDecrement(). The return value shouldn't
be the address of input parameter. It should be the updated
value of input parameter instead.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Haojian Zhuang <haojian.zhuang@linaro.org>
Reviewed-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@18685 6f19259b-4bc3-4df7-8a09-765794883524
2015-10-27 11:56:57 +00:00
Dandan Bi 8a4582838b MdeModulePkg:Add new API HiiGetFormSetFromHiiHandle into UefiHiiLib
This function is mainly through the Hii handle to get the formset opcode.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Dandan Bi <dandan.bi@intel.com>
Reviewed-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@18684 6f19259b-4bc3-4df7-8a09-765794883524
2015-10-27 10:19:29 +00:00
Tim He 8b7a63e7e2 Vlv2TbltDevicePkg: Sync the branch changes to trunk.
update some smbios string and macro name for MinnowBoard 
Turbot board.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Tim He <tim.he@intel.com>
Reviewed-by: David Wei <david.wei@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18682 6f19259b-4bc3-4df7-8a09-765794883524
2015-10-27 07:44:24 +00:00
Eric Dong b6f6125526 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.

Checked in the missing change for gBrowserFormSetList.

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@18681 6f19259b-4bc3-4df7-8a09-765794883524
2015-10-27 07:37:56 +00:00
Yao, Jiewen c00a0c8761 Move Smbios measurement from TCG driver to Smbios driver.
This is patch to add smbios measurement.

The problem of current SMBIOS measurement is:
1) TCG drivers do not support SMBIOS3.0 table.
2) TCG drivers do not follow TCG platform spec on: "Platform configuration information that is automatically updated,
 such as clock registers, and system unique information, such as asset numbers or serial numbers,
 MUST NOT be measured into PCR [1], or any other PCR."

So we decide to move Smbios measurement from TCG drivers to Smbios driver.

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


git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18680 6f19259b-4bc3-4df7-8a09-765794883524
2015-10-27 04:46:50 +00:00
Yao, Jiewen 03195ad324 Fix issue that calling GetS3MemoryInfo() with wrong order.
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: "Yao, Jiewen" <jiewen.yao@intel.com>
Reviewed-by: "Ma, Maurice" <maurice.ma@intel.com>
Reviewed-by: "Rangarajan, Ravi P" <ravi.p.rangarajan@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18679 6f19259b-4bc3-4df7-8a09-765794883524
2015-10-27 04:15:39 +00:00
Yao, Jiewen e620b72924 Do not deadloop if Microcode not found in FspTempRamInit.
We do not consider microcode not found as critical error, because Microcode might be applied later.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: "Yao, Jiewen" <jiewen.yao@intel.com>
Reviewed-by: "Ma, Maurice" <maurice.ma@intel.com>
Reviewed-by: "Rangarajan, Ravi P" <ravi.p.rangarajan@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18678 6f19259b-4bc3-4df7-8a09-765794883524
2015-10-27 04:00:08 +00:00
Yao, Jiewen d2de448338 Move Smbios measurement from TCG driver to Smbios driver.
This is patch to remove smbios measurement in TCG driver. There will be other patch to add it in Smbios driver.

The problem of current SMBIOS measurement is:
1) TCG drivers do not support SMBIOS3.0 table.
2) TCG drivers do not follow TCG platform spec on: "Platform configuration information that is automatically updated,
 such as clock registers, and system unique information, such as asset numbers or serial numbers,
 MUST NOT be measured into PCR [1], or any other PCR."

So we decide to move Smbios measurement from TCG drivers to Smbios driver.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: "Yao, Jiewen" <jiewen.yao@intel.com>
Reviewed-by: "Zhang, Chao B" <chao.b.zhang@intel.com>


git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18677 6f19259b-4bc3-4df7-8a09-765794883524
2015-10-27 03:54:08 +00:00
Yao, Jiewen c41eeb447d Add suppressif around TCG hash seleciton checkbox in TCG2
Previous TCG2 configuration UI always add all TCG defined hash algorithm to let user select which one need be used.
This brings risk that user might select unsupported hash, and selection is rejected later.
So we enhance to UI to hide unsupported hash algorithm.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: "Yao, Jiewen" <jiewen.yao@intel.com>
Reviewed-by: "Zhang, Chao B" <chao.b.zhang@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18676 6f19259b-4bc3-4df7-8a09-765794883524
2015-10-27 03:49:31 +00:00
Yonghong Zhu 7919244076 BaseTools:remove the redundant directories for '-f' with absolute path.
when the absolute path is given to '-f', it would create some redundant
empty directories.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com>
Reviewed-by: Hao Wu <hao.a.wu@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18675 6f19259b-4bc3-4df7-8a09-765794883524
2015-10-27 03:29:50 +00:00
Yao, Jiewen 7254d13470 Move Smbios table MAX length definition to Mde header filer.
So that other module can also refer to them.

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

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18674 6f19259b-4bc3-4df7-8a09-765794883524
2015-10-27 02:43:39 +00:00
Michael Kinney f40577c356 UefiCpuPkg: PiSmmCpuDxeSmm: Remove unused references to SmmLib
The PiSmmCpuDxeSmm module does not use any services from the SmmLib.
This change removes the SmmLib from PiSmmCpuDxeSmm module and also
removes the lib mapping in the UefiCpuPkg DSC file because no other
modules in the UefiCpuPkg use the SmmLib.

Removal of SmmLib is now possible because the only API call to it,
ClearSmi(), was ultimately removed from PiSmmCpuDxeSmm -- see the
"BUGBUG" comment in git commit 529a5a86.

Cc: "Yao, Jiewen" <jiewen.yao@intel.com>
Cc: Jeff Fan <jeff.fan@intel.com>

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Michael Kinney <michael.d.kinney@intel.com>
Reviewed-by: "Yao, Jiewen" <jiewen.yao@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18673 6f19259b-4bc3-4df7-8a09-765794883524
2015-10-26 16:40:52 +00:00
Laszlo Ersek 0f2eb31c76 OvmfPkg: QemuFlashFvbServicesRuntimeDxe: clean up includes and libraries
Before introducing the SMM driver interface, clean up #include directives
and [LibraryClasses] by:
- removing what's not directly used (HobLib and UefiLib),
- adding what's used but not spelled out (DevicePathLib),
- sorting the result.

This helps with seeing each source file's dependencies and with
determining the library classes for the SMM driver.

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@18672 6f19259b-4bc3-4df7-8a09-765794883524
2015-10-26 14:58:46 +00:00
Laszlo Ersek 1767877a31 OvmfPkg: QemuFlashFvbServicesRuntimeDxe: split out runtime DXE specifics
In preparation for introducing an SMM interface to this driver, move the
following traits to separate files, so that we can replace them in the new
SMM INF file:

- Protocol installations. The SMM driver will install protocol interfaces
  in the SMM protocol database, using SMM services.

- Virtual address change handler and pointer conversions. SMM drivers run
  with physical mappings and pointers must not be converted.

There are further restrictions and changes for an SMM driver, but the rest
of the code either complies with those already, or will handle the changes
transparently. For example:

- SMM drivers have access to both UEFI and SMM protocols in their entry
  points (see the PI spec 1.4, "1.7 SMM Driver Initialization"),

- MemoryAllocationLib has an SMM instance that serves allocation requests
  with the gSmst->SmmAllocatePool() service transparently, allocating
  runtime-marked SMRAM.

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@18671 6f19259b-4bc3-4df7-8a09-765794883524
2015-10-26 14:58:39 +00:00
Laszlo Ersek 109301e5a1 OvmfPkg: QemuFlashFvbServicesRuntimeDxe: no dual addressing needed
Currently the EFI_FW_VOL_INSTANCE and ESAL_FWB_GLOBAL structures declare
the following entries as arrays, with two entries each:

- EFI_FW_VOL_INSTANCE.FvBase[2]
- ESAL_FWB_GLOBAL.FvInstance[2]

In every case, the entry at subscript zero is meant as "physical address",
while the entry at subscript one is meant as "virtual address" -- a
pointer to the same object. The virtual address entry is originally
initialized to the physical address, and then it is converted to the
virtual mapping in FvbVirtualddressChangeEvent().

Functions that (a) read the listed fields and (b) run both before and
after the virtual address change event -- since this is a runtime DXE
driver -- derive the correct array subscript by calling the
EfiGoneVirtual() function from UefiRuntimeLib.

The problem with the above infrastructure is that it's entirely
superfluous.

EfiGoneVirtual() "knows" whether EFI has gone virtual only because the
UefiRuntimeLib constructor registers the exact same kind of virtual
address change callback, and the callback flips a static variabe to TRUE,
and EfiGoneVirtual() queries that static variable.

In effect this means for QemuFlashFvbServicesRuntimeDxe: "when there is a
virtual address change, convert the entries with subscript one from
physical to virtual, and from then on use the entries with subscript one".

This would only make sense if QemuFlashFvbServicesRuntimeDxe ever needed
the original (physical) addresses (ie. the entries with subscript zero)
after the virtual address change, but that is not the case.

Replace the arrays with single elements. The subscript zero elements
simply disappear, and the single elements take the role of the prior
subscript one elements.

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@18670 6f19259b-4bc3-4df7-8a09-765794883524
2015-10-26 14:58:33 +00:00
Laszlo Ersek f97a5b5e4c 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.

Remove it.

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@18669 6f19259b-4bc3-4df7-8a09-765794883524
2015-10-26 14:58:26 +00:00
Laszlo Ersek a05aff5655 OvmfPkg: QemuFlashFvbServicesRuntimeDxe: remove FvbDevLock field
The EFI_FW_VOL_INSTANCE.FvbDevLock member is initialized and then never
used. Remove it.

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@18668 6f19259b-4bc3-4df7-8a09-765794883524
2015-10-26 14:58:20 +00:00
Laszlo Ersek 2ff2a0e1a8 OvmfPkg: QemuFlashFvbServicesRuntimeDxe: fix VALID_ARCHITECTURES in INF
We build this driver for X64 as well -- the comment isn't overly
important, but it shouldn't be misleading.

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@18667 6f19259b-4bc3-4df7-8a09-765794883524
2015-10-26 14:58:14 +00:00
Laszlo Ersek ea0d111efe 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.

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@18666 6f19259b-4bc3-4df7-8a09-765794883524
2015-10-26 14:58:08 +00:00
Laszlo Ersek 141f0c6445 OvmfPkg: QemuFlashFvbServicesRuntimeDxe: strip trailing whitespace
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@18665 6f19259b-4bc3-4df7-8a09-765794883524
2015-10-26 14:58:01 +00:00
Qiu Shumin 490ce43d92 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
2015-10-26 13:28:01 +00:00
Liming Gao c2305a4af8 BaseTools: Add MultipleWorkspace.py in the common dependency.
Add new added MultipleWorkspace.py in the common dependency to freeze
python tools for Windows.

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@18663 6f19259b-4bc3-4df7-8a09-765794883524
2015-10-26 08:48:39 +00:00
Sunny Wang 5d3a9896f0 MdeModulePkg: Make the BmFindLoadOption function public
Make the BmFindLoadOption function public

Contributed-under: TianoCore Contribution Agreement 1.0

Signed-off-by: Sunny Wang <sunnywang@hpe.com>
Reviewed-by: Samer El-Haj-Mahmoud <elhaj@hpe.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18662 6f19259b-4bc3-4df7-8a09-765794883524
2015-10-26 04:49:08 +00:00
Yonghong Zhu 7beed8a3da 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.

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@18661 6f19259b-4bc3-4df7-8a09-765794883524
2015-10-26 03:26:55 +00:00
Star Zeng 9382b53a23 MdePkg BaseExtractGuidedSectionLib: R15917 removed useful information wrongly
As the title, this patch is to add back the useful information.

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: Liming Gao <liming.gao@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18660 6f19259b-4bc3-4df7-8a09-765794883524
2015-10-26 02:00:58 +00:00
Tapan Shah 0a7102fa8e ShellPkg: Update 'tftp' command help output and error messages
Changing 'tftp' command's help output .uni file to match other EDK2 Shell commands as well as adjusting error messages text.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Tapan Shah <tapandshah@hpe.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>


git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18659 6f19259b-4bc3-4df7-8a09-765794883524
2015-10-23 20:13:44 +00:00
Ruiyu Ni fbe618a45e 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.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Feng Tian <feng.tian@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18658 6f19259b-4bc3-4df7-8a09-765794883524
2015-10-23 08:29:38 +00:00
Ruiyu Ni d4bf294e0e MdeModulePkg: Update UiApp to not display itself
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18657 6f19259b-4bc3-4df7-8a09-765794883524
2015-10-23 07:28:18 +00:00
Ruiyu Ni 26da0b64df MdeModulePkg: Update BootManagerMenuApp to not display itself
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18656 6f19259b-4bc3-4df7-8a09-765794883524
2015-10-23 07:26:58 +00:00
Shia Cinnamon 711ef3f624 MdePkg: Add a new DxeServicesLib GetFileDevicePathFromAnyFv () function
Contributed-under: TianoCore Contribution Agreement 1.0
From: Shia Cinnamon <cinnamon.shia@hpe.com>
Signed-off-by: Wang Nickle <nickle.wang@hpe.com>
Reviewed-by: Feng Tian <feng.tian@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18655 6f19259b-4bc3-4df7-8a09-765794883524
2015-10-23 05:53:08 +00:00
Derek Lin 9b18845a4b 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
2015-10-23 05:28:38 +00:00
Qiu Shumin fbd2dfadfe 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.

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@18653 6f19259b-4bc3-4df7-8a09-765794883524
2015-10-23 02:03:20 +00:00
Jordan Justen a7e173b07a 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.

The --silent option enables silent operation.

The script supports python 2.7 and python 3.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Cc: Erik Bjorge <erik.c.bjorge@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
Reviewed-by: Erik Bjorge <erik.c.bjorge@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18652 6f19259b-4bc3-4df7-8a09-765794883524
2015-10-22 06:01:02 +00:00
Stefano Stabellini 0f34a05110 OvmfPkg: XenPvBlkDxe: handle empty cdrom drives
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.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18651 6f19259b-4bc3-4df7-8a09-765794883524
2015-10-21 12:44:12 +00:00
Eric Dong f4c3c92396 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.

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@18650 6f19259b-4bc3-4df7-8a09-765794883524
2015-10-21 06:10:57 +00:00
Daryl McDaniel 47022e82e1 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.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Daryl McDaniel <edk2-lists@mc2research.org>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>


git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18649 6f19259b-4bc3-4df7-8a09-765794883524
2015-10-19 21:39:46 +00:00
Michael Kinney b7953e2646 UefiCpuPkg: Add PiSmmCpuDxeSmm module to DSC file
Add the PiSmmCpuDxeSmm module to the UefiCpuPkg DSC file along
with this modules dependent libraries.

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@18648 6f19259b-4bc3-4df7-8a09-765794883524
2015-10-19 19:13:45 +00:00
Michael Kinney 427e357342 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
2015-10-19 19:13:31 +00:00
Michael Kinney 7947da3ccc 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
2015-10-19 19:13:13 +00:00
Michael Kinney 529a5a8609 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
2015-10-19 19:12:53 +00:00
Michael Kinney 406c720054 UefiCpuPkg: Update DEC/DSC files for new includes and libraries
Add SmmCpuPlatformHookLib library class declaration
Add SmmCpuFeaturesLib library class declaration
Add gEfiSmmCpuServiceProtocolGuid protocol declaration
Build SmmCpuPlatformHookLibNull library instance
Build SmmCpuFeaturesLib library instance

Changes between [PATCH v1] and [PATCH v2]:
1) Use module type specific CpuExceptionHandlerLib in DSC file
   instead of Null library instance

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@18644 6f19259b-4bc3-4df7-8a09-765794883524
2015-10-19 19:12:32 +00:00
Michael Kinney a0fa23aab2 UefiCpuPkg: Add CPU Hot Plug Data include file
Add CpuHotPlugData.h that defines a data structure that is shared between
modules and is required for to support hot plug CPUs.

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@18643 6f19259b-4bc3-4df7-8a09-765794883524
2015-10-19 19:12:18 +00:00
Michael Kinney 1c27f926c1 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
2015-10-19 19:12:04 +00:00
Michael Kinney 70de765d90 UefiCpuPkg: Add SMRAM Save State include file
Add SmramSaveStateMap.h file that defines the 32-bit and 64-bit CPU
SMRAM Save State Map.

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@18641 6f19259b-4bc3-4df7-8a09-765794883524
2015-10-19 19:11:49 +00:00