From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.openvz.org (unknown [69.168.225.77]) by lore.virtuozzo.com (Postfix) with ESMTPS id 8E6908015B for ; Thu, 24 Sep 2026 17:17:04 +0000 (UTC) Received: from mail.openvz.org (localhost [127.0.0.1]) by mail.openvz.org (8.14.4/8.14.4) with ESMTP id 68OHFokw018236; Thu, 24 Sep 2026 20:15:51 +0300 DKIM-Filter: OpenDKIM Filter v2.11.0 mail.openvz.org 68OHFokw018236 Authentication-Results: mail.openvz.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=virtuozzo.com header.i=@virtuozzo.com header.b="B7GHXnui" Received: from mail-wm1-f69.google.com (mail-wm1-f69.google.com [209.85.128.69]) by mail.openvz.org (8.14.4/8.14.4) with ESMTP id 68OHFi5U018219 (version=TLSv1/SSLv3 cipher=AES128-GCM-SHA256 bits=128 verify=FAIL) for ; Thu, 24 Sep 2026 20:15:44 +0300 DKIM-Filter: OpenDKIM Filter v2.11.0 mail.openvz.org 68OHFi5U018219 Received: by mail-wm1-f69.google.com with SMTP id 5b1f17b1804b1-49e65ecd557so425115e9.1 for ; Thu, 24 Sep 2026 10:15:44 -0700 (PDT) X-Forwarded-Encrypted: i=2; AKwUvBwQmP2LiEymAuA/ZN+ILytFeyPLRx7Y3BLT+7jAkWhILCitpIDcQ/jR2BucSnz4GvouYpU9Dg==@openvz.org X-Gm-Message-State: AFuF++k0VPlFn7W9SoTZfrkbxD6vCun3G298TPvDNZcZNJLYiiL9mIXi rpwtTDDbDij9WzbRBal12uJRUnf+x3xn5FV9FLi/gOe2YpaphY3xElsf+1MjbkgDj0beUiGaLW5 1LWkQZtD1tzUpLKTEY17Ikp4ws20WCHofD077WRTQ0HcgMJQcr1gH6w== X-Gm-Gg: AYBFou3e+ejyC2V+1ovS1FH0LMEp0Y9WYky7xZKW55zowuQH84Se/f1CFJUY9sd1BdD GVy9ZVQ+EnTAPL6TQqWHibqFHyL2Xe96o5j+zi9pNaCFKhfOXPan7hdX/WOKFTZrNpPXjpaRE1t O3W8Ijrclut0/Z8lFXvWO4psnL8sc8QfelCepq57/+THdxAty2SSe5I85EECCqOb2W74TwQNHKR E199MRHc0TLWP2tEpOjoahkeh9jy0maqxknN//IF+w35+oKkSusGfZ3pSoaXyfJaupIlEADH5vV AtKTuhaL3ub3bcTGgJ4JD/okEzJVZI5fkyrfnDSXKK9dHU2KUond8rUj/SWljcvrCsNSTpZOB0I UU1Ul5wv9RsY5g9frug== X-Received: by 2002:a05:600c:638f:b0:49c:ffab:551f with SMTP id 5b1f17b1804b1-49fe66d8112mr51668015e9.22.1790270144570; Thu, 24 Sep 2026 10:15:44 -0700 (PDT) X-Received: by 2002:a05:600c:638f:b0:49c:ffab:551f with SMTP id 5b1f17b1804b1-49fe66d8112mr51667315e9.22.1790270144012; Thu, 24 Sep 2026 10:15:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1790270144; cv=none; d=google.com; s=arc-20260327; b=dLSLRK+55A8/DB8cMgDCm+Xz4Gm3qHrR37//BBU7oFFUxPqhOT0B/TXubMwUgf7AUR 9NzatMDasj2Qy6q+TXRz8pSPqSfDYI0pzT0xFl6X8z/x+SRG+Qhf/rIU/ccKkzf6SFfw vMQt2LSF1qR5rWPC8bPP+acmFo0fVfmCwWM1kf//9lxGUvMiCw/PcnVgN3tbTzGWiMG6 /QblL3nZrxcv86N1SQqnHm3zAPd9xj+7ZGwRAod+6KnlEoLkqU+p9CW5zTqzTXrvK2XB yp0b5IEuIh+HqGDudmyk3Em1xJMeUsw0AECWt4JjoyaiOCBrnBwCaVsDbvxDl0H04Qs+ 439w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20260327; h=to:content-transfer-encoding:mime-version:message-id:date:subject :from:dkim-signature; bh=P8OGBfLC+7Hdm2USHbBYT3bw6G1R7lWezjVjfes0A6k=; fh=CYcqLjLSfZMYXQrAlD49Y7qij+C3kWyN/pW02euNCoQ=; b=pwmzYusVqlDhQhctPRfBSDQtZ7LGSpF/nU8sLIuY9jf6wDbypevpOLcd/pAy5kJXlb RgAGKXCNpx7K+TH98D7ZzXKyu2CchzVr8sIL8fGLJCo8UVXrusHpycLBfSQKYIREMUJ7 wEbJ3+9+FFK8icj3ge6DftH7aTHvhYqyl+1N1TOtSztDpWOXwqQa3APWrTKTG4hsbtpA 61TpwJ4KzBYGois2mYiIn50fiBWO5R2OR4xmyOyjxeNS/OgXp9xS/J9ESGr16rO0irhf VgP/mi+7nYW8+2gFaQngCfsJ7sFqWBwAvjg92y1FVRXBi7lprxJpXIL/iTdtXEhagQqK Ymcg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@virtuozzo.com header.s=relay header.b=B7GHXnui; spf=pass (google.com: domain of khorenko@virtuozzo.com designates 130.117.225.111 as permitted sender) smtp.mailfrom=khorenko@virtuozzo.com; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=virtuozzo.com Received: from relay.virtuozzo.com (relay.virtuozzo.com. [130.117.225.111]) by mx.google.com with ESMTPS id ffacd0b85a97d-4887a840756si365189f8f.189.2026.09.24.10.15.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 24 Sep 2026 10:15:43 -0700 (PDT) Received-SPF: pass (google.com: domain of khorenko@virtuozzo.com designates 130.117.225.111 as permitted sender) client-ip=130.117.225.111; Authentication-Results: mx.google.com; dkim=pass header.i=@virtuozzo.com header.s=relay header.b=B7GHXnui; spf=pass (google.com: domain of khorenko@virtuozzo.com designates 130.117.225.111 as permitted sender) smtp.mailfrom=khorenko@virtuozzo.com; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=virtuozzo.com DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=virtuozzo.com; s=relay; h=Content-Type:MIME-Version:Message-Id:Date:Subject :From; bh=P8OGBfLC+7Hdm2USHbBYT3bw6G1R7lWezjVjfes0A6k=; b=B7GHXnuiNcFePV1Qwkv Yys2LhOAsSMkaT5a8gZg6+Ur2nZk5LWSO7V6Jt7lWTs/RvKmWmHv/VGsQsZFREMaIocnbtGIJfTV4 yCVf3qJKKciUFqFHTsA5DPn/81KmyFFRQhOod2RWGfqp35e4dVydQfqN1wDXU4pyNOD8WOxiAt+6V rhWACJD7LKEOckb1nKnaBHbWocN8jjdLJYvCZc5V06wTBnIhWk3GDSBLgUj6jYtr3R0axL2cqlDGR sPb9kDumV+/eWYmTJeDZiKqXegLb7Rs0q2rx1ewAb2NrSn46ARSwwtp1rV6cKlbbi6YAbjYE1WvUa gwNu5taGenDHaMA==; Received: from ch-demo-asa.virtuozzo.com ([130.117.225.8] helo=f0.sw.ru) by relay.virtuozzo.com with esmtp (Exim 4.96) (envelope-from ) id 1x9mzw-002HCZ-1b; Thu, 24 Sep 2026 19:15:40 +0200 From: Konstantin Khorenko Date: Thu, 24 Sep 2026 19:15:36 +0200 Message-Id: <20260924-b4-prep-kvm-v2-0-ad742e43266c@virtuozzo.com> MIME-Version: 1.0 X-B4-Tracking: v=1; b=H4sIALhatWoC/yWMzQ6CMBAGX4V8Z9aUpsrPqxAPpS6yEKFphZAQ3 t2qx8lk5kDkIBzRZAcCbxJlmRPoPIMb7PxkkkdiaKVvqtaGOkM+sKdpe1HRl5VRV2u4tEhFEr3 sv1uLwQlVlwL3v4hrN7J7f184zw/XRutieAAAAA== X-Change-ID: 20260924-b4-prep-kvm-1f78405a4e7a To: "Denis V. Lunev" , devel@openvz.org, Konstantin Khorenko X-Mailer: b4 0.16.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=3649; i=khorenko@virtuozzo.com; h=from:subject:message-id; bh=Jw9QF3pBGHm9RbyaPWqABIAZlSy7F12ENiJRFnthPfo=; b=owEBbQKS/ZANAwAKAVGWCkf5YVwqAcsmYgBqtVq+F0gjInfvnwF/GXudefN29L5tuFS3TaNVj hrkiCSkpeOJAjMEAAEKAB0WIQRWD23IPcXT0GO9CCxRlgpH+WFcKgUCarVavgAKCRBRlgpH+WFc KrQcEACK1C4eb1loG50E9EJb5uk0Wbgus5Uqm2L+nRlItm0t/YkEEMd2933NhZoFGoQSjRoB/6L 3GQvYDpRhsoRvjRHlPI8dHKK+hgiRjpeLDsuBBK5TK8b972NUMia6hKNn1jJs9zz0A4uwiBKOBL XWoHfaqaS9GEEdjQ4Nc5Qx6PPTdIzPX/zVHGsY9grQ6OuI3nNK6LasXypolDBfyvrd1Ll/+ZOHC +E9U8uLL59nD2w/UPt61S7wrVLlQ23ouAQfwpCHtBzqotV3wFuP2ps4vubhpMqc6qqQuBt4XZ0X MIhttjgPMPnuD+QEqixo7vVoZ3eDLME9RXSv3imVbKKt2xU1aclOVP/MpoFilGbQ/6A90SnE7F8 rC06uK2X79T8ykULn4PNWD9aUgr1aV40fKA5sJamFrje8ujkjJ9uWfNQ031rrqttmLe7snBIb/v AfkYRVRoEtKqLOZnSbwrUZlPQV/B5oaQdNwPy8eC7mhCKudojLxmX4/Ni+fDPU9BFboSQsYkn/X NxqcK1RDREyEbNa8qMB682h6Z2RSbYbW8dFHSJ4gBIaJ6bVUGZwJNqoWecFq82hqSdjgj9FwlQi zy9xt98URUsLJmqoTqkh9Hithd5U+W0dKxEz7yOa7hQHR2P8jPyKErEQQOAdDYoOV1Wxo8tUF7Z tZOZL0Fd5yd0hdA== X-Developer-Key: i=khorenko@virtuozzo.com; a=openpgp; fpr=560F6DC83DC5D3D063BD082C51960A47F9615C2A X-OZ-Fwd: true Subject: [Devel] [PATCH hci-8.1 v2 0/2] KVM: VMX: fix stale SVI after APICv is re-activated at runtime X-BeenThere: devel@openvz.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: OpenVZ development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: devel-bounces@openvz.org Errors-To: devel-bounces@openvz.org A Windows guest with Hyper-V SynIC enlightenments runs with APICv inhibited for as long as Windows uses SynIC auto-EOI. A system_reset clears SynIC, the inhibit lifts and KVM re-activates APICv on every vCPU. __kvm_vcpu_update_apicv() refreshes the VMCS exec controls but never re-syncs GUEST_INTR_STATUS.SVI from the software vISR, so each vCPU carries whatever SVI it had when APICv was last switched off. With virtual-interrupt delivery the CPU derives the virtual PPR from SVI. A stale SVI in class 0x2x blocks every vector of that class, including the OVMF local APIC timer. The firmware halts waiting for a timer tick that KVM considers deliverable, KVM re-enters the vCPU on every HLT exit, and the guest never leaves BDS. Nothing in the software state looks wrong: apicv_active is set, no inhibits, vIRR has the timer vector, vISR is empty. Only the VMCS SVI disagrees. Rewriting the LAPIC state of the stuck vCPU with its own contents re-synced SVI and the guest booted into Windows, which confirms the mechanism on the live reproducer. Full analysis is in the ticket. Patch 1 is the upstream fix: re-sync SVI from vISR when APICv is activated at runtime. Upstream took it in v6.19-rc2. Patch 2 comes from the same upstream series. While reviewing the SVI fix, Chao Gao found that an APICv (un)inhibit that lands while L2 is active is lost: the nested VM-Exit pends KVM_REQ_APICV_UPDATE, but the handler sees apicv_active already up to date and never refreshes vmcs01. Sean Christopherson merged the two fixes together as the pair meant for stable and marked patch 2 with Fixes and Cc: stable. It is not the scenario reproduced here, but it is the same activation path, and every stable branch that carries patch 1 carries patch 2 as well. Both patches are taken as is: the diffs are identical to mainline, to linux-6.12.y and to CentOS Stream 10, which already has both under RHEL-151869. The prerequisites (kvm_apic_update_hwapic_isr() and the vCPU-taking vmx_hwapic_isr_update() with the L2 deferral) are already in our tree from the RHEL 10 kernel-6.12.0-211.16.1 import, so both cherry-picks apply cleanly. Upstream has no Fixes against either commit. The v7.0 rework that switches to vmcs01 on demand instead of deferring the updates is a cleanup on top, explicitly not meant for stable, and is not taken. The failure has been seen three times across release lines and is tied to a save/restore followed by a reset, so it is rare. Per the ticket discussion this goes to hci-8.1, not 8.0 right before the release. https://virtuozzo.atlassian.net/browse/VSTOR-147087 Changes in v2: - Add the second fix from the same upstream series, "KVM: nVMX: Immediately refresh APICv controls as needed on nested VM-Exit" (mainline 2976313883091, taken via CentOS Stream 10 e299e09009929). Upstream ships the two together, and the second closes the case where the first one is not reached because the APICv update itself is lost while L2 is active. - Add the cover letter. Signed-off-by: Konstantin Khorenko --- Dongli Zhang (1): ms/KVM: VMX: Update SVI during runtime APICv activation Maxim Levitsky (1): ms/KVM: nVMX: Immediately refresh APICv controls as needed on nested VM-Exit arch/x86/kvm/vmx/nested.c | 3 ++- arch/x86/kvm/vmx/vmx.c | 9 --------- arch/x86/kvm/x86.c | 7 +++++++ 3 files changed, 9 insertions(+), 10 deletions(-) --- base-commit: bd96ec5e17337493fefd459682cc21871238ef9c change-id: 20260924-b4-prep-kvm-1f78405a4e7a Best regards, -- Konstantin Khorenko _______________________________________________ Devel mailing list Devel@openvz.org https://lists.openvz.org/mailman/listinfo/devel