summaryrefslogtreecommitdiff
path: root/sys/arch/hppa
AgeCommit message (Collapse)Author
2023-06-15all platforms, main(): call clockqueue_init() just before sched_init_cpu()Scott Soule Cheloha
Move the clockqueue_init() call out of clockintr_cpu_init() and up just before the sched_init_cpu() call for a given CPU. This will allow sched_init_cpu() to allocate clockintr handles for a given CPU's scheduler in a later patch. Link: https://marc.info/?l=openbsd-tech&m=168661507607622&w=2 ok kettenis@, claudio@
2023-04-26Implement dt(4) utrace support on amd64 and i386.Claudio Jeker
This adds stacktrace_save_utrace() to extract and save the userland stack which is stubbed out on most archs. alpha and riscv64 do not even implement dt(4) and stacktrace_save_at() so the stubs are excluded there. Additionally add a new ioctl DTIOCGETAUXBASE which allows btrace to fetch the AUX_BASE vallue from the AUX vector of a process. OK mpi@ (some time ago) discussed with kettenis@
2023-04-13pmap_copy() has never, ever, been implemented in any of the platforms OpenBSDMiod Vallat
ever ran on, and it's unlikely to ever be implemented, so remove it. ok jsg@
2023-04-13Remove intentionally undocumented pci_{io,mem}_find and convert their lastMiod Vallat
few users to pci_mapreg_info(). ok jsg@
2023-04-10spellingJonathan Gray
2023-03-08Delete obsolete /* ARGSUSED */ lint comments.Philip Guenther
ok miod@ millert@
2023-02-23Remove dangerous user-settable "addr" variable from MI boot loader, andMiod Vallat
only compile tty-related code (stty command, tty variable) on platforms where it makes sense for the boot loader to control it, rather than the PROM/firmware/whatever.
2023-02-11__syscall() is no longer neccessary since the system calls which neededTheo de Raadt
it are now unpadded ok kettenis guenther
2023-02-04timecounting: remove incomplete PPS supportScott Soule Cheloha
The timecounting code has had stubs for pulse-per-second (PPS) polling since it was imported in 2004. At this point it seems unlikely that anyone is going to finish adding PPS support, so let's remove the stubs: - Delete the dead tc_poll_pps() call from tc_windup(). - Remove all tc_poll_pps symbols from the kernel. Link: https://marc.info/?l=openbsd-tech&m=167519035723210&w=2 ok miod@
2023-01-31On systems without xonly mmu hardware-enforcement, we can still mitigateTheo de Raadt
against classic BROP with a range-checking wrapper in front of copyin() and copyinstr() which ensures the userland source doesn't overlap the main program text, ld.so text, signal tramp text (it's mapping is hard to distinguish so it comes along for the ride), or libc.so text. ld.so tells the kernel libc.so text range with msyscall(2). The range checking for 2-4 elements is done without locking (because all 4 ranges are immutable!) and is inexpensive. write(sock, &open, 400) now fails with EFAULT. No programs have been discovered which require reading their own text segments with a system call. On a machine without mmu enforcement, a test program reports the following: userland kernel ld.so readable unreadable mmap xz unreadable unreadable mmap x readable readable mmap nrx readable readable mmap nwx readable readable mmap xnwx readable readable main readable unreadable libc unmapped? readable unreadable libc mapped readable unreadable ok kettenis, additional help from miod
2023-01-24Make sure pmap_page_protect() does the right thing for execute-onlyMark Kettenis
mappings and enforce this with a KASSERT like we do on amd64. Bring the pmap_protect() inline in line with the amd64 version. ok miod@, deraadt@
2023-01-20hppa: simplify itmr_rearm()Scott Soule Cheloha
The nest of branches in itmr_rearm() can be simplified to: if (cycles <= t1 - t0) { /* we probably missed */ } We're doing modular unsigned 32-bit, so the rollover case in the current code is superfluous. Tested by miod@. "Works for me." miod@
2023-01-16we spent far too long debugging a weird go library problem (incorrectTheo de Raadt
arguments to mmap) because it was using syscall(2) and that callpath is invisible in ktrace. make it visible, it will now show "(via syscall)" and such. ok guenther
2023-01-07The PA-RISC architecture supports execute-only mappings by using aMark Kettenis
"remain at privilege level 3" gateway page. Make use of this. ok deraadt@, miod@
2023-01-06Remove copystr(9), unless used internally by copy{in,out}str.Miod Vallat
2023-01-06Remove no longer needed and quite worthless header.Miod Vallat
2023-01-06Remove unused local variables as well as the dependency on <machine/nvm.h>.Miod Vallat
2023-01-01With the introduction of the PMAP_PREFER_{ALIGN,OFFSET} macros a long time ago,Miod Vallat
there are actually no more uses of the PMAP_PREFER() macro left in the kernel. Remove that macro but keep PMAP_PREFER as a simple #define for it to let uvm knows the PMAP_PREFER_{ALIGN,OFFSET} macros are available. ok mpi@
2022-12-06hppa: switch to clockintrScott Soule Cheloha
- Remove hppa-specific clock interrupt scheduling bits from cpu_info. - Rename cpu_hardclock() to itmr_intr(); it doesn't exclusively run hardclock(9) anymore. - Wire up itmr_intrclock. hppa now has a randomized statclock(), stathz = hz. Patch help, testing, and review from kettenis@ (B2000) and miod@ (C3650). MP testing from guenther@ (dual-core J6700). ok mlarkin@ kettenis@, "Ship it?" guenther@
2022-11-02Clean up more ancient history: since 2015 the libc stubs forPhilip Guenther
fork/vfork/__tfork haven't cared about the second return register. So, stop setting retval[1] in kern_fork.c and stop setting the second return register in the MD child_return() routines. With the above, we have no multi-register return values on LP64, so stop touching that register in the trapframe on those archs. testing miod@ and aoyama@ ok miod@
2022-10-30Simplfity setregs() by passing it the ps_strings and switchingPhilip Guenther
sys_execve() to return EJUSTRETURN. setregs() is the MD routine used by sys_execve() to set up the thread's trapframe and PCB such that, on 'return' to userspace, it has the register values defined by the ABI and otherwise zero. It had to set the syscall retval[] values previously because the normal syscall return path overwrites a couple registers with the retval[] values. By instead returning EJUSTRETURN that and some complexity with program-counter handling on m88k and sparc64 goes away. Also, give setregs() add a 'struct ps_strings *arginfo' argument so powerpc, powerpc64, and sh can directly get argc/argv/envp values for registers instead of copyin()ing the one in userspace. Improvements from miod@ and millert@ Testing assistance miod@, kettenis@, and aoyama@ ok miod@ kettenis@
2022-10-26Make audio(9) get_props() optional, remove it from duplex driversKlemens Nanni
The property bits of audio(9) are obsolete and ought to be removed completely. sys/dev/audio.c:audio_open() currently uses get_props() to bail out if read *and* write was requested on a non-duplex driver. Drivers that currently support playing but not recording need adjustment before the API can be cleaned up. Drivers that advertise themselves as full duplex, i.e. those that always return AUDIO_PROP_FULLDUPLEX unconditionally in their get_props() currently always succeed this check. As this is the only property, losen audio_open()'s DIAGNOSTIC check and only do the duplex check if the driver provides get_props(). This allows for simple removal of get_props() from full-duplex drivers without adding any other code or without changing functionality. This includes all audio drivers under sys/dev/pci/ (maestro(4) being the only unfinished exception here). Other drivers as well as the API change can then follow in smaller diffs. This builds on amd64, arm64, i386, macppc and sparc64. amd64 with azalia(4) still plays, records as well as plays and records at the same time on my X230 as tested with $ aucat -i play.wav [-o rec.wav] alpha and hppa tests by miod OK ratchov miod
2022-10-25Store mod/ref flags using md pg_flags values rather than a specific field inMiod Vallat
vm_page_md, which allows this struct to shrink a bit.
2022-10-25Consistently use 'proc_trampoline' as the name of the trampolinePhilip Guenther
used by cpu_fork() ok miod@ kettenis@ mpi@ deraadt@
2022-10-19Use C99 struct init for struct audio_hw_ifKlemens Nanni
This audio(9) struct will lose a member, but drivers init their struct quite inconsistently, most pre-C99 style. Use C99 style everywhere, to get rid of all annoying differences and allow for easy member removals/additions: - don't change current order of members - no explicit NULL members - no comments or blank lines - trailing comma in last member line GENERIC.MP builds fine with this on arm64, amd64, i386 and sparc64. macppc and alpha build-tested by miod OK ratchov miod
2022-10-15ansiJonathan Gray
2022-10-11Give checkdisklabel() a new parameter supplying the dev_t of theKenneth R Westerback
device whose disklabel is being checked. Within checkdisklabel() use this information to discover a device name iff (sic) the label is an obsolete version. Use the name to generate a meaningful warning message asking the user to rewrite the disklabel and thus promote it to the current version. Suggested by, feedback from and ok deraadt@
2022-09-10Remove pmap_collect() when a no-op, define __HAVE_PMAP_COLLECT otherwise.Miod Vallat
Use that define to shunt uvm_swapout_threads(), which is a noop when pmap_collect() does nothing. ok mpi@
2022-09-02Constify nam2blk[], chrtoblktbl[] and octeon devmap[].Miod Vallat
ok mpi@ millert@
2022-09-01Stop setting d_bbsize and d_sbsize. Nobody has paidKenneth R Westerback
any attention for some time. ok otto@ as part of larger diff
2022-08-12Make sure we don't pass uninitialized siginfo values to trapsignal(); fromMiod Vallat
clang via jsg@, ok jsg@
2022-08-12use string literal for format stringJonathan Gray
ok deraadt@ miod@
2022-08-10match other archs use %s for version printfJonathan Gray
2022-07-20the _pad_ system calls from 2021/12/23 can go awayTheo de Raadt
ok guenther
2022-07-02remove machine/lock.h where unusedJonathan Gray
Previously for __cpu_simple_lock parts. Now only hppa and m88k use __cpu_simple_lock (and hppa uses atomic.h for it). ok miod@ visa@
2022-05-21Convert KVA allocation to km_alloc(9).Mark Kettenis
ok mpi@
2022-04-20repair kstat entryTheo de Raadt
2022-03-21Constify struct {audio,midi,radio,video}_hw_if. No functional change.Miod Vallat
ok mpi@ ratchov@ "More const is good" deraadt@
2022-03-13Constify struct cfattach.Martin Pieuchot
ok miod@
2022-02-21enries -> entriesJonathan Gray
2022-02-16Make room for a cookie argument passed to audio_attach_mi(). CurrentlyAnton Lindqvist
unused but intended to be used to correlate audio and wskbd devices. ok ratchov@
2022-02-15fix mask in hppa inst_trap_return()Jonathan Gray
inst_trap_return() was checking for rfir by masking with 0xfc001fc0 which made it impossible to match rfir (0xca0) rfi: return from interruption 00 rv rv rv 60 0 6 5 5 3 8 5 rfir: return from interruption and restore 00 rv rv rv 65 0 6 5 5 3 8 5 from "PA-RISC 1.1 Architecture and Instruction Set Reference Manual" where rv indicates reserved bits change the mask to only mask out reserved bits and check for rfi in addition to rfir ok miod@
2022-02-14don't deref pointer before test it is safeJonathan Gray
ok miod@
2022-01-02numers -> numbersJonathan Gray
2021-12-23Roll the syscalls that have an off_t argument to remove the explicit padding.Philip Guenther
Switch libc and ld.so to the generic stubs for these calls. WARNING: reboot to updated kernel before installing libc or ld.so! Time for a story... When gcc (back in 1.x days) first implemented long long, it didn't (always) pass 64bit arguments in 'aligned' registers/stack slots, with the result that argument offsets didn't match structure offsets. This affected the nine system calls that pass off_t arguments: ftruncate lseek mmap mquery pread preadv pwrite pwritev truncate To avoid having to do custom ASM wrappers for those, BSD put an explicit pad argument in so that the off_t argument would always start on a even slot and thus be naturally aligned. Thus those odd wrappers in lib/libc/sys/ that use __syscall() and pass an extra '0' argument. The ABIs for different CPUs eventually settled how things should be passed on each and gcc 2.x followed them. The only arch now where it helps is landisk, which needs to skip the last argument register if it would be the first half of a 64bit argument. So: add new syscalls without the pad argument and on landisk do that skipping directly in the syscall handler in the kernel. Keep compat support for the existing syscalls long enough for the transition. ok deraadt@
2021-12-09We only have one syscall table: inline sysent/SYS_MAXSYSCALL andPhilip Guenther
SYS_syscall as the nosys() function into the MD syscall entry routines and the SYSCALL_DEBUG support. Adjust alpha's syscall check to match the other archs. Also, make sysent const to get it into .rodata. With that, 'struct emul' is unused: delete it and all its references ok millert@
2021-11-11Retire switch(4) it never really was production ready and the OpenFlowClaudio Jeker
API implemented is a deadend. OK akoshibe@ yasuoka@ deraadt@ kn@ patrick@ sthen@
2021-10-07trapsignal() can be called without KERNEL_LOCK, adjust code accordingly.Claudio Jeker
OK mpi@
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-14Make pmap_extract() mpsafe by grabbing the kernel lock for userland pmapsMark Kettenis
while walking the page tables. ok deraadt@