mirror_edk2.git
7 years agoRemove unused [PcdsDynamic, PcdsDynamicEx] section.
Dong Guo [Mon, 31 Mar 2014 01:54:51 +0000 (01:54 +0000)]
Remove unused [PcdsDynamic, PcdsDynamicEx] section.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Dong Guo <guo.dong@intel.com>
Reviewed-by: Fan, Jeff <jeff.fan@intel.com>
Reviewed-by: Ni, Ruiyu <ruiyu.ni@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@15416 6f19259b-4bc3-4df7-8a09-765794883524

7 years agoCheck the input file pointer before use it.
Eric Dong [Fri, 28 Mar 2014 05:51:51 +0000 (05:51 +0000)]
Check the input file pointer before use it.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Eric Dong <eric.dong@intel.com>
Reviewed-by: Guo, Dong <guo.dong@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@15412 6f19259b-4bc3-4df7-8a09-765794883524

7 years agoAdd check to avoid null pointer deference.
Ruiyu Ni [Fri, 28 Mar 2014 02:50:47 +0000 (02:50 +0000)]
Add check to avoid null pointer deference.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Eric Dong <eric.dong@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@15410 6f19259b-4bc3-4df7-8a09-765794883524

7 years agoSecurityPkg Variable: Add NULL pointer check.
Star Zeng [Fri, 28 Mar 2014 02:47:46 +0000 (02:47 +0000)]
SecurityPkg Variable: Add NULL pointer check.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Guo Dong <guo.dong@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@15409 6f19259b-4bc3-4df7-8a09-765794883524

7 years agoAdd NULL pointer check in I2chost.
Elvin Li [Fri, 28 Mar 2014 02:34:31 +0000 (02:34 +0000)]
Add NULL pointer check in I2chost.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Elvin Li <elvin.li@intel.com>
Reviewed-by: Eric Dong <eric.dong@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@15408 6f19259b-4bc3-4df7-8a09-765794883524

7 years agoAdd ASSERT to check if NewVariable is NULL.
Elvin Li [Fri, 28 Mar 2014 02:13:41 +0000 (02:13 +0000)]
Add ASSERT to check if NewVariable is NULL.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Elvin Li <elvin.li@intel.com>
Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@15407 6f19259b-4bc3-4df7-8a09-765794883524

7 years agoShellPkg: Fix file system change issue that results in ASSERT
Chris Phillips [Thu, 27 Mar 2014 18:21:43 +0000 (18:21 +0000)]
ShellPkg: Fix file system change issue that results in ASSERT

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Chris Phillips <chrisp@hp.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@15406 6f19259b-4bc3-4df7-8a09-765794883524

7 years agoRemove hide TPM support.
Dong Guo [Thu, 27 Mar 2014 11:03:04 +0000 (11:03 +0000)]
Remove hide TPM support.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Dong Guo <guo.dong@intel.com>
Reviewed-by: Yao Jiewen <jiewen.yao@intel.com>
Reviewed-by: Ni, Ruiyu <ruiyu.ni@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@15405 6f19259b-4bc3-4df7-8a09-765794883524

7 years agoCalculate enough space for 2 variables (public key and variable data) instead of...
Dong Guo [Thu, 27 Mar 2014 10:54:23 +0000 (10:54 +0000)]
Calculate enough space for 2 variables (public key and variable data) instead of directly setting them 1 by 1.
Fixed a bug in public key reclaim().

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Dong Guo <guo.dong@intel.com>
Reviewed-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@15404 6f19259b-4bc3-4df7-8a09-765794883524

7 years agoUpdate code logic, remove ASSERT and use error handling.
Eric Dong [Thu, 27 Mar 2014 07:08:15 +0000 (07:08 +0000)]
Update code logic, remove ASSERT and use error handling.

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@15403 6f19259b-4bc3-4df7-8a09-765794883524

7 years agoNot to copy mailbox into new space when debug agent initialization for S3 Boot Script.
Jeff Fan [Thu, 27 Mar 2014 06:02:54 +0000 (06:02 +0000)]
Not to copy mailbox into new space when debug agent initialization for S3 Boot Script.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jeff Fan <jeff.fan@intel.com>
Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@15402 6f19259b-4bc3-4df7-8a09-765794883524

7 years agoRemove RT attribute for variable PlatDriOver.
Gao, Liming [Thu, 27 Mar 2014 05:11:02 +0000 (05:11 +0000)]
Remove RT attribute for variable PlatDriOver.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Gao, Liming <liming.gao@intel.com>
Reviewed-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@15401 6f19259b-4bc3-4df7-8a09-765794883524

7 years agoArmPkg/ArmCpuLib: Added A57 Errata 806969
Olivier Martin [Wed, 26 Mar 2014 19:35:17 +0000 (19:35 +0000)]
ArmPkg/ArmCpuLib: Added A57 Errata 806969

This rare errata only affects r0p0

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Olivier Martin <olivier.martin@arm.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@15400 6f19259b-4bc3-4df7-8a09-765794883524

7 years agoArmPkg/ArmLib: Correct Error Handling in AArch64
Olivier Martin [Wed, 26 Mar 2014 19:34:32 +0000 (19:34 +0000)]
ArmPkg/ArmLib: Correct Error Handling in AArch64

There are several instances of asserts which do not also handle
the error condition in Release builds.
Because these functions are called in different location of the
code and their parameters might change during the execution, it
is safer to handle the error.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Olivier Martin <olivier.martin@arm.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@15399 6f19259b-4bc3-4df7-8a09-765794883524

7 years agoArmPkg/ArmCortexA5xLib: Fixed setting of SMP bit
Olivier Martin [Wed, 26 Mar 2014 19:33:51 +0000 (19:33 +0000)]
ArmPkg/ArmCortexA5xLib: Fixed setting of SMP bit

On CortexA5x the SMP bit is BIT6 of CPUECTLR_EL1 register.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Olivier Martin <olivier.martin@arm.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@15398 6f19259b-4bc3-4df7-8a09-765794883524

7 years agoArmPkg/ArmCortexA5x: Declared the helper functions to access the CPU Extended Control...
Olivier Martin [Wed, 26 Mar 2014 19:32:48 +0000 (19:32 +0000)]
ArmPkg/ArmCortexA5x: Declared the helper functions to access the CPU Extended Control Register

This register is A5x specific. It is the reason why the code moved from ArmLib
to ArmCpuLib/ArmCortexA5xLib.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Olivier Martin <olivier.martin@arm.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@15397 6f19259b-4bc3-4df7-8a09-765794883524

7 years agoArmPkg/ArmLib: Added helper functions for accessing CPU ACTLR
Olivier Martin [Wed, 26 Mar 2014 19:31:01 +0000 (19:31 +0000)]
ArmPkg/ArmLib: Added helper functions for accessing CPU ACTLR

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Olivier Martin <olivier.martin@arm.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@15396 6f19259b-4bc3-4df7-8a09-765794883524

7 years agoArmPkg/Chipset: Added ARMv8 CPU's PartNum
Olivier Martin [Wed, 26 Mar 2014 19:29:31 +0000 (19:29 +0000)]
ArmPkg/Chipset: Added ARMv8 CPU's PartNum

PartNum is the field of MIDR that returns the CPU name.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Olivier Martin <olivier.martin@arm.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@15395 6f19259b-4bc3-4df7-8a09-765794883524

