Commit graph

29 commits

Author SHA1 Message Date
cinap_lenrek 24057fd4f4 kernel: introduce per process FPU struct (PFPU) for more flexible machine specific fpu handling
introducing the PFPU structue which allows the machine specific
code some flexibility on how to handle the FPU process state.

for example, in the pc and pc64 kernel, the FPsave structure is
arround 512 bytes. with avx512, it could grow up to 2K. instead
of embedding that into the Proc strucutre, it is more effective
to allocate it on first use of the fpu, as most processes do not
use simd or floating point in the first place. also, the FPsave
structure has special 16 byte alignment constraint, which further
favours dynamic allocation.

this gets rid of the memmoves in pc/pc64 kernels for the aligment.

there is also devproc, which is now checking if the fpsave area
is actually valid before reading it, avoiding debuggers to see
garbage data.

the Notsave structure is gone now, as it was not used on any
machine.
2017-11-04 20:08:22 +01:00
cinap_lenrek aab4e32ce0 pc, pc64: support for multiboot framebuffer, common bootargs and multiboot code 2017-06-25 22:22:58 +02:00
aiju becb89bae5 pc, pc64: adapt devvmx to work on pc64 2017-06-20 15:10:08 +00:00
aiju 2bb65c40ab devvmx: support debug registers; simplify assembly 2017-06-17 22:38:16 +00:00
aiju dea6bc51bc pc/pc64: debugexc: ignore exception if in kernel mode and can't get hold of up->debug 2017-06-12 22:58:25 +00:00
aiju 773be02aa1 kernel: add support for hardware watchpoints 2017-06-12 19:03:07 +00:00
cinap_lenrek 5aa224c153 pc: use fpsave() instead of fpenv() to capture fp exception context 2016-05-01 21:51:15 +02:00
cinap_lenrek 5458506881 all kernels: declare _tas() to prevent pulling in libc version (for libmemdraw) 2015-07-07 19:17:55 +02:00
cinap_lenrek fba26da490 pc, pc64: extend initial memory map for qemu multiboot data
qemu puts multiboot data after the end of the kernel image, so
to be able to KADDR() that memory early, we extend the initial
identity mapping by 16K. right now we just got lucky with
the pc kernel as it rounds the map to 4MB pages.
2015-04-08 02:50:09 +02:00
cinap_lenrek 3d4d594049 pc: dont handle pending floating point exception in fpsave thru FPOFF
the FPOFF macro that follows the FXSAVE/FSAVE instructions in l.s
used to execute WAIT instruction when the TS flag was not set. this
is wrong and causes pending exceptions to be raised from fpsave which
is called from provsave() which holds up->rlock making it deadlock
when matherror() tries to postnote() to itself.

so making FPOFF non-waiting (just set TS flag).

we handle pending exception when restoring the context.
2015-01-23 14:01:56 +01:00
cinap_lenrek d069c9b486 pc: get rid of fixed 8MB memory map (now dynamically between 4 to 16 MB depending on kernel size)
we now do mapping of KZERO to ROUND(end, 4*MB) where
end needs not to be above 16MB. this allows for bigger
kernels.
2014-11-15 15:21:24 +01:00
cinap_lenrek 0d5491fb08 pc, pc64: fix off by one error in _multibootentry 2014-08-18 03:16:11 +02:00
cinap_lenrek 72ba3571a3 kernel: remove _xinc()/_xdec()
as with the Block refcount changes, _xinc() and _xdec() arent
used anymore, so remove them.

architecure can still define ainc()/adec() when it needs them.
2014-06-08 01:35:22 +02:00
cinap_lenrek a9155014c0 pc, pc64: handle sse simd exceptions 2014-05-11 05:59:10 +02:00
cinap_lenrek c9bbe34bf6 pc kernel: make syscall() return thru forkret() to handle exceptions
forkret() labels the instructions that can raise exceptions
so they can be handled in trap(). this can happen when
segment descriptors get invalidated.
2013-09-27 19:24:45 +02:00
cinap_lenrek 257c7e958e keep fpregs always in sse (FXSAVE) format, adapt libmach and acid files for new format
we now always use the new FXSAVE format in FPsave structure and fpregs
file, converting back and forth in fpx87save() and fpx87restore().

document that fprestore() is a destructive operation now.

change fp register definition in libmach and adapt fpr() acid funciton.

avoid unneccesary copy of fpstate and fpsave in sysfork(). functions
including syscalls do not preserve the fp registers and copying fpstate
from the current process would mean we had to fpsave(&up->fpsave); first.
simply not doing it, new process starts in FPinit state.
2013-05-26 22:41:40 +02:00
jpathy 81b7451972 sse kernel support (sources) 2013-05-22 23:47:05 +05:30
jpathy e3883b050e Add RDRAND Support for /dev/random 2013-05-08 23:27:58 +05:30
cinap_lenrek e91301a401 rdmsr/wrmsr become tryrdmsr/trywrmsr, we can should check for trap 2012-08-31 16:48:33 +02:00
aiju c612f9c41f multiboot: use initrd for config 2012-07-13 18:52:39 +02:00
aiju c03913c62d fixed multiboot booting 2012-07-13 18:09:42 +02:00
cinap_lenrek aa015b1c4f kernel: use monitor/mwait instruction on pc multiprocessor for idlehands 2012-05-04 11:02:11 +02:00
cinap_lenrek f5018135c0 vesa/realmode cleanup 2011-11-05 06:54:48 +01:00
cinap_lenrek 563437cb6d remove realmode and e820 code from kernel 2011-11-05 06:19:52 +01:00
cinap_lenrek 5be936a192 pc/trap: cleanup exception handling 2011-07-20 07:48:33 +02:00
aiju 03d71535ec reading from/writing to non-existant MSRs via /dev/msr no longer crashes the system 2011-07-19 15:42:00 +02:00
cinap_lenrek c6c2e04d4a segdesc: add /dev/^(ldt gdt) support 2011-07-12 15:46:22 +02:00
Taru Karttunen a9060cc06b Import sources from 2011-03-30 iso image - lib 2011-03-30 19:35:09 +03:00
Taru Karttunen e5888a1ffd Import sources from 2011-03-30 iso image 2011-03-30 15:46:40 +03:00