[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [PATCH RFC] x86: Limit MSR_IA32_THERM_CONTROL and MSR_IA32_ENERGY_PERF_BIAS



Those two allow the OS pinned dom0 to change the T-state
(throttling) behind the Xen cpufreq code.

The patch that introduced this: f78e2193b6409577314167ed9e077de7ac3e652f

    x86: Enable THERM_CONTROL_MSR write for dom0 even when cpufreq=xen

    Signed-off-by: Wei Gang <gang.wei@xxxxxxxxx>
    Signed-off-by: Keir Fraser <keir.fraser@xxxxxxxxxx>

is very lacking on details.

Anyhow this patch in effect reverts the above commit. It is also
lacking in details :-)

Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@xxxxxxxxxx>
---
 xen/arch/x86/traps.c | 10 +---------
 1 file changed, 1 insertion(+), 9 deletions(-)

diff --git a/xen/arch/x86/traps.c b/xen/arch/x86/traps.c
index e105b95..78395ef 100644
--- a/xen/arch/x86/traps.c
+++ b/xen/arch/x86/traps.c
@@ -2614,23 +2614,15 @@ static int emulate_privileged_op(struct cpu_user_regs 
*regs)
                 goto fail;
             break;
         case MSR_IA32_PERF_CTL:
-            if ( boot_cpu_data.x86_vendor != X86_VENDOR_INTEL )
-                goto fail;
-            if ( !is_cpufreq_controller(currd) )
-                break;
-            if ( wrmsr_safe(regs->ecx, msr_content) != 0 )
-                goto fail;
-            break;
         case MSR_IA32_THERM_CONTROL:
         case MSR_IA32_ENERGY_PERF_BIAS:
             if ( boot_cpu_data.x86_vendor != X86_VENDOR_INTEL )
                 goto fail;
-            if ( !is_hardware_domain(currd) || !is_pinned_vcpu(v) )
+            if ( !is_cpufreq_controller(currd) )
                 break;
             if ( wrmsr_safe(regs->ecx, msr_content) != 0 )
                 goto fail;
             break;
-
         case MSR_AMD64_DR0_ADDRESS_MASK:
             if ( !boot_cpu_has(X86_FEATURE_DBEXT) || (msr_content >> 32) )
                 goto fail;
-- 
2.1.0


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.