All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Add Undervolt MSRs to wrmsr function.
@ 2019-04-18  8:56 ` Dylanger Daly
  0 siblings, 0 replies; 10+ messages in thread
From: Dylanger Daly @ 2019-04-18  8:56 UTC (permalink / raw)
  To: xen-devel; +Cc: Dylanger Daly, Andrew Cooper, Jan Beulich, xen-devel

Giving Laptop Users the ability to Undervolt and change Temp Throttle Limits.

Signed-off-by: Dylanger Daly <dylanger@thegrail.co>
---
 xen/arch/x86/traps.c            | 8 ++++++++
 xen/include/asm-x86/msr-index.h | 2 ++
 2 files changed, 10 insertions(+)

diff --git a/xen/arch/x86/traps.c b/xen/arch/x86/traps.c
index 1a22895907..475a2a5720 100644
--- a/xen/arch/x86/traps.c
+++ b/xen/arch/x86/traps.c
@@ -2684,6 +2684,14 @@ static int priv_op_write_msr(unsigned int reg, uint64_t val,
             goto invalid;
         return X86EMUL_OKAY;
 
+    case MSR_IA32_VOLTAGE_OFFSET:
+    case MSR_IA32_TEMP_CONTROL:
+        if ( boot_cpu_data.x86_vendor != X86_VENDOR_INTEL )
+            break;
+        if ( wrmsr_safe(reg, val) == 0 )
+            return X86EMUL_OKAY;
+        break;
+
     case MSR_IA32_MISC_ENABLE:
         if ( rdmsr_safe(reg, temp) )
             break;
diff --git a/xen/include/asm-x86/msr-index.h b/xen/include/asm-x86/msr-index.h
index 7bb382f456..75dad3fe43 100644
--- a/xen/include/asm-x86/msr-index.h
+++ b/xen/include/asm-x86/msr-index.h
@@ -346,6 +346,8 @@
 #define MSR_IA32_THERM_INTERRUPT	0x0000019b
 #define MSR_IA32_THERM_STATUS		0x0000019c
 #define MSR_IA32_MISC_ENABLE		0x000001a0
+#define MSR_IA32_VOLTAGE_OFFSET		0x00000150
+#define MSR_IA32_TEMP_CONTROL		0x000001a2
 #define MSR_IA32_MISC_ENABLE_PERF_AVAIL   (1<<7)
 #define MSR_IA32_MISC_ENABLE_BTS_UNAVAIL  (1<<11)
 #define MSR_IA32_MISC_ENABLE_PEBS_UNAVAIL (1<<12)
-- 
2.20.1


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2019-04-18 11:54 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-04-18  8:56 [PATCH] Add Undervolt MSRs to wrmsr function Dylanger Daly
2019-04-18  8:56 ` [Xen-devel] " Dylanger Daly
2019-04-18  9:09 ` Andrew Cooper
2019-04-18  9:09   ` [Xen-devel] " Andrew Cooper
2019-04-18  9:19   ` Dylanger Daly
2019-04-18  9:19     ` [Xen-devel] " Dylanger Daly
2019-04-18 11:12     ` Andrew Cooper
2019-04-18 11:12       ` [Xen-devel] " Andrew Cooper
2019-04-18 11:54       ` Dylanger Daly
2019-04-18 11:54         ` [Xen-devel] " Dylanger Daly

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.