[edk2-devel] [PATCH v2 0/3] reuse the SevEsWork area

Brijesh Singh via groups.io posted 3 patches 2 years, 8 months ago
Failed in applying to current master (apply log)
There is a newer version of this series
OvmfPkg/OvmfPkg.dec                        |  12 +++
OvmfPkg/OvmfPkgX64.fdf                     |   9 +-
OvmfPkg/PlatformPei/PlatformPei.inf        |   4 +-
OvmfPkg/ResetVector/ResetVector.inf        |   1 +
OvmfPkg/Sec/SecMain.inf                    |   2 +
OvmfPkg/Include/Library/MemEncryptSevLib.h |  21 +---
OvmfPkg/Include/WorkArea.h                 |  67 +++++++++++++
OvmfPkg/PlatformPei/MemDetect.c            |  32 +++---
OvmfPkg/Sec/SecMain.c                      |  32 +++++-
OvmfPkg/OvmfPkgDefines.fdf.inc             |   6 ++
OvmfPkg/ResetVector/Ia32/AmdSev.asm        | 111 +++++++++++++++++----
OvmfPkg/ResetVector/Ia32/PageTables64.asm  |  57 ++---------
OvmfPkg/ResetVector/ResetVector.nasmb      |   1 +
13 files changed, 247 insertions(+), 108 deletions(-)
create mode 100644 OvmfPkg/Include/WorkArea.h
[edk2-devel] [PATCH v2 0/3] reuse the SevEsWork area
Posted by Brijesh Singh via groups.io 2 years, 8 months ago
Based on the discussion on the mailing list, we agreed that instead
of wasting extra page in the MEMFD, we can reuse the SevEsWorkArea
buffer for the TDX. To avoid any confusion, lets introduce a OvmfWorkArea
that will contains 32 bytes of header followed by the actual workarea.

While at it, move the code to clear the GHCB page from PageTable build
to AmdSev.asm.

I have used the existing TDX BZ for it because the request came
during the TDX patch review. if anyone have concern please let me know
and I will happily create a new BZ.

Full tree is at: https://github.com/AMDESE/ovmf/tree/sev-new-work-area

Brijesh Singh (3):
  OvmfPkg: introduce a common work area
  OvmfPkg/ResetVector: update SEV support to use new work area format
  OvmfPkg/ResetVector: move the GHCB page setup in AmdSev.asm

Cc: James Bottomley <jejb@linux.ibm.com>
Cc: Min Xu <min.m.xu@intel.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Tom Lendacky <thomas.lendacky@amd.com>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
Cc: Erdem Aktas <erdemaktas@google.com>

Changes since v1:
 - address Jiewen's feedback.

Brijesh Singh (3):
  OvmfPkg: introduce a common work area
  OvmfPkg/ResetVector: update SEV support to use new work area format
  OvmfPkg/ResetVector: move the GHCB page setup in AmdSev.asm

 OvmfPkg/OvmfPkg.dec                        |  12 +++
 OvmfPkg/OvmfPkgX64.fdf                     |   9 +-
 OvmfPkg/PlatformPei/PlatformPei.inf        |   4 +-
 OvmfPkg/ResetVector/ResetVector.inf        |   1 +
 OvmfPkg/Sec/SecMain.inf                    |   2 +
 OvmfPkg/Include/Library/MemEncryptSevLib.h |  21 +---
 OvmfPkg/Include/WorkArea.h                 |  67 +++++++++++++
 OvmfPkg/PlatformPei/MemDetect.c            |  32 +++---
 OvmfPkg/Sec/SecMain.c                      |  32 +++++-
 OvmfPkg/OvmfPkgDefines.fdf.inc             |   6 ++
 OvmfPkg/ResetVector/Ia32/AmdSev.asm        | 111 +++++++++++++++++----
 OvmfPkg/ResetVector/Ia32/PageTables64.asm  |  57 ++---------
 OvmfPkg/ResetVector/ResetVector.nasmb      |   1 +
 13 files changed, 247 insertions(+), 108 deletions(-)
 create mode 100644 OvmfPkg/Include/WorkArea.h

-- 
2.17.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#78751): https://edk2.groups.io/g/devel/message/78751
Mute This Topic: https://groups.io/mt/84694275/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-


Re: [edk2-devel] [PATCH v2 0/3] reuse the SevEsWork area
Posted by Min Xu 2 years, 8 months ago
Hi, Brijesh
May I know is there some progress of this patch set? I noticed some comments have been given to the patch-set.

