summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsephe <sephe@FreeBSD.org>2016-05-25 06:01:47 +0000
committersephe <sephe@FreeBSD.org>2016-05-25 06:01:47 +0000
commitde35596831c863c295b43b621442ee9cf64d63de (patch)
tree42783a2c9986a0777e138c1cc3a0c1c4e4a93e5d
parent65ac34ef0ae4a02394a592705ddfc6127c339f72 (diff)
downloadFreeBSD-src-de35596831c863c295b43b621442ee9cf64d63de.zip
FreeBSD-src-de35596831c863c295b43b621442ee9cf64d63de.tar.gz
hyperv: Preserve required bits when disable Hypercall
MFC after: 1 week Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D6530
-rw-r--r--sys/dev/hyperv/vmbus/hv_hv.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/sys/dev/hyperv/vmbus/hv_hv.c b/sys/dev/hyperv/vmbus/hv_hv.c
index 289b577..c499f18 100644
--- a/sys/dev/hyperv/vmbus/hv_hv.c
+++ b/sys/dev/hyperv/vmbus/hv_hv.c
@@ -390,11 +390,14 @@ SYSINIT(hypercall_ctor, SI_SUB_DRIVERS, SI_ORDER_FIRST, hypercall_create, NULL);
static void
hypercall_destroy(void *arg __unused)
{
+ uint64_t hc;
+
if (hypercall_context.hc_addr == NULL)
return;
/* Disable Hypercall */
- wrmsr(MSR_HV_HYPERCALL, 0);
+ hc = rdmsr(MSR_HV_HYPERCALL);
+ wrmsr(MSR_HV_HYPERCALL, (hc & MSR_HV_HYPERCALL_RSVD_MASK));
hypercall_memfree();
if (bootverbose)
OpenPOWER on IntegriCloud