Skip to content

Commit 84bb41d

Browse files
hcahcaVasily Gorbik
authored andcommitted
s390/cmma: fix handling of swapper_pg_dir and invalid_pg_dir
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. All pages used for swapper_pg_dir and invalid_pg_dir are incorrectly marked as no-dat, which in turn can result in incorrect guest TLB flushes. Fix this by marking those pages correctly as being used for DAT. Cc: <stable@vger.kernel.org> Reviewed-by: Claudio Imbrenda <imbrenda@linux.ibm.com> Signed-off-by: Heiko Carstens <hca@linux.ibm.com> Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
1 parent 44d9304 commit 84bb41d

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

arch/s390/mm/page-states.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,12 @@ void __init cmma_init_nodat(void)
188188
return;
189189
/* Mark pages used in kernel page tables */
190190
mark_kernel_pgd();
191+
page = virt_to_page(&swapper_pg_dir);
192+
for (i = 0; i < 4; i++)
193+
set_bit(PG_arch_1, &page[i].flags);
194+
page = virt_to_page(&invalid_pg_dir);
195+
for (i = 0; i < 4; i++)
196+
set_bit(PG_arch_1, &page[i].flags);
191197

192198
/* Set all kernel pages not used for page tables to stable/no-dat */
193199
for_each_mem_pfn_range(i, MAX_NUMNODES, &start, &end, NULL) {

0 commit comments

Comments
 (0)