Skip to contentSkip to conversation

FAILED: patch "[PATCH] KVM: x86: Fix wall clock writes in Xen shared_info not to" failed to apply to 5.16-stable tree

PATCH [email protected] 1 participant 1 message Jan 17, 2022

Subsystems (4)
lore
Share & tools
lore

[email protected]

author maintainer
#0 lore raw

The patch below does not apply to the 5.16-stable tree.
If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to <[email protected]>.

thanks,

greg k-h

------------------ original commit in Linus's tree ------------------

From 55749769fe608fa3f4a075e42e89d237c8e37637 Mon Sep 17 00:00:00 2001
From: David Woodhouse <[email protected]>
Date: Fri, 10 Dec 2021 16:36:24 +0000
Subject: [PATCH] KVM: x86: Fix wall clock writes in Xen shared_info not to
mark page dirty

When dirty ring logging is enabled, any dirty logging without an active vCPU context will cause a kernel oops. But we've already declared that the shared_info page doesn't get dirty tracking anyway, since it would be kind of insane to mark it dirty every time we deliver an event channel interrupt. Userspace is supposed to just assume it's always dirty any time a vCPU can run or event channels are routed.

So stop using the generic kvm_write_wall_clock() and just write directly through the gfn_to_pfn_cache that we already have set up.

We can make kvm_write_wall_clock() static in x86.c again now, but let's not remove the 'sec_hi_ofs' argument even though it's not used yet. At some point we *will* want to use that for KVM guests too.

Fixes 629b5348841a ("KVM: x86/xen: update wallclock region")

Message-Id: <[email protected]>

arch/x86/kvm/x86.c +1 -1
index 3050601d5d73..6492329f2e9a 100644
@@ -2135,7 +2135,7 @@ static s64 get_kvmclock_base_ns(void)
 }
 #endif
 
-void kvm_write_wall_clock(struct kvm *kvm, gpa_t wall_clock, int sec_hi_ofs)
+static void kvm_write_wall_clock(struct kvm *kvm, gpa_t wall_clock, int sec_hi_ofs)
 {
 	int version;
 	int r;
arch/x86/kvm/x86.h +0 -1
index 4abcd8d9836d..da7031e80f23 100644
@@ -301,7 +301,6 @@ static inline bool kvm_vcpu_latch_init(struct kvm_vcpu *vcpu)
 	return is_smm(vcpu) || static_call(kvm_x86_apic_init_signal_blocked)(vcpu);
 }
 
-void kvm_write_wall_clock(struct kvm *kvm, gpa_t wall_clock, int sec_hi_ofs);
 void kvm_inject_realmode_interrupt(struct kvm_vcpu *vcpu, int irq, int inc_eip);
 
 u64 get_kvmclock_ns(struct kvm *kvm);
arch/x86/kvm/xen.c +48 -14

88 lines not on this page · raw message