Skip to contentSkip to conversation

call write_guest_time as soon as we register the paravirt clock.

PATCH Applied Glauber de Oliveira Costa 2 participants 2 messages Feb 21, 2008 – Feb 22, 2008

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 call write_guest_time as soon as we register the paravirt clock.

From: Glauber Costa <[email protected]>

In situations, like, cpu hotplugging, a cpu can arrive later on the game and register its paravirt clock while everything else is already running, which will lead to breakage, since the time readings will return bogus values.

To prevent this, we write system time as soon as the guest registers its clock

---
 arch/x86/kvm/x86.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
arch/x86/kvm/x86.c +2 -0
index 5dfc21f..03c0c6d 100644
@@ -595,6 +595,8 @@ int kvm_set_msr_common(struct kvm_vcpu *
 
 		if (is_error_page(vcpu->arch.time_page))
 			vcpu->arch.time_page = NULL;
+
+		kvm_write_guest_time(vcpu);
 		break;
 	}
 	default:
Signature · 7 lines
1.4.2


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
Applied
#1 lore raw
Quoted 10 lines · Glauber de Oliveira Costa

From: Glauber Costa <[email protected]>

In situations, like, cpu hotplugging, a cpu can arrive later on the game and register its paravirt clock while everything else is already running, which will lead to breakage, since the time readings will return bogus values.

To prevent this, we write system time as soon as the guest registers its clock

Applied, thanks.

Signature · 7 lines
Do not meddle in the internals of kernels, for they are subtle and quick to panic.


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/