]> git.proxmox.com Git - mirror_edk2.git/log
mirror_edk2.git
8 years agoArmPlatformPkg: remove PeiServicesTablePointerLib implementation
Ard Biesheuvel [Fri, 27 Nov 2015 17:06:24 +0000 (17:06 +0000)]
ArmPlatformPkg: remove PeiServicesTablePointerLib implementation

This removes the PeiServicesTablePointerLib implementation under
ArmPlatformPkg that violates the PI spec, and hence should not be
used. Instead, the implementation that resides under ArmPkg should
be used.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18989 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoArmPlatformPkg: drop ArmPlatformGlobalVariableLib resolutions
Ard Biesheuvel [Fri, 27 Nov 2015 17:06:11 +0000 (17:06 +0000)]
ArmPlatformPkg: drop ArmPlatformGlobalVariableLib resolutions

We can remove all mention of ArmPlatformGlobalVariableLib now that
there are no remaining [transitive] dependencies on it.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18988 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoArmPlatformPkg: move to ArmPkg version of PeiServicesTablePointerLib
Ard Biesheuvel [Fri, 27 Nov 2015 17:05:59 +0000 (17:05 +0000)]
ArmPlatformPkg: move to ArmPkg version of PeiServicesTablePointerLib

As pointed out by Eugene, the ArmPlatformPkg implementation of
PeiServicesTablePointerLib violates the PI sec, since it uses
ArmPlatformGlobalVariableLib to store the PEI services table pointer
rather than the thread ID cpu registers as the spec requires.

So instead, move to the ArmPkg version of this library, which does
adhere to the PI spec.

Reported-by: Eugene Cohen <eugene@hp.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18987 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoArmVirtPkg: drop ArmPlatformGlobalVariableLib dependency
Ard Biesheuvel [Fri, 27 Nov 2015 17:05:47 +0000 (17:05 +0000)]
ArmVirtPkg: drop ArmPlatformGlobalVariableLib dependency

Now that all PeiServicesTablePointerLib and PrePiHobListPointerLib
library dependencies in both ArmVirtQemu and ArmVirtXen are satisfied
by implementations that do not depend on ArmPlatformGlobalVariableLib,
we can remove all mention of it from the various .dsc files.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18986 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoArmVirtPkg/ArmVirtQemu: move to ArmPkg version of PeiServicesTablePointerLib
Ard Biesheuvel [Fri, 27 Nov 2015 17:05:36 +0000 (17:05 +0000)]
ArmVirtPkg/ArmVirtQemu: move to ArmPkg version of PeiServicesTablePointerLib

As pointed out by Eugene, the ArmPlatformPkg implementation of
PeiServicesTablePointerLib violates the PI sec, since it uses
ArmPlatformGlobalVariableLib to store the PEI services table pointer
rather than the thread ID cpu registers as the spec requires.

So instead, move to the ArmPkg version of this library, which does
adhere to the PI spec.

Reported-by: Eugene Cohen <eugene@hp.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18985 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoBeagleBoardPkg: remove ArmPlatformGlobalVariableLib resolution
Ard Biesheuvel [Fri, 27 Nov 2015 17:05:24 +0000 (17:05 +0000)]
BeagleBoardPkg: remove ArmPlatformGlobalVariableLib resolution

Remove the ArmPlatformGlobalVariableLib library class resolution now
that BeagleBoardPkg no longer has a transitive dependency on it.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18984 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoArmPkg: remove ArmPlatformGlobalVariableLib resolution from ArmPkg.dsc
Ard Biesheuvel [Fri, 27 Nov 2015 17:05:13 +0000 (17:05 +0000)]
ArmPkg: remove ArmPlatformGlobalVariableLib resolution from ArmPkg.dsc

ArmPkg does not depend on ArmPlatformGlobalVariableLib, and this library
is about to be removed, so remove all mention of it from ArmPkg.dsc.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18983 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoArmPlatformPkg/PrePiHobListPointerLib: use thread ID register
Ard Biesheuvel [Fri, 27 Nov 2015 17:04:59 +0000 (17:04 +0000)]
ArmPlatformPkg/PrePiHobListPointerLib: use thread ID register

This updates the PrePiHobListPointerLib implementation in ArmPlatformPkg
to move away from ArmPlatformGlobalVariableLib and instead use the thread
ID CPU registers (TPIDRURW and TPIDR_EL0 for v7 and v8, respectively)
for storing the HobList pointer.

Since PrePiHobListPointerLib is specific to PrePi (where PEI core is skipped)
we can share these registers with the PEI services table pointer. By the
same reasoning, the PEI services table pointer and the HobList pointer
already shared the same offset in the ArmPlatformGlobalVariable array.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18982 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoUefiCpuPkg/PiSmmCpu: Update function call for 2 new APIs.
Yao, Jiewen [Fri, 27 Nov 2015 13:48:12 +0000 (13:48 +0000)]
UefiCpuPkg/PiSmmCpu: Update function call for 2 new APIs.

All page table allocation will use AllocatePageTableMemory().
Add SmmCpuFeaturesCompleteSmmReadyToLock() to PerformRemainingTasks()
and PerformPreTasks().

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: "Yao, Jiewen" <jiewen.yao@intel.com>
Reviewed-by: "Kinney, Michael D" <michael.d.kinney@intel.com>
Cc: "Fan, Jeff" <jeff.fan@intel.com>
Cc: "Kinney, Michael D" <michael.d.kinney@intel.com>
Cc: "Laszlo Ersek" <lersek@redhat.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18981 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoUefiCpuPkg/PiSmmCpu: Add NULL func for 2 new APIs in SmmCpuFeaturesLib.
Yao, Jiewen [Fri, 27 Nov 2015 13:48:08 +0000 (13:48 +0000)]
UefiCpuPkg/PiSmmCpu: Add NULL func for 2 new APIs in SmmCpuFeaturesLib.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: "Yao, Jiewen" <jiewen.yao@intel.com>
Reviewed-by: "Kinney, Michael D" <michael.d.kinney@intel.com>
Cc: "Fan, Jeff" <jeff.fan@intel.com>
Cc: "Kinney, Michael D" <michael.d.kinney@intel.com>
Cc: "Laszlo Ersek" <lersek@redhat.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18980 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoUefiCpuPkg/PiSmmCpu: Add 2 APIs in SmmCpuFeaturesLib.
Yao, Jiewen [Fri, 27 Nov 2015 13:48:03 +0000 (13:48 +0000)]
UefiCpuPkg/PiSmmCpu: Add 2 APIs in SmmCpuFeaturesLib.

SmmCpuFeaturesCompleteSmmReadyToLock() is a hook point to
allow CPU specific code to do more registers setting after
the gEfiSmmReadyToLockProtocolGuid notification is completely
processed.

SmmCpuFeaturesAllocatePageTableMemory() is an API to allow
CPU to allocate a specific region for storing page tables.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: "Yao, Jiewen" <jiewen.yao@intel.com>
Reviewed-by: "Kinney, Michael D" <michael.d.kinney@intel.com>
Cc: "Fan, Jeff" <jeff.fan@intel.com>
Cc: "Kinney, Michael D" <michael.d.kinney@intel.com>
Cc: "Laszlo Ersek" <lersek@redhat.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18979 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoRevert "Add 2 APIs in SmmCpuFeaturesLib."
Laszlo Ersek [Fri, 27 Nov 2015 12:00:32 +0000 (12:00 +0000)]
Revert "Add 2 APIs in SmmCpuFeaturesLib."

