linux/drivers/s390/char
Vasily Gorbik 8543ecc0e0 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>
History 2025-12-07 16:15:19 +01:00
..
con3215.c treewide, timers: Rename from_timer() to timer_container_of() 2025-06-08 09:07:37 +02:00
con3270.c s390: Remove compat support 2025-11-17 11:10:38 +01:00
ctrlchar.c s390/ctrlchar: fix kernel doc comment 2021-09-07 13:38:42 +02:00
ctrlchar.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
defkeymap.c s390/defkeymap: fix global init to zero 2018-03-18 23:02:02 -07:00
defkeymap.map s390: add a few more SPDX identifiers 2017-12-05 07:51:09 +01:00
diag_ftp.c s390: Remove KMSG_COMPONENT macro 2025-11-24 11:45:21 +01:00
diag_ftp.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
fs3270.c s390: Remove compat support 2025-11-17 11:10:38 +01:00
hmcdrv_cache.c s390: Remove KMSG_COMPONENT macro 2025-11-24 11:45:21 +01:00
hmcdrv_cache.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
hmcdrv_dev.c s390: Remove KMSG_COMPONENT macro 2025-11-24 11:45:21 +01:00
hmcdrv_dev.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
hmcdrv_ftp.c s390: Remove KMSG_COMPONENT macro 2025-11-24 11:45:21 +01:00
hmcdrv_ftp.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
hmcdrv_mod.c s390: Remove KMSG_COMPONENT macro 2025-11-24 11:45:21 +01:00
Kconfig s390: Remove protvirt and kvm config guards for uv code 2024-07-23 16:02:33 +02:00
keyboard.c s390/drivers: Explicitly include <linux/export.h> 2025-06-17 18:18:02 +02:00
keyboard.h tty: the rest, stop using tty_schedule_flip() 2021-11-25 18:35:23 +01:00
Makefile s390/sclp: Move memory hotplug code for better modularity 2025-08-20 16:38:23 +02:00
monreader.c s390: Remove KMSG_COMPONENT macro 2025-11-24 11:45:21 +01:00
monwriter.c s390: Remove KMSG_COMPONENT macro 2025-11-24 11:45:21 +01:00
raw3270.c s390/drivers: Explicitly include <linux/export.h> 2025-06-17 18:18:02 +02:00
raw3270.h s390/raw3270: make class3270 constant 2024-03-13 09:23:50 +01:00
sclp.c s390/sclp: Fix SCCB present check 2025-08-20 16:37:27 +02:00
sclp.h s390: Use inline qualifier for all EX_TABLE and ALTERNATIVE inline assemblies 2025-03-18 17:13:51 +01:00
sclp_ap.c s390: Remove KMSG_COMPONENT macro 2025-11-24 11:45:21 +01:00
sclp_cmd.c s390: Remove KMSG_COMPONENT macro 2025-11-24 11:45:21 +01:00
sclp_con.c treewide: Switch/rename to timer_delete[_sync]() 2025-04-05 10:30:12 +02:00
sclp_config.c s390: Remove KMSG_COMPONENT macro 2025-11-24 11:45:21 +01:00
sclp_cpi_sys.c s390: Remove KMSG_COMPONENT macro 2025-11-24 11:45:21 +01:00
sclp_cpi_sys.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
sclp_ctl.c s390: Remove compat support 2025-11-17 11:10:38 +01:00
sclp_diag.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
sclp_early.c s390: Remove KMSG_COMPONENT macro 2025-11-24 11:45:21 +01:00
sclp_early_core.c s390: Remove superfluous newlines from inline assemblies 2025-09-29 13:52:08 +02:00
sclp_ftp.c s390: Remove KMSG_COMPONENT macro 2025-11-24 11:45:21 +01:00
sclp_ftp.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
sclp_mem.c s390: Unmap early KASAN shadow on memory offlining 2025-12-07 16:15:19 +01:00
sclp_ocf.c s390: Remove KMSG_COMPONENT macro 2025-11-24 11:45:21 +01:00
sclp_pci.c s390: Remove KMSG_COMPONENT macro 2025-11-24 11:45:21 +01:00
sclp_quiesce.c s390/sclp: Remove quiesce power management support 2021-06-18 16:41:20 +02:00
sclp_rw.c TTY / Serial patches for 5.14-rc1 2021-07-05 14:08:24 -07:00
sclp_rw.h TTY / Serial patches for 5.14-rc1 2021-07-05 14:08:24 -07:00
sclp_sd.c Significant patch series in this merge are as follows: 2025-12-05 13:52:43 -08:00
sclp_sdias.c s390: Remove KMSG_COMPONENT macro 2025-11-24 11:45:21 +01:00
sclp_sdias.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
sclp_tty.c s390/tty: Fix a potential memory leak bug 2025-03-04 17:18:08 +01:00
sclp_tty.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
sclp_vt220.c treewide: Switch/rename to timer_delete[_sync]() 2025-04-05 10:30:12 +02:00
tape.h s390/tape: Add support for bigger block sizes 2025-10-21 10:25:55 +02:00
tape_34xx.c s390: Remove KMSG_COMPONENT macro 2025-11-24 11:45:21 +01:00
tape_3590.c s390: Remove KMSG_COMPONENT macro 2025-11-24 11:45:21 +01:00
tape_3590.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
tape_char.c s390: Remove KMSG_COMPONENT macro 2025-11-24 11:45:21 +01:00
tape_class.c s390: Remove KMSG_COMPONENT macro 2025-11-24 11:45:21 +01:00
tape_class.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
tape_core.c s390: Remove KMSG_COMPONENT macro 2025-11-24 11:45:21 +01:00
tape_proc.c s390: Remove KMSG_COMPONENT macro 2025-11-24 11:45:21 +01:00
tape_std.c s390: Remove KMSG_COMPONENT macro 2025-11-24 11:45:21 +01:00
tape_std.h s390/tape: Add support for bigger block sizes 2025-10-21 10:25:55 +02:00
uvdevice.c s390/uvdevice: Fix and slightly improve kernel-doc comment 2024-11-07 10:37:00 +01:00
vmcp.c s390: Remove compat support 2025-11-17 11:10:38 +01:00
vmlogrdr.c s390: Remove KMSG_COMPONENT macro 2025-11-24 11:45:21 +01:00
vmur.c s390/vmur: Use scnprintf() instead of sprintf() 2025-12-07 16:15:18 +01:00
vmur.h s390/vmur: generate uevent on unsolicited device end 2022-10-10 10:15:10 +02:00
zcore.c s390: Remove KMSG_COMPONENT macro 2025-11-24 11:45:21 +01:00