CVS log for src/sys/amd64/amd64/vm_machdep.c
Up to [FreeBSD] / src / sys / amd64 / amd64
Request diff between arbitrary revisions
Keyword substitution: kv
Default branch: MAIN
Revision 1.278: download - view: text, markup, annotated - select for diffs
Sat Jan 21 17:45:27 2012 UTC (2 weeks, 5 days ago) by kib
Branches: MAIN
CVS tags: HEAD
Diff to: previous 1.277: preferred, colored
Changes since revision 1.277: +62 -8 lines
SVN rev 230426 on 2012-01-21 17:45:27Z by kib Add support for the extended FPU states on amd64, both for native 64bit and 32bit ABIs. As a side-effect, it enables AVX on capable CPUs. In particular: - Query the CPU support for XSAVE, list of the supported extensions and the required size of FPU save area. The hw.use_xsave tunable is provided for disabling XSAVE, and hw.xsave_mask may be used to select the enabled extensions. - Remove the FPU save area from PCB and dynamically allocate the (run-time sized) user save area on the top of the kernel stack, right above the PCB. Reorganize the thread0 PCB initialization to postpone it after BSP is queried for save area size. - The dumppcb, stoppcbs and susppcbs now do not carry the FPU state as well. FPU state is only useful for suspend, where it is saved in dynamically allocated suspfpusave area. - Use XSAVE and XRSTOR to save/restore FPU state, if supported and enabled. - Define new mcontext_t flag _MC_HASFPXSTATE, indicating that mcontext_t has a valid pointer to out-of-struct extended FPU state. Signal handlers are supplied with stack-allocated fpu state. The sigreturn(2) and setcontext(2) syscall honour the flag, allowing the signal handlers to inspect and manipilate extended state in the interrupted context. - The getcontext(2) never returns extended state, since there is no place in the fixed-sized mcontext_t to place variable-sized save area. And, since mcontext_t is embedded into ucontext_t, makes it impossible to fix in a reasonable way. Instead of extending getcontext(2) syscall, provide a sysarch(2) facility to query extended FPU state. - Add ptrace(2) support for getting and setting extended state; while there, implement missed PT_I386_{GET,SET}XMMREGS for 32bit binaries. - Change fpu_kern KPI to not expose struct fpu_kern_ctx layout to consumers, making it opaque. Internally, struct fpu_kern_ctx now contains a space for the extended state. Convert in-kernel consumers of fpu_kern KPI both on i386 and amd64. First version of the support for AVX was submitted by Tim Bird <tim.bird am sony com> on behalf of Sony. This version was written from scratch. Tested by: pho (previous version), Yamagi Burmeister <lists yamagi org> MFC after: 1 month
Revision 1.277.2.1.2.1: download - view: text, markup, annotated - select for diffs
Fri Nov 11 04:20:22 2011 UTC (2 months, 4 weeks ago) by kensmith
Branches: RELENG_9_0
CVS tags: RELENG_9_0_0_RELEASE
Diff to: previous 1.277.2.1: preferred, colored; next MAIN 1.278: preferred, colored
Changes since revision 1.277.2.1: +0 -0 lines
SVN rev 227445 on 2011-11-11 04:20:22Z by kensmith Copy stable/9 to releng/9.0 as part of the FreeBSD 9.0-RELEASE release cycle. Approved by: re (implicit)
Revision 1.277.2.1: download - view: text, markup, annotated - select for diffs
Fri Sep 23 00:51:37 2011 UTC (4 months, 2 weeks ago) by kensmith
Branches: RELENG_9
CVS tags: RELENG_9_0_BP
Branch point for: RELENG_9_0
Diff to: previous 1.277: preferred, colored; next MAIN 1.278: preferred, colored
Changes since revision 1.277: +0 -0 lines
SVN rev 225736 on 2011-09-23 00:51:37Z by kensmith Copy head to stable/9 as part of 9.0-RELEASE release cycle. Approved by: re (implicit)
Revision 1.277: download - view: text, markup, annotated - select for diffs
Mon Jul 4 12:04:52 2011 UTC (7 months, 1 week ago) by attilio
Branches: MAIN
CVS tags: RELENG_9_BP
Branch point for: RELENG_9
Diff to: previous 1.276: preferred, colored
Changes since revision 1.276: +3 -6 lines
SVN rev 223758 on 2011-07-04 12:04:52Z by attilio With retirement of cpumask_t and usage of cpuset_t for representing a mask of CPUs, pc_other_cpus and pc_cpumask become highly inefficient. Remove them and replace their usage with custom pc_cpuid magic (as, atm, pc_cpumask can be easilly represented by (1 << pc_cpuid) and pc_other_cpus by (all_cpus & ~(1 << pc_cpuid))). This change is not targeted for MFC because of struct pcpu members removal and dependency by cpumask_t retirement. MD review by: marcel, marius, alc Tested by: pluknet MD testing by: marcel, marius, gonzo, andreast
Revision 1.276: download - view: text, markup, annotated - select for diffs
Tue Jun 7 08:46:13 2011 UTC (8 months ago) by attilio
Branches: MAIN
Diff to: previous 1.275: preferred, colored
Changes since revision 1.275: +15 -6 lines
SVN rev 222813 on 2011-06-07 08:46:13Z by attilio etire the cpumask_t type and replace it with cpuset_t usage. This is intended to fix the bug where cpu mask objects are capped to 32. MAXCPU, then, can now arbitrarely bumped to whatever value. Anyway, as long as several structures in the kernel are statically allocated and sized as MAXCPU, it is suggested to keep it as low as possible for the time being. Technical notes on this commit itself: - More functions to handle with cpuset_t objects are introduced. The most notable are cpusetobj_ffs() (which calculates a ffs(3) for a cpuset_t object), cpusetobj_strprint() (which prepares a string representing a cpuset_t object) and cpusetobj_strscan() (which creates a valid cpuset_t starting from a string representation). - pc_cpumask and pc_other_cpus are target to be removed soon. With the moving from cpumask_t to cpuset_t they are now inefficient and not really useful. Anyway, for the time being, please note that access to pcpu datas is protected by sched_pin() in order to avoid migrating the CPU while reading more than one (possible) word - Please note that size of cpuset_t objects may differ between kernel and userland. While this is not directly related to the patch itself, it is good to understand that concept and possibly use the patch as a reference on how to deal with cpuset_t objects in userland, when accessing kernland members. - KTR_CPUMASK is changed and now is represented through a string, to be set as the example reported in NOTES. Please additively note that no MAXCPU is bumped in this patch, but private testing has been done until to MAXCPU=128 on a real 8x8x2(htt) machine (amd64). Please note that the FreeBSD version is not yet bumped because of the upcoming pcpu changes. However, note that this patch is not targeted for MFC. People to thank for the time spent on this patch: - sbruno, pluknet and Nicholas Esborn (nick AT desert DOT net) tested several revision of the patches and really helped in improving stability of this work. - marius fixed several bugs in the sparc64 implementation and reviewed patches related to ktr. - jeff and jhb discussed the basic approach followed. - kib and marcel made targeted review on some specific part of the patch. - marius, art, nwhitehorn and andreast reviewed MD specific part of the patch. - marius, andreast, gonzo, nwhitehorn and jceel tested MD specific implementations of the patch. - Other people have made contributions on other patches that have been already committed and have been listed separately. Companies that should be mentioned for having participated at several degrees: - Yahoo! for having offered the machines used for testing on big count of CPUs. - The FreeBSD Foundation for having sponsored my devsummit attendance, which has been instrumental. - Sandvine for having offered offices and infrastructure during development. (I really hope I didn't forget anyone, if it happened I apologize in advance).
Revision 1.264.2.10: download - view: text, markup, annotated - select for diffs
Wed Mar 2 19:09:49 2011 UTC (11 months, 1 week ago) by jkim
Branches: RELENG_8
Diff to: previous 1.264.2.9: preferred, colored; branchpoint 1.264: preferred, colored; next MAIN 1.265: preferred, colored
Changes since revision 1.264.2.9: +9 -7 lines
SVN rev 219187 on 2011-03-02 19:09:49Z by jkim MFC: r216634, r216673 Improve PCB flags handling and make it more robust. Add two new functions for manipulating pcb_flags. These inline functions are very similar to atomic_set_int(9) and atomic_clear_int(9) but without unnecessary LOCK prefix for SMP. Add comments about the rationale. Use these functions wherever possible. Although there are some places where it is not strictly necessary (e.g., a PCB is copied to create a new PCB), it is done across the board for sake of consistency. Turn pcb_full_iret into a PCB flag as it is safe now. Move rarely used fields before pcb_flags and reduce size of pcb_flags to four bytes. Fix some style(9) nits in pcb.h while I am in the neighborhood.
Revision 1.264.2.9: download - view: text, markup, annotated - select for diffs
Tue Mar 1 20:44:14 2011 UTC (11 months, 1 week ago) by dchagin
Branches: RELENG_8
Diff to: previous 1.264.2.8: preferred, colored; branchpoint 1.264: preferred, colored
Changes since revision 1.264.2.8: +2 -2 lines
SVN rev 219144 on 2011-03-01 20:44:14Z by dchagin MFC r217896: Add macro to test the sv_flags of any process. Change some places to test the flags instead of explicit comparing with address of known sysentvec structures.
Revision 1.275: download - view: text, markup, annotated - select for diffs
Wed Jan 26 20:03:58 2011 UTC (12 months, 2 weeks ago) by dchagin
Branches: MAIN
Diff to: previous 1.274: preferred, colored
Changes since revision 1.274: +2 -2 lines
SVN rev 217896 on 2011-01-26 20:03:58Z by dchagin Add macro to test the sv_flags of any process. Change some places to test the flags instead of explicit comparing with address of known sysentvec structures. MFC after: 1 month
Revision 1.274: download - view: text, markup, annotated - select for diffs
Wed Dec 22 00:18:42 2010 UTC (13 months, 2 weeks ago) by jkim
Branches: MAIN
Diff to: previous 1.273: preferred, colored
Changes since revision 1.273: +9 -7 lines
SVN rev 216634 on 2010-12-22 00:18:42Z by jkim Improve PCB flags handling and make it more robust. Add two new functions for manipulating pcb_flags. These inline functions are very similar to atomic_set_char(9) and atomic_clear_char(9) but without unnecessary LOCK prefix for SMP. Add comments about the rationale[1]. Use these functions wherever possible. Although there are some places where it is not strictly necessary (e.g., a PCB is copied to create a new PCB), it is done across the board for sake of consistency. Turn pcb_full_iret into a PCB flag as it is safe now. Move rarely used fields before pcb_flags and reduce size of pcb_flags to one byte. Fix some style(9) nits in pcb.h while I am in the neighborhood. Reviewed by: kib Submitted by: kib[1] MFC after: 2 months
Revision 1.255.2.3.4.1: download - view: text, markup, annotated - select for diffs
Tue Dec 21 17:10:29 2010 UTC (13 months, 2 weeks ago) by kensmith
Branches: RELENG_7_4
CVS tags: RELENG_7_4_0_RELEASE
Diff to: previous 1.255.2.3: preferred, colored; next MAIN 1.256: preferred, colored
Changes since revision 1.255.2.3: +0 -0 lines
SVN rev 216618 on 2010-12-21 17:10:29Z by kensmith Copy stable/7 to releng/7.4 in preparation for FreeBSD-7.4 release. Approved by: re (implicit)
Revision 1.264.2.8.2.1: download - view: text, markup, annotated - select for diffs
Tue Dec 21 17:09:25 2010 UTC (13 months, 2 weeks ago) by kensmith
Branches: RELENG_8_2
CVS tags: RELENG_8_2_0_RELEASE
Diff to: previous 1.264.2.8: preferred, colored; next MAIN 1.264.2.9: preferred, colored
Changes since revision 1.264.2.8: +0 -0 lines
SVN rev 216617 on 2010-12-21 17:09:25Z by kensmith Copy stable/8 to releng/8.2 in preparation for FreeBSD-8.2 release. Approved by: re (implicit)
Revision 1.264.2.8: download - view: text, markup, annotated - select for diffs
Wed Dec 15 15:25:56 2010 UTC (13 months, 3 weeks ago) by kib
Branches: RELENG_8
CVS tags: RELENG_8_2_BP
Branch point for: RELENG_8_2
Diff to: previous 1.264.2.7: preferred, colored; branchpoint 1.264: preferred, colored
Changes since revision 1.264.2.7: +2 -3 lines
SVN rev 216458 on 2010-12-15 15:25:56Z by kib MFC r216255: Update some comments related to use of amd64 full context switch. In exec_linux_setregs(), use locally cached pointer to pcb to set pcb_full_iret. In set_regs(), note that full return is needed when code that sets segment registers is enabled. Approved by: re (bz)
Revision 1.264.2.7: download - view: text, markup, annotated - select for diffs
Wed Dec 15 15:23:25 2010 UTC (13 months, 3 weeks ago) by kib
Branches: RELENG_8
Diff to: previous 1.264.2.6: preferred, colored; branchpoint 1.264: preferred, colored
Changes since revision 1.264.2.6: +0 -1 lines
SVN rev 216457 on 2010-12-15 15:23:25Z by kib MFC r216253: Retire write-only PCB_FULLCTX pcb flag on amd64. Approved by: re (bz)
Revision 1.273: download - view: text, markup, annotated - select for diffs
Tue Dec 7 12:44:33 2010 UTC (14 months ago) by kib
Branches: MAIN
Diff to: previous 1.272: preferred, colored
Changes since revision 1.272: +2 -3 lines
SVN rev 216255 on 2010-12-07 12:44:33Z by kib Update some comments related to use of amd64 full context switch. In exec_linux_setregs(), use locally cached pointer to pcb to set pcb_full_iret. In set_regs(), note that full return is needed when code that sets segment registers is enabled. MFC after: 1 week
Revision 1.272: download - view: text, markup, annotated - select for diffs
Tue Dec 7 12:17:43 2010 UTC (14 months ago) by kib
Branches: MAIN
Diff to: previous 1.271: preferred, colored
Changes since revision 1.271: +0 -1 lines
SVN rev 216253 on 2010-12-07 12:17:43Z by kib Retire write-only PCB_FULLCTX pcb flag on amd64. Reminded by: Petr Salinger <Petr.Salinger seznam cz> Tested by: pho MFC after: 1 week
Revision 1.264.2.6: download - view: text, markup, annotated - select for diffs
Fri Nov 19 09:49:14 2010 UTC (14 months, 3 weeks ago) by kib
Branches: RELENG_8
Diff to: previous 1.264.2.5: preferred, colored; branchpoint 1.264: preferred, colored
Changes since revision 1.264.2.5: +10 -3 lines
SVN rev 215513 on 2010-11-19 09:49:14Z by kib
Merge the kern_fpu_enter/kern_fpu_leave KPI and followup fixes for the
amd64 suspend/resume support.
Tested by: Mike Tancsa
Also tested by: Dewayne Geraghty <dewayne.geraghty heuristicsystems com au>,
Daryl Richards <daryl isletech net>
Below is the svn log of the merged revisions.
------------------------------------------------------------------------
r197455 | emaste | 2009-09-24 17:26:42 +0300 (Thu, 24 Sep 2009) | 5 lines
Add a backtrace to the "fpudna in kernel mode!" case, to help track down
where this comes from.
Reviewed by: bde
------------------------------------------------------------------------
r197863 | jkim | 2009-10-08 20:41:53 +0300 (Thu, 08 Oct 2009) | 8 lines
Clean up amd64 suspend/resume code.
- Allocate memory for wakeup code after ACPI bus is attached. The early
memory allocation hack was inherited from i386 but amd64 does not need it.
- Exclude real mode IVT and BDA explicitly. Improve comments about memory
allocation and reason for the exclusions. It is a no-op in reality, though.
- Remove an unnecessary CLD from wakeup code and re-align.
------------------------------------------------------------------------
r198931 | jkim | 2009-11-05 00:39:18 +0200 (Thu, 05 Nov 2009) | 2 lines
Tweak memory allocation for amd64 suspend/resume CPU context.
------------------------------------------------------------------------
r200280 | jkim | 2009-12-09 00:38:42 +0200 (Wed, 09 Dec 2009) | 2 lines
Simplify a macro not to generate unncessary symbols.
------------------------------------------------------------------------
r205444 | emaste | 2010-03-22 13:52:53 +0200 (Mon, 22 Mar 2010) | 7 lines
Merge r197455 from amd64:
Add a backtrace to the "fpudna in kernel mode!" case, to help track down
where this comes from.
Reviewed by: bde
------------------------------------------------------------------------
r208833 | kib | 2010-06-05 18:59:59 +0300 (Sat, 05 Jun 2010) | 15 lines
Introduce the x86 kernel interfaces to allow kernel code to use
FPU/SSE hardware. Caller should provide a save area that is chained
into the stack of the areas; pcb save_area for usermode FPU state is
on top. The pcb now contains a pointer to the current FPU saved area,
used during FPUDNA handling and context switches. There is also a
facility to allow the kernel thread to use pcb save_area.
Change the dreaded warnings "npxdna in kernel mode!" into the panics
when FPU usage is not registered.
KPI discussed with: fabient
Tested by: pho, fabient
Hardware provided by: Sentex Communications
MFC after: 1 month
------------------------------------------------------------------------
r208834 | kib | 2010-06-05 19:00:53 +0300 (Sat, 05 Jun 2010) | 13 lines
Use the fpu_kern_enter() interface to properly separate usermode FPU
context from in-kernel execution of padlock instructions and to handle
spurious FPUDNA exceptions that sometime are raised when doing padlock
calculations.
Globally mark crypto(9) kthread as using FPU.
Reviewed by: pjd
Hardware provided by: Sentex Communications
Tested by: pho
PR: amd64/135014
MFC after: 1 month
------------------------------------------------------------------------
r208877 | kib | 2010-06-06 19:13:50 +0300 (Sun, 06 Jun 2010) | 5 lines
Style-compilant order of declarations.
Noted by: bde
MFC after: 1 month
------------------------------------------------------------------------
r209174 | jkim | 2010-06-14 23:08:26 +0300 (Mon, 14 Jun 2010) | 3 lines
Fix ACPI suspend/resume on amd64, which was broken since r208833.
We need actual storage for FPU state to save and restore.
------------------------------------------------------------------------
r209198 | kib | 2010-06-15 12:19:33 +0300 (Tue, 15 Jun 2010) | 10 lines
Use critical sections instead of disabling local interrupts to ensure
the consistency between PCPU fpcurthread and the state of the FPU.
Explicitely assert that the calling conventions for fpudrop() are
adhered too. In cpu_thread_exit(), add missed critical section entrance.
Reviewed by: bde
Tested by: pho
MFC after: 1 month
------------------------------------------------------------------------
r209204 | kib | 2010-06-15 17:59:35 +0300 (Tue, 15 Jun 2010) | 5 lines
Rename CRITSECT_ASSERT to CRITICAL_ASSERT.
Suggested by: jhb
MFC after: 1 month
------------------------------------------------------------------------
r209208 | kib | 2010-06-15 21:16:04 +0300 (Tue, 15 Jun 2010) | 4 lines
Remove two obsoleted comments, add a note about 32bit compatibility.
MFC after: 1 month
------------------------------------------------------------------------
r209252 | kib | 2010-06-17 15:35:17 +0300 (Thu, 17 Jun 2010) | 6 lines
In the ia32_{get,set}_fpcontext(), use fpu{get,set}userregs instead
of fpu{get,set}regs.
Noted by: bde
MFC after: 1 month
------------------------------------------------------------------------
r209460 | kib | 2010-06-23 13:40:28 +0300 (Wed, 23 Jun 2010) | 8 lines
Remove unused i586 optimized bcopy/bzero/etc implementations that utilize
FPU registers for copying. Remove the switch table and jumps from
bcopy/bzero/... to the actual implementation.
As a side-effect, i486-optimized bzero is removed.
Reviewed by: bde
Tested by: pho (previous version)
------------------------------------------------------------------------
r209461 | kib | 2010-06-23 14:12:58 +0300 (Wed, 23 Jun 2010) | 8 lines
Remove the support for int13 FPU exception reporting on i386. It is
believed that all 486-class CPUs FreeBSD is capable to run on, either
have no FPU and cannot use external coprocessor, or have FPU on the
package and can use #MF.
Reviewed by: bde
Tested by: pho (previous version)
------------------------------------------------------------------------
r209462 | kib | 2010-06-23 14:21:19 +0300 (Wed, 23 Jun 2010) | 8 lines
After the FPU use requires #MF working due to INT13 FPU exception handling
removal, MFi386 r209198:
Use critical sections instead of disabling local interrupts to ensure
the consistency between PCPU fpcurthread and the state of FPU.
Reviewed by: bde
Tested by: pho
------------------------------------------------------------------------
r210514 | jkim | 2010-07-26 22:53:09 +0300 (Mon, 26 Jul 2010) | 6 lines
Re-implement FPU suspend/resume for amd64. This removes superfluous uses
of critical_enter(9) and critical_exit(9) by fpugetregs() and fpusetregs().
Also, we do not touch PCB flags any more.
MFC after: 1 month
------------------------------------------------------------------------
r210517 | jkim | 2010-07-27 00:24:52 +0300 (Tue, 27 Jul 2010) | 4 lines
FNSTSW instruction can use AX register as an operand.
Obtained from: fenv.h
------------------------------------------------------------------------
r210518 | jkim | 2010-07-27 01:16:36 +0300 (Tue, 27 Jul 2010) | 5 lines
Reduce diff against fenv.h:
Mark all inline asms as volatile for safety. No object file change after
this commit (verified with md5).
------------------------------------------------------------------------
r210519 | jkim | 2010-07-27 01:55:14 +0300 (Tue, 27 Jul 2010) | 2 lines
Remove an unused macro since r189418.
------------------------------------------------------------------------
r210520 | jkim | 2010-07-27 02:02:18 +0300 (Tue, 27 Jul 2010) | 2 lines
Add missing ldmxcsr() prototype for lint case.
------------------------------------------------------------------------
r210521 | jkim | 2010-07-27 02:20:55 +0300 (Tue, 27 Jul 2010) | 3 lines
Simplify fldcw() macro. There is no reason to use pointer here. No object
file change after this commit (verified with md5).
------------------------------------------------------------------------
r210614 | jkim | 2010-07-29 19:41:21 +0300 (Thu, 29 Jul 2010) | 2 lines
Rename PCB_USER_FPU to PCB_USERFPU not to clash with a macro from fpu.h.
------------------------------------------------------------------------
r210615 | jkim | 2010-07-29 19:49:20 +0300 (Thu, 29 Jul 2010) | 5 lines
Fix another fallout from r208833. savectx() is used to save CPU context
for crash dump (dumppcb) and kdb (stoppcbs). For both cases, there cannot
have a valid pointer in pcb_save. This should restore the previous
behaviour.
------------------------------------------------------------------------
r210777 | jkim | 2010-08-02 20:35:00 +0300 (Mon, 02 Aug 2010) | 13 lines
- Merge savectx2() with savectx() and struct xpcb with struct pcb. [1]
savectx() is only used for panic dump (dumppcb) and kdb (stoppcbs). Thus,
saving additional information does not hurt and it may be even beneficial.
Unfortunately, struct pcb has grown larger to accommodate more data.
Move 512-byte long pcb_user_save to the end of struct pcb while I am here.
- savectx() now saves FPU state unconditionally and copy it to the PCB of
FPU thread if necessary. This gives panic dump and kdb a chance to take
a look at the current FPU state even if the FPU is "supposedly" not used.
- Resuming CPU now unconditionally reinitializes FPU. If the saved FPU
state was irrelevant, it could be in an unknown state.
Suggested by: bde [1]
------------------------------------------------------------------------
r210804 | jkim | 2010-08-03 18:32:08 +0300 (Tue, 03 Aug 2010) | 6 lines
savectx() has not been used for fork(2) for about 15 years. [1]
Do not clobber FPU thread's PCB as it is more harmful. When we resume CPU,
unconditionally reload FPU state.
Pointed out by: bde [1]
------------------------------------------------------------------------
r212026 | jkim | 2010-08-31 00:19:42 +0300 (Tue, 31 Aug 2010) | 3 lines
Save MSR_FSBASE, MSR_GSBASE and MSR_KGSBASE directly to PCB as we do not use
these values in the function.
------------------------------------------------------------------------
r214347 | jhb | 2010-10-25 18:31:13 +0300 (Mon, 25 Oct 2010) | 5 lines
Use 'saveintr' instead of 'savecrit' or 'eflags' to hold the state returned
by intr_disable().
Requested by: bde
------------------------------------------------------------------------
Revision 1.264.2.5: download - view: text, markup, annotated - select for diffs
Thu Nov 11 19:39:38 2010 UTC (14 months, 4 weeks ago) by jhb
Branches: RELENG_8
Diff to: previous 1.264.2.4: preferred, colored; branchpoint 1.264: preferred, colored
Changes since revision 1.264.2.4: +2 -1 lines
SVN rev 215141 on 2010-11-11 19:39:38Z by jhb MFC 211149,211151,211197,211518,215128: Update various places that store or manipulate CPU masks to use cpumask_t instead of int or u_int. Since cpumask_t is currently u_int on all platforms this should just be a cosmetic change.
Revision 1.271: download - view: text, markup, annotated - select for diffs
Wed Aug 11 23:22:53 2010 UTC (17 months, 4 weeks ago) by jhb
Branches: MAIN
Diff to: previous 1.270: preferred, colored
Changes since revision 1.270: +2 -1 lines
SVN rev 211197 on 2010-08-11 23:22:53Z by jhb Update various places that store or manipulate CPU masks to use cpumask_t instead of int or u_int. Since cpumask_t is currently u_int on all platforms this should just be a cosmetic change.
Revision 1.270: download - view: text, markup, annotated - select for diffs
Tue Jun 15 09:19:33 2010 UTC (19 months, 3 weeks ago) by kib
Branches: MAIN
Diff to: previous 1.269: preferred, colored
Changes since revision 1.269: +2 -0 lines
SVN rev 209198 on 2010-06-15 09:19:33Z by kib Use critical sections instead of disabling local interrupts to ensure the consistency between PCPU fpcurthread and the state of the FPU. Explicitely assert that the calling conventions for fpudrop() are adhered too. In cpu_thread_exit(), add missed critical section entrance. Reviewed by: bde Tested by: pho MFC after: 1 month
Revision 1.264.2.4.2.1: download - view: text, markup, annotated - select for diffs
Mon Jun 14 02:09:06 2010 UTC (19 months, 4 weeks ago) by kensmith
Branches: RELENG_8_1
CVS tags: RELENG_8_1_0_RELEASE
Diff to: previous 1.264.2.4: preferred, colored; next MAIN 1.264.2.5: preferred, colored
Changes since revision 1.264.2.4: +0 -0 lines
SVN rev 209145 on 2010-06-14 02:09:06Z by kensmith Copy stable/8 to releng/8.1 in preparation for 8.1-RC1. Approved by: re (implicit)
Revision 1.269: download - view: text, markup, annotated - select for diffs
Sat Jun 5 15:59:59 2010 UTC (20 months ago) by kib
Branches: MAIN
Diff to: previous 1.268: preferred, colored
Changes since revision 1.268: +8 -3 lines
SVN rev 208833 on 2010-06-05 15:59:59Z by kib Introduce the x86 kernel interfaces to allow kernel code to use FPU/SSE hardware. Caller should provide a save area that is chained into the stack of the areas; pcb save_area for usermode FPU state is on top. The pcb now contains a pointer to the current FPU saved area, used during FPUDNA handling and context switches. There is also a facility to allow the kernel thread to use pcb save_area. Change the dreaded warnings "npxdna in kernel mode!" into the panics when FPU usage is not registered. KPI discussed with: fabient Tested by: pho, fabient Hardware provided by: Sentex Communications MFC after: 1 month
Revision 1.264.2.4: download - view: text, markup, annotated - select for diffs
Wed Apr 7 02:24:41 2010 UTC (22 months ago) by nwhitehorn
Branches: RELENG_8
CVS tags: RELENG_8_1_BP
Branch point for: RELENG_8_1
Diff to: previous 1.264.2.3: preferred, colored; branchpoint 1.264: preferred, colored
Changes since revision 1.264.2.3: +2 -2 lines
SVN rev 206336 on 2010-04-07 02:24:41Z by nwhitehorn MFC r205014,205015: Provide groundwork for 32-bit binary compatibility on non-x86 platforms, for upcoming 64-bit PowerPC and MIPS support. This renames the COMPAT_IA32 option to COMPAT_FREEBSD32, removes some IA32-specific code from MI parts of the kernel and enhances the freebsd32 compatibility code to support big-endian platforms. This MFC is required for MFCs of later changes to the freebsd32 compatibility from HEAD. Requested by: kib
Revision 1.268: download - view: text, markup, annotated - select for diffs
Thu Mar 11 14:49:06 2010 UTC (23 months ago) by nwhitehorn
Branches: MAIN
Diff to: previous 1.267: preferred, colored
Changes since revision 1.267: +2 -2 lines
SVN rev 205014 on 2010-03-11 14:49:06Z by nwhitehorn Provide groundwork for 32-bit binary compatibility on non-x86 platforms, for upcoming 64-bit PowerPC and MIPS support. This renames the COMPAT_IA32 option to COMPAT_FREEBSD32, removes some IA32-specific code from MI parts of the kernel and enhances the freebsd32 compatibility code to support big-endian platforms. Reviewed by: kib, jhb
Revision 1.267: download - view: text, markup, annotated - select for diffs
Thu Feb 25 14:13:39 2010 UTC (23 months, 2 weeks ago) by attilio
Branches: MAIN
Diff to: previous 1.266: preferred, colored
Changes since revision 1.266: +1 -1 lines
SVN rev 204309 on 2010-02-25 14:13:39Z by attilio Introduce the new kernel sub-tree x86 which should contain all the code shared and generalized between our current amd64, i386 and pc98. This is just an initial step that should lead to a more complete effort. For the moment, a very simple porting of cpufreq modules, BIOS calls and the whole MD specific ISA bus part is added to the sub-tree but ideally a lot of code might be added and more shared support should grow. Sponsored by: Sandvine Incorporated Reviewed by: emaste, kib, jhb, imp Discussed on: arch MFC: 3 weeks
Revision 1.255.2.3.2.1: download - view: text, markup, annotated - select for diffs
Wed Feb 10 00:26:20 2010 UTC (2 years ago) by kensmith
Branches: RELENG_7_3
CVS tags: RELENG_7_3_0_RELEASE
Diff to: previous 1.255.2.3: preferred, colored; next MAIN 1.256: preferred, colored
Changes since revision 1.255.2.3: +0 -0 lines
SVN rev 203736 on 2010-02-10 00:26:20Z by kensmith Copy stable/7 to releng/7.3 as part of the 7.3-RELEASE process. Approved by: re (implicit)
Revision 1.255.2.3: download - view: text, markup, annotated - select for diffs
Mon Jan 25 15:50:52 2010 UTC (2 years ago) by jhb
Branches: RELENG_7
CVS tags: RELENG_7_4_BP, RELENG_7_3_BP
Branch point for: RELENG_7_4, RELENG_7_3
Diff to: previous 1.255.2.2: preferred, colored; branchpoint 1.255: preferred, colored; next MAIN 1.256: preferred, colored
Changes since revision 1.255.2.2: +3 -1 lines
SVN rev 202970 on 2010-01-25 15:50:52Z by jhb MFC 190239: In general, the kernel virtual address of the pml4 page table page that is stored in the pmap is from the direct map region. The two exceptions have been the kernel pmap and the swapper's pmap. These pmaps have used a kernel virtual address established by pmap_bootstrap() for their shared pml4 page table page. However, there is no reason not to use the direct map for these pmaps as well. Approved by: re (kib)
Revision 1.264.2.3: download - view: text, markup, annotated - select for diffs
Sat Dec 19 10:28:24 2009 UTC (2 years, 1 month ago) by kib
Branches: RELENG_8
Diff to: previous 1.264.2.2: preferred, colored; branchpoint 1.264: preferred, colored
Changes since revision 1.264.2.2: +5 -1 lines
SVN rev 200710 on 2009-12-19 10:28:24Z by kib MFC r200444: For ia32 syscall(), call cpu_set_syscall_retval().
Revision 1.266: download - view: text, markup, annotated - select for diffs
Sat Dec 12 20:11:31 2009 UTC (2 years, 1 month ago) by kib
Branches: MAIN
Diff to: previous 1.265: preferred, colored
Changes since revision 1.265: +5 -1 lines
SVN rev 200444 on 2009-12-12 20:11:31Z by kib For ia32 syscall(), call cpu_set_syscall_retval(). Update comment inside cpu_set_syscall_retval() accordingly. MFC after: 1 week
Revision 1.264.2.2: download - view: text, markup, annotated - select for diffs
Sat Dec 12 20:06:25 2009 UTC (2 years, 1 month ago) by kib
Branches: RELENG_8
Diff to: previous 1.264.2.1: preferred, colored; branchpoint 1.264: preferred, colored
Changes since revision 1.264.2.1: +39 -0 lines
SVN rev 200443 on 2009-12-12 20:06:25Z by kib MFC r199135: Extract the code that records syscall results in the frame into MD function cpu_set_syscall_retval().
Revision 1.265: download - view: text, markup, annotated - select for diffs
Tue Nov 10 11:43:07 2009 UTC (2 years, 3 months ago) by kib
Branches: MAIN
Diff to: previous 1.264: preferred, colored
Changes since revision 1.264: +39 -0 lines
SVN rev 199135 on 2009-11-10 11:43:07Z by kib Extract the code that records syscall results in the frame into MD function cpu_set_syscall_retval(). Suggested by: marcel Reviewed by: marcel, davidxu PowerPC, ARM, ia64 changes: marcel Sparc64 tested and reviewed by: marius, also sunv reviewed MIPS tested by: gonzo MFC after: 1 month
Revision 1.264.2.1.2.1: download - view: text, markup, annotated - select for diffs
Sun Oct 25 01:10:29 2009 UTC (2 years, 3 months ago) by kensmith
Branches: RELENG_8_0
CVS tags: RELENG_8_0_0_RELEASE
Diff to: previous 1.264.2.1: preferred, colored; next MAIN 1.264.2.2: preferred, colored
Changes since revision 1.264.2.1: +0 -0 lines
SVN rev 198460 on 2009-10-25 01:10:29Z by kensmith Copy stable/8 to releng/8.0 as part of 8.0-RELEASE release procedure. Approved by: re (implicit)
Revision 1.264.2.1: download - view: text, markup, annotated - select for diffs
Mon Aug 3 08:13:06 2009 UTC (2 years, 6 months ago) by kensmith
Branches: RELENG_8
CVS tags: RELENG_8_0_BP
Branch point for: RELENG_8_0
Diff to: previous 1.264: preferred, colored
Changes since revision 1.264: +0 -0 lines
SVN rev 196045 on 2009-08-03 08:13:06Z by kensmith Copy head to stable/8 as part of 8.0 Release cycle. Approved by: re (Implicit)
Revision 1.264: download - view: text, markup, annotated - select for diffs
Thu Jul 9 09:34:11 2009 UTC (2 years, 7 months ago) by kib
Branches: MAIN
CVS tags: RELENG_8_BP
Branch point for: RELENG_8
Diff to: previous 1.263: preferred, colored
Changes since revision 1.263: +5 -0 lines
SVN rev 195486 on 2009-07-09 09:34:11Z by kib Restore the segment registers and segment base MSRs for amd64 syscall return path only when neither thread was context switched while executing syscall code nor syscall explicitely modified LDT or MSRs. Save segment registers in trap handlers before interrupts are enabled, to not allow context switches to happen before registers are saved. Use separated byte in pcb for indication of fast/full return, since pcb_flags are not synchronized with context switches. The change puts back syscall microbenchmark numbers that were slowed down after commit of the support for LDT on amd64. Reviewed by: jeff Tested (and tested, and tested ...) by: pho Approved by: re (kensmith)
Revision 1.255.2.2.4.1: download - view: text, markup, annotated - select for diffs
Wed Apr 15 03:14:26 2009 UTC (2 years, 9 months ago) by kensmith
Branches: RELENG_7_2
CVS tags: RELENG_7_2_0_RELEASE
Diff to: previous 1.255.2.2: preferred, colored; next MAIN 1.255.2.3: preferred, colored
Changes since revision 1.255.2.2: +0 -0 lines
SVN rev 191087 on 2009-04-15 03:14:26Z by kensmith Create releng/7.2 from stable/7 in preparation for 7.2-RELEASE. Approved by: re (implicit)
Revision 1.263: download - view: text, markup, annotated - select for diffs
Wed Apr 1 13:09:26 2009 UTC (2 years, 10 months ago) by kib
Branches: MAIN
Diff to: previous 1.262: preferred, colored
Changes since revision 1.262: +76 -20 lines
SVN rev 190620 on 2009-04-01 13:09:26Z by kib Save and restore segment registers on amd64 when entering and leaving the kernel on amd64. Fill and read segment registers for mcontext and signals. Handle traps caused by restoration of the invalidated selectors. Implement user-mode creation and manipulation of the process-specific LDT descriptors for amd64, see sysarch(2). Implement support for TSS i/o port access permission bitmap for amd64. Context-switch LDT and TSS. Do not save and restore segment registers on the context switch, that is handled by kernel enter/leave trampolines now. Remove segment restore code from the signal trampolines for freebsd/amd64, freebsd/ia32 and linux/i386 for the same reason. Implement amd64-specific compat shims for sysarch. Linuxolator (temporary ?) switched to use gsbase for thread_area pointer. TODO: Currently, gdb is not adapted to show segment registers from struct reg. Also, no machine-depended ptrace command is added to set segment registers for debugged process. In collaboration with: pho Discussed with: peter Reviewed by: jhb Linuxolator tested by: dchagin
Revision 1.262: download - view: text, markup, annotated - select for diffs
Sun Mar 22 04:32:05 2009 UTC (2 years, 10 months ago) by alc
Branches: MAIN
Diff to: previous 1.261: preferred, colored
Changes since revision 1.261: +3 -1 lines
SVN rev 190239 on 2009-03-22 04:32:05Z by alc In general, the kernel virtual address of the pml4 page table page that is stored in the pmap is from the direct map region. The two exceptions have been the kernel pmap and the swapper's pmap. These pmaps have used a kernel virtual address established by pmap_bootstrap() for their shared pml4 page table page. However, there is no reason not to use the direct map for these pmaps as well.
Revision 1.261: download - view: text, markup, annotated - select for diffs
Sun Mar 22 02:33:48 2009 UTC (2 years, 10 months ago) by alc
Branches: MAIN
Diff to: previous 1.260: preferred, colored
Changes since revision 1.260: +1 -1 lines
SVN rev 190237 on 2009-03-22 02:33:48Z by alc Eliminate the recomputation of pcb_cr3 from cpu_set_upcall(). The bcopy()ed value from the old thread is the correct value because the new thread and the old thread will share a page table.
Revision 1.260: download - view: text, markup, annotated - select for diffs
Mon Mar 2 18:43:50 2009 UTC (2 years, 11 months ago) by kib
Branches: MAIN
Diff to: previous 1.259: preferred, colored
Changes since revision 1.259: +3 -8 lines
SVN rev 189282 on 2009-03-02 18:43:50Z by kib Use the p_sysent->sv_flags flag SV_ILP32 to detect 32bit process executing on 64bit kernel. This eliminates the direct comparisions of p_sysent with &ia32_freebsd_sysvec, that were left intact after r185169.
Revision 1.255.2.2.2.1: download - view: text, markup, annotated - select for diffs
Tue Nov 25 02:59:29 2008 UTC (3 years, 2 months ago) by kensmith
Branches: RELENG_7_1
CVS tags: RELENG_7_1_0_RELEASE
Diff to: previous 1.255.2.2: preferred, colored; next MAIN 1.255.2.3: preferred, colored
Changes since revision 1.255.2.2: +0 -0 lines
SVN rev 185281 on 2008-11-25 02:59:29Z by kensmith Create releng/7.1 in preparation for moving into RC phase of 7.1 release cycle. Approved by: re (implicit)
Revision 1.259: download - view: text, markup, annotated - select for diffs
Sun Oct 5 02:03:54 2008 UTC (3 years, 4 months ago) by davidxu
Branches: MAIN
Diff to: previous 1.258: preferred, colored
Changes since revision 1.258: +8 -0 lines
SVN rev 183615 on 2008-10-05 02:03:54Z by davidxu If the current thread has the trap bit set (i.e. a debugger had single stepped the process to the system call), we need to clear the trap flag from the new frame. Otherwise, the new thread will receive a (likely unexpected) SIGTRAP when it executes the first instruction after returning to userland.
Revision 1.248.2.4.2.1: download - view: text, markup, annotated - select for diffs
Thu Oct 2 02:57:24 2008 UTC (3 years, 4 months ago) by kensmith
Branches: RELENG_6_4
CVS tags: RELENG_6_4_0_RELEASE
Diff to: previous 1.248.2.4: preferred, colored; next MAIN 1.249: preferred, colored
Changes since revision 1.248.2.4: +0 -0 lines
SVN rev 183531 on 2008-10-02 02:57:24Z by kensmith Create releng/6.4 from stable/6 in preparation for 6.4-RC1. Approved by: re (implicit)
Revision 1.248.2.4: download - view: text, markup, annotated - select for diffs
Thu Sep 18 20:20:28 2008 UTC (3 years, 4 months ago) by jhb
Branches: RELENG_6
CVS tags: RELENG_6_4_BP
Branch point for: RELENG_6_4
Diff to: previous 1.248.2.3: preferred, colored; branchpoint 1.248: preferred, colored; next MAIN 1.249: preferred, colored
Changes since revision 1.248.2.3: +7 -4 lines
SVN rev 183158 on 2008-09-18 20:20:28Z by jhb MFC: Update comments about the 0xcf9 register reset method. Approved by: re (kensmith, kib)
Revision 1.255.2.2: download - view: text, markup, annotated - select for diffs
Thu Sep 18 20:20:00 2008 UTC (3 years, 4 months ago) by jhb
Branches: RELENG_7
CVS tags: RELENG_7_2_BP, RELENG_7_1_BP
Branch point for: RELENG_7_2, RELENG_7_1
Diff to: previous 1.255.2.1: preferred, colored; branchpoint 1.255: preferred, colored
Changes since revision 1.255.2.1: +7 -4 lines
SVN rev 183157 on 2008-09-18 20:20:00Z by jhb MFC: Update comments about the 0xcf9 register reset method. Approved by: re (kensmith, kib)
Revision 1.258: download - view: text, markup, annotated - select for diffs
Thu Sep 11 18:33:57 2008 UTC (3 years, 4 months ago) by jhb
Branches: MAIN
Diff to: previous 1.257: preferred, colored
Changes since revision 1.257: +7 -4 lines
SVN rev 182936 on 2008-09-11 18:33:57Z by jhb Update the comments above the 0xcf9 register reset attempt to match the code. We only attempt a single reset using this method (a "hard" reset), and we use two writes to ensure there is a 0 -> 1 transition in bit 2 to force a reset. MFC after: 1 week
Revision 1.255.2.1: download - view: text, markup, annotated - select for diffs
Thu Apr 24 22:41:59 2008 UTC (3 years, 9 months ago) by marcel
Branches: RELENG_7
Diff to: previous 1.255: preferred, colored
Changes since revision 1.255: +6 -1 lines
MFC fix for PR ia64/118024 o Rename cpu_thread_setup() to cpu_thread_alloc() to better 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(). files: sys/amd64/amd64/vm_machdep.c:1.256 sys/arm/arm/vm_machdep.c:1.35 sys/i386/i386/vm_machdep.c1.284 sys/ia64/ia64/machdep.c:1.227 sys/ia64/ia64/vm_machdep.c:1.95 sys/kern/kern_thread.c:1.260 sys/powerpc/powerpc/vm_machdep.c:1.117 sys/sparc64/sparc64/vm_machdep.c:1.77 sys/sun4v/sun4v/vm_machdep.c:1.8 sys/sys/proc.h:1.495
Revision 1.257: download - view: text, markup, annotated - select for diffs
Wed Mar 12 10:11:54 2008 UTC (3 years, 11 months ago) by jeff
Branches: MAIN
Diff to: previous 1.256: preferred, colored
Changes since revision 1.256: +0 -11 lines
Remove kernel support for M:N threading. While the KSE project was quite successful in bringing threading to FreeBSD, the M:N approach taken by the kse library was never developed to its full potential. Backwards compatibility will be provided via libmap.conf for dynamically linked binaries and static binaries will be broken.
Revision 1.256: download - view: text, markup, annotated - select for diffs
Wed Nov 14 20:21:52 2007 UTC (4 years, 2 months ago) by marcel
Branches: MAIN
Diff to: previous 1.255: preferred, colored
Changes since revision 1.255: +6 -1 lines
o Rename cpu_thread_setup() to cpu_thread_alloc() to better 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
Revision 1.248.2.3: download - view: text, markup, annotated - select for diffs
Mon Jun 18 22:44:57 2007 UTC (4 years, 7 months ago) by jhb
Branches: RELENG_6
CVS tags: RELENG_6_3_BP, RELENG_6_3_0_RELEASE, RELENG_6_3
Diff to: previous 1.248.2.2: preferred, colored; branchpoint 1.248: preferred, colored
Changes since revision 1.248.2.2: +43 -1 lines
MFC: Support for running 32-bit multithreaded binaries using libthr on amd64 including: - Add 32-bit wrappers for thr_new(), thr_suspend(), and the umtx system calls. - Add support to amd64 for constructing thread upcalls for 32-bit processes. - Leave %fs and %gs alone in the signal trampoline for 32-bit processes on amd64. - Add 'casuword32()' to amd64 and ia64. Tested by: emaste
Revision 1.255: download - view: text, markup, annotated - select for diffs
Mon Jun 4 23:57:29 2007 UTC (4 years, 8 months ago) by jeff
Branches: MAIN
CVS tags: RELENG_7_BP, RELENG_7_0_BP, RELENG_7_0_0_RELEASE, RELENG_7_0
Branch point for: RELENG_7
Diff to: previous 1.254: preferred, colored
Changes since revision 1.254: +2 -2 lines
- Change comments and asserts to reflect the removal of the global 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)
Revision 1.248.2.2: download - view: text, markup, annotated - select for diffs
Mon Apr 30 17:45:44 2007 UTC (4 years, 9 months ago) by jhb
Branches: RELENG_6
Diff to: previous 1.248.2.1: preferred, colored; branchpoint 1.248: preferred, colored
Changes since revision 1.248.2.1: +38 -4 lines
MFC: Various fixes to cpu_reset_real() - Try to use the reset control register (I/O port 0xcf9) and the fast a20 and init register (I/O port 0x92) if the keyboard reset fails. - Fix the triple fault to actually work when PGE is enabled.
Revision 1.254: download - view: text, markup, annotated - select for diffs
Tue Apr 24 21:17:45 2007 UTC (4 years, 9 months ago) by jhb
Branches: MAIN
Diff to: previous 1.253: preferred, colored
Changes since revision 1.253: +8 -3 lines
Fix the triple fault used as a last resort during a reboot to actually fault. The previous method zero'd out the page tables, invalidated the TLB, and then entered a spin loop. The idea was that the instruction after the TLB invalidate would result in a page fault and the page fault and subsequent double fault wouldn't be able to determine the physical page for their fault handlers' first instruction. This stopped working when PGE (PG_G PTE/PDE bit) support was added as a TLB invalidate via %cr3 reload doesn't clear TLB entries with PG_G set. Thus, the CPU was still able to map the virtual address for the spin loop and happily performed its infinite loop. The triple fault now uses a much more deterministic sledge-hammer approach to generate a triple fault. First, the IDT descriptor is set to point to an empty IDT, so any interrupts (including a double fault) will instantly fault. Second, we trigger a int 3 breakpoint to force an interrupt and kick off a triple fault. MFC after: 3 days
Revision 1.253: download - view: text, markup, annotated - select for diffs
Tue Apr 24 20:06:36 2007 UTC (4 years, 9 months ago) by jhb
Branches: MAIN
Diff to: previous 1.252: preferred, colored
Changes since revision 1.252: +30 -1 lines
MFi386: Attempt to reset the machine using the Reset Control register and Fast A20 and Init register if the keyboard reset doesn't work before resorting to a triple fault.
Revision 1.252: download - view: text, markup, annotated - select for diffs
Sun Sep 17 14:54:14 2006 UTC (5 years, 4 months ago) by davidxu
Branches: MAIN
Diff to: previous 1.251: preferred, colored
Changes since revision 1.251: +43 -0 lines
Make cpu_set_upcall_kse() and cpu_set_user_tls() work for 32bit process.
Revision 1.251: download - view: text, markup, annotated - select for diffs
Mon Jul 24 12:24:56 2006 UTC (5 years, 6 months ago) by davidxu
Branches: MAIN
Diff to: previous 1.250: preferred, colored
Changes since revision 1.250: +0 -1 lines
Remove a duplicated line.
Revision 1.248.2.1: download - view: text, markup, annotated - select for diffs
Tue Nov 15 00:25:59 2005 UTC (6 years, 2 months ago) by peter
Branches: RELENG_6
CVS tags: RELENG_6_2_BP, RELENG_6_2_0_RELEASE, RELENG_6_2, RELENG_6_1_BP, RELENG_6_1_0_RELEASE, RELENG_6_1
Diff to: previous 1.248: preferred, colored
Changes since revision 1.248: +0 -3 lines
MFC: eliminate pcb_rflags, replacing it with padding. It just wastes cpu cycles.
Revision 1.250: download - view: text, markup, annotated - select for diffs
Mon Oct 24 20:53:51 2005 UTC (6 years, 3 months ago) by jhb
Branches: MAIN
Diff to: previous 1.249: preferred, colored
Changes since revision 1.249: +3 -1 lines
When restarting the BSP during cpu_reset() use a membar to ensure that the updated cpustop_restartfunc is seen when the BSP resumes execution. This matches the membar already present in restart_cpus().
Revision 1.249: download - view: text, markup, annotated - select for diffs
Tue Sep 27 21:10:10 2005 UTC (6 years, 4 months ago) by peter
Branches: MAIN
Diff to: previous 1.248: preferred, colored
Changes since revision 1.248: +0 -3 lines
Kill pcb_rflags. It served no purpose. Reported by: bde
Revision 1.248: download - view: text, markup, annotated - select for diffs
Sun Jul 10 23:31:10 2005 UTC (6 years, 7 months ago) by davidxu
Branches: MAIN
CVS tags: RELENG_6_BP, RELENG_6_0_BP, RELENG_6_0_0_RELEASE, RELENG_6_0
Branch point for: RELENG_6
Diff to: previous 1.247: preferred, colored
Changes since revision 1.247: +5 -1 lines
Validate if the value written into {FS,GS}.base is a canonical
address, writting non-canonical address can cause kernel a panic,
by restricting base values to 0..VM_MAXUSER_ADDRESS, ensuring
only canonical values get written to the registers.
Reviewed by: peter, Josepha Koshy < joseph.koshy at gmail dot com >
Approved by: re (scottl)
Revision 1.247: download - view: text, markup, annotated - select for diffs
Fri Jun 24 00:29:53 2005 UTC (6 years, 7 months ago) by peter
Branches: MAIN
Diff to: previous 1.246: preferred, colored
Changes since revision 1.246: +4 -4 lines
MFi386: 1.258: Minor cleanups Approved by: re (blanket i386<->amd64 sync)
Revision 1.246: download - view: text, markup, annotated - select for diffs
Sat Apr 23 02:32:30 2005 UTC (6 years, 9 months ago) by davidxu
Branches: MAIN
Diff to: previous 1.245: preferred, colored
Changes since revision 1.245: +20 -5 lines
Change cpu_set_kse_upcall to more generic style, so we can reuse it in other codes. Add cpu_set_user_tls, use it to tweak user register and setup user TLS. I ever wanted to merge it into cpu_set_kse_upcall, but since cpu_set_kse_upcall is also used by M:N threads which may not need this feature, so I wrote a separated cpu_set_user_tls.
Revision 1.245: download - view: text, markup, annotated - select for diffs
Mon Apr 4 21:53:52 2005 UTC (6 years, 10 months ago) by jhb
Branches: MAIN
Diff to: previous 1.244: preferred, colored
Changes since revision 1.244: +8 -0 lines
Divorce critical sections from spinlocks. Critical sections as denoted by critical_enter() and critical_exit() are now solely a mechanism for deferring kernel preemptions. They no longer have any affect on interrupts. This means that standalone critical sections are now very cheap as they are simply unlocked integer increments and decrements for the common case. Spin mutexes now use a separate KPI implemented in MD code: spinlock_enter() and spinlock_exit(). This KPI is responsible for providing whatever MD guarantees are needed to ensure that a thread holding a spin lock won't be preempted by any other code that will try to lock the same lock. For now all archs continue to block interrupts in a "spinlock section" as they did formerly in all critical sections. Note that I've also taken this opportunity to push a few things into MD code rather than MI. For example, critical_fork_exit() no longer exists. Instead, MD code ensures that new threads have the correct state when they are created. Also, we no longer try to fixup the idlethreads for APs in MI code. Instead, each arch sets the initial curthread and adjusts the state of the idle thread it borrows in order to perform the initial context switch. This change is largely a big NOP, but the cleaner separation it provides will allow for more efficient alternative locking schemes in other parts of the kernel (bare critical sections rather than per-CPU spin mutexes for per-CPU data for example). Reviewed by: grehan, cognet, arch@, others Tested on: i386, alpha, sparc64, powerpc, arm, possibly more
Revision 1.237.2.2: download - view: text, markup, annotated - select for diffs
Mon Feb 28 07:54:17 2005 UTC (6 years, 11 months ago) by obrien
Branches: RELENG_5
CVS tags: RELENG_5_5_BP, RELENG_5_5_0_RELEASE, RELENG_5_5, RELENG_5_4_BP, RELENG_5_4_0_RELEASE, RELENG_5_4
Diff to: previous 1.237.2.1: preferred, colored; branchpoint 1.237: preferred, colored; next MAIN 1.238: preferred, colored
Changes since revision 1.237.2.1: +26 -37 lines
MFC
rev 1.244: handle PSL_T properly across fork. Typo fix.
rev 1.243: remove redundant code to drop per-thread debug register state from
cpu_exit().
rev 1.242: restore cpu_reset proxy code to enable reset from ddb on an AP.
rev 1.241: reduce diffs to i386.
rev 1.240: remove unused cnt variable for the SMP case & trim some blank lines.
rev 1.239: take advantage of the shutdown processing being wired to the BSP
and eliminate the evil cpu_reset_proxy code now that it will never
be activated.
Revision 1.237.2.1: download - view: text, markup, annotated - select for diffs
Sat Feb 5 01:02:48 2005 UTC (7 years ago) by das
Branches: RELENG_5
Diff to: previous 1.237: preferred, colored
Changes since revision 1.237: +0 -1 lines
MFC: 2004-11-27 06:51:39 UTC Don't include sys/user.h merely for its side-effect of recursively including other headers.
Revision 1.244: download - view: text, markup, annotated - select for diffs
Fri Jan 21 05:57:45 2005 UTC (7 years ago) by peter
Branches: MAIN
Diff to: previous 1.243: preferred, colored
Changes since revision 1.243: +13 -1 lines
MFi386: handle PSL_T properly across fork. Typo fix.
Revision 1.243: download - view: text, markup, annotated - select for diffs
Fri Jan 14 20:16:41 2005 UTC (7 years ago) by jhb
Branches: MAIN
Diff to: previous 1.242: preferred, colored
Changes since revision 1.242: +0 -7 lines
Remove redundant code to drop per-thread debug register state from cpu_exit() as this is already performed in cpu_thread_exit() and the debug state is per-thread rather than per-process.
Revision 1.242: download - view: text, markup, annotated - select for diffs
Mon Dec 27 06:42:25 2004 UTC (7 years, 1 month ago) by njl
Branches: MAIN
Diff to: previous 1.241: preferred, colored
Changes since revision 1.241: +39 -4 lines
MFi386: Restore cpu_reset proxy code to enable reset from ddb on an AP.
Revision 1.241: download - view: text, markup, annotated - select for diffs
Mon Dec 27 06:35:42 2004 UTC (7 years, 1 month ago) by njl
Branches: MAIN
Diff to: previous 1.240: preferred, colored
Changes since revision 1.240: +10 -15 lines
Reduce diffs to i386.
Revision 1.240: download - view: text, markup, annotated - select for diffs
Tue Nov 30 20:25:46 2004 UTC (7 years, 2 months ago) by peter
Branches: MAIN
Diff to: previous 1.239: preferred, colored
Changes since revision 1.239: +1 -5 lines
Remove unused cnt variable for the SMP case. Trim some excessive blank lines while here.
Revision 1.239: download - view: text, markup, annotated - select for diffs
Mon Nov 29 23:25:56 2004 UTC (7 years, 2 months ago) by peter
Branches: MAIN
Diff to: previous 1.238: preferred, colored
Changes since revision 1.238: +3 -45 lines
Take advantage of the shutdown processing being wired to the BSP and eliminate the evil cpu_reset_proxy code now that it will never be activated. i386 should pick this up as well.
Revision 1.238: download - view: text, markup, annotated - select for diffs
Sat Nov 27 06:51:34 2004 UTC (7 years, 2 months ago) by das
Branches: MAIN
Diff to: previous 1.237: preferred, colored
Changes since revision 1.237: +0 -1 lines
Don't include sys/user.h merely for its side-effect of recursively including other headers.
Revision 1.237: download - view: text, markup, annotated - select for diffs
Mon Aug 16 22:57:13 2004 UTC (7 years, 5 months ago) by peter
Branches: MAIN
CVS tags: RELENG_5_BP, RELENG_5_3_BP, RELENG_5_3_0_RELEASE, RELENG_5_3
Branch point for: RELENG_5
Diff to: previous 1.236: preferred, colored
Changes since revision 1.236: +1 -0 lines
Sync with i386 - set rbp reg to 0 for upcalls as a frame marker, not that it is guaranteed to be used in userland though.
Revision 1.236: download - view: text, markup, annotated - select for diffs
Wed Aug 11 23:23:05 2004 UTC (7 years, 6 months ago) by davidxu
Branches: MAIN
Diff to: previous 1.235: preferred, colored
Changes since revision 1.235: +1 -0 lines
Mark end of frames.
Revision 1.235: download - view: text, markup, annotated - select for diffs
Wed May 26 12:09:36 2004 UTC (7 years, 8 months ago) by tmm
Branches: MAIN
Diff to: previous 1.234: preferred, colored
Changes since revision 1.234: +0 -6 lines
Retire cpu_sched_exit(); it is not used any more.
Revision 1.234: download - view: text, markup, annotated - select for diffs
Sun Apr 18 05:36:37 2004 UTC (7 years, 9 months ago) by alc
Branches: MAIN
Diff to: previous 1.233: preferred, colored
Changes since revision 1.233: +6 -64 lines
Simplify the sf_buf implementation. In short, make it a trivial veneer over the direct virtual-to-physical mapping.
Revision 1.233: download - view: text, markup, annotated - select for diffs
Sun Apr 11 04:26:58 2004 UTC (7 years, 10 months ago) by alc
Branches: MAIN
Diff to: previous 1.232: preferred, colored
Changes since revision 1.232: +1 -2 lines
- is_physical_memory()'s parameter, which is a physical address, should be a vm_paddr_t not a vm_offset_t.
Revision 1.232: download - view: text, markup, annotated - select for diffs
Sat Apr 3 09:16:25 2004 UTC (7 years, 10 months ago) by alc
Branches: MAIN
Diff to: previous 1.231: preferred, colored
Changes since revision 1.231: +2 -2 lines
In some cases, sf_buf_alloc() should sleep with pri PCATCH; in others, it should not. Add a new parameter so that the caller can specify which is the case. Reported by: dillon
Revision 1.231: download - view: text, markup, annotated - select for diffs
Mon Mar 29 19:38:05 2004 UTC (7 years, 10 months ago) by peter
Branches: MAIN
Diff to: previous 1.230: preferred, colored
Changes since revision 1.230: +0 -1 lines
Finish tidying up a couple of leftovers from the KSTACK_PAGES stuff. Some files still #included the opt_ file. powerpc hadn't been updated yet.
Revision 1.230: download - view: text, markup, annotated - select for diffs
Thu Mar 25 03:39:38 2004 UTC (7 years, 10 months ago) by peter
Branches: MAIN
Diff to: previous 1.229: preferred, colored
Changes since revision 1.229: +4 -3 lines
MFi386: correctly calculate the top-of-stack when a kthread is created with a larger kernel stack.
Revision 1.229: download - view: text, markup, annotated - select for diffs
Tue Mar 16 19:04:27 2004 UTC (7 years, 10 months ago) by alc
Branches: MAIN
Diff to: previous 1.228: preferred, colored
Changes since revision 1.228: +2 -17 lines
Refactor the existing machine-dependent sf_buf_free() into a machine- dependent function by the same name and a machine-independent function, sf_buf_mext(). Aside from the virtue of making more of the code machine- independent, this change also makes the interface more logical. Before, sf_buf_free() did more than simply undo an sf_buf_alloc(); it also unwired and if necessary freed the page. That is now the purpose of sf_buf_mext(). Thus, sf_buf_alloc() and sf_buf_free() can now be used as a general-purpose emphemeral map cache.
Revision 1.228: download - view: text, markup, annotated - select for diffs
Wed Jan 28 23:58:55 2004 UTC (8 years ago) by peter
Branches: MAIN
Diff to: previous 1.227: preferred, colored
Changes since revision 1.227: +25 -17 lines
deal with dbregs for fork etc update for fpu.c simplification Merge #include sort from i386
Revision 1.227: download - view: text, markup, annotated - select for diffs
Sun Dec 28 08:57:08 2003 UTC (8 years, 1 month ago) by silby
Branches: MAIN
Diff to: previous 1.226: preferred, colored
Changes since revision 1.226: +1 -0 lines
Track three new sendfile-related statistics: - The number of times sendfile had to do disk I/O - The number of times sfbuf allocation failed - The number of times sfbuf allocation had to wait
Revision 1.226: download - view: text, markup, annotated - select for diffs
Sun Dec 28 01:43:21 2003 UTC (8 years, 1 month ago) by silby
Branches: MAIN
Diff to: previous 1.225: preferred, colored
Changes since revision 1.225: +1 -2 lines
Move the declaration of sfbufspeak and sfbufsused to mbuf.h, and use imax instead of max, as sfbufspeak and sfbufsused are signed. Submitted by: bde
Revision 1.225: download - view: text, markup, annotated - select for diffs
Sat Dec 27 07:52:46 2003 UTC (8 years, 1 month ago) by silby
Branches: MAIN
Diff to: previous 1.224: preferred, colored
Changes since revision 1.224: +4 -0 lines
Track current and peak sfbuf usage, export the values via sysctl.
Revision 1.224: download - view: text, markup, annotated - select for diffs
Fri Nov 21 03:02:00 2003 UTC (8 years, 2 months ago) by peter
Branches: MAIN
CVS tags: RELENG_5_2_BP, RELENG_5_2_1_RELEASE, RELENG_5_2_0_RELEASE, RELENG_5_2
Diff to: previous 1.223: preferred, colored
Changes since revision 1.223: +1 -1 lines
Cosmetic and/or trivial sync up with i386. Approved by: re (rwatson)
Revision 1.223: download - view: text, markup, annotated - select for diffs
Mon Nov 17 08:58:13 2003 UTC (8 years, 2 months ago) by peter
Branches: MAIN
Diff to: previous 1.222: preferred, colored
Changes since revision 1.222: +65 -0 lines
Initial landing of SMP support for FreeBSD/amd64. - This is heavily derived from John Baldwin's apic/pci cleanup on i386. - I have completely rewritten or drastically cleaned up some other parts. (in particular, bootstrap) - This is still a WIP. It seems that there are some highly bogus bioses on nVidia nForce3-150 boards. I can't stress how broken these boards are. I have a workaround in mind, but right now the Asus SK8N is broken. The Gigabyte K8NPro (nVidia based) is also mind-numbingly hosed. - Most of my testing has been with SCHED_ULE. SCHED_4BSD works. - the apic and acpi components are 'standard'. - If you have an nVidia nForce3-150 board, you are stuck with 'device atpic' in addition, because they somehow managed to forget to connect the 8254 timer to the apic, even though its in the same silicon! ARGH! This directly violates the ACPI spec.
Revision 1.222: download - view: text, markup, annotated - select for diffs
Sun Nov 16 23:40:06 2003 UTC (8 years, 2 months ago) by alc
Branches: MAIN
Diff to: previous 1.221: preferred, colored
Changes since revision 1.221: +0 -2 lines
- Remove unnecessary synchronization from sf_buf_init(). (There is only one active CPU when sf_buf_init() is performed.)
Revision 1.221: download - view: text, markup, annotated - select for diffs
Sun Nov 16 06:11:25 2003 UTC (8 years, 2 months ago) by alc
Branches: MAIN
Diff to: previous 1.220: preferred, colored
Changes since revision 1.220: +1 -2 lines
- Modify alpha's sf_buf implementation to use the direct virtual-to- physical mapping. - Move the sf_buf API to its own header file; make struct sf_buf's definition machine dependent. In this commit, we remove an unnecessary field from struct sf_buf on the alpha, amd64, and ia64. Ultimately, we may eliminate struct sf_buf on those architecures except as an opaque pointer that references a vm page.
Revision 1.220: download - view: text, markup, annotated - select for diffs
Sat Nov 8 03:33:37 2003 UTC (8 years, 3 months ago) by peter
Branches: MAIN
Diff to: previous 1.219: preferred, colored
Changes since revision 1.219: +3 -3 lines
The great s/npx/fpu/gi
Revision 1.219: download - view: text, markup, annotated - select for diffs
Sat Nov 8 02:39:45 2003 UTC (8 years, 3 months ago) by peter
Branches: MAIN
Diff to: previous 1.218: preferred, colored
Changes since revision 1.218: +1 -1 lines
Rename npx* to fpu*. I haven't done the flags/function names yet.
Revision 1.218: download - view: text, markup, annotated - select for diffs
Thu Oct 30 19:04:58 2003 UTC (8 years, 3 months ago) by peter
Branches: MAIN
Diff to: previous 1.217: preferred, colored
Changes since revision 1.217: +3 -1 lines
MFi386: thread specific fpu state optimizations
Revision 1.217: download - view: text, markup, annotated - select for diffs
Fri Aug 29 20:04:09 2003 UTC (8 years, 5 months ago) by alc
Branches: MAIN
Diff to: previous 1.216: preferred, colored
Changes since revision 1.216: +95 -0 lines
Migrate the sf_buf allocator that is used by sendfile(2) and zero-copy sockets into machine-dependent files. The rationale for this migration is illustrated by the modified amd64 allocator. It uses the amd64's direct map to avoid emphemeral mappings in the kernel's address space. On an SMP, the emphemeral mappings result in an IPI for TLB shootdown for each transmitted page. Yuck. Maintainers of other 64-bit platforms with direct maps should be able to use the amd64 allocator as a reference implementation.
Revision 1.216: download - view: text, markup, annotated - select for diffs
Sat Aug 16 23:15:14 2003 UTC (8 years, 5 months ago) by marcel
Branches: MAIN
Diff to: previous 1.215: preferred, colored
Changes since revision 1.215: +10 -0 lines
In vm_thread_swap{in|out}(), remove the alpha specific conditional
compilation and replace it with a call to cpu_thread_swap{in|out}().
This allows us to add similar code on ia64 without cluttering the
code even more.
Revision 1.215: download - view: text, markup, annotated - select for diffs
Tue Jul 29 12:44:16 2003 UTC (8 years, 6 months ago) by davidxu
Branches: MAIN
Diff to: previous 1.214: preferred, colored
Changes since revision 1.214: +1 -1 lines
Use PSL_KERNEL as upcall thread's initial rflags, don't use scratch user rflags.
Revision 1.214: download - view: text, markup, annotated - select for diffs
Fri Jul 25 21:15:45 2003 UTC (8 years, 6 months ago) by obrien
Branches: MAIN
Diff to: previous 1.213: preferred, colored
Changes since revision 1.213: +4 -2 lines
Use __FBSDID(). Brought to you by: a boring talk at Ottawa Linux Symposium
Revision 1.213: download - view: text, markup, annotated - select for diffs
Fri Jul 25 00:21:37 2003 UTC (8 years, 6 months ago) by davidxu
Branches: MAIN
Diff to: previous 1.212: preferred, colored
Changes since revision 1.212: +1 -0 lines
Align upcall stack top to odd times of 8. GCC accounts return address in callee function for stack alignment.
Revision 1.212: download - view: text, markup, annotated - select for diffs
Thu Jul 24 08:52:44 2003 UTC (8 years, 6 months ago) by davidxu
Branches: MAIN
Diff to: previous 1.211: preferred, colored
Changes since revision 1.211: +68 -0 lines
Implement cpu_set_upcall and cpu_set_upcall_kse. Reviewed by: peter
Revision 1.211: download - view: text, markup, annotated - select for diffs
Wed Jun 11 05:20:32 2003 UTC (8 years, 8 months ago) by peter
Branches: MAIN
Diff to: previous 1.210: preferred, colored
Changes since revision 1.210: +0 -5 lines
GC unused cpu_wait() function
Revision 1.210: download - view: text, markup, annotated - select for diffs
Wed Jun 4 22:46:27 2003 UTC (8 years, 8 months ago) by marcel
Branches: MAIN
Diff to: previous 1.209: preferred, colored
Changes since revision 1.209: +1 -1 lines
Change the second (and last) argument of cpu_set_upcall(). Previously we were passing in a void* representing the PCB of the parent thread. Now we pass a pointer to the parent thread itself. The prime reason for this change is to allow cpu_set_upcall() to copy (parts of) the trapframe instead of having it done in MI code in each caller of cpu_set_upcall(). Copying the trapframe cannot always be done with a simply bcopy() or may not always be optimal that way. On ia64 specifically the trapframe contains information that is specific to an entry into the kernel and can only be used by the corresponding exit from the kernel. A trapframe copied verbatim from another frame is in most cases useless without some additional normalization. Note that this change removes the assignment to td->td_frame in some implementations of cpu_set_upcall(). The assignment is redundant. A previous call to cpu_thread_setup() already did the exact same assignment. An added benefit of removing the redundant assignment is that we can now change td_pcb without nasty side-effects. This change officially marks the ability on ia64 for 1:1 threading. Not tested on: amd64, powerpc Compile & boot tested on: alpha, sparc64 Functionally tested on: i386, ia64
Revision 1.209: download - view: text, markup, annotated - select for diffs
Fri May 23 05:04:54 2003 UTC (8 years, 8 months ago) by peter
Branches: MAIN
CVS tags: RELENG_5_1_BP, RELENG_5_1_0_RELEASE, RELENG_5_1
Diff to: previous 1.208: preferred, colored
Changes since revision 1.208: +1 -1 lines
Major pmap rework to take advantage of the larger address space on amd64 systems. Of note: - Implement a direct mapped region using 2MB pages. This eliminates the need for temporary mappings when getting ptes. This supports up to 512GB of physical memory for now. This should be enough for a while. - Implement a 4-tier page table system. Most of the infrastructure is there for 128TB of userland virtual address space, but only 512GB is presently enabled due to a mystery bug somewhere. The design of this was heavily inspired by the alpha pmap.c. - The kernel is moved into the negative address space(!). - The kernel has 2GB of KVM available. - Provide a uma memory allocator to use the direct map region to take advantage of the 2MB TLBs. - Fixed some assumptions in the bus_space macros about the ability to fit virtual addresses in an 'int'. Notable missing things: - pmap_growkernel() should be able to grow to 512GB of KVM by expanding downwards below kernbase. The kernel must be at the top 2GB of the negative address space because of gcc code generation strategies. - need to fix the >512GB user vm code. Approved by: re (blanket)
Revision 1.208: download - view: text, markup, annotated - select for diffs
Wed May 14 04:10:48 2003 UTC (8 years, 9 months ago) by peter
Branches: MAIN
Diff to: previous 1.207: preferred, colored
Changes since revision 1.207: +1 -1 lines
Add BASIC i386 binary support for the amd64 kernel. This is largely stolen from the ia64/ia32 code (indeed there was a repocopy), but I've redone the MD parts and added and fixed a few essential syscalls. It is sufficient to run i386 binaries like /bin/ls, /usr/bin/id (dynamic) and p4. The ia64 code has not implemented signal delivery, so I had to do that. Before you say it, yes, this does need to go in a common place. But we're in a freeze at the moment and I didn't want to risk breaking ia64. I will sort this out after the freeze so that the common code is in a common place. On the AMD64 side, this required adding segment selector context switch support and some other support infrastructure. The %fs/%gs etc code is hairy because loading %gs will clobber the kernel's current MSR_GSBASE setting. The segment selectors are not used by the kernel, so they're only changed at context switch time or when changing modes. This still needs to be optimized. Approved by: re (amd64/* blanket)
Revision 1.207: download - view: text, markup, annotated - select for diffs
Thu May 1 01:05:22 2003 UTC (8 years, 9 months ago) by peter
Branches: MAIN
Diff to: previous 1.206: preferred, colored
Changes since revision 1.206: +18 -282 lines
Commit MD parts of a loosely functional AMD64 port. This is based on a heavily stripped down FreeBSD/i386 (brutally stripped down actually) to attempt to get a stable base to start from. There is a lot missing still. Worth noting: - The kernel runs at 1GB in order to cheat with the pmap code. pmap uses a variation of the PAE code in order to avoid having to worry about 4 levels of page tables yet. - It boots in 64 bit "long mode" with a tiny trampoline embedded in the i386 loader. This simplifies locore.s greatly. - There are still quite a few fragments of i386-specific code that have not been translated yet, and some that I cheated and wrote dumb C versions of (bcopy etc). - It has both int 0x80 for syscalls (but using registers for argument passing, as is native on the amd64 ABI), and the 'syscall' instruction for syscalls. int 0x80 preserves all registers, 'syscall' does not. - I have tried to minimize looking at the NetBSD code, except in a couple of places (eg: to find which register they use to replace the trashed %rcx register in the syscall instruction). As a result, there is not a lot of similarity. I did look at NetBSD a few times while debugging to get some ideas about what I might have done wrong in my first attempt.
Revision 1.206: download - view: text, markup, annotated - select for diffs
Mon Apr 21 15:05:05 2003 UTC (8 years, 9 months ago) by davidxu
Branches: MAIN
Diff to: previous 1.205: preferred, colored
Changes since revision 1.205: +5 -1 lines
Reset pcb_gs and %gs before possibly invalidating it.
Revision 1.205: download - view: text, markup, annotated - select for diffs
Fri Apr 11 14:47:34 2003 UTC (8 years, 10 months ago) by davidxu
Branches: MAIN
Diff to: previous 1.204: preferred, colored
Changes since revision 1.204: +2 -0 lines
Copy %gs from current CPU not from a stale PCB backup.
Revision 1.204: download - view: text, markup, annotated - select for diffs
Sun Mar 30 05:24:52 2003 UTC (8 years, 10 months ago) by jake
Branches: MAIN
Diff to: previous 1.203: preferred, colored
Changes since revision 1.203: +8 -0 lines
- Add support for PAE and more than 4 gigs of ram on x86, dependent on the kernel opition 'options PAE'. This will only work with device drivers which either use busdma, or are able to handle 64 bit physical addresses. Thanks to Lanny Baron from FreeBSD Systems for the loan of a test machine with 6 gigs of ram. Sponsored by: DARPA, Network Associates Laboratories, FreeBSD Systems
Revision 1.203: download - view: text, markup, annotated - select for diffs
Tue Mar 25 00:07:02 2003 UTC (8 years, 10 months ago) by jake
Branches: MAIN
Diff to: previous 1.202: preferred, colored
Changes since revision 1.202: +5 -5 lines
- Add vm_paddr_t, a physical address type. This is required for systems where physical addresses larger than virtual addresses, such as i386s with PAE. - Use this to represent physical addresses in the MI vm system and in the i386 pmap code. This also changes the paddr parameter to d_mmap_t. - Fix printf formats to handle physical addresses >4G in the i386 memory detection code, and due to kvtop returning vm_paddr_t instead of u_long. Note that this is a name change only; vm_paddr_t is still the same as vm_offset_t on all currently supported platforms. Sponsored by: DARPA, Network Associates Laboratories Discussed with: re, phk (cdevsw change)
Revision 1.202: download - view: text, markup, annotated - select for diffs
Sun Feb 23 21:19:59 2003 UTC (8 years, 11 months ago) by jake
Branches: MAIN
Diff to: previous 1.201: preferred, colored
Changes since revision 1.201: +1 -1 lines
- Added macros NPGPTD, NBPTD, and NPDEPTD, for dealing with the size of the page directory. - Use these instead of the magic constants 1 or PAGE_SIZE where appropriate. There are still numerous assumptions that the page directory is exactly 1 page. Sponsored by: DARPA, Network Associates Laboratories
Revision 1.201: download - view: text, markup, annotated - select for diffs
Mon Feb 17 05:14:25 2003 UTC (8 years, 11 months ago) by jeff
Branches: MAIN
Diff to: previous 1.200: preferred, colored
Changes since revision 1.200: +4 -6 lines
- Split the struct kse into struct upcall and struct kse. struct kse will soon be visible only to schedulers. This greatly simplifies much the KSE code. Submitted by: davidxu
Revision 1.200: download - view: text, markup, annotated - select for diffs
Sat Feb 1 12:17:06 2003 UTC (9 years ago) by julian
Branches: MAIN
Diff to: previous 1.199: preferred, colored
Changes since revision 1.199: +6 -4 lines
Reversion of commit by Davidxu plus fixes since applied. I'm not convinced there is anything major wrong with the patch but them's the rules.. I am using my "David's mentor" hat to revert this as he's offline for a while.
Revision 1.199: download - view: text, markup, annotated - select for diffs
Sun Jan 26 11:41:33 2003 UTC (9 years ago) by davidxu
Branches: MAIN
Diff to: previous 1.198: preferred, colored
Changes since revision 1.198: +4 -6 lines
Move UPCALL related data structure out of kse, introduce a new data structure called kse_upcall to manage UPCALL. All KSE binding and loaning code are gone. A thread owns an upcall can collect all completed syscall contexts in its ksegrp, turn itself into UPCALL mode, and takes those contexts back to userland. Any thread without upcall structure has to export their contexts and exit at user boundary. Any thread running in user mode owns an upcall structure, when it enters kernel, if the kse mailbox's current thread pointer is not NULL, then when the thread is blocked in kernel, a new UPCALL thread is created and the upcall structure is transfered to the new UPCALL thread. if the kse mailbox's current thread pointer is NULL, then when a thread is blocked in kernel, no UPCALL thread will be created. Each upcall always has an owner thread. Userland can remove an upcall by calling kse_exit, when all upcalls in ksegrp are removed, the group is atomatically shutdown. An upcall owner thread also exits when process is in exiting state. when an owner thread exits, the upcall it owns is also removed. KSE is a pure scheduler entity. it represents a virtual cpu. when a thread is running, it always has a KSE associated with it. scheduler is free to assign a KSE to thread according thread priority, if thread priority is changed, KSE can be moved from one thread to another. When a ksegrp is created, there is always N KSEs created in the group. the N is the number of physical cpu in the current system. This makes it is possible that even an userland UTS is single CPU safe, threads in kernel still can execute on different cpu in parallel. Userland calls kse_create to add more upcall structures into ksegrp to increase concurrent in userland itself, kernel is not restricted by number of upcalls userland provides. The code hasn't been tested under SMP by author due to lack of hardware. Reviewed by: julian
Revision 1.132.2.9: download - view: text, markup, annotated - select for diffs
Sat Jan 25 19:02:23 2003 UTC (9 years ago) by dillon
Branches: old_RELENG_4
CVS tags: old_RELENG_4_8_BP, old_RELENG_4_8_0_RELEASE, old_RELENG_4_8
Diff to: previous 1.132.2.8: preferred, colored; branchpoint 1.132: preferred, colored; next MAIN 1.133: preferred, colored
Changes since revision 1.132.2.8: +0 -72 lines
MFC consolidate vmapbuf() and vunmapbuf(). Note that in -current we had to adjust vmapbuf() to use pmap_extract() instead of pamp_kextract() due to the sparc architecture. In -stable there is no sparc architecture and I am making as few changes as possible so pmap_kextract() is being retained.
Revision 1.198: download - view: text, markup, annotated - select for diffs
Thu Jan 16 00:02:20 2003 UTC (9 years ago) by dillon
Branches: MAIN
Diff to: previous 1.197: preferred, colored
Changes since revision 1.197: +0 -17 lines
Merge all the various copies of vm_fault_quick() into a single portable copy.
Revision 1.197: download - view: text, markup, annotated - select for diffs
Wed Jan 15 23:54:34 2003 UTC (9 years ago) by dillon
Branches: MAIN
Diff to: previous 1.196: preferred, colored
Changes since revision 1.196: +0 -74 lines
Merge all the various copies of vmapbuf() and vunmapbuf() into a single portable copy. Note that pmap_extract() must be used instead of pmap_kextract(). This is precursor work to a reorganization of vmapbuf() to close remaining user/kernel races (which can lead to a panic).
Revision 1.132.2.8: download - view: text, markup, annotated - select for diffs
Mon Jan 13 22:51:16 2003 UTC (9 years ago) by dillon
Branches: old_RELENG_4
Diff to: previous 1.132.2.7: preferred, colored; branchpoint 1.132: preferred, colored
Changes since revision 1.132.2.7: +0 -3 lines
primarily MFC vm_map.c 1.275. Also pull-in vm_waitproc() and cpu_wait() changes from current. This should close reference count races with the vmspace structure. There is still a shmexit() race (structure never freed) which will be addressed in a day or two with a fix MFC from current.
Revision 1.196: download - view: text, markup, annotated - select for diffs
Tue Dec 10 02:33:43 2002 UTC (9 years, 2 months ago) by julian
Branches: MAIN
CVS tags: old_RELENG_5_0_BP, old_RELENG_5_0_0_RELEASE, old_RELENG_5_0
Diff to: previous 1.195: preferred, colored
Changes since revision 1.195: +12 -1 lines
Unbreak the KSE code. Keep track of zobie threads using the Per-CPU storage during the context switch. Rearrange thread cleanups to avoid problems with Giant. Clean threads when freed or when recycled. Approved by: re (jhb)
Revision 1.195: download - view: text, markup, annotated - select for diffs
Sun Nov 24 21:37:02 2002 UTC (9 years, 2 months ago) by alc
Branches: MAIN
Diff to: previous 1.194: preferred, colored
Changes since revision 1.194: +3 -3 lines
Add page queues locking to vunmapbuf(); reduce differences with respect to the sparc64 implementation. (Note: With modest effort on the alpha and ia64 this function could migrate to the MI part of the kernel.) Approved by: re (blanket)
Revision 1.194: download - view: text, markup, annotated - select for diffs
Fri Nov 22 23:57:01 2002 UTC (9 years, 2 months ago) by mux
Branches: MAIN
Diff to: previous 1.193: preferred, colored
Changes since revision 1.193: +17 -9 lines
Under certain circumstances, we were calling kmem_free() from i386 cpu_thread_exit(). This resulted in a panic with WITNESS since we need to hold Giant to call kmem_free(), and we weren't helding it anymore in cpu_thread_exit(). We now do this from a new MD function, cpu_thread_dtor(), called by thread_dtor(). Approved by: re@ Suggested by: jhb
Revision 1.193: download - view: text, markup, annotated - select for diffs
Wed Oct 9 02:33:35 2002 UTC (9 years, 4 months ago) by julian
Branches: MAIN
Diff to: previous 1.192: preferred, colored
Changes since revision 1.192: +7 -3 lines
Round out the facilty for a 'bound' thread to loan out its KSE in specific situations. The owner thread must be blocked, and the borrower can not proceed back to user space with the borrowed KSE. The borrower will return the KSE on the next context switch where teh owner wants it back. This removes a lot of possible race conditions and deadlocks. It is consceivable that the borrower should inherit the priority of the owner too. that's another discussion and would be simple to do. Also, as part of this, the "preallocatd spare thread" is attached to the thread doing a syscall rather than the KSE. This removes the need to lock the scheduler when we want to access it, as it's now "at hand". DDB now shows a lot mor info for threaded proceses though it may need some optimisation to squeeze it all back into 80 chars again. (possible JKH project) Upcalls are now "bound" threads, but "KSE Lending" now means that other completing syscalls can be completed using that KSE before the upcall finally makes it back to the UTS. (getting threads OUT OF THE KERNEL is one of the highest priorities in the KSE system.) The upcall when it happens will present all the completed syscalls to the KSE for selection.
Revision 1.192: download - view: text, markup, annotated - select for diffs
Mon Sep 16 19:25:08 2002 UTC (9 years, 4 months ago) by mini
Branches: MAIN
Diff to: previous 1.191: preferred, colored
Changes since revision 1.191: +21 -67 lines
Add kernel support needed for the KSE-aware libpthread: - Maintain fpu state across signals. - Use ucontext_t's to store KSE thread state. - Synthesize state for the UTS upon each upcall, rather than saving and copying a trapframe. - Save and restore FPU state properly in ucontext_t's. Reviewed by: deischen, julian Approved by: -arch
Revision 1.191: download - view: text, markup, annotated - select for diffs
Sat Sep 7 01:26:34 2002 UTC (9 years, 5 months ago) by peter
Branches: MAIN
Diff to: previous 1.190: preferred, colored
Changes since revision 1.190: +0 -34 lines
Zap the implementations of the i386-aout specific cpu_coredump function. Most of the non-i386 platforms had rather broken implementations anyway.
Revision 1.190: download - view: text, markup, annotated - select for diffs
Thu Aug 15 20:55:02 2002 UTC (9 years, 5 months ago) by rwatson
Branches: MAIN
Diff to: previous 1.189: preferred, colored
Changes since revision 1.189: +2 -1 lines
In order to better support flexible and extensible access control, make a series of modifications to the credential arguments relating to file read and write operations to cliarfy which credential is used for what: - Change fo_read() and fo_write() to accept "active_cred" instead of "cred", and change the semantics of consumers of fo_read() and fo_write() to pass the active credential of the thread requesting an operation rather than the cached file cred. The cached file cred is still available in fo_read() and fo_write() consumers via fp->f_cred. These changes largely in sys_generic.c. For each implementation of fo_read() and fo_write(), update cred usage to reflect this change and maintain current semantics: - badfo_readwrite() unchanged - kqueue_read/write() unchanged pipe_read/write() now authorize MAC using active_cred rather than td->td_ucred - soo_read/write() unchanged - vn_read/write() now authorize MAC using active_cred but VOP_READ/WRITE() with fp->f_cred Modify vn_rdwr() to accept two credential arguments instead of a single credential: active_cred and file_cred. Use active_cred for MAC authorization, and select a credential for use in VOP_READ/WRITE() based on whether file_cred is NULL or not. If file_cred is provided, authorize the VOP using that cred, otherwise the active credential, matching current semantics. Modify current vn_rdwr() consumers to pass a file_cred if used in the context of a struct file, and to always pass active_cred. When vn_rdwr() is used without a file_cred, pass NOCRED. These changes should maintain current semantics for read/write, but avoid a redundant passing of fp->f_cred, as well as making it more clear what the origin of each credential is in file descriptor read/write operations. Follow-up commits will make similar changes to other file descriptor operations, and modify the MAC framework to pass both credentials to MAC policy modules so they can implement either semantic for revocation. Obtained from: TrustedBSD Project Sponsored by: DARPA, NAI Labs
Revision 1.189: download - view: text, markup, annotated - select for diffs
Sat Jun 29 17:26:16 2002 UTC (9 years, 7 months ago) by julian
Branches: MAIN
Diff to: previous 1.188: preferred, colored
Changes since revision 1.188: +155 -5 lines
Part 1 of KSE-III The ability to schedule multiple threads per process (one one cpu) by making ALL system calls optionally asynchronous. to come: ia64 and power-pc patches, patches for gdb, test program (in tools) Reviewed by: Almost everyone who counts (at various times, peter, jhb, matt, alfred, mini, bernd, and a cast of thousands) NOTE: this is still Beta code, and contains lots of debugging stuff. expect slight instability in signals..
Revision 1.188: download - view: text, markup, annotated - select for diffs
Mon Jun 24 15:48:00 2002 UTC (9 years, 7 months ago) by jake
Branches: MAIN
Diff to: previous 1.187: preferred, colored
Changes since revision 1.187: +6 -0 lines
Add an MD callout like cpu_exit, but which is called after sched_lock is obtained, when all other scheduling activity is suspended. This is needed on sparc64 to deactivate the vmspace of the exiting process on all cpus. Otherwise if another unrelated process gets the exact same vmspace structure allocated to it (same address), its address space will not be activated properly. This seems to fix some spontaneous signal 11 problems with smp on sparc64.
Revision 1.187: download - view: text, markup, annotated - select for diffs
Wed Mar 27 05:39:19 2002 UTC (9 years, 10 months ago) by dillon
Branches: MAIN
Diff to: previous 1.186: preferred, colored
Changes since revision 1.186: +1 -0 lines
Compromise for critical*()/cpu_critical*() recommit. Cleanup the interrupt disablement assumptions in kern_fork.c by adding another API call, cpu_critical_fork_exit(). Cleanup the td_savecrit field by moving it from MI to MD. Temporarily move cpu_critical*() from <arch>/include/cpufunc.h to <arch>/<arch>/critical.c (stage-2 will clean this up). Implement interrupt deferral for i386 that allows interrupts to remain enabled inside critical sections. This also fixes an IPI interlock bug, and requires uses of icu_lock to be enclosed in a true interrupt disablement. This is the stage-1 commit. Stage-2 will occur after stage-1 has stabilized, and will move cpu_critical*() into its own header file(s) + other things. This commit may break non-i386 architectures in trivial ways. This should be temporary. Reviewed by: core Approved by: core
Revision 1.186: download - view: text, markup, annotated - select for diffs
Thu Mar 21 19:27:15 2002 UTC (9 years, 10 months ago) by alc
Branches: MAIN
Diff to: previous 1.185: preferred, colored
Changes since revision 1.185: +0 -14 lines
o Use the MI vm_map_growstack() instead of grow_stack() in trap_pfault() and trapwrite(). o On i386/pc98, remove the (now) unused grow_stack().
Revision 1.185: download - view: text, markup, annotated - select for diffs
Thu Mar 21 06:19:07 2002 UTC (9 years, 10 months ago) by imp
Branches: MAIN
Diff to: previous 1.184: preferred, colored
Changes since revision 1.184: +3 -3 lines
Fix abuses of cpu_critical_{enter,exit} by converting to
intr_{disable,restore} as well as providing an implemenation of
intr_{disable,restore}.
Reviewed by: jake, rwatson, jhb
Revision 1.184: download - view: text, markup, annotated - select for diffs
Wed Mar 20 08:56:31 2002 UTC (9 years, 10 months ago) by alfred
Branches: MAIN
Diff to: previous 1.183: preferred, colored
Changes since revision 1.183: +3 -3 lines
Remove __P.
Revision 1.183: download - view: text, markup, annotated - select for diffs
Tue Feb 26 20:33:39 2002 UTC (9 years, 11 months ago) by dillon
Branches: MAIN
Diff to: previous 1.182: preferred, colored
Changes since revision 1.182: +0 -1 lines
revert last commit temporarily due to whining on the lists.
Revision 1.182: download - view: text, markup, annotated - select for diffs
Tue Feb 26 17:06:17 2002 UTC (9 years, 11 months ago) by dillon
Branches: MAIN
Diff to: previous 1.181: preferred, colored
Changes since revision 1.181: +1 -0 lines
STAGE-1 of 3 commit - allow (but do not require) interrupts to remain enabled in critical sections and streamline critical_enter() and critical_exit(). This commit allows an architecture to leave interrupts enabled inside critical sections if it so wishes. Architectures that do not wish to do this are not effected by this change. This commit implements the feature for the I386 architecture and provides a sysctl, debug.critical_mode, which defaults to 1 (use the feature). For now you can turn the sysctl on and off at any time in order to test the architectural changes or track down bugs. This commit is just the first stage. Some areas of the code, specifically the MACHINE_CRITICAL_ENTER #ifdef'd code, is strictly temporary and will be cleaned up in the STAGE-2 commit when the critical_*() functions are moved entirely into MD files. The following changes have been made: * critical_enter() and critical_exit() for I386 now simply increment and decrement curthread->td_critnest. They no longer disable hard interrupts. When critical_exit() decrements the counter to 0 it effectively calls a routine to deal with whatever interrupts were deferred during the time the code was operating in a critical section. Other architectures are unaffected. * fork_exit() has been conditionalized to remove MD assumptions for the new code. Old code will still use the old MD assumptions in regards to hard interrupt disablement. In STAGE-2 this will be turned into a subroutine call into MD code rather then hardcoded in MI code. The new code places the burden of entering the critical section in the trampoline code where it belongs. * I386: interrupts are now enabled while we are in a critical section. The interrupt vector code has been adjusted to deal with the fact. If it detects that we are in a critical section it currently defers the interrupt by adding the appropriate bit to an interrupt mask. * In order to accomplish the deferral, icu_lock is required. This is i386-specific. Thus icu_lock can only be obtained by mainline i386 code while interrupts are hard disabled. This change has been made. * Because interrupts may or may not be hard disabled during a context switch, cpu_switch() can no longer simply assume that PSL_I will be in a consistent state. Therefore, it now saves and restores eflags. * FAST INTERRUPT PROVISION. Fast interrupts are currently deferred. The intention is to eventually allow them to operate either while we are in a critical section or, if we are able to restrict the use of sched_lock, while we are not holding the sched_lock. * ICU and APIC vector assembly for I386 cleaned up. The ICU code has been cleaned up to match the APIC code in regards to format and macro availability. Additionally, the code has been adjusted to deal with deferred interrupts. * Deferred interrupts use a per-cpu boolean int_pending, and masks ipending, spending, and fpending. Being per-cpu variables it is not currently necessary to lock; bus cycles modifying them. Note that the same mechanism will enable preemption to be incorporated as a true software interrupt without having to further hack up the critical nesting code. * Note: the old critical_enter() code in kern/kern_switch.c is currently #ifdef to be compatible with both the old and new methodology. In STAGE-2 it will be moved entirely to MD code. Performance issues: One of the purposes of this commit is to enhance critical section performance, specifically to greatly reduce bus overhead to allow the critical section code to be used to protect per-cpu caches. These caches, such as Jeff's slab allocator work, can potentially operate very quickly making the effective savings of the new critical section code's performance very significant. The second purpose of this commit is to allow architectures to enable certain interrupts while in a critical section. Specifically, the intention is to eventually allow certain FAST interrupts to operate rather then defer. The third purpose of this commit is to begin to clean up the critical_enter()/critical_exit()/cpu_critical_enter()/ cpu_critical_exit() API which currently has serious cross pollution in MI code (in fork_exit() and ast() for example). The fourth purpose of this commit is to provide a framework that allows kernel-preempting software interrupts to be implemented cleanly. This is currently used for two forward interrupts in I386. Other architectures will have the choice of using this infrastructure or building the functionality directly into critical_enter()/ critical_exit(). Finally, this commit is designed to greatly improve the flexibility of various architectures to manage critical section handling, software interrupts, preemption, and other highly integrated architecture-specific details.
Revision 1.181: download - view: text, markup, annotated - select for diffs
Tue Feb 12 05:50:43 2002 UTC (9 years, 11 months ago) by alc
Branches: MAIN
Diff to: previous 1.180: preferred, colored
Changes since revision 1.180: +3 -5 lines
Remove an unused (but initialized) variable from vmapbuf().
Revision 1.180: download - view: text, markup, annotated - select for diffs
Thu Feb 7 20:58:43 2002 UTC (10 years ago) by julian
Branches: MAIN
Diff to: previous 1.179: preferred, colored
Changes since revision 1.179: +2 -3 lines
Pre-KSE/M3 commit. this is a low-functionality change that changes the kernel to access the main thread of a process via the linked list of threads rather than assuming that it is embedded in the process. It IS still embeded there but remove all teh code that assumes that in preparation for the next commit which will actually move it out. Reviewed by: peter@freebsd.org, gallatin@cs.duke.edu, benno rice,
Revision 1.179: download - view: text, markup, annotated - select for diffs
Tue Dec 18 18:46:32 2001 UTC (10 years, 1 month ago) by julian
Branches: MAIN
Diff to: previous 1.178: preferred, colored
Changes since revision 1.178: +3 -3 lines
In a couple of places, we recalculated addresses we already had in local pointer variables.
Revision 1.178: download - view: text, markup, annotated - select for diffs
Tue Dec 18 00:27:15 2001 UTC (10 years, 1 month ago) by jhb
Branches: MAIN
Diff to: previous 1.177: preferred, colored
Changes since revision 1.177: +2 -2 lines
Modify the critical section API as follows: - The MD functions critical_enter/exit are renamed to start with a cpu_ prefix. - MI wrapper functions critical_enter/exit maintain a per-thread nesting count and a per-thread critical section saved state set when entering a critical section while at nesting level 0 and restored when exiting to nesting level 0. This moves the saved state out of spin mutexes so that interlocking spin mutexes works properly. - Most low-level MD code that used critical_enter/exit now use cpu_critical_enter/exit. MI code such as device drivers and spin mutexes use the MI wrappers. Note that since the MI wrappers store the state in the current thread, they do not have any return values or arguments. - mtx_intr_enable() is replaced with a constant CRITICAL_FORK which is assigned to curthread->td_savecrit during fork_exit(). Tested on: i386, alpha
Revision 1.177: download - view: text, markup, annotated - select for diffs
Tue Dec 11 23:33:40 2001 UTC (10 years, 2 months ago) by jhb
Branches: MAIN
Diff to: previous 1.176: preferred, colored
Changes since revision 1.176: +1 -1 lines
Overhaul the per-CPU support a bit: - The MI portions of struct globaldata have been consolidated into a MI struct pcpu. The MD per-CPU data are specified via a macro defined in machine/pcpu.h. A macro was chosen over a struct mdpcpu so that the interface would be cleaner (PCPU_GET(my_md_field) vs. PCPU_GET(md.md_my_md_field)). - All references to globaldata are changed to pcpu instead. In a UP kernel, this data was stored as global variables which is where the original name came from. In an SMP world this data is per-CPU and ideally private to each CPU outside of the context of debuggers. This also included combining machine/globaldata.h and machine/globals.h into machine/pcpu.h. - The pointer to the thread using the FPU on i386 was renamed from npxthread to fpcurthread to be identical with other architectures. - Make the show pcpu ddb command MI with a MD callout to display MD fields. - The globaldata_register() function was renamed to pcpu_init() and now init's MI fields of a struct pcpu in addition to registering it with the internal array and list. - A pcpu_destroy() function was added to remove a struct pcpu from the internal array and list. Tested on: alpha, i386 Reviewed by: peter, jake
Revision 1.132.2.7: download - view: text, markup, annotated - select for diffs
Sat Nov 10 22:34:11 2001 UTC (10 years, 3 months ago) by tegge
Branches: old_RELENG_4
CVS tags: old_RELENG_4_7_BP, old_RELENG_4_7_0_RELEASE, old_RELENG_4_7, old_RELENG_4_6_BP, old_RELENG_4_6_2_RELEASE, old_RELENG_4_6_1_RELEASE, old_RELENG_4_6_0_RELEASE, old_RELENG_4_6, old_RELENG_4_5_BP, old_RELENG_4_5_0_RELEASE, old_RELENG_4_5
Diff to: previous 1.132.2.6: preferred, colored; branchpoint 1.132: preferred, colored
Changes since revision 1.132.2.6: +24 -15 lines
MFC: Change vmapbuf() to use pmap_qenter() and vunmapbuf() to use
pmap_qremove(). This significantly reduces the number of TLB
shootdowns caused by vmapbuf/vunmapbuf when performing many large
reads from raw disk devices.
Revision 1.176: download - view: text, markup, annotated - select for diffs
Thu Oct 25 00:53:43 2001 UTC (10 years, 3 months ago) by jhb
Branches: MAIN
Diff to: previous 1.175: preferred, colored
Changes since revision 1.175: +22 -18 lines
Split the per-process Local Descriptor Table out of the PCB and into struct mdproc. Submitted by: Andrew R. Reiter <arr@watson.org> Silence on: -current
Revision 1.132.2.6: download - view: text, markup, annotated - select for diffs
Sat Oct 20 17:37:29 2001 UTC (10 years, 3 months ago) by mjacob
Branches: old_RELENG_4
Diff to: previous 1.132.2.5: preferred, colored; branchpoint 1.132: preferred, colored
Changes since revision 1.132.2.5: +2 -2 lines
MFC: Fix problem where a user buffer outside of the area being tested will be corrupted.
Revision 1.175: download - view: text, markup, annotated - select for diffs
Sun Oct 14 21:09:04 2001 UTC (10 years, 3 months ago) by tegge
Branches: MAIN
Diff to: previous 1.174: preferred, colored
Changes since revision 1.174: +25 -16 lines
Change vmapbuf() to use pmap_qenter() and vunmapbuf() to use pmap_qremove(). This significantly reduces the number of TLB shootdowns caused by vmapbuf/vunmapbuf when performing many large reads from raw disk devices. Reviewed by: dillon
Revision 1.174: download - view: text, markup, annotated - select for diffs
Tue Oct 2 18:34:19 2001 UTC (10 years, 4 months ago) by mjacob
Branches: MAIN
Diff to: previous 1.173: preferred, colored
Changes since revision 1.173: +2 -2 lines
Fix problem where a user buffer outside of the area being tested will be corrupted. PR: 29194 Obtained from: Tor.Egge@fast.no MFC after: 2 weeks
Revision 1.132.2.5: download - view: text, markup, annotated - select for diffs
Sat Sep 22 09:21:48 2001 UTC (10 years, 4 months ago) by dillon
Branches: old_RELENG_4
Diff to: previous 1.132.2.4: preferred, colored; branchpoint 1.132: preferred, colored
Changes since revision 1.132.2.4: +3 -5 lines
MFC the Yahoo coredump patch from Peter, Paul, and I, plus the additional fix by Peter. See kern/kern_sig.c 1.132.
Revision 1.173: download - view: text, markup, annotated - select for diffs
Wed Sep 19 05:44:12 2001 UTC (10 years, 4 months ago) by peter
Branches: MAIN
Diff to: previous 1.172: preferred, colored
Changes since revision 1.172: +3 -2 lines
Reserve an extra 16 bytes in case we have to grow the trapframe into a vm86trapframe for switching to vm86 [unlikely] while exiting. I lost this when doing the pcb move that went in with the KSE commit. Reviewed by: jake
Revision 1.172: download - view: text, markup, annotated - select for diffs
Wed Sep 12 08:37:30 2001 UTC (10 years, 5 months ago) by julian
Branches: MAIN
CVS tags: old_KSE_MILESTONE_2
Diff to: previous 1.171: preferred, colored
Changes since revision 1.171: +47 -36 lines
KSE Milestone 2 Note ALL MODULES MUST BE RECOMPILED make the kernel aware that there are smaller units of scheduling than the process. (but only allow one thread per process at this time). This is functionally equivalent to teh previousl -current except that there is a thread associated with each process. Sorry john! (your next MFC will be a doosie!) Reviewed by: peter@freebsd.org, dillon@freebsd.org X-MFC after: ha ha ha ha
Revision 1.171: download - view: text, markup, annotated - select for diffs
Mon Sep 10 04:28:57 2001 UTC (10 years, 5 months ago) by peter
Branches: MAIN
CVS tags: old_KSE_PRE_MILESTONE_2
Diff to: previous 1.170: preferred, colored
Changes since revision 1.170: +1 -27 lines
Rip some well duplicated code out of cpu_wait() and cpu_exit() and move it to the MI area. KSE touched cpu_wait() which had the same change replicated five ways for each platform. Now it can just do it once. The only MD parts seemed to be dealing with fpu state cleanup and things like vm86 cleanup on x86. The rest was identical. XXX: ia64 and powerpc did not have cpu_throw(), so I've put a functional stub in place. Reviewed by: jake, tmm, dillon
Revision 1.170: download - view: text, markup, annotated - select for diffs
Sat Sep 8 22:18:58 2001 UTC (10 years, 5 months ago) by peter
Branches: MAIN
Diff to: previous 1.169: preferred, colored
Changes since revision 1.169: +3 -5 lines
Missing part of dillon's coredump commit. cpu_coredump() was still passing IO_NODELOCKED to vn_rdwr(), this would cause operations on the unlocked core vnode and softupdates nastiness if an a.out binary cored.
Revision 1.169: download - view: text, markup, annotated - select for diffs
Tue Sep 4 08:36:46 2001 UTC (10 years, 5 months ago) by peter
Branches: MAIN
Diff to: previous 1.168: preferred, colored
Changes since revision 1.168: +1 -18 lines
Nuke #if 0'ed "setredzone()" stub. We never used it, and probably never will. I've implemented an optional redzone as part of the KSE upage breakup.
Revision 1.168: download - view: text, markup, annotated - select for diffs
Sat Aug 25 02:20:01 2001 UTC (10 years, 5 months ago) by peter
Branches: MAIN
Diff to: previous 1.167: preferred, colored
Changes since revision 1.167: +2 -1 lines
Optionize UPAGES for the i386. As part of this I split some of the low level implementation stuff out of machine/globaldata.h to avoid exposing UPAGES to lots more places. The end result is that we can double the kernel stack size with 'options UPAGES=4' etc. This is mainly being done for the benefit of a MFC to RELENG_4 at some point. -current doesn't really need this so much since each interrupt runs on its own kstack.
Revision 1.132.2.4: download - view: text, markup, annotated - select for diffs
Wed Aug 15 01:23:50 2001 UTC (10 years, 5 months ago) by peter
Branches: old_RELENG_4
CVS tags: old_RELENG_4_4_BP, old_RELENG_4_4_0_RELEASE, old_RELENG_4_4
Diff to: previous 1.132.2.3: preferred, colored; branchpoint 1.132: preferred, colored
Changes since revision 1.132.2.3: +2 -2 lines
MFC: SSE kernel support. This is only active if you compile 'options CPU_ENABLE_SSE' in the kernel. This is a MFC of the code in -current, plus all the followup fixes and tweaks but adapted for the npx and compile differences in RELENG_4. The npx_intr() change comes from the 4.3 version of the diffs since -current uses traps vs. interrupts in npx.c. This is a giant no-op without the kernel compile option. Approved by: re (murray)
Revision 1.167: download - view: text, markup, annotated - select for diffs
Thu Jul 12 06:32:50 2001 UTC (10 years, 7 months ago) by peter
Branches: MAIN
Diff to: previous 1.166: preferred, colored
Changes since revision 1.166: +2 -2 lines
Activate SSE/SIMD. This is the extra context switching support that we are required to do if we let user processes use the extra 128 bit registers etc. This is the base part of the diff I got from: http://www.issei.org/issei/FreeBSD/sse.html I believe this is by: Mr. SUZUKI Issei <issei@issei.org> SMP support apparently by: Takekazu KATO <kato@chino.it.okayama-u.ac.jp> Test code by: NAKAMURA Kazushi <kaz@kobe1995.net>, see http://kobe1995.net/~kaz/FreeBSD/SSE.en.html I have fixed a couple of style(9) deviations. I have some followup commits to fix a couple of non-style things.
Revision 1.166: download - view: text, markup, annotated - select for diffs
Thu Jul 5 01:32:40 2001 UTC (10 years, 7 months ago) by dillon
Branches: MAIN
Diff to: previous 1.165: preferred, colored
Changes since revision 1.165: +1 -62 lines
Move vm_page_zero_idle() from machine-dependant sections to a machine-independant source file, vm/vm_zeroidle.c. It was exactly the same for all platforms and updating them all was getting annoying.
Revision 1.165: download - view: text, markup, annotated - select for diffs
Wed Jul 4 23:27:04 2001 UTC (10 years, 7 months ago) by dillon
Branches: MAIN
Diff to: previous 1.164: preferred, colored
Changes since revision 1.164: +2 -2 lines
Reorg vm_page.c into vm_page.c, vm_pageq.c, and vm_contig.c (for contigmalloc). Also removed some spl's and added some VM mutexes, but they are not actually used yet, so this commit does not really make any operational changes to the system. vm_page.c relates to vm_page_t manipulation, including high level deactivation, activation, etc... vm_pageq.c relates to finding free pages and aquiring exclusive access to a page queue (exclusivity part not yet implemented). And the world still builds... :-)
Revision 1.164: download - view: text, markup, annotated - select for diffs
Wed Jul 4 16:20:09 2001 UTC (10 years, 7 months ago) by dillon
Branches: MAIN
Diff to: previous 1.163: preferred, colored
Changes since revision 1.163: +12 -16 lines
With Alfred's permission, remove vm_mtx in favor of a fine-grained approach (this commit is just the first stage). Also add various GIANT_ macros to formalize the removal of Giant, making it easy to test in a more piecemeal fashion. These macros will allow us to test fine-grained locks to a degree before removing Giant, and also after, and to remove Giant in a piecemeal fashion via sysctl's on those subsystems which the authors believe can operate without Giant.
Revision 1.163: download - view: text, markup, annotated - select for diffs
Tue Jul 3 05:09:44 2001 UTC (10 years, 7 months ago) by jhb
Branches: MAIN
Diff to: previous 1.162: preferred, colored
Changes since revision 1.162: +3 -3 lines
Allow Giant to be recursed when a process terminates.
Revision 1.162: download - view: text, markup, annotated - select for diffs
Fri Jun 29 11:10:29 2001 UTC (10 years, 7 months ago) by jhb
Branches: MAIN
Diff to: previous 1.161: preferred, colored
Changes since revision 1.161: +9 -9 lines
Add a new MI pointer to the process' trapframe p_frame instead of using various differently named pointers buried under p_md. Reviewed by: jake (in principle)
Revision 1.132.2.3: download - view: text, markup, annotated - select for diffs
Fri Jun 15 09:38:00 2001 UTC (10 years, 7 months ago) by scottl
Branches: old_RELENG_4
Diff to: previous 1.132.2.2: preferred, colored; branchpoint 1.132: preferred, colored
Changes since revision 1.132.2.2: +9 -8 lines
MFC Peter Wemm's init and kthread enhancements from 08/11/2000 of -current. This allows kthreads to be used by device drivers long before root is mounted and init is officially started. This also brings RAIDframe one step closer. Reviewed by: peter
Revision 1.161: download - view: text, markup, annotated - select for diffs
Wed May 30 14:35:22 2001 UTC (10 years, 8 months ago) by jhb
Branches: MAIN
Diff to: previous 1.160: preferred, colored
Changes since revision 1.160: +4 -2 lines
We can't grab the sched_lock in set_user_ldt() because when it is called from cpu_switch(), curproc has been changed, but the sched_lock owner will not be updated until we return to mi_switch(), thus we deadlock against ourselves. As a workaround, push the acquire and release of sched_lock out to the callers of set_user_ldt(). Note that we can't use a mtx_assert() in set_user_ldt for the same reason. Sleuting by: tmm Tested by: tmm, dougb
Revision 1.160: download - view: text, markup, annotated - select for diffs
Tue May 22 00:09:26 2001 UTC (10 years, 8 months ago) by jhb
Branches: MAIN
Diff to: previous 1.159: preferred, colored
Changes since revision 1.159: +1 -3 lines
Remove a few more spl's I missed earlier. Reported by: Michael Harnois <mdharnois@home.com> Pointy hat: me
Revision 1.159: download - view: text, markup, annotated - select for diffs
Mon May 21 18:30:22 2001 UTC (10 years, 8 months ago) by jhb
Branches: MAIN
Diff to: previous 1.158: preferred, colored
Changes since revision 1.158: +1 -4 lines
Axe unneeded spl()'s.
Revision 1.158: download - view: text, markup, annotated - select for diffs
Sat May 19 01:28:01 2001 UTC (10 years, 8 months ago) by alfred
Branches: MAIN
Diff to: previous 1.157: preferred, colored
Changes since revision 1.157: +17 -7 lines
Introduce a global lock for the vm subsystem (vm_mtx). vm_mtx does not recurse and is required for most low level vm operations. faults can not be taken without holding Giant. Memory subsystems can now call the base page allocators safely. Almost all atomic ops were removed as they are covered under the vm mutex. Alpha and ia64 now need to catch up to i386's trap handlers. FFS and NFS have been tested, other filesystems will need minor changes (grabbing the vm lock when twiddling page properties). Reviewed (partially) by: jake, jhb
Revision 1.157: download - view: text, markup, annotated - select for diffs
Sun May 13 07:44:14 2001 UTC (10 years, 9 months ago) by bde
Branches: MAIN
Diff to: previous 1.156: preferred, colored
Changes since revision 1.156: +15 -5 lines
Use a critical region to protect pushing of the parent's npx state to the pcb for fork(). It was possible for the state to be saved twice when an interrupt handler saved it concurrently. This corrupted (reset) the state because fnsave has the (in)convenient side effect of doing an implicit fninit. Mundane null pointer bugs were not possible, because we save to an "arbitrary" process's pcb and not to the "right" place (npxproc). Push the parent's %gs to the pcb for fork(). Changes to %gs before fork() were not preserved in the child unless an accidental context switch did the pushing. Updated the list of pcb contents which is supposed to inhibit bugs like this. pcb_dr*, pcb_gs and pcb_ext were missing. Copying is correct for pcb_dr*, and pcb_ext is already handled specially (although XXX'ly). Reducing the savectx() call to an npxsave() call in rev.1.80 was a mistake. The above bugs are duplicated in many places, including in savectx() itself. The arbitraryness of the parent process pointer for the fork() subroutines, the pcb pointer for savectx(), and the save87 pointer for npxsave(), is illusory. These functions don't work "right" unless the pointers are precisely curproc, curpcb, and the address of npxproc's save87 area, respectively, although the special context in which they are called allows savectx(&dumppcb) to sort of work and npxsave(&dummy) to work. cpu_fork() just doesn't work unless the parent process pointer is curproc, or the caller has pushed %gs to the pcb, or %gs happens to already be in the pcb.
Revision 1.156: download - view: text, markup, annotated - select for diffs
Thu May 10 17:03:03 2001 UTC (10 years, 9 months ago) by jhb
Branches: MAIN
Diff to: previous 1.155: preferred, colored
Changes since revision 1.155: +5 -1 lines
- Use sched_lock and critical regions to ensure that LDT updates are thread safe from preemption and concurrent access to the LDT. - Move the prototype for i386_extend_pcb() to <machine/pcb_ext.h>. Reviewed by: silence on -hackers
Revision 1.155: download - view: text, markup, annotated - select for diffs
Fri Apr 27 19:28:20 2001 UTC (10 years, 9 months ago) by jhb
Branches: MAIN
Diff to: previous 1.154: preferred, colored
Changes since revision 1.154: +2 -4 lines
Overhaul of the SMP code. Several portions of the SMP kernel support have 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
Revision 1.154: download - view: text, markup, annotated - select for diffs
Wed Mar 7 03:20:14 2001 UTC (10 years, 11 months ago) by jhb
Branches: MAIN
Diff to: previous 1.153: preferred, colored
Changes since revision 1.153: +3 -2 lines
Use the proc lock to protect p_pptr when waking up our parent in cpu_exit() and remove the mpfixme() message that is now fixed.
Revision 1.153: download - view: text, markup, annotated - select for diffs
Fri Feb 23 01:25:00 2001 UTC (10 years, 11 months ago) by peter
Branches: MAIN
Diff to: previous 1.152: preferred, colored
Changes since revision 1.152: +3 -9 lines
Activate USER_LDT by default. The new thread libraries are going to depend on this. The linux ABI emulator tries to use it for some linux binaries too. VM86 had a bigger cost than this and it was made default a while ago. Reviewed by: jhb, imp
Revision 1.152: download - view: text, markup, annotated - select for diffs
Tue Feb 20 05:26:14 2001 UTC (10 years, 11 months ago) by jhb
Branches: MAIN
Diff to: previous 1.151: preferred, colored
Changes since revision 1.151: +1 -3 lines
- Don't call clear_resched() in userret(), instead, clear the resched flag in mi_switch() just before calling cpu_switch() so that the first switch after a resched request will satisfy the request. - While I'm at it, move a few things into mi_switch() and out of cpu_switch(), specifically set the p_oncpu and p_lastcpu members of proc in mi_switch(), and handle the sched_lock state change across a context switch in mi_switch(). - Since cpu_switch() no longer handles the sched_lock state change, we have to setup an initial state for sched_lock in fork_exit() before we release it.
Revision 1.151: download - view: text, markup, annotated - select for diffs
Fri Feb 9 06:09:19 2001 UTC (11 years ago) by bmilekic
Branches: MAIN
Diff to: previous 1.150: preferred, colored
Changes since revision 1.150: +5 -5 lines
Change and clean the mutex lock interface.
mtx_enter(lock, type) becomes:
mtx_lock(lock) for sleep locks (MTX_DEF-initialized locks)
mtx_lock_spin(lock) for spin locks (MTX_SPIN-initialized)
similarily, for releasing a lock, we now have:
mtx_unlock(lock) for MTX_DEF and mtx_unlock_spin(lock) for MTX_SPIN.
We change the caller interface for the two different types of locks
because the semantics are entirely different for each case, and this
makes it explicitly clear and, at the same time, it rids us of the
extra `type' argument.
The enter->lock and exit->unlock change has been made with the idea
that we're "locking data" and not "entering locked code" in mind.
Further, remove all additional "flags" previously passed to the
lock acquire/release routines with the exception of two:
MTX_QUIET and MTX_NOSWITCH
The functionality of these flags is preserved and they can be passed
to the lock/unlock routines by calling the corresponding wrappers:
mtx_{lock, unlock}_flags(lock, flag(s)) and
mtx_{lock, unlock}_spin_flags(lock, flag(s)) for MTX_DEF and MTX_SPIN
locks, respectively.
Re-inline some lock acq/rel code; in the sleep lock case, we only
inline the _obtain_lock()s in order to ensure that the inlined code
fits into a cache line. In the spin lock case, we inline recursion and
actually only perform a function call if we need to spin. This change
has been made with the idea that we generally tend to avoid spin locks
and that also the spin locks that we do have and are heavily used
(i.e. sched_lock) do recurse, and therefore in an effort to reduce
function call overhead for some architectures (such as alpha), we
inline recursion for this case.
Create a new malloc type for the witness code and retire from using
the M_DEV type. The new type is called M_WITNESS and is only declared
if WITNESS is enabled.
Begin cleaning up some machdep/mutex.h code - specifically updated the
"optimized" inlined code in alpha/mutex.h and wrote MTX_LOCK_SPIN
and MTX_UNLOCK_SPIN asm macros for the i386/mutex.h as we presently
need those.
Finally, caught up to the interface changes in all sys code.
Contributors: jake, jhb, jasone (in no particular order)
Revision 1.150: download - view: text, markup, annotated - select for diffs
Mon Jan 29 09:38:38 2001 UTC (11 years ago) by peter
Branches: MAIN
Diff to: previous 1.149: preferred, colored
Changes since revision 1.149: +3 -4 lines
Send "#if NISA > 0" to the bit-bucket and replace it with an option. These were compile-time "is the isa code present?" tests and not 'how many isa busses' tests.
Revision 1.149: download - view: text, markup, annotated - select for diffs
Wed Jan 24 09:54:44 2001 UTC (11 years ago) by jhb
Branches: MAIN
Diff to: previous 1.148: preferred, colored
Changes since revision 1.148: +5 -1 lines
Setup the return values for a child process in the trapframe when we setup the rest of the trapframe instead of doing it in fork_return().
Revision 1.148: download - view: text, markup, annotated - select for diffs
Fri Jan 19 13:19:01 2001 UTC (11 years ago) by peter
Branches: MAIN
Diff to: previous 1.147: preferred, colored
Changes since revision 1.147: +5 -5 lines
Use #ifdef DEV_NPX from opt_npx.h instead of #if NNPX > 0 from npx.h
Revision 1.147: download - view: text, markup, annotated - select for diffs
Wed Jan 10 04:43:46 2001 UTC (11 years, 1 month ago) by jake
Branches: MAIN
Diff to: previous 1.146: preferred, colored
Changes since revision 1.146: +6 -6 lines
Use PCPU_GET, PCPU_PTR and PCPU_SET to access all per-cpu variables other then curproc.
Revision 1.146: download - view: text, markup, annotated - select for diffs
Sat Dec 23 19:42:56 2000 UTC (11 years, 1 month ago) by jake
Branches: MAIN
Diff to: previous 1.145: preferred, colored
Changes since revision 1.145: +13 -1 lines
Protect proc.p_pptr and proc.p_children/p_sibling with the proctree_lock. linprocfs not locked pending response from informal maintainer. Reviewed by: jhb, -smp@
Revision 1.145: download - view: text, markup, annotated - select for diffs
Fri Dec 8 21:50:09 2000 UTC (11 years, 2 months ago) by dwmalone
Branches: MAIN
Diff to: previous 1.144: preferred, colored
Changes since revision 1.144: +2 -3 lines
Convert more malloc+bzero to malloc+M_ZERO. Submitted by: josh@zipperup.org Submitted by: Robert Drehmel <robd@gmx.net>
Revision 1.144: download - view: text, markup, annotated - select for diffs
Fri Dec 8 21:31:52 2000 UTC (11 years, 2 months ago) by jake
Branches: MAIN
Diff to: previous 1.143: preferred, colored
Changes since revision 1.143: +2 -2 lines
Revert the previous change I made to cpu_switch. It doesn't help as much as I thought it would and according to bde was a pessimization.
Revision 1.143: download - view: text, markup, annotated - select for diffs
Sun Dec 3 01:09:59 2000 UTC (11 years, 2 months ago) by jake
Branches: MAIN
Diff to: previous 1.142: preferred, colored
Changes since revision 1.142: +2 -2 lines
Change cpu_switch to explicitly popl the callers program counter and pushl that of the new process, rather than doing a movl (%esp) and assuming that the stack has been setup right. This make the initial stack setup slightly more sane, and will make it easier to stick an interrupted process onto the run queue without its knowing.
Revision 1.142: download - view: text, markup, annotated - select for diffs
Wed Oct 25 05:19:34 2000 UTC (11 years, 3 months ago) by jhb
Branches: MAIN
Diff to: previous 1.141: preferred, colored
Changes since revision 1.141: +2 -2 lines
- Overhaul the software interrupt code to use interrupt threads for each type of software interrupt. Roughly, what used to be a bit in spending now maps to a swi thread. Each thread can have multiple handlers, just like a hardware interrupt thread. - Instead of using a bitmask of pending interrupts, we schedule the specific software interrupt thread to run, so spending, NSWI, and the shandlers array are no longer needed. We can now have an arbitrary number of software interrupt threads. When you register a software interrupt thread via sinthand_add(), you get back a struct intrhand that you pass to sched_swi() when you wish to schedule your swi thread to run. - Convert the name of 'struct intrec' to 'struct intrhand' as it is a bit more intuitive. Also, prefix all the members of struct intrhand with 'ih_'. - Make swi_net() a MI function since there is now no point in it being MD. Submitted by: cp
Revision 1.141: download - view: text, markup, annotated - select for diffs
Mon Oct 23 23:32:36 2000 UTC (11 years, 3 months ago) by jhb
Branches: MAIN
Diff to: previous 1.140: preferred, colored
Changes since revision 1.140: +2 -11 lines
Don't dink with interrupts in vm_page_zero_idle(). This code assumed it was being called with interrupts disabled, when it was actually being called with them enabled. Pointed out by: tegge
Revision 1.140: download - view: text, markup, annotated - select for diffs
Fri Oct 20 07:43:55 2000 UTC (11 years, 3 months ago) by jhb
Branches: MAIN
Diff to: previous 1.139: preferred, colored
Changes since revision 1.139: +3 -3 lines
- machine/mutex.h -> sys/mutex.h - Use cpu_throw() instead of cpu_switch() during cpu_exit() since we don't need to save our previous state.
Revision 1.139: download - view: text, markup, annotated - select for diffs
Sun Oct 15 14:18:37 2000 UTC (11 years, 3 months ago) by phk
Branches: MAIN
Diff to: previous 1.138: preferred, colored
Changes since revision 1.138: +1 -2 lines
Remove unneeded #include <machine/clock.h>
Revision 1.138: download - view: text, markup, annotated - select for diffs
Thu Sep 7 01:32:43 2000 UTC (11 years, 5 months ago) by jasone
Branches: MAIN
Diff to: previous 1.137: preferred, colored
Changes since revision 1.137: +19 -34 lines
Major update to the way synchronization is done in the kernel. Highlights include: * Mutual exclusion is used instead of spl*(). See mutex(9). (Note: The alpha port is still in transition and currently uses both.) * Per-CPU idle processes. * Interrupts are run in their own separate kernel threads and can be preempted (i386 only). Partially contributed by: BSDi (BSD/OS) Submissions by (at least): cp, dfr, dillon, grog, jake, jhb, sheldonh
Revision 1.132.2.2: download - view: text, markup, annotated - select for diffs
Sat Aug 26 04:19:26 2000 UTC (11 years, 5 months ago) by yokota
Branches: old_RELENG_4
CVS tags: old_RELENG_4_3_BP, old_RELENG_4_3_0_RELEASE, old_RELENG_4_3, old_RELENG_4_2_0_RELEASE, old_RELENG_4_1_1_RELEASE
Diff to: previous 1.132.2.1: preferred, colored; branchpoint 1.132: preferred, colored
Changes since revision 1.132.2.1: +2 -1 lines
MFC: add option BROKEN_KEYBOARD_RESET to opt_reset.h. PR: conf/20806
Revision 1.137: download - view: text, markup, annotated - select for diffs
Fri Aug 11 09:05:11 2000 UTC (11 years, 6 months ago) by peter
Branches: MAIN
CVS tags: old_PRE_SMPNG
Diff to: previous 1.136: preferred, colored
Changes since revision 1.136: +9 -8 lines
Clean up some low level bootstrap code: - stop using the evil 'struct trapframe' argument for mi_startup() (formerly main()). There are much better ways of doing it. - do not use prepare_usermode() - setregs() in execve() will do it all for us as long as the p_md.md_regs pointer is set. (which is now done in machdep.c rather than init_main.c. The Alpha port did it this way all along and is much cleaner). - collect all the magic %cr0 etc register settings into one place and have the AP's call that instead of using magic numbers (!!) that keep changing over and over again. - Make it safe to call kthread_create() earlier, including during the device probe sequence. It doesn't need the callback mechanism that NetBSD's version uses. - kthreads created this way are root-less as they exist before the root filesystem is mounted. init(1) is set up so that it aquires the root pointers prior to running. If other kthreads want filesystem acccess we can make this code more generic. - set all threads start times once we have decided what time it is. - init uses a trampoline rather than the evil prepare_usermode() hack. - kern_descrip.c has a couple of tweaks to deal with forking when there is no rootdir or cwd etc. - adjust the early SYSINIT() sequence so that a few prereqisites are in place. eg: make sure the run queue is initialized before doing forks. With this, the USB code can easily create a kthread to do the device tree discovery. (I have tested it, it works nicely). There are still some open issues before this is truely useful. - tsleep() does not like working before the clock is running. It sort-of tries to spin wait, but it can do more useful things now. - stopping a kthread in kld code at unload time is "interesting" but we have a solution for that. The Alpha code needs no changes for this. It already uses pretty much the same strategies, but a little cleaner.
Revision 1.136: download - view: text, markup, annotated - select for diffs
Sat Jun 10 02:05:57 2000 UTC (11 years, 8 months ago) by peter
Branches: MAIN
Diff to: previous 1.135: preferred, colored
Changes since revision 1.135: +2 -1 lines
Add option BROKEN_KEYBOARD_RESET to an opt_*.h file
Revision 1.132.2.1: download - view: text, markup, annotated - select for diffs
Tue May 16 06:58:07 2000 UTC (11 years, 8 months ago) by dillon
Branches: old_RELENG_4
CVS tags: old_RELENG_4_1_0_RELEASE
Diff to: previous 1.132: preferred, colored
Changes since revision 1.132: +7 -7 lines
MFC the SMP cleanup.
Revision 1.135: download - view: text, markup, annotated - select for diffs
Fri May 5 09:58:03 2000 UTC (11 years, 9 months ago) by phk
Branches: MAIN
Diff to: previous 1.134: preferred, colored
Changes since revision 1.134: +2 -1 lines
Separate the struct bio related stuff out of <sys/buf.h> into <sys/bio.h>. <sys/bio.h> is now a prerequisite for <sys/buf.h> but it shall not be made a nested include according to bdes teachings on the subject of nested includes. Diskdrivers and similar stuff below specfs::strategy() should no longer need to include <sys/buf.> unless they need caching of data. Still a few bogus uses of struct buf to track down. Repocopy by: peter
Revision 1.134: download - view: text, markup, annotated - select for diffs
Tue Mar 28 07:16:18 2000 UTC (11 years, 10 months ago) by dillon
Branches: MAIN
Diff to: previous 1.133: preferred, colored
Changes since revision 1.133: +7 -7 lines
Commit major SMP cleanups and move the BGL (big giant lock) in the
syscall path inward. A system call may select whether it needs the MP
lock or not (the default being that it does need it).
A great deal of conditional SMP code for various deadended experiments
has been removed. 'cil' and 'cml' have been removed entirely, and the
locking around the cpl has been removed. The conditional
separately-locked fast-interrupt code has been removed, meaning that
interrupts must hold the CPL now (but they pretty much had to anyway).
Another reason for doing this is that the original separate-lock for
interrupts just doesn't apply to the interrupt thread mechanism being
contemplated.
Modifications to the cpl may now ONLY occur while holding the MP
lock. For example, if an otherwise MP safe syscall needs to mess with
the cpl, it must hold the MP lock for the duration and must (as usual)
save/restore the cpl in a nested fashion.
This is precursor work for the real meat coming later: avoiding having
to hold the MP lock for common syscalls and I/O's and interrupt threads.
It is expected that the spl mechanisms and new interrupt threading
mechanisms will be able to run in tandem, allowing a slow piecemeal
transition to occur.
This patch should result in a moderate performance improvement due to
the considerable amount of code that has been removed from the critical
path, especially the simplification of the spl*() calls. The real
performance gains will come later.
Approved by: jkh
Reviewed by: current, bde (exception.s)
Some work taken from: luoqi's patch
Revision 1.133: download - view: text, markup, annotated - select for diffs
Mon Mar 20 10:44:20 2000 UTC (11 years, 10 months ago) by phk
Branches: MAIN
Diff to: previous 1.132: preferred, colored
Changes since revision 1.132: +2 -2 lines
Remove B_READ, B_WRITE and B_FREEBUF and replace them with a new field in struct buf: b_iocmd. The b_iocmd is enforced to have exactly one bit set. B_WRITE was bogusly defined as zero giving rise to obvious coding mistakes. Also eliminate the redundant struct buf flag B_CALL, it can just as efficiently be done by comparing b_iodone to NULL. Should you get a panic or drop into the debugger, complaining about "b_iocmd", don't continue. It is likely to write on your disk where it should have been reading. This change is a step in the direction towards a stackable BIO capability. A lot of this patch were machine generated (Thanks to style(9) compliance!) Vinum users: Greg has not had time to test this yet, be careful.
Revision 1.132: download - view: text, markup, annotated - select for diffs
Sun Feb 20 20:50:59 2000 UTC (11 years, 11 months ago) by bsd
Branches: MAIN
CVS tags: old_RELENG_4_BP, old_RELENG_4_0_0_RELEASE
Branch point for: old_RELENG_4
Diff to: previous 1.131: preferred, colored
Changes since revision 1.131: +8 -1 lines
Don't forget to reset the hardware debug registers when a process that was using them exits. Don't allow a user process to cause the kernel to take a TRCTRAP on a user space address. Reviewed by: jlemon, sef Approved by: jkh
Revision 1.131: download - view: text, markup, annotated - select for diffs
Mon Dec 6 04:53:04 1999 UTC (12 years, 2 months ago) by luoqi
Branches: MAIN
Diff to: previous 1.130: preferred, colored
Changes since revision 1.130: +34 -20 lines
User ldt sharing.
Revision 1.130: download - view: text, markup, annotated - select for diffs
Sat Oct 30 07:37:01 1999 UTC (12 years, 3 months ago) by alc
Branches: MAIN
Diff to: previous 1.129: preferred, colored
Changes since revision 1.129: +3 -3 lines
The core of this patch is to vm/vm_page.h. The effects are two-fold: (1) to eliminate an extra (useless) level of indirection in half of the page queue accesses and (2) to use a single name for each queue throughout, instead of, e.g., "vm_page_queue_active" in some places and "vm_page_queues[PQ_ACTIVE]" in others. Reviewed by: dillon
Revision 1.129: download - view: text, markup, annotated - select for diffs
Fri Oct 29 18:08:35 1999 UTC (12 years, 3 months ago) by phk
Branches: MAIN
Diff to: previous 1.128: preferred, colored
Changes since revision 1.128: +1 -2 lines
useracc() the prequel:
Merge the contents (less some trivial bordering the silly comments)
of <vm/vm_prot.h> and <vm/vm_inherit.h> into <vm/vm.h>. This puts
the #defines for the vm_inherit_t and vm_prot_t types next to their
typedefs.
This paves the road for the commit to follow shortly: change
useracc() to use VM_PROT_{READ|WRITE} rather than B_{READ|WRITE}
as argument.
Revision 1.128: download - view: text, markup, annotated - select for diffs
Mon Oct 11 14:50:03 1999 UTC (12 years, 4 months ago) by peter
Branches: MAIN
Diff to: previous 1.127: preferred, colored
Changes since revision 1.127: +1 -3 lines
Zap unneeded #includes Submitted by: phk
Revision 1.127: download - view: text, markup, annotated - select for diffs
Mon Sep 20 19:08:47 1999 UTC (12 years, 4 months ago) by dillon
Branches: MAIN
Diff to: previous 1.126: preferred, colored
Changes since revision 1.126: +7 -4 lines
Fix bug in pipe code relating to writes of mmap'd but illegal address
spaces which cross a segment boundry in the page table. pmap_kextract()
is not designed for access to the user space portion of the page
table and cannot handle the null-page-directory-entry case.
The fix is to have vm_fault_quick() return a success or failure which
is then used to avoid calling pmap_kextract().
Revision 1.39.4.5: download - view: text, markup, annotated - select for diffs
Sun Sep 5 08:29:31 1999 UTC (12 years, 5 months ago) by peter
Branches: old_RELENG_2_1_0
Diff to: previous 1.39.4.4: preferred, colored; branchpoint 1.39: preferred, colored; next MAIN 1.40: preferred, colored
Changes since revision 1.39.4.4: +1 -1 lines
$Id$ -> $FreeBSD$
Revision 1.71.2.7: download - view: text, markup, annotated - select for diffs
Sun Sep 5 08:11:20 1999 UTC (12 years, 5 months ago) by peter
Branches: old_RELENG_2_2
Diff to: previous 1.71.2.6: preferred, colored; branchpoint 1.71: preferred, colored; next MAIN 1.72: preferred, colored
Changes since revision 1.71.2.6: +1 -1 lines
$Id$ -> $FreeBSD$
Revision 1.115.2.1: download - view: text, markup, annotated - select for diffs
Sun Aug 29 16:05:58 1999 UTC (12 years, 5 months ago) by peter
Branches: old_RELENG_3
CVS tags: old_RELENG_3_5_0_RELEASE, old_RELENG_3_4_0_RELEASE, old_RELENG_3_3_0_RELEASE
Diff to: previous 1.115: preferred, colored; next MAIN 1.116: preferred, colored
Changes since revision 1.115: +1 -1 lines
$Id$ -> $FreeBSD$
Revision 1.126: download - view: text, markup, annotated - select for diffs
Sat Aug 28 00:43:54 1999 UTC (12 years, 5 months ago) by peter
Branches: MAIN
Diff to: previous 1.125: preferred, colored
Changes since revision 1.125: +1 -1 lines
$Id$ -> $FreeBSD$
Revision 1.125: download - view: text, markup, annotated - select for diffs
Sat Jul 31 18:30:49 1999 UTC (12 years, 6 months ago) by alc
Branches: MAIN
Diff to: previous 1.124: preferred, colored
Changes since revision 1.124: +3 -3 lines
Change the type of vpgqueues::lcnt from "int *" to "int". The indirection served no purpose.
Revision 1.124: download - view: text, markup, annotated - select for diffs
Thu Jul 22 06:04:01 1999 UTC (12 years, 6 months ago) by alc
Branches: MAIN
Diff to: previous 1.123: preferred, colored
Changes since revision 1.123: +2 -2 lines
Reduce the number of "magic constants" used for page coloring by one: PQ_PRIME2 and PQ_PRIME3 are used to accomplish the same thing at different places in the kernel. Drop PQ_PRIME3.
Revision 1.123: download - view: text, markup, annotated - select for diffs
Thu Jul 1 13:21:35 1999 UTC (12 years, 7 months ago) by peter
Branches: MAIN
Diff to: previous 1.122: preferred, colored
Changes since revision 1.122: +3 -3 lines
Slight reorganization of kernel thread/process creation. Instead of using SYSINIT_KT() etc (which is a static, compile-time procedure), use a NetBSD-style kthread_create() interface. kproc_start is still available as a SYSINIT() hook. This allowed simplification of chunks of the sysinit code in the process. This kthread_create() is our old kproc_start internals, with the SYSINIT_KT fork hooks grafted in and tweaked to work the same as the NetBSD one. One thing I'd like to do shortly is get rid of nfsiod as a user initiated process. It makes sense for the nfs client code to create them on the fly as needed up to a user settable limit. This means that nfsiod doesn't need to be in /sbin and is always "available". This is a fair bit easier to do outside of the SYSINIT_KT() framework.
Revision 1.122: download - view: text, markup, annotated - select for diffs
Tue Jun 1 18:19:50 1999 UTC (12 years, 8 months ago) by jlemon
Branches: MAIN
Diff to: previous 1.121: preferred, colored
Changes since revision 1.121: +1 -14 lines
Unifdef VM86. Reviewed by: silence on on -current
Revision 1.121: download - view: text, markup, annotated - select for diffs
Mon Apr 19 14:14:13 1999 UTC (12 years, 9 months ago) by peter
Branches: MAIN
CVS tags: old_PRE_VFS_BIO_NFS_PATCH, old_PRE_SMP_VMSHARE, old_POST_VFS_BIO_NFS_PATCH, old_POST_SMP_VMSHARE
Diff to: previous 1.120: preferred, colored
Changes since revision 1.120: +1 -56 lines
unifdef -DVM_STACK - it's been on for a while for x86 and was checked and appeared to be working for the Alpha some time ago.
Revision 1.120: download - view: text, markup, annotated - select for diffs
Fri Feb 19 14:25:33 1999 UTC (12 years, 11 months ago) by luoqi
Branches: MAIN
CVS tags: old_PRE_NEWBUS, old_POST_NEWBUS
Diff to: previous 1.119: preferred, colored
Changes since revision 1.119: +2 -2 lines
Hide access to vmspace:vm_pmap with inline function vmspace_pmap(). This is the preparation step for moving pmap storage out of vmspace proper. Reviewed by: Alan Cox <alc@cs.rice.edu> Matthew Dillion <dillon@apollo.backplane.com>
Revision 1.119: download - view: text, markup, annotated - select for diffs
Tue Feb 16 10:49:48 1999 UTC (12 years, 11 months ago) by dfr
Branches: MAIN
Diff to: previous 1.118: preferred, colored
Changes since revision 1.118: +2 -1 lines
* Change sysctl from using linker_set to construct its tree using SLISTs. This makes it possible to change the sysctl tree at runtime. * Change KLD to find and register any sysctl nodes contained in the loaded file and to unregister them when the file is unloaded. Reviewed by: Archie Cobbs <archie@whistle.com>, Peter Wemm <peter@netplex.com.au> (well they looked at it anyway)
Revision 1.118: download - view: text, markup, annotated - select for diffs
Mon Feb 8 02:42:12 1999 UTC (13 years ago) by dillon
Branches: MAIN
Diff to: previous 1.117: preferred, colored
Changes since revision 1.117: +8 -4 lines
Adjust idle zero-page fill hysteresis based on tests. Use 2/3 and 4/5
zero-fill levels.
Adjust comment for ozfod in vmmeter.h - this counter represents
non-optimal ( on the fly ) zero fills, not prefills.
Revision 1.117: download - view: text, markup, annotated - select for diffs
Mon Feb 8 00:37:35 1999 UTC (13 years ago) by dillon
Branches: MAIN
Diff to: previous 1.116: preferred, colored
Changes since revision 1.116: +23 -19 lines
Rip out PQ_ZERO queue. PQ_ZERO functionality is now combined in with
PQ_FREE. There is little operational difference other then the kernel
being a few kilobytes smaller and the code being more readable.
* vm_page_select_free() has been *greatly* simplified.
* The PQ_ZERO page queue and supporting structures have been removed
* vm_page_zero_idle() revamped (see below)
PG_ZERO setting and clearing has been migrated from vm_page_alloc()
to vm_page_free[_zero]() and will eventually be guarenteed to remain
tracked throughout a page's life ( if it isn't already ).
When a page is freed, PG_ZERO pages are appended to the appropriate
tailq in the PQ_FREE queue while non-PG_ZERO pages are prepended.
When locating a new free page, PG_ZERO selection operates from within
vm_page_list_find() ( get page from end of queue instead of beginning
of queue ) and then only occurs in the nominal critical path case. If
the nominal case misses, both normal and zero-page allocation devolves
into the same _vm_page_list_find() select code without any specific
zero-page optimizations.
Additionally, vm_page_zero_idle() has been revamped. Hysteresis has been
added and zero-page tracking adjusted to conform with the other changes.
Currently hysteresis is set at 1/3 (lo) and 1/2 (hi) the number of free
pages. We may wish to increase both parameters as time permits. The
hysteresis is designed to avoid silly zeroing in borderline allocation/free
situations.
Revision 1.116: download - view: text, markup, annotated - select for diffs
Fri Jan 29 08:36:42 1999 UTC (13 years ago) by dillon
Branches: MAIN
Diff to: previous 1.115: preferred, colored
Changes since revision 1.115: +3 -3 lines
More -Wall / -Wcast-qual cleanup. Also, EXEC_SET can't use
C_DECLARE_MODULE due to the linker_file_sysinit() function
making modifications to the data.
Revision 1.115: download - view: text, markup, annotated - select for diffs
Wed Jan 6 23:05:37 1999 UTC (13 years, 1 month ago) by julian
Branches: MAIN
CVS tags: old_RELENG_3_BP, old_RELENG_3_2_PAO_BP, old_RELENG_3_2_PAO, old_RELENG_3_2_0_RELEASE, old_RELENG_3_1_0_RELEASE
Branch point for: old_RELENG_3
Diff to: previous 1.114: preferred, colored
Changes since revision 1.114: +18 -1 lines
Add (but don't activate) code for a special VM option to make downward growing stacks more general. Add (but don't activate) code to use the new stack facility when running threads, (specifically the linux threads support). This allows people to use both linux compiled linuxthreads, and also the native FreeBSD linux-threads port. The code is conditional on VM_STACK. Not using this will produce the old heavily tested system. Submitted by: Richard Seaman <dick@tar.com>
Revision 1.114: download - view: text, markup, annotated - select for diffs
Wed Dec 16 15:21:51 1998 UTC (13 years, 1 month ago) by bde
Branches: MAIN
Diff to: previous 1.113: preferred, colored
Changes since revision 1.113: +4 -4 lines
Removed bogus casts of USRSTACK and/or the other operand in binary expressions involving USRSTACK.
Revision 1.113: download - view: text, markup, annotated - select for diffs
Sat Oct 31 17:21:30 1998 UTC (13 years, 3 months ago) by peter
Branches: MAIN
Diff to: previous 1.112: preferred, colored
Changes since revision 1.112: +3 -2 lines
Add John Dyson's SYSCTL descriptions, and an export of more stats to a sysctl hierarchy (vm.stats.*). SYSCTL descriptions are only present in source, they do not get compiled into the binaries taking up memory.
Revision 1.112: download - view: text, markup, annotated - select for diffs
Tue Oct 13 08:24:33 1998 UTC (13 years, 4 months ago) by dg
Branches: MAIN
CVS tags: old_RELENG_3_0_0_RELEASE
Diff to: previous 1.111: preferred, colored
Changes since revision 1.111: +3 -3 lines
Fixed two potentially serious classes of bugs: 1) The vnode pager wasn't properly tracking the file size due to "size" being page rounded in some cases and not in others. This sometimes resulted in corrupted files. First noticed by Terry Lambert. Fixed by changing the "size" pager_alloc parameter to be a 64bit byte value (as opposed to a 32bit page index) and changing the pagers and their callers to deal with this properly. 2) Fixed a bogus type cast in round_page() and trunc_page() that caused some 64bit offsets and sizes to be scrambled. Removing the cast required adding casts at a few dozen callers. There may be problems with other bogus casts in close-by macros. A quick check seemed to indicate that those were okay, however.
Revision 1.111: download - view: text, markup, annotated - select for diffs
Mon Sep 28 03:34:39 1998 UTC (13 years, 4 months ago) by tegge
Branches: MAIN
Diff to: previous 1.110: preferred, colored
Changes since revision 1.110: +4 -1 lines
Initialize pcb_mpnest to 1 in the child process in cpu_fork(). This should fix the 50% idle problem that the ELF /sbin/init triggered. The problem appeared when the last context switch before a fork() call was due to the kernel faulting in user pages via normal page faults (e.g. copyin). Reviewed by: Peter Wemm <peter@netplex.com.au>
Revision 1.110: download - view: text, markup, annotated - select for diffs
Fri Sep 25 17:34:48 1998 UTC (13 years, 4 months ago) by peter
Branches: MAIN
Diff to: previous 1.109: preferred, colored
Changes since revision 1.109: +1 -478 lines
Goodbye BOUNCE_BUFFERS, for a hack it has served us well. The last consumer of this code (the old SCSI system) has left us and the CAM code does it's own bouncing. The isa dma system has been doing it's own bouncing for a while too. Reviewed by: core
Revision 1.109: download - view: text, markup, annotated - select for diffs
Tue Aug 18 07:46:58 1998 UTC (13 years, 5 months ago) by msmith
Branches: MAIN
Diff to: previous 1.108: preferred, colored
Changes since revision 1.108: +5 -3 lines
Presently there is only one `currentldt' variable for all cpus
in a SMP system. Unexpected things could happen if each cpu
has a different ldt setting and one cpu tries to use value
of currentldt set by another cpu.
The fix is to move currentldt to the per-cpu area. It includes
patches I filed in PR i386/6219 which are also user ldt related.
PR: i386/7591, i386/6219
Submitted by: Luoqi Chen <luoqi@watermarkgroup.com>
Revision 1.108: download - view: text, markup, annotated - select for diffs
Tue May 19 00:00:10 1998 UTC (13 years, 8 months ago) by tegge
Branches: MAIN
CVS tags: old_PRE_NOBDEV
Diff to: previous 1.107: preferred, colored
Changes since revision 1.107: +21 -4 lines
Disallow reading the current kernel stack. Only the user structure and the current registers should be accessible. Reviewed by: David Greenman <dg@root.com>
Revision 1.107: download - view: text, markup, annotated - select for diffs
Sun May 17 22:12:11 1998 UTC (13 years, 8 months ago) by tegge
Branches: MAIN
Diff to: previous 1.106: preferred, colored
Changes since revision 1.106: +88 -1 lines
Add forwarding of roundrobin to other cpus. This gives a more regular update of cpu usage as shown by top when one process is cpu bound (no system calls) while the system is otherwise idle (except for top). Don't attempt to switch to the BSP in boot(). If the system was idle when an interrupt caused a panic, this won't work. Instead, switch to the BSP in cpu_reset. Remove some spurious forward_statclock/forward_hardclock warnings.
Revision 1.71.2.6: download - view: text, markup, annotated - select for diffs
Sat May 16 14:47:46 1998 UTC (13 years, 8 months ago) by kato
Branches: old_RELENG_2_2
CVS tags: old_RELENG_2_2_8_RELEASE, old_RELENG_2_2_7_RELEASE
Diff to: previous 1.71.2.5: preferred, colored; branchpoint 1.71: preferred, colored
Changes since revision 1.71.2.5: +5 -3 lines
MFC: revision 1.106 (reboot mode setting).
Revision 1.106: download - view: text, markup, annotated - select for diffs
Sat May 16 14:44:11 1998 UTC (13 years, 8 months ago) by kato
Branches: MAIN
Diff to: previous 1.105: preferred, colored
Changes since revision 1.105: +5 -3 lines
Some of newer PC-98 may cause "Windows Protection Fault" when booting Windows 95 after rebooting FreeBSD without power off. In PC-98 system, reboot mode is set via I/O port 0x37 in cpu_reset(), and accessing of this port is the reason of the problem. To avnoid the fault, current status of reboot mode should be checked before accessing the I/O port.
Revision 1.71.2.5: download - view: text, markup, annotated - select for diffs
Wed May 6 19:04:14 1998 UTC (13 years, 9 months ago) by gibbs
Branches: old_RELENG_2_2
Diff to: previous 1.71.2.4: preferred, colored; branchpoint 1.71: preferred, colored
Changes since revision 1.71.2.4: +11 -1 lines
MFC autoconf.c: Add interrupt driven config hook mechanism. Split out mountroot and dumpconf code so it occurs after config hooks run. machdep.c: Clean out old DPT SWI mechanism. trap.c: Add CAM SWI mechanism, remove DPT SWI mechanism. userconfig.c: Remove DPTOPT. The dpt driver is now standard. vm_machdep.c: Add the VM SWI with hooks to call the bus dma code. busdma_machdep.c: Add bus dma functionality. Interrupt specification and attach changed to allow shared interrupts. Shared EISA interrupts don't work in -stable though because we need the new interrupt code from current. Match routines now deal with const strings.
Revision 1.105: download - view: text, markup, annotated - select for diffs
Mon Mar 23 19:52:42 1998 UTC (13 years, 10 months ago) by jlemon
Branches: MAIN
CVS tags: old_PRE_DEVFS_SLICE, old_POST_DEVFS_SLICE
Diff to: previous 1.104: preferred, colored
Changes since revision 1.104: +9 -1 lines
Add the ability to make real-mode BIOS calls from the kernel. Currently, everything is contained inside #ifdef VM86, so this option must be present in the config file to use this functionality. Thanks to Tor Egge, these changes should work on SMP machines. However, it may not be throughly SMP-safe. Currently, the only BIOS calls made are memory-sizing routines at bootup, these replace reading the RTC values.
Revision 1.104: download - view: text, markup, annotated - select for diffs
Tue Mar 17 09:10:05 1998 UTC (13 years, 10 months ago) by kato
Branches: MAIN
Diff to: previous 1.103: preferred, colored
Changes since revision 1.103: +4 -1 lines
Make EPSON_BOUNCEDMA a new-style option.
Revision 1.103: download - view: text, markup, annotated - select for diffs
Sat Mar 14 03:02:15 1998 UTC (13 years, 11 months ago) by tegge
Branches: MAIN
Diff to: previous 1.102: preferred, colored
Changes since revision 1.102: +3 -3 lines
Don't use the standard macros for disabling/enabling interrupt. On SMP systems, this left the mpintr_lock simplelock locked, causing further calls to disable_intr to deadlock or panic.
Revision 1.102: download - view: text, markup, annotated - select for diffs
Thu Mar 12 09:55:57 1998 UTC (13 years, 11 months ago) by bde
Branches: MAIN
Diff to: previous 1.101: preferred, colored
Changes since revision 1.101: +7 -5 lines
Fixed breakage of the !SMP case in vm_page_zero_idle() in the previous commit. Opportunities to clean pages were often missed, and leaving of the idle state was sometimes delayed until the next interrupt (after any that occurred while cleaning). Fixed an unstaticization, a syntax error and a style bug in the previous commit.
Revision 1.101: download - view: text, markup, annotated - select for diffs
Wed Feb 25 03:56:09 1998 UTC (13 years, 11 months ago) by dyson
Branches: MAIN
CVS tags: old_PRE_SOFTUPDATE, old_POST_SOFTUPDATE
Diff to: previous 1.100: preferred, colored
Changes since revision 1.100: +35 -29 lines
Fix page prezeroing for SMP, and fix some potential paging-in-progress hangs. The paging-in-progress diagnosis was a result of Tor Egge's excellent detective work. Submitted by: Partially from Tor Egge.
Revision 1.100: download - view: text, markup, annotated - select for diffs
Fri Feb 13 05:30:18 1998 UTC (13 years, 11 months ago) by bde
Branches: MAIN
Diff to: previous 1.99: preferred, colored
Changes since revision 1.99: +3 -1 lines
Ifdefed some npx code. npx should be optional again.
Revision 1.99: download - view: text, markup, annotated - select for diffs
Fri Feb 6 12:13:11 1998 UTC (14 years ago) by eivind
Branches: MAIN
Diff to: previous 1.98: preferred, colored
Changes since revision 1.98: +1 -2 lines
Back out DIAGNOSTIC changes.
Revision 1.98: download - view: text, markup, annotated - select for diffs
Wed Feb 4 22:32:13 1998 UTC (14 years ago) by eivind
Branches: MAIN
Diff to: previous 1.97: preferred, colored
Changes since revision 1.97: +2 -1 lines
Turn DIAGNOSTIC into a new-style option.
Revision 1.97: download - view: text, markup, annotated - select for diffs
Fri Jan 30 10:26:26 1998 UTC (14 years ago) by dyson
Branches: MAIN
Diff to: previous 1.96: preferred, colored
Changes since revision 1.96: +10 -3 lines
Make the bounce buffer code a little more robust when space isn't available. If there isn't bounce space available, the bounce code is disabled. This will allow most large systems to run properly when the bounce space is mistakenly allocated above 16MB.
Revision 1.96: download - view: text, markup, annotated - select for diffs
Thu Jan 22 17:29:32 1998 UTC (14 years ago) by dyson
Branches: MAIN
Diff to: previous 1.95: preferred, colored
Changes since revision 1.95: +3 -1 lines
VM level code cleanups. 1) Start using TSM. Struct procs continue to point to upages structure, after being freed. Struct vmspace continues to point to pte object and kva space for kstack. u_map is now superfluous. 2) vm_map's don't need to be reference counted. They always exist either in the kernel or in a vmspace. The vmspaces are managed by reference counts. 3) Remove the "wired" vm_map nonsense. 4) No need to keep a cache of kernel stack kva's. 5) Get rid of strange looking ++var, and change to var++. 6) Change more data structures to use our "zone" allocator. Added struct proc, struct vmspace and struct vnode. This saves a significant amount of kva space and physical memory. Additionally, this enables TSM for the zone managed memory. 7) Keep ioopt disabled for now. 8) Remove the now bogus "single use" map concept. 9) Use generation counts or id's for data structures residing in TSM, where it allows us to avoid unneeded restart overhead during traversals, where blocking might occur. 10) Account better for memory deficits, so the pageout daemon will be able to make enough memory available (experimental.) 11) Fix some vnode locking problems. (From Tor, I think.) 12) Add a check in ufs_lookup, to avoid lots of unneeded calls to bcmp. (experimental.) 13) Significantly shrink, cleanup, and make slightly faster the vm_fault.c code. Use generation counts, get rid of unneded collpase operations, and clean up the cluster code. 14) Make vm_zone more suitable for TSM. This commit is partially as a result of discussions and contributions from other people, including DG, Tor Egge, PHK, and probably others that I have forgotten to attribute (so let me know, if I forgot.) This is not the infamous, final cleanup of the vnode stuff, but a necessary step. Vnode mgmt should be correct, but things might still change, and there is still some missing stuff (like ioopt, and physical backing of non-merged cache files, debugging of layering concepts.)
Revision 1.71.2.4: download - view: text, markup, annotated - select for diffs
Tue Jan 20 12:47:33 1998 UTC (14 years ago) by tegge
Branches: old_RELENG_2_2
CVS tags: old_RELENG_2_2_6_RELEASE
Diff to: previous 1.71.2.3: preferred, colored; branchpoint 1.71: preferred, colored
Changes since revision 1.71.2.3: +2 -1 lines
MFC: Mark page as not free while zeroing it.
Revision 1.95: download - view: text, markup, annotated - select for diffs
Mon Jan 19 04:16:16 1998 UTC (14 years ago) by tegge
Branches: MAIN
Diff to: previous 1.94: preferred, colored
Changes since revision 1.94: +2 -1 lines
The removal of a page from the free queue in vm_page_zero_idle was imcomplete. Also set m->queue, in order to prevent vm_page_select_free from selecting the page being zeroed.
Revision 1.94: download - view: text, markup, annotated - select for diffs
Thu Jan 15 07:32:21 1998 UTC (14 years ago) by gibbs
Branches: MAIN
Diff to: previous 1.93: preferred, colored
Changes since revision 1.93: +11 -1 lines
Implementation of Bus DMA for FreeBSD-x86. This is sufficient to do page level bounce buffering, but there are still some issues left to address.
Revision 1.93: download - view: text, markup, annotated - select for diffs
Sat Dec 27 02:28:28 1997 UTC (14 years, 1 month ago) by peter
Branches: MAIN
Diff to: previous 1.92: preferred, colored
Changes since revision 1.92: +2 -1 lines
#include "opt_user_ldt.h" so that the #ifdef USER_LDT checks can work, as commented about at length in the PR audit trail. PR: 2412
Revision 1.92: download - view: text, markup, annotated - select for diffs
Thu Nov 20 19:41:20 1997 UTC (14 years, 2 months ago) by bde
Branches: MAIN
Diff to: previous 1.91: preferred, colored
Changes since revision 1.91: +5 -4 lines
Removed a duplicate (sloppy common-style) definition. Fixed some style bugs.
Revision 1.91: download - view: text, markup, annotated - select for diffs
Tue Nov 18 09:27:23 1997 UTC (14 years, 2 months ago) by bde
Branches: MAIN
Diff to: previous 1.90: preferred, colored
Changes since revision 1.90: +4 -1 lines
Don't #include <machine/smp.h> even in the SMP case. Fixed the one place that depended on it. The "bazillion warnings" mentioned in the log for rev.1.45 apparently aren't a problem any more. It is hard to be sure because the SIMPLELOCK_DEBUG option turns off (and breaks) things in the SMP case.
Revision 1.90: download - view: text, markup, annotated - select for diffs
Fri Oct 10 09:44:12 1997 UTC (14 years, 4 months ago) by peter
Branches: MAIN
Diff to: previous 1.89: preferred, colored
Changes since revision 1.89: +2 -1 lines
Convert the VM86 option from a global option to an option only depended on by the files that use it. Changing the VM86 option now only causes a recompile of a dozen files or so rather than the entire kernel.
Revision 1.71.2.3: download - view: text, markup, annotated - select for diffs
Sat Sep 13 16:18:53 1997 UTC (14 years, 5 months ago) by joerg
Branches: old_RELENG_2_2
CVS tags: old_RELENG_2_2_5_RELEASE
Diff to: previous 1.71.2.2: preferred, colored; branchpoint 1.71: preferred, colored
Changes since revision 1.71.2.2: +29 -1 lines
MFC: introduce a function is_physical_memory(), and use it to exclude the ``ISA memory hole'' from kernel coredumps.
Revision 1.89: download - view: text, markup, annotated - select for diffs
Sat Sep 13 16:12:04 1997 UTC (14 years, 5 months ago) by joerg
Branches: MAIN
Diff to: previous 1.88: preferred, colored
Changes since revision 1.88: +5 -5 lines
Revert the logic behind my last change, and use a function called `is_physical_memory()' now for the decision whether to dump some region of memory or not. Suggested by: davidg
Revision 1.88: download - view: text, markup, annotated - select for diffs
Wed Sep 10 12:31:28 1997 UTC (14 years, 5 months ago) by joerg
Branches: MAIN
Diff to: previous 1.87: preferred, colored
Changes since revision 1.87: +29 -1 lines
Do not ever try to coredump adapter memory regions. PR: 4486 Submitted by: tegge@idi.ntnu.no (Tor Egge) Implement a function is_adapter_memory() in order to determine what should nto be dumped at all. Currently, only populated with the ``ISA memory hole''. Adapter regions of other busses should be added.
Revision 1.87: download - view: text, markup, annotated - select for diffs
Tue Sep 2 20:05:31 1997 UTC (14 years, 5 months ago) by bde
Branches: MAIN
Diff to: previous 1.86: preferred, colored
Changes since revision 1.86: +1 -2 lines
Removed unused #includes.
Revision 1.86: download - view: text, markup, annotated - select for diffs
Tue Aug 26 18:10:34 1997 UTC (14 years, 5 months ago) by peter
Branches: MAIN
Diff to: previous 1.85: preferred, colored
Changes since revision 1.85: +13 -1 lines
Clean up the SMP AP bootstrap and eliminate the wretched idle procs. - We now have enough per-cpu idle context, the real idle loop has been revived (cpu's halt now with nothing to do). - Some preliminary support for running some operations outside the global lock (eg: zeroing "free but not yet zeroed pages") is present but appears to cause problems. Off by default. - the smp_active sysctl now behaves differently. It's merely a 'true/false' option. Setting smp_active to zero causes the AP's to halt in the idle loop and stop scheduling processes. - bootstrap is a lot safer. Instead of sharing a statically compiled in stack a number of times (which has caused lots of problems) and then abandoning it, we use the idle context to boot the AP's directly. This should help >2 cpu support since the bootlock stuff was in doubt. - print physical apic id in traps.. helps identify private pages getting out of sync. (You don't want to know how much hair I tore out with this!) More cleanup to follow, this is more of a checkpoint than a 'finished' thing.
Revision 1.85: download - view: text, markup, annotated - select for diffs
Sat Aug 9 00:02:56 1997 UTC (14 years, 6 months ago) by dyson
Branches: MAIN
Diff to: previous 1.84: preferred, colored
Changes since revision 1.84: +22 -4 lines
VM86 kernel support. Work done by BSDI, Jonathan Lemon <jlemon@americantv.com>, Mike Smith <msmith@gsoft.com.au>, Sean Eric Fagan <sef@kithrup.com>, and probably alot of others. Submitted by: Jnathan Lemon <jlemon@americantv.com>
Revision 1.84: download - view: text, markup, annotated - select for diffs
Sun Jul 20 08:37:24 1997 UTC (14 years, 6 months ago) by bde
Branches: MAIN
Diff to: previous 1.83: preferred, colored
Changes since revision 1.83: +1 -6 lines
Removed unused #includes.
Revision 1.83: download - view: text, markup, annotated - select for diffs
Thu Jun 26 02:04:34 1997 UTC (14 years, 7 months ago) by tegge
Branches: MAIN
CVS tags: old_WOLLMAN_MBUF, old_BP_WOLLMAN_MBUF
Diff to: previous 1.82: preferred, colored
Changes since revision 1.82: +1 -3 lines
Back out a bad commit.
Revision 1.82: download - view: text, markup, annotated - select for diffs
Wed Jun 25 19:49:45 1997 UTC (14 years, 7 months ago) by tegge
Branches: MAIN
Diff to: previous 1.81: preferred, colored
Changes since revision 1.81: +3 -1 lines
Block some interrupts during the call to pmap_zero_page in vm_page_zero_idle. This fixes some occurences of the problem reported in PR kern/3216: "panic: pmap_zero_page: CMAP busy"
Revision 1.81: download - view: text, markup, annotated - select for diffs
Sun Jun 22 16:03:40 1997 UTC (14 years, 7 months ago) by peter
Branches: MAIN
Diff to: previous 1.80: preferred, colored
Changes since revision 1.80: +1 -8 lines
Preliminary support for per-cpu data pages. This eliminates a lot of #ifdef SMP type code. Things like _curproc reside in a data page that is unique on each cpu, eliminating the expensive macros like: #define curproc (SMPcurproc[cpunumber()]) There are some unresolved bootstrap and address space sharing issues at present, but Steve is waiting on this for other work. There is still some strictly temporary code present that isn't exactly pretty. This is part of a larger change that has run into some bumps, this part is standalone so it should be safe. The temporary code goes away when the full idle cpu support is finished. Reviewed by: fsmp, dyson
Revision 1.80: download - view: text, markup, annotated - select for diffs
Wed May 7 20:19:18 1997 UTC (14 years, 9 months ago) by peter
Branches: MAIN
Diff to: previous 1.79: preferred, colored
Changes since revision 1.79: +36 -17 lines
clean up forked child creation. This is simplified also by having md_regs being struct trapframe *. Do a npxsave() if needed and copy the pcb rather than use the increasingly defunct savectx(). Copy %edi and %ebp explicitly. Submitted by: bde XXX npxproc could be declared in npx.h so the externs with smp fruit are not needed.
Revision 1.71.2.2: download - view: text, markup, annotated - select for diffs
Wed Apr 16 12:27:03 1997 UTC (14 years, 9 months ago) by kato
Branches: old_RELENG_2_2
CVS tags: old_RELENG_2_2_2_RELEASE
Diff to: previous 1.71.2.1: preferred, colored; branchpoint 1.71: preferred, colored
Changes since revision 1.71.2.1: +12 -10 lines
YAMFC (revision 1.79; use CPU reset port on PC-98).
Revision 1.79: download - view: text, markup, annotated - select for diffs
Wed Apr 16 12:11:37 1997 UTC (14 years, 9 months ago) by kato
Branches: MAIN
CVS tags: old_pre_smp_merge, old_post_smp_merge
Diff to: previous 1.78: preferred, colored
Changes since revision 1.78: +12 -10 lines
Use reset port before clearing page table in cpu_reset if PC98 is defined. Clearing page table could hang some new PC-98.
Revision 1.78: download - view: text, markup, annotated - select for diffs
Mon Apr 7 07:15:56 1997 UTC (14 years, 10 months ago) by peter
Branches: MAIN
Diff to: previous 1.77: preferred, colored
Changes since revision 1.77: +61 -37 lines
The biggie: Get rid of the UPAGES from the top of the per-process address space. (!) Have each process use the kernel stack and pcb in the kvm space. Since the stacks are at a different address, we cannot copy the stack at fork() and allow the child to return up through the function call tree to return to user mode - create a new execution context and have the new process begin executing from cpu_switch() and go to user mode directly. In theory this should speed up fork a bit. Context switch the tss_esp0 pointer in the common tss. This is a lot simpler since than swithching the gdt[GPROC0_SEL].sd.sd_base pointer to each process's tss since the esp0 pointer is a 32 bit pointer, and the sd_base setting is split into three different bit sections at non-aligned boundaries and requires a lot of twiddling to reset. The 8K of memory at the top of the process space is now empty, and unmapped (and unmappable, it's higher than VM_MAXUSER_ADDRESS). Simplity the pmap code to manage process contexts, we no longer have to double map the UPAGES, this simplifies and should measuably speed up fork(). The following parts came from John Dyson: Set PG_G on the UPAGES that are now in kernel context, and invalidate them when swapping them out. Move the upages object (upobj) from the vmspace to the proc structure. Now that the UPAGES (pcb and kernel stack) are out of user space, make rfork(..RFMEM..) do what was intended by sharing the vmspace entirely via reference counting rather than simply inheriting the mappings.
Revision 1.77: download - view: text, markup, annotated - select for diffs
Sat Mar 29 04:35:26 1997 UTC (14 years, 10 months ago) by bde
Branches: MAIN
Diff to: previous 1.76: preferred, colored
Changes since revision 1.76: +35 -25 lines
Don't keep cpu interrupts enabled during the lookup in vm_page_zero_idle(). Lookup isn't done every time the system goes idle now, but it can still take > 1800 instructions in the worst case, so if cpu interrupts are kept disabled then it might lose 20 characters of sio input at 115200 bps. Fixed style in vm_page_zero_idle().
Revision 1.76: download - view: text, markup, annotated - select for diffs
Sat Mar 22 04:28:16 1997 UTC (14 years, 10 months ago) by dyson
Branches: MAIN
Diff to: previous 1.75: preferred, colored
Changes since revision 1.75: +17 -2 lines
Decrease the latency/overhead in the prezero code when there is an adequate number of prezeroed pages.
Revision 1.75: download - view: text, markup, annotated - select for diffs
Sat Feb 22 09:33:01 1997 UTC (14 years, 11 months ago) by peter
Branches: MAIN
Diff to: previous 1.74: preferred, colored
Changes since revision 1.74: +1 -1 lines
Back out part 1 of the MCFH that changed $Id$ to $FreeBSD$. We are not ready for it yet.
Revision 1.74: download - view: text, markup, annotated - select for diffs
Mon Feb 10 02:06:35 1997 UTC (15 years ago) by dyson
Branches: MAIN
Diff to: previous 1.73: preferred, colored
Changes since revision 1.73: +1 -1 lines
This is the kernel Lite/2 commit. There are some requisite userland changes, so don't expect to be able to run the kernel as-is (very well) without the appropriate Lite/2 userland changes. The system boots and can mount UFS filesystems. Untested: ext2fs, msdosfs, NFS Known problems: Incorrect Berkeley ID strings in some files. Mount_std mounts will not work until the getfsent library routine is changed. Reviewed by: various people Submitted by: Jeffery Hsu <hsu@freebsd.org>
Revision 1.73: download - view: text, markup, annotated - select for diffs
Tue Jan 14 06:39:11 1997 UTC (15 years ago) by jkh
Branches: MAIN
Diff to: previous 1.72: preferred, colored
Changes since revision 1.72: +1 -1 lines
Make the long-awaited change from $Id$ to $FreeBSD$ This will make a number of things easier in the future, as well as (finally!) avoiding the Id-smashing problem which has plagued developers for so long. Boy, I'm glad we're not using sup anymore. This update would have been insane otherwise.
Revision 1.71.2.1: download - view: text, markup, annotated - select for diffs
Thu Jan 2 02:21:09 1997 UTC (15 years, 1 month ago) by se
Branches: old_RELENG_2_2
CVS tags: old_RELENG_2_2_1_RELEASE, old_RELENG_2_2_0_RELEASE
Diff to: previous 1.71: preferred, colored
Changes since revision 1.71: +16 -1 lines
Merge from -current: Copy LDT on fork, if necessary. Approved by: jkh
Revision 1.72: download - view: text, markup, annotated - select for diffs
Thu Jan 2 01:43:09 1997 UTC (15 years, 1 month ago) by se
Branches: MAIN
Diff to: previous 1.71: preferred, colored
Changes since revision 1.71: +16 -1 lines
Add code to copy the LDT, if required. This code was sent to me by Bruce Evans, and seems to fix some possible kernel panic in case of an execution error. It did not cause any problems on my system, but I did never observe the problem this patch is supposed to fix, anyway. This patch is a NOP, unless the kernel is built with "options USER_LDT", and doesn't affect the GENERIC kernel for this reason. I want to have it in 2.2: it fixes a bug ... Submitted by: bde
Revision 1.71: download - view: text, markup, annotated - select for diffs
Wed Oct 30 22:38:24 1996 UTC (15 years, 3 months ago) by asami
Branches: MAIN
CVS tags: old_RELENG_2_2_BP
Branch point for: old_RELENG_2_2
Diff to: previous 1.70: preferred, colored
Changes since revision 1.70: +16 -2 lines
More merge and update.
(1) deleted #if 0
pc98/pc98/mse.c
(2) hold per-unit I/O ports in ed_softc
pc98/pc98/if_ed.c
pc98/pc98/if_ed98.h
(3) merge more files by segregating changes into headers.
new file (moved from pc98/pc98):
i386/isa/aic_98.h
deleted:
well, it's already in the commit message so I won't repeat the
long list here ;)
Submitted by: The FreeBSD(98) Development Team
Revision 1.70: download - view: text, markup, annotated - select for diffs
Tue Oct 15 03:16:33 1996 UTC (15 years, 3 months ago) by dyson
Branches: MAIN
Diff to: previous 1.69: preferred, colored
Changes since revision 1.69: +2 -3 lines
Move much of the machine dependent code from vm_glue.c into pmap.c. Along with the improved organization, small proc fork performance is now about 5%-10% faster.
Revision 1.69: download - view: text, markup, annotated - select for diffs
Sat Sep 28 22:37:43 1996 UTC (15 years, 4 months ago) by dyson
Branches: MAIN
Diff to: previous 1.68: preferred, colored
Changes since revision 1.68: +2 -2 lines
Essentially rename pmap_update to be invltlb. It is a very machine dependent operation, and not really a correct name. invltlb and invlpg are more descriptive, and in the case of invlpg, a real opcode. Additionally, fix the tlb management code for 386 machines.
Revision 1.68: download - view: text, markup, annotated - select for diffs
Sun Sep 8 20:44:12 1996 UTC (15 years, 5 months ago) by dyson
Branches: MAIN
Diff to: previous 1.67: preferred, colored
Changes since revision 1.67: +9 -5 lines
Addition of page coloring support. Various levels of coloring are afforded. The default level works with minimal overhead, but one can also enable full, efficient use of a 512K cache. (Parameters can be generated to support arbitrary cache sizes also.)
Revision 1.67: download - view: text, markup, annotated - select for diffs
Fri Jul 12 04:11:10 1996 UTC (15 years, 7 months ago) by bde
Branches: MAIN
Diff to: previous 1.66: preferred, colored
Changes since revision 1.66: +3 -3 lines
Don't use NULL in non-pointer contexts.
Revision 1.39.4.4: download - view: text, markup, annotated - select for diffs
Thu Jun 20 08:08:29 1996 UTC (15 years, 7 months ago) by davidg
Branches: old_RELENG_2_1_0
CVS tags: old_RELENG_2_1_7_RELEASE, old_RELENG_2_1_6_RELEASE, old_RELENG_2_1_6_1_RELEASE, old_RELENG_2_1_5_RELEASE
Diff to: previous 1.39.4.3: preferred, colored; branchpoint 1.39: preferred, colored
Changes since revision 1.39.4.3: +4 -3 lines
Brough in fix from rev 1.66: account for non-page aligned buffers.
Revision 1.66: download - view: text, markup, annotated - select for diffs
Thu Jun 20 08:07:30 1996 UTC (15 years, 7 months ago) by davidg
Branches: MAIN
Diff to: previous 1.65: preferred, colored
Changes since revision 1.65: +4 -3 lines
Properly account for non-page aligned buffers.
Revision 1.39.4.3: download - view: text, markup, annotated - select for diffs
Thu Jun 20 01:55:54 1996 UTC (15 years, 7 months ago) by davidg
Branches: old_RELENG_2_1_0
Diff to: previous 1.39.4.2: preferred, colored; branchpoint 1.39: preferred, colored
Changes since revision 1.39.4.2: +21 -58 lines
Brought in the rewritten versions of vmapbuf/vunmapbuf from main branch. Not only is the code higher quality, but it also fixes a rounding/off-by- one bug that caused a panic when doing physio() with DIAGNOSTIC. This fix closes PR#1195.
Revision 1.65: download - view: text, markup, annotated - select for diffs
Thu Jun 20 01:47:21 1996 UTC (15 years, 7 months ago) by davidg
Branches: MAIN
Diff to: previous 1.64: preferred, colored
Changes since revision 1.64: +9 -13 lines
Minor KNF formatting change to vmapbuf() and vunmapbuf().
Revision 1.64: download - view: text, markup, annotated - select for diffs
Wed Jun 19 03:39:24 1996 UTC (15 years, 7 months ago) by dyson
Branches: MAIN
Diff to: previous 1.63: preferred, colored
Changes since revision 1.63: +16 -49 lines
Clean up vmapbuf and vunmapbuf significantly. The previous code was very rough.
Revision 1.63: download - view: text, markup, annotated - select for diffs
Sat May 18 03:36:22 1996 UTC (15 years, 8 months ago) by dyson
Branches: MAIN
Diff to: previous 1.62: preferred, colored
Changes since revision 1.62: +2 -2 lines
This set of commits to the VM system does the following, and contain contributions or ideas from Stephen McKay <syssgm@devetir.qld.gov.au>, Alan Cox <alc@cs.rice.edu>, David Greenman <davidg@freebsd.org> and me: More usage of the TAILQ macros. Additional minor fix to queue.h. Performance enhancements to the pageout daemon. Addition of a wait in the case that the pageout daemon has to run immediately. Slightly modify the pageout algorithm. Significant revamp of the pmap/fork code: 1) PTE's and UPAGES's are NO LONGER in the process's map. 2) PTE's and UPAGES's reside in their own objects. 3) TOTAL elimination of recursive page table pagefaults. 4) The page directory now resides in the PTE object. 5) Implemented pmap_copy, thereby speeding up fork time. 6) Changed the pv entries so that the head is a pointer and not an entire entry. 7) Significant cleanup of pmap_protect, and pmap_remove. 8) Removed significant amounts of machine dependent fork code from vm_glue. Pushed much of that code into the machine dependent pmap module. 9) Support more completely the reuse of already zeroed pages (Page table pages and page directories) as being already zeroed. Performance and code cleanups in vm_map: 1) Improved and simplified allocation of map entries. 2) Improved vm_map_copy code. 3) Corrected some minor problems in the simplify code. Implemented splvm (combo of splbio and splimp.) The VM code now seldom uses splhigh. Improved the speed of and simplified kmem_malloc. Minor mod to vm_fault to avoid using pre-zeroed pages in the case of objects with backing objects along with the already existant condition of having a vnode. (If there is a backing object, there will likely be a COW... With a COW, it isn't necessary to start with a pre-zeroed page.) Minor reorg of source to perhaps improve locality of ref.
Revision 1.62: download - view: text, markup, annotated - select for diffs
Thu May 2 14:19:55 1996 UTC (15 years, 9 months ago) by phk
Branches: MAIN
Diff to: previous 1.61: preferred, colored
Changes since revision 1.61: +2 -2 lines
removed:
CLBYTES PD_SHIFT PGSHIFT NBPG PGOFSET CLSIZELOG2 CLSIZE pdei()
ptei() kvtopte() ptetov() ispt() ptetoav() &c &c
new:
NPDEPG
Major macro cleanup.
Revision 1.61: download - view: text, markup, annotated - select for diffs
Thu May 2 10:43:06 1996 UTC (15 years, 9 months ago) by phk
Branches: MAIN
Diff to: previous 1.60: preferred, colored
Changes since revision 1.60: +21 -21 lines
First pass at cleaning up macros relating to pages, clusters and all that.
Revision 1.60: download - view: text, markup, annotated - select for diffs
Thu Apr 25 06:20:06 1996 UTC (15 years, 9 months ago) by phk
Branches: MAIN
Diff to: previous 1.59: preferred, colored
Changes since revision 1.59: +6 -7 lines
Fix cpu_fork for real. Suggested by: bde
Revision 1.59: download - view: text, markup, annotated - select for diffs
Thu Apr 18 21:34:28 1996 UTC (15 years, 9 months ago) by phk
Branches: MAIN
Diff to: previous 1.58: preferred, colored
Changes since revision 1.58: +4 -2 lines
Fix a bogon. cpu_fork & savectx ecpected cpu_switch to restore %eax, they shouldn't.
Revision 1.58: download - view: text, markup, annotated - select for diffs
Sun Apr 7 17:39:28 1996 UTC (15 years, 10 months ago) by bde
Branches: MAIN
Diff to: previous 1.57: preferred, colored
Changes since revision 1.57: +1 -2 lines
Removed never-used #includes of <machine/cpu.h>. Many were apparently copied from bad examples.
Revision 1.57: download - view: text, markup, annotated - select for diffs
Sun Mar 3 01:57:45 1996 UTC (15 years, 11 months ago) by jkh
Branches: MAIN
CVS tags: old_wollman_polling
Diff to: previous 1.56: preferred, colored
Changes since revision 1.56: +14 -1 lines
USER_LDT changes for the Willows TwinXPDK toolkit. Only tested with WINE since that's the only other USER_LDT using code that I know of. Submitted by: Gary Jennejohn <Gary.Jennejohn@munich.netsurf.de> Obtained from: {Origin of diffs may be someone else - I only rec'd them from Gary}
Revision 1.56: download - view: text, markup, annotated - select for diffs
Mon Feb 5 14:23:19 1996 UTC (16 years ago) by davidg
Branches: MAIN
Diff to: previous 1.55: preferred, colored
Changes since revision 1.55: +11 -9 lines
Unspam my changes in rev 1.54 that John spammed in rev 1.55.
Revision 1.55: download - view: text, markup, annotated - select for diffs
Sun Feb 4 22:09:12 1996 UTC (16 years ago) by dyson
Branches: MAIN
Diff to: previous 1.54: preferred, colored
Changes since revision 1.54: +9 -13 lines
Changed vm_fault_quick in vm_machdep.c to be global. Needed for new pipe code.
Revision 1.54: download - view: text, markup, annotated - select for diffs
Sun Feb 4 21:20:38 1996 UTC (16 years ago) by davidg
Branches: MAIN
Diff to: previous 1.53: preferred, colored
Changes since revision 1.53: +11 -9 lines
Rewrote cpu_fork so that it doesn't use pmap_activate, and removed pmap_activate since it's not used anymore. Changed cpu_fork so that it uses one line of inline assembly rather than calling mvesp() to get the current stack pointer. Removed mvesp() since it is no longer being used.
Revision 1.39.4.2: download - view: text, markup, annotated - select for diffs
Tue Jan 30 12:56:30 1996 UTC (16 years ago) by davidg
Branches: old_RELENG_2_1_0
Diff to: previous 1.39.4.1: preferred, colored; branchpoint 1.39: preferred, colored
Changes since revision 1.39.4.1: +3 -11 lines
Brought in fix from rev 1.27 of swtch.s: properly adjust the saved stack pointer to pop the return address.
Revision 1.53: download - view: text, markup, annotated - select for diffs
Tue Jan 30 12:54:21 1996 UTC (16 years ago) by davidg
Branches: MAIN
Diff to: previous 1.52: preferred, colored
Changes since revision 1.52: +3 -11 lines
savectx() strikes again: the saved stack pointer wasn't properly adjusted to remove the return address. It's only the frame pointer and luck that allowed the code to work at all.
Revision 1.39.4.1: download - view: text, markup, annotated - select for diffs
Mon Jan 29 12:28:28 1996 UTC (16 years ago) by davidg
Branches: old_RELENG_2_1_0
Diff to: previous 1.39: preferred, colored
Changes since revision 1.39: +2 -2 lines
Brought in changes from rev 1.26 of swtch.s and related changes: bugfix for savectx() returning garbage in %eax for the child.
Revision 1.52: download - view: text, markup, annotated - select for diffs
Tue Jan 23 02:39:17 1996 UTC (16 years ago) by davidg
Branches: MAIN
Diff to: previous 1.51: preferred, colored
Changes since revision 1.51: +2 -2 lines
Simplified savectx() a little and fixed a bug that caused it to return garbage in the child process rather than "1" like it is supposed to. Reviewed by: bde
Revision 1.51: download - view: text, markup, annotated - select for diffs
Fri Jan 19 03:57:43 1996 UTC (16 years ago) by dyson
Branches: MAIN
Diff to: previous 1.50: preferred, colored
Changes since revision 1.50: +14 -14 lines
Eliminated many redundant vm_map_lookup operations for vm_mmap. Speed up for vfs_bio -- addition of a routine bqrelse to greatly diminish overhead for merged cache. Efficiency improvement for vfs_cluster. It used to do alot of redundant calls to cluster_rbuild. Correct the ordering for vrele of .text and release of credentials. Use the selective tlb update for 486/586/P6. Numerous fixes to the size of objects allocated for files. Additionally, fixes in the various pagers. Fixes for proper positioning of vnode_pager_setsize in msdosfs and ext2fs. Fixes in the swap pager for exhausted resources. The pageout code will not as readily thrash. Change the page queue flags (PG_ACTIVE, PG_INACTIVE, PG_FREE, PG_CACHE) into page queue indices (PQ_ACTIVE, PQ_INACTIVE, PQ_FREE, PQ_CACHE), thereby improving efficiency of several routines. Eliminate even more unnecessary vm_page_protect operations. Significantly speed up process forks. Make vm_object_page_clean more efficient, thereby eliminating the pause that happens every 30seconds. Make sequential clustered writes B_ASYNC instead of B_DELWRI even in the case of filesystems mounted async. Fix a panic with busy pages when write clustering is done for non-VMIO buffers.
Revision 1.50: download - view: text, markup, annotated - select for diffs
Fri Jan 5 20:12:23 1996 UTC (16 years, 1 month ago) by wollman
Branches: MAIN
Diff to: previous 1.49: preferred, colored
Changes since revision 1.49: +3 -1 lines
Convert BOUNCE_BUFFERS and BOUNCEPAGES to new option scheme.
Revision 1.49: download - view: text, markup, annotated - select for diffs
Thu Dec 14 08:31:01 1995 UTC (16 years, 2 months ago) by phk
Branches: MAIN
Diff to: previous 1.48: preferred, colored
Changes since revision 1.48: +4 -36 lines
A Major staticize sweep. Generates a couple of warnings that I'll deal with later. A number of unused vars removed. A number of unused procs removed or #ifdefed.
Revision 1.48: download - view: text, markup, annotated - select for diffs
Mon Dec 11 04:55:01 1995 UTC (16 years, 2 months ago) by dyson
Branches: MAIN
Diff to: previous 1.47: preferred, colored
Changes since revision 1.47: +2 -1 lines
Changes to support 1Tb filesizes. Pages are now named by an (object,index) pair instead of (object,offset) pair.
Revision 1.47: download - view: text, markup, annotated - select for diffs
Sun Dec 10 13:36:34 1995 UTC (16 years, 2 months ago) by phk
Branches: MAIN
Diff to: previous 1.46: preferred, colored
Changes since revision 1.46: +23 -22 lines
Staticize and cleanup. remove a TON of #includes from machdep.
Revision 1.46: download - view: text, markup, annotated - select for diffs
Thu Dec 7 12:45:40 1995 UTC (16 years, 2 months ago) by davidg
Branches: MAIN
Diff to: previous 1.45: preferred, colored
Changes since revision 1.45: +9 -2 lines
Untangled the vm.h include file spaghetti.
Revision 1.45: download - view: text, markup, annotated - select for diffs
Mon Nov 20 12:10:09 1995 UTC (16 years, 2 months ago) by phk
Branches: MAIN
Diff to: previous 1.44: preferred, colored
Changes since revision 1.44: +3 -3 lines
Remove unused vars.
Revision 1.44: download - view: text, markup, annotated - select for diffs
Sat Nov 18 06:54:11 1995 UTC (16 years, 2 months ago) by bde
Branches: MAIN
Diff to: previous 1.43: preferred, colored
Changes since revision 1.43: +18 -9 lines
Fixed the type of vm_fault_quick() - don't convert types back and forth through bogus immediate types. Added prototypes.
Revision 1.43: download - view: text, markup, annotated - select for diffs
Sun Oct 1 20:10:20 1995 UTC (16 years, 4 months ago) by davidg
Branches: MAIN
Diff to: previous 1.42: preferred, colored
Changes since revision 1.42: +2 -2 lines
Insert zeroed pages at the head of the zero queue rather than at the tail. A measurable performance improvement results from the potential for the page to be partially cached when it is eventually used.
Revision 1.42: download - view: text, markup, annotated - select for diffs
Sun Sep 3 20:39:22 1995 UTC (16 years, 5 months ago) by dyson
Branches: MAIN
Diff to: previous 1.41: preferred, colored
Changes since revision 1.41: +20 -1 lines
Machine dependent routines to support pre-zeroed free pages. This significantly improves demand zero performance.
Revision 1.41: download - view: text, markup, annotated - select for diffs
Sat Jul 29 11:38:53 1995 UTC (16 years, 6 months ago) by bde
Branches: MAIN
Diff to: previous 1.40: preferred, colored
Changes since revision 1.40: +1 -3 lines
Eliminate sloppy common-style declarations. There should be none left for the LINT configuation.
Revision 1.40: download - view: text, markup, annotated - select for diffs
Thu Jul 13 08:47:29 1995 UTC (16 years, 7 months ago) by davidg
Branches: MAIN
Diff to: previous 1.39: preferred, colored
Changes since revision 1.39: +2 -1 lines
NOTE: libkvm, w, ps, 'top', and any other utility which depends on struct
proc or any VM system structure will have to be rebuilt!!!
Much needed overhaul of the VM system. Included in this first round of
changes:
1) Improved pager interfaces: init, alloc, dealloc, getpages, putpages,
haspage, and sync operations are supported. The haspage interface now
provides information about clusterability. All pager routines now take
struct vm_object's instead of "pagers".
2) Improved data structures. In the previous paradigm, there is constant
confusion caused by pagers being both a data structure ("allocate a
pager") and a collection of routines. The idea of a pager structure has
escentially been eliminated. Objects now have types, and this type is
used to index the appropriate pager. In most cases, items in the pager
structure were duplicated in the object data structure and thus were
unnecessary. In the few cases that remained, a un_pager structure union
was created in the object to contain these items.
3) Because of the cleanup of #1 & #2, a lot of unnecessary layering can now
be removed. For instance, vm_object_enter(), vm_object_lookup(),
vm_object_remove(), and the associated object hash list were some of the
things that were removed.
4) simple_lock's removed. Discussion with several people reveals that the
SMP locking primitives used in the VM system aren't likely the mechanism
that we'll be adopting. Even if it were, the locking that was in the code
was very inadequate and would have to be mostly re-done anyway. The
locking in a uni-processor kernel was a no-op but went a long way toward
making the code difficult to read and debug.
5) Places that attempted to kludge-up the fact that we don't have kernel
thread support have been fixed to reflect the reality that we are really
dealing with processes, not threads. The VM system didn't have complete
thread support, so the comments and mis-named routines were just wrong.
We now use tsleep and wakeup directly in the lock routines, for instance.
6) Where appropriate, the pagers have been improved, especially in the
pager_alloc routines. Most of the pager_allocs have been rewritten and
are now faster and easier to maintain.
7) The pagedaemon pageout clustering algorithm has been rewritten and
now tries harder to output an even number of pages before and after
the requested page. This is sort of the reverse of the ideal pagein
algorithm and should provide better overall performance.
8) Unnecessary (incorrect) casts to caddr_t in calls to tsleep & wakeup
have been removed. Some other unnecessary casts have also been removed.
9) Some almost useless debugging code removed.
10) Terminology of shadow objects vs. backing objects straightened out.
The fact that the vm_object data structure escentially had this
backwards really confused things. The use of "shadow" and "backing
object" throughout the code is now internally consistent and correct
in the Mach terminology.
11) Several minor bug fixes, including one in the vm daemon that caused
0 RSS objects to not get purged as intended.
12) A "default pager" has now been created which cleans up the transition
of objects to the "swap" type. The previous checks throughout the code
for swp->pg_data != NULL were really ugly. This change also provides
the rudiments for future backing of "anonymous" memory by something
other than the swap pager (via the vnode pager, for example), and it
allows the decision about which of these pagers to use to be made
dynamically (although will need some additional decision code to do
this, of course).
13) (dyson) MAP_COPY has been deprecated and the corresponding "copy
object" code has been removed. MAP_COPY was undocumented and non-
standard. It was furthermore broken in several ways which caused its
behavior to degrade to MAP_PRIVATE. Binaries that use MAP_COPY will
continue to work correctly, but via the slightly different semantics
of MAP_PRIVATE.
14) (dyson) Sharing maps have been removed. It's marginal usefulness in a
threads design can be worked around in other ways. Both #12 and #13
were done to simplify the code and improve readability and maintain-
ability. (As were most all of these changes)
TODO:
1) Rewrite most of the vnode pager to use VOP_GETPAGES/PUTPAGES. Doing
this will reduce the vnode pager to a mere fraction of its current size.
2) Rewrite vm_fault and the swap/vnode pagers to use the clustering
information provided by the new haspage pager interface. This will
substantially reduce the overhead by eliminating a large number of
VOP_BMAP() calls. The VOP_BMAP() filesystem interface should be
improved to provide both a "behind" and "ahead" indication of
contiguousness.
3) Implement the extended features of pager_haspage in swap_pager_haspage().
It currently just says 0 pages ahead/behind.
4) Re-implement the swap device (swstrategy) in a more elegant way, perhaps
via a much more general mechanism that could also be used for disk
striping of regular filesystems.
5) Do something to improve the architecture of vm_object_collapse(). The
fact that it makes calls into the swap pager and knows too much about
how the swap pager operates really bothers me. It also doesn't allow
for collapsing of non-swap pager objects ("unnamed" objects backed by
other pagers).
Revision 1.39: download - view: text, markup, annotated - select for diffs
Tue May 30 07:59:46 1995 UTC (16 years, 8 months ago) by rgrimes
Branches: MAIN
CVS tags: old_RELENG_2_1_0_RELEASE, old_RELENG_2_1_0_BP, old_RELENG_2_0_5_RELEASE, old_RELENG_2_0_5_BP, old_RELENG_2_0_5
Branch point for: old_RELENG_2_1_0
Diff to: previous 1.38: preferred, colored
Changes since revision 1.38: +12 -12 lines
Remove trailing whitespace.
Revision 1.38: download - view: text, markup, annotated - select for diffs
Thu May 18 09:17:07 1995 UTC (16 years, 8 months ago) by davidg
Branches: MAIN
CVS tags: old_RELENG_2_0_5_ALPHA
Diff to: previous 1.37: preferred, colored
Changes since revision 1.37: +4 -1 lines
Added "BROKEN_KEYBOARD_RESET" option to disable using the keyboard reset in cpu_reset(). Some MBs don't deal with this properly. Submitted by: Rod Grimes
Revision 1.37: download - view: text, markup, annotated - select for diffs
Mon May 1 23:32:30 1995 UTC (16 years, 9 months ago) by dyson
Branches: MAIN
Diff to: previous 1.36: preferred, colored
Changes since revision 1.36: +9 -27 lines
Fixed a problem that can cause left-over pv_entries and as as side-effect, removed some legacy code that was necessary when we called vm_fault inside of vm_fault_quick instead of using the kernel/user space byte move routines.
Revision 1.36: download - view: text, markup, annotated - select for diffs
Wed Apr 26 07:38:35 1995 UTC (16 years, 9 months ago) by rgrimes
Branches: MAIN
Diff to: previous 1.35: preferred, colored
Changes since revision 1.35: +14 -1 lines
Add outb to keyboard controller to do a cpu_reset, this fixes 2 known cases of motherboards that failed to reboot.
Revision 1.35: download - view: text, markup, annotated - select for diffs
Sun Mar 19 14:28:41 1995 UTC (16 years, 10 months ago) by davidg
Branches: MAIN
Diff to: previous 1.34: preferred, colored
Changes since revision 1.34: +4 -4 lines
Removed redundant newlines that were in some panic strings.
Revision 1.34: download - view: text, markup, annotated - select for diffs
Thu Mar 16 18:11:33 1995 UTC (16 years, 10 months ago) by bde
Branches: MAIN
Diff to: previous 1.33: preferred, colored
Changes since revision 1.33: +2 -3 lines
Add and move declarations to fix all of the warnings from `gcc -Wimplicit' (except in netccitt, netiso and netns) and most of the warnings from `gcc -Wnested-externs'. Fix all the bugs found. There were no serious ones.
Revision 1.33: download - view: text, markup, annotated - select for diffs
Wed Mar 1 23:59:21 1995 UTC (16 years, 11 months ago) by davidg
Branches: MAIN
Diff to: previous 1.32: preferred, colored
Changes since revision 1.32: +4 -8 lines
Use su/fubyte instead of directly touching the user's address space.
Revision 1.32: download - view: text, markup, annotated - select for diffs
Mon Feb 20 22:23:31 1995 UTC (16 years, 11 months ago) by davidg
Branches: MAIN
Diff to: previous 1.31: preferred, colored
Changes since revision 1.31: +3 -3 lines
Use of vm_allocate() and vm_deallocate() has been deprecated.
Revision 1.31: download - view: text, markup, annotated - select for diffs
Sat Jan 21 15:34:03 1995 UTC (17 years ago) by bde
Branches: MAIN
Diff to: previous 1.30: preferred, colored
Changes since revision 1.30: +3 -8 lines
Don't use mi_switch() to terminate cpu_exit(). Calling it just happened to work (mi_switch() counted the last timeslice again but this didn't affect the exiting process' rusage because the rusage has already been finalized). Remove stale comment.
Revision 1.30: download - view: text, markup, annotated - select for diffs
Mon Jan 9 16:04:40 1995 UTC (17 years, 1 month ago) by davidg
Branches: MAIN
Diff to: previous 1.29: preferred, colored
Changes since revision 1.29: +10 -4 lines
These changes embody the support of the fully coherent merged VM buffer cache, much higher filesystem I/O performance, and much better paging performance. It represents the culmination of over 6 months of R&D. The majority of the merged VM/cache work is by John Dyson. The following highlights the most significant changes. Additionally, there are (mostly minor) changes to the various filesystem modules (nfs, msdosfs, etc) to support the new VM/buffer scheme. vfs_bio.c: Significant rewrite of most of vfs_bio to support the merged VM buffer cache scheme. The scheme is almost fully compatible with the old filesystem interface. Significant improvement in the number of opportunities for write clustering. vfs_cluster.c, vfs_subr.c Upgrade and performance enhancements in vfs layer code to support merged VM/buffer cache. Fixup of vfs_cluster to eliminate the bogus pagemove stuff. vm_object.c: Yet more improvements in the collapse code. Elimination of some windows that can cause list corruption. vm_pageout.c: Fixed it, it really works better now. Somehow in 2.0, some "enhancements" broke the code. This code has been reworked from the ground-up. vm_fault.c, vm_page.c, pmap.c, vm_object.c Support for small-block filesystems with merged VM/buffer cache scheme. pmap.c vm_map.c Dynamic kernel VM size, now we dont have to pre-allocate excessive numbers of kernel PTs. vm_glue.c Much simpler and more effective swapping code. No more gratuitous swapping. proc.h Fixed the problem that the p_lock flag was not being cleared on a fork. swap_pager.c, vnode_pager.c Removal of old vfs_bio cruft to support the past pseudo-coherency. Now the code doesn't need it anymore. machdep.c Changes to better support the parameter values for the merged VM/buffer cache scheme. machdep.c, kern_exec.c, vm_glue.c Implemented a seperate submap for temporary exec string space and another one to contain process upages. This eliminates all map fragmentation problems that previously existed. ffs_inode.c, ufs_inode.c, ufs_readwrite.c Changes for merged VM/buffer cache. Add "bypass" support for sneaking in on busy buffers. Submitted by: John Dyson and David Greenman
Revision 1.29: download - view: text, markup, annotated - select for diffs
Sat Oct 8 22:19:51 1994 UTC (17 years, 4 months ago) by phk
Branches: MAIN
CVS tags: old_RELEASE_2_0, old_OLAH_TTCP, old_BETA_2_0, old_ALPHA_2_0
Diff to: previous 1.28: preferred, colored
Changes since revision 1.28: +8 -13 lines
db_disasm.c: Unused var zapped. pmap.c: tons of unused vars zapped, various other warnings silenced. trap.c: unused vars zapped. vm_machdep.c: A wrong argument, which by chance did the right thing, was corrected.
Revision 1.28: download - view: text, markup, annotated - select for diffs
Fri Sep 2 04:12:07 1994 UTC (17 years, 5 months ago) by davidg
Branches: MAIN
Diff to: previous 1.27: preferred, colored
Changes since revision 1.27: +2 -2 lines
Removed all vestiges of tlbflush(). Replaced them with calls to pmap_update(). Made pmap_update an inline assembly function.
Revision 1.27: download - view: text, markup, annotated - select for diffs
Wed Aug 31 06:17:33 1994 UTC (17 years, 5 months ago) by davidg
Branches: MAIN
Diff to: previous 1.26: preferred, colored
Changes since revision 1.26: +3 -3 lines
Rather than exclude bounce buffers support with NOBOUNCE, include it with BOUNCE_BUFFERS. This is more intuitive, and is better for future multiplatform support. Added BOUNCE_BUFFERS option to the GENERIC and LINT kernel config files.
Revision 1.26: download - view: text, markup, annotated - select for diffs
Sun Aug 7 14:53:11 1994 UTC (17 years, 6 months ago) by davidg
Branches: MAIN
Diff to: previous 1.25: preferred, colored
Changes since revision 1.25: +1 -6 lines
Made pmap_kenter "TLB safe". ...and then removed all the pmap_updates that are no longer needed because of this.
Revision 1.25: download - view: text, markup, annotated - select for diffs
Sun Aug 7 03:31:52 1994 UTC (17 years, 6 months ago) by davidg
Branches: MAIN
Diff to: previous 1.24: preferred, colored
Changes since revision 1.24: +20 -15 lines
Don't kremove process VM pages (oops!). This was the cause of the instability that was introduced last night. Submitted by: John Dyson
Revision 1.24: download - view: text, markup, annotated - select for diffs
Sat Aug 6 10:25:37 1994 UTC (17 years, 6 months ago) by davidg
Branches: MAIN
Diff to: previous 1.23: preferred, colored
Changes since revision 1.23: +2 -2 lines
Fixed various prototype problems with the pmap functions and the subsequent problems that fixing them caused.
Revision 1.23: download - view: text, markup, annotated - select for diffs
Sat Aug 6 09:20:56 1994 UTC (17 years, 6 months ago) by davidg
Branches: MAIN
Diff to: previous 1.22: preferred, colored
Changes since revision 1.22: +117 -487 lines
Incorporated 1.1.5 improvements to the bounce buffer code (i.e. make it actually work), and additionally improved it's performance via new pmap routines and "pbuf" allocation policy. Submitted by: John Dyson
Revision 1.22: download - view: text, markup, annotated - select for diffs
Wed May 25 08:55:23 1994 UTC (17 years, 8 months ago) by rgrimes
Branches: MAIN
Diff to: previous 1.21: preferred, colored
Changes since revision 1.21: +140 -45 lines
The big 4.4BSD Lite to FreeBSD 2.0.0 (Development) patch. Reviewed by: Rodney W. Grimes Submitted by: John Dyson and David Greenman
Revision 1.21: download - view: text, markup, annotated - select for diffs
Mon Apr 25 23:48:20 1994 UTC (17 years, 9 months ago) by davidg
Branches: MAIN
CVS tags: old_REL_before_johndavid_2_0_0, old_MOVED_NEWCVS
Diff to: previous 1.20: preferred, colored
Changes since revision 1.20: +20 -3 lines
From John Dyson: Fixed physio in the 386 case - write faults weren't properly implemented.
Revision 1.20: download - view: text, markup, annotated - select for diffs
Wed Apr 20 07:06:20 1994 UTC (17 years, 9 months ago) by davidg
Branches: MAIN
Diff to: previous 1.19: preferred, colored
Changes since revision 1.19: +100 -27 lines
Bug fixes and performance improvements from John Dyson and myself: 1) check va before clearing the page clean flag. Not doing so was causing the vnode pager error 5 messages when paging from NFS. (pmap.c) 2) put back interrupt protection in idle_loop. Bruce didn't think it was necessary, John insists that it is (and I agree). (swtch.s) 3) various improvements to the clustering code (vm_machdep.c). It's now enabled/used by default. 4) bad disk blocks are now handled properly when doing clustered IOs. (wd.c, vm_machdep.c) 5) bogus bad block handling fixed in wd.c. 6) algorithm improvements to the pageout/pagescan daemons. It's amazing how well 4MB machines work now.
Revision 1.19: download - view: text, markup, annotated - select for diffs
Thu Apr 14 07:49:40 1994 UTC (17 years, 10 months ago) by davidg
Branches: MAIN
Diff to: previous 1.18: preferred, colored
Changes since revision 1.18: +70 -137 lines
Changes from John Dyson and myself: 1) Removed all instances of disable_intr()/enable_intr() and changed them back to splimp/splx. The previous method was done to improve the performance, but Bruces recent changes to inline spl* have made this unnecessary. 2) Cleaned up vm_machdep.c considerably. Probably fixed a few bugs, too. 3) Added a new mechanism for collecting page statistics - now done by a new system process "pagescan". Previously this was done by the pageout daemon, but this proved to be impractical. 4) Improved the page usage statistics gathering mechanism - performance is much improved in small memory machines. 5) Modified mbuf.h to enable the support for an external free routine when using mbuf clusters. Added appropriate glue in various places to allow this to work. 6) Adapted a suggested change to the NFS code from Yuval Yurom to take advantage of #5. 7) Added fault/swap statistics support.
Revision 1.18: download - view: text, markup, annotated - select for diffs
Tue Apr 5 03:23:09 1994 UTC (17 years, 10 months ago) by davidg
Branches: MAIN
Diff to: previous 1.17: preferred, colored
Changes since revision 1.17: +467 -43 lines
from John Dyson: 1) fixed some bugs related to the bounce buffer code 2) vnode pager now supports clustered pageouts 3) experimental code for clustering all I/O via a new "cldisksort" 4) added >16MB check to Bustek driver 5) made some experimental algorithmic changes to the pageout daemon 6) fixed bugs in truncating mapped files (esp when mapped via NFS) 7) reorganized vnode pager I/O code
Revision 1.17: download - view: text, markup, annotated - select for diffs
Wed Mar 30 02:47:13 1994 UTC (17 years, 10 months ago) by davidg
Branches: MAIN
Diff to: previous 1.16: preferred, colored
Changes since revision 1.16: +10 -21 lines
Eliminated the "physstrat" wart and merged it into kern_physio.c. This patch also fixes a bug which causes a kernel VM leak.
Revision 1.16: download - view: text, markup, annotated - select for diffs
Wed Mar 30 02:17:47 1994 UTC (17 years, 10 months ago) by davidg
Branches: MAIN
Diff to: previous 1.15: preferred, colored
Changes since revision 1.15: +23 -12 lines
New routine "pmap_kenter", designed to take advantage of the special case of the kernel pmap.
Revision 1.15: download - view: text, markup, annotated - select for diffs
Thu Mar 24 23:12:35 1994 UTC (17 years, 10 months ago) by davidg
Branches: MAIN
Diff to: previous 1.14: preferred, colored
Changes since revision 1.14: +17 -12 lines
From John Dyson: performance improvements to the new bounce buffer code.
Revision 1.11.2.1: download - view: text, markup, annotated - select for diffs
Thu Mar 24 08:56:56 1994 UTC (17 years, 10 months ago) by rgrimes
Branches: old_BETA_1_1
CVS tags: old_GAMMA_1_1, old_FINAL_1_1
Diff to: previous 1.11: preferred, colored; next MAIN 1.12: preferred, colored
Changes since revision 1.11: +7 -8 lines
>From main branch: Changed dynamic stack grow code to grow by "SGROWSIZ" amount. Initially allocate SGROWSIZ amount of stack. Also set vm_ssize to the initial stack VM size. Increased DFLSSIZ stack rlimit default to 8MB.
Revision 1.14: download - view: text, markup, annotated - select for diffs
Wed Mar 23 09:15:06 1994 UTC (17 years, 10 months ago) by davidg
Branches: MAIN
Diff to: previous 1.13: preferred, colored
Changes since revision 1.13: +333 -1 lines
Bounce buffers. From John Dyson with help from me.
Revision 1.13: download - view: text, markup, annotated - select for diffs
Mon Mar 21 09:35:10 1994 UTC (17 years, 10 months ago) by davidg
Branches: MAIN
Diff to: previous 1.12: preferred, colored
Changes since revision 1.12: +7 -8 lines
Changed dynamic stack grow code to grow by "SGROWSIZ" amount. Initially allocate SGROWSIZ amount of stack. Also set vm_ssize to the initial stack VM size. Increased DFLSSIZ stack rlimit default to 8MB.
Revision 1.12: download - view: text, markup, annotated - select for diffs
Mon Mar 7 11:38:36 1994 UTC (17 years, 11 months ago) by davidg
Branches: MAIN
Diff to: previous 1.11: preferred, colored
Changes since revision 1.11: +1 -27 lines
1) "Pre-faulting" in of pages into process address space Eliminates vm_fault overhead on process startup and mmap referenced data for in-memory pages. (process startup time using in-memory segments *much* faster) 2) Even more efficient pmap code. Code partially cleaned up. More comments yet to follow. (generally more efficient pte management) 3) Pageout clustering ( in addition to the FreeBSD V1.1 pagein clustering.) (much faster paging performance on non-write behind disk subsystems, slightly faster performance on other systems.) 4) Slightly changed vm_pageout code for more efficiency and better statistics. Also, resist swapout a little more. (less likely to pageout a recently used page) 5) Slight improvement to the page table page trap efficiency. (generally faster system VM fault performance) 6) Defer creation of unnamed anonymous regions pager until needed. (speeds up shared memory bss creation) 7) Remove possible deadlock from swap_pager initialization. 8) Enhanced procfs to provide "vminfo" about vm objects and user pmaps. 9) Increased MCLSHIFT/MCLBYTES from 2K to 4K to improve net & socket performance and to prepare for things to come. John Dyson dyson@implode.root.com David Greenman davidg@root.com
Revision 1.11: download - view: text, markup, annotated - select for diffs
Tue Feb 8 09:26:04 1994 UTC (18 years ago) by davidg
Branches: MAIN
CVS tags: old_BP_BETA_1_1
Branch point for: old_BETA_1_1
Diff to: previous 1.10: preferred, colored
Changes since revision 1.10: +55 -1 lines
Fixed bugs in stack grow code, and moved it back into a seperate function like it was originally. Also added back call to "grow" in sendsig now that this routine actually works.
Revision 1.10: download - view: text, markup, annotated - select for diffs
Fri Jan 21 17:11:38 1994 UTC (18 years ago) by davidg
Branches: MAIN
Diff to: previous 1.9: preferred, colored
Changes since revision 1.9: +1 -93 lines
Remove some old, unused, major UGLY code.
Revision 1.9: download - view: text, markup, annotated - select for diffs
Fri Jan 14 16:23:42 1994 UTC (18 years ago) by davidg
Branches: MAIN
Diff to: previous 1.8: preferred, colored
Changes since revision 1.8: +17 -11 lines
"New" VM system from John Dyson & myself. For a run-down of the major changes, see the log of any effected file in the sys/vm directory (swap_pager.c for instance).
Revision 1.8: download - view: text, markup, annotated - select for diffs
Sun Dec 19 00:50:10 1993 UTC (18 years, 1 month ago) by wollman
Branches: MAIN
Diff to: previous 1.7: preferred, colored
Changes since revision 1.7: +5 -5 lines
Make everything compile with -Wtraditional. Make it easier to distribute a binary link-kit. Make all non-optional options (pagers, procfs) standard, and update LINT to reflect new symtab requirements. NB: -Wtraditional will henceforth be forgotten. This editing pass was primarily intended to detect any constructions where the old code might have been relying on traditional C semantics or syntax. These were all fixed, and the result of fixing some of them means that -Wall is now a realistic possibility within a few weeks.
Revision 1.7: download - view: text, markup, annotated - select for diffs
Thu Nov 25 01:31:02 1993 UTC (18 years, 2 months ago) by wollman
Branches: MAIN
Diff to: previous 1.6: preferred, colored
Changes since revision 1.6: +13 -2 lines
Make the LINT kernel compile with -W -Wreturn-type -Wcomment -Werror, and add same (sans -Werror) to Makefile for future compilations.
Revision 1.6: download - view: text, markup, annotated - select for diffs
Fri Oct 15 10:34:29 1993 UTC (18 years, 3 months ago) by rgrimes
Branches: MAIN
CVS tags: old_FINAL_1_0_2, old_FINAL_1_0, old_BRANCH_1_0
Diff to: previous 1.5: preferred, colored
Changes since revision 1.5: +9 -19 lines
genassym.c: Remove NKMEMCLUSTERS, it is no longer define or used. locores.s: Fix comment on PTDpde and APTDpde to be pde instead of pte Add new equation for calculating location of Sysmap Remove Bill's old #ifdef garbage for counting up memory, that stuff will never be made to work and was just cluttering up the file. Add code that places the PTD, page table pages, and kernel stack below the 640k ISA hole if there is room for it, otherwise put this stuff all at 1MB. This fixes the 28K bogusity in the boot blocks, that can now go away! Fix the caclulation of where first is to be dependent on NKPDE so that we can skip over the above mentioned areas. The 28K thing is now 44K in size due to the increase in kernel virtual memory space, but since we no longer have to worry about that this is no big deal. Use if NNPX > 0 instead of ifdef NPX for floating point code. machdep.c Change the calculation of for the buffer cache to be 20% of all memory above 2MB and add back the upper limit of 2/5's of the VM_KMEM_SIZE so that we do not eat ALL of the kernel memory space on large memory machines, note that this will not even come into effect unless you have more than 32MB. The current buffer cache limit is 6.7MB due to this caclulation. It seems that we where erroniously allocating bufpages pages for buffer_map. buffer_map is UNUSED in this implementation of the buffer cache, but since the map is referenced in several if statements a quick fix was to simply allocate 1 vm page (but no real memory) to it. pmap.h Remove rcsid, don't want them in the kernel files! Removed some cruft inside an #ifdef DEBUGx that caused compiler errors if you where compiling this for debug. Use the #defines for PD_SHIFT and PG_SHIFT in place of constants. trap.c: Remove patch kit header and rcsid, fix $Id$. Now include "npx.h" and use NNPX for controlling the floating point code. Remove a now completly invalid check for a maximum virtual address, the virtual address now ends at 0xFFFFFFFF so there is no more MAX!! (Thanks David, I completly missed that one!) vm_machdep.c Remove patch kit header and rcsid, fix $Id$. Now include "npx.h" and use NNPX for controlling the floating point code. Replace several 0xFE00000 constants with KERNBASE
Revision 1.5: download - view: text, markup, annotated - select for diffs
Fri Sep 10 22:14:37 1993 UTC (18 years, 5 months ago) by nate
Branches: MAIN
CVS tags: old_EPSILON_1_0
Diff to: previous 1.4: preferred, colored
Changes since revision 1.4: +8 -4 lines
Removed volatile functions which were causing grief in the system, since volatile functions are undefined, and there is no reason to have them in our kernel.
Revision 1.4: download - view: text, markup, annotated - select for diffs
Fri Sep 10 20:39:13 1993 UTC (18 years, 5 months ago) by rgrimes
Branches: MAIN
Diff to: previous 1.3: preferred, colored
Changes since revision 1.3: +3 -1 lines
This is just to shut the compiler up =================================================================== RCS file: /a/cvs/386BSD/src/sys/i386/i386/vm_machdep.c,v retrieving revision 1.3 diff -c -r1.3 vm_machdep.c *** 1.3 1993/07/27 10:52:21 --- vm_machdep.c 1993/09/10 20:12:53 *************** *** 179,184 **** --- 179,186 ---- #endif splclock(); swtch(); + /*NOTREACHED*/ + for(;;); } cpu_wait(p) struct proc *p; {
Revision 1.3: download - view: text, markup, annotated - select for diffs
Tue Jul 27 10:52:21 1993 UTC (18 years, 6 months ago) by davidg
Branches: MAIN
CVS tags: old_GAMMA_1_0, old_BETA_1_0
Diff to: previous 1.2: preferred, colored
Changes since revision 1.2: +10 -3 lines
* Applied fixes from Bruce Evans to fix COW bugs, >1MB kernel loading, profiling, and various protection checks that cause security holes and system crashes. * Changed min/max/bcmp/ffs/strlen to be static inline functions - included from cpufunc.h in via systm.h. This change improves performance in many parts of the kernel - up to 5% in the networking layer alone. Note that this requires systm.h to be included in any file that uses these functions otherwise it won't be able to find them during the load. * Fixed incorrect call to splx() in if_is.c * Fixed bogus variable assignment to splx() in if_ed.c
Revision 1.2: download - view: text, markup, annotated - select for diffs
Sun Jul 18 20:56:17 1993 UTC (18 years, 6 months ago) by paul
Branches: MAIN
CVS tags: old_ALPHA_1_0
Diff to: previous 1.1: preferred, colored
Changes since revision 1.1: +3 -1 lines
Added volatile void to cpu_exit() in the hope that it would stop warning about returning from gcc. It hasn't but the declaration is still correct.
Revision 1.1.1.1 (vendor branch): download - view: text, markup, annotated - select for diffs
Sat Jun 12 14:58:05 1993 UTC (18 years, 8 months ago) by rgrimes
CVS tags: old_V_0_1_2_4
Diff to: previous 1.1: preferred, colored
Changes since revision 1.1: +0 -0 lines
Initial import, 0.1 + pk 0.2.4-B1
Revision 1.1: download - view: text, markup, annotated - select for diffs
Sat Jun 12 14:58:04 1993 UTC (18 years, 8 months ago) by rgrimes
Branches: MAIN
Initial revision
