David S. Miller 84bd6d8b9c sparc64: Fix corrupted thread fault code.
Every path that ends up at do_sparc64_fault() must install a valid
FAULT_CODE_* bitmask in the per-thread fault code byte.

Two paths leading to the label winfix_trampoline (which expects the
FAULT_CODE_* mask in register %g4) were not doing so:

1) For pre-hypervisor TLB protection violation traps, if we took
   the 'winfix_trampoline' path we wouldn't have %g4 initialized
   with the FAULT_CODE_* value yet.  Resulting in using the
   TLB_TAG_ACCESS register address value instead.

2) In the TSB miss path, when we notice that we are going to use a
   hugepage mapping, but we haven't allocated the hugepage TSB yet, we
   still have to take the window fixup case into consideration and
   in that particular path we leave %g4 not setup properly.

Errors on this sort were largely invisible previously, but after
commit 4ccb9272892c33ef1c19a783cfa87103b30c2784 ("sparc64: sun4v TLB
error power off events") we now have a fault_code mask bit
(FAULT_CODE_BAD_RA) that triggers due to this bug.

FAULT_CODE_BAD_RA triggers because this bit is set in TLB_TAG_ACCESS
(see #1 above) and thus we get seemingly random bus errors triggered
for user processes.

Fixes: 4ccb9272892c ("sparc64: sun4v TLB error power off events")
Reported-by: Meelis Roos <mroos@linux.ee>
Signed-off-by: David S. Miller <davem@davemloft.net>
2014-10-18 23:03:09 -04:00
..
2013-02-17 23:36:56 -05:00
2014-05-18 19:01:30 -07:00
2014-05-18 19:01:29 -07:00
2012-07-26 16:46:15 -07:00
2014-09-16 18:26:40 -07:00
2014-09-16 18:26:40 -07:00
2014-05-18 19:01:31 -07:00
2014-10-05 16:53:40 -07:00
2014-08-26 13:45:55 -04:00
2014-05-02 01:30:21 -04:00
2014-08-26 13:45:55 -04:00
2014-05-18 19:01:29 -07:00
2013-11-13 12:09:05 +09:00
2014-08-26 13:45:55 -04:00
2014-08-26 13:45:55 -04:00
2014-05-18 19:01:27 -07:00
2014-09-16 18:26:40 -07:00
2013-02-17 23:36:56 -05:00
2013-06-13 22:12:14 +01:00
2012-03-28 18:30:03 +01:00
2014-09-16 18:23:11 -07:00
2014-08-26 13:45:55 -04:00
2014-07-21 22:27:56 -07:00
2014-08-26 13:45:55 -04:00
2014-09-30 14:17:08 -07:00