From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pl1-f202.google.com (mail-pl1-f202.google.com [209.85.214.202]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1A028315D29 for ; Sat, 6 Dec 2025 00:43:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.202 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764981798; cv=none; b=r83Lo4nOTii+hMcg5ECib6WxUSMNqoMxdZ8JWXkc/QdsK6CKGFSl4SanAGVQcNv2GxdB6NOO7XjlJLaHRfJjYXfeREBnNCgWn9C7n9tmNFkdfDLLCmTuW1XjGplugNew8E9uow7FMr6D+tXXjEL3+iCWoHsY5OGvvp9KHl+JfLw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764981798; c=relaxed/simple; bh=iChR0Rc4BB9WG7gSWIif9Hae1GK7UMbvihwokYDapp8=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=mrM39+zi56t7dz4BKyGqgf4TK/8zAFzSVrbvy6AisXBJFOtVCdqdBtCkEqg3g8T0ldEwdOiXyllydD0uGDa8pgALYJG0NIB0ubqPBmn2erp2jO/3qaZXS691gjbwgZuOeQKQ4YVPgjw+5anLS1kH9GW5d0jcanmyXu5JudRsWGQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--seanjc.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=lOPrXEBL; arc=none smtp.client-ip=209.85.214.202 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--seanjc.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="lOPrXEBL" Received: by mail-pl1-f202.google.com with SMTP id d9443c01a7336-29557f43d56so34959495ad.3 for ; Fri, 05 Dec 2025 16:43:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1764981796; x=1765586596; darn=vger.kernel.org; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:reply-to:from:to:cc:subject:date:message-id:reply-to; bh=nDbfRGVCOdB8q8+bSZUn6u1eLIn1JShiu3JRgjwMHyI=; b=lOPrXEBL83pUdariqM2GocB/5ejBWc/nlw4rmkyp1jWkf6Awdd/TqkXzaG+pZXvKvD cKLqLpmlaRe6iB3dltuHVgMY4BeCOypey/1qZlCEYlxShg0Ah5ffDOCgtwGIixizzgGf tK7xOQM2ztbkz0ykcymhY1vSi4bO0uf+5bLmtoMXzXJFtC8GMazrKjTr2MK7/vlgUJ0/ 7LV6UHsMJXuPgvQpbPYA2bdwSEDQc3zIxLNPU1bW42TvlAC8CqPmTNdssq2TeHtDyEc+ VKpFHL7Eml5daGtTDevkQvpJp5w3LA9kxDV4T3pCl3kaAEd58Dkkf0WwJ7KR74WwZujY 5cvQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1764981796; x=1765586596; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:reply-to:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=nDbfRGVCOdB8q8+bSZUn6u1eLIn1JShiu3JRgjwMHyI=; b=R09ptGYSIpyczed6cxtncDxanTr/lgYjx+7jZKWXL+912k9EI5QAxFEDfwY4JLbHEv 55GwwCc6Kmt+Y4z8KBnohSQ5Qp8iOwkyaNE8ZT95jgfYwW8+dqFEcTnSwwDKTh5Q6Rd0 DENEERP+hAslYuI96LrxztpAOd4XBkMCDesNCPk0yPbcxyz+GIzZxGCUfp68mQC/3xf2 FjKhuaOBKhCR0/hgJKBr2il6b78yF9hnYk3QHXDmtFby8tQWLcXlGVPkDHaRTGtRmXGp IeDHVecm0g5hphRHRROKx3CQU4BwQkzM5ZDorDu4zwv/u7DExDfK8NJ0Qcfoe/StzOWL Wqtg== X-Forwarded-Encrypted: i=1; AJvYcCU2NPRThe+dLqErZOCBx54/vU3Bi4CRdHOt2gFv/RecCcHgwTJYjybEForWwk8Y4X9CsyFj/St3/a1vIBs=@vger.kernel.org X-Gm-Message-State: AOJu0YwTekEaynXefFbXLVvFuOqOKVRRoTKXkE1VP5cL7KK7TRxaV5I6 gTNx1eeiBEB5AXixCt5EjuJ1s3vzG7vDpkdIkVDmefIDICH2ubaqhPu4MJV3awJHv1NwsQga9Vo IaTyFvQ== X-Google-Smtp-Source: AGHT+IHv8VUdThEMuYCTo4CRTZK/X2P2LNU9z0jf1LB7AEYk0QUXaJ8qfyEqkCSAnavX436lQTAj32kbRlw= X-Received: from plhz1.prod.google.com ([2002:a17:902:d9c1:b0:295:fdf4:5ad4]) (user=seanjc job=prod-delivery.src-stubby-dispatcher) by 2002:a17:902:cecc:b0:297:d4c4:4d99 with SMTP id d9443c01a7336-29df579ea1dmr8987315ad.6.1764981796344; Fri, 05 Dec 2025 16:43:16 -0800 (PST) Reply-To: Sean Christopherson Date: Fri, 5 Dec 2025 16:43:03 -0800 In-Reply-To: <20251206004311.479939-1-seanjc@google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20251206004311.479939-1-seanjc@google.com> X-Mailer: git-send-email 2.52.0.223.gf5cc29aaa4-goog Message-ID: <20251206004311.479939-2-seanjc@google.com> Subject: [PATCH 1/9] KVM: x86: Drop ASSERT()s on APIC/vCPU being non-NULL From: Sean Christopherson To: Sean Christopherson , Paolo Bonzini , Vitaly Kuznetsov , David Woodhouse , Paul Durrant Cc: kvm@vger.kernel.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" 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 --- 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