Skip to contentSkip to conversation

kvm:x86:Make sure kvm_write_guest successes for first call in kvm_write_wall_clock

PATCH RESEND Paolo Bonzini 1 participant 1 message Jan 7, 2016 1 message not in the archive KVM

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

Paolo Bonzini

author maintainer Applied
#1 lore raw
Quoted 16 lines · Nicholas Krause

This makes sure that kvm_write_guest successes for the first call in order to make sure that the wall clock is successfully written to the host system before being calucated as required by the guest system.

---
 arch/x86/kvm/x86.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
arch/x86/kvm/x86.c +0 -0
index eed3228..7551f30 100644

arch/x86/kvm/x86.c static void kvm_write_wall_clock(struct kvm *kvm, gpa_t wall_clock) · line 1174

Quoted 9 lines
arch/x86/kvm/x86.c +2 -1
@@ -1167,7 +1167,8 @@ static void kvm_write_wall_clock(struct kvm *kvm, gpa_t wall_clock)
 
 	++version;
 
-	kvm_write_guest(kvm, wall_clock, &version, sizeof(version));
+	if (kvm_write_guest(kvm, wall_clock, &version, sizeof(version)))
+		return;
 
 	/*
 	 * The guest calculates current wall clock time by adding

Applied, thanks.

Paolo