diff options
author | Martin Schwidefsky <schwidefsky@de.ibm.com> | 2018-01-16 01:36:46 -0500 |
---|---|---|
committer | Martin Schwidefsky <schwidefsky@de.ibm.com> | 2018-02-05 08:48:50 -0500 |
commit | 6b73044b2b0081ee3dd1cd6eaab7dee552601efb (patch) | |
tree | 25a142770f34cb0b7ba27e691d02509902a1974d /arch/s390/include | |
parent | d768bd892fc8f066cd3aa000eb1867bcf32db0ee (diff) |
s390: run user space and KVM guests with modified branch prediction
Define TIF_ISOLATE_BP and TIF_ISOLATE_BP_GUEST and add the necessary
plumbing in entry.S to be able to run user space and KVM guests with
limited branch prediction.
To switch a user space process to limited branch prediction the
s390_isolate_bp() function has to be call, and to run a vCPU of a KVM
guest associated with the current task with limited branch prediction
call s390_isolate_bp_guest().
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Diffstat (limited to 'arch/s390/include')
-rw-r--r-- | arch/s390/include/asm/processor.h | 3 | ||||
-rw-r--r-- | arch/s390/include/asm/thread_info.h | 4 |
2 files changed, 7 insertions, 0 deletions
diff --git a/arch/s390/include/asm/processor.h b/arch/s390/include/asm/processor.h index 5f37f9ceef5e..7f2953c15c37 100644 --- a/arch/s390/include/asm/processor.h +++ b/arch/s390/include/asm/processor.h | |||
@@ -378,6 +378,9 @@ extern void memcpy_absolute(void *, void *, size_t); | |||
378 | memcpy_absolute(&(dest), &__tmp, sizeof(__tmp)); \ | 378 | memcpy_absolute(&(dest), &__tmp, sizeof(__tmp)); \ |
379 | } while (0) | 379 | } while (0) |
380 | 380 | ||
381 | extern int s390_isolate_bp(void); | ||
382 | extern int s390_isolate_bp_guest(void); | ||
383 | |||
381 | #endif /* __ASSEMBLY__ */ | 384 | #endif /* __ASSEMBLY__ */ |
382 | 385 | ||
383 | #endif /* __ASM_S390_PROCESSOR_H */ | 386 | #endif /* __ASM_S390_PROCESSOR_H */ |
diff --git a/arch/s390/include/asm/thread_info.h b/arch/s390/include/asm/thread_info.h index 25d6ec3aaddd..83ba57533ce6 100644 --- a/arch/s390/include/asm/thread_info.h +++ b/arch/s390/include/asm/thread_info.h | |||
@@ -58,6 +58,8 @@ int arch_dup_task_struct(struct task_struct *dst, struct task_struct *src); | |||
58 | #define TIF_GUARDED_STORAGE 4 /* load guarded storage control block */ | 58 | #define TIF_GUARDED_STORAGE 4 /* load guarded storage control block */ |
59 | #define TIF_PATCH_PENDING 5 /* pending live patching update */ | 59 | #define TIF_PATCH_PENDING 5 /* pending live patching update */ |
60 | #define TIF_PGSTE 6 /* New mm's will use 4K page tables */ | 60 | #define TIF_PGSTE 6 /* New mm's will use 4K page tables */ |
61 | #define TIF_ISOLATE_BP 8 /* Run process with isolated BP */ | ||
62 | #define TIF_ISOLATE_BP_GUEST 9 /* Run KVM guests with isolated BP */ | ||
61 | 63 | ||
62 | #define TIF_31BIT 16 /* 32bit process */ | 64 | #define TIF_31BIT 16 /* 32bit process */ |
63 | #define TIF_MEMDIE 17 /* is terminating due to OOM killer */ | 65 | #define TIF_MEMDIE 17 /* is terminating due to OOM killer */ |
@@ -78,6 +80,8 @@ int arch_dup_task_struct(struct task_struct *dst, struct task_struct *src); | |||
78 | #define _TIF_UPROBE _BITUL(TIF_UPROBE) | 80 | #define _TIF_UPROBE _BITUL(TIF_UPROBE) |
79 | #define _TIF_GUARDED_STORAGE _BITUL(TIF_GUARDED_STORAGE) | 81 | #define _TIF_GUARDED_STORAGE _BITUL(TIF_GUARDED_STORAGE) |
80 | #define _TIF_PATCH_PENDING _BITUL(TIF_PATCH_PENDING) | 82 | #define _TIF_PATCH_PENDING _BITUL(TIF_PATCH_PENDING) |
83 | #define _TIF_ISOLATE_BP _BITUL(TIF_ISOLATE_BP) | ||
84 | #define _TIF_ISOLATE_BP_GUEST _BITUL(TIF_ISOLATE_BP_GUEST) | ||
81 | 85 | ||
82 | #define _TIF_31BIT _BITUL(TIF_31BIT) | 86 | #define _TIF_31BIT _BITUL(TIF_31BIT) |
83 | #define _TIF_SINGLE_STEP _BITUL(TIF_SINGLE_STEP) | 87 | #define _TIF_SINGLE_STEP _BITUL(TIF_SINGLE_STEP) |