This reverts SVN r18958 / git commit
9daa916dd1efe6443f9a66dfa882f3185d33ad28.

The patch series had been fully reviewed on edk2-devel, but it got
committed as a single squashed patch. Revert it for now.

Link: http://thread.gmane.org/gmane.comp.bios.edk2.devel/4951
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18978 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoRevert "Always set WP in CR0."
Laszlo Ersek [Fri, 27 Nov 2015 12:00:26 +0000 (12:00 +0000)]
Revert "Always set WP in CR0."

This reverts SVN r18960 / git commit
8e496a7abcb78c36b0af47ed473096ef7f171606.

The patch series had been fully reviewed on edk2-devel, but it got
committed as a single squashed patch. Revert it for now.

Link: http://thread.gmane.org/gmane.comp.bios.edk2.devel/4951
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18977 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoArmPlatformPkg/PrePeiCore: add missing entries to AArch64 vector table
Ard Biesheuvel [Fri, 27 Nov 2015 09:24:27 +0000 (09:24 +0000)]
ArmPlatformPkg/PrePeiCore: add missing entries to AArch64 vector table

The PrePeiCore vector table for AArch64 mode is only half populated.
However unlikely, if exceptions from lower exception levels are ever
taken, they should be reported correctly, rather than causing a
recursive undefined instruction fault on the zero padding that was
introduced by commit SVN r18904 ("ArmPkg/ArmPlatformPkg: position
vectors relative to base"). So add the missing entries, and wire
them up to the default handler.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Acked-by: Mark Rutland <mark.rutland@arm.com>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18976 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoMdeModulePkg:Refine the comments in INF files
Dandan Bi [Thu, 26 Nov 2015 10:00:12 +0000 (10:00 +0000)]
MdeModulePkg:Refine the comments in INF files

Add comments in INF file in BootMaintenanceManagerLib.inf.
Refine the comments in INF file in FileExplorerLib.inf

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

8 years agoEmbeddedPkg: Remove SerialDxe and SerialPortExtLib libraries
Star Zeng [Thu, 26 Nov 2015 08:52:58 +0000 (08:52 +0000)]
EmbeddedPkg: Remove SerialDxe and SerialPortExtLib libraries

Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Leif Lindholm <leif.lindholm@linaro.org>
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18974 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoArmVirtPkg: Use SerialDxe in MdeModulePkg instead of EmbeddedPkg
Star Zeng [Thu, 26 Nov 2015 08:52:12 +0000 (08:52 +0000)]
ArmVirtPkg: Use SerialDxe in MdeModulePkg instead of EmbeddedPkg

Beyond just changing the directly related lines in the FDF and DSC files,
we have to adapt the EarlyFdtPL011SerialPortLib and FdtPL011SerialPortLib
instances as well, in the same patch. This is because the EmbeddedPkg
driver expects the SerialPortSetAttributes(),
SerialPortSetControl() and SerialPortGetControl() functions from
SerialPortExtLib, while the MdeModulePkg driver expects them from
SerialPortLib itself.

We cannot implement these functions in ArmVirtPkg's SerialPortLib
instances *before* flipping the driver, because it would cause double
function definitions in the EmbeddedPkg driver. We also can't implement
the functions *after* flipping the driver, because it would cause
unresolved function references in the MdeModulePkg driver. Therefore
we have to implement the functions simultaneously with the driver
replacement.

Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Laszlo Ersek <lersek@redhat.com>
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18973 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoOvmfPkg XenConsoleSerialPortLib: Implement Get(Set)Control/SetAttributes
Star Zeng [Thu, 26 Nov 2015 08:51:34 +0000 (08:51 +0000)]
OvmfPkg XenConsoleSerialPortLib: Implement Get(Set)Control/SetAttributes

Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Laszlo Ersek <lersek@redhat.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18972 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoArmPlatformPkg: Use SerialDxe in MdeModulePkg instead of EmbeddedPkg
Star Zeng [Thu, 26 Nov 2015 08:51:05 +0000 (08:51 +0000)]
ArmPlatformPkg: Use SerialDxe in MdeModulePkg instead of EmbeddedPkg

It is also to integrate PL011SerialPortExtLib to PL011SerialPortLib.

Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Leif Lindholm <leif.lindholm@linaro.org>
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18971 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoBeagleBoardPkg: Use SerialDxe in MdeModulePkg instead of EmbeddedPkg
Star Zeng [Thu, 26 Nov 2015 08:50:16 +0000 (08:50 +0000)]
BeagleBoardPkg: Use SerialDxe in MdeModulePkg instead of EmbeddedPkg

It is also to remove the reference to TemplateSerialPortExtLib in
EmbeddedPkg.

Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Leif Lindholm <leif.lindholm@linaro.org>
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18970 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoOmap35xxPkg SerialPortLib: Implement Get(Set)Control/SetAttributes
Star Zeng [Thu, 26 Nov 2015 08:49:53 +0000 (08:49 +0000)]
Omap35xxPkg SerialPortLib: Implement Get(Set)Control/SetAttributes

Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Leif Lindholm <leif.lindholm@linaro.org>
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18969 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoCorebootPayloadPkg: Use SerialDxe in MdeModulePkg
Star Zeng [Thu, 26 Nov 2015 08:49:26 +0000 (08:49 +0000)]
CorebootPayloadPkg: Use SerialDxe in MdeModulePkg

1. Update fdf and dsc to use SerialDxe in MdeModulePkg.
2. Separate the code that gets SerialRegBase and SerialRegAccessType
   by CbParseLib from CorebootPayloadPkg/Library/SerialPortLib to
   PlatformHookLib, and then leverage BaseSerialPortLib16550 in
   MdeModulePkg.
3. Remove CorebootPayloadPkg/SerialDxe and
   CorebootPayloadPkg/Library/SerialPortLib.

Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Maurice Ma <maurice.ma@intel.com>
Cc: Prince Agyeman <prince.agyeman@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Maurice Ma <maurice.ma@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18968 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoEmulatorPkg: Use SerialDxe in MdeModulePkg instead of EmbeddedPkg
Star Zeng [Thu, 26 Nov 2015 08:48:38 +0000 (08:48 +0000)]
EmulatorPkg: Use SerialDxe in MdeModulePkg instead of EmbeddedPkg

It is also to add GetControl/SetControl/SetAttributes implementation
for DxeEmuSerialPortLib.

Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Andrew Fish <afish@apple.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18967 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoMdeModulePkg: Upstream SerialDxe from EmbeddedPkg
Star Zeng [Thu, 26 Nov 2015 08:48:10 +0000 (08:48 +0000)]
MdeModulePkg: Upstream SerialDxe from EmbeddedPkg

This Serial driver layers on top of a Serial Port Library instance
to produce serial IO protocol.

There is also another SerialDxe implementation in CorebootPayloadPkg,
but SerialDxe from EmbeddedPkg should be better that also consumes
the extended interfaces GetControl/SetControl/SetAttributes in
EmbeddedPkg/Include/Library/SerialPortExtLib.h for serial IO protocol.
And the extended interfaces GetControl/SetControl/SetAttributes in
EmbeddedPkg/Include/Library/SerialPortExtLib.h has been upstream to
MdePkg/Include/Library/SerialPortLib.h.

Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Feng Tian <feng.tian@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>
Reviewed-by: Michael Kinney <michael.d.kinney@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18966 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoMdeModulePkg BaseSerialPortLib16550:Implement Get(Set)Control/SetAttributes
Star Zeng [Thu, 26 Nov 2015 08:47:44 +0000 (08:47 +0000)]
MdeModulePkg BaseSerialPortLib16550:Implement Get(Set)Control/SetAttributes

Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Feng Tian <feng.tian@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>
Reviewed-by: Michael D Kinney <michael.d.kinney@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18965 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoPcAtChipsetPkg SerialIoLib: Implement Get(Set)Control/SetAttributes
Star Zeng [Thu, 26 Nov 2015 08:47:15 +0000 (08:47 +0000)]
PcAtChipsetPkg SerialIoLib: Implement Get(Set)Control/SetAttributes

Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Ruiyu Ni <ruiyu.ni@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>
Reviewed-by: Michael D Kinney <michael.d.kinney@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18964 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoMdePkg SerialPortLib: Upstream Get(Set)Control/SetAttributes interfaces
Star Zeng [Thu, 26 Nov 2015 08:46:52 +0000 (08:46 +0000)]
MdePkg SerialPortLib: Upstream Get(Set)Control/SetAttributes interfaces

The extended interfaces GetControl/SetControl/SetAttributes are from
EmbeddedPkg/Include/Library/SerialPortExtLib.h.

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

8 years agoMdeModulePkg: TerminalDxe: avoid checking uninitialized variable
Star Zeng [Thu, 26 Nov 2015 08:46:20 +0000 (08:46 +0000)]
MdeModulePkg: TerminalDxe: avoid checking uninitialized variable

The SerialIo->GetControl() function is not required to set the
Control output parameter on error. Make sure we apply the
EFI_SERIAL_INPUT_BUFFER_EMPTY optimization in
TerminalConInTimerHandler() only if the SerialIo->GetControl()
function call set that bit in the Control variable.

Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Feng Tian <feng.tian@intel.com>
Cc: Laszlo Ersek <lersek@redhat.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Suggested-by: Laszlo Ersek <lersek@redhat.com>
Signed-off-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Michael Kinney <michael.d.kinney@intel.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18962 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoNetworkPkg:Fix NULL pointer dereference issues.
Zhang Lubo [Thu, 26 Nov 2015 08:17:46 +0000 (08:17 +0000)]
NetworkPkg:Fix NULL pointer dereference issues.

Revise some errors that some Null pointers may be dereferenced.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Zhang Lubo <lubo.zhang@intel.com>
Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>
Reviewed-by: Ye Ting <ting.ye@intel.com>
Reviewed-by: Wu Jiaxin <jiaxin.wu@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18961 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoAlways set WP in CR0.
Yao, Jiewen [Thu, 26 Nov 2015 07:01:08 +0000 (07:01 +0000)]
Always set WP in CR0.

Always set RW+P bit for page table by default.

So that we can use write-protection for code later.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: "Yao, Jiewen" <jiewen.yao@intel.com>
Reviewed-by: "Kinney, Michael D" <michael.d.kinney@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18960 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoMdeModulePkg:Correct the file name in UiApp.inf
Dandan Bi [Thu, 26 Nov 2015 06:37:14 +0000 (06:37 +0000)]
MdeModulePkg:Correct the file name in UiApp.inf

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

8 years agoAdd 2 APIs in SmmCpuFeaturesLib.
Yao, Jiewen [Thu, 26 Nov 2015 04:12:53 +0000 (04:12 +0000)]
Add 2 APIs in SmmCpuFeaturesLib.

Add NULL func for 2 new APIs in SmmCpuFeaturesLib.

SmmCpuFeaturesCompleteSmmReadyToLock() is a hook point to allow
CPU specific code to do more registers setting after
the gEfiSmmReadyToLockProtocolGuid notification is completely processed.
Add SmmCpuFeaturesCompleteSmmReadyToLock() to PerformRemainingTasks() and PerformPreTasks().

SmmCpuFeaturesAllocatePageTableMemory() is an API to allow
CPU to allocate a specific region for storing page tables.
All page table allocation will use AllocatePageTableMemory().

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: "Yao, Jiewen" <jiewen.yao@intel.com>
Reviewed-by: "Kinney, Michael D" <michael.d.kinney@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18958 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoAllocate Tile size based on Page.
Yao, Jiewen [Thu, 26 Nov 2015 03:56:33 +0000 (03:56 +0000)]
Allocate Tile size based on Page.

We had better separate code from data in tile in page level,
so that other program may use page level protection on that.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: "Yao, Jiewen" <jiewen.yao@intel.com>
Reviewed-by: "Kinney, Michael D" <michael.d.kinney@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18957 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoShellPkg: Add NULL check to pointer returned from 'AllocateZeroPool'.
Qiu Shumin [Thu, 26 Nov 2015 01:51:52 +0000 (01:51 +0000)]
ShellPkg: Add NULL check to pointer returned from 'AllocateZeroPool'.

When CustomCumulativeToken is not NULL, the CustomCumulativeData is expected non-NULL.
Add 'ASSERT' statement to ensure this.

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

8 years agoPerformancePkg\Dp_App: Add NULL check to pointer returned from 'AllocateZeroPool'.
Qiu Shumin [Thu, 26 Nov 2015 01:47:14 +0000 (01:47 +0000)]
PerformancePkg\Dp_App: Add NULL check to pointer returned from 'AllocateZeroPool'.

When CustomCumulativeToken is not NULL, the CustomCumulativeData is expected non-NULL.
Add 'ASSERT' statement to ensure this.

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

8 years agoShellPkg: fix RVCT warning due to CONST in typecast.
Cohen Eugene [Thu, 26 Nov 2015 01:04:41 +0000 (01:04 +0000)]
ShellPkg: fix RVCT warning due to CONST in typecast.

Building the latest shell on RVCT exposed this warning:

ShellPkg\Application\Shell\Shell.c(1090,69): error #191-D: type qualifier is meaningless on cast type

The CONST in the cast was deemed meaningless.  Removing the CONST fixed the warning.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Cohen Eugene <eugene@hp.com>
Reviewed-by: Qiu Shumin <shumin.qiu@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18954 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoArmPkg/PeiServicesTablePointerLib: add missing MigratePeiServicesTablePointer()
Eugene Cohen [Wed, 25 Nov 2015 20:06:41 +0000 (20:06 +0000)]
ArmPkg/PeiServicesTablePointerLib: add missing MigratePeiServicesTablePointer()

As of SVN 15115, the PEI core needs a MigratePeiServicesTablePointer function.

Background: The ArmPkg variant of the PeiServicesTablePointerLib implements
the standard PEI Services table retrieval mechanism as defined in the
PI Specification Volume 1 section 5.4.4 using the TPIDRURW registers.
No special action is required on ARM to migrate the PEI Services table
pointer after main memory initialization but a function must be implemented
nonetheless.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Eugene Cohen <eugene@hp.com>
Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18953 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoArmPkg/UncachedMemoryAllocationLib: fix warning about uninitialized local var
Eugene Cohen [Wed, 25 Nov 2015 19:50:05 +0000 (19:50 +0000)]
ArmPkg/UncachedMemoryAllocationLib: fix warning about uninitialized local var

RVCT (the proprietary 32-bit ARM compiler) warns about Node potentially being
used uninitialized, so initialize it to NULL explicitly.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Eugene Cohen <eugene@hp.com>
Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18952 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoUefiCpuPkg/CpuS3DataDxe: Add module to initialize ACPI_CPU_DATA for S3
Michael Kinney [Wed, 25 Nov 2015 17:01:02 +0000 (17:01 +0000)]
UefiCpuPkg/CpuS3DataDxe: Add module to initialize ACPI_CPU_DATA for S3

This module initializes the ACPI_CPU_DATA structure and registers the
address of this structure in the PcdCpuS3DataAddress PCD.  This is a
generic/simple version of this module.  It does not provide a machine
check handler or CPU register initialization tables for ACPI S3 resume.
It also only supports the number of CPUs reported by the MP Services
Protocol, so this module does not support hot plug CPUs.  This module
can be copied into a CPU specific package and customized if these
additional features are required.

This patch series is in response to the OvmfPkg patch series from
Laszlo Ersek that enables SMM on OVMF.  The v4 version of the patch
series from Laszlo includes an OVMF specific CPU module to initialize
the ACPI_CPU_DATA structure.

This proposed patch series replaces the patches listed below.

[PATCH v4 27/41] OvmfPkg:
  add skeleton QuarkPort/CpuS3DataDxe

[PATCH v4 28/41] OvmfPkg:
  QuarkPort/CpuS3DataDxe: fill in ACPI_CPU_DATA.StartupVector

[PATCH v4 29/41] OvmfPkg:
  QuarkPort/CpuS3DataDxe: handle IDT, GDT and MCE in ACPI_CPU_DATA

[PATCH v4 30/41] OvmfPkg:
  QuarkPort/CpuS3DataDxe: handle StackAddress and StackSize

[PATCH v4 31/41] OvmfPkg:
  import CpuConfigLib header from Quark_EDKII_v1.1.0/IA32FamilyCpuBasePkg

[PATCH v4 32/41] OvmfPkg:
  QuarkPort/CpuS3DataDxe: fill in ACPI_CPU_DATA.NumberOfCpus

[PATCH v4 33/41] OvmfPkg:
  QuarkPort/CpuS3DataDxe: fill in ACPI_CPU_DATA.MtrrTable

[PATCH v4 34/41] OvmfPkg:
  QuarkPort/CpuS3DataDxe: handle register tables in ACPI_CPU_DATA

[PATCH v4 35/41] OvmfPkg:
  port CpuS3DataDxe to X64
  patch originally authored by Paolo Bonzini

[PATCH v4 36/41] OvmfPkg:
  build QuarkPort/CpuS3DataDxe for -D SMM_REQUIRE

Cc: Laszlo Ersek <lersek@redhat.com>
Cc: "Yao, Jiewen" <jiewen.yao@intel.com>
Cc: "Fan, Jeff" <jeff.fan@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Michael Kinney <michael.d.kinney@intel.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Tested-by: Laszlo Ersek <lersek@redhat.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18951 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoUefiCpuPkg/Include: Expand description of AcpiCpuData.h structures
Michael Kinney [Wed, 25 Nov 2015 17:00:51 +0000 (17:00 +0000)]
UefiCpuPkg/Include: Expand description of AcpiCpuData.h structures

Provide a more detailed description of each field of the
ACPI_CPU_DATA and CPU_REGISTER_TABLE structures.

Cc: Laszlo Ersek <lersek@redhat.com>
Cc: "Yao, Jiewen" <jiewen.yao@intel.com>
Cc: "Fan, Jeff" <jeff.fan@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Michael Kinney <michael.d.kinney@intel.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Tested-by: Laszlo Ersek <lersek@redhat.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18950 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoMove CommunicationBuffer from stack to global variable.
Yao, Jiewen [Wed, 25 Nov 2015 13:14:27 +0000 (13:14 +0000)]
Move CommunicationBuffer from stack to global variable.

We had put communication buffer to Runtime memory,
so that SMI handler can know it is not used by OS.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: "Yao, Jiewen" <jiewen.yao@intel.com>
Reviewed-by: "Zeng, Star" <star.zeng@intel.com>
Reviewed-by: "Kinney, Michael D" <michael.d.kinney@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18949 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoMove SmmDebug feature from ASM to C.
Yao, Jiewen [Wed, 25 Nov 2015 08:51:15 +0000 (08:51 +0000)]
Move SmmDebug feature from ASM to C.

SmmDebug feature is implemented in ASM, which is not easy to maintain.
So we move it to C function.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: "Yao, Jiewen" <jiewen.yao@intel.com>
Reviewed-by: "Kinney, Michael D" <michael.d.kinney@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18946 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoInstall LoadedImage protocol for PiSmmCore.
Yao, Jiewen [Wed, 25 Nov 2015 08:40:49 +0000 (08:40 +0000)]
Install LoadedImage protocol for PiSmmCore.

PiSmmCore installs LoadedImage for each SMM driver. However itself is missing.
So we follow DxeCore style, let PiSmmCore installs LoadedImage protocol for itself,
then the SMM image information is complete.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: "Yao, Jiewen" <jiewen.yao@intel.com>
Reviewed-by: "Zeng, Star" <star.zeng@intel.com>
Reviewed-by: "Kinney, Michael D" <michael.d.kinney@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18945 6f19259b-4bc3-4df7-8a09-765794883524

8 years ago[CryptoPkg] Correct one typo in the API comments.
Qin Long [Wed, 25 Nov 2015 08:34:57 +0000 (08:34 +0000)]
[CryptoPkg] Correct one typo in the API comments.

Correct one typo (SingerChainCerts --> SignerChainCerts) in the comments
for Pkcs7GetCertificatesList() API.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Qin Long <qin.long@intel.com>
Reviewed-by: Shumin Qiu <shumin.qiu@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18944 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoMdeModulePkg: Clean code to follow C Coding style.
Zhang Lubo [Wed, 25 Nov 2015 08:08:25 +0000 (08:08 +0000)]
MdeModulePkg: Clean code to follow C Coding style.

Clean code to follow C Coding style.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Zhang Lubo <lubo.zhang@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18943 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoMove RestoreSmmConfigurationInS3 function to PerformPreTasks().
Yao, Jiewen [Wed, 25 Nov 2015 04:28:46 +0000 (04:28 +0000)]
Move RestoreSmmConfigurationInS3 function to PerformPreTasks().

In this way, we can centralize the silicon configuration in
PerformRemainingTasks()/PerformPreTasks() function.
If there are more features need to be configured, they can put in
PerformRemainingTasks()/PerformPreTasks() only.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: "Yao, Jiewen" <jiewen.yao@intel.com>
Reviewed-by: "Kinney, Michael D" <michael.d.kinney@intel.com>
Reviewed-by: "Laszlo Ersek" <lersek@redhat.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18938 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoEliminate EFI_IMAGE_MACHINE_TYPE_SUPPORTED.
Yao, Jiewen [Wed, 25 Nov 2015 04:23:01 +0000 (04:23 +0000)]
Eliminate EFI_IMAGE_MACHINE_TYPE_SUPPORTED.

Move Gdt initialization from InitializeMpServiceData() to CPU Arch specific function.
We create SmmFuncsArch.c for hold CPU specific function, so that
EFI_IMAGE_MACHINE_TYPE_SUPPORTED(EFI_IMAGE_MACHINE_X64) can be removed.

For IA32 version, we always allocate new page for GDT entry, for easy maintenance.
For X64 version, we fixed TssBase in GDT entry to make sure TSS data is correct.
Remove TSS fixup for GDT in ASM file.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: "Yao, Jiewen" <jiewen.yao@intel.com>
Reviewed-by: "Fan, Jeff" <jeff.fan@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18937 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoUninstall LoadedImage protocol if SMM driver returns error and is unloaded.
Yao, Jiewen [Wed, 25 Nov 2015 04:05:49 +0000 (04:05 +0000)]
Uninstall LoadedImage protocol if SMM driver returns error and is unloaded.

Original code does not uninstall LoadedImage protocol if SMM driver returns error and is unloaded.
It causes a wrong LoadedImage protocol existing in system.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: "Yao, Jiewen" <jiewen.yao@intel.com>
Reviewed-by: "Zeng, Star" <star.zeng@intel.com>
Reviewed-by: "Kinney, Michael D" <michael.d.kinney@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18936 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoCorrect TSS segment.
Yao, Jiewen [Wed, 25 Nov 2015 04:01:00 +0000 (04:01 +0000)]
Correct TSS segment.

TSS segment should use (SIZE - 1) as limit, and do not set G bit (highest bit of LimitHigh) because limit means byte count.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: "Yao, Jiewen" <jiewen.yao@intel.com>
Reviewed-by: "Fan, Jeff" <jeff.fan@intel.com>
Reviewed-by: "Kinney, Michael D" <michael.d.kinney@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18935 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoUefiCpuPkg/CpuMpPei: Enable x2APIC mode on BSP/APs
Jeff Fan [Wed, 25 Nov 2015 02:47:59 +0000 (02:47 +0000)]
UefiCpuPkg/CpuMpPei: Enable x2APIC mode on BSP/APs

If x2APIC flag is set, enable x2APIC mode on all APs and BSP. Before we wakeup
APs to enable x2APIC mode, we should wait all APs have finished initialization.

Cc: Feng Tian <feng.tian@intel.com>
Cc: Michael Kinney <michael.d.kinney@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jeff Fan <jeff.fan@intel.com>
Reviewed-by: Michael Kinney <michael.d.kinney@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18934 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoUefiCpuPkg/CpuMpPei: Set X2APIC flag if one x2APIC ID larger than 254
Jeff Fan [Wed, 25 Nov 2015 02:47:34 +0000 (02:47 +0000)]
UefiCpuPkg/CpuMpPei: Set X2APIC flag if one x2APIC ID larger than 254

If there are any logical processor reporting an APIC ID of 255 or greater, set
X2ApicEnable flag.

GetInitialApicId() will return x2APIC ID if CPUID leaf B supported.

Cc: Feng Tian <feng.tian@intel.com>
Cc: Michael Kinney <michael.d.kinney@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jeff Fan <jeff.fan@intel.com>
Reviewed-by: Michael Kinney <michael.d.kinney@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18933 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoCheck InternalAllocPoolByIndex status before refer buffer.
Zeng, Star [Wed, 25 Nov 2015 02:33:06 +0000 (02:33 +0000)]
Check InternalAllocPoolByIndex status before refer buffer.

Original code refers FreePoolHdr without check Status. It is obvious wrong and has risk.

Aslo, if InternalAllocPoolByIndex() returns an error, then *FreePoolHdr is assigned to an uninitialized value. So we init Hdr be NULL.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: "Zeng, Star" <star.zeng@intel.com>
Reviewed-by: "Yao, Jiewen" <jiewen.yao@intel.com>
Reviewed-by: "Fan, Jeff" <jeff.fan@intel.com>
Reviewed-by: "Kinney, Michael D" <michael.d.kinney@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18932 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoBaseTools/GenFw ARM: allow R_ARM_REL32 relocations
Ard Biesheuvel [Tue, 24 Nov 2015 08:40:33 +0000 (08:40 +0000)]
BaseTools/GenFw ARM: allow R_ARM_REL32 relocations

R_ARM_REL32 are relative relocations, so we don't need to do anything
special when performing the ELF to PE/COFF conversion, since our memory
layout is identical between the two binary formats. So just allow them.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Liming Gao <liming.gao@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18931 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoArmLib/ArmV7Mmu: use 64-bit type for mapping region size
Ard Biesheuvel [Tue, 24 Nov 2015 07:48:06 +0000 (07:48 +0000)]
ArmLib/ArmV7Mmu: use 64-bit type for mapping region size

The way the v7 MMU code is invoked by the Xen port is somewhat of
a pathological case, since it describes its physical memory space
using a single cacheable region that covers the entire addressable
range. When clipping this region to the part that is 1:1 addressable,
we end up with a region of exactly 4 GB in size, which just exceeds
the range of the UINT32 variable we use in FillTranslationTable() to
track our progress while populating the page tables. So promote it
to UINT64 instead.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18930 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoArmVirtPkg/ArmVirtPlatformLib: reduce ID map size to GCD region size
Ard Biesheuvel [Tue, 24 Nov 2015 07:44:41 +0000 (07:44 +0000)]
ArmVirtPkg/ArmVirtPlatformLib: reduce ID map size to GCD region size

The ID mapping routines on virtual platforms simply map the entire
hardware supported physical address space as device memory, and then
punch some holes for regions that need to be mapped cacheable.
On virtual platforms hosted on CPUs that support a large physical
address range, this may result in a lot of overhead, i.e., 4 KB of page
tables for each 512 GB of address space, which quickly adds up (i.e.,
2 MB for the architectural maximum of 48 bits).

Since there may be a platform specific limit to the size of the (I)PA
space that is not reflected by CPU id registers, restrict the range of
the ID mapping to gEmbeddedTokenSpaceGuid.PcdPrePiCpuMemorySize bits.
This makes sense by itself, since we cannot manipulate mappings above
that limit anwyay (because they are not covered by GCD), and it allows
the PCD be set to a lower value by platforms whose (I)PA space is
smaller than the hardware supported maximum.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Tested-by: Wei Huang <wei@redhat.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18929 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoArmVirtPkg/ArmVirtQemu: limit the (I)PA space to 40 bits
Ard Biesheuvel [Tue, 24 Nov 2015 07:44:28 +0000 (07:44 +0000)]
ArmVirtPkg/ArmVirtQemu: limit the (I)PA space to 40 bits

KVM uses a fixed size of 40 bits for its intermediate physical address
space, so there is no need to support anything beyond that even if the
host hardware does.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Tested-by: Wei Huang <wei@redhat.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18928 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoMdeModulePkg/BdsDxe: Fix EBC build failure
Ruiyu Ni [Tue, 24 Nov 2015 06:57:47 +0000 (06:57 +0000)]
MdeModulePkg/BdsDxe: Fix EBC build failure

Define EFI_REMOVABLE_MEDIA_FILE_NAME for EBC ARCH to fix EBC build failure.

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

8 years agoMdeModulePkg/UefiBootManagerLib: Always create MemoryTypeInfo variable
Ruiyu Ni [Tue, 24 Nov 2015 06:56:05 +0000 (06:56 +0000)]
MdeModulePkg/UefiBootManagerLib: Always create MemoryTypeInfo variable

Align to old BDS behavior (IntelFrameworkModulePkg/BDS) to always create
MemoryTypeInfo variable regardless of the PcdResetOnMemoryTypeInformationChange
value.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Michael Kinney <michael.d.kinney@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18926 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoShellBinPkg: Arm/AArch64 Shell binary update.
Leif Lindholm [Mon, 23 Nov 2015 19:34:40 +0000 (19:34 +0000)]
ShellBinPkg: Arm/AArch64 Shell binary update.

The binaries of ShellBinPkg are generated with ShellPkg from r18915.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Leif Lindholm <leif.lindholm@linaro.org>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18925 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoMdeModulePkg:Refine the UiApp
Dandan Bi [Mon, 23 Nov 2015 09:37:24 +0000 (09:37 +0000)]
MdeModulePkg:Refine the UiApp

Use new created libraries(Boot Manager,Device Manager,Boot Maintenance
Manager) in UiApp.So remove and refine relative code in UiApp.And update
the Nt32Pkg.dsc and MdeModulePkg.dsc.

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

8 years agoMdeModulePkg:Create Boot Maintenance Manager Library
Dandan Bi [Mon, 23 Nov 2015 09:34:55 +0000 (09:34 +0000)]
MdeModulePkg:Create Boot Maintenance Manager Library

Split the boot maintenance manager library from UiApp in MdeModulePkg/Application
and put the library in MdeModulePkg/Library.

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

8 years agoMdeModulePkg:Create Device Manager Library
Dandan Bi [Mon, 23 Nov 2015 09:33:42 +0000 (09:33 +0000)]
MdeModulePkg:Create Device Manager Library

Split the device manager library from UiApp in MdeModulePkg/Application
and put the library in MdeModulePkg/Library.

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

8 years agoMdeModulePkg:Create Boot Manager Library
Dandan Bi [Mon, 23 Nov 2015 09:32:08 +0000 (09:32 +0000)]
MdeModulePkg:Create Boot Manager Library

Split the boot manager library from UiApp in MdeModulePkg/Application
and put the library in MdeModulePkg/Library.

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

8 years agoArmPkg: Invalidate cache after allocating UC memory
Heyi Guo [Mon, 23 Nov 2015 07:48:33 +0000 (07:48 +0000)]
ArmPkg: Invalidate cache after allocating UC memory

It is implied that the memory returned from UncachedMemoryAllocationLib
should have cache invalidated. So we invalidate memory range after
changing memory attribute to uncached.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Heyi Guo <heyi.guo@linaro.org>
Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18920 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoMdeModulePkg DxeFileExplorerProtocol: Create wrapper fileexplorer library.
Eric Dong [Mon, 23 Nov 2015 05:42:50 +0000 (05:42 +0000)]
MdeModulePkg DxeFileExplorerProtocol: Create wrapper fileexplorer library.

This library wrapper explorer protocol and produce the file explorer library.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Eric Dong <eric.dong@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Samer El-Haj-Mahmoud <elhaj@hpe.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18919 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoMdeModulePkg FileExplorerDxe: Create file explorer Protocol.
Eric Dong [Mon, 23 Nov 2015 05:42:21 +0000 (05:42 +0000)]
MdeModulePkg FileExplorerDxe: Create file explorer Protocol.

This driver produces file explorer protocol layered on top of the FileExplorerLib.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Eric Dong <eric.dong@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Samer El-Haj-Mahmoud <elhaj@hpe.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18918 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoMdeModulePkg FileExplorerLib: Create file explorer library.
Eric Dong [Mon, 23 Nov 2015 05:41:28 +0000 (05:41 +0000)]
MdeModulePkg FileExplorerLib: Create file explorer library.

This library support select one file from the specified directory or from system root directory.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Eric Dong <eric.dong@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Samer El-Haj-Mahmoud <elhaj@hpe.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18917 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoMdeModulePkg/BootLogoLib: Fix GCC build failure
Ruiyu Ni [Mon, 23 Nov 2015 00:48:46 +0000 (00:48 +0000)]
MdeModulePkg/BootLogoLib: Fix GCC build failure

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

8 years agoArmPkg: ArmLib: purge incorrect ArmDrainWriteBuffer () alias
Leif Lindholm [Fri, 20 Nov 2015 13:14:59 +0000 (13:14 +0000)]
ArmPkg: ArmLib: purge incorrect ArmDrainWriteBuffer () alias

In ArmLib, there exists an alias for ArmDataSynchronizationBarrier,
named after one of several names for the pre-ARMv6 cp15 operation that
was formalised into the Data Synchronization Barrier in ARMv6.

This alias is also the one called from within ArmLib, in preference of
the correct name. Through the power of code reuse, this name slipped
into the AArch64 variant as well.

Expunge it from the codebase.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Leif Lindholm <leif.lindholm@linaro.org>
Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18915 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoUefiCpuPkg/CpuDxe: Don't use gBS->Stall
Jordan Justen [Fri, 20 Nov 2015 08:22:46 +0000 (08:22 +0000)]
UefiCpuPkg/CpuDxe: Don't use gBS->Stall

The CpuDxe driver may run before the gEfiMetronomeArchProtocolGuid
protocol is installed. gBS->Stall does not work until this arch
protocol is installed.

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

8 years agoMdeModulePkg BaseSerialPortLib16550: Fix typo in SerialPortWrite()
Star Zeng [Fri, 20 Nov 2015 01:51:15 +0000 (01:51 +0000)]
MdeModulePkg BaseSerialPortLib16550: Fix typo in SerialPortWrite()

The "read" word in SerialPortWrite() header comment block should be
"write".

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

8 years agoPcAtChipsetPkg SerialIoLib: Fix typo in SerialPortWrite()
Star Zeng [Fri, 20 Nov 2015 01:50:34 +0000 (01:50 +0000)]
PcAtChipsetPkg SerialIoLib:  Fix typo in SerialPortWrite()

The "read" word in SerialPortWrite() header comment block should be
"write".

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

8 years agoMdePkg SerialPortLib: Fix typo in SerialPortWrite()
Star Zeng [Fri, 20 Nov 2015 01:49:48 +0000 (01:49 +0000)]
MdePkg SerialPortLib:  Fix typo in SerialPortWrite()

The "read" word in SerialPortWrite() header comment block should be
"write".

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

8 years agoMdePkg SerialIo.h: Fix typo "buts" to "bits"
Star Zeng [Fri, 20 Nov 2015 01:46:42 +0000 (01:46 +0000)]
MdePkg SerialIo.h: Fix typo "buts" to "bits"

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

8 years agoUefiCpuPkg/SmmFeatureLib: Check SmmFeatureControl by Code_Access_Chk
Jeff Fan [Fri, 20 Nov 2015 01:23:52 +0000 (01:23 +0000)]
UefiCpuPkg/SmmFeatureLib: Check SmmFeatureControl by Code_Access_Chk

Bit SMM_Code_Access_Chk (SMM-RO) in MSR_SMM_MCA_CAP is defined in SDM.
If set to 1 indicates that the SMM code access restriction is supported and the
MSR_SMM_FEATURE_CONTROL is supported.

If this bit is not set, we needn't to access register SmmFetureControl.
Otherwise, #GP exception may happen.
We need to check if SmmFeatureControl support or not by checking
SMM_Code_Access_Chk (SMM-RO) in MSR_SMM_MCA_CAP.

Because MSR_SMM_MCA_CAP is SMM-RO register, we should move this check from
SmmCpuFeaturesLibConstructor (non-SMM) to SmmCpuFeaturesInitializeProcessor
(SMM).

Cc: Michael Kinney <michael.d.kinney@intel.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jeff Fan <jeff.fan@intel.com>
Reviewed-by: Michael Kinney <michael.d.kinney@intel.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18906 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoUefiCpuPkg: Not touch SmmFeatureControl if Code_Access_Chk not Set
Jeff Fan [Fri, 20 Nov 2015 01:22:00 +0000 (01:22 +0000)]
UefiCpuPkg: Not touch SmmFeatureControl if Code_Access_Chk not Set

Bit SMM_Code_Access_Chk (SMM-RO) in MSR_SMM_MCA_CAP is defined in SDM.
If set to 1 indicates that the SMM code access restriction is supported and the
MSR_SMM_FEATURE_CONTROL is supported.

If this bit is not set, we needn't to access register SmmFetureControl.
Otherwise, #GP exception may happen.

Cc: Michael Kinney <michael.d.kinney@intel.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jeff Fan <jeff.fan@intel.com>
Reviewed-by: Michael Kinney <michael.d.kinney@intel.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18905 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoArmPkg/ArmPlatformPkg: position vectors relative to base
Mark Rutland [Thu, 19 Nov 2015 14:39:48 +0000 (14:39 +0000)]
ArmPkg/ArmPlatformPkg: position vectors relative to base

We currently rely on .align directives to ensure that each exception
vector entry is the appropriate offset from the vector base address.

This is slightly fragile, as were an entry to become too large (greater
than 32 A64 instructions), all following entries would be silently
shifted until they meet the next alignment boundary. Thus we might
execute the wrong code in response to an exception.

To prevent this, introduce a new macro, VECTOR_ENTRY, that uses .org
directives to position each entry at the precise required offset from
the base of a vector. A vector entry which is too large will trigger a
build failure rather than a runtime failure which is difficult to debug.

For consistency, the base and end of each vector is similarly annotated,
with VECTOR_BASE and VECTOR_END, which provide the necessary alignment
and symbol exports. The now redundant directives and labels are removed.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Mark Rutland <mark.rutland@arm.com>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18904 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoArmPkg: correct TTBR1_EL1 settings in TCR_EL1
Mark Rutland [Thu, 19 Nov 2015 14:14:25 +0000 (14:14 +0000)]
ArmPkg: correct TTBR1_EL1 settings in TCR_EL1

As EDK2 runs in an idmap, we do not use TTBR1_EL1, nor do we configure
it. TTBR1_EL1 may contain UNKNOWN values if it is not programmed since
reset.

Prior to enabling the MMU, we do not set TCR_EL1.EPD1, and hence the CPU
may make page table walks via TTBR1_EL1 at any time, potentially using
UNKNOWN values. This can result in a number of potential problems (e.g.
the CPU may load from MMIO registers as part of a page table walk).

Additionally, in the presence of Cortex-A57 erratum #822227, we must
program TCR_EL1.TG1 == 0b1x (e.g. 4KB granule) regardless of the value
of TCR_EL1.EPD1, to ensure that EDK2 can make forward progress under a
hypervisor which makes use of PAR_EL1.

This patch ensures that we program TCR_EL1.EPD1 and TCR_EL1.TG1 as above
to avoid these issues. TCR_EL1.TG1 is set to 4K for all targets, as any
CPU capable of running EDK2 must support this granule, and given
TCR_EL1.EPD1, programming the field is not detrimental in the absence of
the erratum.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Mark Rutland <mark.rutland@arm.com>
Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18903 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoShellPkg: Corrected CatSPrint usage to prevent memory leaks.
Cecil Sheng [Thu, 19 Nov 2015 08:37:03 +0000 (08:37 +0000)]
ShellPkg: Corrected CatSPrint usage to prevent memory leaks.

CatSPrint allocates return buffer for the caller. The caller doesn't have to allocate one, and has to free the used buffers.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Cecil Sheng <cecil.sheng@hpe.com>
Reviewed-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@18902 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoArmPkg/ArmV7Mmu: handle memory regions over 4 GB correctly
Ard Biesheuvel [Wed, 18 Nov 2015 16:18:40 +0000 (16:18 +0000)]
ArmPkg/ArmV7Mmu: handle memory regions over 4 GB correctly

The ARM_MEMORY_REGION_DESCRIPTOR array provided by the platform may
contain entries that extend beyond the 4 GB boundary, above which
we can't map anything on 32-bit ARM. If this is the case, map only
the 1:1 addressable part.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18900 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoArmPkg/ArmV7Lib: take MP extensions into account when programming TTBR
Ard Biesheuvel [Wed, 18 Nov 2015 15:59:59 +0000 (15:59 +0000)]
ArmPkg/ArmV7Lib: take MP extensions into account when programming TTBR

Bits 0 and 6 of the TTBRx system registers have different meanings
depending on whether a system implements the Multiprocessing
Extensions. So use separate memory attribute definitions for MP and
non-MP.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18899 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoArmPkg/ArmV7Lib: fix definition of TTBR_NON_INNER_CACHEABLE
Ard Biesheuvel [Wed, 18 Nov 2015 15:59:42 +0000 (15:59 +0000)]
ArmPkg/ArmV7Lib: fix definition of TTBR_NON_INNER_CACHEABLE

The definition of TTBR_NON_INNER_CACHEABLE should be bit 0 cleared, not
bit 0 set. Furthermore, the name is inconsistent with the other definitions
so rename it to TTBR_INNER_NON_CACHEABLE.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18898 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoArmPkg/ArmV7Mmu: introduce feature PCD to map normal memory non-shareable
Ard Biesheuvel [Wed, 18 Nov 2015 15:59:22 +0000 (15:59 +0000)]
ArmPkg/ArmV7Mmu: introduce feature PCD to map normal memory non-shareable

Even though mapping normal memory (inner) shareable is usually the
correct choice on coherent systems, it may be desirable in some cases
to use non-shareable mappings for normal memory, e.g., when hardware
managed coherency is not required and the memory system is not fully
configured yet. So introduce a PCD PcdNormalMemoryNonshareableOverride
that makes cacheable mappings of normal memory non-shareable.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18897 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoArmPkg/ArmV7Mmu: make cached translation table accesses shareable
Ard Biesheuvel [Wed, 18 Nov 2015 15:59:04 +0000 (15:59 +0000)]
ArmPkg/ArmV7Mmu: make cached translation table accesses shareable

To align with the way normal cacheable memory is mapped, set the
shareable bit for cached accesses performed by the page table walker.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18896 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoArmPkg/ArmV7Lib: add function to test for presence of MP extensions
Ard Biesheuvel [Wed, 18 Nov 2015 15:58:46 +0000 (15:58 +0000)]
ArmPkg/ArmV7Lib: add function to test for presence of MP extensions

Some MMU manipulation is dependent on the presence of the multiprocessing
extensions. So add a function that returns this information.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18895 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoArmPkg/ArmV7Lib: add support for reading the ID_MMFR0 system register
Ard Biesheuvel [Wed, 18 Nov 2015 15:58:26 +0000 (15:58 +0000)]
ArmPkg/ArmV7Lib: add support for reading the ID_MMFR0 system register

Implement an accessor function for the ID_MMFR0 system register, which
contains information about the VMSA implementation. We will need this
to access the number of shareability levels and the nature of their
implementations.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18894 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoArmPkg/ArmV7Mmu: fix write-through translation table accesses
Ard Biesheuvel [Wed, 18 Nov 2015 15:58:03 +0000 (15:58 +0000)]
ArmPkg/ArmV7Mmu: fix write-through translation table accesses

The definition TTBR_WRITE_THROUGH_NO_ALLOC makes little sense, since
a) its meaning is unclear in the context of TTBRx, since write through
   always implies Read-Allocate and no Write-Allocate
