Re: [edk2] [PATCH v3 0/7] ArmPkg: ARMv7 MMU fixes

2015-11-18 Thread Ard Biesheuvel
On 18 November 2015 at 15:54, Leif Lindholm wrote: > On Wed, Nov 18, 2015 at 02:16:26PM +0100, Ard Biesheuvel wrote: >> Yesterday's 3-piece series is now a 7-piece series, since I spotted some >> other >> issues when looking at this code. >> >> Patch #1 replaces the

Re: [edk2] [PATCH] ArmPkg/ArmV7Mmu: handle memory regions over 4 GB correctly

2015-11-18 Thread Leif Lindholm
On Wed, Nov 18, 2015 at 04:38:55PM +0100, Ard Biesheuvel wrote: > 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.

[edk2] [PATCH] ArmPkg/ArmV7Mmu: handle memory regions over 4 GB correctly

2015-11-18 Thread Ard Biesheuvel
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:

Re: [edk2] [Patch 2/2] UefiCpuPkg/SmmFeatureLib: Check SmmFeatureControl by Code_Access_Chk

2015-11-18 Thread Kinney, Michael D
Reviewed-by: Michael Kinney Mike -Original Message- From: Fan, Jeff Sent: Tuesday, November 17, 2015 10:45 PM To: edk2-devel@lists.01.org Cc: Kinney, Michael D ; Yao, Jiewen Subject: [Patch 2/2]

Re: [edk2] [PATCH V2 03/12] MdeModulePkg BaseSerialPortLib16550: Add GetControl/SetControl/SetAttributes implementation

2015-11-18 Thread Kinney, Michael D
Star, There are a few comments included below for the SerialPortSetAttributes() function header comment block. With those comment block fixes: Reviewed-by: Michael Kinney Best regards, Mike > -Original Message- > From: edk2-devel

Re: [edk2] [Patch 1/2] UefiCpuPkg: Not touch SmmFeatureControl if Code_Access_Chk not Set

2015-11-18 Thread Kinney, Michael D
Reviewed-by: Michael Kinney Mike -Original Message- From: Fan, Jeff Sent: Tuesday, November 17, 2015 10:45 PM To: edk2-devel@lists.01.org Cc: Kinney, Michael D ; Yao, Jiewen Subject: [Patch 1/2] UefiCpuPkg:

Re: [edk2] [PATCH V2 01/12] MdePkg SerialPortLib: Upstream GetControl/SetControl/SetAttributes interfaces

2015-11-18 Thread Kinney, Michael D
Star, There are a few comments included below for the SerialPortSetAttributes() function header comment block. With those comment block fixes: Reviewed-by: Michael Kinney Best regards, Mike > -Original Message- > From: edk2-devel

Re: [edk2] [PATCH V2 00/12] Upstream SerialDxe from EmbeddedPkg to MdeModulePkg

2015-11-18 Thread Kinney, Michael D
Star, I think I am seeing some files with incorrect line endings in this patch series. Please make sure you use the BaseTools\Scripts\PatchCheck.py script. Thanks, Mike > -Original Message- > From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of Star > Zeng > Sent:

Re: [edk2] [PATCH V2 02/12] PcAtChipsetPkg SerialIoLib: Add GetControl/SetControl/SetAttributes implementation

2015-11-18 Thread Kinney, Michael D
Star, There are a few comments included below for the SerialPortSetAttributes() function header comment block. With those comment block fixes: Reviewed-by: Michael Kinney Best regards, Mike > -Original Message- > From: edk2-devel

Re: [edk2] [PATCH V2 00/12] Upstream SerialDxe from EmbeddedPkg to MdeModulePkg

2015-11-18 Thread Kinney, Michael D
Star, It looks like the function header comment block for SerialPortSetAttributes() has the same issues in all patches in this series. Please make sure to apply my feedback to patch 1/12 to all patches in the series. Thanks, Mike > -Original Message- > From: Kinney, Michael D >

[edk2] [PATCH v3 2/7] ArmPkg/ArmV7Lib: add support for reading the ID_MMFR0 system register

2015-11-18 Thread Ard Biesheuvel
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:

[edk2] [PATCH v3 6/7] ArmPkg/ArmV7Lib: fix definition of TTBR_NON_INNER_CACHEABLE

2015-11-18 Thread Ard Biesheuvel
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

[edk2] [PATCH v3 0/7] ArmPkg: ARMv7 MMU fixes

