diff options
Diffstat (limited to 'arch/s390/mm/fault.c')
| -rw-r--r-- | arch/s390/mm/fault.c | 29 | 
1 files changed, 7 insertions, 22 deletions
| diff --git a/arch/s390/mm/fault.c b/arch/s390/mm/fault.c index 996884dcc9fd..b8210103de14 100644 --- a/arch/s390/mm/fault.c +++ b/arch/s390/mm/fault.c @@ -53,7 +53,6 @@  enum fault_type {  	KERNEL_FAULT,  	USER_FAULT, -	VDSO_FAULT,  	GMAP_FAULT,  }; @@ -77,22 +76,16 @@ static enum fault_type get_fault_type(struct pt_regs *regs)  	trans_exc_code = regs->int_parm_long & 3;  	if (likely(trans_exc_code == 0)) {  		/* primary space exception */ -		if (IS_ENABLED(CONFIG_PGSTE) && -		    test_pt_regs_flag(regs, PIF_GUEST_FAULT)) -			return GMAP_FAULT; -		if (current->thread.mm_segment == USER_DS) +		if (user_mode(regs))  			return USER_FAULT; -		return KERNEL_FAULT; -	} -	if (trans_exc_code == 2) { -		/* secondary space exception */ -		if (current->thread.mm_segment & 1) { -			if (current->thread.mm_segment == USER_DS_SACF) -				return USER_FAULT; +		if (!IS_ENABLED(CONFIG_PGSTE))  			return KERNEL_FAULT; -		} -		return VDSO_FAULT; +		if (test_pt_regs_flag(regs, PIF_GUEST_FAULT)) +			return GMAP_FAULT; +		return KERNEL_FAULT;  	} +	if (trans_exc_code == 2) +		return USER_FAULT;  	if (trans_exc_code == 1) {  		/* access register mode, not used in the kernel */  		return USER_FAULT; @@ -188,10 +181,6 @@ static void dump_fault_info(struct pt_regs *regs)  		asce = S390_lowcore.user_asce;  		pr_cont("user ");  		break; -	case VDSO_FAULT: -		asce = S390_lowcore.vdso_asce; -		pr_cont("vdso "); -		break;  	case GMAP_FAULT:  		asce = ((struct gmap *) S390_lowcore.gmap)->asce;  		pr_cont("gmap "); @@ -414,9 +403,6 @@ static inline vm_fault_t do_exception(struct pt_regs *regs, int access)  	switch (type) {  	case KERNEL_FAULT:  		goto out; -	case VDSO_FAULT: -		fault = VM_FAULT_BADMAP; -		goto out;  	case USER_FAULT:  	case GMAP_FAULT:  		if (faulthandler_disabled() || !mm) @@ -834,7 +820,6 @@ void do_secure_storage_access(struct pt_regs *regs)  		if (rc)  			BUG();  		break; -	case VDSO_FAULT:  	case GMAP_FAULT:  	default:  		do_fault_error(regs, VM_READ | VM_WRITE, VM_FAULT_BADMAP); | 
