Re: [edk2-devel] [PATCH] CryptoPkg/FltUsedLib: Add FltUsedLib for float.

2020-04-22 Thread Liming Gao
Guomin: You can count the size of all generated EFI images for IA32 and X64, then compare them between two builds. This change should impact EFI image only. Based on this data, we can know the image size impact. Thanks Liming > -Original Message- > From: devel@edk2.groups.io On

Re: [edk2-devel] [PATCH v1 7/7] MdePkg: UEFI JSON Capsule Support

2020-04-22 Thread Liming Gao
So, the better way should be UINT8 Field[]; if the compiler doesn’t report error. From: Rothman, Michael A Sent: Thursday, April 23, 2020 10:38 AM To: devel@edk2.groups.io; Liu, Zhiguang ; Oleksiy Yakovlev Cc: Feng, Bob C ; Gao, Liming ; Kinney, Michael D ; Felix Polyudov Subject: RE:

[edk2-devel] [PATCH v7 41/43] OvmfPkg: Use the SEV-ES work area for the SEV-ES AP reset vector

2020-04-22 Thread Lendacky, Thomas
BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=2198 A hypervisor is not allowed to update an SEV-ES guest's register state, so when booting an SEV-ES guest AP, the hypervisor is not allowed to set the RIP to the guest requested value. Instead an SEV-ES AP must be re-directed from within the

[edk2-devel] [PATCH v7 40/43] UefiCpuPkg: Allow AP booting under SEV-ES

2020-04-22 Thread Lendacky, Thomas
BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=2198 Typically, an AP is booted using the INIT-SIPI-SIPI sequence. This sequence is intercepted by the hypervisor, which sets the AP's registers to the values requested by the sequence. At that point, the hypervisor can start the AP, which will

[edk2-devel] [PATCH v7 42/43] OvmfPkg: Move the GHCB allocations into reserved memory

2020-04-22 Thread Lendacky, Thomas
BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=2198 After having transitioned from UEFI to the OS, the OS will need to boot the APs. For an SEV-ES guest, the APs will have been parked by UEFI using GHCB pages allocated by UEFI. The hypervisor will write to the GHCB SW_EXITINFO2 field of the

[edk2-devel] [PATCH v7 43/43] UefiCpuPkg/MpInitLib: Prepare SEV-ES guest APs for OS use

2020-04-22 Thread Lendacky, Thomas
BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=2198 Before UEFI transfers control to the OS, it must park the AP. This is done using the AsmRelocateApLoop function to transition into 32-bit non-paging mode. For an SEV-ES guest, a few additional things must be done: - AsmRelocateApLoop must

Re: [edk2-devel] [PATCH] CryptoPkg/FltUsedLib: Add FltUsedLib for float.

2020-04-22 Thread Guomin Jiang
I guess the key point is /GL option. IntrinsicLib omit the /GL option to avoid the build error, but it abandon the optimization meanwhile. I will do a test: create a simplest application and just depend IntrinsicLib and add /GL option to compare the different with and without /GL. >

Re: [edk2-devel] [PATCH] CryptoPkg/FltUsedLib: Add FltUsedLib for float.

2020-04-22 Thread Ni, Ray
Guomin, Can you investigate why moving _fltused from CryptoPkg/IntrinsicLib to MdePkg/BaseLib saves size? Thanks, Ray > -Original Message- > From: Jiang, Guomin > Sent: Thursday, April 23, 2020 9:34 AM > To: devel@edk2.groups.io; Jiang, Guomin ; Ni, Ray > ; Kinney, Michael D > ;

[edk2-devel] [PATCH v2 1/2] MdePkg/BaseLib: Add _fltused to feed MSVC compiler

2020-04-22 Thread Guomin Jiang
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2596 Out of edk2 may need _fltused symbol such as mu_plus OnScreenKeyboard and UiToolKit. those driver will define the symbol to feed MSVC, but it will conflict with CryptoPkg. so move the symbol to BaseLib. Signed-off-by: Guomin Jiang Cc:

[edk2-devel] [PATCH v2 2/2] CryptoPkg/IntrinsicLib: Remove _fltused to avoid duplication

2020-04-22 Thread Guomin Jiang
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2596 Out of edk2 may need _fltused symbol such as mu_plus OnScreenKeyboard and UiToolKit. those driver will define the symbol to feed MSVC, but it will conflict with CryptoPkg. so move the symbol to BaseLib. Signed-off-by: Guomin Jiang Cc:

[edk2-devel] [PATCH v2 0/2] Define the unique _fltused in BaseLib

2020-04-22 Thread Guomin Jiang
Out of edk2 may need _fltused and may confict with edk2, define the unique to provide the _fltused and expect to avoid build error result by missing _fltused symbol Guomin Jiang (2): MdePkg/BaseLib: Add _fltused to feed MSVC compiler CryptoPkg/IntrinsicLib: Remove _fltused to avoid

Re: [edk2-devel] [PATCH 0/2] Add DxeResetSystemLibBhyve

2020-04-22 Thread Rebecca Cran
On 4/22/20 9:02 PM, Rebecca Cran wrote: Add DxeResetSystemLibBhyve and update BhyvePkg/BhyvePkgX64.dsc to use it. Signed-off-by: Rebecca Cran Rebecca Cran (2): OvmfPkg: Add DxeResetSystemLibBhyve BhyvePkg: Update BhyvePkgX64.dsc to use DxeResetSystemLibBhyve This series depends on the

[edk2-devel] [PATCH 1/2] OvmfPkg: Add DxeResetSystemLibBhyve

2020-04-22 Thread Rebecca Cran
Introduce the DxeResetSystemLibBhyve library to support powering off bhyve guests. Signed-off-by: Rebecca Cran Cc: Jordan Justen Cc: Laszlo Ersek Cc: Ard Biesheuvel --- OvmfPkg/Include/IndustryStandard/Bhyve.h | 2 + .../ResetSystemLib/DxeResetShutdownBhyve.c| 43

