s390/cmma: fix initial kernel address space page table walk
authorHeiko Carstens <hca@linux.ibm.com>
Tue, 17 Oct 2023 19:07:03 +0000 (21:07 +0200)
committerVasily Gorbik <gor@linux.ibm.com>
Mon, 23 Oct 2023 16:21:23 +0000 (18:21 +0200)
commit16ba44826a04834d3eeeda4b731c2ea3481062b7
treeb1575b41a3baf6722a31b9b6741d1ac294d23cbb
parentc8b5d574fcea49e9974b7658d5337f93d1921f8c
s390/cmma: fix initial kernel address space page table walk

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 does not
cover the complete kernel address space. This can result in pages being
marked as not being used for dynamic address translation, even though they
are. In turn guest TLB entries incorrectly may not be purged.

Fix this by adjusting the end address of the kernel address range being
walked.

Cc: <stable@vger.kernel.org>
Reviewed-by: Claudio Imbrenda <imbrenda@linux.ibm.com>
Reviewed-by: Alexander Gordeev <agordeev@linux.ibm.com>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
arch/s390/mm/page-states.c