7 years agoArmPlatformPkg/ArmVExpressPkg: Add processor identifiers for Cortex A12/A7
Olivier Martin [Wed, 26 Mar 2014 19:28:35 +0000 (19:28 +0000)]
ArmPlatformPkg/ArmVExpressPkg: Add processor identifiers for Cortex A12/A7

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Olivier Martin <olivier.martin@arm.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@15394 6f19259b-4bc3-4df7-8a09-765794883524

7 years agoAdd check to make sure the data be valid.
Gao, Liming [Wed, 26 Mar 2014 09:27:01 +0000 (09:27 +0000)]
Add check to make sure the data be valid.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Gao, Liming <liming.gao@intel.com>
Reviewed-by: Zeng, Star <star.zeng@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@15393 6f19259b-4bc3-4df7-8a09-765794883524

7 years agoPerfomancePkg Dp: Add missing EFIAPI for PrintToken().
Star Zeng [Wed, 26 Mar 2014 07:08:12 +0000 (07:08 +0000)]
PerfomancePkg Dp: Add missing EFIAPI for PrintToken().

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@15392 6f19259b-4bc3-4df7-8a09-765794883524

7 years agoRemove RT attribute for variable LegacyDevOrder
Ruiyu Ni [Wed, 26 Mar 2014 04:23:48 +0000 (04:23 +0000)]
Remove RT attribute for variable LegacyDevOrder

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@15391 6f19259b-4bc3-4df7-8a09-765794883524

7 years agoArmPkg/SemihostFs: Various fixes for the file system
Harry Liebel [Tue, 25 Mar 2014 11:04:41 +0000 (11:04 +0000)]
ArmPkg/SemihostFs: Various fixes for the file system

- Fix file deletion from the shell.
- Fix file creation using the shell editor.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Harry Liebel <Harry.Liebel@arm.com>
Reviewed-by: Olivier Martin <olivier.martin@arm.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@15390 6f19259b-4bc3-4df7-8a09-765794883524

7 years agoArmPkg/SemihostLib: Made arguments 'native' size
Harry Liebel [Tue, 25 Mar 2014 11:03:54 +0000 (11:03 +0000)]
ArmPkg/SemihostLib: Made arguments 'native' size

The arguments passed to the semi-hosing backend should
be of 'native' size to match register widths.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Harry Liebel <Harry.Liebel@arm.com>
Reviewed-by: Olivier Martin <olivier.martin@arm.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@15389 6f19259b-4bc3-4df7-8a09-765794883524

7 years agoMdeModulePkg/SecurityPkg Variable: Calculate enough space for PlatformLang and Lang...
Star Zeng [Tue, 25 Mar 2014 06:56:55 +0000 (06:56 +0000)]
MdeModulePkg/SecurityPkg Variable: Calculate enough space for PlatformLang and Lang variables and use PcdUefiVariableDefaultLangDeprecate to turn off auto update between PlatformLang and Lang variables.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
Reviewed-by: Guo Dong <guo.dong@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@15388 6f19259b-4bc3-4df7-8a09-765794883524

7 years agoSupport load 64 bit image from 32 bit core.
Eric Dong [Tue, 25 Mar 2014 05:04:21 +0000 (05:04 +0000)]
Support load 64 bit image from 32 bit core.
Add more enhancement to check invalid PE format.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Eric Dong <eric.dong@intel.com>
Reviewed-by: Jiewen, Yao <jiewen.yao@intel.com>
Reviewed-by: Liming, Gao <liming.gao@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@15387 6f19259b-4bc3-4df7-8a09-765794883524

7 years agoReport the setting variable failure to platform through the status code when core...
Ruiyu Ni [Tue, 25 Mar 2014 03:54:34 +0000 (03:54 +0000)]
Report the setting variable failure to platform through the status code when core cannot handle the error.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Elvin Li <elvin.li@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@15386 6f19259b-4bc3-4df7-8a09-765794883524

7 years agoReport the setting variable failure to platform through the status code when core...
Ruiyu Ni [Tue, 25 Mar 2014 02:38:54 +0000 (02:38 +0000)]
Report the setting variable failure to platform through the status code when core cannot handle the error.

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@15385 6f19259b-4bc3-4df7-8a09-765794883524

7 years agoArmPkg/CompilerIntrinsicsLib: Added memset() to AArch64
Olivier Martin [Mon, 24 Mar 2014 15:30:48 +0000 (15:30 +0000)]
ArmPkg/CompilerIntrinsicsLib: Added memset() to AArch64

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Olivier Martin <olivier.martin@arm.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@15384 6f19259b-4bc3-4df7-8a09-765794883524

7 years agoEmbeddedPkg: Added Isp1761UsbDxe to EmbeddedPkg.dsc
Olivier Martin [Mon, 24 Mar 2014 15:29:50 +0000 (15:29 +0000)]
EmbeddedPkg: Added Isp1761UsbDxe to EmbeddedPkg.dsc

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Olivier Martin <olivier.martin@arm.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@15383 6f19259b-4bc3-4df7-8a09-765794883524

7 years agoArmPkg/ArmLib: Removed unused AArch64 files
Olivier Martin [Mon, 24 Mar 2014 15:29:03 +0000 (15:29 +0000)]
ArmPkg/ArmLib: Removed unused AArch64 files

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Olivier Martin <olivier.martin@arm.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@15382 6f19259b-4bc3-4df7-8a09-765794883524

7 years agoArmPkg/ArmLib: Renamed Cp15CacheInfo into ArmCacheInfo
Olivier Martin [Mon, 24 Mar 2014 15:26:22 +0000 (15:26 +0000)]
ArmPkg/ArmLib: Renamed Cp15CacheInfo into ArmCacheInfo

CTR (Cache Type Register) has the same format on ARMv7 and AArch64.
Renaming Cp15CacheInfo() into ArmCacheInfo() makes this function
architecture independent.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Olivier Martin <olivier.martin@arm.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@15381 6f19259b-4bc3-4df7-8a09-765794883524

7 years agoArmPkg/ArmLib: Removed unused ArmSwitchProcessorMode & ArmProcessorMode functions
Olivier Martin [Mon, 24 Mar 2014 15:25:44 +0000 (15:25 +0000)]
ArmPkg/ArmLib: Removed unused ArmSwitchProcessorMode & ArmProcessorMode functions

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Olivier Martin <olivier.martin@arm.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@15380 6f19259b-4bc3-4df7-8a09-765794883524

7 years agoArmPkg: Removed unused header files from source files
Olivier Martin [Mon, 24 Mar 2014 15:25:01 +0000 (15:25 +0000)]
ArmPkg: Removed unused header files from source files

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Olivier Martin <olivier.martin@arm.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@15379 6f19259b-4bc3-4df7-8a09-765794883524

7 years agoArmPkg: Fix typo in comment and trailing spaces
Olivier Martin [Mon, 24 Mar 2014 15:24:23 +0000 (15:24 +0000)]
ArmPkg: Fix typo in comment and trailing spaces

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Olivier Martin <olivier.martin@arm.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@15378 6f19259b-4bc3-4df7-8a09-765794883524

7 years agoComment PwdCredential driver.
Dong Guo [Sun, 23 Mar 2014 23:47:18 +0000 (23:47 +0000)]
Comment PwdCredential driver.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Dong Guo <guo.dong@intel.com>
Reviewed-by: Yao Jiewen <jiewen.yao@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@15376 6f19259b-4bc3-4df7-8a09-765794883524

