]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/blob - src/patches/60050_xen-cpufreq-report.patch1
Imported xen patches.
[people/pmueller/ipfire-2.x.git] / src / patches / 60050_xen-cpufreq-report.patch1
1 From: jbeulich@novell.com
2 Subject: make /proc/cpuinfo track CPU speed
3 Patch-mainline: obsolete
4
5 Index: head-2008-10-01/arch/x86/kernel/acpi/processor_extcntl_xen.c
6 ===================================================================
7 --- head-2008-10-01.orig/arch/x86/kernel/acpi/processor_extcntl_xen.c 2008-10-01 15:43:24.000000000 +0200
8 +++ head-2008-10-01/arch/x86/kernel/acpi/processor_extcntl_xen.c 2008-10-01 16:44:34.000000000 +0200
9 @@ -207,3 +207,14 @@ void arch_acpi_processor_init_extcntl(co
10 *ops = &xen_extcntl_ops;
11 }
12 EXPORT_SYMBOL(arch_acpi_processor_init_extcntl);
13 +
14 +unsigned int cpufreq_quick_get(unsigned int cpu)
15 +{
16 + xen_platform_op_t op = {
17 + .cmd = XENPF_get_cpu_freq,
18 + .interface_version = XENPF_INTERFACE_VERSION,
19 + .u.get_cpu_freq.vcpu = cpu
20 + };
21 +
22 + return HYPERVISOR_platform_op(&op) == 0 ? op.u.get_cpu_freq.freq : 0;
23 +}
24 Index: head-2008-10-01/include/linux/cpufreq.h
25 ===================================================================
26 --- head-2008-10-01.orig/include/linux/cpufreq.h 2008-10-01 14:44:59.000000000 +0200
27 +++ head-2008-10-01/include/linux/cpufreq.h 2008-10-01 16:44:34.000000000 +0200
28 @@ -282,7 +282,7 @@ int cpufreq_update_policy(unsigned int c
29 unsigned int cpufreq_get(unsigned int cpu);
30
31 /* query the last known CPU freq (in kHz). If zero, cpufreq couldn't detect it */
32 -#ifdef CONFIG_CPU_FREQ
33 +#if defined(CONFIG_CPU_FREQ) || defined(CONFIG_PROCESSOR_EXTERNAL_CONTROL)
34 unsigned int cpufreq_quick_get(unsigned int cpu);
35 #else
36 static inline unsigned int cpufreq_quick_get(unsigned int cpu)
37 Index: head-2008-10-01/include/xen/interface/platform.h
38 ===================================================================
39 --- head-2008-10-01.orig/include/xen/interface/platform.h 2008-09-25 13:55:33.000000000 +0200
40 +++ head-2008-10-01/include/xen/interface/platform.h 2008-10-01 16:44:34.000000000 +0200
41 @@ -312,6 +312,16 @@ struct xenpf_set_processor_pminfo {
42 typedef struct xenpf_set_processor_pminfo xenpf_set_processor_pminfo_t;
43 DEFINE_XEN_GUEST_HANDLE(xenpf_set_processor_pminfo_t);
44
45 +#define XENPF_get_cpu_freq ('N' << 24)
46 +struct xenpf_get_cpu_freq {
47 + /* IN variables */
48 + uint32_t vcpu;
49 + /* OUT variables */
50 + uint32_t freq; /* in kHz */
51 +};
52 +typedef struct xenpf_get_cpu_freq xenpf_get_cpu_freq_t;
53 +DEFINE_XEN_GUEST_HANDLE(xenpf_get_cpu_freq_t);
54 +
55 struct xen_platform_op {
56 uint32_t cmd;
57 uint32_t interface_version; /* XENPF_INTERFACE_VERSION */
58 @@ -327,6 +337,7 @@ struct xen_platform_op {
59 struct xenpf_change_freq change_freq;
60 struct xenpf_getidletime getidletime;
61 struct xenpf_set_processor_pminfo set_pminfo;
62 + struct xenpf_get_cpu_freq get_cpu_freq;
63 uint8_t pad[128];
64 } u;
65 };