From nobody Mon Feb 9 15:26:21 2026 Received: from mail-pj1-f74.google.com (mail-pj1-f74.google.com [209.85.216.74]) (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 0EB5827B32B for ; Fri, 9 Jan 2026 04:15:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.74 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767932136; cv=none; b=aw6bPqIasGxYPFwMZtQrKMIACJ1ueMpMG1cxUfGS4aRsr6GM3hYUcHAzbx53YlfPn0NQMe27zLkr3Ed7kYSLZtwPzl3VDrbmEykcCjGOckQzohuf9h7/y+FDY+z2/ShacnCW9I7cvQp+qFQ7nNrkwBM14G7qFUg5kV5/+aGJbgc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767932136; c=relaxed/simple; bh=DZZWXNB3UFwK8BGeGJyRTp3Xu6hRuIS0kH1Hk2lrhes=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=ITjr/StBsHr3DSKFCocgn3BbL0VRFvrSzIS/Cd6Eep1fGalMakraOGrNzpxgpbnp9P3+eSCIepuOoiPYQ7tKwe5oksqh2PXaNloSa3UcrIbfu3IXTsVMVCE6uqMbs7YO96j2oSQmnezXuFgWzMR1aFIiW/mR5ifg+xj/psdrCVw= 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=GSgoaCUi; arc=none smtp.client-ip=209.85.216.74 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="GSgoaCUi" Received: by mail-pj1-f74.google.com with SMTP id 98e67ed59e1d1-34cc88eca7eso4801191a91.2 for ; Thu, 08 Jan 2026 20:15:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1767932132; x=1768536932; 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=Ov/rDMP3kxGlRWYyyDh1VhkYmedXXlvI3JsrhuQsaKs=; b=GSgoaCUiw87ZtIV16uyAseR+M0ZCxfkQqXM6Frm55RL460mtYG+9+Oh4nHYIOH1x5/ TJQb6rrNyyUsQkx29ArEUsKF7k/UvpCJYs/6Sed/mzfNvs7tK3ZMcTCiT0EdrZUzd5hI 1ayVYojURnr9qJ+7rJRwLO8Tl1YY94MkQ146cjqo3poStqa8kwkv7C9MKvKO9+LEIP9/ ux1MigM0y7c/OuxVrAqCD9zh2wszPP9bA3xcNhWavv5JIDMeOHAppD2yl4BUlzksWW1Q 2a3PVe1gj673pMoG6BXYQAUziu1S9WiPqNnrkuWiNLl2uCNBqCrZK/9RmejNIbbMULWg XiIg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1767932132; x=1768536932; 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=Ov/rDMP3kxGlRWYyyDh1VhkYmedXXlvI3JsrhuQsaKs=; b=Oc4n7aJc1h602byGaOs7Csxbe9yIvYGyplWZqBTpKC9cm6IuTFhZRTKW8+8hnWnTAs TmgYn/iEiX+LRcefPoeC1DUJYjOQ8dZYFh++3AFwpxm0V2MDbqUVqOK+QkPIgO8Xlhq0 /HqOSJy/zxt5U7qb21RLUuPjo7clc/5oqNGeFZ5XIWdV9VsDk2KLDYFMlDKsc8rKbQd9 K76aPGnRAs5j41bQdSDsYZfIZ1NdsThQFUplkoeXHlGXFmfyc70INaUAvNzm/09xIz3T 21dchrwv085uGir4zltbcfUtXSMqPWkkcOnzZ8Xi2KylEYZg/N7IhPpXFJgjv3t+5NLd H7Hw== X-Forwarded-Encrypted: i=1; AJvYcCWnDR4AVj8xafFl4vzOjadf7eKKcttePSxh0sVAx/LTpbVErPciPn0rJ1KSuLvbo7An7Qurq6kaJVAXeRU=@vger.kernel.org X-Gm-Message-State: AOJu0Yy7jdto255TburV8F+Ccbqfvgtf/f5y4zlwc9XYgHUevjzMCwax zJQ13/7tk4QT5zEq5pp26HnximV1D1sCMWl+UduWcIn/qM5hkVi60h2j3zxVoMT2oNSnmlQluI5 a+AR/tA== X-Google-Smtp-Source: AGHT+IGwhjd/Tdp+duDHCNNRqDKJScvXuyyuKTZj+2tNhsQ5tHaL89ELrFF1rUILoaCEzOilT74jxEfvxLM= X-Received: from pjzj18.prod.google.com ([2002:a17:90a:eb12:b0:34c:c510:f186]) (user=seanjc job=prod-delivery.src-stubby-dispatcher) by 2002:a17:90b:1c05:b0:340:bb51:17eb with SMTP id 98e67ed59e1d1-34f68c286c8mr8384781a91.15.1767932132325; Thu, 08 Jan 2026 20:15:32 -0800 (PST) Reply-To: Sean Christopherson Date: Thu, 8 Jan 2026 20:15:23 -0800 In-Reply-To: <20260109041523.1027323-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: <20260109041523.1027323-1-seanjc@google.com> X-Mailer: git-send-email 2.52.0.457.g6b5491de43-goog Message-ID: <20260109041523.1027323-5-seanjc@google.com> Subject: [PATCH v3 4/4] KVM: nVMX: Remove explicit filtering of GUEST_INTR_STATUS from shadow VMCS fields From: Sean Christopherson To: Sean Christopherson , Paolo Bonzini Cc: kvm@vger.kernel.org, linux-kernel@vger.kernel.org, Xiaoyao Li , Chao Gao , Xin Li , Yosry Ahmed Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Drop KVM's filtering of GUEST_INTR_STATUS when generating the shadow VMCS bitmap now that KVM drops GUEST_INTR_STATUS from the set of supported vmcs12 fields if the field isn't supported by hardware, and initialization of the shadow VMCS fields omits unsupported vmcs12 fields. Note, there is technically a small functional change here, as the vmcs12 filtering only requires support for Virtual Interrupt Delivery, whereas the shadow VMCS code being removed required "full" APICv support, i.e. required Virtual Interrupt Delivery *and* APIC Register Virtualizaton *and* Posted Interrupt support. Opportunistically tweak the comment to more precisely explain why the PML and VMX preemption timer fields need to be explicitly checked. Signed-off-by: Sean Christopherson --- arch/x86/kvm/vmx/nested.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/arch/x86/kvm/vmx/nested.c b/arch/x86/kvm/vmx/nested.c index ac7a17560c8f..3ef4d7ab5723 100644 --- a/arch/x86/kvm/vmx/nested.c +++ b/arch/x86/kvm/vmx/nested.c @@ -115,9 +115,10 @@ static void init_vmcs_shadow_fields(void) continue; =20 /* - * PML and the preemption timer can be emulated, but the - * processor cannot vmwrite to fields that don't exist - * on bare metal. + * KVM emulates PML and the VMX preemption timer irrespective + * of hardware support, but shadowing their related VMCS fields + * requires hardware support as the CPU will reject VMWRITEs to + * fields that don't exist. */ switch (field) { case GUEST_PML_INDEX: @@ -128,10 +129,6 @@ static void init_vmcs_shadow_fields(void) if (!cpu_has_vmx_preemption_timer()) continue; break; - case GUEST_INTR_STATUS: - if (!cpu_has_vmx_apicv()) - continue; - break; default: break; } --=20 2.52.0.457.g6b5491de43-goog