b) its definition equals the definition of TTBR_WRITE_BACK_ALLOC

So instead, rename it to TTBR_WRITE_THROUGH and update the definition
to reflect the name.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18893 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoArmPkg/Mmu: set required XN attributes for device mappings
Ard Biesheuvel [Wed, 18 Nov 2015 11:51:06 +0000 (11:51 +0000)]
ArmPkg/Mmu: set required XN attributes for device mappings

To prevent speculative intruction fetches from MMIO ranges that may
have side effects on reads, the architecture requires device mappings
to be created with the XN or UXN/PXN bits set (for the ARM/EL2 and
EL1&0 translation regimes, respectively.)

Note that, in the ARM case, this involves moving all accesses to a
client domain since permission attributes like XN are ignored from
a manager domain. The use of a client domain is actually mandated
explicitly by the UEFI spec.

Reported-by: Heyi Guo <heyi.guo@linaro.org>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18891 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoArmVExpressPkg/ArmVExpressLibRTSM: map NOR flash as normal memory
Ard Biesheuvel [Wed, 18 Nov 2015 11:50:50 +0000 (11:50 +0000)]
ArmVExpressPkg/ArmVExpressLibRTSM: map NOR flash as normal memory

Some users of this library (i.e., FVP-AArch64 and RTSM-A15_MPCore)
may be built to execute straight from NOR flash. Since device mappings
should have the XN attribute set (according to the architecture), mapping
the NOR flash as a device may prevent it from being executable.

