xen/x86-cpufreq-report.patch
Charles Arnold 287ca6da2e - Upstream patches from Jan
23725-pci-add-device.patch
  23762-iommu-fault-bm-off.patch
  23763-pci-multi-seg-x2apic-vtd-no-crash.patch
  23765-x86-irq-vector-leak.patch 
  23766-x86-msi-vf-bars.patch
  23771-x86-ioapic-clear-pin.patch
  23772-x86-trampoline.patch
  23774-x86_64-EFI-EDD.patch
  23776-x86-kexec-hpet-legacy-bcast-disable.patch
  23781-pm-wide-ACPI-ids.patch
  23782-x86-ioapic-clear-irr.patch
  23783-ACPI-set-_PDC-bits.patch

OBS-URL: https://build.opensuse.org/package/show/Virtualization/xen?expand=0&rev=140
2011-08-26 16:49:33 +00:00

70 lines
2.2 KiB
Diff

--- a/xen/arch/x86/platform_hypercall.c
+++ b/xen/arch/x86/platform_hypercall.c
@@ -23,7 +23,7 @@
#include <xen/cpu.h>
#include <asm/current.h>
#include <public/platform.h>
-#include <acpi/cpufreq/processor_perf.h>
+#include <acpi/cpufreq/cpufreq.h>
#include <asm/edd.h>
#include <asm/mtrr.h>
#include <asm/io_apic.h>
@@ -63,6 +63,7 @@ long cpu_down_helper(void *data);
ret_t do_platform_op(XEN_GUEST_HANDLE(xen_platform_op_t) u_xenpf_op)
{
ret_t ret = 0;
+ struct vcpu *v;
struct xen_platform_op curop, *op = &curop;
if ( !IS_PRIV(current->domain) )
@@ -522,6 +523,24 @@ ret_t do_platform_op(XEN_GUEST_HANDLE(xe
op->u.mem_add.epfn,
op->u.mem_add.pxm);
break;
+
+ case XENPF_get_cpu_freq:
+ if ( op->u.get_cpu_freq.vcpu >= current->domain->max_vcpus ||
+ !(v = current->domain->vcpu[op->u.get_cpu_freq.vcpu]) )
+ {
+ ret = -EINVAL;
+ break;
+ }
+
+ op->u.get_cpu_freq.freq = per_cpu(cpufreq_cpu_policy, v->processor)
+ ? cpufreq_driver->get
+ ? cpufreq_driver->get(v->processor)
+ : per_cpu(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;
break;
--- a/xen/include/public/platform.h
+++ b/xen/include/public/platform.h
@@ -451,6 +451,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 */
@@ -471,6 +479,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;
};