Drivers: hv: Cleanup the guest ID computation

The current guest ID string in use in vmbus driver does not conform
to the MSFT guidelines on guest ID. MSFT currently does not specify
Linux specific guidelines. MSFT however has plans to publish Linux
specific guidelines. This implementation conforms to the yet unpublished
Linux specific guidelines for guest ID. This implementation also broadly
conforms to the current guidelines as well.

Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Reviewed-by: Haiyang Zhang <haiyangz@microsoft.com>
Cc: Bjørn Mork <bjorn@mork.no>
Cc: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
K. Y. Srinivasan
2012-07-24 16:11:58 -07:00
committed by Greg Kroah-Hartman
parent 0d7614f09c
commit 83ba0c4f3f
2 changed files with 49 additions and 7 deletions

View File

@@ -26,6 +26,7 @@
#include <linux/slab.h>
#include <linux/vmalloc.h>
#include <linux/hyperv.h>
#include <linux/version.h>
#include <asm/hyperv.h>
#include "hyperv_vmbus.h"
@@ -164,9 +165,11 @@ int hv_init(void)
max_leaf = query_hypervisor_info();
/* Write our OS info */
wrmsrl(HV_X64_MSR_GUEST_OS_ID, HV_LINUX_GUEST_ID);
hv_context.guestid = HV_LINUX_GUEST_ID;
/*
* Write our OS ID.
*/
hv_context.guestid = generate_guest_id(0, LINUX_VERSION_CODE, 0);
wrmsrl(HV_X64_MSR_GUEST_OS_ID, hv_context.guestid);
/* See if the hypercall page is already set */
rdmsrl(HV_X64_MSR_HYPERCALL, hypercall_msr.as_uint64);