Commit aa184a86 authored by Marcelo Tosatti's avatar Marcelo Tosatti Committed by Willy Tarreau

KVM: x86: relax MSR_KVM_SYSTEM_TIME alignment check

This was fixed by commit 8f964525
upstream.  This alternate fix avoids the need for extensive backporting.

RHEL5 i386 guests register non 32-byte aligned addresses:

kvm-clock: cpu 1, msr 0:3018aa5, secondary cpu clock
kvm-clock: cpu 2, msr 0:301f8e9, secondary cpu clock
kvm-clock: cpu 3, msr 0:302672d, secondary cpu clock

Check for an address+len that would cross page boundary
instead.
Signed-off-by: default avatarMarcelo Tosatti <mtosatti@redhat.com>
[dannf: backported to Debian's 2.6.32]
Signed-off-by: default avatarWilly Tarreau <w@1wt.eu>
parent 1a33aaff
......@@ -925,9 +925,10 @@ int kvm_set_msr_common(struct kvm_vcpu *vcpu, u32 msr, u64 data)
/* ...but clean it before doing the actual write */
vcpu->arch.time_offset = data & ~(PAGE_MASK | 1);
/* Check that the address is 32-byte aligned. */
if (vcpu->arch.time_offset &
(sizeof(struct pvclock_vcpu_time_info) - 1))
/* Check that address+len does not cross page boundary */
if ((vcpu->arch.time_offset +
sizeof(struct pvclock_vcpu_time_info) - 1)
& PAGE_MASK)
break;
vcpu->arch.time_page =
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment