KVM: s390: gaccess: fix real-space designation asce handling for gmap shadows
authorHeiko Carstens <heiko.carstens@de.ibm.com>
Mon, 19 Jun 2017 06:02:28 +0000 (08:02 +0200)
committerRaspbian kernel package updater <root@raspbian.org>
Sun, 23 Jul 2017 03:02:11 +0000 (03:02 +0000)
commit35529da35c99d097c820814cdf0b898124f14046
tree1f08c2ee4de77ccb22e4dc187a70fe634af1c6fe
parentaa69f82a15dc772e088b61847e1663cdcf20d140
KVM: s390: gaccess: fix real-space designation asce handling for gmap shadows

commit addb63c18a0d52a9ce2611d039f981f7b6148d2b upstream.

For real-space designation asces the asce origin part is only a token.
The asce token origin must not be used to generate an effective
address for storage references. This however is erroneously done
within kvm_s390_shadow_tables().

Furthermore within the same function the wrong parts of virtual
addresses are used to generate a corresponding real address
(e.g. the region second index is used as region first index).

Both of the above can result in incorrect address translations. Only
for real space designations with a token origin of zero and addresses
below one megabyte the translation was correct.

Furthermore replace a "!asce.r" statement with a "!*fake" statement to
make it more obvious that a specific condition has nothing to do with
the architecture, but with the fake handling of real space designations.

Fixes: 3218f7094b6b ("s390/mm: support real-space for gmap shadows")
Cc: David Hildenbrand <david@redhat.com>
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Reviewed-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/s390/kvm/gaccess.c