fadump.c (742a265accd3e3afcc8e7b17f409c93c1de8be85) fadump.c (2790d01d1e1d22735d848eec55668f7d44417e22)
1// SPDX-License-Identifier: GPL-2.0-or-later
2/*
3 * Firmware Assisted dump: A robust mechanism to get reliable kernel crash
4 * dump with assistance from firmware. This approach does not use kexec,
5 * instead firmware assists in booting the kdump kernel while preserving
6 * memory contents. The most of the code implementation has been adapted
7 * from phyp assisted dump implementation written by Linas Vepstas and
8 * Manish Ahuja

--- 951 unchanged lines hidden (view full) ---

960
961 /* register the future kernel dump with firmware. */
962 pr_debug("Registering for firmware-assisted kernel dump...\n");
963 return fw_dump.ops->fadump_register(&fw_dump);
964}
965
966void fadump_cleanup(void)
967{
1// SPDX-License-Identifier: GPL-2.0-or-later
2/*
3 * Firmware Assisted dump: A robust mechanism to get reliable kernel crash
4 * dump with assistance from firmware. This approach does not use kexec,
5 * instead firmware assists in booting the kdump kernel while preserving
6 * memory contents. The most of the code implementation has been adapted
7 * from phyp assisted dump implementation written by Linas Vepstas and
8 * Manish Ahuja

--- 951 unchanged lines hidden (view full) ---

960
961 /* register the future kernel dump with firmware. */
962 pr_debug("Registering for firmware-assisted kernel dump...\n");
963 return fw_dump.ops->fadump_register(&fw_dump);
964}
965
966void fadump_cleanup(void)
967{
968 if (!fw_dump.fadump_supported)
969 return;
970
968 /* Invalidate the registration only if dump is active. */
969 if (fw_dump.dump_active) {
970 pr_debug("Invalidating firmware-assisted dump registration\n");
971 fw_dump.ops->fadump_invalidate(&fw_dump);
972 } else if (fw_dump.dump_registered) {
973 /* Un-register Firmware-assisted dump if it was registered. */
974 fw_dump.ops->fadump_unregister(&fw_dump);
975 free_crash_memory_ranges();
976 }
971 /* Invalidate the registration only if dump is active. */
972 if (fw_dump.dump_active) {
973 pr_debug("Invalidating firmware-assisted dump registration\n");
974 fw_dump.ops->fadump_invalidate(&fw_dump);
975 } else if (fw_dump.dump_registered) {
976 /* Un-register Firmware-assisted dump if it was registered. */
977 fw_dump.ops->fadump_unregister(&fw_dump);
978 free_crash_memory_ranges();
979 }
980
981 if (fw_dump.ops->fadump_cleanup)
982 fw_dump.ops->fadump_cleanup(&fw_dump);
977}
978
979static void fadump_free_reserved_memory(unsigned long start_pfn,
980 unsigned long end_pfn)
981{
982 unsigned long pfn;
983 unsigned long time_limit = jiffies + HZ;
984

--- 253 unchanged lines hidden ---
983}
984
985static void fadump_free_reserved_memory(unsigned long start_pfn,
986 unsigned long end_pfn)
987{
988 unsigned long pfn;
989 unsigned long time_limit = jiffies + HZ;
990

--- 253 unchanged lines hidden ---