summaryrefslogtreecommitdiffstats
path: root/arch/s390/mm
diff options
context:
space:
mode:
authorHeiko Carstens <hca@linux.ibm.com>2023-10-12 09:40:40 +0200
committerVasily Gorbik <gor@linux.ibm.com>2023-10-23 18:21:22 +0200
commit9641613f48bbf8626355118de58f96eec5aebf49 (patch)
tree2e8b355f63382d8ce582ce201601302815bd2e19 /arch/s390/mm
parentae626f686351d220d5eab746dc3a19e90bb1de9a (diff)
downloadlinux-stable-9641613f48bbf8626355118de58f96eec5aebf49.tar.gz
linux-stable-9641613f48bbf8626355118de58f96eec5aebf49.tar.bz2
linux-stable-9641613f48bbf8626355118de58f96eec5aebf49.zip
s390/mm,fault: use get_fault_address() everywhere
Use the get_fault_address() helper function instead of open-coding it at many locations. Reviewed-by: Claudio Imbrenda <imbrenda@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')
-rw-r--r--arch/s390/mm/fault.c16
1 files changed, 7 insertions, 9 deletions
diff --git a/arch/s390/mm/fault.c b/arch/s390/mm/fault.c
index dd1dca10bd6b..ba2056b35910 100644
--- a/arch/s390/mm/fault.c
+++ b/arch/s390/mm/fault.c
@@ -176,7 +176,7 @@ static void dump_fault_info(struct pt_regs *regs)
unsigned long asce;
pr_alert("Failing address: %016lx TEID: %016lx\n",
- regs->int_parm_long & __FAIL_ADDR_MASK, regs->int_parm_long);
+ get_fault_address(regs), regs->int_parm_long);
pr_alert("Fault in ");
switch (regs->int_parm_long & 3) {
case 3:
@@ -210,7 +210,7 @@ static void dump_fault_info(struct pt_regs *regs)
unreachable();
}
pr_cont("ASCE.\n");
- dump_pagetable(asce, regs->int_parm_long & __FAIL_ADDR_MASK);
+ dump_pagetable(asce, get_fault_address(regs));
}
int show_unhandled_signals = 1;
@@ -237,8 +237,7 @@ void report_user_fault(struct pt_regs *regs, long signr, int is_mm_fault)
static void do_sigsegv(struct pt_regs *regs, int si_code)
{
report_user_fault(regs, SIGSEGV, 1);
- force_sig_fault(SIGSEGV, si_code,
- (void __user *)(regs->int_parm_long & __FAIL_ADDR_MASK));
+ force_sig_fault(SIGSEGV, si_code, (void __user *)get_fault_address(regs));
}
static void do_no_context(struct pt_regs *regs, vm_fault_t fault)
@@ -280,8 +279,7 @@ static void do_low_address(struct pt_regs *regs)
static void do_sigbus(struct pt_regs *regs)
{
- force_sig_fault(SIGBUS, BUS_ADRERR,
- (void __user *)(regs->int_parm_long & __FAIL_ADDR_MASK));
+ force_sig_fault(SIGBUS, BUS_ADRERR, (void __user *)get_fault_address(regs));
}
static void do_fault_error(struct pt_regs *regs, vm_fault_t fault)
@@ -547,7 +545,7 @@ NOKPROBE_SYMBOL(do_dat_exception);
void do_secure_storage_access(struct pt_regs *regs)
{
- unsigned long addr = regs->int_parm_long & __FAIL_ADDR_MASK;
+ unsigned long addr = get_fault_address(regs);
struct vm_area_struct *vma;
struct mm_struct *mm;
struct page *page;
@@ -625,8 +623,8 @@ NOKPROBE_SYMBOL(do_secure_storage_access);
void do_non_secure_storage_access(struct pt_regs *regs)
{
- unsigned long gaddr = regs->int_parm_long & __FAIL_ADDR_MASK;
struct gmap *gmap = (struct gmap *)S390_lowcore.gmap;
+ unsigned long gaddr = get_fault_address(regs);
if (get_fault_type(regs) != GMAP_FAULT) {
do_fault_error(regs, VM_FAULT_BADMAP);
@@ -640,8 +638,8 @@ NOKPROBE_SYMBOL(do_non_secure_storage_access);
void do_secure_storage_violation(struct pt_regs *regs)
{
- unsigned long gaddr = regs->int_parm_long & __FAIL_ADDR_MASK;
struct gmap *gmap = (struct gmap *)S390_lowcore.gmap;
+ unsigned long gaddr = get_fault_address(regs);
/*
* If the VM has been rebooted, its address space might still contain