From nobody Mon Feb 9 08:29:27 2026 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 757793C1997 for ; Thu, 15 Jan 2026 17:34:37 +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=1768498478; cv=none; b=jPPnCsI1WLjQNbqXEz19IQts6m4Iio9HB43HAgzHJQp7YXFGco2gK5hVjkUnaSyjp142CM524ZHzkhyKtcYU1/z6amLBjAY/lDS35Cey03iekth/93mnXSGv5ZRheR5nniVeVpNgFYT1RUDwI9DW4Fj5sfsOhPA6+aVG7/I45s8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768498478; c=relaxed/simple; bh=XILqFVmOsaW9D6OaK0VES3uHC4bLdcRi1kimGLm++So=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=pGjnmb5pLMd69TLhwcZr5lb7dspxNh0ebP1yI67nWACc+rCPWw8Gis3R/2wuFnd4Y9M1/UaHfujFcmjClIoi3CfOagM8ulQ/0PDzAg+S9YEiZmLVlT07dSBGeX4l7ATFeb0GeyR7qfAW8Pu5CsEzMR93ejHh/eszZvNqc+8Kx2k= 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=kjNrjhea; 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="kjNrjhea" Received: by mail-pl1-f202.google.com with SMTP id d9443c01a7336-29f8e6a5de4so11470985ad.2 for ; Thu, 15 Jan 2026 09:34:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1768498477; x=1769103277; 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=vronXy/BR0vEwHHg+fBfUJp9qb/Nw8vk6MBcNfoFOWE=; b=kjNrjhea56eEcbQmXdWswXfhHj8tOp0lVbFQlYYT7Q/8cBcDPpZ8JnCnwsJRaL0W7I MQj0o/JdNZZ2pNdtmQ6Ggm2+gTCQW/htDQdHuZwKCRWcGN6ImwO2FFaQd+zc6aMI/StO tpVWwBKzuxYOt/Qk5/pWfO4OzFr2gy9lYUuahOh5AWPDe2cp1UcRp0OvJf7VOFZnx6Zq OIpAdvD8N2rxaUIzGub56QKaS1h/99FbBFodqmXlE3GQxr+sGmfJNnX5YaCzzemqyXab WwxWXXhjEo/ARcR9yjz1f8jDS6szjhEMWg05fTQ/jXc0tJtsTuCBX0/LiLpKdkg6Htqh +DqQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1768498477; x=1769103277; 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=vronXy/BR0vEwHHg+fBfUJp9qb/Nw8vk6MBcNfoFOWE=; b=e6rQiEi9AjJ+4LWYPW08guqM/pvqZ9ElmOuFJuY5eaJlSxBEn44WT8SXse3/Kr5rz6 Y44q+rDilpk+CD77HXrwDC0ZqH7FqVGt7hQl5OqOdE40x9ARgVR1Nse8JR7EthR1Bp8w 6X37vi3YOG7D1GkXF2eSqolY1GPT2RfYjhVFS3KL+2T4sLqhY4V1gyGe6BAjt4H3qsvu QcUWJpvadx69i/5y8OXn0F/rYGmk6FQ6GAXt/5Di6V1kUwocW8zpOzxzRtPLicZ1u9PS ci2Qg5QHyYGDwtfOEPobpDe+NpNLgJKmSlhnsTVkarfJxhPU7zrgVnSsgmsjB81BQ9KK QPRA== X-Forwarded-Encrypted: i=1; AJvYcCXIM1T2DfxTq0UbFpz/aEjvAGAqRzY2KzNl2IxTwqPUx1IKFD+UpBuoVraxDjO/SbrRlkSl2yUNoMkZtv8=@vger.kernel.org X-Gm-Message-State: AOJu0Yw+gJgBeZWxX5dEaZqnLHcqEcS3FlRBC0+TkDPi2n6HIff14Fj5 7cdDfJAUWbBgWZc4pgDfKkgYdrnXPsfUKgTYAkAhDn8y4w6V5lfFcoSn6qfWFDXPoBFoFN9CwOq xcQTNXg== X-Received: from plyw10.prod.google.com ([2002:a17:902:d70a:b0:2a2:f514:2116]) (user=seanjc job=prod-delivery.src-stubby-dispatcher) by 2002:a17:903:40cc:b0:2a1:388d:8ef3 with SMTP id d9443c01a7336-2a71754385emr3353485ad.18.1768498476771; Thu, 15 Jan 2026 09:34:36 -0800 (PST) Reply-To: Sean Christopherson Date: Thu, 15 Jan 2026 09:34:27 -0800 In-Reply-To: <20260115173427.716021-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: <20260115173427.716021-1-seanjc@google.com> X-Mailer: git-send-email 2.52.0.457.g6b5491de43-goog Message-ID: <20260115173427.716021-5-seanjc@google.com> Subject: [PATCH v4 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 Reviewed-by: Xiaoyao Li --- 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 34d54edb2851..edbe99a85286 100644 --- a/arch/x86/kvm/vmx/nested.c +++ b/arch/x86/kvm/vmx/nested.c @@ -118,9 +118,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: @@ -131,10 +132,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