Commit graph

226 commits

Author SHA1 Message Date
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 3844090f39 pc/pc64: reset DR7 in mmurelease 2017-06-12 19:46:25 +00:00
aiju 773be02aa1 kernel: add support for hardware watchpoints 2017-06-12 19:03:07 +00:00
aiju 1cfa405d0a pc64: set error code and trap fields in Ureg* on syscalls 2017-06-12 17:09:11 +00:00
cinap_lenrek 34f5a83330 pc64: state mp.h dependency for archacpi.$O 2017-04-11 02:26:39 +02:00
cinap_lenrek 557cbe10ad sdnvme: enable in pcf, pccpuf, pc64 kernel configuration 2017-03-30 23:37:28 +02:00
cinap_lenrek 4e8494aad7 pc kernel: handle PCMP and RSD being in low (kaddr) or reserved (vmap) memory
on thinkpad x1v4, the PCMP structure resides in upper reserved memory
pa=0xd7f49000 - while system memory ends at 0x0ffff000; so we have to
vmap() it instead of KADDR().

the RSD structure for ACPI might reside in low memory, so we sould
KADDR() in that case.
2017-03-25 04:08:14 +01:00
cinap_lenrek 8177d20fb2 kernel: get rid of active.Lock and active.thunderbirdsargo 2017-03-11 16:30:51 +01:00
cinap_lenrek a7f8ebca2f pc kernel: give cpu servers as many image cache strctures as processes 2017-03-11 16:28:11 +01:00
cinap_lenrek 5104934135 pc kernel: avoid AP's spinning in syncclock(), don't wait for thunderbirdsargo 2017-03-11 16:24:56 +01:00
mischief a4895f5e44 pc64: enable cputemp driver
works on on x301 and t420.
2017-03-01 02:43:51 -08:00
cinap_lenrek ea30cf94a5 pat write combinding support for 386 kernel, honor cpuid bits 2016-12-17 16:35:26 +01: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 1a782fda3e pc64: check if vmap() range fits in VMAPLEN window, remove unneeded vmapsync(), rename fault386() to faultamd64() 2016-11-17 01:28:11 +01:00
cinap_lenrek 0a5f81a442 kernel: switch to fast portable chacha based seed-once random number generator 2016-08-27 20:42:31 +02:00
cinap_lenrek 8d9a94a66e pc64: add etheryuk driver 2016-05-05 16:18:57 +02:00
cinap_lenrek a57a6e511f pc64: move idle() routine after CALL main(SB) as the comment suggests 2016-01-14 01:08:36 +01:00
cinap_lenrek ed4c812765 pc/pc64: backing out new mp startup code (caused issues with ramnode)
apparently, this causes some quadcore ramnode vm to hang on boot,
even tho all cores successfully started up and are operational.

i suspect some side effect from timersinit()... this would also
mean *notsc= would break it (syncclock() would continue)...
its unclear.

i'm reverting this for now until the problem is better understood.
2016-01-13 23:18:25 +01:00
cinap_lenrek 63f9a4fda3 pc/pc64: bring up ap's one after another, use idlehands() while waiting for thunderbirdsarego
when testing in qemu, launching each ap became slower and slower
because all the ap's where spinning in syncclock() waiting for
cpu0 to update its mach0->tscticks, which happens only much later
after all cpu's have been started up.

now we wait for each cpu to do its timer callibration and
manually update our tscticks while we wait and each cpu will
not spin but halt while waiting for active.thunderbirdsarego.
this reduces the system load and noise for timer callibration
and makes the mp startup linear with regard to the number of
cores.
2016-01-11 06:47:52 +01:00
cinap_lenrek 41383ad012 kernel: change active.machs from bitmap to char array to support up to 64 cpus on pc64 2016-01-05 05:32:40 +01:00
cinap_lenrek 7f3659e78f kernel: cleanup exit()/shutdown()/reboot() code
introduce cpushutdown() function that does the common
operation of initiating shutdown, returning once all
cpu's got the message and are about to shutdown. this
avoids duplicated code which isnt really machine specific.

automatic reboot on panic only when *debug= is not set
and the machine is a cpu server or has no display,
otherwise just hang.
2015-11-30 14:56:00 +01: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 b5655b7247 wifi: adjust transmit rate on error (for etheriwl), small mkfile changes
Wnode gets two new counters: txcount and txerror
and actrate pointer that will be between minrate
and maxrate.

