<feed xmlns='http://www.w3.org/2005/Atom'>
<title>Tianocore/edk2.git/OvmfPkg/Library/BaseMemEncryptSevLib/DxeMemEncryptSevLib.inf, branch master</title>
<subtitle>EDK II (mirror)</subtitle>
<id>https://git.radix-linux.su/Tianocore/edk2.git/atom?h=master</id>
<link rel='self' href='https://git.radix-linux.su/Tianocore/edk2.git/atom?h=master'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/Tianocore/edk2.git/'/>
<updated>2026-08-27T06:37:01+00:00</updated>
<entry>
<title>OvmfPkg/BaseMemEncryptSevLib: Fetch Sev data from the work area</title>
<updated>2026-08-27T06:37:01+00:00</updated>
<author>
<name>John Berg</name>
<email>jhnberg@amazon.co.uk</email>
</author>
<published>2026-08-05T13:35:31+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/Tianocore/edk2.git/commit/?id=196e496a4ec19c083c6e97b87c475c73020807da'/>
<id>urn:sha1:196e496a4ec19c083c6e97b87c475c73020807da</id>
<content type='text'>
The first call to MemEncryptSevGetEncryptionMask() in the Dxe phase will
look for the encryption mask for the page table entry by reading the
PcdPteMemoryEncryptionAddressOrMask (dynamic PCD) token. The value is
then cached for subsequent accesses. But if the first call has
interrupts disabled, as is the case in the MmioExit function in the #VC
handler then the PcdGet64() will re-enable interrupts unexpectedly. A
hypervisor may then inject interrupts into the guest whilst the guest is
not expected to be interrupted. This leads to the ovmf image hanging
when handling too many nested #VC exceptions.

This patch avoids using the PcdPteMemoryEncryptionAddressOrMask token in
the MemEncryptSevGetEncryptionMask() function as it cannot be called
safely from a context where interrupts are disabled. Instead, we fetch
the values from the SEC_SEV_ES_WORK_AREA in the Dxe phase. The work area
is already used in the Pei phase, and is available in the Dxe phase as it
is marked as either EfiBootServicesData or EfiACPIMemoryNVS. However,
the work area will be inaccessible when SetVirtualAddressMap() is called,
so we only read the work area in the Dxe phase through a constructor function.

Signed-off-by: John Berg &lt;jhnberg@amazon.co.uk&gt;
Signed-off-by: Ivan Orlov &lt;iorlov@amazon.co.uk&gt;
</content>
</entry>
<entry>
<title>OvmfPkg/BaseMemEncryptSevLib: Make GetSevEsWorkArea() Pei/Dxe shared</title>
<updated>2026-08-27T06:37:01+00:00</updated>
<author>
<name>John Berg</name>
<email>jhnberg@amazon.co.uk</email>
</author>
<published>2026-08-13T09:01:38+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/Tianocore/edk2.git/commit/?id=6a99d10480bacd0affcfe2c7399d961237e00b79'/>
<id>urn:sha1:6a99d10480bacd0affcfe2c7399d961237e00b79</id>
<content type='text'>
This is a small refactor to the BaseMemEncryptSevLib in the OvmfPkg
which moves the function used in the Pei phase for accessing the
SEC_SEV_ES_WORK_AREA, into the common Pei and Dxe code. The Dxe phase
will consume the work area in a subsequent patch.

Signed-off-by: John Berg &lt;jhnberg@amazon.co.uk&gt;
</content>
</entry>
<entry>
<title>OvmfPkg: Remove OVMF IA32</title>
<updated>2025-09-09T18:49:32+00:00</updated>
<author>
<name>Oliver Smith-Denny</name>
<email>osde@microsoft.com</email>
</author>
<published>2025-08-25T18:24:03+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/Tianocore/edk2.git/commit/?id=1fb88ffe284782cc79e306306b8d19829b6248b7'/>
<id>urn:sha1:1fb88ffe284782cc79e306306b8d19829b6248b7</id>
<content type='text'>
This commit removes OVMF IA32 from edk2 per RFC
https://edk2.groups.io/g/devel/topic/rfc_remove_ovmf_ia32_and/114152215.

OVMF IA32 is a 32 bit only platform that no longer represents the vast
majority of physical platforms. The RFC details more reasoning in
much more depth.

OVMF IA32 will be kept in a branch off the edk2-stable202508 tag for
any long term consumers; it will receive build break updates only
(e.g. if an upstream submodule changes location).