[edk2-devel] [PATCH 2/2] BhyvePkg: Update BhyvePkgX64.dsc to use DxeResetSystemLibBhyve

2020-04-22 Thread Rebecca Cran
bhyve uses a different method for powering off guests than OVMF, so use the new DxeResetSystemLibBhyve library to support that. Signed-off-by: Rebecca Cran Cc: Peter Grehan --- BhyvePkg/BhyvePkgX64.dsc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/BhyvePkg/BhyvePkgX64.dsc

[edk2-devel] [PATCH 0/2] Add DxeResetSystemLibBhyve

2020-04-22 Thread Rebecca Cran
Add DxeResetSystemLibBhyve and update BhyvePkg/BhyvePkgX64.dsc to use it. Signed-off-by: Rebecca Cran Rebecca Cran (2): OvmfPkg: Add DxeResetSystemLibBhyve BhyvePkg: Update BhyvePkgX64.dsc to use DxeResetSystemLibBhyve BhyvePkg/BhyvePkgX64.dsc | 2 +-

Re: [edk2-devel] [PATCH v1 7/7] MdePkg: UEFI JSON Capsule Support

2020-04-22 Thread Rothman, Michael A
As a general rule, there are places in the specification where we have had fields like this: // UINT8 Field[]; } STRUC_NAME; This has a history because not all the compilers supported compiling a non-commented version of the above field without a warning. Today, this isn’t the case and I

Re: [edk2-devel] [PATCH] CryptoPkg/FltUsedLib: Add FltUsedLib for float.

2020-04-22 Thread Guomin Jiang
Hi Ard, it explain the reason at https://docs.microsoft.com/en-us/cpp/error-messages/tool-errors/linker-tools-error-lnk1237?view=vs-2019. It can use ```MSFT:*_*_*_DLINK_FLAGS = /include:_fltused``` to resolve the error, but it is complex. Best Regards Guomin > -Original Message- >

Re: [edk2-devel] [PATCH v1 7/7] MdePkg: UEFI JSON Capsule Support

2020-04-22 Thread Zhiguang Liu
Hi Oleksiy, I agree with you that your original code change is good. But I can't open the link you posted. Can you send your new code change here, so that everyone can give their comments. Thanks Zhiguang From: Oleksiy Yakovlev Sent: Thursday, April 23, 2020 4:41 AM To: Liu, Zhiguang ;

Re: [edk2-devel] [PATCH] CryptoPkg/FltUsedLib: Add FltUsedLib for float.

2020-04-22 Thread Guomin Jiang
The size comparation between with _fltused and without _fltused, use OvmfPkgX64 as build target OvmfX64 EFI_FV_TAKEN_SIZE | Without _fltused | With _fltused DXEFV | 0x46bbe0 | 0x46bbc0 FVMAIN_COMPACT |

Re: [edk2-devel] [edk2-platforms: PATCH] MinPlatformPkg/PlatformInitPei: Create Library Instance of ReportCpuHobLib.

2020-04-22 Thread Chiu, Chasel
Hi Chandana, Usually we will send one patch for one package, so in this case you can split into 5 patches. (as a series [0/5], [1/5], [2/5], [3/5], [4/5], [5/5]) Please also help to update copyright year for those files you touched. Thanks, Chasel > -Original Message- > From:

Re: [edk2-devel] [EXTERNAL] Re: [PATCH v2 0/6] Edk2 Platform and Core CI for ArmVirtPkg, EmulatorPkg, and OvmfPkg

2020-04-22 Thread Bret Barkelew via groups.io
I personally prefer readME. - Bret From: Sean Brogan Sent: Wednesday, April 22, 2020 5:45:41 PM To: Laszlo Ersek ; michael.kuba...@outlook.com ; devel@edk2.groups.io Cc: Andrew Fish ; Ard Biesheuvel ; Bret Barkelew ; Jordan Justen ; Leif Lindholm ; Liming Gao

Re: [edk2-devel] [PATCH v2 1/2] UefiCpuPkg/MpInitLib: Restore IDT context for APs.

2020-04-22 Thread Dong, Eric
> -Original Message- > From: devel@edk2.groups.io [mailto:devel@edk2.groups.io] On Behalf Of > Laszlo Ersek > Sent: Thursday, April 23, 2020 5:41 AM > To: devel@edk2.groups.io; Dong, Eric > Cc: Ni, Ray ; Kumar, Chandana C > > Subject: Re: [edk2-devel] [PATCH v2 1/2] UefiCpuPkg/MpInitLib:

Re: [edk2-devel] [EXTERNAL] Re: [PATCH v2 0/6] Edk2 Platform and Core CI for ArmVirtPkg, EmulatorPkg, and OvmfPkg

2020-04-22 Thread Sean via groups.io
I was hoping that because it wasn't "HTML tag soup" that build status could be front and center in the package readme as I find that more in line with expectations on github based projects. Nesting it deeper in the package just means less people find it when looking at your package. But I

[edk2-devel] [edk2-staging/EdkRepo] [PATCH V3 2/3] EdkRepo: Add edkrepo/common/workspace_maitenance/manifest_repos_maitenance

2020-04-22 Thread Ashley E Desimone
Add a directory to edkrepo/common to store workspace maitenance functionatlity. Add edkrepo/common/workspace_matenance/humble directory to store related strings and included manifest_repos_maitenance_humble.py Add edkrepo/common/workspace_maitenance/manifest_repos_maitenance.py to support the

[edk2-devel] [edk2-staging/EdkRepo] [PATCH V3 1/3] EdkRepo: Initial commit of workspace_maitenance.py

