xen-acpi-processor.c 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566
  1. /*
  2. * Copyright 2012 by Oracle Inc
  3. * Author: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
  4. *
  5. * This code borrows ideas from https://lkml.org/lkml/2011/11/30/249
  6. * so many thanks go to Kevin Tian <kevin.tian@intel.com>
  7. * and Yu Ke <ke.yu@intel.com>.
  8. *
  9. * This program is free software; you can redistribute it and/or modify it
  10. * under the terms and conditions of the GNU General Public License,
  11. * version 2, as published by the Free Software Foundation.
  12. *
  13. * This program is distributed in the hope it will be useful, but WITHOUT
  14. * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  15. * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
  16. * more details.
  17. *
  18. */
  19. #include <linux/cpumask.h>
  20. #include <linux/cpufreq.h>
  21. #include <linux/freezer.h>
  22. #include <linux/kernel.h>
  23. #include <linux/kthread.h>
  24. #include <linux/init.h>
  25. #include <linux/module.h>
  26. #include <linux/types.h>
  27. #include <acpi/acpi_bus.h>
  28. #include <acpi/acpi_drivers.h>
  29. #include <acpi/processor.h>
  30. #include <xen/interface/platform.h>
  31. #include <asm/xen/hypercall.h>
  32. #define DRV_NAME "xen-acpi-processor: "
  33. static int no_hypercall;
  34. MODULE_PARM_DESC(off, "Inhibit the hypercall.");
  35. module_param_named(off, no_hypercall, int, 0400);
  36. /*
  37. * Note: Do not convert the acpi_id* below to cpumask_var_t or use cpumask_bit
  38. * - as those shrink to nr_cpu_bits (which is dependent on possible_cpu), which
  39. * can be less than what we want to put in. Instead use the 'nr_acpi_bits'
  40. * which is dynamically computed based on the MADT or x2APIC table.
  41. */
  42. static unsigned int nr_acpi_bits;
  43. /* Mutex to protect the acpi_ids_done - for CPU hotplug use. */
  44. static DEFINE_MUTEX(acpi_ids_mutex);
  45. /* Which ACPI ID we have processed from 'struct acpi_processor'. */
  46. static unsigned long *acpi_ids_done;
  47. /* Which ACPI ID exist in the SSDT/DSDT processor definitions. */
  48. static unsigned long __initdata *acpi_id_present;
  49. /* And if there is an _CST definition (or a PBLK) for the ACPI IDs */
  50. static unsigned long __initdata *acpi_id_cst_present;
  51. static int push_cxx_to_hypervisor(struct acpi_processor *_pr)
  52. {
  53. struct xen_platform_op op = {
  54. .cmd = XENPF_set_processor_pminfo,
  55. .interface_version = XENPF_INTERFACE_VERSION,
  56. .u.set_pminfo.id = _pr->acpi_id,
  57. .u.set_pminfo.type = XEN_PM_CX,
  58. };
  59. struct xen_processor_cx *dst_cx, *dst_cx_states = NULL;
  60. struct acpi_processor_cx *cx;
  61. unsigned int i, ok;
  62. int ret = 0;
  63. dst_cx_states = kcalloc(_pr->power.count,
  64. sizeof(struct xen_processor_cx), GFP_KERNEL);
  65. if (!dst_cx_states)
  66. return -ENOMEM;
  67. for (ok = 0, i = 1; i <= _pr->power.count; i++) {
  68. cx = &_pr->power.states[i];
  69. if (!cx->valid)
  70. continue;
  71. dst_cx = &(dst_cx_states[ok++]);
  72. dst_cx->reg.space_id = ACPI_ADR_SPACE_SYSTEM_IO;
  73. if (cx->entry_method == ACPI_CSTATE_SYSTEMIO) {
  74. dst_cx->reg.bit_width = 8;
  75. dst_cx->reg.bit_offset = 0;
  76. dst_cx->reg.access_size = 1;
  77. } else {
  78. dst_cx->reg.space_id = ACPI_ADR_SPACE_FIXED_HARDWARE;
  79. if (cx->entry_method == ACPI_CSTATE_FFH) {
  80. /* NATIVE_CSTATE_BEYOND_HALT */
  81. dst_cx->reg.bit_offset = 2;
  82. dst_cx->reg.bit_width = 1; /* VENDOR_INTEL */
  83. }
  84. dst_cx->reg.access_size = 0;
  85. }
  86. dst_cx->reg.address = cx->address;
  87. dst_cx->type = cx->type;
  88. dst_cx->latency = cx->latency;
  89. dst_cx->power = cx->power;
  90. dst_cx->dpcnt = 0;
  91. set_xen_guest_handle(dst_cx->dp, NULL);
  92. }
  93. if (!ok) {
  94. pr_debug(DRV_NAME "No _Cx for ACPI CPU %u\n", _pr->acpi_id);
  95. kfree(dst_cx_states);
  96. return -EINVAL;
  97. }
  98. op.u.set_pminfo.power.count = ok;
  99. op.u.set_pminfo.power.flags.bm_control = _pr->flags.bm_control;
  100. op.u.set_pminfo.power.flags.bm_check = _pr->flags.bm_check;
  101. op.u.set_pminfo.power.flags.has_cst = _pr->flags.has_cst;
  102. op.u.set_pminfo.power.flags.power_setup_done =
  103. _pr->flags.power_setup_done;
  104. set_xen_guest_handle(op.u.set_pminfo.power.states, dst_cx_states);
  105. if (!no_hypercall)
  106. ret = HYPERVISOR_dom0_op(&op);
  107. if (!ret) {
  108. pr_debug("ACPI CPU%u - C-states uploaded.\n", _pr->acpi_id);
  109. for (i = 1; i <= _pr->power.count; i++) {
  110. cx = &_pr->power.states[i];
  111. if (!cx->valid)
  112. continue;
  113. pr_debug(" C%d: %s %d uS\n",
  114. cx->type, cx->desc, (u32)cx->latency);
  115. }
  116. } else if (ret != -EINVAL)
  117. /* EINVAL means the ACPI ID is incorrect - meaning the ACPI
  118. * table is referencing a non-existing CPU - which can happen
  119. * with broken ACPI tables. */
  120. pr_err(DRV_NAME "(CX): Hypervisor error (%d) for ACPI CPU%u\n",
  121. ret, _pr->acpi_id);
  122. kfree(dst_cx_states);
  123. return ret;
  124. }
  125. static struct xen_processor_px *
  126. xen_copy_pss_data(struct acpi_processor *_pr,
  127. struct xen_processor_performance *dst_perf)
  128. {
  129. struct xen_processor_px *dst_states = NULL;
  130. unsigned int i;
  131. BUILD_BUG_ON(sizeof(struct xen_processor_px) !=
  132. sizeof(struct acpi_processor_px));
  133. dst_states = kcalloc(_pr->performance->state_count,
  134. sizeof(struct xen_processor_px), GFP_KERNEL);
  135. if (!dst_states)
  136. return ERR_PTR(-ENOMEM);
  137. dst_perf->state_count = _pr->performance->state_count;
  138. for (i = 0; i < _pr->performance->state_count; i++) {
  139. /* Fortunatly for us, they are both the same size */
  140. memcpy(&(dst_states[i]), &(_pr->performance->states[i]),
  141. sizeof(struct acpi_processor_px));
  142. }
  143. return dst_states;
  144. }
  145. static int xen_copy_psd_data(struct acpi_processor *_pr,
  146. struct xen_processor_performance *dst)
  147. {
  148. struct acpi_psd_package *pdomain;
  149. BUILD_BUG_ON(sizeof(struct xen_psd_package) !=
  150. sizeof(struct acpi_psd_package));
  151. /* This information is enumerated only if acpi_processor_preregister_performance
  152. * has been called.
  153. */
  154. dst->shared_type = _pr->performance->shared_type;
  155. pdomain = &(_pr->performance->domain_info);
  156. /* 'acpi_processor_preregister_performance' does not parse if the
  157. * num_processors <= 1, but Xen still requires it. Do it manually here.
  158. */
  159. if (pdomain->num_processors <= 1) {
  160. if (pdomain->coord_type == DOMAIN_COORD_TYPE_SW_ALL)
  161. dst->shared_type = CPUFREQ_SHARED_TYPE_ALL;
  162. else if (pdomain->coord_type == DOMAIN_COORD_TYPE_HW_ALL)
  163. dst->shared_type = CPUFREQ_SHARED_TYPE_HW;
  164. else if (pdomain->coord_type == DOMAIN_COORD_TYPE_SW_ANY)
  165. dst->shared_type = CPUFREQ_SHARED_TYPE_ANY;
  166. }
  167. memcpy(&(dst->domain_info), pdomain, sizeof(struct acpi_psd_package));
  168. return 0;
  169. }
  170. static int xen_copy_pct_data(struct acpi_pct_register *pct,
  171. struct xen_pct_register *dst_pct)
  172. {
  173. /* It would be nice if you could just do 'memcpy(pct, dst_pct') but
  174. * sadly the Xen structure did not have the proper padding so the
  175. * descriptor field takes two (dst_pct) bytes instead of one (pct).
  176. */
  177. dst_pct->descriptor = pct->descriptor;
  178. dst_pct->length = pct->length;
  179. dst_pct->space_id = pct->space_id;
  180. dst_pct->bit_width = pct->bit_width;
  181. dst_pct->bit_offset = pct->bit_offset;
  182. dst_pct->reserved = pct->reserved;
  183. dst_pct->address = pct->address;
  184. return 0;
  185. }
  186. static int push_pxx_to_hypervisor(struct acpi_processor *_pr)
  187. {
  188. int ret = 0;
  189. struct xen_platform_op op = {
  190. .cmd = XENPF_set_processor_pminfo,
  191. .interface_version = XENPF_INTERFACE_VERSION,
  192. .u.set_pminfo.id = _pr->acpi_id,
  193. .u.set_pminfo.type = XEN_PM_PX,
  194. };
  195. struct xen_processor_performance *dst_perf;
  196. struct xen_processor_px *dst_states = NULL;
  197. dst_perf = &op.u.set_pminfo.perf;
  198. dst_perf->platform_limit = _pr->performance_platform_limit;
  199. dst_perf->flags |= XEN_PX_PPC;
  200. xen_copy_pct_data(&(_pr->performance->control_register),
  201. &dst_perf->control_register);
  202. xen_copy_pct_data(&(_pr->performance->status_register),
  203. &dst_perf->status_register);
  204. dst_perf->flags |= XEN_PX_PCT;
  205. dst_states = xen_copy_pss_data(_pr, dst_perf);
  206. if (!IS_ERR_OR_NULL(dst_states)) {
  207. set_xen_guest_handle(dst_perf->states, dst_states);
  208. dst_perf->flags |= XEN_PX_PSS;
  209. }
  210. if (!xen_copy_psd_data(_pr, dst_perf))
  211. dst_perf->flags |= XEN_PX_PSD;
  212. if (dst_perf->flags != (XEN_PX_PSD | XEN_PX_PSS | XEN_PX_PCT | XEN_PX_PPC)) {
  213. pr_warn(DRV_NAME "ACPI CPU%u missing some P-state data (%x), skipping.\n",
  214. _pr->acpi_id, dst_perf->flags);
  215. ret = -ENODEV;
  216. goto err_free;
  217. }
  218. if (!no_hypercall)
  219. ret = HYPERVISOR_dom0_op(&op);
  220. if (!ret) {
  221. struct acpi_processor_performance *perf;
  222. unsigned int i;
  223. perf = _pr->performance;
  224. pr_debug("ACPI CPU%u - P-states uploaded.\n", _pr->acpi_id);
  225. for (i = 0; i < perf->state_count; i++) {
  226. pr_debug(" %cP%d: %d MHz, %d mW, %d uS\n",
  227. (i == perf->state ? '*' : ' '), i,
  228. (u32) perf->states[i].core_frequency,
  229. (u32) perf->states[i].power,
  230. (u32) perf->states[i].transition_latency);
  231. }
  232. } else if (ret != -EINVAL)
  233. /* EINVAL means the ACPI ID is incorrect - meaning the ACPI
  234. * table is referencing a non-existing CPU - which can happen
  235. * with broken ACPI tables. */
  236. pr_warn(DRV_NAME "(_PXX): Hypervisor error (%d) for ACPI CPU%u\n",
  237. ret, _pr->acpi_id);
  238. err_free:
  239. if (!IS_ERR_OR_NULL(dst_states))
  240. kfree(dst_states);
  241. return ret;
  242. }
  243. static int upload_pm_data(struct acpi_processor *_pr)
  244. {
  245. int err = 0;
  246. mutex_lock(&acpi_ids_mutex);
  247. if (__test_and_set_bit(_pr->acpi_id, acpi_ids_done)) {
  248. mutex_unlock(&acpi_ids_mutex);
  249. return -EBUSY;
  250. }
  251. if (_pr->flags.power)
  252. err = push_cxx_to_hypervisor(_pr);
  253. if (_pr->performance && _pr->performance->states)
  254. err |= push_pxx_to_hypervisor(_pr);
  255. mutex_unlock(&acpi_ids_mutex);
  256. return err;
  257. }
  258. static unsigned int __init get_max_acpi_id(void)
  259. {
  260. struct xenpf_pcpuinfo *info;
  261. struct xen_platform_op op = {
  262. .cmd = XENPF_get_cpuinfo,
  263. .interface_version = XENPF_INTERFACE_VERSION,
  264. };
  265. int ret = 0;
  266. unsigned int i, last_cpu, max_acpi_id = 0;
  267. info = &op.u.pcpu_info;
  268. info->xen_cpuid = 0;
  269. ret = HYPERVISOR_dom0_op(&op);
  270. if (ret)
  271. return NR_CPUS;
  272. /* The max_present is the same irregardless of the xen_cpuid */
  273. last_cpu = op.u.pcpu_info.max_present;
  274. for (i = 0; i <= last_cpu; i++) {
  275. info->xen_cpuid = i;
  276. ret = HYPERVISOR_dom0_op(&op);
  277. if (ret)
  278. continue;
  279. max_acpi_id = max(info->acpi_id, max_acpi_id);
  280. }
  281. max_acpi_id *= 2; /* Slack for CPU hotplug support. */
  282. pr_debug(DRV_NAME "Max ACPI ID: %u\n", max_acpi_id);
  283. return max_acpi_id;
  284. }
  285. /*
  286. * The read_acpi_id and check_acpi_ids are there to support the Xen
  287. * oddity of virtual CPUs != physical CPUs in the initial domain.
  288. * The user can supply 'xen_max_vcpus=X' on the Xen hypervisor line
  289. * which will band the amount of CPUs the initial domain can see.
  290. * In general that is OK, except it plays havoc with any of the
  291. * for_each_[present|online]_cpu macros which are banded to the virtual
  292. * CPU amount.
  293. */
  294. static acpi_status __init
  295. read_acpi_id(acpi_handle handle, u32 lvl, void *context, void **rv)
  296. {
  297. u32 acpi_id;
  298. acpi_status status;
  299. acpi_object_type acpi_type;
  300. unsigned long long tmp;
  301. union acpi_object object = { 0 };
  302. struct acpi_buffer buffer = { sizeof(union acpi_object), &object };
  303. acpi_io_address pblk = 0;
  304. status = acpi_get_type(handle, &acpi_type);
  305. if (ACPI_FAILURE(status))
  306. return AE_OK;
  307. switch (acpi_type) {
  308. case ACPI_TYPE_PROCESSOR:
  309. status = acpi_evaluate_object(handle, NULL, NULL, &buffer);
  310. if (ACPI_FAILURE(status))
  311. return AE_OK;
  312. acpi_id = object.processor.proc_id;
  313. pblk = object.processor.pblk_address;
  314. break;
  315. case ACPI_TYPE_DEVICE:
  316. status = acpi_evaluate_integer(handle, "_UID", NULL, &tmp);
  317. if (ACPI_FAILURE(status))
  318. return AE_OK;
  319. acpi_id = tmp;
  320. break;
  321. default:
  322. return AE_OK;
  323. }
  324. /* There are more ACPI Processor objects than in x2APIC or MADT.
  325. * This can happen with incorrect ACPI SSDT declerations. */
  326. if (acpi_id > nr_acpi_bits) {
  327. pr_debug(DRV_NAME "We only have %u, trying to set %u\n",
  328. nr_acpi_bits, acpi_id);
  329. return AE_OK;
  330. }
  331. /* OK, There is a ACPI Processor object */
  332. __set_bit(acpi_id, acpi_id_present);
  333. pr_debug(DRV_NAME "ACPI CPU%u w/ PBLK:0x%lx\n", acpi_id,
  334. (unsigned long)pblk);
  335. status = acpi_evaluate_object(handle, "_CST", NULL, &buffer);
  336. if (ACPI_FAILURE(status)) {
  337. if (!pblk)
  338. return AE_OK;
  339. }
  340. /* .. and it has a C-state */
  341. __set_bit(acpi_id, acpi_id_cst_present);
  342. return AE_OK;
  343. }
  344. static int __init check_acpi_ids(struct acpi_processor *pr_backup)
  345. {
  346. if (!pr_backup)
  347. return -ENODEV;
  348. /* All online CPUs have been processed at this stage. Now verify
  349. * whether in fact "online CPUs" == physical CPUs.
  350. */
  351. acpi_id_present = kcalloc(BITS_TO_LONGS(nr_acpi_bits), sizeof(unsigned long), GFP_KERNEL);
  352. if (!acpi_id_present)
  353. return -ENOMEM;
  354. acpi_id_cst_present = kcalloc(BITS_TO_LONGS(nr_acpi_bits), sizeof(unsigned long), GFP_KERNEL);
  355. if (!acpi_id_cst_present) {
  356. kfree(acpi_id_present);
  357. return -ENOMEM;
  358. }
  359. acpi_walk_namespace(ACPI_TYPE_PROCESSOR, ACPI_ROOT_OBJECT,
  360. ACPI_UINT32_MAX,
  361. read_acpi_id, NULL, NULL, NULL);
  362. acpi_get_devices("ACPI0007", read_acpi_id, NULL, NULL);
  363. if (!bitmap_equal(acpi_id_present, acpi_ids_done, nr_acpi_bits)) {
  364. unsigned int i;
  365. for_each_set_bit(i, acpi_id_present, nr_acpi_bits) {
  366. pr_backup->acpi_id = i;
  367. /* Mask out C-states if there are no _CST or PBLK */
  368. pr_backup->flags.power = test_bit(i, acpi_id_cst_present);
  369. (void)upload_pm_data(pr_backup);
  370. }
  371. }
  372. kfree(acpi_id_present);
  373. acpi_id_present = NULL;
  374. kfree(acpi_id_cst_present);
  375. acpi_id_cst_present = NULL;
  376. return 0;
  377. }
  378. static int __init check_prereq(void)
  379. {
  380. struct cpuinfo_x86 *c = &cpu_data(0);
  381. if (!xen_initial_domain())
  382. return -ENODEV;
  383. if (!acpi_gbl_FADT.smi_command)
  384. return -ENODEV;
  385. if (c->x86_vendor == X86_VENDOR_INTEL) {
  386. if (!cpu_has(c, X86_FEATURE_EST))
  387. return -ENODEV;
  388. return 0;
  389. }
  390. if (c->x86_vendor == X86_VENDOR_AMD) {
  391. /* Copied from powernow-k8.h, can't include ../cpufreq/powernow
  392. * as we get compile warnings for the static functions.
  393. */
  394. #define CPUID_FREQ_VOLT_CAPABILITIES 0x80000007
  395. #define USE_HW_PSTATE 0x00000080
  396. u32 eax, ebx, ecx, edx;
  397. cpuid(CPUID_FREQ_VOLT_CAPABILITIES, &eax, &ebx, &ecx, &edx);
  398. if ((edx & USE_HW_PSTATE) != USE_HW_PSTATE)
  399. return -ENODEV;
  400. return 0;
  401. }
  402. return -ENODEV;
  403. }
  404. /* acpi_perf_data is a pointer to percpu data. */
  405. static struct acpi_processor_performance __percpu *acpi_perf_data;
  406. static void free_acpi_perf_data(void)
  407. {
  408. unsigned int i;
  409. /* Freeing a NULL pointer is OK, and alloc_percpu zeroes. */
  410. for_each_possible_cpu(i)
  411. free_cpumask_var(per_cpu_ptr(acpi_perf_data, i)
  412. ->shared_cpu_map);
  413. free_percpu(acpi_perf_data);
  414. }
  415. static int __init xen_acpi_processor_init(void)
  416. {
  417. struct acpi_processor *pr_backup = NULL;
  418. unsigned int i;
  419. int rc = check_prereq();
  420. if (rc)
  421. return rc;
  422. nr_acpi_bits = get_max_acpi_id() + 1;
  423. acpi_ids_done = kcalloc(BITS_TO_LONGS(nr_acpi_bits), sizeof(unsigned long), GFP_KERNEL);
  424. if (!acpi_ids_done)
  425. return -ENOMEM;
  426. acpi_perf_data = alloc_percpu(struct acpi_processor_performance);
  427. if (!acpi_perf_data) {
  428. pr_debug(DRV_NAME "Memory allocation error for acpi_perf_data.\n");
  429. kfree(acpi_ids_done);
  430. return -ENOMEM;
  431. }
  432. for_each_possible_cpu(i) {
  433. if (!zalloc_cpumask_var_node(
  434. &per_cpu_ptr(acpi_perf_data, i)->shared_cpu_map,
  435. GFP_KERNEL, cpu_to_node(i))) {
  436. rc = -ENOMEM;
  437. goto err_out;
  438. }
  439. }
  440. /* Do initialization in ACPI core. It is OK to fail here. */
  441. (void)acpi_processor_preregister_performance(acpi_perf_data);
  442. for_each_possible_cpu(i) {
  443. struct acpi_processor_performance *perf;
  444. perf = per_cpu_ptr(acpi_perf_data, i);
  445. rc = acpi_processor_register_performance(perf, i);
  446. if (rc)
  447. goto err_out;
  448. }
  449. rc = acpi_processor_notify_smm(THIS_MODULE);
  450. if (rc)
  451. goto err_unregister;
  452. for_each_possible_cpu(i) {
  453. struct acpi_processor *_pr;
  454. _pr = per_cpu(processors, i /* APIC ID */);
  455. if (!_pr)
  456. continue;
  457. if (!pr_backup) {
  458. pr_backup = kzalloc(sizeof(struct acpi_processor), GFP_KERNEL);
  459. memcpy(pr_backup, _pr, sizeof(struct acpi_processor));
  460. }
  461. (void)upload_pm_data(_pr);
  462. }
  463. rc = check_acpi_ids(pr_backup);
  464. if (rc)
  465. goto err_unregister;
  466. kfree(pr_backup);
  467. return 0;
  468. err_unregister:
  469. for_each_possible_cpu(i) {
  470. struct acpi_processor_performance *perf;
  471. perf = per_cpu_ptr(acpi_perf_data, i);
  472. acpi_processor_unregister_performance(perf, i);
  473. }
  474. err_out:
  475. /* Freeing a NULL pointer is OK: alloc_percpu zeroes. */
  476. free_acpi_perf_data();
  477. kfree(acpi_ids_done);
  478. return rc;
  479. }
  480. static void __exit xen_acpi_processor_exit(void)
  481. {
  482. int i;
  483. kfree(acpi_ids_done);
  484. for_each_possible_cpu(i) {
  485. struct acpi_processor_performance *perf;
  486. perf = per_cpu_ptr(acpi_perf_data, i);
  487. acpi_processor_unregister_performance(perf, i);
  488. }
  489. free_acpi_perf_data();
  490. }
  491. MODULE_AUTHOR("Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>");
  492. MODULE_DESCRIPTION("Xen ACPI Processor P-states (and Cx) driver which uploads PM data to Xen hypervisor");
  493. MODULE_LICENSE("GPL");
  494. /* We want to be loaded before the CPU freq scaling drivers are loaded.
  495. * They are loaded in late_initcall. */
  496. device_initcall(xen_acpi_processor_init);
  497. module_exit(xen_acpi_processor_exit);