exceptions-64s.S 29 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133
  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. ld r12,PACAKBASE(r13)
  201. ld r10,PACAKMSR(r13)
  202. LOAD_HANDLER(r12, system_call_entry)
  203. mtspr SPRN_SRR0,r12
  204. mfspr r12,SPRN_SRR1
  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. SAVE_8GPRS(14,r1)
  436. SAVE_10GPRS(22,r1)
  437. lhz r12,PACA_TRAP_SAVE(r13)
  438. std r12,_TRAP(r1)
  439. addi r11,r1,INT_FRAME_SIZE
  440. std r11,0(r1)
  441. li r12,0
  442. std r12,0(r11)
  443. ld r2,PACATOC(r13)
  444. ld r11,exception_marker@toc(r2)
  445. std r12,RESULT(r1)
  446. std r11,STACK_FRAME_OVERHEAD-16(r1)
  447. 1: addi r3,r1,STACK_FRAME_OVERHEAD
  448. bl .kernel_bad_stack
  449. b 1b
  450. /*
  451. * Here r13 points to the paca, r9 contains the saved CR,
  452. * SRR0 and SRR1 are saved in r11 and r12,
  453. * r9 - r13 are saved in paca->exgen.
  454. */
  455. .align 7
  456. .globl data_access_common
  457. data_access_common:
  458. mfspr r10,SPRN_DAR
  459. std r10,PACA_EXGEN+EX_DAR(r13)
  460. mfspr r10,SPRN_DSISR
  461. stw r10,PACA_EXGEN+EX_DSISR(r13)
  462. EXCEPTION_PROLOG_COMMON(0x300, PACA_EXGEN)
  463. ld r3,PACA_EXGEN+EX_DAR(r13)
  464. lwz r4,PACA_EXGEN+EX_DSISR(r13)
  465. li r5,0x300
  466. b .do_hash_page /* Try to handle as hpte fault */
  467. .align 7
  468. .globl h_data_storage_common
  469. h_data_storage_common:
  470. mfspr r10,SPRN_HDAR
  471. std r10,PACA_EXGEN+EX_DAR(r13)
  472. mfspr r10,SPRN_HDSISR
  473. stw r10,PACA_EXGEN+EX_DSISR(r13)
  474. EXCEPTION_PROLOG_COMMON(0xe00, PACA_EXGEN)
  475. bl .save_nvgprs
  476. addi r3,r1,STACK_FRAME_OVERHEAD
  477. bl .unknown_exception
  478. b .ret_from_except
  479. .align 7
  480. .globl instruction_access_common
  481. instruction_access_common:
  482. EXCEPTION_PROLOG_COMMON(0x400, PACA_EXGEN)
  483. ld r3,_NIP(r1)
  484. andis. r4,r12,0x5820
  485. li r5,0x400
  486. b .do_hash_page /* Try to handle as hpte fault */
  487. STD_EXCEPTION_COMMON(0xe20, h_instr_storage, .unknown_exception)
  488. /*
  489. * Here is the common SLB miss user that is used when going to virtual
  490. * mode for SLB misses, that is currently not used
  491. */
  492. #ifdef __DISABLED__
  493. .align 7
  494. .globl slb_miss_user_common
  495. slb_miss_user_common:
  496. mflr r10
  497. std r3,PACA_EXGEN+EX_DAR(r13)
  498. stw r9,PACA_EXGEN+EX_CCR(r13)
  499. std r10,PACA_EXGEN+EX_LR(r13)
  500. std r11,PACA_EXGEN+EX_SRR0(r13)
  501. bl .slb_allocate_user
  502. ld r10,PACA_EXGEN+EX_LR(r13)
  503. ld r3,PACA_EXGEN+EX_R3(r13)
  504. lwz r9,PACA_EXGEN+EX_CCR(r13)
  505. ld r11,PACA_EXGEN+EX_SRR0(r13)
  506. mtlr r10
  507. beq- slb_miss_fault
  508. andi. r10,r12,MSR_RI /* check for unrecoverable exception */
  509. beq- unrecov_user_slb
  510. mfmsr r10
  511. .machine push
  512. .machine "power4"
  513. mtcrf 0x80,r9
  514. .machine pop
  515. clrrdi r10,r10,2 /* clear RI before setting SRR0/1 */
  516. mtmsrd r10,1
  517. mtspr SRR0,r11
  518. mtspr SRR1,r12
  519. ld r9,PACA_EXGEN+EX_R9(r13)
  520. ld r10,PACA_EXGEN+EX_R10(r13)
  521. ld r11,PACA_EXGEN+EX_R11(r13)
  522. ld r12,PACA_EXGEN+EX_R12(r13)
  523. ld r13,PACA_EXGEN+EX_R13(r13)
  524. rfid
  525. b .
  526. slb_miss_fault:
  527. EXCEPTION_PROLOG_COMMON(0x380, PACA_EXGEN)
  528. ld r4,PACA_EXGEN+EX_DAR(r13)
  529. li r5,0
  530. std r4,_DAR(r1)
  531. std r5,_DSISR(r1)
  532. b handle_page_fault
  533. unrecov_user_slb:
  534. EXCEPTION_PROLOG_COMMON(0x4200, PACA_EXGEN)
  535. DISABLE_INTS
  536. bl .save_nvgprs
  537. 1: addi r3,r1,STACK_FRAME_OVERHEAD
  538. bl .unrecoverable_exception
  539. b 1b
  540. #endif /* __DISABLED__ */
  541. /*
  542. * r13 points to the PACA, r9 contains the saved CR,
  543. * r12 contain the saved SRR1, SRR0 is still ready for return
  544. * r3 has the faulting address
  545. * r9 - r13 are saved in paca->exslb.
  546. * r3 is saved in paca->slb_r3
  547. * We assume we aren't going to take any exceptions during this procedure.
  548. */
  549. _GLOBAL(slb_miss_realmode)
  550. mflr r10
  551. #ifdef CONFIG_RELOCATABLE
  552. mtctr r11
  553. #endif
  554. stw r9,PACA_EXSLB+EX_CCR(r13) /* save CR in exc. frame */
  555. std r10,PACA_EXSLB+EX_LR(r13) /* save LR */
  556. bl .slb_allocate_realmode
  557. /* All done -- return from exception. */
  558. ld r10,PACA_EXSLB+EX_LR(r13)
  559. ld r3,PACA_EXSLB+EX_R3(r13)
  560. lwz r9,PACA_EXSLB+EX_CCR(r13) /* get saved CR */
  561. #ifdef CONFIG_PPC_ISERIES
  562. BEGIN_FW_FTR_SECTION
  563. ld r11,PACALPPACAPTR(r13)
  564. ld r11,LPPACASRR0(r11) /* get SRR0 value */
  565. END_FW_FTR_SECTION_IFSET(FW_FEATURE_ISERIES)
  566. #endif /* CONFIG_PPC_ISERIES */
  567. mtlr r10
  568. andi. r10,r12,MSR_RI /* check for unrecoverable exception */
  569. beq- 2f
  570. .machine push
  571. .machine "power4"
  572. mtcrf 0x80,r9
  573. mtcrf 0x01,r9 /* slb_allocate uses cr0 and cr7 */
  574. .machine pop
  575. #ifdef CONFIG_PPC_ISERIES
  576. BEGIN_FW_FTR_SECTION
  577. mtspr SPRN_SRR0,r11
  578. mtspr SPRN_SRR1,r12
  579. END_FW_FTR_SECTION_IFSET(FW_FEATURE_ISERIES)
  580. #endif /* CONFIG_PPC_ISERIES */
  581. ld r9,PACA_EXSLB+EX_R9(r13)
  582. ld r10,PACA_EXSLB+EX_R10(r13)
  583. ld r11,PACA_EXSLB+EX_R11(r13)
  584. ld r12,PACA_EXSLB+EX_R12(r13)
  585. ld r13,PACA_EXSLB+EX_R13(r13)
  586. rfid
  587. b . /* prevent speculative execution */
  588. 2:
  589. #ifdef CONFIG_PPC_ISERIES
  590. BEGIN_FW_FTR_SECTION
  591. b unrecov_slb
  592. END_FW_FTR_SECTION_IFSET(FW_FEATURE_ISERIES)
  593. #endif /* CONFIG_PPC_ISERIES */
  594. mfspr r11,SPRN_SRR0
  595. ld r10,PACAKBASE(r13)
  596. LOAD_HANDLER(r10,unrecov_slb)
  597. mtspr SPRN_SRR0,r10
  598. ld r10,PACAKMSR(r13)
  599. mtspr SPRN_SRR1,r10
  600. rfid
  601. b .
  602. unrecov_slb:
  603. EXCEPTION_PROLOG_COMMON(0x4100, PACA_EXSLB)
  604. DISABLE_INTS
  605. bl .save_nvgprs
  606. 1: addi r3,r1,STACK_FRAME_OVERHEAD
  607. bl .unrecoverable_exception
  608. b 1b
  609. .align 7
  610. .globl hardware_interrupt_common
  611. .globl hardware_interrupt_entry
  612. hardware_interrupt_common:
  613. EXCEPTION_PROLOG_COMMON(0x500, PACA_EXGEN)
  614. FINISH_NAP
  615. hardware_interrupt_entry:
  616. DISABLE_INTS
  617. BEGIN_FTR_SECTION
  618. bl .ppc64_runlatch_on
  619. END_FTR_SECTION_IFSET(CPU_FTR_CTRL)
  620. addi r3,r1,STACK_FRAME_OVERHEAD
  621. bl .do_IRQ
  622. b .ret_from_except_lite
  623. #ifdef CONFIG_PPC_970_NAP
  624. power4_fixup_nap:
  625. andc r9,r9,r10
  626. std r9,TI_LOCAL_FLAGS(r11)
  627. ld r10,_LINK(r1) /* make idle task do the */
  628. std r10,_NIP(r1) /* equivalent of a blr */
  629. blr
  630. #endif
  631. .align 7
  632. .globl alignment_common
  633. alignment_common:
  634. mfspr r10,SPRN_DAR
  635. std r10,PACA_EXGEN+EX_DAR(r13)
  636. mfspr r10,SPRN_DSISR
  637. stw r10,PACA_EXGEN+EX_DSISR(r13)
  638. EXCEPTION_PROLOG_COMMON(0x600, PACA_EXGEN)
  639. ld r3,PACA_EXGEN+EX_DAR(r13)
  640. lwz r4,PACA_EXGEN+EX_DSISR(r13)
  641. std r3,_DAR(r1)
  642. std r4,_DSISR(r1)
  643. bl .save_nvgprs
  644. addi r3,r1,STACK_FRAME_OVERHEAD
  645. ENABLE_INTS
  646. bl .alignment_exception
  647. b .ret_from_except
  648. .align 7
  649. .globl program_check_common
  650. program_check_common:
  651. EXCEPTION_PROLOG_COMMON(0x700, PACA_EXGEN)
  652. bl .save_nvgprs
  653. addi r3,r1,STACK_FRAME_OVERHEAD
  654. ENABLE_INTS
  655. bl .program_check_exception
  656. b .ret_from_except
  657. .align 7
  658. .globl fp_unavailable_common
  659. fp_unavailable_common:
  660. EXCEPTION_PROLOG_COMMON(0x800, PACA_EXGEN)
  661. bne 1f /* if from user, just load it up */
  662. bl .save_nvgprs
  663. addi r3,r1,STACK_FRAME_OVERHEAD
  664. ENABLE_INTS
  665. bl .kernel_fp_unavailable_exception
  666. BUG_OPCODE
  667. 1: bl .load_up_fpu
  668. b fast_exception_return
  669. .align 7
  670. .globl altivec_unavailable_common
  671. altivec_unavailable_common:
  672. EXCEPTION_PROLOG_COMMON(0xf20, PACA_EXGEN)
  673. #ifdef CONFIG_ALTIVEC
  674. BEGIN_FTR_SECTION
  675. beq 1f
  676. bl .load_up_altivec
  677. b fast_exception_return
  678. 1:
  679. END_FTR_SECTION_IFSET(CPU_FTR_ALTIVEC)
  680. #endif
  681. bl .save_nvgprs
  682. addi r3,r1,STACK_FRAME_OVERHEAD
  683. ENABLE_INTS
  684. bl .altivec_unavailable_exception
  685. b .ret_from_except
  686. .align 7
  687. .globl vsx_unavailable_common
  688. vsx_unavailable_common:
  689. EXCEPTION_PROLOG_COMMON(0xf40, PACA_EXGEN)
  690. #ifdef CONFIG_VSX
  691. BEGIN_FTR_SECTION
  692. bne .load_up_vsx
  693. 1:
  694. END_FTR_SECTION_IFSET(CPU_FTR_VSX)
  695. #endif
  696. bl .save_nvgprs
  697. addi r3,r1,STACK_FRAME_OVERHEAD
  698. ENABLE_INTS
  699. bl .vsx_unavailable_exception
  700. b .ret_from_except
  701. .align 7
  702. .globl __end_handlers
  703. __end_handlers:
  704. /*
  705. * Return from an exception with minimal checks.
  706. * The caller is assumed to have done EXCEPTION_PROLOG_COMMON.
  707. * If interrupts have been enabled, or anything has been
  708. * done that might have changed the scheduling status of
  709. * any task or sent any task a signal, you should use
  710. * ret_from_except or ret_from_except_lite instead of this.
  711. */
  712. fast_exc_return_irq: /* restores irq state too */
  713. ld r3,SOFTE(r1)
  714. TRACE_AND_RESTORE_IRQ(r3);
  715. ld r12,_MSR(r1)
  716. rldicl r4,r12,49,63 /* get MSR_EE to LSB */
  717. stb r4,PACAHARDIRQEN(r13) /* restore paca->hard_enabled */
  718. b 1f
  719. .globl fast_exception_return
  720. fast_exception_return:
  721. ld r12,_MSR(r1)
  722. 1: ld r11,_NIP(r1)
  723. andi. r3,r12,MSR_RI /* check if RI is set */
  724. beq- unrecov_fer
  725. #ifdef CONFIG_VIRT_CPU_ACCOUNTING
  726. andi. r3,r12,MSR_PR
  727. beq 2f
  728. ACCOUNT_CPU_USER_EXIT(r3, r4)
  729. 2:
  730. #endif
  731. ld r3,_CCR(r1)
  732. ld r4,_LINK(r1)
  733. ld r5,_CTR(r1)
  734. ld r6,_XER(r1)
  735. mtcr r3
  736. mtlr r4
  737. mtctr r5
  738. mtxer r6
  739. REST_GPR(0, r1)
  740. REST_8GPRS(2, r1)
  741. mfmsr r10
  742. rldicl r10,r10,48,1 /* clear EE */
  743. rldicr r10,r10,16,61 /* clear RI (LE is 0 already) */
  744. mtmsrd r10,1
  745. mtspr SPRN_SRR1,r12
  746. mtspr SPRN_SRR0,r11
  747. REST_4GPRS(10, r1)
  748. ld r1,GPR1(r1)
  749. rfid
  750. b . /* prevent speculative execution */
  751. unrecov_fer:
  752. bl .save_nvgprs
  753. 1: addi r3,r1,STACK_FRAME_OVERHEAD
  754. bl .unrecoverable_exception
  755. b 1b
  756. /*
  757. * Hash table stuff
  758. */
  759. .align 7
  760. _STATIC(do_hash_page)
  761. std r3,_DAR(r1)
  762. std r4,_DSISR(r1)
  763. andis. r0,r4,0xa410 /* weird error? */
  764. bne- handle_page_fault /* if not, try to insert a HPTE */
  765. andis. r0,r4,DSISR_DABRMATCH@h
  766. bne- handle_dabr_fault
  767. BEGIN_FTR_SECTION
  768. andis. r0,r4,0x0020 /* Is it a segment table fault? */
  769. bne- do_ste_alloc /* If so handle it */
  770. END_MMU_FTR_SECTION_IFCLR(MMU_FTR_SLB)
  771. clrrdi r11,r1,THREAD_SHIFT
  772. lwz r0,TI_PREEMPT(r11) /* If we're in an "NMI" */
  773. andis. r0,r0,NMI_MASK@h /* (i.e. an irq when soft-disabled) */
  774. bne 77f /* then don't call hash_page now */
  775. /*
  776. * On iSeries, we soft-disable interrupts here, then
  777. * hard-enable interrupts so that the hash_page code can spin on
  778. * the hash_table_lock without problems on a shared processor.
  779. */
  780. DISABLE_INTS
  781. /*
  782. * Currently, trace_hardirqs_off() will be called by DISABLE_INTS
  783. * and will clobber volatile registers when irq tracing is enabled
  784. * so we need to reload them. It may be possible to be smarter here
  785. * and move the irq tracing elsewhere but let's keep it simple for
  786. * now
  787. */
  788. #ifdef CONFIG_TRACE_IRQFLAGS
  789. ld r3,_DAR(r1)
  790. ld r4,_DSISR(r1)
  791. ld r5,_TRAP(r1)
  792. ld r12,_MSR(r1)
  793. clrrdi r5,r5,4
  794. #endif /* CONFIG_TRACE_IRQFLAGS */
  795. /*
  796. * We need to set the _PAGE_USER bit if MSR_PR is set or if we are
  797. * accessing a userspace segment (even from the kernel). We assume
  798. * kernel addresses always have the high bit set.
  799. */
  800. rlwinm r4,r4,32-25+9,31-9,31-9 /* DSISR_STORE -> _PAGE_RW */
  801. rotldi r0,r3,15 /* Move high bit into MSR_PR posn */
  802. orc r0,r12,r0 /* MSR_PR | ~high_bit */
  803. rlwimi r4,r0,32-13,30,30 /* becomes _PAGE_USER access bit */
  804. ori r4,r4,1 /* add _PAGE_PRESENT */
  805. rlwimi r4,r5,22+2,31-2,31-2 /* Set _PAGE_EXEC if trap is 0x400 */
  806. /*
  807. * r3 contains the faulting address
  808. * r4 contains the required access permissions
  809. * r5 contains the trap number
  810. *
  811. * at return r3 = 0 for success
  812. */
  813. bl .hash_page /* build HPTE if possible */
  814. cmpdi r3,0 /* see if hash_page succeeded */
  815. BEGIN_FW_FTR_SECTION
  816. /*
  817. * If we had interrupts soft-enabled at the point where the
  818. * DSI/ISI occurred, and an interrupt came in during hash_page,
  819. * handle it now.
  820. * We jump to ret_from_except_lite rather than fast_exception_return
  821. * because ret_from_except_lite will check for and handle pending
  822. * interrupts if necessary.
  823. */
  824. beq 13f
  825. END_FW_FTR_SECTION_IFSET(FW_FEATURE_ISERIES)
  826. BEGIN_FW_FTR_SECTION
  827. /*
  828. * Here we have interrupts hard-disabled, so it is sufficient
  829. * to restore paca->{soft,hard}_enable and get out.
  830. */
  831. beq fast_exc_return_irq /* Return from exception on success */
  832. END_FW_FTR_SECTION_IFCLR(FW_FEATURE_ISERIES)
  833. /* For a hash failure, we don't bother re-enabling interrupts */
  834. ble- 12f
  835. /*
  836. * hash_page couldn't handle it, set soft interrupt enable back
  837. * to what it was before the trap. Note that .arch_local_irq_restore
  838. * handles any interrupts pending at this point.
  839. */
  840. ld r3,SOFTE(r1)
  841. TRACE_AND_RESTORE_IRQ_PARTIAL(r3, 11f)
  842. bl .arch_local_irq_restore
  843. b 11f
  844. /* We have a data breakpoint exception - handle it */
  845. handle_dabr_fault:
  846. bl .save_nvgprs
  847. ld r4,_DAR(r1)
  848. ld r5,_DSISR(r1)
  849. addi r3,r1,STACK_FRAME_OVERHEAD
  850. bl .do_dabr
  851. b .ret_from_except_lite
  852. /* Here we have a page fault that hash_page can't handle. */
  853. handle_page_fault:
  854. ENABLE_INTS
  855. 11: ld r4,_DAR(r1)
  856. ld r5,_DSISR(r1)
  857. addi r3,r1,STACK_FRAME_OVERHEAD
  858. bl .do_page_fault
  859. cmpdi r3,0
  860. beq+ 13f
  861. bl .save_nvgprs
  862. mr r5,r3
  863. addi r3,r1,STACK_FRAME_OVERHEAD
  864. lwz r4,_DAR(r1)
  865. bl .bad_page_fault
  866. b .ret_from_except
  867. 13: b .ret_from_except_lite
  868. /* We have a page fault that hash_page could handle but HV refused
  869. * the PTE insertion
  870. */
  871. 12: bl .save_nvgprs
  872. mr r5,r3
  873. addi r3,r1,STACK_FRAME_OVERHEAD
  874. ld r4,_DAR(r1)
  875. bl .low_hash_fault
  876. b .ret_from_except
  877. /*
  878. * We come here as a result of a DSI at a point where we don't want
  879. * to call hash_page, such as when we are accessing memory (possibly
  880. * user memory) inside a PMU interrupt that occurred while interrupts
  881. * were soft-disabled. We want to invoke the exception handler for
  882. * the access, or panic if there isn't a handler.
  883. */
  884. 77: bl .save_nvgprs
  885. mr r4,r3
  886. addi r3,r1,STACK_FRAME_OVERHEAD
  887. li r5,SIGSEGV
  888. bl .bad_page_fault
  889. b .ret_from_except
  890. /* here we have a segment miss */
  891. do_ste_alloc:
  892. bl .ste_allocate /* try to insert stab entry */
  893. cmpdi r3,0
  894. bne- handle_page_fault
  895. b fast_exception_return
  896. /*
  897. * r13 points to the PACA, r9 contains the saved CR,
  898. * r11 and r12 contain the saved SRR0 and SRR1.
  899. * r9 - r13 are saved in paca->exslb.
  900. * We assume we aren't going to take any exceptions during this procedure.
  901. * We assume (DAR >> 60) == 0xc.
  902. */
  903. .align 7
  904. _GLOBAL(do_stab_bolted)
  905. stw r9,PACA_EXSLB+EX_CCR(r13) /* save CR in exc. frame */
  906. std r11,PACA_EXSLB+EX_SRR0(r13) /* save SRR0 in exc. frame */
  907. /* Hash to the primary group */
  908. ld r10,PACASTABVIRT(r13)
  909. mfspr r11,SPRN_DAR
  910. srdi r11,r11,28
  911. rldimi r10,r11,7,52 /* r10 = first ste of the group */
  912. /* Calculate VSID */
  913. /* This is a kernel address, so protovsid = ESID */
  914. ASM_VSID_SCRAMBLE(r11, r9, 256M)
  915. rldic r9,r11,12,16 /* r9 = vsid << 12 */
  916. /* Search the primary group for a free entry */
  917. 1: ld r11,0(r10) /* Test valid bit of the current ste */
  918. andi. r11,r11,0x80
  919. beq 2f
  920. addi r10,r10,16
  921. andi. r11,r10,0x70
  922. bne 1b
  923. /* Stick for only searching the primary group for now. */
  924. /* At least for now, we use a very simple random castout scheme */
  925. /* Use the TB as a random number ; OR in 1 to avoid entry 0 */
  926. mftb r11
  927. rldic r11,r11,4,57 /* r11 = (r11 << 4) & 0x70 */
  928. ori r11,r11,0x10
  929. /* r10 currently points to an ste one past the group of interest */
  930. /* make it point to the randomly selected entry */
  931. subi r10,r10,128
  932. or r10,r10,r11 /* r10 is the entry to invalidate */
  933. isync /* mark the entry invalid */
  934. ld r11,0(r10)
  935. rldicl r11,r11,56,1 /* clear the valid bit */
  936. rotldi r11,r11,8
  937. std r11,0(r10)
  938. sync
  939. clrrdi r11,r11,28 /* Get the esid part of the ste */
  940. slbie r11
  941. 2: std r9,8(r10) /* Store the vsid part of the ste */
  942. eieio
  943. mfspr r11,SPRN_DAR /* Get the new esid */
  944. clrrdi r11,r11,28 /* Permits a full 32b of ESID */
  945. ori r11,r11,0x90 /* Turn on valid and kp */
  946. std r11,0(r10) /* Put new entry back into the stab */
  947. sync
  948. /* All done -- return from exception. */
  949. lwz r9,PACA_EXSLB+EX_CCR(r13) /* get saved CR */
  950. ld r11,PACA_EXSLB+EX_SRR0(r13) /* get saved SRR0 */
  951. andi. r10,r12,MSR_RI
  952. beq- unrecov_slb
  953. mtcrf 0x80,r9 /* restore CR */
  954. mfmsr r10
  955. clrrdi r10,r10,2
  956. mtmsrd r10,1
  957. mtspr SPRN_SRR0,r11
  958. mtspr SPRN_SRR1,r12
  959. ld r9,PACA_EXSLB+EX_R9(r13)
  960. ld r10,PACA_EXSLB+EX_R10(r13)
  961. ld r11,PACA_EXSLB+EX_R11(r13)
  962. ld r12,PACA_EXSLB+EX_R12(r13)
  963. ld r13,PACA_EXSLB+EX_R13(r13)
  964. rfid
  965. b . /* prevent speculative execution */
  966. #ifdef CONFIG_PPC_PSERIES
  967. /*
  968. * Data area reserved for FWNMI option.
  969. * This address (0x7000) is fixed by the RPA.
  970. */
  971. .= 0x7000
  972. .globl fwnmi_data_area
  973. fwnmi_data_area:
  974. #endif /* CONFIG_PPC_PSERIES */
  975. /* iSeries does not use the FWNMI stuff, so it is safe to put
  976. * this here, even if we later allow kernels that will boot on
  977. * both pSeries and iSeries */
  978. #ifdef CONFIG_PPC_ISERIES
  979. . = LPARMAP_PHYS
  980. .globl xLparMap
  981. xLparMap:
  982. .quad HvEsidsToMap /* xNumberEsids */
  983. .quad HvRangesToMap /* xNumberRanges */
  984. .quad STAB0_PAGE /* xSegmentTableOffs */
  985. .zero 40 /* xRsvd */
  986. /* xEsids (HvEsidsToMap entries of 2 quads) */
  987. .quad PAGE_OFFSET_ESID /* xKernelEsid */
  988. .quad PAGE_OFFSET_VSID /* xKernelVsid */
  989. .quad VMALLOC_START_ESID /* xKernelEsid */
  990. .quad VMALLOC_START_VSID /* xKernelVsid */
  991. /* xRanges (HvRangesToMap entries of 3 quads) */
  992. .quad HvPagesToMap /* xPages */
  993. .quad 0 /* xOffset */
  994. .quad PAGE_OFFSET_VSID << (SID_SHIFT - HW_PAGE_SHIFT) /* xVPN */
  995. #endif /* CONFIG_PPC_ISERIES */
  996. #ifdef CONFIG_PPC_PSERIES
  997. . = 0x8000
  998. #endif /* CONFIG_PPC_PSERIES */
  999. /*
  1000. * Space for CPU0's segment table.
  1001. *
  1002. * On iSeries, the hypervisor must fill in at least one entry before
  1003. * we get control (with relocate on). The address is given to the hv
  1004. * as a page number (see xLparMap above), so this must be at a
  1005. * fixed address (the linker can't compute (u64)&initial_stab >>
  1006. * PAGE_SHIFT).
  1007. */
  1008. . = STAB0_OFFSET /* 0x8000 */
  1009. .globl initial_stab
  1010. initial_stab:
  1011. .space 4096