From nobody Fri Nov 29 02:52:59 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1650382844220220.55605387137803; Tue, 19 Apr 2022 08:40:44 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.308279.523959 (Exim 4.92) (envelope-from ) id 1ngpxk-000387-47; Tue, 19 Apr 2022 15:40:20 +0000 Received: by outflank-mailman (output) from mailman id 308279.523959; Tue, 19 Apr 2022 15:40:20 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1ngpxk-00037y-0G; Tue, 19 Apr 2022 15:40:20 +0000 Received: by outflank-mailman (input) for mailman id 308279; Tue, 19 Apr 2022 15:40:18 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1ngpxi-0001X4-Mx for xen-devel@lists.xenproject.org; Tue, 19 Apr 2022 15:40:18 +0000 Received: from out5-smtp.messagingengine.com (out5-smtp.messagingengine.com [66.111.4.29]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 02fca4bd-bff7-11ec-8fbf-03012f2f19d4; Tue, 19 Apr 2022 17:40:17 +0200 (CEST) Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id AC34F5C01A7; Tue, 19 Apr 2022 11:40:16 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute5.internal (MEProxy); Tue, 19 Apr 2022 11:40:16 -0400 Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 19 Apr 2022 11:40:15 -0400 (EDT) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 02fca4bd-bff7-11ec-8fbf-03012f2f19d4 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t=1650382816; x= 1650469216; bh=y8YXkeeQ9GgwyGmaIEG/es/LlJnAcVQcC9VWjF18iw8=; b=k DqbBiwXLWZUu1Nitz4+JinnRFGiAsrST4QYi8bwctJD9v5OMPNCVj25Jd7UFGAGP +QNDpi7I/CxIP+tNuOz4L8ncTHgLDZqODX3Wi3SFsiEomHrwGOjgH32zrhGpXGZO j9KKl31AVoLzEO4GvFNERKdGbizNp8vPIiKOuTHzpICn0X0ZjaZGERar8+JVbnuO cPGbmUwO+Ag69ru6g0wNBAR8SJGZ8Z6a2vIFcAjEOF90Tq/Y0Uim5O7RDjW/F+/1 j5wTtF6Wom/k7Lj6ZNCea2qIjlrlAZfdRATjiyyq1zhqQMCPKFPXdq+WIAbI6VyE MNn9DCvMogs+KuUCHQUtg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvvddrvddtfedgleduucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepfffhvffukfhfgggtuggjsehgtderredttddunecuhfhrohhmpeffvghmihcu ofgrrhhivgcuqfgsvghnohhurhcuoeguvghmihesihhnvhhishhisghlvghthhhinhhgsh hlrggsrdgtohhmqeenucggtffrrghtthgvrhhnpeetgeeuieehvdfhfefgtedvjeehtdei geduheeljeduveejheefvdeifeeuvddthfenucffohhmrghinhepkhgvrhhnvghlrdhorh hgnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepuggv mhhisehinhhvihhsihgslhgvthhhihhnghhslhgrsgdrtghomh X-ME-Proxy: Date: Tue, 19 Apr 2022 11:40:12 -0400 From: Demi Marie Obenour To: xen-devel@lists.xenproject.org Cc: Stefano Stabellini , Julien Grall , Bertrand Marquis , Volodymyr Babchuk , Jan Beulich , Andrew Cooper , Roger Pau =?iso-8859-1?Q?Monn=E9?= , Wei Liu Subject: [PATCH v3 1/4] Grab the EFI System Resource Table and check it Message-ID: References: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="L3mDJzuE5U39uQuT" Content-Disposition: inline In-Reply-To: X-Zoho-Virus-Status: 1 X-ZM-MESSAGEID: 1650382846514100001 --L3mDJzuE5U39uQuT Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Date: Tue, 19 Apr 2022 11:40:12 -0400 From: Demi Marie Obenour To: xen-devel@lists.xenproject.org Cc: Stefano Stabellini , Julien Grall , Bertrand Marquis , Volodymyr Babchuk , Jan Beulich , Andrew Cooper , Roger Pau =?iso-8859-1?Q?Monn=E9?= , Wei Liu Subject: [PATCH v3 1/4] Grab the EFI System Resource Table and check it MIME-Version: 1.0 Content-Type: text/plain; protected-headers="v1"; charset="utf-8" The EFI System Resource Table (ESRT) is necessary for fwupd to identify firmware updates to install. According to the UEFI specification =C2=A723.= 4, the table shall be stored in memory of type EfiBootServicesData. Therefore, Xen must avoid reusing that memory for other purposes, so that Linux can access the ESRT. Additionally, Xen must mark the memory as reserved, so that Linux knows accessing it is safe. See https://lore.kernel.org/xen-devel/20200818184018.GN1679@mail-itl/T/ for details. Signed-off-by: Demi Marie Obenour --- xen/arch/arm/efi/efi-boot.h | 1 + xen/arch/x86/efi/efi-boot.h | 2 +- xen/common/efi/boot.c | 50 ++++++++++++++++++++++++++++++++++--- xen/common/efi/efi.h | 18 +++++++++++++ xen/common/efi/runtime.c | 3 ++- xen/include/efi/efiapi.h | 3 +++ 6 files changed, 72 insertions(+), 5 deletions(-) diff --git a/xen/arch/arm/efi/efi-boot.h b/xen/arch/arm/efi/efi-boot.h index e452b687d8..ab2ad3dfe0 100644 --- a/xen/arch/arm/efi/efi-boot.h +++ b/xen/arch/arm/efi/efi-boot.h @@ -188,6 +188,7 @@ static EFI_STATUS __init efi_process_memory_map_bootinf= o(EFI_MEMORY_DESCRIPTOR * desc_ptr->Type =3D=3D EfiLoaderCode || desc_ptr->Type =3D=3D EfiLoaderData || (!map_bs && + desc_ptr !=3D esrt_desc && (desc_ptr->Type =3D=3D EfiBootServicesCode || desc_ptr->Type =3D=3D EfiBootServicesData))) ) { diff --git a/xen/arch/x86/efi/efi-boot.h b/xen/arch/x86/efi/efi-boot.h index 6e65b569b0..75937c8a11 100644 --- a/xen/arch/x86/efi/efi-boot.h +++ b/xen/arch/x86/efi/efi-boot.h @@ -171,7 +171,7 @@ static void __init efi_arch_process_memory_map(EFI_SYST= EM_TABLE *SystemTable, { case EfiBootServicesCode: case EfiBootServicesData: - if ( map_bs ) + if ( map_bs || desc =3D=3D (EFI_MEMORY_DESCRIPTOR *)esrt_desc ) { default: type =3D E820_RESERVED; diff --git a/xen/common/efi/boot.c b/xen/common/efi/boot.c index ac1b235372..31664818c1 100644 --- a/xen/common/efi/boot.c +++ b/xen/common/efi/boot.c @@ -567,6 +567,38 @@ static int __init efi_check_dt_boot(const EFI_LOADED_I= MAGE *loaded_image) } #endif =20 +static UINTN __initdata esrt =3D EFI_INVALID_TABLE_ADDR; + +static bool __init is_esrt_valid( + const EFI_MEMORY_DESCRIPTOR *const desc) +{ + size_t available_len, len; + const UINTN physical_start =3D desc->PhysicalStart; + const ESRT *esrt_ptr; + + len =3D desc->NumberOfPages << EFI_PAGE_SHIFT; + if ( esrt =3D=3D EFI_INVALID_TABLE_ADDR ) + return false; + if ( physical_start > esrt || esrt - physical_start >=3D len ) + return false; + /* + * The specification requires EfiBootServicesData, but accept + * EfiRuntimeServicesData for compatibility + */ + if ( (desc->Type !=3D EfiRuntimeServicesData) && + (desc->Type !=3D EfiBootServicesData) ) + return false; + available_len =3D len - (esrt - physical_start); + if ( available_len < sizeof(*esrt_ptr) ) + return false; + esrt_ptr =3D (const ESRT *)esrt; + if ( esrt_ptr->Version !=3D 1 || !esrt_ptr->Count ) + return false; + return esrt_ptr->Count <=3D + (available_len - sizeof(*esrt_ptr)) / + sizeof(esrt_ptr->Entries[0]); +} + /* * Include architecture specific implementation here, which references the * static globals defined above. @@ -857,6 +889,7 @@ static void __init efi_tables(void) static EFI_GUID __initdata mps_guid =3D MPS_TABLE_GUID; static EFI_GUID __initdata smbios_guid =3D SMBIOS_TABLE_GUID; static EFI_GUID __initdata smbios3_guid =3D SMBIOS3_TABLE_GUID; + static EFI_GUID __initdata esrt_guid =3D ESRT_GUID; =20 if ( match_guid(&acpi2_guid, &efi_ct[i].VendorGuid) ) efi.acpi20 =3D (unsigned long)efi_ct[i].VendorTable; @@ -868,6 +901,8 @@ static void __init efi_tables(void) efi.smbios =3D (unsigned long)efi_ct[i].VendorTable; if ( match_guid(&smbios3_guid, &efi_ct[i].VendorGuid) ) efi.smbios3 =3D (unsigned long)efi_ct[i].VendorTable; + if ( match_guid(&esrt_guid, &efi_ct[i].VendorGuid) ) + esrt =3D (UINTN)efi_ct[i].VendorTable; } =20 #ifndef CONFIG_ARM /* TODO - disabled until implemented on ARM */ @@ -1056,19 +1091,19 @@ static void __init efi_exit_boot(EFI_HANDLE ImageHa= ndle, EFI_SYSTEM_TABLE *Syste EFI_STATUS status; UINTN info_size =3D 0, map_key; bool retry; -#ifdef CONFIG_EFI_SET_VIRTUAL_ADDRESS_MAP unsigned int i; -#endif =20 efi_bs->GetMemoryMap(&info_size, NULL, &map_key, &efi_mdesc_size, &mdesc_ver); - info_size +=3D 8 * efi_mdesc_size; + info_size +=3D 8 * (efi_mdesc_size + 1); efi_memmap =3D efi_arch_allocate_mmap_buffer(info_size); if ( !efi_memmap ) blexit(L"Unable to allocate memory for EFI memory map"); =20 for ( retry =3D false; ; retry =3D true ) { + esrt_desc =3D (const EFI_MEMORY_DESCRIPTOR *)EFI_INVALID_TABLE_ADD= R; + efi_memmap_size =3D info_size; status =3D SystemTable->BootServices->GetMemoryMap(&efi_memmap_siz= e, efi_memmap, &map_= key, @@ -1077,6 +1112,15 @@ static void __init efi_exit_boot(EFI_HANDLE ImageHan= dle, EFI_SYSTEM_TABLE *Syste if ( EFI_ERROR(status) ) PrintErrMesg(L"Cannot obtain memory map", status); =20 + for ( i =3D 0; i < efi_memmap_size; i +=3D efi_mdesc_size ) + { + if ( is_esrt_valid(efi_memmap + i) ) + { + esrt_desc =3D efi_memmap + i; + break; + } + } + efi_arch_process_memory_map(SystemTable, efi_memmap, efi_memmap_si= ze, efi_mdesc_size, mdesc_ver); =20 diff --git a/xen/common/efi/efi.h b/xen/common/efi/efi.h index c9aa65d506..02f499071a 100644 --- a/xen/common/efi/efi.h +++ b/xen/common/efi/efi.h @@ -10,6 +10,23 @@ #include #include =20 +typedef struct _ESRT_ENTRY { + EFI_GUID FwClass; + UINT32 FwType; + UINT32 FwVersion; + UINT32 FwLowestSupportedVersion; + UINT32 FwCapsuleFlags; + UINT32 FwLastAttemptVersion; + UINT32 FwLastAttemptStatus; +} ESRT_ENTRY; + +typedef struct _ESRT { + UINT32 Count; + UINT32 Max; + UINT64 Version; + ESRT_ENTRY Entries[]; +} ESRT; + struct efi_pci_rom { const struct efi_pci_rom *next; u16 vendor, devid, segment; @@ -28,6 +45,7 @@ extern const EFI_RUNTIME_SERVICES *efi_rs; =20 extern UINTN efi_memmap_size, efi_mdesc_size; extern void *efi_memmap; +extern const EFI_MEMORY_DESCRIPTOR *esrt_desc; =20 #ifdef CONFIG_X86 extern mfn_t efi_l4_mfn; diff --git a/xen/common/efi/runtime.c b/xen/common/efi/runtime.c index 13b0975866..0d09647952 100644 --- a/xen/common/efi/runtime.c +++ b/xen/common/efi/runtime.c @@ -52,6 +52,7 @@ static unsigned int efi_rs_on_cpu =3D NR_CPUS; UINTN __read_mostly efi_memmap_size; UINTN __read_mostly efi_mdesc_size; void *__read_mostly efi_memmap; +const EFI_MEMORY_DESCRIPTOR *__read_mostly esrt_desc; =20 UINT64 __read_mostly efi_boot_max_var_store_size; UINT64 __read_mostly efi_boot_remain_var_store_size; @@ -269,7 +270,7 @@ int efi_get_info(uint32_t idx, union xenpf_efi_info *in= fo) case XEN_FW_EFI_MEM_INFO: for ( i =3D 0; i < efi_memmap_size; i +=3D efi_mdesc_size ) { - EFI_MEMORY_DESCRIPTOR *desc =3D efi_memmap + i; + const EFI_MEMORY_DESCRIPTOR *desc =3D efi_memmap + i; u64 len =3D desc->NumberOfPages << EFI_PAGE_SHIFT; =20 if ( info->mem.addr >=3D desc->PhysicalStart && diff --git a/xen/include/efi/efiapi.h b/xen/include/efi/efiapi.h index a616d1238a..42ef3e1c8c 100644 --- a/xen/include/efi/efiapi.h +++ b/xen/include/efi/efiapi.h @@ -882,6 +882,9 @@ typedef struct _EFI_BOOT_SERVICES { #define SAL_SYSTEM_TABLE_GUID \ { 0xeb9d2d32, 0x2d88, 0x11d3, {0x9a, 0x16, 0x0, 0x90, 0x27, 0x3f, 0xc1= , 0x4d} } =20 +#define ESRT_GUID \ + { 0xb122a263, 0x3661, 0x4f68, {0x99, 0x29, 0x78, 0xf8, 0xb0, 0xd6, 0x2= 1, 0x80} } + =20 typedef struct _EFI_CONFIGURATION_TABLE { EFI_GUID VendorGuid; --=20 Sincerely, Demi Marie Obenour (she/her/hers) Invisible Things Lab --L3mDJzuE5U39uQuT Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEdodNnxM2uiJZBxxxsoi1X/+cIsEFAmJe190ACgkQsoi1X/+c IsHNJQ//W2d8jOibu72naOLhu6PCNGKzdJOgRptgSMXUrEhVFELuw/WcXVlV5afX ghnINwp9GjVyKDZ9Pv52P4aJmBRzfdxApFbjTGraJ8Yz6cUZs3z1M56nMlQFylEa U0Gu4ZXtBR/IeU/rPO83AeRv0FoIxUmECmS5+mphutwlcc8skdD8moWX8ptx4oMJ nZjdjjC+yA78wFVoEJiwFHni1M5G4o6rK4/hOWSg95Qu0FYkYtt79VvS01+WA1dO S/0EbmXSDzGg+b0tEGnUDv6bnV0oDDA7LNJZMKvnjNUPdGBVwN6lnzCXWtr6BGT3 LF9U3uDeD7Vr9jJ6nMotL8AMc7xbuGIZfbEFj2jYFeMOJXX48dmVTTVUNuyAw4Kf WcR4kc9MdW3mkgaRRfVlO9lpBCJ9Kx/Ouuddwcbwq4ojMWbfXL6obLbhEjTWdP0b jOWSA5v6tiqPQIUuiiGKMD+Sg2lGmmSaT82CnmSAZeKBb5gkpfwO4vn1+gtGONSQ 7/rJDwDIvoGnydU6/ALQFAr1e4+OTWs+1p1pQLGg8rCDSIJrIpOsJCl9u2PfoQkU HFmCfvBcb+uC2S30WFt6UO2aC3rvxD7OU2rx5pksWaJjmquzKhsGOHE56LSUTxXp tSTWg5veY48n7RxiwCye2zcFTzD3Jb5yiZoXbJIVBpsw5LtQPLc= =3GHb -----END PGP SIGNATURE----- --L3mDJzuE5U39uQuT-- From nobody Fri Nov 29 02:52:59 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1650382872182636.969305384052; Tue, 19 Apr 2022 08:41:12 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.308291.523969 (Exim 4.92) (envelope-from ) id 1ngpyE-0003uZ-DI; Tue, 19 Apr 2022 15:40:50 +0000 Received: by outflank-mailman (output) from mailman id 308291.523969; Tue, 19 Apr 2022 15:40:50 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1ngpyE-0003uS-AS; Tue, 19 Apr 2022 15:40:50 +0000 Received: by outflank-mailman (input) for mailman id 308291; Tue, 19 Apr 2022 15:40:49 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1ngpyD-0001X4-4Z for xen-devel@lists.xenproject.org; Tue, 19 Apr 2022 15:40:49 +0000 Received: from out5-smtp.messagingengine.com (out5-smtp.messagingengine.com [66.111.4.29]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 153e9ac8-bff7-11ec-8fbf-03012f2f19d4; Tue, 19 Apr 2022 17:40:48 +0200 (CEST) Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id 731F15C017F; Tue, 19 Apr 2022 11:40:47 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute2.internal (MEProxy); Tue, 19 Apr 2022 11:40:47 -0400 Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 19 Apr 2022 11:40:46 -0400 (EDT) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 153e9ac8-bff7-11ec-8fbf-03012f2f19d4 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:reply-to:sender :subject:subject:to:to:x-me-proxy:x-me-proxy:x-me-sender :x-me-sender:x-sasl-enc; s=fm1; t=1650382847; x=1650469247; bh=3 arqv03JGEGVKFR5SMcDPvfcQfJd+3ZKaEx4TULio5U=; b=qKNxCblSJz6gsng7G YoUR2s1K3Y2gRE0PZA7hmzMaeE0bqbiB1v0EvMyPWkqwRU3PQ8Zto7cL0hBiGuDb i1QFmcMp3w9JWYla75ac+cWalloxZ7fVv1Cd4XmGGFehWIJGLCeClFrJfvfHZ54x gkP6heZYzMBZTHl4W1pUHf59cB6YH62/BIJn8/uMiSe11NY9FlTi/UTFZIwj6qsT rYiW54QsxfPDmBV0Q3QYNkTqIvgpGxmd9dS9vKgqxJR1m+iXV58B8eJPmLjGnqrr rYu00HGEP7LRCPTNNUUaYJA+xcuL8posXX9o87r5u3E7U4Tw1nX79IqG2NSL531s GGrRg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvvddrvddtfedgledvucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepfffhvffukfggtggujgesghdtreertddtvdenucfhrhhomhepffgvmhhiucfo rghrihgvucfqsggvnhhouhhruceouggvmhhisehinhhvihhsihgslhgvthhhihhnghhslh grsgdrtghomheqnecuggftrfgrthhtvghrnhepveefleduheekhfdtfffffedukeevtedu leekfffgudfhtdduhfevueefueegtefhnecuvehluhhsthgvrhfuihiivgeptdenucfrrg hrrghmpehmrghilhhfrhhomhepuggvmhhisehinhhvihhsihgslhgvthhhihhnghhslhgr sgdrtghomh X-ME-Proxy: Date: Tue, 19 Apr 2022 11:40:44 -0400 From: Demi Marie Obenour To: xen-devel@lists.xenproject.org Cc: Jan Beulich , Andrew Cooper , Roger Pau =?iso-8859-1?Q?Monn=E9?= , Wei Liu Subject: [PATCH v3 2/4] Add a dedicated memory region for the ESRT Message-ID: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="weNRqal4jiKrbyKp" Content-Disposition: inline In-Reply-To: X-Zoho-Virus-Status: 1 X-ZM-MESSAGEID: 1650382872593100001 --weNRqal4jiKrbyKp Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Date: Tue, 19 Apr 2022 11:40:44 -0400 From: Demi Marie Obenour To: xen-devel@lists.xenproject.org Cc: Jan Beulich , Andrew Cooper , Roger Pau =?iso-8859-1?Q?Monn=E9?= , Wei Liu Subject: [PATCH v3 2/4] Add a dedicated memory region for the ESRT MIME-Version: 1.0 Content-Type: text/plain; protected-headers="v1"; charset="utf-8" This allows the ESRT to be marked as reserved without having to waste a potentially large amount of memory. This patch assumes that Xen can handle memory regions that are not page-aligned. If it cannot, additional code will need to be added to align the regions. --- xen/arch/x86/efi/efi-boot.h | 69 +++++++++++++++++++++++++-------- xen/arch/x86/include/asm/e820.h | 2 +- 2 files changed, 54 insertions(+), 17 deletions(-) diff --git a/xen/arch/x86/efi/efi-boot.h b/xen/arch/x86/efi/efi-boot.h index 75937c8a11..edf1fea3e0 100644 --- a/xen/arch/x86/efi/efi-boot.h +++ b/xen/arch/x86/efi/efi-boot.h @@ -165,13 +165,14 @@ static void __init efi_arch_process_memory_map(EFI_SY= STEM_TABLE *SystemTable, { EFI_MEMORY_DESCRIPTOR *desc =3D map + i; u64 len =3D desc->NumberOfPages << EFI_PAGE_SHIFT; + UINTN physical_start =3D desc->PhysicalStart; u32 type; =20 switch ( desc->Type ) { case EfiBootServicesCode: case EfiBootServicesData: - if ( map_bs || desc =3D=3D (EFI_MEMORY_DESCRIPTOR *)esrt_desc ) + if ( map_bs ) { default: type =3D E820_RESERVED; @@ -179,9 +180,9 @@ static void __init efi_arch_process_memory_map(EFI_SYST= EM_TABLE *SystemTable, } /* fall through */ case EfiConventionalMemory: - if ( !trampoline_phys && desc->PhysicalStart + len <=3D 0x1000= 00 && - len >=3D cfg.size && desc->PhysicalStart + len > cfg.addr= ) - cfg.addr =3D (desc->PhysicalStart + len - cfg.size) & PAGE= _MASK; + if ( !trampoline_phys && physical_start + len <=3D 0x100000 && + len >=3D cfg.size && physical_start + len > cfg.addr ) + cfg.addr =3D (physical_start + len - cfg.size) & PAGE_MASK; /* fall through */ case EfiLoaderCode: case EfiLoaderData: @@ -198,21 +199,57 @@ static void __init efi_arch_process_memory_map(EFI_SY= STEM_TABLE *SystemTable, type =3D E820_NVS; break; } - if ( e820_raw.nr_map && type =3D=3D e->type && - desc->PhysicalStart =3D=3D e->addr + e->size ) - e->size +=3D len; - else if ( !len || e820_raw.nr_map >=3D ARRAY_SIZE(e820_raw.map) ) - continue; - else + +#define ADD_ENTRY(len, type_, physical_start) \ + if ( len ) \ + { \ + if ( e820_raw.nr_map && (type_) =3D=3D e->type && = \ + (physical_start) =3D=3D e->addr + e->size ) = \ + e->size +=3D (len); \ + else if ( e820_raw.nr_map < ARRAY_SIZE(e820_raw.map) ) \ + continue; \ + else \ + { \ + ++e; \ + e->addr =3D (physical_start); \ + e->size =3D (len); \ + e->type =3D (type_); \ + ++e820_raw.nr_map; \ + } \ + } \ + else \ + do {} while (0) + + if ( desc =3D=3D (EFI_MEMORY_DESCRIPTOR *)esrt_desc ) { - ++e; - e->addr =3D desc->PhysicalStart; - e->size =3D len; - e->type =3D type; - ++e820_raw.nr_map; + const ESRT *esrt_ptr; + UINTN esrt_offset, esrt_len; + + BUG_ON(physical_start > esrt); + BUG_ON(len < sizeof(*esrt_ptr)); + esrt_offset =3D esrt - physical_start; + + BUG_ON(len - sizeof(*esrt_ptr) < esrt_offset); + esrt_ptr =3D (const ESRT *)esrt; + + BUG_ON(esrt_ptr->Version !=3D 1); + BUG_ON(esrt_ptr->Count < 1); + + esrt_len =3D (esrt_ptr->Count + 1) * sizeof(*esrt_ptr); + + BUG_ON( len - esrt_offset < esrt_len ); + + ADD_ENTRY(esrt_offset, type, physical_start); + + ADD_ENTRY(esrt_len, E820_RESERVED, esrt); + + physical_start =3D esrt + esrt_len; + len -=3D esrt_offset + esrt_len; } - } =20 + ADD_ENTRY(len, type, physical_start); + } +#undef ADD_ENTRY } =20 static void *__init efi_arch_allocate_mmap_buffer(UINTN map_size) diff --git a/xen/arch/x86/include/asm/e820.h b/xen/arch/x86/include/asm/e82= 0.h index 92f5efa4f5..98eca96425 100644 --- a/xen/arch/x86/include/asm/e820.h +++ b/xen/arch/x86/include/asm/e820.h @@ -16,7 +16,7 @@ struct __packed e820entry { uint32_t type; }; =20 -#define E820MAX 1024 +#define E820MAX 1026 =20 struct e820map { unsigned int nr_map; --=20 Sincerely, Demi Marie Obenour (she/her/hers) Invisible Things Lab --weNRqal4jiKrbyKp Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEdodNnxM2uiJZBxxxsoi1X/+cIsEFAmJe1/wACgkQsoi1X/+c IsHFtxAAp1e2QIOgX1bpt7qNcCU5Zsz899u1wSFeVNkiZXPfrfE8D4H8ORJZIl88 27e0V68HVQkE4uaJ9XgX9/WVCmSOrCGcX3frrJCbUHS7AvVDkEoxR9En0txPGX7q rWuk3EpGrGdeaKYq2Ze6iQs4H7kPKmgi95fwyY/8pqw9gQAniHiJ3adSxBUafFfH Ez/7LesMXKHLRUTWAUQzKNwQnH6VVBYarKap3DQCZOz0i9C9gWGrEt4CK3ygWipx 5b6lx+dOE5HbILaW5LbTFbdVZPaZ5dXPEDPJw5QPFK03AY8Q8L51O0f7M2K7Zue+ KWojkSWYtACQsisU0UYHcrYdMEFP69GjHfhPev7cAuchrRV56RCiXs1Mt9U3+mI6 htsW+Us0wIGyxElXfyEptPyQU/POeQ5KSaZjQ3DoBctCK7K3+8kBpFBQZ9jfQeER uOUpXb5dQ0kG3boBiGrfNJFvmWSAX+2PDXEa7uLr0ryfc9o6L9vdYGab9mA9DEiF VB6qmAQfnVpMkDRz4JWn3yYUJGBd0PDFv+Tpl/cmMvEuQj6s05P6m7PmPIGhilC7 HwNfPkZ7FBpT3mFGFpaczuS4/AWNWlQk5RcpdcrKw8jCTlhrajqyFF6SM+5TWRGg JIxC7d2EvDVFKGxN+wbp6kksRPG+JGWEU4ECiqROELsAmoFPcFA= =LKhS -----END PGP SIGNATURE----- --weNRqal4jiKrbyKp-- From nobody Fri Nov 29 02:52:59 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1650383398442429.799763593242; Tue, 19 Apr 2022 08:49:58 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.308318.524013 (Exim 4.92) (envelope-from ) id 1ngq6j-0006eY-5L; Tue, 19 Apr 2022 15:49:37 +0000 Received: by outflank-mailman (output) from mailman id 308318.524013; Tue, 19 Apr 2022 15:49:37 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1ngq6j-0006eO-28; Tue, 19 Apr 2022 15:49:37 +0000 Received: by outflank-mailman (input) for mailman id 308318; Tue, 19 Apr 2022 15:49:35 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1ngq6h-0006bg-OZ for xen-devel@lists.xenproject.org; Tue, 19 Apr 2022 15:49:35 +0000 Received: from out5-smtp.messagingengine.com (out5-smtp.messagingengine.com [66.111.4.29]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 4f1a3660-bff8-11ec-a405-831a346695d4; Tue, 19 Apr 2022 17:49:34 +0200 (CEST) Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.nyi.internal (Postfix) with ESMTP id C8CA75C01B9; Tue, 19 Apr 2022 11:49:33 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute3.internal (MEProxy); Tue, 19 Apr 2022 11:49:33 -0400 Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 19 Apr 2022 11:49:33 -0400 (EDT) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 4f1a3660-bff8-11ec-a405-831a346695d4 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:reply-to:sender :subject:subject:to:to:x-me-proxy:x-me-proxy:x-me-sender :x-me-sender:x-sasl-enc; s=fm1; t=1650383373; x=1650469773; bh=/ sHDqu5TR+my1VccR9iUf0aiaYoUSa126jvmh3CA+Xk=; b=c8FvKmdLc6lFlXIaX 1GbBfeZgu60Wek4Z5Pvxw3wIflxj6k+jsBGqWu4tUnv4XtOTOMB/i7uPwpj/e/oO Pcexr7nx6G7BNREGg4AZ9oINFVaqsja657tvmusXByrTRI6ypXmG0kYBS4FJ1H3I hJc7Q372MpgdvM4YSEXSHTdTp7gytWmIh86Q1E84OMrBkYrB51GyN5P5yy/aL1Y7 biFLVaWf4b2AvMgSwDPnfDgYmqU5Gd7oyjay/tuwKOdjLMuf3AgWuHIGIfeihjCq BExjc3bqlhbAD0bXrwTXPYRLp5Of8Ps2cvj10OMr73zEPIVovaFL0IuqrIC927GI 0lGxA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvvddrvddtfedgleegucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepfffhvffukfggtggujgesghdtreertddtvdenucfhrhhomhepffgvmhhiucfo rghrihgvucfqsggvnhhouhhruceouggvmhhisehinhhvihhsihgslhgvthhhihhnghhslh grsgdrtghomheqnecuggftrfgrthhtvghrnhepveefleduheekhfdtfffffedukeevtedu leekfffgudfhtdduhfevueefueegtefhnecuvehluhhsthgvrhfuihiivgeptdenucfrrg hrrghmpehmrghilhhfrhhomhepuggvmhhisehinhhvihhsihgslhgvthhhihhnghhslhgr sgdrtghomh X-ME-Proxy: Date: Tue, 19 Apr 2022 11:49:29 -0400 From: Demi Marie Obenour To: xen-devel@lists.xenproject.org Cc: Jan Beulich , Andrew Cooper , George Dunlap , Julien Grall , Stefano Stabellini , Wei Liu Subject: [PATCH v3 3/4] Add a new hypercall to get the ESRT Message-ID: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="i0aPqryS6w7vx+4i" Content-Disposition: inline In-Reply-To: X-Zoho-Virus-Status: 1 X-ZM-MESSAGEID: 1650383400131100001 --i0aPqryS6w7vx+4i Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Date: Tue, 19 Apr 2022 11:49:29 -0400 From: Demi Marie Obenour To: xen-devel@lists.xenproject.org Cc: Jan Beulich , Andrew Cooper , George Dunlap , Julien Grall , Stefano Stabellini , Wei Liu Subject: [PATCH v3 3/4] Add a new hypercall to get the ESRT MIME-Version: 1.0 Content-Type: text/plain; protected-headers="v1"; charset="utf-8" This hypercall can be used to get the ESRT from the hypervisor. It returning successfully also indicates that Xen has reserved the ESRT and it can safely be parsed by dom0. --- xen/common/efi/boot.c | 15 ++++++++++----- xen/common/efi/efi.h | 2 ++ xen/common/efi/runtime.c | 14 ++++++++++++++ xen/include/public/platform.h | 7 +++++++ 4 files changed, 33 insertions(+), 5 deletions(-) diff --git a/xen/common/efi/boot.c b/xen/common/efi/boot.c index 31664818c1..01b2409c5e 100644 --- a/xen/common/efi/boot.c +++ b/xen/common/efi/boot.c @@ -567,8 +567,6 @@ static int __init efi_check_dt_boot(const EFI_LOADED_IM= AGE *loaded_image) } #endif =20 -static UINTN __initdata esrt =3D EFI_INVALID_TABLE_ADDR; - static bool __init is_esrt_valid( const EFI_MEMORY_DESCRIPTOR *const desc) { @@ -594,9 +592,13 @@ static bool __init is_esrt_valid( esrt_ptr =3D (const ESRT *)esrt; if ( esrt_ptr->Version !=3D 1 || !esrt_ptr->Count ) return false; - return esrt_ptr->Count <=3D - (available_len - sizeof(*esrt_ptr)) / - sizeof(esrt_ptr->Entries[0]); + if ( esrt_ptr->Count > + (available_len - sizeof(*esrt_ptr)) / + sizeof(esrt_ptr->Entries[0]) ) + return false; + esrt_size =3D sizeof(*esrt_ptr) + + esrt_ptr->Count * sizeof(esrt_ptr->Entries[0]); + return true; } =20 /* @@ -1121,6 +1123,9 @@ static void __init efi_exit_boot(EFI_HANDLE ImageHand= le, EFI_SYSTEM_TABLE *Syste } } =20 + if ( esrt_desc =3D=3D (const EFI_MEMORY_DESCRIPTOR *)EFI_INVALID_TABLE_AD= DR ) + esrt =3D EFI_INVALID_TABLE_ADDR; + efi_arch_process_memory_map(SystemTable, efi_memmap, efi_memmap_si= ze, efi_mdesc_size, mdesc_ver); =20 diff --git a/xen/common/efi/efi.h b/xen/common/efi/efi.h index 02f499071a..0736662ebc 100644 --- a/xen/common/efi/efi.h +++ b/xen/common/efi/efi.h @@ -46,6 +46,8 @@ extern const EFI_RUNTIME_SERVICES *efi_rs; extern UINTN efi_memmap_size, efi_mdesc_size; extern void *efi_memmap; extern const EFI_MEMORY_DESCRIPTOR *esrt_desc; +extern UINTN esrt; +extern UINTN esrt_size; =20 #ifdef CONFIG_X86 extern mfn_t efi_l4_mfn; diff --git a/xen/common/efi/runtime.c b/xen/common/efi/runtime.c index 0d09647952..4466d5379c 100644 --- a/xen/common/efi/runtime.c +++ b/xen/common/efi/runtime.c @@ -227,6 +227,12 @@ const CHAR16 *wmemchr(const CHAR16 *s, CHAR16 c, UINTN= n) #endif /* COMPAT */ =20 #ifndef CONFIG_ARM /* TODO - disabled until implemented on ARM */ + +#ifndef COMPAT +UINTN esrt =3D EFI_INVALID_TABLE_ADDR; +UINTN esrt_size =3D 0; +#endif + int efi_get_info(uint32_t idx, union xenpf_efi_info *info) { unsigned int i, n; @@ -311,6 +317,14 @@ int efi_get_info(uint32_t idx, union xenpf_efi_info *i= nfo) info->apple_properties.size =3D efi_apple_properties_len; break; =20 + case XEN_FW_EFI_ESRT: + if ( esrt_desc =3D=3D (const EFI_MEMORY_DESCRIPTOR *)EFI_INVALID_T= ABLE_ADDR ) + return -ENODATA; + if ( info->esrt.size < esrt_size ) + return -ERANGE; + if ( copy_to_guest(info->esrt.table, (const ESRT *)esrt, esrt_size= ) ) + return -EFAULT; + break; default: return -EINVAL; } diff --git a/xen/include/public/platform.h b/xen/include/public/platform.h index 8100133509..a848df2066 100644 --- a/xen/include/public/platform.h +++ b/xen/include/public/platform.h @@ -243,6 +243,7 @@ DEFINE_XEN_GUEST_HANDLE(xenpf_efi_runtime_call_t); #define XEN_FW_EFI_RT_VERSION 4 #define XEN_FW_EFI_PCI_ROM 5 #define XEN_FW_EFI_APPLE_PROPERTIES 6 +#define XEN_FW_EFI_ESRT 7 #define XEN_FW_KBD_SHIFT_FLAGS 5 struct xenpf_firmware_info { /* IN variables. */ @@ -307,6 +308,12 @@ struct xenpf_firmware_info { uint64_t address; xen_ulong_t size; } apple_properties; + struct { + /* IN variables */ + uint64_t size; + /* OUT variables */ + XEN_GUEST_HANDLE(void) table; + } esrt; } efi_info; /* XEN_FW_EFI_INFO */ =20 /* Int16, Fn02: Get keyboard shift flags. */ --=20 Sincerely, Demi Marie Obenour (she/her/hers) Invisible Things Lab --i0aPqryS6w7vx+4i Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEdodNnxM2uiJZBxxxsoi1X/+cIsEFAmJe2goACgkQsoi1X/+c IsHj2xAAxd80MtCKJV/pn9p8JOQoS7zPDoXYsikhyFi7e9HVcGzFm9P5GkA7ymis CVy1LrPNaqPPa0GugnmTvBXV0BCvZc1IRZGU+vXQuPfYga+hATQjAMToybrrWJNM h2WHqp41GE81bICGVcRrw13giqjs5Sy7/1+RJoRh02H5+gjewcg+0cqoRKCwZtvY JwRpe0sHNnQDdJwRRcez4YmGqclrVrwt4+QATlvBk88pmwBYxPMfzrXfIO0WL5jx krX9BT4wnPeE5ApRe4daYJMxXM6/ZrMyXViJjuHkYLnNha8U4mhHzkU9JRp96Ge5 arcO4ea+3TKIN23Ujy7eSeFrKvrCXDMGRFK3sAFQtZhmRrl3S+46S2AuYhhPLP27 e57ICEMAVlnr0JrKYuow/8LgToWPUfLc97vBWhy4Jjtxlvd36gRT0iXu6OojaBDO 0Rpe4pfMdv0nKENiL9RD8V75RrMg84urga422U4T3ro3WNrN/WsygDgXMHQpJO/G mhl5g9MjTLT/oqREBHwBYWUYIsctupKCkD5IZ5EoczGQgkSQWoSmmiNisF+6xb2X P+cGXSX5HOKfEt0PPxm3FGyewwZTwBnJoPmNJE6b16kMHGu1oPrpO/I0WRl+EKe+ 40TbkZRk7RQh+EFpjLx8OQxDhofnCpC+6qwx+a6tjgAEXp2Eo1Q= =EnvI -----END PGP SIGNATURE----- --i0aPqryS6w7vx+4i-- From nobody Fri Nov 29 02:52:59 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1650383545250275.7973267523647; Tue, 19 Apr 2022 08:52:25 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.308338.524036 (Exim 4.92) (envelope-from ) id 1ngq90-0000NB-VF; Tue, 19 Apr 2022 15:51:58 +0000 Received: by outflank-mailman (output) from mailman id 308338.524036; Tue, 19 Apr 2022 15:51:58 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1ngq90-0000N4-S5; Tue, 19 Apr 2022 15:51:58 +0000 Received: by outflank-mailman (input) for mailman id 308338; Tue, 19 Apr 2022 15:51:56 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1ngq8y-0000Lk-Qx for xen-devel@lists.xenproject.org; Tue, 19 Apr 2022 15:51:56 +0000 Received: from out5-smtp.messagingengine.com (out5-smtp.messagingengine.com [66.111.4.29]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id a32fde1a-bff8-11ec-a405-831a346695d4; Tue, 19 Apr 2022 17:51:55 +0200 (CEST) Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id 0AAFE5C00D2; Tue, 19 Apr 2022 11:51:55 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute5.internal (MEProxy); Tue, 19 Apr 2022 11:51:55 -0400 Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 19 Apr 2022 11:51:54 -0400 (EDT) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: a32fde1a-bff8-11ec-a405-831a346695d4 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:reply-to:sender :subject:subject:to:to:x-me-proxy:x-me-proxy:x-me-sender :x-me-sender:x-sasl-enc; s=fm1; t=1650383515; x=1650469915; bh=f JfW3aNKUP1YaiRHgeQrsvL4jbiMKjBZMM/ztfq6U7M=; b=kFMW+HXhRpX7lvUYj TRNUsGwMjm5zSuJ1pHFFuZQjXWnJA2MVrUCmKVUAmq1z7Q1B3whrLimroK323zLU HLcg5n1rXPGY2qVOHztvOyQP+yu7WkbWLdkCtT4H/94gJffxMBNbJTu4hiDP0TVi xJMoNFbh46FvarjbnhNsuB3ETSeOmE7nvsViwebxhndzsUNfnB+CnP25rqds5L3w l5J903R6dwmS8T89HOJcm4T6wJkDyA6I+Sx2gscRMMgSx41q4rkBcVADueVuWTu9 UtKevyb84nYfQa5irm9LGyPRiDcwEA83ARdv2raH3T854jc4j/3yRfOp59c/86GG 47+AQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvvddrvddtfedgleefucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepfffhvffukfggtggujgesghdtreertddtvdenucfhrhhomhepffgvmhhiucfo rghrihgvucfqsggvnhhouhhruceouggvmhhisehinhhvihhsihgslhgvthhhihhnghhslh grsgdrtghomheqnecuggftrfgrthhtvghrnhepveefleduheekhfdtfffffedukeevtedu leekfffgudfhtdduhfevueefueegtefhnecuvehluhhsthgvrhfuihiivgeptdenucfrrg hrrghmpehmrghilhhfrhhomhepuggvmhhisehinhhvihhsihgslhgvthhhihhnghhslhgr sgdrtghomh X-ME-Proxy: Date: Tue, 19 Apr 2022 11:51:52 -0400 From: Demi Marie Obenour To: xen-devel@lists.xenproject.org Cc: Jan Beulich Subject: [PATCH v3 4/4] Add emacs file-local variables Message-ID: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="XKTcRyePo7OpsmLl" Content-Disposition: inline In-Reply-To: X-Zoho-Virus-Status: 1 X-ZM-MESSAGEID: 1650383547496100001 --XKTcRyePo7OpsmLl Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Date: Tue, 19 Apr 2022 11:51:52 -0400 From: Demi Marie Obenour To: xen-devel@lists.xenproject.org Cc: Jan Beulich Subject: [PATCH v3 4/4] Add emacs file-local variables MIME-Version: 1.0 Content-Type: text/plain; protected-headers="v1"; charset="utf-8" These were very helpful for me when I was working on the code. --- xen/common/efi/boot.c | 10 ++++++++++ xen/common/efi/runtime.c | 10 ++++++++++ 2 files changed, 20 insertions(+) diff --git a/xen/common/efi/boot.c b/xen/common/efi/boot.c index 01b2409c5e..5415785bef 100644 --- a/xen/common/efi/boot.c +++ b/xen/common/efi/boot.c @@ -1802,3 +1802,13 @@ void __init efi_init_memory(void) unmap_domain_page(efi_l4t); } #endif + +/* + * Local variables: + * mode: C + * c-file-style: "BSD" + * c-basic-offset: 4 + * tab-width: 4 + * indent-tabs-mode: nil + * End: + */ diff --git a/xen/common/efi/runtime.c b/xen/common/efi/runtime.c index 4466d5379c..8021ecaecc 100644 --- a/xen/common/efi/runtime.c +++ b/xen/common/efi/runtime.c @@ -719,3 +719,13 @@ int efi_runtime_call(struct xenpf_efi_runtime_call *op) return rc; } #endif + +/* + * Local variables: + * mode: C + * c-file-style: "BSD" + * c-basic-offset: 4 + * tab-width: 4 + * indent-tabs-mode: nil + * End: + */ --=20 Sincerely, Demi Marie Obenour (she/her/hers) Invisible Things Lab --XKTcRyePo7OpsmLl Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEdodNnxM2uiJZBxxxsoi1X/+cIsEFAmJe2pgACgkQsoi1X/+c IsFk6g/8CngbYCHCGA8SU+crsh1r6B2PvhdbDrgIM2jLjR2j09xRhNDnoDSCtBV4 aSgOwd46GIjGq9ZTvoOgFelFN33gnE7Mf5l7+3QzAQrEx2tAo2e/+f0/zqNx1EXw Kvoy5yYkcNwagONc96pl4MOLyFR9tPdbnDFyA/lg8BQW+T7WPalYLen45jvAHIZ0 EGViDyKVb0zL1dqLuW7LxbLD3cmjYOj581za50K6ijuxH/1FVKxBBY2iscHJf2R6 1661hb56fgeqPOOA2SLFjK+v34NnXRVNuBvQ1OVK3yXbROrIqHfwEZ+DrhpRv1XJ EV4REasRY0RYoPM3V3f4CbwMoKmfQYCHrSzKrJof+556GH8FnZLfZUDLwTGUgzAz 89HygJQoNSQ6ajrYylNxIPphpnIZYWf9yMxH8//49FCxYxar0qecNv2uzX66OeDm EcERpUxCu8TP1BRiLtqPl3F9x0q7ImiW5vEfRNTq/nsEpTNTSiG8yZtSqaqQ2fwj wDFX+svA0d/wR6u7MgCvAEdUoJUk/OhwWZA7UNX82xruACt/Aa/SOG7fJ3w1YPCH QdQeNa2WWK1LdWRj42pCpvm0BbVR9ud0RoFi8JZSy2jxK50bebjiXK6I3J/wk2Dm SOLO7NdoxBBBbinplXavAxEJK9fO5DqwZ1ME/VhTWSEvZsVqH1M= =tbQV -----END PGP SIGNATURE----- --XKTcRyePo7OpsmLl--