All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Jason A. Donenfeld" <Jason@zx2c4.com>
To: Adrian Catangiu <acatan@amazon.com>
Cc: "open list:DOCUMENTATION" <linux-doc@vger.kernel.org>,
	LKML <linux-kernel@vger.kernel.org>,
	QEMU Developers <qemu-devel@nongnu.org>,
	KVM list <kvm@vger.kernel.org>,
	linux-s390@vger.kernel.org,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	graf@amazon.com, Randy Dunlap <rdunlap@infradead.org>,
	Arnd Bergmann <arnd@arndb.de>,
	"Eric W. Biederman" <ebiederm@xmission.com>,
	Mike Rapoport <rppt@kernel.org>,
	0x7f454c46@gmail.com, borntraeger@de.ibm.com,
	Jann Horn <jannh@google.com>, Willy Tarreau <w@1wt.eu>,
	Colm MacCarthaigh <colmmacc@amazon.com>,
	Andrew Lutomirski <luto@kernel.org>,
	"Theodore Ts'o" <tytso@mit.edu>,
	Eric Biggers <ebiggers@kernel.org>,
	"Woodhouse, David" <dwmw@amazon.co.uk>,
	bonzini@gnu.org, "Singh, Balbir" <sblbir@amazon.com>,
	"Weiss, Radu" <raduweis@amazon.com>,
	Jonathan Corbet <corbet@lwn.net>,
	"Michael S. Tsirkin" <mst@redhat.com>,
	Michal Hocko <mhocko@kernel.org>,
	"Rafael J. Wysocki" <rafael@kernel.org>,
	Pavel Machek <pavel@ucw.cz>,
	Michael Ellerman <mpe@ellerman.id.au>,
	areber@redhat.com, ovzxemul@gmail.com, avagin@gmail.com,
	ptikhomirov@virtuozzo.com, gil@azul.com, asmehra@redhat.com,
	dgunigun@redhat.com, vijaysun@ca.ibm.com, oridgar@gmail.com,
	ghammer@redhat.com
Subject: Re: [PATCH v7 2/2] drivers/virt: vmgenid: add vm generation id driver
Date: Tue, 22 Feb 2022 22:24:19 +0100	[thread overview]
Message-ID: <CAHmME9o6cjZT1Cj1g5w5WQE83YxJNqB7eUCWn74FA9Pbb3Y6nQ@mail.gmail.com> (raw)
In-Reply-To: <1614156452-17311-3-git-send-email-acatan@amazon.com>

Hi Adrian,

This thread seems to be long dead, but I couldn't figure out what
happened to the ideas in it. I'm specifically interested in this part:

On Wed, Feb 24, 2021 at 9:48 AM Adrian Catangiu <acatan@amazon.com> wrote:
> +static void vmgenid_acpi_notify(struct acpi_device *device, u32 event)
> +{
> +       uuid_t old_uuid;
> +
> +       if (!device || acpi_driver_data(device) != &vmgenid_data) {
> +               pr_err("VMGENID notify with unexpected driver private data\n");
> +               return;
> +       }
> +
> +       /* update VM Generation UUID */
> +       old_uuid = vmgenid_data.uuid;
> +       memcpy_fromio(&vmgenid_data.uuid, vmgenid_data.uuid_iomap, sizeof(uuid_t));
> +
> +       if (memcmp(&old_uuid, &vmgenid_data.uuid, sizeof(uuid_t))) {
> +               /* HW uuid updated */
> +               sysgenid_bump_generation();
> +               add_device_randomness(&vmgenid_data.uuid, sizeof(uuid_t));
> +       }
> +}

As Jann mentioned in an earlier email, we probably want this to
immediately reseed the crng, not just dump it into
add_device_randomness alone. But either way, the general idea seems
interesting to me. As far as I can tell, QEMU still supports this. Was
it not deemed to be sufficiently interesting?

Thanks,
Jason

WARNING: multiple messages have this Message-ID (diff)
From: "Jason A. Donenfeld" <Jason@zx2c4.com>
To: Adrian Catangiu <acatan@amazon.com>
Cc: areber@redhat.com, KVM list <kvm@vger.kernel.org>,
	"open list:DOCUMENTATION" <linux-doc@vger.kernel.org>,
	ghammer@redhat.com, vijaysun@ca.ibm.com, 0x7f454c46@gmail.com,
	QEMU Developers <qemu-devel@nongnu.org>,
	Michal Hocko <mhocko@kernel.org>,
	dgunigun@redhat.com, avagin@gmail.com,
	Pavel Machek <pavel@ucw.cz>,
	ptikhomirov@virtuozzo.com, linux-s390@vger.kernel.org,
	Jonathan Corbet <corbet@lwn.net>,
	Michael Ellerman <mpe@ellerman.id.au>,
	"Michael S. Tsirkin" <mst@redhat.com>,
	Eric Biggers <ebiggers@kernel.org>,
	borntraeger@de.ibm.com, "Singh, Balbir" <sblbir@amazon.com>,
	bonzini@gnu.org, Arnd Bergmann <arnd@arndb.de>,
	Jann Horn <jannh@google.com>, "Weiss, Radu" <raduweis@amazon.com>,
	asmehra@redhat.com, graf@amazon.com,
	Mike Rapoport <rppt@kernel.org>,
	Andrew Lutomirski <luto@kernel.org>,
	gil@azul.com, oridgar@gmail.com,
	Colm MacCarthaigh <colmmacc@amazon.com>,
	Theodore Ts'o <tytso@mit.edu>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Randy Dunlap <rdunlap@infradead.org>,
	LKML <linux-kernel@vger.kernel.org>,
	"Eric W. Biederman" <ebiederm@xmission.com>,
	ovzxemul@gmail.com, "Rafael J. Wysocki" <rafael@kernel.org>,
	Willy Tarreau <w@1wt.eu>, "Woodhouse, David" <dwmw@amazon.co.uk>