driver should use actrate instead of maxrate for
transmission when it can provide error feedback.

when a driver detects a transmission failed, it calls
wifitxfail() with the original packet. wifitxfail() then
reduces wn->actrate.

every 256th packet, we optimistically increase wn->actrate
before transmitting.
2015-07-10 09:04:05 +02:00
cinap_lenrek 63879193e7 pc64: use unsigned long for kmapindex and mmu counts avoiding signed integer division 2015-07-07 21:13:36 +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 ed238e7ef8 etherwpi: Intel PRO Wireless 3945abg driver based on openbsd's if_wpi (thanks aap) 2015-06-28 18:32:54 +02:00
cinap_lenrek 00328b5759 pc, pc64: toggle bit 2 in port 0x61 to reset and enable PCI SERR# nmi's, print nmi status 2015-06-28 18:22:36 +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 bf365ac50e pc, pc64: state dependency to usbehci.h in mkfiles 2015-03-25 17:42:51 +01:00
cinap_lenrek 8e61a0036d usbohci: ensure Ed and Td alignment, fix for amd64 2015-03-22 17:41:35 +01:00
cinap_lenrek c6069e28ac pc, pc64: simplify intrdisable() 2015-02-20 18:43:32 +01:00
cinap_lenrek 581f3852fe pc, pc64: fix intrdisable() MaxIrqLAPIC -> MaxVectorAPIC (thanks mischief) 2015-02-18 06:30:01 +01:00
cinap_lenrek 995379e388 usbehci: initial support for usb on zynq, remove uncached.h
the following hooks have been added to the ehci Ctlr
structore to handle cache coherency (on arm):

	void*	(*tdalloc)(ulong,int,ulong);
	void*	(*dmaalloc)(ulong);
	void	(*dmafree)(void*);
	void	(*dmaflush)(int,void*,ulong);

tdalloc() is used to allocate descriptors and the periodic
frame schedule array. on arm, this needs to return uncached
memory. tdalloc()ed memory is never freed.

dmaalloc()/dmafree() is used for io buffers. this can return
cached memory when when hardware maintains cache coherency (pc)
or dmaflush() is provided to flush/invalidate the cache (zynq),
otherwise needs to return uncached memory.

dmaflush() is used to flush/invalidate the cache. the first
argument tells us if we need to flush (non zero) or
invalidate (zero).

uncached.h is gone now. this change makes the handling explicit.
2015-02-14 03:00:31 +01:00
stanley lieber cab445eb62 pc64: enable uartisa in default config 2015-02-07 01:01:11 -05:00
cinap_lenrek b8cf3cb879 kernel: reduce Page structure size by changing Page.cachectl[]
there are no kernels currently that do page coloring,
so the only use of cachectl[] is flushing the icache
(on arm and ppc).

on pc64, cachectl consumes 32 bytes in each page resulting
in over 200 megabytes of overhead for 32gb of ram with 4K
pages.

this change removes cachectl[] and adds txtflush ulong
that is set to ~0 by pio() to instruct putmmu() to flush
the icache.
2015-02-07 02:52:23 +01:00
cinap_lenrek 15590e39c6 igfx: implement hardware cursor
this can even be used with the vesa driver, just
enable the cursor after mode switch like:

echo hwgc igfxhwgc >/dev/vgactl
2015-01-09 22:23:25 +01:00
cinap_lenrek 6fe180657f igfx: work in progress intel graphics driver
this driver can modeset lvds on x200s and x230.
everything else is completely untested.
no hardware cursor implemented.
no vgadb entries are provided.
2015-01-09 02:55:12 +01: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 e0c221eea6 pc, pc64: fix intrdisable() to remove the Vctl entry even tho we can't disable the interrupt on apic 2014-12-22 16:10:18 +01:00
cinap_lenrek 515893dda6 pc, pc64, xen: simplify #P/irqalloc 2014-12-22 10:49:52 +01:00
cinap_lenrek e93cd703a2 pc64: enable devaoe and sdloop in kernel configuration 2014-12-19 02:40:45 +01:00
cinap_lenrek 2d06aac2ab pc, pc64: adjust mpshutdown() comment to reflect the current state 2014-12-19 23:57:43 +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 06e6115044 pc, pc64: remove old B.COM command line parsing and just pass tokenized BOOTLINE to /boot/boot as argv[]
this change allows command line passing to /boot/boot from qemu like:
qemu -kernel 9pcf -append "-u glenda tcp"
2014-12-17 09:23:21 +01:00
cinap_lenrek 5c29603f50 kernel: remove obsolete comment regarding Mntcache size in */main.c 2014-12-16 08:11:21 +01:00
cinap_lenrek 67bed722f2 kernel: get rid of /boot/boot parametrization
there is no use for "bootdisk" variable parametrization
of /boot/boot and no point for the boot section with its
boot methods in the kernel configuration anymore. so
mkboot and boot$CONF.out are gone.

