From: David Woodhouse <dwmw2@infradead.org>
To: Dongli Zhang <dongli.zhang@oracle.com>,
kvm@vger.kernel.org, linux-kselftest@vger.kernel.org
Cc: pbonzini@redhat.com, shuah@kernel.org, seanjc@google.com,
linux-kernel@vger.kernel.org, joe.jin@oracle.com
Subject: Re: [PATCH 1/1] KVM: selftests: add kvmclock drift test
Date: Thu, 04 Apr 2024 15:34:08 +0100 [thread overview]
Message-ID: <d18bb252013df73abc0de662008f399cf77e78cf.camel@infradead.org> (raw)
In-Reply-To: <20240106083346.29180-1-dongli.zhang@oracle.com>
[-- Attachment #1: Type: text/plain, Size: 1745 bytes --]
On Sat, 2024-01-06 at 00:33 -0800, Dongli Zhang wrote:
> There is kvmclock drift issue during the vCPU hotplug. It has been fixed by
> the commit c52ffadc65e2 ("KVM: x86: Don't unnecessarily force masterclock
> update on vCPU hotplug").
>
> This is to add the test to verify if the master clock is updated when we
> write 0 to MSR_IA32_TSC from the host side.
>
> Here is the usage example on the KVM with the bugfix reverted.
>
> $ ./kvm_clock_drift -v -p 5
> kvmclock based on old pvclock_vcpu_time_info: 5012221999
> version: 2
> tsc_timestamp: 3277968
> system_time: 11849519
> tsc_to_system_mul: 2152530255
> tsc_shift: 0
> flags: 1
>
> kvmclock based on new pvclock_vcpu_time_info: 5012222411
> version: 4
> tsc_timestamp: 9980576184
> system_time: 5012222411
> tsc_to_system_mul: 2152530255
> tsc_shift: 0
> flags: 1
>
> ==== Test Assertion Failure ====
> x86_64/kvm_clock_drift.c:216: clock_old == clock_new
> pid=14257 tid=14257 errno=4 - Interrupted system call
> 1 0x000000000040277b: main at kvm_clock_drift.c:216
> 2 0x00007f7766fa7e44: ?? ??:0
> 3 0x000000000040286d: _start at ??:?
> kvmclock drift detected, old=5012221999, new=5012222411
>
> Signed-off-by: Dongli Zhang <dongli.zhang@oracle.com>
We should extend this to cover live update — it should create a
*second* KVM, migrate the guest including its clock information to
that, and validate that the kvmclock information still doesn't change.
Ideally during a leap second.
[-- Attachment #2: smime.p7s --]
[-- Type: application/pkcs7-signature, Size: 5965 bytes --]
next prev parent reply other threads:[~2024-04-04 14:34 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-01-06 8:33 [PATCH 1/1] KVM: selftests: add kvmclock drift test Dongli Zhang
2024-01-29 18:42 ` Dongli Zhang
2024-04-04 14:34 ` David Woodhouse [this message]
2024-08-16 15:15 ` Sean Christopherson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=d18bb252013df73abc0de662008f399cf77e78cf.camel@infradead.org \
--to=dwmw2@infradead.org \
--cc=dongli.zhang@oracle.com \
--cc=joe.jin@oracle.com \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=pbonzini@redhat.com \
--cc=seanjc@google.com \
--cc=shuah@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox