diff options
| author | Heiko Carstens <hca@linux.ibm.com> | 2025-02-07 15:48:54 +0100 |
|---|---|---|
| committer | Vasily Gorbik <gor@linux.ibm.com> | 2025-03-04 17:18:05 +0100 |
| commit | 3f5eede6dfdd2cf9f4c0156ccee20bd0e5d927aa (patch) | |
| tree | 276d04deb2cccb6970d24eda5ffd95525fa9ee72 /arch/s390/boot | |
| parent | 2e2ff71febfe30963deff1897b7d1d1ceb8628dd (diff) | |
s390/cpufeature: Convert MACHINE_HAS_EDAT2 to cpu_has_edat2()
Convert MACHINE_HAS_... to cpu_has_...() which uses test_facility() instead
of testing the machine_flags lowcore member if the feature is present.
test_facility() generates better code since it results in a static branch
without accessing memory. The branch is patched via alternatives by the
decompressor depending on the availability of the required facility.
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/boot')
| -rw-r--r-- | arch/s390/boot/boot.h | 4 | ||||
| -rw-r--r-- | arch/s390/boot/startup.c | 4 | ||||
| -rw-r--r-- | arch/s390/boot/vmem.c | 2 |
3 files changed, 1 insertions, 9 deletions
diff --git a/arch/s390/boot/boot.h b/arch/s390/boot/boot.h index 668d88fbeccb..f4af23c142cc 100644 --- a/arch/s390/boot/boot.h +++ b/arch/s390/boot/boot.h @@ -11,10 +11,6 @@ #include <linux/printk.h> #include <asm/physmem_info.h> -struct machine_info { - unsigned char has_edat2 : 1; -}; - struct vmlinux_info { unsigned long entry; unsigned long image_size; /* does not include .bss */ diff --git a/arch/s390/boot/startup.c b/arch/s390/boot/startup.c index 124bf13dedf9..72d48e1d67be 100644 --- a/arch/s390/boot/startup.c +++ b/arch/s390/boot/startup.c @@ -39,8 +39,6 @@ int __bootdata_preserved(relocate_lowcore); u64 __bootdata_preserved(stfle_fac_list[16]); struct oldmem_data __bootdata_preserved(oldmem_data); -struct machine_info machine; - void error(char *x) { boot_emerg("%s\n", x); @@ -52,8 +50,6 @@ static void detect_facilities(void) { if (cpu_has_edat1()) local_ctl_set_bit(0, CR0_EDAT_BIT); - if (test_facility(78)) - machine.has_edat2 = 1; page_noexec_mask = -1UL; segment_noexec_mask = -1UL; region_noexec_mask = -1UL; diff --git a/arch/s390/boot/vmem.c b/arch/s390/boot/vmem.c index 4d27428c5233..1e87cffac2f1 100644 --- a/arch/s390/boot/vmem.c +++ b/arch/s390/boot/vmem.c @@ -315,7 +315,7 @@ static unsigned long try_get_large_pud_pa(pud_t *pu_dir, unsigned long addr, uns { unsigned long pa, size = end - addr; - if (!machine.has_edat2 || !large_page_mapping_allowed(mode) || + if (!cpu_has_edat2() || !large_page_mapping_allowed(mode) || !IS_ALIGNED(addr, PUD_SIZE) || (size < PUD_SIZE)) return INVALID_PHYS_ADDR; |
