[edk2] [PATCH] MdeModulePkg SmiHandlerProfile: Use fixed data type in data structure

2017-05-22 Thread Star Zeng
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=568 Use fixed data type in data structure and make the structure be natural aligned. Without this update, the code must assume DXE and SMM are using same data type (same size of UINTN), but it may be not true at some case, for example, after

[edk2] [PATCH] MdeModulePkg SmiHandlerProfile: Fix no PDB case handling incorrectly

2017-05-22 Thread Star Zeng
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=569 The PdbStringOffset should be set to 0 for no PDB case, then SmiHandlerProfileInfo can use it to know whether there is PCD info or not. Cc: Jiewen Yao Contributed-under: TianoCore Contribution Agreement 1.0

Re: [edk2] [PATCH v2] MdeModulePkg/DxeHttpLib: Fix potential memory leaks

2017-05-22 Thread Wu, Jiaxin
Reviewed-by: Wu Jiaxin > -Original Message- > From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of Paulo > Alcantara > Sent: Monday, May 22, 2017 7:52 PM > To: edk2-devel@lists.01.org > Cc: Dong, Eric ; Zeng, Star

Re: [edk2] [Patch V2] UefiCpuPkg/MpInitLib: Fix X64 XCODE5/NASM compatibility issues

2017-05-22 Thread Fan, Jeff
Reviewed-by: Jeff Fan -Original Message- From: Kinney, Michael D Sent: Tuesday, May 23, 2017 1:13 AM To: edk2-devel@lists.01.org Cc: Andrew Fish; Fan, Jeff; Kinney, Michael D Subject: [Patch V2] UefiCpuPkg/MpInitLib: Fix X64 XCODE5/NASM compatibility issues

[edk2] [PATCH] ShellPkg/UefiShellLib: Avoid reading undefined content before string

2017-05-22 Thread Hao Wu
https://bugzilla.tianocore.org/show_bug.cgi?id=566 In function InternalShellPrintWorker(), if the string in variable 'mPostReplaceFormat2' starts with character L'%', the following expression: *(ResumeLocation-1) == L'^' at line 2831 will read an undefined value before the starting of string

[edk2] [PATCH 1/2] MdePkg/BasePrintLib: Avoid reading content beyond the format string

2017-05-22 Thread Hao Wu
In function BasePrintLibSPrintMarker(), when processing ASCII format strings, if the format string walker pointer 'Format' is pointing at the end of the format string (i.e. '\0'), the following expression: *(Format + 1) will read an undefined value. Though this value won't affect the

[edk2] [PATCH 2/2] MdeModulePkg/PrintLib: Avoid reading content beyond the format string

2017-05-22 Thread Hao Wu
In functions DxePrintLibPrint2ProtocolVaListToBaseList() and InternalPrintLibSPrintMarker(), when processing ASCII format strings, if the format string walker pointer 'Format' is pointing at the end of the format string (i.e. '\0'), the following expression: *(Format + 1) will read an undefined

[edk2] [PATCH 0/2] Avoid reading undefined contents

2017-05-22 Thread Hao Wu
This series add logic to avoid reading content beyond a ASCII format string. Cc: Jiewen Yao Cc: Liming Gao Cc: Michael Kinney Hao Wu (2): MdePkg/BasePrintLib: Avoid reading content beyond the format string

Re: [edk2] [staging/cadence-aarch64] Add readme for cadence-aarch64 branch

2017-05-22 Thread Andrew Fish
> On May 22, 2017, at 11:12 AM, Leif Lindholm wrote: > > Hi Scott, thanks for this. Looking forward to seeing it. > > Andrew, Mike - for what it's worth, I'm happy to do the mechanics here > unless there are any objections. > Looks good to me. Thanks, Andrew Fish

Re: [edk2] [staging/cadence-aarch64] Add readme for cadence-aarch64 branch

2017-05-22 Thread Leif Lindholm
Hi Scott, thanks for this. Looking forward to seeing it. Andrew, Mike - for what it's worth, I'm happy to do the mechanics here unless there are any objections. Oh, and it's usually a good idea to cc maintainers of existing packages you intend to work on. For MdeModulePkg, this is Feng Tian

Re: [edk2] [PATCH 1/8] ArmPlatformPkg/NorFlashDxe: correct NumOfLba vararg type in EraseBlocks()

