summaryrefslogtreecommitdiffstats
path: root/sys/amd64
Commit message (Collapse)AuthorAgeFilesLines
* Add pmap_clear_write() to the interface between the virtual memoryalc2006-07-201-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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@
* Now that free_pv_entry() accesses the pmap, call free_pv_entry() inalc2006-07-171-1/+2
| | | | | | | pmap_remove_all() before rather than after the pmap is unlocked. At present, the page queues lock provides sufficient sychronization. In the future, the page queues lock may not always be held when free_pv_entry() is called.
* Sync specialreg.h changes between amd64 and i386 with few fixes.jkim2006-07-131-2/+5
|
* Simplify the pager support in DDB. Allowing different db commands tojhb2006-07-123-12/+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.
* Add two new CPUID bits for AMD CPUs, i. e., SVM and extended APIC register.jkim2006-07-122-2/+4
|
* Regen.jhb2006-07-113-6/+6
|
* - Add conditional VFS Giant locking to getdents_common() (linux ABIs),jhb2006-07-111-3/+3
| | | | | | | | ibcs2_getdents(), ibcs2_read(), ogetdirentries(), svr4_sys_getdents(), and svr4_sys_getdents64() similar to that in getdirentries(). - Mark ibcs2_getdents(), ibcs2_read(), linux_getdents(), linux_getdents64(), linux_readdir(), ogetdirentries(), svr4_sys_getdents(), and svr4_sys_getdents64() MPSAFE.
* Make the firmware assist driver resident inmjacob2006-07-091-0/+1
| | | | preparation for isp using it.
* Regen.jhb2006-07-063-4/+4
|
* - Protect the list of linux ioctl handlers with an sx lock.jhb2006-07-061-1/+1
| | | | | | - Hold Giant while calling linux ioctl handlers for now as they aren't all known to be MPSAFE yet. - Mark linux_ioctl() MPSAFE.
* Make two simplifications to pmap_ts_referenced(): Eliminate an unnecessaryalc2006-07-061-5/+3
| | | | test and exit the loop in a shorter way.
* pmap_clear_ptes() is already convoluted. This will worsen with thealc2006-07-051-28/+49
| | | | | | implementation of superpages. Eliminate it and add pmap_clear_write(). There are no functional changes. Checked by: md5
* Temporarily remove SCHED_CORE, it seems I have so many works can do now,davidxu2006-07-051-1/+0
| | | | one example is POSIX priority mutex for libthr.
* Correct an error in the new pmap_collect(), thus only affecting HEAD.alc2006-07-021-1/+1
| | | | | Specifically, the pv entry was always being freed to the caller's pmap instead of the pmap to which the pv entry belongs.
* Tidy up pmap_ts_referenced(): Eliminate excessive white space. Eliminatealc2006-07-011-11/+1
| | | | | | | an initialized but otherwise unused variable. Explicitly check a pointer against NULL. There are no functional changes. Checked by: md5
* Eliminate the remaining uses of "register".alc2006-07-011-27/+13
| | | | Convert the remaining K&R-style function declarations to ANSI-style.
* Regen.jhb2006-06-273-4/+4
|
* - Add a kern_semctl() helper function for __semctl(). It accepts a pointerjhb2006-06-271-1/+1
| | | | | | | to a copied-in copy of the 'union semun' and a uioseg to indicate which memory space the 'buf' pointer of the union points to. This is then used in linux_semctl() and svr4_sys_semctl() to eliminate use of the stackgap. - Mark linux_ipc() and svr4_sys_semsys() MPSAFE.
* Regen.jhb2006-06-273-6/+6
|
* - Expand the scope of Giant some in mount(2) to protect the vfsp structurejhb2006-06-271-3/+3
| | | | | | | | from going away. mount(2) is now MPSAFE. - Expand the scope of Giant some in unmount(2) to protect the mp structure (or rather, to handle concurrent unmount races) from going away. umount(2) is now MPSAFE, as well as linux_umount() and linux_oldumount(). - nmount(2) and linux_mount() were already MPSAFE.
* Correct a very old and very obscure bug: vmspace_fork() callsalc2006-06-271-3/+4
| | | | | | | | | | | | | pmap_copy() if the mapping is VM_INHERIT_SHARE. Suppose the mapping is also wired. vmspace_fork() clears the wiring attributes in the vm map entry but pmap_copy() copies the PG_W attribute in the PTE. I don't think this is catastrophic. It blocks pmap_remove_pages() from destroying the mapping and corrupts the pmap's wiring count. This revision fixes the problem by changing pmap_copy() to clear the PG_W attribute. Reviewed by: tegge@
* Add a pure open source nForce Ethernet driver, under BSDL.obrien2006-06-261-0/+2
| | | | | | | | | This driver was ported from OpenBSD by Shigeaki Tagashira <shigeaki@se.hiroshima-u.ac.jp> and posted at http://www.se.hiroshima-u.ac.jp/~shigeaki/software/freebsd-nfe.html It was additionally cleaned up by me. It is still a work-in-progress and thus is purposefully not in GENERIC. And it conflicts with nve(4), so only one should be loaded.
* Backed out the change by request from rwatson.babkin2006-06-261-1/+0
| | | | PR: kern/14584
* Regen.jhb2006-06-263-4/+4
|
* linux_brk() is MPSAFE.jhb2006-06-261-1/+1
|
* Eliminate a comment that became stale after revision 1.540.alc2006-06-251-6/+2
| | | | Wrap a nearby line.
* 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
* Commit the DUMMY stuff (printing messages for missing syscalls) for amd64 too.netchild2006-06-211-0/+56
| | | | | | | Submitted by: rdivacky Sponsored by: Google SoC 2006 Noticed by: jkim Pointyhat to: netchild
* Change get_pv_entry() such that the call to vm_page_alloc() specifiesalc2006-06-201-21/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | VM_ALLOC_NORMAL instead of VM_ALLOC_SYSTEM when try is TRUE. In other words, when get_pv_entry() is permitted to fail, it no longer tries as hard to allocate a page. Change pmap_enter_quick_locked() to fail rather than wait if it is unable to allocate a page table page. This prevents a race between pmap_enter_object() and the page daemon. Specifically, an inactive page that is a successor to the page that was given to pmap_enter_quick_locked() might become a cache page while pmap_enter_quick_locked() waits and later pmap_enter_object() maps the cache page violating the invariant that cache pages are never mapped. Similarly, change pmap_enter_quick_locked() to call pmap_try_insert_pv_entry() rather than pmap_insert_entry(). Generally speaking, pmap_enter_quick_locked() is used to create speculative mappings. So, it should not try hard to allocate memory if free memory is scarce. Add an assertion that the object containing m_start is locked in pmap_enter_object(). Remove a similar assertion from pmap_enter_quick_locked() because that function no longer accesses the containing object. Remove a stale comment. Reviewed by: ups@
* regen after change to syscalls.masternetchild2006-06-203-61/+341
|
* Switch to using the DUMMY infrastructure instead of UNIMPL for the newnetchild2006-06-201-58/+58
| | | | | | | | | | | | syscalls. This way there will be a log message printed to the console (this time for real). Note: UNIMPL should be used for syscalls we do not implement ever, e.g. syscalls to load linux kernel modules. Submitted by: rdivacky Sponsored by: Goole SoC 2006 P4 IDs: 99600, 99602
* We no longer need to disable interrupts in MD trap machineryyar2006-06-201-8/+2
| | | | | | | | | when we're about to call kdb_trap() because the latter MI function can disable interrupts by itself now. Pointed out by: bde X-MFC remark: depends on kern/subr_kdb.c#1.18 Sponsored by: RiNet (Cronyx Plus LLC)
* Add variable cpu_mxcsr_mask to save valid bits of mxcsr register.davidxu2006-06-191-0/+1
|
* MFi386:davidxu2006-06-193-2/+10
| | | | | | Use the method described in IA-32 Intel Architecture Software Developer's Manual chapter 11.6.6 to get valid mxcsr bits, use the mxcsr mask to clear invalid bits passed by user code.
* 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-5/+3
| | | | | | | | | 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
* regen after MFP4 (soc2006/rdivacky_linuxolator) of syscalls.masternetchild2006-06-133-163/+206
| | | | | | P4-Changes: similar to 98673 and 98675 but regenerated locally Sponsored by: Google SoC 2006 Submitted by: rdivacky
* MFP4 (soc2006/rdivacky_linuxolator)netchild2006-06-131-180/+225
| | | | | | | | | | | | | Update of syscall.master: o Adding of several new dummy syscalls (268-310) o Synchronization of amd64 syscall.master with i386 one o Auditing added to amd64 syscall.master o Change auditing type for lstat syscall (bugfix). [1] P4-Changes: 98672, 98674 Noticed by: rwatson [1] Sponsored by: Google SoC 2006 Submitted by: rdivacky
* Add scheduler CORE, the work I have done half a year ago, recent,davidxu2006-06-131-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I picked it up again. The scheduler is forked from ULE, but the algorithm to detect an interactive process is almost completely different with ULE, it comes from Linux paper "Understanding the Linux 2.6.8.1 CPU Scheduler", although I still use same word "score" as a priority boost in ULE scheduler. Briefly, the scheduler has following characteristic: 1. Timesharing process's nice value is seriously respected, timeslice and interaction detecting algorithm are based on nice value. 2. per-cpu scheduling queue and load balancing. 3. O(1) scheduling. 4. Some cpu affinity code in wakeup path. 5. Support POSIX SCHED_FIFO and SCHED_RR. Unlike scheduler 4BSD and ULE which using fuzzy RQ_PPQ, the scheduler uses 256 priority queues. Unlike ULE which using pull and push, the scheduelr uses pull method, the main reason is to let relative idle cpu do the work, but current the whole scheduler is protected by the big sched_lock, so the benefit is not visible, it really can be worse than nothing because all other cpu are locked out when we are doing balancing work, which the 4BSD scheduelr does not have this problem. The scheduler does not support hyperthreading very well, in fact, the scheduler does not make the difference between physical CPU and logical CPU, this should be improved in feature. The scheduler has priority inversion problem on MP machine, it is not good for realtime scheduling, it can cause realtime process starving. As a result, it seems the MySQL super-smack runs better on my Pentium-D machine when using libthr, despite on UP or SMP kernel.
* Enable a few more things in x86 NOTES to get broader LINT coverage:jhb2006-06-121-0/+12
| | | | | - Turn on iwi(4), ipw(4), and ndis(4) on amd64 and i386. - Turn on ral(4) and ural(4) on i386, pc98, and amd64.
* Don't invalidate the TLB in pmap_qenter() unless the old mapping was valid.alc2006-06-121-10/+15
| | | | | | Most often, it isn't. Reviewed by: tegge@
* Add the ability to subset the devices that UART pulls in. This allowsimp2006-06-121-0/+3
| | | | | | | | 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.
* Introduce the function pmap_enter_object(). It maps a sequence of residentalc2006-06-051-5/+47
| | | | | | | pages from the same object. Use it in vm_map_pmap_enter() to reduce the locking overhead of premapping objects. Reviewed by: tegge@
* After much discussion with mjacob and scottl, change bus_dmamem_alloc sosilby2006-06-011-21/+3
| | | | | | | | | | | | that it just warns the user with a printf when it misaligns a piece of memory that was requested through a busdma tag. Some drivers (such as mpt, and probably others) were asking for alignments that could not be satisfied, but as far as driver operation was concerned, that did not matter. In the theory that other drivers will fall into this same category, we agreed that panicing or making the allocation fail will cause more hardship than is necessary. The printf should be sufficient motivation to get the driver glitch fixed.
* Turn the panic on not being able to meet alignment constraintsmjacob2006-05-311-4/+22
| | | | | | | in bus_dmamem_alloc into the more reasonable EINVAL return. Also, reclaim memory allocated but then not used if we had an error return.
* MFi386 rev 1.78:silby2006-05-281-2/+14
| | | | | | | Add a quick hack to ensure that bus_dmamem_alloc properly aligns small allocations with large alignment requirements. Add a panic to detect cases where we've still failed to properly align.
* Move clock_lock prototype into <machine/clock.h>, where it is moresobomax2006-05-192-9/+1
| | | | | | appropriate. Discussed with: jhb
* Add le(4). I could actually only test it on alpha, i386 and sparc64 butmarius2006-05-171-1/+2
| | | | | given that this includes the more problematic platforms I see no reason why it shouldn't also work on amd64 and ia64.
* Since DELAY() was moved, most <machine/clock.h> #includes have beenphk2006-05-161-1/+0
| | | | unnecessary.
* Kill more references to lnc(4).ru2006-05-161-3/+1
| | | | Submitted by: grep(1)
OpenPOWER on IntegriCloud