From nobody Sun Feb 8 22:58:28 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 4EFF82C0297 for ; Tue, 30 Dec 2025 22:02:26 +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=1767132147; cv=none; b=RZmwoM4Ikmn/+pSmYBw/6AysG6m9X3Ot8OCajXnLKRvD1CIJf3+iXKJ3E6CuHvhY3ZXq3QnuBJkxt44EIHIZoTTmHc/54CUHKGp/5KWj2uG3pOxQ7Od+7ikrpWxSIxcO5RVSDVqNdycD4umOD6HcEV5Nli9ShH84vREDTVCT4Qo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767132147; c=relaxed/simple; bh=Ol8Q1P2DspwmDzNsce460hRFuWrj2m2NNQOvDXhcsas=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=i4oQw9yoY5pk0VPOx11BCF9n8K3Ymn/T+ImRZFy5cijtNfS1cG5LN763ojBKmF4sE+4H0sKvliQfzWEc0smnztX6xS3s4MWyM6UMILqimvoRjgNLtAnFyXtjh4QXHLjuF6zTQNtoKq/usXUlE2n+MM9QS7p9NYQaFSGF2VJQzS8= 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=JhWCyteI; 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="JhWCyteI" Received: by mail-pj1-f74.google.com with SMTP id 98e67ed59e1d1-34eff656256so7476792a91.2 for ; Tue, 30 Dec 2025 14:02:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1767132145; x=1767736945; 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=jNWfhcrdkoHWZkKVPidQfqfKWfFIUQ2ZGPzX3rKucVM=; b=JhWCyteIIoQ+DfsEJ6vAIGUvQGh67+OJapqgPeHyLzUHHqJr9f1XJaa24GRMA1SUV0 U24JBBdbYPQIYadJMlzGv7Odct+162y0cBz3Jy0J1WNPZlrMC3e2sNSKe8QMxh3s1TzE KY9WJi7fW9R6q4nXm2Ezld4Pxk59j19kGuJtFsmup/kTcHYA5r+MYfci2ITMTR0KfDGM oIeHsC9pF4GDvwIVaPNhrikC1hzkiQa6r/0li9EdVBxdT/F7+mNMlwccW9V1VTJ7cRpu wqdtCPQ7yFJh+VSI4me3RQqoj6BJS+zIUrxE0ZE2lKrZl+m/+fzrYPlL01fdh68Q9Uei T0kg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1767132145; x=1767736945; 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=jNWfhcrdkoHWZkKVPidQfqfKWfFIUQ2ZGPzX3rKucVM=; b=VyBqivgwE94URI0FgST2OYxpMj5jqQah3ROqDxyypziMMbTCOpmqZXpfQaz9qTO+vv 7r8Nf1cdcujHFTKglKGMc6/Kfpt/QG5Dza8lJLp6faBU31HARcT2BIwqClhzAL7Md1g4 feyBLTAf0v4sjRgH0B26VgPK/GH6OGb3cxc4WGs8LcMS7ZGH2keiwhr2gpQxt+10q4hK cAoJyq/idTiJzYkKHm9GrN6T9nrwXprfxXrmPylvY+GVZbe2jYcd2+Z/TWaKR3ba2UZF dGAkEaC1l9cJFkwBpkwCCHXQ045Q3/L5wq7PEu4YAJkt99HwRnsKPOkAr9wSxfNUN6Rk t2Pg== X-Forwarded-Encrypted: i=1; AJvYcCU+e9HSQjbOfxdtS5CSERXyRrQWvIg8KDx99uOWIjzaCDV2azpyVU6sgKIIs+/2160lE1ZFmD+b5EOiNtY=@vger.kernel.org X-Gm-Message-State: AOJu0YwenIwZPVFylbqYOjsGKhzbuBZhuV7JZiZZ4cCUBn2yDkUU/hOJ npw7hwxa3BYPP5IT75h4BLID1WjZzy3mxJef3ugTxY7vDvTJKSdYn7LxQGW6sUodgbx6J6mIYkJ 3hhTvAg== X-Google-Smtp-Source: AGHT+IHN1J89n4cMOgQCEej01IxvUanktN/Lpxev8oNAKJoKAIUKOTfCKourZVIb+utPYAPKKtYErWGIBRc= X-Received: from pjj16.prod.google.com ([2002:a17:90b:5550:b0:34c:37db:8f1b]) (user=seanjc job=prod-delivery.src-stubby-dispatcher) by 2002:a17:90b:1e42:b0:341:6164:c27d with SMTP id 98e67ed59e1d1-34e92137f6fmr27146295a91.3.1767132145556; Tue, 30 Dec 2025 14:02:25 -0800 (PST) Reply-To: Sean Christopherson Date: Tue, 30 Dec 2025 14:02:20 -0800 In-Reply-To: <20251230220220.4122282-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: <20251230220220.4122282-1-seanjc@google.com> X-Mailer: git-send-email 2.52.0.351.gbe84eed79e-goog Message-ID: <20251230220220.4122282-3-seanjc@google.com> Subject: [PATCH v2 2/2] 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, Xin Li , Chao Gao , 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. 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 9d8f84e3f2da..f50d21a6a2d7 100644 --- a/arch/x86/kvm/vmx/nested.c +++ b/arch/x86/kvm/vmx/nested.c @@ -112,9 +112,10 @@ static void init_vmcs_shadow_fields(void) "Update vmcs12_write_any() to drop reserved bits from AR_BYTES"); =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: @@ -125,10 +126,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.351.gbe84eed79e-goog