xen-acpi-processor.c 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582
  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. #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
  20. #include <linux/cpumask.h>
  21. #include <linux/cpufreq.h>
  22. #include <linux/freezer.h>
  23. #include <linux/kernel.h>
  24. #include <linux/kthread.h>
  25. #include <linux/init.h>
  26. #include <linux/module.h>
  27. #include <linux/types.h>
  28. #include <linux/syscore_ops.h>
  29. #include <linux/acpi.h>
  30. #include <acpi/processor.h>
  31. #include <xen/xen.h>
  32. #include <xen/interface/platform.h>
  33. #include <asm/xen/hypercall.h>
  34. static int no_hypercall;
  35. MODULE_PARM_DESC(off, "Inhibit the hypercall.");
  36. module_param_named(off, no_hypercall, int, 0400);
  37. /*
  38. * Note: Do not convert the acpi_id* below to cpumask_var_t or use cpumask_bit
  39. * - as those shrink to nr_cpu_bits (which is dependent on possible_cpu), which
  40. * can be less than what we want to put in. Instead use the 'nr_acpi_bits'
  41. * which is dynamically computed based on the MADT or x2APIC table.
  42. */
  43. static unsigned int nr_acpi_bits;
  44. /* Mutex to protect the acpi_ids_done - for CPU hotplug use. */
  45. static DEFINE_MUTEX(acpi_ids_mutex);
  46. /* Which ACPI ID we have processed from 'struct acpi_processor'. */
  47. static unsigned long *acpi_ids_done;
  48. /* Which ACPI ID exist in the SSDT/DSDT processor definitions. */
  49. static unsigned long *acpi_id_present;
  50. /* And if there is an _CST definition (or a PBLK) for the ACPI IDs */
  51. static unsigned long *acpi_id_cst_present;
  52. static int push_cxx_to_hypervisor(struct acpi_processor *_pr)
  53. {
  54. struct xen_platform_op op = {
  55. .cmd = XENPF_set_processor_pminfo,
  56. .interface_version = XENPF_INTERFACE_VERSION,
  57. .u.set_pminfo.id = _pr->acpi_id,
  58. .u.set_pminfo.type = XEN_PM_CX,
  59. };
  60. struct xen_processor_cx *dst_cx, *dst_cx_states = NULL;
  61. struct acpi_processor_cx *cx;
  62. unsigned int i, ok;
  63. int ret = 0;
  64. dst_cx_states = kcalloc(_pr->power.count,
  65. sizeof(struct xen_processor_cx), GFP_KERNEL);
  66. if (!dst_cx_states)
  67. return -ENOMEM;
  68. for (ok = 0, i = 1; i <= _pr->power.count; i++) {
  69. cx = &_pr->power.states[i];
  70. if (!cx->valid)
  71. continue;
  72. dst_cx = &(dst_cx_states[ok++]);
  73. dst_cx->reg.space_id = ACPI_ADR_SPACE_SYSTEM_IO;
  74. if (cx->entry_method == ACPI_CSTATE_SYSTEMIO) {
  75. dst_cx->reg.bit_width = 8;
  76. dst_cx->reg.bit_offset = 0;
  77. dst_cx->reg.access_size = 1;
  78. } else {
  79. dst_cx->reg.space_id = ACPI_ADR_SPACE_FIXED_HARDWARE;
  80. if (cx->entry_method == ACPI_CSTATE_FFH) {
  81. /* NATIVE_CSTATE_BEYOND_HALT */
  82. dst_cx->reg.bit_offset = 2;
  83. dst_cx->reg.bit_width = 1; /* VENDOR_INTEL */
  84. }
  85. dst_cx->reg.access_size = 0;
  86. }
  87. dst_cx->reg.address = cx->address;
  88. dst_cx->type = cx->type;
  89. dst_cx->latency = cx->latency;
  90. dst_cx->dpcnt = 0;
  91. set_xen_guest_handle(dst_cx->dp, NULL);
  92. }
  93. if (!ok) {
  94. pr_debug("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) && (ret != -ENOSYS))
  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("(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("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) && (ret != -ENOSYS))
  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("(_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("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
  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("max acpi id %u, trying to set %u\n",
  328. nr_acpi_bits - 1, 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("ACPI CPU%u w/ PBLK:0x%lx\n", acpi_id, (unsigned long)pblk);
  334. status = acpi_evaluate_object(handle, "_CST", NULL, &buffer);
  335. if (ACPI_FAILURE(status)) {
  336. if (!pblk)
  337. return AE_OK;
  338. }
  339. /* .. and it has a C-state */
  340. __set_bit(acpi_id, acpi_id_cst_present);
  341. return AE_OK;
  342. }
  343. static int check_acpi_ids(struct acpi_processor *pr_backup)
  344. {
  345. if (!pr_backup)
  346. return -ENODEV;
  347. if (acpi_id_present && acpi_id_cst_present)
  348. /* OK, done this once .. skip to uploading */
  349. goto upload;
  350. /* All online CPUs have been processed at this stage. Now verify
  351. * whether in fact "online CPUs" == physical CPUs.
  352. */
  353. acpi_id_present = kcalloc(BITS_TO_LONGS(nr_acpi_bits), sizeof(unsigned long), GFP_KERNEL);
  354. if (!acpi_id_present)
  355. return -ENOMEM;
  356. acpi_id_cst_present = kcalloc(BITS_TO_LONGS(nr_acpi_bits), sizeof(unsigned long), GFP_KERNEL);
  357. if (!acpi_id_cst_present) {
  358. kfree(acpi_id_present);
  359. return -ENOMEM;
  360. }
  361. acpi_walk_namespace(ACPI_TYPE_PROCESSOR, ACPI_ROOT_OBJECT,
  362. ACPI_UINT32_MAX,
  363. read_acpi_id, NULL, NULL, NULL);
  364. acpi_get_devices("ACPI0007", read_acpi_id, NULL, NULL);
  365. upload:
  366. if (!bitmap_equal(acpi_id_present, acpi_ids_done, nr_acpi_bits)) {
  367. unsigned int i;
  368. for_each_set_bit(i, acpi_id_present, nr_acpi_bits) {
  369. pr_backup->acpi_id = i;
  370. /* Mask out C-states if there are no _CST or PBLK */
  371. pr_backup->flags.power = test_bit(i, acpi_id_cst_present);
  372. (void)upload_pm_data(pr_backup);
  373. }
  374. }
  375. return 0;
  376. }
  377. /* acpi_perf_data is a pointer to percpu data. */
  378. static struct acpi_processor_performance __percpu *acpi_perf_data;
  379. static void free_acpi_perf_data(void)
  380. {
  381. unsigned int i;
  382. /* Freeing a NULL pointer is OK, and alloc_percpu zeroes. */
  383. for_each_possible_cpu(i)
  384. free_cpumask_var(per_cpu_ptr(acpi_perf_data, i)
  385. ->shared_cpu_map);
  386. free_percpu(acpi_perf_data);
  387. }
  388. static int xen_upload_processor_pm_data(void)
  389. {
  390. struct acpi_processor *pr_backup = NULL;
  391. unsigned int i;
  392. int rc = 0;
  393. pr_info("Uploading Xen processor PM info\n");
  394. for_each_possible_cpu(i) {
  395. struct acpi_processor *_pr;
  396. _pr = per_cpu(processors, i /* APIC ID */);
  397. if (!_pr)
  398. continue;
  399. if (!pr_backup) {
  400. pr_backup = kzalloc(sizeof(struct acpi_processor), GFP_KERNEL);
  401. if (pr_backup)
  402. memcpy(pr_backup, _pr, sizeof(struct acpi_processor));
  403. }
  404. (void)upload_pm_data(_pr);
  405. }
  406. rc = check_acpi_ids(pr_backup);
  407. kfree(pr_backup);
  408. return rc;
  409. }
  410. static void xen_acpi_processor_resume_worker(struct work_struct *dummy)
  411. {
  412. int rc;
  413. bitmap_zero(acpi_ids_done, nr_acpi_bits);
  414. rc = xen_upload_processor_pm_data();
  415. if (rc != 0)
  416. pr_info("ACPI data upload failed, error = %d\n", rc);
  417. }
  418. static void xen_acpi_processor_resume(void)
  419. {
  420. static DECLARE_WORK(wq, xen_acpi_processor_resume_worker);
  421. /*
  422. * xen_upload_processor_pm_data() calls non-atomic code.
  423. * However, the context for xen_acpi_processor_resume is syscore
  424. * with only the boot CPU online and in an atomic context.
  425. *
  426. * So defer the upload for some point safer.
  427. */
  428. schedule_work(&wq);
  429. }
  430. static struct syscore_ops xap_syscore_ops = {
  431. .resume = xen_acpi_processor_resume,
  432. };
  433. static int __init xen_acpi_processor_init(void)
  434. {
  435. unsigned int i;
  436. int rc;
  437. if (!xen_initial_domain())
  438. return -ENODEV;
  439. nr_acpi_bits = get_max_acpi_id() + 1;
  440. acpi_ids_done = kcalloc(BITS_TO_LONGS(nr_acpi_bits), sizeof(unsigned long), GFP_KERNEL);
  441. if (!acpi_ids_done)
  442. return -ENOMEM;
  443. acpi_perf_data = alloc_percpu(struct acpi_processor_performance);
  444. if (!acpi_perf_data) {
  445. pr_debug("Memory allocation error for acpi_perf_data\n");
  446. kfree(acpi_ids_done);
  447. return -ENOMEM;
  448. }
  449. for_each_possible_cpu(i) {
  450. if (!zalloc_cpumask_var_node(
  451. &per_cpu_ptr(acpi_perf_data, i)->shared_cpu_map,
  452. GFP_KERNEL, cpu_to_node(i))) {
  453. rc = -ENOMEM;
  454. goto err_out;
  455. }
  456. }
  457. /* Do initialization in ACPI core. It is OK to fail here. */
  458. (void)acpi_processor_preregister_performance(acpi_perf_data);
  459. for_each_possible_cpu(i) {
  460. struct acpi_processor *pr;
  461. struct acpi_processor_performance *perf;
  462. pr = per_cpu(processors, i);
  463. perf = per_cpu_ptr(acpi_perf_data, i);
  464. if (!pr)
  465. continue;
  466. pr->performance = perf;
  467. rc = acpi_processor_get_performance_info(pr);
  468. if (rc)
  469. goto err_out;
  470. }
  471. rc = xen_upload_processor_pm_data();
  472. if (rc)
  473. goto err_unregister;
  474. register_syscore_ops(&xap_syscore_ops);
  475. return 0;
  476. err_unregister:
  477. for_each_possible_cpu(i)
  478. acpi_processor_unregister_performance(i);
  479. err_out:
  480. /* Freeing a NULL pointer is OK: alloc_percpu zeroes. */
  481. free_acpi_perf_data();
  482. kfree(acpi_ids_done);
  483. return rc;
  484. }
  485. static void __exit xen_acpi_processor_exit(void)
  486. {
  487. int i;
  488. unregister_syscore_ops(&xap_syscore_ops);
  489. kfree(acpi_ids_done);
  490. kfree(acpi_id_present);
  491. kfree(acpi_id_cst_present);
  492. for_each_possible_cpu(i)
  493. acpi_processor_unregister_performance(i);
  494. free_acpi_perf_data();
  495. }
  496. MODULE_AUTHOR("Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>");
  497. MODULE_DESCRIPTION("Xen ACPI Processor P-states (and Cx) driver which uploads PM data to Xen hypervisor");
  498. MODULE_LICENSE("GPL");
  499. /* We want to be loaded before the CPU freq scaling drivers are loaded.
  500. * They are loaded in late_initcall. */
  501. device_initcall(xen_acpi_processor_init);
  502. module_exit(xen_acpi_processor_exit);