History log of /src/sys/arch/usermode/dev/cpu.c |
Revision | | Date | Author | Comments |
1.84 |
| 04-Oct-2023 |
ad | Eliminate l->l_ncsw and l->l_nivcsw. From memory think they were added before we had per-LWP struct rusage; the same is now tracked there.
|
1.83 |
| 03-Dec-2019 |
riastradh | Use __insn_barrier to enforce ordering in l_ncsw loops.
(Only need ordering observable by interruption, not by other CPUs.)
|
1.82 |
| 01-Dec-2019 |
ad | Make cpu_intr_p() safe to use anywhere, i.e. outside assertions:
Don't call kpreempt_disable() / kpreempt_enable() to make sure we're not preempted while using the value of curcpu(). Instead, observe the value of l_ncsw before and after the check to see if we have been preempted. If we have been preempted, then we need to retry the read.
|
1.81 |
| 23-Nov-2019 |
ad | cpu_need_resched():
- Remove all code that should be MI, leaving the bare minimum under arch/. - Make the required actions very explicit. - Pass in LWP pointer for convenience. - When a trap is required on another CPU, have the IPI set it locally. - Expunge cpu_did_resched().
|
1.80 |
| 01-Jun-2018 |
reinoud | branches: 1.80.2; Pass the address of the array, this fixes issues with i386 compilation
|
1.79 |
| 29-May-2018 |
reinoud | Only report the things we've passed in the mcontext and leave out flags that are not reported in the mcontext anyway!
|
1.78 |
| 29-May-2018 |
reinoud | Implement cpu_lwp_setprivate(). This removes the need for the cpu_switch() hack.
Programs with TLS work fine now, including gdb!
|
1.77 |
| 29-May-2018 |
reinoud | Only set requested parts of the mcontext in cpu_setmcontext() Make the atomic switcher `atomic' by using splhigh()
|
1.76 |
| 24-May-2018 |
reinoud | First try at TLS support and getcontext/setcontext/swapcontext support.
|
1.75 |
| 17-May-2018 |
reinoud | Refactor for easier debugging and while here add some more signals
|
1.74 |
| 01-Jun-2017 |
chs | branches: 1.74.8; remove checks for failure after memory allocation calls that cannot fail:
kmem_alloc() with KM_SLEEP kmem_zalloc() with KM_SLEEP percpu_alloc() pserialize_create() psref_class_create()
all of these paths include an assertion that the allocation has not failed, so callers should not assert that again.
|
1.73 |
| 24-Mar-2014 |
christos | branches: 1.73.6; use cpu_{g,s}etmodel
|
1.72 |
| 29-Jul-2012 |
mlelstv | branches: 1.72.2; 1.72.4; Do not call setroot() from MD code and from MI code, which has unwanted sideeffects in the RB_ASKNAME case. This fixes PR/46732.
No longer wrap MD cpu_rootconf(), as hp300 port stores reboot information as a side effect. Instead call MI rootconf() from MD code which makes rootconf() now a wrapper to setroot().
Adjust several MD routines to set the global booted_device,booted_partition variables instead of passing partial information to setroot().
Make cpu_rootconf(9) describe the calling order.
|
1.71 |
| 25-Jun-2012 |
reinoud | Implement dummy `cpu_mcontext_validate' to make it compile again. This function needs to be implemented in the target secton one day for extra security.
|
1.70 |
| 03-Mar-2012 |
reinoud | Implement signal forwarding to userland for usermode kernels. Especially SIGFPE is important since the urkel shouldn't stop when a userland program devides by zero!
|
1.69 |
| 21-Jan-2012 |
reinoud | branches: 1.69.2; Complete rewrite of the signal and spl framework for NetBSD/usermode
Signals are now moved from the sigaltstack ASAP and stacked on a replacement stack for each processes.
Preemption now works though could be enhanced a bit more
|
1.68 |
| 18-Jan-2012 |
reinoud | Create an atomic switchto() that has SIGALRM and SIGIO signals blocked that might otherwise disrupt the setting of curlwp to match the lwp context.
|
1.67 |
| 15-Jan-2012 |
jmcneill | sync disks and unmount at shutdown, and run shutdownhooks + pmf shutdown handlers
|
1.66 |
| 15-Jan-2012 |
jmcneill | allow specifing the root device with 'root=ldN' parameter
|
1.65 |
| 14-Jan-2012 |
reinoud | Reimplement userret() to also include AST for preemption.
Note it would be nice if we could do the check "are we going to userland?" in a less intrusive way.
|
1.64 |
| 14-Jan-2012 |
reinoud | Revamp the NetBSD/usermode pagefault and illegal instruction handing. It now can handle recursive entry and is a lot more memory tight compared to the old implementation. Performance wise:
* slightly less number of syscalls/sec possible though could be optimized * a lot faster context creation / destruction making overall operation faster.
|
1.63 |
| 12-Jan-2012 |
reinoud | Remove old comment about space not being freed; it is now done correctly so remove it to avoid confusion later.
|
1.62 |
| 06-Jan-2012 |
reinoud | Cleanup stack allocation and freeing. This means the memory leak on lwp destruction ought to be solved.
|
1.61 |
| 04-Jan-2012 |
reinoud | No reason why to have a larger pagefault stackframe for lwp0
|
1.60 |
| 04-Jan-2012 |
reinoud | Zero the memory we claim for the stacks
|
1.59 |
| 03-Jan-2012 |
reinoud | Use M_WAITOK instead of M_NOWAIT for the stack allocations
|
1.58 |
| 03-Jan-2012 |
reinoud | Rename the debug printf's to use a thunk_ prefix to avoid confusion.
|
1.57 |
| 27-Dec-2011 |
reinoud | Implement physio() for NetBSD/usermode the right way!
|
1.56 |
| 24-Dec-2011 |
reinoud | Implement cpu_getmcontext() and cpu_setmcontext()
|
1.55 |
| 15-Dec-2011 |
jmcneill | Improve usermode timecounter. It's unreasonable to assume that we'll get 100 "SIGALRM" per second with an ITIMER_REAL at 100Hz on a HZ=100 host as the timer may expire before a pending signal has been delivered.
Instead of setitimer, use timer_create + timer_settime and from our intr handler use timer_getoverrun to determine how many ticks we have missed.
|
1.54 |
| 15-Dec-2011 |
jmcneill | allocate msgbuf with kmem_zalloc instead of thunk_malloc, now dmesg works
|
1.53 |
| 15-Dec-2011 |
jmcneill | implement cpu idle via sigsuspend
|
1.52 |
| 14-Dec-2011 |
jmcneill | only need to setup altstack after fork, not in lwp tramp
|
1.51 |
| 14-Dec-2011 |
jmcneill | need to sigaltstack for each lwp
|
1.50 |
| 13-Dec-2011 |
reinoud | Just in case ease up the stack space a bit more
|
1.49 |
| 12-Dec-2011 |
reinoud | No need for such big stack spaces on lwp_fork() with the new setup.
|
1.48 |
| 11-Dec-2011 |
reinoud | Free the systemcall and pagefault stacks on lwp destroy.
XXX what about the main ucps stackspace that is used for the trampoline?
|
1.47 |
| 27-Nov-2011 |
reinoud | branches: 1.47.2; Big patch that changes the signal stack usage of urkel significantly.
Formerly, all signals came on the signal stack and the two important ones were then forwared to either the system call or the pagefault handler. This worked fine but the signal stack remains that, a stack. When we go multi-process this stack gets corrupted and out-of-order with all kind of nastyness since a userland process switch can occure when a system call is called or when a process gets a page fault.
The new scheme only uses the signal stack as a jumpboard. It swaps states and then returns from the signal, clearing the stack but instead of returning to the code it now jumpt to the handler and that handler then returns to the code when its finished.
|
1.46 |
| 14-Sep-2011 |
reinoud | branches: 1.46.2; Make stacksize of newly spawn lwp's bigger than one page. Actually use the variable stack_size now
|
1.45 |
| 10-Sep-2011 |
reinoud | Make cpu_lwp_trampo only jump once and make successive jumps go to the func only
|
1.44 |
| 09-Sep-2011 |
reinoud | Make the trampoline only jump once! All next calls are directed directly to the func specified.
|
1.43 |
| 09-Sep-2011 |
reinoud | Use the new thunk_makecontext() scheme with function and upto 3 aguments
|
1.42 |
| 09-Sep-2011 |
reinoud | Streamline makecontext() calls to really only specify the number of arguments to prevent side-effects
|
1.41 |
| 09-Sep-2011 |
reinoud | Clean up cpu_trampoline and link the context so we dont have to manually do that.
|
1.40 |
| 08-Sep-2011 |
reinoud | Use the machdep.h and now use the md_check_syscall_opcode()
|
1.39 |
| 08-Sep-2011 |
reinoud | Link syscall to userland so on exit is automatically goes to userland.
|
1.38 |
| 08-Sep-2011 |
reinoud | Cleanup syscall context creation
|
1.37 |
| 08-Sep-2011 |
jmcneill | get rid of clock softintr and move setitimer call to cpu_initclocks
|
1.36 |
| 08-Sep-2011 |
reinoud | White space
|
1.35 |
| 08-Sep-2011 |
reinoud | Create a ucontext for the system call to work in; its cloned from the new pcb's call `userland' ucontext.
|
1.34 |
| 06-Sep-2011 |
jmcneill | cpu_lwp_inkernel approach won't work, back to the drawing board
|
1.33 |
| 05-Sep-2011 |
jmcneill | Have the urkel maintain a 'cpu_lwp_inkernel' variable and read it from the urkelvisor to determine the origin of a syscall.
|
1.32 |
| 05-Sep-2011 |
reinoud | Restore errno just before switching to the new context and NOT after it got back again
|
1.31 |
| 05-Sep-2011 |
reinoud | Move kpreempt_enable/disable to splsched()
|
1.30 |
| 05-Sep-2011 |
reinoud | Disable kernel preemption in the critical section of cpu_switchto()
|
1.29 |
| 04-Sep-2011 |
reinoud | pcb->errno to pcb->pcb_errno
|
1.28 |
| 04-Sep-2011 |
reinoud | Try to preserve errno over traps and on context switches
|
1.27 |
| 03-Sep-2011 |
jmcneill | unbreak build on netbsd
|
1.26 |
| 03-Sep-2011 |
jmcneill | Get this compiling (but not quite linking yet) on Linux
|
1.25 |
| 03-Sep-2011 |
reinoud | Oops forgot to commit this one
|
1.24 |
| 02-Sep-2011 |
reinoud | Update trapframe and add system call switchframe
|
1.23 |
| 29-Aug-2011 |
reinoud | Dirty commit of machdep.c and cpu.c
|
1.22 |
| 28-Aug-2011 |
jmcneill | cpu_reboot: only call thunk_abort if RB_DUMP is set
|
1.21 |
| 28-Aug-2011 |
reinoud | Jump to `userland' or the other function specified in the pcb's ucontext
|
1.20 |
| 28-Aug-2011 |
jmcneill | cpu_lwp_trampoline isn't supposed to return, so drop the atexit handler and drop a panic() at the end of the function
|
1.19 |
| 27-Aug-2011 |
jmcneill | defflag CPU_DEBUG
|
1.18 |
| 27-Aug-2011 |
reinoud | Print when the cpu_trampoline is called()
|
1.17 |
| 27-Aug-2011 |
jmcneill | CPU_DEBUG: remove printf in cpu_signotify, and print pid/lid in cpu_switchto
|
1.16 |
| 24-Aug-2011 |
jmcneill | make room for a small msgbuf
|
1.15 |
| 13-Aug-2011 |
jmcneill | lwp0pcb should be struct pcb not ucontext_t, and initialize it in cpu_startup instead of cpu_attach
|
1.14 |
| 13-Aug-2011 |
jmcneill | no need to print copyright/version/memory info, just call banner()
|
1.13 |
| 13-Aug-2011 |
jmcneill | - initialize cpu_info_primary early, before cpu0 attaches - track idepth in cpu_info struct and use it in cpu_intr_p - for debug and diagnostic kernels, abort when rebooting - fill in __cpu_simple_lock_* stubs - splraise(IPL_HIGH) before calling kernmain - pmap_extract: only return phys addr if pap is not NULL
|
1.12 |
| 12-Aug-2011 |
jmcneill | add a simple disk driver, pass the path to the disk image on the kernel command line:
soundwave$ ./netbsd /tmp/test.fs NetBSD/usermode startup [...] ld0 at mainbus0: /tmp/test.fs (33554432) ld0: 32768 KB, 8322 cyl, 64 head, 63 sec, 1 bytes/sect x 33554432 sectors boot device: ld0 root on ld0a dumps on ld0b
|
1.11 |
| 12-Aug-2011 |
jmcneill | implement reboot using execv
|
1.10 |
| 12-Aug-2011 |
jmcneill | Clean up extern mess by adding an API for kernel components to call libc functions. thunk.c is built with special cflags that makes it compile against standard system headers instead of kernel ones.
|
1.9 |
| 11-Aug-2011 |
jmcneill | initialize lwp0 l_addr so we can switch back to it
|
1.8 |
| 10-Aug-2011 |
jmcneill | fix build
|
1.7 |
| 08-Feb-2010 |
joerg | Remove separate mb_map. The nmbclusters is computed at boot time based on the amount of physical memory and limited by NMBCLUSTERS if present. Architectures without direct mapping also limit it based on the kmem_map size, which is used as backing store. On i386 and ARM, the maximum KVA used for mbuf clusters is limited to 64MB by default.
The old default limits and limits based on GATEWAY have been removed. key_registered_sb_max is hard-wired to a value derived from 2048 clusters.
|
1.6 |
| 27-Nov-2009 |
rmind | branches: 1.6.2; - Use uvm_lwp_setuarea() instead of directly setting address to lwp_t::l_addr. - Replace most remaining uses of l_addr with uvm_lwp_getuarea() or lwp_getpcb(). - Amend assembly in ports where it accesses PCB via struct user. - Rename L_ADDR to L_PCB in few places. Reduce sys/user.h inclusions.
|
1.5 |
| 21-Nov-2009 |
rmind | Catch-up Xen and usermode with lwp_getpcb() and unbreak Xen build.
|
1.4 |
| 21-Oct-2009 |
snj | Drop 3rd and 4th clauses. OK jmcneill (copyright holder).
|
1.3 |
| 11-Aug-2009 |
matt | Remove all declarations of physmem from sys/arch. Add an include of <sys/systm.h> to the one file that did not already contain it. This now means that physmem can be changed by updating systm.h and uvm_page.c (excluding fixing printfs)
|
1.2 |
| 12-Feb-2008 |
joerg | branches: 1.2.2; 1.2.12; Introduce device_find_by_xname and device_find_by_driver_unit to replace alldevs iterations all over src.
Patch discussed with and improved on suggestioned from cube@.
|
1.1 |
| 29-Dec-2007 |
jmcneill | branches: 1.1.2; 1.1.4; 1.1.6; Import work-in-progress NetBSD/usermode port.
|
1.1.6.3 |
| 27-Feb-2008 |
yamt | sync with head.
|
1.1.6.2 |
| 21-Jan-2008 |
yamt | sync with head
|
1.1.6.1 |
| 29-Dec-2007 |
yamt | file cpu.c was added on branch yamt-lazymbuf on 2008-01-21 09:39:44 +0000
|
1.1.4.3 |
| 23-Mar-2008 |
matt | sync with HEAD
|
1.1.4.2 |
| 09-Jan-2008 |
matt | sync with HEAD
|
1.1.4.1 |
| 29-Dec-2007 |
matt | file cpu.c was added on branch matt-armv6 on 2008-01-09 01:49:20 +0000
|
1.1.2.2 |
| 02-Jan-2008 |
bouyer | Sync with HEAD
|
1.1.2.1 |
| 29-Dec-2007 |
bouyer | file cpu.c was added on branch bouyer-xeni386 on 2008-01-02 21:50:43 +0000
|
1.2.12.2 |
| 11-Mar-2010 |
yamt | sync with head
|
1.2.12.1 |
| 19-Aug-2009 |
yamt | sync with head.
|
1.2.2.2 |
| 18-Feb-2008 |
mjf | Sync with HEAD.
|
1.2.2.1 |
| 12-Feb-2008 |
mjf | file cpu.c was added on branch mjf-devfs on 2008-02-18 21:05:12 +0000
|
1.6.2.1 |
| 30-Apr-2010 |
uebayasi | Sync with HEAD.
|
1.46.2.3 |
| 22-May-2014 |
yamt | sync with head.
for a reference, the tree before this commit was tagged as yamt-pagecache-tag8.
this commit was splitted into small chunks to avoid a limitation of cvs. ("Protocol error: too many arguments")
|
1.46.2.2 |
| 30-Oct-2012 |
yamt | sync with head
|
1.46.2.1 |
| 17-Apr-2012 |
yamt | sync with head
|
1.47.2.4 |
| 06-Mar-2012 |
mrg | sync to -current
|
1.47.2.3 |
| 06-Mar-2012 |
mrg | sync to -current
|
1.47.2.2 |
| 04-Mar-2012 |
mrg | sync to latest -current.
|
1.47.2.1 |
| 18-Feb-2012 |
mrg | merge to -current.
|
1.69.2.3 |
| 08-Aug-2012 |
martin | Pull up following revision(s) (requested by mlelstv in ticket #466): sys/arch/amiga/amiga/autoconf.c: revision 1.113 sys/arch/rs6000/rs6000/autoconf.c: revision 1.4 sys/arch/emips/emips/autoconf.c: revision 1.6 sys/arch/sandpoint/sandpoint/autoconf.c: revision 1.27 sys/arch/evbmips/alchemy/autoconf.c: revision 1.18 sys/arch/sgimips/sgimips/autoconf.c: revision 1.43 sys/arch/atari/atari/autoconf.c: revision 1.63 sys/arch/powerpc/oea/ofw_autoconf.c: revision 1.17 sys/arch/mmeye/mmeye/autoconf.c: revision 1.9 distrib/sets/lists/comp/mi: revision 1.1771 sys/arch/mipsco/mipsco/autoconf.c: revision 1.25 sys/arch/iyonix/iyonix/autoconf.c: revision 1.14 sys/arch/hp300/hp300/autoconf.c: revision 1.100 sys/kern/init_main.c: revision 1.445 sys/arch/pmax/pmax/autoconf.c: revision 1.79 sys/arch/netwinder/netwinder/autoconf.c: revision 1.11 sys/arch/dreamcast/dreamcast/autoconf.c: revision 1.10 sys/arch/ibmnws/ibmnws/autoconf.c: revision 1.12 sys/arch/evbppc/ev64260/autoconf.c: revision 1.17 sys/arch/evbmips/gdium/autoconf.c: revision 1.5 sys/arch/algor/algor/autoconf.c: revision 1.21 share/man/man9/Makefile: revision 1.367 sys/arch/ews4800mips/ews4800mips/autoconf.c: revision 1.9 sys/arch/amigappc/amigappc/autoconf.c: revision 1.5 sys/arch/x86/x86/x86_autoconf.c: revision 1.65 sys/arch/acorn26/acorn26/autoconf.c: revision 1.9 sys/arch/mvmeppc/mvmeppc/autoconf.c: revision 1.13 sys/arch/vax/vax/autoconf.c: revision 1.94 sys/arch/usermode/dev/cpu.c: revision 1.72 sys/arch/evbppc/virtex/autoconf.c: revision 1.5 sys/arch/next68k/next68k/autoconf.c: revision 1.26 sys/arch/mac68k/mac68k/autoconf.c: revision 1.73 sys/arch/ia64/ia64/autoconf.c: revision 1.6 sys/arch/evbppc/obs405/obs405_autoconf.c: revision 1.6 share/man/man9/cpu_rootconf.9: revision 1.7 sys/arch/landisk/landisk/autoconf.c: revision 1.6 sys/arch/evbmips/malta/autoconf.c: revision 1.16 sys/arch/sun3/sun3/autoconf.c: revision 1.76 sys/arch/evbppc/explora/autoconf.c: revision 1.13 sys/arch/sun3/sun3/autoconf.c: revision 1.77 sys/arch/evbmips/loongson/autoconf.c: revision 1.3 sys/arch/evbmips/atheros/autoconf.c: revision 1.11 sys/arch/sparc64/sparc64/autoconf.c: revision 1.188 sys/arch/acorn32/acorn32/autoconf.c: revision 1.18 sys/arch/evbarm/evbarm/autoconf.c: revision 1.13 sys/arch/cobalt/cobalt/autoconf.c: revision 1.30 sys/arch/mvme68k/mvme68k/autoconf.c: revision 1.46 sys/arch/hp700/hp700/autoconf.c: revision 1.48 sys/arch/evbmips/adm5120/autoconf.c: revision 1.5 sys/arch/hpcmips/hpcmips/autoconf.c: revision 1.25 sys/arch/alpha/alpha/autoconf.c: revision 1.52 sys/arch/sparc/sparc/autoconf.c: revision 1.244 sys/arch/evbppc/pmppc/autoconf.c: revision 1.7 sys/arch/bebox/bebox/autoconf.c: revision 1.25 sys/arch/luna68k/luna68k/autoconf.c: revision 1.13 sys/arch/hpcarm/hpcarm/autoconf.c: revision 1.20 sys/arch/evbppc/walnut/autoconf.c: revision 1.21 sys/arch/cesfic/cesfic/autoconf.c: revision 1.26 sys/arch/cats/cats/autoconf.c: revision 1.17 sys/arch/x68k/x68k/autoconf.c: revision 1.67 sys/arch/news68k/news68k/autoconf.c: revision 1.21 sys/arch/arc/arc/autoconf.c: revision 1.34 sys/arch/evbsh3/evbsh3/autoconf.c: revision 1.11 sys/sys/conf.h: revision 1.143 sys/arch/evbmips/rasoc/autoconf.c: revision 1.3 sys/arch/hpcsh/hpcsh/autoconf.c: revision 1.26 sys/arch/sun68k/sun68k/autoconf.c: revision 1.29 sys/arch/evbmips/rmixl/autoconf.c: revision 1.6 sys/arch/zaurus/zaurus/autoconf.c: revision 1.12 sys/arch/xen/x86/autoconf.c: revision 1.15 sys/arch/evbppc/mpc85xx/autoconf.c: revision 1.6 sys/arch/shark/shark/autoconf.c: revision 1.18 sys/arch/prep/prep/autoconf.c: revision 1.25 sys/arch/newsmips/newsmips/autoconf.c: revision 1.36 sys/arch/sbmips/sbmips/autoconf.c: revision 1.8 Do not call setroot() from MD code and from MI code, which has unwanted sideeffects in the RB_ASKNAME case. This fixes PR/46732. No longer wrap MD cpu_rootconf(), as hp300 port stores reboot information as a side effect. Instead call MI rootconf() from MD code which makes rootconf() now a wrapper to setroot(). Adjust several MD routines to set the global booted_device,booted_partition variables instead of passing partial information to setroot(). Make cpu_rootconf(9) describe the calling order. add rootconf(9) as a link to cpu_rootconf(9) make this compile again
|
1.69.2.2 |
| 02-Jul-2012 |
jdc | Pull up revision 1.71 (requested by reinoud in ticket #377).
Implement dummy `cpu_mcontext_validate' to make it compile again. This function needs to be implemented in the target secton one day for extra security.
|
1.69.2.1 |
| 07-Mar-2012 |
riz | Pull up following revision(s) (requested by reinoud in ticket #89): sys/arch/usermode/usermode/thunk.c: revision 1.81 sys/arch/usermode/target/i386/cpu_i386.c: revision 1.4 sys/arch/usermode/include/thunk.h: revision 1.61 sys/arch/usermode/include/intr.h: revision 1.9 sys/arch/usermode/dev/cpu.c: revision 1.70 sys/arch/usermode/dev/ttycons.c: revision 1.19 sys/arch/usermode/usermode/trap.c: revision 1.64 Implement signal forwarding to userland for usermode kernels. Especially SIGFPE is important since the urkel shouldn't stop when a userland program devides by zero!
|
1.72.4.1 |
| 18-May-2014 |
rmind | sync with head
|
1.72.2.2 |
| 03-Dec-2017 |
jdolecek | update from HEAD
|
1.72.2.1 |
| 20-Aug-2014 |
tls | Rebase to HEAD as of a few days ago.
|
1.73.6.1 |
| 28-Aug-2017 |
skrll | Sync with HEAD
|
1.74.8.2 |
| 25-Jun-2018 |
pgoyette | Sync with HEAD
|
1.74.8.1 |
| 21-May-2018 |
pgoyette | Sync with HEAD
|
1.80.2.1 |
| 08-Apr-2020 |
martin | Merge changes from current as of 20200406
|