2 * sie64a.S - low level sie call
4 * Copyright IBM Corp. 2008,2010
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License (version 2 only)
8 * as published by the Free Software Foundation.
10 * Author(s): Heiko Carstens <heiko.carstens@de.ibm.com>
11 * Christian Ehrhardt <ehrhardt@linux.vnet.ibm.com>
14 #include <linux/errno.h>
15 #include <asm/asm-offsets.h>
16 #include <asm/setup.h>
17 #include <asm/asm-offsets.h>
18 #include <asm/ptrace.h>
19 #include <asm/thread_info.h>
21 _TIF_EXIT_SIE = (_TIF_SIGPENDING | _TIF_NEED_RESCHED | _TIF_MCCK_PENDING)
24 * offsets into stackframe
25 * SP_ = offsets into stack sie64 is called with
26 * SPI_ = offsets into irq stack
29 SP_HOOK = __SF_EMPTY+8
30 SP_GPP = __SF_EMPTY+16
31 SPI_PSW = STACK_FRAME_OVERHEAD + __PT_PSW
35 tm __LC_MACHINE_FLAGS+6,0x20 # MACHINE_FLAG_SPP
37 .insn s,0xb2800000,\newpp
42 SPP __LC_CMF_HPP # set host id
44 clg %r2,SPI_PSW+8(0,%r15) # intercepted sie
46 xc __LC_SIE_HOOK(8),__LC_SIE_HOOK
47 lg %r2,__LC_THREAD_INFO # pointer thread_info struct
48 tm __TI_flags+7(%r2),_TIF_EXIT_SIE
50 larl %r2,sie_exit # work pending, leave sie
51 stg %r2,SPI_PSW+8(0,%r15)
53 0: larl %r2,sie_reenter # re-enter with guest id
54 stg %r2,SPI_PSW+8(0,%r15)
58 * sie64a calling convention:
59 * %r2 pointer to sie control block
60 * %r3 guest register save area
64 stg %r3,SP_GREGS(%r15) # save guest register save area
65 stmg %r6,%r14,__SF_GPRS(%r15) # save registers on entry
66 lgr %r14,%r2 # pointer to sie control block
67 larl %r5,sie_irq_handler
69 stg %r5,SP_HOOK(%r15) # save hook target
70 lmg %r0,%r13,0(%r3) # load guest gprs 0-13
72 mvc __LC_SIE_HOOK(8),SP_HOOK(%r15)
73 SPP SP_GPP(%r15) # set guest id
76 xc __LC_SIE_HOOK(8),__LC_SIE_HOOK
77 SPP __LC_CMF_HPP # set host id
79 lg %r14,SP_GREGS(%r15)
80 stmg %r0,%r13,0(%r14) # save guest gprs 0-13
82 lmg %r6,%r14,__SF_GPRS(%r15)
86 xc __LC_SIE_HOOK(8),__LC_SIE_HOOK
87 SPP __LC_CMF_HPP # set host id
88 lg %r14,SP_GREGS(%r15)
89 stmg %r0,%r13,0(%r14) # save guest gprs 0-13
91 lmg %r6,%r14,__SF_GPRS(%r15)
94 .section __ex_table,"a"
95 .quad sie_inst,sie_err
96 .quad sie_exit,sie_err
97 .quad sie_reenter,sie_err