Thanks!
Min

> -----Original Message-----
> From: Brijesh Singh <brijesh.singh@amd.com>
> Sent: Friday, August 6, 2021 4:42 AM
> To: devel@edk2.groups.io
> Cc: James Bottomley <jejb@linux.ibm.com>; Xu, Min M
> <min.m.xu@intel.com>; Yao, Jiewen <jiewen.yao@intel.com>; Tom
> Lendacky <thomas.lendacky@amd.com>; Justen, Jordan L
> <jordan.l.justen@intel.com>; Ard Biesheuvel <ardb+tianocore@kernel.org>;
> Erdem Aktas <erdemaktas@google.com>; Michael Roth
> <Michael.Roth@amd.com>; Brijesh Singh <brijesh.singh@amd.com>
> Subject: [PATCH v2 0/3] reuse the SevEsWork area
> 
> Based on the discussion on the mailing list, we agreed that instead of wasting
> extra page in the MEMFD, we can reuse the SevEsWorkArea buffer for the
> TDX. To avoid any confusion, lets introduce a OvmfWorkArea that will
> contains 32 bytes of header followed by the actual workarea.
> 
> While at it, move the code to clear the GHCB page from PageTable build to
> AmdSev.asm.
> 
> I have used the existing TDX BZ for it because the request came during the
> TDX patch review. if anyone have concern please let me know and I will
> happily create a new BZ.
> 
> Full tree is at: https://github.com/AMDESE/ovmf/tree/sev-new-work-area
> 
> Brijesh Singh (3):
>   OvmfPkg: introduce a common work area
>   OvmfPkg/ResetVector: update SEV support to use new work area format
>   OvmfPkg/ResetVector: move the GHCB page setup in AmdSev.asm
> 
> Cc: James Bottomley <jejb@linux.ibm.com>
> Cc: Min Xu <min.m.xu@intel.com>
> Cc: Jiewen Yao <jiewen.yao@intel.com>
> Cc: Tom Lendacky <thomas.lendacky@amd.com>
> Cc: Jordan Justen <jordan.l.justen@intel.com>
> Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
> Cc: Erdem Aktas <erdemaktas@google.com>
> 
> Changes since v1:
>  - address Jiewen's feedback.
> 
> Brijesh Singh (3):
>   OvmfPkg: introduce a common work area
>   OvmfPkg/ResetVector: update SEV support to use new work area format
>   OvmfPkg/ResetVector: move the GHCB page setup in AmdSev.asm
> 
>  OvmfPkg/OvmfPkg.dec                        |  12 +++
>  OvmfPkg/OvmfPkgX64.fdf                     |   9 +-
>  OvmfPkg/PlatformPei/PlatformPei.inf        |   4 +-
>  OvmfPkg/ResetVector/ResetVector.inf        |   1 +
>  OvmfPkg/Sec/SecMain.inf                    |   2 +
>  OvmfPkg/Include/Library/MemEncryptSevLib.h |  21 +---
>  OvmfPkg/Include/WorkArea.h                 |  67 +++++++++++++
>  OvmfPkg/PlatformPei/MemDetect.c            |  32 +++---
>  OvmfPkg/Sec/SecMain.c                      |  32 +++++-
>  OvmfPkg/OvmfPkgDefines.fdf.inc             |   6 ++
>  OvmfPkg/ResetVector/Ia32/AmdSev.asm        | 111 +++++++++++++++++---
> -
>  OvmfPkg/ResetVector/Ia32/PageTables64.asm  |  57 ++---------
>  OvmfPkg/ResetVector/ResetVector.nasmb      |   1 +
>  13 files changed, 247 insertions(+), 108 deletions(-)  create mode 100644
> OvmfPkg/Include/WorkArea.h
> 
> --
> 2.17.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#79313): https://edk2.groups.io/g/devel/message/79313
Mute This Topic: https://groups.io/mt/84694275/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-


Re: [edk2-devel] [PATCH v2 0/3] reuse the SevEsWork area
Posted by Brijesh Singh via groups.io 2 years, 8 months ago
Hi Min,

I was giving sometime for other reviewers to comment. I will respin v3 
this week with Tom's feedback addressed.

thanks