7 years agoOvmfPkg: PlatformDxe: connect RouteConfig() to platform data
Laszlo Ersek [Sat, 22 Mar 2014 07:14:09 +0000 (07:14 +0000)]
OvmfPkg: PlatformDxe: connect RouteConfig() to platform data

Establish the full stack of conversions when modifying the platform
configuration:

       ConfigResp            -- form engine / HII communication
            |
     [ConfigToBlock]
            |
            v
     MAIN_FORM_STATE         -- binary representation of form/widget state
            |
[FormStateToPlatformConfig]
            |
            v
     PLATFORM_CONFIG         -- accessible to DXE and UEFI drivers
            |
   [PlatformConfigSave]
            |
            v
  UEFI non-volatile variable -- accessible to external utilities

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@15375 6f19259b-4bc3-4df7-8a09-765794883524

7 years agoOvmfPkg: PlatformDxe: connect ExtractConfig() to platform data
Laszlo Ersek [Sat, 22 Mar 2014 07:14:03 +0000 (07:14 +0000)]
OvmfPkg: PlatformDxe: connect ExtractConfig() to platform data

Establish the full stack of conversions in retrieving the platform
configuration:

    MultiConfigAltResp       -- form engine / HII communication
            ^
            |
     [BlockToConfig]
            |
     MAIN_FORM_STATE         -- binary representation of form/widget state
            ^
            |
[PlatformConfigToFormState]
            |
     PLATFORM_CONFIG         -- accessible to DXE and UEFI drivers
            ^
            |
   [PlatformConfigLoad]
            |
  UEFI non-volatile variable -- accessible to external utilities

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@15374 6f19259b-4bc3-4df7-8a09-765794883524

7 years agoOvmfPkg: PlatformDxe: add save and discard buttons to the form
Laszlo Ersek [Sat, 22 Mar 2014 07:13:57 +0000 (07:13 +0000)]
OvmfPkg: PlatformDxe: add save and discard buttons to the form

The RouteConfig() function is also called now as expected.

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@15373 6f19259b-4bc3-4df7-8a09-765794883524

7 years agoOvmfPkg: PlatformDxe: get available resolutions from GOP
Laszlo Ersek [Sat, 22 Mar 2014 07:13:50 +0000 (07:13 +0000)]
OvmfPkg: PlatformDxe: get available resolutions from GOP

Generate the options for the drop-down list from the GOP resolutions.

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@15372 6f19259b-4bc3-4df7-8a09-765794883524

7 years agoOvmfPkg: QemuVideoDxe: serialize Start() against callbacks
Laszlo Ersek [Sat, 22 Mar 2014 07:13:44 +0000 (07:13 +0000)]
OvmfPkg: QemuVideoDxe: serialize Start() against callbacks

If Start() succeeds, the callback is only executed when the setup is
complete (on the stack of RestoreTPL()), rather than on the stack of
InstallMultipleProtocolInterfaces(), when the driver setup may yet be
theoretically incomplete.

If Start() fails, the protocol interface will have been uninstalled
(rolled back) by the time the callback runs (again, on the stack of
RestoreTPL()). Since protocol notification callbacks begin with locating
the protocol interface in question, such attempts to locate will fail
immediately and save some work in the callback.

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@15371 6f19259b-4bc3-4df7-8a09-765794883524

7 years agoOvmfPkg/PlatformDxe: Silence warning seen with GCC48 IA32
Jordan Justen [Sat, 22 Mar 2014 07:13:38 +0000 (07:13 +0000)]
OvmfPkg/PlatformDxe: Silence warning seen with GCC48 IA32

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@15370 6f19259b-4bc3-4df7-8a09-765794883524

7 years agoOvmfPkg: PlatformDxe: add form widgets for video modes
Laszlo Ersek [Sat, 22 Mar 2014 07:13:31 +0000 (07:13 +0000)]
OvmfPkg: PlatformDxe: add form widgets for video modes

In this patch we populate the form with the two widgets related to video
resolution:
- A read-only string field displaying the preference for the next boot.
- A drop-down list offering choices for changing the setting. This list is
  implemented with dynamically generated IFR opcodes.

(In general, the current preference may be missing, or it may be invalid
for the available video RAM size. The list of possible new settings is
filtered with the video RAM size.)

Because the form now becomes able to receive input, we must also implement
ExtractConfig(). This function tells the HII engine about the state of the
widgets.

For now we set up both widgets with static data only:
- The current preference always says "Unset". The driver code is still
  isolated from the backend (the UEFI variable store).
- The list of possible resolutions offers 800x600 only. We don't
  interrogate the GOP yet.

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@15369 6f19259b-4bc3-4df7-8a09-765794883524

7 years agoOvmfPkg: PlatformDxe: introduce state for the main form
Laszlo Ersek [Sat, 22 Mar 2014 07:13:24 +0000 (07:13 +0000)]
OvmfPkg: PlatformDxe: introduce state for the main form

We'll need a C language (ie. structure) representation for the state of
the visual elements on the form. We choose the Buffer Storage kind (see
29.2.5.6 "Storage" in UEFI 2.4A), because it's easy to work with.

Note that the structure added in this patch has nothing to do with UEFI
non-volatile variables.

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@15368 6f19259b-4bc3-4df7-8a09-765794883524

7 years agoOvmfPkg: PlatformDxe: add an empty HII form
Laszlo Ersek [Sat, 22 Mar 2014 07:13:18 +0000 (07:13 +0000)]
OvmfPkg: PlatformDxe: add an empty HII form

... which opens from the Device Manager window.

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@15367 6f19259b-4bc3-4df7-8a09-765794883524

7 years agoOvmfPkg: PlatformDxe: set preferred video resolution from platform config
Laszlo Ersek [Sat, 22 Mar 2014 07:13:09 +0000 (07:13 +0000)]
OvmfPkg: PlatformDxe: set preferred video resolution from platform config

The GraphicsConsoleDxe driver (in MdeModulePkg/Universal/Console)
determines the preferred video resolution from the dynamic PCDs
- gEfiMdeModulePkgTokenSpaceGuid.PcdVideoHorizontalResolution
- gEfiMdeModulePkgTokenSpaceGuid.PcdVideoVerticalResolution

Setting the graphics resolution during boot is useful when the guest OS
(for lack of a dedicated display driver) continues to work with the
original GOP resolution and framebuffer.

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@15366 6f19259b-4bc3-4df7-8a09-765794883524

7 years agoOvmfPkg: PlatformDxe: utility functions for saving / loading configuration
Laszlo Ersek [Sat, 22 Mar 2014 07:13:02 +0000 (07:13 +0000)]
OvmfPkg: PlatformDxe: utility functions for saving / loading configuration

The two functions introduced here allow the saving and loading of platform
configuration to/from the non-volatile variable store.

The PLATFORM_CONFIG structure and the two functions that take it / return
it are generally meant for any DXE or UEFI driver that needs to access
platform configuration. For now we keep this small "library" internal to
PlatformDxe.

The PLATFORM_CONFIG wire format is intended only to grow over time (as
long as the variable GUID remains unchanged). At the introduction of new
fields, new feature flags must be added, and recognized in
PlatformConfigLoad().

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@15365 6f19259b-4bc3-4df7-8a09-765794883524

