Patch "s390/cmma: fix detection of DAT pages" has been added to the 4.19-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    s390/cmma: fix detection of DAT pages

to the 4.19-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:
     s390-cmma-fix-detection-of-dat-pages.patch
and it can be found in the queue-4.19 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 184321b6220f28c99a9be086a01cce54e248a277
Author: Heiko Carstens <hca@xxxxxxxxxxxxx>
Date:   Tue Oct 24 10:15:19 2023 +0200

    s390/cmma: fix detection of DAT pages
    
    [ Upstream commit 44d93045247661acbd50b1629e62f415f2747577 ]
    
    If the cmma no-dat feature is available the kernel page tables are walked
    to identify and mark all pages which are used for address translation (all
    region, segment, and page tables). In a subsequent loop all other pages are
    marked as "no-dat" pages with the ESSA instruction.
    
    This information is visible to the hypervisor, so that the hypervisor can
    optimize purging of guest TLB entries. The initial loop however is
    incorrect: only the first three of the four pages which belong to segment
    and region tables will be marked as being used for DAT. The last page is
    incorrectly marked as no-dat.
    
    This can result in incorrect guest TLB flushes.
    
    Fix this by simply marking all four pages.
    
    Cc: <stable@xxxxxxxxxxxxxxx>
    Reviewed-by: Claudio Imbrenda <imbrenda@xxxxxxxxxxxxx>
    Signed-off-by: Heiko Carstens <hca@xxxxxxxxxxxxx>
    Signed-off-by: Vasily Gorbik <gor@xxxxxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/arch/s390/mm/page-states.c b/arch/s390/mm/page-states.c
index 5a0460b0fd6ae..182240411211c 100644
--- a/arch/s390/mm/page-states.c
+++ b/arch/s390/mm/page-states.c
@@ -137,7 +137,7 @@ static void mark_kernel_pud(p4d_t *p4d, unsigned long addr, unsigned long end)
 			continue;
 		if (!pud_folded(*pud)) {
 			page = phys_to_page(pud_val(*pud));
-			for (i = 0; i < 3; i++)
+			for (i = 0; i < 4; i++)
 				set_bit(PG_arch_1, &page[i].flags);
 		}
 		mark_kernel_pmd(pud, addr, next);
@@ -158,7 +158,7 @@ static void mark_kernel_p4d(pgd_t *pgd, unsigned long addr, unsigned long end)
 			continue;
 		if (!p4d_folded(*p4d)) {
 			page = phys_to_page(p4d_val(*p4d));
-			for (i = 0; i < 3; i++)
+			for (i = 0; i < 4; i++)
 				set_bit(PG_arch_1, &page[i].flags);
 		}
 		mark_kernel_pud(p4d, addr, next);
@@ -180,7 +180,7 @@ static void mark_kernel_pgd(void)
 			continue;
 		if (!pgd_folded(*pgd)) {
 			page = phys_to_page(pgd_val(*pgd));
-			for (i = 0; i < 3; i++)
+			for (i = 0; i < 4; i++)
 				set_bit(PG_arch_1, &page[i].flags);
 		}
 		mark_kernel_p4d(pgd, addr, next);



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux