#
16e66f46 |
| 11-Jan-2023 |
visa <visa@openbsd.org> |
Add TLB bypass for instruction emulation
copyinsn() fetches a userland instruction through the direct map. This lets emulation work with execute-only virtual memory mappings.
OK deraadt@
|
#
36fd90dc |
| 11-Mar-2021 |
jsg <jsg@openbsd.org> |
spelling
|
#
726a21b0 |
| 19-Aug-2020 |
mpi <mpi@openbsd.org> |
Push KERNEL_LOCK/UNLOCK() dance inside trapsignal().
ok kettenis@, visa@
|
#
4452dbda |
| 14-Jan-2019 |
visa <visa@openbsd.org> |
Wrap floating point instructions with .set hardfloat to make clang's integrated assembler accept them in the kernel.
Move fsr access code into dedicated inline functions to improve readability.
|
#
8cf749ac |
| 31-Dec-2018 |
visa <visa@openbsd.org> |
Set floating point condition code even if the result of an emulated floating point comparison is unordered. The setting should be skipped only if an invalid operation exception is taken.
This fixes
Set floating point condition code even if the result of an emulated floating point comparison is unordered. The setting should be skipped only if an invalid operation exception is taken.
This fixes incorrect emulated compare behaviour with NaN values.
NaN issue on octeon reported by afresh1@; OK miod@
show more ...
|
#
c43131ad |
| 22-Oct-2018 |
krw <krw@openbsd.org> |
More "explicitely" -> "explicitly" in various comments.
ok guenther@ tb@ deraadt@
|
#
cf27e011 |
| 16-Sep-2017 |
visa <visa@openbsd.org> |
Make sure that `fsr' is always initialized. Non-DEBUG kernels have not been affected.
From miod@
|
#
6d1676f7 |
| 02-Sep-2017 |
visa <visa@openbsd.org> |
Let the kernel utilize the FPU if one is available, even when the FPUEMUL option is enabled. This benefits OCTEON III systems which can run floating-point operations natively.
Feedback from and OK m
Let the kernel utilize the FPU if one is available, even when the FPUEMUL option is enabled. This benefits OCTEON III systems which can run floating-point operations natively.
Feedback from and OK miod@; he also helped with testing.
Tested on octeon without FPU (CN5020, CN6120) and with FPU (CN7130), as well as on sgi/IP27 (MP R16000), sgi/IP32 (R5000), and loongson (3A1000).
show more ...
|
#
7cc3b72e |
| 30-Aug-2017 |
visa <visa@openbsd.org> |
Prefer copyin32() to copyin() when fetching instructions from user space. This improves performance slightly.
Discussed with miod@
|
#
fadade63 |
| 26-Aug-2017 |
visa <visa@openbsd.org> |
Use copyin32() instead of a direct memory load when fetching a branch instruction for branch emulation. This ensures the userspace memory access is properly guarded and that TLB faults are handled.
Use copyin32() instead of a direct memory load when fetching a branch instruction for branch emulation. This ensures the userspace memory access is properly guarded and that TLB faults are handled.
In order not to complicate the interface of MipsEmulateBranch(), each caller now has to provide the branch instruction for the function.
Feedback from miod@
show more ...
|
#
8fda72b7 |
| 21-Jan-2017 |
guenther <guenther@openbsd.org> |
p_comm is the process's command and isn't per thread, so move it from struct proc to struct process.
ok deraadt@ kettenis@
|
#
b43ebd13 |
| 06-Mar-2016 |
mpi <mpi@openbsd.org> |
Rename mips64's trap_frame into trapframe.
For coherency with other archs and in order to use it in MI code.
ok visa@, tobiasu@
|
#
c6c81e74 |
| 10-Sep-2015 |
miod <miod@openbsd.org> |
Initialize `pc' earlier so that the siginfo pc value is correct in case of genuine FPU exception.
|
#
e9f71800 |
| 27-Aug-2015 |
miod <miod@openbsd.org> |
Access the image of the floating point registers via p_md.md_regs, instead of directly on the frame, or any updates will get lost. This went unnoticed for so long because FPU emulation traps usually
Access the image of the floating point registers via p_md.md_regs, instead of directly on the frame, or any updates will get lost. This went unnoticed for so long because FPU emulation traps usually use the first frame of the U area, so values kind of stick.
This fixes a rare occurrence of wrong floating-point values with MP kernels on Octeon.
ok visa@
show more ...
|
#
2647def4 |
| 05-May-2015 |
jmatthew <jmatthew@openbsd.org> |
no need to swizzle load/store addresses for 32bit values on big endian systems
ok miod@
|
#
8051afc3 |
| 02-Jan-2015 |
sebastia <sebastia@openbsd.org> |
Fix a few format string warnings, allow to build DEBUG kernel on sgi
OK miod@
|
#
2df76cc2 |
| 29-Mar-2014 |
guenther <guenther@openbsd.org> |
It's been a quarter century: we can assume volatile is present with that name.
ok dlg@ mpi@ deraadt@
|
#
7b6ae6a5 |
| 03-Oct-2012 |
miod <miod@openbsd.org> |
Split ever-growing mips <machine/cpu.h> into what 99% of the kernel needs, which will remain in <machine/cpu.h>, and a new mips_cpu.h containing only the goriest md details, which are only of interes
Split ever-growing mips <machine/cpu.h> into what 99% of the kernel needs, which will remain in <machine/cpu.h>, and a new mips_cpu.h containing only the goriest md details, which are only of interest to a handful set of files; this is similar in spirit to what alpha does, but here <machine/cpu.h> does not include the new file.
show more ...
|
#
a6ba7b46 |
| 29-Sep-2012 |
miod <miod@openbsd.org> |
Handle the coprocessor 0 cause and status registers as a 64 bit value now, as some odd mips designs need moro than 32 bits in there. This causes a lot of mechanical changes everywhere getsr() is used.
|
#
f4e9e19c |
| 11-Jul-2011 |
guenther <guenther@openbsd.org> |
Revert art@'s moving around of the KERNEL_LOCK()/KERNEL_UNLOCK() calls, as it causes hangs in some ports, including libsigsegv's configure script
confirmed by krw@, landry@
|
#
22bce29c |
| 07-Jul-2011 |
art <art@openbsd.org> |
There is a bunch of places in the kernel entry points where we don't hold the kernel lock, but still need call one function that needs it.
Instead of grabbing the lock all over the place, move the l
There is a bunch of places in the kernel entry points where we don't hold the kernel lock, but still need call one function that needs it.
Instead of grabbing the lock all over the place, move the locks into the affected functions: trapsignal, scdebug*, ktrsyscall, ktrsysret, systrace_redirect and ADDUPROF. In the cases we already hold the biglock we'll just recurse.
kettenis@, beck@ ok
show more ...
|
#
971e1bb6 |
| 06-Jul-2011 |
art <art@openbsd.org> |
Clean up after P_BIGLOCK removal. KERNEL_PROC_LOCK -> KERNEL_LOCK KERNEL_PROC_UNLOCK -> KERNEL_UNLOCK
oga@ ok
|
#
0f3849f4 |
| 24-Nov-2010 |
miod <miod@openbsd.org> |
Floating-point emulation code for systems lacking proper FPU (i.e. Octeon), enabled by option FPUEMUL.
This is pretty straightforward, except for conditional branch on FPU condition codes emulation
Floating-point emulation code for systems lacking proper FPU (i.e. Octeon), enabled by option FPUEMUL.
This is pretty straightforward, except for conditional branch on FPU condition codes emulation (bc1f/bc1fl/bc1t/bc1tl instructions): unlike most RISC-with-delay-slots designs (m88k, sparc), the branch pipeline is not exposed to the kernel on Mips, therefore we can not resume a branch without losing the delay slot instruction.
Some other operating systems work around this issue by emulating the delay slot instruction, but this is error-prone (and requires the kernel code to be aware of all supported instructions of the processor it is currently running on), some use dedicated breakpoints to single-step through the delay slot and then resume the branch as expected, but this causes a lot of copy-on-write allocations.
This code chooses a third path, of copying the delay slot instructions to run toa special `magic' page, followed by a special trap instruction to give control back to the kernel. This makes sure the instruction will actually be run by the processor, and that no more than one page per process is wasted, regardless of the number of branches to emulate.
Tested on octeon (big-endian) by syuu@ and on loongson (little-endian) by me. Note that enabling option FPUEMUL in the kernel will completely disable the hardware FPU, if there is one; there is currently no way to build a kernel supporting both hardware and software FPU, and there is no reason to change this until there is a strong need to support both.
show more ...
|
#
f4229ccb |
| 27-Oct-2010 |
miod <miod@openbsd.org> |
Fix a few logic errors in comparison instruction emulation: make sure the less than relation is correctly computed, and check for both operands being signaling NaNs, instead of only the first NaN fou
Fix a few logic errors in comparison instruction emulation: make sure the less than relation is correctly computed, and check for both operands being signaling NaNs, instead of only the first NaN found, to decide whether to raise an invalid exception or not.
show more ...
|
#
dd191549 |
| 21-Sep-2010 |
miod <miod@openbsd.org> |
Replace the old floating point completion code with a C interface to the MI softfloat code, implementing all MIPS IV specified floating point operations. Tested on R5000, R10000, R14000 and Loongson2
Replace the old floating point completion code with a C interface to the MI softfloat code, implementing all MIPS IV specified floating point operations. Tested on R5000, R10000, R14000 and Loongson2F.
show more ...
|