Age | Commit message (Collapse) | Author |
|
In order to increase the amount of memory available for kernel objects,
without reducing the amount of memory available for user processes,
a new allocation strategy is introduced in this change.
Instead of allocating kernel objects out of kernel virtual memory,
the slab allocator directly uses the direct mapping of physical
memory as its backend. This largely increases the kernel heap, and
removes the need for address translation updates.
In order to allow this strategy, an assumption made by the interrupt
code had to be removed. In addition, kernel stacks are now also
allocated directly from the physical allocator.
* i386/i386/db_trace.c: Include i386at/model_dep.h
(db_i386_reg_value): Update stack check.
* i386/i386/locore.S (trap_from_kernel, all_intrs,
int_from_intstack): Update interrupt handling.
* i386/i386at/model_dep.c: Include kern/macros.h.
(int_stack, int_stack_base): New variables.
(int_stack_high): Remove variable.
(i386at_init): Update interrupt stack initialization.
* i386/i386at/model_dep.h: Include i386/vm_param.h.
(int_stack_top, int_stack_base): New extern declarations.
(ON_INT_STACK): New macro.
* kern/slab.c: Include vm/vm_page.h
(KMEM_CF_NO_CPU_POOL, KMEM_CF_NO_RECLAIM): Remove macros.
(kmem_pagealloc, kmem_pagefree, kalloc_pagealloc, kalloc_pagefree): Remove
functions.
(kmem_slab_create): Allocate slab pages directly from the physical allocator.
(kmem_slab_destroy): Release slab pages directly to the physical allocator.
(kmem_cache_compute_sizes): Update the slab size computation algorithm to
return a power-of-two suitable for the physical allocator.
(kmem_cache_init): Remove custom allocation function pointers.
(kmem_cache_reap): Remove check on KMEM_CF_NO_RECLAIM.
(slab_init, kalloc_init): Update calls to kmem_cache_init.
(kalloc, kfree): Directly fall back on the physical allocator for big
allocation sizes.
(host_slab_info): Remove checks on defunct flags.
* kern/slab.h (kmem_slab_alloc_fn_t, kmem_slab_free_fn_t): Remove types.
(struct kmem_cache): Add `slab_order' member, remove `slab_alloc_fn' and
`slab_free_fn' members.
(KMEM_CACHE_NOCPUPOOL, KMEM_CACHE_NORECLAIM): Remove macros.
(kmem_cache_init): Update prototype, remove custom allocation functions.
* kern/thread.c (stack_alloc): Allocate stacks from the physical allocator.
* vm/vm_map.c (vm_map_kentry_cache, kentry_data, kentry_data_size): Remove
variables.
(kentry_pagealloc): Remove function.
(vm_map_init): Update calls to kmem_cache_init, remove initialization of
vm_map_kentry_cache.
(vm_map_create, _vm_map_entry_dispose, vm_map_copyout): Unconditionnally
use vm_map_entry_cache.
* vm/vm_map.h (kentry_data, kentry_data_size, kentry_count): Remove extern
declarations.
* vm/vm_page.h (VM_PT_STACK): New page type.
* device/dev_lookup.c (dev_lookup_init): Update calls to kmem_cache_init.
* device/dev_pager.c (dev_pager_hash_init, device_pager_init): Likewise.
* device/ds_routines.c (mach_device_init, mach_device_trap_init): Likewise.
* device/net_io.c (net_io_init): Likewise.
* i386/i386/fpu.c (fpu_module_init): Likewise.
* i386/i386/machine_task.c (machine_task_module_init): Likewise.
* i386/i386/pcb.c (pcb_module_init): Likewise.
* i386/intel/pmap.c (pmap_init): Likewise.
* ipc/ipc_init.c (ipc_bootstrap): Likewise.
* ipc/ipc_marequest.c (ipc_marequest_init): Likewise.
* kern/act.c (global_act_init): Likewise.
* kern/processor.c (pset_sys_init): Likewise.
* kern/rdxtree.c (rdxtree_cache_init): Likewise.
* kern/task.c (task_init): Likewise.
* vm/memory_object_proxy.c (memory_object_proxy_init): Likewise.
* vm/vm_external.c (vm_external_module_initialize): Likewise.
* vm/vm_fault.c (vm_fault_init): Likewise.
* vm/vm_object.c (vm_object_bootstrap): Likewise.
* vm/vm_resident.c (vm_page_module_init): Likewise.
(vm_page_bootstrap): Remove initialization of kentry_data.
|
|
The Xen target was completely ignored when porting the biosmem and
vm_page physical memory allocators. Let's fix this.
* i386/Makefrag.am (libkernel_a_SOURCES): Add i386/i386at/biosmem.{c,h}.
* i386/i386/vm_page.h (VM_PAGE_MAX_SEGS, VM_PAGE_DIRECTMAP_LIMIT,
VM_PAGE_HIGHMEM_LIMIT): Define for Xen.
* i386/i386at/biosmem.c: Include mach/xen.h.
(biosmem_panic_setup_msg): Comment out for Xen since it's unused.
(biosmem_map_build, biosmem_map_build_simple,
biosmem_save_cmdline_sizes, biosmem_find_boot_data_update,
biosmem_find_boot_data, biosmem_setup_allocator): Likewise.
(biosmem_bootstrap_common): New function.
(biosmem_xen_bootstrap): Likewise, for Xen.
(biosmem_bootalloc): Perform bottom-up allocations for Xen.
* i386/i386at/biosmem.h (biosmem_xen_bootstrap): New prototype, for Xen.
* i386/i386at/model_dep.c (i386at_init): Call biosmem_xen_bootstrap instead
of biosmem_bootstrap on Xen.
* i386/include/mach/i386/vm_types.h (phys_addr_t): Define as an unsigned
64-bits integer when PAE is enabled.
|
|
* linux/src/drivers/block/ide.c (default_io_base): Do not qualify const.
(ide_disable_base): New function.
* linux/dev/include/linux/blk.h (ide_disable_base): New declaration.
* linux/dev/drivers/block/ahci.c (ahci_probe_dev): Call ide_disable_base
with each I/O BAR of the AHCI PCI card.
|
|
* linux/dev/drivers/block/ahci.c (ahci_probe_dev): Use
PCI_BASE_ADDRESS_SPACE_IO and PCI_BASE_ADDRESS_MEM_MASK macros instead of
hardcoded values.
|
|
* linux/dev/drivers/block/ahci.c: Print PCI bus/dev/fun number in
hexadecimal
|
|
Some hardware start shippping with no BIOS32 at all, and we'll have to
implement ACPI to get the address of the mmconfig table. In the meanwhile,
we can hope that the direct probe works (it does on HP820 for instance).
* linux/src/arch/i386/kernel/bios32.c (pcibios_init): Also try
check_direct_pci() when bios32 probing failed.
|
|
|
|
This change replaces the historical page allocator with a buddy allocator
implemented in vm/vm_page.c. This allocator allows easy contiguous allocations
and also manages memory inside segments. In a future change, these segments
will be used to service requests with special constraints, such as "usable
for 16-bits DMA" or "must be part of the direct physical mapping".
* Makefrag.am (libkernel_a_SOURCES): Add vm/vm_page.c.
* i386/Makefrag.am (libkernel_a_SOURCES): Add i386/i386at/biosmem.{c,h}.
* i386/i386/vm_param.h: Include kern/macros.h.
(VM_PAGE_DMA_LIMIT, VM_PAGE_MAX_SEGS, VM_PAGE_DMA32_LIMIT,
VM_PAGE_DIRECTMAP_LIMIT, VM_PAGE_HIGHMEM_LIMIT, VM_PAGE_SEG_DMA,
VM_PAGE_SEG_DMA32, VM_PAGE_SEG_DIRECTMAP, VM_PAGE_SEG_HIGHMEM): New macros.
* i386/i386at/model_dep.c: Include i386at/biosmem.h.
(avail_next, avail_remaining): Remove variables.
(mem_size_init): Remove function.
(i386at_init): Initialize and use the biosmem module for early physical
memory management.
(pmap_free_pages): Return phys_last_addr instead of avail_remaining.
(init_alloc_aligned): Turn into a wrapper for biosmem_bootalloc.
(pmap_grab_page): Directly call init_alloc_aligned instead of pmap_next_page.
* i386/include/mach/i386/vm_types.h (phys_addr_t): New type.
* kern/bootstrap.c (free_bootstrap_pages): New function.
(bootstrap_create): Call free_bootstrap_pages instead of vm_page_create.
* kern/cpu_number.h (CPU_L1_SIZE): New macro.
* kern/slab.h: Include kern/cpu_number.h.
(CPU_L1_SIZE): Remove macro, moved to kern/cpu_number.h.
* kern/startup.c (setup_main): Change the value of machine_info.memory_size.
* linux/dev/glue/glue.h (alloc_contig_mem, free_contig_mem): Update prototypes.
* linux/dev/glue/kmem.c (linux_kmem_init): Don't use defunct page queue.
* linux/dev/init/main.c (linux_init): Don't free unused memory.
(alloc_contig_mem, free_contig_mem): Turn into wrappers for the vm_page
allocator.
* linux/pcmcia-cs/glue/ds.c (PAGE_SHIFT): Don't undefine.
* vm/pmap.h (pmap_startup, pmap_next_page): Remove prototypes.
* vm/vm_fault.c (vm_fault_page): Update calls to vm_page_convert.
* vm/vm_init.c (vm_mem_init): Call vm_page_info_all.
* vm/vm_object.c (vm_object_page_map): Update call to vm_page_init.
* vm/vm_page.h (vm_page_queue_free): Remove variable declaration.
(vm_page_create, vm_page_release_fictitious, vm_page_release): Remove
declarations.
(vm_page_convert, vm_page_init): Update prototypes.
(vm_page_grab_contig, vm_page_free_contig): New prototypes.
* vm/vm_resident.c (vm_page_template, vm_page_queue_free,
vm_page_big_pagenum): Remove variables.
(vm_page_bootstrap): Update and call vm_page_setup.
(pmap_steal_memory): Update and call vm_page_bootalloc.
(pmap_startup, vm_page_create, vm_page_grab_contiguous_pages): Remove functions.
(vm_page_init_template, vm_page_grab_contig,
vm_page_free_contig): New functions.
(vm_page_init): Update and call vm_page_init_template.
(vm_page_release_fictitious): Make static.
(vm_page_more_fictitious): Update call to vm_page_init.
(vm_page_convert): Rewrite to comply with vm_page.
(vm_page_grab): Update and call vm_page_alloc_pa.
(vm_page_release): Update and call vm_page_free_pa.
|
|
* vm/vm_page.c: New File.
* vm/vm_page.h: Merge vm_page.h from X15.
(struct vm_page): New members: node, type, seg_index, order,
vm_page_header. Turn phys_addr into a phys_addr_t.
|
|
* i386/i386at/biosmem.c: New file.
* i386/i386at/biosmem.h: Likewise.
|
|
* i386/include/mach/i386/multiboot.h: Merge multiboot.h from X15.
|
|
* i386/i386at/elf.h: New file.
|
|
* kern/log2.h: New file.
|
|
* linux/src/include/linux/compiler-gcc6.h: New file.
|
|
To avoid running out of memory due to the increased consumption by radix
trees which replaced arrays.
* kern/slab.c (KMEM_MAP_SIZE): Bump from 96MiB to 128MiB.
* i386/i386/vm_param.h (VM_KERNEL_MAP_SIZE): Add 32MiB accordingly.
|
|
* Makefile.am (AM_CFLAGS): Add -fno-strict-aliasing.
|
|
* vm/vm_object.h (struct vm_object): Use queue_head_t instead of
queue_chain_t as the page list type.
|
|
* linux/dev/include/linux/fs.h: Replace extern with static.
* linux/dev/include/linux/locks.h: Likewise.
* linux/dev/include/linux/mm.h: Likewise.
* linux/src/drivers/net/e2100.c: Likewise
* linux/src/include/asm-i386/termios.h: Likewise.
* linux/src/include/linux/interrupt.h: Likewise.
* linux/src/include/net/route.h: Likewise.
* linux/src/include/net/sock.h: Likewise.
|
|
* i386/i386at/lpr.c (lpropen): Fix assignment to t_addr.
|
|
* i386/Makefrag.am: Remove disk.h.
* i386/i386at/disk.h: Remove unnused definitions.
* i386/include/mach/i386/disk.h: Remove.
* linux/dev/glue/block.c (device_get_status): Remove V_GETPARMS case.
|
|
* linux/dev/glue/block.c (out): Cast to device_t.
* linux/dev/init/main.c (alloc_contig_mem): Initialize addr and cast return value to void *.
* i386/i386/phys.c (pmap_copy_page): Initialize src_map.
* i386/intel/pmap.c: Include i386at/model_dep.h.
* kern/mach_clock.c (mapable_time_init): Cast to void *.
|
|
* vm/vm_object.c (vm_object_print): Break line so all debugging output fits
in a page.
|
|
* vm/vm_map.c (vm_map_print): Reduce indentation, break lines earlier.
(vm_map_copy_print): Likewise.
* vm/vm_object.c (vm_object_print): Likewise.
|
|
* vm/vm_map.c (vm_map_print): Update arguments to conform to ddb
protocol.
* vm/vm_print.h (vm_map_print): Likewise for prototype.
|
|
* vm/vm_map.c (vm_map_copyout): Reinitialize copy map red-black tree.
|
|
* i386/i386/locore.S (discover_x86_cpu_type): Disable Cyrix CPU discovery.
|
|
* vm/vm_object.c (_vm_object_allocate): Return 0 immediately when
kmem_cache_alloc returned 0.
(vm_object_allocate): Panic when _vm_object_allocate returns 0.
|
|
* vm/vm_map.c (vm_map_pageable_common): Put back wired_count decrementation
into user_wired_count test.
|
|
* linux/dev/drivers/block/ahci.c (ahci_do_request): Fix checking unit
against MAX_PORTS.
|
|
* i386/i386at/lpr.c (lprprobe): Fix checking unit against NLPR.
|
|
* linux/dev/drivers/block/ahci.c (ahci_probe_dev): Add missing format.
|
|
* version.m4 (AC_PACKAGE_VERSION): Set to 1.6.
* NEWS: Finalize for 1.6.
|
|
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.
|
|
|
|
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'.
|
|
* .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.
|
|
* kern/slab.c (_slab_info): Print total used and reclaimable memory.
|
|
* kern/slab.c (_slab_info): Include flags in the slab information.
|
|
* ddb/db_output.c (db_putchar): Fix off-by-one, allowing one more
character to be printed before the newline is inserted.
|
|
* 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.
|
|
* i386/i386/debug_i386.c (syscall_trace_task): New variable.
(syscall_trace_print): If set, trace only syscalls from this task.
|
|
* 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.
|
|
* 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.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.
|
|
* include/mach/time_value.h (TIME_VALUE_TO_TIMESPEC,
TIMESPEC_TO_TIME_VALUE): New macros
|
|
* 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.
|
|
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.
|
|
[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.
|
|
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.
|
|
* 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.
|