[Bug 3987] New: Adds a new memory allocation boot service GetMemoryMapEx that carries a memory feature support bitmap.


bugzilla-daemon@...
 

https://bugzilla.tianocore.org/show_bug.cgi?id=3987

Bug ID: 3987
Summary: Adds a new memory allocation boot service
GetMemoryMapEx that carries a memory feature support
bitmap.
Product: EDK2 Code First
Version: Current
Hardware: All
OS: All
Status: UNCONFIRMED
Severity: normal
Priority: Lowest
Component: Specification Update
Assignee: unassigned@...
Reporter: dionnaglaze@...
CC: edk2+bugs+int+994+563148131503455288@groups.io
EDK II Code First UEFI Specification
industry standard
specifications:

# Title: GetMemoryMapEx

# Status: Draft

# Document: UEFI Specification Version 2.10

# License

SPDX-License-Identifier: CC-BY-4.0

# Submitter: [TianoCore Community](https://www.tianocore.org)

# Summary of the change

Adds a new memory allocation boot service GetMemoryMapEx that carries a memory
feature support bitmap.

# Benefits of the change

The addition of unaccepted memory in v2.9 makes the assumption that support of
a technology (e.g., Intel TDX, AMD SEV-SNP) is paired with support of
unaccepted memory in the guest OS. This is not the case. Linux has support for
SEV-SNP without support for accepting unaccepted memory. By adding this boot
service, the guest OS can inform the UEFI whether it has support for unaccepted
memory or not so that in the case that unaccepted memory is not supported, the
UEFI can accept all memory and classify unaccepted memory as system memory
before returning a memory map.

# Impact of the change

Virtual machines that run SEV-SNP will enjoy the benefits of a faster boot,
since accepting all memory before booting the guest OS can take a significant
amount of time for VMs with a large memory footprint.

# Detailed description of the change [normative updates]

Addition to end of Section 4.4 EFI Boot services table

EFI_GET_MEMORY_MAP_EX GetMemoryMapEx; // UEFI 2.10+

Addition to Section 7.2

EFI_BOOT_SERVICES.GetMemoryMapEx()

Summary
Returns the current memory map subject to feature support.

Prototype

typedef EFI_STATUS (EFIAPI *EFI_GET_MEMORY_MAP_EX) (
IN OUT UINTN *MemoryMapSize,
IN EFI_MEMORY_MAP_FEATURES_TYPE *MemoryMapFeatures,
OUT EFI_MEMORY_DESCRIPTOR *MemoryMap,
OUT UINTN *MapKey,
OUT UINTN *DescriptorSize,
OUT UINT32 *DescriptorVersion
);

Parameters

MemoryMapSize

A pointer to the size, in bytes, of the MemoryMap buffer. On input, this is the
size of the buffer allocated by the caller. On output, it is the size of the
buffer returned by the firmware if the buffer was large enough, or the size of
the buffer needed to contain the map if the buffer was too small.

MemoryMapFeatures

A pointer to the description of the caller's support for particular memory
features. The description is a sized struct to permit future extension. If
NULL, then all features are considered supported. See “Related Definitions.”

MemoryMap

A pointer to the buffer in which firmware places the current memory map. The
map is an array of EFI_MEMORY_DESCRIPTORs, which is defined in the
GetMemoryMap() function description.

MapKey

A pointer to the location in which firmware returns the key for the current
memory map. DescriptorSize A pointer to the location in which firmware returns
the size, in bytes, of an individual EFI_MEMORY_DESCRIPTOR.

DescriptorVersion

A pointer to the location in which firmware returns the version number
associated with the EFI_MEMORY_DESCRIPTOR. See “Related Definitions.”

EFI_SUCCESS The requested memory pages were freed.
EFI_NOT_FOUND The requested memory pages were not allocated with
AllocatePages(). EFI_INVALID_PARAMETER Memory is not a page-aligned address or
Pages is invalid.

Related Definitions

//*******************************************************
//EFI_MEMORY_MAP_FEATURES_TYPE
//*******************************************************
typedef struct {
UINT32 Size;
UINT64 FeatureBitmap0;
} EFI_MEMORY_MAP_FEATURES_TYPE;

//*******************************************************
// Acceptable values for FeatureBitmap0 in EFI_MEMORY_MAP_FEATURES_TYPE
//*******************************************************
#define EFI_MEMORY_MAP_FEATURE0_UNACCEPTED_MEMORY 1

Size

The size of this struct. If less than the size of the struct, then the
remaining data are defined as 0. If larger than the size of the struct, then
all data beyond is considered unsupported optional feature data and is defined
as 0.

FeatureBitmap0

A bitmap of features that the caller supports. Must be a bitwise OR of
EFI_MEMORY_MAP_FEATURE0_* values.

--
You are receiving this mail because:
You are on the CC list for the bug.

Join {bugs@edk2.groups.io to automatically receive all group messages.