From: Christoffer Dall <christoffer.dall@arm.com>
To: Mark Rutland <mark.rutland@arm.com>
Cc: Marc Zyngier <marc.zyngier@arm.com>,
Catalin Marinas <catalin.marinas@arm.com>,
Will Deacon <will.deacon@arm.com>,
Steven Price <steven.price@arm.com>,
kvmarm@lists.cs.columbia.edu,
linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH 00/12] arm64: Paravirtualized time support
Date: Tue, 8 Jan 2019 11:36:37 +0100 [thread overview]
Message-ID: <20190108103637.GI10769@e113682-lin.lund.arm.com> (raw)
In-Reply-To: <20181210114047.tifwh6ilwzphsbqy@lakrids.cambridge.arm.com>
On Mon, Dec 10, 2018 at 11:40:47AM +0000, Mark Rutland wrote:
> On Wed, Nov 28, 2018 at 02:45:15PM +0000, Steven Price wrote:
> > This series add support for paravirtualized time for Arm64 guests and
> > KVM hosts following the specification in Arm's document DEN 0057A:
> >
> > https://developer.arm.com/docs/den0057/a
> >
> > It implements support for Live Physical Time (LPT) which provides the
> > guest with a method to derive a stable counter of time during which the
> > guest is executing even when the guest is being migrated between hosts
> > with different physical counter frequencies.
> >
> > It also implements support for stolen time, allowing the guest to
> > identify time when it is forcibly not executing.
>
> I know that stolen time reporting is important, and I think that we
> definitely want to pick up that part of the spec (once it is published
> in some non-draft form).
>
> However, I am very concerned with the pv-freq part of LPT, and I'd like
> to avoid that if at all possible. I say that because:
>
> * By design, it breaks architectural guarantees from the PoV of SW in
> the guest.
>
> A VM may host multiple SW agents serially (e.g. when booting, or
> across kexec), or concurrently (e.g. Linux w/ EFI runtime services),
> and the host has no way to tell whether all software in the guest will
> function correctly. Due to this, it's not possible to have a guest
> opt-in to the architecturally-broken timekeeping.
Is this necessarily true?
As I understood the intention of the spec, there would be no change to
behavior of the timers as exposed by the hypervisor unless a software
agent specifically ops-int to LPT and pv-freq.
In a scenario with Linux and UEFI running, they must clearly agree on
using functionality that changes the underlying behavior. For
kdump/kexec scenarios, the OS would have to tear down the functionality
to work across migration after loading a secondary SW agent, which
probably needs adding to the spec.
>
> Existing guests will not work correctly once pv-freq is in use, and if
> configured without pv-freq (or if the guest fails to discover pv-freq
> for any reason), the administrator may encounter anything between
> subtle breakage or fatally incorrect timekeeping.
>
> There's plenty of SW agents other than Linux which runs in a guest,
> which would need to be updated to handle pv-freq, e.g. GRUB, *BSD,
> iPXE.
>
> Given this, I think that this is going to lead to subtle breakage in
> real-world scenarios.
I think we'd definitely need to limit the exposure of pv-freq to Linux
and (if necessary) UEFI runtime services. Do you see scenarios where
this would not be possible?
[...]
>
> I understand that LPT is supposed to account for time lost during the
> migration. Can we account for this without pv-freq? e.g. is it possible
> to account for this in the same way as stolen time?
>
I think we can indeed account for lost time during migration or host
system suspend by simply adjusting CNTVOFF_EL2 (as Steve points out, KVM
already supports this, but QEMU doesn't make use of that today -- there
were some patches attempting to address that recently).
Thanks,
Christoffer
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
prev parent reply other threads:[~2019-01-08 10:36 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-11-28 14:45 [PATCH 00/12] arm64: Paravirtualized time support Steven Price
2018-11-28 14:45 ` [PATCH 01/12] KVM: arm64: Document PV-time interface Steven Price
2018-12-03 13:50 ` Andrew Jones
2018-12-03 14:18 ` Marc Zyngier
2018-12-03 15:16 ` Andrew Jones
2018-12-03 15:23 ` Marc Zyngier
2018-12-03 15:52 ` Andrew Jones
2018-12-05 12:32 ` Steven Price
2018-11-28 14:45 ` [PATCH 02/12] KVM: arm/arm64: Factor out hypercall handling from PSCI code Steven Price
2018-12-03 16:02 ` Andrew Jones
2018-11-28 14:45 ` [PATCH 03/12] arm/arm64: Provide a wrapper for SMCCC 1.1 calls Steven Price
2018-12-10 10:27 ` Mark Rutland
2018-12-10 13:52 ` Steven Price
2018-11-28 14:45 ` [PATCH 04/12] arm/arm64: Make use of the SMCCC 1.1 wrapper Steven Price
2018-11-28 14:45 ` [PATCH 05/12] KVM: arm64: Implement PV_FEATURES call Steven Price
2018-12-10 10:39 ` Mark Rutland
2018-12-10 14:20 ` Steven Price
2018-11-28 14:45 ` [PATCH 06/12] KVM: arm64: Support Live Physical Time reporting Steven Price
2018-12-10 10:56 ` Mark Rutland
2018-12-10 15:45 ` Steven Price
2018-11-28 14:45 ` [PATCH 07/12] clocksource: arm_arch_timer: Use paravirtualized LPT Steven Price
2018-11-28 14:45 ` [PATCH 08/12] KVM: Export mark_page_dirty_in_slot Steven Price
2018-11-28 14:45 ` [PATCH 09/12] KVM: arm64: Support stolen time reporting via shared page Steven Price
2018-11-28 14:45 ` [PATCH 10/12] arm64: Retrieve stolen time as paravirtualized guest Steven Price
2018-11-28 14:45 ` [PATCH 11/12] KVM: Allow kvm_device_ops to be const Steven Price
2018-11-28 14:45 ` [PATCH 12/12] KVM: arm64: Provide a PV_TIME device to user space Steven Price
2018-12-03 13:25 ` [PATCH 00/12] arm64: Paravirtualized time support Andrew Jones
2018-12-03 14:36 ` Marc Zyngier
2018-12-05 12:30 ` Steven Price
2018-12-10 11:40 ` Mark Rutland
2018-12-10 16:08 ` Steven Price
2019-01-08 10:36 ` Christoffer Dall [this message]
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=20190108103637.GI10769@e113682-lin.lund.arm.com \
--to=christoffer.dall@arm.com \
--cc=catalin.marinas@arm.com \
--cc=kvmarm@lists.cs.columbia.edu \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=marc.zyngier@arm.com \
--cc=mark.rutland@arm.com \
--cc=steven.price@arm.com \
--cc=will.deacon@arm.com \
/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;
as well as URLs for NNTP newsgroup(s).