Commit graph

37 commits

Author SHA1 Message Date
aiju bd4513fe87 devvmx: call vmxshutdown from reboot() function manually 2017-09-02 10:43:37 +00:00
aiju e5d3aaf1aa devvmx, vmx: lilu dallas multivm 2017-08-28 17:27:41 +00: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 773be02aa1 kernel: add support for hardware watchpoints 2017-06-12 19:03:07 +00:00
aiju 48fa332c61 pc: actually call netconsole() 2017-06-01 06:40:05 +00:00
cinap_lenrek d48a089486 pc64: implement simple write combining for framebuffers with the PAT
on some modern machines like the x250, the bios arranges the mtrr's
and the framebuffer membar in a way that doesnt allow us to mark
the framebuffer pages as write combining, leading to slow graphics.

since the pentium III, the processor interprets the page table bit
combinations of the WT, CD and bit7 bits as an index into the
page attribute table (PAT).

to not change the semantics of the WT and CD bits, we preserve
the bit patterns 0-3 and use the last entry 7 for write combining.
(done in mmuinit() for each core).

the new patwc() function takes virtual address range and changes
the page table marking the range as write combining. no attempt
is made on invalidating tlb's. doesnt matter in our case as the
following mtrr() call in screen.c does it for us.
2016-12-15 23:27:01 +01: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 7304deaec1 pc, pc64: remove unused psaux driver, cleanup devkbd
the psaux driver is not used in any kernel configuration and theres
no userspace mouse daemon. i8042auxcmds() is wrong as access
to the user buffer can fault and we are holding an ilocks.

little cleanups in devkbd.
2015-08-05 10:44:03 +02:00
cinap_lenrek f7514acc95 devkbd: disable mosue/keyboard on shutdown, disable ps2 mouse on init, remove kbdenable()/kbdinit()
on vmware, loading a new kernel sometimes reboots when
wiggling the mouse. disabling keyboard and mouse on
shutdown fixes the issue.
make sure ps2 mouse is disabled on init, will get re-enabled
in i8042auxenable().
keyboard isnt special anymore, we can just use the devreset
entry point in the device to do the keyboard initialization,
so kbdinit()/kbdenable() are not needed anymore.
2015-08-05 09:22:07 +02:00
cinap_lenrek 3ab80c9fe0 pc, pc64, xen: change return type of intrdisable() to void
intrdisable() will always be able to unregister the interrupt
now, so there is no reason to have it return an error value.

all drivers except uart8250 already assumed it to never fail
and theres no need to maintain that complexity.
2014-12-22 16:56:04 +01:00
cinap_lenrek 7523131e78 pc, pc64: untangle acpireset() from mpshutdown()
mpshutdown() used to call acpireset() making it impossible to build
a kernel without archacpi. now, mpshutdown() is a helper function
that only shuts down the application processors that gets used from
mpreset() and acpireset().

the generic machine reset code in exported by devarch's archreset()
function that is called by mpreset() and from acpireset() as a fallback.
so the code duplication that was in mpshutdown() is avoided.
2014-12-19 23:34:43 +01:00
cinap_lenrek bcb67353c1 pc, pc64: provide access to embedded controller with #P/ec file 2014-11-10 00:04:37 +01:00
cinap_lenrek bb95002c2d pc, pc64: implement acpi reset (for efi)
x230 booted in efi only (no csp) mode hangs
when traditional i8042reset() keyboard reset
is tried.

so we try acpireset() first which discoveres
and writes the acpi reset register.
2014-11-02 03:52:53 +01:00
cinap_lenrek e81e1a4aed pc, pc64: make mtrr() callable from interrupt context and before mpinit
to make it possible to mark the bootscreen framebuffer
as write combining in early initialization, mtrr() is
changed not not to error() but to return an error string.

as bootscreen() is used before multiprocessor initialization,
we have to synchronize the mtrr's for every processor as
it comes online. for this, a new mtrrsync() function is
provided that is called from cpuidentify() if mtrr support
is indicated.