7 years agoOvmfPkg: introduce empty PlatformDxe
Laszlo Ersek [Sat, 22 Mar 2014 07:12:55 +0000 (07:12 +0000)]
OvmfPkg: introduce empty PlatformDxe

This DXE driver will load/save persistent values for OVMF's config knobs,
plus expose those knobs via HII.

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@15364 6f19259b-4bc3-4df7-8a09-765794883524

7 years agoOvmfPkg: introduce gOvmfPlatformConfigGuid
Laszlo Ersek [Sat, 22 Mar 2014 07:12:46 +0000 (07:12 +0000)]
OvmfPkg: introduce gOvmfPlatformConfigGuid

This GUID should become a new "namespace" for UEFI variables that are
specific to OVMF configuration (as opposed to standard UEFI global
variables). We'll also use it as the GUID of the related HII form-set (ie.
the interactive user interface).

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@15363 6f19259b-4bc3-4df7-8a09-765794883524

7 years agoOvmfPkg: non-null PcdLib instance for GraphicsConsoleDxe
Laszlo Ersek [Sat, 22 Mar 2014 07:12:36 +0000 (07:12 +0000)]
OvmfPkg: non-null PcdLib instance for GraphicsConsoleDxe

GraphicsConsoleDxe (a UEFI_DRIVER under MdeModulePkg/Universal/Console)
determines the preferred video resolution from the dynamic PCDs
- gEfiMdeModulePkgTokenSpaceGuid.PcdVideoHorizontalResolution
- gEfiMdeModulePkgTokenSpaceGuid.PcdVideoVerticalResolution

In one of the next patches, we'd like to change these PCDs. In order for
GraphicsConsoleDxe to retrieve the new values dynamically,
- it must be linked with the non-null instance of PcdLib,
- OvmfPkg must provide dynamic defaults.

We keep MdeModulePkg's 800x600 default resolution. (The UEFI specification
requires video drivers to support 800x600.)

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@15362 6f19259b-4bc3-4df7-8a09-765794883524

7 years agoFix current TPM device string missing. Use efivarstore instead of varstor, remove...
Jiewen Yao [Fri, 21 Mar 2014 02:51:42 +0000 (02:51 +0000)]
Fix current TPM device string missing. Use efivarstore instead of varstor, remove TPM disable.

Signed-off-by: Jiewen Yao <Jiewen.yao@intel.com>
Reviewed-by: Guo Dong <Guo.Dong@intel.com>
Reviewed-by: Liming Gao <Liming.Gao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@15360 6f19259b-4bc3-4df7-8a09-765794883524

7 years agoMdeModulePkg PCD: Fix PCD driver to return default data if size mismatch.
Star Zeng [Fri, 21 Mar 2014 01:16:07 +0000 (01:16 +0000)]
MdeModulePkg PCD: Fix PCD driver to return default data if size mismatch.

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@15357 6f19259b-4bc3-4df7-8a09-765794883524

7 years agoForce UID modules build error to warn user that currently it is just a sample.
Dong Guo [Fri, 21 Mar 2014 00:57:42 +0000 (00:57 +0000)]
Force UID modules build error to warn user that currently it is just a sample.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Dong Guo <guo.dong@intel.com>
Reviewed-by: Yao Jiewen <jiewen.yao@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@15356 6f19259b-4bc3-4df7-8a09-765794883524

7 years agoFix TCP4/TCP6 connections. Connections were transitioning into the connected state...
leroy.p.leahy [Thu, 20 Mar 2014 22:05:51 +0000 (22:05 +0000)]
Fix TCP4/TCP6 connections.  Connections were transitioning into the connected state and the polling was returning an error.  Fix the polling routine to return success in this case.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: leroy.p.leahy@intel.com
Reviewed-by: SREENIVASULA_REDDY@Dell.com
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@15355 6f19259b-4bc3-4df7-8a09-765794883524

7 years agoShellPkg: remove redudant code. call existing API.
Jaben Carsey [Thu, 20 Mar 2014 17:12:30 +0000 (17:12 +0000)]
ShellPkg: remove redudant code.  call existing API.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jaben Carsey <Jaben.carsey@intel.com>
Reviewed-by: Erik Bjorge <erik.c.bjorge@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@15354 6f19259b-4bc3-4df7-8a09-765794883524

7 years agoShellPkg: Remove unused function
Jaben Carsey [Thu, 20 Mar 2014 17:11:52 +0000 (17:11 +0000)]
ShellPkg: Remove unused function

This function was not exposed outside the library and is not used internally.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jaben Carsey <Jaben.carsey@intel.com>
Reviewed-by: Erik Bjorge <erik.c.bjorge@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@15353 6f19259b-4bc3-4df7-8a09-765794883524

7 years agoShellPkg: Allow for LoadedImageProtocol information to be verbosely exported for...
Jaben Carsey [Thu, 20 Mar 2014 17:10:57 +0000 (17:10 +0000)]
ShellPkg: Allow for LoadedImageProtocol information to be verbosely exported for commands like "dh"

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jaben Carsey <Jaben.carsey@intel.com>
Reviewed-by: Erik Bjorge <erik.c.bjorge@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@15352 6f19259b-4bc3-4df7-8a09-765794883524

7 years agoRemoves MacString Rt attribute in Ip4Config/Mnp driver.
Fu Siyuan [Thu, 20 Mar 2014 08:19:28 +0000 (08:19 +0000)]
Removes MacString Rt attribute in Ip4Config/Mnp driver.
Signed-off-by: Fu Siyuan <siyuan.fu@intel.com>
Reviewed-by: Dong, Guo <guo.dong@intel.com>
Reviewed-by: Yao, Jiewen <jiewen.yao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@15351 6f19259b-4bc3-4df7-8a09-765794883524

7 years agoUse PXE_OPFLAGS_STATION_ADDRESS_WRITE when setting new MAC address for the NIC in...
Fu Siyuan [Thu, 20 Mar 2014 06:04:50 +0000 (06:04 +0000)]
Use PXE_OPFLAGS_STATION_ADDRESS_WRITE when setting new MAC address for the NIC in SNP driver.
Signed-off-by: Fu Siyuan <siyuan.fu@intel.com>
Reviewed-by: Dong, Guo <guo.dong@intel.com>
Reviewed-by: Jin, Eric <eric.jin@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@15350 6f19259b-4bc3-4df7-8a09-765794883524

7 years agoMdeModulePkg/SecurityPkg Variable: Return error status to avoid inconsistency between...
Star Zeng [Thu, 20 Mar 2014 02:07:48 +0000 (02:07 +0000)]
MdeModulePkg/SecurityPkg Variable: Return error status to avoid inconsistency between PlatformLang and Lang.

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@15340 6f19259b-4bc3-4df7-8a09-765794883524

7 years agoFix the return value bug when updating public key database variable failure.
Dong Guo [Wed, 19 Mar 2014 03:12:57 +0000 (03:12 +0000)]
Fix the return value bug when updating public key database variable failure.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Dong Guo <guo.dong@intel.com>
Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>
Reviewed-by: Yao Jiewen <jiewen.yao@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@15339 6f19259b-4bc3-4df7-8a09-765794883524

7 years agoDid proper error handling when SetVariable failed, and put RTC write operation at...
Elvin Li [Wed, 19 Mar 2014 02:42:36 +0000 (02:42 +0000)]
Did proper error handling when SetVariable failed, and put RTC write operation at the behind of SetVariable, if SetVariable failed, RTC content could not be changed.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Elvin Li <elvin.li@intel.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@15338 6f19259b-4bc3-4df7-8a09-765794883524