Since the NOR flash DXE driver is perfectly capable of setting the correct
attributes for the region it needs to write to, and since we will be
executing from DRAM by that time anyway, we can simply map the NOR flash
as normal memory initially.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18890 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoArmVirtPkg/ArmVirtPlatformLib: map executable NOR region as normal memory
Ard Biesheuvel [Wed, 18 Nov 2015 11:50:33 +0000 (11:50 +0000)]
ArmVirtPkg/ArmVirtPlatformLib: map executable NOR region as normal memory

The ARM architecture version 7 and later mandates that device mappings
have the XN (non-executable) bit set, to prevent speculative instruction
fetches from read-sensitive regions. This implies that we should not map
regions as device if we want to execute from them, so the NOR region that
contains our FD image should be mapped as normal memory instead.

The MMU code deals correctly with overlapping ARM_MEMORY_REGION_DESCRIPTOR
entries, and later entries in the array take precedence over earlier ones.
So simply add an entry to the end of the array that overrides the mapping
attributes of the FD image, wherever it resides.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18889 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoArmPkg/AArch64Mmu: remove unused GcdAttributeToArmAttribute()
Ard Biesheuvel [Wed, 18 Nov 2015 11:50:12 +0000 (11:50 +0000)]
ArmPkg/AArch64Mmu: remove unused GcdAttributeToArmAttribute()

