lkml.org 
[lkml]   [2013]   [Jun]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [ 056/184] KVM: x86: relax MSR_KVM_SYSTEM_TIME alignment check
From
Date
On Tue, 2013-06-04 at 19:22 +0200, Willy Tarreau wrote:
> 2.6.32-longterm review patch. If anyone has any objections, please let me know.
>
> ------------------
>
> From: Marcelo Tosatti <mtosatti@redhat.com>

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

Ben.

> 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>
> ---
> arch/x86/kvm/x86.c | 7 ++++---
> 1 file changed, 4 insertions(+), 3 deletions(-)
>
> diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
> index e24e9ce..79905f2 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 =

--
Ben Hutchings
Theory and practice are closer in theory than in practice.
- John Levine, moderator of comp.compilers
[unhandled content-type:application/pgp-signature]
\
 
 \ /
  Last update: 2013-06-07 09:01    [W:0.529 / U:2.972 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site