2020-04-22 Thread Ashley E Desimone
Add workspace_maitenance.py including the implementation of generate_name_for_obsolete_backup() Signed-off-by: Ashley E Desimone Cc: Nate DeSimone Cc: Puja Pandya Cc: Erik Bjorge Cc: Bret Barkelew Cc: Prince Agyeman --- .../workspace_maitenance/workspace_maitenance.py | 30

[edk2-devel] [edk2-staging/EdkRepo] [PATCH V3 3/3] EdkRepo: Update pull_latest_manifest_repo to use pull_single_manifest_repo

2020-04-22 Thread Ashley E Desimone
Updates the implementation for pull_latest_manifest_repo to call pull_single_manifest repo. Removes definitions of strings used by pull_latest_manifest_repo from common/humble.py and from the imports of common_repo_functions.py Signed-off-by: Ashley E Desimone Cc: Nate DeSimone Cc: Puja Pandya

[edk2-devel] [edk2-staging/EdkRepo] [PATCH V3 0/3] Add initial manifest repository support

2020-04-22 Thread Ashley E Desimone
V3 Addresses Prince's comments regarding typos in patch 2/3 V2 Replaces use of management with maitenance per feedback V2 Introduces patch 1/1 which removes a circular import between common_repo_functions.py and manifest_repos_maitenance.py by adding workspace_maiteneance.py. Adds initial

Re: [edk2-devel] [edk2-staging/EdkRepo] [PATCH V2 2/3] EdkRepo: Add edkrepo/common/workspace_maitenance/manifest_repos_maitenance

2020-04-22 Thread Agyeman, Prince
Hi Ashley, Comment below Prince -Original Message- From: Desimone, Ashley E Sent: Wednesday, April 22, 2020 2:35 PM To: devel@edk2.groups.io Cc: Desimone, Nathaniel L ; Pandya, Puja ; Bjorge, Erik C ; Bret Barkelew ; Agyeman, Prince Subject: [edk2-staging/EdkRepo] [PATCH V2 2/3]

Re: [edk2-devel] [edk2-platforms] [PATCH 00/11] Add BDS Hook Points

2020-04-22 Thread Nate DeSimone
Hi Leif, Definitely. I held back on closing it for my follow-up patch series to be reviewed and committed as well: https://edk2.groups.io/g/devel/message/57762 Thanks, Nate On 4/22/20, 3:32 AM, "Leif Lindholm" wrote: Hi Nate, On Tue, Apr 21, 2020 at 20:37:39 +, Nate DeSimone

Re: [edk2-devel] [PATCH v2 1/2] UefiCpuPkg/MpInitLib: Restore IDT context for APs.

2020-04-22 Thread Laszlo Ersek
Eric, On 04/22/20 11:01, Dong, Eric wrote: > REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2683 I don't know what patches I'm supposed to review now. You seem to have sent 4 (four) versions of this patch set to the list, but you didn't call them {v1, v2, v3, v4}; you called them {v1, v2,

[edk2-devel] [edk2-staging/EdkRepo] [PATCH V2 3/3] EdkRepo: Update pull_latest_manifest_repo to use pull_single_manifest_repo

2020-04-22 Thread Ashley E Desimone
Updates the implementation for pull_latest_manifest_repo to call pull_single_manifest repo. Removes definitions of strings used by pull_latest_manifest_repo from common/humble.py and from the imports of common_repo_functions.py Signed-off-by: Ashley E Desimone Cc: Nate DeSimone Cc: Puja Pandya

[edk2-devel] [edk2-staging/EdkRepo] [PATCH V2 2/3] EdkRepo: Add edkrepo/common/workspace_maitenance/manifest_repos_maitenance

2020-04-22 Thread Ashley E Desimone
Add a directory to edkrepo/common to store workspace maitenance functionatlity. Add edkrepo/common/workspace_matenance/humble directory to store related strings and included manifest_repos_maitenance_humble.py Add edkrepo/common/workspace_maitenance/manifest_repos_maitenance.py to support the

[edk2-devel] [edk2-staging/EdkRepo][PATCH V2 0/3] EdkRepo: Add initial manifest repository support

2020-04-22 Thread Ashley E Desimone
V2 Replaces use of management with maitenance per feedback V2 Introduces patch 1/1 which removes a circular import between common_repo_functions.py and manifest_repos_maitenance.py by adding workspace_maiteneance.py. Adds initial support for manifest repository maitenance while retaining support

[edk2-devel] [edk2-staging/EdkRepo] [PATCH V2 1/3] EdkRepo: Initial commit of workspace_maitenance.py

2020-04-22 Thread Ashley E Desimone
Add workspace_maitenance.py including the implementation of generate_name_for_obsolete_backup() Signed-off-by: Ashley E Desimone Cc: Nate DeSimone Cc: Puja Pandya Cc: Erik Bjorge Cc: Bret Barkelew Cc: Prince Agyeman --- .../workspace_maitenance/workspace_maitenance.py | 30

Re: [edk2-devel] [PATCH v1 7/7] MdePkg: UEFI JSON Capsule Support

2020-04-22 Thread Oleksiy Yakovlev
Hi Zhiguang. Thank you for your feedback. Using definition from Spec: typedef struct { UINT32 ConfigDataLength; UINT8 ConfigData[ConfigDataLength]; } EFI_JSON_CONFIG_DATA_ITEM; will result in build error. You can't use structure field to define array size. I addressed this issue by commenting

Re: [edk2-devel] [PATCH 0/6] OvmfPkg/ResetSystemLib: clean up, refactor, fix

2020-04-22 Thread Laszlo Ersek
On 04/17/20 17:37, Laszlo Ersek wrote: > Ref:https://bugzilla.tianocore.org/show_bug.cgi?id=2675 > Repo: https://pagure.io/lersek/edk2.git > Branch: rsl_cleanup > > Rebecca's > > [PATCH 02/13] OvmfPkg: support powering off bhyve guests > > at > >

