Subject: hv: set guest os id
From: <ohering@suse.de>
Patch-mainline: Never, this change carry until upstream provides better method <jeffm: awaiting feedback from ohering as to why this must be carried when other vendors do not, Oct 4, 2017>
References: bnc#814005
Give the host more detailed info about the running guest.
Provide the guest OS id.
A better change is pending.
Acked-by: Olaf Hering <ohering@suse.de>
---
arch/x86/hyperv/hv_init.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
--- a/arch/x86/hyperv/hv_init.c
+++ b/arch/x86/hyperv/hv_init.c
@@ -266,6 +266,8 @@ void __init hyperv_init(void)
u64 guest_id, required_msrs;
union hv_x64_msr_hypercall_contents hypercall_msr;
int cpuhp, i;
+ __u8 d1 = 0x10; /* SuSE */
+ __u16 d2 = 0x0; /* -d of a.b.c-d */
if (x86_hyper_type != X86_HYPER_MS_HYPERV)
return;
@@ -313,7 +315,7 @@ void __init hyperv_init(void)
* 1. Register the guest ID
* 2. Enable the hypercall and register the hypercall page
*/
- guest_id = generate_guest_id(0, LINUX_VERSION_CODE, 0);
+ guest_id = generate_guest_id(d1, LINUX_VERSION_CODE, d2);
wrmsrl(HV_X64_MSR_GUEST_OS_ID, guest_id);
hv_hypercall_pg = __vmalloc(PAGE_SIZE, GFP_KERNEL, PAGE_KERNEL_RX);