s390x/mmu: Fix the handling of the table levels
commitf8f84e93ab6111848cfc83b3d6122573eb03bccf
authorThomas Huth <thuth@linux.vnet.ibm.com>
Thu, 12 Feb 2015 17:09:20 +0000 (12 18:09 +0100)
committerChristian Borntraeger <borntraeger@de.ibm.com>
Wed, 18 Feb 2015 08:37:14 +0000 (18 09:37 +0100)
tree8def6d45138ccad288b2e59195291d853656ca12
parent89a41e0a37f3c749f3038ac2544f74257bc7b94d
s390x/mmu: Fix the handling of the table levels

The current code used a wrong and very confusing way of dealing with
the table levels by introducing a "fake level above current". However,
the real problem was simply that the checks for the region/segment
invalid bit and for the matching region/segment level was done at the
wrong spot in the code - it has to be done after the first table entry
has been looked up instead (e.g. there is also no "invalid" bit in the
ASCE itself and the current "level" has to be the same as the level in
the entry that we just looked up).
Also the entries for the segment table are quite a bit different compared
to the region table entries. So this patch moves the related code into the
function mmu_translate_segment() to make it clear at which table level we
currently are and to get rid of the ugly switch-statement in the function
mmu_translate_region().

Signed-off-by: Thomas Huth <thuth@linux.vnet.ibm.com>
Signed-off-by: Jens Freimann <jfrei@linux.vnet.ibm.com>
Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
target-s390x/mmu_helper.c