summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2016-08-31Avoid using non-ascii source encodingSamuel Thibault
* xen/console.c (hypcnintr): Replace latin1 £ character with the 0xA3 number.
2016-08-29vm: fix boot on xenRichard Braun
* vm/vm_map.c (_vm_map_entry_create: Make sure there is a thread before accessing VM privilege.
2016-08-26Revert "Fix documentation for vm_map"Samuel Thibault
This reverts commit 57694037a02dda29bd678dc3b8531bd437682ba7. We rather prefer the kernel just use whatever slot it sees fit. Userland has already been fixed into not using the behavior anyway.
2016-08-25Add missing memory barriers in simple lock debuggingSamuel Thibault
* kern/lock.c (_simple_lock, _simple_lock_try, simple_unlock): Add compiler memory barrier to separate simple_locks_taken update from information filling.
2016-08-25Use invlpg for single-page pagetable changesSamuel Thibault
* i386/intel/pmap.c (INVALIDATE_TLB): When e-s is constant, equal to PAGE_SIZE, use just one invlpg instruction to flush the TLB.
2016-08-25Drop unused macroSamuel Thibault
* i386/intel/pmap.c (MAX_TBIS_SIZE): Drop unused macro.
2016-08-16Replace libc string functions with internal implementationsRichard Braun
* Makefile.am (clib_routines): Remove memcmp, memcpy, memmove, strchr, strstr and strsep. * kern/strings.c (memset): Comment out. (strchr, strsep, strstr): New functions.
2016-08-16i386: import string functions from X15 and relicense to GPLv2+Richard Braun
* i386/Makefrag.am (libkernel_a_SOURCES): Add i386/i386/strings.c. * i386/i386/strings.c: New file.
2016-08-12i386: request the boot loader to page-align modulesRichard Braun
* i386/i386at/boothdr.S (MULTIBOOT_FLAGS): Set LSB bit.
2016-08-07VM: fix pageout-related deadlockRichard Braun
* vm/vm_map.c (_vm_map_entry_create): Temporarily set the current thread as VM privileged.
2016-08-06Augment VM maps with task namesRichard Braun
This change improves the clarity of "no more room for ..." VM map allocation errors. * kern/task.c (task_init): Call vm_map_set_name for the kernel map. (task_create): Call vm_map_set_name where appropriate. * vm/vm_map.c (vm_map_setup): Set map name to NULL. (vm_map_find_entry_anywhere): Update error message to include map name. * vm/vm_map.h (struct vm_map): New `name' member. (vm_map_set_name): New inline function.
2016-06-29Fix page fault in critical section in the slab allocatorRichard Braun
* kern/slab.c (host_slab_info): Use wired kernel memory to build the cache info.
2016-06-29Fix locking error in the slab allocatorRichard Braun
* kern/slab.c (kmem_slab_create): Set `slab->cache` member. (kmem_cache_reap): Return dead slabs instead of destroying in place. (slab_collect): Destroy slabs outside of critical section. * kern/slab.h (struct kmem_slab): New `cache` member.
2016-06-27Fix locking errorRichard Braun
* i386/i386/io_perm.c (no_senders): Remove bogus call to ip_lock.
2016-06-17Change page cache statisticsRichard Braun
Instead of reporting statistics about unreferenced objects (the object cache), report statistics about external objects (the page cache). * vm/vm_object.c (vm_object_cached_count): Remove variable. (vm_object_cache_add): Remove object cache stats updates. (vm_object_cache_remove): Likewise. (vm_object_terminate): Update page cache stats. * vm/vm_object.h (vm_object_cached_count): Remove variable. (vm_object_cached_pages): Likewise. (vm_object_cached_pages_lock_data): Likewise. (vm_object_cached_pages_update): Remove macro. (vm_object_external_count): New extern variable. (vm_object_external_pages): Likewise. * vm/vm_resident.c (vm_object_external_count): New variable. (vm_object_external_pages): Likewise. (vm_page_insert): Remove object cache stats updates and update page cache stats. (vm_page_replace): Likewise. (vm_page_remove): Likewise. * vm/vm_user.c (vm_cache_statistics): Report page cache stats instead of object cache stats.
2016-06-10Allow setting x86 debug flags for the current threadSamuel Thibault
* kern/thread.c (thread_get_state): Allow call for the current thread, without suspending it. (thread_set_status): Likewise.
2016-06-10Use int3 on x86_64 build tooSamuel Thibault
* kern/debug.c (SoftDebugger) [__x86_64__]: Use int3 instruction to trigger debugger.
2016-06-09Fix overflow checking on VM map copyinRichard Braun
* vm/vm_map (vm_map_copyin, vm_map_copyin_page_list): Check overflow before page alignment of source data.
2016-06-07Fix deadlockRichard Braun
* vm/vm_map.c (vm_map_copyout_page_list): Fix call to vm_map_find_entry_anywhere to avoid relocking VM map.
2016-06-02Fix some license headers.Richard Braun
As the original author of the files imported, I explicitely dual license them to something compatible with GPLv2. kern/macros.h: Switch license from GPLv3 to BSD 2-clause. kern/rdxtree_i.h: Likewise.
2016-05-26Fix buffer size passed to scsi_do_cmdSamuel Thibault
* linux/src/drivers/scsi/eata_dma_proc.c (eata_proc_info): Increase cmd size to 12. * linux/src/drivers/scsi/sd.c (do_sd_request, sd_init_done): Likewise. * linux/src/drivers/scsi/sr.c (do_sr_request, sr_init_done): Likewise. * linux/src/drivers/scsi/sr_ioctl.c (sr_ioctl): Likewise with sr_cmd.
2016-05-26Cope with getc returning -1Samuel Thibault
* i386/i386at/lpr.c (lprstart): Use int instead of char to store result of getc, so as to return in case of getting -1.
2016-05-26Fix potential divisal by zeroSamuel Thibault
* kern/debug.c (panic, log): Pass 16 as default radix to _doprnt.
2016-05-23Fix getting ELF symbol bind and typeSamuel Thibault
ddb/db_elf.c (elf_db_search_symbol): Use ELF32_ST_BIND and ELF32_ST_TYPE to access symbol bind and type.
2016-05-20vm_map: back allocations with a red-black treeRichard Braun
This change augments VM maps with a gap tree, sorted by gap size, to use for non-fixed allocations. * vm/vm_map.c: Include kern/list.h. (vm_map_entry_gap_cmp_lookup, vm_map_entry_gap_cmp_insert, vm_map_gap_valid, vm_map_gap_compute, vm_map_gap_insert_single, vm_map_gap_remove_single, vm_map_gap_update, vm_map_gap_insert, vm_map_gap_remove, vm_map_find_entry_anywhere): New functions. (vm_map_setup): Initialize gap tree. (_vm_map_entry_link): Call vm_map_gap_insert. (_vm_map_entry_unlink): Call vm_map_gap_remove. (vm_map_find_entry, vm_map_enter, vm_map_copyout, vm_map_copyout_page_list, vm_map_copyin): Replace look up loop with a call to vm_map_find_entry_anywhere. Call vm_map_gap_update and initialize gap tree where relevant. (vm_map_copy_insert): Turn macro into an inline function and rewrite. (vm_map_simplify): Reorder call to vm_map_entry_unlink so that previous entry is suitable for use with gap management functions. * vm/vm_map.h: Include kern/list.h. (struct vm_map_entry): New members `gap_node`, `gap_list`, `gap_size` and `in_gap_tree`. (struct vm_map_header): New member `gap_tree`.
2016-05-20xen: fix prototypeJustus Winter
Amends a7f248bf. * xen/console.h (hypcnclose): Fix type of parameter.
2016-05-18GNU Mach 1.7v1.7Thomas Schwinge
* version.m4 (AC_PACKAGE_VERSION): Set to 1.7. * NEWS: Finalize for 1.7.
2016-05-18Fix gcc-6 warningsSamuel Thibault
* ddb/db_elf.c (elf_db_sym_init): Turn `i' into unsigned. * device/ds_routines.c (ds_device_open, device_writev_trap): Likewise. * i386/i386/user_ldt.c (i386_set_ldt): Likewise for `i', `min_selector', and `first_desc'. (i386_get_ldt): Likewise for `ldt_count'. (user_ldt_free): Likewise for `i'. * i386/i386/xen.h (hyp_set_ldt): Turn `count' into unsigned long. * i386/intel/pmap.c (pmap_bootstrap): Turn `i', `j' and 'n' into unsigned. (pmap_clear_bootstrap_pagetable): Likewise for `i' and `j'. * ipc/ipc_kmsg.c (ipc_msg_print): Turn `i' and `numwords' into unsigned. * kern/boot_script.c (boot_script_parse_line): Likewise for `i'. * kern/bootstrap.c (bootstrap_create): Likewise for `n' and `i'. * kern/host.c (host_processors): Likewise for `i'. * kern/ipc_tt.c (mach_ports_register): Likewise. * kern/mach_clock.c (tickadj, bigadj): turn into unsigned. * kern/processor.c (processor_set_things): Turn `i' into unsigned. * kern/task.c (task_threads): Likewise. * kern/thread.c (consider_thread_collect, stack_init): Likewise. * kern/strings.c (memset): Turn `i' into size_t. * vm/memory_object.c (memory_object_lock_request): Turn `i' into unsigned. * xen/block.c (hyp_block_init): Use %u format for evt. (device_open): Drop unused err variable. (device_write): Turn `copy_npages', `i', `nbpages', and `j' into unsigned. * xen/console.c (hypcnread, hypcnwrite, hypcnclose): Turn dev to dev_t. (hypcnclose): Return void. * xen/console.h (hypcnread, hypcnwrite, hypcnclose): Fix prototypes accordingly. * xen/evt.c (form_int_mask): Turn `i' into int. * xen/net.c (hyp_net_init): Use %u format for evt. (device_open): Remove unused `err' variable.
2016-05-17Revert "Fix getting ELF symbol bind and type"Samuel Thibault
This reverts commit a8a52cafb5621b475737ffdc81f63703d5b37904. It seems to be breaking backtracing in ddb...
2016-05-16Fix pageout deadlockRichard Braun
The pageout daemon uses small, internal, temporary objects to transport the data out to memory managers, which are expected to release the data once written out to backing store. Releasing this data is done with a vm_deallocate call. The problem with this is that vm_map is allowed to merge these objects, in which case vm_deallocate will only remove a reference instead of releasing the underlying pages, causing the pageout daemon to deadlock. This change makes the pageout daemon mark these objects so that they don't get merged. * vm/vm_object.c (vm_object_bootstrap): Update template. (vm_object_coalesce): Don't coalesce if an object is used for pageout. * vm/vm_object.h (struct vm_object): New `used_for_pageout` member. * vm/vm_pageout.c (vm_pageout_page): Mark new objects for pageout.
2016-05-15Fix warningRichard Braun
ddb/db_output.c (db_printf): Return 0. ddb/db_printf.h (db_printf): Change declaration to return an int.
2016-04-21Fix xen bootSamuel Thibault
* i386/i386/pcb.c (pcb_init): Make sure there is a thread before calling current_task().
2016-04-20Fix type of program counter argumentJustus Winter
* i386/i386/hardclock.c (hardclock): Use '0' instead of 'NULL'. * vm/vm_fault (vm_fault_cleanup): Likewise.
2016-04-20xen: fix buildJustus Winter
* i386/xen/xen.c (hypclock_machine_intr): Fix 'clock_interrupt' call. * xen/time.c (clkstart): Likewise.
2016-04-20Add kernel profiling through samplingSamuel Thibault
* NEWS: Advertise feature. * configfrac.ac (--enable-kernsample): Add option. * kern/pc_sample.h (take_pc_sample): Add usermode and pc parameter. (take_pc_sample_macro): Take usermode and pc parameters, pass as such to take_pc_sample. * kern/pc_sample.c (take_pc_sample): Use pc parameter when usermode is 1. * kern/mach_clock.c (clock_interrupt): Add pc parameter. Pass usermode and pc to take_pc_sample_macro call. * i386/i386/hardclock.c (hardclock): Pass regs->eip to clock_interrupt call on normal interrupts, NULL on interrupt interrupt. * vm/vm_fault.c (vm_fault_cleanup): Set usermode to 1 and pc to NULL in take_pc_sample_macro call.
2016-04-17Add memory barrier to spl*Samuel Thibault
* i386/i386/spl.S (mb): Define macro (SETIPL, spl0, spl7): Call mb.
2016-04-17Avoid using C99 for variable declaration for nowSamuel Thibault
* kern/gsync.c (gsync_setup): Declare `i' variable out of for loop.
2016-04-15update NEWS fileSamuel Thibault
2016-04-15Lightweight synchronization mechanismAgustina Arzille
* Makefrag.am (libkernel_a_SOURCES): Add kern/gsync.c and kern/gsync.h. * include/mach/gnumach.defs (gsync_wait, gsync_wake, gsync_requeue): New routines. * include/mach/kern_return.h (KERN_TIMEDOUT, KERN_INTERRUPTED): New error codes. * kern/gsync.c: New file. * kern/gsync.h: New file. * kern/startup.c: Include <kern/gsync.h> (setup_main): Call gsync_setup.
2016-04-15Update NEWS fileJustus Winter
2016-04-15Add --disable-assert flag to disable assertionsJustus Winter
* configfrag.ac: Use 'AC_HEADER_ASSERT'. Signed-off-by: Justus Winter <justus@gnupg.org>
2016-04-15i386: Fix error handlingJustus Winter
* i386/i386at/model_dep.c (i386at_init): Fix error handling. Signed-off-by: Justus Winter <justus@gnupg.org>
2016-04-05Fix bootstraping issues with stdint.h.Flavio Cruz
* include/mach/std_types.h: Do not include stdint.h. * kern/rdxtree.h: Replace sys/types.h with stdint.h.
2016-04-04Follow-up stdint useSamuel Thibault
7bbfa39f59dcbc55b21d31abb9e2febef6a51ebb ('Use uint32_t instead of unsigned32_t.') missed some Xen code * xen/net.c (recompute_checksum): Use stdint.h types. * xen/time.c (hyp_get_stime): Likewise.
2016-04-04Use uint32_t instead of unsigned32_t.Flavio Cruz
Implement stdint.h and use it in gnumach. Remove old type definitions such as signed* and unsigned*. * Makefile.am: Add -ffreestanding. * i386/i386/xen.h: Use uint64_t. * i386/include/mach/i386/machine_types.defs: Use uint32_t and int32_t. * i386/include/mach/i386/vm_types.h: Remove definitions of int*, uint*, unsigned* and signed* types. * i386/xen/xen.c: Use uint64_t. * include/device/device_types.defs: Use uint32_t. * include/mach/std_types.defs: Use POSIX types. * include/mach/std_types.h: Include stdint.h. * include/stdint.h: New file with POSIX types. * include/sys/types.h: Include stdint.h. * ipc/ipc_kmsg.c: Use uint64_t. * kern/exception.c: Use uint32_t. * linux/dev/include/linux/types.h: Remove POSIX types. * xen/block.c: Use uint64_t. * xen/net.c: Do not use removed unsigned*_t types. * xen/ring.h: Use uint32_t instead. * xen/store.c: Use uint32_t. * xen/store.h: Use uint32_t. * xen/time.c: Use POSIX types only. * xen/time.h: Use uint64_t.
2016-03-19Make kernel mapping start address configurableSamuel Thibault
and move it to 16MiB by default to free 24bit DMA area * i386/configfrag.ac (--with-_START_MAP): Add option, default to 0x1000000. * i386/Makefrag.am (_START_MAP): Set to $(_START_MAP). (_START): Set to _START_MAP+0xC0000000.
2016-03-19Fix getting ELF symbol bind and typeSamuel Thibault
ddb/db_elf.c (elf_db_search_symbol): Use ELF32_ST_BIND and ELF32_ST_TYPE to access symbol bind and type.
2016-03-13Avoid panics on physical memory exhaustionRichard Braun
* vm/vm_resident (vm_page_grab_contig): Return NULL instead of calling panic on memory exhaustion.
2016-03-11Ship missing filesSamuel Thibault
Makefrag.am (libkernel_a_SOURCES): Add kern/log2.h. (EXTRA_DIST): Add kern/exc.defs. i386/Makefrag.am (libkernel_a_SOURCES): Add i386/i386at/elf.h.
2016-03-11Merge remote-tracking branch 'remotes/origin/rbraun/vm_cache_policy'Richard Braun
Finally ;-).