7 years agoIntelFrameworkModulePkg AcpiS3SaveDxe: Remove ASSERT, add lock and remove RT for...
Star Zeng [Tue, 18 Mar 2014 09:10:13 +0000 (09:10 +0000)]
IntelFrameworkModulePkg AcpiS3SaveDxe: Remove ASSERT, add lock and remove RT for AcpiGlobalVariable variable.

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@15337 6f19259b-4bc3-4df7-8a09-765794883524

7 years agoRemove ASSERT when SetVariable for ConOutDev/ConInDev/ErrOutDev variables failed.
Elvin Li [Tue, 18 Mar 2014 07:43:27 +0000 (07:43 +0000)]
Remove ASSERT when SetVariable for ConOutDev/ConInDev/ErrOutDev variables failed.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Elvin Li <elvin.li@intel.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@15336 6f19259b-4bc3-4df7-8a09-765794883524

7 years agoShellPkg: Move a function into shared location
Jaben Carsey [Mon, 17 Mar 2014 17:18:08 +0000 (17:18 +0000)]
ShellPkg: Move a function into shared location

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jaben Carsey <Jaben.carsey@intel.com>
Reviewed-by: Erik Bjorge <erik.c.bjorge@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@15335 6f19259b-4bc3-4df7-8a09-765794883524

7 years agoAdd comments for PcdHideTpmSupport.
Dong Guo [Mon, 17 Mar 2014 08:38:32 +0000 (08:38 +0000)]
Add comments for PcdHideTpmSupport.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Dong Guo <guo.dong@intel.com>
Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>
Reviewed-by: Yao Jiewen <jiewen.yao@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@15334 6f19259b-4bc3-4df7-8a09-765794883524

7 years agoDo not reset system when the MemoryTypeInformation variable cannot be written.
Ruiyu Ni [Mon, 17 Mar 2014 08:24:07 +0000 (08:24 +0000)]
Do not reset system when the MemoryTypeInformation variable cannot be written.
Remove the RT attribute for the MemoryTypeInformation variable because it’s not necessary.

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@15333 6f19259b-4bc3-4df7-8a09-765794883524

7 years agoRemove unnecessary dependency in variable driver.
Dong Guo [Mon, 17 Mar 2014 08:23:54 +0000 (08:23 +0000)]
Remove unnecessary dependency in variable driver.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Dong Guo <guo.dong@intel.com>
Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>
Reviewed-by: Gao, Liming <liming.gao@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@15332 6f19259b-4bc3-4df7-8a09-765794883524

7 years agoAdd comments to describe PlatformDriOverrideDxe is used for test purpose.
Gao, Liming [Mon, 17 Mar 2014 07:24:15 +0000 (07:24 +0000)]
Add comments to describe PlatformDriOverrideDxe is used for test purpose.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Gao, Liming <liming.gao@intel.com>
Reviewed-by: Yao, Jiewen <jiewen.yao@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@15331 6f19259b-4bc3-4df7-8a09-765794883524

7 years agoRemove ASSERT check for SetVariable in FirmwarePerformanceDataTableDxe
Gao, Liming [Mon, 17 Mar 2014 07:22:50 +0000 (07:22 +0000)]
Remove ASSERT check for SetVariable in FirmwarePerformanceDataTableDxe

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Gao, Liming <liming.gao@intel.com>
Reviewed-by: Yao, Jiewen <jiewen.yao@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@15330 6f19259b-4bc3-4df7-8a09-765794883524

7 years agoFix the return status when physical presence variable and MemoryOverwriteRequestContr...
Dong Guo [Mon, 17 Mar 2014 05:46:53 +0000 (05:46 +0000)]
Fix the return status when physical presence variable and MemoryOverwriteRequestControl variable are corrupt.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Dong Guo <guo.dong@intel.com>
Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>
Reviewed-by: Yao Jiewen <jiewen.yao@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@15329 6f19259b-4bc3-4df7-8a09-765794883524

7 years agoRemove ASSERT when failed to Get/Set “AttemptOrder” and “ClientId” variable.
Fu Siyuan [Mon, 17 Mar 2014 05:32:32 +0000 (05:32 +0000)]
Remove ASSERT when failed to Get/Set “AttemptOrder” and “ClientId” variable.
Removes RT attribute for “AttemptOrder” variable.
Signed-off-by: Fu Siyuan <siyuan.fu@intel.com>
Reviewed-by: Dong, Guo <guo.dong@intel.com>
Reviewed-by: Yao, Jiewen <jiewen.yao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@15328 6f19259b-4bc3-4df7-8a09-765794883524

7 years agoOvmfPkg: BDS: QemuBootOrder: don't leak unreferenced boot options
Laszlo Ersek [Thu, 13 Mar 2014 17:35:03 +0000 (17:35 +0000)]
OvmfPkg: BDS: QemuBootOrder: don't leak unreferenced boot options

The Boot#### variables that have become unreferenced in the new BootOrder
variable won't ever be automatically reused for booting. They are
"unreachable" resources that take up room in the variable store. Make an
effort to remove them.

This should plug the leak which, given sufficient reboots, exhausts the
variable store with stale Boot#### variables and renders the VM
unbootable.

Reported-by: Michael Chang <mchang@suse.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@15327 6f19259b-4bc3-4df7-8a09-765794883524

7 years agoOvmfPkg: BDS: remove historic (now defunct) boot mode hack
Laszlo Ersek [Thu, 13 Mar 2014 17:34:55 +0000 (17:34 +0000)]
OvmfPkg: BDS: remove historic (now defunct) boot mode hack

When PI can distinguish the "full config" boot mode from "assume no
changes", then the following BDS logic is correct:

  if BootMode == BOOT_WITH_FULL_CONFIGURATION:
    //
    // connect all devices
    // create & append each default boot option that's missing
    //
    BdsLibConnectAll
    BdsLibEnumerateAllBootOption
  else if BootMode == BOOT_ASSUMING_NO_CONFIGURATION_CHANGES:
    //
    // just stick with current BootOrder and the Boot#### variables
    // referenced by it
    //

In theory, the first branch is intended to run infrequently, and the
"assume no changes" branch should run most of the time.

However, some platforms can't tell these two boot modes apart. The
following substitute had been introduced:

  //
  // Technically, always assume "full config", but the BootMode HOB is
  // actually meaningless wrt. to "full config" or "assume no changes".
  //
  ASSERT (BootMode == BOOT_WITH_FULL_CONFIGURATION);

  //
  // Key off the existence of BootOrder. Try to prepare an in-memory list
  // of boot options, based on BootOrder and the referenced Boot####
  // variables.
  //
  Status = BdsLibBuildOptionFromVar()

  //
  // If that succeeded, we'll treat it as "assume no changes".  If it
  // failed (*only* if it failed), we'll build default boot options,
  // calling it "full config":
  //
  if EFI_ERROR(Status):
    BdsLibConnectAll()
    BdsLibEnumerateAllBootOption(BootOptionList)

What we have now in OVMF is a mixture of the hack, and the behavior that's
theoretically correct for "full config":
- We assert "full config" -- this is OK.
- We call "connect all" and "enumerate all" deliberately -- this is OK
  too. It matches "full config" which we assert.
