1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 2026 2027 2028 2029 2030 2031 2032 2033 2034 2035 2036 2037 2038 2039 2040 2041 2042 2043 2044 2045 2046 2047 2048 2049 2050 2051 2052 2053 2054 2055 2056 2057 2058 2059 2060 2061 2062 2063 2064 2065 2066 2067 2068 2069 2070 2071 2072 2073 2074 2075 2076 2077 2078 2079 2080 2081 2082 2083 2084 2085 2086 2087 2088 2089 2090 2091 2092 2093 2094 2095 2096 2097 2098 2099 2100 2101 2102 2103 2104 2105 2106 2107 2108 2109 2110 2111 2112 2113 2114 2115 2116 2117 2118 2119 2120 2121 2122 2123 2124 2125 2126 2127 2128 2129 2130 2131 2132 2133 2134 2135 2136 2137 2138 2139 2140 2141 2142 2143 2144 2145 2146 2147 2148 2149 2150 2151 2152 2153 2154 2155 2156 2157 2158 2159 2160 2161 2162 2163 2164 2165 2166 2167 2168 2169 2170 2171 2172 2173 2174 2175 2176 2177 2178 2179 2180 2181 2182 2183 2184 2185 2186 2187 2188 2189 2190 2191 2192 2193 2194 2195 2196 2197 2198 2199 2200 2201 2202 2203 2204 2205 2206 2207 2208 2209 2210 2211 2212 2213 2214 2215 2216 2217 2218 2219 2220 2221 2222 2223 2224 2225 2226 2227 2228 2229 2230 2231 2232 2233 2234 2235 2236 2237 2238 2239 2240 2241 2242 2243 2244 2245 2246 2247 2248 2249 2250 2251 2252 2253 2254 2255 2256 2257 2258 2259 2260 2261 2262 2263 2264 2265 2266 2267 2268 2269 2270 2271 2272 2273 2274 2275 2276 2277 2278 2279 2280 2281 2282 2283 2284 2285 2286 2287 2288 2289 2290 2291 2292 2293 2294 2295 2296 2297 2298 2299 2300 2301 2302 2303 2304 2305 2306 2307 2308 2309 2310 2311 2312 2313 2314 2315 2316 2317 2318 2319 2320 2321 2322 2323 2324 2325 2326 2327 2328 2329 2330 2331 2332 2333 2334 2335 2336 2337 2338 2339 2340 2341 2342 2343 2344 2345 2346 2347 2348 2349 2350 2351 2352 2353 2354 2355 2356 2357 2358 2359 2360 2361 2362 2363 2364 2365 2366 2367 2368 2369 2370 2371 2372 2373 2374 2375 2376 2377 2378 2379 2380 2381 2382 2383 2384 2385 2386 2387 2388 2389 2390 2391 2392 2393 2394 2395 2396 2397 2398 2399 2400 2401 2402 2403 2404 2405 2406 2407 2408 2409 2410 2411 2412 2413 2414 2415 2416 2417 2418 2419 2420 2421 2422 2423 2424 2425 2426 2427 2428 2429 2430 2431 2432 2433 2434 2435 2436 2437 2438 2439 2440 2441 2442 2443 2444 2445 2446 2447 2448 2449 2450 2451 2452 2453 2454 2455 2456 2457 2458 2459 2460 2461 2462 2463 2464 2465 2466 2467 2468 2469 2470 2471 2472 2473 2474 2475 2476 2477 2478 2479 2480 2481 2482 2483 2484 2485 2486 2487 2488 2489 2490 2491 2492 2493 2494 2495 2496 2497 2498 2499 2500 2501 2502 2503 2504 2505 2506 2507 2508 2509 2510 2511 2512 2513 2514 2515 2516 2517 2518 2519 2520 2521 2522 2523 2524 2525 2526 2527 2528 2529 2530 2531 2532 2533 2534 2535 2536 2537 2538 2539 2540 2541 2542 2543 2544 2545 2546 2547 2548 2549 2550 2551 2552 2553 2554 2555 2556 2557 2558 2559 2560 2561 2562 2563 2564 2565 2566 2567 2568 2569 2570 2571 2572 2573 2574 2575 2576 2577 2578 2579 2580 2581 2582 2583 2584 2585 2586 2587 2588 2589 2590 2591 2592 2593 2594 2595 2596 2597 2598 2599 2600 2601 2602 2603 2604 2605 2606 2607 2608 2609 2610 2611 2612 2613 2614 2615 2616 2617 2618 2619 2620 2621 2622 2623 2624 2625 2626 2627 2628 2629 2630 2631 2632 2633 2634 2635 2636 2637 2638 2639 2640 2641 2642 2643 2644 2645 2646 2647 2648 2649 2650 2651 2652 2653 2654 2655 2656 2657 2658 2659 2660 2661 2662 2663 2664 2665 2666 2667 2668 2669 2670 2671 2672 2673 2674 2675 2676 2677 2678 2679 2680 2681 2682 2683 2684 2685 2686 2687 2688 2689 2690 2691 2692 2693 2694 2695 2696 2697 2698 2699 2700 2701 2702 2703 2704 2705 2706 2707 2708 2709 2710 2711 2712 2713 2714 2715 2716 2717 2718 2719 2720 2721 2722 2723 2724 2725 2726 2727 2728 2729 2730 2731 2732 2733 2734 2735 2736 2737 2738 2739 2740 2741 2742 2743 2744 2745 2746 2747 2748 2749 2750 2751 2752 2753 2754 2755 2756 2757 2758 2759 2760 2761 2762 2763 2764 2765 2766 2767 2768 2769 2770 2771 2772 2773 2774 2775 2776 2777 2778 2779 2780 2781 2782 2783 2784 2785 2786 2787 2788 2789 2790 2791 2792 2793 2794 2795 2796 2797 2798 2799 2800 2801 2802 2803 2804 2805 2806 2807 2808 2809 2810 2811 2812 2813 2814 2815 2816 2817 2818 2819 2820 2821 2822 2823 2824 2825 2826 2827 2828 2829 2830 2831 2832 2833 2834 2835 2836 2837 2838 2839 2840 2841 2842 2843 2844 2845 2846 2847 2848 2849 2850 2851 2852 2853 2854 2855 2856 2857 2858 2859 2860 2861 2862 2863 2864 2865 2866 2867 2868 2869 2870 2871 2872 2873 2874 2875 2876 2877 2878 2879 2880 2881 2882 2883 2884 2885 2886 2887 2888 2889 2890 2891 2892 2893 2894 2895 2896 2897 2898 2899 2900 2901 2902 2903 2904 2905 2906 2907 2908 2909 2910 2911 2912 2913 2914 2915 2916 2917 2918 2919 2920 2921 2922 2923 2924 2925 2926 2927 2928 2929 2930 2931 2932 2933 2934 2935 2936 2937 2938 2939 2940 2941 2942 2943 2944 2945 2946 2947 2948 2949 2950 2951 2952 2953 2954 2955 2956 2957 2958 2959 2960 2961 2962 2963 2964 2965 2966 2967 2968 2969 2970 2971 2972 2973 2974 2975 2976 2977 2978 2979 2980 2981 2982 2983 2984 2985 2986 2987 2988 2989 2990 2991 2992 2993 2994 2995 2996 2997 2998 2999 3000 3001 3002 3003 3004 3005 3006 3007 3008 3009 3010 3011 3012 3013 3014 3015 3016 3017 3018 3019 3020 3021 3022 3023 3024 3025 3026 3027 3028 3029 3030 3031 3032 3033 3034 3035 3036 3037 3038 3039 3040 3041 3042 3043 3044 3045 3046 3047 3048 3049 3050 3051 3052 3053 3054 3055 3056 3057 3058 3059 3060 3061 3062 3063 3064 3065 3066 3067 3068 3069 3070 3071 3072 3073 3074 3075 3076 3077 3078 3079 3080 3081 3082 3083 3084 3085 3086 3087 3088 3089 3090 3091 3092 3093 3094 3095 3096 3097 3098 3099 3100 3101 3102 3103 3104 3105 3106 3107 3108 3109 3110 3111 3112 3113 3114 3115 3116 3117 3118 3119 3120 3121 3122 3123 3124 3125 3126 3127 3128 3129 3130 3131 3132 3133 3134 3135 3136 3137 3138 3139 3140 3141 3142 3143 3144 3145 3146 3147 3148 3149 3150 3151 3152 3153 3154 3155 3156 3157 3158 3159 3160 3161 3162 3163 3164 3165 3166 3167 3168 3169 3170 3171 3172 3173 3174 3175 3176 3177 3178 3179 3180 3181 3182 3183 3184 3185 3186 3187 3188 3189 3190 3191 3192 3193 3194 3195 3196 3197 3198 3199 3200 3201 3202 3203 3204 3205 3206 3207 3208 3209 3210 3211 3212 3213 3214 3215 3216 3217 3218 3219 3220 3221 3222 3223 3224 3225 3226 3227 3228 3229 3230 3231 3232 3233 3234 3235 3236 3237 3238 3239 3240 3241 3242 3243 3244 3245 3246 3247 3248 3249 3250 3251 3252 3253 3254 3255 3256 3257 3258 3259 3260 3261 3262 3263 3264 3265 3266 3267 3268 3269 3270 3271 3272 3273 3274 3275 3276 3277 3278 3279 3280 3281 3282 3283 3284 3285 3286 3287 3288 3289 3290 3291 3292 3293 3294 3295 3296 3297 3298 3299 3300 3301 3302 3303 3304 3305 3306 3307 3308 3309 3310 3311 3312 3313 3314 3315 3316 3317 3318 3319 3320 3321 3322 3323 3324 3325 3326 3327 3328 3329 3330 3331 3332 3333 3334 3335 3336 3337 3338 3339 3340 3341 3342 3343 3344 3345 3346 3347 3348 3349 3350 3351 3352 3353 3354 3355 3356 3357 3358 3359 3360 3361 3362 3363 3364 3365 3366 3367 3368 3369 3370 3371 3372 3373 3374 3375 3376 3377 3378 3379 3380 3381 3382 3383 3384 3385 3386 3387 3388 3389 3390 3391 3392 3393 3394 3395 3396 3397 3398 3399 3400 3401 3402 3403 3404 3405 3406 3407 3408 3409 3410 3411 3412 3413 3414 3415 3416 3417 3418 3419 3420 3421 3422 3423 3424 3425 3426 3427 3428 3429 3430 3431 3432 3433 3434 3435 3436 3437 3438 3439 3440 3441 3442 3443 3444 3445 3446 3447 3448 3449 3450 3451 3452 3453 3454 3455 3456 3457 3458 3459 3460 3461 3462 3463 3464 3465 3466 3467 3468 3469 3470 3471 3472 3473 3474 3475 3476 3477 3478 3479 3480 3481 3482 3483 3484 3485 3486 3487 3488 3489 3490 3491 3492 3493 3494 3495 3496 3497 3498 3499 3500 3501 3502 3503 3504 3505 3506 3507 3508 3509 3510 3511 3512 3513 3514 3515 3516 3517 3518 3519 3520 3521 3522 3523 3524 3525 3526 3527 3528 3529 3530 3531 3532 3533 3534 3535 3536 3537 3538 3539 3540 3541 3542 3543 3544 3545 3546 3547 3548 3549 3550 3551 3552 3553 3554 3555 3556 3557 3558 3559 3560 3561 3562 3563 3564 3565 3566 3567 3568 3569 3570 3571 3572 3573 3574 3575 3576 3577 3578 3579 3580 3581 3582 3583 3584 3585 3586 3587 3588 3589 3590 3591 3592 3593 3594 3595 3596 3597 3598 3599 3600 3601 3602 3603 3604 3605 3606 3607 3608 3609 3610 3611 3612 3613 3614 3615 3616 3617 3618 3619 3620 3621 3622 3623 3624 3625 3626 3627 3628 3629 3630 3631 3632 3633 3634 3635 3636 3637 3638 3639 3640 3641 3642 3643 3644 3645 3646 3647 3648 3649 3650 3651 3652 3653 3654 3655 3656 3657 3658 3659 3660 3661 3662 3663 3664 3665 3666 3667 3668 3669 3670 3671 3672 3673 3674 3675 3676 3677 3678 3679 3680 3681 3682 3683 3684 3685 3686 3687 3688 3689 3690 3691 3692 3693 3694 3695 3696 3697 3698 3699 3700 3701 3702 3703 3704 3705 3706 3707 3708 3709 3710 3711 3712 3713 3714 3715 3716 3717 3718 3719 3720 3721 3722 3723 3724 3725 3726 3727 3728 3729 3730 3731 3732 3733 3734 3735 3736 3737 3738 3739 3740 3741 3742 3743 3744 3745 3746 3747 3748 3749 3750 3751 3752 3753 3754 3755 3756 3757 3758 3759 3760 3761 3762 3763 3764 3765 3766 3767 3768 3769 3770 3771 3772 3773 3774 3775 3776 3777 3778 3779 3780 3781 3782 3783 3784 3785 3786 3787 3788 3789 3790 3791 3792 3793 3794 3795 3796 3797 3798 3799 3800 3801 3802 3803 3804 3805 3806 3807 3808 3809 3810 3811 3812 3813 3814 3815 3816 3817 3818 3819 3820 3821 3822 3823 3824 3825 3826 3827 3828 3829 3830 3831 3832 3833 3834 3835 3836 3837 3838 3839 3840 3841 3842 3843 3844 3845 3846 3847 3848 3849 3850 3851 3852 3853 3854 3855 3856 3857 3858 3859 3860 3861 3862 3863 3864 3865 3866 3867 3868 3869 3870 3871 3872 3873 3874 3875 3876 3877 3878 3879 3880 3881 3882 3883 3884 3885 3886 3887 3888 3889 3890 3891 3892 3893 3894 3895 3896 3897 3898 3899 3900 3901 3902 3903 3904 3905 3906 3907 3908 3909 3910 3911 3912 3913 3914 3915 3916 3917 3918 3919 3920 3921 3922 3923 3924 3925 3926 3927 3928 3929 3930 3931 3932 3933 3934 3935 3936 3937 3938 3939 3940 3941 3942 3943 3944 3945 3946 3947 3948 3949 3950 3951 3952 3953 3954 3955 3956 3957 3958 3959 3960 3961 3962 3963 3964 3965 3966 3967 3968 3969 3970 3971 3972 3973 3974 3975 3976 3977 3978 3979 3980 3981 3982 3983 3984 3985 3986 3987 3988 3989 3990 3991 3992 3993 3994 3995 3996 3997 3998 3999 4000 4001 4002 4003 4004 4005 4006 4007 4008 4009 4010 4011 4012 4013 4014 4015 4016 4017 4018 4019 4020 4021 4022 4023 4024 4025 4026 4027 4028 4029 4030 4031 4032 4033 4034 4035 4036 4037 4038 4039 4040 4041 4042 4043 4044 4045 4046 4047 4048 4049 4050 4051 4052 4053 4054 4055 4056 4057 4058 4059 4060 4061 4062 4063 4064 4065 4066 4067 4068 4069 4070 4071 4072 4073 4074 4075 4076 4077 4078 4079 4080 4081 4082 4083 4084 4085 4086 4087 4088 4089 4090 4091 4092 4093 4094 4095 4096 4097 4098 4099 4100 4101 4102 4103 4104 4105 4106 4107 4108 4109 4110 4111 4112 4113 4114 4115 4116 4117 4118 4119 4120 4121 4122 4123 4124 4125 4126 4127 4128 4129 4130 4131 4132 4133 4134 4135 4136 4137 4138 4139 4140 4141 4142 4143 4144 4145 4146 4147 4148 4149 4150 4151 4152 4153 4154 4155 4156 4157 4158 4159 4160 4161 4162 4163 4164 4165 4166 4167 4168 4169 4170 4171 4172 4173 4174 4175 4176 4177 4178 4179 4180 4181 4182 4183 4184 4185 4186 4187 4188 4189 4190 4191 4192 4193 4194 4195 4196 4197 4198 4199 4200 4201 4202 4203 4204 4205 4206 4207 4208 4209 4210 4211 4212 4213 4214 4215 4216 4217 4218 4219 4220 4221 4222 4223 4224 4225 4226 4227 4228 4229 4230 4231 4232 4233 4234 4235 4236 4237 4238 4239 4240 4241 4242 4243 4244 4245 4246 4247 4248 4249 4250 4251 4252 4253 4254 4255 4256 4257 4258 4259 4260 4261 4262 4263 4264 4265 4266 4267 4268 4269 4270 4271 4272 4273 4274 4275 4276 4277 4278 4279 4280 4281 4282 4283 4284 4285 4286 4287 4288 4289 4290 4291 4292 4293 4294 4295 4296 4297 4298 4299 4300 4301 4302 4303 4304 4305 4306 4307 4308 4309 4310 4311 4312 4313 4314 4315 4316 4317 4318 4319 4320 4321 4322 4323 4324 4325 4326 4327 4328 4329 4330 4331 4332 4333 4334 4335 4336 4337 4338 4339 4340 4341 4342 4343 4344 4345 4346 4347 4348 4349 4350 4351 4352 4353 4354 4355 4356 4357 4358 4359 4360 4361 4362 4363 4364 4365 4366 4367 4368 4369 4370 4371 4372 4373 4374 4375 4376 4377 4378 4379 4380 4381 4382 4383 4384 4385 4386 4387 4388 4389 4390 4391 4392 4393 4394 4395 4396 4397 4398 4399 4400 4401 4402 4403 4404 4405 4406 4407 4408 4409 4410 4411 4412 4413 4414 4415 4416 4417 4418 4419 4420 4421 4422 4423 4424 4425 4426 4427 4428 4429 4430 4431 4432 4433 4434 4435 4436 4437 4438 4439 4440 4441 4442 4443 4444 4445 4446 4447 4448 4449 4450 4451 4452 4453 4454 4455 4456 4457 4458 4459 4460 4461 4462 4463 4464 4465 4466 4467 4468 4469 4470 4471 4472 4473 4474 4475 4476 4477 4478 4479 4480 4481 4482 4483 4484 4485 4486 4487 4488 4489 4490 4491 4492 4493 4494 4495 4496 4497 4498 4499 4500 4501 4502 4503 4504 4505 4506 4507 4508 4509 4510 4511 4512 4513 4514 4515 4516 4517 4518 4519 4520 4521 4522 4523 4524 4525 4526 4527 4528 4529 4530 4531 4532 4533 4534 4535 4536 4537 4538 4539 4540 4541 4542 4543 4544 4545 4546 4547 4548 4549 4550 4551 4552 4553 4554 4555 4556 4557 4558 4559 4560 4561 4562 4563 4564 4565 4566 4567 4568 4569 4570 4571 4572 4573 4574 4575 4576 4577 4578 4579 4580 4581 4582 4583 4584 4585 4586 4587 4588 4589 4590 4591 4592 4593 4594 4595 4596 4597 4598 4599 4600 4601 4602 4603 4604 4605 4606 4607 4608 4609 4610 4611 4612 4613 4614 4615 4616 4617 4618 4619 4620 4621 4622 4623 4624 4625 4626 4627 4628 4629 4630 4631 4632 4633 4634 4635 4636 4637 4638 4639 4640 4641 4642 4643 4644 4645 4646 4647 4648 4649 4650 4651 4652 4653 4654 4655 4656 4657 4658 4659 4660 4661 4662 4663 4664 4665 4666 4667 4668 4669 4670 4671 4672 4673 4674 4675 4676 4677 4678 4679 4680 4681 4682 4683 4684 4685 4686 4687 4688 4689 4690 4691 4692 4693 4694 4695 4696 4697 4698 4699 4700 4701 4702 4703 4704 4705 4706 4707 4708 4709 4710 4711 4712 4713 4714 4715 4716 4717 4718 4719 4720 4721
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"
"http://www.w3.org/TR/REC-html40/loose.dtd">
<html>
<head>
<meta content="text/html; charset=iso-8859-1" http-equiv="Content-Type">
<title>Dear Diary</title>
</head>
<body alink="#FF0000" vlink="#55188A" link="#0000EF" bgcolor="#FFFFFF" text="#000099">
<table border="0">
<tr align="left">
<td valign="top">
<table border="0">
<tr align="left"><td valign="top" >
<img width="120" height="171" src="uml-small.png">
</td></tr>
<tr align="left"><td valign="top" bgcolor="#e0e0e0">
<font size="-1"><a href="index.html">Site Home Page</a></font>
<br>
<font size="-1"><a href="uses.html">What it's good for</a></font>
<br>
<font size="-1"><a href="case-studies.html">Case Studies</a></font>
<br>
<font size="-1"><a href="kernel.html">Kernel Capabilities</a></font>
<br>
<font size="-1"><a href="dl-sf.html">Downloading it</a></font>
<br>
<font size="-1"><a href="run.html">Running it</a></font>
<br>
<font size="-1"><a href="compile.html">Compiling</a></font>
<br>
<font size="-1"><a href="install.html">Installation</a></font>
<br>
<font size="-1"><a href="fs_making.html">Building filesystems</a></font>
<br>
<font size="-1"><a href="faq.html">Troubles</a></font>
<br>
<font size="-1"><a href="contrib.html">User Contributions</a></font>
<br>
<font size="-1"><a href="links.html">Related Links</a></font>
<br>
<font size="-1"><a href="todo.html">The ToDo list</a></font>
<br>
<font size="-1"><a href="projects.html">Projects</a></font>
<br>
<font size="-1"><a href="diary.html">Diary</a></font>
<br>
<font size="-1"><a href="thanks.html">Thanks</a></font>
<br>
<font size="-1"><a href="contacts.html">Contacts</a></font>
</td></tr>
<tr align="left"><td valign="top" bgcolor="#e0e0e0">Tutorials<br>
<font size="-1"><a href="UserModeLinux-HOWTO.html">The HOWTO (html)</a></font>
<br>
<font size="-1"><a href="UserModeLinux-HOWTO.txt">The HOWTO (text)</a></font>
<br>
<font size="-1"><a href="hostfs.html">Host file access</a></font>
<br>
<font size="-1"><a href="input.html">Device inputs</a></font>
<br>
<font size="-1"><a href="shared_fs.html">Sharing filesystems</a></font>
<br>
<font size="-1"><a href="fs.html">Creating filesystems</a></font>
<br>
<font size="-1"><a href="networking.html">Virtual Networking</a></font>
<br>
<font size="-1"><a href="mconsole.html">Management Console</a></font>
<br>
<font size="-1"><a href="debugging.html">Kernel Debugging</a></font>
<br>
<font size="-1"><a href="gprof.html">gprof and gcov</a></font>
<br>
<font size="-1"><a href="xtut.html">Running X</a></font>
<br>
<font size="-1"><a href="trouble.html">Diagnosing problems</a></font>
<br>
<font size="-1"><a href="config.html">Configuration</a></font>
<br>
<font size="-1"><a href="slack_readme.html">Installing Slackware</a></font>
<br>
<font size="-1"><a href="arch-port.html">Porting UML</a></font>
<br>
<font size="-1"><a href="iomem.html">IO memory emulation</a></font>
<br>
<font size="-1"><a href="2G-2G.html">UML on 2G/2G hosts</a></font>
<br>
<font size="-1"><a href="lksct/index.html">Adding a UML system call</a></font>
</td></tr>
<tr align="left"><td valign="top" bgcolor="#e0e0e0">How you can help<br>
<font size="-1"><a href="help-gen.html">Overview</a></font>
<br>
<font size="-1"><a href="help-doc.html">Documentation</a></font>
<br>
<font size="-1"><a href="help-userspace.html">Utilities</a></font>
<br>
<font size="-1"><a href="help-kernel-v1.html">Kernel bugs</a></font>
<br>
<font size="-1"><a href="projects.html">Kernel projects</a></font>
</td></tr>
<tr align="left"><td valign="top" bgcolor="#e0e0e0">Screenshots<br>
<font size="-1"><a href="net.html">A virtual network</a></font>
<br>
<font size="-1"><a href="x.html">An X session</a></font>
</td></tr>
<tr align="left"><td valign="top" bgcolor="#e0e0e0">Transcripts<br>
<font size="-1"><a href="login.html">A login session</a></font>
<br>
<font size="-1"><a href="debug-session.html">A debugging session</a></font>
<br>
<font size="-1"><a href="slackinst.html">Slackware installation</a></font>
</td></tr>
<tr align="left"><td valign="top" bgcolor="#e0e0e0">Reference<br>
<font size="-1"><a href="switches.html">Kernel switches</a></font>
<br>
<font size="-1"><a href="slack_readme.html">Slackware README</a></font>
</td></tr>
<tr align="left"><td valign="top" bgcolor="#e0e0e0">Papers<br>
<font size="-1"><a href="als2000/index.html">ALS 2000 paper (html)</a></font>
<br>
<font size="-1"><a href="als2000.tex">ALS 2000 paper (TeX)</a></font>
<br>
<font size="-1"><a href="slides/als2000/slides.html">ALS 2000 slides</a></font>
<br>
<font size="-1"><a href="slides/lca2001/lca.html">LCA 2001 slides</a></font>
<br>
<font size="-1"><a href="slides/ols2001/index.html">OLS 2001 paper (html)</a></font>
<br>
<font size="-1"><a href="ols2001.tex">OLS 2001 paper (TeX)</a></font>
<br>
<font size="-1"><a href="als2001/index.html">ALS 2001 paper (html)</a></font>
<br>
<font size="-1"><a href="als2001.tex">ALS 2001 paper (TeX)</a></font>
<br>
<font size="-1"><a href="slides/ists2002/umlsec.htm">UML security (html)</a></font>
<br>
<font size="-1"><a href="slides/lca2002/lca2002.htm">LCA 2002 (html)</a></font>
<br>
<font size="-1"><a href="slides/wvu2002/wvu2002.htm">WVU 2002 (html)</a></font>
</td></tr>
<tr align="left"><td valign="top" bgcolor="#e0e0e0">Fun and Games<br>
<font size="-1"><a href="http://user-mode-linux.sourceforge.net/cgi-bin/hangman">Kernel Hangman</a></font>
<br>
<font size="-1"><a href="sdotm.html">Disaster of the Month</a></font>
</td></tr>
</table>
</td>
<td valign="top" align="left">
<center>
<h3>Dear Diary</h3>
</center>
This page contains information about what's currently happening with the
project. I may update it once in a while if I feel like it.
<p>
<a name="4-25-2002"><table width="100%" bgcolor="#e0e0e0">
<tr>
<td>
<b>
<font color="black">25 Apr 2002</font>
</b>
</td>
</tr>
</table>
<blockquote>
This was a fairly lazy week. I went down to West Virginia at the
invitation of David Krovich to give a talk at WVU. That went fairly
well - the chairman of the CSEE department was apparently impressed by
the number of students who attended. After dinner, I gave another
talk at a MORLUG meeting (MORLUG == Morgantown LUG) which consisted of
me firing up UMLs and demonstrating various neat things you can do
with it. This also seemed to go well.
<p>
In extra-curricular activities, we tried to go hiking on Sunday, but
got rained on heavily. It looks like nice country if only the clouds
would get out of the way so you could see something.
<p>
In UML news, I spent some time fixing the iomem support. It was
broken in such a way that I had a hard time believing it ever worked.
What I now think is more likely is that the VM system changed in a way
that broken iomem, but no one noticed. The problem was that the VM
system deals largely with page structs instead of raw page addresses
and the iomem regions had no sane mem_maps, so they had no page
structs.
<p>
I fixed this by changing the infrastructure to allow for segmented
physical memory consisting of regions which have their own separate
mem_maps. This will allow for plugging and unplugging of iomem
regions. I was hoping this would work for physical memory regions as
well (plugging anyway; unplugging is harder), and after a bunch of
failed experiments, decided that this wasn't going to be.
<p>
After getting this working, I decided to release 2.4.18-19. It also
contains James McMechan's partitioned device support and a bunch of
smaller bug fixes that were noticed by various people.
</blockquote>
<a name="4-15-2002"><table width="100%" bgcolor="#e0e0e0">
<tr>
<td>
<b>
<font color="black">15 Apr 2002</font>
</b>
</td>
</tr>
</table>
<blockquote>
More bug-bashing. My lists contain a total of 93 items, but a large
number of them are about to die. The umlgdb expect script from
Chandan Kudige will knock off the two related to reloading module
symbols. When I verify that UML can boot as a diskless client, that
will get rid of five more. James McMechan's ubd partition patch is
currently accounting for six items. I should be able to knock all
those off in the next couple of days.
<p>
I released an RPM last Tuesday to get the accumulated changes out to a
wider audience. I think I'm going to start releasing an RPM every two
or three weeks from now on. 2.4.x releases are too far apart for me now.
</blockquote>
<a name="4-06-2002"><table width="100%" bgcolor="#e0e0e0">
<tr>
<td>
<b>
<font color="black">6 Apr 2002</font>
</b>
</td>
</tr>
</table>
<blockquote>
I spent the last few days on a bug-smashing spree. To-do items had
accumulated at an alarming pace over the last couple weeks, so I
decided to whack away at them a bit. I had over 110 items on my
various lists, so I knocked off as many as were easy to kill. I now have
99 items, so I got rid of more than 10 of them.
<p>
Prominent among them are
<ul>
<li>
floating point registers not being available to gdb inside UML or
stored in core files
</li>
<li>
hostfs not being able to create unix sockets
</li>
<li>
the daemon transport now gets its MAC from uml_switch
</li>
<li>
if the umid is set on the command line, it is put into host process
names and into xterm title bars
</li>
</ul>
There were some small patches from mulix, Sapan, and Daniel Phillips,
which all did useful things.
<p>
With that, I released 2.4.18-14 and uml_utilities_20020406. This may
be the basis of another full release (with an RPM instead of just a
patch). I need to do that soon since the 2.4.18 UML is getting fairly
old at this point.
</blockquote>
<a name="4-03-2002"><table width="100%" bgcolor="#e0e0e0">
<tr>
<td>
<b>
<font color="black">3 Apr 2002</font>
</b>
</td>
</tr>
</table>
<blockquote>
In the nearly two weeks since the last entry, I've pretty much knocked
off the console flow control bug (the one remaining piece is to make
sure that it works correctly when ptys deliver output SIGIO) and the
init hang on older machines. These are two of the oldest UML bugs.
<p>
The init hang is caused by init executing a cmov on a processor that
doesn't support it. What I ended up doing (at the suggestion of Alan
Cox who saw this on one of his boxes) is detect cmov support by
looking at /proc/cpuinfo, then panic if init gets a SIGILL on a cmov.
<p>
In other news, I got all of Bill Stearns' bootable filesystems over to
SF, so the links to them are likely to work. They're not on
ftp.nl.linux.org yet though.
</blockquote>
<a name="3-22-2002"><table width="100%" bgcolor="#e0e0e0">
<tr>
<td>
<b>
<font color="black">22 Mar 2002</font>
</b>
</td>
</tr>
</table>
<blockquote>
I've decided that I'm out of major design changes I need to make and
can now concentrate on knocking items off the todo list. The one
published on the site has 44 things on it. I also keep a todo mail
folder containing pieces of mail that describe something well enough
that I can keep track of it. That folder contains 54 messages right
now, so I've got almost 100 things to do. Some are duplicates, and
some are already fixed and I haven't figured it yet, so the actual
number is somewhat smaller.
<p>
My latest run of the test suite succeeded in booting all of the
filesystems available from the UML site, which is probably the first
time that has ever been true.
</blockquote>
<a name="3-15-2002"><table width="100%" bgcolor="#e0e0e0">
<tr>
<td>
<b>
<font color="black">15 Mar 2002</font>
</b>
</td>
</tr>
</table>
<blockquote>
I discovered a remnant bug. 'strace -p' didn't work. Fixing that was
easy enough, but I decided to clean up some code while I was in it.
That took more work than I expected, since it involved saving state in
the thread structure in signal handlers, and when you forget to
restore the old state, you get very obscure misbehaviors. I ended up
backing out the changes and putting them back in one line at a time
before it dawned on me that perhaps restoring the old stuff would be a
good plan.
<p>
So, I released 2.4.18-7 today. I also released another version of the
test suite. This one allows tests to be interactive and for the perl
test driver to interact with them.
<p>
In separate news, my paper proposal for OLS was accepted. So, it
looks like I'm on the hook for another paper.
</blockquote>
<a name="3-14-2002"><table width="100%" bgcolor="#e0e0e0">
<tr>
<td>
<b>
<font color="black">14 Mar 2002</font>
</b>
</td>
</tr>
</table>
<blockquote>
After much surgery, I finished the pt_regs to sigcontext work and put
UML back together. There were surprisingly few bugs to chase once it
compiled again. I fixed around three bugs, and haven't found any more
since.
<p>
I did some more work on the test suite. There is now a kernel build
test, for which I wrote a perl mconsole client. This prompted me to
add the option of the mconsole driver sending the name of its socket
to a socket specified on the command line. This allows scripts to
find out where to send mconsole commands without having to parse the
boot log. It also tells them when UML has booted to that point.
<p>
This test also exposed a bug in the mconsole driver which caused
commands not to be NULL-terminated.
</blockquote>
<a name="3-7-2002"><table width="100%" bgcolor="#e0e0e0">
<tr>
<td>
<b>
<font color="black">7 Mar 2002</font>
</b>
</td>
</tr>
</table>
<blockquote>
Bad news. I decided to do a UML-sucks/rocks-ometer on Google. Well,
<a href="http://www.google.com/search?num=100&hl=en&q=%22user+mode+linux%22+sucks">"sucks"</a> beats
<a href="http://www.google.com/search?num=100&hl=en&as_qdr=all&q=%22user+mode+linux%22+rocks">"rocks"</a> 125-83. To
make things worse, the first few "sucks" entries are me.
</blockquote>
<a name="3-4-2002"><table width="100%" bgcolor="#e0e0e0">
<tr>
<td>
<b>
<font color="black">4 Mar 2002</font>
</b>
</td>
</tr>
</table>
<blockquote>
I made the 2.4.18 announcement on freshmeat today. That is the final
piece of this release.
<p>
I have known for a long time that UML is susceptible to bus errors in
random places in the code if it touches memory that it had previously
mmapped, but the host can't back with physical memory. This turned
out to be a lot easier to trigger than I expected. I run with tmpfs
mounted on /tmp for speed reasons. It has a maximum size of 1/2 RAM
by default, which is 128M for me. I got a UML to hit that limit and
crash with a bus error.
<p>
So, I posted an RFC to lkml asking for comments on my proposed
solution which was to add a hook to __alloc_pages to allow the
architecture to touch pages before they're returned to the caller.
Physical architectures have no need of this because they have a known
amount of physical memory and they know it's not going anywhere. UML
doesn't, so it needs to assure itself that an allocated page is real
and that accesses to it won't fault.
<p>
What I got was an argument with Alan Cox who persistently doesn't
understand what I'm talking about. He has appeared to believe that
I'm trying to get good behavior when the system is out of memory and
good behavior is impossible, that I want the host kernel to allocate
memory as soon as the address space is allocated, and a bunch of other
things that I don't begin to fathom. Peter Anvin hopped in briefly
with what look like similar problems.
<p>
So, I implemented what I wanted, and sent the patch in. Hopefully
that will clear out the confusion.
<p>
In actual development news, I'm converting UML from storing register
information in pt_regs structs to storing it in sigcontext structs.
What I'm doing is making UML return to userspace by way of host signal
returns rather then having the tracing thread teleport it back with
PTRACE_SETREGS. The main advantage is that it is guaranteed to
correctly restore floating point state, which has worried me for quite
a while. It has other advantages, like removing code from the tracing
thread, which will make it easier to finally eliminate at some point.
</blockquote>
<a name="3-1-2002"><table width="100%" bgcolor="#e0e0e0">
<tr>
<td>
<b>
<font color="black">1 Mar 2002</font>
</b>
</td>
</tr>
</table>
<blockquote>
I finished the release of 2.4.18 today with the bare kernel and the
RPM. No deb since Matt is taking care of that for me now.
<p>
I cleaned up the test driver some more. The local configuration
information is now stored in ~/.umltest, and it is possible to pass in
configuration options on the command line. This is in preparation for
automatically running the tests whenever a new patch is ready.
</blockquote>
<a name="2-25-2002"><table width="100%" bgcolor="#e0e0e0">
<tr>
<td>
<b>
<font color="black">25 Feb 2002</font>
</b>
</td>
</tr>
</table>
<blockquote>
I released the 2.4.18 UML patch today. It was a no-effort update,
except that there were a bunch of placeholder entries for
the extended attribute system calls.
<p>
I'm going to sit on the full release for a few days while I work up a
new test suite and harness. Hopefully, I can get something automated
set up so that whenever I release a patch, it will get banged on
without me having to do it by hand.
</blockquote>
<a name="2-24-2002"><table width="100%" bgcolor="#e0e0e0">
<tr>
<td>
<b>
<font color="black">24 Feb 2002</font>
</b>
</td>
</tr>
</table>
<blockquote>
I think I'm emerging from signal delivery hell. Everything seems to
work again with the exception of a memory corruption problem which may
not be new. I've discovered new and interesting ways to screw up.
<p>
It turns out that when you leave -ERESTARTSYS or -ERESTARTNOHAND in %eax
when leaving a system call, the host kernel will helpfully subtract 2
from eip. This is because a system call instruction is 2 bytes long
and it restarts them by executing that instruction over again. This
turns out to be a problem when UML itself is restarting one of its own
system calls. It delivers the signal first, so eip points to the
beginning of the handler, and if you don't put a zero or something in
eip, then you will fake the host into subtracting two from eip. That
puts it at the very end of the previous procedure, which will try to
return from a stack frame that never really existed in the first
place. This leads to very interesting debugging sessions.
<p>
It also turns out that ptrace "knows" that when it has intercepted the
start of a system call, eax contains -ENOSYS. It depends on this.
When I changed how UML gets the process state before a system call, I
changed the value in eax to something else, and ptrace stopped
working. It took a couple of days to figure this out.
<p>
But things seem back to normal now. My signal delivery exercisers
work OK, my stress tests work OK, UML works when compiled on 2.4 and
run on 2.2, and vice versa, which -13 didn't. So, I'm releasing -14
now and maybe this signal delivery rewrite will be done.
</blockquote>
<a name="2-17-2002"><table width="100%" bgcolor="#e0e0e0">
<tr>
<td>
<b>
<font color="black">17 Feb 2002</font>
</b>
</td>
</tr>
</table>
<blockquote>
I submitted a paper proposal for OLS yesterday. This time, I decided
to rant and rave about how the host kernel needs to be fixed to better
support virtual machines. We'll see how that goes. At least it's
different from the standard UML song and dance I've been flogging for
the last couple of years.
<p>
I redid the UML signal delivery code in order to fix the pthreads hang
with the newer pthreads library. I prototyped this in a small
standalone process in Incheon Airport (Seoul's international airport)
on my way back from Brisbane and just got around to integrating it
into UML. It massively cleaned up a bunch of code and opens the way
for getting rid of some other problems that have existed for a while.
</blockquote>
<a name="2-11-2002"><table width="100%" bgcolor="#e0e0e0">
<tr>
<td>
<b>
<font color="black">11 Feb 2002</font>
</b>
</td>
</tr>
</table>
<blockquote>
My flight leaves tonight, so I spent the day wandering around central
Brisbane. Ben LaHaise happened to take the same CityCat ferry (which
is a system of catamarans used to ferry people up and down the
Brisbane River) as me down to the city. He tried to blow up the boat
with his umbrella, but, fortunately, an alert crew member stopped
him.
<p>
Back to the Uni at the end of the afternoon, collect my bags, call a
taxi to the airport, and wait for the flight to Seoul. Then it's
another 14 hours to JFK and another couple back to CT and then I will
be hopelessly confused about what time it is for a couple of days.
</blockquote>
<a name="2-10-2002"><table width="100%" bgcolor="#e0e0e0">
<tr>
<td>
<b>
<font color="black">10 Feb 2002</font>
</b>
</td>
</tr>
</table>
<blockquote>
LCA is over as of yesterday, and I'm heading home tomorrow.
<p>
The slides from my talk (with notes) are available
<a href="slides/lca2002/lca2002.htm">here</a>.
It was pretty well attended and it seemed to be received fairly well.
LCA always seems to do some innovative things, one of which is to
rerun talks that a large number of people regretted missing. The
three talks that were chosen this year were a virtual reality talk
that a huge number of people wanted to see, Andrew van der Stock's
talk on code auditing, and one other that I can't remember. This was
good because I was one of the huge number of people that wanted to
see the virtual reality talk. However, it turned out that my talk was
the number four vote-getter, and this turned out to be relevant when
Andrew was nowhere to be seen when the reruns were about to happen.
<p>
So, I was happily debugging the ppc UML build with Anton Blanchard
when one of the organizers ran up and asked me if I could do mine
again. I did so, except I skipped over some of the heavier parts of
the talk to leave a good bit of time for a demo at the end.
<p>
This went well, except for the panics I got when I tried to have two
UMLs mount the same filesystem. I demoed three UMLs running (one
Debian, two Slackwares) with most of them (plus the host, I think)
displaying on the X server of one of the Slackware UMLs. I showed
various other aspects of UML like what it looks like from the host
side.
</blockquote>
<a name="2-1-2002"><table width="100%" bgcolor="#e0e0e0">
<tr>
<td>
<b>
<font color="black">1 Feb 2002</font>
</b>
</td>
</tr>
</table>
<blockquote>
I'm off to Australia tomorrow for
<link target="http://linux.conf.au" type="external">LCA 2002</link>.
This caps a fairly productive week of UML bug hunting:
<ul>
<li>
mistral and blinky started seeing a panic in fork. mistral figured
out how to reproduce it and tracked it down to the point where it had
something to do with kernel threads reference counting their mm's.
This was enough information for me to fix the bug, by giving kernel
threads NULL mm's.
</li>
<li>
While I was at ISTS giving a talk, I spent some free time looking at
the pthreads problem that people have been seeing for a while. It
turns out to be a problem with UML signal delivery. I had assumed
that the registers going into a signal handler didn't matter (except
for the IP and SP, of course) and that only the stack frame mattered.
So, the process registers at the start of a signal delivery are
initialized with a set that was captured from a UML thread at boot
time. This works fine usually, except that recent pthreads libraries
store some thread-private data in %gs, and the %gs value has to be
preserved in signal handlers. So, the UML signal delivery mechanism
needs to be reworked again.
</li>
<li>
The UML IO hangs that were reported this week were tracked down and
found to be a bug in the host's handling of SIGIO. It turns out to be
possible, on an SMP host, for SIGIO to be queued to a process after
that process has returned from the fcntl that registered a different
process as the SIGIO recipient. This breaks UML badly because SIGIOs
end up queued, but not delivered, to a process which is out of context
and sleeping.
</li>
</ul>
</blockquote>
<a name="1-30-2002"><table width="100%" bgcolor="#e0e0e0">
<tr>
<td>
<b>
<font color="black">30 Jan 2002</font>
</b>
</td>
</tr>
</table>
<blockquote>
I gave a talk at ISTS yesterday on the UML security work that I did
last week. It's available both as
<a href="slides/ists2002/umlsec.htm">html-ized
slides</a> and as the
<a href="slides/ists2002/umlsec.sdd">original Star
Office presentation</a>. These are intended to provide a starting
point for anyone wanting to probe this for exploitable holes as well
as anyone who's curious about what was done.
<p>
I released 2.4.17-10 today. It contains a pile of bug fixes and a
bunch of changes which allow a UML patch to come close to compiling in
both 2.4 and 2.5 pools. I reverted a change which is causing problems
on SMP hosts. I decided that using sockets rather than pts devices to
communicate between the IO thread and UML was a good idea because
sockets are lighter weight and they're pretty much guaranteed to be
supported on the host, whereas there are lots of systems without pts
devices. However, there is some difference in how SIGIO is delivered
which causes UML to lose interrupts once in a while. The effect is
that it seems to hang on boot, but can be made to continue by banging
on the keyboard.
<p>
MTD is in the configuration now. So, UML supports MTD devices and
creating JFFS2 filesystems and mounting them seems to work, although
there are some nasty-looking error messages along the way. They don't
seem obviously related to UML though.
</blockquote>
<a name="1-25-2002"><table width="100%" bgcolor="#e0e0e0">
<tr>
<td>
<b>
<font color="black">25 Jan 2002</font>
</b>
</td>
</tr>
</table>
<blockquote>
The security work is largely done. The exception is the lcall
prevention fix that's needed on the host. So, I released 2.4.17-9
today. It also contains a number of fixes and patches from other
people, the largest being the latest set of James McMechan's ubd
changes.
</blockquote>
<a name="1-23-2002"><table width="100%" bgcolor="#e0e0e0">
<tr>
<td>
<b>
<font color="black">23 Jan 2002</font>
</b>
</td>
</tr>
</table>
<blockquote>
I released 2.4.17-8 yesterday (and 2.4.17-7 earlier this week without
dignifying it with a diary entry). I spent a fair amount of time
tracking down some old debugging problems. The strace recipe on the
<a href="debugging.html">debugging page</a>
hasn't worked for a while, so I mostly fixed it. strace still doesn't
see system calls from new processes until they receive a signal.
<p>
I also figured out what was happening with using the gdb under ddd as an
external debugger. ddd periodically calls wait on gdb, and when UML
attaches it, gdb gets reparented away from ddd. wait starts returning
ECHILD, and ddd reacts by shutting down gdb's input, and gdb, in turn,
exits. To fix this, I think I'm going to have to have a 'gdb-parent='
switch that will make UML attach to the parent and fake normal return
values from wait.
<p>
In other news, there have been a couple of articles about UML
recently. NewsForge ran
<a href="http://www.newsforge.com/article.pl?sid=02/01/18/2025249">one</a>
yesterday. This is a followup on the article last week about Linux
virtual machines which completely failed to mention UML. Bill Stearns
also noticed <a href="http://www.securitywriters.org/texts/internet%20security/Virtual_HoneyNet.php">
this article</a> on using UML as the basis of a honeynet.
<p>
I've started finishing off the security work needed to make UML a
secure root jail. The 'jail' switch now checks for config options
which would make the UML inherently insecure and refuses to run if any
of them are enabled. Currently, the proscribed options are
CONFIG_MODULES, CONFIG_HOSTFS, and CONFIG_SMP. CONFIG_MODULES is
fairly obvious. If modules are enabled, then root can insert any code
at all into UML, and a nasty root would insert code that execs a shell
or something on the host. CONFIG_HOSTFS is forbidden to prevent
accidentally providing access to the host filesystem. This is a bit
dubious because hostfs is not inherently insecure, and I may relax
this one at some point. CONFIG_SMP is non-obvious. Lennert Buytenhek
noticed the relationship between SMP and security. 'jail' is
implemented by unprotecting kernel memory (by making it writable) on
entering the UML kernel, and write-protecting it on kernel exit. If a
process were to have two threads, one busy-waiting in userspace, and
the other sleeping in the kernel, kernel memory would be writable
because the sleeping thread would be in the kernel. So, the spinning
thread would wait for that to happen and write on whatever part of
kernel memory would let it escape. This will be fixed when UML gets a
separate address space for the kernel.
<p>
I've stared at /proc and /dev to find devices that provide access to
kernel memory. The only two that I spotted were /dev/mem and
/dev/kmem. These are disabled with a trick that someone on
#kernelnewbies told me about. Access to them is controlled by
CAP_SYS_RAWIO, so removing that capability from the bounding
capability set makes it impossible for any process to ever get it.
So, no process can ever open those devices. Even better, in my
limited testing, nothing seems to break badly as a result.
<p>
/proc/kcore looks suspicious, but it's a readonly file that seems to
fit out a memory image wrapped in an ELF header, so it's OK,
security-wise.
</blockquote>
<a name="1-18-2002"><table width="100%" bgcolor="#e0e0e0">
<tr>
<td>
<b>
<font color="black">18 Jan 2002</font>
</b>
</td>
</tr>
</table>
<blockquote>
2.4.17-6 is out. There are a lot of driver cleanups and bug fixes in
this patch. The IRQ hang is fixed. The default console and serial
line channel initialization strings are now configurable.
<p>
In other news, NewsForge ran an
<a href="http://www.newsforge.com/article.pl?sid=02/01/16/1930207">article
</a> about Linux virtual machines which covered everything
relevant, including some things that weren't virtual machines, except
for UML. They got some complaints about that, and later that day, I
got a piece of email from the guy who wrote the article wanting to
write a followup about UML. So, it looks like UML will be getting
another nice bit of publicity.
</blockquote>
<a name="1-13-2002"><table width="100%" bgcolor="#e0e0e0">
<tr>
<td>
<b>
<font color="black">13 Jan 2002</font>
</b>
</td>
</tr>
</table>
<blockquote>
I made another patch against the 2.5.2-pre tree again today. This one
is against 2.5.2-pre11. It has been sent off to Linus so he can drop
it in his bit bucket.
<p>
In another development, it turns out that the O(1) scheduler breaks
UML by holding IRQs disabled across context switches. This results in
SIGIO (i.e. from disk IO completions) to be trapped in a process that
has gone out of context, and can't be woken up until something else
notices that the IO has completed, and of course it won't because the
SIGIO has been delivered to the wrong process.
</blockquote>
<a name="1-11-2002"><table width="100%" bgcolor="#e0e0e0">
<tr>
<td>
<b>
<font color="black">11 Jan 2002</font>
</b>
</td>
</tr>
</table>
<blockquote>
After spending five days tracking down a swap corruption bug, I
discovered that Rodrigo de Castro had explained to me exactly what it
was about a month ago. Unfortunately, at the time, I didn't know
enough about the swap code to decide whether he was making sense. Of
course he was, and I discovered that at the end of the great bug hunt.
<p>
So, with that fix, Lennert's latest SMP changes, and a bunch of
smaller stuff, I'm releasing 2.4.17-5 today.
<p>
Linus saw fit to silently drop UML into the bit bucket again, so I'll
make another patch soon and send it in.
</blockquote>
<a name="1-5-2002"><table width="100%" bgcolor="#e0e0e0">
<tr>
<td>
<b>
<font color="black">5 Jan 2002</font>
</b>
</td>
</tr>
</table>
<blockquote>
I released the 2.4.17-3 and 2.4.17-4 patches this week. The biggest
change has been the merging of Lennert's SMP fixes.
<p>
I made another attempt to get UML into the Linus tree. This patch is
against 2.5.2-pre9 and is the 2.4.17-4 patch. We'll see how well this
attempt fares.
</blockquote>
<a name="12-30-2001"><table width="100%" bgcolor="#e0e0e0">
<tr>
<td>
<b>
<font color="black">30 Dec 2001</font>
</b>
</td>
</tr>
</table>
<blockquote>
I announced the full 2.4.17 release and the 2.4.17-2 patch today. The
patch is largely changes to allow UML to calculate current from the
stack. This is to make life easier for Lennert, who's trying to get
SMP working. It also contains a bunch of fixes for bugs that crop up
when host devices get closed from under UML consoles or serial lines.
<p>
Iain Young is making a decent stab at a UML/sparc64 port. He's got
the boilerplate filled in (albeit with some skeptical comments about
their correctness...) and he's trying to get the whole thing to compile.
<p>
Linus released 2.5.2-pre4 today with no sign of UML in the changelog.
I grabbed the patch to make sure it wasn't there. It wasn't. Grrr.
I'll give him another patch and then I'll spam him with it again.
</blockquote>
<a name="12-28-2001"><table width="100%" bgcolor="#e0e0e0">
<tr>
<td>
<b>
<font color="black">28 Dec 2001</font>
</b>
</td>
</tr>
</table>
<blockquote>
OK, so the diary has taken a bit of a holiday break. I released the
2.4.17 UML patch yesterday. The full release will be forthcoming. I
also ported that patch into 2.5.1, created the 2.5.1 patch, and sent
it to Linus. Hopefully, he will put it in without my having to resend
it too many times. I sent a little note off to LKML announcing this,
which got some favorable reaction, both on and off the list. Alan,
being his usual taciturn self sent a reply, which read, in its
entirety, "Cool".
<p>
This release had a lot of accumulated stuff in it. The biggest item
are the port channel, which let you attach any number of UML consoles
and serial lines to a host port, at which point you can access them by
telnetting to that port. I also redid the context switching mechanism
after thinking of a much simpler way of doing it. This should also be
much faster since it doesn't involve signals flying around, so context
switches are now invisible to the tracing thread.
</blockquote>
<a name="12-08-2001"><table width="100%" bgcolor="#e0e0e0">
<tr>
<td>
<b>
<font color="black">8 Dec 2001</font>
</b>
</td>
</tr>
</table>
<blockquote>
I released 2.4.15-3 today. It contains some fixes to previous patches
and a lot of changes to the gdb support. gdb now sees ^C immediately,
rather than an arbitrary amount of time after it's typed. I also
cleaned up that code quite a bit. This knocks a couple of items off
the <a href="todo.html">todo list</a>. It also
sets me up to fix the gdb shell hang, but I'll let these changes gel
for a bit before dealing with that.
</blockquote>
<a name="12-07-2001"><table width="100%" bgcolor="#e0e0e0">
<tr>
<td>
<b>
<font color="black">7 Dec 2001</font>
</b>
</td>
</tr>
</table>
<blockquote>
I got the <a href="sdotm.html">Sysadmin Disaster of
the Month contest</a> going about a week
later than I should have. The thing that happened a week earlier was
the publication of an <a href="http://www.oreillynet.com/pub/a/linux/2001/11/29/UserModeLinux.html">
article</a> that I wrote for O'Reilly on using UML to simulate and
recover from disasters.
<p>
This month's disaster is a trashed root superblock. It involves
booting UML, zeroing out the superblock, and figuring out how to fix
the filesystem. I had some trouble coming up with a good example to
use for the contest. So, if I have similar troubles at the end of the
month, I might just trash a filesystem, make it available for
download, and the contest will be to figure out what's wrong with it
and fix it.
</blockquote>
<a name="12-04-2001"><table width="100%" bgcolor="#e0e0e0">
<tr>
<td>
<b>
<font color="black">4 Dec 2001</font>
</b>
</td>
</tr>
</table>
<blockquote>
Back from Linux-Kongress. Back on US/Eastern. I think I never left
it, which made life (the staying awake part of it) difficult in
Holland.
<p>
As for highlights of the conference, we have:
<ul>
<li>
I and the UML project seem to have some name recognition. Everyone I
talked to seemed to have heard of both me and UML, which is very cool.
</li>
<li>
The talk went reasonably well. I gave the same talk as I did at ALS.
I had forgotten that it was somewhat tailored for ALS (i.e. I tried
to avoid talking about stuff that I had talked about at the previous
ALS), and it would have been somwhat different if I had prepared a new
talk for Linux-Kongress.
</li>
<li>
I met a pile of cool people, like
<ul>
<li>
Lennert Buytenhek (who, in recognition of his contributions to both
projects, was embarassed by both me and Rusty by being asked to stand
up for some audience appreciation, which must be a new Linux-Kongress
record)
</li>
<li>
Roman Zippel (who told me about a couple of ubd driver bugs, one of
which I knew of (a subtle rounding error), and one of which I didn't
(Greg Lonnon and I went to some trouble to put the COW header in
network byte order, but forgot to do the same for the block bitmap
(grrrr))
</li>
<li>
Bruce Walker (who's in charge of the Compaq SSI project, and who asked
me clustering questions during my talk, at which point, I (correctly)
guessed who he worked for and why he was asking)
</li>
<li>
Fabio Olive Leite (a Conectivite who gave me a nice Conectiva
filesystem image a while back, and whose name I unaccented to get it
through my XSL processor)
</li>
<li>
Philipp Reisner (who threatened an Alpha UML port a while back, but
gave up, so he's less cool than the others :-)
</li>
</ul>
</li>
<li>
The organizers took the speakers back to Amsterdam after the
conference to spend the day bumming around the city. We broke up into
small groups and went our separate ways. Our group spent much of our
time in two smallish cafe-type places just talking about random stuff.
</li>
<li>
The train trip from Schiphol airport (Amsterdam) to Enschede (near the
German border) was interesting for a number of people. It was exactly
as described for me (2+ hours, direct train, no problem), but some
track maintenance in Amsterdam's central station caused subsequent
trains to be cancelled, so other people had nightmares involving 5
trains and a bus totalling 5 hours.
</li>
</ul>
</blockquote>
<a name="11-26-2001"><table width="100%" bgcolor="#e0e0e0">
<tr>
<td>
<b>
<font color="black">26 Nov 2001</font>
</b>
</td>
</tr>
</table>
<blockquote>
I released 2.4.14-6 today in the interest of clearing the decks for
the 2.4.15 release. Before leaving for Thanksgiving, I had redone the
mconsole protocol to be packet-oriented. This allows a lot more
flexibility in what can be done with the protocol. As a result,
you'll need the new mconsole client for this release.
<p>
While down in CT, I redid the host channel support. It is all much
cleaner now, and makes it a lot simpler to knock a bunch of
related items off the todo list.
<p>
I decided to knock off the 2.4.15 patch today as well. It went cleanly,
aside from a ptrace cleanup and a new way of generating /proc/cpuinfo
which I had to support. I also put in the file corruption fix after
forgetting to and discovering that a boot/halt caused fsck to complain
a little.
</blockquote>
<a name="11-18-2001"><table width="100%" bgcolor="#e0e0e0">
<tr>
<td>
<b>
<font color="black">18 Nov 2001</font>
</b>
</td>
</tr>
</table>
<blockquote>
While I'm waiting for the meteors to arrive, I'm chasing and stomping
UML bugs. I cleaned up and released the proxy arp fixes that I did on
planes and in airports on my way to Oakland. Before, uml_net would
blindly add an arp entry to eth0 and nothing else. This is wrong if
there is no eth0, and it's also wrong if eth0 doesn't connect to the
local net or if there are other interfaces also attached to the local
net. uml_net now looks at the routing table and puts an arp entry on
every interface that talks to the local net.
<p>
I also noticed that slip support wasn't up to date, so I modernized it
and cleaned up the code while I was at it. You can now change the IP
address of a slip-based interface and the host configuration will be
updated just like the other transports.
<p>
I added some RT signal support. SA_SIGINFO is now supported, which
will hopefully fix some of the strange process behaviors that have
cropped up lately. If this fix doesn't do it, I chased down another
bug which was causing rt_sigsuspend and sigsuspend to return incorrect
values. This was causing the libc sigsuspend to hang, and its process
with it. This fixes the pthread_create hang that Greg Lonnon noticed,
plus the gdb hang, I think. I haven't checked that yet.
<p>
Those fixes are in 2.4.14-3um which I just released. You'll need the
latest utilities in order to use the network, since I bumped the
uml_net version again.
</blockquote>
<a name="11-14-2001"><table width="100%" bgcolor="#e0e0e0">
<tr>
<td>
<b>
<font color="black">14 Nov 2001</font>
</b>
</td>
</tr>
</table>
<blockquote>
OK, I'm back from ALS. My talk was on the first day, and it was
reasonably well attended considering the somewhat dismal overall
number of attendees. It was a half-hour talk, so about an hour
beforehand, I took my OLS slides, threw out more than half of them,
and updated the rest. That worked out reasonably well, but 30 minutes
makes for a very short talk without much detail.
<p>
Daniel Phillip's talk was the last of the conference, and was somewhat
interesting. He had a pile of raw data that he needed to turn into
slides, and all of the KDE presentation tools blew up on him in one
way or another. So, in the break before his slot, he grabbed Stephen
Tweedie, and they plus me and another guy went off to a local dim-sum
place. Daniel and Stephen sweated over Star Office on Stephen's
laptop making slides. In the event, they turned out rather well.
<p>
I left just after Daniel's talk, so I missed out on some of the
socializing that afternoon and evening. It turned out that Daniel and
Larry McVoy were talking about his clustering ideas (MetaLinux, or
ML), and it occurred to them that UML was not only a good simulation
tool for ML, but that it actually implements a good part of what Larry
has in mind. I found out about this later, and had a long talk with
Larry on Monday, in which he explained his plans. I had heard various
mumblings about it, and saw a
<a href="http://bitmover.com/ml">slide show</a>
that Larry has, and remained unenlightened. It turns out, that as far
as I can tell, the only way to find out what he's thinking is to have
him explain it in person. Anyway, I became enlightened after our
chat, and it looks like this could be a whole new area that UML could
branch into.
<p>
In actual development news, I fully released 2.4.14 today. En route
to Oakland, I fixed uml_net so it's smarter about doing proxy arp. It
figures out what devices are connected to the local net and only sets
proxy arp on those. As a side-effect, if the host is totally
isolated, then you don't get scary-looking error messages when it
tries to set proxy arp on eth0 and it turns out not to exist.
<p>
This happened to me at OLS when I tried to demo it after my talk. I got
this nasty message which convinced me that the network all of a sudden
didn't work, and I was all apologetic and had no idea what happened.
In reality, the network was fine, and I could have demoed it if I had
retained a bit more presence of mind.
<p>
This isn't in the 2.4.14 release because I'm not happy about the
cleanliness of the change. I'll probably clean it up for the next
2.4.14 patch.
<p>
On a much-delayed train from San Francisco to Mountain View (a
supposedly 1:13 hour trip that in reality required about 1:50 and two
trains), I also figured out why you can't talk to eth1 from the host
if you configure both an eth0 and eth1. It turned out to be the same
bug that other people had noticed causing dropped packets. I was
checking errno incorrectly. I had code that did this:
<tt>
<pre>
<font size="-1">
n = read(...);
if(errno == EAGAIN) return(0);
</font>
</pre>
</tt>
forgetting that successful system calls don't necessarily set errno to
zero. So, the eth1 read was succeeding, but errno was still EAGAIN
from the eth0 read.
<p>
In other news, beware of kernels built with gcc 3.0.2. I got a
complaint from Jens Axboe today about UML leaving all kinds of
not-quite-zombie processes lying around. I looked at it a bit and
guessed that the host kernel was messed up somehow. He looked at
that, decided I was right, and that the culprit was the latest gcc.
The interesting thing was that, until he ran UML on that kernel, it
looked just fine to him.
</blockquote>
<a name="11-06-2001"><table width="100%" bgcolor="#e0e0e0">
<tr>
<td>
<b>
<font color="black">6 Nov 2001</font>
</b>
</td>
</tr>
</table>
<blockquote>
In preparation for fixing the problem of the console driver losing
output, I ported the SIGIO handler to use poll instead of select.
This was mostly what 2.4.13-4 was. I later discovered a bug in it,
which is fixed in -5.
<p>
I then decided to fix the problem of UML not being able to be
interrupted and backgrounded. The problem was that all UML processes
are in the same process group, with all of them stopped except for the
one that's actually running. The problem is that when UML is
backgrounded, the shell sends a SIGCONT to the process group, which
wakes up every UML process, which is very bad.
<p>
I did some failed experiments with setpgrp/setsid and friends, and
discovered that a separate process group wouldn't work because then
those threads can't write to the terminal because they're in the wrong
process group.
<p>
So, I decided that out-of-context processes should be asleep rather
than stopped. This required redoing the task switching code. They
were stopped because the tracing thread intercepted a signal from them
when they went out of context and never continued them. Having them
sleep would require that the tracing thread stop doing that and that
the threads involved in a context switch arrange the transfer
themselves.
<p>
So, what is now done is that non-running processes are asleep in
sigsuspend, and they are woken up by the going-out-of-context process
sending a SIGTERM. Races are avoided by having the SIGTERM sent
inside a section of code that has blocked SIGTERM. SIGTERM is
re-enabled atomically with the sleep with sigsuspend.
<p>
So, that plus the poll fix is the contents of -5.
</blockquote>
<a name="11-03-2001"><table width="100%" bgcolor="#e0e0e0">
<tr>
<td>
<b>
<font color="black">3 Nov 2001</font>
</b>
</td>
</tr>
</table>
<blockquote>
Time to patch-bomb Alan again. I sent in ten patches to get the ac
tree current with CVS. Here they are:
<ul>
<li name="2.4.13/misc-4">
<a href="ac-patches/2.4.13/misc-4">Miscellaneous fixes</a> - some build cleanup,
a config update, some name changes in the mconsole driver, exporting
of gprof symbols, and various other small cleanups and fixes
</li>
<li name="2.4.13/physmem">
A <a href="ac-patches/2.4.13/physmem">name change</a> from physmem
to uml_physmem
</li>
<li name="2.4.13/con">
A <a href="ac-patches/2.4.13/con">console driver fix</a> caused by
a tty struct leak
</li>
<li name="2.4.13/init">
Adam Heath's <a href="ac-patches/2.4.13/init">init changes</a> and
other cleanups
</li>
<li name="2.4.13/initrd">
A <a href="ac-patches/2.4.13/initrd">initrd cleanup</a>
</li>
<li name="2.4.13/net">
<a href="ac-patches/2.4.13/net">Update to the network backends</a> to make
them grab output from uml_net and printk it cleanly
</li>
<li name="2.4.13/ppc">
Some <a href="ac-patches/2.4.13/ppc">ppc updates</a> and fixes from Chris
</li>
<li name="2.4.13/sig">
A <a href="ac-patches/2.4.13/sig">signal handling fix</a> which eliminates
most of the process segfaults which people had been seeing
</li>
<li name="2.4.13/vm">
Jorgen Cederlof's <a href="ac-patches/2.4.13/vm">context switch speedup</a> ,
which also includes some VM fixes that I found
</li>
<li name="2.4.13/sync">
A <a href="ac-patches/2.4.13/sync">sychronization patch</a> which
includes a grab-bag of changes which I hadn't managed to get into the
ac tree yet
</li>
</ul>
</blockquote>
<a name="11-02-2001"><table width="100%" bgcolor="#e0e0e0">
<tr>
<td>
<b>
<font color="black">2 Nov 2001</font>
</b>
</td>
</tr>
</table>
<blockquote>
That last patch went into -ac6, so the ac UML builds and works again.
The next job is to get the ac tree up to date.
<p>
I released a new utilities tarball today. uml_net should now do proxy
arp correctly. uml_mconsole is now able to take a command on its
command line and execute it, rather than being strictly a command line
tool.
</blockquote>
<a name="10-30-2001"><table width="100%" bgcolor="#e0e0e0">
<tr>
<td>
<b>
<font color="black">30 Oct 2001</font>
</b>
</td>
</tr>
</table>
<blockquote name="2.4.13/build">
I decided to make the -ac UML build again, so I made
<a href="ac-patches/2.4.13/build">this patch</a> and sent it off to
Alan. The rest of the updates will be forthcoming.
</blockquote>
<a name="10-29-2001"><table width="100%" bgcolor="#e0e0e0">
<tr>
<td>
<b>
<font color="black">29 Oct 2001</font>
</b>
</td>
</tr>
</table>
<blockquote>
Today is 2.4.14-3 day. I decided to remove the code in fix_range
which unmaps pages whose ptes say they're not present. That basically
caused it to try to uselessly unmap all of its unused address space.
So, I did that and it uncovered a bug. It turns out that swapped-out
pages weren't marked as needing to be remapped. Everything worked a
lot better with that fixed, and context switching should be a bit
faster now.
</blockquote>
<a name="10-28-2001"><table width="100%" bgcolor="#e0e0e0">
<tr>
<td>
<b>
<font color="black">28 Oct 2001</font>
</b>
</td>
</tr>
</table>
<blockquote>
I released 2.4.14-2 today. This contains the fix for the process
segfaults and the gdb problems people have been having. It also turns
on morlock's context switch optimization which I disabled until I
figured out the segfaults.
</blockquote>
<a name="10-26-2001"><table width="100%" bgcolor="#e0e0e0">
<tr>
<td>
<b>
<font color="black">26 Oct 2001</font>
</b>
</td>
</tr>
</table>
<blockquote>
I finished releasing 2.4.13 today.
<p>
After some prodding from Greg Lonnon, and after he did some investigation,
I figured out what the problem with gdb inside UML is. The signal
handlers don't save their registers in the thread struct. This means
that when a SIGTRAP from a breakpoint comes in and it gets forwarded
to gdb, when it gets the registers to find out what the ip is, it gets
an old, bogus value. So, it doesn't recognize that as a breakpoint
and complains about a spurious SIGTRAP instead.
</blockquote>
<a name="10-25-2001"><table width="100%" bgcolor="#e0e0e0">
<tr>
<td>
<b>
<font color="black">25 Oct 2001</font>
</b>
</td>
</tr>
</table>
<blockquote>
I spent the last few days chasing a process segfault problem. I
finally tracked it down today. It turns out that my rewrite of the
process signal delivery code was broken in the case of a signal being
delivered from an interrupt handler rather than a system call. It
grabs the process registers from the thread structure, saves them away
on the stack, and then restores them to the process when the handler
finishes.
<p>
However, interrupts don't save their registers in the thread
structure, so those registers represent the last system call, which
has already finished. And restoring those causes great confusion in
the process.
</blockquote>
<a name="10-20-2001"><table width="100%" bgcolor="#e0e0e0">
<tr>
<td>
<b>
<font color="black">20 Oct 2001</font>
</b>
</td>
</tr>
</table>
<blockquote>
I released 2.4.12-3um and 2.4.12-4um over the last week. -3 fixed a
couple of problems with -2, and -4 adds some miscellaneous fixes to
that. The major ones are that physical memory protection is optional
(controlled by the 'jail' switch) and that the network driver backends
now collect uml_net commands and output and nicely printk them instead
of having the output just dumped to the terminal. To support this,
uml_net now hangs on to the commands it runs and the output they
produce and send them back to UML. This required that the uml_net
interface be incremented, so it's now at 3. The new drivers require
the new uml_net, so if you grab the UML patch, also get the latest
utilities tarball too.
</blockquote>
<a name="10-13-2001"><table width="100%" bgcolor="#e0e0e0">
<tr>
<td>
<b>
<font color="black">13 Oct 2001</font>
</b>
</td>
</tr>
</table>
<blockquote>
I released 2.4.12-2um today. It's almost entirely changes sent in by
other people, dominated by Adam Heath's cleanups. There were also some
ppc fixes from Chris Emerson, and small fixes from other people.
<p>
I also released a new utilities tarball. The one change was to
uml_net, which does proxy arp in a different, and apparently more
robust way than it used to.
</blockquote>
<a name="10-11-2001"><table width="100%" bgcolor="#e0e0e0">
<tr>
<td>
<b>
<font color="black">11 Oct 2001</font>
</b>
</td>
</tr>
</table>
<blockquote>
Linus released 2.4.11 and 2.4.12 two days apart. I had the 2.4.11
patch uploaded, and had started releasing packages when 2.4.12 came
out. So, 2.4.12 is out there and I'm doing the packages again.
</blockquote>
<a name="10-08-2001"><table width="100%" bgcolor="#e0e0e0">
<tr>
<td>
<b>
<font color="black">8 Oct 2001</font>
</b>
</td>
</tr>
</table>
<blockquote>
I should have mentioned the latest -ac patches already since they've
been in Alan's tree for a few days, but I didn't, so here they are
<ul>
<li name="2.4.10/mmapper">
<a href="ac-patches/2.4.10/mmapper">an update</a> to the mmapper driver
</li>
<li name="2.4.10/misc-2">
yet another set of <a href="ac-patches/2.4.10/misc-2">miscellaneous fixes
</a>
</li>
<li name="2.4.10/addr">
a <a href="ac-patches/2.4.10/addr">reorganization</a> of the UML
address space
</li>
<li name="2.4.10/sigs">
a <a href="ac-patches/2.4.10/sigs">rewrite</a> of the signal
delivery mechanism to allow all of kernel physical memory to be
protected from userspace
</li>
<li name="2.4.10/ubd">
<a href="ac-patches/2.4.10/ubd">version 2</a> of the ubd COW header
</li>
</ul>
In other news, with the help of Paul, I tracked down an ancient
console driver bug that held on to a struct tty after it had been
freed and subsequently caused panics.
<p>
I released 2.4.10-7um today with that fix and some other minor changes.
</blockquote>
<a name="10-05-2001"><table width="100%" bgcolor="#e0e0e0">
<tr>
<td>
<b>
<font color="black">5 Oct 2001</font>
</b>
</td>
</tr>
</table>
<blockquote>
Paul Larson found a test case for the signal problems that was
reproducable for me. So, with that in hand, I tracked down the bug,
and released 2.4.10-6um.
<p>
The bug turned out to be a result of moving where state is saved
before a signal is delivered to a process. The process registers and
some other things need to be saved on the process stack so they can be
restored later. The way it used to work is that
<ul>
<li>
handle_signal would figure out what the interrupted system call
eventually returns
</li>
<li>
that value is passed up the stack and stored in the process registers
stored in its task structure
</li>
<li>
the process would be sent a signal so it starts running on its process stack
</li>
<li>
the UML signal handler copies the register state from the task
structure to its own stack
</li>
<li>
it calls the process signal handler
</li>
<li>
and restores the registers back to the task struct
</li>
</ul>
What I implemented did this
<ul>
<li>
handle_signal figures out what the interrupted system call eventually
returns and constructs the process stack frame, copying the registers
from the task struct onto the stack
</li>
<li>
that value is passed up the stack and stored in the process registers
stored in its task structure
</li>
</ul>
The bug is that the second step happened too late. The registers
saved on the stack hold a bogus return value, and it's that value
which the system call eventually returns.
</blockquote>
<a name="10-03-2001"><table width="100%" bgcolor="#e0e0e0">
<tr>
<td>
<b>
<font color="black">3 Oct 2001</font>
</b>
</td>
</tr>
</table>
<blockquote>
I decided to profile a stretch of UML thrashing. So, I took the
2.4.10-2ac UML (which I updated to the latest stuff, and which I'll be
sending to Alan shortly), gave it 128M of memory and 1G of swap, and
let a 'make -j' kernel build run for a couple of hours.
<a href="text/gprof1.out">These</a> are the
results. All of the system calls show up as <spontaneous>.
Somehow it wasn't linked against the profiling libc. I'll try to
figure out why not.
<p>
Some highlights:
<ul>
<li>
Protecting kernel memory from userspace seems to be expensive -
mprotect is the top item on the list.
</li>
<li>
wait4 is number two, which I don't entirely understand. That's the
tracing thread. It sleeps in wait, and wakes up when there's
something that needs doing, so I don't understand why it shows up,
unless it's somehow being charged for all of the context switching
that UML causes.
</li>
<li>
Then we have other low-level VM things, fix_range and
flush_tlb_kernel_vm. These manually walk address spaces to update
them. These two are unnecessarily inefficient and can probably be
knocked far down the list pretty easily.
</li>
<li>
Finally, we get into generic kernel things, which show clear signs of
heavy swapping - page_launder, swap_out_pmd, do_anonymous_page.
</li>
<li>
The first system call which shows up is sys_brk, way down the list,
followed distantly by sys_read and sys_close.
</li>
<li>
There were 312175 system calls total. The most frequently called were
sys_brk, sys_read, sys_open, sys_newfstat, and sys_stat64, not
unexpected for a kernel build.
</li>
<li>
kmalloc was called most often from load_elf_binary, select_bits_alloc,
and load_elf_interp. __get_free_pages was called most often from
handle_mm_fault, pipe_poll, and do_fork. It called _alloc_pages,
which was called most frequently from read_swap_cache_async,
do_anonymous_page, and do_wp_page.
</li>
</ul>
</blockquote>
<a name="10-01-2001"><table width="100%" bgcolor="#e0e0e0">
<tr>
<td>
<b>
<font color="black">1 Oct 2001</font>
</b>
</td>
</tr>
</table>
<blockquote name="2.4.10/build-2">
I discovered a new way of breaking UML. A 'make -j' kernel build
drives the load above 150, and on 2.4.10 causes essentially a
livelock. I eventually regained control by sending SIGILL to all the
processes from the host. Plus, I got all kinds of interesting illegal
instruction and bus error deaths. These were absent on -ac2, probably
because that wasn't a totally up-to-date UML, so it was missing the
most recent bugs that I added. I'm going to track those bugs down by
updating UML in the -ac tree bit by bit and seeing which bit causes
these nasty little problems.
<p>
Speaking of -ac2, it needs a <a href="ac-patches/2.4.10/build-2">little
fix to ptrace</a> in order to build.
</blockquote>
<a name="09-25-2001"><table width="100%" bgcolor="#e0e0e0">
<tr>
<td>
<b>
<font color="black">25 Sep 2001</font>
</b>
</td>
</tr>
</table>
<blockquote>
Today I redid the signal delivery code. Now all the saving and
restoring of state happens in kernelspace rather than on the process
stack like before. This allows the task structure to be protected
from processes. Since that was the only hole in the protection of
physical memory, that is now fully protected against being changed
from userspace.
</blockquote>
<a name="09-24-2001"><table width="100%" bgcolor="#e0e0e0">
<tr>
<td>
<b>
<font color="black">24 Sep 2001</font>
</b>
</td>
</tr>
</table>
<blockquote>
I made a .deb and an RPM in preparation for releasing 2.4.10, and
Jacques Nilo reported that yesterday's fix wasn't enough. I had
forgot about an instance of MAP_SHARED | MAP_ANONYMOUS. So, I fixed
that, and that is 2.4.10-3um. And that is the basis of the official
2.4.10 UML release.
</blockquote>
<a name="09-24-2001"><table width="100%" bgcolor="#e0e0e0">
<tr>
<td>
<b>
<font color="black">24 Sep 2001</font>
</b>
</td>
</tr>
</table>
<blockquote>
I thought of an easy fix for the stack capturing problem that
prevented UML from booting on 2.2 hosts. Basically, a new process is
created which stops itself, and when that happens, the parent grabs a
copy of the stack and uses it to create a context for future threads
to run in. On 2.2, the parent used ptrace to extract the contents of
the stack from the child word by word. I looked at that code and
decided it would be much easier to map the stack MAP_SHARED so it
would be shared between parent and child and the parent could just
memcpy it to a safe place rather than ptracing it out.
<p>
What I forgot was that, while 2.4 supports MAP_SHARED | MAP_ANONYMOUS,
2.2 doesn't. So, on 2.2 hosts, UML wouldn't even begin to boot.
<p>
The easy solution was to go back to MAP_PRIVATE | MAP_ANONYMOUS, but
clone the new process with CLONE_VM, making it a thread, which allows
the parent to copy the stack directly, since they're both in the same
address space.
<p>
This fix makes 2.4.10 usable, so I've released another patch and
updated CVS.
</blockquote>
<a name="09-23-2001"><table width="100%" bgcolor="#e0e0e0">
<tr>
<td>
<b>
<font color="black">23 Sep 2001</font>
</b>
</td>
</tr>
</table>
<blockquote>
Linux released 2.4.10 today, so I updated UML as well. I decided not
to base this on the latest UML patch, since that it not entirely
healthy at the moment. My sigaltstack fixes broke UML totally on 2.2
hosts. So, 2.4.10-1um is 2.3.9-8um updated to 2.4.10.
<p>
CVS is not updated, but will be once I have the sigaltstack thing
fixed and that pool updated to 2.4.10.
</blockquote>
<a name="09-22-2001"><table width="100%" bgcolor="#e0e0e0">
<tr>
<td>
<b>
<font color="black">22 Sep 2001</font>
</b>
</td>
</tr>
</table>
<blockquote>
The last set of -ac patches went into -ac14. That brings Alan's tree
reasonably up-to-date.
<p>
I released 2.4.9-8um yesterday and 2.4.9-9um today. -8 was some bug
fixes and cleanup. -9 was fixing sigaltstack and doing a lot of cleanup
and rearrangement of the signal delivery code. This sets me up to redo
the entire signal delivery mechanism so I can finish protecting all of the
kernel's physical memory from userspace.
</blockquote>
<a name="09-18-2001"><table width="100%" bgcolor="#e0e0e0">
<tr>
<td>
<b>
<font color="black">18 Sep 2001</font>
</b>
</td>
</tr>
</table>
<blockquote name="2.4.9/personality">
That last batch of patches went into -ac12. So, the next batch is off
to him, plus <a href="ac-patches/2.4.9/personality">one from Andrea
Arcangeli</a> which fixes a declaration which is needed to
compile UML successfully.
<p>
Once these are in, the -ac tree is almost up to date. It'll be one
CVS release behind, which is OK because there are some tweaks I want
to make to the address space reorg. So, I'll get that right and send
it in rather than sending it in two pieces.
</blockquote>
<a name="09-15-2001"><table width="100%" bgcolor="#e0e0e0">
<tr>
<td>
<b>
<font color="black">15 Sep 2001</font>
</b>
</td>
</tr>
</table>
<blockquote name="2.4.9/hz">
I released 2.4.9-6um last night. It contains the already-mentioned
COW header changes. It also occurred to me that I can fix the
mlockall bug by sticking UML at the top of the address space where
it's supposed to be anyway. So, I went ahead and did that. This
allowed me to get rid of the vmas that UML needed to stick in each mm
to prevent mmap from reallocating areas of virtual memory that UML is
living in. This, plus the fact that these vmas had no ptes, caused
mlockall to cause major damage to UML by trying to unmap it. Putting
UML above TASK_SIZE causes it to be ignored by mmap, and the problem
just disappears. This also let me get rid of the nasty address space
reservation code that was needed in order to prevent libc from mapping
stuff in where UML wanted to put stuff.
<p>
In other news, I'm back in the ac patch business. First is a
<a href="ac-patches/2.4.9/hz">patch</a> that I've been sitting on
all week which defined hz_to_std and allows UML to build again. Then,
we have
<ul>
<li name="2.4.9/build">
some <a href="ac-patches/2.4.9/build">build cleanups</a>
</li>
<li name="2.4.9/misc">
a couple <a href="ac-patches/2.4.9/misc">miscellaneous fixes</a>
</li>
<li name="2.4.9/hostfs">
a small <a href="ac-patches/2.4.9/hostfs">hostfs patch</a> from
Jorgen Cederlof
</li>
<li name="2.4.9/sysrq">
mistral's <a href="ac-patches/2.4.9/sysrq">sysrq patch</a>
</li>
</ul>
These are now all off to Alan. I've got some more which will wait
till those have gone in, in order to minimize conflicts:
<ul>
<li name="2.4.9/inline">
a bunch of 'extern inline' declarations <a href="ac-patches/2.4.9/inline">
turned</a> into 'static inline'
</li>
<li name="2.4.9/mem">
the first <a href="ac-patches/2.4.9/mem">installment</a> of
protecting the kernel from userspace
</li>
<li name="2.4.9/misc-2">
another <a href="ac-patches/2.4.9/misc-2">miscellaneous fixes patch</a>
</li>
<li name="2.4.9/tuntap">
the <a href="ac-patches/2.4.9/tuntap">TUN/TAP transport</a>
</li>
<li name="2.4.9/misc-3">
yet another <a href="ac-patches/2.4.9/misc-3">miscellaneous fixes patch</a>
</li>
<li name="2.4.9/ppc">
some <a href="ac-patches/2.4.9/ppc">ppc updates</a> from Chris Emerson
</li>
<li name="2.4.9/malloc">
calls to malloc, calloc, and free are now <a href="ac-patches/2.4.9/malloc">
converted</a> into calls to kmalloc and kfree when the slab
allocator is running
</li>
</ul>
</blockquote>
<a name="09-14-2001"><table width="100%" bgcolor="#e0e0e0">
<tr>
<td>
<b>
<font color="black">14 Sep 2001</font>
</b>
</td>
</tr>
</table>
<blockquote>
Greg Lonnon and I have been fiddling with the COW file header format.
I had already discovered that blindly copying the backing file path
provided by the user into the header is a problem when it is a
relative path. That COW file won't be usable by a UML run in a
different level of the directory hierarchy because, from there, the
relative path stored in the header doesn't refer to the backing file.
The fix is to write an absolute pathname into the header.
<p>
Greg had a couple of other good ideas which we thought should be
implemented earlier rather than later
<ul>
<li>
The header should be able to hold a MAXPATHLEN-sized backing file name
rather than the current 256 bytes.
</li>
<li>
It should be in network byte order. This will allow COW files to be
moved between big-endian and little-endian hosts. Whether the
underlying filesystem can be mounted in UML after the move depends on
whether the filesystem has its metadata byte-swapped correctly. But,
at least the COW header won't prevent it from working.
</li>
</ul>
These two are not backward compatible, so we bumped the COW header
version and made these changes in the version 2 header. The driver
can read both V1 and V2 headers but it will only write V2 headers.
<p>
The absolute pathname change is in 2.4.9-5um since it was small and
backward compatible. The other two will be introduced in 2.4.9-6um.
<p>
The <a href="http://lists.sourceforge.net/lists/listinfo/user-mode-linux-user">uml-user list</a> had a couple of
interesting posts from UML users today
<ul>
<li post="6617693"> <a href="http://www.geocrawler.com/lists/3/SourceForge/597/0/6617693">Martin Volf</a> did a Slackware 8.0
installation inside UML and wrote a
<a href="http://mv.web.wo.cz/uml/umlslackware.html">
page</a> describing how he did it.
</li>
<li post="6620124">Tim Robinson had some problems with the TUN/TAP transport and
<a href="http://www.geocrawler.com/lists/3/SourceForge/597/0/6620124">posted</a> a nice diagnosis of them.
</li>
</ul>
</blockquote>
<a name="09-10-2001"><table width="100%" bgcolor="#e0e0e0">
<tr>
<td>
<b>
<font color="black">10 Sep 2001</font>
</b>
</td>
</tr>
</table>
<blockquote post="6593569">
Been playing with the tools and website lately. I added a bunch of
new <a href="http://www.geocrawler.com/lists/3/SourceForge/597/0/6589530">features</a> to the mconsole
client (and <a href="http://www.geocrawler.com/lists/3/SourceForge/597/0/6590956">promptly</a> had to
<a href="http://www.geocrawler.com/lists/3/SourceForge/597/0/6593569">fix</a> it), and fixed uml_net
building on 2.2.
<p>
I also restructured the web site build somewhat to make it more manageable.
</blockquote>
<a name="09-06-2001"><table width="100%" bgcolor="#e0e0e0">
<tr>
<td>
<b>
<font color="black">6 Sep 2001</font>
</b>
</td>
</tr>
</table>
<blockquote>
I tracked down the process segfault problem. It was caused by a newly
forked child inheriting some pages that were swapped out, but hadn't
been unmapped. The code that it ran on its first quantum didn't
update its address space correctly, so those pages remained mapped.
<p>
Having chased that problem down, I'm releasing 2.4.9-4um with that fix
plus Chris Emerson's latest ppc changes.
</blockquote>
<a name="09-01-2001"><table width="100%" bgcolor="#e0e0e0">
<tr>
<td>
<b>
<font color="black">1 Sep 2001</font>
</b>
</td>
</tr>
</table>
<blockquote>
After much ado, I revamped the UML
<a href="dl-sf.html">download page</a>. It
essentially replaces the Sourceforge project download page. I did
this in order to be able to let people select the mirror they want to
download from and to be able to put explanatory information on the same
page as the download link. If it is missing stuff that you'd like to
see, regardless of whether it's on the SF download page,
<a href="contacts.html">I'd like to know</a> about it.
<p>
There are a couple things that aren't working right now - the
'Changelog's don't link to anything, and most of the SourceForge root
filesystem links don't work. I'm in the process of copying the
filesystems over to SF to fix this.
<p>
It's now pretty trivial for me to add mirrors, so if you have a box
available (particularly if it's in a part of the world not
well-covered by the UML global mirror system),
<a href="contacts.html">let me know</a>.
</blockquote>
<a name="08-30-2001"><table width="100%" bgcolor="#e0e0e0">
<tr>
<td>
<b>
<font color="black">30 Aug 2001</font>
</b>
</td>
</tr>
</table>
<blockquote>
Thanks to what looks like an all-night debugging session on the part
of Yon Uriarte, the TUN/TAP backend now works. You'll need the latest
uml_net for this. It wasn't setting IFF_NO_PI, which was causing
extra cruft to be stuck on the front of the packet, which probably
required the broken nastiness I had to add to the driver. Adding that
and backing out all the skbuff fiddling made everything work a lot
better.
<p>
So, I released 2.4.9-3um with the fixed driver in it, plus new entries
in config.release, defconfig, and Configure.help.
</blockquote>
<a name="08-28-2001"><table width="100%" bgcolor="#e0e0e0">
<tr>
<td>
<b>
<font color="black">28 Aug 2001</font>
</b>
</td>
</tr>
</table>
<blockquote>
I implemented a TUN/TAP backend for the network driver. It involved
more work than I expected. A lot of it was due to restructuring other
code in order to keep the code relatively clean.
<p>
I haven't done any stessing or timing of it, but I did happen to
notice that pings over TUN/TAP are about 10x faster than pings over
ethertap. The absence of the helper handling each packet on the way
to the kernel is no doubt a big piece of that. At some point, I'll do
some bandwidth measurements against ethertap to see how much better it
is. Hopefully a lot.
</blockquote>
<a name="08-26-2001"><table width="100%" bgcolor="#e0e0e0">
<tr>
<td>
<b>
<font color="black">26 Aug 2001</font>
</b>
</td>
</tr>
</table>
<blockquote>
UML development took a bit of a break while I got busy with other
stuff.
<p>
In UML news, I started work on my ALS paper, got a first draft
ready, and sent it off for review. I also did a bunch of web site
work. I've been letting things fall behind for lack of time to deal
with them, so I decided to swallow my pride and start asking for
help. This necessarily involves describing what needs doing, so I
wrote most of it up, and the results are
<a href="help-gen.html">here</a>,
<a href="help-doc.html">here</a>,
<a href="help-userspace.html">here</a>,
<a href="help-kernel-v1.html">here</a>, and
<a href="projects.html">here</a>.
<p>
I also made a pass over the site, fixing a bunch of hopelessly
outdated and wrong things, and probably leaving some things which are
only moderately outdated and wrong.
</blockquote>
<a name="08-16-2001"><table width="100%" bgcolor="#e0e0e0">
<tr>
<td>
<b>
<font color="black">16 Aug 2001</font>
</b>
</td>
</tr>
</table>
<blockquote>
I've been having fun playing with crashme. It's a great little tool.
It generates buffers full of random data and then executes them. It
runs differently on UML than on the host, which it shouldn't. The
problems I've tracked down so far are signal handling bugs. UML
wasn't handling write faults correctly when the accessed memory was
readonly, and it wasn't properly segfaulting processes to which
signals couldn't be delivered (because their stack pointers were
garbage). This last was the bug I was chasing a couple days ago.
There are still problems. The first process (crashme +2000 666 100)
runs just as it does on the host, but the next one (crashme +2000 667
100) doesn't. On the host, the segfault handler somehow gets bus
errors in libc, which I don't understand, and that doesn't happen
under UML.
<p>
On IRC yesterday, Lennert Buytenhek clued me in on how to reliably
segfault processes and crash UML. He was running 8 "du /". That
didn't work for me, but 16 of them does. The segfaults are on pages
that are mapped in but shouldn't be (their ptes say that they should
be mapped out, and somehow that didn't happen). So, those pages were
presumably allocated for something else, and contain garbage from the
perspective of the process that should have unmapped them, and so it
segfaults.
<p>
The panic looks like memory corruption. I turned on slab debugging,
and it looks like that makes the panic go away.
<p>
Well, Linus released 2.4.9 today, so it's time for me to go into my
UML release routine. When I did the obligatory kernel build on 2.4.9,
one of the crashme fixes turned out to be bogus. It was doing the
segfault-during-signal-delivery check too early, so it caught fixable
segfaults that happened because the stack needed extending or was
readonly.
</blockquote>
<a name="08-14-2001"><table width="100%" bgcolor="#e0e0e0">
<tr>
<td>
<b>
<font color="black">14 Aug 2001</font>
</b>
</td>
</tr>
</table>
<blockquote>
2.4.8-2um is out as of yesterday. I made the freshmeat announcement
of 2.4.8 this morning.
<p>
I chased the crashme bug a little. Somehow, a signal is marked as
being pending, but it's never actually delivered and reset. So, no
further signals can be delivered to that process from then on. This
makes it unkillable and unstoppable.
<p>
I also took the first step towards making UML secure against nasty
users. UML physical memory, except for the task structure and kernel
stack, are protected from userspace access. I still need to protect the
task structure and kernel virtual memory. The task structure is a bit
tricky because of the signal delivery code. It runs on the process
stack and is considered to be userspace code. However, it needs to be
able to modify the task structure to restore state that it saved
before the signal delivery. So, if the task structure isn't writable,
this isn't possible. Further thought on the subject is necessary.
</blockquote>
<a name="08-13-2001"><table width="100%" bgcolor="#e0e0e0">
<tr>
<td>
<b>
<font color="black">13 Aug 2001</font>
</b>
</td>
</tr>
</table>
<blockquote>
Well, Linus released 2.4.8 just as I was heading up north for a
weekend of camping and climbing mountains. He does this on purpose.
He released 2.4.3 when I had just arrived in San Jose for the Kernel
Summit.
<p>
Anyway, this was a relatively simple patch. It just dropped in and
worked, except that hostfs was already broken. My calculation of the
stat64 inode field was wrong. It looked at the kernel version to
decide what was in the userspace headers. I discovered the error of
my ways when I booted up a Debian UML to produce the 2.4.8 .deb. This
is a 2.2 filesystem (with .st_ino in stat64) with a 2.4 kernel (which
implied .__st_ino in stat64). hostfs did not build. I changed the
Makefile to just grep the appropriate header instead.
<p>
So, this fix will be the substance of 2.4.8-2um.
</blockquote>
<a name="08-09-2001"><table width="100%" bgcolor="#e0e0e0">
<tr>
<td>
<b>
<font color="black">9 Aug 2001</font>
</b>
</td>
</tr>
</table>
<blockquote>
The remaining differences between my pool and the ac tree are a couple
of patches that didn't go in for some reason, cleanups of printks and
some includes.
<p>
Daemonizing UML does work. I just checked it, and the only case where
it does something strange is if you background it without nohupping it
and log out. The tracing thread dies from the SIGHUP, but all the
other threads survive.
<p>
I released 2.4.7-5um today. It contains a few recent patches from
other people. I figured out how to turn -fno-common back on. I tried
all kinds of linker tricks to throw errno.o out of the binary. Then I
discovered that the linking that had already taken place had destroyed
any notion of what objects anything originally came from. So,
instead, I added -Derrno=kernel_errno to all the kernelspace gcc
lines, which translates all the kernel uses of errno to kernel_errno,
and leaves the libc errno alone. That's actually a better solution
than throwing out one of the errnos because that would leave open the
possibility that the kernel and userspace uses of libc could step on
each other. Now that they're using different symbols, that's not a problem.
</blockquote>
<a name="08-07-2001"><table width="100%" bgcolor="#e0e0e0">
<tr>
<td>
<b>
<font color="black">7 Aug 2001</font>
</b>
</td>
</tr>
</table>
<blockquote>
Yesterday's patches are off to Alan.
<p>
In other news, daemonizing UML seems to be broken again. Grrr. That
seems to break now and then for no apparent reason.
<p>
ac9 is out with my patches in it. So, time to make the final diff
between Alan's stuff and mine to get him totally caught up with me.
</blockquote>
<a name="08-06-2001"><table width="100%" bgcolor="#e0e0e0">
<tr>
<td>
<b>
<font color="black">6 Aug 2001</font>
</b>
</td>
</tr>
</table>
<blockquote>
Yesterday's patches are in ac8. So, two more patches will bring the
ac tree completely up to date:
<ul>
<li name="2.4.7/net-8">
A <a href="ac-patches/2.4.7/net-8">network driver update</a> which
adds the ability for the drivers to tell the helper about any IP
address changes. This allows the host configuration (routing and
proxy arp) to stay in sync with the interface address changing inside
UML. If you're in the habit of getting UML from the ac tree, you'll
need the latest uml_net in order to use the network when this patch
goes in because it makes an incompatible change in the helper interface.
</li>
<li name="2.4.7/misc-8">
Another batch of (surprise!) <a href="ac-patches/2.4.7/misc-8">miscellaneous
fixes</a> , including some cleanup of stack permission setting, the
apparently gratuitous locals that are needed to pursuade -pg to work
properly, a couple of symbol exports for GFS, a fix that ensures that
the pid file contains the correct pid, and yet another squashed warning.
</li>
</ul>
With these in, I'll be able to diff the ac tree against mine to see
what divergences there are. I know there are some, because I
occasionally see patches fail to apply because of context conflicts
which shouldn't be there. So, there will be one more patch to clean
those up, and Alan will be completely in sync with me.
</blockquote>
<a name="08-05-2001"><table width="100%" bgcolor="#e0e0e0">
<tr>
<td>
<b>
<font color="black">5 Aug 2001</font>
</b>
</td>
</tr>
</table>
<blockquote>
Patch time again. This time I'm making them up ahead of ac7 coming
out. So, we have
<ul>
<li name="2.4.7/hostfs">
A <a href="ac-patches/2.4.7/hostfs">hostfs update</a> , which brings
the ac tree completely up-to-date. Normally, I bundle a couple of cvs
updates into a small number of patches and send them off to Alan.
With hostfs, I decided to give him the latest stuff, since there have
been a bunch of changes spread over a number of cvs updates. This is
fairly easy since hostfs is a completely self-contained piece of code.
</li>
<li name="2.4.7/net">
A <a href="ac-patches/2.4.7/net">network driver update</a> , which
fixes a crash and makes net devices pluggable via the mconsole.
There's some restructuring and cleanup in this patch. Also, mconsole
actions move into keventd context from softirq context. This is
because alloc_netdevice does a GFP_KERNEL kmalloc, which has to be
done in process context.
</li>
<li name="2.4.7/misc-7">
Yet another <a href="ac-patches/2.4.7/misc-7">batch of miscellaneous
fixes</a> , including renaming CONFIG_IOMEM to CONFIG_MMAPPER,
some cleanup in the ubd driver, and removal of a number of warnings.
</li>
<li name="2.4.7/ppc">
The <a href="ac-patches/2.4.7/ppc">complete merge of the ppc
port</a> , which reorganizes the headers somewhat. For some
headers, there are now header.h, which is a symlink to
header-$(SUBARCH).h, which includes header-generic.h and is allowed to
do whatever it wants before and after. This provides the flexibility
needed to do things like undef stuff after the include and rename
things beforehand.
</li>
</ul>
These all will bring Alan up to my 2.4.7 release, except for hostfs,
which will be completely up to date. Since I'm up to 2.4.7-4um, and
2.4.7-2um was just a hostfs fix, I might be able to bring the ac tree
up to date with one more set of patches.
<p>
Alan released ac7 this afternoon, as I prophesied, so those patches
are off to him. I'll be looking for them in ac8.
<p>
I failed to resist temptation. I looked at the diffs between the ac
tree once those patches are in and my current stuff and I noticed a
big wad of documentation. So, I rolled that up and sent it to Alan.
</blockquote>
<a name="08-04-2001"><table width="100%" bgcolor="#e0e0e0">
<tr>
<td>
<b>
<font color="black">4 Aug 2001</font>
</b>
</td>
</tr>
</table>
<blockquote name="2.4.7/build-5">
OK, I'm back in the business of sending Alan patches. I sent in a
<a href="ac-patches/2.4.7/build-5">small patch</a> which fixes the
things that broke when 2.4.7 came out. So, UML now builds and works in
the -ac tree again. It made 2.4.7-ac6 an hour or so after I sent it over.
<p>
Also, in the interest of getting the ac tree more caught up with my CVS, I
sent Alan a batch of fixes which bring him up to 2.4.6-4um:
<ul>
<li name="2.4.7/umid">
<a href="ac-patches/2.4.7/umid">umid fixes</a> from Henrik Nordstrom
which create a directory based on the umid rather than having that be
the pid file. The pid file and the mconsole socket are now in that
directory.
</li>
<li name="2.4.7/misc-6">
Another batch of <a href="ac-patches/2.4.7/misc-6">small fixes</a> -
a Makefile fix, mconsole cleanups and an update to create the socket in
the umid directory.
</li>
<li name="2.4.7/config">
Some <a href="ac-patches/2.4.7/config">config changes</a> , also
from Henrik Nordstrom. These change the network config names to be
more explicitly UML-specific. The config.in is also cleaned up so
that it resembles the i386 config more closely.
</li>
<li name="2.4.7/iomem">
Greg Lonnon's <a href="ac-patches/2.4.7/iomem">example iomem
driver</a> , plus a couple of generic UML fixes that were needed
in order to make it work.
</li>
<li name="2.4.7/uaccess">
A <a href="ac-patches/2.4.7/uaccess">uaccess fix</a> which required
a surprising amount of surgery to fix. The copy_{to,from}_macros
previously regarded a fault location of 0 as meaning that the copy has
succeeded without faulting. When the address passed into the kernel
was NULL, this of course broke badly. It had a very interesting
side-effect in the case I saw. After running the command that
exercised the bug, every command on the system started failing to
start because libc was corrupted. This was something of a
head-scratcher. I eventually figured out that I was causing the
command to open NULL, the fault went undetected, and the buffer that
was supposed to have had the filename copied into it had
the filename of libc in it from a previous use. So, libc was opened
for writing with fairly severe results.
</li>
</ul>
</blockquote>
<a name="08-03-2001"><table width="100%" bgcolor="#e0e0e0">
<tr>
<td>
<b>
<font color="black">3 Aug 2001</font>
</b>
</td>
</tr>
</table>
<blockquote>
The deb build problem turned out to be me accidentally redefining VERSION
in the upper layers of the build process. That value overrode a VERSION
in the kernel build, which resulted in a totally bogus KERNELRELEASE, which
confused a macro which tested it badly enough that it broke the build.
Simple to fix once I figured it out.
<p>
I discovered another hostfs bug on my way back from OLS. ls didn't work
and I found two bugs as a result. The easy one was that hostfs_readdir
was filling in the directory inode rather than the file inode for every
directory entry it passed back to vfs. This was fixed by having read_dir
pass the inode back up so it could be use to fill in the entry properly.
<p>
The more interesting one is that there was a source-incompatible change
made in the stat64 struct between 2.2 and 2.4. The st_ino field changed
its name to __st_ino and a new st_ino field was added at the end. The
inode appears in the same place (the st_ino/__st_ino field) making it
binary compatible. So, after changing to use the 2.4 field name (and
breaking hostfs on 2.2), I changed the hostfs build to figure out what
name to use and passing that in on the compile line to hostfs_user.c.
<p>
In other news, we (me, Rodrigo de Castro, and Livio Baldini Soares) have
decided that -pg support in gcc is broken in multiple ways. rcastro and
livio complained a couple weeks ago about UML's gprof support not working.
I finally had a look at it, and found that it was broken, but not in the
way they described.
<p>
UML crashed in a very inconvient place, and when I finally got in there
enough to figure out what was happening, it turned out that mcount was
segfaulting when it dereferenced ebp because ebp was NULL. The reason
for that turned out to be that in some procedures, mcount is absolutely
the first thing they do. Everything else calls mcount after the new
stack frame has been set up and ebp has a valid value in it (the old esp).
When the procedure is the main procedure for a thread, then ebp turns
out to be NULL.
<p>
The difference between the two sets of procedures seems to be that the
good ones have local variables and the bad ones don't. So, to work
around this bug, I added a useless, but non-optimizable, local to the
affected trampolines.
<p>
Having done that, rcastro and livio were still complaining about UML
crashing. So, I looked at it with rcastro using gdbbot (and livio did so
later and discovered the same thing). -pg was trashing edx for some
reason. A constant (which varies from procedure to procedure) is
dumped into it. This suggests that it's used for the profiling
bookkeeping somehow, but looking at the assembly, we don't see how.
mcount carefully pushes it and restores it, which is not typical of
something that is going to be used for something. The problem is that
FASTCALL procedures (which are regparam(3)) pass arguments in eax,
edx, and ecx. So, dumping this constant into edx trashes the second
argument to the procedure. A workaround for this bug would seem to be
to disable FASTCALL (and I guess that gprof support stopped working
when I enabled FASTCALL to fix a different bug).
<p>
I released 2.4.7-4um today. The main new thing is that you can change
the IP address of a ethertap eth0 device and the host configuration
will change to match. This required a bit of infrastructure which I
wanted for other reasons. The uml_net interface is now versioned,
which I've been meaning to do for a while. uml_net now goes away
cleanly when UML is killed messily. Before, it would hang around,
occupying the tap device, and when UML was rerun, the new uml_net
would emit non-intuitive error messages.
<p>
I also made hostfs build and run again on 2.2 with a bit of Makefile
hackery.
</blockquote>
<a name="07-28-2001"><table width="100%" bgcolor="#e0e0e0">
<tr>
<td>
<b>
<font color="black">28 Jul 2001</font>
</b>
</td>
</tr>
</table>
<blockquote>
That hostfs problem turned out to be different than I thought. Livio
Soares started chasing the problem and found that the hostfs_user
close_file didn't actually close anything. It took a pointer to a
file descriptor and closed the pointer (or at least tried to) rather
than the descriptor that it pointed to. Fixing that made hostfs
behave a lot better.
<p>
Having fixed that, I finished the page cache work for UML and it can
now successfully do the deb build through hostfs without getting the
md5sum mismatches it was getting before. Having said that, I've
started seeing a compilation problem when building UML through hostfs
that I don't get on the host.
<p>
On to OLS. My talk was in the second slot of the first day, which was
nice. It's good to get your talk over early so you can do the rest of
the conference without worrying about it. It went pretty well. I had
hoped to fit a demo in at the end, but the talk basically went the
full 90 minutes. So I did a real short watch-it-boot-up demo
afterwards while most of the crowd was filing out of the room.
<p>
There was a talk on porting Linux to the i-series IBM boxes (aka
AS-400) which was fairly interesting. They ported Linux/ppc to a
hypervisor running on OS-400, making it fairly similar to the UML
port, being a port to an OS rather than to bare hardware. Dave
Boucher, who gave the talk, made a number of comments comparing it to
UML, which was nice. He also grabbed me during lunch today to quiz me
about the COW ubd driver. It turns out that he can't do that so
easily because OS-400 doesn't have sparse files, so he can't drop
blocks down in the same location in the COW file as in the backing
file because that would allocate space. I suggested a block directory
instead of a bitmap at the beginning of the COW file and dropping
changed blocks down sequentially, but he seemed unconvinced for some
reason.
<p>
A number of people told me either they or people they knew were using
UML for various things. The FreeS/WAN project as a whole seems
extremely interested in UML for running tests on their stuff over a
virtual network. A PPPoE maintainer complained about the ethertap
transport not being intuitively obvious on 2.4. And there were a
bunch of other people who were less specific about what their interest
in UML was who were either using it or were intending to.
<p>
In other news, I discovered that the mcast network transport didn't
work when the box had no ethernet card in it. Being at OLS, I showed
this to Harald Welte and we stared at the code a bit, then asked Andi
Kleen about it. The underlying problem turned out to be that there was
no route to any multicast address because there was no interface on
the system that supported multicast. The fix seems to be to add
multicast support to the loopback device, preferably, and if that's
not possible for some reason, to the dummy device.
</blockquote>
<a name="07-22-2001"><table width="100%" bgcolor="#e0e0e0">
<tr>
<td>
<b>
<font color="black">22 Jul 2001</font>
</b>
</td>
</tr>
</table>
<blockquote>
2.4.7-1um is released. A change which made kernel threads sychronize with
the parent at startup caused a hang at boot. The cause was a long-standing
bug which caused initdata not to be shared between processes. Andrea
noticed the problem as well, and found the fix.
<p>
That bug was fixed and I released everything. I released it with a fairly
big hostfs problem that I didn't notice until the middle of the release
process. I changed how it opens and closes files, with the result that it
closes them later than it used to. So, it isn't too hard to get hostfs
very confused by running UML out of file descriptors.
</blockquote>
<a name="07-21-2001"><table width="100%" bgcolor="#e0e0e0">
<tr>
<td>
<b>
<font color="black">21 Jul 2001</font>
</b>
</td>
</tr>
</table>
<blockquote>
2.4.7 appeared yesterday. I'm looking it over to see what's new. One
interesting thing is that Alan is sending over some bits of UML which
change the generic kernel. These don't affect anything besides UML,
so they're harmless. On the other hand, they eliminate some generic
files from my patch, which is nice. It makes the UML patch appear
purer.
</blockquote>
<a name="07-16-2001"><table width="100%" bgcolor="#e0e0e0">
<tr>
<td>
<b>
<font color="black">16 Jul 2001</font>
</b>
</td>
</tr>
</table>
<blockquote>
Yesterday's patches are in 2.4.6-ac5. So, time to send in another
batch. This will get him up to my 2.4.6-2um. Today's batch contains
another batch of <a href="ac-patches/2.4.6/misc-6">
random fixes</a> and Greg Lonnon's
<a href="ac-patches/2.4.6/cow">ubd COW</a>
patch. See <a href="shared_fs.html">this
page</a> for more information on the ubd COW driver.
<p>
I also checked in all the userspace stuff, including the deb builder,
recent changes to the tools, and the website, which I hadn't checked
in for quite a while.
</blockquote>
<a name="07-15-2001"><table width="100%" bgcolor="#e0e0e0">
<tr>
<td>
<b>
<font color="black">15 Jul 2001</font>
</b>
</td>
</tr>
</table>
<blockquote>
Those two pesky patches finally made it to Alan OK and were included
in 2.4.6-ac4. This gets the ac tree up to 2.4.5-8um. The next batch
will bring him up to 2.4.5-10um. It includes a bunch of
<a href="ac-patches/2.4.6/misc-5">miscellaneous
fixes</a>, the first merge of the
<a href="ac-patches/2.4.6/iomem">iomem</a> patch,
and an <a href="ac-patches/2.4.6/mconsole-5">mconsole
update</a> which makes gdb and the ubd driver hot-pluggable and
runs mconsole stuff from a tasklet rather than inside the interrupt.
<p>
With some more symlink abuse, I merged the last of Chris Emerson's ppc
port patch.
</blockquote>
<a name="07-14-2001"><table width="100%" bgcolor="#e0e0e0">
<tr>
<td>
<b>
<font color="black">14 Jul 2001</font>
</b>
</td>
</tr>
</table>
<blockquote>
Two of the three patches I sent to Alan were broken again. However, I
figured out why. My devious little mail reader was breaking lines
when it sent out the mail, which was way too late for me to eyeball it
to make sure it wasn't messing up. Turning off this behavior results
in much better patches at the other end of the line.
<p>
I played with the UML .deb builder and got a workable .deb out of it.
I think I figured out why the process gets a checksum error at the
very end - it's on hostfs, and hostfs reads through the page cache,
but doesn't write through it. I'll have to check with a filesystem
guru on this, but it sounds right to me. Putting the process on a
normal block device results in good checksums.
</blockquote>
<a name="07-13-2001"><table width="100%" bgcolor="#e0e0e0">
<tr>
<td>
<b>
<font color="black">13 Jul 2001</font>
</b>
</td>
</tr>
</table>
<blockquote>
I put out a couple more patches. Highlights include
<ul>
<li>
Greg Lonnon's <a href="iomem.html">iomem</a> driver now
works
</li>
<li>
network devices can now be
<a href="mconsole.html#config">added to</a> and
<a href="mconsole.html#remove">removed</a> from a
running system via the <a href="mconsole.html">mconsole</a>
</li>
<li>
most of the ppc port is merged in
</li>
</ul>
</blockquote>
<a name="07-09-2001"><table width="100%" bgcolor="#e0e0e0">
<tr>
<td>
<b>
<font color="black">9 Jul 2001</font>
</b>
</td>
</tr>
</table>
<blockquote>
Thanks to Simon Blake, I tracked down an interesting bug last night.
The UML build turns off __i386__ in order to throw out some very
hardware-specific code that UML definitely doesn't want.
This also turns off the i386 definition of FASTCALL, which invokes an
in-register parameter passing convention that gcc supports. This
wouldn't be a problem, except that UML borrows code from the i386 port
which assumes that this convention is being used.
<p>
In the case that I was looking at, rw_down_write_failed() was getting
its semaphore address from the wrong place and using a random
userspace address as its semaphore. This could cause all kinds of
interesting side-effects, like kernel corruption from two threads
using two different random addresses as the same semaphore or process
memory corruption from the kernel writing semaphore stuff into its
memory. Hopefully, this fix will eliminate some of the strange
crashes that people ocassionally see with UML.
<p>
<a href="text/fastcall.txt">Here</a> is a more
detailed description of the bug and its side-effects.
<p>
I sent the two broken patches (the
<a href="ac-patches/2.4.6/mconsole">mconsole</a>
and <a href="ac-patches/2.4.6/64-bits">64-bit</a>
patches, see the 30 Jun 2001 entry for
descriptions) to Alan again. Hopefuly they aren't broken this time.
Also, I
<a href="ac-patches/2.4.6/build-2">fixed</a>
a few build problems that turned up lately.
</blockquote>
<a name="07-07-2001"><table width="100%" bgcolor="#e0e0e0">
<tr>
<td>
<b>
<font color="black">7 Jul 2001</font>
</b>
</td>
</tr>
</table>
<blockquote>
I integrated Greg Lonnon's ubd COW patch today. It allows multiple
UMLs to <a href="shared_fs.html">share a filesystem</a>
read-write by storing the changes in a
private file. This private file can be considered to overlay the
read-only shared file. All writes go into the private file, and reads
come from the private file if it has a valid block and from the shared
file if not.
<p>
This allows a huge savings in disk space for people running many UMLs
with large filesystems. It probably will help performance, since the
caching requirements on the host are similarly reduced.
</blockquote>
<a name="07-04-2001"><table width="100%" bgcolor="#e0e0e0">
<tr>
<td>
<b>
<font color="black">4 Jul 2001</font>
</b>
</td>
</tr>
</table>
<blockquote>
Two of the last three patches I sent Alan somehow got corrupted. I
suspect that what happened was I added spaces accidentally while
reading the patch in my mail composition window by trying to page it
with the space bar, then messed by the patch when deleting the
spaces. So, I'll send them in again.
<p>
Rik van Riel has been visiting for the last couple of days. He was in
Boston for Usenix, and was visiting
<a href="http://www.emc.com">EMC</a> and
<a href="http://www.missioncriticallinux.com">MCLX
</a> (where a number of my former coworkers from DEC now work)
after the show. Since I live a couple of hours north of Boston, I
invited him up. In doing so, I acquired the responsibility of getting
him to Logan airport at the same time that 2M people were going into
Boston to see the 4th of July fireworks and concert. I ended up
putting him on a bus that ran from outside the city straight to the
airport. I haven't heard anything from him since, so I suppose that's
good news.
<p>
2.4.6 was released last night. It turns out to be a piece of cake.
The well-known softirq fix is the only thing that needed changing. I
stuck that in, and it built and ran through my tests without a
problem. The patch is released, and I'll probably finish the rest
tomorrow.
</blockquote>
<a name="06-30-2001"><table width="100%" bgcolor="#e0e0e0">
<tr>
<td>
<b>
<font color="black">30 Jun 2001</font>
</b>
</td>
</tr>
</table>
<blockquote>
I sent Alan patches which will bring him up to 2.4.5-8um, which include:
<ul>
<li name="2.4.5/misc-22">
a collection of <a href="ac-patches/2.4.5/misc-22">small fixes</a> ,
including ^S/^Q support for the console, some ubd driver cleanups, and
the TASK_UNINTERRUPTIBLE fix
</li>
<li name="2.4.5/64-bits">
Lennert's reimplementation of the <a href="ac-patches/2.4.5/64-bits">64-bit
file support</a> - the first try used libc's magic support for
popping the 64-bit interfaces under the 32-bit names. That broke UML
modules badly. This version explicitly uses the 64-bit interfaces and
seems a lot healthier.
</li>
<li name="2.4.5/mconsole">
Lennert's <a href="ac-patches/2.4.5/mconsole">management
console</a> patch. This version has support for getting the
kernel version, halting and rebooting the system, and turning the
debugger on and off.
</li>
</ul>
<p>
Last night, the f00f bug was bugging me, so I fixed it. It turned out
that the tracing thread was routing SIGILL and SIGBUS incorrectly.
Fixing that causes f00f to SIGILL properly.
</blockquote>
<a name="06-29-2001"><table width="100%" bgcolor="#e0e0e0">
<tr>
<td>
<b>
<font color="black">29 Jun 2001</font>
</b>
</td>
</tr>
</table>
<blockquote>
I found and fixed the TASK_UNINTERRUPTIBLE hang last night. It turned
out to be caused by an interrupted write in the block driver. The
driver didn't check the return value, so didn't notice that an IO
request it sent to the IO thread didn't go anywhere. That shut down
the disk IO system, which ultimately results in the whole system being
deadlocked waiting for IO that's never going to happen.
<p>
That, plus a few other things, are checked in as 2.4.5-11um.
<p>
In other news, Bill Stearns, who's always looking for more devious
things to inflict on UML, happened across the
<a href="http://sourceforge.net/projects/ltp">
Linux Test Project</a>
and decided to run it on UML. UML did pretty well. There were three
failures, two of which also fail on the host. The other is the f00f
test, which causes UML to hang. I applied the obvious fix of relaying
SIGILL from UML to the process. That fixed the hang, but after a long
pause, the test's SIGILL handler apparently gets called twice.
</blockquote>
<a name="06-26-2001"><table width="100%" bgcolor="#e0e0e0">
<tr>
<td>
<b>
<font color="black">26 Jun 2001</font>
</b>
</td>
</tr>
</table>
<blockquote>
Those last two patches made it into ac19. Time to start thinking
about bringing the ac tree up to -7um.
<p>
I finally got Greg Lonnon's iomem match into UML. This allows a
process outside UML to communicate with one inside (or with a UML
driver) through a mmapped file.
<p>
I've also been chasing the TASK_UNINTERRUPTIBLE hang that a few people
have been seeing. It happens most easily under UML, apparently. I'm
using a recipe discovered by mistral to reproduce it (two infinite
loops each diffing two kernel pools). The longest it's taken to
reproduce is about 30 minutes. It hung on boot once. The others have
been in the 5-10 minute range.
<p>
I had a long chat with Al Viro last night with him telling me what he
wanted to see from gdb and me providing it. He ended up being puzzled
about what was happening. Following a suggestion from Daniel
Phillips, I've started instrumenting buffer_heads and pages to see
what happened to the ones involved in the hang.
</blockquote>
<a name="06-25-2001"><table width="100%" bgcolor="#e0e0e0">
<tr>
<td>
<b>
<font color="black">25 Jun 2001</font>
</b>
</td>
</tr>
</table>
<blockquote>
It's -ac patch time again. I boiled the -5um to -6um changes down to
two patches:
<ul>
<li name="2.4.5/misc-17">
a <a href="ac-patches/2.4.5/misc-17">miscellaneous fixes</a> which
adds some IP address sanity checking to the ethertap backend, fixes
a couple of process signal delivery races, cleans up the associated
thread data a little, fixes a swap bug (which caused swapped-out pages
to never be unmapped from their processes), and gets rid of the last
vestige of the mm_changes code.
</li>
<li name="2.4.5/timer">
a <a href="ac-patches/2.4.5/timer">timer</a> patch which attempts
to eliminate missing clock ticks by never disabling the timer and
keeps track of ticks which happen when it's not safe to call the timer
IRQ. This improves things, but it doesn't eliminate missing ticks
under load.
</li>
</ul>
</blockquote>
<a name="06-22-2001"><table width="100%" bgcolor="#e0e0e0">
<tr>
<td>
<b>
<font color="black">22 Jun 2001</font>
</b>
</td>
</tr>
</table>
<blockquote name="2.4.5/ac17-build">
Some time around ac16 or ac17, someone added a call to
linux_booted_ok() which the ports have to implement. So, I sent
<a href="ac-patches/2.4.5/ac17-build">the patch</a> to Alan today.
<p>
And a short bit later, I got a reply saying not to bother. The
linux_booted_ok thing was a temporary test that's going to be
removed. So, it won't appear in my pool, but if you absolutely want
to run the ac16/ac17 UML, apply that patch.
<p>
I spent the better part of the afternoon in IRC trying to figure out
the hang that mistral is seeing. No joy, but I did learn more about
the problem. I'll attack it again later.
</blockquote>
<a name="06-21-2001"><table width="100%" bgcolor="#e0e0e0">
<tr>
<td>
<b>
<font color="black">21 Jun 2001</font>
</b>
</td>
</tr>
</table>
<blockquote>
gdbbot got its first test yesterday when I looked at the problem that
Chris Emerson is having with UML/ppc hanging during boot. I didn't
find the problem, but was able to check that signal delivery (which
was what I thought was broken) was working fine. The next step will
be to do a post-mortem on the hang.
</blockquote>
<a name="06-20-2001"><table width="100%" bgcolor="#e0e0e0">
<tr>
<td>
<b>
<font color="black">20 Jun 2001</font>
</b>
</td>
</tr>
</table>
<blockquote>
I wrote a IRC gateway for gdb. This allows a gdb (like the UML kernel
debugger) to be controlled from an IRC channel. The intent is that if
someone sees a bug that I can't reproduce, but want to look at, that
person's UML gdb can be attached to an IRC channel where I can poke
around and see what's going on.
<p>
I also integrated Lennert's management console patch. This is a very
low-level interface to the kernel (like the i386 SysRq interface).
The main use for it right now is to hot-plug devices. At this point,
only the ubd driver and gdb support this. So, you can add and remove
block devices from your UML without having to reboot it. You can
switch gdb in and out the same way. I will also do the consoles,
serial lines, and network interfaces at some point as well.
</blockquote>
<a name="06-15-2001"><table width="100%" bgcolor="#e0e0e0">
<tr>
<td>
<b>
<font color="black">15 Jun 2001</font>
</b>
</td>
</tr>
</table>
<blockquote>
The two patches I sent to Alan yesterday are in 2.4.5-ac15. Alan
horribly mangled Harald Welte's name, unfortunately.
<p>
Today was a patch bashing day. I merged in a good number of the
patches in my queue.
<p>
Today was also the (extended) deadline for abstracts for ALS2001. So,
I sent one in. This is the most explicit that I've been so far about
my future development plans for UML. So, if you want to see how wierd
things are going to get, read all about it
<a href="text/als2001.txt">here</a>.
</blockquote>
<a name="06-14-2001"><table width="100%" bgcolor="#e0e0e0">
<tr>
<td>
<b>
<font color="black">14 Jun 2001</font>
</b>
</td>
</tr>
</table>
<blockquote>
IBM put out a
<a href="http://www-1.ibm.com/linux/news/LTCWhitepaper.shtml">
Linux security whitepaper</a>
in which UML gets a pretty lame mention (down towards the bottom, there's
some prose which is basically lifted from my site). Thanks to Bill Stearns
for spotting it.
<p>
I'm finally getting around to sending off the latest stuff to Alan. The
ac tree is now two cvs updates behind. The first set will be the -5um update,
which is basically
<ul>
<li name="2.4.5/mcast">
the <a href="ac-patches/2.4.5/mcast">mcast transport</a> plus some other
network cleanup
</li>
<li name="2.4.5/misc-13">
some <a href="ac-patches/2.4.5/misc-13">random fixes</a> , including an
updated defconfig, making the console xterms go away when the machine shuts
down, making a read-only hostfs really read-only, hooking up a couple of new
system calls, allowing UML to boot on hosts with a 2G/2G address space split
</li>
</ul>
</blockquote>
<a name="06-12-2001"><table width="100%" bgcolor="#e0e0e0">
<tr>
<td>
<b>
<font color="black">12 Jun 2001</font>
</b>
</td>
</tr>
</table>
<blockquote>
Banged out a bunch of bugs. I started booting UML with 24 megs and
plenty of swap, and running a whole bunch of stuff on it to overload
it and put it heavily into swap. This turned up a couple of signal
delivery races and a swapping bug. The signal races would cause
various strange behavior. Mostly what I saw was hangs with an
infinite sequence of sigreturns. The swap bug caused pages not to be
unmapped when they were swapped out. Obviously, this is very bad.
With the help of rcastro, I fiddled my page table macros to fix this.
I'm still seeing process segfaults. It looks like pages are being
swapped out and swapped back in with the wrong data.
</blockquote>
<a name="06-08-2001"><table width="100%" bgcolor="#e0e0e0">
<tr>
<td>
<b>
<font color="black">8 Jun 2001</font>
</b>
</td>
</tr>
</table>
<blockquote>
I fixed a bunch of buglets, like the console xterms not going away,
readonly hostfs not being readonly, merged Harald Welte's mcast
network transport, and a few other things, and checked them into CVS.
I also checked in the tools, so everything ought to be up-to-date and
consistent at this point.
<p>
I also have the .deb build procedure working, I think. The
uncertainty is due to the fact that I think there's a hostfs data
corruption problem. My development box runs Red Hat, and I couldn't
find RPMs for the Debian tools, so I just installed them in my Debian
filesystem (apt-get rocks, BTW :-), mount the source pool inside a
Debian UML via hostfs, and run the debian build procedure there. The
problem is that the gzipped source tarball has its md5sum recorded at
the beginning of the build and checked again at the end, and they
don't match. I also ran md5sum three times in a row on that file
while the builder was running, and got three different answers. So,
it looks like I have some debugging to do there.
</blockquote>
<a name="06-03-2001"><table width="100%" bgcolor="#e0e0e0">
<tr>
<td>
<b>
<font color="black">3 Jun 2001</font>
</b>
</td>
</tr>
</table>
<blockquote>
True to yesterday's promise, I sent Alan three more patches
<ul>
<li name="2.4.5/ethertap_mtu">
A <a href="ac-patches/2.4.5/ethertap_mtu">fix</a> for the ethertap driver
which fixes mishandling of large packets
</li>
<li name="2.4.5/segv">
More careful handling of <a href="ac-patches/2.4.5/segv">seg faults</a>
</li>
<li name="2.4.5/umn">
Deletion of the <a href="ac-patches/2.4.5/umn">old umn driver</a>
</li>
</ul>
</blockquote>
<a name="06-02-2001"><table width="100%" bgcolor="#e0e0e0">
<tr>
<td>
<b>
<font color="black">2 Jun 2001</font>
</b>
</td>
</tr>
</table>
<blockquote>
From the changelog, it looks like yesterday's patches are in ac7. Time to
start generating more...
</blockquote>
<a name="06-01-2001"><table width="100%" bgcolor="#e0e0e0">
<tr>
<td>
<b>
<font color="black">1 Jun 2001</font>
</b>
</td>
</tr>
</table>
<blockquote>
Another day, another set of patches for Alan. Today, the lucky winners are
<ul>
<li name="2.4.5/misc">
Some <a href="ac-patches/2.4.5/misc">cleanups</a> that I had missed before
</li>
<li name="2.4.5/ether">
Ethernet addresses passed in on the command line are no longer allowed to
be <a href="ac-patches/2.4.5/ether">broadcast addresses</a>
</li>
<li name="2.4.5/copy">
Chris Emerson's longjmp-based <a href="ac-patches/2.4.5/copy">user copy routines
</a>
</li>
<li name="2.4.5/hostfs">
Jorgen Cederlof's support for <a href="ac-patches/2.4.5/hostfs">device
nodes</a> in hostfs
</li>
<li name="2.4.5/ethertap">
A fixlet in the ethertap driver to <a href="ac-patches/2.4.5/ethertap">prevent
a hang</a> if the helper can't be execed
</li>
<li name="2.4.5/time">
Livio Soares' fix to <a href="ac-patches/2.4.5/time">allow the time to be
changed</a>
</li>
<li name="2.4.5/portable">
More <a href="ac-patches/2.4.5/portable">portability changes</a> to
generic and i386 code
</li>
<li name="2.4.5/ppc">
Almost all of the <a href="ac-patches/2.4.5/ppc">remaining ppc changes</a>
</li>
<li name="2.4.5/printk">
A big <a href="ac-patches/2.4.5/printk">printk cleanup</a> which attaches
KERN_* to most UML printks
</li>
</ul>
</blockquote>
<a name="05-30-2001"><table width="100%" bgcolor="#e0e0e0">
<tr>
<td>
<b>
<font color="black">30 May 2001</font>
</b>
</td>
</tr>
</table>
<blockquote>
Alan put yesterday's patch into ac5, so UML should build and run
again. Thanks to Arjan van de Ven for telling me about that.
</blockquote>
<a name="05-29-2001"><table width="100%" bgcolor="#e0e0e0">
<tr>
<td>
<b>
<font color="black">29 May 2001</font>
</b>
</td>
</tr>
</table>
<blockquote name="2.4.5/ac4-fixes">
It turns out that I messed up the patches somewhat. So, this is the
<a href="ac-patches/2.4.5/ac4-fixes">patch for ac4</a> . With it, UML
will build and run again.
</blockquote>
<a name="05-28-2001"><table width="100%" bgcolor="#e0e0e0">
<tr>
<td>
<b>
<font color="black">28 May 2001</font>
</b>
</td>
</tr>
</table>
<blockquote>
Alan apparently put all 10 of yesterday's patches in 2.4.5-ac3 (but
seems not to have dignified the added comment with a changelog entry).
<p>
I wrote up the new networking. Check it out
<a href="networking.html">here</a>.
</blockquote>
<a name="05-27-2001"><table width="100%" bgcolor="#e0e0e0">
<tr>
<td>
<b>
<font color="black">27 May 2001</font>
</b>
</td>
</tr>
</table>
<blockquote>
I got 2.4.5 merged in, and mostly released. I'll probably finish it and
announce it tomorrow.
<p>
I also synced up with Alan by sending him a whole pack of patches, to wit:
<ul>
<li name="2.4.5/ppc-merge">
Chris Emerson's <a href="ac-patches/2.4.5/ppc-merge">ppc changes</a>
</li>
<li name="2.4.5/new-network">
the new <a href="ac-patches/2.4.5/new-network">network drivers</a>
</li>
<li name="2.4.5/console_crash">
a fix for a <a href="ac-patches/2.4.5/console_crash">console crash</a>
caused by typing at it too soon
</li>
<li name="2.4.5/configs">
include and __SMP__ <a href="ac-patches/2.4.5/configs">cleanups</a>
</li>
<li name="2.4.5/hostfs-fixlets">
a few <a href="ac-patches/2.4.5/hostfs-fixlets">hostfs fixes</a> from Henrik
Nordstrom
</li>
<li name="2.4.5/more-portable">
some more <a href="ac-patches/2.4.5/more-portable">portability changes</a>
needed by Chris
</li>
<li name="2.4.5/irq-note">
a <a href="ac-patches/2.4.5/irq-note">note</a> to myself to fix something at
some point
</li>
<li name="2.4.5/syscall-cleanup">
some <a href="ac-patches/2.4.5/syscall-cleanup">system call cleanups</a>
from Roman Zippel
</li>
<li name="2.4.5/vm-hole">
a <a href="ac-patches/2.4.5/vm-hole">fix</a> for a crash caused by a hole
between UML's text and data
</li>
<li name="2.4.5/debugger-tweaks">
a couple of <a href="ac-patches/2.4.5/debugger-tweaks">debugger fixes</a>
</li>
</ul>
</blockquote>
<a name="05-26-2001"><table width="100%" bgcolor="#e0e0e0">
<tr>
<td>
<b>
<font color="black">26 May 2001</font>
</b>
</td>
</tr>
</table>
<blockquote>
I got the networking cleaned up enough that I'm happy for the general public
to use it. There are three host transports, ethertap, the routing daemon,
and slip. You can have the helper do the host setup for you or not. If you
do, then getting the network running is a matter of a command line switch,
ifconfiging the device, and setting routes inside UML. This is a huge
usability improvement over the previous situation.
<p>
This is all checked in, and I'm currently building 2.4.5, which I'll release
in the next day or two.
</blockquote>
<a name="05-18-2001"><table width="100%" bgcolor="#e0e0e0">
<tr>
<td>
<b>
<font color="black">18 May 2001</font>
</b>
</td>
</tr>
</table>
<blockquote>
I fixed the slip interface, cleaned out some unused code which had become
a portability problem, and fixed the fix for the crash caused by someone
typing at the console too soon. It is all checked in to CVS.
</blockquote>
<a name="05-17-2001"><table width="100%" bgcolor="#e0e0e0">
<tr>
<td>
<b>
<font color="black">17 May 2001</font>
</b>
</td>
</tr>
</table>
<blockquote>
I grabbed 2.4.4-ac11 to see if Henrik's patch was in there, and it was. So
I don't have to worry about it any more. I guess it made ac9, but Henrik
didn't get credit for it in the ac changelog.
<p>
In other news, the ethertap interface is working reasonably well. It couldn't
do HTTP until I figured out that the mtu on host tap device needed to be 16
bytes less than the UML eth0 mtu. The helper is now more helpful. In order
to talk to the rest of the world through it, you basically just have to
ifconfig the device inside UML and add a route to the outside world, and you're
done. Much better than what we had before.
</blockquote>
<a name="05-13-2001"><table width="100%" bgcolor="#e0e0e0">
<tr>
<td>
<b>
<font color="black">13 May 2001</font>
</b>
</td>
</tr>
</table>
<blockquote>
Five of yesterday's six patches made it into 2.4.4-ac9. The lonely exception
was Henrik's hostfs blocksize fix.
</blockquote>
<a name="05-12-2001"><table width="100%" bgcolor="#e0e0e0">
<tr>
<td>
<b>
<font color="black">12 May 2001</font>
</b>
</td>
</tr>
</table>
<blockquote>
I decided to clean out my patch backlog a bit. So, I merged and sent to Alan
the following patches:
<ul>
<li name="2.4.4/makefiles">
most of Roman Zippel's <a href="ac-patches/2.4.4/makefiles">Makefile
cleanup</a> , minus some bugs and some unistd.h stuff that I want to
look at more carefully
</li>
<li name="2.4.4/portable">
Chris Emerson's <a href="ac-patches/2.4.4/portable">portability changes</a>
to generic code and i386 code
</li>
<li name="2.4.4/rz-clean">
a bunch of <a href="ac-patches/2.4.4/rz-clean">non-Makefile cleanups</a>
from Roman Zippel
</li>
<li name="2.4.4/hostfs-blocksize">
Henrik Nordstrum's
<a href="ac-patches/2.4.4/hostfs-blocksize">one-line fix</a>
that allows root hostfs to work when something has changed the ubd block size
</li>
<li name="2.4.4/starting_exec">
the <a href="ac-patches/2.4.4/starting_exec">removal of
thread.starting_exec</a> ,
which was ancient history, is now longer needed, and was causing hangs under
heavy load
</li>
<li name="2.4.4/stack-race">
a <a href="ac-patches/2.4.4/stack-race">fix for a race</a> while getting
the stack snapshot - this was seen on SMP boxes because the child gets to run
sooner than on a UP box
</li>
</ul>
</blockquote>
<a name="05-11-2001"><table width="100%" bgcolor="#e0e0e0">
<tr>
<td>
<b>
<font color="black">11 May 2001</font>
</b>
</td>
</tr>
</table>
<blockquote post="5732981">
Chris Emerson got UML/ppc booting to a shell prompt! His uml-devel post
is <a href="http://www.geocrawler.com/lists/3/SourceForge/709/0/5732981">here</a> . This is the first UML port,
and it showed me how to make UML portable. There aren't really all that many
non-portable things in UML, so a port doesn't take all that much code. Based
on his work, I'm going to write up a UML porting guide, which will be found
<a href="arch-port.html">here</a> when it's done. If that
link is dead, keep trying until I have something to put there.
<p>
In other news, I fiddled the ethertap driver backend so that the read hang
has gone. With some help from Bill Stearns, I also figured out how to talk
to the rest of my network through the ethertap device.
</blockquote>
<a name="05-9-2001"><table width="100%" bgcolor="#e0e0e0">
<tr>
<td>
<b>
<font color="black">9 May 2001</font>
</b>
</td>
</tr>
</table>
<blockquote>
I got the ethertap backend to the network driver working today and I
submitted it to <a href="http://sourceforge.net/cvs/?group_id=429">CVS</a> . I haven't been able to get it
to talk to anything but the host over the tap device, but it communicates
with the host just fine.
</blockquote>
<a name="05-4-2001"><table width="100%" bgcolor="#e0e0e0">
<tr>
<td>
<b>
<font color="black">4 May 2001</font>
</b>
</td>
</tr>
</table>
<blockquote>
My 2.4.4 fixes, except for Andrew Morton's exitcall fix, are in 2.4.4-ac3.
<p>
I wrote and submitted my OLS paper yesterday, two days late. It's also
posted on this site, as <a href="ols2001.tex">TeX</a>
and <a href="slides/ols2001/index.html">HTML</a>
<p>
On the network driver front, I've got the unified front-end plus the slip
back-end working. I've started working on the ethertap back-end. After that
will come the socket and TUN/TAP back-ends. This stuff is in CVS, but I
haven't updated the patch because the ethernet driver is broken, and I don't
want a bunch of complaints from people who grabbed the latest patch without
knowing what was in it.
<p>
Update: Andrew's patch made it into 2.4.4-ac5. I was beginning to wonder.
That cleans out my pending ac patches.
</blockquote>
<a name="04-28-2001"><table width="100%" bgcolor="#e0e0e0">
<tr>
<td>
<b>
<font color="black">28 Apr 2001</font>
</b>
</td>
</tr>
</table>
<blockquote name="2.4.4/exitcall">
Linus released 2.4.4 yesterday, so I released the 2.4.4 UML today. No major
changes - I dropped in the semaphore changes I was keeping in my ac tree, and
I <a href="ac-patches/2.4.4/pgd_alloc">added an mm argument to
pgd_alloc()</a> .
When I built the RPM (which uses a
different configuration), I noticed that
<a href="ac-patches/2.4.4/blocksize">hostfs didn't compile any more</a> , and
<a href="ac-patches/2.4.4/attach">UML didn't compile with CONFIG_PT_PROXY turned
off</a> . These fixes aren't in CVS or the patch yet.
<p>
Those changes, plus <a href="ac-patches/2.4.4/exitcall">Andrew Morton's exitcall
fix</a> , are off to Alan.
</blockquote>
<a name="04-27-2001"><table width="100%" bgcolor="#e0e0e0">
<tr>
<td>
<b>
<font color="black">27 Apr 2001</font>
</b>
</td>
</tr>
</table>
<blockquote post="5641552">
The last batch of patches I sent to Alan made it into ac14.
<p>
I started looking at the two network drivers today. I think it won't
be too hard to merge them. They're pretty similar, since they're both
derived from the same code base, and the differences seem to be
orthogonal. They don't seem to have done the same things in
fundamentally different ways. I <a href="http://www.geocrawler.com/lists/3/SourceForge/709/0/5644151">posted</a>
my impressions for the devel list to comment on.
<p>
Andrew Morton looked at the shutdown crash that
<a href="http://www.geocrawler.com/lists/3/SourceForge/597/0/5611967">people</a>
<a href="http://www.geocrawler.com/lists/3/SourceForge/709/0/5633700">started</a>
<a href="http://www.geocrawler.com/lists/3/SourceForge/709/0/5634016">seeing</a>
lately and <a href="http://www.geocrawler.com/lists/3/SourceForge/709/0/5641389">figured out</a> that it
was caused by /proc being unregistered before something else tried to
remove its proc entries when it was unregistered. He sent in a patch
which reversed the __exitcall order, and Henrik Nordstrom
<a href="http://www.geocrawler.com/lists/3/SourceForge/709/0/5641552">reported</a> that it fixed the
crash for him.
</blockquote>
<a name="04-22-2001"><table width="100%" bgcolor="#e0e0e0">
<tr>
<td>
<b>
<font color="black">22 Apr 2001</font>
</b>
</td>
</tr>
</table>
<blockquote post="5599515" name="2.4.3/build-ac12">
The fixes I made on Thursday were broken. The initrd fix
<a href="http://www.geocrawler.com/lists/3/SourceForge/597/0/5603373">introduced a name clash</a> with a
function in hostfs, and the sleep fix made
<a href="http://www.geocrawler.com/lists/3/SourceForge/709/0/5599515">sleep always hang</a> . I
didn't notice because I was fixated on getting UML to boot from an initrd
image, and that wasn't obviously showing the problem.
<p>
Anyhow, I made the fixes, submitted them to CVS, updated the patch, and sent
fixes off to Alan. I hadn't sent in Thursday's changes to Alan, so the
patches are the real thing, not just patches to the patches.
<p>
The patches sent off to Alan today
<a href="ac-patches/2.4.3/initrd">add initrd support
</a> , <a href="ac-patches/2.4.3/timer">fix the sleep bug</a> , and
<a href="ac-patches/2.4.3/build-ac12">make UML build and work with the generic rw
semaphores</a> .
</blockquote>
<a name="04-18-2001"><table width="100%" bgcolor="#e0e0e0">
<tr>
<td>
<b>
<font color="black">18 Apr 2001</font>
</b>
</td>
</tr>
</table>
<blockquote>
The patches I sent in a couple days ago are all in ac10 by the looks of
Alan's change log.
<p>
I figured out how initrd support is supposed to work, and implemented the
necessary stuff in UML. I booted a RH initrd image far enough to convince
myself that it works.
<p>
I also figured out the sleep hang. It turns out to be a race between the
registration of the timer irq and the first time the timer interrupt calls
do_IRQ. The timer was enabled before the registration, so if an interrupt
happened in that window, do_IRQ would bail out early, leaving the irq
permanently marked as in progress and pending. This locked out all future
timer interrupts from going through the irq system, so counters would never
be decremented, and sleeps would never wake up.
</blockquote>
<a name="04-17-2001"><table width="100%" bgcolor="#e0e0e0">
<tr>
<td>
<b>
<font color="black">17 Apr 2001</font>
</b>
</td>
</tr>
</table>
<blockquote name="2.4.3/umn">
The UML build fixes made ac6. However, the rw semaphores in ac7 broke UML
again. I sent Alan the <a href="ac-patches/2.4.3/build-ac7">fix</a>
for that yesterday, and it made ac9 later in the
afternoon. I also sent a few other patches which
<a href="ac-patches/2.4.3/gcov">fix
the gcov and gprof support</a> ,
<a href="ac-patches/2.4.3/debugger">add support
for external debuggers</a> , and
<a href="ac-patches/2.4.3/umn">clean up the umn
driver a bit</a> .
</blockquote>
<a name="04-12-2001"><table width="100%" bgcolor="#e0e0e0">
<tr>
<td>
<b>
<font color="black">12 Apr 2001</font>
</b>
</td>
</tr>
</table>
<blockquote>
They didn't make -ac5. Oh well.
<p>
I had a chat on <a href="http://kernelnewbies.org">#kernelnewbies</a>
with Rodrigo de Castro, who's using UML
for his <a href="http://tutu.ime.usp.br/index.html">compressed
caching</a> project. He understands swapping better
than I, and told me why my new pte bits were breaking it. So, I fixed
it, and swapping now seems to work.
</blockquote>
<a name="04-11-2001"><table width="100%" bgcolor="#e0e0e0">
<tr>
<td>
<b>
<font color="black">11 Apr 2001</font>
</b>
</td>
</tr>
</table>
<blockquote name="2.4.3/build">
Sent Alan the <a href="ac-patches/2.4.3/build">patches</a> necessary
for UML to build and run in his tree.
I got back a reply which said in its entirety, "ok", which I think is good.
Maybe they will make -ac5.
</blockquote>
<a name="04-10-2001"><table width="100%" bgcolor="#e0e0e0">
<tr>
<td>
<b>
<font color="black">10 Apr 2001</font>
</b>
</td>
</tr>
</table>
<blockquote>
UML is now in 2.4.3-ac4. I was on IRC with Alan and a bunch of other
hackers when he merged it. He looked like he was going to start
asking a bunch of embarassing questions about my locking, but he was
concerned only about one thing, and that was a special case that
didn't need locking.
<p>
Too bad it doesn't build. The patch that Alan merged was against the
Linus 2.4.3 tree, which differs in a few respects from the current -ac tree.
</blockquote>
<a name="04-8-2001"><table width="100%" bgcolor="#e0e0e0">
<tr>
<td>
<b>
<font color="black">8 Apr 2001</font>
</b>
</td>
</tr>
</table>
<blockquote>
Released 2.4.3 a week or so late. Blame Linus for releasing it the
night before the kernel summit officially started. We were all in San
Jose and not able to react.
</blockquote>
<a name="04-4-2001"><table width="100%" bgcolor="#e0e0e0">
<tr>
<td>
<b>
<font color="black">4 Apr 2001</font>
</b>
</td>
</tr>
</table>
<blockquote>
A couple more summit tidbits that I forgot to mention in my last entry:
<ul>
<li>
Willy is thinking about using UML as a testbed for NUMA support. He
wants to fire up a number of virtual machines and have them hook
themselves together so they can access each other's memory through
device files. This would allow people who don't have access to the
fancy hardware to develop and debug Linux support for these boxes.
</li>
<li>
UML may appear in the -ac trees at some point. He wanted to include it, but I
had sounded fairly negative towards that in the past. What I don't
want just yet is for UML to hit the Linus tree. Alan said he doesn't
send stuff to Linus if the author doesn't want it sent, which is fine
by me.
</li>
</ul>
</blockquote>
<a name="04-02-2001"><table width="100%" bgcolor="#e0e0e0">
<tr>
<td>
<b>
<font color="black">2 Apr 2001</font>
</b>
</td>
</tr>
</table>
<blockquote>
Back from the kernel summit. I wanted to get a feel for whether four
things that I wanted from the host kernel were reasonable. I got two
OKs and two dings. That's fine, since the OKs were the important
ones. Here's the run-down:
<ul>
<li>Userspace manipulation of address spaces : I want to be able to
create, populate, release, and switch between mm_structs. This will
speed up UML context switches, and greatly clean up that code. I
asked Linus, and he said OK to the fairly static things that I want to
do. Apparently, there are serious complications when fiddling with the
address space of another process, but that's not what I want to do.
</li>
<li>System call interception via signals : In order to avoid the
context switching between threads involved in virtualizing a system
call, I want to have a process intercept its own system calls by
having the host kernel deliver a signal whenever it makes a system
call. The handler would be the current syscall_handler, which would
read the arguments from its sigcontext_struct. This would change a
system call virtualization from four context switches to a signal
delivery and return. I infer Alan's OK on this from my describing it
in his presence and him not objecting.
</li>
<li>Notification when a UML thread sleeps in the kernel due to a
page fault : For the sake of cleanliness and completeness, I want to
be able to have UML know when a thread is sleeping in the kernel and
be able to call schedule when that happens. This would let UML do as
much work as possible given its state of memory residence. Alan
rejected this on the grounds that UML would be the only sane user of
this mechanism.
</li>
<li>Full kernel preemption : This was implicitly rejected as a UML
need by Alan's rejection of the previous item. If UML is to call
schedule whenever it sleeps, the whole kernel needs to be preemptible
because the swapped-out page might be a kernel page. This doesn't at
all mean that preemption isn't going to happen. Rather, it means that
UML doesn't have a particular need for it.
</li>
</ul>
Other tidbits:
<ul>
<li>A number of people consider UML a very neat hack, including Ben
Lahaise, Andrea Arcangeli, and Eric Raymond.
</li>
<li>Alan turns out to be a UML user. For the last month or so, he's
been booting his kernels as UML kernels before booting them as native
kernels. This is in part because recovery from a totally messed up
kernel is a lot easier with UML than with a native kernel. UML is
also his ptrace test case. It apparently does things with ptrace that
nothing else tries.
</li>
<li>Al Viro is thinking about porting UML to Plan 9. He asked me
about what it would take. He had thought through the ptrace
requirement, and I told him about the mmap requirement, which is the
next hurdle. Plan 9 apparently doesn't have mmap. He's going to
think about how to do that.
</li>
</ul>
<p>On the trip over, I did some debugging, and I also threw in some
patches. There is now a "umid=<name>" switch for providing a virtual
machine with an identifier. This causes a pid file to be created
using that name, which is something that makes controlling multiple
UMLs through a nice UI a lot easier. This file will be replaced with
a socket to the machine console that Lennert is working on.
<p>I also implemented __exitcall, which declares a procedure which is
to be called on machine shutdown. This was prompted by the need to
remove the pid files when the virtual machine goes away. I also
converted other existing cleanups to use this mechanism.
</blockquote>
<a name="03-25-2001"><table width="100%" bgcolor="#e0e0e0">
<tr>
<td>
<b>
<font color="black">25 Mar 2001</font>
</b>
</td>
</tr>
</table>
<blockquote>
I checked in a bunch of changes again. Henrik Nordstrom provoked me into
making it possible to use hostfs as a root directory by sending me a patch
that did it, but which was wrong (IMHO). He did it in the same way that
nfsroot and initrd support is done, which is by adding a special block of
code to fs/super.c inside CONFIG_HOSTFS_ROOT. That works fine, but I didn't
want to annoy Al Viro. What I did instead was to add a second registration
of hostfs as a device (not a virtual) filesystem and change the ubd driver
to support being given a directory rather than a file or block device. What
happens is that when a read request comes in to the ubd driver, it is
guaranteed to be a request for the superblock. The driver constructs a fake
superblock with the directory name in it. hostfs recognizes that and claims
the mount as its own. After that, it goes back to being a normal virtual
filesystem and doesn't bother the block driver again. The involvement of the
ubd driver is a bit of a kludge, but it works well on the command line, and I
can't think of anything better besides some kind of general support for
virtual root filesystems that cover nfs and initrd as well as hostfs.
<p>
There were also a number of patches from other people: Lennert Buytenhek's
modify_ldt patch, a bunch from Greg Lonnon, one from Gordon McNutt, and
a buffer overrun patch from Henrik Nordstrom.
</blockquote>
<a name="03-23-2001"><table width="100%" bgcolor="#e0e0e0">
<tr>
<td>
<b>
<font color="black">23 Mar 2001</font>
</b>
</td>
</tr>
</table>
<blockquote>
I spent a few days fixing the infinite recursive context switch bug. That
was a lot more complicated than I expected. The fix involved replacing the
shadow page tables that represent the mappings on the host for each process
with bits in the pte that say whether it is up-to-date or not. These bits
are set in the little functions that change ptes and cleared in fix_range
after it's updated the mappings. Since the process page tables are per-mm
and not per-process, a mapping that was changed in a multi-threaded process
would only be updated for one of the threads. This meant that UML processes
that share a memory context also need to share a memory context on the host.
This in turn complicated exec, since it now needs to create a new host process
in order to get out of a shared UML address space. I implemented this a few
times, and on about the third try, I got something that works.
<p>
So, aside from eliminating a nasty bug, this also makes the modify_ldt fix
more useful, since it now should work properly without any extra code, and
opens the way to more efficient context switching between threads, since they
won't have to go through the remapping that processes need.
</blockquote>
<a name="03-18-2001"><table width="100%" bgcolor="#e0e0e0">
<tr>
<td>
<b>
<font color="black">18 Mar 2001</font>
</b>
</td>
</tr>
</table>
<blockquote>
Lots of bugs have been fixed. I got a little list of hostfs
complaints from Al Viro, which I think I fixed. hostfs is now pretty
solid. I fixed the naming problem which cropped up if you held a file
open, then moved its directory and accessed that file by its new
name. You'd get 'file not found'. This is because I stored the full
host pathname in the inode, and when you changed its name while
holding it open by the old name, the inode continued to contain the
old bogus name. This was fixed by having anything that needs a
filename walk the dentry tree back up to the root, constructing the
current filename. The other major problem was that readdir didn't
work, resulting in missing files when a directory was copied. These
are fixed. What remains is to get rid of some interfaces which will
complain about not being implemented.
<p>
The signal delivery race is fixed. That induced me to clean up a lot
of old, crufty code in the kernel entry and exit paths. That's
sensitive code, and a few bugs in it caused some very selective and
very strange behavior.
<p>
I've put together an RPM for UML just in time for the April Linux
Magazine to hit the streets with my article in it. This is good,
because the article claims that RPMs are available, which they weren't
at the time that I wrote it. This also goes some way towards
simplifying the network mess. The RPM installs the umn_helper, which
lets the umn device run without any help from the user. It also
installs the eth tools, which are otherwise hard to find unless you
pull them from cvs.
</blockquote>
<a name="02-25-2001"><table width="100%" bgcolor="#e0e0e0">
<tr>
<td>
<b>
<font color="black">25 Feb 2001</font>
</b>
</td>
</tr>
</table>
<blockquote>
CVS update today. I fixed a few bugs and cleaned up a bunch of
things.
<p>
I've started keeping an up-to-date TODO list. This will help
me not forget anything important. I post it to the -devel list
occasionally to prompt people to send in whatever gripes they have.
</blockquote>
<a name="02-24-2001"><table width="100%" bgcolor="#e0e0e0">
<tr>
<td>
<b>
<font color="black">24 Feb 2001</font>
</b>
</td>
</tr>
</table>
<blockquote>
I'm releasing 2.4.2 today. It has a number of bug fixes and no
significant functionality changes.
<p>
A number of bugs have cropped up lately. The most significant is a
race when a process signal handler returns. There is a narrow window
in which an interrupt can cause a crash. The fix is to implement
sigreturn like the other arches and run almost all of the kernel code
on the kernel stack rather than the process stack as I'm doing now.
</blockquote>
<a name="02-08-2001"><table width="100%" bgcolor="#e0e0e0">
<tr>
<td>
<b>
<font color="black">8 Feb 2001</font>
</b>
</td>
</tr>
</table>
<blockquote>
I managed to reproduce a number of panics and fixed all but one of
them. The key was hitting UML with a high-concurrency ab run with
requests that fire off perl scripts which make mySQL requests, with
not too much memory, so that it is at least starting to swap.
<p>This reproduced two bugs, one was caused by a failed memory
allocation in the middle of setting up a tracing thread request. The
failure caused a schedule, which caused a switch request, which blew
away the first, partially-set-up request. When the process was
rescheduled, its request was garbage, confusing the tracing thread
into detaching it. This was fixed by moving the allocation to before
the request started being set up.
<p>
The other one, which isn't fixed yet, is caused by the shadow page
tables maintained by arch/um/kernel/tlb.c. It occasionally needs to
allocate a page table when it sets up ptes for a new range of memory.
However, if the context switch that it's dealing with was forced by
low memory, then that allocation will fail, causing a recursive
context switch, and recursion continues until either the stack guard
page is hit, or, in the case of a kernel thread, the task structure is
polluted. I'm going to fix this by following a suggestion by prumpf,
which is to use some spare bits in the pte rather than a separate page
table to figure out what parts of the address space need updating.
<p>
And, panic number three, which is also fixed, was caused a faulty
notion of when a thread is in kernel space. The old way was to look
at whether the thread is being traced. That fails when a breapoint
was put in a signal handler before it requested that tracing be turned
off. The fix is to look at the current stack pointer. However, that
causes problems when a signal is being delivered to a process. In
this case, there is kernel code running on the process stack. So, a
flag was added to the thread structure when this is happening.
</blockquote>
<a name="01-29-2001"><table width="100%" bgcolor="#e0e0e0">
<tr>
<td>
<b>
<font color="black">29 Jan 2001</font>
</b>
</td>
</tr>
</table>
<blockquote>
Back from Sydney. The talk went pretty well, it was well attended,
and there was a fair amount of interest in UML there. Rik van Riel
and I wandered around Syndey until the following Friday.
<p>The slides from my talk are available
<a href="slides/lca2001/lca.html">
here</a>.
<p>While I was in .au, my OLS paper proposal was accepted, so it
looks like I'll be doing my song and dance in Ottawa this summer.
</blockquote>
<a name="01-03-2001"><table width="100%" bgcolor="#e0e0e0">
<tr>
<td>
<b>
<font color="black">3 Jan 2001</font>
</b>
</td>
</tr>
</table>
<blockquote>
Updated the web site with a couple pages describing hostfs and the new
console/serial line input specification.
<p>
The hostfs memory corruption problems are fixed. slab debug found
them for me. They turned out to be two string buffer overrun bugs.
I'll release a patch with the fixes pretty soon.
</blockquote>
<a name="01-01-2001"><table width="100%" bgcolor="#e0e0e0">
<tr>
<td>
<b>
<font color="black">1 Jan 2001</font>
</b>
</td>
</tr>
</table>
<blockquote>
I released the uml patch for 2.4.0-prerelease. You can find it
<a href="ftp.nl.linux.org:/pub/uml/uml-patch-2.4.0-prerelease.bz2">here</a>.
I'm going to make the full release tomorrow, hopefully after fixing
the hostfs crash and getting socket inputs to work.
<p>
Today is the deadline for a first draft of my Linux Magazine article
and for OLS paper proposals. I sent them both in last night. We'll
see what happens.
</blockquote>
<a name="12-27-2000"><table width="100%" bgcolor="#e0e0e0">
<tr>
<td>
<b>
<font color="black">27 Dec 2000</font>
</b>
</td>
</tr>
</table>
<blockquote>
hostfs now pretty much works. I built UML from inside itself on
hostfs. I fixed some bugs in the write code, added enough mmap
support to run binaries from hostfs, and implemented statfs. However,
there is some as-yet explained memory corruption going on.
<p>
In an attempt to reproduce the MySQL problems that a couple people are
seeing, I moved some of my work, which is heavy on MySQL and perl,
into UML. I've seen no problems, which is disappointing because I'm
not any closer to finding the bug, but also nice because it shows that
it's possible to do real work inside it.
<p>
I've also been banging on the ethernet driver trying to reproduce the
server buffer overflow that I saw earlier. No dice there either.
<p>
The swapoff bug is now fixed. It turned out to be a bad idea to give
kernel threads both a non-NULL mm and active_mm. That code has been
that way for ages. I have no idea when or why it became a bad thing.
</blockquote>
<a name="12-09-2000"><table width="100%" bgcolor="#e0e0e0">
<tr>
<td>
<b>
<font color="black">9 Dec 2000</font>
</b>
</td>
</tr>
</table>
<blockquote>
hostfs is now almost all working. mknod doesn't work, and you can't
run binaries out of a hostfs filesystem.
<p>
I also fixed that pesky linking failure that people have seen seeing
sporadically for a while. I noticed that profiling was turned
on in the latest case that showed up in my inbox. I did a profiling
build of my own and lo! it failed to link. Since I could reproduce
it, I was out of excuses for not fixing it, and so I did. You can see
a full explanation of the problem
<a href="http://www.geocrawler.com/lists/3/SourceForge/597/0/4805000/">here
</a>.
<p>
Those changes plus a couple of smaller ones are now in CVS. They
aren't in the latest patch because the SourceForge upload system has
been seriously b0rked. I'll update the patch when I can.
</blockquote>
<a name="12-07-2000"><table width="100%" bgcolor="#e0e0e0">
<tr>
<td>
<b>
<font color="black">7 Dec 2000</font>
</b>
</td>
</tr>
</table>
<blockquote>
I fixed the known bugs in the block driver. The
<blockquote>
<tt>
<font color="#000000">
dd if=/dev/ubd/0 of=/dev/null
</font>
</tt>
</blockquote>
hang was due to the driver returning to the block layer rather than
continuing to process the queue when it found an out-of-range I/O
request. The dbench corruption was due to the elevator rearranging
the request queue while a request was in flight. When that request
finished, the interrupt handler was supposed to retire it by removing
it from the head of the queue. The problem is that the elevator put
some other request at the head, and that request was retired without
ever being done. Meanwhile, the original request was pushed back in
the queue somewhere, and it got done twice.
<p>
Dan Aloni has started the Windows port. He got most of the
kernel to compile. There are a number of undefined symbols from files
that don't compile yet. Overall, though, it's looking pretty good.
</blockquote>
<a name="11-30-2000"><table width="100%" bgcolor="#e0e0e0">
<tr>
<td>
<b>
<font color="black">30 Nov 2000</font>
</b>
</td>
</tr>
</table>
<blockquote>
I updated the site a little. The major changes involved the "ARCH=um"
build change. The
<a href="compile.html">compilation</a>
page is now
very explicit about that and there's a
<a href="faq.html">FAQ</a>
entry for it.
<p>
I fixed up the block driver a little. In the past, if you did
<blockquote>
<tt>
<font color="#000000">
dd if=/dev/ubd/0 of=/dev/null
</font>
</tt>
</blockquote>
when it ran off the end of the device, it could apparently hang. This
is fixed. The problem with dbench is not fixed, but I made the
driver's synchronous mode accessible from the command line with the
"ubd=sync" switch. In sychronous mode, the driver has no problems
with dbench.
</blockquote>
<a name="11-18-2000"><table width="100%" bgcolor="#e0e0e0">
<tr>
<td>
<b>
<font color="black">18 Nov 2000</font>
</b>
</td>
</tr>
</table>
<blockquote>
I've got hostfs starting to work reasonably. ls now works, you can cd
around and cat things. You can't write anything, create files, or
execute them yet.
</blockquote>
<a name="11-17-2000"><table width="100%" bgcolor="#e0e0e0">
<tr>
<td>
<b>
<font color="black">17 Nov 2000</font>
</b>
</td>
</tr>
</table>
<blockquote>
After a bit of a hiatus, I did a CVS update. A number of buglets
relating to running UML as a daemon were fixed. The build was cleaned
up - I had hard-coded "gcc" instead of "$(CC)" in my Makefiles, the
top-level Makefile is now able to do native and user-mode builds, and
I cleaned up the drivers and fs Makefiles so that they let Rules.mk do
all the hard work.
<p>
I'm also back on hostfs. I fixed the mm problems that it uncovered.
It can now do ls on the top-level directory.
</blockquote>
<a name="11-01-2000"><table width="100%" bgcolor="#e0e0e0">
<tr>
<td>
<b>
<font color="black">1 Nov 2000</font>
</b>
</td>
</tr>
</table>
<blockquote>
Linus finally released the final test10 yesterday, so I made my
release last night, with a freshmeat announcement this morning. The
stack overflow problems in test9 are fixed by doubling the stack
size. There is also an inaccessible page between the two stack pages
and the task structure, so there shouldn't be any task structure corruption.
<p>
There were a number of other fixes. At the last minute, I found and
fixed a nasty race which resulted in the kernel tracing its own system
calls, resulting in some nasty stack corruption which made it hard to
figure out what happened. UML can now run when its main console is
not a terminal (i.e. /dev/null). That didn't work because it flipped
the terminal between raw and cooked mode, complaining via printk if
the ioctls failed. That led to an infinite recursion of printk
error messages which ultimately resulted in a segfault. I also made
it possible to mount host devices again. That was broke when I made
the block driver check IO requests against the device size so it could
report errors for out of bounds IO. It turns out not to be possible
to get the size of the media behind a block special file, as far as I
can tell. So, as far as the block driver was concerned, block devices
had zero size, and all IO was out of bounds.
<p>
I also started work on the hostfs filesystem. This is a virtual
filesystem which provides access to the host filesystem. The theory
is straightforward - vfs calls are converted into the equivalent
system calls on the host - but this uncovered a subtle memory
management bug. If a libc routine which mallocs memory is called, and the
break is increased, that extra memory only exists in that process. If
the kernel in another process tries using that memory (or tries
calling malloc at all), it will fault. What needs to happen is for
the context switching code to see if malloc has increased the size of
the data segment and map the new memory into the newly running
process. This also raises some SMP issues because when the new memory
is mapped in, the other processors will need to be told about it so
they can also map it. The same is true of the kernel's virtual memory.
</blockquote>
<a name="10-20-2000"><table width="100%" bgcolor="#e0e0e0">
<tr>
<td>
<b>
<font color="black">20 Oct 2000</font>
</b>
</td>
</tr>
</table>
<blockquote>
At long last, I added a
<a href="links.html">page</a> for related
projects and other interesting links.
<p>
In other news, it turns out that Michael Vines wrote a Linux
executable runner for Windows that does what a UML port to Windows
would have to do and he has GPL-ed it and made it available for anyone
who wants to incorporate it into a UML Windows port. See the
<a href="todo.html">todo</a> page for a link to his stuff.
</blockquote>
<a name="10-17-2000"><table width="100%" bgcolor="#e0e0e0">
<tr>
<td>
<b>
<font color="black">17 Oct 2000</font>
</b>
</td>
</tr>
</table>
<blockquote>
Back from ALS. The talk went pretty well. I'll put the slides up on
the site at some point.
<p>
I fixed the stack overflow problems that people were seeing. The
stack is now two pages long, with an inaccessible third page
protecting the task structure, which is on the fourth. Now, any stack
overflows will segfault rather than polluting the task structure,
making them a lot easier to debug. This is in CVS along with a few
other changes.
</blockquote>
<a name="10-02-2000"><table width="100%" bgcolor="#e0e0e0">
<tr>
<td>
<b>
<font color="black">2 Oct 2000</font>
</b>
</td>
</tr>
</table>
<blockquote>
Bill Stearns decided to go overboard on root_fs production. He's been
fiddling with the mkrootfs script so that it can handle distros other
than Red Hat 6.x. He's done Red Hat 7.0, Mandrake, and Immunix.
These are all now available from the project
<a href="http://sourceforge.net/project/showfiles.php?group_id=429 ">
download page</a> . Caldera, Conectiva, and SuSE are in the works.
</blockquote>
<a name="9-26-2000"><table width="100%" bgcolor="#e0e0e0">
<tr>
<td>
<b>
<font color="black">26 Sep 2000</font>
</b>
</td>
</tr>
</table>
<blockquote>
<p>
SGI released a new version of XFS for test5 and I tried to apply it to
my test8 um pool, the idea being that I could play with xfs in
userspace. The patch went in ok, with some rejects that were not too
hard to figure out. After some work, I got it to build. It didn't
boot, though. There were some changes in ll_blk_rw.c that I didn't
understand, and it looks like they are what resulted in the block
device getting a NULL buffer to do I/O into.
<p>
So, maybe I'll give XFS another try when SGI gets it slightly more
up-to-date.
</blockquote>
<a name="9-25-2000"><table width="100%" bgcolor="#e0e0e0">
<tr>
<td>
<b>
<font color="black">25 Sep 2000</font>
</b>
</td>
</tr>
</table>
<blockquote>
<p>
I found out why the kernel debugging interface doesn't handle
breakpoints very well. Setting breakpoints results in process
segfaults, floating point exceptions, and other strange behavior. It
turns out that do_syscall stored the current register state in the
thread structure while determining whether the process was doing a
system call. If the process hit a breakpoint in the kernel instead,
then that overwrote the state that was stored when the system call was
called. When the system call returned, that bogus state was restored,
and the process was essentially teleported back into the kernel just
after the breakpoint, leading to all kinds of strange behavior. With
that problem fixed, things work much better. The kernel debugger
seems to be basically healthy, and works just like on a normal process.
<p>
While I was fixing breakpoints, I decided to see why gdb inside a
virtual machine crashes it whenever it sets a breakpoint. There turn
out to be a number of problems. First, SIGTRAP wasn't being delivered
to the debuggee when it hit a breakpoint. This made it hard for gdb
to find out that the breakpoint had been hit, and to remove it
temporarily so the debuggee could get by it. Then, it turned out that
PTRACE_SINGLESTEP wasn't implemented. This is used by gdb to execute
the instruction which had the breakpoint and stop on the next one.
There were one or two other buglets, but now that they are fixed, gdb
seems happy with breakpoints.
</blockquote>
<a name="9-23-2000"><table width="100%" bgcolor="#e0e0e0">
<tr>
<td>
<b>
<font color="black">23 Sep 2000</font>
</b>
</td>
</tr>
</table>
<blockquote>
So, I've been a little lax. Here's what's happened in the last few weeks:
two bugs were fixed, the reboot bug and and shell segfault bug. That's it.
</blockquote>
<a name="9-01-2000"><table width="100%" bgcolor="#e0e0e0">
<tr>
<td>
<b>
<font color="black">1 Sep 2000</font>
</b>
</td>
</tr>
</table>
<blockquote>
<p>I realized that I am starting to lose track of bugs and functionality
requests, so I dusted off the project's
<a href="http://sourceforge.net/tracker/?group_id=429&atid=100429 ">bug tracking</a>
system and put everything that I know of in it. I'm also using the
<a href="http://sourceforge.net/tracker/?group_id=429&atid=300429 ">patch manager</a>
to store the fixes. The idea is that I'll put fixes there and close
them when I make a release that contains the fix.
<p>I fixed a context-switching bug
<a href="http://www.geocrawler.com/archives/3/597/2000/8/0/4251403/">noticed
</a> by Lennert Buytenhek. The problem turned out to be a race while
updating the address space of the process being restarted. If the
interrupt handler needed data from the kernel's vm area, and that area
hadn't yet been updated, then the kernel would crash. The
<a href="http://sourceforge.net/tracker/?group_id=429&atid=300429 ">
fix</a> was to disable signals during that period of the context switch.
</blockquote>
<a name="8-31-2000"><table width="100%" bgcolor="#e0e0e0">
<tr>
<td>
<b>
<font color="black">31 Aug 2000</font>
</b>
</td>
</tr>
</table>
<blockquote>
<p>I put in
<a href="http://www.geocrawler.com/lists/3/SourceForge/597/0/4256313/">
Andrea's LFS patch</a>. While I was in there, I cleaned
that code up somewhat. That is some of the oldest code still
remaining, and it really needed some work. I also put in the fix for
the crash caused by a
<a href="http://www.geocrawler.com/lists/3/SourceForge/709/0/4262186/">
module creating a kernel thread</a>. No word yet on
whether it's the right fix, though.
<p>Also, Laurent Bonnaud volunteered to update the ancient filesystem in
the Debian package to potato. This is very cool. It is something
that I've been wanting to do for a long time.
</blockquote>
<a name="8-25-2000"><table width="100%" bgcolor="#e0e0e0">
<tr>
<td>
<b>
<font color="black">25 Aug 2000</font>
</b>
</td>
</tr>
</table>
<blockquote>
<p>I'm releasing test7 today.
<p>My ALS2000 paper is now available as
<a href="als2000/index.html">
HTML</a> and <a href="als2000.tex">TeX</a>.
<p>I redid the RH mkrootfs script. It now prompts for the info it
needs. It also works for RH6.1 and probably RH6.2, although I didn't
test that.
</blockquote>
<a name="8-23-2000"><table width="100%" bgcolor="#e0e0e0">
<tr>
<td>
<b>
<font color="black">23 Aug 2000</font>
</b>
</td>
</tr>
</table>
<blockquote>
<p>Finished my ALS paper and sent it in. That's a load off my mind.
Made some more CVS checkins. This makes the various debugging options
configurable, although I haven't tested the gprof and gcov
configurations. I also added some compatibility code to make the
Debian install happier. It now recognizes that uml can have disks,
but the disk recognizer gets stuck in state 'D' for reasons I haven't
figured out yet.
<p>Linus just released test7, so I am building it right now (right
now as I'm writing this, and not right now as you're reading it, because
I've got no idea when you're reading this). A quick check of the
patch shows no changes that I need to worry about, so this looks like
a drop-it-in-and-it-just-works patch. We'll see...
<p>Things look good. I booted it up, and ran a few things, and
they all worked. So, I'll run the stress testers on it tomorrow, and
if that checks out, I'll release it.
</blockquote>
<a name="8-21-2000"><table width="100%" bgcolor="#e0e0e0">
<tr>
<td>
<b>
<font color="black">21 Aug 2000</font>
</b>
</td>
</tr>
</table>
<blockquote>
I've made the
<a href="debugging.html">ptrace proxy</a>, gprof, and
gcov support configurable. Also started playing with the Debian 2.2
install. It starts up ok, which the 2.1 install doesn't. It looks
like I'll have to fake some /proc/ide entries before it will deign to
admit that the virtual machine has disks. Right now, it's punting me
into the diskless install.
</blockquote>
<a name="8-17-2000"><table width="100%" bgcolor="#e0e0e0">
<tr>
<td>
<b>
<font color="black">17 Aug 2000</font>
</b>
</td>
</tr>
</table>
<blockquote>
Fixed a network driver bug which caused a crash when ab was run
against it. This might also fix the ping flood problem. The fix is
in cvs. It will appear for real in test7.
</blockquote>
<a name="8-15-2000"><table width="100%" bgcolor="#e0e0e0">
<tr>
<td>
<b>
<font color="black">15 Aug 2000</font>
</b>
</td>
</tr>
</table>
<blockquote>
I found out what was causing uml not to boot. It turned out to be a
casting bug which was making the compiler do pointer arithmetic rather
than integer arithmetic. This was a long-standing bug, and test6
changed things so it got hit more heavily. So, assuming that it's not
too badly broken now, I'll release test6 for real.
</blockquote>
<a name="8-08-2000"><table width="100%" bgcolor="#e0e0e0">
<tr>
<td>
<b>
<font color="black">8 Aug 2000</font>
</b>
</td>
</tr>
</table>
<blockquote>
Revamped the website. It will be put up as soon as Linus releases
test6 and I've integrated the changes in. This is because this site
talks about stuff which isn't really going to be released until then.
</blockquote>
<a name="8-07-2000"><table width="100%" bgcolor="#e0e0e0">
<tr>
<td>
<b>
<font color="black">7 Aug 2000</font>
</b>
</td>
</tr>
</table>
<blockquote>
<p>Checked in changes which make the new debugging interface
more or less work. I also added a 'debug' command line switch which
starts the kernel in the debugger, so you have control of it from the start.
<p>There are some problems with it. Commands attached to breakpoints
cause segfaults for some reason. It also can't step across a context
switch.
<p>I also put in Rusty's patches. They completely revamp the config
mechanism. For some reason, there also seems to be very complete
networking/netfilter converage.
</blockquote>
<a name="8-05-2000"><table width="100%" bgcolor="#e0e0e0">
<tr>
<td>
<b>
<font color="black">5 Aug 2000</font>
</b>
</td>
</tr>
</table>
<blockquote>The ptrace proxy is more or less working. I've checked it in to CVS and
<a href="http://www.geocrawler.com/lists/3/SourceForge/709/0/4146641/">
announced</a> it on my devel list.
</blockquote>
<a name="8-04-2000"><table width="100%" bgcolor="#e0e0e0">
<tr>
<td>
<b>
<font color="black">4 Aug 2000</font>
</b>
</td>
</tr>
</table>
<blockquote>
<p>Got a couple of patches from Rusty. I'm apparently going
to graduate to a complete port once I've applied one of them :-) It
is nice. It gives me what looks like a complete config process rather
than the one I've kludged together. He also sent in enough exports to
allow his stuff to be modular inside a UML.
<p>I'm integrating in Lars Brinkhoff's ptrace proxy. It's partially
working - enough that I can attach to the running thread, poke around
it, set breakpoints, etc. This without needing to detach it from the
uml tracing thread. I can't ^C gdb and have it stop the kernel
wherever it happens to be. It also doesn't seem to be following
threads as one goes to sleep and another starts up. Once these work, this
will be a huge improvement in uml kernel debugging.
</blockquote>
<a name="8-02-2000"><table width="100%" bgcolor="#e0e0e0">
<tr>
<td>
<b>
<font color="black">2 Aug 2000</font>
</b>
</td>
</tr>
</table>
<blockquote>
<p>Bill Stearns
<a href="http://www.geocrawler.com/lists/3/SourceForge/597/0/4126255/">
pointed out</a> a reproducable way of crashing the kernel
yesterday. It turns out that irq_save/irq_restore were completely wrong.
irq_save was enabling signals when it should have been disabling them.
This could explain a lot of the problems I saw in test4.
<p>I
<a href="http://www.geocrawler.com/lists/3/SourceForge/709/0/4131747/">
checked the fix into CVS</a> today.
</blockquote>
<a name="7-28-2000"><table width="100%" bgcolor="#e0e0e0">
<tr>
<td>
<b>
<font color="black">28 Jul 2000</font>
</b>
</td>
</tr>
</table>
<blockquote>
<p>Linus released test5 last night, so I'm putting out the user-mode
version today. There's nothing new in it. The virtual ethernet is in
the patch, but not enabled in the binary kernels and off by default in
defconfig.
<p>The stress testing of this kernel produced no strange happenings.
Maybe the segfaults and other stuff in the last release weren't my
fault (heh).
</blockquote>
<a name="7-27-2000"><table width="100%" bgcolor="#e0e0e0">
<tr>
<td>
<b>
<font color="black">27 Jul 2000</font>
</b>
</td>
</tr>
</table>
<blockquote>Started integrating Jim Leu's virtual ethernet driver. It
basically works, but it misbehaves a fair bit. It's unclear whether
that's the kernel's fault or the driver's.
</blockquote>
<a name="7-18-2000"><table width="100%" bgcolor="#e0e0e0">
<tr>
<td>
<b>
<font color="black">18 Jul 2000</font>
</b>
</td>
</tr>
</table>
<blockquote>
<p>I/O, I/O, off to OLS I go
<p>I'm leaving OLS a bit early because I've got a hiking weekend
coming up - Carter Dome on Saturday and possibly Moriah on Sunday.
So, no one had better expect any work from me until at least next
week...
<p>Plus I'm getting <a href="http://home.ici.net/~erice/Outdoors/Kije.jpg">
Kije</a> next week.
</blockquote>
<a name="7-17-2000"><table width="100%" bgcolor="#e0e0e0">
<tr>
<td>
<b>
<font color="black">17 Jul 2000</font>
</b>
</td>
</tr>
</table>
<blockquote>
<p>Announced test4 on freshmeat today.
<p>Also discovered a few more problems which I didn't see on test2 or test3:
<li>the occasional process segfault which I've mentioned already</li>
<li>a devfs segfault - I did this by displaying an xterm out to the
host; when I logged out, the kernel paniced with memory corruption in
devfs</li>
<li>X clients sometimes can't display against a local X server - strace says
that they're stuck in select</li>
<li>strace also displayed their read masks as '[?]', which doesn't
seem right</li>
<p>Patches for these will be forthcoming when I find fixes.
</blockquote>
<a name="7-14-2000"><table width="100%" bgcolor="#e0e0e0">
<tr>
<td>
<b>
<font color="black">14 Jul 2000</font>
</b>
</td>
</tr>
</table>
<blockquote>
<p>Back from SF. Not only did Linus release test3 on Tuesday (as I
discovered when I was checking things out just before leaving for the
airport), but he also released test4 yesterday. So, it looks like I'm
going to be skipping test3 and going straight to test4.
<p>The test3 changes are pretty minor, but enough to prevent the um
test2 patch from going in. task.priority changed to task.nice, there
were some minor locking changes, devfs_mk_dir lost a parameter, and
kernel/timer.c doesn't compile because of that field change.
With those things fixed, the kernel boots fine.
<p>I also decided to get rid of the
<tt>
<pre>
<font size="-1">
pid 16 (mount) - segv changing ip to 0x10025ff2 for address 0x8064000
</font>
</pre>
</tt>
messages that appear at boot time. They are debugging messages to
convince me that the new uaccess macros are working. But they looked
abnormal and worried people so they are now gone. Don't worry, be
happy.
<p>The test3 kernel runs my stress tests (lmbench and a kernel build)
fine, so I'm checking it in to CVS and
<a href="http://www.geocrawler.com/lists/3/SourceForge/709/0/4036235/">
announcing</a> it on the devel list.
<p>On to test4. The timer.c bug got fixed. Otherwise, the patch went
in cleanly. It compiles and the resulting kernel boots cleanly.
Unfortunately, lmbench segfaults. I put in some debugging code, and
lmbench stops segfaulting. On to the kernel build. That works fine.
I try a couple more lmbench runs. They work fine. Oh well.
<p>I'll consider this releasable. Maybe someone else can find a
better way to reproduce the problem. Check this stuff into CVS, and
out goes the
<a href="http://www.geocrawler.com/lists/3/SourceForge/709/0/4036801/">
announcement</a>.
<p>I also updated all of the downloadable stuff and
<a href="http://kernelnotes.org/lnxlists/linux-kernel/lk_0007_02/msg01130.html">
announced</a> it.
</blockquote>
<a name="7-3-2000"><table width="100%" bgcolor="#e0e0e0">
<tr>
<td>
<b>
<font color="black">3 Jul 2000</font>
</b>
</td>
</tr>
</table>
<blockquote>I fixed the double panic bug. That was caused by a stacksize limit
that was not a multiple of 4 meg. The reason that matters is that
check_range (in arch/um/kernel/tlb.c), which is used to remap address
spaces during a context switch, assumes that remappable areas and
non-remappable areas are under different pgdirs, which represent 4 meg
apiece. Non-remappable areas are areas of address space which don't
belong to the process. Kernel text, data, and physical and virtual
memory, plus the original stack, fall into this category. They are
represented by vmas in the process mm_struct, but don't have page
table entries. If check_range runs into one of these areas in the
course of looking at something else, the lack of ptes for it will
cause it to be unmapped. Since the process stack is placed just
outside the stacksize limit, if that limit is (say) less than 4 meg,
when check_range checks it for remapping, it will also run into the
main stack provided by the host kernel and unmap it. The panic
happened when a process tried to change its name, which is stored in
that initial stack.
<p>If you see this problem, you can change your stacksize limit to a
multiple of 4 meg, or apply
<a href="stacksize.txt">this patch</a> to
the kernel.
<p>Those two fixes are now checked into
<a href="http://sourceforge.net/cvs/?group_id=429">CVS</a> .
<a href="http://www.geocrawler.com/lists/3/SourceForge/709/0/3976060/">
Here's</a> the devel list post describing the changes.
</blockquote>
<a name="7-2-2000"><table width="100%" bgcolor="#e0e0e0">
<tr>
<td>
<b>
<font color="black">2 Jul 2000</font>
</b>
</td>
</tr>
</table>
<blockquote>UML doesn't run on recent 2.3/2.4 kernels and I figured out
why. The signal frame size increased due to some extra x86 state that needed
to be saved. UML is responsible for making sure that there is enough stack
available when it asks the host kernel to send a signal to one of its
processes. To do this, it pokes the stack (by reading and writing a word)
a little below the current stack pointer. If there is nothing mapped there,
the seg fault handler will map a page in and all will be well. The offset
that it used to poke was a hard-coded 512 bytes, which I got by looking at
the amount of stack state the syscall handler needed (312 bytes) and adding
a bit. However, it turns out that the new stack frames are much bigger than
that, so the 512 bytes wasn't enough. Fixing this makes UML run on new
kernels. If you are seeing this problem, apply
<a href="probe-stack.txt">this patch</a> to the 2.4.0-test2 pool.
<p>I'm also chasing a bug which causes a panic like this:<br>
<tt>
<pre>
<font size="-1">
Kernel panic: Double fault on 0xbffff874 - panicing because it wasn't
fixed the first time
</font>
</pre>
</tt>
</blockquote>
</td>
</tr>
</table>
<center>
<font size="-1">
Hosted at </font>
<a href="http://sourceforge.net">
<IMG alt="SourceForge Logo" border="0" height="31" width="88" src="http://sourceforge.net/sflogo.php?group_id=429">
</a>
</center>
</body>
</html>
|