diff options
| author | Heiko Carstens <hca@linux.ibm.com> | 2025-02-07 15:48:57 +0100 |
|---|---|---|
| committer | Vasily Gorbik <gor@linux.ibm.com> | 2025-03-04 17:18:05 +0100 |
| commit | e4da8249cf1e2aac1f2ca3d8bbe6c7589b4a7a13 (patch) | |
| tree | e4c49394fad4b4f83f4037e9c4fe494ec9576b98 /arch/s390/include | |
| parent | b7e81efc2436c553ca29eae5f069480de3d9f975 (diff) | |
s390/lowcore: Convert relocated lowcore alternative to machine feature
Convert the explicit relocated lowcore alternative type to a more
generic machine feature. This only reduces the number of alternative
types, but has no impact on code generation.
Reviewed-by: Vasily Gorbik <gor@linux.ibm.com>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
Diffstat (limited to 'arch/s390/include')
| -rw-r--r-- | arch/s390/include/asm/abs_lowcore.h | 7 | ||||
| -rw-r--r-- | arch/s390/include/asm/alternative.h | 4 | ||||
| -rw-r--r-- | arch/s390/include/asm/lowcore.h | 7 | ||||
| -rw-r--r-- | arch/s390/include/asm/machine.h | 6 |
4 files changed, 10 insertions, 14 deletions
diff --git a/arch/s390/include/asm/abs_lowcore.h b/arch/s390/include/asm/abs_lowcore.h index 004d17ea05cf..317c07c09ae4 100644 --- a/arch/s390/include/asm/abs_lowcore.h +++ b/arch/s390/include/asm/abs_lowcore.h @@ -25,11 +25,4 @@ static inline void put_abs_lowcore(struct lowcore *lc) put_cpu(); } -extern int relocate_lowcore; - -static inline int have_relocated_lowcore(void) -{ - return relocate_lowcore; -} - #endif /* _ASM_S390_ABS_LOWCORE_H */ diff --git a/arch/s390/include/asm/alternative.h b/arch/s390/include/asm/alternative.h index 67abef07ac93..c7bf60a541e9 100644 --- a/arch/s390/include/asm/alternative.h +++ b/arch/s390/include/asm/alternative.h @@ -34,7 +34,6 @@ #define ALT_TYPE_FACILITY 0 #define ALT_TYPE_FEATURE 1 #define ALT_TYPE_SPEC 2 -#define ALT_TYPE_LOWCORE 3 #define ALT_DATA_SHIFT 0 #define ALT_TYPE_SHIFT 20 @@ -52,9 +51,6 @@ ALT_TYPE_SPEC << ALT_TYPE_SHIFT | \ (facility) << ALT_DATA_SHIFT) -#define ALT_LOWCORE (ALT_CTX_EARLY << ALT_CTX_SHIFT | \ - ALT_TYPE_LOWCORE << ALT_TYPE_SHIFT) - #ifndef __ASSEMBLY__ #include <linux/types.h> diff --git a/arch/s390/include/asm/lowcore.h b/arch/s390/include/asm/lowcore.h index 42a092fa1029..60c887cdbaec 100644 --- a/arch/s390/include/asm/lowcore.h +++ b/arch/s390/include/asm/lowcore.h @@ -10,6 +10,7 @@ #define _ASM_S390_LOWCORE_H #include <linux/types.h> +#include <asm/machine.h> #include <asm/ptrace.h> #include <asm/ctlreg.h> #include <asm/cpu.h> @@ -222,7 +223,7 @@ static __always_inline struct lowcore *get_lowcore(void) if (__is_defined(__DECOMPRESSOR)) return NULL; - asm(ALTERNATIVE("llilh %[lc],0", "llilh %[lc],%[alt]", ALT_LOWCORE) + asm(ALTERNATIVE("llilh %[lc],0", "llilh %[lc],%[alt]", ALT_FEATURE(MFEATURE_LOWCORE)) : [lc] "=d" (lc) : [alt] "i" (LOWCORE_ALT_ADDRESS >> 16)); return lc; @@ -240,13 +241,13 @@ static inline void set_prefix(__u32 address) .macro GET_LC reg ALTERNATIVE "llilh \reg,0", \ __stringify(llilh \reg, LOWCORE_ALT_ADDRESS >> 16), \ - ALT_LOWCORE + ALT_FEATURE(MFEATURE_LOWCORE) .endm .macro STMG_LC start, end, savearea ALTERNATIVE "stmg \start, \end, \savearea", \ __stringify(stmg \start, \end, LOWCORE_ALT_ADDRESS + \savearea), \ - ALT_LOWCORE + ALT_FEATURE(MFEATURE_LOWCORE) .endm #endif /* __ASSEMBLY__ */ diff --git a/arch/s390/include/asm/machine.h b/arch/s390/include/asm/machine.h index bbe6c24bfc88..bc30384d396d 100644 --- a/arch/s390/include/asm/machine.h +++ b/arch/s390/include/asm/machine.h @@ -6,6 +6,10 @@ #ifndef __ASM_S390_MACHINE_H #define __ASM_S390_MACHINE_H +#include <linux/const.h> + +#define MFEATURE_LOWCORE 0 + #ifndef __ASSEMBLY__ #include <linux/bitops.h> @@ -72,5 +76,7 @@ static __always_inline bool machine_has_##name(void) \ return test_machine_feature(feature); \ } +DEFINE_MACHINE_HAS_FEATURE(relocated_lowcore, MFEATURE_LOWCORE) + #endif /* __ASSEMBLY__ */ #endif /* __ASM_S390_MACHINE_H */ |