- However, we also have the hack in place, which had been meant as an
  alternative.

In order to clean this up, we either need to restore the hack to its
original form (ie. comment out the unconditional calls again), or we ought
to remove the hack altogether.

The unconditional "connect all" + "enumerate all" calls are the correct
approach for OVMF, because we want, in fact, to start with "full config".
The QEMU boot order specification and the set of emulated devices might
change "out of band", which excludes "assume no changes".

In other words, removing the hack corresponds to the "real production"
case that the comment hints at.

Because SetBootOrderFromQemu() may change the BootOrder NvVar, we must
preserve the BdsLibBuildOptionFromVar() function call, in order to
refresh the in-memory list with the new boot priorities.
(The last step of BdsLibEnumerateAllBootOption() is such a call too.)

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@15326 6f19259b-4bc3-4df7-8a09-765794883524

7 years agoArmPlatformPkg/Bds: stop inputting more characters when string is full
Ryan Harkin [Wed, 12 Mar 2014 17:24:48 +0000 (17:24 +0000)]
ArmPlatformPkg/Bds: stop inputting more characters when string is full

If EditHIInputStr() is called, say with a MaxCmdLine of 2, the user is
currently allowed to enter 2 characters.

If the second character is a carriage return/line feed, this is
substituted with a NULL and the function returns.

If the second character is a regular character, the loop terminated and
the function returns.  However, the buffer has not been NULL terminated.

This patch prevents the user from entering a regular character as the
final character and ensures that the only way out of the input is by
pressing ESC or ENTER (or equivalent).

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ryan Harkin <ryan.harkin@linaro.org>
Reviewed-by: Olivier Martin <olivier.martin@arm.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@15325 6f19259b-4bc3-4df7-8a09-765794883524

7 years agoArmPlatformPkg/BootMonFs: Added support for new revision of the NOR Flash file system
Olivier Martin [Wed, 12 Mar 2014 17:23:33 +0000 (17:23 +0000)]
ArmPlatformPkg/BootMonFs: Added support for new revision of the NOR Flash file system

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Olivier Martin <olivier.martin@arm.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@15324 6f19259b-4bc3-4df7-8a09-765794883524

7 years agoShellPkg: ShellCommands/SetVar: Make '-rt' imply '-bs'
Brendan Jackman [Mon, 10 Mar 2014 18:13:13 +0000 (18:13 +0000)]
ShellPkg: ShellCommands/SetVar: Make '-rt' imply '-bs'

It's invalid to set a variable that's available from runtime services but not
from boot services.

Currently if you pass '-rt' without '-bs' you get a generic
'Invalid Parameter' message. We should either print a more useful message in
this case, or make '-rt' imply '-bs' (as this patch does). The Shell Spec is
ambiguous on the matter.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Brendan Jackman <Brendan.Jackman@arm.com>
Reviewed-By: Olivier Martin <olivier.martin@arm.com>
Reviewed-By: Jaben Carsey <jaben.carsey@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@15323 6f19259b-4bc3-4df7-8a09-765794883524

7 years agoRemove unused variable attribute flag.
jyao1 [Fri, 7 Mar 2014 03:07:09 +0000 (03:07 +0000)]
Remove unused variable attribute flag.

Signed off by: Jiewen Yao <jiewen.yao@intel.com>
Reviewed by: Jeff Fan <jeff.fan@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Contributed-under: TianoCore Contribution Agreement 1.0

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@15321 6f19259b-4bc3-4df7-8a09-765794883524

7 years ago 1.Add code to check the pointer 'CorrectedPath' in Ls.c line 460 before referenced...
Shumin Qiu [Fri, 7 Mar 2014 01:06:37 +0000 (01:06 +0000)]
 1.Add code to check the pointer  'CorrectedPath' in Ls.c line 460 before referenced. 2.Not use  explicit comparisons to TRUE or FALSE for Boolean variable in Ls.c. 3.Add doxygen tags in comment and return type for 'ToLower' in ShellProtocol.c.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Shumin Qiu <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@15320 6f19259b-4bc3-4df7-8a09-765794883524

7 years agoStdLib: Modify the memory allocation routines to not be dependent upon the internal...
Daryl McDaniel [Fri, 7 Mar 2014 01:05:30 +0000 (01:05 +0000)]
StdLib: Modify the memory allocation routines to not be dependent upon the internal structure of the EDK II memory pool.

StdLib/LibC/StdLib/Malloc.c
Create a private data structure, CPOOL_HEAD, which contains housekeeping information for StdLib’s memory allocation functions.  An instance of this structure is prepended to every chunk of allocated memory.  The structure links the allocation into a doubly-linked list and keeps track of the size of each allocation unit.  This information is then available for use by the realloc function.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Daryl McDaniel <daryl.mcdaniel@intel.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
Reviewed-by: Erik Bjorge <erik.c.bjorge@intel.com>
Reviewed-by: Rosenbaum, Lee G <lee.g.rosenbaum@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@15319 6f19259b-4bc3-4df7-8a09-765794883524

7 years agoThe size of platform memory above 1M is measured in kilobytes.
Mike Maslenkin [Wed, 5 Mar 2014 08:45:13 +0000 (08:45 +0000)]
The size of platform memory above 1M is measured in kilobytes.
This patch fixes truncation of this value. Actually 0 Mb memory size was set by reason of overflow of 16 bit word caused by wrong value used.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Mike Maslenkin <mihailm@parallels.com>
Reviewed-by: Elvin Li <elvin.li@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@15318 6f19259b-4bc3-4df7-8a09-765794883524

7 years agoArmPlatformPkg/ArmVExpressPkg: Added Android FastBoot support
Olivier Martin [Wed, 5 Mar 2014 04:52:33 +0000 (04:52 +0000)]
ArmPlatformPkg/ArmVExpressPkg: Added Android FastBoot support

That includes an implementation of FASTBOOT_PLATFORM_PROTOCOL for
ARM Versatile Express.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Olivier Martin <olivier.martin@arm.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@15317 6f19259b-4bc3-4df7-8a09-765794883524

7 years agoEmbeddedPkg/AndroidFastbootTransportUsbDxe: Implemented Android FastBoot over USB
Olivier Martin [Wed, 5 Mar 2014 04:51:31 +0000 (04:51 +0000)]
EmbeddedPkg/AndroidFastbootTransportUsbDxe: Implemented Android FastBoot over USB

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Olivier Martin <olivier.martin@arm.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@15316 6f19259b-4bc3-4df7-8a09-765794883524

7 years agoArmPlatformPkg/ArmVExpressPkg: Added Isp1761 USB OTG driver
Olivier Martin [Wed, 5 Mar 2014 04:33:37 +0000 (04:33 +0000)]
ArmPlatformPkg/ArmVExpressPkg: Added Isp1761 USB OTG driver

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Olivier Martin <olivier.martin@arm.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@15315 6f19259b-4bc3-4df7-8a09-765794883524

7 years agoEmbeddedPkg/Isp1761UsbDxe: Driver for the NXP ISP1761's USB peripheral controller
Olivier Martin [Wed, 5 Mar 2014 04:32:48 +0000 (04:32 +0000)]
EmbeddedPkg/Isp1761UsbDxe: Driver for the NXP ISP1761's USB peripheral controller

This driver doesn't support OTG - it simply sets the NXP ISP1761 in pure
peripheral mode.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Olivier Martin <olivier.martin@arm.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@15314 6f19259b-4bc3-4df7-8a09-765794883524

