From: Sean Christopherson <seanjc@google.com>
To: Tim Wiederhake <twiederh@redhat.com>
Cc: Borislav Petkov <bp@alien8.de>,
Dave Hansen <dave.hansen@linux.intel.com>,
"H. Peter Anvin" <hpa@zytor.com>, Ingo Molnar <mingo@redhat.com>,
Jonathan Corbet <corbet@lwn.net>,
kvm@vger.kernel.org, linux-doc@vger.kernel.org,
linux-kernel@vger.kernel.org,
Paolo Bonzini <pbonzini@redhat.com>,
Shuah Khan <skhan@linuxfoundation.org>,
Thomas Gleixner <tglx@kernel.org>,
x86@kernel.org
Subject: Re: [PATCH 0/4] KVM: x86: Document and enforce APIC base memory hole
Date: Wed, 8 Jul 2026 06:41:54 -0700 [thread overview]
Message-ID: <ak5TojZfR04SWWd-@google.com> (raw)
In-Reply-To: <bceedaf195adf713db70a1dba743055fe4f20bc0.camel@redhat.com>
On Wed, Jul 08, 2026, Tim Wiederhake wrote:
> On Mon, 2026-07-06 at 15:26 -0700, Sean Christopherson wrote:
> > On Mon, Jul 06, 2026, Tim Wiederhake wrote:
> > > When an in-kernel irqchip is enabled on x86, KVM installs a private
> > > memory slot at the default APIC base address (0xfee00000) during
> > > vcpu
> > > creation. If user space has already mapped a memory region
> > > covering
> > > that address, vcpu creation fails with -EEXIST. The same happens
> > > in
> > > reverse: mapping memory over the APIC base after vcpu creation also
> > > fails with -EEXIST.
> > >
> > > None of this is documented, and the error is reported far from
> > > where
> > > the actual conflict is introduced. A VMM developer hitting this
> > > has
> > > to trace through KVM internals to understand what went wrong.
> > >
> > > This series documents the two undocumented constraints (irqchip
> > > before
> > > vcpu, APIC base memory hole) and adds early checks so the error is
> > > reported at the ioctl that actually violates the constraint.
> > >
> > > Patches 1-2 are documentation only. Patches 3-4 add early
> > > validation
> > > that turns a confusing -EEXIST at vcpu creation into an explicit
> > > error
> > > at the point where the conflict is introduced.
> >
> > I'm 100% in favor of documenting the behavior, but I'm not exactly
> > excited about
> > the enforcement. It's not needed for KVM's safety, and while I
> > appreciate that
> > such a goof would be somewhat annoying to debug, I have a hard time
> > believing it's
> > a common failure. I.e. I'm not convinced carrying the code is worth
> > the marginal
> > benefits it provides.
>
> FWIW, I did run into this exact issue myself and debugging it was
What were you doing (or trying to do?) when you ran afoul of this? I ask because
maybe there's a way to help developers without impacting KVM's uABI.
> indeed quite a ride. The EEXIST from vcpu creation led me completely
> astray and I was very close to just giving up. If I had, I wouldn't
> have written this patch, and the failure would be perceived as even
> less common.
>
> I don't mind dropping patches 3 and 4 (the actual "enforcement"
> patches) for v2, the documentation is more important in my opinion.
> Still, if there is interest, I'd be more than happy to rework these
> patches for eventual inclusion.
>
> Thanks for the review,
> Tim
>
next prev parent reply other threads:[~2026-07-08 13:41 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-06 9:20 [PATCH 0/4] KVM: x86: Document and enforce APIC base memory hole Tim Wiederhake
2026-07-06 9:20 ` [PATCH 1/4] KVM: x86: Document that KVM_CREATE_IRQCHIP must precede vcpu creation Tim Wiederhake
2026-07-06 23:22 ` Sean Christopherson
2026-07-06 9:20 ` [PATCH 2/4] KVM: x86: Document APIC base address constraint for in-kernel irqchip Tim Wiederhake
2026-07-06 23:32 ` Sean Christopherson
2026-07-06 9:20 ` [PATCH 3/4] KVM: x86: Reject KVM_CREATE_IRQCHIP if APIC base is already mapped Tim Wiederhake
2026-07-06 9:40 ` sashiko-bot
2026-07-06 22:26 ` Sean Christopherson
2026-07-06 9:20 ` [PATCH 4/4] KVM: x86: Reject user memory regions covering the APIC base Tim Wiederhake
2026-07-06 10:00 ` sashiko-bot
2026-07-06 15:21 ` [syzbot ci] Re: KVM: x86: Document and enforce APIC base memory hole syzbot ci
2026-07-06 22:26 ` [PATCH 0/4] " Sean Christopherson
2026-07-08 13:34 ` Tim Wiederhake
2026-07-08 13:41 ` Sean Christopherson [this message]
2026-07-08 19:48 ` Tim Wiederhake
2026-07-09 17:38 ` Sean Christopherson
2026-07-10 8:02 ` Tim Wiederhake
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=ak5TojZfR04SWWd-@google.com \
--to=seanjc@google.com \
--cc=bp@alien8.de \
--cc=corbet@lwn.net \
--cc=dave.hansen@linux.intel.com \
--cc=hpa@zytor.com \
--cc=kvm@vger.kernel.org \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=pbonzini@redhat.com \
--cc=skhan@linuxfoundation.org \
--cc=tglx@kernel.org \
--cc=twiederh@redhat.com \
--cc=x86@kernel.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.