On 8/14/21 10:00 PM, Xu, Min M wrote:
> Hi, Brijesh
> May I know is there some progress of this patch set? I noticed some comments have been given to the patch-set.
> 
> Thanks!
> Min
> 
>> -----Original Message-----
>> From: Brijesh Singh <brijesh.singh@amd.com>
>> Sent: Friday, August 6, 2021 4:42 AM
>> To: devel@edk2.groups.io
>> Cc: James Bottomley <jejb@linux.ibm.com>; Xu, Min M
>> <min.m.xu@intel.com>; Yao, Jiewen <jiewen.yao@intel.com>; Tom
>> Lendacky <thomas.lendacky@amd.com>; Justen, Jordan L
>> <jordan.l.justen@intel.com>; Ard Biesheuvel <ardb+tianocore@kernel.org>;
>> Erdem Aktas <erdemaktas@google.com>; Michael Roth
>> <Michael.Roth@amd.com>; Brijesh Singh <brijesh.singh@amd.com>
>> Subject: [PATCH v2 0/3] reuse the SevEsWork area
>>
>> Based on the discussion on the mailing list, we agreed that instead of wasting
>> extra page in the MEMFD, we can reuse the SevEsWorkArea buffer for the
>> TDX. To avoid any confusion, lets introduce a OvmfWorkArea that will
>> contains 32 bytes of header followed by the actual workarea.
>>
>> While at it, move the code to clear the GHCB page from PageTable build to
>> AmdSev.asm.
>>
>> I have used the existing TDX BZ for it because the request came during the
>> TDX patch review. if anyone have concern please let me know and I will
>> happily create a new BZ.
>>
>> Full tree is at: https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2FAMDESE%2Fovmf%2Ftree%2Fsev-new-work-area&amp;data=04%7C01%7Cbrijesh.singh%40amd.com%7C0e9d9486a8974e77448a08d95f98d95e%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637645932352135436%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&amp;sdata=2kSK48j5Nghl5F%2FCDyun6tGkFRwTpb1QAf5kpPAnbIA%3D&amp;reserved=0
>>
>> Brijesh Singh (3):
>>    OvmfPkg: introduce a common work area
>>    OvmfPkg/ResetVector: update SEV support to use new work area format
>>    OvmfPkg/ResetVector: move the GHCB page setup in AmdSev.asm
>>
>> Cc: James Bottomley <jejb@linux.ibm.com>
>> Cc: Min Xu <min.m.xu@intel.com>
>> Cc: Jiewen Yao <jiewen.yao@intel.com>
>> Cc: Tom Lendacky <thomas.lendacky@amd.com>
>> Cc: Jordan Justen <jordan.l.justen@intel.com>
>> Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
>> Cc: Erdem Aktas <erdemaktas@google.com>
>>
>> Changes since v1:
>>   - address Jiewen's feedback.
>>
>> Brijesh Singh (3):
>>    OvmfPkg: introduce a common work area
>>    OvmfPkg/ResetVector: update SEV support to use new work area format
>>    OvmfPkg/ResetVector: move the GHCB page setup in AmdSev.asm
>>
>>   OvmfPkg/OvmfPkg.dec                        |  12 +++
>>   OvmfPkg/OvmfPkgX64.fdf                     |   9 +-
>>   OvmfPkg/PlatformPei/PlatformPei.inf        |   4 +-
>>   OvmfPkg/ResetVector/ResetVector.inf        |   1 +
>>   OvmfPkg/Sec/SecMain.inf                    |   2 +
>>   OvmfPkg/Include/Library/MemEncryptSevLib.h |  21 +---
>>   OvmfPkg/Include/WorkArea.h                 |  67 +++++++++++++
>>   OvmfPkg/PlatformPei/MemDetect.c            |  32 +++---
>>   OvmfPkg/Sec/SecMain.c                      |  32 +++++-
>>   OvmfPkg/OvmfPkgDefines.fdf.inc             |   6 ++
>>   OvmfPkg/ResetVector/Ia32/AmdSev.asm        | 111 +++++++++++++++++---
>> -
>>   OvmfPkg/ResetVector/Ia32/PageTables64.asm  |  57 ++---------
>>   OvmfPkg/ResetVector/ResetVector.nasmb      |   1 +
>>   13 files changed, 247 insertions(+), 108 deletions(-)  create mode 100644
>> OvmfPkg/Include/WorkArea.h
>>
>> --
>> 2.17.1
> 


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#79361): https://edk2.groups.io/g/devel/message/79361
Mute This Topic: https://groups.io/mt/84694275/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-