The function GcdAttributeToArmAttribute() is not used anywhere in the
code base, and is only defined for AARCH64 and not for ARM. It also
fails to set the bits for shareability and non-executability that we
require for correct operation. So remove it.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18888 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoMdeModulePkg PeiCore: PeiInstallPeiMemory improper ASSERT test on second call
Star Zeng [Wed, 18 Nov 2015 10:13:31 +0000 (10:13 +0000)]
MdeModulePkg PeiCore: PeiInstallPeiMemory improper ASSERT test on second call

The ASSERT (PrivateData->PeiMemoryInstalled) in if (PrivateData->PeiMemoryInstalled)
condition is useless, it should be ASSERT (FALSE) to follow the code's expectation.

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

8 years agoBaseTool/UPT: Add supporting of decimal numbers for INF_VERSION and DEC_SPECIFICATION
Hess Chen [Wed, 18 Nov 2015 05:38:35 +0000 (05:38 +0000)]
BaseTool/UPT: Add supporting of decimal numbers for INF_VERSION and DEC_SPECIFICATION

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Hess Chen <hesheng.chen@intel.com>
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18868 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoMdeModulePkg: Change BootLogoEnableLogo use INTN for minus value
Ruiyu Ni [Wed, 18 Nov 2015 05:05:22 +0000 (05:05 +0000)]
MdeModulePkg: Change BootLogoEnableLogo use INTN for minus value

