Received: by 2002:a05:6a10:9afc:0:0:0:0 with SMTP id t28csp97041pxm; Tue, 22 Feb 2022 17:43:21 -0800 (PST) X-Google-Smtp-Source: ABdhPJwyTH90yTNXKJ5mzpWtGRw7/8nTshugepwI/aDoWm4eagai+AqXH+MmhtYlldWqdvUEuS/D X-Received: by 2002:a17:906:3e09:b0:6ce:d86c:91a3 with SMTP id k9-20020a1709063e0900b006ced86c91a3mr21139699eji.255.1645580601592; Tue, 22 Feb 2022 17:43:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1645580601; cv=none; d=google.com; s=arc-20160816; b=g0o/IKqZ/jnu0Hwn2hADI7M73lIYkqomA4liuVgpVbODDlio2yAxpIr6Qz52PQamsU ZTQO6dxaRHdyWI587NJseObiFQfIUULVzAk1LNx5TUMpG1xFhwZsw8/n1qZRPtHRMlqR HBnVZs2v5AY5iEN+q4gq2kHDMfjAMhmiVCkL9g2FNVG3MMDVIE/HDaTxkDoSJIwJIx/U cUsLxoeESRuQZEcx7eEwxLQcKXLb1d0ePtu9LZEc+p+LMJut9na/MDXDELB0UIlonWhY 2DZ5AB9lAC+Ccfu6alAMHMRDd2FU+a9IDFQBjzVuYqU66Z+TqZ/o5lDeKGWBqKS3rEOb EAPw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=vCnYHLy2ZxLW1+1wKyxbDfmohEew3lEiJPknv0zMRYw=; b=sUPNKkz08h7RuWyn30WgF1NIOCxQeBuNDhqLDdIAqeUuQ63kDWP0f1lTL9Po9HBjbu Ppgjy6WrTkLzRpL1AiVuh56swkaMAz+gauckF+skKSH/uWE3e777OzjtnHQSfTJbPRf4 0mXe09SOlY7T7HCuHmQKhTfDIsp0WiwDz45t2kr2g4r/K+h9IyxoUdgxWltq/rwUqlz0 SBR2vx84BU0HcH4TVf03dRdeSW9zBE4h5/cU44zy3y+/cshdPc4t1ZrQb8t7Yd9FAKRo 8GVSRQsaBr6/LHHXfA05xO0DhL343FLueKJdOmYTUY87BxO0Yl417WwxXuQe/ZpIalXP cK9g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@zx2c4.com header.s=20210105 header.b=lXMDj8r4; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=zx2c4.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id p1si9310986ejn.483.2022.02.22.17.42.59; Tue, 22 Feb 2022 17:43:21 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@zx2c4.com header.s=20210105 header.b=lXMDj8r4; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=zx2c4.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236028AbiBVWSD (ORCPT + 99 others); Tue, 22 Feb 2022 17:18:03 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39254 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230097AbiBVWSB (ORCPT ); Tue, 22 Feb 2022 17:18:01 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B249EB6D19; Tue, 22 Feb 2022 14:17:34 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 2BC89B81A2C; Tue, 22 Feb 2022 22:17:33 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4211DC340E8; Tue, 22 Feb 2022 22:17:31 +0000 (UTC) Authentication-Results: smtp.kernel.org; dkim=pass (1024-bit key) header.d=zx2c4.com header.i=@zx2c4.com header.b="lXMDj8r4" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=zx2c4.com; s=20210105; t=1645568244; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=vCnYHLy2ZxLW1+1wKyxbDfmohEew3lEiJPknv0zMRYw=; b=lXMDj8r4Yr5uWWxTJyy9JlZE8dPd9P561SOdb0cphGNYx4uYOF0/QjtLjtN93FcOp6uNlQ VupvtVgoxdsTRr0yiFFc/3WGr0DAPUbxmounmYEQjVl0cokQYpe4Am0KzYJUUjkCaqDOIk WVlMfbOqLv3Owc1ux6xbpSelgoQb0Mw= Received: by mail.zx2c4.com (ZX2C4 Mail Server) with ESMTPSA id fedef2a4 (TLSv1.3:AEAD-AES256-GCM-SHA384:256:NO); Tue, 22 Feb 2022 22:17:24 +0000 (UTC) Received: by mail-yb1-f177.google.com with SMTP id c6so44223237ybk.3; Tue, 22 Feb 2022 14:17:23 -0800 (PST) X-Gm-Message-State: AOAM531a+v7B3JZn2f1FkbCZysTrcKGDwCqOUsj0vxEbI44kVeDuXi8m +u+4nDmpUmFpnqugFrgIm8U8BQpdfRbuyzR90/k= X-Received: by 2002:a05:6902:693:b0:613:7f4f:2e63 with SMTP id i19-20020a056902069300b006137f4f2e63mr24281380ybt.271.1645568240101; Tue, 22 Feb 2022 14:17:20 -0800 (PST) MIME-Version: 1.0 References: <1614156452-17311-1-git-send-email-acatan@amazon.com> <1614156452-17311-3-git-send-email-acatan@amazon.com> In-Reply-To: From: "Jason A. Donenfeld" Date: Tue, 22 Feb 2022 23:17:09 +0100 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v7 2/2] drivers/virt: vmgenid: add vm generation id driver To: adrian@parity.io Cc: "open list:DOCUMENTATION" , LKML , QEMU Developers , KVM list , linux-s390@vger.kernel.org, Greg Kroah-Hartman , graf@amazon.com, Randy Dunlap , Arnd Bergmann , "Eric W. Biederman" , Mike Rapoport , 0x7f454c46@gmail.com, borntraeger@de.ibm.com, Jann Horn , Willy Tarreau , Colm MacCarthaigh , Andrew Lutomirski , "Theodore Ts'o" , Eric Biggers , "Woodhouse, David" , bonzini@gnu.org, "Singh, Balbir" , "Weiss, Radu" , Jonathan Corbet , "Michael S. Tsirkin" , Michal Hocko , "Rafael J. Wysocki" , Pavel Machek , Michael Ellerman , 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, Adrian Catangiu Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_HI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hey again, On Tue, Feb 22, 2022 at 10:24 PM Jason A. Donenfeld wrote: > 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 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 Well I cleaned up this v7 and refactored it into something along the lines of what I'm thinking. I don't yet know enough about this general problem space to propose the patch and I haven't tested it either, but in case you're curious, something along the lines of what I'm thinking about lives at https://git.kernel.org/pub/scm/linux/kernel/git/crng/random.git/commit/?h=jd/vmgenid if you (or somebody else) feels inclined to pick this up. Looking forward to learning more from you in general, though, about what the deal is with the VM gen ID, and if this is a real thing or not. Regards, Jason