hc
2024-02-20 102a0743326a03cd1a1202ceda21e175b7d3575c
kernel/arch/s390/boot/head.S
....@@ -60,6 +60,11 @@
6060 .long 0x02000690,0x60000050
6161 .long 0x020006e0,0x20000050
6262
63
+ .org __LC_RST_NEW_PSW # 0x1a0
64
+ .quad 0,iplstart
65
+ .org __LC_PGM_NEW_PSW # 0x1d0
66
+ .quad 0x0000000180000000,startup_pgm_check_handler
67
+
6368 .org 0x200
6469
6570 #
....@@ -302,39 +307,98 @@
302307 xc 0x300(256),0x300
303308 xc 0xe00(256),0xe00
304309 xc 0xf00(256),0xf00
305
- lctlg %c0,%c15,0x200(%r0) # initialize control registers
310
+ lctlg %c0,%c15,.Lctl-.LPG0(%r13) # load control registers
306311 stcke __LC_BOOT_CLOCK
307312 mvc __LC_LAST_UPDATE_CLOCK(8),__LC_BOOT_CLOCK+1
308313 spt 6f-.LPG0(%r13)
309314 mvc __LC_LAST_UPDATE_TIMER(8),6f-.LPG0(%r13)
310315 l %r15,.Lstack-.LPG0(%r13)
311
- ahi %r15,-STACK_FRAME_OVERHEAD
312316 brasl %r14,verify_facilities
313
-#ifdef CONFIG_KERNEL_UNCOMPRESSED
314
- jg startup_continue
315
-#else
316
- jg startup_decompressor
317
-#endif
317
+ brasl %r14,startup_kernel
318318
319319 .Lstack:
320
- .long 0x8000 + (1<<(PAGE_SHIFT+THREAD_SIZE_ORDER))
320
+ .long 0x8000 + (1<<(PAGE_SHIFT+BOOT_STACK_ORDER)) - STACK_FRAME_OVERHEAD
321321 .align 8
322322 6: .long 0x7fffffff,0xffffffff
323
+
324
+.Lctl: .quad 0x04040000 # cr0: AFP registers & secondary space
325
+ .quad 0 # cr1: primary space segment table
326
+ .quad .Lduct # cr2: dispatchable unit control table
327
+ .quad 0 # cr3: instruction authorization
328
+ .quad 0xffff # cr4: instruction authorization
329
+ .quad .Lduct # cr5: primary-aste origin
330
+ .quad 0 # cr6: I/O interrupts
331
+ .quad 0 # cr7: secondary space segment table
332
+ .quad 0x0000000000008000 # cr8: access registers translation
333
+ .quad 0 # cr9: tracing off
334
+ .quad 0 # cr10: tracing off
335
+ .quad 0 # cr11: tracing off
336
+ .quad 0 # cr12: tracing off
337
+ .quad 0 # cr13: home space segment table
338
+ .quad 0xc0000000 # cr14: machine check handling off
339
+ .quad .Llinkage_stack # cr15: linkage stack operations
340
+
341
+ .section .dma.data,"aw",@progbits
342
+.Lduct: .long 0,.Laste,.Laste,0,.Lduald,0,0,0
343
+ .long 0,0,0,0,0,0,0,0
344
+.Llinkage_stack:
345
+ .long 0,0,0x89000000,0,0,0,0x8a000000,0
346
+ .align 64
347
+.Laste: .quad 0,0xffffffffffffffff,0,0,0,0,0,0
348
+ .align 128
349
+.Lduald:.rept 8
350
+ .long 0x80000000,0,0,0 # invalid access-list entries
351
+ .endr
352
+ .previous
323353
324354 #include "head_kdump.S"
325355
326356 #
357
+# This program check is active immediately after kernel start
358
+# and until early_pgm_check_handler is set in kernel/early.c
359
+# It simply saves general/control registers and psw in
360
+# the save area and does disabled wait with a faulty address.
361
+#
362
+ENTRY(startup_pgm_check_handler)
363
+ stmg %r8,%r15,__LC_SAVE_AREA_SYNC
364
+ la %r8,4095
365
+ stctg %c0,%c15,__LC_CREGS_SAVE_AREA-4095(%r8)
366
+ stmg %r0,%r7,__LC_GPREGS_SAVE_AREA-4095(%r8)
367
+ mvc __LC_GPREGS_SAVE_AREA-4095+64(64,%r8),__LC_SAVE_AREA_SYNC
368
+ mvc __LC_PSW_SAVE_AREA-4095(16,%r8),__LC_PGM_OLD_PSW
369
+ mvc __LC_RETURN_PSW(16),__LC_PGM_OLD_PSW
370
+ ni __LC_RETURN_PSW,0xfc # remove IO and EX bits
371
+ ni __LC_RETURN_PSW+1,0xfb # remove MCHK bit
372
+ oi __LC_RETURN_PSW+1,0x2 # set wait state bit
373
+ larl %r9,.Lold_psw_disabled_wait
374
+ stg %r9,__LC_PGM_NEW_PSW+8
375
+ l %r15,.Ldump_info_stack-.Lold_psw_disabled_wait(%r9)
376
+ brasl %r14,print_pgm_check_info
377
+.Lold_psw_disabled_wait:
378
+ la %r8,4095
379
+ lmg %r0,%r15,__LC_GPREGS_SAVE_AREA-4095(%r8)
380
+ lpswe __LC_RETURN_PSW # disabled wait
381
+.Ldump_info_stack:
382
+ .long 0x5000 + PAGE_SIZE - STACK_FRAME_OVERHEAD
383
+ENDPROC(startup_pgm_check_handler)
384
+
385
+#
327386 # params at 10400 (setup.h)
387
+# Must be keept in sync with struct parmarea in setup.h
328388 #
329389 .org PARMAREA
330
- .long 0,0 # IPL_DEVICE
331
- .long 0,0 # INITRD_START
332
- .long 0,0 # INITRD_SIZE
333
- .long 0,0 # OLDMEM_BASE
334
- .long 0,0 # OLDMEM_SIZE
390
+ .quad 0 # IPL_DEVICE
391
+ .quad 0 # INITRD_START
392
+ .quad 0 # INITRD_SIZE
393
+ .quad 0 # OLDMEM_BASE
394
+ .quad 0 # OLDMEM_SIZE
395
+ .quad kernel_version # points to kernel version string
335396
336397 .org COMMAND_LINE
337398 .byte "root=/dev/ram0 ro"
338399 .byte 0
339400
340
- .org 0x11000
401
+ .org EARLY_SCCB_OFFSET
402
+ .fill 4096
403
+
404
+ .org HEAD_END