Re: [BUG] Fault during memory acceptance for TDX VMs with certain memory sizes

From: Dave Hansen

Date: Thu Feb 12 2026 - 18:32:43 EST


On 2/12/26 08:29, Moritz Sanft wrote:
> Based on our current (trial-and-error-based) knowledge, the issue only
> occurs on TDX VMs with memory sizes >64GB, where the memory size is not
> aligned to a multiple of 1024. For instance, the QEMU argument `-m 67G`
> works, while `-m 67000M` results in the crash cited below. The
> configurations we've tested so far are as follows:

I don't see any outrageous bugs in the code. I'm going to take a guess
though: the 'unit_size' and the bitmap size don't match or aren't
consistent.

I'd guess that _something_ is unaligned and you're running off the end
of the bitmap or the *mapping* for the bitmap. Any chance you can throw
a bunch of printk()'s in the kernel and see what all the fields in here are:

struct efi_unaccepted_memory {
u32 version;
u32 unit_size;
u64 phys_base;
u64 size;
unsigned long bitmap[];
};

Along with the address of bitmap[] and all the calls to: bitmap_clear()?

That that should shed some light on it.

Any other TDX folks that want to try and reproduce this and do the same
would also be much appreciated!