Hi Mukesh,
Thanks for looking into it.
On 8/24/26 6:06 PM, Mukesh Pilaniya wrote:
Hi Dave,
On 24/08/26 12:33 pm, Dave Young wrote:
>
> crash failed with mainline kernel with kaslr enabled.
What does "failed" mean here? A backtrace? Wrong symbols? Please include
the actual error output so the commit log is useful as a bisect landing
point.
I lost the log while sending out the patch, here is it with a retest:
without "-d"
WARNING: could not find MAGIC_START!
crash: cannot determine base kernel version
crash: /home/ruyang/git/linux/vmlinux and ./root/root/vmcore.elf do not match!
With "-d1"
WARNING: could not find MAGIC_START!
cpu_possible_mask: cpus: 0 1 2 3 4 5 6 7 8 9 13 14 16 19 22 23 25 33 34 35 36 38 39 40 41
46 47 50 51 53 54 55 57 65 66 68 69 73 75 76 78 80 89 91 92 118 120 121 128 130 134 136
137 140 141 144 145 146 151 153 155 157 162 165 166 168 169 176 178 180 192 193 195 203
205 206 210 211 217 218 220 222 224 226 230 232 233 236 237 240 241 242 247 251 253 258
259 263 267 268 272 273 274 275 276 278 279 288 289 290 292 295 303 310 320 321 322 323
325 346 348 356 366 367 368 369 370 371 372 373 374 375 376 378 380 385 386 387 391 392
394 395 400 406 418 419 421 422 423 425 426 427 428 430 434 435 437 448 449 450 451 453
454 455 456 463 464 469 471 472 473 484 489 504 505 512 514 515 519 520 522 523 524 526
527 528 530 531 533 544 546 549 550 551 553 554 556 557 559 570 571 573 574 578 579 581
584 585 601 602 605 608 610 611 613 615 616 618 619 620 624 630 642 643 647 648 650 652
653 655 660 680 681 682 685 686 702 704 706 707 711 712 714 715 716 717 719 724 736 738
739 743 744 749 750 755 756 760 761 762 765 772 775 776 779 780 782 787 788 792 793 794
797 800 801 802 803 804 807 808 812 813 814 819 820 824 825 826 829 832 834 835 839 840
843 845 846 851 852 856 857 858 861 864 866 867 870 871 872 873 875 876 877 882 883 891
892 893 896 898 902 903 905 910 911 913 917 918 919 923 925 929 930 935 936 938 940 941
942 943 948 960 962 963 965 967 968 970 971 972 974 976 979 980 992 994 995 997 999 1000
1002 1014 1016 1017 1026 1029 1030 1031 1033 1040 1042 1044 1061 1063 1064 1066 1067 1082
1086 1089 1090 1095 1096 1098 1100 1101 1102 1103 1108 1122 1141 1143 1144 1145 1153 1154
1156 1157 1158 1159 1160 1161 1163 1164 1165 1167 1168 1169 1171 1172 1175 1176 1177 1178
1180 1182 1187 1188 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205
1207 1209 1217 1218 1221 1222 1223 1225 1226 1239 1241 1248 1249 1250 1251 1252 1253 1254
1255 1256 1257 1258 1260 1261 1262 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1276
1278 1302 1304 1305 1334 1336 1337 1366 1368 1369 1398 1400 1401 1430 1432 1433 1462 1464
1465 1479 1480 1484 1485 1486 1491 1492 1496 1497 1498 1501 1506 1511 1512 1514 1516 1517
1518 1519 1524 1538 1539 1541 1542 1549 1558 1559 1560 1563 1565 1568 1569 1570 1571 1572
1573 1574 1575 1576 1577 1578 1579 1585 1587 1588 1589 1590 1591 1592 1593 1594 1596 1598
1602 1603 1605 1606 1613 1622 1623 1627 1629 1633 1634 1637 1638 1639 1641 1642 1655 1657
1666 1667 1671 1672 1675 1676 1677 1678 1683 1684 1689 1690 1693 1698 1699 1700 1703 1704
1705 1708 1709 1711 1716 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1739 1740 1741
1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1756 1758 1782 1784 1785 1814 1816 1817
1846 1848 1849 1878 1880 1881 1910 1912 1913 1942 1944 1945 1974 1976 1977 1987 1988 1989
2010 2012 2017 2018 2032 2034 2036
cpu_present_mask: cpus: 3 7 8 14 15 19 22 34 36 39 40 45 47 51 54 71 72 77 79 80 81 82 83
84 85 86 87 88 89 90 93 94 101 102 103 107 111 126 130 131 140 151 153 162 163 165 167 175
186 187 188 190 194 195 202 204 205 206 207 215 217 226 227 230 233 235 236 237 238 250
251 252 254 258 259 261 262 263 264 267 268 271 278 288 292 293 297 300 301 303 310 322
323 327 328 330 334 336 338 340 354 355 359 360 367 374 385 388 389 390 393 395 396 397
411 412 414 418 419 423 424 430 432 434 436 448 450 451 455 456 464 466 468 480 482 483
491 497 498 499 500 503 517 519 520 522 524 526 538 542 544 545 546 547 551 552 555 557
559 563 566 576 578 579 582 583 584 587 598 599 601 610 611 615 616 619 623 627 630 640
641 642 643 646 647 648 664 667 669 674 675 678 679 680 682 696 699 701 706 709 711 712
715 716 720 724 741 762 763 766 790 792 793 822 824 825 832 834 835 839 840 848 850 852
864 866 867 875 877 881 882 883 884 887 901 903 904 906 909 922 926 930 931 935 936 939
941 943 947 950 960 962 963 966 967 968 970 982 983 985 994 995 998 999 1000 1016 1019
1021 1026 1029 1031 1032 1035 1036 1040 1044 1061 1082 1083 1086 1093 1095 1098 1100 1114
1118 1122 1126 1127 1128 1131 1132 1136 1140 1157 1178 1179 1182 1186 1194 1195 1196 1197
1198 1199 1200 1201 1202 1203 1204 1205 1207 1209 1221 1242 1243 1246 1248 1249 1250 1251
1252 1253 1254 1255 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272
1273 1274 1278 1282 1283 1290 1303 1305 1314 1315 1317 1319 1324 1325 1326 1327 1328 1329
1330 1331 1332 1333 1334 1335 1336 1337 1339 1340 1342 1346 1347 1351 1369 1371 1373 1376
1377 1378 1379 1383 1386 1401 1403 1405 1412 1419 1431 1433 1442 1443 1445 1447 1448 1452
1453 1467 1468 1469 1472 1473 1474 1475 1477 1479 1480 1482 1483 1484 1485 1499 1500 1501
1506 1507 1511 1512 1516 1517 1519 1526 1536 1537 1538 1539 1541 1542 1543 1544 1547 1548
1551 1558 1570 1571 1575 1576 1578 1579 1580 1581 1584 1586 1588 1602 1603 1607 1608 1615
1622 1636 1637 1639 1642 1643 1644 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657
1659 1660 1662 1664 1665 1666 1667 1671 1675 1689 1691 1693 1700 1701 1703 1704 1706 1707
1708 1709 1723 1724 1725 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740
1742 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1756 1758 1856 1857 1861 1862 1871
1872 1873 1874 1875 1876 1877 1878 1879 1881 1888 1889 1890 1892 1893 1894 1902 1910 1911
1912 1915 1917 1920 1921 1922 1924 1925 1928 1930 1931 1932 1937 1945 1947 1948 1952 1953
1954 1956 1957 1958 1959 1961 1966 1969 1971 1972 1973 1974 1975 1977 1987 1988 1989 1990
1997 2006 2007 2008 2011 2013 2019 2020 2023 2032 2034 2036
cpu_online_mask: cpus: 5 26 27 30 54 56 57 86 88 89 118 120 121 130 131 135 153 155 157
160 161 162 163 167 168 171 176 177 178 182 183 192 193 194 195 198 199 200 202 203 204
205 213 219 220 221 226 227 231 232 236 239 246 258 259 263 264 270 271 278 280 281 288
289 290 291 293 295 296 312 315 317 322 323 326 327 328 332 333 341 347 348 349 354 355
357 359 360 362 376 379 381 389 390 391 397 414 418 419 426 428 429 430 431 439 441 450
451 453 455 456 459 472 475 477 482 483 485 487 488 490 491 504 507 509 512 514 515 517
519 520 524 534 535 537 546 549 551 552 555 556 560 564 581 602 603 606 630 632 633 640
642 643 645 647 648 651 662 663 665 674 677 679 680 683 684 688 692 709 730 731 734 758
760 761 790 792 793 822 824 825 854 856 857 886 888 889 896 898 899 901 903 904 906 907
918 919 921 930 933 935 936 939 940 944 948 965 986 987 990 1014 1016 1017 1024 1026 1027
1030 1031 1032 1036 1037 1039 1049 1051 1052 1056 1058 1059 1061 1063 1064 1070 1078 1079
1081 1091 1096 1104 1105 1106 1107 1108 1110 1111 1120 1122 1123 1125 1127 1128 1133 1136
1137 1142 1143 1145 1155 1160 1165 1168 1174 1186 1187 1194 1195 1207 1209 1216 1218 1219
1221 1223 1224 1229 1231 1236 1249 1250 1251 1254 1255 1264 1266 1268 1280 1282 1287 1288
1292 1293 1294 1295 1306 1309 1310 1313 1315 1322 1323 1335 1337 1357 1372 1374 1398 1400
1401 1411 1414 1415 1416 1432 1435 1437 1442 1444 1446 1447 1448 1450 1464 1467 1469 1472
1474 1477 1479 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1495 1497 1506 1507 1510
1511 1512 1515 1528 1531 1533 1537 1538 1539 1542 1543 1544 1546 1547 1558 1559 1561 1568
1570 1574 1576 1578 1579 1582 1583 1594 1597 1598 1600 1601 1602 1603 1607 1625 1627 1629
1634 1635 1639 1642 1657 1659 1661 1664 1665 1668 1671 1675 1689 1691 1693 1697 1700 1703
1706 1707 1721 1723 1725 1728 1732 1733 1735 1736 1738 1739 1740 1741 1755 1756 1757 1760
1761 1762 1763 1765 1767 1768 1772 1773 1787 1788 1789 1795 1797 1799 1800 1803 1806 1819
1820 1821 1828 1829 1831 1832 1834 1835 1838 1851 1852 1853 1858 1859 1861 1865 1867 1870
1871 1878 1888 1891 1893 1894 1895 1896 1900 1901 1903 1910 1922 1923 1927 1928 1930 1933
1936 1938 1940 1954 1956 1961 1963 1964 1967 1974 1986 1987 1991 1992 1997 2000 2002 2004
2018 2019 2023 2024 2028 2030 2032 2034 2036
cpu_active_mask: cpus: 0 1 2 4 5 7 16 18 20 33 36 42 44 47 48 50 54 55 58 60 62 64 69 70
77 86 87 91 93 98 101 102 103 105 112 114 116 128 129 130 132 133 134 153 154 157 160 161
165 166 174 182 183 185 193 196 197 198 199 200 201 203 204 206 213 215 217 220 222 246
248 249 256 257 261 262 270 271 272 273 274 275 276 277 278 279 281 288 289 290 292 293
294 312 313 314 317 320 325 326 333 342 343 344 347 349 352 353 354 356 359 368 370 372
386 391 399 406 407 411 413 417 420 421 422 423 424 425 426 427 428 429 430 434 436 439
441 442 444 446 450 459 461 474 477 478 482 485 486 487 489 495 502 503 507 509 513 516
517 518 519 520 521 524 525 533 535 537 538 540 542 546 549 550 551 553 557 559 566 567
571 573 576 578 579 581 582 583 584 585 589 591 592 595 597 601 602 604 606 608 613 614
621 630 631 635 637 642 645 646 647 649 656 658 660 672 673 674 676 677 678 697 698 701
704 705 709 710 718 726 727 729 736 738 740 741 742 743 744 745 746 748 749 751 752 754
755 756 764 766 768 785 787 789 822 824 825 832 833 837 838 847 848 849 850 851 852 853
854 855 857 867 868 869 870 877 886 887 888 891 893 896 899 900 901 902 920 921 922 925
928 933 934 941 942 950 951 952 955 957 962 963 970 983 985 994 995 999 1016 1019 1021
1024 1027 1028 1029 1031 1040 1042 1044 1056 1058 1062 1063 1081 1082 1085 1090 1093 1096
1098 1099 1100 1105 1113 1115 1116 1122 1127 1134 1137 1139 1140 1141 1142 1143 1145 1155
1156 1157 1158 1159 1168 1170 1172 1185 1188 1194 1196 1199 1200 1201 1202 1204 1205 1208
1210 1212 1214 1218 1219 1221 1222 1224 1226 1227 1228 1229 1230 1231 1241 1243 1244 1250
1255 1256 1261 1265 1266 1267 1269 1270 1271 1275 1277 1281 1282 1294 1295 1303 1305 1312
1314 1327 1333 1335 1336 1337 1344 1346 1348 1349 1350 1351 1352 1353 1356 1357 1359 1364
1365 1367 1370 1372 1374 1383 1387 1389 1390 1406 1408 1409 1410 1412 1413 1414 1422 1430
1431 1432 1435 1437 1440 1442 1443 1447 1453 1462 1463 1465 1472 1473 1474 1476 1479 1488
1490 1492 1506 1507 1509 1529 1531 1532 1537 1538 1539 1550 1551 1552 1553 1554 1555 1556
1557 1558 1559 1560 1562 1564 1568 1570 1571 1573 1574 1575 1577 1581 1590 1591 1592 1595
1597 1602 1603 1607 1608 1615 1616 1619 1620 1621 1622 1623 1625 1633 1634 1635 1638 1639
1640 1656 1657 1666 1672 1673 1680 1682 1684 1696 1699 1700 1701 1702 1703 1705 1711 1718
1719 1720 1723 1725 1730 1731 1733 1734 1735 1737 1741 1742 1750 1751 1752 1755 1757 1763
1764 1765 1766 1767 1769 1773 1775 1782 1783 1784 1787 1789 1793 1794 1795 1797 1798 1799
1801 1816 1817 1818 1821 1824 1826 1827 1829 1830 1831 1833 1838 1846 1847 1848 1851 1853
1856 1858 1859 1861 1862 1863 1864 1865 1868 1871 1875 1877 1881 1882 1884 1886 1890 1891
1893 1894 1896 1898 1899 1900 1901 1902 1903 1913 1915 1916 1920 1925 1926 1933 1934 1942
1943 1947 1949 1955 1956 1957 1958 1965 1974 1975 1979 1981 1984 1987 1988 1989 1990 2009
2010 2013 2016 2018 2023 2024 2030 2031 2033 2037 2038 2039 2043 2045
xtime timespec.tv_sec: 100000135c: Sun Aug 20 16:54:52 CST 4147
utsname:
sysname: (not printable)
nodename: (not printable)
release: (not printable)
version: (not printable)
machine: (not printable)
domainname: (not printable)
crash: cannot determine base kernel version
linux_banner:
�.
$�
crash: /home/ruyang/git/linux/vmlinux and ./root/root/vmcore.elf do not match!
>
> Add the flags which will enable kaslr offset calculating.
>
> Signed-off-by: Dave Young <yangrr.2009(a)tsinghua.org.cn>
> ---
> loongarch64.c | 8 ++++++++
> 1 file changed, 8 insertions(+)
>
> Index: crash/loongarch64.c
> ===================================================================
> --- crash.orig/loongarch64.c 2026-08-18 08:59:46.731117021 +0800
> +++ crash/loongarch64.c 2026-08-24 14:55:57.330529708 +0800
> @@ -1891,6 +1891,14 @@
> machdep->last_ptbl_read = 0;
> machdep->verify_paddr = generic_verify_paddr;
> machdep->ptrs_per_pgd = PTRS_PER_PGD;
> +
> + /*
> + * Even if CONFIG_RANDOMIZE_BASE is not configured,
> + * derive_kaslr_offset() should work and set
> + * kt->relocate to 0
> + */
This comment is same as arm64.c and riscv64.c. On arm64 the comment
justifies why the block runs even when there is no kimage_voffset
condition — here there is no such condition to begin with, so the
"Even if" framing is slightly misleading. Consider rewording to
something like:
/*
* derive_kaslr_offset() handles the CONFIG_RANDOMIZE_BASE=n
* case by setting kt->relocate to 0.
*/
I'm fine with your wording.
> + if (!kt->relocate && !(kt->flags2 & (RELOC_AUTO|KASLR)))
> + kt->flags2 |= (RELOC_AUTO|KASLR);
> break;
One question, arm64 adjusts kimage_voffset post-relocation and riscv64
adjusts kernel_link_addr, once the KASLR offset is derived. Does
LoongArch need a similar fixup for its virtual-to-physical translation,
or is the global kt->relocate sufficient?
I suppose we do not need them though I'm not very clear about the arch code.
loongarch kernel code does not export those related vmcore infos and test passed.
Anyway let's see if wangming from loongson company can provide more info.
>
>>
>> case PRE_GDB:
>> --
>> Crash-utility mailing list -- devel(a)lists.crash-utility.osci.io
>> To unsubscribe send an email to devel-leave(a)lists.crash-utility.osci.io
>> https://${domain_name}/admin/lists/devel.lists.crash-utility.osci.io/
>> Contribution Guidelines:
https://github.com/crash-utility/crash/wiki
>