From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by mx.groups.io with SMTP id smtpd.web11.8786.1675384016723994766 for ; Thu, 02 Feb 2023 16:26:56 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@linux.microsoft.com header.s=default header.b=ZAnX/Ren; spf=pass (domain: linux.microsoft.com, ip: 13.77.154.182, mailfrom: mikuback@linux.microsoft.com) Received: from [192.168.4.22] (unknown [47.201.8.94]) by linux.microsoft.com (Postfix) with ESMTPSA id 1AC7120B74F7; Thu, 2 Feb 2023 16:26:55 -0800 (PST) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 1AC7120B74F7 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1675384016; bh=1yhOXWmGZtbknMQtBSvS9Ao5U123R0woYpAK9UBF6go=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=ZAnX/Ren8KU/4VfguAx+4hfaNiXnHbgLSZC4PgsZnup+W8gfGS+pCj8XARh1rhqEV yqL+SmeZQFmcRkZu9TxZM4RsUnoUmechMeYUeYQQKylsXArKoDTb2oxEwBLbrBravI QeoqByeByEikC1HLd0/DUMXkwT14EsmBa+UIeJLM= Message-ID: <48a6eaff-1826-e51c-1703-1ebfe75a0ddd@linux.microsoft.com> Date: Thu, 2 Feb 2023 19:26:54 -0500 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 6.2; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.13.1 Subject: Re: [edk2-devel] [RFC PATCH 1/3] MdePkg: Update MemoryAttributesTable to v2.10 To: devel@edk2.groups.io, ardb@kernel.org Cc: Michael Kinney , Liming Gao , Jiewen Yao , Michael Kubacki , Sean Brogan , Rebecca Cran , Leif Lindholm , Sami Mujawar , Taylor Beebe References: <20230202180335.2256160-1-ardb@kernel.org> <20230202180335.2256160-2-ardb@kernel.org> From: "Michael Kubacki" In-Reply-To: <20230202180335.2256160-2-ardb@kernel.org> Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Acked-by: Michael Kubacki Might be convenient to have a link in the commit message to the definition in the 2.10 spec: https://uefi.org/specs/UEFI/2.10/04_EFI_System_Table.html?highlight=memory_attribute#efi-memory-attributes-table On 2/2/2023 1:03 PM, Ard Biesheuvel wrote: > UEFI v2.10 introduces a new flag to the memory attributes table to > inform the OS whether or not runtime services code regions were emitted > by the compiler with guard instructions for forward edge control flow > integrity enforcement. > > So update our definition accordingly. > > Signed-off-by: Ard Biesheuvel > --- > MdePkg/Include/Guid/MemoryAttributesTable.h | 8 ++++++-- > 1 file changed, 6 insertions(+), 2 deletions(-) > > diff --git a/MdePkg/Include/Guid/MemoryAttributesTable.h b/MdePkg/Include/Guid/MemoryAttributesTable.h > index 82f83a67b96d..238c14ff92df 100644 > --- a/MdePkg/Include/Guid/MemoryAttributesTable.h > +++ b/MdePkg/Include/Guid/MemoryAttributesTable.h > @@ -17,11 +17,15 @@ typedef struct { > UINT32 Version; > > UINT32 NumberOfEntries; > > UINT32 DescriptorSize; > > - UINT32 Reserved; > > + UINT32 Flags; > > // EFI_MEMORY_DESCRIPTOR Entry[1]; > > } EFI_MEMORY_ATTRIBUTES_TABLE; > > > > -#define EFI_MEMORY_ATTRIBUTES_TABLE_VERSION 0x00000001 > > +#define EFI_MEMORY_ATTRIBUTES_TABLE_VERSION 0x00000002 > > + > > +#define EFI_MEMORY_ATTRIBUTES_FLAGS_RT_FORWARD_CONTROL_FLOW_GUARD 0x1 > > +// BIT0 implies that Runtime code includes the forward control flow guard > > +// instruction, such as X86 CET-IBT or ARM BTI. > > > > extern EFI_GUID gEfiMemoryAttributesTableGuid; > > >