summaryrefslogtreecommitdiff
path: root/rust/helpers
diff options
context:
space:
mode:
authorVasily Gorbik <gor@linux.ibm.com>2025-11-28 23:01:08 +0100
committerHeiko Carstens <hca@linux.ibm.com>2025-12-07 16:15:19 +0100
commit8543ecc0e03b9367e36a93d82bdef0bf5a16dc56 (patch)
tree3b3fa46c4782b15cecf9ac92dc306f2d0b95ce78 /rust/helpers
parent6a35d02fec5a1e2ab6c0c94ccc5b0c57a580b098 (diff)
s390: Unmap early KASAN shadow on memory offlining
Teach the memory hotplug path to tear down KASAN shadow that was mapped during early boot when a memory block is offlined. Track for each sclp_mem whether its range was covered by the early KASAN shadow via an early_shadow_mapped flag. When such a block is deconfigured and removed via sclp_config_mem_store(), compute the corresponding shadow range and call vmemmap_free() to unmap the boot mapped shadow, then clear the flag. Using vmemmap_free() for the early shadow is safe despite the use of large mappings in the boot-time KASAN setup. The initial shadow is mapped with 1M and 2G pages, where possible. The minimum hotplug memory block size is 128M and always aligned (the identity mapping is at least 2G aligned), which corresponds to a 16M chunk of at least 1M aligned shadow. PMD-mapped 1M shadow pages therefore never need splitting, and PUD-mapped 2G shadow pages can now be split following the preceding changes. Relax the modify_pagetable() sanity check in vmem so that, with KASAN enabled, it may also operate on the KASAN shadow region in addition to the 1:1 mapping and vmemmap area. This allows the KASAN shadow unmapping to reuse the common vmem helpers. Signed-off-by: Vasily Gorbik <gor@linux.ibm.com> Reviewed-by: Heiko Carstens <hca@linux.ibm.com> Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
Diffstat (limited to 'rust/helpers')
0 files changed, 0 insertions, 0 deletions