2015-11-18 Thread Ard Biesheuvel
Yesterday's 3-piece series is now a 7-piece series, since I spotted some other issues when looking at this code. Patch #1 replaces the bogus TTBR_WRITE_THROUGH_NO_ALLOC with something that is more aligned with what TTBRx actually allows. Patch #2 adds an accessor to the ID_MMFR0 system id

[edk2] [PATCH v3 4/7] ArmPkg/ArmV7Mmu: make cached translation table accesses shareable

2015-11-18 Thread Ard Biesheuvel
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 --- ArmPkg/Include/Chipset/ArmV7Mmu.h | 6

[edk2] [PATCH v3 5/7] ArmPkg/ArmV7Mmu: introduce feature PCD to map normal memory non-shareable

2015-11-18 Thread Ard Biesheuvel
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

[edk2] [PATCH v3 1/7] ArmPkg/ArmV7Mmu: fix write-through translation table accesses

2015-11-18 Thread Ard Biesheuvel
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

Re: [edk2] [PATCH] ArmPkg/ArmLib: mark all cached mappings as (inner) shareable

2015-11-18 Thread Ard Biesheuvel
On 16 November 2015 at 16:03, Michael Zimmermann wrote: > Unfortunately I can't tell you much about how the L2 works or if it's > configurable because it's a proprietary hw(I'm a opensource dev working with > Qualcomm Android devices). > > Also, I'm using ARM PrePi so

Re: [edk2] [PATCH v3 0/4] improve handling of device attributes on ARM/AARCH64

2015-11-18 Thread Leif Lindholm
On Wed, Nov 18, 2015 at 09:25:55AM +0100, Ard Biesheuvel wrote: > This series fixes some issues that exist in the code with regard to how device > mappings are created. According to the architecture, read-sensitive devices > should be mapped with the non-execute bits (XN/PXN/UXN) to prevent

Re: [edk2] [PATCH v3 0/4] improve handling of device attributes on ARM/AARCH64

2015-11-18 Thread Ard Biesheuvel
On 18 November 2015 at 12:47, Leif Lindholm wrote: > On Wed, Nov 18, 2015 at 11:29:15AM +, Leif Lindholm wrote: >> On Wed, Nov 18, 2015 at 09:25:55AM +0100, Ard Biesheuvel wrote: >> > This series fixes some issues that exist in the code with regard to how >> >

Re: [edk2] [PATCH v3 0/4] improve handling of device attributes on ARM/AARCH64

2015-11-18 Thread Leif Lindholm
On Wed, Nov 18, 2015 at 11:29:15AM +, Leif Lindholm wrote: > On Wed, Nov 18, 2015 at 09:25:55AM +0100, Ard Biesheuvel wrote: > > This series fixes some issues that exist in the code with regard to how > > device > > mappings are created. According to the architecture, read-sensitive devices >

[edk2] [PATCH v3 7/7] ArmPkg/ArmV7Lib: take MP extensions into account when programming TTBR

2015-11-18 Thread Ard Biesheuvel
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

[edk2] [PATCH v3 3/7] ArmPkg/ArmV7Lib: add function to test for presence of MP extensions

2015-11-18 Thread Ard Biesheuvel
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 ---

Re: [edk2] [PATCH V2 02/12] PcAtChipsetPkg SerialIoLib: Add GetControl/SetControl/SetAttributes implementation

2015-11-18 Thread Gao, Liming
Reviewed-by: Liming Gao -Original Message- From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of Star Zeng Sent: Tuesday, November 17, 2015 7:07 PM To: edk2-devel@lists.01.org Cc: Kinney, Michael D; Ni, Ruiyu; Gao, Liming Subject: [edk2] [PATCH V2

Re: [edk2] [PATCH 0/3] AppPkg/Python-2.7.10/edk2module.c: Reviewable Revision Resubmission

2015-11-18 Thread Ard Biesheuvel
On 12 November 2015 at 23:52, Daryl McDaniel wrote: > AppPkg/Python-2.7.10: Present patch in three reviewable chunks. > > Due to the large number of changes, the previous submission of this patch > was not reviewable. This patch set presents the changes as three

Re: [edk2] [patch 0/7]MdeModulePkg:UiApp remodeling task

2015-11-18 Thread Gao, Liming
Dandan: I have some comments. 1) gEfiSetupEnterGuid is not required. Library constructor() can directly do the initialization. 2) gEfiIfrFrontPageGuid can be defined in Package.dec file, and can be referred in C and VFR file. 3) The separate library is NULL class Library instance. They need

[edk2] [PATCH v2] ShellPkg: Corrected CatSPrint usage to prevent memory leaks.

2015-11-18 Thread Cecil Sheng
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 --- .../UefiHandleParsingLib/UefiHandleParsingLib.c| 232

