exceptions-64s.S 29 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137
  1. /*
  2. * This file contains the 64-bit "server" PowerPC variant
  3. * of the low level exception handling including exception
  4. * vectors, exception return, part of the slb and stab
  5. * handling and other fixed offset specific things.
  6. *
  7. * This file is meant to be #included from head_64.S due to
  8. * position dependent assembly.
  9. *
  10. * Most of this originates from head_64.S and thus has the same
  11. * copyright history.
  12. *
  13. */
  14. #include <asm/exception-64s.h>
  15. #include <asm/ptrace.h>
  16. /*
  17. * We layout physical memory as follows:
  18. * 0x0000 - 0x00ff : Secondary processor spin code
  19. * 0x0100 - 0x2fff : pSeries Interrupt prologs
  20. * 0x3000 - 0x5fff : interrupt support, iSeries and common interrupt prologs
  21. * 0x6000 - 0x6fff : Initial (CPU0) segment table
  22. * 0x7000 - 0x7fff : FWNMI data area
  23. * 0x8000 - : Early init and support code
  24. */
  25. /*
  26. * This is the start of the interrupt handlers for pSeries
  27. * This code runs with relocation off.
  28. * Code from here to __end_interrupts gets copied down to real
  29. * address 0x100 when we are running a relocatable kernel.
  30. * Therefore any relative branches in this section must only
  31. * branch to labels in this section.
  32. */
  33. . = 0x100
  34. .globl __start_interrupts
  35. __start_interrupts:
  36. .globl system_reset_pSeries;
  37. system_reset_pSeries:
  38. HMT_MEDIUM;
  39. DO_KVM 0x100;
  40. SET_SCRATCH0(r13)
  41. #ifdef CONFIG_PPC_P7_NAP
  42. BEGIN_FTR_SECTION
  43. /* Running native on arch 2.06 or later, check if we are
  44. * waking up from nap. We only handle no state loss and
  45. * supervisor state loss. We do -not- handle hypervisor
  46. * state loss at this time.
  47. */
  48. mfspr r13,SPRN_SRR1
  49. rlwinm r13,r13,47-31,30,31
  50. cmpwi cr0,r13,1
  51. bne 1f
  52. b .power7_wakeup_noloss
  53. 1: cmpwi cr0,r13,2
  54. bne 1f
  55. b .power7_wakeup_loss
  56. /* Total loss of HV state is fatal, we could try to use the
  57. * PIR to locate a PACA, then use an emergency stack etc...
  58. * but for now, let's just stay stuck here
  59. */
  60. 1: cmpwi cr0,r13,3
  61. beq .
  62. END_FTR_SECTION_IFSET(CPU_FTR_HVMODE_206)
  63. #endif /* CONFIG_PPC_P7_NAP */
  64. EXCEPTION_PROLOG_PSERIES(PACA_EXGEN, system_reset_common, EXC_STD)
  65. . = 0x200
  66. _machine_check_pSeries:
  67. HMT_MEDIUM
  68. DO_KVM 0x200
  69. SET_SCRATCH0(r13)
  70. EXCEPTION_PROLOG_PSERIES(PACA_EXMC, machine_check_common, EXC_STD)
  71. . = 0x300
  72. .globl data_access_pSeries
  73. data_access_pSeries:
  74. HMT_MEDIUM
  75. DO_KVM 0x300
  76. SET_SCRATCH0(r13)
  77. BEGIN_FTR_SECTION
  78. GET_PACA(r13)
  79. std r9,PACA_EXSLB+EX_R9(r13)
  80. std r10,PACA_EXSLB+EX_R10(r13)
  81. mfspr r10,SPRN_DAR
  82. mfspr r9,SPRN_DSISR
  83. srdi r10,r10,60
  84. rlwimi r10,r9,16,0x20
  85. mfcr r9
  86. cmpwi r10,0x2c
  87. beq do_stab_bolted_pSeries
  88. ld r10,PACA_EXSLB+EX_R10(r13)
  89. std r11,PACA_EXGEN+EX_R11(r13)
  90. ld r11,PACA_EXSLB+EX_R9(r13)
  91. std r12,PACA_EXGEN+EX_R12(r13)
  92. GET_SCRATCH0(r12)
  93. std r10,PACA_EXGEN+EX_R10(r13)
  94. std r11,PACA_EXGEN+EX_R9(r13)
  95. std r12,PACA_EXGEN+EX_R13(r13)
  96. EXCEPTION_PROLOG_PSERIES_1(data_access_common, EXC_STD)
  97. FTR_SECTION_ELSE
  98. EXCEPTION_PROLOG_PSERIES(PACA_EXGEN, data_access_common, EXC_STD)
  99. ALT_MMU_FTR_SECTION_END_IFCLR(MMU_FTR_SLB)
  100. . = 0x380
  101. .globl data_access_slb_pSeries
  102. data_access_slb_pSeries:
  103. HMT_MEDIUM
  104. DO_KVM 0x380
  105. SET_SCRATCH0(r13)
  106. GET_PACA(r13)
  107. std r3,PACA_EXSLB+EX_R3(r13)
  108. mfspr r3,SPRN_DAR
  109. std r9,PACA_EXSLB+EX_R9(r13) /* save r9 - r12 */
  110. mfcr r9
  111. #ifdef __DISABLED__
  112. /* Keep that around for when we re-implement dynamic VSIDs */
  113. cmpdi r3,0
  114. bge slb_miss_user_pseries
  115. #endif /* __DISABLED__ */
  116. std r10,PACA_EXSLB+EX_R10(r13)
  117. std r11,PACA_EXSLB+EX_R11(r13)
  118. std r12,PACA_EXSLB+EX_R12(r13)
  119. GET_SCRATCH0(r10)
  120. std r10,PACA_EXSLB+EX_R13(r13)
  121. mfspr r12,SPRN_SRR1 /* and SRR1 */
  122. #ifndef CONFIG_RELOCATABLE
  123. b .slb_miss_realmode
  124. #else
  125. /*
  126. * We can't just use a direct branch to .slb_miss_realmode
  127. * because the distance from here to there depends on where
  128. * the kernel ends up being put.
  129. */
  130. mfctr r11
  131. ld r10,PACAKBASE(r13)
  132. LOAD_HANDLER(r10, .slb_miss_realmode)
  133. mtctr r10
  134. bctr
  135. #endif
  136. STD_EXCEPTION_PSERIES(0x400, 0x400, instruction_access)
  137. . = 0x480
  138. .globl instruction_access_slb_pSeries
  139. instruction_access_slb_pSeries:
  140. HMT_MEDIUM
  141. DO_KVM 0x480
  142. SET_SCRATCH0(r13)
  143. GET_PACA(r13)
  144. std r3,PACA_EXSLB+EX_R3(r13)
  145. mfspr r3,SPRN_SRR0 /* SRR0 is faulting address */
  146. std r9,PACA_EXSLB+EX_R9(r13) /* save r9 - r12 */
  147. mfcr r9
  148. #ifdef __DISABLED__
  149. /* Keep that around for when we re-implement dynamic VSIDs */
  150. cmpdi r3,0
  151. bge slb_miss_user_pseries
  152. #endif /* __DISABLED__ */
  153. std r10,PACA_EXSLB+EX_R10(r13)
  154. std r11,PACA_EXSLB+EX_R11(r13)
  155. std r12,PACA_EXSLB+EX_R12(r13)
  156. GET_SCRATCH0(r10)
  157. std r10,PACA_EXSLB+EX_R13(r13)
  158. mfspr r12,SPRN_SRR1 /* and SRR1 */
  159. #ifndef CONFIG_RELOCATABLE
  160. b .slb_miss_realmode
  161. #else
  162. mfctr r11
  163. ld r10,PACAKBASE(r13)
  164. LOAD_HANDLER(r10, .slb_miss_realmode)
  165. mtctr r10
  166. bctr
  167. #endif
  168. /* We open code these as we can't have a ". = x" (even with
  169. * x = "." within a feature section
  170. */
  171. . = 0x500;
  172. .globl hardware_interrupt_pSeries;
  173. .globl hardware_interrupt_hv;
  174. hardware_interrupt_pSeries:
  175. hardware_interrupt_hv:
  176. BEGIN_FTR_SECTION
  177. _MASKABLE_EXCEPTION_PSERIES(0x500, hardware_interrupt, EXC_STD)
  178. FTR_SECTION_ELSE
  179. _MASKABLE_EXCEPTION_PSERIES(0x502, hardware_interrupt, EXC_HV)
  180. ALT_FTR_SECTION_END_IFCLR(CPU_FTR_HVMODE_206)
  181. STD_EXCEPTION_PSERIES(0x600, 0x600, alignment)
  182. STD_EXCEPTION_PSERIES(0x700, 0x700, program_check)
  183. STD_EXCEPTION_PSERIES(0x800, 0x800, fp_unavailable)
  184. MASKABLE_EXCEPTION_PSERIES(0x900, 0x900, decrementer)
  185. MASKABLE_EXCEPTION_HV(0x980, 0x980, decrementer)
  186. STD_EXCEPTION_PSERIES(0xa00, 0xa00, trap_0a)
  187. STD_EXCEPTION_PSERIES(0xb00, 0xb00, trap_0b)
  188. . = 0xc00
  189. .globl system_call_pSeries
  190. system_call_pSeries:
  191. HMT_MEDIUM
  192. DO_KVM 0xc00
  193. BEGIN_FTR_SECTION
  194. cmpdi r0,0x1ebe
  195. beq- 1f
  196. END_FTR_SECTION_IFSET(CPU_FTR_REAL_LE)
  197. mr r9,r13
  198. GET_PACA(r13)
  199. mfspr r11,SPRN_SRR0
  200. mfspr r12,SPRN_SRR1
  201. ld r10,PACAKBASE(r13)
  202. LOAD_HANDLER(r10, system_call_entry)
  203. mtspr SPRN_SRR0,r10
  204. ld r10,PACAKMSR(r13)
  205. mtspr SPRN_SRR1,r10
  206. rfid
  207. b . /* prevent speculative execution */
  208. /* Fast LE/BE switch system call */
  209. 1: mfspr r12,SPRN_SRR1
  210. xori r12,r12,MSR_LE
  211. mtspr SPRN_SRR1,r12
  212. rfid /* return to userspace */
  213. b .
  214. STD_EXCEPTION_PSERIES(0xd00, 0xd00, single_step)
  215. /* At 0xe??? we have a bunch of hypervisor exceptions, we branch
  216. * out of line to handle them
  217. */
  218. . = 0xe00
  219. b h_data_storage_hv
  220. . = 0xe20
  221. b h_instr_storage_hv
  222. . = 0xe40
  223. b emulation_assist_hv
  224. . = 0xe50
  225. b hmi_exception_hv
  226. . = 0xe60
  227. b hmi_exception_hv
  228. /* We need to deal with the Altivec unavailable exception
  229. * here which is at 0xf20, thus in the middle of the
  230. * prolog code of the PerformanceMonitor one. A little
  231. * trickery is thus necessary
  232. */
  233. performance_monitor_pSeries_1:
  234. . = 0xf00
  235. b performance_monitor_pSeries
  236. altivec_unavailable_pSeries_1:
  237. . = 0xf20
  238. b altivec_unavailable_pSeries
  239. vsx_unavailable_pSeries_1:
  240. . = 0xf40
  241. b vsx_unavailable_pSeries
  242. #ifdef CONFIG_CBE_RAS
  243. STD_EXCEPTION_HV(0x1200, 0x1202, cbe_system_error)
  244. #endif /* CONFIG_CBE_RAS */
  245. STD_EXCEPTION_PSERIES(0x1300, 0x1300, instruction_breakpoint)
  246. #ifdef CONFIG_CBE_RAS
  247. STD_EXCEPTION_HV(0x1600, 0x1602, cbe_maintenance)
  248. #endif /* CONFIG_CBE_RAS */
  249. STD_EXCEPTION_PSERIES(0x1700, 0x1700, altivec_assist)
  250. #ifdef CONFIG_CBE_RAS
  251. STD_EXCEPTION_HV(0x1800, 0x1802, cbe_thermal)
  252. #endif /* CONFIG_CBE_RAS */
  253. . = 0x3000
  254. /*** Out of line interrupts support ***/
  255. /* moved from 0xe00 */
  256. STD_EXCEPTION_HV(., 0xe00, h_data_storage)
  257. STD_EXCEPTION_HV(., 0xe20, h_instr_storage)
  258. STD_EXCEPTION_HV(., 0xe40, emulation_assist)
  259. STD_EXCEPTION_HV(., 0xe60, hmi_exception) /* need to flush cache ? */
  260. /* moved from 0xf00 */
  261. STD_EXCEPTION_PSERIES(., 0xf00, performance_monitor)
  262. STD_EXCEPTION_PSERIES(., 0xf20, altivec_unavailable)
  263. STD_EXCEPTION_PSERIES(., 0xf40, vsx_unavailable)
  264. /*
  265. * An interrupt came in while soft-disabled; clear EE in SRR1,
  266. * clear paca->hard_enabled and return.
  267. */
  268. masked_interrupt:
  269. stb r10,PACAHARDIRQEN(r13)
  270. mtcrf 0x80,r9
  271. ld r9,PACA_EXGEN+EX_R9(r13)
  272. mfspr r10,SPRN_SRR1
  273. rldicl r10,r10,48,1 /* clear MSR_EE */
  274. rotldi r10,r10,16
  275. mtspr SPRN_SRR1,r10
  276. ld r10,PACA_EXGEN+EX_R10(r13)
  277. GET_SCRATCH0(r13)
  278. rfid
  279. b .
  280. masked_Hinterrupt:
  281. stb r10,PACAHARDIRQEN(r13)
  282. mtcrf 0x80,r9
  283. ld r9,PACA_EXGEN+EX_R9(r13)
  284. mfspr r10,SPRN_HSRR1
  285. rldicl r10,r10,48,1 /* clear MSR_EE */
  286. rotldi r10,r10,16
  287. mtspr SPRN_HSRR1,r10
  288. ld r10,PACA_EXGEN+EX_R10(r13)
  289. GET_SCRATCH0(r13)
  290. hrfid
  291. b .
  292. .align 7
  293. do_stab_bolted_pSeries:
  294. std r11,PACA_EXSLB+EX_R11(r13)
  295. std r12,PACA_EXSLB+EX_R12(r13)
  296. GET_SCRATCH0(r10)
  297. std r10,PACA_EXSLB+EX_R13(r13)
  298. EXCEPTION_PROLOG_PSERIES_1(.do_stab_bolted, EXC_STD)
  299. #ifdef CONFIG_PPC_PSERIES
  300. /*
  301. * Vectors for the FWNMI option. Share common code.
  302. */
  303. .globl system_reset_fwnmi
  304. .align 7
  305. system_reset_fwnmi:
  306. HMT_MEDIUM
  307. SET_SCRATCH0(r13) /* save r13 */
  308. EXCEPTION_PROLOG_PSERIES(PACA_EXGEN, system_reset_common, EXC_STD)
  309. .globl machine_check_fwnmi
  310. .align 7
  311. machine_check_fwnmi:
  312. HMT_MEDIUM
  313. SET_SCRATCH0(r13) /* save r13 */
  314. EXCEPTION_PROLOG_PSERIES(PACA_EXMC, machine_check_common, EXC_STD)
  315. #endif /* CONFIG_PPC_PSERIES */
  316. #ifdef __DISABLED__
  317. /*
  318. * This is used for when the SLB miss handler has to go virtual,
  319. * which doesn't happen for now anymore but will once we re-implement
  320. * dynamic VSIDs for shared page tables
  321. */
  322. slb_miss_user_pseries:
  323. std r10,PACA_EXGEN+EX_R10(r13)
  324. std r11,PACA_EXGEN+EX_R11(r13)
  325. std r12,PACA_EXGEN+EX_R12(r13)
  326. GET_SCRATCH0(r10)
  327. ld r11,PACA_EXSLB+EX_R9(r13)
  328. ld r12,PACA_EXSLB+EX_R3(r13)
  329. std r10,PACA_EXGEN+EX_R13(r13)
  330. std r11,PACA_EXGEN+EX_R9(r13)
  331. std r12,PACA_EXGEN+EX_R3(r13)
  332. clrrdi r12,r13,32
  333. mfmsr r10
  334. mfspr r11,SRR0 /* save SRR0 */
  335. ori r12,r12,slb_miss_user_common@l /* virt addr of handler */
  336. ori r10,r10,MSR_IR|MSR_DR|MSR_RI
  337. mtspr SRR0,r12
  338. mfspr r12,SRR1 /* and SRR1 */
  339. mtspr SRR1,r10
  340. rfid
  341. b . /* prevent spec. execution */
  342. #endif /* __DISABLED__ */
  343. /* KVM's trampoline code needs to be close to the interrupt handlers */
  344. #ifdef CONFIG_KVM_BOOK3S_64_HANDLER
  345. #include "../kvm/book3s_rmhandlers.S"
  346. #endif
  347. .align 7
  348. .globl __end_interrupts
  349. __end_interrupts:
  350. /*
  351. * Code from here down to __end_handlers is invoked from the
  352. * exception prologs above. Because the prologs assemble the
  353. * addresses of these handlers using the LOAD_HANDLER macro,
  354. * which uses an addi instruction, these handlers must be in
  355. * the first 32k of the kernel image.
  356. */
  357. /*** Common interrupt handlers ***/
  358. STD_EXCEPTION_COMMON(0x100, system_reset, .system_reset_exception)
  359. /*
  360. * Machine check is different because we use a different
  361. * save area: PACA_EXMC instead of PACA_EXGEN.
  362. */
  363. .align 7
  364. .globl machine_check_common
  365. machine_check_common:
  366. EXCEPTION_PROLOG_COMMON(0x200, PACA_EXMC)
  367. FINISH_NAP
  368. DISABLE_INTS
  369. bl .save_nvgprs
  370. addi r3,r1,STACK_FRAME_OVERHEAD
  371. bl .machine_check_exception
  372. b .ret_from_except
  373. STD_EXCEPTION_COMMON_LITE(0x900, decrementer, .timer_interrupt)
  374. STD_EXCEPTION_COMMON(0xa00, trap_0a, .unknown_exception)
  375. STD_EXCEPTION_COMMON(0xb00, trap_0b, .unknown_exception)
  376. STD_EXCEPTION_COMMON(0xd00, single_step, .single_step_exception)
  377. STD_EXCEPTION_COMMON(0xe00, trap_0e, .unknown_exception)
  378. STD_EXCEPTION_COMMON(0xe40, emulation_assist, .program_check_exception)
  379. STD_EXCEPTION_COMMON(0xe60, hmi_exception, .unknown_exception)
  380. STD_EXCEPTION_COMMON_IDLE(0xf00, performance_monitor, .performance_monitor_exception)
  381. STD_EXCEPTION_COMMON(0x1300, instruction_breakpoint, .instruction_breakpoint_exception)
  382. #ifdef CONFIG_ALTIVEC
  383. STD_EXCEPTION_COMMON(0x1700, altivec_assist, .altivec_assist_exception)
  384. #else
  385. STD_EXCEPTION_COMMON(0x1700, altivec_assist, .unknown_exception)
  386. #endif
  387. #ifdef CONFIG_CBE_RAS
  388. STD_EXCEPTION_COMMON(0x1200, cbe_system_error, .cbe_system_error_exception)
  389. STD_EXCEPTION_COMMON(0x1600, cbe_maintenance, .cbe_maintenance_exception)
  390. STD_EXCEPTION_COMMON(0x1800, cbe_thermal, .cbe_thermal_exception)
  391. #endif /* CONFIG_CBE_RAS */
  392. .align 7
  393. system_call_entry:
  394. b system_call_common
  395. /*
  396. * Here we have detected that the kernel stack pointer is bad.
  397. * R9 contains the saved CR, r13 points to the paca,
  398. * r10 contains the (bad) kernel stack pointer,
  399. * r11 and r12 contain the saved SRR0 and SRR1.
  400. * We switch to using an emergency stack, save the registers there,
  401. * and call kernel_bad_stack(), which panics.
  402. */
  403. bad_stack:
  404. ld r1,PACAEMERGSP(r13)
  405. subi r1,r1,64+INT_FRAME_SIZE
  406. std r9,_CCR(r1)
  407. std r10,GPR1(r1)
  408. std r11,_NIP(r1)
  409. std r12,_MSR(r1)
  410. mfspr r11,SPRN_DAR
  411. mfspr r12,SPRN_DSISR
  412. std r11,_DAR(r1)
  413. std r12,_DSISR(r1)
  414. mflr r10
  415. mfctr r11
  416. mfxer r12
  417. std r10,_LINK(r1)
  418. std r11,_CTR(r1)
  419. std r12,_XER(r1)
  420. SAVE_GPR(0,r1)
  421. SAVE_GPR(2,r1)
  422. ld r10,EX_R3(r3)
  423. std r10,GPR3(r1)
  424. SAVE_GPR(4,r1)
  425. SAVE_4GPRS(5,r1)
  426. ld r9,EX_R9(r3)
  427. ld r10,EX_R10(r3)
  428. SAVE_2GPRS(9,r1)
  429. ld r9,EX_R11(r3)
  430. ld r10,EX_R12(r3)
  431. ld r11,EX_R13(r3)
  432. std r9,GPR11(r1)
  433. std r10,GPR12(r1)
  434. std r11,GPR13(r1)
  435. BEGIN_FTR_SECTION
  436. ld r10,EX_CFAR(r3)
  437. std r10,ORIG_GPR3(r1)
  438. END_FTR_SECTION_IFSET(CPU_FTR_CFAR)
  439. SAVE_8GPRS(14,r1)
  440. SAVE_10GPRS(22,r1)
  441. lhz r12,PACA_TRAP_SAVE(r13)
  442. std r12,_TRAP(r1)
  443. addi r11,r1,INT_FRAME_SIZE
  444. std r11,0(r1)
  445. li r12,0
  446. std r12,0(r11)
  447. ld r2,PACATOC(r13)
  448. ld r11,exception_marker@toc(r2)
  449. std r12,RESULT(r1)
  450. std r11,STACK_FRAME_OVERHEAD-16(r1)
  451. 1: addi r3,r1,STACK_FRAME_OVERHEAD
  452. bl .kernel_bad_stack
  453. b 1b
  454. /*
  455. * Here r13 points to the paca, r9 contains the saved CR,
  456. * SRR0 and SRR1 are saved in r11 and r12,
  457. * r9 - r13 are saved in paca->exgen.
  458. */
  459. .align 7
  460. .globl data_access_common
  461. data_access_common:
  462. mfspr r10,SPRN_DAR
  463. std r10,PACA_EXGEN+EX_DAR(r13)
  464. mfspr r10,SPRN_DSISR
  465. stw r10,PACA_EXGEN+EX_DSISR(r13)
  466. EXCEPTION_PROLOG_COMMON(0x300, PACA_EXGEN)
  467. ld r3,PACA_EXGEN+EX_DAR(r13)
  468. lwz r4,PACA_EXGEN+EX_DSISR(r13)
  469. li r5,0x300
  470. b .do_hash_page /* Try to handle as hpte fault */
  471. .align 7
  472. .globl h_data_storage_common
  473. h_data_storage_common:
  474. mfspr r10,SPRN_HDAR
  475. std r10,PACA_EXGEN+EX_DAR(r13)
  476. mfspr r10,SPRN_HDSISR
  477. stw r10,PACA_EXGEN+EX_DSISR(r13)
  478. EXCEPTION_PROLOG_COMMON(0xe00, PACA_EXGEN)
  479. bl .save_nvgprs
  480. addi r3,r1,STACK_FRAME_OVERHEAD
  481. bl .unknown_exception
  482. b .ret_from_except
  483. .align 7
  484. .globl instruction_access_common
  485. instruction_access_common:
  486. EXCEPTION_PROLOG_COMMON(0x400, PACA_EXGEN)
  487. ld r3,_NIP(r1)
  488. andis. r4,r12,0x5820
  489. li r5,0x400
  490. b .do_hash_page /* Try to handle as hpte fault */
  491. STD_EXCEPTION_COMMON(0xe20, h_instr_storage, .unknown_exception)
  492. /*
  493. * Here is the common SLB miss user that is used when going to virtual
  494. * mode for SLB misses, that is currently not used
  495. */
  496. #ifdef __DISABLED__
  497. .align 7
  498. .globl slb_miss_user_common
  499. slb_miss_user_common:
  500. mflr r10
  501. std r3,PACA_EXGEN+EX_DAR(r13)
  502. stw r9,PACA_EXGEN+EX_CCR(r13)
  503. std r10,PACA_EXGEN+EX_LR(r13)
  504. std r11,PACA_EXGEN+EX_SRR0(r13)
  505. bl .slb_allocate_user
  506. ld r10,PACA_EXGEN+EX_LR(r13)
  507. ld r3,PACA_EXGEN+EX_R3(r13)
  508. lwz r9,PACA_EXGEN+EX_CCR(r13)
  509. ld r11,PACA_EXGEN+EX_SRR0(r13)
  510. mtlr r10
  511. beq- slb_miss_fault
  512. andi. r10,r12,MSR_RI /* check for unrecoverable exception */
  513. beq- unrecov_user_slb
  514. mfmsr r10
  515. .machine push
  516. .machine "power4"
  517. mtcrf 0x80,r9
  518. .machine pop
  519. clrrdi r10,r10,2 /* clear RI before setting SRR0/1 */
  520. mtmsrd r10,1
  521. mtspr SRR0,r11
  522. mtspr SRR1,r12
  523. ld r9,PACA_EXGEN+EX_R9(r13)
  524. ld r10,PACA_EXGEN+EX_R10(r13)
  525. ld r11,PACA_EXGEN+EX_R11(r13)
  526. ld r12,PACA_EXGEN+EX_R12(r13)
  527. ld r13,PACA_EXGEN+EX_R13(r13)
  528. rfid
  529. b .
  530. slb_miss_fault:
  531. EXCEPTION_PROLOG_COMMON(0x380, PACA_EXGEN)
  532. ld r4,PACA_EXGEN+EX_DAR(r13)
  533. li r5,0
  534. std r4,_DAR(r1)
  535. std r5,_DSISR(r1)
  536. b handle_page_fault
  537. unrecov_user_slb:
  538. EXCEPTION_PROLOG_COMMON(0x4200, PACA_EXGEN)
  539. DISABLE_INTS
  540. bl .save_nvgprs
  541. 1: addi r3,r1,STACK_FRAME_OVERHEAD
  542. bl .unrecoverable_exception
  543. b 1b
  544. #endif /* __DISABLED__ */
  545. /*
  546. * r13 points to the PACA, r9 contains the saved CR,
  547. * r12 contain the saved SRR1, SRR0 is still ready for return
  548. * r3 has the faulting address
  549. * r9 - r13 are saved in paca->exslb.
  550. * r3 is saved in paca->slb_r3
  551. * We assume we aren't going to take any exceptions during this procedure.
  552. */
  553. _GLOBAL(slb_miss_realmode)
  554. mflr r10
  555. #ifdef CONFIG_RELOCATABLE
  556. mtctr r11
  557. #endif
  558. stw r9,PACA_EXSLB+EX_CCR(r13) /* save CR in exc. frame */
  559. std r10,PACA_EXSLB+EX_LR(r13) /* save LR */
  560. bl .slb_allocate_realmode
  561. /* All done -- return from exception. */
  562. ld r10,PACA_EXSLB+EX_LR(r13)
  563. ld r3,PACA_EXSLB+EX_R3(r13)
  564. lwz r9,PACA_EXSLB+EX_CCR(r13) /* get saved CR */
  565. #ifdef CONFIG_PPC_ISERIES
  566. BEGIN_FW_FTR_SECTION
  567. ld r11,PACALPPACAPTR(r13)
  568. ld r11,LPPACASRR0(r11) /* get SRR0 value */
  569. END_FW_FTR_SECTION_IFSET(FW_FEATURE_ISERIES)
  570. #endif /* CONFIG_PPC_ISERIES */
  571. mtlr r10
  572. andi. r10,r12,MSR_RI /* check for unrecoverable exception */
  573. beq- 2f
  574. .machine push
  575. .machine "power4"
  576. mtcrf 0x80,r9
  577. mtcrf 0x01,r9 /* slb_allocate uses cr0 and cr7 */
  578. .machine pop
  579. #ifdef CONFIG_PPC_ISERIES
  580. BEGIN_FW_FTR_SECTION
  581. mtspr SPRN_SRR0,r11
  582. mtspr SPRN_SRR1,r12
  583. END_FW_FTR_SECTION_IFSET(FW_FEATURE_ISERIES)
  584. #endif /* CONFIG_PPC_ISERIES */
  585. ld r9,PACA_EXSLB+EX_R9(r13)
  586. ld r10,PACA_EXSLB+EX_R10(r13)
  587. ld r11,PACA_EXSLB+EX_R11(r13)
  588. ld r12,PACA_EXSLB+EX_R12(r13)
  589. ld r13,PACA_EXSLB+EX_R13(r13)
  590. rfid
  591. b . /* prevent speculative execution */
  592. 2:
  593. #ifdef CONFIG_PPC_ISERIES
  594. BEGIN_FW_FTR_SECTION
  595. b unrecov_slb
  596. END_FW_FTR_SECTION_IFSET(FW_FEATURE_ISERIES)
  597. #endif /* CONFIG_PPC_ISERIES */
  598. mfspr r11,SPRN_SRR0
  599. ld r10,PACAKBASE(r13)
  600. LOAD_HANDLER(r10,unrecov_slb)
  601. mtspr SPRN_SRR0,r10
  602. ld r10,PACAKMSR(r13)
  603. mtspr SPRN_SRR1,r10
  604. rfid
  605. b .
  606. unrecov_slb:
  607. EXCEPTION_PROLOG_COMMON(0x4100, PACA_EXSLB)
  608. DISABLE_INTS
  609. bl .save_nvgprs
  610. 1: addi r3,r1,STACK_FRAME_OVERHEAD
  611. bl .unrecoverable_exception
  612. b 1b
  613. .align 7
  614. .globl hardware_interrupt_common
  615. .globl hardware_interrupt_entry
  616. hardware_interrupt_common:
  617. EXCEPTION_PROLOG_COMMON(0x500, PACA_EXGEN)
  618. FINISH_NAP
  619. hardware_interrupt_entry:
  620. DISABLE_INTS
  621. BEGIN_FTR_SECTION
  622. bl .ppc64_runlatch_on
  623. END_FTR_SECTION_IFSET(CPU_FTR_CTRL)
  624. addi r3,r1,STACK_FRAME_OVERHEAD
  625. bl .do_IRQ
  626. b .ret_from_except_lite
  627. #ifdef CONFIG_PPC_970_NAP
  628. power4_fixup_nap:
  629. andc r9,r9,r10
  630. std r9,TI_LOCAL_FLAGS(r11)
  631. ld r10,_LINK(r1) /* make idle task do the */
  632. std r10,_NIP(r1) /* equivalent of a blr */
  633. blr
  634. #endif
  635. .align 7
  636. .globl alignment_common
  637. alignment_common:
  638. mfspr r10,SPRN_DAR
  639. std r10,PACA_EXGEN+EX_DAR(r13)
  640. mfspr r10,SPRN_DSISR
  641. stw r10,PACA_EXGEN+EX_DSISR(r13)
  642. EXCEPTION_PROLOG_COMMON(0x600, PACA_EXGEN)
  643. ld r3,PACA_EXGEN+EX_DAR(r13)
  644. lwz r4,PACA_EXGEN+EX_DSISR(r13)
  645. std r3,_DAR(r1)
  646. std r4,_DSISR(r1)
  647. bl .save_nvgprs
  648. addi r3,r1,STACK_FRAME_OVERHEAD
  649. ENABLE_INTS
  650. bl .alignment_exception
  651. b .ret_from_except
  652. .align 7
  653. .globl program_check_common
  654. program_check_common:
  655. EXCEPTION_PROLOG_COMMON(0x700, PACA_EXGEN)
  656. bl .save_nvgprs
  657. addi r3,r1,STACK_FRAME_OVERHEAD
  658. ENABLE_INTS
  659. bl .program_check_exception
  660. b .ret_from_except
  661. .align 7
  662. .globl fp_unavailable_common
  663. fp_unavailable_common:
  664. EXCEPTION_PROLOG_COMMON(0x800, PACA_EXGEN)
  665. bne 1f /* if from user, just load it up */
  666. bl .save_nvgprs
  667. addi r3,r1,STACK_FRAME_OVERHEAD
  668. ENABLE_INTS
  669. bl .kernel_fp_unavailable_exception
  670. BUG_OPCODE
  671. 1: bl .load_up_fpu
  672. b fast_exception_return
  673. .align 7
  674. .globl altivec_unavailable_common
  675. altivec_unavailable_common:
  676. EXCEPTION_PROLOG_COMMON(0xf20, PACA_EXGEN)
  677. #ifdef CONFIG_ALTIVEC
  678. BEGIN_FTR_SECTION
  679. beq 1f
  680. bl .load_up_altivec
  681. b fast_exception_return
  682. 1:
  683. END_FTR_SECTION_IFSET(CPU_FTR_ALTIVEC)
  684. #endif
  685. bl .save_nvgprs
  686. addi r3,r1,STACK_FRAME_OVERHEAD
  687. ENABLE_INTS
  688. bl .altivec_unavailable_exception
  689. b .ret_from_except
  690. .align 7
  691. .globl vsx_unavailable_common
  692. vsx_unavailable_common:
  693. EXCEPTION_PROLOG_COMMON(0xf40, PACA_EXGEN)
  694. #ifdef CONFIG_VSX
  695. BEGIN_FTR_SECTION
  696. bne .load_up_vsx
  697. 1:
  698. END_FTR_SECTION_IFSET(CPU_FTR_VSX)
  699. #endif
  700. bl .save_nvgprs
  701. addi r3,r1,STACK_FRAME_OVERHEAD
  702. ENABLE_INTS
  703. bl .vsx_unavailable_exception
  704. b .ret_from_except
  705. .align 7
  706. .globl __end_handlers
  707. __end_handlers:
  708. /*
  709. * Return from an exception with minimal checks.
  710. * The caller is assumed to have done EXCEPTION_PROLOG_COMMON.
  711. * If interrupts have been enabled, or anything has been
  712. * done that might have changed the scheduling status of
  713. * any task or sent any task a signal, you should use
  714. * ret_from_except or ret_from_except_lite instead of this.
  715. */
  716. fast_exc_return_irq: /* restores irq state too */
  717. ld r3,SOFTE(r1)
  718. TRACE_AND_RESTORE_IRQ(r3);
  719. ld r12,_MSR(r1)
  720. rldicl r4,r12,49,63 /* get MSR_EE to LSB */
  721. stb r4,PACAHARDIRQEN(r13) /* restore paca->hard_enabled */
  722. b 1f
  723. .globl fast_exception_return
  724. fast_exception_return:
  725. ld r12,_MSR(r1)
  726. 1: ld r11,_NIP(r1)
  727. andi. r3,r12,MSR_RI /* check if RI is set */
  728. beq- unrecov_fer
  729. #ifdef CONFIG_VIRT_CPU_ACCOUNTING
  730. andi. r3,r12,MSR_PR
  731. beq 2f
  732. ACCOUNT_CPU_USER_EXIT(r3, r4)
  733. 2:
  734. #endif
  735. ld r3,_CCR(r1)
  736. ld r4,_LINK(r1)
  737. ld r5,_CTR(r1)
  738. ld r6,_XER(r1)
  739. mtcr r3
  740. mtlr r4
  741. mtctr r5
  742. mtxer r6
  743. REST_GPR(0, r1)
  744. REST_8GPRS(2, r1)
  745. mfmsr r10
  746. rldicl r10,r10,48,1 /* clear EE */
  747. rldicr r10,r10,16,61 /* clear RI (LE is 0 already) */
  748. mtmsrd r10,1
  749. mtspr SPRN_SRR1,r12
  750. mtspr SPRN_SRR0,r11
  751. REST_4GPRS(10, r1)
  752. ld r1,GPR1(r1)
  753. rfid
  754. b . /* prevent speculative execution */
  755. unrecov_fer:
  756. bl .save_nvgprs
  757. 1: addi r3,r1,STACK_FRAME_OVERHEAD
  758. bl .unrecoverable_exception
  759. b 1b
  760. /*
  761. * Hash table stuff
  762. */
  763. .align 7
  764. _STATIC(do_hash_page)
  765. std r3,_DAR(r1)
  766. std r4,_DSISR(r1)
  767. andis. r0,r4,0xa410 /* weird error? */
  768. bne- handle_page_fault /* if not, try to insert a HPTE */
  769. andis. r0,r4,DSISR_DABRMATCH@h
  770. bne- handle_dabr_fault
  771. BEGIN_FTR_SECTION
  772. andis. r0,r4,0x0020 /* Is it a segment table fault? */
  773. bne- do_ste_alloc /* If so handle it */
  774. END_MMU_FTR_SECTION_IFCLR(MMU_FTR_SLB)
  775. clrrdi r11,r1,THREAD_SHIFT
  776. lwz r0,TI_PREEMPT(r11) /* If we're in an "NMI" */
  777. andis. r0,r0,NMI_MASK@h /* (i.e. an irq when soft-disabled) */
  778. bne 77f /* then don't call hash_page now */
  779. /*
  780. * On iSeries, we soft-disable interrupts here, then
  781. * hard-enable interrupts so that the hash_page code can spin on
  782. * the hash_table_lock without problems on a shared processor.
  783. */
  784. DISABLE_INTS
  785. /*
  786. * Currently, trace_hardirqs_off() will be called by DISABLE_INTS
  787. * and will clobber volatile registers when irq tracing is enabled
  788. * so we need to reload them. It may be possible to be smarter here
  789. * and move the irq tracing elsewhere but let's keep it simple for
  790. * now
  791. */
  792. #ifdef CONFIG_TRACE_IRQFLAGS
  793. ld r3,_DAR(r1)
  794. ld r4,_DSISR(r1)
  795. ld r5,_TRAP(r1)
  796. ld r12,_MSR(r1)
  797. clrrdi r5,r5,4
  798. #endif /* CONFIG_TRACE_IRQFLAGS */
  799. /*
  800. * We need to set the _PAGE_USER bit if MSR_PR is set or if we are
  801. * accessing a userspace segment (even from the kernel). We assume
  802. * kernel addresses always have the high bit set.
  803. */
  804. rlwinm r4,r4,32-25+9,31-9,31-9 /* DSISR_STORE -> _PAGE_RW */
  805. rotldi r0,r3,15 /* Move high bit into MSR_PR posn */
  806. orc r0,r12,r0 /* MSR_PR | ~high_bit */
  807. rlwimi r4,r0,32-13,30,30 /* becomes _PAGE_USER access bit */
  808. ori r4,r4,1 /* add _PAGE_PRESENT */
  809. rlwimi r4,r5,22+2,31-2,31-2 /* Set _PAGE_EXEC if trap is 0x400 */
  810. /*
  811. * r3 contains the faulting address
  812. * r4 contains the required access permissions
  813. * r5 contains the trap number
  814. *
  815. * at return r3 = 0 for success
  816. */
  817. bl .hash_page /* build HPTE if possible */
  818. cmpdi r3,0 /* see if hash_page succeeded */
  819. BEGIN_FW_FTR_SECTION
  820. /*
  821. * If we had interrupts soft-enabled at the point where the
  822. * DSI/ISI occurred, and an interrupt came in during hash_page,
  823. * handle it now.
  824. * We jump to ret_from_except_lite rather than fast_exception_return
  825. * because ret_from_except_lite will check for and handle pending
  826. * interrupts if necessary.
  827. */
  828. beq 13f
  829. END_FW_FTR_SECTION_IFSET(FW_FEATURE_ISERIES)
  830. BEGIN_FW_FTR_SECTION
  831. /*
  832. * Here we have interrupts hard-disabled, so it is sufficient
  833. * to restore paca->{soft,hard}_enable and get out.
  834. */
  835. beq fast_exc_return_irq /* Return from exception on success */
  836. END_FW_FTR_SECTION_IFCLR(FW_FEATURE_ISERIES)
  837. /* For a hash failure, we don't bother re-enabling interrupts */
  838. ble- 12f
  839. /*
  840. * hash_page couldn't handle it, set soft interrupt enable back
  841. * to what it was before the trap. Note that .arch_local_irq_restore
  842. * handles any interrupts pending at this point.
  843. */
  844. ld r3,SOFTE(r1)
  845. TRACE_AND_RESTORE_IRQ_PARTIAL(r3, 11f)
  846. bl .arch_local_irq_restore
  847. b 11f
  848. /* We have a data breakpoint exception - handle it */
  849. handle_dabr_fault:
  850. bl .save_nvgprs
  851. ld r4,_DAR(r1)
  852. ld r5,_DSISR(r1)
  853. addi r3,r1,STACK_FRAME_OVERHEAD
  854. bl .do_dabr
  855. b .ret_from_except_lite
  856. /* Here we have a page fault that hash_page can't handle. */
  857. handle_page_fault:
  858. ENABLE_INTS
  859. 11: ld r4,_DAR(r1)
  860. ld r5,_DSISR(r1)
  861. addi r3,r1,STACK_FRAME_OVERHEAD
  862. bl .do_page_fault
  863. cmpdi r3,0
  864. beq+ 13f
  865. bl .save_nvgprs
  866. mr r5,r3
  867. addi r3,r1,STACK_FRAME_OVERHEAD
  868. lwz r4,_DAR(r1)
  869. bl .bad_page_fault
  870. b .ret_from_except
  871. 13: b .ret_from_except_lite
  872. /* We have a page fault that hash_page could handle but HV refused
  873. * the PTE insertion
  874. */
  875. 12: bl .save_nvgprs
  876. mr r5,r3
  877. addi r3,r1,STACK_FRAME_OVERHEAD
  878. ld r4,_DAR(r1)
  879. bl .low_hash_fault
  880. b .ret_from_except
  881. /*
  882. * We come here as a result of a DSI at a point where we don't want
  883. * to call hash_page, such as when we are accessing memory (possibly
  884. * user memory) inside a PMU interrupt that occurred while interrupts
  885. * were soft-disabled. We want to invoke the exception handler for
  886. * the access, or panic if there isn't a handler.
  887. */
  888. 77: bl .save_nvgprs
  889. mr r4,r3
  890. addi r3,r1,STACK_FRAME_OVERHEAD
  891. li r5,SIGSEGV
  892. bl .bad_page_fault
  893. b .ret_from_except
  894. /* here we have a segment miss */
  895. do_ste_alloc:
  896. bl .ste_allocate /* try to insert stab entry */
  897. cmpdi r3,0
  898. bne- handle_page_fault
  899. b fast_exception_return
  900. /*
  901. * r13 points to the PACA, r9 contains the saved CR,
  902. * r11 and r12 contain the saved SRR0 and SRR1.
  903. * r9 - r13 are saved in paca->exslb.
  904. * We assume we aren't going to take any exceptions during this procedure.
  905. * We assume (DAR >> 60) == 0xc.
  906. */
  907. .align 7
  908. _GLOBAL(do_stab_bolted)
  909. stw r9,PACA_EXSLB+EX_CCR(r13) /* save CR in exc. frame */
  910. std r11,PACA_EXSLB+EX_SRR0(r13) /* save SRR0 in exc. frame */
  911. /* Hash to the primary group */
  912. ld r10,PACASTABVIRT(r13)
  913. mfspr r11,SPRN_DAR
  914. srdi r11,r11,28
  915. rldimi r10,r11,7,52 /* r10 = first ste of the group */
  916. /* Calculate VSID */
  917. /* This is a kernel address, so protovsid = ESID */
  918. ASM_VSID_SCRAMBLE(r11, r9, 256M)
  919. rldic r9,r11,12,16 /* r9 = vsid << 12 */
  920. /* Search the primary group for a free entry */
  921. 1: ld r11,0(r10) /* Test valid bit of the current ste */
  922. andi. r11,r11,0x80
  923. beq 2f
  924. addi r10,r10,16
  925. andi. r11,r10,0x70
  926. bne 1b
  927. /* Stick for only searching the primary group for now. */
  928. /* At least for now, we use a very simple random castout scheme */
  929. /* Use the TB as a random number ; OR in 1 to avoid entry 0 */
  930. mftb r11
  931. rldic r11,r11,4,57 /* r11 = (r11 << 4) & 0x70 */
  932. ori r11,r11,0x10
  933. /* r10 currently points to an ste one past the group of interest */
  934. /* make it point to the randomly selected entry */
  935. subi r10,r10,128
  936. or r10,r10,r11 /* r10 is the entry to invalidate */
  937. isync /* mark the entry invalid */
  938. ld r11,0(r10)
  939. rldicl r11,r11,56,1 /* clear the valid bit */
  940. rotldi r11,r11,8
  941. std r11,0(r10)
  942. sync
  943. clrrdi r11,r11,28 /* Get the esid part of the ste */
  944. slbie r11
  945. 2: std r9,8(r10) /* Store the vsid part of the ste */
  946. eieio
  947. mfspr r11,SPRN_DAR /* Get the new esid */
  948. clrrdi r11,r11,28 /* Permits a full 32b of ESID */
  949. ori r11,r11,0x90 /* Turn on valid and kp */
  950. std r11,0(r10) /* Put new entry back into the stab */
  951. sync
  952. /* All done -- return from exception. */
  953. lwz r9,PACA_EXSLB+EX_CCR(r13) /* get saved CR */
  954. ld r11,PACA_EXSLB+EX_SRR0(r13) /* get saved SRR0 */
  955. andi. r10,r12,MSR_RI
  956. beq- unrecov_slb
  957. mtcrf 0x80,r9 /* restore CR */
  958. mfmsr r10
  959. clrrdi r10,r10,2
  960. mtmsrd r10,1
  961. mtspr SPRN_SRR0,r11
  962. mtspr SPRN_SRR1,r12
  963. ld r9,PACA_EXSLB+EX_R9(r13)
  964. ld r10,PACA_EXSLB+EX_R10(r13)
  965. ld r11,PACA_EXSLB+EX_R11(r13)
  966. ld r12,PACA_EXSLB+EX_R12(r13)
  967. ld r13,PACA_EXSLB+EX_R13(r13)
  968. rfid
  969. b . /* prevent speculative execution */
  970. #ifdef CONFIG_PPC_PSERIES
  971. /*
  972. * Data area reserved for FWNMI option.
  973. * This address (0x7000) is fixed by the RPA.
  974. */
  975. .= 0x7000
  976. .globl fwnmi_data_area
  977. fwnmi_data_area:
  978. #endif /* CONFIG_PPC_PSERIES */
  979. /* iSeries does not use the FWNMI stuff, so it is safe to put
  980. * this here, even if we later allow kernels that will boot on
  981. * both pSeries and iSeries */
  982. #ifdef CONFIG_PPC_ISERIES
  983. . = LPARMAP_PHYS
  984. .globl xLparMap
  985. xLparMap:
  986. .quad HvEsidsToMap /* xNumberEsids */
  987. .quad HvRangesToMap /* xNumberRanges */
  988. .quad STAB0_PAGE /* xSegmentTableOffs */
  989. .zero 40 /* xRsvd */
  990. /* xEsids (HvEsidsToMap entries of 2 quads) */
  991. .quad PAGE_OFFSET_ESID /* xKernelEsid */
  992. .quad PAGE_OFFSET_VSID /* xKernelVsid */
  993. .quad VMALLOC_START_ESID /* xKernelEsid */
  994. .quad VMALLOC_START_VSID /* xKernelVsid */
  995. /* xRanges (HvRangesToMap entries of 3 quads) */
  996. .quad HvPagesToMap /* xPages */
  997. .quad 0 /* xOffset */
  998. .quad PAGE_OFFSET_VSID << (SID_SHIFT - HW_PAGE_SHIFT) /* xVPN */
  999. #endif /* CONFIG_PPC_ISERIES */
  1000. #ifdef CONFIG_PPC_PSERIES
  1001. . = 0x8000
  1002. #endif /* CONFIG_PPC_PSERIES */
  1003. /*
  1004. * Space for CPU0's segment table.
  1005. *
  1006. * On iSeries, the hypervisor must fill in at least one entry before
  1007. * we get control (with relocate on). The address is given to the hv
  1008. * as a page number (see xLparMap above), so this must be at a
  1009. * fixed address (the linker can't compute (u64)&initial_stab >>
  1010. * PAGE_SHIFT).
  1011. */
  1012. . = STAB0_OFFSET /* 0x8000 */
  1013. .globl initial_stab
  1014. initial_stab:
  1015. .space 4096