Age | Commit message (Collapse) | Author |
|
|
|
|
|
|
|
|
|
|
|
Earlier, when page fault occurred, control reached the function
vm_fault_page, that determined the reason of the fault and if the reason
was appropriate, kernel asked a pager for data that should be stored in that
single page. The main idea behind this commit is to determine and than
request not only one page, but a bunch of them.
Almost all work is done in function vm_fault_page, but to keep the size of
this function there was added a bunch of helper functions for internal use
in vm_fault_page.
* i386/intel/read_fault.c (intel_read_fault): New prototype of vm_fault_page
requires supplying of map entry in which fault occurred, so change function
appropriately.
* vm/vm_fault.h (vm_fault_page): Update function prototype.
* vm/vm_fault.c (min): New macro.
(vm_fault_state_t): New field.
(vm_advice_table): New table where parameters for types of memory advice are
stored.
(map_function_parameter_t): New union for internal use.
(vm_mark_for_pagein): New function for internal use.
(vm_mark_for_unlock): Likewise.
(vm_free_after_error): Likewise.
(vm_cleanup_after_error): Likewise.
(vm_calculate_clusters): Likewise.
(dont_request_page): Likewise.
(dont_unlock_page): Likewise.
(vm_for_every_page): Likewise.
(vm_fault_page): Function has been changed to request data in clusters. Its
prototype has been changed to supply to this function information regarding
memory entry where page fault occurred.
(vm_fault): Function has been changed to supply function vm_fault_page with
information regarding memory entry where page fault occurred.
(vm_fault_unwire): Function changed to call vm_fault_page with new
prototype.
(vm_fault_copy): Likewise.
* vm/vm_map.c (vm_map_copyin_page_list): Function changed to call
vm_fault_page with new prototype.
* vm/vm_object.c (vm_object_copy_slowly): Function changed to call
vm_fault_page with new prototype.
|
|
This commit add possibility for server to inform kernel that server has no
some data requested by kernel. This possibility should be used when kernel
asks for cluster of data, but server can't return all the data.
* include/mach/kern_return.h (KERN_NO_DATA): New macro. Using this value
server may notify kernel that not all data in requested by kernel cluster
are available at the moment.
* vm/memory_object.c (memory_object_data_error): Add special treatment for
error code KERN_NO_DATA.
|
|
* include/mach_debug/vm_info.h (vm_region_info_t): Add memory advice that is
applied to region's information structure.
(vm_object_info_t): Add memory advice that is applied to object's
information structure.
* vm/vm_debug.c (mach_vm_region_info): Function changed to inform caller
about memory advice.
(mach_vm_object_info): Likewise.
|
|
Current implementation of vm_get_advice_info returns only maximal possible
size of cluster to be asked. This information is used by default pager,
because it can't rely on allocating of memory during processing requests
from kernel. That's why default pager allocates buffers, where it stores
data to be returned to kernel, beforehand for each thread. So, information
provided by vm_get_advice_info tells the default pager size of this buffer.
* include/mach/mach.defs (vm_get_advice_info): New ipc definition.
* vm/vm_user.c (vm_get_advice_info): New function.
|
|
* include/mach/mach_types.defs (vm_advice_t): New type definition.
* include/mach/mach.defs (vm_advice): New RPC definition.
(memory_object_set_advice): Likewise.
(memory_object_get_advice): Likewise.
* kern/ipc_mig.c (syscall_vm_advice): New function. This is optimization
function for RPC that is processed by kernel.
* kern/syscall_sw.c (syscall_vm_advice): Add function prototype.
(mach_trap_table): Add syscall_vm_advice to trap table.
* vm/memory_object.c (memory_object_set_advice): New function. Sets memory
advice for memory object.
(memory_object_get_advice): New function. Returns memory advice of memory
object.
* vm/vm_user.c (vm_advice): New function. Wrapper for vm_map_advice.
* vm/vm_map.h (vm_map_advice): Add function prototype.
* vm/vm_map.c (vm_map_advice): New function. Sets memory advice for memory
range.
|
|
* include/mach/vm_advice.h: New file with some definitions used for making
memory advice.
(vm_advice_t): Enumeration that is used to denote memory advice.
(VM_ADVICE_MAX_READAHEAD): New macro, that denotes maximal size of cluster
to be read.
(struct vm_advice_entry): Structure that keeps number of pages to be read
before and after the page where fault occurred for some specific memory
advice.
* Makefrag.am (include_mach_HEADERS): Add file vm_advice.h.
* include/mach/mach_types.h: Include header mach/vm_advice.h.
* vm/vm_map.h: Include mach/vm_advice.h.
(struct vm_map_entry): Add advice to map entry attributes.
* vm/vm_map.c (vm_map_find_entry): Add advice to new entry template.
(vm_map_enter): Likewise.
* vm/vm_object.h: Include mach/vm_advice.h.
(struct vm_object): Add advice to memory object attributes.
* vm/vm_object.c (vm_object_bootstrap): Add advice to object template.
|
|
* linux/src/arch/i386/kernel/bios32.c (check_pcibios, pcibios_init): Convert
physical bios32 entry address to kernel virtual address.
|
|
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.
|
|
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.
|
|
* 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.
|
|
* 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.
|
|
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.
|
|
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.
|
|
* i386/i386/pcb.c (switch_ktss): Check value returned by hyp_stack_switch.
|
|
* kern/thread.c (host_stack_usage): Set `total' type to natural_t.
|
|
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 *.
|
|
* 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.
|
|
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.
|
|
* 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.
|
|
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.
|
|
* i386/i386/vm_param.h [!MACH_XEN]: Do not include <xen/public/xen.h>.
* i386/i386at/model_dep.c (init_alloc_aligned): Use phystokv to compare physical
memory addresses with kernel start, end, and symbol table.
* i386/intel/pmap.c (pmap_enter): Use kvtophys to convert ptp pointer to pte
entry.
* linux/dev/init/main.c (alloc_contig_mem, linux_init): Use phystokv to convert
allocated pages to virtual pointer.
* linux/src/include/asm-i386/io.h: Include <machine/vm_param.h>.
(virt_to_phys): Call _kvtophys.
(phys_to_virt): Call phystokv.
* linux/src/include/linux/compatmac.h: Include <asm/io.h>.
(ioremap): Use phys_to_virt to convert physical address to virtual pointer.
(my_iounmap): Likewise.
* linux/dev/include/asm-i386/page.h: Include <mach/vm_param.h>.
(PAGE_SHIFT, PAGE_SIZE, PAGE_MASK): Remove macros.
* linux/src/drivers/scsi/ncr53c8xx.c (vm_size_t): Remove type.
* linux/dev/glue/net.c: Include <machine/vm_param.h>
(device_write): Call phystokv to convert from physical page address to
virtual pointer.
* linux/dev/glue/block.c (alloc_buffer, free_buffer, rdwr_full): Likewise.
|
|
* linux/dev/glue/misc.c (issig): Return 0 if current_thread() is NULL.
|
|
* i386/intel/pmap.c (pmap_bootstrap): Check against `va' wrap around
0xffffffff.
|
|
When _start is not close to 0, just using init_alloc_aligned() is not enough
to know how much should be duplicated between linear and virtual mappings.
Just mapping everything that can be is not very costly and should just work
when it can work.
* i386/i386at/model_dep.c (i386at_init) [VM_MIN_KERNEL_ADDRESS !=
LINEAR_MIN_KERNEL_ADDRESS]: Extend `nb_direct' to VM_MIN_KERNEL_ADDRESS -
LINEAR_MIN_KERNEL_ADDRESS.
|
|
* i386/i386/i386asm.sym (PFN_LIST): Enclose in #ifdef MACH_XEN. Thanks
to Samuel Thibault for the suggestion.
|
|
* ddb/db_examine.c (db_xcdump): Do not cast addr before passing to
db_read_bytes.
* ddb/db_macro.c (db_arg_variable): Return long.
* ddb/db_macro.h (db_arg_variable): Likewise.
* ddb/db_sym.c (db_maxoff): Set type to unsigned long.
* ddb/db_task_thread.c (db_set_default_thread, db_get_task_thread): Return
long.
* ddb/db_variables.h (db_variable): Make fcn function field to return long.
(FCN_NULL): Make function type return long.
* i386/i386/db_interface.c (int_regs): Set field sizes to long.
* i386/i386/db_machdep.h (db_expr_t): Set type to long.
* i386/i386/db_trace.c (db_i386_reg_value): Return long. Use long types.
(i386_frame, i386_kregs, interrupt_frame, db_nextframe): Set field sizes to
long.
(db_regs, i386_kregs): Use long * pointers.
(db_lookup_i386_kreg): Return long *.
(db_numargs, db_nextframe, db_stack_trace_cmd, db_i386_stack_trace): Use long
types.
* i386/i386/debug_i386.c (dump_ss): Fix format.
* i386/i386/ktss.c (ktss_init): Use long type.
* i386/i386/pcb.c (set_user_regs): Likewise.
* i386/i386/thread.h (i386_saved_state, v86_segs, i386_kernel_state,
i386_interrupt_state): Set field sizes to long.
* i386/i386/trap.c (kernel_trap, user_trap): Fix formats.
* kern/ast.h (ast_t): Set type to long.
* kern/boot_script.c (create_task, resume_task, prompt_resume_task,
boot_script_set_variable): Use long types.
* kern/boot_script.h (boot_script_set_variable): Use long type.
* kern/bootstrap.c (bootstrap_create): Pass long type.
* kern/lock.c (simple_lock, simple_lock_try): Use long type.
* linux/dev/kernel/softirq.c (linux_soft_intr): Fix format.
|
|
* xen/console.c (hypputc): Warning only once per console write about console
ring smash.
|
|
* i386/i386/xen.h (xchgl): Use xchg instruction instead of xchgl, so the
assembler can detect unsigned long size.
|
|
* i386/configfrag.ac (i386): Remove definition.
* i386/intel/pmap.c (pmap_update_interrupt): Rename i386 to __i386__.
* i386/intel/pmap.h: Likewise.
* kern/debug.c (Debugger): Likewise.
* kern/lock.c (simple_lock, simple_lock_try, db_show_all_slocks): Likewise.
|
|
On amd64 the cpu flags is a 64-bit word, and long on 32-bit systems is
32-bit wide anyway.
* linux/dev/glue/kmem.c (linux_kmalloc, linux_kfree, __get_free_pages,
free_pages): Use unsigned long instead of unsigned.
* linux/dev/include/asm-i386/system.h (__save_flags, __restore_flags):
Likewise.
* linux/dev/kernel/printk.c (printk): Likewise.
* linux/src/drivers/scsi/advansys.c (DvcEnterCritical, DvcLeaveCritical,
advansys_queuecommand, advansys_abort, advansys_reset, advansys_interrupt,
interrupts_enabled, AdvISR): Likewise.
* linux/src/drivers/scsi/aha152x.c (aha152x_intr): Likewise.
* linux/src/drivers/scsi/aha1542.c (aha1542_intr_handle): Likewise.
* linux/src/drivers/scsi/aic7xxx.c (aic7xxx_done_cmds_complete): Likewise.
* linux/src/drivers/scsi/ultrastor.c (log_ultrastor_abort,
ultrastor_queuecommand, ultrastor_abort): Likewise.
|
|
* i386/i386at/com.c (comgetstat): Use natural_t instead of `unsigned int'.
(comsetstat): Likewise.
* i386/i386at/kd.c (kdgetstat, kdsetstat): Likewise.
* i386/i386at/lpr.c (lprgetstat, lprsetstat): Likewise.
|
|
* i386/include/mach/i386/exec/elf.h (Elf32_Addr, Elf32_Off, Elf32_Sword,
Elf32_Word): Use int type instead of long.
|
|
* xen/evt.c (hyp_c_callback): Do not set assembly instruction suffixes,
using 1UL constant instead.
|
|
* i386/include/mach/i386/vm_param.h (i386_btop, i386_ptob, i386_round_page,
i386_trunc_page): Cast to unsigned long.
|
|
* i386/i386/proc_reg.h (get_eflags, get_esp, get_eflags, get_cr0, get_cr2,
get_cr3, get_cr4): Return unsigned long type.
(set_eflags, set_cr0, set_cr3, set_cr4): Take unsigned long type.
|
|
* i386/i386/i386asm.sym (R_EDI): Define macro.
* i386/i386/locore.S (t_page_fault): Use R_CR2-R_EDI instead of hardcoded
12.
|
|
That makes the virtual addressing equal to linear addressing, thus optimizing
some computations away.
* i386/i386/vm_param.h (VM_MIN_KERNEL_ADDRESS) [MACH_XEN]: Set to
0xC0000000UL.
* i386/xen/Makefrag.am (gnumach_LINKFLAGS): Set _START to 0xC0000000.
* i386/xen/xen_boothdr.S (VIRT_BASE, ELF_PADDR_OFFSET): Set to 0xC0000000.
|
|
* i386/intel/pmap.c (pmap_set_page_readonly_init) [PAE]: Access the bootstrap
dirbase with PTEMASK (1 page) instead of PDEMASK (4 pages) through pmap_pde.
|
|
* linux/src/include/linux/interrupt.h (intr_count): Declare as unsigned int.
|
|
* i386/i386/spl.S (splx): Use S_ARG0 instead of reimplementing it.
|
|
* linux/dev/arch/i386/kernel/irq.c (intr_count): Set to int type.
* linux/dev/kernel/softirq.c (bh_active, bh_mask): Likewise.
(linux_soft_intr: active, mask, left): Likewise
* linux/src/include/linux/interrupt.h (bh_active, bh_mask): Likewise.
* linux/src/kernel/softirq.c (intr_count, bh_active, bh_mask): Likewise.
(do_bottom_half: active, mask, left): Likewise
|
|
* i386/ldscript: Reformat to follow binutils version
|
|
* i386/intel/pmap.h (INTEL_PTE_PFN): Keep only 47bits, others are not usable.
|
|
* i386/intel/pmap.h (lin2pdpnum): New macro.
* i386/intel/pmap.c (pmap_set_page_readonly_init): Use lin2pdpnum macro
instead of hardcoding 0.
|
|
* i386/i386at/model_dep.c (i386at_init): Do not copy linear into virtual kernel
mapping when they are equal, and do not drop the former either. Use the
function `i' variable.
|