diff options
| author | Heiko Carstens <hca@linux.ibm.com> | 2025-02-07 15:48:50 +0100 |
|---|---|---|
| committer | Vasily Gorbik <gor@linux.ibm.com> | 2025-03-04 17:18:04 +0100 |
| commit | b49ee5b38651643d9e643fb4c7465f4046022254 (patch) | |
| tree | b4f07b7e3cd13726a51a94be8009ad813a4ddf56 /arch/s390/mm/fault.c | |
| parent | 42805261fcea809e1e76243dfc5218f6f12c1614 (diff) | |
s390/cpufeature: Convert MACHINE_HAS_NX to cpu_has_nx()
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/mm/fault.c')
| -rw-r--r-- | arch/s390/mm/fault.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/arch/s390/mm/fault.c b/arch/s390/mm/fault.c index 9c9d7840cb57..13d8c44bf8ed 100644 --- a/arch/s390/mm/fault.c +++ b/arch/s390/mm/fault.c @@ -11,6 +11,7 @@ #include <linux/kernel_stat.h> #include <linux/mmu_context.h> +#include <linux/cpufeature.h> #include <linux/perf_event.h> #include <linux/signal.h> #include <linux/sched.h> @@ -366,7 +367,7 @@ void do_protection_exception(struct pt_regs *regs) */ return handle_fault_error_nolock(regs, 0); } - if (unlikely(MACHINE_HAS_NX && teid.b56)) { + if (unlikely(cpu_has_nx() && teid.b56)) { regs->int_parm_long = (teid.addr * PAGE_SIZE) | (regs->psw.addr & PAGE_MASK); return handle_fault_error_nolock(regs, SEGV_ACCERR); } |