7 years agoEmbeddedPkg/UsbDevice.h: Introduced USB Device Protocol
Olivier Martin [Wed, 5 Mar 2014 04:31:04 +0000 (04:31 +0000)]
EmbeddedPkg/UsbDevice.h: Introduced USB Device Protocol

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Olivier Martin <olivier.martin@arm.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@15313 6f19259b-4bc3-4df7-8a09-765794883524

7 years agoEmbeddedPkg/AndroidFastboot: Introduce Android FastBoot Application
Olivier Martin [Wed, 5 Mar 2014 04:15:44 +0000 (04:15 +0000)]
EmbeddedPkg/AndroidFastboot: Introduce Android FastBoot Application

This application enables Android FastBoot on UEFI.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Olivier Martin <olivier.martin@arm.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@15312 6f19259b-4bc3-4df7-8a09-765794883524

7 years agoEmbeddedPkg/AndroidFastbootPlatform.h: Introduced Fastboot Platform Protocol
Olivier Martin [Wed, 5 Mar 2014 04:14:02 +0000 (04:14 +0000)]
EmbeddedPkg/AndroidFastbootPlatform.h: Introduced Fastboot Platform Protocol

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Olivier Martin <olivier.martin@arm.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@15311 6f19259b-4bc3-4df7-8a09-765794883524

7 years agoEmbeddedPkg/AndroidFastbootTransport.h: Introduced Android Fastboot Transport protocol
Olivier Martin [Wed, 5 Mar 2014 04:12:35 +0000 (04:12 +0000)]
EmbeddedPkg/AndroidFastbootTransport.h: Introduced Android Fastboot Transport protocol

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Olivier Martin <olivier.martin@arm.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@15310 6f19259b-4bc3-4df7-8a09-765794883524

7 years agoOvmfPkg: raise DXEFV size to 8 MB
Laszlo Ersek [Wed, 5 Mar 2014 00:54:00 +0000 (00:54 +0000)]
OvmfPkg: raise DXEFV size to 8 MB

This fixes build errors like:

  GenFds.py...
    the required fv image size 0x71b118 exceeds the set fv image size
    0x700000

which is reported at least for:
(a) -b DEBUG -D SECURE_BOOT_ENABLE -t GCC44,
(b) -b DEBUG -D SECURE_BOOT_ENABLE -t GCC48 -D CSM_ENABLE

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@15309 6f19259b-4bc3-4df7-8a09-765794883524

7 years agoOvmfPkg: Add DebugAgentLib for Library class mapping for DXE_DRIVER
Jordan Justen [Tue, 4 Mar 2014 08:04:20 +0000 (08:04 +0000)]
OvmfPkg: Add DebugAgentLib for Library class mapping for DXE_DRIVER

This is needed for BootScriptExecutorDxe.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@15308 6f19259b-4bc3-4df7-8a09-765794883524

7 years agoOvmfPkg: S3 Resume: pull in BootScriptExecutorDxe
Laszlo Ersek [Tue, 4 Mar 2014 08:04:13 +0000 (08:04 +0000)]
OvmfPkg: S3 Resume: pull in BootScriptExecutorDxe

This driver (from
"MdeModulePkg/Universal/Acpi/BootScriptExecutorDxe/BootScriptExecutorDxe.inf")
is first loaded normally during DXE. When the
EFI_DXE_SMM_READY_TO_LOCK_PROTOCOL is installed by any DXE driver (purely
as a form of notification), the driver reloads itself to reserved memory.

During S3 Resume / PEI, the driver image is executed from there. In order
to access the boot script saved during S3 Suspend, LockBox access is
needed.

The boot script is transferred internal to PiDxeS3BootScriptLib:

Both S3SaveStateDxe and BootScriptExecutorDxe are statically linked
against PiDxeS3BootScriptLib. Whichever is loaded first (during normal
boot, in the DXE phase), allocates the root storage for the script. The
address is then passed between the PiDxeS3BootScriptLib instances living
in the two separate drivers thru the dynamic
PcdS3BootScriptTablePrivateDataPtr PCD.

Dependencies:

  BootScriptExecutorDxe
    gEfiLockBoxProtocolGuid [OvmfPkg/AcpiS3SaveDxe]
    S3BootScriptLib [PiDxeS3BootScriptLib]
      SmbusLib [BaseSmbusLibNull]
      LockBoxLib [OvmfPkg/Library/LockBoxLib]
    LockBoxLib [OvmfPkg/Library/LockBoxLib]

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@15307 6f19259b-4bc3-4df7-8a09-765794883524

7 years agoOvmfPkg: S3 Resume: fake LockBox protocol for BootScriptExecutorDxe
Laszlo Ersek [Tue, 4 Mar 2014 08:04:04 +0000 (08:04 +0000)]
OvmfPkg: S3 Resume: fake LockBox protocol for BootScriptExecutorDxe

BootScriptExecutorDxe, to be pulled in in the next patch, was written with
the SMM implementation of LockBox in mind. That implementation is split in
the following three parts:

- client side (DXE/PEI) library,
- SMM driver producing gEfiLockBoxProtocolGuid,
- driver side (SMM) library.

BootScriptExecutorDxe includes the client side LockBoxLib. So that the
library can communicate with the SMM LockBox driver, BootScriptExecutorDxe
has a Depex on gEfiLockBoxProtocolGuid, normally installed by the SMM
LockBox driver. This is actually not a hard dependency, it just ensures
correct load order between BootScriptExecutorDxe and
MdeModulePkg/Universal/LockBox/SmmLockBox.

The (client side) LockBox library instance in OVMF doesn't depend on a
separate driver that produces gEfiLockBoxProtocolGuid. Nothing  produces
that GUID right now in OVMF. This prevents BootScriptExecutorDxe from
loading.

Install gEfiLockBoxProtocolGuid in our only S3-specific, custom DXE
driver, in order to enable loading of BootScriptExecutorDxe.

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@15306 6f19259b-4bc3-4df7-8a09-765794883524

7 years agoOvmfPkg: S3 Suspend: save boot script after ACPI context
Laszlo Ersek [Tue, 4 Mar 2014 08:03:56 +0000 (08:03 +0000)]
OvmfPkg: S3 Suspend: save boot script after ACPI context

The trigger to actually save the boot script is the installation of
EFI_DXE_SMM_READY_TO_LOCK_PROTOCOL, to be performed by any DXE driver.
Installation of the protocol also locks down SMM (as its name indicates)
and (in theory) prevents further LockBox access.

