summaryrefslogtreecommitdiff
path: root/arch
diff options
context:
space:
mode:
authorMarcelo Tosatti <mtosatti@redhat.com>2013-03-22 19:14:07 +0000
committerWilly Tarreau <w@1wt.eu>2013-06-10 11:42:37 +0200
commitaa184a862d1617273bb56da292a923dbfcc1486c (patch)
treea84d7bbef97baa0f2dca1ec3828462eb04f43fc9 /arch
parent1a33aafff4febd7d3b0c2e27f1c2c7c5b5e08bd1 (diff)
KVM: x86: relax MSR_KVM_SYSTEM_TIME alignment check
This was fixed by commit 8f964525a121f2ff2df948dac908dcc65be21b5b 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: Marcelo Tosatti <mtosatti@redhat.com> [dannf: backported to Debian's 2.6.32] Signed-off-by: Willy Tarreau <w@1wt.eu>
Diffstat (limited to 'arch')
-rw-r--r--arch/x86/kvm/x86.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index e24e9ce8a199..8f408c1d960c 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -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 =