Displaying 8 results from an estimated 8 matches for "cpufreq_cpu_policy".
2011 Oct 20
0
[PATCH 07/12] cpufreq: allocate CPU masks dynamically
...!=
@@ -181,11 +186,18 @@ int cpufreq_add_cpu(unsigned int cpu)
goto err0;
}
+ if (!zalloc_cpumask_var(&policy->cpus)) {
+ xfree(policy);
+ ret = -ENOMEM;
+ goto err0;
+ }
+
policy->cpu = cpu;
per_cpu(cpufreq_cpu_policy, cpu) = policy;
ret = cpufreq_driver->init(policy);
if (ret) {
+ free_cpumask_var(policy->cpus);
xfree(policy);
per_cpu(cpufreq_cpu_policy, cpu) = NULL;
goto err0;
@@ -193,7 +205,7 @@ int cpufreq_add_cpu(unsigned int cpu)...
2011 Oct 14
1
[PATCH] cpufreq: error path fixes
...-176,8 +176,10 @@ int cpufreq_add_cpu(unsigned int cpu)
if (!domexist || hw_all) {
policy = xzalloc(struct cpufreq_policy);
- if (!policy)
+ if (!policy) {
ret = -ENOMEM;
+ goto err0;
+ }
policy->cpu = cpu;
per_cpu(cpufreq_cpu_policy, cpu) = policy;
@@ -186,7 +188,7 @@ int cpufreq_add_cpu(unsigned int cpu)
if (ret) {
xfree(policy);
per_cpu(cpufreq_cpu_policy, cpu) = NULL;
- return ret;
+ goto err0;
}
if (cpufreq_verbose)
printk("CPU %u...
2008 Sep 19
8
[PATCH] x86: add hypercall to query current underlying pCPU''s frequency
...break;
+
+ case XENPF_get_cpu_freq:
+ if ( op->u.get_cpu_freq.vcpu >= MAX_VIRT_CPUS ||
+ !(v = current->domain->vcpu[op->u.get_cpu_freq.vcpu]) )
+ {
+ ret = -EINVAL;
+ break;
+ }
+
+ op->u.get_cpu_freq.freq = cpufreq_cpu_policy[v->processor] ?
+ cpufreq_cpu_policy[v->processor]->cur : 0;
+ if ( copy_field_to_guest(u_xenpf_op, op, u.get_cpu_freq.freq) )
+ ret = -EFAULT;
+ break;
default:
ret = -ENOSYS;
Index: 2008-09-19/xen/arch/x86/x86_64/platform_hypercall.c
=...
2013 Jun 20
3
[PATCH V2 1/2] cpufreq, xenpm: fix cpufreq and xenpm mismatch
...diff --git a/xen/drivers/cpufreq/utility.c b/xen/drivers/cpufreq/utility.c
index 3dd70e2..519f862 100644
--- a/xen/drivers/cpufreq/utility.c
+++ b/xen/drivers/cpufreq/utility.c
@@ -428,7 +428,7 @@ int cpufreq_get_turbo_status(int cpuid)
struct cpufreq_policy *policy;
policy = per_cpu(cpufreq_cpu_policy, cpuid);
- return policy && policy->turbo;
+ return policy && policy->turbo == CPUFREQ_TURBO_ENABLED;
}
/*********************************************************************
--
1.7.9.5
2011 Nov 15
0
[PATCH] xen: avoid crash enabling turbo mode
...5e -r 3cfb8f2c4ce8 xen/drivers/cpufreq/utility.c
--- a/xen/drivers/cpufreq/utility.c Tue Oct 18 10:33:32 2011 +0100
+++ b/xen/drivers/cpufreq/utility.c Tue Nov 15 11:28:17 2011 +0000
@@ -396,7 +396,7 @@ void cpufreq_enable_turbo(int cpuid)
struct cpufreq_policy *policy;
policy = per_cpu(cpufreq_cpu_policy, cpuid);
- if (policy->turbo != CPUFREQ_TURBO_UNSUPPORTED)
+ if (policy && policy->turbo != CPUFREQ_TURBO_UNSUPPORTED)
policy->turbo = CPUFREQ_TURBO_ENABLED;
}
@@ -405,7 +405,7 @@ void cpufreq_disable_turbo(int cpuid)
struct cpufreq_policy *policy;
pol...
2010 Jul 06
0
[PATCH] x86/cpufreq: check array index before use
.../xen/arch/x86/acpi/cpufreq/cpufreq.c 2010-07-06 16:08:59.000000000 +0200
+++ 2010-06-15/xen/arch/x86/acpi/cpufreq/cpufreq.c 2010-07-06 16:11:48.000000000 +0200
@@ -210,9 +210,11 @@ static u32 get_cur_val(cpumask_t mask)
if (!cpu_isset(cpu, mask))
cpu = first_cpu(mask);
- policy = cpufreq_cpu_policy[cpu];
+ if (cpu >= NR_CPUS)
+ return 0;
- if (cpu >= NR_CPUS || !policy || !drv_data[policy->cpu])
+ policy = cpufreq_cpu_policy[cpu];
+ if (!policy || !drv_data[policy->cpu])
return 0;
switch (drv_data[policy->cpu]->cpu_feature) {
___...
2013 Jun 19
8
[PATCH 1/2] cpufreq, powernow: enable/disable core performance boost for all cpus in policy
Currently, enable/disable turbo mode on AMD is broken:
$ xenpm enable-turbo-mode 0 <-- works and proper CPU MSR bit is set
$ xenpm enable-turbo-mode 1 <-- silently broken, MSR bit not set
Since ->turbo is per policy, when user requests to enable/disable
turbo mode, we need to set the bit in all of the ->cpus that this
policy affects.
---
xen/arch/x86/acpi/cpufreq/powernow.c | 2
2008 Sep 17
5
c/s 18470
This changeset reverts two previous corrections, for reasons that escape
me.
First, the domain map is again being confined to NR_CPUS, which I had
submitted a patch to fix recently (yes, I realize the code has a TODO in
there, but those really get forgotten about far too often).
Second, the platform hypercall was reverted back to require all
information to be passed to Xen in one chunk, whereas