mirror of
https://github.com/torvalds/linux.git
synced 2026-04-18 06:44:00 -04:00
s390/mm: use __set_memory() variants where useful
Use the __set_memory_yy() variants instead of set_memory_yy() where useful. This allows to make the code a bit more readable. This also fixes the debug pagealloc case, where set_memory_4k() might be called for an area larger than 8TB which would lead to an overflow of the num_pages parameter of set_memory_4k(). However RELOC_HIDE() has to be used for the __set_memory_4k() case for the time being, to avoid compiler warnings because of performing pointer arithmetic on a NULL pointer, which has undefined behavior. This happens because __va(0) always translates to NULL. However this will change, and as soon as this happens the RELOC_HIDE() hack can be removed again. Reviewed-by: Alexander Gordeev <agordeev@linux.ibm.com> Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
This commit is contained in:
@@ -107,7 +107,7 @@ void mark_rodata_ro(void)
|
||||
{
|
||||
unsigned long size = __end_ro_after_init - __start_ro_after_init;
|
||||
|
||||
set_memory_ro((unsigned long)__start_ro_after_init, size >> PAGE_SHIFT);
|
||||
__set_memory_ro(__start_ro_after_init, __end_ro_after_init);
|
||||
pr_info("Write protected read-only-after-init data: %luk\n", size >> 10);
|
||||
debug_checkwx();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user