move the rules for bootfs.paq creation in 9/boot/bootmkfile.
location of bootfs.proto is now in 9/boot/bootfs.proto.
our /boot/boot target is now just "boot".
2014-12-14 22:10:34 +01:00
cinap_lenrek 25a9cc3adb pc, pc64: untangle embedded controller (ec) dependency from devarch 2014-12-13 06:23:23 +01:00
mischief 1fe69754b6 pc, pc64: add and enable ethervirtio driver
many thanks to cinap_lenrek, erik quanstrom and david du colombier for feedback and testing.
2014-12-06 22:13:44 -08:00
cinap_lenrek 529082d34d pc, pc64: preserve last KB of conventional memory (might contain bios tables)
we add new function convmemsize() that returns the size of
*usable* conventional memory that does some sanity checking
and reserves the last KB below the top of memory pointer.

this avoids lowraminit() overriding potential bios tables
and sigsearch() going off the rails looking for tables
at above 640K.
2014-11-20 19:05:43 +01:00
cinap_lenrek 4e00cf6b17 pc64: get rid of fixed 8MB INIMAP and dynamically map KZERO-end in l.s
traditionally, the pc kernel mapped the first 8MB of physical
address space. when the kernel size grows beyond that memory mapping,
it will crash on boot and theres no checking in the build process
making sure it fits.

with the pc64 kernel, it is not hard to always map the whole
kernel memory image from KZERO to end[], so that the kernel will
always fit into the initial mapping.
2014-11-15 11:43:05 +01:00
cinap_lenrek bd7e387b51 pc64: fix comment description of pc64 kernel configuration 2014-11-10 12:22:50 +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 b18a641397 kernel: remove implicit Proc* argument from procctl()
procctl() is always called with up and it would not
work correctly if passed a different process, so
remove the Proc* argument and use up directly.
2014-11-09 08:19:28 +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 2020190f94 pc, pc64: more sanity checking for lowraminit() 2014-11-02 00:32:46 +01:00
cinap_lenrek 153f96ebc6 pc64: remove unused pdballoc and pdbfree counters from mach structure 2014-11-01 20:53:36 +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 0a6439a1f5 pc, pc64: allow passing RSDT pointer in *acpi= boot parameter, early bootscreeninit(), fix rampage() usage
rampage() cannot be used after meminit(), so test for
conf.mem[0].npage != 0 and use xalloc()/mallocalign()
instead. this allows us to use vmap() early before
mmuinit() which is needed for bootscreeninit() and
acpi.

to get memory for page tables, pc64 needs a lowraminit().

with EFI, the RSDT pointer is passed in *acpi= parameter
from the efi loader. as the RSDT is ususally at the end of
the physical address space (and not to be found in
bios areas), we cannot KMAP() it so we need to vmap().
2014-10-18 02:01:58 +02:00
mischief ee29c17639 pc64: enable rtl8169 driver (thanks awabimakoto for testing) 2014-09-24 14:19:22 -07:00
cinap_lenrek 47e52123d0 pc64: print "Plan 9" on boot, cleanup pccpu64 files 2014-09-21 16:06:25 +02:00
cinap_lenrek 6031dd83b6 pc64: enable ether8139 in kernel config (thanks hiro) 2014-08-22 00:00:06 +02:00
cinap_lenrek 0d5491fb08 pc, pc64: fix off by one error in _multibootentry 2014-08-18 03:16:11 +02:00
cinap_lenrek 0a101736b8 pc, pc64: make pc kaddr() check reject -KZERO address (thanks aiju) 2014-08-07 21:11:11 +02:00
cinap_lenrek ca4f815cfc pc64: fix wrong Ureg* argument on note handler (thanks _sl!)
_sl reported crash:

stats 593: suicide: sys: trap: fault write addr=0xffffffff8258d1b0 pc=0x204cc7

