From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-qk1-f179.google.com (mail-qk1-f179.google.com [209.85.222.179]) (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 987BF36EAB8 for ; Sun, 29 Mar 2026 17:55:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.222.179 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774806927; cv=none; b=SJZexxsSzCz7IBBP0dFTnwDEV5At/SA4lOnlc0tUcamrhab3+0ypOqY2JY1Im7ITf58QvTaEzKLxogmOOyUvU12q6/QhPXMMQow7/a0XrIxB6sE48xWN/tB6FGzuPMUrk2q1mJiLLNYgLUQJpqC/+/0ras7bKEyYavDwmTVhJ1c= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774806927; c=relaxed/simple; bh=UBWQH1pqb31aIAq/6OcggWSs3frKEtuJ3nEvyubtDyw=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=LhC8nT6/fISk/QKBJ1sqVqHTv8D8h5u/SAzzfy2r71Cwi4ilohVveVWAi7Tahvj3P3QWa4Cj1PQlH1PB9G8D7GOtD5NgPEHjhn5zImx5/6gLr/7LR2gwl8SOBgzTk32YJbShy8gWiasKU2OfzB24H6oyHys6UOJ+XzXBacWEKYc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=gourry.net; spf=pass smtp.mailfrom=gourry.net; dkim=pass (2048-bit key) header.d=gourry.net header.i=@gourry.net header.b=p38bPscG; arc=none smtp.client-ip=209.85.222.179 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=gourry.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gourry.net Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gourry.net header.i=@gourry.net header.b="p38bPscG" Received: by mail-qk1-f179.google.com with SMTP id af79cd13be357-8cd80f56b27so362708285a.1 for ; Sun, 29 Mar 2026 10:55:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gourry.net; s=google; t=1774806925; x=1775411725; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=Ap9dPuw0mQr3chOD7n0lkw4KTbjyl1V2xyuJ5AjqmVI=; b=p38bPscGV28eQkbHfQC0f8liYNAaLiou80JaQsBxLD2xtFvQ6Jh2ARwpK9VcE4xrQu 2IUWs0eDYbXC7shN+Ho9CydZLvc7MXxOSNwEjuwqr45Noa6r9+HpmDtgZTjk5o6GZ7wZ ls3LXhSlXYNIBBak3J6ODbC33gI3fM/KUuYM6KUsTqEQZ56mP4C9oIamBYaTAC0dfCY0 V+rIh4Of00ZZO19wK28MR5mO35BmR0zgq8uXQWgbqXJRZLOBhUCFaw3u4TVozfrJYO7l fmEP9DvpA5vncWw/40WeQvMgNnEuwoMgz6CjVdW5GiGMvty4orhHFCv0/vZvEP+yJTtj 1jYA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1774806925; x=1775411725; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-gg:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Ap9dPuw0mQr3chOD7n0lkw4KTbjyl1V2xyuJ5AjqmVI=; b=Jp4q9UMP4z/wC8g/0CX83zfbm6L9jVLkGI0k7307iQEczZAgmpWW0iC7hiNWYlwLaE TLzazuZM9t+WGsU7wDmnzFrSDqIHpy5gEOVAACtUDX1BcuT8qAVOaoVVKVL32LEMtP2G 9p+7nI9TK9YRE43FdzYbFUd3+cXs8kqu3V945zgFFqOQal1EQfHCXS1PHmNa4xgM1KYb LnUIvpDxddxFkjTc/2NRC19cJ4i9dMP860jDvKa4RFjsYnK8cpNQ25In5zH90v5ZA0FV kR38361FeEQo4qn0QAoolXSgfWkzqzLB86iaVzJfvy0M5jVyzf21OjKNpW3t0ddMr1q1 bAXQ== X-Forwarded-Encrypted: i=1; AJvYcCU8XQvbi3auw+SShlhqMaTZWhK9D+eeOSgynxtGl7YFxfD09uXuIb4FSOMbDkiyXfkj2+jRtdnpp2dpDag=@vger.kernel.org X-Gm-Message-State: AOJu0YyjCVLfEl2aaL1cawprEmaCfDVSA4dI4uZ/kq7odVAbSl3K1JFK caFay/WlXa7j0Pi7m+7fF1/+zouwSYZmI5YsCx0ZD8soFaQe5z4cyDEnFgGxhOk1FSo= X-Gm-Gg: ATEYQzwAkysX7ZXtMnuykLOIoAT/NGCmdUtXCNzHpnqNZFCVcYL0VMeFz2ONFufh6CZ +u5UDwwB9KWYOiPjiLmnGnRLlr1OkYxgNcA4KXHqQCNS7TYUdA4RgOXJOPOzZq842Qlpn4OPsT1 UYWiwexEUWRdSy0UXgcKi8ZKoJmskISwlRWvP33NGUSdVgrc3A8xp2j2DL+Z5y/drIV1ePbl+sd 0xuxnSGZIwLDgrddaTP31dLCWCCFVkXK+QbkjRYftgL1/9rH3hpVwFTVenyvJBLbAZO0HQ5tObN QH/LdnIZDppWpw5/9bvh7RbCMyQ1fIVnJx5EfrKmZg54CErldsPrSY/dpxsTqwvpZM5Y70wM8T4 Z8xbD/rn4zEe4KN8mLC/U11ceq/IsLDkFQbvaiLdDl718rR72zRZOY64bg0R8Ss9+XyybfqvM0w j/8Fz8C7c9P1+n7rr4gFNsrwA4ao2DzKXnZKymwNpkXZyyF+4Pk33woqvUeChX0TsYVMLRhboB/ uLO3j97SGNT4BczrA== X-Received: by 2002:a05:620a:29cb:b0:8cd:b90f:fc14 with SMTP id af79cd13be357-8d01c7e4b6dmr1256165885a.61.1774806925541; Sun, 29 Mar 2026 10:55:25 -0700 (PDT) Received: from gourry-fedora-PF4VCD3F (pool-173-79-68-72.washdc.fios.verizon.net. [173.79.68.72]) by smtp.gmail.com with ESMTPSA id af79cd13be357-8d027f0e687sm470620385a.18.2026.03.29.10.55.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 29 Mar 2026 10:55:24 -0700 (PDT) Date: Sun, 29 Mar 2026 13:55:22 -0400 From: Gregory Price To: Ard Biesheuvel Cc: linux-efi@vger.kernel.org, linux-kernel@vger.kernel.org, x86@kernel.org, Ard Biesheuvel , Dave Young , Usama Arif , Jiri Slaby , Breno Leitao Subject: Re: [PATCH 0/5] x86/efi: Re-enable memory attributes table for kexec Message-ID: References: <20260326132655.1733873-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 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20260326132655.1733873-7-ardb+git@google.com> On Thu, Mar 26, 2026 at 02:26:56PM +0100, Ard Biesheuvel wrote: > From: Ard Biesheuvel > > The EFI memory attributes table augments the EFI memory map, and > provides permission attributes for all runtime code and data regions > that are otherwise mapped read-write-execute in their entirety. > > Currently, this table is disregarded when doing kexec boot on x86, for > two reasons: > - the boot services data region that holds the table is not reserved > correctly, and may contain garbage at kexec time > - a misguided sanity check on the size of the table is likely to trigger > on kexec, as the EFI memory map has been trimmed down by that time. > > Fix both issues, so that the EFI memory attributes table can be taken > into account again at kexec time. Note that this requires that the call > to efi_memattr_init() is moved to a later point for x86. > I appreciate this fixup, I'll try to give it a test in some known host configuration switch scenarios I know don't work across multiple kexecs and see if it is an improvement. ~Gregory > Cc: Dave Young > Cc: Gregory Price > Cc: Usama Arif > Cc: Jiri Slaby > Cc: Breno Leitao > > Ard Biesheuvel (5): > efi/memattr: Fix thinko in table size sanity check > x86/efi: Gather initial memory reservation and table handling logic > x86/efi: Defer the call to efi_memattr_init() > efi: Use efi_mem_reserve() to reserve the memory attribute table > x86/efi: Drop kexec quirk for the EFI memory attributes table > > arch/x86/include/asm/efi.h | 5 ++--- > arch/x86/kernel/setup.c | 11 ++--------- > arch/x86/platform/efi/efi.c | 15 +++++++++++++++ > arch/x86/platform/efi/quirks.c | 4 ---- > drivers/firmware/efi/efi.c | 2 +- > drivers/firmware/efi/memattr.c | 17 ++++++++++------- > 6 files changed, 30 insertions(+), 24 deletions(-) > > > base-commit: 217c0a5c177a3d4f7c8497950cbf5c36756e8bbb > -- > 2.53.0.1018.g2bb0e51243-goog >