The parameter name is also changed from Coordinate* to Offset* to
reflect that it's the offset to the location specified by Attribute.
For example, when the Attribute is Center, OffsetX and OffsetY are
used to specify the offset to the Center. OffsetX = 100 means
100 pixels right to the Center.

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

8 years agoMdeModulePkg: Change PlatformLogo.GetImage use INTN for minus value
Ruiyu Ni [Wed, 18 Nov 2015 05:04:23 +0000 (05:04 +0000)]
MdeModulePkg: Change PlatformLogo.GetImage use INTN for minus value

The parameter name is also changed from Coordinate* to Offset* to
reflect that it's the offset to the location specified by Attribute.
For example, when the Attribute is Center, OffsetX and OffsetY are
used to specify the offset to the Center. OffsetX = 100 means
100 pixels right to the Center.

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

8 years agoArmPkg: ensure DebugAgentVectorTable is 2K-aligned
Mark Rutland [Tue, 17 Nov 2015 13:58:19 +0000 (13:58 +0000)]
ArmPkg: ensure DebugAgentVectorTable is 2K-aligned

We force alignment to 2K after generating the DebugAgentVectorTable
symbol, and hence DebugAgentVectorTable itself may not be 2K-aligned,
and table entries may not be at the correct offset from the
DebugAgentVectorTable base address.

