xen-acpi-processor.c 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565
  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->dpcnt = 0;
  90. set_xen_guest_handle(dst_cx->dp, NULL);
  91. }
  92. if (!ok) {
  93. pr_debug(DRV_NAME "No _Cx for ACPI CPU %u\n", _pr->acpi_id);
  94. kfree(dst_cx_states);
  95. return -EINVAL;
  96. }
  97. op.u.set_pminfo.power.count = ok;
  98. op.u.set_pminfo.power.flags.bm_control = _pr->flags.bm_control;
  99. op.u.set_pminfo.power.flags.bm_check = _pr->flags.bm_check;
  100. op.u.set_pminfo.power.flags.has_cst = _pr->flags.has_cst;
  101. op.u.set_pminfo.power.flags.power_setup_done =
  102. _pr->flags.power_setup_done;
  103. set_xen_guest_handle(op.u.set_pminfo.power.states, dst_cx_states);
  104. if (!no_hypercall)
  105. ret = HYPERVISOR_dom0_op(&op);
  106. if (!ret) {
  107. pr_debug("ACPI CPU%u - C-states uploaded.\n", _pr->acpi_id);
  108. for (i = 1; i <= _pr->power.count; i++) {
  109. cx = &_pr->power.states[i];
  110. if (!cx->valid)
  111. continue;
  112. pr_debug(" C%d: %s %d uS\n",
  113. cx->type, cx->desc, (u32)cx->latency);
  114. }
  115. } else if (ret != -EINVAL)
  116. /* EINVAL means the ACPI ID is incorrect - meaning the ACPI
  117. * table is referencing a non-existing CPU - which can happen
  118. * with broken ACPI tables. */
  119. pr_err(DRV_NAME "(CX): Hypervisor error (%d) for ACPI CPU%u\n",
  120. ret, _pr->acpi_id);
  121. kfree(dst_cx_states);
  122. return ret;
  123. }
  124. static struct xen_processor_px *
  125. xen_copy_pss_data(struct acpi_processor *_pr,
  126. struct xen_processor_performance *dst_perf)
  127. {
  128. struct xen_processor_px *dst_states = NULL;
  129. unsigned int i;
  130. BUILD_BUG_ON(sizeof(struct xen_processor_px) !=
  131. sizeof(struct acpi_processor_px));
  132. dst_states = kcalloc(_pr->performance->state_count,
  133. sizeof(struct xen_processor_px), GFP_KERNEL);
  134. if (!dst_states)
  135. return ERR_PTR(-ENOMEM);
  136. dst_perf->state_count = _pr->performance->state_count;
  137. for (i = 0; i < _pr->performance->state_count; i++) {
  138. /* Fortunatly for us, they are both the same size */
  139. memcpy(&(dst_states[i]), &(_pr->performance->states[i]),
  140. sizeof(struct acpi_processor_px));
  141. }
  142. return dst_states;
  143. }
  144. static int xen_copy_psd_data(struct acpi_processor *_pr,
  145. struct xen_processor_performance *dst)
  146. {
  147. struct acpi_psd_package *pdomain;
  148. BUILD_BUG_ON(sizeof(struct xen_psd_package) !=
  149. sizeof(struct acpi_psd_package));
  150. /* This information is enumerated only if acpi_processor_preregister_performance
  151. * has been called.
  152. */
  153. dst->shared_type = _pr->performance->shared_type;
  154. pdomain = &(_pr->performance->domain_info);
  155. /* 'acpi_processor_preregister_performance' does not parse if the
  156. * num_processors <= 1, but Xen still requires it. Do it manually here.
  157. */
  158. if (pdomain->num_processors <= 1) {
  159. if (pdomain->coord_type == DOMAIN_COORD_TYPE_SW_ALL)
  160. dst->shared_type = CPUFREQ_SHARED_TYPE_ALL;
  161. else if (pdomain->coord_type == DOMAIN_COORD_TYPE_HW_ALL)
  162. dst->shared_type = CPUFREQ_SHARED_TYPE_HW;
  163. else if (pdomain->coord_type == DOMAIN_COORD_TYPE_SW_ANY)
  164. dst->shared_type = CPUFREQ_SHARED_TYPE_ANY;
  165. }
  166. memcpy(&(dst->domain_info), pdomain, sizeof(struct acpi_psd_package));
  167. return 0;
  168. }
  169. static int xen_copy_pct_data(struct acpi_pct_register *pct,
  170. struct xen_pct_register *dst_pct)
  171. {
  172. /* It would be nice if you could just do 'memcpy(pct, dst_pct') but
  173. * sadly the Xen structure did not have the proper padding so the
  174. * descriptor field takes two (dst_pct) bytes instead of one (pct).
  175. */
  176. dst_pct->descriptor = pct->descriptor;
  177. dst_pct->length = pct->length;
  178. dst_pct->space_id = pct->space_id;
  179. dst_pct->bit_width = pct->bit_width;
  180. dst_pct->bit_offset = pct->bit_offset;
  181. dst_pct->reserved = pct->reserved;
  182. dst_pct->address = pct->address;
  183. return 0;
  184. }
  185. static int push_pxx_to_hypervisor(struct acpi_processor *_pr)
  186. {
  187. int ret = 0;
  188. struct xen_platform_op op = {
  189. .cmd = XENPF_set_processor_pminfo,
  190. .interface_version = XENPF_INTERFACE_VERSION,
  191. .u.set_pminfo.id = _pr->acpi_id,
  192. .u.set_pminfo.type = XEN_PM_PX,
  193. };
  194. struct xen_processor_performance *dst_perf;
  195. struct xen_processor_px *dst_states = NULL;
  196. dst_perf = &op.u.set_pminfo.perf;
  197. dst_perf->platform_limit = _pr->performance_platform_limit;
  198. dst_perf->flags |= XEN_PX_PPC;
  199. xen_copy_pct_data(&(_pr->performance->control_register),
  200. &dst_perf->control_register);
  201. xen_copy_pct_data(&(_pr->performance->status_register),
  202. &dst_perf->status_register);
  203. dst_perf->flags |= XEN_PX_PCT;
  204. dst_states = xen_copy_pss_data(_pr, dst_perf);
  205. if (!IS_ERR_OR_NULL(dst_states)) {
  206. set_xen_guest_handle(dst_perf->states, dst_states);
  207. dst_perf->flags |= XEN_PX_PSS;
  208. }
  209. if (!xen_copy_psd_data(_pr, dst_perf))
  210. dst_perf->flags |= XEN_PX_PSD;
  211. if (dst_perf->flags != (XEN_PX_PSD | XEN_PX_PSS | XEN_PX_PCT | XEN_PX_PPC)) {
  212. pr_warn(DRV_NAME "ACPI CPU%u missing some P-state data (%x), skipping.\n",
  213. _pr->acpi_id, dst_perf->flags);
  214. ret = -ENODEV;
  215. goto err_free;
  216. }
  217. if (!no_hypercall)
  218. ret = HYPERVISOR_dom0_op(&op);
  219. if (!ret) {
  220. struct acpi_processor_performance *perf;
  221. unsigned int i;
  222. perf = _pr->performance;
  223. pr_debug("ACPI CPU%u - P-states uploaded.\n", _pr->acpi_id);
  224. for (i = 0; i < perf->state_count; i++) {
  225. pr_debug(" %cP%d: %d MHz, %d mW, %d uS\n",
  226. (i == perf->state ? '*' : ' '), i,
  227. (u32) perf->states[i].core_frequency,
  228. (u32) perf->states[i].power,
  229. (u32) perf->states[i].transition_latency);
  230. }
  231. } else if (ret != -EINVAL)
  232. /* EINVAL means the ACPI ID is incorrect - meaning the ACPI
  233. * table is referencing a non-existing CPU - which can happen
  234. * with broken ACPI tables. */
  235. pr_warn(DRV_NAME "(_PXX): Hypervisor error (%d) for ACPI CPU%u\n",
  236. ret, _pr->acpi_id);
  237. err_free:
  238. if (!IS_ERR_OR_NULL(dst_states))
  239. kfree(dst_states);
  240. return ret;
  241. }
  242. static int upload_pm_data(struct acpi_processor *_pr)
  243. {
  244. int err = 0;
  245. mutex_lock(&acpi_ids_mutex);
  246. if (__test_and_set_bit(_pr->acpi_id, acpi_ids_done)) {
  247. mutex_unlock(&acpi_ids_mutex);
  248. return -EBUSY;
  249. }
  250. if (_pr->flags.power)
  251. err = push_cxx_to_hypervisor(_pr);
  252. if (_pr->performance && _pr->performance->states)
  253. err |= push_pxx_to_hypervisor(_pr);
  254. mutex_unlock(&acpi_ids_mutex);
  255. return err;
  256. }
  257. static unsigned int __init get_max_acpi_id(void)
  258. {
  259. struct xenpf_pcpuinfo *info;
  260. struct xen_platform_op op = {
  261. .cmd = XENPF_get_cpuinfo,
  262. .interface_version = XENPF_INTERFACE_VERSION,
  263. };
  264. int ret = 0;
  265. unsigned int i, last_cpu, max_acpi_id = 0;
  266. info = &op.u.pcpu_info;
  267. info->xen_cpuid = 0;
  268. ret = HYPERVISOR_dom0_op(&op);
  269. if (ret)
  270. return NR_CPUS;
  271. /* The max_present is the same irregardless of the xen_cpuid */
  272. last_cpu = op.u.pcpu_info.max_present;
  273. for (i = 0; i <= last_cpu; i++) {
  274. info->xen_cpuid = i;
  275. ret = HYPERVISOR_dom0_op(&op);
  276. if (ret)
  277. continue;
  278. max_acpi_id = max(info->acpi_id, max_acpi_id);
  279. }
  280. max_acpi_id *= 2; /* Slack for CPU hotplug support. */
  281. pr_debug(DRV_NAME "Max ACPI ID: %u\n", max_acpi_id);
  282. return max_acpi_id;
  283. }
  284. /*
  285. * The read_acpi_id and check_acpi_ids are there to support the Xen
  286. * oddity of virtual CPUs != physical CPUs in the initial domain.
  287. * The user can supply 'xen_max_vcpus=X' on the Xen hypervisor line
  288. * which will band the amount of CPUs the initial domain can see.
  289. * In general that is OK, except it plays havoc with any of the
  290. * for_each_[present|online]_cpu macros which are banded to the virtual
  291. * CPU amount.
  292. */
  293. static acpi_status __init
  294. read_acpi_id(acpi_handle handle, u32 lvl, void *context, void **rv)
  295. {
  296. u32 acpi_id;
  297. acpi_status status;
  298. acpi_object_type acpi_type;
  299. unsigned long long tmp;
  300. union acpi_object object = { 0 };
  301. struct acpi_buffer buffer = { sizeof(union acpi_object), &object };
  302. acpi_io_address pblk = 0;
  303. status = acpi_get_type(handle, &acpi_type);
  304. if (ACPI_FAILURE(status))
  305. return AE_OK;
  306. switch (acpi_type) {
  307. case ACPI_TYPE_PROCESSOR:
  308. status = acpi_evaluate_object(handle, NULL, NULL, &buffer);
  309. if (ACPI_FAILURE(status))
  310. return AE_OK;
  311. acpi_id = object.processor.proc_id;
  312. pblk = object.processor.pblk_address;
  313. break;
  314. case ACPI_TYPE_DEVICE:
  315. status = acpi_evaluate_integer(handle, "_UID", NULL, &tmp);
  316. if (ACPI_FAILURE(status))
  317. return AE_OK;
  318. acpi_id = tmp;
  319. break;
  320. default:
  321. return AE_OK;
  322. }
  323. /* There are more ACPI Processor objects than in x2APIC or MADT.
  324. * This can happen with incorrect ACPI SSDT declerations. */
  325. if (acpi_id > nr_acpi_bits) {
  326. pr_debug(DRV_NAME "We only have %u, trying to set %u\n",
  327. nr_acpi_bits, acpi_id);
  328. return AE_OK;
  329. }
  330. /* OK, There is a ACPI Processor object */
  331. __set_bit(acpi_id, acpi_id_present);
  332. pr_debug(DRV_NAME "ACPI CPU%u w/ PBLK:0x%lx\n", acpi_id,
  333. (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 __init check_acpi_ids(struct acpi_processor *pr_backup)
  344. {
  345. if (!pr_backup)
  346. return -ENODEV;
  347. /* All online CPUs have been processed at this stage. Now verify
  348. * whether in fact "online CPUs" == physical CPUs.
  349. */
  350. acpi_id_present = kcalloc(BITS_TO_LONGS(nr_acpi_bits), sizeof(unsigned long), GFP_KERNEL);
  351. if (!acpi_id_present)
  352. return -ENOMEM;
  353. acpi_id_cst_present = kcalloc(BITS_TO_LONGS(nr_acpi_bits), sizeof(unsigned long), GFP_KERNEL);
  354. if (!acpi_id_cst_present) {
  355. kfree(acpi_id_present);
  356. return -ENOMEM;
  357. }
  358. acpi_walk_namespace(ACPI_TYPE_PROCESSOR, ACPI_ROOT_OBJECT,
  359. ACPI_UINT32_MAX,
  360. read_acpi_id, NULL, NULL, NULL);
  361. acpi_get_devices("ACPI0007", read_acpi_id, NULL, NULL);
  362. if (!bitmap_equal(acpi_id_present, acpi_ids_done, nr_acpi_bits)) {
  363. unsigned int i;
  364. for_each_set_bit(i, acpi_id_present, nr_acpi_bits) {
  365. pr_backup->acpi_id = i;
  366. /* Mask out C-states if there are no _CST or PBLK */
  367. pr_backup->flags.power = test_bit(i, acpi_id_cst_present);
  368. (void)upload_pm_data(pr_backup);
  369. }
  370. }
  371. kfree(acpi_id_present);
  372. acpi_id_present = NULL;
  373. kfree(acpi_id_cst_present);
  374. acpi_id_cst_present = NULL;
  375. return 0;
  376. }
  377. static int __init check_prereq(void)
  378. {
  379. struct cpuinfo_x86 *c = &cpu_data(0);
  380. if (!xen_initial_domain())
  381. return -ENODEV;
  382. if (!acpi_gbl_FADT.smi_command)
  383. return -ENODEV;
  384. if (c->x86_vendor == X86_VENDOR_INTEL) {
  385. if (!cpu_has(c, X86_FEATURE_EST))
  386. return -ENODEV;
  387. return 0;
  388. }
  389. if (c->x86_vendor == X86_VENDOR_AMD) {
  390. /* Copied from powernow-k8.h, can't include ../cpufreq/powernow
  391. * as we get compile warnings for the static functions.
  392. */
  393. #define CPUID_FREQ_VOLT_CAPABILITIES 0x80000007
  394. #define USE_HW_PSTATE 0x00000080
  395. u32 eax, ebx, ecx, edx;
  396. cpuid(CPUID_FREQ_VOLT_CAPABILITIES, &eax, &ebx, &ecx, &edx);
  397. if ((edx & USE_HW_PSTATE) != USE_HW_PSTATE)
  398. return -ENODEV;
  399. return 0;
  400. }
  401. return -ENODEV;
  402. }
  403. /* acpi_perf_data is a pointer to percpu data. */
  404. static struct acpi_processor_performance __percpu *acpi_perf_data;
  405. static void free_acpi_perf_data(void)
  406. {
  407. unsigned int i;
  408. /* Freeing a NULL pointer is OK, and alloc_percpu zeroes. */
  409. for_each_possible_cpu(i)
  410. free_cpumask_var(per_cpu_ptr(acpi_perf_data, i)
  411. ->shared_cpu_map);
  412. free_percpu(acpi_perf_data);
  413. }
  414. static int __init xen_acpi_processor_init(void)
  415. {
  416. struct acpi_processor *pr_backup = NULL;
  417. unsigned int i;
  418. int rc = check_prereq();
  419. if (rc)
  420. return rc;
  421. nr_acpi_bits = get_max_acpi_id() + 1;
  422. acpi_ids_done = kcalloc(BITS_TO_LONGS(nr_acpi_bits), sizeof(unsigned long), GFP_KERNEL);
  423. if (!acpi_ids_done)
  424. return -ENOMEM;
  425. acpi_perf_data = alloc_percpu(struct acpi_processor_performance);
  426. if (!acpi_perf_data) {
  427. pr_debug(DRV_NAME "Memory allocation error for acpi_perf_data.\n");
  428. kfree(acpi_ids_done);
  429. return -ENOMEM;
  430. }
  431. for_each_possible_cpu(i) {
  432. if (!zalloc_cpumask_var_node(
  433. &per_cpu_ptr(acpi_perf_data, i)->shared_cpu_map,
  434. GFP_KERNEL, cpu_to_node(i))) {
  435. rc = -ENOMEM;
  436. goto err_out;
  437. }
  438. }
  439. /* Do initialization in ACPI core. It is OK to fail here. */
  440. (void)acpi_processor_preregister_performance(acpi_perf_data);
  441. for_each_possible_cpu(i) {
  442. struct acpi_processor_performance *perf;
  443. perf = per_cpu_ptr(acpi_perf_data, i);
  444. rc = acpi_processor_register_performance(perf, i);
  445. if (rc)
  446. goto err_out;
  447. }
  448. rc = acpi_processor_notify_smm(THIS_MODULE);
  449. if (rc)
  450. goto err_unregister;
  451. for_each_possible_cpu(i) {
  452. struct acpi_processor *_pr;
  453. _pr = per_cpu(processors, i /* APIC ID */);
  454. if (!_pr)
  455. continue;
  456. if (!pr_backup) {
  457. pr_backup = kzalloc(sizeof(struct acpi_processor), GFP_KERNEL);
  458. memcpy(pr_backup, _pr, sizeof(struct acpi_processor));
  459. }
  460. (void)upload_pm_data(_pr);
  461. }
  462. rc = check_acpi_ids(pr_backup);
  463. if (rc)
  464. goto err_unregister;
  465. kfree(pr_backup);
  466. return 0;
  467. err_unregister:
  468. for_each_possible_cpu(i) {
  469. struct acpi_processor_performance *perf;
  470. perf = per_cpu_ptr(acpi_perf_data, i);
  471. acpi_processor_unregister_performance(perf, i);
  472. }
  473. err_out:
  474. /* Freeing a NULL pointer is OK: alloc_percpu zeroes. */
  475. free_acpi_perf_data();
  476. kfree(acpi_ids_done);
  477. return rc;
  478. }
  479. static void __exit xen_acpi_processor_exit(void)
  480. {
  481. int i;
  482. kfree(acpi_ids_done);
  483. for_each_possible_cpu(i) {
  484. struct acpi_processor_performance *perf;
  485. perf = per_cpu_ptr(acpi_perf_data, i);
  486. acpi_processor_unregister_performance(perf, i);
  487. }
  488. free_acpi_perf_data();
  489. }
  490. MODULE_AUTHOR("Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>");
  491. MODULE_DESCRIPTION("Xen ACPI Processor P-states (and Cx) driver which uploads PM data to Xen hypervisor");
  492. MODULE_LICENSE("GPL");
  493. /* We want to be loaded before the CPU freq scaling drivers are loaded.
  494. * They are loaded in late_initcall. */
  495. device_initcall(xen_acpi_processor_init);
  496. module_exit(xen_acpi_processor_exit);