From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pj1-f73.google.com (mail-pj1-f73.google.com [209.85.216.73]) (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 3425E3168EC for ; Sat, 6 Dec 2025 00:43:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.73 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764981802; cv=none; b=HnS12V0DcY5zmY37oALLZ2PTko+q4c0oVaDcEnY3klO3jjkQ4Iw6ZYKNOlRcwzeYSE8PueDnUipa2VCztI78Liri2irvSuQXnFh5NlwPMC6KUiCFixL2VBFcZAtIyN8GUSZNerYAB4j9usb/37RB3xJ7G1r3bVJaUenbFCpB6eA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764981802; c=relaxed/simple; bh=Hy74djawqMvSP0jMJOk9BCT2RyW0VOR90fXdslhQje0=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=XH+O1478GfjFFkLQjCRa4jDUNE4IIPxE4J+dFEhg5i5uFXOYMszXR/aCZTIJzAPraWfA2WPaOS4v3L9lufKpDco1iDg8gcvjqKNFVw7wfwUQJF0PKunnkMhM9Es24Nm5I0xgJv5Y2DLL/xlR6pxkXzRaP9NHbnSUILarJ743U/c= 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=ZEQSUU8p; arc=none smtp.client-ip=209.85.216.73 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="ZEQSUU8p" Received: by mail-pj1-f73.google.com with SMTP id 98e67ed59e1d1-34378c914b4so4948079a91.1 for ; Fri, 05 Dec 2025 16:43:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1764981800; x=1765586600; 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=173K4atzjTV2FLTaLFj0n34rAomBtKCng7OEVaMUqaE=; b=ZEQSUU8pPvE0bONpoXFp4e7swPzQFL1px4v7+bBiSqkY9ZRwDm7UPAr3cuO9nLUtgt 78RR68LA8TU1BjSzryAUfHC83ojmNjgyywt6rtUnfgijqa6x6e/3rE35x1WbvTYMd90a C496YEWBlmTeR2mM2d1CE6cqzYtJvwDBcgs4ziCJ76ro00j+iYlokFnYTPY/h7bo6d88 3JfRmFPaTn7zVC+KEFqyscwWwN7TU439furgNb/QujagsJuN0+04vzigOUADjuAqP1JI uxJBeuheA/AQ9AxwU9b3YPWLyUspW4I6mJ0rnpKPv1jX6AidBfvFSe4hZymppUmycHf9 kYoA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1764981800; x=1765586600; 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=173K4atzjTV2FLTaLFj0n34rAomBtKCng7OEVaMUqaE=; b=AdVpqBoC9gHEt4zVGN1BLKz2Tjgl+XyHJtiZQXyeEEzwRZM6gqq+vs/fKMgi/+kxL/ wkepRrPWRBp94A9p5WUk0kF62mpKn+wSVmCrKM8E8TmpQ1Fc4OI3mzxgSj3pu33EEMCS 9ogYZ3QelGNYK9+y31IACVQcgmsNA4DhfUlvBp9IhSJFkYSXn+qJ8mXKugQaGUaEXsbA 3pUyzX0TmL220iYyvUkkp3KHodecFnU/RF4LkUYqNFkS+Qia2ykDoZ5/Ek1S4a2nuDhu Y8gskYCiordgcjaw6ef9/ug0Kc8TNShXrCDKVC/hXMQkuphoF7OehUJ1Ze5eq6nx4+Wm 4iXA== X-Forwarded-Encrypted: i=1; AJvYcCUIlofpf55UfjoO9Me8LEF7EFw8JQv5mS5nze4jyqpq5PImpAnj1n32L0+jhBEam9JUfzGEIl3ZiEOi+qU=@vger.kernel.org X-Gm-Message-State: AOJu0YwLPLGW+jGyOFJ3G8jf76E7Fz/g90tFeMy2XI3xTSFjyn8sUF9w ENlAl/p46RxsOg+IHPVW8xtb+tnaYvmWL2gEj03VjtLjYu42EaCqrt0XtXXn7EpyGeYHDTMH49j Y0ydX1Q== X-Google-Smtp-Source: AGHT+IGTVnpxzGirvoM3sWOHnaYFOdYvPr17LMZTMJrq9eXAIpbGbRw9kPXACGvzABd9IaSIWNihB3yXpFc= X-Received: from pjbhl15.prod.google.com ([2002:a17:90b:134f:b0:340:9a37:91a4]) (user=seanjc job=prod-delivery.src-stubby-dispatcher) by 2002:a17:90b:184e:b0:340:d511:e167 with SMTP id 98e67ed59e1d1-349a23af6bemr710202a91.0.1764981800353; Fri, 05 Dec 2025 16:43:20 -0800 (PST) Reply-To: Sean Christopherson Date: Fri, 5 Dec 2025 16:43:05 -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-4-seanjc@google.com> Subject: [PATCH 3/9] KVM: x86: Drop ASSERT() on I/O APIC EOIs being only for LEVEL_to WARN_ON_ONCE 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 kvm_ioapic_update_eoi_one()'s ASSERT() that the vector's entry is configured to be level-triggered, as KVM intercepts and forward EOIs to the I/O APIC even for edge-triggered IRQs (see kvm_ioapic_scan_entry()), and nothing guarantees the local APIC's TMR register is synchronized with the I/O APIC redirection table, i.e. the @trigger_mode check just out of sight doesn't provide any meaningful protection. Given that roughly half of the historic ASSERT()s are/were guest- and/or user-triggerable, it's safe to assume no one has run meaningful workloads with DEBUG=1, i.e. that the ASSERT() has been dead code since it was added 18+ years ago. Opportunistically drop the unnecessary forward declaration of kvm_ioapic_update_eoi_one(). For all intents and purposes, no functional change intended. Signed-off-by: Sean Christopherson --- arch/x86/kvm/ioapic.c | 6 ------ 1 file changed, 6 deletions(-) diff --git a/arch/x86/kvm/ioapic.c b/arch/x86/kvm/ioapic.c index 2c2783296aed..e7315b9311d3 100644 --- a/arch/x86/kvm/ioapic.c +++ b/arch/x86/kvm/ioapic.c @@ -37,11 +37,6 @@ static int ioapic_service(struct kvm_ioapic *vioapic, int irq, bool line_status); -static void kvm_ioapic_update_eoi_one(struct kvm_vcpu *vcpu, - struct kvm_ioapic *ioapic, - int trigger_mode, - int pin); - static unsigned long ioapic_read_indirect(struct kvm_ioapic *ioapic) { unsigned long result = 0; @@ -564,7 +559,6 @@ static void kvm_ioapic_update_eoi_one(struct kvm_vcpu *vcpu, kvm_lapic_get_reg(apic, APIC_SPIV) & APIC_SPIV_DIRECTED_EOI) return; - ASSERT(ent->fields.trig_mode == IOAPIC_LEVEL_TRIG); ent->fields.remote_irr = 0; if (!ent->fields.mask && (ioapic->irr & (1 << pin))) { ++ioapic->irq_eoi[pin]; -- 2.52.0.223.gf5cc29aaa4-goog