Subject: Re: [PATCH v7 2/2] drivers/virt: vmgenid: add vm generation id driver
Date: Tue, 22 Feb 2022 22:24:19 +0100	[thread overview]
Message-ID: <CAHmME9o6cjZT1Cj1g5w5WQE83YxJNqB7eUCWn74FA9Pbb3Y6nQ@mail.gmail.com> (raw)
In-Reply-To: <1614156452-17311-3-git-send-email-acatan@amazon.com>

Hi Adrian,

This thread seems to be long dead, but I couldn't figure out what
happened to the ideas in it. I'm specifically interested in this part:

On Wed, Feb 24, 2021 at 9:48 AM Adrian Catangiu <acatan@amazon.com> wrote:
> +static void vmgenid_acpi_notify(struct acpi_device *device, u32 event)
> +{
> +       uuid_t old_uuid;
> +
> +       if (!device || acpi_driver_data(device) != &vmgenid_data) {
> +               pr_err("VMGENID notify with unexpected driver private data\n");
> +               return;
> +       }
> +
> +       /* update VM Generation UUID */
> +       old_uuid = vmgenid_data.uuid;
> +       memcpy_fromio(&vmgenid_data.uuid, vmgenid_data.uuid_iomap, sizeof(uuid_t));
> +
> +       if (memcmp(&old_uuid, &vmgenid_data.uuid, sizeof(uuid_t))) {
> +               /* HW uuid updated */
> +               sysgenid_bump_generation();
> +               add_device_randomness(&vmgenid_data.uuid, sizeof(uuid_t));
> +       }
> +}

As Jann mentioned in an earlier email, we probably want this to
immediately reseed the crng, not just dump it into
add_device_randomness alone. But either way, the general idea seems
interesting to me. As far as I can tell, QEMU still supports this. Was
it not deemed to be sufficiently interesting?

Thanks,
Jason


  reply	other threads:[~2022-02-22 21:24 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-24  8:47 [PATCH v7 0/2] System Generation ID driver and VMGENID backend Adrian Catangiu
2021-02-24  8:47 ` Adrian Catangiu
2021-02-24  8:47 ` [PATCH v7 1/2] drivers/misc: sysgenid: add system generation id driver Adrian Catangiu
2021-02-24  8:47   ` Adrian Catangiu
2021-02-24  9:19   ` Michael S. Tsirkin
2021-02-24  9:19     ` Michael S. Tsirkin
2021-02-24 13:45     ` Alexander Graf
2021-02-24 13:45       ` Alexander Graf
2021-02-24 22:41       ` Michael S. Tsirkin
2021-02-24 22:41         ` Michael S. Tsirkin
2021-02-24 23:22         ` Alexander Graf
2021-02-24  8:47 ` [PATCH v7 2/2] drivers/virt: vmgenid: add vm " Adrian Catangiu
2021-02-24  8:47   ` Adrian Catangiu
2022-02-22 21:24   ` Jason A. Donenfeld [this message]
2022-02-22 21:24     ` Jason A. Donenfeld
2022-02-22 22:17     ` Jason A. Donenfeld
2022-02-22 22:17       ` Jason A. Donenfeld
2022-02-23 13:21       ` Jason A. Donenfeld
2022-02-23 13:21         ` Jason A. Donenfeld
2021-02-24  9:05 ` [PATCH v7 0/2] System Generation ID driver and VMGENID backend Michael S. Tsirkin
2021-02-24  9:05   ` Michael S. Tsirkin
2021-03-04 20:08   ` Catangiu, Adrian Costin

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=CAHmME9o6cjZT1Cj1g5w5WQE83YxJNqB7eUCWn74FA9Pbb3Y6nQ@mail.gmail.com \
    --to=jason@zx2c4.com \
    --cc=0x7f454c46@gmail.com \
    --cc=acatan@amazon.com \
    --cc=areber@redhat.com \
    --cc=arnd@arndb.de \
    --cc=asmehra@redhat.com \
    --cc=avagin@gmail.com \
    --cc=bonzini@gnu.org \
    --cc=borntraeger@de.ibm.com \
    --cc=colmmacc@amazon.com \
    --cc=corbet@lwn.net \
    --cc=dgunigun@redhat.com \
    --cc=dwmw@amazon.co.uk \
    --cc=ebiederm@xmission.com \
    --cc=ebiggers@kernel.org \
    --cc=ghammer@redhat.com \
    --cc=gil@azul.com \
    --cc=graf@amazon.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=jannh@google.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-s390@vger.kernel.org \
    --cc=luto@kernel.org \
    --cc=mhocko@kernel.org \
    --cc=mpe@ellerman.id.au \
    --cc=mst@redhat.com \
    --cc=oridgar@gmail.com \
    --cc=ovzxemul@gmail.com \
    --cc=pavel@ucw.cz \
    --cc=ptikhomirov@virtuozzo.com \
    --cc=qemu-devel@nongnu.org \
    --cc=raduweis@amazon.com \
    --cc=rafael@kernel.org \
    --cc=rdunlap@infradead.org \
    --cc=rppt@kernel.org \
    --cc=sblbir@amazon.com \
    --cc=tytso@mit.edu \
    --cc=vijaysun@ca.ibm.com \
    --cc=w@1wt.eu \
    /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.