aboutsummaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Fix commentsSamuel Thibault2013-01-282-3/+3
|
* Fix build with --disable-pseudo-physSamuel Thibault2013-01-281-1/+1
| | | | * i386/i386/i386asm.sym (PFN_LIST) [!MACH_PSEUDO_PHYS]: Do not define.
* Add initial code for disabling ring1 xen executionSamuel Thibault2013-01-283-1/+17
| | | | | | | * xen/configfrag.ac (--disable-ring1): Add option. * i386/xen/xen_boothdr.S (XEN_ELFNOTE_FEATURES) [!MACH_RING1]: Add supervisor_mode_kernel. * i386/i386/seg.h (KERNEL_RING) [!MACH_RING1]: Set macro to 0.
* Add initial code for disabling PV descriptorsSamuel Thibault2013-01-2812-55/+73
| | | | | | | | | | | | | | | | | * xen/configfrag.ac (--disable-pv-descriptors): Add option * i386/xen/xen_boothdr.S (XEN_ELFNOTE_FEATURES) [!MACH_PV_DESCRIPTORS]: Add writable_descriptor_tables. * i386/i386/gdt.c: Turn appropriate MACH_XEN/MACH_HYP tests into MACH_PV_DESCRIPTORS tests. * i386/i386/gdt.h: Likewise. * i386/i386/i386asm.sym: Likewise. * i386/i386/idt.c: Likewise. * i386/i386/idt_inittab.S: Likewise. * i386/i386/ldt.c: Likewise. * i386/i386/pcb.c: Likewise. * i386/i386/seg.h: Likewise. * i386/i386/user_ldt.c: Likewise. * i386/i386/user_ldt.h: Likewise.
* Add the mach_print debugging system callRichard Braun2013-01-224-1/+23
| | | | | | | | | | | | The purpose of this system call is to help debugging in situations where it's desirable to bypass the mach_msg call entirely. * include/mach/syscall_sw.h (mach_print): Generate system call code. * kern/syscall_subr.c: Include <kern/printf.h>. [MACH_KDB] (mach_print): New function. * kern/syscall_subr.h (mach_print): New prototype. * kern/syscall_sw.c [MACH_KDB] (mach_trap_table): Declare mach_print system call.
* Merge branch 'master' of git.savannah.gnu.org:/srv/git/hurd/gnumachSamuel Thibault2013-01-132-4/+38
|\
| * Fix slab cache list lockingRichard Braun2013-01-081-4/+4
| | | | | | | | | | | | | | This problem was overlooked because of simple locks being no-ops. * kern/slab.c (slab_collect): Fix lock name to kmem_cache_list_lock. (host_slab_info): Likewise.
| * Add function to dump a raw summary of the slab allocator stateRichard Braun2013-01-082-0/+34
| | | | | | | | | | | | | | | | | | The purpose of this function is to allow kernel code to display the state of the slab caches in situations where the host_slab_info RPC wouldn't be available, e.g. before a panic. * kern/slab.c (slab_info): New function. * kern/slab.h: Add declaration for slab_info.
* | Fix task stats incrementationsSamuel Thibault2013-01-131-3/+3
| | | | | | | | | | * vm/vm_fault.c (vm_fault_page): Properly increment current_task()->zero_fills and cow_faults.
* | Add statistics for task_events_infoDavid Höppner2013-01-136-2/+60
|/ | | | | | | | | | | | | | * ipc/ipc_mqueue.c (ipc_mqueue_send, ipc_mqueue_receive): Increment counters for message sent and received. * kern/ipc_kobject.c (ipc_kobject_server): Increment sent and received counters for the kernel task. * kern/task.c (task_create): Zero statistics. * kern/task.c (task_info): Add task_events_info call. * kern/task.h: Add statistics. * vm/vm_fault.c (vm_fault_page): Increment zero_fills, pageins, reactivations and cow_faults counters. * vm/vm_fault.c (vm_fault_wire_fast): Increment faults counters. * vm/vm_pageout.c (vm_pageout_scan): Increment reactivations counter.
* Double KENTRY_DATA_SIZESamuel Thibault2013-01-061-1/+2
| | | | * vm/vm_map.h (KENTRY_DATA_SIZE): Bump from 32 pages to 64 pages.
* Fix compilation warning implicit function declaration kdbprintfDavid Höppner2013-01-047-3/+29
| | | | | | | | | | | | | When kernel debugger support is requested ipc and vm need the prototype for the debugger function kdbprintf. * ddb/db_output.h: Add prototype for kdbprintf. * ipc/ipc_object.c: Add include file ddb/db_output.h * ipc/ipc_port.c: Likewise. * ipc/ipc_pset.c: Likewise. * vm/vm_map.c: Likewise. * vm/vm_object.c: Likewise. * vm/vm_resident.c: Likewise.
* Fix slow boot in virtualboxSamuel Thibault2012-12-273-4/+9
| | | | | | | | | | | By disabling some of the most slow drivers by default, and giving progress feedback to the user. * linux/configfrag.ac (CONFIG_SCSI_NCR53C7xx, CONFIG_SCSI_AIC7XXX, CONFIG_SCSI_GDTH): Disable by default * linux/src/drivers/scsi/eata.c (__initfunc): Don't feed line in probe message. * linux/src/drivers/scsi/hosts.c (scsi_init): Print SCSI probe progress.
* Fix spurious error on accessing fd1Samuel Thibault2012-12-271-0/+2
| | | | | | | Cherry picked from Linux kernel commit 76c25284e0d845bff4ee1031721556148af4db1c * linux/dev/drivers/block/floppy.c (config_types): Clear from `allowed_drive_mask' floppy drives whose cmos type is 0.
* Merge branch 'master' of git.savannah.gnu.org:/srv/git/hurd/gnumachSamuel Thibault2012-12-234-109/+135
|\
| * ide: Increase WAIT_DRQ to accomodate some CF cards and SSD drives.David S. Miller2012-12-211-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | Based upon a patch by Philippe De Muyter, and feedback from Mark Lord and Robert Hancock. As noted by Mark Lord, the outdated ATA1 spec specifies a 20msec timeout for setting DRQ but lots of common devices overshoot this. Signed-off-by: David S. Miller <davem@davemloft.net> (cherry picked from Linux kernel commit 602da297e293eb2cbd28dcdbbe247593a46a853a) * linux/src/drivers/block/ide.h (WAIT_DRQ): Increase to 1 s.
| * IDE disk drives with unusual C/H/S.Thomas Schwinge2012-12-211-25/+48
| | | | | | | | * linux/src/drivers/block/ide.c: Partially update to Linux 2.0.40 code.
| * Fix kernel task creation timeRichard Braun2012-12-051-2/+2
| | | | | | | | | | | | | | The mapable_time_init function is called before machine_init, but the latter sets the system boot time. Fix their calling order. * kern/startup.c (setup_main): Call machine_init before mapable_time_init.
| * Strongly reduce risks of name capture in rbtree macrosRichard Braun2012-12-041-81/+83
| | | | | | | | | | | | | | | | | | * kern/rbtree.h (rbtree_lookup): Prefix local variable names with three underscores. (rbtree_lookup_nearest): Likewise. (rbtree_insert): Likewise. (rbtree_lookup_slot): Likewise. (rbtree_insert_slot): Rewrite as an inline function.
* | Make thread_suspend wait for !TH_UNINTSamuel Thibault2012-12-232-3/+8
|/ | | | | | | | | | 0a55db5 made thread_suspend return KERN_FAILURE when the target thread is in TH_UNINT state. That however is not currently handled by libc, and it's more useful to just wait for the thread to get interruptible. * kern/sched_prim.c (thread_invoke): Wake NEW_THREAD->STATE for thread_suspend. * kern/thread.c (thread_suspend): Wait on NEW_THREAD->STATE as long as THREAD has TH_UNINT.
* Fix calls to vm_map when size is 0Richard Braun2012-11-202-0/+6
| | | | | * vm/vm_map.c (vm_map_enter): return KERN_INVALID_ARGUMENT if size is 0. * vm/vm_user.c (vm_map): Likewise.
* Fix compilation error with older versions of GCCMatthew Leach2012-11-191-1/+3
| | | | | | | | | | Some versions of GCC will error if you define a type twice (even if the definition is the same). The NCR53C8XX SCSI driver defines 'vm_offset_t', this is also defined in vm_types.h and will therefore cause a compilation error depending on the GCC version. * linux/src/drivers/scsi/ncr53c8xx.c [!MACH] (vm_offset_t, vm_size_t): Don't define types.
* Fix gnumach_server_routine prototypeSamuel Thibault2012-09-231-1/+1
| | | | | * kern/ipc_kobject.c (ipc_kobject_server): Set gnumach_server_routine prototype to mig_routine_t.
* Add missing file for page statisticsRichard Braun2012-09-231-0/+23
| | | | * kern/gnumach.srv: New file.
* Add missing file for page statisticsRichard Braun2012-09-231-0/+41
| | | | * include/mach/vm_cache_statistics.h: New file
* Fix panic on irq >= 16Gianluca Guida2012-09-231-1/+1
| | | | | | * linux/src/drivers/net/pci-scan.c (pci_drv_register): Skip device if we are getting an invalid IRQ >= 16 and different from 255 (it happens in some motherboard).
* Update DMA auto-enabling, make forcing DMA an optionSergio Lopez2012-09-235-193/+690
| | | | | | | | | | | | | | * linux/configfrag.ac (--enable-ide-forcedma): Add option. * linux/src/drivers/block/ide.c (ide_probe_promise_20246): Do not call ide_init_promise. (probe_for_hwifs): Add SI, VIA, AL PCI probing. * linux/src/drivers/block/ide.h (hwif_chipset_t): Add hpt343, udma and ultra66 chipsets. * linux/src/drivers/block/triton.c: Update to upstream 1.14 version. * linux/src/include/linux/hdreg.h (HDIO_GET_IDENTITY): Rename to ... (HDIO_OBSOLETE_IDENTITY): ... new macro. (HDIO_GET_IDENTITY): New macro. (hd_driveid): Add fields for extended identification.
* Fix CDROM door unlock on closure without device_closeAlexey Dejneka2012-09-231-8/+26
| | | | | | | | | | * linux/dev/glue/block.c (device_open): Properly return devp on multiple opens. (device_close_forced): Renamed from device_close, when force parameter is 1, do not wait for open_count to become 0 before closing. (device_close): New function. (device_no_senders): New function. linux_block_emulation_ops: Use (device_no_senders).
* Provide basic page cache statisticsRichard Braun2012-09-239-2/+126
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Makefrag.am (EXTRA_DIST): Add kern/gnumach.srv. (include_mach_HEADERS): Add include/mach/gnumach.defs and include/mach/vm_cache_statistics.h (nodist_libkernel_a_SOURCES): Add kern/gnumach.server.defs.c, kern/gnumach.server.h, kern/gnumach.server.c, kern/gnumach.server.msgids, kern/gnumach.server.defs. * include/mach/mach_types.h: Add #include <mach/vm_cache_statistics.h>. * kern/ipc_kobject.c (ipc_kobject_server): Declare and call gnumach_server_routine. * vm/vm_object.c (vm_object_cached_pages): New variable. (vm_object_cached_pages_lock_data): Likewise. (vm_object_deallocate): Update number of cached pages. (vm_object_lookup): Likewise. (vm_object_lookup_name): Likewise. (vm_object_destroy): Likewise. (vm_object_enter): Likewise. * vm/vm_object.h (ref_count): Declare as int. (resident_page_count): Likewise. (vm_object_cached_count): Add extern declaration. (vm_object_cached_pages): Likewise. (vm_object_cached_pages_lock_data): Likewise. (vm_object_cached_pages_update): New macro. * vm/vm_resident.c (vm_page_insert): Assert resident page count doesn't overflow, update number of cached pages as appropriate. (vm_page_replace): Likewise. (vm_page_remove): Update number of cached pages as appropriate. * vm/vm_user.c: Add #include <mach/vm_cache_statistics.h>. (vm_cache_statistics): New function. * vm/vm_user.h: Add #include <mach/mach_types.h>. (vm_cache_statistics): New declaration. * include/mach/gnumach.defs: New file.
* Store threads waiting on a message queue in LIFO orderRichard Braun2012-08-241-0/+6
| | | | | * ipc/ipc_thread.h (ipc_thread_enqueue_macro): Insert thread at the head of the list instead of the tail.
* Fix Xen boot at linear address 0xC0000000Samuel Thibault2012-07-141-7/+9
| | | | | * i386/intel/pmap.c (pmap_bootstrap): Interate over linear addresses and compute l3 and l2 offsets from it instead of assuming nul l3 offset.
* Fix slab collection timingRichard Braun2012-07-081-4/+4
| | | | | | | | | The slab garbage collector uses sched_tick as its time reference, which is increased every seconds, while the interval is expressed in clock ticks. Use the proper time reference instead. * kern/slab.c (kmem_gc_last_tick): Declare as unsigned long. (slab_collect): Use elapsed_ticks instead of sched_tick.
* Increase the slab collection intervalRichard Braun2012-07-071-1/+1
| | | | * kern/slab.c (KMEM_GC_INTERVAL): Increase to 5 seconds.
* Allocate kernel thread stacks out of kmem_mapRichard Braun2012-07-071-2/+2
| | | | | | | | | | The kernel submaps eat most of the available kernel space. Using the main kernel map for thread stacks sometimes lead to exhaustion when many threads are created. Use kmem_map instead to increase this limit. * kern/thread.c (stack_alloc): Use kmem_map instead of kernel_map for stack allocation. (stack_collect): Likewise for release.
* Merge kalloc_map into kmem_mapRichard Braun2012-07-073-22/+8
| | | | | | | | | | | | | | | | | * ipc/ipc_table.c: Add #include <kern/slab.h>. (ipc_table_alloc): Use kmem_map instead of kalloc_map when allocating a table. (ipc_table_realloc): Likewise for reallocation. (ipc_table_free): Likewise for release. * kern/kalloc.h (kalloc_map): Remove declaration. * kern/slab.c (KMEM_MAP_SIZE): Increase to 128 MiB. (KALLOC_MAP_SIZE): Remove macro. (kalloc_map_store): Remove variable. (kalloc_map): Likewise. (kalloc_pagealloc): Use kmem_map instead of kalloc_map for general purpose allocations. (kalloc_pagefree): Likewise. (kalloc_init): Remove the creation of kalloc_map.
* Permit to select/deselect whole driver groupsSamuel Thibault2012-06-101-1/+14
| | | | | | | * linux/configfrag.ac (AC_OPTION_Linux_group): New function (AC_OPTION_Linux_ix86_at): Do not enable driver by default if the group was explicitly disabled. (scsi, net, pcmcia, wireless): Define groups.
* Offset bios32 entrySamuel Thibault2012-05-171-2/+2
| | | | | * linux/src/arch/i386/kernel/bios32.c (check_pcibios, pcibios_init): Convert physical bios32 entry address to kernel virtual address.
* Clear direction flag after bios32 callSamuel Thibault2012-05-171-10/+10
| | | | | | | | | | Linux does this, there are probably wild BIOSes out there. * linux/src/arch/i386/kernel/bios32.c (bios32_service, check_pcibios, pci_bios_find_class, pci_bios_find_device, pci_bios_read_config_byte, pci_bios_read_config_word, pci_bios_read_config_dword, pci_bios_write_config_byte, pci_bios_write_config_word, pci_bios_write_config_dword): Clear direction flag after lcall to bios32.
* Offset kernel addresses by 3GiBSamuel Thibault2012-05-052-5/+4
| | | | | | | This permits better trace support in kdb. * i386/i386/vm_param.h (VM_MIN_KERNEL_ADDRESS): Set to 0xC0000000 * i386/Makefrag.am (_START): Set to 0xC0100000.
* Document how to offset the kernel to get better debuggingSamuel Thibault2012-05-051-0/+5
| | | | | | * i386/i386/vm_param.h (VM_MIN_KERNEL_ADDRESS): Document that it can be changed, but _START has to be offset too. (INIT_VM_MIN_KERNEL_ADDRESS): Document that it should remain 0.
* Augment VM maps with a red-black treeRichard Braun2012-04-272-52/+76
| | | | | | | | | | | | | | | | | * vm/vm_map.c: Add #include <kern/rbtree.h>. (vm_map_setup): Initialize the map red-black tree. (vm_map_entry_cmp_lookup): New function. (vm_map_entry_cmp_insert): Likewise. (_vm_map_entry_link): Insert map entry in the red-black tree. (_vm_map_entry_unlink): Remove map entry from the red-black tree. (vm_map_lookup_entry): Rework the way the VM map hint is used, and replace the linear search with a binary search tree lookup. (vm_map_copy_insert): Move map entries from the map copy tree to the destination map tree. (vm_map_copyin): Initialize the map copy red-black tree. * vm/vm_map.h: Add #include <kern/rbtree.h>. (vm_map_entry): Add `tree_node' member. (vm_map_header): Add `tree' member.
* Update comments.Richard Braun2012-04-221-14/+12
| | | | | | Literature about red-black trees vary concerning the cases numbering, and the implementation doesn't make all of them clearly appear. Remove cases numbering references to avoid confusion.
* Fix copyright assignmentRichard Braun2012-04-226-50/+134
| | | | | | | | | | | | Maksym and I have assigned copyright to the Free Software Foundation. In addition, restore the original upstream copyrights for correctness. * kern/list.h: Fix copyright assignment. * kern/rbtree.c: Likewise. * kern/rbtree.h: Likewise. * kern/rbtree_i.h: Likewise. * kern/slab.c: Likewise. * kern/slab.h: Likewise.
* Check hyp_stack_switch returnSamuel Thibault2012-04-061-1/+2
| | | | * i386/i386/pcb.c (switch_ktss): Check value returned by hyp_stack_switch.
* Fix integer typeSamuel Thibault2012-04-061-1/+1
| | | | * kern/thread.c (host_stack_usage): Set `total' type to natural_t.
* Do not take address of va_list variableSamuel Thibault2012-04-064-18/+21
| | | | | | | | | | | This breaks on x86_64, where it is an array and thus gets bogus results. * ddb/db_output.c (db_printf, kdbprintf): Pass copy of va_list variable instead of its address. * kern/debug.c (panic, log): Likewise. * kern/printf.c (vprintf, iprintf, sprintf, vsnprintf): Likewise. (_doprnt): Take va_list instead of va_list *, fix usage and comment accordingly. * kern/printf.h (_doprnt): Take va_list instead of va_list *.
* Fix Xen boot after c74adfeSamuel Thibault2012-03-243-1/+3
| | | | | | * i386/Makefrag.am (_START_MAP): Define symbol to 0x100000. * i386/xen/Makefrag.am (_START_MAP): Define symbol to 0xC0000000. * i386/ldscript: Use _START_MAP instead of hardcoding 0x100000.
* Relocate kernel at bootupSamuel Thibault2012-03-242-0/+38
| | | | | | | | | | | | Grub is not able to map us at high addresses. We can however make it load us at low addresses (through the linker script mapping), then use segmentation to move ourselves to high addresses, and switch to C which uses high addresses (through _START definition). * i386/ldscript: Force mapping kernel at 0x100000, regardless of the value of _START. * i386/i386at/boothdr.S (boot_entry): Set up initial segments to project the bootstrap linear space to high addresses.
* Make sure BIOS area is mapped in kernel threadsSamuel Thibault2012-03-242-0/+20
| | | | | * i386/i386at/model_dep.c (i386at_init): Map BIOS memory at 0. * i386/intel/pmap.c (pmap_create): Do not map BIOS memory in user tasks.
* Separate INIT_VM_MIN_KERNEL_ADDRESS from VM_MIN_KERNEL_ADDRESSSamuel Thibault2012-03-242-9/+11
| | | | | | | | | The former is the initial value set by the bootloader. It may not be the same as what Mach will set up. * i386/i386/vm_param.h (INIT_VM_MIN_KERNEL_ADDRESS): New macro. * i386/i386at/model_dep.c (i386at_init): Use INIT_VM_MIN_KERNEL_ADDRESS instead of VM_MIN_KERNEL_ADDRESS.