Skip to content

Commit 76502ab

Browse files
committed
s390/mm: Change comment and die() message if teid.b61 is zero
The comments in do_protection() give the impression that a TEID, where bit 61 is zero, indicates a low address protection exception. This is not necessarily true, and it depends on the type of Suppression-on-Protection facility of the machine (see Princples of Operation) what this means. Rework the comments and the die() message to reflect this. This may also help to avoid confusion. Reviewed-by: Alexander Gordeev <agordeev@linux.ibm.com> Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
1 parent 02310ad commit 76502ab

1 file changed

Lines changed: 4 additions & 9 deletions

File tree

arch/s390/mm/fault.c

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -368,20 +368,15 @@ void do_protection_exception(struct pt_regs *regs)
368368
if (!(regs->int_code & 0x200))
369369
regs->psw.addr = __rewind_psw(regs->psw, regs->int_code >> 16);
370370
/*
371-
* Check for low-address protection. This needs to be treated
372-
* as a special case because the translation exception code
373-
* field is not guaranteed to contain valid data in this case.
371+
* If bit 61 if the TEID is not set, the remainder of the
372+
* TEID is unpredictable. Special handling is required.
374373
*/
375374
if (unlikely(!teid.b61)) {
376375
if (user_mode(regs)) {
377-
/* Low-address protection in user mode: cannot happen */
378376
dump_fault_info(regs);
379-
die(regs, "Low-address protection");
377+
die(regs, "Unexpected TEID");
380378
}
381-
/*
382-
* Low-address protection in kernel mode means
383-
* NULL pointer write access in kernel mode.
384-
*/
379+
/* Assume low-address protection in kernel mode. */
385380
return handle_fault_error_nolock(regs, 0);
386381
}
387382
if (unlikely(cpu_has_nx() && teid.b56)) {

0 commit comments

Comments
 (0)