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 2DE58314D39 for ; Sat, 6 Dec 2025 00:43:15 +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=1764981796; cv=none; b=ASDufPwOjqpe20Ji1wwzEBajr6LmrZgdrEOYIjfL8Cxfbm7AAD78i6fibqV5qeVauvreX7/EIeVzFsE9kemVdw9DgbgYASZuIdGhaxBH1DpK8IcsU+jQuVJ8zU0HOF4UZ6i//cUm9/E8WRuPruuL0lSAwKgAQicvPGW2IGBxFXc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764981796; c=relaxed/simple; bh=vxFL93WAY4zqIzMOP62KloH/LvPCv7AgmPTHoMKRYaA=; h=Date:Mime-Version:Message-ID:Subject:From:To:Cc:Content-Type; b=vA+0JnK6eyXXjW1CPZj3wdh91d65iSOr7zYHaxn4bno/rON98oUaOtTkJkyXAs5L1ZK0FJ+k16qaRdWrnPZ7kvICQKg6VUBFPbYTvNa+PYoeDm2KaJMzmyMERLXI07ZJTB1Xrhxum88NKUUQfIvJsYZCANDNOBw4roYSVr2fm1k= 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=sdVklTO4; 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="sdVklTO4" Received: by mail-pj1-f73.google.com with SMTP id 98e67ed59e1d1-340d3b1baafso3714156a91.3 for ; Fri, 05 Dec 2025 16:43:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1764981794; x=1765586594; darn=vger.kernel.org; h=cc:to:from:subject:message-id:mime-version:date:reply-to:from:to:cc :subject:date:message-id:reply-to; bh=gEmwveQn6vdgc6heZsgyAqQ0ODAKxlyjenCFiDNwSDM=; b=sdVklTO43XrqDqEIYk1DxkaggJv5qn2GTPV50U99WBBgW0/GCXaqzbvsubcYpql4ZN 6wG+zPWJmYm6IpKcyWDSBIB6FcS52Q2S8xX7bWX40w+FnnvVGKAapDbNnPHMBta9R6tY g+AFDwxxfkqpz8dqftDQ+S9LvwADgjLMKlT7FQF1LOGwnSsKrgYRgQjSMEz+vq2Z5sZA iPLVxmShRGEELNR81ldea/rGpHiyppvzpcSLE/mNhLDXjL9eQjTDLqjjdhEA0GKdLjDO AVPPf9DtLHHTHsbaM89+6zdyntuqiApaIW5Y1yRM7omoIeSQ12D3a4Yga8MX7K64fLYE JD9w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1764981794; x=1765586594; h=cc:to:from:subject:message-id:mime-version:date:reply-to :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=gEmwveQn6vdgc6heZsgyAqQ0ODAKxlyjenCFiDNwSDM=; b=atGTcVz9ooDFamaQspjqY8ddpNMs3pHY7wS9uIUiisjk9p93bFWwBXQEJdHVqEAQcc DMEDNw2dXifNYiFpkzIpVCR7SogDYTGOpIdSFLeM0tb5xcLzqcYdJZFdelvDwgaOYuNB Wc3vbju+7dYFWZejHqGe7LC3xrzO40zR1eh3N+xTvPKMwtDZec7OgOJnVD6RBrgcvwU5 fO0nCrULe8mZV+siDvvxYqBa1+xSB1L0Sx7gYgv2vEx7uj7bFg6lGlx8VNLabEkRkfhM /6VdTrxDQKtVjwZQTJXUTTLnzQx81uMTmgHgrauvgUj2j2bRukucgTqk8bsIGHTw78uw 8iAw== X-Forwarded-Encrypted: i=1; AJvYcCUCqsbVPPqBB6624jAXMgT+6v0gWwwMykGdB6VaBhNJPw+NtNPEmlD8QlysYgAeqXFxjhTVU2adtryJZEc=@vger.kernel.org X-Gm-Message-State: AOJu0YzwzFbV9FKgiYQryC4bAMF+qR4ZRcyrsQliy+8EkRnccdL9iRLO lsFza2qZN2BhsrRlUa6BaQn5ffTyWoXIAvQIJTiuJzdJWgz4WrsewTbT6dFjg5KoDwhgOpZjbZP n1acDqg== X-Google-Smtp-Source: AGHT+IGKcKsXYFiwDN9JH+Hs5XE4UIPLzuxuiGz/FY2mBLL65RU4QZMj4yDQ4Ex+8n9vlupd0eVKk8b7I8Y= X-Received: from pjbbo14.prod.google.com ([2002:a17:90b:90e:b0:340:bb52:b060]) (user=seanjc job=prod-delivery.src-stubby-dispatcher) by 2002:a17:90b:1e11:b0:330:6d5e:f174 with SMTP id 98e67ed59e1d1-349a258d6bbmr787826a91.20.1764981794460; Fri, 05 Dec 2025 16:43:14 -0800 (PST) Reply-To: Sean Christopherson Date: Fri, 5 Dec 2025 16:43:02 -0800 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 X-Mailer: git-send-email 2.52.0.223.gf5cc29aaa4-goog Message-ID: <20251206004311.479939-1-seanjc@google.com> Subject: [PATCH 0/9] KVM: x86: APIC and I/O APIC cleanups 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" Drop a bunch of _really_ old dead code (ASSERT() buried behind a DEBUG macro that probably hasn't been enabled in 15+ years), clean up the bizarre and confusing "dest_map" pointer that gets passed all of the place but is only actually used for in-kernel RTC emulation, and the bury almost all of ioapic.h behind CONFIG_KVM_IOAPIC=y. I'm not entirely sure why I started poking at this. I think I got mad at the dest_map code, and then things snowballed... Sean Christopherson (9): KVM: x86: Drop ASSERT()s on APIC/vCPU being non-NULL KVM: x86: Drop guest/user-triggerable asserts on IRR/ISR vectors KVM: x86: Drop ASSERT() on I/O APIC EOIs being only for LEVEL_to WARN_ON_ONCE KVM: x86: Drop guest-triggerable ASSERT()s on I/O APIC access alignment KVM: x86: Drop MAX_NR_RESERVED_IOAPIC_PINS, use KVM_MAX_IRQ_ROUTES directly KVM: x86: Add a wrapper to handle common case of IRQ delivery without dest_map KVM: x86: Fold "struct dest_map" into "struct rtc_status" KVM: x86: Bury ioapic.h definitions behind CONFIG_KVM_IOAPIC KVM: x86: Hide KVM_IRQCHIP_KERNEL behind CONFIG_KVM_IOAPIC=y arch/x86/include/asm/kvm_host.h | 2 + arch/x86/kvm/hyperv.c | 2 +- arch/x86/kvm/ioapic.c | 43 ++++++++------------- arch/x86/kvm/ioapic.h | 38 ++++++------------- arch/x86/kvm/irq.c | 4 +- arch/x86/kvm/lapic.c | 66 ++++++++++++++++----------------- arch/x86/kvm/lapic.h | 20 +++++++--- arch/x86/kvm/x86.c | 4 +- arch/x86/kvm/xen.c | 2 +- 9 files changed, 81 insertions(+), 100 deletions(-) base-commit: 5d3e2d9ba9ed68576c70c127e4f7446d896f2af2 -- 2.52.0.223.gf5cc29aaa4-goog