Question about the KVM API KVM_VCPU_TSC_CTRL to control guest TSC

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi KVM communication,

    I am working on TSC synchronization between host and guests.
    I found this doc (https://docs.kernel.org/virt/kvm/devices/vcpu.html#group-kvm-vcpu-tsc-ctrl), which gives some instructions of how to synchronize them. When I reading the KVM APIs (kernel version 6.4), I am a little confused. It seems to me the KVM APIs don’t match the instructions in the doc.
    The doc says "Read the KVM_VCPU_TSC_OFFSET attribute for *every vCPU* to record the guest TSC offset”. However, the KVM API for getting/setting the offset is not through vCPU’s fd, it is through KVM device's fd, 
    E.g., when I refer to the KVM selftest code, I found accessing TSC_OFFSET is through the “KVM_SET_DEVICE_ATTR” cmd, with args “KVM_VCPU_TSC_CTRL” & “KVM_VCPU_TSC_OFFSET”. It looks like the API sets the TSC offset on all vCPUs, instead of a single vCPU.
    Can someone help on it and give some input? Thanks a lot!

    Yifei



[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux