mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Sean Christopherson <seanjc@google.com>
To: Amirmohammad Eftekhar <amirmohammad.eftekhar@cispa.de>
Cc: pbonzini@redhat.com, kvm@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [BUG/RFC] KVM: nVMX: nested_get_vmcs12_pages() kills the VM when the APIC-access page is unbacked, unlike its sibling pointers
Date: Fri, 16 Oct 2026 17:53:58 -0700	[thread overview]
Message-ID: <atLHJpJUXJKNZ09L@google.com> (raw)
In-Reply-To: <20261016235221.33726-4-amirmohammad.eftekhar@cispa.de>

On Sat, Oct 17, 2026, Amirmohammad Eftekhar wrote:
> Hi,
> 
> nested_get_vmcs12_pages() (arch/x86/kvm/vmx/nested.c:3448) maps three
> L1-supplied guest-physical pointers into vmcs02 on nested VM-entry. Each is
> VALIDATE-checked for format only (page_address_valid / legal-aligned-gpa),
> never for backing, so a legal-format GPA with no memslot passes every
> consistency check and can only fail at the kvm_vcpu_map() step. When that map
> fails, the three pointers are handled three incompatible ways:
> 
>   apic_access_addr        -> vcpu->run->exit_reason = KVM_EXIT_INTERNAL_ERROR,
>                              suberror EMULATION, return false. The VM dies
>                              (every userspace VMM treats INTERNAL_ERROR as fatal).
>   virtual_apic_page_addr  -> clears CPU_BASED_TPR_SHADOW, or writes INVALID_GPA
>                              to force a clean VM-entry failure -> L1 gets a
>                              well-formed VMfail.
>   posted_intr_desc_addr   -> pi_desc = NULL; clears PIN_BASED_POSTED_INTR and
>                              runs L2 anyway, with no signal to L1.

...

> Question / suggested direction: should the apic_access arm be made to fail the
> nested entry cleanly (as virtual_apic does), rather than kill the VM?

No.  KVM goes out of its way to limp along if the vAPIC or PID pages are bad,
mostly to play nice with tests and pedantic developers.  AFAIK, there's no good
option to allow the VM to limp along.  If someone has a strong use case *and* a
"fix", they are more than welcome to post it.

      reply	other threads:[~2026-10-17  0:54 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-16 23:52 Amirmohammad Eftekhar
2026-10-17  0:53 ` Sean Christopherson [this message]

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=atLHJpJUXJKNZ09L@google.com \
    --to=seanjc@google.com \
    --cc=amirmohammad.eftekhar@cispa.de \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@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

all inboxes | Powered by JetHome®