Fix this by forcing alignment before generating the
DebugAgentVectorTable symbol.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Mark Rutland <mark.rutland@arm.com>
Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18865 6f19259b-4bc3-4df7-8a09-765794883524

8 years agoMdeModulePkg/VarCheck: Add VarCheck handler for PlatformRecovery####
Ruiyu Ni [Tue, 17 Nov 2015 10:16:02 +0000 (10:16 +0000)]
MdeModulePkg/VarCheck: Add VarCheck handler for PlatformRecovery####

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

8 years agoMdeModulePkg: Enable PlatformRecovery in BdsDxe driver
Ruiyu Ni [Tue, 17 Nov 2015 10:15:09 +0000 (10:15 +0000)]
MdeModulePkg: Enable PlatformRecovery in BdsDxe driver

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

8 years agoMdeModulePkg: Add PlatformRecovery#### pointing to default file path
Ruiyu Ni [Tue, 17 Nov 2015 10:14:13 +0000 (10:14 +0000)]
MdeModulePkg: Add PlatformRecovery#### pointing to default file path

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

8 years agoMdeModulePkg: Use UefiSpec.h defined macro to replace L"xxx" string
Ruiyu Ni [Tue, 17 Nov 2015 10:13:21 +0000 (10:13 +0000)]
MdeModulePkg: Use UefiSpec.h defined macro to replace L"xxx" string

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