From: "Chalios, Babis" <bchalios@amazon.es>
To: "Daniel P. Berrangé" <berrange@redhat.com>
Cc: <qemu-devel@nongnu.org>, <ani@anisinha.ca>, <mst@redhat.com>,
<imammedo@redhat.com>, <dwmw@amazon.co.uk>, <graf@amazon.de>,
<xmarcalx@amazon.co.uk>, <Jason@zx2c4.com>
Subject: Re: [PATCH 0/2] vmgenid: add generation counter
Date: Thu, 4 Aug 2022 11:54:05 +0200 [thread overview]
Message-ID: <babbf105-f7df-a759-c942-45483dfae02f@amazon.es> (raw)
In-Reply-To: <Yuqhm5LCdg+zf/rH@redhat.com>
Hi Daniel,
On 3/8/22 18:26, Daniel P. Berrangé wrote:
> CAUTION: This email originated from outside of the organization. Do not click links or open attachments unless you can confirm the sender and know the content is safe.
>
>
>
> On Wed, Aug 03, 2022 at 03:41:45PM +0200, bchalios@amazon.es wrote:
>> From: Babis Chalios <bchalios@amazon.es>
>>
>> VM generation ID exposes a GUID inside the VM which changes every time a
>> VM restore is happening. Typically, this GUID is used by the guest
>> kernel to re-seed its internal PRNG. As a result, this value cannot be
>> exposed in guest user-space as a notification mechanism for VM restore
>> events.
>>
>> This patch set extends vmgenid to introduce a 32 bits generation counter
>> whose purpose is to be used as a VM restore notification mechanism for
>> the guest user-space.
>>
>> It is true that such a counter could be implemented entirely by the
>> guest kernel, but this would rely on the vmgenid ACPI notification to
>> trigger the counter update, which is inherently racy. Exposing this
>> through the monitor allows the updated value to be in-place before
>> resuming the vcpus, so interested user-space code can (atomically)
>> observe the update without relying on the ACPI notification.
> The VM generation ID feature in QEMU is implementing a spec defined
> by Microsoft. It is implemented in HyperV, VMWare, QEMU and possibly
> more. This series is proposing a QEMU specific variant, which means
> Linux running on all these other hypervisor platforms won't benefit
> from the change. If the counter were provided entirely in the guest
> kernel, then it works across all hypervisors.
>
> It feels like the kernel ought to provide an implementation itself
> as a starting point, with this QEMU change merely being an optional
> enhancement to close the race window.
>
> Ideally there would be someone at Microsoft we could connect with to
> propose they include this feature in a VM Gen ID spec update, but I
> don't personally know who to contact about that kind of thing. A
> spec update would increase chances that this change gets provieded
> across all hypervisors.
You are right, this *is* out-of-spec. The approach here is based on various
discussions happened last year when we first tried to upstream and more
recently when vmgenid landed in Linux. I find that this summary:
https://lkml.org/lkml/2022/3/1/693 quite to the point. (CCing Jason to
have his take on the matter).
This series comes together with a Linux counterpart:
https://lkml.org/lkml/2022/8/3/563, where the generation counter is
exposed to user-space as a misc device. There, I tried to make the
generation counter "optional", in the sense that if it is not there, the
ACPI device should not fail, exactly because, for the moment, this is
not in the spec and hypervisors might not want to implement it.
However, I think that changing the spec will take time and this is a
real issue affecting real use-cases, so we should start from somewhere.
Cheers,
Babis
>
> With regards,
> Daniel
> --
> |: https://berrange.com -o- https://www.flickr.com/photos/dberrange :|
> |: https://libvirt.org -o- https://fstop138.berrange.com :|
> |: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|
>
Amazon Spain Services sociedad limitada unipersonal, Calle Ramirez de Prado 5, 28045 Madrid. Registro Mercantil de Madrid . Tomo 22458 . Folio 102 . Hoja M-401234 . CIF B84570936
next prev parent reply other threads:[~2022-08-04 9:56 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-08-03 13:41 [PATCH 0/2] vmgenid: add generation counter bchalios
2022-08-03 13:41 ` [PATCH 1/2] vmgenid: make device data size configurable bchalios
2022-08-03 13:41 ` [PATCH 2/2] vmgenid: add generation counter bchalios
2022-08-03 15:36 ` [PATCH 0/2] " Michael S. Tsirkin
2022-08-03 16:17 ` bchalios
2022-08-03 16:26 ` Daniel P. Berrangé
2022-08-04 9:54 ` Chalios, Babis [this message]
2022-08-04 10:02 ` Daniel P. Berrangé
2022-08-04 10:17 ` Chalios, Babis
2022-08-04 13:31 ` Chalios, Babis
2022-08-07 15:39 ` Michael Kelley (LINUX)
2022-08-04 15:01 ` Jason A. Donenfeld
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=babbf105-f7df-a759-c942-45483dfae02f@amazon.es \
--to=bchalios@amazon.es \
--cc=Jason@zx2c4.com \
--cc=ani@anisinha.ca \
--cc=berrange@redhat.com \
--cc=dwmw@amazon.co.uk \
--cc=graf@amazon.de \
--cc=imammedo@redhat.com \
--cc=mst@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=xmarcalx@amazon.co.uk \
/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).