Signed-off-by: Oliver Smith-Denny &lt;osde@microsoft.com&gt;
</content>
</entry>
<entry>
<title>OvmfPkg/BaseMemEncryptSevLib: Use AmdSvsmSnpPvalidate() to validate pages</title>
<updated>2024-04-17T20:04:41+00:00</updated>
<author>
<name>Tom Lendacky</name>
<email>thomas.lendacky@amd.com</email>
</author>
<published>2024-03-08T15:32:10+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/Tianocore/edk2.git/commit/?id=f6bf37c1711c07709b0817a996c5b5a97f263bdd'/>
<id>urn:sha1:f6bf37c1711c07709b0817a996c5b5a97f263bdd</id>
<content type='text'>
BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=4654

The PVALIDATE instruction is used to change the SNP validation of a page,
but that can only be done when running at VMPL0. To prepare for running at
a less priviledged VMPL, use the AmdSvsmLib library API to perform the
PVALIDATE. The AmdSvsmLib library will perform the proper operation on
behalf of the caller.

Cc: Ard Biesheuvel &lt;ardb+tianocore@kernel.org&gt;
Cc: Erdem Aktas &lt;erdemaktas@google.com&gt;
Cc: Gerd Hoffmann &lt;kraxel@redhat.com&gt;
Cc: Jiewen Yao &lt;jiewen.yao@intel.com&gt;
Cc: Laszlo Ersek &lt;lersek@redhat.com&gt;
Cc: Michael Roth &lt;michael.roth@amd.com&gt;
Cc: Min Xu &lt;min.m.xu@intel.com&gt;
Signed-off-by: Tom Lendacky &lt;thomas.lendacky@amd.com&gt;
Acked-by: Gerd Hoffmann &lt;kraxel@redhat.com&gt;
</content>
</entry>
<entry>
<title>OvmfPkg/UefiCpuPkg/UefiPayloadPkg: Rename VmgExitLib to CcExitLib</title>
<updated>2022-11-14T04:55:34+00:00</updated>
<author>
<name>Min M Xu</name>
<email>min.m.xu@intel.com</email>
</author>
<published>2022-11-07T06:30:26+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/Tianocore/edk2.git/commit/?id=a89f558d3c56d9c16e5f5b7d395c1aa36ccd38f2'/>
<id>urn:sha1:a89f558d3c56d9c16e5f5b7d395c1aa36ccd38f2</id>
<content type='text'>
BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=4123

VmgExitLib once was designed to provide interfaces to support #VC handler
and issue VMGEXIT instruction. After TDVF (enable TDX feature in OVMF) is
introduced, this library is updated to support #VE as well. Now the name
of VmgExitLib cannot reflect what the lib does.

This patch renames VmgExitLib to CcExitLib (Cc means Confidential
Computing). This is a simple renaming and there is no logic changes.
After renaming all the VmgExitLib related codes are updated with
CcExitLib. These changes are in OvmfPkg/UefiCpuPkg/UefiPayloadPkg.

Cc: Guo Dong &lt;guo.dong@intel.com&gt;
Cc: Sean Rhodes &lt;sean@starlabs.systems&gt;
Cc: James Lu &lt;james.lu@intel.com&gt;
Cc: Gua Guo &lt;gua.guo@intel.com&gt;
Cc: Eric Dong &lt;eric.dong@intel.com&gt;
Cc: Ray Ni &lt;ray.ni@intel.com&gt;
Cc: Brijesh Singh &lt;brijesh.singh@amd.com&gt;
Cc: Erdem Aktas &lt;erdemaktas@google.com&gt;
Cc: Gerd Hoffmann &lt;kraxel@redhat.com&gt;
Cc: James Bottomley &lt;jejb@linux.ibm.com&gt;
Cc: Jiewen Yao &lt;jiewen.yao@intel.com&gt;
Cc: Tom Lendacky &lt;thomas.lendacky@amd.com&gt;
Reviewed-by: James Lu &lt;james.lu@intel.com&gt;
Reviewed-by: Gua Guo &lt;gua.guo@intel.com&gt;
Reviewed-by: Jiewen Yao &lt;jiewen.yao@intel.com&gt;
Reviewed-by: Ray Ni &lt;ray.ni@intel.com&gt;
Signed-off-by: Min Xu &lt;min.m.xu@intel.com&gt;
</content>
</entry>
<entry>
<title>OvmfPkg/BaseMemEncryptLib: use the SEV_STATUS MSR value from workarea</title>
<updated>2022-02-28T02:46:08+00:00</updated>
<author>
<name>Brijesh Singh</name>
<email>brijesh.singh@amd.com</email>
</author>
<published>2022-02-21T14:59:14+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/Tianocore/edk2.git/commit/?id=f1d1c337e7c0575da7fd248b2dd9cffc755940df'/>
<id>urn:sha1:f1d1c337e7c0575da7fd248b2dd9cffc755940df</id>
<content type='text'>
BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=3582

