From nobody Wed Apr 1 20:42:55 2026 Received: from mail-wr1-f74.google.com (mail-wr1-f74.google.com [209.85.221.74]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id AF44737F72E for ; Wed, 1 Apr 2026 12:24:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.74 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775046249; cv=none; b=FXq4vDDxxs46ZoWCkB5fuvizrf/dzeP2LvmjUgBIoPYCdGID3aKVsrFHLf0IeS+MIWLNXontlxF+2qO4r6Bwxket/SX0o/jFNjQ4z0t9XmAvBHROGtOj8aGBtmHvomXFe8ovXaVkt+3fBBaADOO2cQCPlPRnewFp3CZOol/iOmg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775046249; c=relaxed/simple; bh=fH7t4CLoMxZ4hGmlSQX/UeCrlLK1h+wo/X3EJch0vls=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=V3qjvGGUHBPxkIrAPZLhd+Vz4NdoX3NfFJG3pI6KJo/G9ZxjODKltr0iinlFVj00xHw9uUXgSpiAXmPVs+VVxewkvgvoPuSF4EhcTqiYVacspDhW/87demvlYMXWIbQjYaoBZj5A2aZrabfD/Ku2Uy3u9QNdrJK6fsE2aQreGrY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--ardb.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=tNZKFUUy; arc=none smtp.client-ip=209.85.221.74 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--ardb.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="tNZKFUUy" Received: by mail-wr1-f74.google.com with SMTP id ffacd0b85a97d-43cfedb10a8so1803914f8f.1 for ; Wed, 01 Apr 2026 05:24:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20251104; t=1775046246; x=1775651046; darn=vger.kernel.org; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=ubtZTgynj1xoqNeD7/xyduK3+fryeNVENJKTAAs0vMo=; b=tNZKFUUybvXQJoTco7t0/PSEmxZq60qcSFtgLzIm/6YPG5Eqt+GmH7MsAV+cX0+eUD PkjSzJ/pj+GoKr4+D8Wgs4oO19vbL/ti75LiRLLjUbB3sczrsMXiQ2OYjLqqU004HOxK je1pYcAKrLXd4G+nCdt4Rh3IOX1niE66f5+1/b+JTAIdM/aI765PVSN8OUoTXiJ1+gjd a+Ej33i/xDaW51/L9SWmTm3qQWAFHmT6h3JYQPfXVSKQBU+gV623jwXkjaKz3pBTkvGw yQTRtZDBxP9PZxZLpQHOs2gxrAO+8ULZGG/CzFphBk2XmdPtdDIAeUmJpzJp8iNXHWGQ 73Zg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1775046246; x=1775651046; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=ubtZTgynj1xoqNeD7/xyduK3+fryeNVENJKTAAs0vMo=; b=RQolTqAxJNchTkiBBkn8LcdjwDqvqxMlRUSuClDQbOb+Q9St05xarh8l+Hszqcp9LJ aJakasIycvyFlqfXqHbmyljC5Zkd5s+nR/NUeQr7RMZCcZefnzyUNd5ByuTgen65p2bm t8sIgY1N0faSg+7f5hWPOkwCXk7RCtM5X0CPwZp6DtHxHMA0MHZLd8P6GiGK9QI4yU94 ZqoxkysNnVbHYOuCDATadNJELLH9JLyuPfKINC7igqYsdJII21EgMm+4BM8StpK3q4ea PMQJHH/UGqJPgpQee2sDMy9m749m2CULKUcUsynxoODq3ib1QtLQzrbcueXHI7PRXkUe ptuA== X-Gm-Message-State: AOJu0Yz2dttre5ltHaTt6IRfZF2IZ9KoTWDn4GzEEaRppgBB520Z7Afa 0L5Yjz7THhiTyL///odeLh5jbHEZ42hF59i7eC/flWwqSIy3UDMlg+6qjKt5aJ6rqmYVgscJPg= = X-Received: from wrpv1.prod.google.com ([2002:adf:f681:0:b0:43c:fab7:4ffb]) (user=ardb job=prod-delivery.src-stubby-dispatcher) by 2002:a05:6000:178d:b0:43d:184:8aa2 with SMTP id ffacd0b85a97d-43d15051ecbmr6088304f8f.16.1775046245895; Wed, 01 Apr 2026 05:24:05 -0700 (PDT) Date: Wed, 1 Apr 2026 14:23:53 +0200 In-Reply-To: <20260401122351.2058145-7-ardb+git@google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20260401122351.2058145-7-ardb+git@google.com> X-Developer-Key: i=ardb@kernel.org; a=openpgp; fpr=F43D03328115A198C90016883D200E9CA6329909 X-Developer-Signature: v=1; a=openpgp-sha256; l=3875; i=ardb@kernel.org; h=from:subject; bh=Jx0PtHjYP7r1fy/2H9zhi0ODRUOUmIUV3b1pYSgmzlo=; b=owGbwMvMwCVmkMcZplerG8N4Wi2JIfMsX6T0nAiOC64fqt7lLXl74l28S5X1gr7pfma28Vt85 67ZoXWmo5SFQYyLQVZMkUVg9t93O09PlKp1niULM4eVCWQIAxenAEwkiY/hf1m045NPK9+uWCzN 6/EzSVd043TnJaJJ3+ebRilryJy8tJLhf/nJtc0S4oHeet2e8e3P+9ZNdjx358C9eOUdr+KOBz+ LZgAA X-Mailer: git-send-email 2.53.0.1118.gaef5881109-goog Message-ID: <20260401122351.2058145-8-ardb+git@google.com> Subject: [PATCH v2 1/5] efi/memattr: Fix thinko in table size sanity check From: Ard Biesheuvel To: linux-efi@vger.kernel.org Cc: linux-kernel@vger.kernel.org, x86@kernel.org, Ard Biesheuvel , Dave Young , Gregory Price , Usama Arif , Jiri Slaby , Breno Leitao Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Ard Biesheuvel While it is true that each PE/COFF runtime driver in memory can generally be split into 3 different regions (the header, the code/rodata region and the data/bss region), each with different permissions, it does not mean that 3x the size of the memory map is a suitable upper bound. This is due to the fact that all runtime drivers could be coalesced into a single EFI runtime code region by the firmware, and if the firmware does a good job of keeping the fragmentation down, it is conceivable that the memory attributes table has more entries than the EFI memory map itself. So instead, base the sanity check on whether the descriptor size matches the EFI memory map's descriptor size closely enough (which is not mandated by the spec but extremely unlikely to differ in practice), and whether the size of the whole table does not exceed 64k entries. Signed-off-by: Ard Biesheuvel Reviewed-by: Breno Leitao --- drivers/firmware/efi/memattr.c | 37 +++++++++++++++----- 1 file changed, 28 insertions(+), 9 deletions(-) diff --git a/drivers/firmware/efi/memattr.c b/drivers/firmware/efi/memattr.c index e727cc5909cb..b83f1c5a9164 100644 --- a/drivers/firmware/efi/memattr.c +++ b/drivers/firmware/efi/memattr.c @@ -22,7 +22,6 @@ unsigned long __ro_after_init efi_mem_attr_table =3D EFI_= INVALID_TABLE_ADDR; void __init efi_memattr_init(void) { efi_memory_attributes_table_t *tbl; - unsigned long size; =20 if (efi_mem_attr_table =3D=3D EFI_INVALID_TABLE_ADDR) return; @@ -40,22 +39,42 @@ void __init efi_memattr_init(void) goto unmap; } =20 + /* + * The EFI memory attributes table descriptors might potentially be + * smaller than those used by the EFI memory map, as long as they can + * fit a efi_memory_desc_t. However, a larger descriptor size makes no + * sense, and might be an indication that the table is corrupted. + * + * The only exception is kexec_load(), where the EFI memory map is + * reconstructed by user space, and may use a smaller descriptor size + * than the original. Given that, ignoring this companion table is + * still the right thing to do here, but don't complain too loudly when + * this happens. + */ + if (tbl->desc_size < sizeof(efi_memory_desc_t) || + tbl->desc_size > efi.memmap.desc_size) { + pr_warn("Unexpected EFI Memory Attributes descriptor size %d (expected: = %ld)\n", + tbl->desc_size, efi.memmap.desc_size); + goto unmap; + } =20 /* - * Sanity check: the Memory Attributes Table contains up to 3 entries - * for each entry of type EfiRuntimeServicesCode in the EFI memory map. - * So if the size of the table exceeds 3x the size of the entire EFI - * memory map, there is clearly something wrong, and the table should - * just be ignored altogether. + * Sanity check: the Memory Attributes Table contains multiple entries + * for each EFI runtime services code or data region in the EFI memory + * map, each with the permission attributes that may be applied when + * mapping the region. There is no upper bound for the number of + * entries, as it could conceivably contain more entries than the EFI + * memory map itself. So pick an arbitrary limit of 64k, which is + * ludicrously high. This prevents a corrupted table from eating all + * system RAM. */ - size =3D tbl->num_entries * tbl->desc_size; - if (size > 3 * efi.memmap.nr_map * efi.memmap.desc_size) { + if (tbl->num_entries > SZ_64K) { pr_warn(FW_BUG "Corrupted EFI Memory Attributes Table detected! (version= =3D=3D %u, desc_size =3D=3D %u, num_entries =3D=3D %u)\n", tbl->version, tbl->desc_size, tbl->num_entries); goto unmap; } =20 - tbl_size =3D sizeof(*tbl) + size; + tbl_size =3D sizeof(*tbl) + tbl->num_entries * tbl->desc_size; memblock_reserve(efi_mem_attr_table, tbl_size); set_bit(EFI_MEM_ATTR, &efi.flags); =20 --=20 2.53.0.1118.gaef5881109-goog From nobody Wed Apr 1 20:42:55 2026 Received: from mail-wr1-f73.google.com (mail-wr1-f73.google.com [209.85.221.73]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CA0D03F20FD for ; Wed, 1 Apr 2026 12:24:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.73 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775046250; cv=none; b=qBQXnRM3SkaTB+XqIrjWxM7FU0sKGSjMllHvXvIrcO55r1mT2seWJS2OWtEV5upg4/IKazH1eK8LApkMxqf1MHTd7ga4GCtLIbl1YEo8afy5B8Wz7BfQ/ptxWbwzH/qgbOYywRx9KggCXCAbWNaDEiPXtG1yiGovMKHDPF8+FrU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775046250; c=relaxed/simple; bh=au8J3JXx6lFCqi6g4FwJRLjfxSQilVzeMKUqA5NPysc=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=Qv22z5A443PELfK1IZ5DGuRgUpqgFXGVdLXVb+cWev2IFiYojBL4ZrOI6MOP6LlpRLQ+rHBmPvcY57STQtTh6LA6qpzC65qpBD+4Ete6eZysU2YWMrM9UguSaUxkLCmoTkuYXeUuUkH5FzSDM2db6QwQCb/y5YGH5yB9KKkJ4Pg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--ardb.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=PpjIhqX4; arc=none smtp.client-ip=209.85.221.73 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--ardb.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="PpjIhqX4" Received: by mail-wr1-f73.google.com with SMTP id ffacd0b85a97d-43d034589d0so2369681f8f.1 for ; Wed, 01 Apr 2026 05:24:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20251104; t=1775046247; x=1775651047; darn=vger.kernel.org; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=iB38xTc/lCZzgKyu5iU+XvCVBzC17imd+nlx2vvhAIQ=; b=PpjIhqX4TMBPfrztk9Z2oJMEzAPLuVtO4UR2/MHJsiBxQ9jO7xMpZmN5pM1tcGv6uW //GP4bYPInWetAdYx+gYltVs+VBcfPbasN8DyZrAsLsXCVhqtXAO/g21u6UL3tcpFCbS uMePNOWbl0eNpDQbHlorBkGl4TaHw+oNeffOD2oFKHbItQvRHaMVu2LihTiFGiRPW63E fgD+TWr/vFSmPLIZGbgHxda4I0cNwlhgv3oPRZP8E7SmVgHWUK2TEwA73qSoRT/bvAfP r6C4kG9P7Df50C1LAMy8r/Z+Nr1Aic9QU9exeLnV50sW443FGXg8JrijBNM87naoBeT/ XKuA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1775046247; x=1775651047; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=iB38xTc/lCZzgKyu5iU+XvCVBzC17imd+nlx2vvhAIQ=; b=kmBYfqcMboO3UrAtEQBYsLGcSK6bsBdHP71WjsFN6jENKX32TmCE3/WaRno+o6mW52 Sz9mcUfQbvFpmdjmkrHcvlXKohdwitom25ZiMElkXnuFDAt+uiZMr1TQSmD+zFwnBb7n fsHRKmMEt9F1HOz9AoqvIfJ5UXQ70DDF45EEUbVASTPtnPbEyRuWuuaDeRg2JK2DAL2N b4ZfdzqyJNGeunGUgarP+BHQVxTCZ5ss+lw4JgoXkHrV7tHdXg+PkdhrKaep8CkeOw0H lcNcqX3ee80eMSlM6Olwl1H8fS0U9FPNLMvN5T85ngg/6wMo9Xt8QblsXDwqlBi5BWFj e1ZA== X-Gm-Message-State: AOJu0YxnZxDSNgdnBd0qgxQlRXNhkbQl8uYfhzI3nWDlBlfB5LTiHFp5 vA4eRWcnz29m0ZxUAolcHEZ2NiggZt9qGSHy5F4KWK/zokOozSmfBk3polT2sL7w6JqT05Dy/A= = X-Received: from wrwa7.prod.google.com ([2002:a5d:53c7:0:b0:43b:86e0:73aa]) (user=ardb job=prod-delivery.src-stubby-dispatcher) by 2002:a05:6000:2c06:b0:43b:86f7:2ecd with SMTP id ffacd0b85a97d-43d1504b96fmr6007216f8f.8.1775046247121; Wed, 01 Apr 2026 05:24:07 -0700 (PDT) Date: Wed, 1 Apr 2026 14:23:54 +0200 In-Reply-To: <20260401122351.2058145-7-ardb+git@google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20260401122351.2058145-7-ardb+git@google.com> X-Developer-Key: i=ardb@kernel.org; a=openpgp; fpr=F43D03328115A198C90016883D200E9CA6329909 X-Developer-Signature: v=1; a=openpgp-sha256; l=2536; i=ardb@kernel.org; h=from:subject; bh=r4Z6Kbm7Kzgsq337UXgzByJyJH3oiBiclKceTmwE7e8=; b=owGbwMvMwCVmkMcZplerG8N4Wi2JIfMsX/S5GaszfuvX3PjzOnu1IteDqpU5nfnZKi3LMlMvc H43eMfZUcrCIMbFICumyCIw+++7nacnStU6z5KFmcPKBDKEgYtTACay/ibD/zxrrYIZXt+VdbzF hc4llNjPeGy7WtR72cstb4qOWr+O1mT4X5Yoo8f82PfGef3q4M2LqqvvbVrB4aQUlnGQX7Azs6K cFQA= X-Mailer: git-send-email 2.53.0.1118.gaef5881109-goog Message-ID: <20260401122351.2058145-9-ardb+git@google.com> Subject: [PATCH v2 2/5] x86/efi: Gather initial memory reservation and table handling logic From: Ard Biesheuvel To: linux-efi@vger.kernel.org Cc: linux-kernel@vger.kernel.org, x86@kernel.org, Ard Biesheuvel , Dave Young , Gregory Price , Usama Arif , Jiri Slaby , Breno Leitao Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Ard Biesheuvel Move the back-to-back calls to various EFI routines related to processing of firmware tables and reserving the associated memory into a helper function. This is tidier, and will avoid the need to add yet another function call there in a subsequent patch. Reviewed-by: Gregory Price Signed-off-by: Ard Biesheuvel Reviewed-by: Breno Leitao --- arch/x86/include/asm/efi.h | 5 ++--- arch/x86/kernel/setup.c | 11 ++--------- arch/x86/platform/efi/efi.c | 13 +++++++++++++ 3 files changed, 17 insertions(+), 12 deletions(-) diff --git a/arch/x86/include/asm/efi.h b/arch/x86/include/asm/efi.h index 51b4cdbea061..3dcb137a49ed 100644 --- a/arch/x86/include/asm/efi.h +++ b/arch/x86/include/asm/efi.h @@ -387,11 +387,10 @@ static inline bool efi_is_table_address(unsigned lon= g phys_addr) { return false; } -static inline void efi_reserve_boot_services(void) -{ -} #endif /* CONFIG_EFI */ =20 +void efi_init_reservations(void); + extern int __init efi_memmap_alloc(unsigned int num_entries, struct efi_memory_map_data *data); =20 diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c index eebcc9db1a1b..9f5f50bff16d 100644 --- a/arch/x86/kernel/setup.c +++ b/arch/x86/kernel/setup.c @@ -1083,15 +1083,8 @@ void __init setup_arch(char **cmdline_p) mem_encrypt_setup_arch(); cc_random_init(); =20 - efi_find_mirror(); - efi_esrt_init(); - efi_mokvar_table_init(); - - /* - * The EFI specification says that boot service code won't be - * called after ExitBootServices(). This is, in fact, a lie. - */ - efi_reserve_boot_services(); + if (efi_enabled(EFI_BOOT)) + efi_init_reservations(); =20 /* preallocate 4k for mptable mpc */ e820__memblock_alloc_reserved_mpc_new(); diff --git a/arch/x86/platform/efi/efi.c b/arch/x86/platform/efi/efi.c index d84c6020dda1..f32276bd8d4e 100644 --- a/arch/x86/platform/efi/efi.c +++ b/arch/x86/platform/efi/efi.c @@ -165,6 +165,19 @@ static void __init do_add_efi_memmap(void) e820__update_table(e820_table); } =20 +void __init efi_init_reservations(void) +{ + efi_find_mirror(); + efi_esrt_init(); + efi_mokvar_table_init(); + + /* + * The EFI specification says that boot service code won't be + * called after ExitBootServices(). This is, in fact, a lie. + */ + efi_reserve_boot_services(); +} + /* * Given add_efi_memmap defaults to 0 and there is no alternative * e820 mechanism for soft-reserved memory, import the full EFI memory --=20 2.53.0.1118.gaef5881109-goog From nobody Wed Apr 1 20:42:55 2026 Received: from mail-wm1-f74.google.com (mail-wm1-f74.google.com [209.85.128.74]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 03529405AC7 for ; Wed, 1 Apr 2026 12:24:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.74 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775046251; cv=none; b=SaAVYEtjytEuDOXxn6fcl9NkD6u+kqlK/OCxdXadIugaoq4RW+Xc42o6sW0zdzpgCE/kn6KptYf9CJJdepi+Ghdm8Uil0oNp7bfaHFa0QbRt0HHfwPrWeuJlmyIbwHIYzOcpb/davZRB5RTVNMLnEbCRTQpsXvmJ4uuvDo/vEME= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775046251; c=relaxed/simple; bh=mb6d7rW0CVAuRgITj2ljHrU5md0zBfVw8rbd/vwnu+8=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=OlxVpshyrzsUhWP/6BG5LeX/3TiekIRpyk6ul46FK/WujE6aTSuI9NLSateIMUg48C2+nprqILz76K+OHaM3bjCENKwCcSUs/10qIJ0tG9wXiSgsjnvl5cffKMg2V6YJF8ZWeC1mo708rp1C2k0fl6z2BUgwQPL7yDVNbMua6+U= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--ardb.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=YzNyyGg2; arc=none smtp.client-ip=209.85.128.74 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--ardb.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="YzNyyGg2" Received: by mail-wm1-f74.google.com with SMTP id 5b1f17b1804b1-4837bfcfe0dso80163575e9.1 for ; Wed, 01 Apr 2026 05:24:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20251104; t=1775046248; x=1775651048; darn=vger.kernel.org; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=M4wbaKY21hgpMlmdrFHV95hFJUSsWb/tqabG7mAIAC8=; b=YzNyyGg2/eh8uE2X7OJ+ssefhYi2y55qVvg42aCv1b12nkOZgWKLFUdZyYOD2j+aRP sjUvHJVFq30QLmizaqiDygVkuYtea1F5L4iZLOHHGAYW6uijbYQUlLzNZJUNz9lrPZEu HCOUNvdajbbnTvk24WWLYBFgzDaNBtrC3ihBE454Lo1dwTcLkafP3LivhUsJGXhLPD8w N2VrOgkh3iib2QZxOfpX0VZPr3AKwYDyBxH7/F8vHdFeKc5JbHzJHiuG/HUmck8TIRYy JuEHdBNI4ycx0fGaNV9UUe0HxxLmTA56XfgVcYKzDecCpfWuCTzyryWtEkBIkt1wd6Hd 3nvw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1775046248; x=1775651048; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=M4wbaKY21hgpMlmdrFHV95hFJUSsWb/tqabG7mAIAC8=; b=PiemMWDYUZuKZ5h/67XAOUuS+SWLW/Mgngz/03i2X+tOWOh3aYHet8oKw1q96Iry3z CcTJ5+7CNPhNd7G4i6XtJ0lkefMPfYzE+YrXKm8KMtM51kbJIOZGutRyMgKinCxRIZoD Df3cdS+8HqQ02lXVQkwlE5MNQt85shmsfifFDyu2aFqy2YUtxCl7R0yKmIqx71SfVDc4 nARYEAREeqJlkgAenaTyYezZcyAVLOEi4zdsabCfvgLcp1lIxDmxZ4lJYzZccbudplIt IIRK0XzhacuZqWapbj2wUg8BF1n6RkjB9wnaHXJZbiUHaw5oAjv6yfY7R3cGA1aUqXEl WSyg== X-Gm-Message-State: AOJu0YwIvsIyJFIs9c3FwHaMCtgby7wEUzQnxIugSd06fgVJolplLhqM x6+ru3FiOHmawcDqMoIa+qIAD2/FXtaKG4rbVIXxP0x3rBBVXePuoztv8G1C4wFoHSCfxb6C0g= = X-Received: from wmbe18.prod.google.com ([2002:a05:600c:5912:b0:488:7f73:f59f]) (user=ardb job=prod-delivery.src-stubby-dispatcher) by 2002:a05:600c:4b23:b0:488:869c:edaa with SMTP id 5b1f17b1804b1-488869cf045mr20210045e9.7.1775046248089; Wed, 01 Apr 2026 05:24:08 -0700 (PDT) Date: Wed, 1 Apr 2026 14:23:55 +0200 In-Reply-To: <20260401122351.2058145-7-ardb+git@google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20260401122351.2058145-7-ardb+git@google.com> X-Developer-Key: i=ardb@kernel.org; a=openpgp; fpr=F43D03328115A198C90016883D200E9CA6329909 X-Developer-Signature: v=1; a=openpgp-sha256; l=1578; i=ardb@kernel.org; h=from:subject; bh=2pqrLVJXUdSwkxLG1HfUHc8dGGkHych9XZigLHERKdI=; b=owGbwMvMwCVmkMcZplerG8N4Wi2JIfMsX8zO7P3nlkzR7fayjbdV556ttE6vz1TiyhW+/K+CQ sms7mkdpSwMYlwMsmKKLAKz/77beXqiVK3zLFmYOaxMIEMYuDgFYCKKKxn+B9Yq2HWJhc2J+/Po c1fGJdYlQYvKL7pcLbXMN5eU2rN3KcP/qjQHEVuexAOrW+r/rGK1i7qde3KxzOsfNr1h+4UcGeq YAA== X-Mailer: git-send-email 2.53.0.1118.gaef5881109-goog Message-ID: <20260401122351.2058145-10-ardb+git@google.com> Subject: [PATCH v2 3/5] x86/efi: Defer the call to efi_memattr_init() From: Ard Biesheuvel To: linux-efi@vger.kernel.org Cc: linux-kernel@vger.kernel.org, x86@kernel.org, Ard Biesheuvel , Dave Young , Gregory Price , Usama Arif , Jiri Slaby , Breno Leitao Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Ard Biesheuvel efi_memattr_init() should call efi_mem_reserve() rather than memblock_reserve() to preserve the memory contents of the region when the EFI memory attributes table is loaded by the firmware. However, efi_mem_reserve() can only be called later during the boot on x86, due to the fact that it may need to memblock_alloc() memory for the EFI memory map. So move the call to efi_memattr_init() to a later stage when building for x86_64. Signed-off-by: Ard Biesheuvel Reviewed-by: Breno Leitao --- arch/x86/platform/efi/efi.c | 2 ++ drivers/firmware/efi/efi.c | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/arch/x86/platform/efi/efi.c b/arch/x86/platform/efi/efi.c index f32276bd8d4e..107dcdf354ba 100644 --- a/arch/x86/platform/efi/efi.c +++ b/arch/x86/platform/efi/efi.c @@ -167,6 +167,8 @@ static void __init do_add_efi_memmap(void) =20 void __init efi_init_reservations(void) { + if (IS_ENABLED(CONFIG_X86_64) && efi_enabled(EFI_MEMMAP)) + efi_memattr_init(); efi_find_mirror(); efi_esrt_init(); efi_mokvar_table_init(); diff --git a/drivers/firmware/efi/efi.c b/drivers/firmware/efi/efi.c index b2fb92a4bbd1..d28ed1ce9a33 100644 --- a/drivers/firmware/efi/efi.c +++ b/drivers/firmware/efi/efi.c @@ -761,7 +761,7 @@ int __init efi_config_parse_tables(const efi_config_tab= le_t *config_tables, } } =20 - if (!IS_ENABLED(CONFIG_X86_32) && efi_enabled(EFI_MEMMAP)) + if (!IS_ENABLED(CONFIG_X86) && efi_enabled(EFI_MEMMAP)) efi_memattr_init(); =20 efi_tpm_eventlog_init(); --=20 2.53.0.1118.gaef5881109-goog From nobody Wed Apr 1 20:42:55 2026 Received: from mail-wm1-f74.google.com (mail-wm1-f74.google.com [209.85.128.74]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E6DA4406297 for ; Wed, 1 Apr 2026 12:24:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.74 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775046252; cv=none; b=jewEz8zrQoEq7o7ilEOyT+Fnb6tF5QKxiywpih8oG9CX+zaJdWe6uQEEWY1McvqFIWBdh4z6ZMIIALQYphclj4txex/1u0haGiyfSIahBTlj7v+Ht77Hazl7q9KqSzSnlVaS7ReTaTDyl9LZuknqis6/hLW71Edt4S3HkGlu4BU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775046252; c=relaxed/simple; bh=YK+U8DngO2p2xHvfZLICzQ7p9q/5l2Pooo/tpmsxwDg=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=Bf1/e2+f4Kql8FNQL8nbttAKVB5qkajz2yz1oDjRjolLkYx/FDaHzDWs/G2c3vc84VR9Lsh/FOyL6U/6pAoHjlAAg2yImIFfqQd4ag23bGKXKQmpOwvYLdoFqMiuP/1x+BuHNLHxaU6Y4qJsFtJ6aGYP5LvUOvDw0zGemfJtchk= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--ardb.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=m1ZTlN3K; arc=none smtp.client-ip=209.85.128.74 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--ardb.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="m1ZTlN3K" Received: by mail-wm1-f74.google.com with SMTP id 5b1f17b1804b1-486fcc05b20so44795805e9.3 for ; Wed, 01 Apr 2026 05:24:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20251104; t=1775046249; x=1775651049; darn=vger.kernel.org; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=/aM4S1PduY4h/8bCx53tKfnLs3GrlzWIDVWJDUhE/+8=; b=m1ZTlN3Kh4W08rBQ8/ZFD5PJNkQQGoGzzgrUUp/VXN1g/oSfRkek6tRiGMXsGrd4rQ 80HvFMkN3uUZn+RHIYhtC5oxuJYzsXFJI3WeaLnBq8tv8UgZYQ/AOgkhkXJ87yy/IszZ U4lTgUwE/18YiIL+kBeoJJJwfbzBUhqfFrUPLN9C1//0aPMRIpMGI8BlJXToqSbhFsL3 PBRlT6RI3XkJRxkQIbzH+ErntD2a9F+/OPzeta5cK6wTe/IrWOhXbfLHI2JidZCztuP0 c1mFM+sJw0tY6IzQ8L01gscMfn7jioixzNjQpe/dXfP7K/539Tzb+iMzbYZQToJjo40P AdUw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1775046249; x=1775651049; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=/aM4S1PduY4h/8bCx53tKfnLs3GrlzWIDVWJDUhE/+8=; b=n2ynI6QOPfxJHFKPAgQ33H51CogM5rx8jU+o++wI4jWb6HTApYFWAtSbQV5oLkO1sI eeLe/NHXkqiLpeeMiZBNZDFQtksiZ/IUHsbytxPhZWBVFg3STqqBHVjYTcveZ4AZHiLS /PA534CG31z+kLP7bkoSY2UVXHnqBVtYrB+ocliXIr3J3u3qTN3v+0iO8gr8f3UxsSQW mRbbbU7ts7LhxCdZlntt1RfRgH0DRkQh8/WkvenKwM/S1TIPRT/2ddWmnvPB+PjGi9up G+fTF4UMbwsd0v/5iSkGBnVJKXQKP8o3ZBsftEEtnnQqCZBtpCwBTTnqr+vA3uMhsl4n ScDQ== X-Gm-Message-State: AOJu0YwYrFviNV8q7OhvCDT+AHdGpO1PSdwicIz6lyNO9z8XE/if4ac+ G6FWDj9KNHkkQJtvsIlu8BcDo1KcU9LyHndIMWuWvWr/pTCR3dvY9XKOpfXcp5W9t9SAPkmG/g= = X-Received: from wmf3.prod.google.com ([2002:a05:600c:2283:b0:485:6976:d608]) (user=ardb job=prod-delivery.src-stubby-dispatcher) by 2002:a05:600c:3e1a:b0:488:7784:d06 with SMTP id 5b1f17b1804b1-488835abf84mr53317615e9.31.1775046249386; Wed, 01 Apr 2026 05:24:09 -0700 (PDT) Date: Wed, 1 Apr 2026 14:23:56 +0200 In-Reply-To: <20260401122351.2058145-7-ardb+git@google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20260401122351.2058145-7-ardb+git@google.com> X-Developer-Key: i=ardb@kernel.org; a=openpgp; fpr=F43D03328115A198C90016883D200E9CA6329909 X-Developer-Signature: v=1; a=openpgp-sha256; l=884; i=ardb@kernel.org; h=from:subject; bh=QYLi+A1pkK5JDmD/bJgyNt3bd0+6uqfnrlyZz6kzmFw=; b=owGbwMvMwCVmkMcZplerG8N4Wi2JIfMsX9xpppBd5ubu19azZa9jUo2UTGIVN2uoWPDmSSJLw T1Lq/8dpSwMYlwMsmKKLAKz/77beXqiVK3zLFmYOaxMIEMYuDgFYCK7nzH89+adVHhJIdqLe6Hh qcxT91VLWq8pFWd3iagoWCTJuj6rYGRYMKH5xqs3R/+4/jyWF15weP72eo49gRXP9d88ZFO+ssa bAwA= X-Mailer: git-send-email 2.53.0.1118.gaef5881109-goog Message-ID: <20260401122351.2058145-11-ardb+git@google.com> Subject: [PATCH v2 4/5] efi: Use efi_mem_reserve() to reserve the memory attribute table From: Ard Biesheuvel To: linux-efi@vger.kernel.org Cc: linux-kernel@vger.kernel.org, x86@kernel.org, Ard Biesheuvel , Dave Young , Gregory Price , Usama Arif , Jiri Slaby , Breno Leitao Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Ard Biesheuvel Use efi_mem_reserve() rather than memblock_reserve() to reserve the EFI memory attributes table. This is needed on x86, where memblock_reserve() is not sufficient for assets that may be placed in EFI boot services data memory. Signed-off-by: Ard Biesheuvel Reviewed-by: Breno Leitao --- drivers/firmware/efi/memattr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/firmware/efi/memattr.c b/drivers/firmware/efi/memattr.c index b83f1c5a9164..785b7fc687fe 100644 --- a/drivers/firmware/efi/memattr.c +++ b/drivers/firmware/efi/memattr.c @@ -75,7 +75,7 @@ void __init efi_memattr_init(void) } =20 tbl_size =3D sizeof(*tbl) + tbl->num_entries * tbl->desc_size; - memblock_reserve(efi_mem_attr_table, tbl_size); + efi_mem_reserve(efi_mem_attr_table, tbl_size); set_bit(EFI_MEM_ATTR, &efi.flags); =20 unmap: --=20 2.53.0.1118.gaef5881109-goog From nobody Wed Apr 1 20:42:55 2026 Received: from mail-wm1-f74.google.com (mail-wm1-f74.google.com [209.85.128.74]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E28B1401A03 for ; Wed, 1 Apr 2026 12:24:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.74 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775046253; cv=none; b=YL//cqqEnSX2W1jL2+uyayyhj8b26LVdYASFlKnTAwoTcbcjewDMCFvYostOa8Ld/9AQJ54AzGGNeHZIbQwCcWYcKEE2/yyN8Qkl57A/cHnQFT22YWbSf1gTCF5qhZ/iqTcTs174aq1UwGnnqoRr+rEtnbBeEKPEYqV359PxD5Y= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775046253; c=relaxed/simple; bh=Vq83sHeQM3lKtjJXQLWNxKXaNZHPY9RfSEtNN9UDHGg=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=G/Bh0cSmtlNVin1QmoqK5PghecZ0MuBcYEjdvwnwbL/1aZ8PEtOyXjNkZFW5MkIrJaof7SGAar5XuYinyltQTgOZiSMORD6VZv3GD2rkP+4bzLKZkAMSsvDbzKBkH+jJOVd3btAcvNUzYBGliM2RehKHVOAGHdcpgqlDwHrOcCg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--ardb.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=eTmz8knJ; arc=none smtp.client-ip=209.85.128.74 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--ardb.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="eTmz8knJ" Received: by mail-wm1-f74.google.com with SMTP id 5b1f17b1804b1-4887f8a8df3so9567705e9.0 for ; Wed, 01 Apr 2026 05:24:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20251104; t=1775046250; x=1775651050; darn=vger.kernel.org; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=raTovvIuA8BXu/kgHuJxIxG7+Jya4C5OKP0v/N62tFM=; b=eTmz8knJXHvW0G6JA9Z2oS07oT8ys8nhxT1tioj1MG1QzekjcBfdk/R3o+5V86Etfi fWGDynN0Wm3Il93Ka0E4KhuXozuTDeWjp2l9+udnYnBugfy2uyMIq3HjPv2ibEWs2ZxE kKJPCXpoC+FAr9J/Dy6t7ApxkhjRiVgd3JYn5VPGboiYXTXzOMaQvlU9ObU3kEC0n2b4 j/F67T/LSepO/ZxXro7HEeCDzlhcrqZ92uMYmrzDkjrqf/a2H10AbO5dRZNKK2wAYZen orH8NJv9+xjknJRwOqtSGKy0nXZH16ZDTr3NoBMJLfF+FPOu95qUU9gc0J9S1yVdEkQt jqGQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1775046250; x=1775651050; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=raTovvIuA8BXu/kgHuJxIxG7+Jya4C5OKP0v/N62tFM=; b=Ec6nIHksOtIjZeNjhA+OtTwNK+qJfTmgcfQTY+imK0DR07ZUfCuF00ewxO9BpRtkTt 8QbSfwhIL7XdfmJA1BPx9lbGyITbwudyrb+Dod0ttEAlfy5rn/8d05GMOzVJHzd6Vjg9 kg1NFbWa29DN7lnFIggnzFvC8do0A9XgT+03f33UE1OnphZg+J/Qd8okLs7WGZUZhQEw HvdWE8k0f5eKMjpdJinhVQB+I+6lX8iiofrAsnEg7zqaexBUYjCOtn6I3XhpCs2aZrO8 tebuh8YaTO/6LCLTKIXPo0Amk3Xv4QLJ2CppOajx8DV1FCMSswKhRKu/4oE/UMaY3ecF m8rQ== X-Gm-Message-State: AOJu0Yz9xE1HrFXky4Ri7D/BaePZWySPRLB/ANfZ9hKDnazs+NTiIfGz 300TLXZZ5JvbZQ23ioAnJer1cZGQJRi2kD2CnAi0umtsyQgHkdghbgqqP7C2qbVLfBAFi0NDCg= = X-Received: from wmok18.prod.google.com ([2002:a05:600c:4792:b0:488:7891:d1bf]) (user=ardb job=prod-delivery.src-stubby-dispatcher) by 2002:a05:600c:4f95:b0:477:a1a2:d829 with SMTP id 5b1f17b1804b1-4888356754dmr55980545e9.13.1775046250319; Wed, 01 Apr 2026 05:24:10 -0700 (PDT) Date: Wed, 1 Apr 2026 14:23:57 +0200 In-Reply-To: <20260401122351.2058145-7-ardb+git@google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20260401122351.2058145-7-ardb+git@google.com> X-Developer-Key: i=ardb@kernel.org; a=openpgp; fpr=F43D03328115A198C90016883D200E9CA6329909 X-Developer-Signature: v=1; a=openpgp-sha256; l=1261; i=ardb@kernel.org; h=from:subject; bh=NDK6hD2ARL8meteiG5vAQnRk28SciK+OGjeHBR0xY18=; b=owGbwMvMwCVmkMcZplerG8N4Wi2JIfMsX/zxj3LaXd+2iK3b45EVEv5lX85yfff0dy1TtjQ4f EqX89buKGVhEONikBVTZBGY/ffdztMTpWqdZ8nCzGFlAhnCwMUpABPprWP475lWaBXEZMr8enVb 3vu9a7P2zd1W+T2KZ0n14WqbsJ9HFRj+6Rk3ps3Kq9qqxsbBxJpQ+eHjaf5TdvuqV7L8f1zv9Oo VKwA= X-Mailer: git-send-email 2.53.0.1118.gaef5881109-goog Message-ID: <20260401122351.2058145-12-ardb+git@google.com> Subject: [PATCH v2 5/5] x86/efi: Drop kexec quirk for the EFI memory attributes table From: Ard Biesheuvel To: linux-efi@vger.kernel.org Cc: linux-kernel@vger.kernel.org, x86@kernel.org, Ard Biesheuvel , Dave Young , Gregory Price , Usama Arif , Jiri Slaby , Breno Leitao Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Ard Biesheuvel Now that the EFI memory attributes table is preserved properly, and the quirk to detect corrupted tables has been updated not to result in false positives when the number of EFI memory map entries is low compared to the number of EFI memory attributes table entries, there is no longer a need to ignore the latter when doing a kexec boot. So drop the workaround. This reverts commit 64b45dd46e15 ("x86/efi: skip memattr table on kexec boot") Signed-off-by: Ard Biesheuvel --- arch/x86/platform/efi/quirks.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/arch/x86/platform/efi/quirks.c b/arch/x86/platform/efi/quirks.c index 79f0818131e8..98641c621e6c 100644 --- a/arch/x86/platform/efi/quirks.c +++ b/arch/x86/platform/efi/quirks.c @@ -611,10 +611,6 @@ int __init efi_reuse_config(u64 tables, int nr_tables) if (!efi_guidcmp(guid, SMBIOS_TABLE_GUID)) ((efi_config_table_64_t *)p)->table =3D data->smbios; =20 - /* Do not bother to play with mem attr table across kexec */ - if (!efi_guidcmp(guid, EFI_MEMORY_ATTRIBUTES_TABLE_GUID)) - ((efi_config_table_64_t *)p)->table =3D EFI_INVALID_TABLE_ADDR; - p +=3D sz; } early_memunmap(tablep, nr_tables * sz); --=20 2.53.0.1118.gaef5881109-goog