aboutsummaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Add cause_ast_check prototypeSamuel Thibault2018-06-271-0/+5
| | | | | | As reported by Almudena Garcia <liberamenso10000@gmail.com> * kern/ast.h [NCPUS > 1] (cause_ast_check): Add prototype.
* Define CPU_L1_SIZE even when NCPUS != 1Samuel Thibault2018-06-271-1/+2
| | | | | | As reported by Almudena Garcia <liberamenso10000@gmail.com> * kern/cpu_number.h [NCPUS != 1] (CPU_L1_SIZE): Define macro.
* Disable position-independant compilationSamuel Thibault2018-06-271-0/+4
| | | | | | | | as now enabled automatically by some distributions... Reported and tested by Almudena Garcia <liberamenso10000@gmail.com> * Makefile.am (AM_CFLAGS): Add -no-pie -fno-pic.
* Add missing prototypeSamuel Thibault2018-06-171-0/+1
| | | | * kern/machine.h (action_thread): Add prototype.
* Re-fix typoSamuel Thibault2018-06-171-1/+1
| | | | * machine/lock.h (_simple_lock_xchg_): Remove spurious parenthesis.
* Fix typoSamuel Thibault2018-06-171-1/+1
| | | | * machine/lock.h (_simple_lock_xchg_): Add missing parenthesis.
* Keep DMA enabled on QEMU disksSamuel Thibault2018-06-131-0/+8
| | | | | | | | When the host is very loaded, some requests might time out, but that is not a reason for disabling DMA, so keep it enabled. * linux/src/drivers/block/triton.c (config_drive_for_dma): When disk is QEMU, set using_dma and keep_settings to 1.
* vm_map: Fix bugs on huge masks parametersSamuel Thibault2018-04-222-3/+5
| | | | | * vm/vm_map.c (vm_map_find_entry_anywhere): Also check that (min + mask) & ~mask remains bigger than min.
* Avoid old typeSamuel Thibault2018-03-031-4/+2
| | | | | * include/device/bpf.h: Do not include <sys/types.h> (struct bpf_version): Use unsigned short type instead of u_short.
* Add const MIG typesSamuel Thibault2018-01-282-0/+2
| | | | | | * i386/include/mach/i386/mach_i386_types.h (const_descriptor_list_t): New type. * include/mach/port.h (const_mach_port_array_t): New type.
* Fix warningSamuel Thibault2018-01-281-1/+1
| | | | * i386/i386at/lpr.c (lpropen): Cast io port to void *.
* Fix warningSamuel Thibault2018-01-281-1/+1
| | | | * vm/vm_map.c (vm_map_copyout): Fix panic format.
* Fix warningSamuel Thibault2018-01-281-1/+1
| | | | * kern/sched_prim.c (assert_wait): Fix panic format.
* Fix warningSamuel Thibault2018-01-281-1/+1
| | | | * kern/ast.c (ast_check): Fix panic format.
* Fix halt messageSamuel Thibault2017-11-121-1/+2
| | | | | * i386/i386at/model_dep.c (halt_all_cpus): Change halt message to better explain what happened.
* linux block: fix outbound access to non-directmap user dataSamuel Thibault2017-11-011-4/+6
| | | | | * linux/dev/glue/block.c (rdwr_full): Set BH_Bounce if the physical address of the user data is not in directmap.
* linux-block: Fix calling vm_map_copy_discard on uninitialized variableSamuel Thibault2017-10-311-2/+1
| | | | | | | | | This happens if passed count is 0. Reported by Richard Braun. * linux/dev/glue/block.c (device_write): Set copy variable before vm_map_copy_discard() is called.
* Fix commit 10ebf9565f69760e46a8f271e22c5367d54e10ff.Justus Winter2017-10-271-13/+0
| | | | | | * kern/task.c (task_ledger_acquire): Remove function that I added by accident. (task_ledger_release): Likewise.
* kern: Fix new task notifications.Justus Winter2017-10-261-1/+3
| | | | * kern/task.c (task_create_kernel): Handle NULL parent tasks.
* kern: Fix crash.Justus Winter2017-10-263-2/+32
| | | | | | | | | | Check receiver in task_create. Fixes a crash when sending that message to a non-task port. * kern/bootstrap.c (boot_script_task_create): Use the new function. * kern/task.c (task_create): Rename to task_create_internal, create a new function in its place that checks the receiver first. * kern/task.h (task_create_internal): New prototype.
* linux: Fix warnings.Justus Winter2017-10-261-2/+1
| | | | * linux/dev/glue/net.c (device_write): Remove unused variables.
* Drop the register qualifier.Justus Winter2017-10-236-14/+14
| | | | | | | | | * i386/intel/pmap.c: Drop the register qualifier. * ipc/ipc_kmsg.h: Likewise. * kern/bootstrap.c: Likewise. * kern/profile.c: Likewise. * kern/thread.c: Likewise. * vm/vm_object.c: Likewise.
* linux: Fix interrupt glue.Justus Winter2017-09-301-2/+16
| | | | | | | | | | | Previously, we used an invalid pointer to mark interrupts as reserved by Mach. This, however, crashes code trying to iterate over the list of interrupt handlers. Use a valid structure instead. * linux/dev/arch/i386/kernel/irq.c (reserved_mach_handler): New function. (reserved_mach): New variable. (reserve_mach_irqs): Use the new variable.
* device: Remove unused file.Justus Winter2017-09-211-44/+0
| | | | * device/dev_forward.defs: Remove unused file.
* vm: Remove old memory manager remnants.Justus Winter2017-09-211-5/+0
| | | | | * vm/vm_object.c (vm_object_accept_old_init_protocol): Remove. (vm_object_enter): Adapt.
* ddb: More gracefully handle address errorsSamuel Thibault2017-08-274-10/+12
| | | | | | | | | | | * i386/i386/db_interface.h (db_read_bytes): Return boolean_t instead of void. * i386/i386/db_interface.c (db_user_to_kernel_address): Return -1 instead of calling db_error() if address is bogus. (db_read_bytes): Return FALSE instead of calling db_error() if address is bogus. * ddb/db_access.c (db_get_task_value): Return 0 if db_read_bytes failed. * ddb/db_examine.c (db_xcdump): Only print * if db_read_bytes failed.
* i386: Fix pmap_remove on PAE kernels.Justus Winter2017-08-141-5/+3
| | | | | * i386/intel/pmap.c (pmap_remove): Fix iteration over page directory. (pmap_enter): Explain why it is ok here.
* vm: Improve error handling.Justus Winter2017-08-141-1/+5
| | | | | * vm/vm_map.c (vm_map_create): Gracefully handle resource exhaustion. (vm_map_fork): Likewise at the callsite.
* Fix typo.Justus Winter2017-08-141-1/+1
|
* ddb: Add magic variable $mapXX.Justus Winter2017-08-124-0/+38
| | | | | | | | | | Maps '$mapXX' to a VM map structure address. @var{xx} is a task identification number printed by a @code{show all tasks} command. * ddb/db_task_thread.c (db_get_map): New function. * ddb/db_task_thread.h (db_get_map): New declaration. * ddb/db_variables.c (db_vars): Add new variable. * doc/mach.texi: Document this.
* vm: Mute paging error message.Justus Winter2017-08-121-1/+1
| | | | | | * vm/vm_fault.c (vm_fault_page): Mute paging error message if the objects pager is NULL. This happens when a pager is destroyed, e.g. at system shutdown time when the root filesystem terminates.
* ddb: debug traps and port referencesJustus Winter2017-08-056-0/+80
| | | | | | | | | | | * ddb/db_command.c (db_debug_all_traps_cmd): New declaration and function. (db_debug_port_references_cmd): Likewise. * doc/mach.texi: Describe new commands. * i386/i386/db_interface.h (db_debug_all_traps): New declaration. * i386/i386/trap.c (db_debug_all_traps): New function. * ipc/mach_port.c (db_debug_port_references): New function. * ipc/mach_port.h (db_debug_port_references): New declaration.
* ddb: Print scheduling information.Justus Winter2017-08-052-7/+41
| | | | | | | | | | * ddb/db_print.c (OPTION_SCHED): New macro. (db_print_thread): Display scheduling information if the flag is given. (db_print_task): Adapt. (db_show_all_threads): Parse new modifier. (db_show_one_thread): Likewise. * doc/mach.texi: Document the new flag.
* doc: Document 'show all tasks'.Justus Winter2017-08-051-0/+4
|
* kern: Fix reporting the minimum quantum used for scheduling.Justus Winter2017-08-051-2/+3
| | | | | * kern/host.c (host_info): Scale 'min_quantum' by 'tick', then convert to milliseconds.
* Steal '__divdi3'.Justus Winter2017-08-051-0/+1
| | | | * Makefile.am (clib_routines): Steal '__divdi3' from the gcc runtime.
* i386: Make function static.Justus Winter2017-08-052-7/+1
| | | | | * i386/intel/pmap.c (pmap_remove_range): Make function static. * i386/intel/pmap.h (pmap_remove_range): Remove declaration.
* Fix year computationSamuel Thibault2017-06-101-1/+3
| | | | * i386/i386at/rtc.c (readtodc): Do not spuriously add 70 to the year.
* Fix Epoch computationSamuel Thibault2017-06-101-2/+8
| | | | | | * i386/i386at/rtc.c (CENTURY_START): New macro. (readtodc): Use CENTURY_START instead of assuming it is equal to 1970, and set yr to an absolute date before calling yeartoday.
* Support GCC 7David Michael2017-05-072-1/+68
| | | | | * Makefile.am (clib_routines): Add __udivmoddi4. * linux/src/include/linux/compiler-gcc7.h: New file.
* Merge branch 'master' of git.savannah.gnu.org:/srv/git/hurd/gnumachSamuel Thibault2017-05-071-0/+6
|\
| * kern: Make kernel task available to bootscript.Justus Winter2017-03-181-0/+6
| | | | | | | | | | | | * kern/bootstrap.c (bootstrap_create): Insert the variable 'kernel-task' into the bootscript environment. Userspace can use this instead of guessing based on the order of the first tasks.
* | Rewrite gsync so that it works with remote tasks v2Agustina Arzille2017-03-042-138/+244
|/
* Implement basic sleeping locks for gnumachAgustina Arzille2017-03-046-2/+190
| | | | | | | | | | * kern/atomic.h: New file. * kern/kmutex.h: New file. * kern/kmutex.c: New file. * Makefrag.am (libkernel_a_SOURCES): Add atomic.h, kmutex.h, kmutex.c. * kern/sched_prim.h (thread_wakeup_prim): Make it return boolean_t. * kern/sched_prim.c (thread_wakeup_prim): Return TRUE if we woke a thread, and FALSE otherwise.
* Fix bissextile years computationSamuel Thibault2017-01-241-1/+18
| | | | | | | In practice, fixes 2100, 2200, 2300, 2500, 2600, 2700, etc. * i386/i386at/rtc.c (yeartoday): Make years divisible by 100 but not divisible by 400 non-bisextile.
* VM: really fix pageout of external objects backed by the default pagerRichard Braun2016-12-272-25/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | Commit eb07428ffb0009085fcd01dd1b79d9953af8e0ad does fix pageout of external objects backed by the default pager, but the way it's done has a vicious side effect: because they're considered external, the pageout daemon can keep evicting them even though the external pagers haven't released them, unlike internal pages which must all be released before the pageout daemon can make progress. This can lead to a situation where too many pages become wired, the default pager cannot allocate memory to process new requests, and the pageout daemon cannot recycle any more page, causing a panic. This change makes the pageout daemon use the same strategy for both internal pages and external pages sent to the default pager: use the laundry bit and wait for all laundry pages to be released, thereby completely synchronizing the pageout daemon and the default pager. * vm/vm_page.c (vm_page_can_move): Allow external laundry pages to be moved. (vm_page_seg_evict): Don't alter the `external_laundry' bit, merely disable double paging for external pages sent to the default pager. * vm/vm_pageout.c: Include vm/memory_object.h. (vm_pageout_setup): Don't check whether the `external_laundry' bit is set, but handle external pages sent to the default pager the same as internal pages.
* Increase the size of the kernel mapRichard Braun2016-12-251-6/+5
| | | | | | | | Sometimes, in particular during IO spikes, the slab allocator needs more virtual memory than is currently available. The new size should also be fine for the Xen version. * i386/i386/vm_param.h (VM_KERNEL_MAP_SIZE): Increase value.
* doc: update documentation about wiringRichard Braun2016-12-241-0/+41
| | | | | * doc/mach.texi: Describe vm_wire_all, and add more information about vm_wire and vm_protect.
* VM: add the vm_wire_all callRichard Braun2016-12-247-6/+169
| | | | | | | | | | | | | | | | | This call maps the POSIX mlockall and munlockall calls. * Makefrag.am (include_mach_HEADERS): Add include/mach/vm_wire.h. * include/mach/gnumach.defs (vm_wire_t): New type. (vm_wire_all): New routine. * include/mach/mach_types.h: Include mach/vm_wire.h. * vm/vm_map.c: Likewise. (vm_map_enter): Automatically wire new entries if requested. (vm_map_copyout): Likewise. (vm_map_pageable_all): New function. vm/vm_map.h: Include mach/vm_wire.h. (struct vm_map): Update description of member `wiring_required'. (vm_map_pageable_all): New function. * vm/vm_user.c (vm_wire_all): New function.
* VM: rework map entry wiringRichard Braun2016-12-247-298/+311
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | First, user wiring is removed, simply because it has never been used. Second, make the VM system track wiring requests to better handle protection. This change makes it possible to wire entries with VM_PROT_NONE protection without actually reserving any page for them until protection changes, and even make those pages pageable if protection is downgraded to VM_PROT_NONE. * ddb/db_ext_symtab.c: Update call to vm_map_pageable. * i386/i386/user_ldt.c: Likewise. * ipc/mach_port.c: Likewise. * vm/vm_debug.c (mach_vm_region_info): Update values returned as appropriate. * vm/vm_map.c (vm_map_entry_copy): Update operation as appropriate. (vm_map_setup): Update member names as appropriate. (vm_map_find_entry): Update to account for map member variable changes. (vm_map_enter): Likewise. (vm_map_entry_inc_wired): New function. (vm_map_entry_reset_wired): Likewise. (vm_map_pageable_scan): Likewise. (vm_map_protect): Update wired access, call vm_map_pageable_scan. (vm_map_pageable_common): Rename to ... (vm_map_pageable): ... and rewrite to use vm_map_pageable_scan. (vm_map_entry_delete): Fix unwiring. (vm_map_copy_overwrite): Replace inline code with a call to vm_map_entry_reset_wired. (vm_map_copyin_page_list): Likewise. (vm_map_print): Likewise. Also print map size and wired size. (vm_map_copyout_page_list): Update to account for map member variable changes. * vm/vm_map.h (struct vm_map_entry): Remove `user_wired_count' member, add `wired_access' member. (struct vm_map): Rename `user_wired' member to `size_wired'. (vm_map_pageable_common): Remove function. (vm_map_pageable_user): Remove macro. (vm_map_pageable): Replace macro with function declaration. * vm/vm_user.c (vm_wire): Update call to vm_map_pageable.