; acid 593
/proc/593/text:amd64 plan 9 executable
/sys/lib/acid/port
/sys/lib/acid/amd64
acid: lstk()
notejmp(ret=0x1,j=0x40ac90)+0x13 /sys/src/libc/amd64/notejmp.c:10
alarmed(a=0xffffffff8258d1b0,s=0x7ffffeffea58)+0x3f /sys/src/cmd/stats.c:718
notifier+0x3e /sys/src/libc/port/atnotify.c:15
acid:

note how a in alarmed is a kernel address!

the first Ureg* argument is passed to the note handler in the
RARG (BX) register, which was not loaded when returning to
userspace from syscall() thru forkret(). fix by returning thru
noteret() from syscall().
2014-08-07 19:55:25 +02:00
cinap_lenrek 1021caa395 pc64: cleanup syscallentry()
avoid the stack shuffeling and make syscallentry() and
forkret() use the same stack offsets.
2014-07-21 18:02:14 +02:00
cinap_lenrek c78c6e349a pc64: dont save/restore DS/ES/FS/GS segment registers on syscall or interrupt, they are ignored in long mode.
we do not support 32 bit processes and DS, ES, FS and GS segment
registers are ignored in long mode, so theres no point in saving
and restoring them.
2014-07-20 02:59:45 +02:00
cinap_lenrek 20b7a19c58 pc64: preserve user extern registers R14 and R15 across syscalls, use Ureg.bp (RARG) for syscall number
the 6c compiler reserves R14 and R15 for extern register variables,
which is used by the kernel to hold the m and up pointers. until
now, the meaning of R14 and R15 was undefined for userspace and
extern register would not work as the kernel trashes R14 and R15
on syscalls. with this change, user extern registers R14 and R15
are zeroed on exec and otherwise preserved across syscalls. so
userspace *could* use them for per process variables like the
kernel does.

use Ureg.bp (RARG) for syscall number instead of Ureg.ax. this is
less confusing and mirrors the amd64 calling convention.
2014-07-20 22:49:02 +02:00
cinap_lenrek 3a6a754051 pc, pc64: initial machine check architecture support 2014-07-09 22:45:51 +02:00
cinap_lenrek e7bfa556ad pc64: fix comment for preallocpages() 2014-06-22 16:05:53 +02:00
cinap_lenrek e6f37cf64e pc64: fix MS2HZ (thanks Anthony Martin) 2014-06-13 10:19:46 +02:00
cinap_lenrek fcfa74a1cf pc64: use pc/pcrandom.$O instead of port/random.$O for RDRAND instruction support 2014-06-08 04:40:18 +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 865368f604 pc64: remove unneeded parens in pmap() 2014-06-07 09:43:37 +02:00
cinap_lenrek 7bc8f4d993 pc64: implement checkmmu() debug function 2014-06-07 09:26:57 +02:00
cinap_lenrek 76db435e3c pc64: dont trap _xinc()/_xdec() overflow/underflow, delete unused atomic functions 2014-06-05 07:57:23 +02:00
cinap_lenrek 1427ba3126 pc64: fix for unsigned comparsion of (top - base) >= size
the rounding of base can make it above top, so have to
use signed comparsion.
2014-06-01 06:54:55 +02:00
cinap_lenrek fb97665a14 pc64: use 2MB pages for preallocpages() 2014-06-01 06:31:50 +02:00
cinap_lenrek c9f91d5015 pc64: allocate palloc.pages from upages
the palloc.pages array takes arround 5% of the upages which
gives us:

16GB = ~0.8GB
32GB = ~1.6GB
64GB = ~3.2GB

we only have 2GB of address space above KZERO so this will not
work for long.

instead, pageinit() was altered to accept a preallocated memory
in palloc.pages. and preallocpages() in pc64/main.c allocates the
in upages memory, mapping it in the VMAP area (which has 512GB).

