drivers/misc: vm_gen_counter: initial driver implementation
PATCH v4 1/1 drivers/misc: vm_gen_counter: initial driver implementation
From: Or Idgar <[email protected]>
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 <[email protected]>
---
Changes in v4:
- variable phy_addr changed to phys_addr (nit)
- using iomem functions to support arch portability
Documentation/ABI/testing/sysfs-hypervisor | 13 +++ drivers/misc/Kconfig | 6 ++ drivers/misc/Makefile | 1 + drivers/misc/vmgenid.c | 142 +++++++++++++++++++++++++++++ 4 files changed, 162 insertions(+) create mode 100644 Documentation/ABI/testing/sysfs-hypervisor create mode 100644 drivers/misc/vmgenid.c
Documentation/ABI/testing/sysfs-hypervisor new file +13 -0
@@ -0,0 +1,13 @@ +What: /sys/hypervisor/vm_gen_counter +Date: February 2018 +Contact: Or Idgar <[email protected]> + Gal Hammer <[email protected]> +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).
drivers/misc/Kconfig +6 -0
@@ -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"
drivers/misc/Makefile +1 -0
@@ -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
drivers/misc/vmgenid.c new file +142 -0
142 lines not on this page · raw message
Signature · 1 line
2.14.3