Re: [patch 3/7] x86/kvmclock: Decrapify kvm_register_clock()

From: Paolo Bonzini
Date: Fri Jul 06 2018 - 13:38:25 EST


Decrapification went a bit too far...

On 06/07/2018 18:13, Thomas Gleixner wrote:
> - int cpu = smp_processor_id();
> - int low, high, ret;
> struct pvclock_vcpu_time_info *src;
> + int cpu = smp_processor_id();
> + u64 pa;
>
> if (!hv_clock)
> - return 0;
> -
> - src = &hv_clock[cpu].pvti;

... the line above should not have been a "-". That, or initialize it
in the declaration. Whoever applies can fix it, no need to repost.
I'll test with the above fix.

Paolo

> - low = (int)slow_virt_to_phys(src) | 1;
> - high = ((u64)slow_virt_to_phys(src) >> 32);
> - ret = native_write_msr_safe(msr_kvm_system_time, low, high);
> - printk(KERN_INFO "kvm-clock: cpu %d, msr %x:%x, %s\n",
> - cpu, high, low, txt);
> + return;
>
> - return ret;
> + pa = slow_virt_to_phys(src) | 0x01ULL;
> + wrmsrl(msr_kvm_system_time, pa);
> + pr_info("kvm-clock: cpu %d, msr %llx, %s\n", cpu, pa, txt);
> }