--- Gnu-Mach/ChangeLog 2020/09/02 04:47:10 1.1.1.7 +++ Gnu-Mach/ChangeLog 2020/09/02 04:49:37 1.1.1.8 @@ -1,3 +1,901 @@ +2015-10-31 Thomas Schwinge + + GNU Mach 1.6 + * version.m4 (AC_PACKAGE_VERSION): Set to 1.6. + * NEWS: Finalize for 1.6. + +2015-10-31 Thomas Schwinge + + Rework *.msgids handling when neither client nor server stubs are required + Originally added in commit 255c47e669819f153c722c98a230f6fe4e6ece08, but "make + distcheck" didn't like that: + + [...] + ERROR: files left in build directory after distclean: + ./ipc/notify.msgids + Makefile:7489: recipe for target 'distcleancheck' failed + make[1]: *** [distcleancheck] Error 1 + make[1]: Leaving directory '[...]/gnumach/release.build/gnumach-1.5/_build/sub' + Makefile:7416: recipe for target 'distcheck' failed + make: *** [distcheck] Error 1 + + Instead of special-casing that, generalize the Makefile rules. + + * Makefrag.am (nodist_lib_dep_tr_for_defs_a_SOURCES): Add + ipc/notify.none.defs.c. + (nodist_libkernel_a_SOURCES): Add ipc/notify.none.msgids. + (gnumach.msgids): Remove ipc/notify.msgids prerequisite. + * Makerules.mig.am (%.msgids): Remove rule, and instead... + (%.none.defs.c, %.none.msgids): ... add these rules. + +2015-10-05 Justus Winter <4winter@informatik.uni-hamburg.de> + + Update NEWS file + +2015-10-05 Samuel Thibault + + Fix time going back in Xen case + when backward time correction happens to get bigger than the tick duration. + + * kern/mach_clock.c (clock_interrupt): When `tickdelta' is bigger than `usec', + truncate it to `usec-1'. + +2015-10-05 Joshua Branson + + Add generated mach documentation files to gitignore + * .gitignore: Add doc/mach.aux doc/mach.cp doc/mach.cps doc/mach.fn + doc/mach.fns doc/mach.ky doc/mach.log doc/mach.pdf doc/mach.pg doc/mach.toc + doc/mach.tp doc/mach.vr. + +2015-09-29 Justus Winter <4winter@informatik.uni-hamburg.de> + + kern/slab: print total used and reclaimable memory + * kern/slab.c (_slab_info): Print total used and reclaimable memory. + + kern/slab: include flags in the slab information + * kern/slab.c (_slab_info): Include flags in the slab information. + + ddb: fix line formatting + * ddb/db_output.c (db_putchar): Fix off-by-one, allowing one more + character to be printed before the newline is inserted. + + ddb: add new command `show slabinfo' + * ddb/db_command.c (db_show_cmds): Add `slabinfo'. + * kern/slab.c (slab_info): Generalize so that it can be used with + different printf-like functions, and turn it into a static function. + (slab_info): New wrapper retaining the old behaviour. + (db_show_slab_info): New wrapper that uses `db_printf' instead. + * kern/slab.h (db_show_slab_info): New declaration. + +2015-09-27 Justus Winter <4winter@informatik.uni-hamburg.de> + + i386: trace syscalls of a single task + * i386/i386/debug_i386.c (syscall_trace_task): New variable. + (syscall_trace_print): If set, trace only syscalls from this task. + + i386: improve syscall tracing + * kern/syscall_sw.h (mach_trap_t): Turn unused field into `mach_trap_name'. + (MACH_TRAP, MACH_TRAP_STACK): Record name. + * i386/i386/debug_i386.c (syscall_trace_print): Use the name and + format the arguments to look like c. + + Fix build with -DDEBUG + * device/cirbuf.c: Add missing include. + * i386/i386/debug.h (dump_ss): Hide declaration from assembler. + * i386/i386/debug_i386.c: Fix include. + * kern/sched_prim.h: Add missing include, fix declaration. + + kern/bootstrap: drop into the debugger + * kern/bootstrap.c (boot_script_prompt_task_resume): Drop into the + debugger instead of merely waiting for return using `safe_gets', which + disables interrupts, making it impossible to break into the debugger + using the magic keys. + +2015-09-19 Flávio Cruz + + Add macros to convert between time_value_t and timespec + * include/mach/time_value.h (TIME_VALUE_TO_TIMESPEC, + TIMESPEC_TO_TIME_VALUE): New macros + +2015-09-07 Justus Winter <4winter@informatik.uni-hamburg.de> + + kern: use proper memory fences when handling the mapped time + * include/mach/time_value.h (struct mapped_time_value): Adjust comment. + * kern/mach_clock.c (mtime): Likewise. Also make it volatile. + (update_mapped_time): Use full hardware barriers. + (read_mapped_time): New macro with proper fences. + (record_time_stamp, host_get_time): Use the new macro. + +2015-09-07 Justus Winter <4winter@informatik.uni-hamburg.de> + + kern: fix loop reading the time value + Previously, recent versions of gcc would hoist the loads out of the + loop reading the time value. + + * kern/macros.h (access_once): New macro. + * kern/mach_clock.c (host_get_time): Use the new macro to prevent the + loads from being hoisted out of the loop. + +2015-09-07 Rik van Riel + + commit fce798016c4bd2be89b86b0d343ab54505409412 + [PATCH] advansys.c buffer overflow + + The Stanford checker found an error in advansys.c, the driver + is accessing field 6 in an array[6]. Since this is the only + place where this field is accessed it should be safe to simply + remove this line. + +2015-08-31 Samuel Thibault + + Reserve 64k at beginning of memory, not just 4k + Linux does this to be extra careful with some BIOSes which apparently + spuriously write between 4k and 64k. + + * i386/i386at/model_dep.c (RESERVED_BIOS): New macro. + (avail_next, mem_size_init, init_alloc_aligned): Use RESERVED_BIOS instead + of hardcoded 0x1000. + +2015-08-30 James Clarke + + Fix printk not handling ANSI escape codes + * i386/i386at/kd.c (kdstart): Moved escape sequence handling to new + kd_putc_esc function. + (kd_putc_esc): New function with logic from kdstart. + (kdcnputc): Call kd_putc_esc rather than kd_putc to allow for ANSI + escape codes. + * i386/i386at/kd.h (kd_putc_esc): New function. + +2015-08-28 Flávio Cruz + + Make sure the reply port's reference is released when the thread needs to be halted. + * kern/thread.h (thread_halt_self): Add continuation_t parameter. + * kern/thread.c (thread_halt_self): Pass continuation_t parameter to + thread_block instead of thread_exception_return. + * kern/ast.c (ast_taken): Pass thread_exception_return to thread_halt_self. + * kern/profile.c (profile_thread): Likewise. + * kern/exception.c (exception_no_server): Likewise. + (thread_release_and_exception_return): New function. + (exception_raise_continue_slow): Pass thread_release_and_exception_return to + thread_halt_self. + +2015-08-28 Flávio Cruz + + Add a thread_no_continuation definition + to replace the use of the NULL pointer. + + * kern/sched_prim.h (thread_no_continuation): New macro. + * kern/machine.c (processor_assign, processor_doaction): Use + thread_no_continuation instead of 0. + * kern/profile.c (send_last_sample_buf): Likewise + * kern/sched_prim.c (thread_sleep, thread_invoke, thread_dispatch): + Likewise. + * kern/task.c (task_terminate, task_assign): Likewise. + * kern/thread.c (thread_suspend): Likewise. + * kern/thread.h (struct thread): Change type of swap_func field to + continuation_t. + +2015-08-20 Justus Winter <4winter@informatik.uni-hamburg.de> + + kern/bootstrap: tune locking + * kern/bootstrap.c (boot_script_exec_cmd): Avoid holding the lock + across the call to `thread_create'. + + i386: enable assertions + * i386/intel/pmap.c (pmap_page_protect): Enable assertions. + (phys_attribute_clear, phys_attribute_test): Likewise. + + kern: really zero-out unused simple lock info entries + * kern/lock.c (simple_unlock): Really zero-out unused simple lock info + entries. + +2015-08-18 Justus Winter <4winter@informatik.uni-hamburg.de> + + i386: fix panic message + * i386/intel/pmap.c (pmap_page_protect): Fix function name in panic + message. + + vm: collapse unreachable branch into assertion + * vm/vm_object.c (vm_object_collapse): Collapse unreachable branch + into assertion. + +2015-08-17 Justus Winter <4winter@informatik.uni-hamburg.de> + + kern: keep track of the writer when debugging locks + * configfrag.ac (MACH_LDEBUG): Adjust comment, we use it to sanity + check all locks now. + * kern/lock.c (lock_write): Keep track of the writer thread. + (lock_done): Clear writer. + (lock_read_to_write): Keep track of the writer thread. + (lock_write_to_read): Assert that the current thread holds the lock. + Clear writer. + (lock_try_write): Keep track of the writer thread. + (lock_try_read_to_write): Likewise. + (lock_set_recursive): Assert that the current thread holds the lock. + * kern/lock.h (struct lock): New field `writer'. + (have_read_lock, have_write_lock, have_lock): New macros that can be + used to assert that the current thread holds the given lock. If + MACH_LDEBUG is not set, they evaluate to true. + +2015-08-17 Justus Winter <4winter@informatik.uni-hamburg.de> + + kern: improve simple lock debugging + Do not bother saving the return address when acquire a simple lock. + Save the location as provided by the compiler as string instead. Also + save the lock parameter. + + * kern/lock.c (struct simple_locks_info): Drop `ra', add `expr', `loc'. + (simple_lock): Rename to `_simple_lock', add expression and location + parameters and save them. + (simple_lock_try): Likewise. + (simple_unlock): Zero-out the now unused slot in the list of taken locks. + (db_show_all_slocks): Use the new information. + * kern/lock.h (simple_lock, simple_lock_try): Provide macro versions + passing the location and expression as string. + +2015-08-17 Justus Winter <4winter@informatik.uni-hamburg.de> + + kern: disable the simple lock checks while debugging + * kern/lock.c (do_check_simple_locks): New variable. + (check_simple_locks): Make check conditional. + (check_simple_locks_{en,dis}able): New functions. + * kern/lock.h (check_simple_locks_{en,dis}able): New declarations. + * ddb/db_trap.c (db_task_trap): Disable simple lock checks. + +2015-08-15 Justus Winter <4winter@informatik.uni-hamburg.de> + + vm: fix compiler warning + * vm/vm_user.c (vm_wire): Drop unused but set variable `host'. + + vm: enable extra assertions + * vm/vm_fault.c (vm_fault_page): Enable extra assertions. + + Avoid re-defining macros + * kern/macros.h: Avoid re-defining macros. + * linux/src/include/linux/compiler-gcc.h: Likewise. + * linux/src/include/linux/compiler.h: Likewise. + +2015-07-25 Justus Winter <4winter@informatik.uni-hamburg.de> + + kern: add boot-time clock, use it for time stamps + The kernel keeps track of task and thread creation times by saving a + time stamp. Previously, the real-time clock was used for this. When + the real-time clock is changed, however, the reference frame for the + time stamps is lost. This surfaced in Hurd systems reporting + spuriously long uptimes. + + Fix this by creating a boot-time clock and use it as reference frame + for the time stamps. + + * kern/mach_clock.c (clock_boottime_offset): Create clock by keeping + track of the offset from the real-time. + (clock_boottime_update): New function. + (record_time_stamp): Use the boot-time clock for time stamps. + (read_time_stamp): New function to convert it back to real-time. + (host_set_time): Call `clock_boottime_update'. + * kern/mach_clock.h (record_time_stamp): Amend comment. + (read_time_stamp): New declaration. + * kern/task.c (task_info): Use `read_time_stamp'. + * kern/thread.c (thread_info): Likewise. + +2015-07-25 Justus Winter <4winter@informatik.uni-hamburg.de> + + include: provide time-value substraction + * include/mach/time_value.h (time_value_assert): New macro to assert + that the given value is well-formed. + (time_value_add_usec): Use the new macro. + (time_value_sub_usec): New macro. + (time_value_add): Use `time_value_add_usec'. + (time_value_sub_usec): New macro. + + kern/lock: make sure the macros are only used on simple locks + * kern/lock.h (struct slock, simple_lock_data_empty): Add field + `is_a_simple_lock'. + (simple_lock_assert): New macro that tests for `is_a_simple_lock'. + Use this macro to assert that the arguments to various other macros + are indeed simple locks. + + Disable the kernel tracing system XPR + * configfrag.ac (XPR_DEBUG): Disable tracing system. + + ipc/space: inline reference counting + * ipc/ipc_space.h (is_{reference,release}): Use the macro variant. + + Make sure the field offsets are updated + * Makerules.am: Make sure the field offsets are updated. + +2015-07-20 Justus Winter <4winter@informatik.uni-hamburg.de> + + kern/bootstrap: deallocate thread + Previously, killing the thread would fail because of the extra + reference, making task_terminate loop forever. + + * kern/bootstrap.c (boot_script_exec_command): Deallocate thread. + +2015-07-19 Justus Winter <4winter@informatik.uni-hamburg.de> + + kern/bootstrap: deallocate task + * kern/bootstrap.c (boot_script_free_task): Deallocate task. + +2015-07-18 Justus Winter <4winter@informatik.uni-hamburg.de> + + linux/net: fix build with -O0 + * linux/src/drivers/net/pci-scan.c: Avoid #erroring out. + +2015-07-18 Justus Winter <4winter@informatik.uni-hamburg.de> + + kern/printf: do not serialize printf and co + A lot of code assumes that printf is re-entrant, e.g. the pagination + code in the debugger, or any use of assert inside the console driver. + + * kern/printf.c: Drop the lock serializing calls to `_doprnt'. + (printf_init): Remove function. + * kern/printf.h (printf_init): Remove declaration. + * kern/startup.c (setup_main): Remove call to `printf_init'. + +2015-07-18 Justus Winter <4winter@informatik.uni-hamburg.de> + + kern/lock: use compiler built-in functions to get return address + * kern/lock.c (struct simple_locks_info): Fix type of `ra'. + (simple_lock, simple_lock_try): Use compiler built-in functions to get + return address. + + kern/bootstrap: fix locking + * kern/bootstrap.c (boot_script_exec_cmd): Add missing unlock. + (user_bootstrap): Likewise. + + kern/slab: fix locking + * kern/slab.c (host_slab_info): Fix locking. + +2015-07-15 Justus Winter <4winter@informatik.uni-hamburg.de> + + ipc: use a general lock to protect IPC spaces + This fixes a corruption in the radix trees representing the IPC spaces + when memory was tight. + + * ipc/ipc_space.h: Use a general lock to protect IPC spaces. + +2015-07-15 Justus Winter <4winter@informatik.uni-hamburg.de> + + ipc: fix the locking of the IPC entry allocation functions + * ipc/ipc_entry.c (ipc_entry_alloc): Assume the space is write-locked. + (ipc_entry_alloc_name): Likewise. + * ipc/ipc_object.c: Fix the locking around all call sites to the two + functions where the space was not locked before. + + i386: fix typo + * i386/intel/pmap.c: Fix typo. + +2015-07-12 Justus Winter <4winter@informatik.uni-hamburg.de> + + ipc: avoid kmem_alloc + * ipc/ipc_table.c (ipc_table_alloc): Unconditionally use `kalloc'. + (ipc_table_free): Unconditionally use `kfree'. + +2015-07-12 Justus Winter <4winter@informatik.uni-hamburg.de> + + vm: really fix traversing the list of inactive pages + Previously, the pageout code traversed the list of pages in an object + instead of the list of inactive pages. + + * vm/vm_pageout.c (vm_pageout_scan): Fix traversing the list of + inactive pages. + +2015-07-11 Justus Winter <4winter@informatik.uni-hamburg.de> + + kern: make sure the queue macros are only used on queues + This turns mistakes as the one corrected in e59f05e9 into compile-time + errors. + + * kern/queue.h: Add a new macro, queue_assert, and use it to assert + that all arguments given to the queue macros have the correct type. + * device/net_io.c (ENQUEUE_DEAD): Adapt to the fact that + `queue_next(q)' is no longer an lvalue. + +2015-07-11 Justus Winter <4winter@informatik.uni-hamburg.de> + + vm: fix traversing the list of inactive pages + Previously, the pageout code traversed the hash table chain instead of + the list of inactive pages. The code merely compiled by accident, + because the `struct page' also has a field called `next' for the hash + table chain. + + * vm/vm_pageout.c (vm_pageout_scan): Fix traversing the list of + inactive pages. + +2015-07-10 Justus Winter <4winter@informatik.uni-hamburg.de> + + vm: drop debugging remnants + * vm/vm_object.c (vm_object_terminate): Drop debugging remnants. + + kern: make printf handle long long integers + * Makefile.am (clib_routines): Steal `__umoddi3'. + * kern/printf.c (MAXBUF): Increase size. + (printnum, _doprnt): Handle long long integers. + * kern/printf.h (printnum): Adjust declaration. + +2015-07-09 Justus Winter <4winter@informatik.uni-hamburg.de> + + vm: fix panic message + * vm/vm_kern.c (kmem_init): Fix panic message. + + i386: fix line wrapping in the immediate console + * i386/i386at/immc.c (immc_cnputc): Fix line wrapping. + + kern: remove superfluous file + * kern/server_loop.ch: Remove superfluous file. + + kern: improve error handling + * kern/bootstrap.c (boot_script_exec_cmd): Improve error handling. + +2015-07-09 Samuel Thibault + + Allow non-privileged tasks to wire 64KiB task memory + * doc/mach.texi (vm_wire): Document that the host port does not have to be + privileged. + * include/mach/mach_hosts.defs (vm_wire): Use mach_port_t instead of + host_priv_t. + * vm/vm_map.h (vm_map): Add user_wired field. + * vm/vm_map.c (vm_map_setup): Initialize user_wired field to 0. + (vm_map_pageable_common, vm_map_entry_delete, vm_map_copy_overwrite, + vm_map_copyout_page_list, vm_map_copyin_page_list): When switching + user_wired_count field of entry between 0 and non-0, accumulate the + corresponding size into the user_wired field of map. + * vm/vm_user.c (vm_wire): Turn host parameter into port parameter, and + inline a version of convert_port_to_host_priv which records whether the host + port is privileged or not. When it is not privileged, check whether + the additional amount to user_wired will overcome 64KiB. + +2015-07-07 Samuel Thibault + + Fix build with -O0 + * linux/src/include/linux/string.h (strcpy, strncpy, strcat, strncat, + strchr, strrchr, strlen, strnlen, strcmp, strncmp, memmove, + memscan): Comment out extern declarations. + * linux/dev/include/asm-i386/string.h (strcpy, strncpy, strcat, strncat, + strcmp, strncmp, strchr, strrchr, strlen, __memcpy, __constant_memcpy, + memmove, memchr, __memset_generic, __constant_c_memset, strnlen, + __constant_c_and_count_memset, memscan): Turn extern inline into static + inline. + * linux/dev/include/linux/fs.h (mark_buffer_uptodate): Likewise. + * linux/src/include/asm-i386/bitops.h (set_bit, clear_bit, change_bit, + test_and_set_bit, test_and_clear_bit, test_and_change_bit, test_bit, + find_first_zero_bit, find_next_zero_bit, ffz, ffs): Likewise. + * linux/src/include/asm-i386/io.h (virt_to_phys, phys_to_virt, __out##s, + __in##s, ins##s, outs##s): Likewise. + * linux/src/include/asm-i386/semaphore.h (down, down_interruptible, up): + Likewise. + * linux/src/include/asm-i386/segment.h [!__OPTIMIZE]: Emit an ud2 instruction + instead of an undefined reference. + +2015-07-05 Samuel Thibault + + Add missing distributed file + * Makefrag.am (EXTRA_DIST): Add ipc/notify.defs. + +2015-06-30 Justus Winter <4winter@informatik.uni-hamburg.de> + + Fix re-configuring out-of-tree builds + Previously, running `../configure ...' to reconfigure an out-of-tree + build would link `machine' to `i386/i386' instead of `../i386/i386' + (i.e. point to the build directory instead to the source) if + `i386/i386' also exists in the build directory because of a previous + build. + + * configfrag.ac: Prefix machine link target with `$srcdir'. + +2015-06-30 Samuel Thibault + + Fix restoring interrupts on timeout + * linux/dev/drivers/block/ahci.c (ahci_identify): Restore flags before + returning on timeout. + +2015-06-29 Samuel Thibault + + Print about powered-down AHCI ports + * linux/dev/drivers/block/ahci.c (ahci_probe_dev): Print messages when + device is present but powered down. + +2015-06-28 Justus Winter <4winter@informatik.uni-hamburg.de> + + ddb: automatically display stack traces + * ddb/db_trap.c (db_task_trap): Automatically display stack traces if + an unexpected trap occurs. + +2015-06-28 Justus Winter <4winter@informatik.uni-hamburg.de> + + i386: improve the immediate console + Improve the immediate console to the point that it can be enabled and + display e.g. assertion failures from very early on (i.e. from + `c_boot_entry'). + + * device/cons.h (romgetc, romputc): New declarations. + * i386/configfrag.ac: Add configuration variable. + * i386/i386at/conf.c (dev_name_list): Add entry. + * i386/i386at/cons_conf.c (constab): Add entry. + * i386/i386at/immc.c: Add missing includes. + (immc_cnprobe, immc_cninit, immc_cngetc, immc_romputc): New functions. + (immc_cnputc): Fix signature, use virtual addresses. + * i386/i386at/immc.h: New file. + * i386/i386at/kd.c: Use `#if ENABLE_IMMEDIATE_CONSOLE'. + * i386/i386at/kd.h (kd_setpos): Add missing declaration. + * i386/i386at/model_dep.c (c_boot_entry): Install immediate console as + early boot console. + +2015-06-26 Justus Winter <4winter@informatik.uni-hamburg.de> + + i386: add comment + * i386/i386at/model_dep.c (rebootflag): Explain flag. + +2015-06-20 Justus Winter <4winter@informatik.uni-hamburg.de> + + kern: fix error handling + This avoids calling `thread_deallocate' with an uninitialized value, + as found by the Clang Static Analyzer. + + * kern/thread.c (kernel_thread): Fix error handling. + +2015-06-09 Justus Winter <4winter@informatik.uni-hamburg.de> + + kern: add function attributes to the printf-functions + * kern/printf.h (sprintf, snprintf, vsnprintf, printf): Add the + `printf' function attribute that allows the compiler to check the + format strings and arguments. + +2015-06-05 Flávio Cruz + + Fix typo + * vm/vm_kern.c (kmem_alloc_aligned): Fix typo. + + Use custom port macros. + * ipc/ipc_port.c (ipc_port_alloc_special): Use ip_alloc and ip_lock_init + macros instead of manually inlining them. + +2015-05-31 Justus Winter <4winter@informatik.uni-hamburg.de> + + ipc: fix typo + * ipc/notify.defs: Fix typo. + + Include the notify protocol in `gnumach.msgids' + * Makefrag.am (gnumach.msgids): Add `notify.msgids' as prerequisite. + * Makerules.mig.am: Add rule to generate the list of message ids when + neither the client nor the server stubs are required. + * ipc/notify.defs: New file. + +2015-05-29 Justus Winter <4winter@informatik.uni-hamburg.de> + + kern: fix argument handling + Previously, the processor argument was not checked. If called with a + non-processor argument (like a task), `processor' is set to NULL, + triggering a page fault. Likewise for the other functions. + + * kern/processor.c (processor_get_assignment): Fix argument handling. + * kern/task.c (task_get_assignment): Likewise. + * kern/thread.c (thread_get_assignment): Likewise. + +2015-05-23 Justus Winter <4winter@informatik.uni-hamburg.de> + + Restrict `-fno-strict-aliasing' to the Linux drivers + * Makefile.am: Move `-fno-strict-aliasing'... + * linux/Makefrag.am: ... here. + + i386: avoid breaking the strict-aliasing rules + * i386/i386/pcb.c (switch_ktss): Cleanly convert the value. + + kern: avoid breaking the strict-aliasing rules + * kern/exception.c (exception_parse_reply): Use `BAD_TYPECHECK'. + + vm: drop unused `kmem_realloc' + * vm/vm_kern.c (kmem_realloc): Remove function. + (kmem_alloc_wired): Adopt comment. + * vm/vm_kern.h (kmem_realloc): Remove declaration. + +2015-05-23 Samuel Thibault + + Add stdint integer types in Linux glue + * linux/dev/include/linux/types.h (int8_t, uint8_t, int16_t, uint16_t, + int32_t, uint32_t, int64_t, uint64_t): New types. + +2015-05-22 Justus Winter <4winter@informatik.uni-hamburg.de> + + ipc: drop remnants of the IPC tables + * ipc/ipc_table.c (ipc_table_entries): Remove. + (ipc_table_entries_size): Likewise. + (ipc_table_init): Remove initialization of `ipc_table_entries'. + (ipc_table_realloc): Remove function. + * ipc/ipc_table.h: Adjust comments. + (ipc_table_entries): Remove declaration. + (ipc_table_realloc): Likewise. + (it_entries_{alloc,reallocable,realloc,free}): Remove macros. + + ipc: drop size parameter from `ipc_space_create' + * ipc/ipc_space.c (ipc_space_create): Drop size parameter. + * ipc/ipc_space.h (ipc_space_create): Adopt declaration, fix comment. + * kern/ipc_tt.c (ipc_task_init): Adopt accordingly. + +2015-05-20 Justus Winter <4winter@informatik.uni-hamburg.de> + + ipc: inline key ipc entry lookup functions + Declare functions looking up IPC entries that were previously inlined + manually with `static inline' so that they will be inlined into the + fast paths by the compiler. + + * ipc/ipc_entry.c (ipc_entry_lookup, ipc_entry_get, + ipc_entry_dealloc): Move functions... + * ipc/ipc_space.h: ... here, and declare them as `static inline'. + * ipc/ipc_entry.h: Drop associated declarations. + +2015-05-20 Justus Winter <4winter@informatik.uni-hamburg.de> + + ipc: replace the IPC table with a radix tree + Currently, the port names are mapped to an IPC object (e.g. a port) + using a table. This, however, requires large chunks of continuous + memory, and leads to scalability problems as virtual kernel memory is + a scarce resource. To avoid excessive overhead, non-contiguous port + names are spilled into a splay tree. + + Replace the IPC table with a radix tree. As the radix tree is able to + store non-contiguous names with reasonable overhead, we can drop the + splay tree as well. + + * ipc/ipc_entry.c (ipc_entry_tree_collision): Remove function. + (ipc_entry_cache): New variable. + (ipc_entry_lookup): Replace with a radix tree lookup. + (ipc_entry_get): The free list handling is changed a little. Adopt + accordingly. + (ipc_entry_free_name): New function. + (ipc_entry_alloc): Adopt accordingly. + (ipc_entry_alloc_name): Likewise. + (ipc_entry_dealloc): Likewise. + (ipc_entry_grow_table): Remove function. + * ipc/ipc_entry.h (struct ipc_entry): Update comment, add field for + name and free list, remove unused fields. + (ipc_entry_cache, ie_alloc, ie_free): New declarations. + (struct ipc_tree_entry): Remove. Also remove any related declarations. + (ipc_entry_grow_table): Remove declaration. + * ipc/ipc_init.c (ipc_bootstrap): Adopt initialization. + * ipc/ipc_kmsg.c (ipc_kmsg_copyout_header): Use `ipc_entry_alloc' + instead of re-coding it. Adopt free list handling. + (ipc_kmsg_copyout_object): Adopt free list handling, store the name. + * ipc/ipc_object.c (ipc_object_copyout): Likewise. + (ipc_object_copyout_multiname): Likewise. + * ipc/ipc_space.c (ipc_space_create): Initialize radix tree and free list. + Drop table and splay tree initialization. + (ipc_space_destroy): Free ipc entries and radix tree, remove table and + splay tree cleanup. + * ipc/ipc_space.h (struct ipc_space): Add radix tree, free list, and size. + Remove all fields related to the table and splay tree. + * ddb/db_print.c (db_port_iterate): Adopt iteration. + (db_lookup_port): Adopt lookup. + * include/mach_debug/ipc_info.h: Remove unused parts of the debug interface. + * include/mach_debug/mach_debug.defs: Likewise. + * include/mach_debug/mach_debug_types.defs: Likewise. + * ipc/mach_debug.c: Likewise. + * ipc/ipc_right.c (ipc_right_reverse): Adopt lookup, store name. + (ipc_right_check): Adopt removal. + (ipc_right_destroy): Likewise. + (ipc_right_dealloc): Likewise. + (ipc_right_delta): Likewise. + (ipc_right_copyin): Adopt insertion, adopt removal. + (ipc_right_copyin_two): Adopt removal. + (ipc_right_copyout): Adopt insertion, adopt removal. + (ipc_right_rename): Likewise, also update comment. + * ipc/mach_port.c (mach_port_names): Adopt iteration. + (mach_port_get_set_status): Likewise. + * ipc/port.h: Update comment. + * ipc/ipc_hash.c: Delete file. + * ipc/ipc_hash.h: Likewise. + * ipc/ipc_splay.c: Likewise. + * ipc/ipc_splay.h: Likewise. + * Makefrag.am (libkernel_a_SOURCES): Remove these files. + +2015-05-20 Justus Winter <4winter@informatik.uni-hamburg.de> + + ipc: replace reverse hash table with a radix tree + Currently, there is a hash table mapping (space, object) tuples to + `ipc_entry' objects. This hash table is intertwined with the IPC + tables. There is one hash table per IPC space, but it is only for the + entries in the IPC table. This hash table is called `local' in the + source. All IPC entries being spilled into the splay tree are instead + mapped by a global hash table. + + Replace the local (i.e. per IPC space) reverse hash table with a radix + tree. + + * ipc/ipc_entry.c (ipc_entry_grow_table): Adjust accordingly. + * ipc/ipc_entry.h (struct ipc_entry): Adjust comment. + * ipc/ipc_hash.c: Adjust comment explaining the local lookup table. + (IPC_LOCAL_HASH_INVARIANT): New macro. + (ipc_hash_local_lookup): Use the new `ipc_reverse_lookup' function. + (ipc_hash_local_insert): Use the new `ipc_reverse_insert' function. + (ipc_hash_local_delete): Use the new `ipc_reverse_remove' function. + * ipc/ipc_space.c (ipc_space_create): Initialize radix tree. + (ipc_space_destroy): Free radix tree. + * ipc/ipc_space.h (struct ipc_space): Add radix tree. + (ipc_reverse_insert): New function. + (ipc_reverse_remove): Likewise. + (ipc_reverse_remove_all): Likewise. + (ipc_reverse_lookup): Likewise. + * ipc/ipc_right.c (ipc_right_clean): Update comment. + +2015-05-20 Justus Winter <4winter@informatik.uni-hamburg.de> + + ipc: undo manual inlining of `ipc_entry_X' functions + Today we can rely on the compiler to inline functions. Undoing this + manual optimization is a first step to replace the IPC tables. + + * ipc/mach_msg.c (mach_msg_trap): Undo the manual inlining of + `ipc_entry_lookup', `ipc_entry_dealloc', and `ipc_entry_get'. + * ipc/ipc_kmsg.c (ipc_kmsg_copyin_header, ipc_kmsg_copyout_header): Likewise. + * kern/exception.c (exception_raise): Likewise. + * kern/ipc_mig.c (fast_send_right_lookup): Likewise. + +2015-05-20 Justus Winter <4winter@informatik.uni-hamburg.de> + + kern: add radix tree library + Import a radix tree library from Richard Braun's librbraun. + + * Makefile.am (clib_routines): Steal `__ffsdi2'. + * Makefrag.am (libkernel_a_SOURCES): Add new files. + * kern/rdxtree.c: New file. + * kern/rdxtree.h: Likewise. + * kern/rdxtree_i.h: Likewise. + * kern/startup.c (setup_main): Initialize radix tree library. + +2015-05-20 Justus Winter <4winter@informatik.uni-hamburg.de> + + kern: gracefully handle resource shortage + * kern/thread.c (stack_alloc): Report resource shortage. + * kern/sched_prim.h (stack_alloc): Adjust declaration accordingly. + * kern/thread_swap.c (thread_doswapin): Report resource shortage. + (swapin_thread_continue): If the swap-in fails, put the thread back on + the queue and go back to sleep. + * kern/thread_swap.h (thread_doswapin): Adjust declaration accordingly. + + vm: gracefully handle resource shortage + * vm/vm_object.c (vm_object_copy_call): Gracefully handle resource + shortage by doing the allocation earlier and aborting the function if + unsuccessful. + + kern: gracefully handle resource shortage + * kern/task.c (task_create): Gracefully handle resource shortage. + +2015-05-19 Justus Winter <4winter@informatik.uni-hamburg.de> + + kern: import `macros.h' from x15 + Import the macro definitions from the x15 kernel project, and replace + all similar definitions littered all over the place with it. + + Importing this file will make importing code from the x15 kernel + easier. We are already using the red-black tree implementation and + the slab allocator from it, and we will import even more code in the + near future. + + * kern/list.h: Do not define `structof', include `macros.h' instead. + * kern/rbtree.h: Likewise. + * kern/slab.c: Do not define `ARRAY_SIZE', include `macros.h' instead. + * i386/grub/misc.h: Likewise. + * i386/i386/xen.h: Do not define `barrier', include `macros.h' instead. + * kern/macro_help.h: Delete file. Replaced by `macros.h'. + * kern/macros.h: New file. + * Makefrag.am (libkernel_a_SOURCES): Add new file, remove old file. + * device/dev_master.h: Adopt accordingly. + * device/io_req.h: Likewise. + * device/net_io.h: Likewise. + * i386/intel/read_fault.c: Likewise. + * ipc/ipc_kmsg.h: Likewise. + * ipc/ipc_mqueue.h: Likewise. + * ipc/ipc_object.h: Likewise. + * ipc/ipc_port.h: Likewise. + * ipc/ipc_space.h: Likewise. + * ipc/ipc_splay.c: Likewise. + * ipc/ipc_splay.h: Likewise. + * kern/assert.h: Likewise. + * kern/ast.h: Likewise. + * kern/pc_sample.h: Likewise. + * kern/refcount.h: Likewise. + * kern/sched.h: Likewise. + * kern/sched_prim.c: Likewise. + * kern/timer.c: Likewise. + * kern/timer.h: Likewise. + * vm/vm_fault.c: Likewise. + * vm/vm_map.h: Likewise. + * vm/vm_object.h: Likewise. + * vm/vm_page.h: Likewise. + +2015-05-17 Justus Winter <4winter@informatik.uni-hamburg.de> + + i386: avoid compiler warning + * i386/i386/phys.c (pmap_zero_page, pmap_copy_page, copy_to_phys, + copy_from_phys): Avoid compiler warning about `map' being used + uninitialized. + +2015-05-14 Justus Winter <4winter@informatik.uni-hamburg.de> + + i386: use macro to compute address of saved registers + * i386/i386/pcb.c (stack_attach): Use `USER_REGS'. + (stack_handoff): Likewise. + +2015-05-02 Samuel Thibault + + Fix semaphore failure path special calling convention + * linux/src/include/asm-i386/semaphore.h (down): Pass semaphore address to + down_failed through ecx. + (down_interruptible): Likewise to down_failed_interruptible. + (up): Likewise to up_wakeup. + +2015-05-02 Justus Winter <4winter@informatik.uni-hamburg.de> + + kern: fix comment + * kern/rbtree.h: Fix comment. + +2015-05-02 Samuel Thibault + + Fix warning + * i386/i386at/rtc.c (rtcget, rtcput): Make functions take an rtc_st + structure which it casts to char * itself. + + Fix warnings + * device/ds_routines.c (device_open, ds_open_done, device_close, + device_write, device_write_inband, ds_write_done, device_read, + device_read_inband, ds_read_done, device_set_status, mach_device_get_status, + device_set_filter, device_map, ds_no_senders): Convert from K&R declaration, + fix type of `device' into void*. + + Fix block_io_mmap prototype + * device/blkio.c (block_io_mmap): Fix prototype of dummy function. + * device/blkio.h (block_io_mmap): Likewise. + +2015-05-01 Samuel Thibault + + Use gnu89 inline style + * Makefile.am (AM_CFLAGS): Add -fgnu89-inline option. + +2015-05-01 Samuel Thibault + + Replace clobbers with earlyclobbers + Newer gccs consider the former "impossible" + + * linux/src/include/asm-i386/bitops.h (find_first_zero_bit): Replace + clobbers with earlyclobbers. + * linux/src/include/asm-i386/semaphore.h (down, down_interruptible, up): + Likewise. + +2015-04-30 Samuel Thibault + + Fix build with gcc-5 + * linux/src/include/linux/compiler-gcc5.h: New file. + +2015-04-24 Justus Winter <4winter@informatik.uni-hamburg.de> + + kern: avoid hardcoding the lowest priority + The number of priorities has been changed from 32 to 50 in + 6a234201081156e6d5742e7eeabb68418b518fad. + + * kern/syscall_subr.c (thread_depress_priority): Avoid hardcoding the + lowest priority. + +2015-04-23 Justus Winter <4winter@informatik.uni-hamburg.de> + + kern: disable stack allocation counters by default + Disable the stack allocation counters by default. Casual checking + revealed that the hits-to-miss ratio is excellent. + + * kern/thread.c (stack_alloc_{hits,misses,max}): Move variables... + * kern/counters.c: ... here, and add the usual counter prefix. + * kern/counters.h: New declarations. + +2015-04-23 Samuel Thibault + + Avoid accessing ip_protected_payload without the lock. + * ipc/ipc_kmsg.c (ipc_kmsg_copyout_header): Avoid accessing + dest->ip_protected_payload without the lock. + * ipc/mach_msg.c (ipc/mach_msg.c): Avoid accessing + dest_port->ip_protected_payload without the lock. + + Prepend 0x to hexadecimal offset + * i386/i386/db_trace.c (db_i386_stack_trace): Prepend 0x to hexadecimal offset. + 2015-04-10 Thomas Schwinge GNU Mach 1.5.