summaryrefslogtreecommitdiffstats
path: root/sys/ia64
Commit message (Collapse)AuthorAgeFilesLines
* Add configuration knobs for the superpage reservation system. Initially,alc2007-12-271-0/+7
| | | | the reservation will only be enabled on amd64.
* Add a new 'why' argument to kdb_enter(), and a set of constants to userwatson2007-12-251-1/+2
| | | | | | | | | for that argument. This will allow DDB to detect the broad category of reason why the debugger has been entered, which it can use for the purposes of deciding which DDB script to run. Assign approximate why values to all current consumers of the kdb_enter() interface.
* Add stubs to unbreak LINT.jkoshy2007-12-071-0/+4
|
* Add a BSD disklabel backend to g_part:marcel2007-12-061-1/+1
| | | | | | | o Disklabels can have between 8 and 20 partitions (inclusive). o No device special file is created for the raw partition. o Switch ia64 to use this backend. o No support for boot code yet.
* Break out stack(9) from ddb(4):rwatson2007-12-023-12/+58
| | | | | | | | | | | | | | | | | | | | - Introduce per-architecture stack_machdep.c to hold stack_save(9). - Introduce per-architecture machine/stack.h to capture any common definitions required between db_trace.c and stack_machdep.c. - Add new kernel option "options STACK"; we will build in stack(9) if it is defined, or also if "options DDB" is defined to provide compatibility with existing users of stack(9). Add new stack_save_td(9) function, which allows the capture of a stacktrace of another thread rather than the current thread, which the existing stack_save(9) was limited to. It requires that the thread be neither swapped out nor running, which is the responsibility of the consumer to enforce. Update stack(9) man page. Build tested: amd64, arm, i386, ia64, powerpc, sparc64, sun4v Runtime tested: amd64 (rwatson), arm (cognet), i386 (rwatson)
* Remove the 'needbounce' variable from the _bus_dmamap_load_buffer()jhb2007-11-271-5/+2
| | | | | | | | | routine. It is not needed as the existing tests for segment coalescing already handle bounced addresses and it prevents legal segment coalescing in certain edge cases. MFC after: 1 week Reviewed by: scottl
* Define atomic_readandclear_ptr.jasone2007-11-271-0/+1
|
* Extend critical section coverage in the low-level interrupt handlers toscottl2007-11-211-1/+1
| | | | | | | | | | | | | | | | | | include the ithread scheduling step. Without this, a preemption might occur in between the interrupt getting masked and the ithread getting scheduled. Since the interrupt handler runs in the context of curthread, the scheudler might see it as having a such a low priority on a busy system that it doesn't get to run for a _long_ time, leaving the interrupt stranded in a disabled state. The only way that the preemption can happen is by a fast/filter handler triggering a schduling event earlier in the handler, so this problem can only happen for cases where an interrupt is being shared by both a fast/filter handler and an ithread handler. Unfortunately, it seems to be common for this sharing to happen with network and USB devices, for example. This fixes many of the mysterious TCP session timeouts and NIC watchdogs that were being reported. Many thanks to Sam Lefler for getting to the bottom of this problem. Reviewed by: jhb, jeff, silby
* Prevent the leakage of wired pages in the following circumstances:alc2007-11-171-0/+32
| | | | | | | | | | | | | | | | | | | | | | First, a file is mmap(2)ed and then mlock(2)ed. Later, it is truncated. Under "normal" circumstances, i.e., when the file is not mlock(2)ed, the pages beyond the EOF are unmapped and freed. However, when the file is mlock(2)ed, the pages beyond the EOF are unmapped but not freed because they have a non-zero wire count. This can be a mistake. Specifically, it is a mistake if the sole reason why the pages are wired is because of wired, managed mappings. Previously, unmapping the pages destroys these wired, managed mappings, but does not reduce the pages' wire count. Consequently, when the file is unmapped, the pages are not unwired because the wired mapping has been destroyed. Moreover, when the vm object is finally destroyed, the pages are leaked because they are still wired. The fix is to reduce the pages' wired count by the number of wired, managed mappings destroyed. To do this, I introduce a new pmap function pmap_page_wired_mappings() that returns the number of managed mappings to the given physical page that are wired, and I use this function in vm_object_page_remove(). Reviewed by: tegge MFC after: 6 weeks
* o Rename cpu_thread_setup() to cpu_thread_alloc() to bettermarcel2007-11-142-2/+9
| | | | | | | | | | | | | communicate that it relates to (is called by) thread_alloc() o Add cpu_thread_free() which is called from thread_free() to counter-act cpu_thread_alloc(). i386: Have cpu_thread_free() call cpu_thread_clean() to preserve behaviour. ia64: Have cpu_thread_free() call mtx_destroy() for the mutex initialized in cpu_thread_alloc(). PR: ia64/118024
* generally we are interested in what thread did something asjulian2007-11-141-3/+3
| | | | | | opposed to what process. Since threads by default have teh name of the process unless over-written with more useful information, just print the thread name instead.
* Fix for the panic("vm_thread_new: kstack allocation failed") andkib2007-11-052-2/+3
| | | | | | | | | | | | | | | | | | | | silent NULL pointer dereference in the i386 and sparc64 pmap_pinit() when the kmem_alloc_nofault() failed to allocate address space. Both functions now return error instead of panicing or dereferencing NULL. As consequence, vmspace_exec() and vmspace_unshare() returns the errno int. struct vmspace arg was added to vm_forkproc() to avoid dealing with failed allocation when most of the fork1() job is already done. The kernel stack for the thread is now set up in the thread_alloc(), that itself may return NULL. Also, allocation of the first process thread is performed in the fork1() to properly deal with stack allocation failure. proc_linkup() is separated into proc_linkup() called from fork1(), and proc_linkup0(), that is used to set up the kernel process (was known as swapper). In collaboration with: Peter Holm Reviewed by: jhb
* Set PTE_ACCESSED in the PTE and before inserting it in the VHPT.marcel2007-10-161-2/+12
| | | | | | | | This avoids back-to-back faults for all TLB misses. This can be improved further in the future by also setting PTE_DIRTY for TLB misses for write accesses. MFC after: 1 week
* The flushrs instruction must be the first in an instructionmarcel2007-10-161-0/+1
| | | | | | | group. GNU as(1) already made sure of that, but it's better to actually have the code right. MFC after: 1 week
* Print instruction stops to improve analysis of dependencymarcel2007-10-161-0/+2
| | | | | | violations. MFC after: 1 week
* Fix disassembly of the invala, itc, itr and hint instructionsmarcel2007-10-161-1/+1
| | | | | | by fixing the opcode ordering. MFC after: 1 week
* Use the correct expanded name for SCTP.brueffer2007-09-261-1/+1
| | | | | | | PR: 116496 Submitted by: koitsu Reviewed by: rrs Approved by: re (kensmith)
* Change the management of cached pages (PQ_CACHE) in two fundamentalalc2007-09-251-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ways: (1) Cached pages are no longer kept in the object's resident page splay tree and memq. Instead, they are kept in a separate per-object splay tree of cached pages. However, access to this new per-object splay tree is synchronized by the _free_ page queues lock, not to be confused with the heavily contended page queues lock. Consequently, a cached page can be reclaimed by vm_page_alloc(9) without acquiring the object's lock or the page queues lock. This solves a problem independently reported by tegge@ and Isilon. Specifically, they observed the page daemon consuming a great deal of CPU time because of pages bouncing back and forth between the cache queue (PQ_CACHE) and the inactive queue (PQ_INACTIVE). The source of this problem turned out to be a deadlock avoidance strategy employed when selecting a cached page to reclaim in vm_page_select_cache(). However, the root cause was really that reclaiming a cached page required the acquisition of an object lock while the page queues lock was already held. Thus, this change addresses the problem at its root, by eliminating the need to acquire the object's lock. Moreover, keeping cached pages in the object's primary splay tree and memq was, in effect, optimizing for the uncommon case. Cached pages are reclaimed far, far more often than they are reactivated. Instead, this change makes reclamation cheaper, especially in terms of synchronization overhead, and reactivation more expensive, because reactivated pages will have to be reentered into the object's primary splay tree and memq. (2) Cached pages are now stored alongside free pages in the physical memory allocator's buddy queues, increasing the likelihood that large allocations of contiguous physical memory (i.e., superpages) will succeed. Finally, as a result of this change long-standing restrictions on when and where a cached page can be reclaimed and returned by vm_page_alloc(9) are eliminated. Specifically, calls to vm_page_alloc(9) specifying VM_ALLOC_INTERRUPT can now reclaim and return a formerly cached page. Consequently, a call to malloc(9) specifying M_NOWAIT is less likely to fail. Discussed with: many over the course of the summer, including jeff@, Justin Husted @ Isilon, peter@, tegge@ Tested by: an earlier version by kris@ Approved by: re (kensmith)
* It has been observed on the mailing lists that the different categoriesalc2007-09-151-2/+4
| | | | | | | | | | | | | | | of pages don't sum to anywhere near the total number of pages on amd64. This is for the most part because uma_small_alloc() pages have never been counted as wired pages, like their kmem_malloc() brethren. They should be. This changes fixes that. It is no longer necessary for the page queues lock to be held to free pages allocated by uma_small_alloc(). I removed the acquisition and release of the page queues lock from uma_small_free() on amd64 and ia64 weeks ago. This patch updates the other architectures that have uma_small_alloc() and uma_small_free(). Approved by: re (kensmith)
* Clear pending interrupts before we enable external interrupts.marcel2007-08-061-5/+20
| | | | | | | | | | | | Recently the AP in my Merced box seems to have grown a habit of getting unexpected interrupts, such as redundant wake-ups and legacy interrupts that require an INTA cycle. While here, replace DELAY(0) with cpu_spinwait() so that it's clear what we're doing as well as enable the code to take advantage of cpu_spinwait() when it gets implemented. Approved by: re (blanket)
* Keep interrupts disabled while handling external interrupts.marcel2007-08-063-73/+64
| | | | | | | | | | | | There's no advantage in allowing nested external interrupts. In fact, it leads to a potential stack overrun. While here, put the interrupt vector in the trapframe, so as to compensate for the 36 cycle latency of reading cr.ivr. Further simplify assembly code by dealing with ASTs from C. Approved by: re (blanket)
* In ia64_set_rr(), don't perform data serialization. This allowsmarcel2007-08-051-1/+1
| | | | | | | | us to do the data serializations once after writing multiple region registers, as is done in pmap_switch(). All existing calls to ia64_set_rr() are followed with calls to ia64_srlz_d(). Approved by: re (blanket)
* Replace "__asm __volatile()" by equivalent support functions frommarcel2007-08-041-6/+6
| | | | | | | | | | | ia64_cpu.h. This improves readability and consistency and aids in auditing the code. Add instruction-serialization after writing to cr.pta. Delay enabling interrupts until after we setup the clocks and after we program the task priority register. Approved by: re (blanket)
* Replace "__asm __volatile()" by equivalent support functions frommarcel2007-08-041-3/+5
| | | | | | | | | ia64_cpu.h. This improves readability and consistency and aids in auditing the code. Add data-serialization after writing to the region registers and add instruction-serialization after writing to cr.pta. Approved by: re (blanket)
* Replace "__asm __volatile()" by equivalent support functions frommarcel2007-08-041-16/+18
| | | | | | | | ia64_cpu.h. This improves readability and consistency and aids in auditing the code. Add data-serialization after writing to cr.tpr. Approved by: re (blanket)
* Add required data-serialization after writing to cr.itm and cr.itv.marcel2007-08-041-0/+1
| | | | Approved by: re (blanket)
* Add ia64_srlz_d() and ia64_srlz_i() functions to aid in serialization.marcel2007-08-041-0/+12
| | | | Approved by: re (blanket)
* o Switch to physical addressing before dereferencing the VHPTmarcel2007-07-301-37/+62
| | | | | | | | | | | | bucket pointer. The virtual mapping may not be present in the translation cache. This will result in a nested TLB fault at a place we don't handle (and don't want to handle). o Make sure there's a stop after the rfi instruction, otherwise its behaviour is undefined. o Make sure we switch back to virtual addressing before doing a rfi. Behaviour is undefined otherwise. Approved by: re (blanket)
* Add option EXCEPTION_TRACING, which enables KTR-like functionalitymarcel2007-07-302-1/+85
| | | | | | | for processor interruptions. This is especially useful to track unexpected nested TLB faults. Approved by: re (blanket)
* Rework the interrupt code and add support for interrupt filteringmarcel2007-07-306-177/+239
| | | | | | | | | | | | | | | | | | | | (INTR_FILTER). This includes: o Save a pointer to the sapic structure and IRQ for every vector, so that we can quickly EOI, mask and unmask the interrupt. o Add locking to the sapic code now that we can reprogram a sapic on multiple CPUs at the same time. o Use u_int for the vector and IRQ. We only have 256 vectors, so using a 64-bit type for it is rather excessive. o Properly handle concurrent registration of a handler for the same vector. Since vectors have a corresponding priority, we should not map IRQs to vectors in a linear fashion, but rather pick a vector that has a priority in line with the interrupt type. This is left for later. The vector/IRQ interchange has been untangled as much as possible to make this easier. Approved by: re (blacket)
* Explicitly map the VHPT on all processors. Previously we weremarcel2007-07-304-0/+27
| | | | | | | | merely lucky that the VHPT was mapped as a side-effect of mapping the kernel, but when there's enough physical memory, this may not at all be the case. Approved by: re (blanket)
* Add casts to some of the more commonly used pointer-type atomicmarcel2007-07-301-5/+14
| | | | | | | operations. We really should be able to make those inline functions, but this would break its use for sx_locks. Approved by: re (blanket)
* If clock_ct_to_ts fails to convert time time from the real time clock,dwmalone2007-07-231-1/+2
| | | | | | | | | print a one line error message. Add some comments on not being able to trust the day of week field (I'll act on these comments in a follow up commit). Approved by: re MFC after: 3 weeks
* Restore the value of ar.rnat after the assignment to ar.bspstore.marcel2007-07-161-3/+3
| | | | | | | | | | | | | | | | | | The SDM states that writing to ar.bspstore invalidates the ar.rnat register as a side-effect. This was interpreted as "bits in the ar.rnat register that correspond to registers whose value is on the stack are undefined'. Since we keep the kernel stack NaT- aligned with the user stack (i.e. the lower 9 bits of the backing store pointer remain unchanged when we switch to the kernel stack) bits that need preserving would be preserved. That interpretation is questionable. So, now, the interpretation is more absolute: ar.rnat is undefined after writing to ar.bspstore. As such, we write the saved value of ar.rnat back to ar.rnat after writing to ar.bspstore. Discussed with: christian.kandeler@hob.de Approved by: re (kensmith)
* dma_tag is a static structure. Testing for it being a NULL pointermarcel2007-07-091-1/+1
| | | | | | | doesn't make sense. Rewrite to what was intended. Correctly warned about by: GCC Approved by: re (bmah)
* Enable SCTP by default for GENERIC kernels in order to give itdelphij2007-06-141-0/+1
| | | | | | | | | more exposure. The current state of SCTP implementation is considered to be ready for 32-bit platforms, but still need some work/testing on 64-bit platforms. Approved by: re (kensmith) Discussed with: rrs
* Enable GEOM_PART_MBR by default. On ia64 this replaces GEOM_MBR.marcel2007-06-131-1/+1
|
* Add the machine-specific definitions for configuring the new physicalalc2007-06-102-1/+31
| | | | | | | | memory allocator. Set the size of phys_avail[] using one of these definitions. Approved by: re
* Work around a firmware bug in the HP rx2660, where in ACPI an I/O portmarcel2007-06-102-3/+12
| | | | | | | | | | | | is really a memory mapped I/O address. The bug is in the GAS that describes the address and in particular the SpaceId field. The field should not say the address is an I/O port when it clearly is not. With an additional check for the IA64_BUS_SPACE_IO case in the bus access functions, and the fact that I/O ports pretty much not used in general on ia64, make the calculation of the I/O port address a function. This avoids inlining the work-around into every driver, and also helps reduce overall code bloat.
* Synchronize the instruction cache after writing to memory. This ismarcel2007-06-091-1/+5
| | | | needed for breakpoints to work.
* Add kdb_cpu_sync_icache(), intended to synchronize instructionmarcel2007-06-091-0/+15
| | | | | | caches with data caches after writing to memory. This typically is required to make breakpoints work on ia64 and powerpc. For those architectures the function is implemented.
* Physical memory regions can be larger than INT_MAX. Change size1marcel2007-06-091-3/+4
| | | | | from an int to a long to avoid printing negative byte and page counts.
* Enable AUDIT by default in the GENERIC kernel, allowing security eventrwatson2007-06-081-0/+1
| | | | | | | | auditing to be turned on without a kernel recompile, just an rc.conf option. Approved by: re (kensmith) Obtained from: TrustedBSD Project
* Remove remaining references to pc_curtid missed in previous commit.marcel2007-06-071-2/+0
|
* Eliminate pmap_install(), which was used to wrap pmap_switch() andmarcel2007-06-071-55/+43
| | | | | | | | | | grab sched_lock. This would serialize calls to pmap_switch from cpu_switch(). With the introduction of thread_lock, this is not possible anymore, because thread_lock is not a single lock. It varies. Secondly and most importantly, it's not needed at all. The only requirement for pmap_switch() is that it's not preempted while in the middle of updating the CPU and PCPU. In other words, it's a critical region. No locking required.
* Fix compiling error.davidxu2007-06-071-1/+0
|
* Include <sys/sched.h> for sched_throw().marcel2007-06-061-0/+1
|
* Commit 14/14 of sched_lock decomposition.jeff2007-06-051-4/+6
| | | | | | | | | | | - Use thread_lock() rather than sched_lock for per-thread scheduling sychronization. - Use the per-process spinlock rather than the sched_lock for per-process scheduling synchronization. Tested by: kris, current@ Tested on: i386, amd64, ULE, 4BSD, libthr, libkse, PREEMPTION, etc. Discussed with: kris, attilio, kmacy, jhb, julian, bde (small parts each)
* Commit 13/14 of sched_lock decomposition.jeff2007-06-041-1/+1
| | | | | | | | | | | | | - Add a new parameter to cpu_switch() that is used to release the lock on the outgoing thread and properly acquire the lock on the incoming thread. This parameter is not required for schedulers that don't do per-cpu locking and architectures which do not support it may continue to use the 4BSD scheduler. This feature is presently not supported on ia64 Tested by: kris, current@ Tested on: i386, amd64, ULE, 4BSD, libthr, libkse, PREEMPTION, etc. Discussed with: kris, attilio, kmacy, jhb, julian, bde (small parts each)
* - Change comments and asserts to reflect the removal of the globaljeff2007-06-041-2/+2
| | | | | | | | scheduler lock. Tested by: kris, current@ Tested on: i386, amd64, ULE, 4BSD, libthr, libkse, PREEMPTION, etc. Discussed with: kris, attilio, kmacy, jhb, julian, bde (small parts each)
OpenPOWER on IntegriCloud