summaryrefslogtreecommitdiff
path: root/sys/arch/mips64
AgeCommit message (Collapse)Author
2021-11-26avoid clang -Wsometimes-uninitialized warning when MULTIPROCESSOR is notJonathan Gray
defined feedback from millert@, ok kettenis@, mips64 diff from and ok visa@
2021-10-24Unlock top part of UVM fault handler on mips64.Visa Hankala
OK mpi@
2021-10-07Remove unused TLB routines.Visa Hankala
2021-10-07Remove struct members that were used by the R4000 EoP workaround.Visa Hankala
2021-10-07Use tabs instead of spaces.Visa Hankala
2021-10-07Remove a stale comment.Visa Hankala
2021-10-06Change sendsig() interface so that the MD code does not need to accessClaudio Jeker
data from struct process anymore. This changes how siginfo and onstack are accessed and make sendsig() more MP friendly. With and OK semarie@ OK kettenis@
2021-09-13Remember to lock user pmap in pmap_extract()Visa Hankala
pmap_extract() has to lock user pmap to prevent concurrent pruning of the page table. The kernel pmap is exempt from this because it uses a fixed page table structure.
2021-09-13Consistently use unsigned long for CPU masks in pmap.c.Visa Hankala
2021-08-30Remove typedef of db_addr_t; mpi converted the users of it to vaddr_t alreadyJasper Lievisse Adriaanse
back in 2019. ok mpi@
2021-07-24Replace cpus_running with CPU_IS_RUNNING().Visa Hankala
2021-07-20Remove bogus use of CPU_MAXID and get cpu_info only once.Visa Hankala
2021-07-20Remove unneeded __sync_* library functions from the kernel.Visa Hankala
These library functions were added as stopgaps because GCC 4.2.1 lacks the corresponding __sync_* builtins on mips64. However, the builtins are now provided by Clang.
2021-07-06Introduce CPU_IS_RUNNING() and us it in scheduler-related code to preventMark Kettenis
waiting on CPUs that didn't spin up. This will allow us to spin down CPUs in the future to save power as well. ok mpi@
2021-06-02kernel: introduce per-CPU panic(9) message bufferscheloha
Add a 512-byte buffer (ci_panicbuf) to each cpu_info struct on each platform for use by panic(9). The first panic on a given CPU writes its message to this buffer. Subsequent panics on a given CPU print the panic message to the console but do not modify the buffer. This aids debugging in two cases: - If 2+ CPUs panic simultaneously there is no risk of garbled messages in the panic buffer. - If a CPU panics and then the operator causes a second panic while using ddb(4), the operator can still recall the first failure on a particular CPU. Misc. changes to support this bigger change: - Set panicstr atomically to identify the first CPU to reach panic(). - Tweak db_show_panic_cmd() to print all panic messages across all CPUs. Prefix the first panic with an asterisk ('*'). - Prefer db_printf() to printf() during a panic if we have it. Apparently it disturbs less global state. - On amd64, tweak fault() to write the local panic buffer. This needs more work. Prompted by bluhm@ and deraadt@. Mostly written by deraadt@. Discussed with bluhm@, deraadt@ and kettenis@. Borne from a discussion on tech@ about making panic(9) more MP-safe: https://marc.info/?l=openbsd-tech&m=162086462316143&w=2 ok kettenis@, visa@, bluhm@, deraadt@
2021-05-30Include <sys/mutex.h> to avoid a hidden header dependency.Visa Hankala
OK jsg@ deraadt@
2021-05-28Remove CPU and node id fields that were used with SGI Origin.Visa Hankala
2021-05-05Remove unneeded tlb_set_gbase() that was used with R8000.Visa Hankala
Pointed out by miod@
2021-05-01Retire OpenBSD/sgi.Visa Hankala
OK deraadt@
2021-04-29Remove unused RM7000 ICR handling.Visa Hankala
2021-03-11spellingJonathan Gray
2021-03-04Update clock interrupt count atomically.Visa Hankala
This avoids errors that can arise when multiple cores update the variable at the same time.
2021-02-23timecounting: use C99-style initialization for all timecounter structscheloha
The timecounter struct is large and I think it may change in the future. Changing it later will be easier if we use C99-style initialization for all timecounter structs. It also makes reading the code a bit easier. For reasons I cannot explain, switching to C99-style initialization sometimes changes the hash of the resulting object file, even though the resulting struct should be the same. So there is a binary change here, but only sometimes. No behavior should change in either case. I can't compile-test this everywhere but I have been staring at the diff for days now and I'm relatively confident this will not break compilation. Fingers crossed. ok gnezdo@
2021-02-11Leave out gp initialization from kernel entry on mips64Visa Hankala
On OpenBSD/mips64, the kernel is compiled with -mno-abicalls. This disables gp-relative addressing and essentially makes gp a spare register in the kernel. Hence it is unnecessary to initialize gp when entering the kernel. The _gp symbol is not needed either. Suggested by miod@
2021-01-13kernel, sysctl(8): remove dead variable: tickadjcheloha
The global "tickadj" variable is a remnant of the old NTP adjustment code we used in the kernel before the current timecounter subsystem was imported from FreeBSD circa 2004 or 2005. Fifteen years hence it is completely vestigial and we can remove it. We probably should have removed it long ago but I guess it slipped through the cracks. FreeBSD removed it in 2002: https://cgit.freebsd.org/src/commit/?id=e1d970f1811e5e1e9c912c032acdcec6521b2a6d NetBSD and DragonflyBSD can probably remove it, too. We export tickadj via the kern.clockrate sysctl(2), so update sysctl.2 and sysctl(8) accordingly. Hypothetically this change could break someone's sysctl(8) parsing script. I don't think that's very likely. ok mvs@
2020-12-24Initialize mips64 pmap pool using IPL_VM.Visa Hankala
This moves the pmap closer to MP-safety. A similar change has already been made on some other architectures.
2020-11-08In case of failure, call sigexit() from trapsignal instead of sensig().Martin Pieuchot
Simplify MD code and reduce the amount of recursion into the signal code which helps when dealing with locks. ok cheloha@, deraadt@
2020-10-22uvm_grow() doesn't need KERNEL_LOCK anymore, and onfault never did.Theo de Raadt
minor refactorings to narrow KERNEL_LOCK just around uvm_fault() ok kettenis
2020-10-21uvm_grow() now does the vm_maxsaddr check (before locking), so callers don'tTheo de Raadt
need to do it ok kettenis
2020-10-21mips64 has same bug as arm64: copyout(9), copyinstr(9) andTheo de Raadt
copyoutstr(9) should bail out properly if they are called with a length of 0. ok visa
2020-10-20Use a trap instruction that unconditionally terminates the process.Visa Hankala
OK deraadt@
2020-10-20Add handling for a trap instruction that terminates the process.Visa Hankala
OK deraadt@
2020-10-08use access_type as the PROT_* variable for uvm_fault() consistantlyTheo de Raadt
ok kettenis
2020-10-07Include <sys/systm.h> directly instead of relying on hidden UVM includes.Martin Pieuchot
The header is being pulled via uvm_extern.h -> uvm_map.h
2020-09-24mi_ast() needs curcpu()->ci_want_resched rather than ci->ci_want_resched,Theo de Raadt
because refreshcreds() may sleep in pool_put(). Subtle isn't it... ok visa kettenis
2020-09-24Only perform uvm_map_inentry() checks for PROC_SP for userland pagefaults.Theo de Raadt
This should be sufficient for identifying pivoted ROP. Doing so for other traps is at best opportunistic for finding a straight-running ROP chain, but the added (and rare) sleeping point has proven to be dangerous. Discussed at length with kettenis and mortimer. ok mortimer kettenis mpi
2020-08-19Push KERNEL_LOCK/UNLOCK() dance inside trapsignal().Martin Pieuchot
ok kettenis@, visa@
2020-08-10Do not block IPIs when acquiring the rendezvous mutex. Otherwise theVisa Hankala
system would deadlock when a CPU gets blocked by the mutex while another CPU is waiting for the first CPU to finish a rendezvous request. This possibly fixes some hangs on sgi. There should be no effect on loongson and octeon because their interrupt code is sloppy with masking of IPIs. While here, rename the rendezvous mutex to better reflect its use.
2020-07-22Use CPU_IS_PRIMARY macro in cpuattach() on mips64.Frederic Cambus
OK visa@
2020-07-18Userland timecounter implementation for octeonVisa Hankala
OK naddy@; no objections from kettenis@
2020-07-15Use CPU_IS_PRIMARY macro on alpha and mips64.Frederic Cambus
OK deraadt@, visa@
2020-07-11Synchronize each core's CP0 cycle counter using the IO clock counter.Visa Hankala
This makes the cycle counter usable as timecounter on multiprocessor machines. Idea from Linux. Tested on CN5020, CN6120, CN7130 and CN7360. Looks reasonable to kettenis@
2020-07-08do not need these versions of timetc.hTheo de Raadt
2020-07-06Add support for timeconting in userland.Paul Irofti
This diff exposes parts of clock_gettime(2) and gettimeofday(2) to userland via libc eliberating processes from the need for a context switch everytime they want to count the passage of time. If a timecounter clock can be exposed to userland than it needs to set its tc_user member to a non-zero value. Tested with one or multiple counters per architecture. The timing data is shared through a pointer found in the new ELF auxiliary vector AUX_openbsd_timekeep containing timehands information that is frequently updated by the kernel. Timing differences between the last kernel update and the current time are adjusted in userland by the tc_get_timecount() function inside the MD usertc.c file. This permits a much more responsive environment, quite visible in browsers, office programs and gaming (apparently one is are able to fly in Minecraft now). Tested by robert@, sthen@, naddy@, kmos@, phessler@, and many others! OK from at least kettenis@, cheloha@, naddy@, sthen@
2020-06-30Remove obsolete <machine/stdarg.h> header. Nowadays the varargVisa Hankala
functionality is provided by <sys/stdarg.h> using compiler builtins. Tested in a ports bulk build on amd64 by naddy@ OK naddy@ mpi@
2020-06-30Retire unused <mips64/dev/clockvar.h> interface.Visa Hankala
2020-06-05cpu_rnd_messybits() for mips64Visa Hankala
Use CP0 Count as a basis. Also take noise from virtual memory activity by including BadVAddr. OK deraadt@ dlg@
2020-05-31introduce "cpu_rnd_messybits" for use instead of nanotime in dev/rnd.c.David Gwynne
rnd.c uses nanotime to get access to some bits that change quickly between events that it can mix into the entropy pool. it doesn't use nanotime to get a monotonically increasing set or ordered and accurate timestamps, it just wants something with bits that change. there's been discussions for years about letting rnd use a clock that's super fast to read, but not necessarily accurate, but it wasn't until recently that i figured out it wasn't interested in time at all, so things like keeping a fast clock coherent between cpu cores or correct according to ntp is unecessary. this means we can just let rnd read the cycle counters on cpus and things will be fine. cpus with cycle counters that vary in their speed and arent kept consistent between cores may even be desirable in this context. so this is the first step in converting rnd.c to reading cycle counter. it copies the nanotime backend to each arch, and they can replace it with something MD as a second step later on. djm@ suggested rnd_messybytes, but we landed on cpu_rnd_messybits. thanks to visa for his eyes. ok deraadt@ visa@ deraadt@ says he will help handle any MD fallout that occurs.
2020-05-29dev/rndvar.h no longer has statistical interfaces (removed during variousTheo de Raadt
conversion steps). it only contains kernel prototypes for 4 interfaces, all of which legitimately belong in sys/systm.h, which are already included by all enqueue_randomness() users.
2020-05-27Retire <machine/varargs.h>.Visa Hankala
Nothing uses the header anymore. OK deraadt@ mpi@