the drawback is that we cannot poke at Page structures now from
/proc/n/mem as the VMAP area is not accessible from it.
2014-06-01 03:13:58 +02:00
cinap_lenrek 5246416621 pc, pc64: simplify reboot code
as we do system reset and reboot only from boot processor cpu0 now,
theres no need for active.rebooting conditional variable.
mpshutdown() will unconditionally park application processors and
and cpu0 boots the new kernel or calls mpshutdown() causing system
reset.
2014-05-29 18:50:52 +02:00
cinap_lenrek c5214cd6d9 pc64: cleanup mmuzap 2014-05-25 20:34:26 +02:00
cinap_lenrek 06ad4e5fff pc64: remove cpuserver bigboy hack and honor *kernelpercent= 2014-05-19 06:57:04 +02:00
cinap_lenrek 17d932eca9 pc, pc64: add simd error exception name in trap.c 2014-05-11 06:17:13 +02:00
cinap_lenrek a9155014c0 pc, pc64: handle sse simd exceptions 2014-05-11 05:59:10 +02:00
cinap_lenrek 59e53f818d pc64: fix embrassing typo in mmuzap() 2014-05-06 18:59:56 +02:00
cinap_lenrek 405de1e6a2 pc64: increase sizes of physical memory bank maps
number of bank slots in Conf.mem[4] was too small
for kenjis machine, set it to maximum 16 (the
size of the RAM map in pc64/memory.c).

also increasing the UPA memory map to 64. the
e820 map on my x200s has 31 entries and many
holes. this gets rid of the "mapfree: ... losing"
messages on boot.
2014-05-01 17:24:50 +02:00
cinap_lenrek d4abe404b4 pc64: prevent dat.h from getting overwritten by ../pc/dat.h
the rule that was used to copy header files from ../pc
accidently overwrote dat.h when ../pc/dat.h was updated
because it matched on all *.h files that was also found
in ../pc directory. change to exact match on $PCHEADERS
to prevent this.
2014-03-24 19:00:34 +01:00
cinap_lenrek 294e940f57 pc64: serial console support 2014-03-21 18:59:21 +01:00
cinap_lenrek da62091c07 pc64: port etherbcm
do not store Block* pointer in packet descriptor, assumed
pointer would fit in a long. we use pointer table now to
record the Block* pointer and store index instead.
2014-03-19 09:00:20 +01:00
cinap_lenrek f2f46f4a33 pc64: amd64 kernel reboot support 2014-03-16 20:22:59 +01:00
cinap_lenrek 38c0dfacab pc64: fix swaped error/flags in dumpregs(), remove misleading comment in apbootstrap 2014-03-16 02:28:04 +01:00
cinap_lenrek 469dfca25f pc64: add R8-R15 in dumpregs() 2014-03-15 04:38:14 +01:00
cinap_lenrek a8af25ef81 kernel: interpret service= boot parameter to set "cpuserver" variable 2014-03-15 00:55:02 +01:00
cinap_lenrek 316d8ad76b pc64: fix segattach
the comment about Physseg.size being in pages is wrong,
change type to uintptr and correct the comment.

change the length parameter of segattach() and isoverlap()
to uintptr as well. segments can grow over 4GB in pc64 now
and globalsegattach() in devsegment calculates len argument
of isoverlap() by s->top - s->bot. note that the syscall
still takes 32bit ulong argument for the length!

check for integer overflow in segattach(), make sure segment
goes not beyond USTKTOP.

change PTEMAPMEM constant to uvlong as it is used to calculate
SEGMAXSIZE.
2014-03-04 22:37:15 +01:00
cinap_lenrek 2e6234da0f pc64: multiboot support 2014-03-01 19:35:40 +01:00
cinap_lenrek fd112b949f pc64: enable pmmc driver 2014-03-01 05:50:20 +01:00
cinap_lenrek ef1ec09cf7 pc64: fix mmu leak 2014-02-23 18:40:43 +01:00
cinap_lenrek 240ba73770 pc64: fix mistake 2014-02-15 16:58:35 +01:00
cinap_lenrek 25189924db pc64: simplify mmuwalk by factoring out mmu page table creation into separate function 2014-02-15 16:43:55 +01:00
cinap_lenrek ebeb501cff pc64: support for vmware PCnet ethernet 2014-02-15 06:17:38 +01:00
cinap_lenrek 32604cd830 pc64: move VMAP into its own PDP (for vmware)
modifying the kernel pdp (CPU0PDP) hangs vmware. so
we initialize the pdp with KZERO and KZERO+1GB map
in l.s and never change it. (except when removing
the zero double map which seems to work).

