Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8fe234d3 authored by Heiko Carstens's avatar Heiko Carstens Committed by Martin Schwidefsky
Browse files

s390/mm: fix mapping of read-only kernel text section



Within the identity mapping the kernel text section is mapped read-only.
However when mapping the first and last page of the text section we must
round upwards and downwards respectively, if only parts of a page belong
to the section.
Otherwise potential rw data can be mapped read-only. So the rounding must
be done just the other way we have it right now.

Signed-off-by: default avatarHeiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: default avatarMartin Schwidefsky <schwidefsky@de.ibm.com>
parent e76e82d7
Loading
Loading
Loading
Loading
+2 −2
Original line number Original line Diff line number Diff line
@@ -331,8 +331,8 @@ void __init vmem_map_init(void)
	unsigned long start, end;
	unsigned long start, end;
	int i;
	int i;


	ro_start = ((unsigned long)&_stext) & PAGE_MASK;
	ro_start = PFN_ALIGN((unsigned long)&_stext);
	ro_end = PFN_ALIGN((unsigned long)&_eshared);
	ro_end = (unsigned long)&_eshared & PAGE_MASK;
	for (i = 0; i < MEMORY_CHUNKS && memory_chunk[i].size > 0; i++) {
	for (i = 0; i < MEMORY_CHUNKS && memory_chunk[i].size > 0; i++) {
		if (memory_chunk[i].type == CHUNK_CRASHK ||
		if (memory_chunk[i].type == CHUNK_CRASHK ||
		    memory_chunk[i].type == CHUNK_OLDMEM)
		    memory_chunk[i].type == CHUNK_OLDMEM)