sysinfo.c 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585
  1. /*
  2. * Copyright IBM Corp. 2001, 2009
  3. * Author(s): Ulrich Weigand <Ulrich.Weigand@de.ibm.com>,
  4. * Martin Schwidefsky <schwidefsky@de.ibm.com>,
  5. */
  6. #include <linux/debugfs.h>
  7. #include <linux/kernel.h>
  8. #include <linux/mm.h>
  9. #include <linux/proc_fs.h>
  10. #include <linux/seq_file.h>
  11. #include <linux/init.h>
  12. #include <linux/delay.h>
  13. #include <linux/export.h>
  14. #include <linux/slab.h>
  15. #include <asm/ebcdic.h>
  16. #include <asm/debug.h>
  17. #include <asm/sysinfo.h>
  18. #include <asm/cpcmd.h>
  19. #include <asm/topology.h>
  20. #include <asm/fpu/api.h>
  21. int topology_max_mnest;
  22. static inline int __stsi(void *sysinfo, int fc, int sel1, int sel2, int *lvl)
  23. {
  24. register int r0 asm("0") = (fc << 28) | sel1;
  25. register int r1 asm("1") = sel2;
  26. int rc = 0;
  27. asm volatile(
  28. " stsi 0(%3)\n"
  29. "0: jz 2f\n"
  30. "1: lhi %1,%4\n"
  31. "2:\n"
  32. EX_TABLE(0b, 1b)
  33. : "+d" (r0), "+d" (rc)
  34. : "d" (r1), "a" (sysinfo), "K" (-EOPNOTSUPP)
  35. : "cc", "memory");
  36. *lvl = ((unsigned int) r0) >> 28;
  37. return rc;
  38. }
  39. /*
  40. * stsi - store system information
  41. *
  42. * Returns the current configuration level if function code 0 was specified.
  43. * Otherwise returns 0 on success or a negative value on error.
  44. */
  45. int stsi(void *sysinfo, int fc, int sel1, int sel2)
  46. {
  47. int lvl, rc;
  48. rc = __stsi(sysinfo, fc, sel1, sel2, &lvl);
  49. if (rc)
  50. return rc;
  51. return fc ? 0 : lvl;
  52. }
  53. EXPORT_SYMBOL(stsi);
  54. static bool convert_ext_name(unsigned char encoding, char *name, size_t len)
  55. {
  56. switch (encoding) {
  57. case 1: /* EBCDIC */
  58. EBCASC(name, len);
  59. break;
  60. case 2: /* UTF-8 */
  61. break;
  62. default:
  63. return false;
  64. }
  65. return true;
  66. }
  67. static void stsi_1_1_1(struct seq_file *m, struct sysinfo_1_1_1 *info)
  68. {
  69. int i;
  70. if (stsi(info, 1, 1, 1))
  71. return;
  72. EBCASC(info->manufacturer, sizeof(info->manufacturer));
  73. EBCASC(info->type, sizeof(info->type));
  74. EBCASC(info->model, sizeof(info->model));
  75. EBCASC(info->sequence, sizeof(info->sequence));
  76. EBCASC(info->plant, sizeof(info->plant));
  77. EBCASC(info->model_capacity, sizeof(info->model_capacity));
  78. EBCASC(info->model_perm_cap, sizeof(info->model_perm_cap));
  79. EBCASC(info->model_temp_cap, sizeof(info->model_temp_cap));
  80. seq_printf(m, "Manufacturer: %-16.16s\n", info->manufacturer);
  81. seq_printf(m, "Type: %-4.4s\n", info->type);
  82. /*
  83. * Sigh: the model field has been renamed with System z9
  84. * to model_capacity and a new model field has been added
  85. * after the plant field. To avoid confusing older programs
  86. * the "Model:" prints "model_capacity model" or just
  87. * "model_capacity" if the model string is empty .
  88. */
  89. seq_printf(m, "Model: %-16.16s", info->model_capacity);
  90. if (info->model[0] != '\0')
  91. seq_printf(m, " %-16.16s", info->model);
  92. seq_putc(m, '\n');
  93. seq_printf(m, "Sequence Code: %-16.16s\n", info->sequence);
  94. seq_printf(m, "Plant: %-4.4s\n", info->plant);
  95. seq_printf(m, "Model Capacity: %-16.16s %08u\n",
  96. info->model_capacity, info->model_cap_rating);
  97. if (info->model_perm_cap_rating)
  98. seq_printf(m, "Model Perm. Capacity: %-16.16s %08u\n",
  99. info->model_perm_cap,
  100. info->model_perm_cap_rating);
  101. if (info->model_temp_cap_rating)
  102. seq_printf(m, "Model Temp. Capacity: %-16.16s %08u\n",
  103. info->model_temp_cap,
  104. info->model_temp_cap_rating);
  105. if (info->ncr)
  106. seq_printf(m, "Nominal Cap. Rating: %08u\n", info->ncr);
  107. if (info->npr)
  108. seq_printf(m, "Nominal Perm. Rating: %08u\n", info->npr);
  109. if (info->ntr)
  110. seq_printf(m, "Nominal Temp. Rating: %08u\n", info->ntr);
  111. if (info->cai) {
  112. seq_printf(m, "Capacity Adj. Ind.: %d\n", info->cai);
  113. seq_printf(m, "Capacity Ch. Reason: %d\n", info->ccr);
  114. seq_printf(m, "Capacity Transient: %d\n", info->t);
  115. }
  116. if (info->p) {
  117. for (i = 1; i <= ARRAY_SIZE(info->typepct); i++) {
  118. seq_printf(m, "Type %d Percentage: %d\n",
  119. i, info->typepct[i - 1]);
  120. }
  121. }
  122. }
  123. static void stsi_15_1_x(struct seq_file *m, struct sysinfo_15_1_x *info)
  124. {
  125. int i;
  126. seq_putc(m, '\n');
  127. if (!MACHINE_HAS_TOPOLOGY)
  128. return;
  129. if (stsi(info, 15, 1, topology_max_mnest))
  130. return;
  131. seq_printf(m, "CPU Topology HW: ");
  132. for (i = 0; i < TOPOLOGY_NR_MAG; i++)
  133. seq_printf(m, " %d", info->mag[i]);
  134. seq_putc(m, '\n');
  135. #ifdef CONFIG_SCHED_TOPOLOGY
  136. store_topology(info);
  137. seq_printf(m, "CPU Topology SW: ");
  138. for (i = 0; i < TOPOLOGY_NR_MAG; i++)
  139. seq_printf(m, " %d", info->mag[i]);
  140. seq_putc(m, '\n');
  141. #endif
  142. }
  143. static void stsi_1_2_2(struct seq_file *m, struct sysinfo_1_2_2 *info)
  144. {
  145. struct sysinfo_1_2_2_extension *ext;
  146. int i;
  147. if (stsi(info, 1, 2, 2))
  148. return;
  149. ext = (struct sysinfo_1_2_2_extension *)
  150. ((unsigned long) info + info->acc_offset);
  151. seq_printf(m, "CPUs Total: %d\n", info->cpus_total);
  152. seq_printf(m, "CPUs Configured: %d\n", info->cpus_configured);
  153. seq_printf(m, "CPUs Standby: %d\n", info->cpus_standby);
  154. seq_printf(m, "CPUs Reserved: %d\n", info->cpus_reserved);
  155. if (info->mt_installed) {
  156. seq_printf(m, "CPUs G-MTID: %d\n", info->mt_gtid);
  157. seq_printf(m, "CPUs S-MTID: %d\n", info->mt_stid);
  158. }
  159. /*
  160. * Sigh 2. According to the specification the alternate
  161. * capability field is a 32 bit floating point number
  162. * if the higher order 8 bits are not zero. Printing
  163. * a floating point number in the kernel is a no-no,
  164. * always print the number as 32 bit unsigned integer.
  165. * The user-space needs to know about the strange
  166. * encoding of the alternate cpu capability.
  167. */
  168. seq_printf(m, "Capability: %u", info->capability);
  169. if (info->format == 1)
  170. seq_printf(m, " %u", ext->alt_capability);
  171. seq_putc(m, '\n');
  172. if (info->nominal_cap)
  173. seq_printf(m, "Nominal Capability: %d\n", info->nominal_cap);
  174. if (info->secondary_cap)
  175. seq_printf(m, "Secondary Capability: %d\n", info->secondary_cap);
  176. for (i = 2; i <= info->cpus_total; i++) {
  177. seq_printf(m, "Adjustment %02d-way: %u",
  178. i, info->adjustment[i-2]);
  179. if (info->format == 1)
  180. seq_printf(m, " %u", ext->alt_adjustment[i-2]);
  181. seq_putc(m, '\n');
  182. }
  183. }
  184. static void stsi_2_2_2(struct seq_file *m, struct sysinfo_2_2_2 *info)
  185. {
  186. if (stsi(info, 2, 2, 2))
  187. return;
  188. EBCASC(info->name, sizeof(info->name));
  189. seq_putc(m, '\n');
  190. seq_printf(m, "LPAR Number: %d\n", info->lpar_number);
  191. seq_printf(m, "LPAR Characteristics: ");
  192. if (info->characteristics & LPAR_CHAR_DEDICATED)
  193. seq_printf(m, "Dedicated ");
  194. if (info->characteristics & LPAR_CHAR_SHARED)
  195. seq_printf(m, "Shared ");
  196. if (info->characteristics & LPAR_CHAR_LIMITED)
  197. seq_printf(m, "Limited ");
  198. seq_putc(m, '\n');
  199. seq_printf(m, "LPAR Name: %-8.8s\n", info->name);
  200. seq_printf(m, "LPAR Adjustment: %d\n", info->caf);
  201. seq_printf(m, "LPAR CPUs Total: %d\n", info->cpus_total);
  202. seq_printf(m, "LPAR CPUs Configured: %d\n", info->cpus_configured);
  203. seq_printf(m, "LPAR CPUs Standby: %d\n", info->cpus_standby);
  204. seq_printf(m, "LPAR CPUs Reserved: %d\n", info->cpus_reserved);
  205. seq_printf(m, "LPAR CPUs Dedicated: %d\n", info->cpus_dedicated);
  206. seq_printf(m, "LPAR CPUs Shared: %d\n", info->cpus_shared);
  207. if (info->mt_installed) {
  208. seq_printf(m, "LPAR CPUs G-MTID: %d\n", info->mt_gtid);
  209. seq_printf(m, "LPAR CPUs S-MTID: %d\n", info->mt_stid);
  210. seq_printf(m, "LPAR CPUs PS-MTID: %d\n", info->mt_psmtid);
  211. }
  212. if (convert_ext_name(info->vsne, info->ext_name, sizeof(info->ext_name))) {
  213. seq_printf(m, "LPAR Extended Name: %-.256s\n", info->ext_name);
  214. seq_printf(m, "LPAR UUID: %pUb\n", &info->uuid);
  215. }
  216. }
  217. static void print_ext_name(struct seq_file *m, int lvl,
  218. struct sysinfo_3_2_2 *info)
  219. {
  220. size_t len = sizeof(info->ext_names[lvl]);
  221. if (!convert_ext_name(info->vm[lvl].evmne, info->ext_names[lvl], len))
  222. return;
  223. seq_printf(m, "VM%02d Extended Name: %-.256s\n", lvl,
  224. info->ext_names[lvl]);
  225. }
  226. static void print_uuid(struct seq_file *m, int i, struct sysinfo_3_2_2 *info)
  227. {
  228. if (!memcmp(&info->vm[i].uuid, &NULL_UUID_BE, sizeof(uuid_be)))
  229. return;
  230. seq_printf(m, "VM%02d UUID: %pUb\n", i, &info->vm[i].uuid);
  231. }
  232. static void stsi_3_2_2(struct seq_file *m, struct sysinfo_3_2_2 *info)
  233. {
  234. int i;
  235. if (stsi(info, 3, 2, 2))
  236. return;
  237. for (i = 0; i < info->count; i++) {
  238. EBCASC(info->vm[i].name, sizeof(info->vm[i].name));
  239. EBCASC(info->vm[i].cpi, sizeof(info->vm[i].cpi));
  240. seq_putc(m, '\n');
  241. seq_printf(m, "VM%02d Name: %-8.8s\n", i, info->vm[i].name);
  242. seq_printf(m, "VM%02d Control Program: %-16.16s\n", i, info->vm[i].cpi);
  243. seq_printf(m, "VM%02d Adjustment: %d\n", i, info->vm[i].caf);
  244. seq_printf(m, "VM%02d CPUs Total: %d\n", i, info->vm[i].cpus_total);
  245. seq_printf(m, "VM%02d CPUs Configured: %d\n", i, info->vm[i].cpus_configured);
  246. seq_printf(m, "VM%02d CPUs Standby: %d\n", i, info->vm[i].cpus_standby);
  247. seq_printf(m, "VM%02d CPUs Reserved: %d\n", i, info->vm[i].cpus_reserved);
  248. print_ext_name(m, i, info);
  249. print_uuid(m, i, info);
  250. }
  251. }
  252. static int sysinfo_show(struct seq_file *m, void *v)
  253. {
  254. void *info = (void *)get_zeroed_page(GFP_KERNEL);
  255. int level;
  256. if (!info)
  257. return 0;
  258. level = stsi(NULL, 0, 0, 0);
  259. if (level >= 1)
  260. stsi_1_1_1(m, info);
  261. if (level >= 1)
  262. stsi_15_1_x(m, info);
  263. if (level >= 1)
  264. stsi_1_2_2(m, info);
  265. if (level >= 2)
  266. stsi_2_2_2(m, info);
  267. if (level >= 3)
  268. stsi_3_2_2(m, info);
  269. free_page((unsigned long)info);
  270. return 0;
  271. }
  272. static int sysinfo_open(struct inode *inode, struct file *file)
  273. {
  274. return single_open(file, sysinfo_show, NULL);
  275. }
  276. static const struct file_operations sysinfo_fops = {
  277. .open = sysinfo_open,
  278. .read = seq_read,
  279. .llseek = seq_lseek,
  280. .release = single_release,
  281. };
  282. static int __init sysinfo_create_proc(void)
  283. {
  284. proc_create("sysinfo", 0444, NULL, &sysinfo_fops);
  285. return 0;
  286. }
  287. device_initcall(sysinfo_create_proc);
  288. /*
  289. * Service levels interface.
  290. */
  291. static DECLARE_RWSEM(service_level_sem);
  292. static LIST_HEAD(service_level_list);
  293. int register_service_level(struct service_level *slr)
  294. {
  295. struct service_level *ptr;
  296. down_write(&service_level_sem);
  297. list_for_each_entry(ptr, &service_level_list, list)
  298. if (ptr == slr) {
  299. up_write(&service_level_sem);
  300. return -EEXIST;
  301. }
  302. list_add_tail(&slr->list, &service_level_list);
  303. up_write(&service_level_sem);
  304. return 0;
  305. }
  306. EXPORT_SYMBOL(register_service_level);
  307. int unregister_service_level(struct service_level *slr)
  308. {
  309. struct service_level *ptr, *next;
  310. int rc = -ENOENT;
  311. down_write(&service_level_sem);
  312. list_for_each_entry_safe(ptr, next, &service_level_list, list) {
  313. if (ptr != slr)
  314. continue;
  315. list_del(&ptr->list);
  316. rc = 0;
  317. break;
  318. }
  319. up_write(&service_level_sem);
  320. return rc;
  321. }
  322. EXPORT_SYMBOL(unregister_service_level);
  323. static void *service_level_start(struct seq_file *m, loff_t *pos)
  324. {
  325. down_read(&service_level_sem);
  326. return seq_list_start(&service_level_list, *pos);
  327. }
  328. static void *service_level_next(struct seq_file *m, void *p, loff_t *pos)
  329. {
  330. return seq_list_next(p, &service_level_list, pos);
  331. }
  332. static void service_level_stop(struct seq_file *m, void *p)
  333. {
  334. up_read(&service_level_sem);
  335. }
  336. static int service_level_show(struct seq_file *m, void *p)
  337. {
  338. struct service_level *slr;
  339. slr = list_entry(p, struct service_level, list);
  340. slr->seq_print(m, slr);
  341. return 0;
  342. }
  343. static const struct seq_operations service_level_seq_ops = {
  344. .start = service_level_start,
  345. .next = service_level_next,
  346. .stop = service_level_stop,
  347. .show = service_level_show
  348. };
  349. static int service_level_open(struct inode *inode, struct file *file)
  350. {
  351. return seq_open(file, &service_level_seq_ops);
  352. }
  353. static const struct file_operations service_level_ops = {
  354. .open = service_level_open,
  355. .read = seq_read,
  356. .llseek = seq_lseek,
  357. .release = seq_release
  358. };
  359. static void service_level_vm_print(struct seq_file *m,
  360. struct service_level *slr)
  361. {
  362. char *query_buffer, *str;
  363. query_buffer = kmalloc(1024, GFP_KERNEL | GFP_DMA);
  364. if (!query_buffer)
  365. return;
  366. cpcmd("QUERY CPLEVEL", query_buffer, 1024, NULL);
  367. str = strchr(query_buffer, '\n');
  368. if (str)
  369. *str = 0;
  370. seq_printf(m, "VM: %s\n", query_buffer);
  371. kfree(query_buffer);
  372. }
  373. static struct service_level service_level_vm = {
  374. .seq_print = service_level_vm_print
  375. };
  376. static __init int create_proc_service_level(void)
  377. {
  378. proc_create("service_levels", 0, NULL, &service_level_ops);
  379. if (MACHINE_IS_VM)
  380. register_service_level(&service_level_vm);
  381. return 0;
  382. }
  383. subsys_initcall(create_proc_service_level);
  384. /*
  385. * CPU capability might have changed. Therefore recalculate loops_per_jiffy.
  386. */
  387. void s390_adjust_jiffies(void)
  388. {
  389. struct sysinfo_1_2_2 *info;
  390. unsigned long capability;
  391. struct kernel_fpu fpu;
  392. info = (void *) get_zeroed_page(GFP_KERNEL);
  393. if (!info)
  394. return;
  395. if (stsi(info, 1, 2, 2) == 0) {
  396. /*
  397. * Major sigh. The cpu capability encoding is "special".
  398. * If the first 9 bits of info->capability are 0 then it
  399. * is a 32 bit unsigned integer in the range 0 .. 2^23.
  400. * If the first 9 bits are != 0 then it is a 32 bit float.
  401. * In addition a lower value indicates a proportionally
  402. * higher cpu capacity. Bogomips are the other way round.
  403. * To get to a halfway suitable number we divide 1e7
  404. * by the cpu capability number. Yes, that means a floating
  405. * point division ..
  406. */
  407. kernel_fpu_begin(&fpu, KERNEL_FPR);
  408. asm volatile(
  409. " sfpc %3\n"
  410. " l %0,%1\n"
  411. " tmlh %0,0xff80\n"
  412. " jnz 0f\n"
  413. " cefbr %%f2,%0\n"
  414. " j 1f\n"
  415. "0: le %%f2,%1\n"
  416. "1: cefbr %%f0,%2\n"
  417. " debr %%f0,%%f2\n"
  418. " cgebr %0,5,%%f0\n"
  419. : "=&d" (capability)
  420. : "Q" (info->capability), "d" (10000000), "d" (0)
  421. : "cc"
  422. );
  423. kernel_fpu_end(&fpu, KERNEL_FPR);
  424. } else
  425. /*
  426. * Really old machine without stsi block for basic
  427. * cpu information. Report 42.0 bogomips.
  428. */
  429. capability = 42;
  430. loops_per_jiffy = capability * (500000/HZ);
  431. free_page((unsigned long) info);
  432. }
  433. /*
  434. * calibrate the delay loop
  435. */
  436. void calibrate_delay(void)
  437. {
  438. s390_adjust_jiffies();
  439. /* Print the good old Bogomips line .. */
  440. printk(KERN_DEBUG "Calibrating delay loop (skipped)... "
  441. "%lu.%02lu BogoMIPS preset\n", loops_per_jiffy/(500000/HZ),
  442. (loops_per_jiffy/(5000/HZ)) % 100);
  443. }
  444. #ifdef CONFIG_DEBUG_FS
  445. #define STSI_FILE(fc, s1, s2) \
  446. static int stsi_open_##fc##_##s1##_##s2(struct inode *inode, struct file *file)\
  447. { \
  448. file->private_data = (void *) get_zeroed_page(GFP_KERNEL); \
  449. if (!file->private_data) \
  450. return -ENOMEM; \
  451. if (stsi(file->private_data, fc, s1, s2)) { \
  452. free_page((unsigned long)file->private_data); \
  453. file->private_data = NULL; \
  454. return -EACCES; \
  455. } \
  456. return nonseekable_open(inode, file); \
  457. } \
  458. \
  459. static const struct file_operations stsi_##fc##_##s1##_##s2##_fs_ops = { \
  460. .open = stsi_open_##fc##_##s1##_##s2, \
  461. .release = stsi_release, \
  462. .read = stsi_read, \
  463. .llseek = no_llseek, \
  464. };
  465. static int stsi_release(struct inode *inode, struct file *file)
  466. {
  467. free_page((unsigned long)file->private_data);
  468. return 0;
  469. }
  470. static ssize_t stsi_read(struct file *file, char __user *buf, size_t size, loff_t *ppos)
  471. {
  472. return simple_read_from_buffer(buf, size, ppos, file->private_data, PAGE_SIZE);
  473. }
  474. STSI_FILE( 1, 1, 1);
  475. STSI_FILE( 1, 2, 1);
  476. STSI_FILE( 1, 2, 2);
  477. STSI_FILE( 2, 2, 1);
  478. STSI_FILE( 2, 2, 2);
  479. STSI_FILE( 3, 2, 2);
  480. STSI_FILE(15, 1, 2);
  481. STSI_FILE(15, 1, 3);
  482. STSI_FILE(15, 1, 4);
  483. STSI_FILE(15, 1, 5);
  484. STSI_FILE(15, 1, 6);
  485. struct stsi_file {
  486. const struct file_operations *fops;
  487. char *name;
  488. };
  489. static struct stsi_file stsi_file[] __initdata = {
  490. {.fops = &stsi_1_1_1_fs_ops, .name = "1_1_1"},
  491. {.fops = &stsi_1_2_1_fs_ops, .name = "1_2_1"},
  492. {.fops = &stsi_1_2_2_fs_ops, .name = "1_2_2"},
  493. {.fops = &stsi_2_2_1_fs_ops, .name = "2_2_1"},
  494. {.fops = &stsi_2_2_2_fs_ops, .name = "2_2_2"},
  495. {.fops = &stsi_3_2_2_fs_ops, .name = "3_2_2"},
  496. {.fops = &stsi_15_1_2_fs_ops, .name = "15_1_2"},
  497. {.fops = &stsi_15_1_3_fs_ops, .name = "15_1_3"},
  498. {.fops = &stsi_15_1_4_fs_ops, .name = "15_1_4"},
  499. {.fops = &stsi_15_1_5_fs_ops, .name = "15_1_5"},
  500. {.fops = &stsi_15_1_6_fs_ops, .name = "15_1_6"},
  501. };
  502. static u8 stsi_0_0_0;
  503. static __init int stsi_init_debugfs(void)
  504. {
  505. struct dentry *stsi_root;
  506. struct stsi_file *sf;
  507. int lvl, i;
  508. stsi_root = debugfs_create_dir("stsi", arch_debugfs_dir);
  509. if (IS_ERR_OR_NULL(stsi_root))
  510. return 0;
  511. lvl = stsi(NULL, 0, 0, 0);
  512. if (lvl > 0)
  513. stsi_0_0_0 = lvl;
  514. debugfs_create_u8("0_0_0", 0400, stsi_root, &stsi_0_0_0);
  515. for (i = 0; i < ARRAY_SIZE(stsi_file); i++) {
  516. sf = &stsi_file[i];
  517. debugfs_create_file(sf->name, 0400, stsi_root, NULL, sf->fops);
  518. }
  519. if (IS_ENABLED(CONFIG_SCHED_TOPOLOGY) && MACHINE_HAS_TOPOLOGY) {
  520. char link_to[10];
  521. sprintf(link_to, "15_1_%d", topology_mnest_limit());
  522. debugfs_create_symlink("topology", stsi_root, link_to);
  523. }
  524. return 0;
  525. }
  526. device_initcall(stsi_init_debugfs);
  527. #endif /* CONFIG_DEBUG_FS */