Improve the MemEncryptSev{Es,Snp}IsEnabled() to use the SEV_STATUS MSR
value saved in the workarea. Since workarea is valid until the PEI phase,
so, for the Dxe phase use the PcdConfidentialComputingGuestAttr to
determine which SEV technology is enabled.

Cc: Min Xu &lt;min.m.xu@intel.com&gt;
Cc: Jiewen Yao &lt;jiewen.yao@intel.com&gt;
Cc: Tom Lendacky &lt;thomas.lendacky@amd.com&gt;
Cc: Jordan Justen &lt;jordan.l.justen@intel.com&gt;
Cc: Ard Biesheuvel &lt;ardb+tianocore@kernel.org&gt;
Cc: Erdem Aktas &lt;erdemaktas@google.com&gt;
Cc: Gerd Hoffmann &lt;kraxel@redhat.com&gt;
Acked-by: Gerd Hoffmann &lt;kraxel@redhat.com&gt;
Signed-off-by: Brijesh Singh &lt;brijesh.singh@amd.com&gt;
Acked-by: Jiewen Yao &lt;jiewen.yao@intel.com&gt;
</content>
</entry>
<entry>
<title>OvmfPkg/MemEncryptSevLib: add support to validate system RAM</title>
<updated>2021-12-09T06:28:10+00:00</updated>
<author>
<name>Brijesh Singh via groups.io</name>
<email>brijesh.singh=amd.com@groups.io</email>
</author>
<published>2021-12-09T03:27:42+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/Tianocore/edk2.git/commit/?id=ade62c18f4742301bbef474ac10518bde5972fba'/>
<id>urn:sha1:ade62c18f4742301bbef474ac10518bde5972fba</id>
<content type='text'>
BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=3275

Many of the integrity guarantees of SEV-SNP are enforced through the
Reverse Map Table (RMP). Each RMP entry contains the GPA at which a
particular page of DRAM should be mapped. The guest can request the
hypervisor to add pages in the RMP table via the Page State Change VMGEXIT
defined in the GHCB specification section 2.5.1 and 4.1.6. Inside each RMP
entry is a Validated flag; this flag is automatically cleared to 0 by the
CPU hardware when a new RMP entry is created for a guest. Each VM page
can be either validated or invalidated, as indicated by the Validated
flag in the RMP entry. Memory access to a private page that is not
validated generates a #VC. A VM can use the PVALIDATE instruction to
validate the private page before using it.

During the guest creation, the boot ROM memory is pre-validated by the
AMD-SEV firmware. The MemEncryptSevSnpValidateSystemRam() can be called
during the SEC and PEI phase to validate the detected system RAM.

One of the fields in the Page State Change NAE is the RMP page size. The
page size input parameter indicates that either a 4KB or 2MB page should
be used while adding the RMP entry. During the validation, when possible,
the MemEncryptSevSnpValidateSystemRam() will use the 2MB entry. A
hypervisor backing the memory may choose to use the different page size
in the RMP entry. In those cases, the PVALIDATE instruction should return
SIZEMISMATCH. If a SIZEMISMATCH is detected, then validate all 512-pages
constituting a 2MB region.

Upon completion, the PVALIDATE instruction sets the rFLAGS.CF to 0 if
instruction changed the RMP entry and to 1 if the instruction did not
change the RMP entry. The rFlags.CF will be 1 only when a memory region
is already validated. We should not double validate a memory
as it could lead to a security compromise. If double validation is
detected, terminate the boot.

Cc: Michael Roth &lt;michael.roth@amd.com&gt;
Cc: James Bottomley &lt;jejb@linux.ibm.com&gt;
Cc: Min Xu &lt;min.m.xu@intel.com&gt;
Cc: Jiewen Yao &lt;jiewen.yao@intel.com&gt;
Cc: Tom Lendacky &lt;thomas.lendacky@amd.com&gt;
Cc: Jordan Justen &lt;jordan.l.justen@intel.com&gt;
Cc: Ard Biesheuvel &lt;ardb+tianocore@kernel.org&gt;
Cc: Erdem Aktas &lt;erdemaktas@google.com&gt;
Cc: Gerd Hoffmann &lt;kraxel@redhat.com&gt;
Acked-by: Jiewen Yao &lt;Jiewen.yao@intel.com&gt;
Acked-by: Gerd Hoffmann &lt;kraxel@redhat.com&gt;
Signed-off-by: Brijesh Singh &lt;brijesh.singh@amd.com&gt;
</content>
</entry>
<entry>
<title>OvfmPkg/VmgExitLib: Validate #VC MMIO is to un-encrypted memory</title>
<updated>2021-01-07T19:34:39+00:00</updated>
<author>
<name>Tom Lendacky</name>
<email>thomas.lendacky@amd.com</email>
</author>
<published>2021-01-07T18:48:25+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/Tianocore/edk2.git/commit/?id=85b8eac59b8c5bd9c7eb9afdb64357ce1aa2e803'/>
<id>urn:sha1:85b8eac59b8c5bd9c7eb9afdb64357ce1aa2e803</id>
<content type='text'>
BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=3108

