From: Sean Christopherson <seanjc@google.com>
To: Jean-Christophe Guillain <jean-christophe@guillain.net>
Cc: kvm@vger.kernel.org, Paolo Bonzini <pbonzini@redhat.com>
Subject: Re: BUILD_BUG_ON failed for kvm_vmx struct size sanity check in vmx.c
Date: Fri, 28 Aug 2026 16:55:25 -0700 [thread overview]
Message-ID: <apIf7eoMxdfV_7kE@google.com> (raw)
In-Reply-To: <56a4bc35ee605588b7cc36c8e45c12b5f3b506cb.camel@guillain.net>
On Thu, Aug 27, 2026, Jean-Christophe Guillain wrote:
> Hello,
>
> Since yesterday, my daily compilation of Linus tree fails with this
> error:
>
> CC [M] arch/x86/kvm/vmx/vmx.o
> In file included from <command-line>:
> arch/x86/kvm/vmx/vmx.c: In function ‘vmx_init’:
> ././include/linux/compiler_types.h:702:45: error: call to
> ‘__compiletime_assert_1411’ declared with attribute error: BUILD_BUG_ON
> failed: get_order(sizeof(struct kvm_vmx) - SIZE_OF_MEMSLOTS_HASHTABLE)
> && !IS_ENABLED(CONFIG_DEBUG_KERNEL) && !IS_ENABLED(CONFIG_KASAN)
> 702 | _compiletime_assert(condition, msg,
> __compiletime_assert_, __COUNTER__)
The immediate problem is more than likely commit 97d65b544f48 ("KVM: Check for
duplicate vcpu_id as early as possible"), which increased the size by 512 bytes.
But KVM has gotten quite fat in over the last year, because if we can trust past
me, the size was then 2KiB when commit ac777fbf064f ("KVM: x86: Use kvzalloc() to
allocate VM struct") added the assert:
but given that the size of the structure (without the memslots hash tables) is
below 2KiB after 18+ years of existence, more than doubling the size would be
quite notable.
Stupidly, I missed the failed assert because all of my build configs have
CONFIG_DEBUG_KERNEL=y (which is somewhat frustrating because just enabling that
config doesn't actually inflate the size, but checking for all of the configs
gated by DEBUG_KERNEL that do inflate the size would be too much of a maintenance
burden).
Given that no bots have complained, it's probably fine to let rc1 get released
with broken CONFIG_DEBUG_KERNEL=n builds? If not, I'd just temporarily disable
the sanity checks until we can look into this.
I'll dig in next week to try and figure out where all the memory is going (and
I'll add a CONFIG_DEBUG_KERNEL=n config to my build tests so this doesn't happen
again).
next prev parent reply other threads:[~2026-08-28 23:55 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-27 8:52 BUILD_BUG_ON failed for kvm_vmx struct size sanity check in vmx.c Jean-Christophe Guillain
2026-08-28 23:55 ` Sean Christopherson [this message]
2026-09-01 0:52 ` Sean Christopherson
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=apIf7eoMxdfV_7kE@google.com \
--to=seanjc@google.com \
--cc=jean-christophe@guillain.net \
--cc=kvm@vger.kernel.org \
--cc=pbonzini@redhat.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