qubes-linux-kernel/patches.xen/xen-cpufreq-report

58 lines
2.0 KiB
Plaintext
Raw Normal View History

From: jbeulich@novell.com
Subject: make /proc/cpuinfo track CPU speed
Patch-mainline: obsolete
2011-04-19 20:09:59 +00:00
--- head-2010-10-05.orig/arch/x86/kernel/acpi/processor_extcntl_xen.c 2010-10-06 17:02:47.000000000 +0200
+++ head-2010-10-05/arch/x86/kernel/acpi/processor_extcntl_xen.c 2010-10-06 17:04:43.000000000 +0200
@@ -208,3 +208,14 @@ static int __init init_extcntl(
return 0;
}
2011-04-19 20:09:59 +00:00
arch_initcall(init_extcntl);
+
+unsigned int cpufreq_quick_get(unsigned int cpu)
+{
+ xen_platform_op_t op = {
+ .cmd = XENPF_get_cpu_freq,
+ .interface_version = XENPF_INTERFACE_VERSION,
+ .u.get_cpu_freq.vcpu = cpu
+ };
+
+ return HYPERVISOR_platform_op(&op) == 0 ? op.u.get_cpu_freq.freq : 0;
+}
2011-04-19 20:09:59 +00:00
--- head-2010-10-05.orig/include/linux/cpufreq.h 2010-10-06 16:54:08.000000000 +0200
+++ head-2010-10-05/include/linux/cpufreq.h 2010-08-25 14:41:45.000000000 +0200
@@ -328,7 +328,7 @@ static inline unsigned int cpufreq_get(u
#endif
/* query the last known CPU freq (in kHz). If zero, cpufreq couldn't detect it */
-#ifdef CONFIG_CPU_FREQ
+#if defined(CONFIG_CPU_FREQ) || defined(CONFIG_PROCESSOR_EXTERNAL_CONTROL)
unsigned int cpufreq_quick_get(unsigned int cpu);
#else
static inline unsigned int cpufreq_quick_get(unsigned int cpu)
2011-04-19 20:09:59 +00:00
--- head-2010-10-05.orig/include/xen/interface/platform.h 2010-01-04 11:56:34.000000000 +0100
+++ head-2010-10-05/include/xen/interface/platform.h 2010-06-22 15:48:58.000000000 +0200
@@ -355,6 +355,14 @@ struct xenpf_mem_hotadd
uint32_t flags;
};
+#define XENPF_get_cpu_freq ('N' << 24)
+struct xenpf_get_cpu_freq {
+ /* IN variables */
+ uint32_t vcpu;
+ /* OUT variables */
+ uint32_t freq; /* in kHz */
+};
+
struct xen_platform_op {
uint32_t cmd;
uint32_t interface_version; /* XENPF_INTERFACE_VERSION */
@@ -374,6 +382,7 @@ struct xen_platform_op {
struct xenpf_cpu_ol cpu_ol;
struct xenpf_cpu_hotadd cpu_add;
struct xenpf_mem_hotadd mem_add;
+ struct xenpf_get_cpu_freq get_cpu_freq;
uint8_t pad[128];
} u;
};