Re: [edk2-devel] FW: Discussion: Basetools a separate repo

2020-04-22 Thread Matthew Carlson via groups.io
I think you've got it. The version of basetools will be carried via a pip-requirements file. Where would "pip install -r pip-requirements.txt" *fetch* the required basetools version from? I believe that it has a cache internal to pip. But if you want to fetch a basetools that hasn't been

Re: [edk2-devel] [edk2-platforms] [PATCH V1 2/2] WhiskeylakeOpenBoardPkg/UpXtreme: Add BDS Hook Dxe Driver

2020-04-22 Thread Michael Kubacki
Reviewed-by: Michael Kubacki On 4/21/2020 1:40 PM, Nate DeSimone wrote: REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2336 Added a DXE driver that registers the minimum platform BDS hook points, to WhiskeylakeURvp board. These hooks are triggered on the BDS hook events What was done:

Re: [edk2-devel] [edk2-platforms] [PATCH V1 1/2] CometlakeOpenBoardPkg: Add BDS Hook Dxe Driver

2020-04-22 Thread Michael Kubacki
Reviewed-by: Michael Kubacki On 4/21/2020 1:40 PM, Nate DeSimone wrote: REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2336 Added a DXE driver that registers the minimum platform BDS hook points, to WhiskeylakeURvp board. These hooks are triggered on the BDS hook events What was done:

Re: [edk2-devel] [PATCH v7 10/43] UefiPayloadPkg: Prepare UefiPayloadPkg to use the VmgExitLib library

2020-04-22 Thread Guo Dong
It looks good to me. Reviewed-by: Guo Dong Thanks, Guo > -Original Message- > From: devel@edk2.groups.io On Behalf Of > Lendacky, Thomas > Sent: Wednesday, April 22, 2020 10:41 AM > To: devel@edk2.groups.io > Cc: Justen, Jordan L ; Laszlo Ersek > ; Ard Biesheuvel ; Kinney, > Michael

[edk2-devel] [PATCH v7 34/43] OvmfPkg/ResetVector: Add support for a 32-bit SEV check

2020-04-22 Thread Lendacky, Thomas
BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=2198 During BSP startup, the reset vector code will issue a CPUID instruction while in 32-bit mode. When running as an SEV-ES guest, this will trigger a #VC exception. Add exception handling support to the early reset vector code to catch these

[edk2-devel] [PATCH v7 37/43] OvmfPkg/QemuFlashFvbServicesRuntimeDxe: Bypass flash detection with SEV-ES is enabled

2020-04-22 Thread Lendacky, Thomas
BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=2198 The flash detection routine will attempt to determine how the flash device behaves (e.g. ROM, RAM, Flash). But when SEV-ES is enabled and the flash device behaves as a ROM device (meaning it is marked read-only by the hypervisor), this check

[edk2-devel] [PATCH v7 32/43] UefiCpuPkg: Create an SEV-ES workarea PCD

2020-04-22 Thread Lendacky, Thomas
BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=2198 Create an SEV-ES workarea PCD. This PCD will be used for BSP communication during SEC and for AP startup during PEI and DXE phases, the latter is the reason for creating it in the UefiCpuPkg. Cc: Eric Dong Cc: Ray Ni Cc: Laszlo Ersek

[edk2-devel] [PATCH v7 33/43] OvmfPkg: Reserve a page in memory for the SEV-ES usage

2020-04-22 Thread Lendacky, Thomas
BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=2198 Reserve a fixed area of memory for SEV-ES use and set a fixed PCD, PcdSevEsWorkAreaBase, to this value. This area will be used by SEV-ES support for two purposes: 1. Communicating the SEV-ES status during BSP boot to SEC: Using a

[edk2-devel] [PATCH v7 30/43] OvmfPkg: Create GHCB pages for use during Pei and Dxe phase

2020-04-22 Thread Lendacky, Thomas
BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=2198 Allocate memory for the GHCB pages and the per-CPU variable pages during SEV initialization for use during Pei and Dxe phases. The GHCB page(s) must be shared pages, so clear the encryption mask from the current page table entries. Upon

[edk2-devel] [PATCH v7 39/43] UefiCpuPkg/MpInitLib: Add CPU MP data flag to indicate if SEV-ES is enabled

2020-04-22 Thread Lendacky, Thomas
BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=2198 When starting APs in an SMP configuration, the AP needs to know if it is running as an SEV-ES guest in order to assign a GHCB page. Add a field to the CPU_MP_DATA structure that will indicate if SEV-ES is enabled. This new field is set

[edk2-devel] [PATCH v7 35/43] OvmfPkg/Sec: Add #VC exception handling for Sec phase

2020-04-22 Thread Lendacky, Thomas
BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=2198 An SEV-ES guest will generate a #VC exception when it encounters a non-automatic exit (NAE) event. It is expected that the #VC exception handler will communicate with the hypervisor using the GHCB to handle the NAE event. NAE events can

[edk2-devel] [PATCH v7 31/43] OvmfPkg/PlatformPei: Move early GDT into ram when SEV-ES is enabled