2017-05-22 Thread Leif Lindholm
On Fri, May 19, 2017 at 09:59:06AM -0700, Jordan Justen wrote: > On 2017-05-19 03:07:56, Leif Lindholm wrote: > > On Thu, May 18, 2017 at 01:44:58PM -0700, Jordan Justen wrote: > > > On 2017-05-18 12:29:09, Laszlo Ersek wrote: > > > > On 05/18/17 19:21, Jordan Justen wrote: > > > > > On 2017-05-18

Re: [edk2] [PATCH] Arm: GICv3: Don't access GIC_ICDIPR for interrupts 0..31

2017-05-22 Thread Leif Lindholm
On Fri, May 19, 2017 at 05:31:36PM +0300, Sergei Temerkhanov wrote: > On Fri, May 19, 2017 at 1:26 PM, Leif Lindholm > wrote: > > On Fri, May 19, 2017 at 05:37:02AM +0300, Sergei Temerkhanov wrote: > >> On Thu, May 18, 2017 at 7:08 PM, Ard Biesheuvel > >>

Re: [edk2] [Patch V2] UefiCpuPkg/MpInitLib: Fix X64 XCODE5/NASM compatibility issues

2017-05-22 Thread Andrew Fish
Reviewed-by: Andrew Fish > On May 22, 2017, at 10:12 AM, Michael Kinney > wrote: > > https://bugzilla.tianocore.org/show_bug.cgi?id=565 > > Fix NASM compatibility issues with XCODE5 tool chain. > The XCODE5 tool chain for X64 builds using PIE

[edk2] [Patch V2] UefiCpuPkg/MpInitLib: Fix X64 XCODE5/NASM compatibility issues

2017-05-22 Thread Michael Kinney
https://bugzilla.tianocore.org/show_bug.cgi?id=565 Fix NASM compatibility issues with XCODE5 tool chain. The XCODE5 tool chain for X64 builds using PIE (Position Independent Executable). For most assembly sources using PIE mode does not cause any issues. However, if assembly code is copied to a

Re: [edk2] Strange issue in USB mass storage device

2017-05-22 Thread Andrew Fish
Your device path difference is based on having a partitioning scheme (MBR or GPT) or not. The partition driver will produce block io protocols for all the partitions. The file system driver goes after fixed block offsets. Sent from my iPhone > On May 22, 2017, at 1:37 AM, GN Keshava

[edk2] [PATCH v5 12/14] OvmfPkg/QemuFwCfgLib: Implement SEV internal function for Dxe phase

2017-05-22 Thread Brijesh Singh
When SEV is enabled, the DMA must be performed on unencrypted pages. So when get asked to perfom FWCFG DMA read or write, we allocate a intermediate (bounce buffer) unencrypted buffer and use this buffer for DMA read or write. Cc: Jordan Justen Cc: Laszlo Ersek

[edk2] [PATCH v5 14/14] OvmfPkg/QemuFwCfgLib: Add SEV support

2017-05-22 Thread Brijesh Singh
When SEV is enabled, use a bounce buffer to perform the DMA operation. Cc: Jordan Justen Cc: Laszlo Ersek Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Brijesh Singh ---

[edk2] [PATCH v5 13/14] OvmfPkg/QemuFwCfgLib: Add option to dynamic alloc FW_CFG_DMA Access

2017-05-22 Thread Brijesh Singh
Update InternalQemuFwCfgDmaBytes() to work with DMA Access pointer. The change provides the flexibility to dynamically allocate the "Access" when SEV is enabled. Cc: Jordan Justen Cc: Laszlo Ersek Contributed-under: TianoCore Contribution Agreement

[edk2] [PATCH v5 08/14] OvmfPkg/QemuFwCfgLib: Provide Pei and Dxe specific library

2017-05-22 Thread Brijesh Singh
Current QemuFwCfgLib.inf is used in both Pei and Dxe phases. Add Pei and Dxe inf file to provide a seperate QemuFwCfgLib instances for Pei and Dxe phases. Cc: Jordan Justen Cc: Laszlo Ersek Contributed-under: TianoCore Contribution Agreement 1.0

[edk2] [PATCH v5 07/14] OvmfPkg:IoMmuDxe: Add IoMmuDxe driver

