1*4882a593Smuzhiyun====================== 2*4882a593SmuzhiyunFirmware-Assisted Dump 3*4882a593Smuzhiyun====================== 4*4882a593Smuzhiyun 5*4882a593SmuzhiyunJuly 2011 6*4882a593Smuzhiyun 7*4882a593SmuzhiyunThe goal of firmware-assisted dump is to enable the dump of 8*4882a593Smuzhiyuna crashed system, and to do so from a fully-reset system, and 9*4882a593Smuzhiyunto minimize the total elapsed time until the system is back 10*4882a593Smuzhiyunin production use. 11*4882a593Smuzhiyun 12*4882a593Smuzhiyun- Firmware-Assisted Dump (FADump) infrastructure is intended to replace 13*4882a593Smuzhiyun the existing phyp assisted dump. 14*4882a593Smuzhiyun- Fadump uses the same firmware interfaces and memory reservation model 15*4882a593Smuzhiyun as phyp assisted dump. 16*4882a593Smuzhiyun- Unlike phyp dump, FADump exports the memory dump through /proc/vmcore 17*4882a593Smuzhiyun in the ELF format in the same way as kdump. This helps us reuse the 18*4882a593Smuzhiyun kdump infrastructure for dump capture and filtering. 19*4882a593Smuzhiyun- Unlike phyp dump, userspace tool does not need to refer any sysfs 20*4882a593Smuzhiyun interface while reading /proc/vmcore. 21*4882a593Smuzhiyun- Unlike phyp dump, FADump allows user to release all the memory reserved 22*4882a593Smuzhiyun for dump, with a single operation of echo 1 > /sys/kernel/fadump_release_mem. 23*4882a593Smuzhiyun- Once enabled through kernel boot parameter, FADump can be 24*4882a593Smuzhiyun started/stopped through /sys/kernel/fadump_registered interface (see 25*4882a593Smuzhiyun sysfs files section below) and can be easily integrated with kdump 26*4882a593Smuzhiyun service start/stop init scripts. 27*4882a593Smuzhiyun 28*4882a593SmuzhiyunComparing with kdump or other strategies, firmware-assisted 29*4882a593Smuzhiyundump offers several strong, practical advantages: 30*4882a593Smuzhiyun 31*4882a593Smuzhiyun- Unlike kdump, the system has been reset, and loaded 32*4882a593Smuzhiyun with a fresh copy of the kernel. In particular, 33*4882a593Smuzhiyun PCI and I/O devices have been reinitialized and are 34*4882a593Smuzhiyun in a clean, consistent state. 35*4882a593Smuzhiyun- Once the dump is copied out, the memory that held the dump 36*4882a593Smuzhiyun is immediately available to the running kernel. And therefore, 37*4882a593Smuzhiyun unlike kdump, FADump doesn't need a 2nd reboot to get back 38*4882a593Smuzhiyun the system to the production configuration. 39*4882a593Smuzhiyun 40*4882a593SmuzhiyunThe above can only be accomplished by coordination with, 41*4882a593Smuzhiyunand assistance from the Power firmware. The procedure is 42*4882a593Smuzhiyunas follows: 43*4882a593Smuzhiyun 44*4882a593Smuzhiyun- The first kernel registers the sections of memory with the 45*4882a593Smuzhiyun Power firmware for dump preservation during OS initialization. 46*4882a593Smuzhiyun These registered sections of memory are reserved by the first 47*4882a593Smuzhiyun kernel during early boot. 48*4882a593Smuzhiyun 49*4882a593Smuzhiyun- When system crashes, the Power firmware will copy the registered 50*4882a593Smuzhiyun low memory regions (boot memory) from source to destination area. 51*4882a593Smuzhiyun It will also save hardware PTE's. 52*4882a593Smuzhiyun 53*4882a593Smuzhiyun NOTE: 54*4882a593Smuzhiyun The term 'boot memory' means size of the low memory chunk 55*4882a593Smuzhiyun that is required for a kernel to boot successfully when 56*4882a593Smuzhiyun booted with restricted memory. By default, the boot memory 57*4882a593Smuzhiyun size will be the larger of 5% of system RAM or 256MB. 58*4882a593Smuzhiyun Alternatively, user can also specify boot memory size 59*4882a593Smuzhiyun through boot parameter 'crashkernel=' which will override 60*4882a593Smuzhiyun the default calculated size. Use this option if default 61*4882a593Smuzhiyun boot memory size is not sufficient for second kernel to 62*4882a593Smuzhiyun boot successfully. For syntax of crashkernel= parameter, 63*4882a593Smuzhiyun refer to Documentation/admin-guide/kdump/kdump.rst. If any 64*4882a593Smuzhiyun offset is provided in crashkernel= parameter, it will be 65*4882a593Smuzhiyun ignored as FADump uses a predefined offset to reserve memory 66*4882a593Smuzhiyun for boot memory dump preservation in case of a crash. 67*4882a593Smuzhiyun 68*4882a593Smuzhiyun- After the low memory (boot memory) area has been saved, the 69*4882a593Smuzhiyun firmware will reset PCI and other hardware state. It will 70*4882a593Smuzhiyun *not* clear the RAM. It will then launch the bootloader, as 71*4882a593Smuzhiyun normal. 72*4882a593Smuzhiyun 73*4882a593Smuzhiyun- The freshly booted kernel will notice that there is a new node 74*4882a593Smuzhiyun (rtas/ibm,kernel-dump on pSeries or ibm,opal/dump/mpipl-boot 75*4882a593Smuzhiyun on OPAL platform) in the device tree, indicating that 76*4882a593Smuzhiyun there is crash data available from a previous boot. During 77*4882a593Smuzhiyun the early boot OS will reserve rest of the memory above 78*4882a593Smuzhiyun boot memory size effectively booting with restricted memory 79*4882a593Smuzhiyun size. This will make sure that this kernel (also, referred 80*4882a593Smuzhiyun to as second kernel or capture kernel) will not touch any 81*4882a593Smuzhiyun of the dump memory area. 82*4882a593Smuzhiyun 83*4882a593Smuzhiyun- User-space tools will read /proc/vmcore to obtain the contents 84*4882a593Smuzhiyun of memory, which holds the previous crashed kernel dump in ELF 85*4882a593Smuzhiyun format. The userspace tools may copy this info to disk, or 86*4882a593Smuzhiyun network, nas, san, iscsi, etc. as desired. 87*4882a593Smuzhiyun 88*4882a593Smuzhiyun- Once the userspace tool is done saving dump, it will echo 89*4882a593Smuzhiyun '1' to /sys/kernel/fadump_release_mem to release the reserved 90*4882a593Smuzhiyun memory back to general use, except the memory required for 91*4882a593Smuzhiyun next firmware-assisted dump registration. 92*4882a593Smuzhiyun 93*4882a593Smuzhiyun e.g.:: 94*4882a593Smuzhiyun 95*4882a593Smuzhiyun # echo 1 > /sys/kernel/fadump_release_mem 96*4882a593Smuzhiyun 97*4882a593SmuzhiyunPlease note that the firmware-assisted dump feature 98*4882a593Smuzhiyunis only available on POWER6 and above systems on pSeries 99*4882a593Smuzhiyun(PowerVM) platform and POWER9 and above systems with OP940 100*4882a593Smuzhiyunor later firmware versions on PowerNV (OPAL) platform. 101*4882a593SmuzhiyunNote that, OPAL firmware exports ibm,opal/dump node when 102*4882a593SmuzhiyunFADump is supported on PowerNV platform. 103*4882a593Smuzhiyun 104*4882a593SmuzhiyunOn OPAL based machines, system first boots into an intermittent 105*4882a593Smuzhiyunkernel (referred to as petitboot kernel) before booting into the 106*4882a593Smuzhiyuncapture kernel. This kernel would have minimal kernel and/or 107*4882a593Smuzhiyunuserspace support to process crash data. Such kernel needs to 108*4882a593Smuzhiyunpreserve previously crash'ed kernel's memory for the subsequent 109*4882a593Smuzhiyuncapture kernel boot to process this crash data. Kernel config 110*4882a593Smuzhiyunoption CONFIG_PRESERVE_FA_DUMP has to be enabled on such kernel 111*4882a593Smuzhiyunto ensure that crash data is preserved to process later. 112*4882a593Smuzhiyun 113*4882a593Smuzhiyun-- On OPAL based machines (PowerNV), if the kernel is build with 114*4882a593Smuzhiyun CONFIG_OPAL_CORE=y, OPAL memory at the time of crash is also 115*4882a593Smuzhiyun exported as /sys/firmware/opal/mpipl/core file. This procfs file is 116*4882a593Smuzhiyun helpful in debugging OPAL crashes with GDB. The kernel memory 117*4882a593Smuzhiyun used for exporting this procfs file can be released by echo'ing 118*4882a593Smuzhiyun '1' to /sys/firmware/opal/mpipl/release_core node. 119*4882a593Smuzhiyun 120*4882a593Smuzhiyun e.g. 121*4882a593Smuzhiyun # echo 1 > /sys/firmware/opal/mpipl/release_core 122*4882a593Smuzhiyun 123*4882a593SmuzhiyunImplementation details: 124*4882a593Smuzhiyun----------------------- 125*4882a593Smuzhiyun 126*4882a593SmuzhiyunDuring boot, a check is made to see if firmware supports 127*4882a593Smuzhiyunthis feature on that particular machine. If it does, then 128*4882a593Smuzhiyunwe check to see if an active dump is waiting for us. If yes 129*4882a593Smuzhiyunthen everything but boot memory size of RAM is reserved during 130*4882a593Smuzhiyunearly boot (See Fig. 2). This area is released once we finish 131*4882a593Smuzhiyuncollecting the dump from user land scripts (e.g. kdump scripts) 132*4882a593Smuzhiyunthat are run. If there is dump data, then the 133*4882a593Smuzhiyun/sys/kernel/fadump_release_mem file is created, and the reserved 134*4882a593Smuzhiyunmemory is held. 135*4882a593Smuzhiyun 136*4882a593SmuzhiyunIf there is no waiting dump data, then only the memory required to 137*4882a593Smuzhiyunhold CPU state, HPTE region, boot memory dump, FADump header and 138*4882a593Smuzhiyunelfcore header, is usually reserved at an offset greater than boot 139*4882a593Smuzhiyunmemory size (see Fig. 1). This area is *not* released: this region 140*4882a593Smuzhiyunwill be kept permanently reserved, so that it can act as a receptacle 141*4882a593Smuzhiyunfor a copy of the boot memory content in addition to CPU state and 142*4882a593SmuzhiyunHPTE region, in the case a crash does occur. 143*4882a593Smuzhiyun 144*4882a593SmuzhiyunSince this reserved memory area is used only after the system crash, 145*4882a593Smuzhiyunthere is no point in blocking this significant chunk of memory from 146*4882a593Smuzhiyunproduction kernel. Hence, the implementation uses the Linux kernel's 147*4882a593SmuzhiyunContiguous Memory Allocator (CMA) for memory reservation if CMA is 148*4882a593Smuzhiyunconfigured for kernel. With CMA reservation this memory will be 149*4882a593Smuzhiyunavailable for applications to use it, while kernel is prevented from 150*4882a593Smuzhiyunusing it. With this FADump will still be able to capture all of the 151*4882a593Smuzhiyunkernel memory and most of the user space memory except the user pages 152*4882a593Smuzhiyunthat were present in CMA region:: 153*4882a593Smuzhiyun 154*4882a593Smuzhiyun o Memory Reservation during first kernel 155*4882a593Smuzhiyun 156*4882a593Smuzhiyun Low memory Top of memory 157*4882a593Smuzhiyun 0 boot memory size |<--- Reserved dump area --->| | 158*4882a593Smuzhiyun | | | Permanent Reservation | | 159*4882a593Smuzhiyun V V | | V 160*4882a593Smuzhiyun +-----------+-----/ /---+---+----+-------+-----+-----+----+--+ 161*4882a593Smuzhiyun | | |///|////| DUMP | HDR | ELF |////| | 162*4882a593Smuzhiyun +-----------+-----/ /---+---+----+-------+-----+-----+----+--+ 163*4882a593Smuzhiyun | ^ ^ ^ ^ ^ 164*4882a593Smuzhiyun | | | | | | 165*4882a593Smuzhiyun \ CPU HPTE / | | 166*4882a593Smuzhiyun ------------------------------ | | 167*4882a593Smuzhiyun Boot memory content gets transferred | | 168*4882a593Smuzhiyun to reserved area by firmware at the | | 169*4882a593Smuzhiyun time of crash. | | 170*4882a593Smuzhiyun FADump Header | 171*4882a593Smuzhiyun (meta area) | 172*4882a593Smuzhiyun | 173*4882a593Smuzhiyun | 174*4882a593Smuzhiyun Metadata: This area holds a metadata struture whose 175*4882a593Smuzhiyun address is registered with f/w and retrieved in the 176*4882a593Smuzhiyun second kernel after crash, on platforms that support 177*4882a593Smuzhiyun tags (OPAL). Having such structure with info needed 178*4882a593Smuzhiyun to process the crashdump eases dump capture process. 179*4882a593Smuzhiyun 180*4882a593Smuzhiyun Fig. 1 181*4882a593Smuzhiyun 182*4882a593Smuzhiyun 183*4882a593Smuzhiyun o Memory Reservation during second kernel after crash 184*4882a593Smuzhiyun 185*4882a593Smuzhiyun Low memory Top of memory 186*4882a593Smuzhiyun 0 boot memory size | 187*4882a593Smuzhiyun | |<------------ Crash preserved area ------------>| 188*4882a593Smuzhiyun V V |<--- Reserved dump area --->| | 189*4882a593Smuzhiyun +-----------+-----/ /---+---+----+-------+-----+-----+----+--+ 190*4882a593Smuzhiyun | | |///|////| DUMP | HDR | ELF |////| | 191*4882a593Smuzhiyun +-----------+-----/ /---+---+----+-------+-----+-----+----+--+ 192*4882a593Smuzhiyun | | 193*4882a593Smuzhiyun V V 194*4882a593Smuzhiyun Used by second /proc/vmcore 195*4882a593Smuzhiyun kernel to boot 196*4882a593Smuzhiyun 197*4882a593Smuzhiyun +---+ 198*4882a593Smuzhiyun |///| -> Regions (CPU, HPTE & Metadata) marked like this in the above 199*4882a593Smuzhiyun +---+ figures are not always present. For example, OPAL platform 200*4882a593Smuzhiyun does not have CPU & HPTE regions while Metadata region is 201*4882a593Smuzhiyun not supported on pSeries currently. 202*4882a593Smuzhiyun 203*4882a593Smuzhiyun Fig. 2 204*4882a593Smuzhiyun 205*4882a593Smuzhiyun 206*4882a593SmuzhiyunCurrently the dump will be copied from /proc/vmcore to a new file upon 207*4882a593Smuzhiyunuser intervention. The dump data available through /proc/vmcore will be 208*4882a593Smuzhiyunin ELF format. Hence the existing kdump infrastructure (kdump scripts) 209*4882a593Smuzhiyunto save the dump works fine with minor modifications. KDump scripts on 210*4882a593Smuzhiyunmajor Distro releases have already been modified to work seemlessly (no 211*4882a593Smuzhiyunuser intervention in saving the dump) when FADump is used, instead of 212*4882a593SmuzhiyunKDump, as dump mechanism. 213*4882a593Smuzhiyun 214*4882a593SmuzhiyunThe tools to examine the dump will be same as the ones 215*4882a593Smuzhiyunused for kdump. 216*4882a593Smuzhiyun 217*4882a593SmuzhiyunHow to enable firmware-assisted dump (FADump): 218*4882a593Smuzhiyun---------------------------------------------- 219*4882a593Smuzhiyun 220*4882a593Smuzhiyun1. Set config option CONFIG_FA_DUMP=y and build kernel. 221*4882a593Smuzhiyun2. Boot into linux kernel with 'fadump=on' kernel cmdline option. 222*4882a593Smuzhiyun By default, FADump reserved memory will be initialized as CMA area. 223*4882a593Smuzhiyun Alternatively, user can boot linux kernel with 'fadump=nocma' to 224*4882a593Smuzhiyun prevent FADump to use CMA. 225*4882a593Smuzhiyun3. Optionally, user can also set 'crashkernel=' kernel cmdline 226*4882a593Smuzhiyun to specify size of the memory to reserve for boot memory dump 227*4882a593Smuzhiyun preservation. 228*4882a593Smuzhiyun 229*4882a593SmuzhiyunNOTE: 230*4882a593Smuzhiyun 1. 'fadump_reserve_mem=' parameter has been deprecated. Instead 231*4882a593Smuzhiyun use 'crashkernel=' to specify size of the memory to reserve 232*4882a593Smuzhiyun for boot memory dump preservation. 233*4882a593Smuzhiyun 2. If firmware-assisted dump fails to reserve memory then it 234*4882a593Smuzhiyun will fallback to existing kdump mechanism if 'crashkernel=' 235*4882a593Smuzhiyun option is set at kernel cmdline. 236*4882a593Smuzhiyun 3. if user wants to capture all of user space memory and ok with 237*4882a593Smuzhiyun reserved memory not available to production system, then 238*4882a593Smuzhiyun 'fadump=nocma' kernel parameter can be used to fallback to 239*4882a593Smuzhiyun old behaviour. 240*4882a593Smuzhiyun 241*4882a593SmuzhiyunSysfs/debugfs files: 242*4882a593Smuzhiyun-------------------- 243*4882a593Smuzhiyun 244*4882a593SmuzhiyunFirmware-assisted dump feature uses sysfs file system to hold 245*4882a593Smuzhiyunthe control files and debugfs file to display memory reserved region. 246*4882a593Smuzhiyun 247*4882a593SmuzhiyunHere is the list of files under kernel sysfs: 248*4882a593Smuzhiyun 249*4882a593Smuzhiyun /sys/kernel/fadump_enabled 250*4882a593Smuzhiyun This is used to display the FADump status. 251*4882a593Smuzhiyun 252*4882a593Smuzhiyun - 0 = FADump is disabled 253*4882a593Smuzhiyun - 1 = FADump is enabled 254*4882a593Smuzhiyun 255*4882a593Smuzhiyun This interface can be used by kdump init scripts to identify if 256*4882a593Smuzhiyun FADump is enabled in the kernel and act accordingly. 257*4882a593Smuzhiyun 258*4882a593Smuzhiyun /sys/kernel/fadump_registered 259*4882a593Smuzhiyun This is used to display the FADump registration status as well 260*4882a593Smuzhiyun as to control (start/stop) the FADump registration. 261*4882a593Smuzhiyun 262*4882a593Smuzhiyun - 0 = FADump is not registered. 263*4882a593Smuzhiyun - 1 = FADump is registered and ready to handle system crash. 264*4882a593Smuzhiyun 265*4882a593Smuzhiyun To register FADump echo 1 > /sys/kernel/fadump_registered and 266*4882a593Smuzhiyun echo 0 > /sys/kernel/fadump_registered for un-register and stop the 267*4882a593Smuzhiyun FADump. Once the FADump is un-registered, the system crash will not 268*4882a593Smuzhiyun be handled and vmcore will not be captured. This interface can be 269*4882a593Smuzhiyun easily integrated with kdump service start/stop. 270*4882a593Smuzhiyun 271*4882a593Smuzhiyun /sys/kernel/fadump/mem_reserved 272*4882a593Smuzhiyun 273*4882a593Smuzhiyun This is used to display the memory reserved by FADump for saving the 274*4882a593Smuzhiyun crash dump. 275*4882a593Smuzhiyun 276*4882a593Smuzhiyun /sys/kernel/fadump_release_mem 277*4882a593Smuzhiyun This file is available only when FADump is active during 278*4882a593Smuzhiyun second kernel. This is used to release the reserved memory 279*4882a593Smuzhiyun region that are held for saving crash dump. To release the 280*4882a593Smuzhiyun reserved memory echo 1 to it:: 281*4882a593Smuzhiyun 282*4882a593Smuzhiyun echo 1 > /sys/kernel/fadump_release_mem 283*4882a593Smuzhiyun 284*4882a593Smuzhiyun After echo 1, the content of the /sys/kernel/debug/powerpc/fadump_region 285*4882a593Smuzhiyun file will change to reflect the new memory reservations. 286*4882a593Smuzhiyun 287*4882a593Smuzhiyun The existing userspace tools (kdump infrastructure) can be easily 288*4882a593Smuzhiyun enhanced to use this interface to release the memory reserved for 289*4882a593Smuzhiyun dump and continue without 2nd reboot. 290*4882a593Smuzhiyun 291*4882a593SmuzhiyunNote: /sys/kernel/fadump_release_opalcore sysfs has moved to 292*4882a593Smuzhiyun /sys/firmware/opal/mpipl/release_core 293*4882a593Smuzhiyun 294*4882a593Smuzhiyun /sys/firmware/opal/mpipl/release_core 295*4882a593Smuzhiyun 296*4882a593Smuzhiyun This file is available only on OPAL based machines when FADump is 297*4882a593Smuzhiyun active during capture kernel. This is used to release the memory 298*4882a593Smuzhiyun used by the kernel to export /sys/firmware/opal/mpipl/core file. To 299*4882a593Smuzhiyun release this memory, echo '1' to it: 300*4882a593Smuzhiyun 301*4882a593Smuzhiyun echo 1 > /sys/firmware/opal/mpipl/release_core 302*4882a593Smuzhiyun 303*4882a593SmuzhiyunNote: The following FADump sysfs files are deprecated. 304*4882a593Smuzhiyun 305*4882a593Smuzhiyun+----------------------------------+--------------------------------+ 306*4882a593Smuzhiyun| Deprecated | Alternative | 307*4882a593Smuzhiyun+----------------------------------+--------------------------------+ 308*4882a593Smuzhiyun| /sys/kernel/fadump_enabled | /sys/kernel/fadump/enabled | 309*4882a593Smuzhiyun+----------------------------------+--------------------------------+ 310*4882a593Smuzhiyun| /sys/kernel/fadump_registered | /sys/kernel/fadump/registered | 311*4882a593Smuzhiyun+----------------------------------+--------------------------------+ 312*4882a593Smuzhiyun| /sys/kernel/fadump_release_mem | /sys/kernel/fadump/release_mem | 313*4882a593Smuzhiyun+----------------------------------+--------------------------------+ 314*4882a593Smuzhiyun 315*4882a593SmuzhiyunHere is the list of files under powerpc debugfs: 316*4882a593Smuzhiyun(Assuming debugfs is mounted on /sys/kernel/debug directory.) 317*4882a593Smuzhiyun 318*4882a593Smuzhiyun /sys/kernel/debug/powerpc/fadump_region 319*4882a593Smuzhiyun This file shows the reserved memory regions if FADump is 320*4882a593Smuzhiyun enabled otherwise this file is empty. The output format 321*4882a593Smuzhiyun is:: 322*4882a593Smuzhiyun 323*4882a593Smuzhiyun <region>: [<start>-<end>] <reserved-size> bytes, Dumped: <dump-size> 324*4882a593Smuzhiyun 325*4882a593Smuzhiyun and for kernel DUMP region is: 326*4882a593Smuzhiyun 327*4882a593Smuzhiyun DUMP: Src: <src-addr>, Dest: <dest-addr>, Size: <size>, Dumped: # bytes 328*4882a593Smuzhiyun 329*4882a593Smuzhiyun e.g. 330*4882a593Smuzhiyun Contents when FADump is registered during first kernel:: 331*4882a593Smuzhiyun 332*4882a593Smuzhiyun # cat /sys/kernel/debug/powerpc/fadump_region 333*4882a593Smuzhiyun CPU : [0x0000006ffb0000-0x0000006fff001f] 0x40020 bytes, Dumped: 0x0 334*4882a593Smuzhiyun HPTE: [0x0000006fff0020-0x0000006fff101f] 0x1000 bytes, Dumped: 0x0 335*4882a593Smuzhiyun DUMP: [0x0000006fff1020-0x0000007fff101f] 0x10000000 bytes, Dumped: 0x0 336*4882a593Smuzhiyun 337*4882a593Smuzhiyun Contents when FADump is active during second kernel:: 338*4882a593Smuzhiyun 339*4882a593Smuzhiyun # cat /sys/kernel/debug/powerpc/fadump_region 340*4882a593Smuzhiyun CPU : [0x0000006ffb0000-0x0000006fff001f] 0x40020 bytes, Dumped: 0x40020 341*4882a593Smuzhiyun HPTE: [0x0000006fff0020-0x0000006fff101f] 0x1000 bytes, Dumped: 0x1000 342*4882a593Smuzhiyun DUMP: [0x0000006fff1020-0x0000007fff101f] 0x10000000 bytes, Dumped: 0x10000000 343*4882a593Smuzhiyun : [0x00000010000000-0x0000006ffaffff] 0x5ffb0000 bytes, Dumped: 0x5ffb0000 344*4882a593Smuzhiyun 345*4882a593Smuzhiyun 346*4882a593SmuzhiyunNOTE: 347*4882a593Smuzhiyun Please refer to Documentation/filesystems/debugfs.rst on 348*4882a593Smuzhiyun how to mount the debugfs filesystem. 349*4882a593Smuzhiyun 350*4882a593Smuzhiyun 351*4882a593SmuzhiyunTODO: 352*4882a593Smuzhiyun----- 353*4882a593Smuzhiyun - Need to come up with the better approach to find out more 354*4882a593Smuzhiyun accurate boot memory size that is required for a kernel to 355*4882a593Smuzhiyun boot successfully when booted with restricted memory. 356*4882a593Smuzhiyun - The FADump implementation introduces a FADump crash info structure 357*4882a593Smuzhiyun in the scratch area before the ELF core header. The idea of introducing 358*4882a593Smuzhiyun this structure is to pass some important crash info data to the second 359*4882a593Smuzhiyun kernel which will help second kernel to populate ELF core header with 360*4882a593Smuzhiyun correct data before it gets exported through /proc/vmcore. The current 361*4882a593Smuzhiyun design implementation does not address a possibility of introducing 362*4882a593Smuzhiyun additional fields (in future) to this structure without affecting 363*4882a593Smuzhiyun compatibility. Need to come up with the better approach to address this. 364*4882a593Smuzhiyun 365*4882a593Smuzhiyun The possible approaches are: 366*4882a593Smuzhiyun 367*4882a593Smuzhiyun 1. Introduce version field for version tracking, bump up the version 368*4882a593Smuzhiyun whenever a new field is added to the structure in future. The version 369*4882a593Smuzhiyun field can be used to find out what fields are valid for the current 370*4882a593Smuzhiyun version of the structure. 371*4882a593Smuzhiyun 2. Reserve the area of predefined size (say PAGE_SIZE) for this 372*4882a593Smuzhiyun structure and have unused area as reserved (initialized to zero) 373*4882a593Smuzhiyun for future field additions. 374*4882a593Smuzhiyun 375*4882a593Smuzhiyun The advantage of approach 1 over 2 is we don't need to reserve extra space. 376*4882a593Smuzhiyun 377*4882a593SmuzhiyunAuthor: Mahesh Salgaonkar <mahesh@linux.vnet.ibm.com> 378*4882a593Smuzhiyun 379*4882a593SmuzhiyunThis document is based on the original documentation written for phyp 380*4882a593Smuzhiyun 381*4882a593Smuzhiyunassisted dump by Linas Vepstas and Manish Ahuja. 382