We cannot install this protocol before BdsLibBootViaBootOption() is called
(eg. in OVMF's PlatformBdsPolicyBehavior()), because
BdsLibBootViaBootOption() calls EFI_ACPI_S3_SAVE_PROTOCOL.S3Save(), which
needs LockBox access.

We also can't install the protocol after BdsLibBootViaBootOption()
returns, simply because control is never returned to us.

Therefore modify our EFI_ACPI_S3_SAVE_PROTOCOL implementation so that the
boot script is prepared and installed internally to S3Save().

(The boot script must contain at least one opcode, otherwise
S3BootScriptLib runs into an assertion failure. We add a harmless (no-op)
"information" opcode.)

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@15305 6f19259b-4bc3-4df7-8a09-765794883524

7 years agoOvmfPkg: S3 Suspend: enable creation/saving of an S3 Boot Script
Laszlo Ersek [Tue, 4 Mar 2014 08:03:50 +0000 (08:03 +0000)]
OvmfPkg: S3 Suspend: enable creation/saving of an S3 Boot Script

"MdeModulePkg/Universal/Acpi/S3SaveStateDxe/S3SaveStateDxe.inf" produces
the EFI_S3_SAVE_STATE_PROTOCOL which allows creation and saving of an S3
Boot Script, to be replayed in PEI during S3 Resume. The script contains
opcodes and opcode arguments to configure CPU, PCI and IO resources.

S3SaveStateDxe relies on the S3BootScriptLib library. The Null
implementation is not useful for actually saving the boot script, we need
the PiDxeS3BootScriptLib instance.

The PiDxeS3BootScriptLib library instance depends on LockBoxLib,
implemented for OVMF in one of the previous patches.

PiDxeS3BootScriptLib also depends on SmbusLib. For now we opt for the Null
instance of the latter. It means that SMBus commands in the boot script
will have no effect when interpreted during S3 Resume. This should be fine
for OvmfPkg and QEMU.

  EFI_S3_SAVE_STATE_PROTOCOL [S3SaveStateDxe]
    S3BootScriptLib [PiDxeS3BootScriptLib]
      SmbusLib [BaseSmbusLibNull]
      LockBoxLib [OvmfPkg/Library/LockBoxLib]

When the EFI_DXE_SMM_READY_TO_LOCK_PROTOCOL is installed by any DXE driver
(purely as a form of notification), the S3SaveStateDxe driver saves the
boot script to EfiACPIMemoryNVS, and links it into the LockBox.

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@15304 6f19259b-4bc3-4df7-8a09-765794883524

7 years agoOvmfPkg: S3 Suspend: save ACPI context
Laszlo Ersek [Tue, 4 Mar 2014 08:03:38 +0000 (08:03 +0000)]
OvmfPkg: S3 Suspend: save ACPI context

"OvmfPkg/AcpiS3SaveDxe/AcpiS3SaveDxe.inf" (originally:
"IntelFrameworkModulePkg/Universal/Acpi/AcpiS3SaveDxe/AcpiS3SaveDxe.inf")
produces the EFI_ACPI_S3_SAVE_PROTOCOL.

When found, this protocol is automatically invoked by
BdsLibBootViaBootOption(), in file
"IntelFrameworkModulePkg/Library/GenericBdsLib/BdsBoot.c", right before
booting a boot option, to save ACPI S3 context.

At that point during BDS, our AcpiPlatformDxe driver will have installed
the FACS table (which AcpiS3SaveDxe has a use-time dependency upon).

With regard to dependencies: AcpiS3SaveDxe implements
EFI_ACPI_S3_SAVE_PROTOCOL by relying on LockBoxLib.

  BdsLibBootViaBootOption()
    EFI_ACPI_S3_SAVE_PROTOCOL [AcpiS3SaveDxe]
      LockBoxLib [OvmfPkg/Library/LockBoxLib]

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
[jordan.l.justen@intel.com: Remove EmuNvramLib]
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@15303 6f19259b-4bc3-4df7-8a09-765794883524

7 years agoOvmfPkg: S3 Suspend: import specialized copy of AcpiS3SaveDxe
Laszlo Ersek [Tue, 4 Mar 2014 08:03:31 +0000 (08:03 +0000)]
OvmfPkg: S3 Suspend: import specialized copy of AcpiS3SaveDxe

"IntelFrameworkModulePkg/Universal/Acpi/AcpiS3SaveDxe/AcpiS3SaveDxe.inf"
currently specifies a DepEx on gEfiMpServiceProtocolGuid (MP Services).

The justification is the following code sequence:

  InstallAcpiS3Save()
    if PcdFrameworkCompatibilitySupport is set:
      InstallAcpiS3SaveThunk()
        if EFI_MP_SERVICES_PROTOCOL is available:
          GetVariable(ACPI_GLOBAL_VARIABLE)

In English, the AcpiS3SaveDxe driver insists on the presence of MP
Services *unconditionally* because,

- if PcdFrameworkCompatibilitySupport is set (the default is false),
- and MP Services are available (which is constant true under the above
  condition),

then the AcpiS3SaveDxe driver would like to get the ACPI_GLOBAL_VARIABLE
variable from the MP Services driver, rather than setting it itself.

The DepEx prevents AcpiS3SaveDxe from loading under OvmfPkg, since we
provide no MP Services implementation. This is particularly broken since
the default PcdFrameworkCompatibilitySupport value is FALSE, making the
entire code that would look at EFI_MP_SERVICES_PROTOCOL dead.

Copy AcpiS3SaveDxe to OvmfPkg, substitute PcdFrameworkCompatibilitySupport
with constant FALSE, and remove all code that becomes dead, including the
DepEx.

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@15302 6f19259b-4bc3-4df7-8a09-765794883524

7 years agoOvmfPkg: implement LockBoxLib
Laszlo Ersek [Tue, 4 Mar 2014 08:03:23 +0000 (08:03 +0000)]
OvmfPkg: implement LockBoxLib

The S3 suspend/resume infrastructure depends on the LockBox library class.
The edk2 tree currently contains Null and SMM instances. The Null instance
is useless, and the SMM instance would require SMM emulation by including
the SMM core and adding several new drivers, which is deemed too complex.

Hence add a simple LockBoxLib instance for OVMF.

jordan.l.justen@intel.com:
 * use PCDs instead of EmuNvramLib
   - clear memory in PlatformPei on non S3 boots
 * allocate NVS memory and store a pointer to that memory
   - reduces memory use at fixed locations

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@15301 6f19259b-4bc3-4df7-8a09-765794883524

7 years agoOvmfPkg: S3 Resume: pull in PEIM orchestrating S3 Resume
Laszlo Ersek [Tue, 4 Mar 2014 08:03:06 +0000 (08:03 +0000)]
OvmfPkg: S3 Resume: pull in PEIM orchestrating S3 Resume

"UefiCpuPkg/Universal/Acpi/S3Resume2Pei/S3Resume2Pei.inf" produces the
EFI_PEI_S3_RESUME2 PEIM-to-PEIM Interface.

When the platform-specific initialization code (in PEI) sets the Boot Mode
to BOOT_ON_S3_RESUME, the DXE IPL (which is the last step in PEI) skips
the DXE phase entirely, and executes the S3 Resume PEIM through the
EFI_PEI_S3_RESUME2 interface instead. (See DxeLoadCore() in
"MdeModulePkg/Core/DxeIplPeim/DxeLoad.c".)

S3Resume2Pei depends on LockBoxLib.

  EFI_PEI_S3_RESUME2 [S3Resume2Pei]
    LockBoxLib [OvmfPkg/Library/LockBoxLib]

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@15300 6f19259b-4bc3-4df7-8a09-765794883524

7 years agoOvmfPkg/PlatformPei: Allocate PEI FV as ACPI NVS if S3 is supported
Jordan Justen [Tue, 4 Mar 2014 08:02:59 +0000 (08:02 +0000)]
OvmfPkg/PlatformPei: Allocate PEI FV as ACPI NVS if S3 is supported

On S3 resume, we skip decompression of the PEI FV, and expect
to jump directly into it. For this to work, we need the OS to
leave the memory range untouched.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@15299 6f19259b-4bc3-4df7-8a09-765794883524