summaryrefslogtreecommitdiff
path: root/arch
diff options
context:
space:
mode:
Diffstat (limited to 'arch')
-rw-r--r--arch/s390/include/asm/pfault.h4
-rw-r--r--arch/s390/mm/pfault.c28
2 files changed, 17 insertions, 15 deletions
diff --git a/arch/s390/include/asm/pfault.h b/arch/s390/include/asm/pfault.h
index beabeebf2859..a1bee4a1e470 100644
--- a/arch/s390/include/asm/pfault.h
+++ b/arch/s390/include/asm/pfault.h
@@ -5,6 +5,8 @@
#ifndef _ASM_S390_PFAULT_H
#define _ASM_S390_PFAULT_H
+#include <linux/errno.h>
+
int __pfault_init(void);
void __pfault_fini(void);
@@ -12,7 +14,7 @@ static inline int pfault_init(void)
{
if (IS_ENABLED(CONFIG_PFAULT))
return __pfault_init();
- return -1;
+ return -EOPNOTSUPP;
}
static inline void pfault_fini(void)
diff --git a/arch/s390/mm/pfault.c b/arch/s390/mm/pfault.c
index 64cc42d37c8b..1d65512c3351 100644
--- a/arch/s390/mm/pfault.c
+++ b/arch/s390/mm/pfault.c
@@ -51,20 +51,19 @@ static struct pfault_refbk pfault_init_refbk = {
int __pfault_init(void)
{
- int rc;
+ int rc = -EOPNOTSUPP;
if (pfault_disable)
- return -1;
+ return rc;
diag_stat_inc(DIAG_STAT_X258);
asm volatile(
- " diag %1,%0,0x258\n"
- "0: j 2f\n"
- "1: la %0,8\n"
- "2:\n"
- EX_TABLE(0b,1b)
- : "=d" (rc)
- : "a" (&pfault_init_refbk), "m" (pfault_init_refbk) : "cc");
- return rc;
+ " diag %[refbk],%[rc],0x258\n"
+ "0: nopr %%r7\n"
+ EX_TABLE(0b, 0b)
+ : [rc] "+d" (rc)
+ : [refbk] "a" (&pfault_init_refbk), "m" (pfault_init_refbk)
+ : "cc");
+ return rc;
}
static struct pfault_refbk pfault_fini_refbk = {
@@ -76,15 +75,16 @@ static struct pfault_refbk pfault_fini_refbk = {
void __pfault_fini(void)
{
-
if (pfault_disable)
return;
diag_stat_inc(DIAG_STAT_X258);
asm volatile(
- " diag %0,0,0x258\n"
+ " diag %[refbk],0,0x258\n"
"0: nopr %%r7\n"
- EX_TABLE(0b,0b)
- : : "a" (&pfault_fini_refbk), "m" (pfault_fini_refbk) : "cc");
+ EX_TABLE(0b, 0b)
+ :
+ : [refbk] "a" (&pfault_fini_refbk), "m" (pfault_fini_refbk)
+ : "cc");
}
static DEFINE_SPINLOCK(pfault_lock);