2020-04-22 Thread Lendacky, Thomas
BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=2198 The SEV support will clear the C-bit from non-RAM areas. The early GDT lives in a non-RAM area, so when an exception occurs (like a #VC) the GDT will be read as un-encrypted even though it is encrypted. This will result in a failure to be

[edk2-devel] [PATCH v7 38/43] UefiCpuPkg: Add a 16-bit protected mode code segment descriptor

2020-04-22 Thread Lendacky, Thomas
BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=2198 A hypervisor is not allowed to update an SEV-ES guests register state, so when booting an SEV-ES guest AP, the hypervisor is not allowed to set the RIP to the guest requested value. Instead, an SEV-ES AP must be transition from 64-bit long

[edk2-devel] [PATCH v7 36/43] OvmfPkg/Sec: Enable cache early to speed up booting

2020-04-22 Thread Lendacky, Thomas
BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=2198 Currently, the OVMF code relies on the hypervisor to enable the cache support on the processor in order to improve the boot speed. However, with SEV-ES, the hypervisor is not allowed to change the CR0 register to enable caching. Update the

[edk2-devel] [PATCH v7 02/43] UefiCpuPkg: Create PCD to be used in support of SEV-ES

2020-04-22 Thread Lendacky, Thomas
BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=2198 A new dynamic UefiCpuPkg PCD is needed to support SEV-ES under OVMF: - PcdSevEsIsEnabled: BOOLEAN value used to indicate if SEV-ES is enabled Cc: Eric Dong Cc: Ray Ni Cc: Laszlo Ersek Signed-off-by: Tom Lendacky ---

[edk2-devel] [PATCH v7 12/43] UefiCpuPkg/CpuExceptionHandler: Add support for IOIO_PROT NAE events

2020-04-22 Thread Lendacky, Thomas
BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=2198 Under SEV-ES, a IOIO_PROT intercept generates a #VC exception. VMGEXIT must be used to allow the hypervisor to handle this intercept. Add support to construct the required GHCB values to support a IOIO_PROT NAE event. Parse the instruction

[edk2-devel] [PATCH v7 22/43] UefiCpuPkg/CpuExceptionHandler: Add support for RDTSCP NAE events

2020-04-22 Thread Lendacky, Thomas
BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=2198 Under SEV-ES, a RDTSCP intercept generates a #VC exception. VMGEXIT must be used to allow the hypervisor to handle this intercept. Cc: Eric Dong Cc: Ray Ni Cc: Laszlo Ersek Signed-off-by: Tom Lendacky --- .../X64/ArchAMDSevVcHandler.c

[edk2-devel] [PATCH v7 00/43] SEV-ES guest support

2020-04-22 Thread Lendacky, Thomas
This patch series provides support for running EDK2/OVMF under SEV-ES. Secure Encrypted Virtualization - Encrypted State (SEV-ES) expands on the SEV support to protect the guest register state from the hypervisor. See "AMD64 Architecture Programmer's Manual Volume 2: System Programming", section

[edk2-devel] [PATCH v7 24/43] UefiCpuPkg/CpuExceptionHandler: Add support for MWAIT/MWAITX NAE events

2020-04-22 Thread Lendacky, Thomas
BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=2198 Under SEV-ES, a MWAIT/MWAITX intercept generates a #VC exception. VMGEXIT must be used to allow the hypervisor to handle this intercept. Cc: Eric Dong Cc: Ray Ni Cc: Laszlo Ersek Signed-off-by: Tom Lendacky ---

[edk2-devel] [PATCH v7 05/43] MdeModulePkg/DxeIplPeim: Support GHCB pages when creating page tables

2020-04-22 Thread Lendacky, Thomas
BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=2198 GHCB pages must be mapped as shared pages, so modify the process of creating identity mapped pagetable entries so that GHCB entries are created without the encryption bit set. The GHCB range consists of two pages per CPU, the first being the

[edk2-devel] [PATCH v7 28/43] OvmfPkg: Create a GHCB page for use during Sec phase

2020-04-22 Thread Lendacky, Thomas
BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=2198 A GHCB page is needed during the Sec phase, so this new page must be created. Since the #VC exception handler routines assume that a per-CPU variable area is immediately after the GHCB, this per-CPU variable area must also be created. Since

[edk2-devel] [PATCH v7 17/43] UefiCpuPkg/CpuExceptionHandler: Add support for WBINVD NAE events

2020-04-22 Thread Lendacky, Thomas
BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=2198 Under SEV-ES, a WBINVD intercept generates a #VC exception. VMGEXIT must be used to allow the hypervisor to handle this intercept. Cc: Eric Dong Cc: Ray Ni Cc: Laszlo Ersek Signed-off-by: Tom Lendacky --- .../X64/ArchAMDSevVcHandler.c

[edk2-devel] [PATCH v7 14/43] UefiCpuPkg/CpuExceptionHandler: Add support for CPUID NAE events

2020-04-22 Thread Lendacky, Thomas
BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=2198 Under SEV-ES, a CPUID intercept generates a #VC exception. VMGEXIT must be used to allow the hypervisor to handle this intercept. Add support to construct the required GHCB values to support a CPUID NAE event. Additionally, CPUID

[edk2-devel] [PATCH v7 10/43] UefiPayloadPkg: Prepare UefiPayloadPkg to use the VmgExitLib library

2020-04-22 Thread Lendacky, Thomas
BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=2198 Various CpuExceptionHandlerLib libraries will updated to use the new VmgExitLib library. To prevent any build breakage, update the UefiPayloadPkg DSC files that use a form of the CpuExceptionHandlerLib library to include the VmgExitLib

[edk2-devel] [PATCH v7 29/43] OvmfPkg/PlatformPei: Reserve GHCB-related areas if S3 is supported

2020-04-22 Thread Lendacky, Thomas
BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=2198 Protect the memory used by an SEV-ES guest when S3 is supported. This includes the page table used to break down the 2MB page that contains the GHCB so that it can be marked un-encrypted, as well as the GHCB area. Regarding the lifecycle of

[edk2-devel] [PATCH v7 11/43] UefiCpuPkg/CpuExceptionHandler: Add base support for the #VC exception

2020-04-22 Thread Lendacky, Thomas
BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=2198 Add base support to handle #VC exceptions. This includes a stub routine to invoke when a #VC exception occurs and special checks in the common exception handlers to invoke the #VC exception handler routine. Cc: Eric Dong Cc: Ray Ni Cc:

[edk2-devel] [PATCH v7 09/43] OvmfPkg: Prepare OvmfPkg to use the VmgExitLib library

2020-04-22 Thread Lendacky, Thomas
BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=2198 Various CpuExceptionHandlerLib libraries will updated to use the new VmgExitLib library. To prevent any build breakage, update the OvmfPkg DSC files that use a form of the CpuExceptionHandlerLib library to include the VmgExitLib library.

[edk2-devel] [PATCH v7 21/43] UefiCpuPkg/CpuExceptionHandler: Add support for VMMCALL NAE events

2020-04-22 Thread Lendacky, Thomas
BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=2198 Under SEV-ES, a VMMCALL intercept generates a #VC exception. VMGEXIT must be used to allow the hypervisor to handle this intercept. Cc: Eric Dong Cc: Ray Ni Cc: Laszlo Ersek Signed-off-by: Tom Lendacky --- .../X64/ArchAMDSevVcHandler.c

[edk2-devel] [PATCH v7 16/43] UefiCpuPkg/CpuExceptionHandler: Add support for NPF NAE events (MMIO)

2020-04-22 Thread Lendacky, Thomas
BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=2198 Under SEV-ES, a NPF intercept for an NPT entry with a reserved bit set generates a #VC exception. This condition is assumed to be an MMIO access. VMGEXIT must be used to allow the hypervisor to handle this intercept. Add support to

[edk2-devel] [PATCH v7 13/43] UefiCpuPkg/CpuExceptionHandler: Support string IO for IOIO_PROT NAE events

2020-04-22 Thread Lendacky, Thomas
BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=2198 Add support to the #VC exception handler to handle string IO. This requires expanding the IO instruction parsing to recognize string based IO instructions as well as preparing an un-encrypted buffer to be used to transfer (either to or from

[edk2-devel] [PATCH v7 08/43] UefiCpuPkg: Implement library support for VMGEXIT

2020-04-22 Thread Lendacky, Thomas
BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=2198 To support issuing a VMGEXIT instruction, create a library that can be used to perform GHCB and VMGEXIT related operations and to issue the actual VMGEXIT instruction when using the GHCB. Additionally, two VMGEXIT / MMIO related functions

[edk2-devel] [PATCH v7 03/43] MdePkg: Add the MSR definition for the GHCB register

2020-04-22 Thread Lendacky, Thomas
BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=2198 For SEV-ES, the GHCB page address is stored in the GHCB MSR register (0xc0010130). Define the register and the format used for register during GHCB protocol negotiation. Cc: Michael D Kinney Cc: Liming Gao Signed-off-by: Tom Lendacky ---

[edk2-devel] [PATCH v7 25/43] UefiCpuPkg/CpuExceptionHandler: Add support for DR7 Read/Write NAE events

2020-04-22 Thread Lendacky, Thomas
BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=2198 Under SEV-ES, a DR7 read or write intercept generates a #VC exception. The #VC handler must provide special support to the guest for this. On a DR7 write, the #VC handler must cache the value and issue a VMGEXIT to notify the hypervisor of

[edk2-devel] [PATCH v7 26/43] OvmfPkg/MemEncryptSevLib: Add an SEV-ES guest indicator function

2020-04-22 Thread Lendacky, Thomas
BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=2198 Create a function that can be used to determine if the VM is running as an SEV-ES guest. Cc: Jordan Justen Cc: Laszlo Ersek Cc: Ard Biesheuvel Reviewed-by: Laszlo Ersek Signed-off-by: Tom Lendacky ---

[edk2-devel] [PATCH v7 19/43] UefiCpuPkg/CpuExceptionHandler: Add support for RDPMC NAE events

2020-04-22 Thread Lendacky, Thomas
BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=2198 Under SEV-ES, a RDPMC intercept generates a #VC exception. VMGEXIT must be used to allow the hypervisor to handle this intercept. Cc: Eric Dong Cc: Ray Ni Cc: Laszlo Ersek Signed-off-by: Tom Lendacky --- .../X64/ArchAMDSevVcHandler.c

[edk2-devel] [PATCH v7 18/43] UefiCpuPkg/CpuExceptionHandler: Add support for RDTSC NAE events

2020-04-22 Thread Lendacky, Thomas
BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=2198 Under SEV-ES, a RDTSC intercept generates a #VC exception. VMGEXIT must be used to allow the hypervisor to handle this intercept. Cc: Eric Dong Cc: Ray Ni Cc: Laszlo Ersek Signed-off-by: Tom Lendacky --- .../X64/ArchAMDSevVcHandler.c

[edk2-devel] [PATCH v7 06/43] MdePkg/BaseLib: Add support for the XGETBV instruction

2020-04-22 Thread Lendacky, Thomas
BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=2198 Under SEV-ES, a CPUID instruction requires the current value of the XCR0 register. In order to retrieve that value, the XGETBV instruction needs to be executed. Provide the necessary support to execute the XGETBV instruction. Cc: Michael D

[edk2-devel] [PATCH v7 04/43] MdePkg: Add a structure definition for the GHCB

2020-04-22 Thread Lendacky, Thomas
BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=2198 The GHCB is used by an SEV-ES guest for communicating between the guest and the hypervisor. Create the GHCB definition as defined by the GHCB protocol definition. Cc: Michael D Kinney Cc: Liming Gao Signed-off-by: Tom Lendacky ---

[edk2-devel] [PATCH v7 27/43] OvmfPkg: Add support to perform SEV-ES initialization

2020-04-22 Thread Lendacky, Thomas
BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=2198 When SEV-ES is enabled, then SEV is also enabled. Add support to the SEV initialization function to also check for SEV-ES being enabled, and if enabled, set the SEV-ES enabled PCD (PcdSevEsIsEnabled). Cc: Jordan Justen Cc: Laszlo Ersek

[edk2-devel] [PATCH v7 07/43] MdePkg/BaseLib: Add support for the VMGEXIT instruction

2020-04-22 Thread Lendacky, Thomas
BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=2198 VMGEXIT is a new instruction used for Hypervisor/Guest communication when running as an SEV-ES guest. A VMGEXIT will cause an automatic exit (AE) to occur, resulting in a #VMEXIT with an exit code value of 0x403. Provide the necessary

[edk2-devel] [PATCH v7 20/43] UefiCpuPkg/CpuExceptionHandler: Add support for INVD NAE events

2020-04-22 Thread Lendacky, Thomas
BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=2198 Under SEV-ES, a INVD intercept generates a #VC exception. VMGEXIT must be used to allow the hypervisor to handle this intercept. Cc: Eric Dong Cc: Ray Ni Cc: Laszlo Ersek Signed-off-by: Tom Lendacky --- .../X64/ArchAMDSevVcHandler.c

[edk2-devel] [PATCH v7 23/43] UefiCpuPkg/CpuExceptionHandler: Add support for MONITOR/MONITORX NAE events

2020-04-22 Thread Lendacky, Thomas
BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=2198 Under SEV-ES, a MONITOR/MONITORX intercept generates a #VC exception. VMGEXIT must be used to allow the hypervisor to handle this intercept. Cc: Eric Dong Cc: Ray Ni Cc: Laszlo Ersek Signed-off-by: Tom Lendacky ---

[edk2-devel] [PATCH v7 15/43] UefiCpuPkg/CpuExceptionHandler: Add support for MSR_PROT NAE events

2020-04-22 Thread Lendacky, Thomas
BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=2198 Under SEV-ES, a MSR_PROT intercept generates a #VC exception. VMGEXIT must be used to allow the hypervisor to handle this intercept. Add support to construct the required GHCB values to support an MSR_PROT NAE event. Parse the instruction

[edk2-devel] [PATCH v7 01/43] MdeModulePkg: Create PCDs to be used in support of SEV-ES

2020-04-22 Thread Lendacky, Thomas
BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=2198 Two new dynamic MdeModulePkg PCDs are needed to support SEV-ES under OVMF: - PcdGhcbBase: UINT64 value that is the base address of the GHCB allocation. - PcdGhcbSize: UINT64 value that is the size, in

Re: [edk2-devel] FW: Discussion: Basetools a separate repo

2020-04-22 Thread Laszlo Ersek
Hello Matthew, On 04/22/20 02:05, macarl via [] wrote: > Hey Lazlo, > > This is a great point of discussion. Just to make sure we're on the same > page, let me paraphrase your scenario. Two features at the same time or a > improperly tested new feature were committed in BaseTools and a new

Re: [edk2-devel] [PATCH 1/1] ShellPkg: Add support for input with separately reported modifiers

2020-04-22 Thread Vitaly Cheptsov via groups.io
Zhichao, We already build a customised shell for ourselves, but the problem with this change is that it is invasive. To make it work we need to patch EDK II, and this is strongly undesired as maintaining EDK II patches is very tiring. In fact, currently this is the only change we have that

Re: [edk2-devel] [PATCH] UefiCpuPkg/MpInitLib: Remove Executable attribute from MpLib.h

2020-04-22 Thread Laszlo Ersek
On 04/22/20 00:05, Leo Duran wrote: > REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2678 > > This patch fixes a file permission issue introduced by accident. > > Cc: Eric Dong > Cc: Ray Ni > Cc: Laszlo Ersek > Signed-off-by: Leo Duran > --- > UefiCpuPkg/Library/MpInitLib/MpLib.h | 0 >

[edk2-devel] [edk2-platforms: PATCH] MinPlatformPkg/PlatformInitPei: Create Library Instance of ReportCpuHobLib.

2020-04-22 Thread Kumar, Chandana C
Create an Library instance of ReportCpuHobLib from PlatformInitPei driver. PA bits reported can be overriden using Library instance in Platform. REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2674 Signed-off-by: Chandana Kumar Cc: Sai Chaganty Cc: Chasel Chiu Cc: Nate DeSimone ---

Re: [edk2-devel] [PATCH edk2-platforms v3 07/24] Silicon/NXP: remove print information from Soc

2020-04-22 Thread Leif Lindholm
On Wed, Apr 15, 2020 at 17:43:25 +0530, Pankaj Bansal wrote: > From: Pankaj Bansal > > The Soc info being printed can be removed from SOC lib. > We are in the process of implementing PEI Phase. > After PEI phase implementation this info would be printed in > common PEIM based on the information

Re: [edk2-devel] [PATCH v3 0/6] Add BhyvePkg, to support the bhyve hypervisor

2020-04-22 Thread Rebecca Cran
On 4/22/20 9:21 AM, Laszlo Ersek wrote: OK, that makes sense -- but, without the ResetSystemLib instance, are you able to boot the BhyvePkg platform firmware in a bhyve guest? Does (for example) the "reset -c" UEFI Shell command work? "reset -c" works, but "reset -s" doesn't. But that's a

Re: [edk2-devel] [PATCH edk2-platforms v3 02/24] Silicon/NXP: changes to use I2clib in i2cdxe

2020-04-22 Thread Leif Lindholm
On Wed, Apr 15, 2020 at 17:43:20 +0530, Pankaj Bansal wrote: > From: Pankaj Bansal > > I2c lib contains the i2c controller functionality. this can be used > in I2c DXE driver to communicate with i2c devices. > > Signed-off-by: Pankaj Bansal Reviewed-by: Leif Lindholm > --- > > Notes: >

Re: [edk2-devel] [PATCH edk2-platforms v3 01/24] Silicon/NXP: Add I2c lib

2020-04-22 Thread Leif Lindholm
On Wed, Apr 15, 2020 at 17:43:19 +0530, Pankaj Bansal wrote: > From: Pankaj Bansal > > I2c lib is going to be used in PrePeiCore sec module to get the > System clock information from devices connected to i2c (like fpga > or clock generator) > > since we don't have support of DXE modules this

Re: [edk2-devel] [PATCH v1] UefiCpuPkg/MpInitLib: Add missing explicit PcdLib dependency

2020-04-22 Thread Laszlo Ersek
On 04/22/20 08:55, Hao A Wu wrote: > REF:https://bugzilla.tianocore.org/show_bug.cgi?id=2632 > > Both PEI and DXE instances of the MpInitLib are using PcdLib APIs, but > none of them list the dependency of the PcdLib in INF & header files. > > This commit will explicitly add such dependency in

Re: [edk2-devel] [PATCH 2/2] OvmfPkg/OvmfXen: Introduce XenDebugLibIoPort

2020-04-22 Thread Laszlo Ersek
On 04/22/20 12:18, Anthony PERARD wrote: > On Tue, Apr 21, 2020 at 03:54:26PM +0200, Laszlo Ersek wrote: >> (2) Please write a patch for the following: >> >> - move the PlatformDebugLibIoPortDetect() function definition to a >> separate file called "DebugIoPortQemu.c", > > On this new file,

Re: [edk2-devel] [PATCH 1/1] BaseTools: convert diff.order to LF-only

2020-04-22 Thread Leif Lindholm
Hi Mike, Well, it's a line-ending conversion: it deletes all lines, then it adds them (this time without ). / Leif On Wed, Apr 22, 2020 at 16:05:34 +, Michael D Kinney wrote: > Leif, > > PatchCheck.py should only check added lines, not removed lines. > > Are you seeing an error on a

Re: [edk2-devel] [PATCH 1/1] BaseTools: convert diff.order to LF-only

2020-04-22 Thread Michael D Kinney
Leif, PatchCheck.py should only check added lines, not removed lines. Are you seeing an error on a removed line? Mike > -Original Message- > From: Leif Lindholm > Sent: Wednesday, April 22, 2020 8:47 AM > To: devel@edk2.groups.io > Cc: Andrew Fish ; Laszlo Ersek > ; Kinney, Michael D

Re: [edk2-devel] [edk2-discuss] Load Option passing. Either bugs or my confusion.

2020-04-22 Thread Laszlo Ersek
On 04/22/20 09:42, Hou Qiming wrote: > A little off topic thing: isn't the default resolution supposed to be > 1024x768? No. > This is the Microsoft regulation which all my physical devices > seem to follow: > >

Re: [edk2-devel] [PATCH] BaseTools/PatchCheck.py: Add LicenseCheck

2020-04-22 Thread Liming Gao
Mike: The checker purpose is to make sure the correct license be used for new added file. If the file has the different license, it should be reviewed carefully. I remember we still have one open for third party non bsd+patent code (the detail can refer to

Re: [edk2-devel] [PATCH 02/13] OvmfPkg: support powering off bhyve guests

2020-04-22 Thread Laszlo Ersek
On 04/22/20 00:14, Rebecca Cran wrote: > On 4/17/20 2:55 AM, Laszlo Ersek wrote: > >> In this patch, we should follow the pattern seen in patch#1 -- new, >> bhyve-specific library instance. >> >> However, this library has hugely bit-rotted, and it needs some serious >> scrubbing before we can do

[edk2-devel] [PATCH 1/1] BaseTools: convert diff.order to LF-only

2020-04-22 Thread Leif Lindholm
SetupGit.py sets the git config option diff.orderFile to {edk2 directory}/BaseTools/Conf/diff.order, to override the default order in which files are shown in a diff/patch/whatever. This is in imitation of what is done manually in Laszlo's Unkempt Guide. However, the version currently in the tree

Re: [edk2-devel] [PATCH] BaseTools/PatchCheck.py: Add LicenseCheck

2020-04-22 Thread Michael D Kinney
Hi Liming, I do not see this change checking that the license is in a proper SPDX Identifier statement? https://spdx.org/ids-how Only checking the for a license name is not sufficient. A file may be covered by more than one license. What is the behavior in this case? The EDK II

Re: [edk2-devel] [PATCH v3 0/6] Add BhyvePkg, to support the bhyve hypervisor

2020-04-22 Thread Laszlo Ersek
On 04/21/20 17:38, Rebecca Cran wrote: > On 4/21/20 9:27 AM, Laszlo Ersek wrote: > >> >> (1) For example, I can't find the patch that adds >> "BhyvePkg/BhyvePkgX64.dsc", in spite of the file being listed in the >> cumulative diffstat below. > > That's in the "Add BhyvePkg" patch. I'm very

Re: [edk2-devel] [PATCH v1 0/9] MdePkg changes for RISC-V edk2 port

2020-04-22 Thread Liming Gao
Thanks for your confirmation. I have no other comment. Reviewed-by: Liming Gao > -Original Message- > From: devel@edk2.groups.io On Behalf Of Abner Chang > Sent: Wednesday, April 22, 2020 10:45 PM > To: devel@edk2.groups.io; Gao, Liming > Subject: Re: [edk2-devel] [PATCH v1 0/9]

Re: [edk2-devel] [PATCH v1 0/9] MdePkg changes for RISC-V edk2 port

2020-04-22 Thread Abner Chang
> -Original Message- > From: devel@edk2.groups.io [mailto:devel@edk2.groups.io] On Behalf Of > Liming Gao > Sent: Wednesday, April 22, 2020 5:17 PM > To: Chang, Abner (HPS SW/FW Technologist) ; > devel@edk2.groups.io > Subject: Re: [edk2-devel] [PATCH v1 0/9] MdePkg changes for RISC-V

  1   2   >