From: Dylanger Daly <dylanger@thegrail.co> To: xen-devel@lists.xenproject.org Cc: Dylanger Daly <dylanger@thegrail.co>, Andrew Cooper <andrew.cooper3@citrix.com>, Jan Beulich <jbeulich@suse.com>, xen-devel@lists.xen.org Subject: [PATCH] Add Undervolt MSRs to wrmsr function. Date: Thu, 18 Apr 2019 09:56:34 +0100 [thread overview] Message-ID: <20190418085634.3629-1-dylanger@thegrail.co> (raw) 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
WARNING: multiple messages have this Message-ID (diff)
From: Dylanger Daly <dylanger@thegrail.co> To: xen-devel@lists.xenproject.org Cc: Dylanger Daly <dylanger@thegrail.co>, Andrew Cooper <andrew.cooper3@citrix.com>, Jan Beulich <jbeulich@suse.com>, xen-devel@lists.xen.org Subject: [Xen-devel] [PATCH] Add Undervolt MSRs to wrmsr function. Date: Thu, 18 Apr 2019 09:56:34 +0100 [thread overview] Message-ID: <20190418085634.3629-1-dylanger@thegrail.co> (raw) Message-ID: <20190418085634.6K38_qhlHmjQf77CPWrPtxQDAaffi3H92fE0QsxyfHM@z> (raw) 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
next reply other threads:[~2019-04-18 8:56 UTC|newest] Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top 2019-04-18 8:56 Dylanger Daly [this message] 2019-04-18 8:56 ` [Xen-devel] [PATCH] Add Undervolt MSRs to wrmsr function 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
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20190418085634.3629-1-dylanger@thegrail.co \ --to=dylanger@thegrail.co \ --cc=andrew.cooper3@citrix.com \ --cc=jbeulich@suse.com \ --cc=xen-devel@lists.xen.org \ --cc=xen-devel@lists.xenproject.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
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.