From: Jim Mattson <jmattson@google.com>
To: Sean Christopherson <seanjc@google.com>,
Paolo Bonzini <pbonzini@redhat.com>,
Maxim Levitsky <mlevitsk@redhat.com>,
kvm@vger.kernel.org
Cc: Jim Mattson <jmattson@google.com>
Subject: [PATCH] KVM: x86: Complain about an attempt to change the APIC base address
Date: Fri, 21 Jun 2024 15:48:54 -0700 [thread overview]
Message-ID: <20240621224946.4083742-1-jmattson@google.com> (raw)
KVM does not support changing the APIC's base address. Prior to commit
3743c2f02517 ("KVM: x86: inhibit APICv/AVIC on changes to APIC ID or
APIC base"), it emitted a rate-limited warning about this. Now, it's
just silently broken.
Use vcpu_unimpl() to complain about this unsupported operation. Even a
rate-limited error message is better than complete silence.
Fixes: 3743c2f02517 ("KVM: x86: inhibit APICv/AVIC on changes to APIC ID or APIC base")
Signed-off-by: Jim Mattson <jmattson@google.com>
---
arch/x86/kvm/lapic.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/arch/x86/kvm/lapic.c b/arch/x86/kvm/lapic.c
index acd7d48100a1..5284dddab337 100644
--- a/arch/x86/kvm/lapic.c
+++ b/arch/x86/kvm/lapic.c
@@ -2583,6 +2583,8 @@ void kvm_lapic_set_base(struct kvm_vcpu *vcpu, u64 value)
if ((value & MSR_IA32_APICBASE_ENABLE) &&
apic->base_address != APIC_DEFAULT_PHYS_BASE) {
+ vcpu_unimpl(vcpu, "APIC base %#llx is not %#llx",
+ apic->base_address, APIC_DEFAULT_PHYS_BASE);
kvm_set_apicv_inhibit(apic->vcpu->kvm,
APICV_INHIBIT_REASON_APIC_BASE_MODIFIED);
}
--
2.45.2.741.gdbec12cfda-goog
next reply other threads:[~2024-06-21 22:50 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-06-21 22:48 Jim Mattson [this message]
2024-06-25 22:22 ` [PATCH] KVM: x86: Complain about an attempt to change the APIC base address kernel test robot
2024-06-25 23:38 ` kernel test robot
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=20240621224946.4083742-1-jmattson@google.com \
--to=jmattson@google.com \
--cc=kvm@vger.kernel.org \
--cc=mlevitsk@redhat.com \
--cc=pbonzini@redhat.com \
--cc=seanjc@google.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