When SEV-ES is active, and MMIO operation will trigger a #VC and the
VmgExitLib exception handler will process this MMIO operation.

A malicious hypervisor could try to extract information from encrypted
memory by setting a reserved bit in the guests nested page tables for
a non-MMIO area. This can result in the encrypted data being copied into
the GHCB shared buffer area and accessed by the hypervisor.

Prevent this by ensuring that the MMIO source/destination is un-encrypted
memory. For the APIC register space, access is allowed in general.

Cc: Jordan Justen &lt;jordan.l.justen@intel.com&gt;
Cc: Laszlo Ersek &lt;lersek@redhat.com&gt;
Cc: Ard Biesheuvel &lt;ard.biesheuvel@arm.com&gt;
Cc: Brijesh Singh &lt;brijesh.singh@amd.com&gt;
Acked-by: Laszlo Ersek &lt;lersek@redhat.com&gt;
Signed-off-by: Tom Lendacky &lt;thomas.lendacky@amd.com&gt;
Message-Id: &lt;0cf28470ad5e694af45f7f0b35296628f819567d.1610045305.git.thomas.lendacky@amd.com&gt;
</content>
</entry>
<entry>
<title>OvmfPkg/MemEncryptSevLib: Address range encryption state interface</title>
<updated>2021-01-07T19:34:39+00:00</updated>
<author>
<name>Tom Lendacky</name>
<email>thomas.lendacky@amd.com</email>
</author>
<published>2021-01-07T18:48:22+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/Tianocore/edk2.git/commit/?id=c330af0246ac9b1c37d17fc79881fc2dd96ec80c'/>
<id>urn:sha1:c330af0246ac9b1c37d17fc79881fc2dd96ec80c</id>
<content type='text'>
BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=3108

Update the MemEncryptSevLib library to include an interface that can
report the encryption state on a range of memory. The values will
represent the range as being unencrypted, encrypted, a mix of unencrypted
and encrypted, and error (e.g. ranges that aren't mapped).

Cc: Jordan Justen &lt;jordan.l.justen@intel.com&gt;
Cc: Laszlo Ersek &lt;lersek@redhat.com&gt;
Cc: Ard Biesheuvel &lt;ard.biesheuvel@arm.com&gt;
Cc: Brijesh Singh &lt;brijesh.singh@amd.com&gt;
Acked-by: Laszlo Ersek &lt;lersek@redhat.com&gt;
Signed-off-by: Tom Lendacky &lt;thomas.lendacky@amd.com&gt;
Message-Id: &lt;0d98f4d42a2b67310c29bac7bcdcf1eda6835847.1610045305.git.thomas.lendacky@amd.com&gt;
</content>
</entry>
<entry>
<title>OvmfPkg/MemEncryptSevLib: Make the MemEncryptSevLib available for SEC</title>
<updated>2021-01-07T19:34:39+00:00</updated>
<author>
<name>Tom Lendacky</name>
<email>thomas.lendacky@amd.com</email>
</author>
<published>2021-01-07T18:48:21+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/Tianocore/edk2.git/commit/?id=a746ca5b47fdffd9c675f2cbf321a1c36ccc9356'/>
<id>urn:sha1:a746ca5b47fdffd9c675f2cbf321a1c36ccc9356</id>
<content type='text'>
BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=3108

In preparation for a new interface to be added to the MemEncryptSevLib
library that will be used in SEC, create an SEC version of the library.

This requires the creation of SEC specific files.

Some of the current MemEncryptSevLib functions perform memory allocations
which cannot be performed in SEC, so these interfaces will return an error
during SEC. Also, the current MemEncryptSevLib library uses some static
variables to optimize access to variables, which cannot be used in SEC.

Cc: Jordan Justen &lt;jordan.l.justen@intel.com&gt;
Cc: Laszlo Ersek &lt;lersek@redhat.com&gt;
Cc: Ard Biesheuvel &lt;ard.biesheuvel@arm.com&gt;
Cc: Brijesh Singh &lt;brijesh.singh@amd.com&gt;
Acked-by: Laszlo Ersek &lt;lersek@redhat.com&gt;
Signed-off-by: Tom Lendacky &lt;thomas.lendacky@amd.com&gt;
Message-Id: &lt;bc7fa76cc23784ab3f37356b6c10dfec61942c38.1610045305.git.thomas.lendacky@amd.com&gt;
</content>
</entry>
</feed>