[edk2] [PATCH v3 4/4] ArmPkg/Mmu: set required XN attributes for device mappings

2015-11-18 Thread Ard Biesheuvel
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

[edk2] [PATCH v3 3/4] ArmVExpressPkg/ArmVExpressLibRTSM: map NOR flash as cached

2015-11-18 Thread Ard Biesheuvel
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

[edk2] [PATCH v3 2/4] ArmVirtPkg/ArmVirtPlatformLib: do not map executable NOR region as device

2015-11-18 Thread Ard Biesheuvel
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

[edk2] [PATCH v3 1/4] ArmPkg/AArch64Mmu: remove unused GcdAttributeToArmAttribute()

2015-11-18 Thread Ard Biesheuvel
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

[edk2] [PATCH v3 0/4] improve handling of device attributes on ARM/AARCH64

2015-11-18 Thread Ard Biesheuvel
This series fixes some issues that exist in the code with regard to how device mappings are created. According to the architecture, read-sensitive devices should be mapped with the non-execute bits (XN/PXN/UXN) to prevent speculative instruction fetches from accessing those regions. Changes since

Re: [edk2] [PATCH v3 2/4] ArmVirtPkg/ArmVirtPlatformLib: do not map executable NOR region as device

2015-11-18 Thread Laszlo Ersek
On 11/18/15 09:25, Ard Biesheuvel wrote: > 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

Re: [edk2] [PATCH V2 01/12] MdePkg SerialPortLib: Upstream GetControl/SetControl/SetAttributes interfaces

2015-11-18 Thread Gao, Liming
Reviewed-by: Liming Gao -Original Message- From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of Star Zeng Sent: Tuesday, November 17, 2015 7:07 PM To: edk2-devel@lists.01.org Cc: Kinney, Michael D; Gao, Liming Subject: [edk2] [PATCH V2 01/12]

Re: [edk2] [PATCH v3 2/4] ArmVirtPkg/ArmVirtPlatformLib: do not map executable NOR region as device

2015-11-18 Thread Ard Biesheuvel
On 18 November 2015 at 10:02, Laszlo Ersek wrote: > On 11/18/15 09:25, Ard Biesheuvel wrote: >> 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

Re: [edk2] [Patch 2/2] UefiCpuPkg/SmmFeatureLib: Check SmmFeatureControl by Code_Access_Chk

2015-11-18 Thread Yao, Jiewen
Reviewed by: jiewen@intel.com -Original Message- From: Fan, Jeff Sent: Wednesday, November 18, 2015 2:45 PM To: edk2-devel@lists.01.org Cc: Kinney, Michael D; Yao, Jiewen Subject: [Patch 2/2] UefiCpuPkg/SmmFeatureLib: Check SmmFeatureControl by Code_Access_Chk Bit

Re: [edk2] [PATCH v3 0/7] ArmPkg: ARMv7 MMU fixes

2015-11-18 Thread Leif Lindholm
On Wed, Nov 18, 2015 at 02:16:26PM +0100, Ard Biesheuvel wrote: > Yesterday's 3-piece series is now a 7-piece series, since I spotted some other > issues when looking at this code. > > Patch #1 replaces the bogus TTBR_WRITE_THROUGH_NO_ALLOC with something that is > more aligned with what TTBRx

[edk2] [PATCH 1/3] MdePkg SerialPortLib: Fix typo in SerialPortWrite()

2015-11-18 Thread Star Zeng
The "read" word in SerialPortWrite() header comment block should be "write". Cc: Michael D Kinney Cc: Liming Gao Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Star Zeng ---

[edk2] [PATCH 0/3] Fix typo in SerialPortWrite() header comment block

2015-11-18 Thread Star Zeng
Star Zeng (3): MdePkg SerialPortLib: Fix typo in SerialPortWrite() PcAtChipsetPkg SerialIoLib: Fix typo in SerialPortWrite() MdeModulePkg BaseSerialPortLib16550: Fix typo in SerialPortWrite() MdeModulePkg/Library/BaseSerialPortLib16550/BaseSerialPortLib16550.c | 2 +-

[edk2] [PATCH 2/3] PcAtChipsetPkg SerialIoLib: Fix typo in SerialPortWrite()

2015-11-18 Thread Star Zeng
The "read" word in SerialPortWrite() header comment block should be "write". Cc: Michael D Kinney Cc: Liming Gao Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Star Zeng ---

[edk2] [PATCH 3/3] MdeModulePkg BaseSerialPortLib16550: Fix typo in SerialPortWrite()

