{"push_id":2938085315,"size":1,"distinct_size":1,"ref":"refs/heads/use-vmcoreinfo-in-prco-kcore-v1","head":"f977c45ed5711f2994e858928a7c18c6e0bc2ffe","before":"69b673cc6bedb8f7df4c973a4d79ddee0cc89481","commits":[{"sha":"f977c45ed5711f2994e858928a7c18c6e0bc2ffe","author":{"name":"Bhupesh Sharma","email":"6c4cf59e0b52117638464629480b895734ef22d2@redhat.com"},"message":"Use VMCOREINTO inside '/proc/kcore' if available\n\nCommit 94c97db3fe859ca14d7b38b0ae9ee0ffb83689d2 (arm64: Get\n'info->page_offset' from PT_LOAD segments to support KASLR boot cases)\nadded a method to determine 'info->page_offset' from PT_LOAD segments\nfor arm64 platforms.\n\nIn this commit we hardcoded the NOT_PADDR_ARM64 macro as\n0x0000000010a80000UL which was a valid value on qualcomm-amberwing\nboards.\n\nHowever, I was testing this change on several other arm64 boards\nlike apm-mustang, huawei-taishan and hp-moonshot and saw that\nthis value can vary on the basic of the \"Kernel code\" memory\nrange placement.\n\nTo fix the same, this patchset uses a new approach. Since kernel\nversion 4.19-rc5 (Commit\n23c85094fe1895caefdd19ef624ee687ec5f4507 [\"proc/kcore: add vmcoreinfo\nnote to /proc/kcore\"]), '/proc/kcore' contains a new\nPT_NOTE which carries the VMCOREINFO information.\n\nIf the same is available, we can use it for makedumpfile\n'show_mem_usage()' and other functionality. This is especially useful\nfor architectures like arm64 as we can get kernel symbols like\n'VA_BITS' and 'kimage_voffset' from the '/proc/kcore' itself and use it\nto calculate 'info->page_offset' when we make a call to\n'get_page_offset()'.\n\nThis VMCOREINFO note provides us a standard interface which can be\nleveraged while debugging live (or primary) kernel with makedumpfile\n(and other user-space tools), especially to derive the machine specific\ndetails (for e.g. VA_BITS, PHYS_OFFSET and kimage_voffset for arm64\narch).\n\nI also verified the makedumpfile functionality in crash kernel with this\npatchset. Here are some details of the tests I ran:\n\nTesting:\n--------\n1. Architectures tested:\n   a) arm64 :- huawei-taishan, apm-mustang and qualcomm-amberwing boards.\n   b) x86_64 :- Dell optiplex workstation.\n      (NOTE that x86_64 makedumpfile --mem-usage use-case is currently\n      broken with upstream kernel, but I have debugged the root-cause\n      and will separately send a patch to fix the same).\n\n2. Use-cases tested:\n   a) Primary kernel ->\n      [] --mem-usage:\n         # makedumpfile -f --mem-usage /proc/kcore\n\n      [] filtering use-case:\n         # makedumpfile --split -d 31 -x vmlinux --config scrub.conf vmcore dumpfile_{1,2,3}\n\n      [] dumpfile creation:\n         # makedumpfile -d 31 -x vmlinux vmcore dumpfile\n\n   b) Crash kernel ->\n      [] dumpfile creation:\n         # makedumpfile -l --message-level 31 -d 31 /proc/vmcore dump\n\n3. Kernel versions tested:\n   a) Kernel version 4.19-rc5 and above on both arm64 and x86_64.\n   b) Fedora 28 on x86_64.\n   c) Kernel version 4.14 on arm64.\n\nFixes: 94c97db3fe859ca14d7b38b0ae9ee0ffb83689d2 \"arm64: Get 'info->page_offset' from PT_LOAD segments to support KASLR boot cases\"\nCc: Kazuhito Hagio <k-hagio@ab.jp.nec.com>\nSigned-off-by: Bhupesh Sharma <bhsharma@redhat.com>","distinct":true,"url":"https://api.github.com/repos/bhupesh-sharma/makedumpfile/commits/f977c45ed5711f2994e858928a7c18c6e0bc2ffe"}]}
{"actor":{"display_login":"bhupesh-sharma"}}