2017-05-22 Thread Brijesh Singh
The IOMMU protocol driver provides capabilities to set a DMA access attribute and methods to allocate, free, map and unmap the DMA memory for the PCI Bus devices. Due to security reasons all DMA operations inside the SEV guest must be performed on shared (i.e unencrypted) pages. The IOMMU

[edk2] [PATCH v5 11/14] OvmfPkg/QemuFwCfgLib: Implement SEV internal functions for PEI phase

2017-05-22 Thread Brijesh Singh
Cc: Jordan Justen Cc: Laszlo Ersek Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Brijesh Singh Reviewed-by: Laszlo Ersek --- OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgPeiLib.inf | 1 +

[edk2] [PATCH v5 10/14] OvmfPkg/QemuFwCfgLib: Implement SEV internal function for SEC phase

2017-05-22 Thread Brijesh Singh
Cc: Jordan Justen Cc: Laszlo Ersek Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Brijesh Singh --- OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgSec.c | 57 1 file changed, 57

[edk2] [PATCH v5 09/14] OvmfPkg/QemuFwCfgLib: Prepare for SEV support

2017-05-22 Thread Brijesh Singh
Add SEV specific internal functions which will be used while intergrating the SEV support into QemuFwCfgLib. Cc: Jordan Justen Cc: Laszlo Ersek Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Brijesh Singh

[edk2] [PATCH v5 04/14] OvmfPkg/BaseMemcryptSevLib: Add SEV helper library

2017-05-22 Thread Brijesh Singh
Add Secure Encrypted Virtualization (SEV) helper library. The library provides the routines to: - set or clear memory encryption bit for a given memory region. - query whether SEV is enabled. Cc: Jordan Justen Cc: Laszlo Ersek Contributed-under:

[edk2] [PATCH v5 06/14] OvmfPkg:AmdSevDxe: Add AmdSevDxe driver

2017-05-22 Thread Brijesh Singh
When SEV is enabled, the MMIO memory range must be mapped as unencrypted (i.e C-bit cleared). We need to clear the C-bit for MMIO GCD entries in order to cover the ranges that were added during the PEI phase (through memory resource descriptor HOBs). Additionally, the NonExistent ranges are

[edk2] [PATCH v5 05/14] OvmfPkg/PlatformPei: Set memory encryption PCD when SEV is enabled

2017-05-22 Thread Brijesh Singh
Secure Encrypted Virtualization (SEV) guest VMs have the concept of private and shared memory. Private memory is encrypted with the guest-specific key, while shared memory may be encrypted with hypervisor key. Certain types of memory (namely instruction pages and guest page tables) are always

[edk2] [PATCH v5 03/14] OvmfPkg: Update dsc to use IoLib from BaseIoLibIntrinsicSev.inf

2017-05-22 Thread Brijesh Singh
When SEV is enabled then we must unroll the rep String I/O instructions. The patch updates dsc file to use SEV version of IoLib inf. The main difference between BaseIoLibIntrinsic.inf and BaseIoLibIntrinsicSev.inf is, SEV version checks if its running under SEV enabled guest, If so then it unroll

[edk2] [PATCH v5 02/14] OvmfPkg/ResetVector: Set C-bit when building initial page table

2017-05-22 Thread Brijesh Singh
SEV guest VMs have the concept of private and shared memory. Private memory is encrypted with the guest-specific key, while shared memory may be encrypted with hypervisor key. Certain types of memory (namely instruction pages and guest page tables) are always treated as private memory by the

[edk2] [PATCH v5 01/14] UefiCpuPkg: Define AMD Memory Encryption specific CPUID and MSR

2017-05-22 Thread Brijesh Singh
The patch defines AMD's Memory Encryption Information CPUID leaf and SEV status MSR. The complete description for CPUID leaf is available in APM volume 2, Section 15.34. Cc: Jordan Justen Cc: Laszlo Ersek Cc: Jeff Fan Cc:

[edk2] [PATCH v5 00/14] x86: Secure Encrypted Virtualization (AMD)

2017-05-22 Thread Brijesh Singh
The patch series provides support for AMD's new Secure Encrypted Virtualization (SEV) feature. SEV is an extension to the AMD-V architecture which supports running multiple VMs under the control of a hypervisor. The SEV feature allows the memory contents of a virtual machine (VM) to be

Re: [edk2] [Patch] UefiCpuPkg/MpInitLib: Fix X64 XCODE5/NASM compatibility issues