VMAP has its own pdp now allowing to map 512GB of
physical address space. this simplifies the code
a bit and gives nice virtual addresses.
2014-02-15 06:17:05 +01:00
mischief 7d73312def pc64: add ahci.h to PCHEADERS so it will be removed on mk clean 2014-02-12 03:02:23 -08:00
mischief 6edd7255c7 pc64: remove ethermii.h and copy it from pc instead 2014-02-12 03:00:12 -08:00
Matthew Veety 6a12aef885 added pccpu64 for cpuservers. also enabled etherigbe in pc64 and pccpu64 2014-02-12 21:05:04 -05:00
cinap_lenrek 7f73792ef9 pc64: limit memory of per processor mmu freelist to 1MB 2014-02-10 02:37:45 +01:00
cinap_lenrek c4679d743a pc64: return up in RUSER (BP) for devproc kregs file 2014-02-10 23:12:52 +01:00
cinap_lenrek 9bdf602ebb pc64: pass Ureg* argument in BP to userspace note handler 2014-02-09 02:23:33 +01:00
cinap_lenrek eaafcf2187 pc64: bump segment limit to 64GB 2014-02-08 00:23:18 +01:00
mischief fc7f6f8e99 pc64: ensure user pc is never set to a non-canonical address through setregisters
on intel processors, a general protection exception is fired if a non-canonical address is loaded into PC during SYSRET. this will cause the kernel to panic.

see http://www.kb.cert.org/vuls/id/649219 and the intel software developer manual for more information.
2014-02-06 18:03:17 -08:00
cinap_lenrek c065eadb53 pc64: fix note handling 2014-02-06 22:43:33 +01:00
cinap_lenrek bfbc5ab197 pc64: fix kmap()
kmapindex has to be per process, not per mach, as the process
can be switched to another processor while the mapping is
established.

to bootstrap the first process, we have to temporarily set up
so the kmap MMU's can be attached to the process. previously
we assumed that the first two pages for the initial process
where below 2GB and could be accessed with KADDR() directly.
with 16GB machine, all the 2GB above KZERO are dedicated to
the kernel so the user pages returned by newpage() need to
be mapped.
2014-02-06 22:41:42 +01:00
mischief 1eef373152 pc64: fix up pointer calculations and enable sdvirtio disk driver 2014-02-03 01:22:26 -08:00
cinap_lenrek 34f7e4ef9a pc64: remove cinaps cga screen interrupt debugger, was experiment... 2014-02-04 02:08:26 +01:00
cinap_lenrek de0712c0b5 pc64: dont dump user registers on exception, was experiment... 2014-02-04 02:06:11 +01:00
mischief 35d19fc6fb merge 2014-02-02 07:41:56 -08:00
cinap_lenrek 6a55790197 pc/pc64: move common code to pc/devarch.c 2014-02-03 06:24:31 +01:00
cinap_lenrek c3028fb924 pc64: implement shutdown and idlehands
just copies from pc kernel. should refactor into common
pc code.
2014-02-03 05:29:53 +01:00
mischief d082e3a5ae pc64: enable sdide driver 2014-02-02 07:34:54 -08:00
cinap_lenrek bfee76e5d3 pc64: track per process kmap page tables in separate MMU list.
we have to keep kmap page tables in ther own list
because user tables are subject to (virtual) tlb flushing.

we never free kmap page tables except in mmurelease()
where we just link the kmap mmu list in front of the user
mmus and call mmufree() which will free all the mmu's
of the process.
2014-02-02 18:01:13 +01:00
cinap_lenrek 02fef73b8f pc64: dont dump registers for user process on pagefault error, was experiment 2014-02-02 09:39:58 +01:00
cinap_lenrek 2a4f7a1eb1 pc64: no need to flush tlb in kunmap(), was experiment 2014-02-02 09:22:23 +01:00
cinap_lenrek db2e22aebe pc64: fix mmu structure leakage, implement global pool 2014-02-02 08:12:08 +01:00
cinap_lenrek 47f551bcea pc64: print only 8 hex chars dumpstack sp/pc
kernel addresses are sign extended to 64 bit. upper bits
are not really helpfull.
2014-02-02 05:49:30 +01:00
cinap_lenrek e289fd8ccd pc64: fix vmap
VMAP address calculation was all wrong resulting
in vmaps get mapped into KZERO map.
2014-02-02 05:10:58 +01:00
cinap_lenrek 0850718033 pc64: enable iahci support 2014-02-01 20:27:54 +01:00
cinap_lenrek 56343cafcf add experimental pc64 kernel 2014-02-01 10:25:10 +01:00