traps.c 30 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250
  1. /*
  2. * Copyright (C) 1995-1996 Gary Thomas (gdt@linuxppc.org)
  3. *
  4. * This program is free software; you can redistribute it and/or
  5. * modify it under the terms of the GNU General Public License
  6. * as published by the Free Software Foundation; either version
  7. * 2 of the License, or (at your option) any later version.
  8. *
  9. * Modified by Cort Dougan (cort@cs.nmt.edu)
  10. * and Paul Mackerras (paulus@samba.org)
  11. */
  12. /*
  13. * This file handles the architecture-dependent parts of hardware exceptions
  14. */
  15. #include <linux/config.h>
  16. #include <linux/errno.h>
  17. #include <linux/sched.h>
  18. #include <linux/kernel.h>
  19. #include <linux/mm.h>
  20. #include <linux/stddef.h>
  21. #include <linux/unistd.h>
  22. #include <linux/slab.h>
  23. #include <linux/user.h>
  24. #include <linux/a.out.h>
  25. #include <linux/interrupt.h>
  26. #include <linux/init.h>
  27. #include <linux/module.h>
  28. #include <linux/delay.h>
  29. #include <linux/kprobes.h>
  30. #include <asm/kdebug.h>
  31. #ifdef CONFIG_PPC32
  32. #include <linux/ptrace.h>
  33. #include <linux/prctl.h>
  34. #endif
  35. #include <asm/pgtable.h>
  36. #include <asm/uaccess.h>
  37. #include <asm/system.h>
  38. #include <asm/io.h>
  39. #ifdef CONFIG_PPC32
  40. #include <asm/reg.h>
  41. #include <asm/xmon.h>
  42. #ifdef CONFIG_PMAC_BACKLIGHT
  43. #include <asm/backlight.h>
  44. #endif
  45. #include <asm/perfmon.h>
  46. #endif
  47. #ifdef CONFIG_PPC64
  48. #include <asm/processor.h>
  49. #include <asm/ppcdebug.h>
  50. #include <asm/rtas.h>
  51. #include <asm/systemcfg.h>
  52. #include <asm/machdep.h>
  53. #include <asm/pmc.h>
  54. #endif
  55. #ifdef CONFIG_PPC64
  56. #define __KPROBES __kprobes
  57. #else
  58. #define __KPROBES
  59. #endif
  60. #ifdef CONFIG_DEBUGGER
  61. int (*__debugger)(struct pt_regs *regs);
  62. int (*__debugger_ipi)(struct pt_regs *regs);
  63. int (*__debugger_bpt)(struct pt_regs *regs);
  64. int (*__debugger_sstep)(struct pt_regs *regs);
  65. int (*__debugger_iabr_match)(struct pt_regs *regs);
  66. int (*__debugger_dabr_match)(struct pt_regs *regs);
  67. int (*__debugger_fault_handler)(struct pt_regs *regs);
  68. EXPORT_SYMBOL(__debugger);
  69. EXPORT_SYMBOL(__debugger_ipi);
  70. EXPORT_SYMBOL(__debugger_bpt);
  71. EXPORT_SYMBOL(__debugger_sstep);
  72. EXPORT_SYMBOL(__debugger_iabr_match);
  73. EXPORT_SYMBOL(__debugger_dabr_match);
  74. EXPORT_SYMBOL(__debugger_fault_handler);
  75. #endif
  76. struct notifier_block *powerpc_die_chain;
  77. static DEFINE_SPINLOCK(die_notifier_lock);
  78. int register_die_notifier(struct notifier_block *nb)
  79. {
  80. int err = 0;
  81. unsigned long flags;
  82. spin_lock_irqsave(&die_notifier_lock, flags);
  83. err = notifier_chain_register(&powerpc_die_chain, nb);
  84. spin_unlock_irqrestore(&die_notifier_lock, flags);
  85. return err;
  86. }
  87. /*
  88. * Trap & Exception support
  89. */
  90. static DEFINE_SPINLOCK(die_lock);
  91. int die(const char *str, struct pt_regs *regs, long err)
  92. {
  93. static int die_counter;
  94. int nl = 0;
  95. if (debugger(regs))
  96. return 1;
  97. console_verbose();
  98. spin_lock_irq(&die_lock);
  99. bust_spinlocks(1);
  100. #if defined(CONFIG_PPC32) && defined(CONFIG_PMAC_BACKLIGHT)
  101. if (_machine == _MACH_Pmac) {
  102. set_backlight_enable(1);
  103. set_backlight_level(BACKLIGHT_MAX);
  104. }
  105. #endif
  106. printk("Oops: %s, sig: %ld [#%d]\n", str, err, ++die_counter);
  107. #ifdef CONFIG_PREEMPT
  108. printk("PREEMPT ");
  109. nl = 1;
  110. #endif
  111. #ifdef CONFIG_SMP
  112. printk("SMP NR_CPUS=%d ", NR_CPUS);
  113. nl = 1;
  114. #endif
  115. #ifdef CONFIG_DEBUG_PAGEALLOC
  116. printk("DEBUG_PAGEALLOC ");
  117. nl = 1;
  118. #endif
  119. #ifdef CONFIG_NUMA
  120. printk("NUMA ");
  121. nl = 1;
  122. #endif
  123. #ifdef CONFIG_PPC64
  124. switch (systemcfg->platform) {
  125. case PLATFORM_PSERIES:
  126. printk("PSERIES ");
  127. nl = 1;
  128. break;
  129. case PLATFORM_PSERIES_LPAR:
  130. printk("PSERIES LPAR ");
  131. nl = 1;
  132. break;
  133. case PLATFORM_ISERIES_LPAR:
  134. printk("ISERIES LPAR ");
  135. nl = 1;
  136. break;
  137. case PLATFORM_POWERMAC:
  138. printk("POWERMAC ");
  139. nl = 1;
  140. break;
  141. case PLATFORM_BPA:
  142. printk("BPA ");
  143. nl = 1;
  144. break;
  145. }
  146. #endif
  147. if (nl)
  148. printk("\n");
  149. print_modules();
  150. show_regs(regs);
  151. bust_spinlocks(0);
  152. spin_unlock_irq(&die_lock);
  153. if (in_interrupt())
  154. panic("Fatal exception in interrupt");
  155. if (panic_on_oops) {
  156. #ifdef CONFIG_PPC64
  157. printk(KERN_EMERG "Fatal exception: panic in 5 seconds\n");
  158. ssleep(5);
  159. #endif
  160. panic("Fatal exception");
  161. }
  162. #ifdef CONFIG_PPC32
  163. do_exit(err);
  164. #else
  165. do_exit(SIGSEGV);
  166. #endif
  167. return 0;
  168. }
  169. void _exception(int signr, struct pt_regs *regs, int code, unsigned long addr)
  170. {
  171. siginfo_t info;
  172. if (!user_mode(regs)) {
  173. if (die("Exception in kernel mode", regs, signr))
  174. return;
  175. }
  176. memset(&info, 0, sizeof(info));
  177. info.si_signo = signr;
  178. info.si_code = code;
  179. info.si_addr = (void __user *) addr;
  180. force_sig_info(signr, &info, current);
  181. #ifdef CONFIG_PPC32
  182. /*
  183. * Init gets no signals that it doesn't have a handler for.
  184. * That's all very well, but if it has caused a synchronous
  185. * exception and we ignore the resulting signal, it will just
  186. * generate the same exception over and over again and we get
  187. * nowhere. Better to kill it and let the kernel panic.
  188. */
  189. if (current->pid == 1) {
  190. __sighandler_t handler;
  191. spin_lock_irq(&current->sighand->siglock);
  192. handler = current->sighand->action[signr-1].sa.sa_handler;
  193. spin_unlock_irq(&current->sighand->siglock);
  194. if (handler == SIG_DFL) {
  195. /* init has generated a synchronous exception
  196. and it doesn't have a handler for the signal */
  197. printk(KERN_CRIT "init has generated signal %d "
  198. "but has no handler for it\n", signr);
  199. do_exit(signr);
  200. }
  201. }
  202. #endif
  203. }
  204. #ifdef CONFIG_PPC64
  205. void system_reset_exception(struct pt_regs *regs)
  206. {
  207. /* See if any machine dependent calls */
  208. if (ppc_md.system_reset_exception)
  209. ppc_md.system_reset_exception(regs);
  210. die("System Reset", regs, 0);
  211. /* Must die if the interrupt is not recoverable */
  212. if (!(regs->msr & MSR_RI))
  213. panic("Unrecoverable System Reset");
  214. /* What should we do here? We could issue a shutdown or hard reset. */
  215. }
  216. #endif
  217. #ifdef CONFIG_PPC32
  218. /*
  219. * I/O accesses can cause machine checks on powermacs.
  220. * Check if the NIP corresponds to the address of a sync
  221. * instruction for which there is an entry in the exception
  222. * table.
  223. * Note that the 601 only takes a machine check on TEA
  224. * (transfer error ack) signal assertion, and does not
  225. * set any of the top 16 bits of SRR1.
  226. * -- paulus.
  227. */
  228. static inline int check_io_access(struct pt_regs *regs)
  229. {
  230. #ifdef CONFIG_PPC_PMAC
  231. unsigned long msr = regs->msr;
  232. const struct exception_table_entry *entry;
  233. unsigned int *nip = (unsigned int *)regs->nip;
  234. if (((msr & 0xffff0000) == 0 || (msr & (0x80000 | 0x40000)))
  235. && (entry = search_exception_tables(regs->nip)) != NULL) {
  236. /*
  237. * Check that it's a sync instruction, or somewhere
  238. * in the twi; isync; nop sequence that inb/inw/inl uses.
  239. * As the address is in the exception table
  240. * we should be able to read the instr there.
  241. * For the debug message, we look at the preceding
  242. * load or store.
  243. */
  244. if (*nip == 0x60000000) /* nop */
  245. nip -= 2;
  246. else if (*nip == 0x4c00012c) /* isync */
  247. --nip;
  248. if (*nip == 0x7c0004ac || (*nip >> 26) == 3) {
  249. /* sync or twi */
  250. unsigned int rb;
  251. --nip;
  252. rb = (*nip >> 11) & 0x1f;
  253. printk(KERN_DEBUG "%s bad port %lx at %p\n",
  254. (*nip & 0x100)? "OUT to": "IN from",
  255. regs->gpr[rb] - _IO_BASE, nip);
  256. regs->msr |= MSR_RI;
  257. regs->nip = entry->fixup;
  258. return 1;
  259. }
  260. }
  261. #endif /* CONFIG_PPC_PMAC */
  262. return 0;
  263. }
  264. #endif /* CONFIG_PPC32 */
  265. #if defined(CONFIG_4xx) || defined(CONFIG_BOOKE)
  266. /* On 4xx, the reason for the machine check or program exception
  267. is in the ESR. */
  268. #define get_reason(regs) ((regs)->dsisr)
  269. #ifndef CONFIG_FSL_BOOKE
  270. #define get_mc_reason(regs) ((regs)->dsisr)
  271. #else
  272. #define get_mc_reason(regs) (mfspr(SPRN_MCSR))
  273. #endif
  274. #define REASON_FP ESR_FP
  275. #define REASON_ILLEGAL (ESR_PIL | ESR_PUO)
  276. #define REASON_PRIVILEGED ESR_PPR
  277. #define REASON_TRAP ESR_PTR
  278. /* single-step stuff */
  279. #define single_stepping(regs) (current->thread.dbcr0 & DBCR0_IC)
  280. #define clear_single_step(regs) (current->thread.dbcr0 &= ~DBCR0_IC)
  281. #else
  282. /* On non-4xx, the reason for the machine check or program
  283. exception is in the MSR. */
  284. #define get_reason(regs) ((regs)->msr)
  285. #define get_mc_reason(regs) ((regs)->msr)
  286. #define REASON_FP 0x100000
  287. #define REASON_ILLEGAL 0x80000
  288. #define REASON_PRIVILEGED 0x40000
  289. #define REASON_TRAP 0x20000
  290. #define single_stepping(regs) ((regs)->msr & MSR_SE)
  291. #define clear_single_step(regs) ((regs)->msr &= ~MSR_SE)
  292. #endif
  293. #ifdef CONFIG_PPC32
  294. /*
  295. * This is "fall-back" implementation for configurations
  296. * which don't provide platform-specific machine check info
  297. */
  298. void __attribute__ ((weak))
  299. platform_machine_check(struct pt_regs *regs)
  300. {
  301. }
  302. #endif
  303. void machine_check_exception(struct pt_regs *regs)
  304. {
  305. #ifdef CONFIG_PPC64
  306. int recover = 0;
  307. /* See if any machine dependent calls */
  308. if (ppc_md.machine_check_exception)
  309. recover = ppc_md.machine_check_exception(regs);
  310. if (recover)
  311. return;
  312. #else
  313. unsigned long reason = get_mc_reason(regs);
  314. if (user_mode(regs)) {
  315. regs->msr |= MSR_RI;
  316. _exception(SIGBUS, regs, BUS_ADRERR, regs->nip);
  317. return;
  318. }
  319. #if defined(CONFIG_8xx) && defined(CONFIG_PCI)
  320. /* the qspan pci read routines can cause machine checks -- Cort */
  321. bad_page_fault(regs, regs->dar, SIGBUS);
  322. return;
  323. #endif
  324. if (debugger_fault_handler(regs)) {
  325. regs->msr |= MSR_RI;
  326. return;
  327. }
  328. if (check_io_access(regs))
  329. return;
  330. #if defined(CONFIG_4xx) && !defined(CONFIG_440A)
  331. if (reason & ESR_IMCP) {
  332. printk("Instruction");
  333. mtspr(SPRN_ESR, reason & ~ESR_IMCP);
  334. } else
  335. printk("Data");
  336. printk(" machine check in kernel mode.\n");
  337. #elif defined(CONFIG_440A)
  338. printk("Machine check in kernel mode.\n");
  339. if (reason & ESR_IMCP){
  340. printk("Instruction Synchronous Machine Check exception\n");
  341. mtspr(SPRN_ESR, reason & ~ESR_IMCP);
  342. }
  343. else {
  344. u32 mcsr = mfspr(SPRN_MCSR);
  345. if (mcsr & MCSR_IB)
  346. printk("Instruction Read PLB Error\n");
  347. if (mcsr & MCSR_DRB)
  348. printk("Data Read PLB Error\n");
  349. if (mcsr & MCSR_DWB)
  350. printk("Data Write PLB Error\n");
  351. if (mcsr & MCSR_TLBP)
  352. printk("TLB Parity Error\n");
  353. if (mcsr & MCSR_ICP){
  354. flush_instruction_cache();
  355. printk("I-Cache Parity Error\n");
  356. }
  357. if (mcsr & MCSR_DCSP)
  358. printk("D-Cache Search Parity Error\n");
  359. if (mcsr & MCSR_DCFP)
  360. printk("D-Cache Flush Parity Error\n");
  361. if (mcsr & MCSR_IMPE)
  362. printk("Machine Check exception is imprecise\n");
  363. /* Clear MCSR */
  364. mtspr(SPRN_MCSR, mcsr);
  365. }
  366. #elif defined (CONFIG_E500)
  367. printk("Machine check in kernel mode.\n");
  368. printk("Caused by (from MCSR=%lx): ", reason);
  369. if (reason & MCSR_MCP)
  370. printk("Machine Check Signal\n");
  371. if (reason & MCSR_ICPERR)
  372. printk("Instruction Cache Parity Error\n");
  373. if (reason & MCSR_DCP_PERR)
  374. printk("Data Cache Push Parity Error\n");
  375. if (reason & MCSR_DCPERR)
  376. printk("Data Cache Parity Error\n");
  377. if (reason & MCSR_GL_CI)
  378. printk("Guarded Load or Cache-Inhibited stwcx.\n");
  379. if (reason & MCSR_BUS_IAERR)
  380. printk("Bus - Instruction Address Error\n");
  381. if (reason & MCSR_BUS_RAERR)
  382. printk("Bus - Read Address Error\n");
  383. if (reason & MCSR_BUS_WAERR)
  384. printk("Bus - Write Address Error\n");
  385. if (reason & MCSR_BUS_IBERR)
  386. printk("Bus - Instruction Data Error\n");
  387. if (reason & MCSR_BUS_RBERR)
  388. printk("Bus - Read Data Bus Error\n");
  389. if (reason & MCSR_BUS_WBERR)
  390. printk("Bus - Read Data Bus Error\n");
  391. if (reason & MCSR_BUS_IPERR)
  392. printk("Bus - Instruction Parity Error\n");
  393. if (reason & MCSR_BUS_RPERR)
  394. printk("Bus - Read Parity Error\n");
  395. #elif defined (CONFIG_E200)
  396. printk("Machine check in kernel mode.\n");
  397. printk("Caused by (from MCSR=%lx): ", reason);
  398. if (reason & MCSR_MCP)
  399. printk("Machine Check Signal\n");
  400. if (reason & MCSR_CP_PERR)
  401. printk("Cache Push Parity Error\n");
  402. if (reason & MCSR_CPERR)
  403. printk("Cache Parity Error\n");
  404. if (reason & MCSR_EXCP_ERR)
  405. printk("ISI, ITLB, or Bus Error on first instruction fetch for an exception handler\n");
  406. if (reason & MCSR_BUS_IRERR)
  407. printk("Bus - Read Bus Error on instruction fetch\n");
  408. if (reason & MCSR_BUS_DRERR)
  409. printk("Bus - Read Bus Error on data load\n");
  410. if (reason & MCSR_BUS_WRERR)
  411. printk("Bus - Write Bus Error on buffered store or cache line push\n");
  412. #else /* !CONFIG_4xx && !CONFIG_E500 && !CONFIG_E200 */
  413. printk("Machine check in kernel mode.\n");
  414. printk("Caused by (from SRR1=%lx): ", reason);
  415. switch (reason & 0x601F0000) {
  416. case 0x80000:
  417. printk("Machine check signal\n");
  418. break;
  419. case 0: /* for 601 */
  420. case 0x40000:
  421. case 0x140000: /* 7450 MSS error and TEA */
  422. printk("Transfer error ack signal\n");
  423. break;
  424. case 0x20000:
  425. printk("Data parity error signal\n");
  426. break;
  427. case 0x10000:
  428. printk("Address parity error signal\n");
  429. break;
  430. case 0x20000000:
  431. printk("L1 Data Cache error\n");
  432. break;
  433. case 0x40000000:
  434. printk("L1 Instruction Cache error\n");
  435. break;
  436. case 0x00100000:
  437. printk("L2 data cache parity error\n");
  438. break;
  439. default:
  440. printk("Unknown values in msr\n");
  441. }
  442. #endif /* CONFIG_4xx */
  443. /*
  444. * Optional platform-provided routine to print out
  445. * additional info, e.g. bus error registers.
  446. */
  447. platform_machine_check(regs);
  448. #endif /* CONFIG_PPC32 */
  449. if (debugger_fault_handler(regs))
  450. return;
  451. die("Machine check", regs,
  452. #ifdef CONFIG_PPC32
  453. SIGBUS
  454. #else
  455. 0
  456. #endif
  457. );
  458. /* Must die if the interrupt is not recoverable */
  459. if (!(regs->msr & MSR_RI))
  460. panic("Unrecoverable Machine check");
  461. }
  462. #ifdef CONFIG_PPC32
  463. void SMIException(struct pt_regs *regs)
  464. {
  465. die("System Management Interrupt", regs, SIGABRT);
  466. }
  467. #endif
  468. void unknown_exception(struct pt_regs *regs)
  469. {
  470. printk("Bad trap at PC: %lx, SR: %lx, vector=%lx\n",
  471. regs->nip, regs->msr, regs->trap);
  472. _exception(SIGTRAP, regs, 0, 0);
  473. }
  474. void instruction_breakpoint_exception(struct pt_regs *regs)
  475. {
  476. if (notify_die(DIE_IABR_MATCH, "iabr_match", regs, 5,
  477. 5, SIGTRAP) == NOTIFY_STOP)
  478. return;
  479. if (debugger_iabr_match(regs))
  480. return;
  481. _exception(SIGTRAP, regs, TRAP_BRKPT, regs->nip);
  482. }
  483. #ifdef CONFIG_PPC32
  484. void RunModeException(struct pt_regs *regs)
  485. {
  486. _exception(SIGTRAP, regs, 0, 0);
  487. }
  488. #endif
  489. void __KPROBES single_step_exception(struct pt_regs *regs)
  490. {
  491. #ifdef CONFIG_PPC32
  492. regs->msr &= ~(MSR_SE | MSR_BE); /* Turn off 'trace' bits */
  493. #else
  494. regs->msr &= ~MSR_SE; /* Turn off 'trace' bit */
  495. #endif
  496. if (notify_die(DIE_SSTEP, "single_step", regs, 5,
  497. 5, SIGTRAP) == NOTIFY_STOP)
  498. return;
  499. if (debugger_sstep(regs))
  500. return;
  501. _exception(SIGTRAP, regs, TRAP_TRACE, regs->nip);
  502. }
  503. /*
  504. * After we have successfully emulated an instruction, we have to
  505. * check if the instruction was being single-stepped, and if so,
  506. * pretend we got a single-step exception. This was pointed out
  507. * by Kumar Gala. -- paulus
  508. */
  509. static inline void emulate_single_step(struct pt_regs *regs)
  510. {
  511. if (single_stepping(regs)) {
  512. #ifdef CONFIG_PPC32
  513. clear_single_step(regs);
  514. _exception(SIGTRAP, regs, TRAP_TRACE, 0);
  515. #else
  516. single_step_exception(regs);
  517. #endif
  518. }
  519. }
  520. static void parse_fpe(struct pt_regs *regs)
  521. {
  522. int code = 0;
  523. unsigned long fpscr;
  524. #ifdef CONFIG_PPC32
  525. /* We must make sure the FP state is consistent with
  526. * our MSR_FP in regs
  527. */
  528. preempt_disable();
  529. if (regs->msr & MSR_FP)
  530. giveup_fpu(current);
  531. preempt_enable();
  532. #else
  533. flush_fp_to_thread(current);
  534. #endif
  535. fpscr = current->thread.fpscr;
  536. /* Invalid operation */
  537. if ((fpscr & FPSCR_VE) && (fpscr & FPSCR_VX))
  538. code = FPE_FLTINV;
  539. /* Overflow */
  540. else if ((fpscr & FPSCR_OE) && (fpscr & FPSCR_OX))
  541. code = FPE_FLTOVF;
  542. /* Underflow */
  543. else if ((fpscr & FPSCR_UE) && (fpscr & FPSCR_UX))
  544. code = FPE_FLTUND;
  545. /* Divide by zero */
  546. else if ((fpscr & FPSCR_ZE) && (fpscr & FPSCR_ZX))
  547. code = FPE_FLTDIV;
  548. /* Inexact result */
  549. else if ((fpscr & FPSCR_XE) && (fpscr & FPSCR_XX))
  550. code = FPE_FLTRES;
  551. _exception(SIGFPE, regs, code, regs->nip);
  552. }
  553. /*
  554. * Illegal instruction emulation support. Originally written to
  555. * provide the PVR to user applications using the mfspr rd, PVR.
  556. * Return non-zero if we can't emulate, or -EFAULT if the associated
  557. * memory access caused an access fault. Return zero on success.
  558. *
  559. * There are a couple of ways to do this, either "decode" the instruction
  560. * or directly match lots of bits. In this case, matching lots of
  561. * bits is faster and easier.
  562. */
  563. #define INST_MFSPR_PVR 0x7c1f42a6
  564. #define INST_MFSPR_PVR_MASK 0xfc1fffff
  565. #define INST_DCBA 0x7c0005ec
  566. #define INST_DCBA_MASK 0x7c0007fe
  567. #define INST_MCRXR 0x7c000400
  568. #define INST_MCRXR_MASK 0x7c0007fe
  569. #ifdef CONFIG_PPC32
  570. #define INST_STRING 0x7c00042a
  571. #define INST_STRING_MASK 0x7c0007fe
  572. #define INST_STRING_GEN_MASK 0x7c00067e
  573. #define INST_LSWI 0x7c0004aa
  574. #define INST_LSWX 0x7c00042a
  575. #define INST_STSWI 0x7c0005aa
  576. #define INST_STSWX 0x7c00052a
  577. static int emulate_string_inst(struct pt_regs *regs, u32 instword)
  578. {
  579. u8 rT = (instword >> 21) & 0x1f;
  580. u8 rA = (instword >> 16) & 0x1f;
  581. u8 NB_RB = (instword >> 11) & 0x1f;
  582. u32 num_bytes;
  583. unsigned long EA;
  584. int pos = 0;
  585. /* Early out if we are an invalid form of lswx */
  586. if ((instword & INST_STRING_MASK) == INST_LSWX)
  587. if ((rT == rA) || (rT == NB_RB))
  588. return -EINVAL;
  589. EA = (rA == 0) ? 0 : regs->gpr[rA];
  590. switch (instword & INST_STRING_MASK) {
  591. case INST_LSWX:
  592. case INST_STSWX:
  593. EA += NB_RB;
  594. num_bytes = regs->xer & 0x7f;
  595. break;
  596. case INST_LSWI:
  597. case INST_STSWI:
  598. num_bytes = (NB_RB == 0) ? 32 : NB_RB;
  599. break;
  600. default:
  601. return -EINVAL;
  602. }
  603. while (num_bytes != 0)
  604. {
  605. u8 val;
  606. u32 shift = 8 * (3 - (pos & 0x3));
  607. switch ((instword & INST_STRING_MASK)) {
  608. case INST_LSWX:
  609. case INST_LSWI:
  610. if (get_user(val, (u8 __user *)EA))
  611. return -EFAULT;
  612. /* first time updating this reg,
  613. * zero it out */
  614. if (pos == 0)
  615. regs->gpr[rT] = 0;
  616. regs->gpr[rT] |= val << shift;
  617. break;
  618. case INST_STSWI:
  619. case INST_STSWX:
  620. val = regs->gpr[rT] >> shift;
  621. if (put_user(val, (u8 __user *)EA))
  622. return -EFAULT;
  623. break;
  624. }
  625. /* move EA to next address */
  626. EA += 1;
  627. num_bytes--;
  628. /* manage our position within the register */
  629. if (++pos == 4) {
  630. pos = 0;
  631. if (++rT == 32)
  632. rT = 0;
  633. }
  634. }
  635. return 0;
  636. }
  637. #endif /* CONFIG_PPC32 */
  638. static int emulate_instruction(struct pt_regs *regs)
  639. {
  640. u32 instword;
  641. u32 rd;
  642. if (!user_mode(regs))
  643. return -EINVAL;
  644. CHECK_FULL_REGS(regs);
  645. if (get_user(instword, (u32 __user *)(regs->nip)))
  646. return -EFAULT;
  647. /* Emulate the mfspr rD, PVR. */
  648. if ((instword & INST_MFSPR_PVR_MASK) == INST_MFSPR_PVR) {
  649. rd = (instword >> 21) & 0x1f;
  650. regs->gpr[rd] = mfspr(SPRN_PVR);
  651. return 0;
  652. }
  653. /* Emulating the dcba insn is just a no-op. */
  654. if ((instword & INST_DCBA_MASK) == INST_DCBA) {
  655. #ifdef CONFIG_PPC64
  656. static int warned;
  657. if (!warned) {
  658. printk(KERN_WARNING
  659. "process %d (%s) uses obsolete 'dcba' insn\n",
  660. current->pid, current->comm);
  661. warned = 1;
  662. }
  663. #endif /* CONFIG_PPC64 */
  664. return 0;
  665. }
  666. /* Emulate the mcrxr insn. */
  667. if ((instword & INST_MCRXR_MASK) == INST_MCRXR) {
  668. unsigned int shift = (instword >> 21) & 0x1c;
  669. unsigned long msk = 0xf0000000UL >> shift;
  670. #ifdef CONFIG_PPC64
  671. static int warned;
  672. if (!warned) {
  673. printk(KERN_WARNING
  674. "process %d (%s) uses obsolete 'mcrxr' insn\n",
  675. current->pid, current->comm);
  676. warned = 1;
  677. }
  678. #endif
  679. regs->ccr = (regs->ccr & ~msk) | ((regs->xer >> shift) & msk);
  680. regs->xer &= ~0xf0000000UL;
  681. return 0;
  682. }
  683. #ifdef CONFIG_PPC32
  684. /* Emulate load/store string insn. */
  685. if ((instword & INST_STRING_GEN_MASK) == INST_STRING)
  686. return emulate_string_inst(regs, instword);
  687. #endif
  688. return -EINVAL;
  689. }
  690. /*
  691. * Look through the list of trap instructions that are used for BUG(),
  692. * BUG_ON() and WARN_ON() and see if we hit one. At this point we know
  693. * that the exception was caused by a trap instruction of some kind.
  694. * Returns 1 if we should continue (i.e. it was a WARN_ON) or 0
  695. * otherwise.
  696. */
  697. extern struct bug_entry __start___bug_table[], __stop___bug_table[];
  698. #ifndef CONFIG_MODULES
  699. #define module_find_bug(x) NULL
  700. #endif
  701. struct bug_entry *find_bug(unsigned long bugaddr)
  702. {
  703. struct bug_entry *bug;
  704. for (bug = __start___bug_table; bug < __stop___bug_table; ++bug)
  705. if (bugaddr == bug->bug_addr)
  706. return bug;
  707. return module_find_bug(bugaddr);
  708. }
  709. static int check_bug_trap(struct pt_regs *regs)
  710. {
  711. struct bug_entry *bug;
  712. unsigned long addr;
  713. if (regs->msr & MSR_PR)
  714. return 0; /* not in kernel */
  715. addr = regs->nip; /* address of trap instruction */
  716. if (addr < PAGE_OFFSET)
  717. return 0;
  718. bug = find_bug(regs->nip);
  719. if (bug == NULL)
  720. return 0;
  721. if (bug->line & BUG_WARNING_TRAP) {
  722. /* this is a WARN_ON rather than BUG/BUG_ON */
  723. #if defined(CONFIG_PPC32) && defined(CONFIG_XMON)
  724. xmon_printf(KERN_ERR "Badness in %s at %s:%d\n",
  725. bug->function, bug->file,
  726. bug->line & ~BUG_WARNING_TRAP);
  727. #endif
  728. printk(KERN_ERR "Badness in %s at %s:%d\n",
  729. bug->function, bug->file,
  730. bug->line & ~BUG_WARNING_TRAP);
  731. #ifdef CONFIG_PPC32
  732. dump_stack();
  733. #else
  734. show_stack(current, (void *)regs->gpr[1]);
  735. #endif
  736. return 1;
  737. }
  738. #if defined(CONFIG_PPC32) && defined(CONFIG_XMON)
  739. xmon_printf(KERN_CRIT "kernel BUG in %s at %s:%d!\n",
  740. bug->function, bug->file, bug->line);
  741. xmon(regs);
  742. #endif
  743. printk(KERN_CRIT "kernel BUG in %s at %s:%d!\n",
  744. bug->function, bug->file, bug->line);
  745. return 0;
  746. }
  747. void __KPROBES program_check_exception(struct pt_regs *regs)
  748. {
  749. unsigned int reason = get_reason(regs);
  750. #if defined(CONFIG_PPC32) && defined(CONFIG_MATH_EMULATION)
  751. extern int do_mathemu(struct pt_regs *regs);
  752. /* (reason & REASON_ILLEGAL) would be the obvious thing here,
  753. * but there seems to be a hardware bug on the 405GP (RevD)
  754. * that means ESR is sometimes set incorrectly - either to
  755. * ESR_DST (!?) or 0. In the process of chasing this with the
  756. * hardware people - not sure if it can happen on any illegal
  757. * instruction or only on FP instructions, whether there is a
  758. * pattern to occurences etc. -dgibson 31/Mar/2003 */
  759. if (!(reason & REASON_TRAP) && do_mathemu(regs) == 0) {
  760. emulate_single_step(regs);
  761. return;
  762. }
  763. #endif
  764. #ifdef CONFIG_PPC64
  765. if (debugger_fault_handler(regs))
  766. return;
  767. #endif
  768. if (reason & REASON_FP) {
  769. /* IEEE FP exception */
  770. parse_fpe(regs);
  771. } else if (reason & REASON_TRAP) {
  772. /* trap exception */
  773. #ifdef CONFIG_PPC64
  774. if (notify_die(DIE_BPT, "breakpoint", regs, 5, 5, SIGTRAP)
  775. == NOTIFY_STOP)
  776. return;
  777. #endif
  778. if (debugger_bpt(regs))
  779. return;
  780. if (check_bug_trap(regs)) {
  781. regs->nip += 4;
  782. return;
  783. }
  784. _exception(SIGTRAP, regs, TRAP_BRKPT,
  785. #ifdef CONFIG_PPC32
  786. 0
  787. #else
  788. regs->nip
  789. #endif
  790. );
  791. } else
  792. #ifdef CONFIG_PPC32
  793. if (reason & (REASON_ILLEGAL | REASON_PRIVILEGED))
  794. #endif
  795. {
  796. /* Privileged or illegal instruction; try to emulate it. */
  797. switch (emulate_instruction(regs)) {
  798. case 0:
  799. regs->nip += 4;
  800. emulate_single_step(regs);
  801. break;
  802. case -EFAULT:
  803. _exception(SIGSEGV, regs, SEGV_MAPERR, regs->nip);
  804. break;
  805. default:
  806. if (reason & REASON_PRIVILEGED)
  807. _exception(SIGILL, regs, ILL_PRVOPC, regs->nip);
  808. else
  809. _exception(SIGILL, regs, ILL_ILLOPC, regs->nip);
  810. break;
  811. }
  812. }
  813. }
  814. void alignment_exception(struct pt_regs *regs)
  815. {
  816. int fixed;
  817. fixed = fix_alignment(regs);
  818. if (fixed == 1) {
  819. regs->nip += 4; /* skip over emulated instruction */
  820. emulate_single_step(regs);
  821. return;
  822. }
  823. /* Operand address was bad */
  824. if (fixed == -EFAULT) {
  825. if (user_mode(regs))
  826. _exception(SIGSEGV, regs,
  827. #ifdef CONFIG_PPC32
  828. SEGV_ACCERR,
  829. #else
  830. SEGV_MAPERR,
  831. #endif
  832. regs->dar);
  833. else
  834. /* Search exception table */
  835. bad_page_fault(regs, regs->dar, SIGSEGV);
  836. return;
  837. }
  838. _exception(SIGBUS, regs, BUS_ADRALN,
  839. #ifdef CONFIG_PPC32
  840. regs->dar
  841. #else
  842. regs->nip
  843. #endif
  844. );
  845. }
  846. #ifdef CONFIG_PPC32
  847. void StackOverflow(struct pt_regs *regs)
  848. {
  849. printk(KERN_CRIT "Kernel stack overflow in process %p, r1=%lx\n",
  850. current, regs->gpr[1]);
  851. debugger(regs);
  852. show_regs(regs);
  853. panic("kernel stack overflow");
  854. }
  855. void nonrecoverable_exception(struct pt_regs *regs)
  856. {
  857. printk(KERN_ERR "Non-recoverable exception at PC=%lx MSR=%lx\n",
  858. regs->nip, regs->msr);
  859. debugger(regs);
  860. die("nonrecoverable exception", regs, SIGKILL);
  861. }
  862. void trace_syscall(struct pt_regs *regs)
  863. {
  864. printk("Task: %p(%d), PC: %08lX/%08lX, Syscall: %3ld, Result: %s%ld %s\n",
  865. current, current->pid, regs->nip, regs->link, regs->gpr[0],
  866. regs->ccr&0x10000000?"Error=":"", regs->gpr[3], print_tainted());
  867. }
  868. #endif /* CONFIG_PPC32 */
  869. #ifdef CONFIG_PPC64
  870. void kernel_fp_unavailable_exception(struct pt_regs *regs)
  871. {
  872. printk(KERN_EMERG "Unrecoverable FP Unavailable Exception "
  873. "%lx at %lx\n", regs->trap, regs->nip);
  874. die("Unrecoverable FP Unavailable Exception", regs, SIGABRT);
  875. }
  876. #endif
  877. void altivec_unavailable_exception(struct pt_regs *regs)
  878. {
  879. #if !defined(CONFIG_ALTIVEC) || defined(CONFIG_PPC64)
  880. if (user_mode(regs)) {
  881. /* A user program has executed an altivec instruction,
  882. but this kernel doesn't support altivec. */
  883. _exception(SIGILL, regs, ILL_ILLOPC, regs->nip);
  884. return;
  885. }
  886. #endif
  887. #ifdef CONFIG_PPC32
  888. {
  889. static int kernel_altivec_count;
  890. /* The kernel has executed an altivec instruction without
  891. first enabling altivec. Whinge but let it do it. */
  892. if (++kernel_altivec_count < 10)
  893. printk(KERN_ERR "AltiVec used in kernel (task=%p, pc=%lx)\n",
  894. current, regs->nip);
  895. regs->msr |= MSR_VEC;
  896. }
  897. #else
  898. printk(KERN_EMERG "Unrecoverable VMX/Altivec Unavailable Exception "
  899. "%lx at %lx\n", regs->trap, regs->nip);
  900. die("Unrecoverable VMX/Altivec Unavailable Exception", regs, SIGABRT);
  901. #endif
  902. }
  903. #ifdef CONFIG_PPC64
  904. extern perf_irq_t perf_irq;
  905. #endif
  906. #if defined(CONFIG_PPC64) || defined(CONFIG_E500)
  907. void performance_monitor_exception(struct pt_regs *regs)
  908. {
  909. perf_irq(regs);
  910. }
  911. #endif
  912. #if defined(CONFIG_PPC32) && defined(CONFIG_8xx)
  913. void SoftwareEmulation(struct pt_regs *regs)
  914. {
  915. extern int do_mathemu(struct pt_regs *);
  916. extern int Soft_emulate_8xx(struct pt_regs *);
  917. int errcode;
  918. CHECK_FULL_REGS(regs);
  919. if (!user_mode(regs)) {
  920. debugger(regs);
  921. die("Kernel Mode Software FPU Emulation", regs, SIGFPE);
  922. }
  923. #ifdef CONFIG_MATH_EMULATION
  924. errcode = do_mathemu(regs);
  925. #else
  926. errcode = Soft_emulate_8xx(regs);
  927. #endif
  928. if (errcode) {
  929. if (errcode > 0)
  930. _exception(SIGFPE, regs, 0, 0);
  931. else if (errcode == -EFAULT)
  932. _exception(SIGSEGV, regs, 0, 0);
  933. else
  934. _exception(SIGILL, regs, ILL_ILLOPC, regs->nip);
  935. } else
  936. emulate_single_step(regs);
  937. }
  938. #endif /* defined(CONFIG_PPC32) && defined(CONFIG_8xx) */
  939. #ifdef CONFIG_PPC32
  940. #if defined(CONFIG_40x) || defined(CONFIG_BOOKE)
  941. void DebugException(struct pt_regs *regs, unsigned long debug_status)
  942. {
  943. if (debug_status & DBSR_IC) { /* instruction completion */
  944. regs->msr &= ~MSR_DE;
  945. if (user_mode(regs)) {
  946. current->thread.dbcr0 &= ~DBCR0_IC;
  947. } else {
  948. /* Disable instruction completion */
  949. mtspr(SPRN_DBCR0, mfspr(SPRN_DBCR0) & ~DBCR0_IC);
  950. /* Clear the instruction completion event */
  951. mtspr(SPRN_DBSR, DBSR_IC);
  952. if (debugger_sstep(regs))
  953. return;
  954. }
  955. _exception(SIGTRAP, regs, TRAP_TRACE, 0);
  956. }
  957. }
  958. #endif /* CONFIG_4xx || CONFIG_BOOKE */
  959. #if !defined(CONFIG_TAU_INT)
  960. void TAUException(struct pt_regs *regs)
  961. {
  962. printk("TAU trap at PC: %lx, MSR: %lx, vector=%lx %s\n",
  963. regs->nip, regs->msr, regs->trap, print_tainted());
  964. }
  965. #endif /* CONFIG_INT_TAU */
  966. #endif /* CONFIG_PPC32*/
  967. #ifdef CONFIG_ALTIVEC
  968. void altivec_assist_exception(struct pt_regs *regs)
  969. {
  970. int err;
  971. #ifdef CONFIG_PPC64
  972. siginfo_t info;
  973. #endif
  974. #ifdef CONFIG_PPC32
  975. preempt_disable();
  976. if (regs->msr & MSR_VEC)
  977. giveup_altivec(current);
  978. preempt_enable();
  979. #endif
  980. if (!user_mode(regs)) {
  981. printk(KERN_EMERG "VMX/Altivec assist exception in kernel mode"
  982. " at %lx\n", regs->nip);
  983. die("Kernel "
  984. #ifdef CONFIG_PPC64
  985. "VMX/"
  986. #endif
  987. "Altivec assist exception", regs, SIGILL);
  988. }
  989. #ifdef CONFIG_PPC64
  990. flush_altivec_to_thread(current);
  991. #endif /* CONFIG_PPC64 */
  992. err = emulate_altivec(regs);
  993. if (err == 0) {
  994. regs->nip += 4; /* skip emulated instruction */
  995. emulate_single_step(regs);
  996. return;
  997. }
  998. if (err == -EFAULT) {
  999. /* got an error reading the instruction */
  1000. #ifdef CONFIG_PPC32
  1001. _exception(SIGSEGV, regs, SEGV_ACCERR, regs->nip);
  1002. #else
  1003. info.si_signo = SIGSEGV;
  1004. info.si_errno = 0;
  1005. info.si_code = SEGV_MAPERR;
  1006. info.si_addr = (void __user *) regs->nip;
  1007. force_sig_info(SIGSEGV, &info, current);
  1008. #endif
  1009. } else {
  1010. /* didn't recognize the instruction */
  1011. /* XXX quick hack for now: set the non-Java bit in the VSCR */
  1012. if (printk_ratelimit())
  1013. printk(KERN_ERR "Unrecognized altivec instruction "
  1014. "in %s at %lx\n", current->comm, regs->nip);
  1015. current->thread.vscr.u[3] |= 0x10000;
  1016. }
  1017. }
  1018. #endif /* CONFIG_ALTIVEC */
  1019. #ifdef CONFIG_PPC32
  1020. #ifdef CONFIG_FSL_BOOKE
  1021. void CacheLockingException(struct pt_regs *regs, unsigned long address,
  1022. unsigned long error_code)
  1023. {
  1024. /* We treat cache locking instructions from the user
  1025. * as priv ops, in the future we could try to do
  1026. * something smarter
  1027. */
  1028. if (error_code & (ESR_DLK|ESR_ILK))
  1029. _exception(SIGILL, regs, ILL_PRVOPC, regs->nip);
  1030. return;
  1031. }
  1032. #endif /* CONFIG_FSL_BOOKE */
  1033. #ifdef CONFIG_SPE
  1034. void SPEFloatingPointException(struct pt_regs *regs)
  1035. {
  1036. unsigned long spefscr;
  1037. int fpexc_mode;
  1038. int code = 0;
  1039. spefscr = current->thread.spefscr;
  1040. fpexc_mode = current->thread.fpexc_mode;
  1041. /* Hardware does not neccessarily set sticky
  1042. * underflow/overflow/invalid flags */
  1043. if ((spefscr & SPEFSCR_FOVF) && (fpexc_mode & PR_FP_EXC_OVF)) {
  1044. code = FPE_FLTOVF;
  1045. spefscr |= SPEFSCR_FOVFS;
  1046. }
  1047. else if ((spefscr & SPEFSCR_FUNF) && (fpexc_mode & PR_FP_EXC_UND)) {
  1048. code = FPE_FLTUND;
  1049. spefscr |= SPEFSCR_FUNFS;
  1050. }
  1051. else if ((spefscr & SPEFSCR_FDBZ) && (fpexc_mode & PR_FP_EXC_DIV))
  1052. code = FPE_FLTDIV;
  1053. else if ((spefscr & SPEFSCR_FINV) && (fpexc_mode & PR_FP_EXC_INV)) {
  1054. code = FPE_FLTINV;
  1055. spefscr |= SPEFSCR_FINVS;
  1056. }
  1057. else if ((spefscr & (SPEFSCR_FG | SPEFSCR_FX)) && (fpexc_mode & PR_FP_EXC_RES))
  1058. code = FPE_FLTRES;
  1059. current->thread.spefscr = spefscr;
  1060. _exception(SIGFPE, regs, code, regs->nip);
  1061. return;
  1062. }
  1063. #endif
  1064. #endif /* CONFIG_PPC32 */
  1065. #ifdef CONFIG_PPC64
  1066. /*
  1067. * We enter here if we get an unrecoverable exception, that is, one
  1068. * that happened at a point where the RI (recoverable interrupt) bit
  1069. * in the MSR is 0. This indicates that SRR0/1 are live, and that
  1070. * we therefore lost state by taking this exception.
  1071. */
  1072. void unrecoverable_exception(struct pt_regs *regs)
  1073. {
  1074. printk(KERN_EMERG "Unrecoverable exception %lx at %lx\n",
  1075. regs->trap, regs->nip);
  1076. die("Unrecoverable exception", regs, SIGABRT);
  1077. }
  1078. #endif /* CONFIG_PPC64 */
  1079. #ifdef CONFIG_PPC32
  1080. #ifdef CONFIG_BOOKE_WDT
  1081. /*
  1082. * Default handler for a Watchdog exception,
  1083. * spins until a reboot occurs
  1084. */
  1085. void __attribute__ ((weak)) WatchdogHandler(struct pt_regs *regs)
  1086. {
  1087. /* Generic WatchdogHandler, implement your own */
  1088. mtspr(SPRN_TCR, mfspr(SPRN_TCR)&(~TCR_WIE));
  1089. return;
  1090. }
  1091. void WatchdogException(struct pt_regs *regs)
  1092. {
  1093. printk (KERN_EMERG "PowerPC Book-E Watchdog Exception\n");
  1094. WatchdogHandler(regs);
  1095. }
  1096. #endif
  1097. #endif /* CONFIG_PPC32 */
  1098. #ifdef CONFIG_PPC64
  1099. /*
  1100. * We enter here if we discover during exception entry that we are
  1101. * running in supervisor mode with a userspace value in the stack pointer.
  1102. */
  1103. void kernel_bad_stack(struct pt_regs *regs)
  1104. {
  1105. printk(KERN_EMERG "Bad kernel stack pointer %lx at %lx\n",
  1106. regs->gpr[1], regs->nip);
  1107. die("Bad kernel stack pointer", regs, SIGABRT);
  1108. }
  1109. #endif
  1110. void __init trap_init(void)
  1111. {
  1112. }