You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
qubes-linux-kernel/patches.xen/xen-cpufreq-report

58 lines
2.1 KiB

From: jbeulich@novell.com
Subject: make /proc/cpuinfo track CPU speed
Patch-mainline: obsolete
--- head-2010-03-15.orig/arch/x86/kernel/acpi/processor_extcntl_xen.c 2010-03-16 10:37:21.000000000 +0100
+++ head-2010-03-15/arch/x86/kernel/acpi/processor_extcntl_xen.c 2010-03-16 10:42:20.000000000 +0100
@@ -206,3 +206,14 @@ void arch_acpi_processor_init_extcntl(co
*ops = &xen_extcntl_ops;
}
EXPORT_SYMBOL(arch_acpi_processor_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;
+}
--- head-2010-03-15.orig/include/linux/cpufreq.h 2010-03-16 10:34:57.000000000 +0100
+++ head-2010-03-15/include/linux/cpufreq.h 2010-01-25 13:46:23.000000000 +0100
@@ -303,7 +303,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)
--- head-2010-03-15.orig/include/xen/interface/platform.h 2010-01-04 11:56:34.000000000 +0100
+++ head-2010-03-15/include/xen/interface/platform.h 2010-01-25 13:46:23.000000000 +0100
@@ -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;
};