From: Sean Christopherson <seanjc@google.com>
To: Sean Christopherson <seanjc@google.com>,
Paolo Bonzini <pbonzini@redhat.com>,
Vitaly Kuznetsov <vkuznets@redhat.com>,
David Woodhouse <dwmw2@infradead.org>,
Paul Durrant <paul@xen.org>
Cc: kvm@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH 1/9] KVM: x86: Drop ASSERT()s on APIC/vCPU being non-NULL
Date: Fri, 5 Dec 2025 16:43:03 -0800 [thread overview]
Message-ID: <20251206004311.479939-2-seanjc@google.com> (raw)
In-Reply-To: <20251206004311.479939-1-seanjc@google.com>
Remove ASSERT()s on vCPU and APIC structures being non-NULL in the local
APIC code as the DEBUG=1 path of ASSERT() ends with BUG(), i.e. isn't
meaningfully better for debugging than a NULL pointer dereference.
For all intents and purposes, no functional change intended.
Signed-off-by: Sean Christopherson <seanjc@google.com>
---
arch/x86/kvm/lapic.c | 5 -----
1 file changed, 5 deletions(-)
diff --git a/arch/x86/kvm/lapic.c b/arch/x86/kvm/lapic.c
index 1597dd0b0cc6..558adcb67171 100644
--- a/arch/x86/kvm/lapic.c
+++ b/arch/x86/kvm/lapic.c
@@ -1048,7 +1048,6 @@ bool kvm_apic_match_dest(struct kvm_vcpu *vcpu, struct kvm_lapic *source,
struct kvm_lapic *target = vcpu->arch.apic;
u32 mda = kvm_apic_mda(vcpu, dest, source, target);
- ASSERT(target);
switch (shorthand) {
case APIC_DEST_NOSHORT:
if (dest_mode == APIC_DEST_PHYSICAL)
@@ -1607,8 +1606,6 @@ static u32 apic_get_tmcct(struct kvm_lapic *apic)
ktime_t remaining, now;
s64 ns;
- ASSERT(apic != NULL);
-
/* if initial count is 0, current count should also be 0 */
if (kvm_lapic_get_reg(apic, APIC_TMICT) == 0 ||
apic->lapic_timer.period == 0)
@@ -3000,8 +2997,6 @@ int kvm_create_lapic(struct kvm_vcpu *vcpu)
{
struct kvm_lapic *apic;
- ASSERT(vcpu != NULL);
-
if (!irqchip_in_kernel(vcpu->kvm)) {
static_branch_inc(&kvm_has_noapic_vcpu);
return 0;
--
2.52.0.223.gf5cc29aaa4-goog
next prev parent reply other threads:[~2025-12-06 0:43 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-12-06 0:43 [PATCH 0/9] KVM: x86: APIC and I/O APIC cleanups Sean Christopherson
2025-12-06 0:43 ` Sean Christopherson [this message]
2025-12-06 0:43 ` [PATCH 2/9] KVM: x86: Drop guest/user-triggerable asserts on IRR/ISR vectors Sean Christopherson
2025-12-06 0:43 ` [PATCH 3/9] KVM: x86: Drop ASSERT() on I/O APIC EOIs being only for LEVEL_to WARN_ON_ONCE Sean Christopherson
2025-12-06 0:43 ` [PATCH 4/9] KVM: x86: Drop guest-triggerable ASSERT()s on I/O APIC access alignment Sean Christopherson
2025-12-06 0:43 ` [PATCH 5/9] KVM: x86: Drop MAX_NR_RESERVED_IOAPIC_PINS, use KVM_MAX_IRQ_ROUTES directly Sean Christopherson
2025-12-06 0:43 ` [PATCH 6/9] KVM: x86: Add a wrapper to handle common case of IRQ delivery without dest_map Sean Christopherson
2025-12-06 0:43 ` [PATCH 7/9] KVM: x86: Fold "struct dest_map" into "struct rtc_status" Sean Christopherson
2025-12-06 0:43 ` [PATCH 8/9] KVM: x86: Bury ioapic.h definitions behind CONFIG_KVM_IOAPIC Sean Christopherson
2025-12-06 0:43 ` [PATCH 9/9] KVM: x86: Hide KVM_IRQCHIP_KERNEL behind CONFIG_KVM_IOAPIC=y Sean Christopherson
2026-01-12 17:38 ` [PATCH 0/9] KVM: x86: APIC and I/O APIC cleanups 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=20251206004311.479939-2-seanjc@google.com \
--to=seanjc@google.com \
--cc=dwmw2@infradead.org \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=paul@xen.org \
--cc=pbonzini@redhat.com \
--cc=vkuznets@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®