mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Woodhouse, David" <dwmw@amazon.co.uk>
To: Jim Mattson <jmattson@google.com>,
	"Hussain, Mushahid" <hmushi@amazon.co.uk>
Cc: "kvm@vger.kernel.org" <kvm@vger.kernel.org>,
	Sean Christopherson <seanjc@google.com>,
	Paolo Bonzini <pbonzini@redhat.com>,
	Vitaly Kuznetsov <vkuznets@redhat.com>,
	"K . Y . Srinivasan" <kys@microsoft.com>,
	"Haiyang Zhang" <haiyangz@microsoft.com>,
	Wei Liu <wei.liu@kernel.org>, Dexuan Cui <decui@microsoft.com>,
	Long Li <longli@microsoft.com>,
	"linux-hyperv@vger.kernel.org" <linux-hyperv@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"nh-open-source@amazon.com" <nh-open-source@amazon.com>,
	"mushi.shar@gmail.com" <mushi.shar@gmail.com>,
	Todd Frederick <tfred@google.com>
Subject: Re: [PATCH 3/3] KVM: x86: hyper-v: Implement HvCallRestorePartitionTime
Date: Tue, 13 Oct 2026 11:32:55 +0000	[thread overview]
Message-ID: <23274a3d540e4bc36a88262c06adc7b16eaa7a3f.camel@amazon.co.uk> (raw)
In-Reply-To: <CALMp9eQz2ouQvFhBYv_R33_sUQ+ehxv__-f5iZ=_3aA2Guwy5w@mail.gmail.com>


[-- Attachment #1.1: Type: text/plain, Size: 1241 bytes --]

On Mon, 2026-10-12 at 14:23 -0700, Jim Mattson wrote:
> 
> I think there's a window here in which another vCPU can consume
> HV_TSC_PAGE_GUEST_CHANGED before kvm_set_clock_and_tsc() steps the
> clocks. If TSC emulation control is enabled,
> kvm_hv_request_tsc_page_update() won't invalidate the resulting stale
> TSC page.
> 
> > +       kvm_set_clock_and_tsc(vcpu->kvm, in.reference_time_in_100ns * 100, in.tsc);
> 
> When stepping the reference time forward, don't we have to recalculate
> the hrtimer deadlines associated with armed synthetic timers?
> Otherwise, those hrtimers will fire late.

My understanding is that Windows only does this at resume time when
nothing else is running, so it doesn't matter much.

Either way, I don't think we want *any* of this in the kernel; we
should just pass the hypercall up to userspace and let userspace handle
it.

There's a commit somewhere in
https://git.infradead.org/?p=users/dwmw2/linux.git;a=shortlog;h=refs/heads/vsm
which does that; I'm working on cleaning that lot up to be postable
this week. (s/linux/kvm-unit-tests/ and s/linux/qemu/ for the other
parts, if you want an early preview that actually boots Windows guests
under KVM with VSM support).

[-- Attachment #1.2: smime.p7s --]
[-- Type: application/pkcs7-signature, Size: 4017 bytes --]

[-- Attachment #2.1: Type: text/plain, Size: 215 bytes --]




Amazon Development Centre (London) Ltd. Registered in England and Wales with registration number 04543232 with its registered office at 1 Principal Place, Worship Street, London EC2A 2FA, United Kingdom.



[-- Attachment #2.2: Type: text/html, Size: 228 bytes --]

  reply	other threads:[~2026-10-13 11:33 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-05 19:24 [PATCH 0/3] KVM: x86: Support hibernation of a nested Hyper-V Mushahid Hussain
2026-10-05 19:24 ` [PATCH 1/3] KVM: nVMX: Clear stale vmcs02 sync flag in free_nested() Mushahid Hussain
2026-10-12 19:29   ` Jim Mattson
2026-10-05 19:24 ` [PATCH 2/3] KVM: x86: Extract __kvm_set_clock() from kvm_vm_ioctl_set_clock() Mushahid Hussain
2026-10-12 19:35   ` Jim Mattson
2026-10-05 19:24 ` [PATCH 3/3] KVM: x86: hyper-v: Implement HvCallRestorePartitionTime Mushahid Hussain
2026-10-05 22:30   ` David Woodhouse
2026-10-12 21:23   ` Jim Mattson
2026-10-13 11:32     ` Woodhouse, David [this message]
2026-10-06  5:08 ` [PATCH 0/3] KVM: x86: Support hibernation of a nested Hyper-V David Woodhouse

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=23274a3d540e4bc36a88262c06adc7b16eaa7a3f.camel@amazon.co.uk \
    --to=dwmw@amazon.co.uk \
    --cc=decui@microsoft.com \
    --cc=haiyangz@microsoft.com \
    --cc=hmushi@amazon.co.uk \
    --cc=jmattson@google.com \
    --cc=kvm@vger.kernel.org \
    --cc=kys@microsoft.com \
    --cc=linux-hyperv@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=longli@microsoft.com \
    --cc=mushi.shar@gmail.com \
    --cc=nh-open-source@amazon.com \
    --cc=pbonzini@redhat.com \
    --cc=seanjc@google.com \
    --cc=tfred@google.com \
    --cc=vkuznets@redhat.com \
    --cc=wei.liu@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

all inboxes | Powered by JetHome®