Received: by 10.223.185.116 with SMTP id b49csp2132674wrg; Thu, 22 Feb 2018 08:37:36 -0800 (PST) X-Google-Smtp-Source: AH8x22543g5dCXiC/Jda3n9hlw3H/pvCbQBUKl/yTzpENPP3ZM4Zhk+U2epvxI1e/NZruTuouk/v X-Received: by 2002:a17:902:6083:: with SMTP id s3-v6mr6964388plj.6.1519317456721; Thu, 22 Feb 2018 08:37:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519317456; cv=none; d=google.com; s=arc-20160816; b=yYz3xnOuz2awT3dTeaPHAeYlerRxaevPS5DsL86Y8LBYLzZF2um1Tza3VcZFYAR8vD G5t2hd7QML5mCe4RvYDU3kqD+gwF8qgcEclVYsg3RA4foFhrVy7XBcRjJ9b3yah9La2Y HUNXeP3LMtI9XpMHQaxUbxYowDWyZKsmtJWA3D0c88s18f/DaN3iJUWNW/lBAncdju5J SMLmqg/dpFIywYaORf0lZVAne6ir1jQkEVXFJgjQt+S4opsLp93DKXqI7WLaaAj7LDgV d5Jq12ODKyzY/b6afQ4WTsQr6dH9wxEYX9zkVQlWmfWBe8GnkpGYmSplBa8FZmQAsvmT s5vg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=EhEeRmA/77kj5+tzQdy28Bcc/QRgvapgHPEPYmwNs7g=; b=MKynhWp/GTd2MtvO9O9ZwkDfjHoPlYtMd8Lr5fbvbhX/rEPw1OWVwGoNSPI4wpHxmh 6s/X7wUQJ8Fl9jhP+rflDEsHF9l612jvBEvk0WjReGqNveSjqkA0gQ4w/zvlJYrmq2yd o9BIX8UaUW4zzx7kAn/iG4IzLspRfv1YymBoBWIHYjHCxzVl9O9cwlTZEb1p18oYHSx4 pU5t8SSPCmV/oSpE9kAHAPmeWZhc4tCst/AyMX/BAXDZxUISMDlzWv8EqiwHY+jVm07V kEZASRHTr5ePxGWLVZbCvYdNQwzyiwOGfJo8qRb1f0yMYqRDJWZsnr2CGiaqMTVdiozo c1Fw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e24si238429pff.233.2018.02.22.08.37.20; Thu, 22 Feb 2018 08:37:36 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933222AbeBVQg2 (ORCPT + 99 others); Thu, 22 Feb 2018 11:36:28 -0500 Received: from mail.linuxfoundation.org ([140.211.169.12]:34456 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933152AbeBVQg1 (ORCPT ); Thu, 22 Feb 2018 11:36:27 -0500 Received: from localhost (LFbn-1-12258-90.w90-92.abo.wanadoo.fr [90.92.71.90]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id DE1E61161; Thu, 22 Feb 2018 16:36:26 +0000 (UTC) Date: Thu, 22 Feb 2018 17:36:28 +0100 From: Greg KH To: Or Idgar Cc: linux-kernel@vger.kernel.org, arnd@arndb.de, ghammer@redhat.com, Or Idgar Subject: Re: [PATCH] drivers/virt: vm_gen_counter: initial driver implementation Message-ID: <20180222163628.GA19172@kroah.com> References: <20180222162038.28768-1-idgar@virtualoco.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180222162038.28768-1-idgar@virtualoco.com> User-Agent: Mutt/1.9.3 (2018-01-21) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Feb 22, 2018 at 06:20:38PM +0200, Or Idgar wrote: > From: Or Idgar > > This patch is a driver which expose the Virtual Machine Generation ID > via sysfs. The ID is a UUID value used to differentiate between virtual > machines. > > The VM-Generation ID is a feature defined by Microsoft (paper: > http://go.microsoft.com/fwlink/?LinkId=260709) and supported by multiple > hypervisor vendors. > > Signed-off-by: Or Idgar > --- > Documentation/ABI/testing/sysfs-hypervisor | 13 +++ > drivers/misc/Kconfig | 6 ++ > drivers/misc/Makefile | 1 + > drivers/misc/vmgenid.c | 141 +++++++++++++++++++++++++++++ > 4 files changed, 161 insertions(+) > create mode 100644 Documentation/ABI/testing/sysfs-hypervisor > create mode 100644 drivers/misc/vmgenid.c > > diff --git a/Documentation/ABI/testing/sysfs-hypervisor b/Documentation/ABI/testing/sysfs-hypervisor > new file mode 100644 > index 000000000000..2f9a7b8eab70 > --- /dev/null > +++ b/Documentation/ABI/testing/sysfs-hypervisor > @@ -0,0 +1,13 @@ > +What: /sys/hypervisor/vm_gen_counter Shouldn't this go under the specific hypervisor you are running on? Why in the "root" of /sys/hypervisor? > +Date: February 2018 > +Contact: Or Idgar > + Gal Hammer > +Description: Expose the virtual machine generation ID. The directory > + contains two files: "generation_id" and "raw". Both files > + represent the same information. > + > + "generation_id" file is a UUID string > + representation. > + > + "raw" file is a 128-bit integer > + representation (binary). > diff --git a/drivers/misc/Kconfig b/drivers/misc/Kconfig > index 03605f8fc0dc..5a74802bdfb4 100644 > --- a/drivers/misc/Kconfig > +++ b/drivers/misc/Kconfig > @@ -500,6 +500,12 @@ config MISC_RTSX > tristate > default MISC_RTSX_PCI || MISC_RTSX_USB > > +config VMGENID > + tristate "Virtual Machine Generation ID driver" > + help > + This is a Virtual Machine Generation ID driver which provides > + a virtual machine unique identifier. > + > source "drivers/misc/c2port/Kconfig" > source "drivers/misc/eeprom/Kconfig" > source "drivers/misc/cb710/Kconfig" > diff --git a/drivers/misc/Makefile b/drivers/misc/Makefile > index c3c8624f4d95..067aa666bb6a 100644 > --- a/drivers/misc/Makefile > +++ b/drivers/misc/Makefile > @@ -57,6 +57,7 @@ obj-$(CONFIG_ASPEED_LPC_SNOOP) += aspeed-lpc-snoop.o > obj-$(CONFIG_PCI_ENDPOINT_TEST) += pci_endpoint_test.o > obj-$(CONFIG_OCXL) += ocxl/ > obj-$(CONFIG_MISC_RTSX) += cardreader/ > +obj-$(CONFIG_VMGENID) += vmgenid.o > > lkdtm-$(CONFIG_LKDTM) += lkdtm_core.o > lkdtm-$(CONFIG_LKDTM) += lkdtm_bugs.o > diff --git a/drivers/misc/vmgenid.c b/drivers/misc/vmgenid.c > new file mode 100644 > index 000000000000..9d7f09f9e7bd > --- /dev/null > +++ b/drivers/misc/vmgenid.c > @@ -0,0 +1,141 @@ > +/* > + * Virtual Machine Generation ID driver > + * > + * Copyright (C) 2018 Red Hat, Inc. All rights reserved. > + * Authors: > + * Or Idgar > + * Gal Hammer > + * > + * This program is free software; you can redistribute it and/or modify > + * it under the terms of the GNU General Public License version 2 as > + * published by the Free Software Foundation. No SPDX line? Please see the documentation for how to properly add this as the first line of any new file. I want some hypervisor people to weigh in on this before I can take it... thanks, greg k-h