From: Moritz Sanft <ms@edgeless.systems>
To: Kiryl Shutsemau <kas@kernel.org>
Cc: Dave Hansen <dave.hansen@intel.com>,
ardb@kernel.org, "Edgecombe, Rick P" <rick.p.edgecombe@intel.com>,
"Weiny, Ira" <ira.weiny@intel.com>,
"Wunner, Lukas" <lukas.wunner@intel.com>,
linux-efi@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [BUG] Fault during memory acceptance for TDX VMs with certain memory sizes
Date: Fri, 13 Feb 2026 15:52:10 +0100 [thread overview]
Message-ID: <bca9631a-b41d-417b-9be5-8c8989728ea3@edgeless.systems> (raw)
In-Reply-To: <aY8y6uCyejTXTejt@thinkstation>
> What about the patch below. It seems we under-reserve memory for the
> table if it is unaligned.
>
> I still think that we need align start/size/end to the PAGE_SIZE in
> accept_memory()/range_contains_unaccepted_memory() before doing anything
> else. Otherwise (end % unit_size) check is broken. But it seems to be
> unrelated to the problem you see.
>
> diff --git a/drivers/firmware/efi/efi.c b/drivers/firmware/efi/efi.c
> index 111e87a618e5..56e9d73412fa 100644
> --- a/drivers/firmware/efi/efi.c
> +++ b/drivers/firmware/efi/efi.c
> @@ -692,13 +692,13 @@ static __init int match_config_table(const efi_guid_t *guid,
>
> static __init void reserve_unaccepted(struct efi_unaccepted_memory *unaccepted)
> {
> - phys_addr_t start, size;
> + phys_addr_t start, end;
>
> start = PAGE_ALIGN_DOWN(efi.unaccepted);
> - size = PAGE_ALIGN(sizeof(*unaccepted) + unaccepted->size);
> + end = PAGE_ALIGN(efi.unaccepted + sizeof(*unaccepted) + unaccepted->size);
>
> - memblock_add(start, size);
> - memblock_reserve(start, size);
> + memblock_add(start, end - start);
> + memblock_reserve(start, end - start);
> }
>
> int __init efi_config_parse_tables(const efi_config_table_t *config_tables,
Thanks, this patch seems to fix the problem causing the panic. The VM
boots as expected with this.
Please let me know if any more information is required.
Best Regards,
Moritz Sanft
next prev parent reply other threads:[~2026-02-13 14:52 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-12 16:29 [BUG] Fault during memory acceptance for TDX VMs with certain memory sizes Moritz Sanft
2026-02-12 23:31 ` Dave Hansen
2026-02-13 8:34 ` Moritz Sanft
2026-02-13 11:56 ` Kiryl Shutsemau
2026-02-13 12:33 ` Moritz Sanft
2026-02-13 14:24 ` Kiryl Shutsemau
2026-02-13 14:52 ` Moritz Sanft [this message]
2026-02-13 14:52 ` Moritz Sanft
2026-02-13 16:53 ` Verma, Vishal L
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=bca9631a-b41d-417b-9be5-8c8989728ea3@edgeless.systems \
--to=ms@edgeless.systems \
--cc=ardb@kernel.org \
--cc=dave.hansen@intel.com \
--cc=ira.weiny@intel.com \
--cc=kas@kernel.org \
--cc=linux-efi@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lukas.wunner@intel.com \
--cc=rick.p.edgecombe@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox