mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
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 13:33:56 +0100	[thread overview]
Message-ID: <5a0fa6d2-f138-4360-bf02-5478eda4b495@edgeless.systems> (raw)
In-Reply-To: <aY8Quu2WJG5HB3PP@thinkstation>

> Could you check it this patch makes a difference:
> 
> diff --git a/drivers/firmware/efi/unaccepted_memory.c b/drivers/firmware/efi/unaccepted_memory.c
> index c2c067eff634..f2a00cd429f2 100644
> --- a/drivers/firmware/efi/unaccepted_memory.c
> +++ b/drivers/firmware/efi/unaccepted_memory.c
> @@ -35,7 +35,7 @@ void accept_memory(phys_addr_t start, unsigned long size)
>  	struct efi_unaccepted_memory *unaccepted;
>  	unsigned long range_start, range_end;
>  	struct accept_range range, *entry;
> -	phys_addr_t end = start + size;
> +	phys_addr_t end = start + PAGE_ALIGN(size);
>  	unsigned long flags;
>  	u64 unit_size;

Thanks, I tried this on the `-m 67000M` VM and the crash still occurs. I 
extended the previously-added logging to also log the values for `start 
+ size` and `start + PAGE_ALIGN(size)`. Please find the full patch 
including the logging and your change in [1].

The produced logs are as follows:

```
[    0.046472] accept_memory(start=0x00000010db600000 size=0x200000)
[    0.048747]   unaccepted: version=1 unit_size=2097152 
phys_base=0x100000000 size=0xfdc bitmap=ff1100007d624030
[    0.052557]   (start + size)=0x00000010db800000 (start + 
PAGE_ALIGN(size))=0x00000010db800000
[    0.065217]   bitmap_clear(bitmap=ff1100007d624030, start=32475, len=1)
[    0.067928] accept_memory(start=0x00000010db7ff000 size=0x1000)
[    0.070167]   unaccepted: version=1 unit_size=2097152 
phys_base=0x100000000 size=0xfdc bitmap=ff1100007d624030
[    0.073917]   (start + size)=0x00000010db800000 (start + 
PAGE_ALIGN(size))=0x00000010db800000
[    0.077150] accept_memory(start=0x00000010db7fe000 size=0x1000)
[    0.079365]   unaccepted: version=1 unit_size=2097152 
phys_base=0x100000000 size=0xfdc bitmap=ff1100007d624030
[    0.083080]   (start + size)=0x00000010db7ff000 (start + 
PAGE_ALIGN(size))=0x00000010db7ff000
[    0.087123] accept_memory(start=0x00000010db7fd000 size=0x1000)
[    0.089362]   unaccepted: version=1 unit_size=2097152 
phys_base=0x100000000 size=0xfdc bitmap=ff1100007d624030
[    0.093239]   (start + size)=0x00000010db7fe000 (start + 
PAGE_ALIGN(size))=0x00000010db7fe000
// unrelated
[    0.150522] APIC: Switched APIC routing to: cluster x2apic
[    0.152595] accept_memory(start=0x00000010db7fcf40 size=0x83)
[    0.154745]   unaccepted: version=1 unit_size=2097152 
phys_base=0x100000000 size=0xfdc bitmap=ff1100007d624030
[    0.158479]   (start + size)=0x00000010db7fcfc3 (start + 
PAGE_ALIGN(size))=0x00000010db7fdf40
[    0.161713] BUG: unable to handle page fault for address: 
ff1100007d625008
```

[1]: https://gist.github.com/msanft/d6d7e32a65708f5bd36233649e4facee



  reply	other threads:[~2026-02-13 12:34 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-12 16:29 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 [this message]
2026-02-13 14:24         ` Kiryl Shutsemau
2026-02-13 14:52           ` Moritz Sanft
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=5a0fa6d2-f138-4360-bf02-5478eda4b495@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

all inboxes | Powered by JetHome®