Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F81970370
D5909.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D5909.diff
View Options
Index: sys/dev/hyperv/vmbus/hv_hv.c
===================================================================
--- sys/dev/hyperv/vmbus/hv_hv.c
+++ sys/dev/hyperv/vmbus/hv_hv.c
@@ -36,6 +36,7 @@
#include <sys/kernel.h>
#include <sys/malloc.h>
#include <sys/pcpu.h>
+#include <sys/proc.h>
#include <sys/timetc.h>
#include <machine/bus.h>
#include <machine/md_var.h>
@@ -77,6 +78,12 @@
return (now);
}
+static void
+hv_idle_hook(sbintime_t sbt)
+{
+ rdmsr(HV_X64_MSR_GUEST_IDLE);
+}
+
/**
* @brief Invoke the specified hypercall
*/
@@ -172,7 +179,7 @@
hv_vmbus_g_context.hypercall_page = virt_addr;
hv_et_init();
-
+
return (0);
cleanup:
@@ -510,6 +517,10 @@
/* Register virtual timecount */
tc_init(&hv_timecounter);
}
+
+ if (hyperv_features & HV_FEATURE_MSR_GUEST_IDLE) {
+ cpu_idle_hook = hv_idle_hook;
+ }
}
SYSINIT(hyperv_initialize, SI_SUB_HYPERVISOR, SI_ORDER_FIRST, hyperv_init,
NULL);
Index: sys/dev/hyperv/vmbus/hv_vmbus_priv.h
===================================================================
--- sys/dev/hyperv/vmbus/hv_vmbus_priv.h
+++ sys/dev/hyperv/vmbus/hv_vmbus_priv.h
@@ -619,6 +619,7 @@
#define HV_X64_MSR_SINT14 (0x4000009E)
#define HV_X64_MSR_SINT15 (0x4000009F)
+#define HV_X64_MSR_GUEST_IDLE (0x400000F0)
/*
* Synthetic Timer MSRs. Four timers per vcpu.
*/
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Dec 15, 5:35 PM (21 h, 53 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
9091818
Default Alt Text
D5909.diff (1 KB)
Attached To
Mode
D5909: hyperv/hv: use MSR to hint hypervisor on entering idle.
Attached
Detach File
Event Timeline
Log In to Comment