xref: /linux/arch/s390/include/asm/thread_info.h (revision 7601d18be06943d5ac2b1802899ff6c303544936)
1 /* SPDX-License-Identifier: GPL-2.0 */
2 /*
3  *  S390 version
4  *    Copyright IBM Corp. 2002, 2006
5  *    Author(s): Martin Schwidefsky (schwidefsky@de.ibm.com)
6  */
7 
8 #ifndef _ASM_THREAD_INFO_H
9 #define _ASM_THREAD_INFO_H
10 
11 #include <linux/bits.h>
12 #include <vdso/page.h>
13 
14 /*
15  * General size of kernel stacks
16  */
17 #if defined(CONFIG_KASAN) || defined(CONFIG_KMSAN)
18 #define THREAD_SIZE_ORDER 4
19 #else
20 #define THREAD_SIZE_ORDER 2
21 #endif
22 #define BOOT_STACK_SIZE (PAGE_SIZE << 2)
23 #define THREAD_SIZE (PAGE_SIZE << THREAD_SIZE_ORDER)
24 
25 #define STACK_INIT_OFFSET (THREAD_SIZE - STACK_FRAME_OVERHEAD - __PT_SIZE)
26 
27 #ifndef __ASSEMBLER__
28 
29 /*
30  * low level task data that entry.S needs immediate access to
31  * - this struct should fit entirely inside of one cache line
32  * - this struct shares the supervisor stack pages
33  * - if the contents of this structure are changed, the assembly constants must also be changed
34  */
35 struct thread_info {
36 	unsigned long		flags;		/* low level flags */
37 	unsigned long		syscall_work;	/* SYSCALL_WORK_ flags */
38 	unsigned int		cpu;		/* current CPU */
39 	unsigned char		sie;		/* running in SIE context */
40 };
41 
42 /*
43  * macros/functions for gaining access to the thread information structure
44  */
45 #define INIT_THREAD_INFO(tsk)			\
46 {						\
47 	.flags		= 0,			\
48 }
49 
50 struct task_struct;
51 
52 void arch_setup_new_exec(void);
53 #define arch_setup_new_exec arch_setup_new_exec
54 
55 #endif
56 
57 /*
58  * thread information flags bit numbers
59  *
60  * Tell the generic TIF infrastructure which special bits s390 supports
61  */
62 #define HAVE_TIF_NEED_RESCHED_LAZY
63 #define HAVE_TIF_RESTORE_SIGMASK
64 
65 #include <asm-generic/thread_info_tif.h>
66 
67 /* Architecture specific bits */
68 #define TIF_ASCE_PRIMARY	16	/* primary asce is kernel asce */
69 #define TIF_GUARDED_STORAGE	17	/* load guarded storage control block */
70 #define TIF_ISOLATE_BP_GUEST	18	/* Run KVM guests with isolated BP */
71 #define TIF_PER_TRAP		19	/* Need to handle PER trap on exit to usermode */
72 #define TIF_31BIT		20	/* 32bit process */
73 #define TIF_SINGLE_STEP		21	/* This task is single stepped */
74 #define TIF_BLOCK_STEP		22	/* This task is block stepped */
75 #define TIF_UPROBE_SINGLESTEP	23	/* This task is uprobe single stepped */
76 
77 #define _TIF_ASCE_PRIMARY	BIT(TIF_ASCE_PRIMARY)
78 #define _TIF_GUARDED_STORAGE	BIT(TIF_GUARDED_STORAGE)
79 #define _TIF_ISOLATE_BP_GUEST	BIT(TIF_ISOLATE_BP_GUEST)
80 #define _TIF_PER_TRAP		BIT(TIF_PER_TRAP)
81 #define _TIF_31BIT		BIT(TIF_31BIT)
82 #define _TIF_SINGLE_STEP	BIT(TIF_SINGLE_STEP)
83 #define _TIF_BLOCK_STEP		BIT(TIF_BLOCK_STEP)
84 #define _TIF_UPROBE_SINGLESTEP	BIT(TIF_UPROBE_SINGLESTEP)
85 
86 #endif /* _ASM_THREAD_INFO_H */
87