/* Architecture code defines this if there are other possible ELF
* machine types, e.g. on bi-arch capable hardware. */ #ifndef vmcore_elf_check_arch_cross #define vmcore_elf_check_arch_cross(x) 0 #endif
/* * Architecture code can redefine this if there are any special checks * needed for 32-bit ELF or 64-bit ELF vmcores. In case of 32-bit * only architecture, vmcore_elf64_check_arch can be set to zero.
*/ #ifndef vmcore_elf32_check_arch #define vmcore_elf32_check_arch(x) elf_check_arch(x) #endif
#ifndef is_kdump_kernel /* * is_kdump_kernel() checks whether this kernel is booting after a panic of * previous kernel or not. This is determined by checking if previous kernel * has passed the elf core header address on command line. * * This is not just a test if CONFIG_CRASH_DUMP is enabled or not. It will * return true if CONFIG_CRASH_DUMP=y and if kernel is booting after a panic * of previous kernel.
*/
/* is_vmcore_usable() checks if the kernel is booting after a panic and * the vmcore region is usable. * * This makes use of the fact that due to alignment -2ULL is not * a valid pointer, much in the vain of IS_ERR(), except * dealing directly with an unsigned long long rather than a pointer.
*/
/** * struct vmcore_cb - driver callbacks for /proc/vmcore handling * @pfn_is_ram: check whether a PFN really is RAM and should be accessed when * reading the vmcore. Will return "true" if it is RAM or if the * callback cannot tell. If any callback returns "false", it's not * RAM and the page must not be accessed; zeroes should be * indicated in the vmcore instead. For example, a ballooned page * contains no data and reading from such a page will cause high * load in the hypervisor. * @get_device_ram: query RAM ranges that can only be detected by device * drivers, such as the virtio-mem driver, so they can be included in * the crash dump on architectures that allocate the elfcore hdr in the dump * ("2nd") kernel. Indicated RAM ranges may contain holes to reduce the * total number of ranges; such holes can be detected using the pfn_is_ram * callback just like for other RAM. * @next: List head to manage registered callbacks internally; initialized by * register_vmcore_cb(). * * vmcore callbacks allow drivers managing physical memory ranges to * coordinate with vmcore handling code, for example, to prevent accessing * physical memory ranges that should not be accessed when reading the vmcore, * although included in the vmcore header as memory ranges to dump.
*/ struct vmcore_cb { bool (*pfn_is_ram)(struct vmcore_cb *cb, unsignedlong pfn); int (*get_device_ram)(struct vmcore_cb *cb, struct list_head *list); struct list_head next;
}; externvoid register_vmcore_cb(struct vmcore_cb *cb); externvoid unregister_vmcore_cb(struct vmcore_cb *cb);
/* Allocate a vmcore range and add it to the list. */ staticinlineint vmcore_alloc_add_range(struct list_head *list, unsignedlonglong paddr, unsignedlonglong size)
{ struct vmcore_range *m = kzalloc(sizeof(*m), GFP_KERNEL);
/* Device Dump information to be filled by drivers */ struct vmcoredd_data { char dump_name[VMCOREDD_MAX_NAME_BYTES]; /* Unique name of the dump */ unsignedint size; /* Size of the dump */ /* Driver's registered callback to be invoked to collect dump */ int (*vmcoredd_callback)(struct vmcoredd_data *data, void *buf);
};
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung ist noch experimentell.