This is a note to let you know that I've just added the patch titled KVM: s390/mm: Fix storage key corruption during swapping to the 3.16-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: kvm-s390-mm-fix-storage-key-corruption-during-swapping.patch and it can be found in the queue-3.16 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. >From 3e03d4c46daa849880837d802e41c14132a03ef9 Mon Sep 17 00:00:00 2001 From: Christian Borntraeger <borntraeger@xxxxxxxxxx> Date: Thu, 28 Aug 2014 21:21:41 +0200 Subject: KVM: s390/mm: Fix storage key corruption during swapping From: Christian Borntraeger <borntraeger@xxxxxxxxxx> commit 3e03d4c46daa849880837d802e41c14132a03ef9 upstream. Since 3.12 or more precisely commit 0944fe3f4a32 ("s390/mm: implement software referenced bits") guest storage keys get corrupted during paging. This commit added another valid->invalid translation for page tables - namely ptep_test_and_clear_young. We have to transfer the storage key into the pgste in that case. Signed-off-by: Christian Borntraeger <borntraeger@xxxxxxxxxx> Acked-by: Martin Schwidefsky <schwidefsky@xxxxxxxxxx> Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> --- arch/s390/include/asm/pgtable.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) --- a/arch/s390/include/asm/pgtable.h +++ b/arch/s390/include/asm/pgtable.h @@ -1115,7 +1115,7 @@ static inline int ptep_test_and_clear_yo unsigned long addr, pte_t *ptep) { pgste_t pgste; - pte_t pte; + pte_t pte, oldpte; int young; if (mm_has_pgste(vma->vm_mm)) { @@ -1123,12 +1123,13 @@ static inline int ptep_test_and_clear_yo pgste = pgste_ipte_notify(vma->vm_mm, ptep, pgste); } - pte = *ptep; + oldpte = pte = *ptep; ptep_flush_direct(vma->vm_mm, addr, ptep); young = pte_young(pte); pte = pte_mkold(pte); if (mm_has_pgste(vma->vm_mm)) { + pgste = pgste_update_all(&oldpte, pgste, vma->vm_mm); pgste = pgste_set_pte(ptep, pgste, pte); pgste_set_unlock(ptep, pgste); } else Patches currently in stable-queue which might be from borntraeger@xxxxxxxxxx are queue-3.16/kvm-s390-fix-user-triggerable-bug-in-dead-code.patch queue-3.16/kvm-s390-mm-try-a-cow-on-read-only-pages-for-key-ops.patch queue-3.16/kvm-s390-mm-fix-storage-key-corruption-during-swapping.patch queue-3.16/kvm-s390-mm-fix-guest-storage-key-corruption-in-ptep_set_access_flags.patch -- To unsubscribe from this list: send the line "unsubscribe stable" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html