From 83ba0c4f3f317270dae5597d8044b795d119914c Mon Sep 17 00:00:00 2001 From: "K. Y. Srinivasan" Date: Tue, 24 Jul 2012 16:11:58 -0700 Subject: Drivers: hv: Cleanup the guest ID computation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Reviewed-by: Haiyang Zhang Cc: Bjørn Mork Cc: Paolo Bonzini Signed-off-by: Greg Kroah-Hartman --- drivers/hv/hv.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'drivers/hv/hv.c') diff --git a/drivers/hv/hv.c b/drivers/hv/hv.c index 86f8885aeb45..771e24f2981d 100644 --- a/drivers/hv/hv.c +++ b/drivers/hv/hv.c @@ -26,6 +26,7 @@ #include #include #include +#include #include #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); -- cgit v1.2.3