summaryrefslogtreecommitdiffstats
path: root/sys/arch/alpha/include
AgeCommit message (Collapse)AuthorFilesLines
2020-07-06Add support for timeconting in userland.pirofti1-0/+23
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 varargvisa1-60/+0
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-05Implement cpu_rnd_messybits() as a read of the cycle counter register.naddy1-2/+6
ok dlg@, powerpc/sparc64 ok kettenis@, sparc64/alpha tested by deraadt@
2020-05-31introduce "cpu_rnd_messybits" for use instead of nanotime in dev/rnd.c.dlg1-1/+3
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-27Retire <machine/varargs.h>.visa1-58/+0
Nothing uses the header anymore. OK deraadt@ mpi@
2020-05-25Pass boothowto from bootblock to kernelderaadt1-2/+3
2020-05-23remove more cfb and sfb bitsjsg2-157/+0
2019-11-07Convert db_addr_t -> vaddr_t but leave the typedef for now.mpi1-5/+5
2019-11-07ANSIfy & substitute boolean_t/TRUE/FALSE by int/1/0.mpi1-9/+8
ok jasper@, deraadt@
2019-05-13free(9) sizes.mpi1-1/+2
From miod@
2019-03-24Add intr_{disable,restore}() for alpha.visa3-7/+16
Reminded by deraadt@
2018-12-05Include srp.h where struct cpu_info uses srp to avoid erroring out whenjsg1-1/+2
including cpu.h machine/intr.h etc without first including param.h when MULTIPROCESSOR is defined. ok visa@
2018-09-14Unify and bump some of the NMBCLUSTERS defines. Some archs had it set toclaudio1-2/+2
4MB which is far too low especially when the platform is able to run MP. New limits are, amd64 = 256M; arm64, mips64, sparc64 = 64M; alpha, arm, hppa, i386, powerpc = 32M; m88k, sh = 8M Still rather conservative numbers but much better than before. At least some hangs of arm64 build boxes was caused by this. OK kettenis@, visa@
2018-08-20Remove unused spllock().visa1-3/+1
OK deraadt@ mpi@
2018-04-09Fill in FRAME_PS after the fact. What a ridiculous design decision.deraadt1-2/+2
It would be better if this was filled in at trap time. ok guenther
2018-03-05#define _MAX_PAGE_SHIFT in MD _types.h as the maximum pagesize an archderaadt1-1/+2
needs (looking at you sgi, but others required this before). This is for the circumstances we need pagesize known at compile time, not getpagesize() runtime. Use it for malloc storage sizes, for shm, and to set pthread stack default sizes. The stack sizes were a mess, and pushing them towards page-aligned is healthy move (which will also be needed by the coming stack register checker) ok guenther kettenis, discussion with stefan
2018-01-25Move common mutex implementations to a MI place.mpi1-84/+2
Archs not yet converted can to the jump by defining __USE_MI_MUTEX. ok visa@
2018-01-13Define and use IPL_MPFLOOR in our common mutex implementation.mpi2-3/+5
ok kettenis@, visa@
2018-01-04Unify <machine/mutex.h> a bit further.mpi1-2/+2
Remove `mtx_lock' from i386, add volatile before `mtx_owner' where it was missing. Inputs from kettenis@, ok visa@
2017-12-04Change __mp_lock_held() to work with an arbitrary CPU info structure andmpi1-2/+2
extend ddb(4) "ps /o" output to print which CPU is currently holding the KERNEL_LOCK(). Tested by dhill@, ok visa@
2017-11-02Switch DEC 3000 (TURBOchannel) alpha serial code to MI z8530 code.mpi1-0/+119
ttyB* minor numbers change; be sure to rerun MAKEDEV if you do not upgrade with bsd.rd Adapted from NetBSD by miod@
2017-09-05Move mutex, condvar, and thread-specific data routes, pthread_once, andguenther1-5/+1
pthread_exit from libpthread to libc, along with low-level bits to support them. Major bump to both libc and libpthread. Requested by libressl team. Ports testing by naddy@ ok kettenis@
2017-06-29kill RCSID macros; discussed with millertderaadt1-20/+1
2017-06-05Split early startup code out of locore.S into locore0.S. Adjust linkderaadt1-1/+3
run so that this locore0.o is always at the start of the executable. But randomize the link order of all other .o files in the kernel, so that their exec/rodata/data/bss segments land all over the place. Late during kernel boot, smash the startup code with traps so that it does not point to the other randomly placed code. It has be smashed, because alpha (insecurely in my view) runs in the KSEG0 space. As a result, the internal layout of every newly build bsd kernel is different from past kernels. Internal relative offsets are not known to an outside attacker. The only known offsets are in the startup code, which is gone. Ramdisk kernels cannot be compiled like this, because they are gzip'd. When the internal pointer references change, the compression dictionary bloats and results in poorer compression.
2017-05-29Kill SPINLOCK_SPIN_HOOK, use CPU_BUSY_CYCLE() instead.mpi2-26/+24
ok visa@, kettenis@
2017-05-08add a BUS_DMA_64BIT flag to bus_dma on all our archs.dlg1-1/+2
this is so drivers can advertise that they can handle 64 dma addresses to the platform. it may choose to handle dmamaps differently based on this flag. tweaks and ok tom@ ok kettenis@
2017-04-20Hook up mutex(9) to witness(4).visa1-3/+15
2017-04-13Provide mips64 with kernel-facing TCB_{GET,SET} macros that store itguenther1-3/+1
in struct mdproc. With that, all archs have those and the __HAVE_MD_TCB macro can be unifdef'ed as always defined. ok kettenis@ visa@ jsing@
2017-02-08In exec_elf.c: expand ELFNAME(), ELFNAME2(), and ELFNAMEEND() exceptguenther1-3/+1
leaving out the size, so that ELFNAME2(exec,makecmds) becomes exec_elf_makecmds instead of exec_elf{32,64}_makecmds and then delete the ELFNAME2() and ELFNAMEEND() macros. Move the prototypes for functions local to exec_elf.c to there from exec_elf.h. Simplify the SMALL_KERNEL conditionals around the ELF coredump code. Change exec_conf.c to use the size-generic names and macros Remove exec_elf{32,64}.c and just build exec_elf.c; delete the _KERN_DO_ELF and _KERN_DO_ELF64 #defines. ok jca@, encouragement from deraadt@ and tom@
2016-11-07Hide FIX_SSTEP() behind #ifdef _KERNELguenther1-2/+4
ok deraadt@
2016-09-03Increase the number of mbufs on most architectures. This is basedbluhm1-2/+2
on a guess how much memory a typical machine has. If the value is too high, users may run out of kernel memory. Then we will have to adjust this again. OK claudio@ deraadt@
2016-06-13rename _splraise to splraisedlg1-14/+14
gets us a bit closer to an MI splraise api.
2016-05-27Remove the non ELF macrosderaadt1-10/+1
ok millert
2016-05-15Implement TCB_{GET,SET} using PAL_{rd,wr}unique.guenther3-5/+55
Inline asm from NetBSD testing deraadt@
2016-05-10SROP mitigation. sendsig() stores a (per-process ^ &sigcontext) cookiederaadt1-3/+3
inside the sigcontext. sigreturn(2) checks syscall entry was from the exact PC addr in the (per-process ASLR) sigtramp, verifies the cookie, and clears it to prevent sigcontext reuse. not yet tested on landisk, sparc, *88k, socppc. ok kettenis
2016-05-03alias bus_space_{read,write}_raw to the non-raw counterpartsdlg1-1/+19
busses are little endian, so the non-raw ops are raw anyway. fixes the kernel build after xge grew the use of the raw ops.
2016-04-27G/C DDB_REGS.mpi1-2/+1
2016-04-20Move back #include <sys/mutex.h> outside #ifdef _KERNEL as it waslandry1-2/+2
originally intended in r1.38. (ie more or less revert r1.39) (re-)Fixes at least net/net-snmp, sysutils/gkrellm/gkrellm,-client, sysutils/xuvmstat and sysutils/bubblemon-dockapp on alpha. From miod@
2016-03-30Better support for alphas without all IEEE-mode instructionsafresh11-1/+2
From Miod Vallat I trust miod deraadt@
2016-03-01guard macro args with parensmmcc1-2/+2
from Michal Mazurek, ok deraadt@
2016-02-27Rename kdb_trap() into db_ktrap().mpi1-2/+2
The goal is to include it in the list of functions that must not be instrumented. All ddb(8) functions should be in this list and have their names start with 'db_'. ok visa@, deraadt@
2016-02-22put mutex.h lowerderaadt1-2/+2
2016-02-22Move #include <sys/mutex.h> from pmap.c to pmap.h, like every other archslandry1-1/+2
using struct mutex in pmap.h do. Fixes net-snmp on alpha. ok deraadt@
2015-11-07Spell `unused' correctly.miod1-2/+2
2015-11-01Remove the definition of USRTEXT. It has no relevance outside of the non-PIEmiod1-13/+1
a.out world. ok deraadt@ kettenis@
2015-10-01Make the alpha pmap (more) mpsafe by protecting both the pmap itself and thekettenis1-1/+4
pv lists with a mutex. This should make pmap_enter(9), pmap_remove(9) and pmap_page_protect(9) safe to use without holding the kernel lock. This largely reverts rev. 1.75, but now of course the pmap locks are defined to actually call mtx_enter(9) and mtx_leave(9). ok visa@
2015-09-30Use consistant whitespace/comments for #define'ing LABELSECTOR,krw1-4/+4
LABELOFFSET and MAXPARTITIONS. Easier on the eye when scanning through all these files. No functional change.
2015-09-26lint is dead and C99 may be old enough to drive a car: delete LONGLONGguenther1-3/+1
comments ok millert@
2015-09-13intr_barrier(9) for alpha.kettenis1-1/+3
2015-08-29_NLIST_DO_ELF is no longer needed: it's the only optionguenther1-2/+1
ok deraadt@