From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5F1DD3E316D; Sun, 20 Sep 2026 21:19:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=90.155.92.199 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789939192; cv=none; b=JXY+fMESEwmxGw2U07xphfGVQhgJz7DSVWMnVVId9T2qokoM5MyqlrgvvmxqcqY+u1+hU+lMKItMxJpTWzuNcrZGO1WHQzIFMBrpEKGnla6mDLGVd8FysbF/uXV/KwW6/WDN9HDU7pyH5FiEK3kADlehW0+swnFm4zRKq0+p42I= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789939192; c=relaxed/simple; bh=9paFBKgt2Xh4dbX3zPgVeuCk+bn6tmDjT2og+4+WNLs=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=i+C827fPoX+hGvQBYsyWCAjyNvM7FxTDcLK5jKeCnVdiI3Ra2+yHk93IXGVBfnf7D9N+nf9Vyrxfzh89+xyWd/Rx7uaz157nQxhP2ALeb9Hfiy+XoiH5SYOn63QCgqB08RqgNKhkqqdqjeBBgUPzz2OzOZy/vgR3wsoko82yKjc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=infradead.org; spf=none smtp.mailfrom=desiato.srs.infradead.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b=inhBhE8G; arc=none smtp.client-ip=90.155.92.199 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=infradead.org Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=desiato.srs.infradead.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="inhBhE8G" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description; bh=4+3o1bExF4BNEXjTcoPtkYQQz1PPLY+gtYFWu9neyKI=; b=inhBhE8GD2OjMo0+nhGXIkolcd 7F2wLQSmssvK5ksDzHs6QY2kzYeKQ7/Vx/bphhd8cOOuWWDC8gvoswHVvLBvQ7gj/BQUR06zIA1Cg tZlVunL5D/MlkwyY8mqASXXG5EFtoFTbSTGvm9fARDtYwP3LPGt8VPVQP0Otk3iMXSk7hIMPzWM9z FRs3nXOmNW7ZIp+lkGfQINivgkBwY19tbcTjozE64De16WANp3OKDvZKQDt78msW6PiiBudAlRwyh SlBL1w01My2EuuJGQSxzhC0yHb8cyQscwWdRBeRCDsZIP9k9UIK5h9pw13Co+bet51t674MwsguFz WnMKSGJg==; Received: from [2001:8b0:10b:1::425] (helo=i7.infradead.org) by desiato.infradead.org with esmtpsa (Exim 4.99.2 #2 (Red Hat Linux)) id 1x8OwW-0000000BdxW-4955; Sun, 20 Sep 2026 21:19:26 +0000 Received: from dwoodhou by i7.infradead.org with local (Exim 4.99.4 #2 (Red Hat Linux)) id 1x8OwU-00000003tcb-1NPW; Sun, 20 Sep 2026 22:19:22 +0100 From: David Woodhouse To: kvm@vger.kernel.org Cc: linux-kernel@vger.kernel.org, rcu@vger.kernel.org, linux-rt-devel@lists.linux.dev, linux-kselftest@vger.kernel.org, Paolo Bonzini , Sean Christopherson , Paul Durrant , Vitaly Kuznetsov , Fred Griffoul , "Paul E. McKenney" , Kunwu Chan , Kunwu Chan , Zqiang , Boqun Feng , Neeraj Upadhyay , Joel Fernandes , Lai Jiangshan , Josh Triplett , Mathieu Desnoyers , Sebastian Andrzej Siewior , Clark Williams , Steven Rostedt , Jason Gunthorpe , Michal Hocko , Nikita Kalyazin , Keir Fraser , David Matlack , nh-open-source@amazon.com, David Woodhouse Subject: [PATCH 04/17] KVM: x86/xen: Don't dirty track "vCPU info" page Date: Sun, 20 Sep 2026 21:49:32 +0100 Message-ID: <20260920211920.928306-5-dwmw2@infradead.org> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260920211920.928306-1-dwmw2@infradead.org> References: <20260920211920.928306-1-dwmw2@infradead.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: David Woodhouse X-SRS-Rewrite: SMTP reverse-path rewritten from by desiato.infradead.org. See http://www.infradead.org/rpr.html From: Sean Christopherson Give the Xen per-vCPU info page the same treatment as the per-VM shared info page, and never mark it dirty, as KVM clearly relies on userspace to assume the page is always dirty. While the page is marked dirty on writes via kvm_xen_inject_pending_events(), it's not marked dirty when written by __kvm_xen_set_evtchn_fast(). Furthermore, as was the case with the shared info page, writes in the event channel fastpath may be done without an active vCPU, e.g. when called via timer callback or irqfd injection. I.e. attempting to fix the fastpath would run afoul of the same issue that was fixed by commit 55749769fe60 ("KVM: x86: Fix wall clock writes in Xen shared_info not to mark page dirty"). Signed-off-by: Sean Christopherson Signed-off-by: David Woodhouse Assisted-by: Claude:claude-mythos-5 --- arch/x86/kvm/xen.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/arch/x86/kvm/xen.c b/arch/x86/kvm/xen.c index 198d7babf964..16b76379dcec 100644 --- a/arch/x86/kvm/xen.c +++ b/arch/x86/kvm/xen.c @@ -682,7 +682,6 @@ void kvm_xen_inject_pending_events(struct kvm_vcpu *v) WRITE_ONCE(vi->evtchn_upcall_pending, 1); } - kvm_gpc_mark_dirty_in_slot(gpc); srcu_read_unlock_atomic(&v->kvm->gpc_srcu, idx); /* For the per-vCPU lapic vector, deliver it as MSI. */ @@ -2389,7 +2388,7 @@ void kvm_xen_init_vcpu(struct kvm_vcpu *vcpu) kvm_gpc_init(&vcpu->arch.xen.runstate_cache, vcpu->kvm); kvm_gpc_init(&vcpu->arch.xen.runstate2_cache, vcpu->kvm); - kvm_gpc_init(&vcpu->arch.xen.vcpu_info_cache, vcpu->kvm); + __kvm_gpc_init(&vcpu->arch.xen.vcpu_info_cache, vcpu->kvm, true); kvm_gpc_init(&vcpu->arch.xen.vcpu_time_info_cache, vcpu->kvm); } -- 2.55.0