Received: by 10.223.185.116 with SMTP id b49csp2145930wrg; Thu, 22 Feb 2018 08:49:57 -0800 (PST) X-Google-Smtp-Source: AH8x226k0No6VhdIPf2JQFo7nps0torCwiRQvJz2MjS44JYrUHyjnsuJzRsd5k1FHUhuTN59DnBh X-Received: by 10.101.83.140 with SMTP id x12mr5985611pgq.288.1519318196889; Thu, 22 Feb 2018 08:49:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519318196; cv=none; d=google.com; s=arc-20160816; b=umKJToPmtsRQsPo7zBQh1VtMNACPXLEykvzX4vdn7HCBHRWi4yAQ9s7hPyszDcDDHk VmuKn8iURyINQsXFNTcPuBf6n26w+0vikg6urUKdpmubEjFd2tcK9gSOqEGipm3jMTJD PHGlfkWHGVriRSJNcMsNDJJOLAhuAwwmTMCRtwzWUicHzesUA17LIQyTnYiLW3ZyByBu t9wjBWOH37WbmuNVtINaYrU42GY9T462SpG/GA4fP03Mh25RHpQ4fTUW8bzlN2xSpDGX mKn9VzYVdvldiIvetGRwfCX71VJHj1cIYSvOdyqIqDF8yIqfKqdVuxk0Ble6HSTsspKs qymw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:arc-authentication-results; bh=ibG871woPSXtHUG8OGtM9lxdQU/NhkLkVNjujDsX6og=; b=tGXyye/G7I54B3vHUcq7mcjYZ9MxE5Ol7gsT61LrdhkgLZML1QMce0hfK1raRrVAU3 oa4w0s4lP8hP3mvQXFTk/G1dHuSCddaVgiZnVfgSu74DXmtcIBkgwtKRecSIv+8MRzfg 9lyizFS6tga9ue3t2scP2PmaZpOOO8UxnvR+8pZK/a87WJINj7hTNjSBzJbB3CKlaPBM oj8uu74xn9XX1hxGPm1ueduJHyx90Ph2dFI/udf2C2hG8kfEmkEUrdgjV8GXk8L84+js H0u7IC1t0tEYLunsKVisFV6ddK1aEhIeKXgZw0g2de4um3tpzjWUVw+6gW2LY87fzn29 kLJw== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n7si285540pfa.62.2018.02.22.08.49.42; Thu, 22 Feb 2018 08:49:56 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933319AbeBVQtD (ORCPT + 99 others); Thu, 22 Feb 2018 11:49:03 -0500 Received: from mail-oi0-f66.google.com ([209.85.218.66]:45039 "EHLO mail-oi0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933219AbeBVQtC (ORCPT ); Thu, 22 Feb 2018 11:49:02 -0500 Received: by mail-oi0-f66.google.com with SMTP id b8so4156079oib.11 for ; Thu, 22 Feb 2018 08:49:02 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=ibG871woPSXtHUG8OGtM9lxdQU/NhkLkVNjujDsX6og=; b=khoXar1+VqWaB10rP0RreLBlqAiPGwzB4ifPBSSp45NpG/aW6V4HC1w2AS6xTfrLs0 RRwPl+hrNzHCHZO6uvNSSNuI2YOhXQEeShP1nJWDFskupaVjzebkvUxvI01REpZt+DSW u0Ru1ihhJ85OcY83iH3phzR4MTuIxFpjC8eBKpcxnYPNzvM9Qv+2gnbLv3gRMKIvIoO8 4Afa8cgMsqe0uMAZYTAOGZtYToqkkpDv63F1D9e3l+Sb330JwvJKFqOl8rghmIYuurfX FLf4ybjsuRbP3O55Ha/zH8PDZxo0pI45J9n4/IyuIF5PG+LfS+aDbBv+5zA+Q63Sm0nW ypYw== X-Gm-Message-State: APf1xPCmfIP98zqTXuB/nYJ3+aVVtRRUYZj23zP2MmJjTXUbZPCOH8Gx l9pOnnd3cd8jpTe7yk/zGHeYe8bSZ1vo6q5//WQyTg== X-Received: by 10.202.96.196 with SMTP id u187mr4731240oib.63.1519318141725; Thu, 22 Feb 2018 08:49:01 -0800 (PST) MIME-Version: 1.0 Received: by 10.74.31.134 with HTTP; Thu, 22 Feb 2018 08:49:00 -0800 (PST) In-Reply-To: <20180222163628.GA19172@kroah.com> References: <20180222162038.28768-1-idgar@virtualoco.com> <20180222163628.GA19172@kroah.com> From: Gal Hammer Date: Thu, 22 Feb 2018 18:49:00 +0200 Message-ID: Subject: Re: [PATCH] drivers/virt: vm_gen_counter: initial driver implementation To: Greg KH Cc: Or Idgar , linux-kernel@vger.kernel.org, arnd@arndb.de, Or Idgar Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, On Thu, Feb 22, 2018 at 6:36 PM, Greg KH wrote: > 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? As far as I know, most of today's hypervisors support this feature, so adding a subdirectory doesn't seem right. The guest user should be able to access the UUID without a knowledge of the running host. At the moment, the driver supports only QEMU, but we're planning to enhance it once we'll have access to other vendor hypervisors. > >> +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. We'll give it another try. > I want some hypervisor people to weigh in on this before I can take > it... > > thanks, > > greg k-h Thank you. Gal.