All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ben Warren <ben@skyportsystems.com>
To: "Michael S. Tsirkin" <mst@redhat.com>
Cc: Ed Swierk <eswierk@skyportsystems.com>,
	Igor Mammedov <imammedo@redhat.com>,
	Laszlo Ersek <lersek@redhat.com>,
	qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] Virtual Machine Generation ID
Date: Tue, 17 Jan 2017 09:35:31 -0800	[thread overview]
Message-ID: <44B60139-6945-4914-AC93-C402EA37AD7E@skyportsystems.com> (raw)
In-Reply-To: <20170117171155-mutt-send-email-mst@kernel.org>

[-- Attachment #1: Type: text/plain, Size: 1706 bytes --]


> On Jan 17, 2017, at 7:21 AM, Michael S. Tsirkin <mst@redhat.com> wrote:
> 
> Let's not top-post anymore pls.
> 
> On Tue, Jan 17, 2017 at 07:01:27AM -0800, Ed Swierk wrote:
>> You mean what causes the guest to re-read the vmgenid guid? The
>> vmgenid ACPI table defines a notify method, and when the guest
>> receives the corresponding event, it re-reads the guid. (Also it
>> appears that with Windows Server 2012 at least, if no notify method is
>> defined, as is the case with Xen, the guest just re-reads it on
>> demand.)
>> 
>> Wouldn't it be sufficient for the qmp set-vmgenid command to call
>> acpi_ram_update() with the new guid, and acpi_send_event() to notify
>> the guest?
>> 
>> --Ed
>> 
> 
> Not if you want to reliably be able to know that gen ID
> did not change.
> 
> Consider an application that sends a transaction to
> a database. It should be able to read gen ID and if that
> is unchanged then you know you only sent it once.
> If that is changed you may have sent it twice,
> and may need to recover.
> 
> If guest updates gen id in memory after getting a notify,
> there's a window after receiving a notify and before
> updating it.
> 
> 
Guests don’t update gen ID, the value is read-only to Windows.  The spec states:

“Put the generation ID in an 8-byte aligned buffer in guest RAM, ROM or device memory space, which is guaranteed not to be used by the operating system”

The host is in complete control of the data, so as long as the notify event follows setting of the data, there should be no race.  In practice, the only time the value will change in a running guest is when recovering a snapshot.
> 
> -- 
> MST
—Ben


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

  reply	other threads:[~2017-01-17 17:35 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-16  0:23 [Qemu-devel] Virtual Machine Generation ID Ed Swierk
2016-09-16  0:36 ` Michael S. Tsirkin
2016-10-04 22:51   ` Ed Swierk
2016-10-05  9:45     ` Igor Mammedov
2016-10-06  1:29     ` Michael S. Tsirkin
2016-12-07  2:15       ` Ben Warren
2016-12-11  3:28         ` Michael S. Tsirkin
2017-01-15  6:17           ` Ben Warren
2017-01-16  8:47             ` Igor Mammedov
2017-01-16 14:21             ` Michael S. Tsirkin
2017-01-16 18:57               ` Ben Warren
2017-01-17 13:26                 ` Igor Mammedov
2017-01-17 14:26                   ` Ed Swierk
2017-01-17 14:33                     ` Michael S. Tsirkin
2017-01-17 15:01                       ` Ed Swierk
2017-01-17 15:21                         ` Michael S. Tsirkin
2017-01-17 17:35                           ` Ben Warren [this message]
2017-01-17 16:24                         ` Igor Mammedov
2017-01-17 17:42                           ` Michael S. Tsirkin
2017-01-17 17:45                 ` Michael S. Tsirkin
2017-01-19  0:02                   ` Ben Warren
2017-01-19  7:09                     ` Ben Warren
2017-01-19  9:25                       ` Laszlo Ersek
2017-01-19 17:47                         ` Ben Warren
2017-01-19 18:20                           ` Laszlo Ersek

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=44B60139-6945-4914-AC93-C402EA37AD7E@skyportsystems.com \
    --to=ben@skyportsystems.com \
    --cc=eswierk@skyportsystems.com \
    --cc=imammedo@redhat.com \
    --cc=lersek@redhat.com \
    --cc=mst@redhat.com \
    --cc=qemu-devel@nongnu.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.