aboutsummaryrefslogtreecommitdiffstats
path: root/include/xen
diff options
context:
space:
mode:
authorLiu, Jinsong <jinsong.liu@intel.com>2012-11-08 00:41:13 -0500
committerKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>2012-11-26 15:07:19 -0500
commit92e3229dcdc80ff0b6304f14c578d76e7e10e226 (patch)
tree6c4a67d4b721b3eb6c2c2b07db2cd173313c9669 /include/xen
parentb3e40b72bb24237b0aee9f6ba2e9f88dd4ff3c0a (diff)
xen/acpi: ACPI PAD driver
PAD is acpi Processor Aggregator Device which provides a control point that enables the platform to perform specific processor configuration and control that applies to all processors in the platform. This patch is to implement Xen acpi pad logic. When running under Xen virt platform, native pad driver would not work. Instead Xen pad driver, a self-contained and thin logic level, would take over acpi pad logic. When acpi pad notify OSPM, xen pad logic intercept and parse _PUR object to get the expected idle cpu number, and then hypercall to hypervisor. Xen hypervisor would then do the rest work, say, core parking, to idle specific number of cpus on its own policy. Signed-off-by: Jan Beulich <JBeulich@suse.com> Signed-off-by: Liu Jinsong <jinsong.liu@intel.com> Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Diffstat (limited to 'include/xen')
-rw-r--r--include/xen/interface/platform.h17
-rw-r--r--include/xen/interface/version.h15
2 files changed, 32 insertions, 0 deletions
diff --git a/include/xen/interface/platform.h b/include/xen/interface/platform.h
index 4755b5fac9c7..5e36932ab407 100644
--- a/include/xen/interface/platform.h
+++ b/include/xen/interface/platform.h
@@ -324,6 +324,22 @@ struct xenpf_cpu_ol {
324}; 324};
325DEFINE_GUEST_HANDLE_STRUCT(xenpf_cpu_ol); 325DEFINE_GUEST_HANDLE_STRUCT(xenpf_cpu_ol);
326 326
327/*
328 * CMD 58 and 59 are reserved for cpu hotadd and memory hotadd,
329 * which are already occupied at Xen hypervisor side.
330 */
331#define XENPF_core_parking 60
332struct xenpf_core_parking {
333 /* IN variables */
334#define XEN_CORE_PARKING_SET 1
335#define XEN_CORE_PARKING_GET 2
336 uint32_t type;
337 /* IN variables: set cpu nums expected to be idled */
338 /* OUT variables: get cpu nums actually be idled */
339 uint32_t idle_nums;
340};
341DEFINE_GUEST_HANDLE_STRUCT(xenpf_core_parking);
342
327struct xen_platform_op { 343struct xen_platform_op {
328 uint32_t cmd; 344 uint32_t cmd;
329 uint32_t interface_version; /* XENPF_INTERFACE_VERSION */ 345 uint32_t interface_version; /* XENPF_INTERFACE_VERSION */
@@ -341,6 +357,7 @@ struct xen_platform_op {
341 struct xenpf_set_processor_pminfo set_pminfo; 357 struct xenpf_set_processor_pminfo set_pminfo;
342 struct xenpf_pcpuinfo pcpu_info; 358 struct xenpf_pcpuinfo pcpu_info;
343 struct xenpf_cpu_ol cpu_ol; 359 struct xenpf_cpu_ol cpu_ol;
360 struct xenpf_core_parking core_parking;
344 uint8_t pad[128]; 361 uint8_t pad[128];
345 } u; 362 } u;
346}; 363};
diff --git a/include/xen/interface/version.h b/include/xen/interface/version.h
index 7ff6498679a3..96d8d3deea6b 100644
--- a/include/xen/interface/version.h
+++ b/include/xen/interface/version.h
@@ -63,4 +63,19 @@ struct xen_feature_info {
63/* arg == xen_domain_handle_t. */ 63/* arg == xen_domain_handle_t. */
64#define XENVER_guest_handle 8 64#define XENVER_guest_handle 8
65 65
66/* Check if running on Xen version (major, minor) or later */
67static inline bool
68xen_running_on_version_or_later(unsigned int major, unsigned int minor)
69{
70 unsigned int version;
71
72 if (!xen_domain())
73 return false;
74
75 version = HYPERVISOR_xen_version(XENVER_version, NULL);
76 if ((((version >> 16) == major) && ((version & 0xffff) >= minor)) ||
77 ((version >> 16) > major))
78 return true;
79 return false;
80}
66#endif /* __XEN_PUBLIC_VERSION_H__ */ 81#endif /* __XEN_PUBLIC_VERSION_H__ */