the boot processor runs mtrrsync() which snarfs the
registers. later, mtrrsync() is run again from the
application processors which apply the values from the
boot processor.

checkmtrr() from mp.c was removed as its task is also
done by mtrrsync() now.
2014-10-21 06:03:03 +02:00
cinap_lenrek 3a6a754051 pc, pc64: initial machine check architecture support 2014-07-09 22:45:51 +02:00
cinap_lenrek a9155014c0 pc, pc64: handle sse simd exceptions 2014-05-11 05:59:10 +02:00
cinap_lenrek 8aff0e5be6 mp/pci: msi support for hypertransport platform 2013-09-09 00:44:08 +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 aa0627162b remove non standard COM3 (eia2) serial port from i8250 uart.
access to non standard serial port COM3 at i/o port 0x200 causes
kernel panic on some machines (Toshiba Sattelite 1415-S115). also,
some machines have gameport at 0x200.

i readded uartisa to the pcf and pccpuf kernel configurations so
one can use plan9.ini to add non standard uarts like:

uart2=type=isa port=0x200 irq=5
2013-01-13 10:23:31 +01:00
cinap_lenrek 4b4070a8b9 ratrace: fix race conditions and range check
the syscallno check in syscallfmt() was wrong. the unsigned
syscall number was cast to an signed integer. so negative
values would pass the check provoking bad memory access from
kernel. the check also has an off by one. one has to check
syscallno >= nsyscalls instead of syscallno > nsyscalls.

access to the p->syscalltrace string was not protected
from modification in devproc. you could awake the process
and cause it to free the string giving an opportunity for
the kernel to access bad memory. or someone could kill the
process (pexit would just free it).

now the string is protected by the usual p->debug qlock. we
also keep the string arround until it is overwritten again
or the process exists. this has the nice side effect that
one can inspect it after the process crashed.

another problem was that our validaddr() would error() instead
of pexiting the current process. the code was changed to only
access up->s.args after it was validated and copied instead of
accessing the user stack directly. this also prevents a sneaky
multithreaded process from chaning the arguments under us.

in case our validaddr() errors, we cannot assume valid user
stack after the waserror() if block. use up->s.arg[0] for the
noted() call to avoid bad access.
2012-11-23 20:27:09 +01:00
cinap_lenrek 347ac6ef58 guesscpuhz(), apm suspend
use fastclock timer (pit2) to measure cpufreq in guesscpuhz(). this
gives a bigger period minimizing the danger of overrun as pit2 runs
at the constant maximum period of 0x10000 ticks. also use smaller
loop increments (1000) and bigger maximum loop upper bound.

move the loops < ... check to the bottom of the loop so we get the
effective count *before* adding the next loop increment.

ilock() while doing measurements in guesscpuhz() to prevent accidents
with other processors reading fastclock or doing guesscpuhz()
in parralel.

export new i8253reset() function for apm to reset the timers after
a apm bios suspend.
2012-09-30 19:41:34 +02:00
cinap_lenrek e91301a401 rdmsr/wrmsr become tryrdmsr/trywrmsr, we can should check for trap 2012-08-31 16:48:33 +02:00
cinap_lenrek d436b2117e add unified sigsearch() function to look for bios data structures
replace the various functions that searched for bios data structures by
a single sigsearch() one in pc/memory.c that will probe the various bios
data areas.

also, a new checksum() function was added that is to be used to validate
the structures found.
2012-08-24 15:36:56 +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 1d58cb8832 pci: add pcicap 2012-02-11 00:49:39 +01:00
cinap_lenrek d4b7ca211d pc kernel: remove i8253link 2011-11-11 05:55:55 +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
cinap_lenrek b74418c2ce sb16: new approach, works in qemu 2011-05-18 19:57:31 +00:00
aiju fe668572ff added basic MSI and PCI capabilities support 2011-05-16 00:35:16 +00: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