lkml.org 
[lkml]   [2021]   [Apr]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    From
    SubjectRe: [PATCH] Guest system time jumps when new vCPUs is hot-added
    Date
    On Wed, Apr 28 2021 at 11:00, Thomas Gleixner wrote:

    > On Wed, Apr 28 2021 at 10:22, Zelin Deng wrote:
    >
    >> Hello,
    >> I have below VM configuration:
    >> ...
    >> <vcpu placement='static' current='1'>2</vcpu>
    >> <cpu mode='host-passthrough'>
    >> </cpu>
    >> <clock offset='utc'>
    >> <timer name='tsc' frequency='3000000000'/>
    >> </clock>
    >> ...
    >> After VM has been up for a few minutes, I use "virsh setvcpus" to hot-add
    >> second vCPU into VM, below dmesg is observed:
    >> [ 53.273484] CPU1 has been hot-added
    >> [ 85.067135] SMP alternatives: switching to SMP code
    >> [ 85.078409] x86: Booting SMP configuration:
    >> [ 85.079027] smpboot: Booting Node 0 Processor 1 APIC 0x1
    >> [ 85.080240] kvm-clock: cpu 1, msr 77601041, secondary cpu clock
    >> [ 85.080450] smpboot: CPU 1 Converting physical 0 to logical die 1
    >> [ 85.101228] TSC ADJUST compensate: CPU1 observed 169175101528 warp. Adjust: 169175101528
    >> [ 141.513496] TSC ADJUST compensate: CPU1 observed 166 warp. Adjust: 169175101694
    >
    > Why is TSC_ADJUST on CPU1 different from CPU0 in the first place?
    >
    > That's broken.

    Aside of that the TSC synchronization check in guests cannot work
    reliably at all. Simply because there is no guarantee that vCPU0 and
    vCPU1 are running in parallel.

    Thanks,

    tglx

    \
     
     \ /
      Last update: 2021-04-28 11:11    [W:3.371 / U:0.028 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site