Skip to content

Commit a497832

Browse files
committed
KVM: x86: Drop ASSERT()s on APIC/vCPU being non-NULL
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. Link: https://patch.msgid.link/20251206004311.479939-2-seanjc@google.com Signed-off-by: Sean Christopherson <seanjc@google.com>
1 parent c9d7134 commit a497832

1 file changed

Lines changed: 0 additions & 5 deletions

File tree

arch/x86/kvm/lapic.c

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1048,7 +1048,6 @@ bool kvm_apic_match_dest(struct kvm_vcpu *vcpu, struct kvm_lapic *source,
10481048
struct kvm_lapic *target = vcpu->arch.apic;
10491049
u32 mda = kvm_apic_mda(vcpu, dest, source, target);
10501050

1051-
ASSERT(target);
10521051
switch (shorthand) {
10531052
case APIC_DEST_NOSHORT:
10541053
if (dest_mode == APIC_DEST_PHYSICAL)
@@ -1607,8 +1606,6 @@ static u32 apic_get_tmcct(struct kvm_lapic *apic)
16071606
ktime_t remaining, now;
16081607
s64 ns;
16091608

1610-
ASSERT(apic != NULL);
1611-
16121609
/* if initial count is 0, current count should also be 0 */
16131610
if (kvm_lapic_get_reg(apic, APIC_TMICT) == 0 ||
16141611
apic->lapic_timer.period == 0)
@@ -3000,8 +2997,6 @@ int kvm_create_lapic(struct kvm_vcpu *vcpu)
30002997
{
30012998
struct kvm_lapic *apic;
30022999

3003-
ASSERT(vcpu != NULL);
3004-
30053000
if (!irqchip_in_kernel(vcpu->kvm)) {
30063001
static_branch_inc(&kvm_has_noapic_vcpu);
30073002
return 0;

0 commit comments

Comments
 (0)