summaryrefslogtreecommitdiffstats
path: root/sys/alpha
Commit message (Collapse)AuthorAgeFilesLines
* o Merge contents of struct pcred into struct ucred. Specifically, add therwatson2001-05-251-17/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | real uid, saved uid, real gid, and saved gid to ucred, as well as the pcred->pc_uidinfo, which was associated with the real uid, only rename it to cr_ruidinfo so as not to conflict with cr_uidinfo, which corresponds to the effective uid. o Remove p_cred from struct proc; add p_ucred to struct proc, replacing original macro that pointed. p->p_ucred to p->p_cred->pc_ucred. o Universally update code so that it makes use of ucred instead of pcred, p->p_ucred instead of p->p_pcred, cr_ruidinfo instead of p_uidinfo, cr_{r,sv}{u,g}id instead of p_*, etc. o Remove pcred0 and its initialization from init_main.c; initialize cr_ruidinfo there. o Restruction many credential modification chunks to always crdup while we figure out locking and optimizations; generally speaking, this means moving to a structure like this: newcred = crdup(oldcred); ... p->p_ucred = newcred; crfree(oldcred); It's not race-free, but better than nothing. There are also races in sys_process.c, all inter-process authorization, fork, exec, and exit. o Remove sigio->sio_ruid since sigio->sio_ucred now contains the ruid; remove comments indicating that the old arrangement was a problem. o Restructure exec1() a little to use newcred/oldcred arrangement, and use improved uid management primitives. o Clean up exit1() so as to do less work in credential cleanup due to pcred removal. o Clean up fork1() so as to do less work in credential cleanup and allocation. o Clean up ktrcanset() to take into account changes, and move to using suser_xxx() instead of performing a direct uid==0 comparision. o Improve commenting in various kern_prot.c credential modification calls to better document current behavior. In a couple of places, current behavior is a little questionable and we need to check POSIX.1 to make sure it's "right". More commenting work still remains to be done. o Update credential management calls, such as crfree(), to take into account new ruidinfo reference. o Modify or add the following uid and gid helper routines: change_euid() change_egid() change_ruid() change_rgid() change_svuid() change_svgid() In each case, the call now acts on a credential not a process, and as such no longer requires more complicated process locking/etc. They now assume the caller will do any necessary allocation of an exclusive credential reference. Each is commented to document its reference requirements. o CANSIGIO() is simplified to require only credentials, not processes and pcreds. o Remove lots of (p_pcred==NULL) checks. o Add an XXX to authorization code in nfs_lock.c, since it's questionable, and needs to be considered carefully. o Simplify posix4 authorization code to require only credentials, not processes and pcreds. Note that this authorization, as well as CANSIGIO(), needs to be updated to use the p_cansignal() and p_cansched() centralized authorization routines, as they currently do not take into account some desirable restrictions that are handled by the centralized routines, as well as being inconsistent with other similar authorization instances. o Update libkvm to take these changes into account. Obtained from: TrustedBSD Project Reviewed by: green, bde, jhb, freebsd-arch, freebsd-audit
* + Turn on SMP support by default (yes an Alpha SMP kernel works onobrien2001-05-252-0/+14
| | | | | uniprocessor systems, aren't Alpha's neat :-)) + Add example KTR (debugging) options.
* Make sure that all resource allocation is handled in the pcib device, notdfr2001-05-2312-119/+90
| | | | | | | | the chipset. This is already how the multi-hose systems handle resource allocation and it fixes a bug where dense and bwx memory allocations were not handled properly. Reviewed by: gallatin
* catch up to i386:gallatin2001-05-231-7/+24
| | | | | | | - remove Giant for vm related traps - don't hold Giant for MP safe syscalls Reviewed-by: jhb
* - FDESC, FIFO, NULL, PORTAL, PROC, UMAP and UNION fileru2001-05-233-3/+3
| | | | | | | | | | | | | | | systems were repo-copied from sys/miscfs to sys/fs. - Renamed the following file systems and their modules: fdesc -> fdescfs, portal -> portalfs, union -> unionfs. - Renamed corresponding kernel options: FDESC -> FDESCFS, PORTAL -> PORTALFS, UNION -> UNIONFS. - Install header files for the above file systems. - Removed bogus -I${.CURDIR}/../../sys CFLAGS from userland Makefiles.
* grab the vm mtx around exec_new_vmspace()gallatin2001-05-221-0/+2
|
* Change pmap_emulate_reference() so that it only touches the vm_pagegallatin2001-05-211-1/+9
| | | | | | | | | flags if it is safe to do so, otherwise it will just alter the pmap state (eg, clear the appropriate PG_FOx bits). This gets alpha booting in the face of the vm_mtx introduction. Reviewed by: dfr
* catch these files up to their i386 neighbors to make alpha bootgallatin2001-05-213-8/+28
| | | | prior to the vm_mtx
* fix vm_mtx related compiler warninggallatin2001-05-201-0/+1
|
* fix alpha-MD compile errors after the vm_mtx commitgallatin2001-05-2011-0/+11
|
* Style changes -- revert ordering to mostly two revs ago.obrien2001-05-181-65/+65
| | | | | | Embellish some comments, fix tab'ing. Requested by: bde
* - Move the setting of bootverbose to a MI SI_SUB_TUNABLES SYSINIT.jhb2001-05-171-5/+1
| | | | | | | | - Attach a writable sysctl to bootverbose (debug.bootverbose) so it can be toggled after boot. - Move the printf of the version string to a SI_SUB_COPYRIGHT SYSINIT just afer the display of the copyright message instead of doing it by hand in three MD places.
* Consistently define the rune types.obrien2001-05-161-4/+17
| | | | Follow NetBSD's lead and add a _BSD_MBSTATE_T_ type.
* Move the int typedefs to the top so they can be used in defining other types.obrien2001-05-161-24/+24
| | | | | | Ensure every platform has __offsetof. Make multiple inclusion detection consistent with other <platform>/include/*.h files.
* Lock the procfs functions for doing a single step and reading/writingjhb2001-05-161-28/+16
| | | | | | registers better. Hold sched_lock not only for checking the flag but also while performing the actual operation to ensure the process doesn't get swapped out by another CPU while we the operation is being performed.
* "Sir, the deorbit burn completed succesfully."jhb2001-05-151-33/+0
| | | | RIP {sys/machine}/ipl.h.
* Remove unneeded includes of sys/ipl.h and machine/ipl.h.jhb2001-05-153-3/+0
|
* Implement a few more floppy ioctl commands and IO options, namely:joerg2001-05-141-2/+18
| | | | | | | | | | | | | | | | | | | | | . FD_CLRERR clears the error counter, thus re-enables kernel error printf()s, . FD_GSTAT obtains the last FDC operation state, if any, . FDOPT_NOERRLOG (temporarily) turns off kernel printf() floppy error logging, . FDOPT_NOERROR makes the kernel ignore an FDC error, thus can enable the transfer of an erroneous sector to the user application All options are being cleared on (last) close. Prime consumer of the last features will be fdread(1), to be committed shortly. (FD_CLRERR should be wired into fdcontrol(8), but then fdcontrol(8) needs a major rewrite anyway.)
* Convert DEVFS from an "opt-in" to an "opt-out" option.phk2001-05-132-2/+0
| | | | | | | | | If for some reason DEVFS is undesired, the "NODEVFS" option is needed now. Pending any significant issues, DEVFS will be made mandatory in -current on july 1st so that we can start reaping the full benefits of having it.
* Simply the vm fault trap handling code a bit by using if-else instead ofjhb2001-05-111-11/+4
| | | | | duplicating code in the then case and then using a goto to jump around the else case.
* Allow sendsig() to hand the proc lock off to osendsig() rather than havingjhb2001-05-111-2/+1
| | | | | sendsig() release the lock just so it can call osendsig() and have osendsig() acquire the lock.
* - Split out the support for per-CPU data from the SMP code. UP kernelsjhb2001-05-103-3/+3
| | | | | | | have per-CPU data and gdb on the i386 at least needs access to it. - Clean up includes in kern_idle.c and subr_smp.c. Reviewed by: jake
* The new order of things is that dwlpxN is now called pcibN- so hack aroundmjacob2001-05-101-2/+4
| | | | | *that* whilst we ponder the best way to decide how to register dwlpx interrupts with TLSB.
* add alpha_pci_route_interrupt methodmjacob2001-05-101-2/+4
|
* Quick hack to reintroduce the notion that there might be alpha platformsmjacob2001-05-101-20/+82
| | | | without an i8254 timer/counter. This really needs to be cleaned up.
* Include sys/lock.h for witness_list_locks() and axe unneeded sys/mutex.hjhb2001-05-091-1/+1
| | | | include.
* Undo part of the tangle of having sys/lock.h and sys/mutex.h included inmarkm2001-05-016-59/+57
| | | | | | | | | | | other "system" header files. Also help the deprecation of lockmgr.h by making it a sub-include of sys/lock.h and removing sys/lockmgr.h form kernel .c files. Sort sys/*.h includes where possible in affected files. OK'ed by: bde (with reservations)
* Turn on preemption by default on the alpha arch. This also removes thejhb2001-05-011-5/+0
| | | | | | PREEMPTION kernel option. Not objected to by: -alpha
* Overhaul of the SMP code. Several portions of the SMP kernel support havejhb2001-04-2711-769/+115
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | been made machine independent and various other adjustments have been made to support Alpha SMP. - It splits the per-process portions of hardclock() and statclock() off into hardclock_process() and statclock_process() respectively. hardclock() and statclock() call the *_process() functions for the current process so that UP systems will run as before. For SMP systems, it is simply necessary to ensure that all other processors execute the *_process() functions when the main clock functions are triggered on one CPU by an interrupt. For the alpha 4100, clock interrupts are delievered in a staggered broadcast fashion, so we simply call hardclock/statclock on the boot CPU and call the *_process() functions on the secondaries. For x86, we call statclock and hardclock as usual and then call forward_hardclock/statclock in the MD code to send an IPI to cause the AP's to execute forwared_hardclock/statclock which then call the *_process() functions. - forward_signal() and forward_roundrobin() have been reworked to be MI and to involve less hackery. Now the cpu doing the forward sets any flags, etc. and sends a very simple IPI_AST to the other cpu(s). AST IPIs now just basically return so that they can execute ast() and don't bother with setting the astpending or needresched flags themselves. This also removes the loop in forward_signal() as sched_lock closes the race condition that the loop worked around. - need_resched(), resched_wanted() and clear_resched() have been changed to take a process to act on rather than assuming curproc so that they can be used to implement forward_roundrobin() as described above. - Various other SMP variables have been moved to a MI subr_smp.c and a new header sys/smp.h declares MI SMP variables and API's. The IPI API's from machine/ipl.h have moved to machine/smp.h which is included by sys/smp.h. - The globaldata_register() and globaldata_find() functions as well as the SLIST of globaldata structures has become MI and moved into subr_smp.c. Also, the globaldata list is only available if SMP support is compiled in. Reviewed by: jake, peter Looked over by: eivind
* Make stathz match reality on platforms like the 4100 where hz!=1024gallatin2001-04-271-1/+1
| | | | | | It might be more correct to make stathz as close as possible to 128, but that would involve adding complexity to the clock intr path, which I don't want to do.
* Initialize p_md.md_kernnest to 1 for newly fork'd processes since theyjhb2001-04-261-0/+6
| | | | start off in the kernel.
* Fix SCM ID's and remove tailing blanks.obrien2001-04-258-27/+24
|
* - Make the dumping of console messages from the secondary CPU's to thejhb2001-04-251-3/+5
| | | | | kernel console be #ifdef DIAGNOSTIC. - Don't set ktr_mask in release_aps().
* alpha_fpstate_save is fairly expensive (critical enter/exit, possiblygallatin2001-04-251-0/+2
| | | | | | | saves 32 registers) to do on every context switch. This is only required for SMP, so only do it there. We should also look at moving the critical enter/exit out to the callers
* Add a new field 'md_kernnest' to the alpha machine dependent processjhb2001-04-246-15/+69
| | | | | | | | | | | | | | | | | | | | | structure. This field keeps track of how many levels deep we are nested into the kernel. The nesting level is bumped at the start of a trap, interrupt, syscall, or exception and is decremented on return. This is used to detect the case when the kernel is returning back to a kernel context in exception_return(). If we are returning to the kernel we need to update the globaldata pointer register saved in the stack frame in case we have switched CPU's between taking the initial interrupt that saved the frame and returning. If we don't do this fixup it is possible for a CPU to use the wrong per-cpu data. On UP systems this is not a problem, so the code is conditional on SMP. A count was used instead of simply checking the process status register in the frame during exception_return() since there are critical sections at the very start and end of a trap, exception, or interrupt from userland in which we could trash the t7 register being used in userland. The counter is incremented after adn before these critical sections respectively so that we will not overwrite the saved t7 register if we are interrupted during one of these critical sections.
* fix it so it compiles again after twerpage elsewheremjacob2001-04-231-0/+2
|
* Fix includes so it compiles again.mjacob2001-04-231-1/+2
|
* Block out all interrupts, even machine checks, for critical_enter()gallatin2001-04-212-1/+2
| | | | | | | This is will be required to prevent lowering the ipl when a critical_enter() is present in the interrupt path when handling a machine check. reviewed by: jhb
* GC some debugging code that's been #if 0'ed since we got the file fromgallatin2001-04-201-8/+0
| | | | NetBSD
* Convert the protection of hte i8254 from critical_enter/exit like it isjhb2001-04-183-17/+18
| | | | on the x86.
* Back out the previous revision as it causes random sig 11's to userlandjhb2001-04-181-7/+3
| | | | | | processes until a better fix is found. Submitted by: gallatin
* Save are floating point state in cpu_switch() if needed instead of relyingjhb2001-04-172-1/+8
| | | | | | | completely on lazy floating point state saving. This is needed for the SMP case since processes can migrate to other CPUs. Submitted by: dfr
* set gd_other_cpus later, when we have a better idea what the other cpusgallatin2001-04-171-1/+0
| | | | | | are. submitted by: jhb
* Improved support for alpha SMP. The following commit gets dual AS2100sgallatin2001-04-171-54/+193
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | and AS4100s into single user mode. This work was done jointly by jhb and myself, and builds on dfr's earlier work. smp_init_secondary() / smp_start_secondary() - use the uniq val to pass the globalp (me) - fancy footwork to take any pending machine checks (me) - doing things the FreeBSD way and getting the per-cpu idleproc created correctly, and synchronizing the startup of secondaries (jhb) mp_start() - better recognition of available cpus (jhb) smp_rendezvous() - if smp hasn't started, only run the rendezvous function on the current cpu. Sleuthing and (prior) incorrect fix by me, correct fix by jhb smp_handle_ipi() - more verbose handling of console messages (jhb) - grab sched lock around setting PS_ASTPENDING (jhb) forward_*clock() - commented out. Joint decision by dfr, jhb and myself General synchronization improvements (more mb()s, etc) (jhb) Printf cleanups (joint) Whitespace cleanups (jhb)
* Changes to support SMP:gallatin2001-04-171-6/+2
| | | | | | | | | - don't do the stack overflow sanity check on MP systems -- p->p_addr will be malloc'ed memory (not K0SEG) and the check will fail. - don't ignore clock interrupts on secondaries. Alphas apparently roundrobin clock interrupts to all cpus, so we're going to take clock interrupts on all CPUS and not forward them.
* changes to smp_init_secondary_glue():gallatin2001-04-171-19/+11
| | | | | | | | | | | | - use the unique value to save the per-cpu globalp struct like the comment says - don't lower the ipl to ALPHA_PSL_IPL_HIGH: we may have a pending machine check to take and we're not prepared for that yet, as we haven't setup our interrupt entry points. (this may only happen on sable/lynx) - indicate the fact that the working version of smp_init_secondary() doesn't return (this is tied up in other changes and hasn't yet been committed).
* Blow away the panic mutex in favor of using a single atomic_cmpset() on ajhb2001-04-171-3/+0
| | | | | | panic_cpu shared variable. I used a simple atomic operation here instead of a spin lock as it seemed to be excessive overhead. Also, this can avoid recursive panics if, for example, witness is broken.
* - Add appropriate #ifndef/#define/#endif to protect against multiplejhb2001-04-171-5/+4
| | | | | | inclusions. - Blow away all evidence of a static curpcb as curpcb is a per-CPU variable and this definition is now bogus.
* - Fix memory barriers in atomic operations so that the barriers are alwaysjhb2001-04-171-20/+26
| | | | | | | | | | | | | "inside" of locked regions. That is, an acquire atomic operation will always enforce a memory barrier after the atomic operation and a release operation will always enforce a memory barrier before the atomic operation. - Explicitly use 'mb' instead of 'wmb' in release atomic operations. The 'wmb' memory barrier is not strong enough to guarantee coherence with other processors. This is effectively a nop since alpha_wmb() actually performs a 'mb' and not a 'wmb', but I wanted the code to be more correct since at some point in the future alpha_wmb()'s implementation may switch to being a real 'wmb'.
* Add a cpu_throw() function that secondary CPU's can use for their firstjhb2001-04-171-0/+10
| | | | context switch.
OpenPOWER on IntegriCloud