2017-05-22 Thread Kinney, Michael D
Jeff, I agree. I thought of a 2nd method to pass the address through the structure that is shared between the C and assembly code. I will work on a 2nd version of the patch that is both XIP and PIE compatible. Mike > -Original Message- > From: Fan, Jeff > Sent: Sunday, May 21, 2017

Re: [edk2] [PATCH 0/2] Initialize CNTHCTL

2017-05-22 Thread Leif Lindholm
Hi Evan, Apologies for delay, was off sick last week. On Tue, May 16, 2017 at 11:10:43AM +0100, evan.ll...@arm.com wrote: > From: Evan > > A pair of minor patches to correct an omission. > This patch set enables timer access as required by the UEFI > specification. > The

[edk2] [Patch] BaseTools: Fix incremental build bug on DynamicPcd Token Generation

2017-05-22 Thread Yonghong Zhu
During incremental build, we meet the bug that the different drivers use the different token for the same DynamicPcd. Cc: Liming Gao Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Yonghong Zhu ---

Re: [edk2] [RFC PATCH] ArmPkg: implement generic SMMU driver to remap DRAM for 32-bit PCI DMA

2017-05-22 Thread Leif Lindholm
On Tue, May 02, 2017 at 11:32:02AM +0100, Ard Biesheuvel wrote: > This implements a driver that uses any SMMU compatible with the generic > ARM SMMU architecture to remap the lowest 4 GB of DRAM in a way that > makes it accessible to PCI masters that are only 32-bit DMA capable. > > Note that

[edk2] [PATCH v2] MdeModulePkg/DxeHttpLib: Fix potential memory leaks

2017-05-22 Thread Paulo Alcantara
Cc: Star Zeng Cc: Eric Dong Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Paulo Alcantara --- MdeModulePkg/Library/DxeHttpLib/DxeHttpLib.c | 15 --- 1 file changed, 12 insertions(+), 3 deletions(-)

[edk2] Strange issue in USB mass storage device

2017-05-22 Thread GN Keshava
Hi all, I'm testing a USB mass storage device (A linux CDC gadget, which has serial and mass storage with FAT32 filesystem) which works fine with Windows. I'm booting to UEFI shell using another mass storage device (a thumb drive). My device under test (A linux CDC gadget, which has serial and

[edk2] [Patch 2/2] MdeModulePkg/UefiPxeBcDxe: Refine the PXE boot displayed information

2017-05-22 Thread Jiaxin Wu
This path is to refine the PXE boot displayed information so as to in line with NetworkPkg/UefiPxeBcDxe driver. Cc: Ye Ting Cc: Fu Siyuan Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Wu Jiaxin ---

[edk2] [Patch 0/2] Fix the issue in MdeModulePkg/UefiPxeBcDxe

2017-05-22 Thread Jiaxin Wu
Cc: Ye Ting Cc: Fu Siyuan Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Wu Jiaxin Jiaxin Wu (2): MdeModulePkg/UefiPxeBcDxe: Fix the PXE BootMenu selection issue MdeModulePkg/UefiPxeBcDxe: Refine the PXE

[edk2] [Patch 1/2] MdeModulePkg/UefiPxeBcDxe: Fix the PXE BootMenu selection issue

2017-05-22 Thread Jiaxin Wu
Currently implementation doesn't accept the input during the user is trying to select the PXE BootMenu from option 43. This path is to fix that problem. Cc: Ye Ting Cc: Fu Siyuan Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Wu

Re: [edk2] [PATCH] UefiCpuPkg/DxeMpInitLib.inf: Add missing SynchronizationLib

2017-05-22 Thread Dong, Eric
Reviewed-by: Eric Dong -Original Message- From: Fan, Jeff Sent: Monday, May 22, 2017 2:50 PM To: edk2-devel@lists.01.org Cc: Dong, Eric Subject: [PATCH] UefiCpuPkg/DxeMpInitLib.inf: Add missing SynchronizationLib Contributed-under: TianoCore Contribution Agreement

[edk2] [PATCH] UefiCpuPkg/DxeMpInitLib.inf: Add missing SynchronizationLib

2017-05-22 Thread Jeff Fan
Contributed-under: TianoCore Contribution Agreement 1.0 Cc: Eric Dong Signed-off-by: Jeff Fan --- UefiCpuPkg/Library/MpInitLib/DxeMpInitLib.inf | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git