2015-11-18 Thread Star Zeng
The "read" word in SerialPortWrite() header comment block should be "write". Cc: Michael D Kinney Cc: Liming Gao Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Star Zeng ---

Re: [edk2] [PATCH V2 00/12] Upstream SerialDxe from EmbeddedPkg to MdeModulePkg

2015-11-18 Thread Zeng, Star
On 2015/11/19 3:16, Kinney, Michael D wrote: Star, I think I am seeing some files with incorrect line endings in this patch series. Please make sure you use the BaseTools\Scripts\PatchCheck.py script. Sure about this, thanks for the reminder. Star Thanks, Mike -Original

Re: [edk2] [PATCH V2] MdePkg SerialIo.h: Fix typo "buts" to "bits"

2015-11-18 Thread Zeng, Star
Wrongly generate the patch with V2, sorry for the confusion, but it should not impact the review to the patch. Thanks, Star On 2015/11/19 8:58, Star Zeng wrote: Cc: Michael D Kinney Cc: Liming Gao Contributed-under: TianoCore Contribution

Re: [edk2] [PATCH V2 00/12] Upstream SerialDxe from EmbeddedPkg to MdeModulePkg

2015-11-18 Thread Zeng, Star
On 2015/11/19 3:29, Kinney, Michael D wrote: Star, It looks like the function header comment block for SerialPortSetAttributes() has the same issues in all patches in this series. Please make sure to apply my feedback to patch 1/12 to all patches in the series. Agree the suggestion to

[edk2] [PATCH V2] MdePkg SerialIo.h: Fix typo "buts" to "bits"

2015-11-18 Thread Star Zeng
Cc: Michael D Kinney Cc: Liming Gao Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Star Zeng --- MdePkg/Include/Protocol/SerialIo.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff

[edk2] [Patch] MdeModulePkg/BootLogoLib: Fix GCC build failure

2015-11-18 Thread Ruiyu Ni
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ruiyu Ni Cc: Feng Tian --- MdeModulePkg/Library/BootLogoLib/BootLogoLib.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/MdeModulePkg/Library/BootLogoLib/BootLogoLib.c

Re: [edk2] [PATCH V2 04/12] MdeModulePkg: Upstream SerialDxe from EmbeddedPkg

2015-11-18 Thread Zeng, Star
On 2015/11/19 3:09, Kinney, Michael D wrote: Star, There is a typo in SerialSetAttributes() function header comment block. There are also a couple changes I recommend be done to SerialDxeInitialize() and moving a couple global variable to top of file. Agree the suggestion and will cover

Re: [edk2] [PATCH V2] MdePkg SerialIo.h: Fix typo "buts" to "bits"

2015-11-18 Thread Kinney, Michael D
Star, Reviewed-by: Michael D Kinney Thanks, Mike > -Original Message- > From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of Star > Zeng > Sent: Wednesday, November 18, 2015 4:58 PM > To: edk2-devel@lists.01.org > Cc: Kinney, Michael D

Re: [edk2] [PATCH v3 2/4] ArmVirtPkg/ArmVirtPlatformLib: do not map executable NOR region as device

2015-11-18 Thread Heyi Guo
On 11/18/2015 04:25 PM, Ard Biesheuvel wrote: 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

Re: [edk2] [PATCH v3 2/4] ArmVirtPkg/ArmVirtPlatformLib: do not map executable NOR region as device

2015-11-18 Thread Ard Biesheuvel
On 19 November 2015 at 00:55, Heyi Guo wrote: > > > On 11/18/2015 04:25 PM, Ard Biesheuvel wrote: >> >> The ARM architecture version 7 and later mandates that device mappings >> have the XN (non-executable) bit set, to prevent speculative instruction >> fetches from

Re: [edk2] [PATCH 0/3] Fix typo in SerialPortWrite() header comment block

2015-11-18 Thread Kinney, Michael D
Star, The changes in this series look good to me. Reviewed-by: Michael D Kinney Mike > -Original Message- > From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of Star > Zeng > Sent: Wednesday, November 18, 2015 5:24 PM > To:

Re: [edk2] Armv8 64bit: System error booting linux from the UEFI

2015-11-18 Thread Ard Biesheuvel
On 19 November 2015 at 05:48, Vladimir Olovyannikov wrote: > > >> -Original Message- >> From: Ard Biesheuvel [mailto:ard.biesheu...@linaro.org] >> Sent: Tuesday, November 17, 2015 11:03 PM >> To: Mark Rutland >> Cc: Vladimir Olovyannikov; edk2-devel@lists.01.org >>