summaryrefslogtreecommitdiffstats
path: root/sys/sparc64
Commit message (Collapse)AuthorAgeFilesLines
* Add pmap_clear_write() to the interface between the virtual memoryalc2006-07-201-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | system's machine-dependent and machine-independent layers. Once pmap_clear_write() is implemented on all of our supported architectures, I intend to replace all calls to pmap_page_protect() by calls to pmap_clear_write(). Why? Both the use and implementation of pmap_page_protect() in our virtual memory system has subtle errors, specifically, the management of execute permission is broken on some architectures. The "prot" argument to pmap_page_protect() should behave differently from the "prot" argument to other pmap functions. Instead of meaning, "give the specified access rights to all of the physical page's mappings," it means "don't take away the specified access rights from all of the physical page's mappings, but do take away the ones that aren't specified." However, owing to our i386 legacy, i.e., no support for no-execute rights, all but one invocation of pmap_page_protect() specifies VM_PROT_READ only, when the intent is, in fact, to remove only write permission. Consequently, a faithful implementation of pmap_page_protect(), e.g., ia64, would remove execute permission as well as write permission. On the other hand, some architectures that support execute permission have basically ignored whether or not VM_PROT_EXECUTE is passed to pmap_page_protect(), e.g., amd64 and sparc64. This change represents the first step in replacing pmap_page_protect() by the less subtle pmap_clear_write() that is already implemented on amd64, i386, and sparc64. Discussed with: grehan@ and marcel@
* Simplify the pager support in DDB. Allowing different db commands tojhb2006-07-121-9/+6
| | | | | | | | | | | | | | | | install custom pager functions didn't actually happen in practice (they all just used the simple pager and passed in a local quit pointer). So, just hardcode the simple pager as the only pager and make it set a global db_pager_quit flag that db commands can check when the user hits 'q' (or a suitable variant) at the pager prompt. Also, now that it's easy to do so, enable paging by default for all ddb commands. Any command that wishes to honor the quit flag can do so by checking db_pager_quit. Note that the pager can also be effectively disabled by setting $lines to 0. Other fixes: - 'show idt' on i386 and pc98 now actually checks the quit flag and terminates early. - 'show intr' now actually checks the quit flag and terminates early.
* Make the firmware assist driver resident inmjacob2006-07-091-1/+2
| | | | preparation for isp using it.
* Backed out the change by request from rwatson.babkin2006-06-261-1/+0
| | | | PR: kern/14584
* The common UID/GID space implementation. It has been discussed on -archbabkin2006-06-251-0/+1
| | | | | | | | | | in 1999, and there are changes to the sysctl names compared to PR, according to that discussion. The description is in sys/conf/NOTES. Lines in the GENERIC files are added in commented-out form. I'll attach the test script I've used to PR. PR: kern/14584 Submitted by: babkin
* Remove COMPAT_43 from GENERIC (and other kernel configs). For amd64 there'snetchild2006-06-151-1/+0
| | | | | | | | | | | | | | | | | | | | | | an explicit comment that it's needed for the linuxolator. This is not the case anymore. For all other architectures there was only a "KEEP THIS". I'm (and other people too) running a COMPAT_43-less kernel since it's not necessary anymore for the linuxolator. Roman is running such a kernel for a for longer time. No problems so far. And I doubt other (newer than ia32 or alpha) architectures really depend on it. This may result in a small performance increase for some workloads. If the removal of COMPAT_43 results in a not working program, please recompile it and all dependencies and try again before reporting a problem. The only place where COMPAT_43 is needed (as in: does not compile without it) is in the (outdated/not usable since too old) svr4 code. Note: this does not remove the COMPAT_43TTY option. Nagging by: rdivacky
* Remove mpte optimization from pmap_enter_quick().ups2006-06-151-4/+2
| | | | | | | | | There is a race with the current locking scheme and removing it should have no measurable performance impact. This fixes page faults leading to panics in pmap_enter_quick_locked() on amd64/i386. Reviewed by: alc,jhb,peter,ps
* - Complete breaking out the definition of bus_space_{tag,handle}_t bymarius2006-06-132-12/+4
| | | | | | | | | | | moving the typedef of bus_space_tag_t from sys/sparc64/include/bus.h to sys/sparc64/include/_bus.h. This brings sparc64 in sync with the other platforms and fixes the compilation of drivers which include <sys/rman.h> before <machine/bus.h> after sys/sys/rman.h rev. 1.34. - Remove the definition of bus_type_t from sys/sparc64/include/_bus.h as it's unused since sys/sparc64/include/bus.h rev. 1.6 and sys/sparc64/sparc64/bus_machdep.c rev. 1.3. - Remove some pointless comments.
* Correct transposed digits in device names which were added in themarius2006-06-131-2/+2
| | | | previous revision.
* Add the ability to subset the devices that UART pulls in. This allowsimp2006-06-121-0/+5
| | | | | | | | the arm to compile without all the extras that don't appear, at least not in the flavors of ARM I deal with. This helps us save about 100k. If I've botched the available devices on a platform, please let me know and I'll correct ASAP.
* - Merge sys/sparc64/pci/psycho.c rev. 1.8:marius2006-06-081-7/+26
| | | | | | | | | | | | | | | | | | | | | | | | | Map the device memory belonging to resources of type SYS_RES_MEMORY into KVA upon activation so that rman_get_virtual() works as expected. - In sbus_alloc_resource() checking whether toffs is 0 as an indication that no applicable child range was found isn't appropriate as it's perfectly valid for the requested SYS_RES_MEMORY resource to start at the beginning of a child range. So check for the RMAN still being NULL instead. - As a minor runtime speed optimization break out of the loop where we search for the applicable child range in sbus_alloc_resource() as soon as it's found. - Let sbus_setup_intr() return ENOMEM rather than 0 if it can't allocate memory for the interrupt clearing info. - Actually do what the comment in sbus_setup_intr() says and disable the respective interrupt while fiddling with it. - Remove some superfluous INTVEC() around inr, which already only contains the interrupt vector, in sbus_setup_intr(). - While here, fix a style(9) bug in sbus_setup_intr() (don't use function calls in initializers). The first two changes are required for a CG6 driver. MFC after: 2 weeks
* add ath & co.sam2006-06-071-0/+9
| | | | MFC after: 1 month
* Introduce the function pmap_enter_object(). It maps a sequence of residentalc2006-06-051-11/+64
| | | | | | | pages from the same object. Use it in vm_map_pmap_enter() to reduce the locking overhead of premapping objects. Reviewed by: tegge@
* - Declare the PnP map const.marius2006-06-051-1/+4
| | | | | | | - Add devices found in V210 to the PnP map. - Don't leak memory if we didn't find a match for a node in the PnP map. MFC after: 2 weeks
* MFalpha/amd64/arm/ia64alc2006-05-292-23/+7
| | | | | | | Retire pmap_track_modified(). We no longer need it because we do not create managed mappings within the clean submap. To prevent regressions, add assertions blocking the creation of managed mappings within the clean submap.
* Since DELAY() was moved, most <machine/clock.h> #includes have beenphk2006-05-162-2/+0
| | | | unnecessary.
* Clean out sysctl machdep.* related defines.phk2006-05-111-19/+0
| | | | The cmos clock related stuff should really be in MI code.
* Uncomment sk(4) as it's now working.yongari2006-04-271-1/+1
|
* Move AHC_REG_PRETTY_PRINT and AHD_REG_PRETTY_PRINT belowdelphij2006-04-241-2/+2
| | | | their corresponding devices.
* Set the rid for any resource obtained from rman_reserve_resource.imp2006-04-204-1/+4
| | | | Reviewed by: wollman, jmg (as were the other commits fixing this problem)
* Remove sab(4).marcel2006-04-191-2/+0
|
* - Since critical sections no longer raise the processor interrupt level tomarius2006-04-172-38/+46
| | | | | | | | | | | | | | | | | | | | | | | above what's used for fast interrupts, only interrupts with the level of the interrupt which led to calling intr_fast() (which is used with both fast and ithread interrupts) are blocked while in that function. Thus intr_fast() can be preempted by a fast interrupt (which are of a higher level than ithread interrupts) while servicing an ithread interrupt. This can lead to a stale pointer to the head of the active interrupt requests list when back in the ithread interrupt invocation of intr_fast(), in turn resulting in corruption of the interrupt request lists and consequently in a panic. Solve this be turning off interrupts in intr_fast() before reading the pointer to the head of the active list rather than after. [1] - Add a KASSERT in intr_fast() which asserts that ir_func is non-zero before calling it. [1] - Increment interrupt stats after calling the handlers rather than before. This reduces the delay until direct and fast handlers are serviced, in my testings by 30% on average for the direct tick interrupt handler, in turn resulting in less clock drift. PR: 94778 [1] Submitted by: Andrew Belashov [1] MFC after: 2 weeks
* For USIII CPUs the type of the trap caused by peeking/poking non-existentmarius2006-04-041-7/+5
| | | | | | | | | | | | | PCI devices apparently was changed from a special deferred trap with TPC pointing to the membar #Sync following the failing load/store instruction to a precise trap with TPC pointing to the failing load/store instruction. Thus remove the check the check whether TPC points to a membar #Sync in case of a data access trap as it's off-by-one for USIII CPUs and it should be sufficient to check whether the trap happend while in fasword*() to properly detect traps caused by peeking/poking. This also corresponds to what other OSs do. Note that also only the USIIi manual suggests to check the TPC for such traps while the USII one doesn't (in the public USIII manual device peeking/poking isn't mentioned at all).
* Eliminate HAVE_STOPPEDPCBS. On ia64 the PCPU holds a pointer to themarcel2006-04-031-0/+2
| | | | | | | | PCB in which the context of stopped CPUs is stored. To access this PCB from KDB, we introduce a new define, called KDB_STOPPEDPCB. The definition, when present, lives in <machine/kdb.h> and abstracts where MD code saves the context. Define KDB_STOPPEDPCB on i386, amd64, alpha and sparc64 in accordance to previous code.
* - s,tramoline,trampoline, in a comment.marius2006-04-032-10/+22
| | | | | | | | | | | | | | | | | | | | | - Use FBSDID in trap.c - Make the global trap_sig[] static as it's not used outside of trap.c. - In sendsig() remove an unused variable. - In trap() sync with the other archs; for fast data access MMU miss and data access protection traps set ksi_addr to the SFAR reg which contains the faulting address and otherwise to the TPC reg. Generally the TCP reg contains the address of the instruction that caused the exception, except for fast instruction access traps (and some others; more refinement may be needed here) it also contains the faulting address. Previously sendsig() always set si_addr to the SFAR reg which is wrong for most traps. - In sendsig() add support for FreeBSD old-style signals. These changes are inspired by kmacy's sun4v changes and allow libsigsegv to build on FreeBSD/sparc64, but it doesn't pass all checks and tests it actually should, yet. MFC after: 5 days
* Remove the unused sva and eva arguments from pmap_remove_pages().peter2006-04-031-1/+1
|
* Add scc(4).marcel2006-03-301-2/+2
|
* - We only lock the local per-CPU page in the local dTLB, so accessing themarius2006-03-291-5/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | foreign per-CPU pages in cpu_ipi_send() in order to get the module IDs of the other CPUs can cause a page fault. If this happens when doing a TLB shootdown while dealing with another page fault this causes a panic due to the recursive page fault. As I don't spot other code that assumes or requires that accessing foreign per-CPU pages must not page fault solve this by adding a statically allocated (and therefore locked in the kernel pages) array which establishes a FreeBSD CPU ID -> module ID relation and use that in cpu_ipi_selected() (instead of statically allocating the per-CPU pages which would just waste memory on say a dual CPU machine as sun4u theoretically supports up to 128 CPUs or wasting dTLB slots for the foreign per-CPU pages). [1] - Fix a potential race in cpu_ipi_send(); as we don't serialize the access to cpu_ipi_selected() between MI and MD use (only MI-MI and MD-MD) we might catch the NACK bit caused by sending another IPI. Solve this by checking the NACK bit in the contents of the interrupt dispatch status reg read while interrupts were still turned off instead of reading that reg anew after interrupts were turned on again. This is also what the CPU docs suggest to do. - Add a workaround for the SpitFire erratum #54 bug (affecting interrupt dispatch). While public info regarding what this CPU bug actually causes is not available testing shows that with the workaround in place it's less likely to get a "couldn't send ipi" panic, it doesn't solve these panics entirely though. [2] Reported by: kris [1] Some clue from: kmacy [1] Info from: Linux, OpenSolaris [2] Additional testing by: kris MFC after: 3 days
* Add convenience macros for the bits in ASI_ESTATE_ERROR_EN_REG (usedmarius2006-03-291-0/+16
| | | | | | | for ECC handling) and the additional uses of the ASIs 0x77 and 0x7f as well as their bits (used for a CPU bug workaround). MFC after: 3 days
* - Add a comment describing why tick_init() is called before cninit().marius2006-03-281-1/+6
| | | | - Fix a typo in another comment.
* - Move the check for too high HZ values from tick_init() to tick_start()marius2006-03-281-7/+12
| | | | | | | | | | as we have to call tick_init() before cninit() in order to provide the low-level console drivers with a working DELAY() which in turn means we cannot use panic() in tick_init(). - s,to high, too high, in the panic string Inspired by: kmacy's sun4v changes MFC after: 3 days
* Add convenience macros for the full register set and use them to replacemarius2006-03-282-23/+74
| | | | | | magic constants in clkbrd.c Info from: OpenSolaris
* Sync with the other archs and declare the memory location referenced bymarius2006-03-281-4/+4
| | | | | | the address argument of the bus_space_write_multi_*() familiy as const. Prodded by: damien
* Fix a c/p error.brueffer2006-02-281-1/+1
| | | | | Obtained from: The TrustedBSD Project Approved by: rwatson (mentor)
* - Don't bother traversing trap frames in stack_save(). This fixes panicsmarius2006-02-192-4/+34
| | | | | | | | | | | | | | | | | | | | when option DEBUG_LOCKS is used. Trap frames are determined by checking whether the caller was one of the tl0_*() or tl1_*() asm functions via a newly added pair of dummy symbols in exception.S which mark the begin and end of these functions. The tl_trap_* pair marks those in the special .trap section and the tl_text_* in the regular .text section. Because of their performance penalty db_search_symbol()/db_symbol_values() and linker_ddb_search_symbol()/linker_ddb_symbol_values() aren't used here for determining the caller, with db_search_symbol()/db_symbol_values() additionally not being reentrant. - For consistency, change db_backtrace() to also use the new markers for determining the tl0_*() and tl1_*() asm functions instead of bcmp()'ing the symbol name. - Use FBSDID in db_trace.c. PR: 93226 Based on a patch by: Antoine Brodin <antoine.brodin@laposte.net> Ok'ed by: jhb
* Add system call auditing support for sparc64.rwatson2006-02-181-0/+3
| | | | | Submitted by: brueffer Obtained from: TrustedBSD Project
* For E250 and E450 enable the watchdog part of the MK48Txx as it justmarius2006-02-151-1/+19
| | | | | | works there. MFC after: 3 days
* Fix the hw.realmem sysctl. The global realmem variable is a count ofjhb2006-02-141-1/+1
| | | | | | | | | pages, not a count of bytes. The sysctl handler for hw.realmem already uses ctob() to convert realmem from pages to bytes. Thus, on archs that were storing a byte count in the realmem variable, hw.realmem was inflated. Reported by: Valerio daelli valerio dot daelli at gmail dot com (alpha) MFC after: 3 days
* CPU time accounting speedup (step 2)phk2006-02-111-9/+1
| | | | | | | | | | | | | | | | | | | Keep accounting time (in per-cpu) cputicks and the statistics counts in the thread and summarize into struct proc when at context switch. Don't reach across CPUs in calcru(). Add code to calibrate the top speed of cpu_tickrate() for variable cpu_tick hardware (like TSC on power managed machines). Don't enforce monotonicity (at least for now) in calcru. While the calibrated cpu_tickrate ramps up it may not be true. Use 27MHz counter on i386/Geode. Use TSC on amd64 & i386 if present. Use tick counter on sparc64
* Simplify system time accounting for profiling.phk2006-02-081-6/+4
| | | | | | | | | | Rename struct thread's td_sticks to td_pticks, we will need the other name for more appropriately named use shortly. Reduce it from uint64_t to u_int. Clear td_pticks whenever we enter the kernel instead of recording its value as reference for userret(). Use the absolute value of td->pticks in userret() and eliminate third argument.
* Modify the way we account for CPU time spent (step 1)phk2006-02-072-1/+18
| | | | | | | | | | | | | | | | Keep track of time spent by the cpu in various contexts in units of "cputicks" and scale to real-world microsec^H^H^H^H^H^H^H^Hclock_t only when somebody wants to inspect the numbers. For now "cputicks" are still derived from the current timecounter and therefore things should by definition remain sensible also on SMP machines. (The main reason for this first milestone commit is to verify that hypothesis.) On slower machines, the avoided multiplications to normalize timestams at every context switch, comes out as a 5-7% better score on the unixbench/context1 microbenchmark. On more modern hardware no change in performance is seen.
* Hook up le(4) to the build. For now it's only added to the sparc64 GENERICmarius2006-01-311-2/+2
| | | | | | | in order to support the on-board LANCE in Ultra 1 and to the MI NOTES as it should work just fine with the AMD PCnet family of chips on all archs but is not yet meant to replace lnc(4). If a kernel includes all of le(4), lnc(4) and pcn(4) precedence is given to lnc(4)/pcn(4) for now.
* o lsi64854_enet_intr():marius2006-01-312-32/+31
| | | | | | | | | | | | | | | | | | | | | | | | | - Like lsi64854_scsi_intr() return -1 in case there was a DMA error so the caller can distinguish it from a normal interrupt and leave the reset of the DMA engine to the caller so we don't kill any state there. - Move the static 'dodrain' flag to struct lsi64854_softc as there can be more than one LSI64854 used for a LANCE in a system and reset it again once draining the E-cache is done so we don't keep draining the cache with every interrupt. - Remove calling sc->sc_intrchain(), we will call lsi64854_enet_intr() via sc->intr() in the interrupt handler of the LANCE driver and not use it in chained mode. o lsi64854_pp_intr(): - Like lsi64854_scsi_intr() return -1 in case there was a DMA error so the caller can distinguish it from a normal interrupt. o Remove the no longer used sc_intrchain* from struct lsi64854_softc. o Make lsi64854_reset(), lsi64854_setup*() and lsi64854_*_intr() static to lsi64854.c as we do and will only call them via the respective function pointers in struct lsi64854_softc. o While here fix style(9) bugs (variable definition inside a nested scope).
* Revert the part of rev. 1.3 which enabled the chaining of the DMA enginemarius2006-01-301-21/+1
| | | | | | | interrupt handler for the LANCE devices and remove dma_setup_intr(). We just can't completely ignore the DMA engine in a LANCE driver anyway and calling the DMA engine interrupt handler in the LANCE driver directly allows to cover it by the LANCE driver lock.
* - Register the generic implementations for the device shutdown, suspendmarius2006-01-267-9/+22
| | | | | | | | | | | | | | and resume methods so these events propagate through the device driver hierarchy. - In dma(4) enable the chaining of the DMA engine interrupt handler for the LANCE devices via a dma_setup_intr(). This was commented out before as I was unsure whether I'd use it but this is probably cleaner than fiddling with the DMA engine interrupt in the LANCE driver directly. - In ebus_setup_dinfo() free 'intrs' instead of 'reg' twice in case setting up a child fails due to routing one of its interrupts fails. [1] Found by: Coverity Prevent [1] MFC after: 3 days
* Make the ACPI and OpenFirmware PCI bus drivers subclasses of the genericjhb2006-01-201-35/+3
| | | | PCI bus driver.
* Correct typos (s/OFERFLOW/OVERFLOW/).kris2006-01-163-4/+4
| | | | Reviewed by: jhb
* - The inline asm in this file uses output operands before all inputmarius2006-01-121-5/+5
| | | | | | | | | | | | | operands are consumed so use the appropriate constraint modifier. Before this change GCC used one register for both an input and an unrelated output operand of in_addword(), causing the input to be overwritten before it was consumed and thus breaking in_addword(). For in_cksum_hdr() and in_pseudo() this change is more or less cosmetic. - Fix a misspelling in a nearby comment. Reported & tested by: yongari MFC after: 1 week
* Move the old BSD4.3 tty compatibility from (!BURN_BRIDGES && COMPAT_43)phk2006-01-101-0/+1
| | | | | | | | | | | | to COMPAT_43TTY. Add COMPAT_43TTY to NOTES and */conf/GENERIC Compile tty_compat.c only under the new option. Spit out #warning "Old BSD tty API used, please upgrade." if ioctl_compat.h gets #included from userland.
* - Make pcib_devclass private to sys/dev/pci/pci_pci.c and change all thejhb2006-01-062-10/+5
| | | | | | | various pcib drivers to use their own private devclass_t variables for their modules. - Use the DEFINE_CLASS_0() macro to declare drivers for the various pcib drivers while I'm here.
OpenPOWER on IntegriCloud