Commit graph

964 commits

Author SHA1 Message Date
cinap_lenrek d80826d6e5 vgai81x: remove unused mach0 variable 2019-12-02 08:26:34 +01:00
cinap_lenrek a9be1374a0 pc: fix ldt memory leak in procsetup() 2019-12-02 07:43:45 +01:00
cinap_lenrek 21a599743e pc, pc64: merge adjacent e820 map entries of same type
some machines give us over 300 e820 ram entries that are
all adjacent to each other causing us to run out of Map
end Emap entries.

this change adds e820clean() function, which sorts the
current e820 map and discards unusable entries and merges
adjacent entries. e820clean() is called after we parsed
the *e820= boot parameter or when we run out of entries.

an example of such a broken e820 map (thanks mischief):

*e820=1 0000000000000000 0000000000008000 1 0000000000008000 000000000000c000 1 000000000000c000 000000000003f000 1 000000000003f000 0000000000040000 1 0000000000040000 00000000000a0000 1 0000000000100000 0000000001000000 1 0000000001000000 0000000001020000 1 0000000001020000 0000000009d82000 2 0000000009d82000 000000000a000000 1 000000000a000000 000000000a200000 4 000000000a200000 000000000a20b000 1 000000000a20b000 000000000b000000 2 000000000b000000 000000000b020000 1 000000000b020000 0000000010000000 1 0000000010000000 000000001000b000 1 000000001000b000 00000000d9634000 1 00000000d9634000 00000000d96be000 1 00000000d96be000 00000000d96cc000 1 00000000d96cc000 00000000d96db000 1 00000000d96db000 00000000d97df000 1 00000000d97df000 00000000d97ed000 1 00000000d97ed000 00000000d9837000 1 00000000d9837000 00000000d9844000 1 00000000d9844000 00000000d985e000 1 00000000d985e000 00000000d9865000 1 00000000d9865000 00000000d9897000 1 00000000d9897000 00000000d98d7000 1 00000000d98d7000 00000000d98db000 1 00000000d98db000 00000000d98dd000 1 00000000d98dd000 00000000d999d000 1 00000000d999d000 00000000d9a8e000 1 00000000d9a8e000 00000000d9add000 1 00000000d9add000 00000000d9ae2000 1 00000000d9ae2000 00000000d9af3000 1 00000000d9af3000 00000000d9af4000 1 00000000d9af4000 00000000d9af6000 1 00000000d9af6000 00000000d9af7000 1 00000000d9af7000 00000000d9af8000 1 00000000d9af8000 00000000d9af9000 1 00000000d9af9000 00000000d9b5e000 1 00000000d9b5e000 00000000d9b60000 1 00000000d9b60000 00000000d9b8c000 1 00000000d9b8c000 00000000d9b8d000 1 00000000d9b8d000 00000000d9c85000 1 00000000d9c85000 00000000d9c8a000 1 00000000d9c8a000 00000000d9caf000 1 00000000d9caf000 00000000d9cb5000 1 00000000d9cb5000 00000000d9cc1000 1 00000000d9cc1000 00000000d9cc2000 1 00000000d9cc2000 00000000da986000 1 00000000da986000 00000000daeb6000 1 00000000daeb6000 00000000daed7000 1 00000000daed7000 00000000daed8000 1 00000000daed8000 00000000daf61000 1 00000000daf61000 00000000daf7c000 1 00000000daf7c000 00000000db3e6000 1 00000000db3e6000 00000000db4ea000 1 00000000db4ea000 00000000db57d000 1 00000000db57d000 00000000db587000 1 00000000db587000 00000000db58a000 1 00000000db58a000 00000000db58b000 1 00000000db58b000 00000000db591000 1 00000000db591000 00000000db5a7000 1 00000000db5a7000 00000000db5b2000 1 00000000db5b2000 00000000db5ba000 1 00000000db5ba000 00000000db5bb000 1 00000000db5bb000 00000000db5c6000 1 00000000db5c6000 00000000db5c7000 1 00000000db5c7000 00000000db5c8000 1 00000000db5c8000 00000000db5c9000 1 00000000db5c9000 00000000db5cb000 1 00000000db5cb000 00000000db5d0000 1 00000000db5d0000 00000000db5e8000 1 00000000db5e8000 00000000db5ea000 1 00000000db5ea000 00000000db5eb000 1 00000000db5eb000 00000000db5ee000 1 00000000db5ee000 00000000db601000 1 00000000db601000 00000000db602000 1 00000000db602000 00000000db60e000 1 00000000db60e000 00000000db610000 1 00000000db610000 00000000db612000 1 00000000db612000 00000000db614000 1 00000000db614000 00000000db61d000 1 00000000db61d000 00000000db645000 1 00000000db645000 00000000db64c000 1 00000000db64c000 00000000db650000 1 00000000db650000 00000000db651000 1 00000000db651000 00000000db653000 1 00000000db653000 00000000db658000 1 00000000db658000 00000000db659000 1 00000000db659000 00000000db661000 1 00000000db661000 00000000db662000 1 00000000db662000 00000000db665000 1 00000000db665000 00000000db677000 1 00000000db677000 00000000db69d000 1 00000000db69d000 00000000db6a0000 1 00000000db6a0000 00000000db6a8000 1 00000000db6a8000 00000000db6ae000 1 00000000db6ae000 00000000db6c2000 1 00000000db6c2000 00000000db6d4000 1 00000000db6d4000 00000000db6de000 1 00000000db6de000 00000000db6e0000 1 00000000db6e0000 00000000db6e2000 1 00000000db6e2000 00000000db6ef000 1 00000000db6ef000 00000000db6f0000 1 00000000db6f0000 00000000db6f2000 1 00000000db6f2000 00000000db6f3000 1 00000000db6f3000 00000000db810000 1 00000000db810000 00000000db815000 1 00000000db815000 00000000db81f000 1 00000000db81f000 00000000db821000 1 00000000db821000 00000000db85d000 1 00000000db85d000 00000000db869000 1 00000000db869000 00000000db881000 1 00000000db881000 00000000db889000 1 00000000db889000 00000000db88e000 1 00000000db88e000 00000000db88f000 1 00000000db88f000 00000000db891000 1 00000000db891000 00000000db899000 1 00000000db899000 00000000db8a9000 1 00000000db8a9000 00000000db8ab000 1 00000000db8ab000 00000000db8af000 1 00000000db8af000 00000000db8b1000 1 00000000db8b1000 00000000db8b5000 1 00000000db8b5000 00000000db8b7000 1 00000000db8b7000 00000000db8be000 1 00000000db8be000 00000000db8c2000 1 00000000db8c2000 00000000db8c7000 1 00000000db8c7000 00000000db8cf000 1 00000000db8cf000 00000000db8e0000 1 00000000db8e0000 00000000db8e1000 1 00000000db8e1000 00000000db8e2000 1 00000000db8e2000 00000000db8e6000 1 00000000db8e6000 00000000db8e8000 1 00000000db8e8000 00000000db8f4000 1 00000000db8f4000 00000000db904000 1 00000000db904000 00000000db90c000 1 00000000db90c000 00000000db91c000 1 00000000db91c000 00000000db91d000 1 00000000db91d000 00000000db922000 1 00000000db922000 00000000db923000 1 00000000db923000 00000000db929000 1 00000000db929000 00000000db92b000 1 00000000db92b000 00000000db92d000 1 00000000db92d000 00000000db92f000 1 00000000db92f000 00000000db933000 1 00000000db933000 00000000db934000 1 00000000db934000 00000000db936000 1 00000000db936000 00000000db937000 1 00000000db937000 00000000db952000 1 00000000db952000 00000000db96b000 1 00000000db96b000 00000000db998000 1 00000000db998000 00000000db9a1000 1 00000000db9a1000 00000000db9a2000 1 00000000db9a2000 00000000db9a3000 1 00000000db9a3000 00000000db9a4000 1 00000000db9a4000 00000000db9a5000 1 00000000db9a5000 00000000db9a7000 1 00000000db9a7000 00000000db9a8000 1 00000000db9a8000 00000000db9aa000 1 00000000db9aa000 00000000db9ba000 1 00000000db9ba000 00000000db9da000 1 00000000db9da000 00000000db9f7000 1 00000000db9f7000 00000000dba00000 1 00000000dba00000 00000000dba0a000 1 00000000dba0a000 00000000dba11000 1 00000000dba11000 00000000dba12000 1 00000000dba12000 00000000dba51000 1 00000000dba51000 00000000dba5d000 1 00000000dba5d000 00000000dba6c000 1 00000000dba6c000 00000000dba88000 1 00000000dba88000 00000000dba92000 1 00000000dba92000 00000000dba94000 1 00000000dba94000 00000000dbac0000 1 00000000dbac0000 00000000dbac6000 1 00000000dbac6000 00000000dbad2000 1 00000000dbad2000 00000000dbad9000 1 00000000dbad9000 00000000dbae0000 1 00000000dbae0000 00000000dbaeb000 1 00000000dbaeb000 00000000dbaf6000 1 00000000dbaf6000 00000000dbb01000 1 00000000dbb01000 00000000dbb17000 1 00000000dbb17000 00000000dbb1f000 1 00000000dbb1f000 00000000dbb20000 1 00000000dbb20000 00000000dbb23000 1 00000000dbb23000 00000000dbb24000 1 00000000dbb24000 00000000dbb25000 1 00000000dbb25000 00000000dbb3a000 1 00000000dbb3a000 00000000dbb3d000 1 00000000dbb3d000 00000000dbb43000 1 00000000dbb43000 00000000dbb45000 1 00000000dbb45000 00000000dbb49000 1 00000000dbb49000 00000000dbb4c000 1 00000000dbb4c000 00000000dbb4e000 1 00000000dbb4e000 00000000dbb51000 1 00000000dbb51000 00000000dbb54000 1 00000000dbb54000 00000000dbb5a000 1 00000000dbb5a000 00000000dbb5e000 1 00000000dbb5e000 00000000dbb62000 1 00000000dbb62000 00000000dbb67000 1 00000000dbb67000 00000000dbb91000 1 00000000dbb91000 00000000dbb93000 1 00000000dbb93000 00000000dbb94000 1 00000000dbb94000 00000000dbb9d000 1 00000000dbb9d000 00000000dbb9f000 1 00000000dbb9f000 00000000dbbcf000 1 00000000dbbcf000 00000000dbbd0000 1 00000000dbbd0000 00000000dbbd1000 1 00000000dbbd1000 00000000dbbd5000 1 00000000dbbd5000 00000000dbbd6000 1 00000000dbbd6000 00000000dbbd7000 1 00000000dbbd7000 00000000dbbd8000 1 00000000dbbd8000 00000000dbbd9000 1 00000000dbbd9000 00000000dbbdd000 1 00000000dbbdd000 00000000dbbdf000 1 00000000dbbdf000 00000000dbbe1000 1 00000000dbbe1000 00000000dbbeb000 1 00000000dbbeb000 00000000dbbec000 1 00000000dbbec000 00000000dbbef000 1 00000000dbbef000 00000000dbbff000 1 00000000dbbff000 00000000dbc01000 1 00000000dbc01000 00000000dbc05000 1 00000000dbc05000 00000000dbc0f000 1 00000000dbc0f000 00000000dbc11000 1 00000000dbc11000 00000000dbc12000 1 00000000dbc12000 00000000dbc14000 1 00000000dbc14000 00000000dbc15000 1 00000000dbc15000 00000000dbc20000 1 00000000dbc20000 00000000dbc21000 1 00000000dbc21000 00000000dbc22000 1 00000000dbc22000 00000000dbc2a000 1 00000000dbc2a000 00000000dbc2c000 1 00000000dbc2c000 00000000dbc2d000 1 00000000dbc2d000 00000000dbc2f000 1 00000000dbc2f000 00000000dbc30000 1 00000000dbc30000 00000000dbc42000 1 00000000dbc42000 00000000dbc44000 1 00000000dbc44000 00000000dbc54000 1 00000000dbc54000 00000000dbc5c000 1 00000000dbc5c000 00000000dbc5e000 1 00000000dbc5e000 00000000dbc60000 1 00000000dbc60000 00000000dbc64000 1 00000000dbc64000 00000000dbc6d000 1 00000000dbc6d000 00000000dbc7f000 1 00000000dbc7f000 00000000dbc85000 1 00000000dbc85000 00000000dbca3000 1 00000000dbca3000 00000000dbca6000 1 00000000dbca6000 00000000dbcb9000 1 00000000dbcb9000 00000000dbcba000 1 00000000dbcba000 00000000dbcbb000 1 00000000dbcbb000 00000000dbcbc000 1 00000000dbcbc000 00000000dbcbd000 1 00000000dbcbd000 00000000dbcd5000 1 00000000dbcd5000 00000000dbcd8000 1 00000000dbcd8000 00000000dbcd9000 1 00000000dbcd9000 00000000dbcda000 1 00000000dbcda000 00000000dbce1000 1 00000000dbce1000 00000000dbce3000 1 00000000dbce3000 00000000dbce4000 1 00000000dbce4000 00000000dbd06000 1 00000000dbd06000 00000000dbd07000 1 00000000dbd07000 00000000dbd0a000 1 00000000dbd0a000 00000000dbd0b000 1 00000000dbd0b000 00000000dbd0c000 1 00000000dbd0c000 00000000dbd0e000 1 00000000dbd0e000 00000000dbd10000 1 00000000dbd10000 00000000dbd12000 1 00000000dbd12000 00000000dbd15000 1 00000000dbd15000 00000000dbd17000 1 00000000dbd17000 00000000dbd19000 1 00000000dbd19000 00000000dbd1b000 1 00000000dbd1b000 00000000dbd44000 1 00000000dbd44000 00000000dbd46000 1 00000000dbd46000 00000000dbd60000 1 00000000dbd60000 00000000dbd70000 1 00000000dbd70000 00000000dbd79000 1 00000000dbd79000 00000000dbd7a000 1 00000000dbd7a000 00000000dbd7c000 1 00000000dbd7c000 00000000dbd7d000 1 00000000dbd7d000 00000000dbd90000 1 00000000dbd90000 00000000dbd93000 1 00000000dbd93000 00000000dbd97000 1 00000000dbd97000 00000000dbd9a000 1 00000000dbd9a000 00000000dbd9b000 1 00000000dbd9b000 00000000dbd9e000 1 00000000dbd9e000 00000000dbda1000 1 00000000dbda1000 00000000dbda5000 1 00000000dbda5000 00000000dbda9000 1 00000000dbda9000 00000000dbdaf000 1 00000000dbdaf000 00000000dbdb3000 1 00000000dbdb3000 00000000dbdb4000 1 00000000dbdb4000 00000000dbdbe000 1 00000000dbdbe000 00000000dbdbf000 1 00000000dbdbf000 00000000dbdc0000 1 00000000dbdc0000 00000000dbdc1000 1 00000000dbdc1000 00000000dbdc2000 1 00000000dbdc2000 00000000dbdc5000 1 00000000dbdc5000 00000000dbdc6000 1 00000000dbdc6000 00000000dbdc7000 1 00000000dbdc7000 00000000dbdcb000 1 00000000dbdcb000 00000000dbdcf000 1 00000000dbdcf000 00000000dbdd5000 1 00000000dbdd5000 00000000dbdd8000 1 00000000dbdd8000 00000000dbddf000 1 00000000dbddf000 00000000dbde1000 1 00000000dbde1000 00000000dbde5000 1 00000000dbde5000 00000000dbde8000 1 00000000dbde8000 00000000dbded000 1 00000000dbded000 00000000dbdf0000 1 00000000dbdf0000 00000000dbdf4000 1 00000000dbdf4000 00000000dbdf7000 1 00000000dbdf7000 00000000dbdfb000 1 00000000dbdfb000 00000000dbe1e000 1 00000000dbe1e000 00000000dbe20000 1 00000000dbe20000 00000000dbe23000 1 00000000dbe23000 00000000dbe27000 1 00000000dbe27000 00000000dbe28000 1 00000000dbe28000 00000000dbe2a000 1 00000000dbe2a000 00000000dbe2b000 1 00000000dbe2b000 00000000dc24d000 1 00000000dc24d000 00000000dc25c000 1 00000000dc25c000 00000000dc25d000 1 00000000dc25d000 00000000dc25e000 1 00000000dc25e000 00000000dc273000 1 00000000dc273000 00000000dc274000 1 00000000dc274000 00000000dc275000 1 00000000dc275000 00000000dc276000 1 00000000dc276000 00000000dc27a000 1 00000000dc27a000 00000000dc27e000 1 00000000dc27e000 00000000dc283000 1 00000000dc283000 00000000dc284000 1 00000000dc284000 00000000dc2a2000 1 00000000dc2a2000 00000000dc2a6000 1 00000000dc2a6000 00000000dd163000 2 00000000dd163000 00000000dd2a8000 1 00000000dd2a8000 00000000dd42a000 4 00000000dd42a000 00000000dd83e000 1 00000000dd83e000 00000000de38b000 1 00000000de38b000 00000000de430000 1 00000000de430000 00000000de733000 1 00000000de733000 00000000de74f000 1 00000000de74f000 00000000de770000 1 00000000de770000 00000000de77d000 1 00000000de77d000 00000000de783000 1 00000000de783000 00000000de78b000 1 00000000de78b000 00000000de7a4000 1 00000000de7a4000 00000000de7b4000 1 00000000de7b4000 00000000de7c9000 1 00000000de7c9000 00000000de7e0000 1 00000000de7e0000 00000000deff9000 1 00000000deff9000 00000000df000000 1 0000000100000000 000000021f380000 2 00000000000a0000 0000000000100000 2 00000000df000000 00000000e0000000 2 00000000f8000000 00000000fc000000 2 00000000fd000000 0000000100000000
2019-12-01 14:06:30 +01:00
cinap_lenrek d32e5d130c sd53c8xx: fix the driver for amd64, fix alignment/padding issues, fix freechain handling 2019-11-24 21:56:54 +01:00
cinap_lenrek 44615fba43 sdiahci: implement reset timeout for ahciencreset(), make blink() never block, fix map[] access in ledkproc()
Ori_B reports that his controller gets stuck in the ahciencreset()
wait loop. so we implement a 1000 ms timeout. we replace delay()
with esleep() as we are always called from the ledkproc().

blink() could enter infinite delay loop as well, so instead of
waiting for the message to get transmitted we exit making it
non-blocking (we will get called again anyway).

the access to the controller map[] was wrong in ledkproc(). the
index is the controller number, not the drive number!
2019-11-17 21:19:55 +01:00
cinap_lenrek e38f75fc45 ether82563: fix multicast for i210
MTA has 128 entries, according to section 8.10.15 in the datasheet.
this fixes ipv6 in apu2 which has 3x i210 (8086/157b).
2019-10-11 21:38:12 +02:00
cinap_lenrek db911d4fef sdiahci: force Hudson SATA Controller to AHCI mode 2019-10-08 13:53:57 +02:00
cinap_lenrek c0f464b98f pc: move low-level allocation details out of mmu.c into memory.c rampage() function 2019-10-02 01:01:34 +02:00
cinap_lenrek 0ee738ef8c vgai81x: use vmap() for uncached access to cursor data instead of manipulating kernel page table
on 386, the kernel memory region is mapped using huge 4MB pages
(when supported by the cpu). so the uncached pte manipulation
does not work to map the cursor data with uncached attribute.

instead, we allocate a memory page using newpage() and map
it globally using vmap(), which maps it uncached.
2019-10-02 00:58:46 +02:00
cinap_lenrek 7de7444c6e sdide: silence compiler warning in atadebug() 2019-09-09 16:56:01 +02:00
cinap_lenrek 1e773c97e7 pc64: implement NX bit discovery, map kernel mappings no-execute 2019-08-27 03:55:12 +02:00
cinap_lenrek 2149600d12 kernel: catch execution read fault on SG_NOEXEC segment
fault() now has an additional pc argument that is
used to detect fault on a non-executable segment.
that is, we check on read fault if the segment
has the SG_NOEXEC attribute and the program counter
is within faulting page.
2019-08-27 03:47:18 +02:00
cinap_lenrek 128ea44a89 kernel: expose no execute bit to portable mmu code as SG_NOEXEC / PTENOEXEC, add PTECACHED bits
a portable SG_NOEXEC segment attribute was added to allow
non-executable (physical) segments. which will set the
PTENOEXEC bits for putmmu().

in the future, this can be used to make non-executable
stack / bss segments.

the SG_DEVICE attribute was added to distinguish between
mmio regions and uncached memory. only matterns on arm64.

on arm, theres the issue that PTEUNCACHED would have
no bits set when using the hardware bit definitions.
this is the reason bcm, kw, teg2 and omap kernels use
arteficial PTE constants. on zynq, the XN bit was used
as a hack to give PTEUNCACHED a non-zero value and when
the bit is clear then cache attributes where added to
the pte.

to fix this, PTECACHED constant was added.

the portable mmu code in fault.c will now explicitely set
PTECACHED bits for cached memory and PTEUNCACHED for
uncached memory. that way the hardware bit definitions
can be used everywhere.
2019-08-26 22:34:38 +02:00
cinap_lenrek a6a1806c17 usbxhci: implement portable dma flush operations and move to port/ 2019-07-17 10:30:06 +02:00
cinap_lenrek 19a883ce7a usbehci: introduce dmaflush() function to handle portable cache invalidation for device drivers 2019-07-17 10:24:50 +02:00
cinap_lenrek a1a6f26110 kernel: move common ethermii to port/ 2019-07-11 07:47:39 +02:00
cinap_lenrek 54f9b36720 usbxhci: fix mysterious ENABLESLOT failures (update to XHCI spec revision 1.2 (2019))
Ori Bernstein had Sunrise Point-H USB 3.0 xHCI Controller that would mysteriously
crash on the 5th ENABLESLOT command. This was reproducable by even just allocating
slots in a loop right after init.

It turns out, the 1.2 spec extended the Max Scratchpad Buffers in HCSPARAMS2 so our
driver would not allocate enougth scratchpad buffers and controller firmware would
crash once it went beyond our allocated scratchpad buffer array.

This change also fixes:

- ignore bits 16:31 in PAGESIZE register
- preserve bits 10:31 in the CONFIG register
- handle ADDESSDEV command failure (so it can be retried)
2019-07-02 05:34:13 +02:00
cinap_lenrek 70ea1310d1 pc kernel: remove countpagerefs() (thanks BurnZeZ)
forgot to commit this...
2019-05-03 23:52:49 +02:00
cinap_lenrek 2f884a5116 ether8169: fix thinkpad A485 ethernet (thanks mischief)
attached is a patch to fix receive in the 8169 chip on my thinkpad
A485. i'm not sure why, but the same thing was done in 3d56a0fc4645
for Macv45.

nick
2019-04-27 21:55:16 +02:00
cinap_lenrek a0da5b973f usbxhci: make stuck usb transactions interruptable.
some control transactions can confuse the xhci controller so
much that it even fails to respond to command abort or STOPEP
control command. with no way for us to abort the transaction
but a full controller reset.

we give the controller 5 seconds to abort our initial
transaction and if that fails we wake the recover process
to reset the controller.

thanks mischief for testing.
2019-04-19 23:39:47 +02:00
mischief 82438139d6 pc: audiohda: recognize AMD Family 17h hd audio controller 2019-04-13 23:11:19 -07:00
mischief 79e24f5ee5 pc: devarch: recognize AMD Ryzen model 2019-04-13 23:08:26 -07:00
mischief 7accf11170 pc: pci: add AMD FCH LPC bridge to southbridges 2019-04-13 23:07:57 -07:00
cinap_lenrek 3e65a15ae0 audiohda: add support for Gemini-Lake audio in Intel NUC nuc7pjyh (thanks sam-d) 2019-04-08 15:50:13 +02:00
qwx b7525d1ed8 igfx: add support for 915gm
tested on a t43 with igfx and a 1600x1200 t43p screen
what works: lvds, blanking
what doesn't: hwgc (not visible), snarfing edid
untested: vga

based on realemu traces.
2019-03-04 21:37:52 +01:00
cinap_lenrek 967b1248f8 libip: move optimized 386 assembly version of ptclbsum() from kernel to libip 2019-02-27 18:29:08 +01:00
cinap_lenrek 66ab4ac223 pc, pc64: fix %.*s format in multibootargs 2019-02-25 04:25:36 +01:00
cinap_lenrek cefc849a95 devdraw: get rid of softscreen==0xa110c hack and make attachscreen() return Memdata*
all screen implementations use a Memimage* internally
for the framebuffer, so we can return a shared reference
to its Memdata structure in attachscreen() instead of
a framebuffer data pointer.

this eleminates the softscreen == 0xa110c hack as we
always use shared Memdata* now.
2019-01-30 18:22:52 +01:00
cinap_lenrek 83aa7ba709 ether82563: fix bugus FCA write and link detection for i217
the FCA registers 0x28, 0x2C have been reassigned to
to FEXTNVM on i217, i218 and i219 so add Fnofca flag
and avoid writing the registers.

make link detection more robust on i217 by delaying the
phy status read after link status change by 150ms. we'd
otherwise get a "phy wedged" (power saving state?) and
not update the link status until the next link change.
2019-01-13 17:17:11 +01:00
cinap_lenrek 998d478550 ether82563: work arround spurious jumbo packets on i217 (thanks k0ga)
i217 appears to receive spurious jumbo frame and then
stops receiving completely. reducing the mtu to 2k as
a work arround for now.
2019-01-12 21:07:12 +01:00
cinap_lenrek 0de56a9913 ether82563: use 9018 byte mtu from datasheet for i217, i218, i219 2019-01-12 19:37:37 +01:00
cinap_lenrek 53275c7045 ether82563, ether82598, etherx550: round rbsz to multiple of 1K
the max packet size is configured in 1K increments on these chips,
which can result in the card receiving a 10K packet but the
driver having only allocated 9.5K of buffer. this actually caued
pool corruption with i210, i217, i218, i219, i350.

for 82598 and x550, we explicitely round rbsz to avoid similar bugs
in the future, even tho the Rbsz constant was already a multiple of
1K and is not affected by the bug.
2019-01-12 15:34:23 +01:00
cinap_lenrek d0f824edc2 pc, pc64: properly track dependencies for mem.h on autogenerated apbootstrap.h and reboot.h targets 2019-01-04 02:51:29 +01:00
cinap_lenrek d843bc8e22 etherx550: add intel 10GB ethernet controlller x550 driver (thanks joe9) 2018-12-23 17:48:11 +01:00
cinap_lenrek 426c989317 ether82598: fix multicast filter (thanks aiju, joe9) 2018-12-23 17:41:47 +01:00
aiju a6517fb498 kernel: change peek to return number of characters left rather than 0/-1 2018-12-11 09:17:44 +00:00
aiju cc066d8130 dtracy: catch page faults 2018-12-11 09:09:08 +00:00
aiju 6f30420136 add dtracy support to mkdevc and enable dtracy with plan9.ini 2018-12-11 07:44:34 +00:00
cinap_lenrek 4dee686ca5 pc, pc64: park application processors in rebootcode with mmu off
instead of having application processors spin in mpshutdown()
with mmu on, and be subject to reboot() overriding kernel text
and modifying page tables, park the application processors in
rebootcode idle loop with the mmu off.
2018-11-19 18:42:01 +01:00
mischief 744867de34 ether82563: ignore i82753 checksums, fixes T60 ethernet 2018-11-14 11:33:52 -08:00
aiju 0bd213b7b0 devvmx: remove bogus . direntry 2018-11-04 16:03:35 +00:00
23hiro 05021e0579 add Centrino Wireless-N 1030 (thanks lksmk from brazil) 2018-10-25 08:09:10 +02:00
mischief 8eecdc9664 etheriwl: support type 2000 devices and the 2200 chip in x230t 2018-10-10 16:37:13 -07:00
cinap_lenrek 679a253931 usbxhci: only clear RW1C bits when set. 2018-10-08 07:10:59 +02:00
cinap_lenrek 2fecc5789e usbxhci: delay after reset, preserve reserved bits in legacy status control register in handoff()
when clering smi enable bits in the legacy control/status register,
preserve the reserved bits. clear the RW1C bits.

linux code claims intel xhci controller needs a 1ms delay before
accessing any register after reset.
2018-10-08 07:05:28 +02:00
cinap_lenrek c458216121 pc drivers: more pci cleanup 2018-10-07 23:38:41 +02:00
cinap_lenrek 9fec0e7360 pc drivers: use pcienable() to handle device power up and missing initialization 2018-10-07 22:28:21 +02:00
cinap_lenrek 4d7c195804 pc, pc64: add pcienable() and pcidisable() functions
pcienable() puts a device in fully powered on state
and does some missing initialization that UEFI might
have skipped such as I/O and Memory requests being
disabled.

pcidisable() is ment to shutdown the device, but
currently just disables dma to prevent accidents.
2018-10-07 21:52:53 +02:00
cinap_lenrek f9839ed0a2 usbehci, usbxhci: add *noehcihandoff= and *noxhcihandoff= parameters
on Samsung ATIV Smart PC Pro XE00T1C-A01CL, the EHCI handoff
causes the system to freeze in UEFI mode as soon as we assert
the os semaphore bit.

until a general solution is found, provide these parameters to
disable the handoff for now as it seems to otherwise work fine.
2018-10-06 00:29:05 +02:00
cinap_lenrek 83876083c9 pc, pc64: increase CONFADDR buffer from 4K to 24K
move APBOOTSTRAP and TMPADDR to make space available for
boot parameters. which can become quite long such as *e820.
2018-10-06 00:26:07 +02:00
cinap_lenrek b591ee195b devarch: reading msr 0xffffffff 2018-09-09 01:53:53 +02:00
cinap_lenrek ba7b07d51a devarch: restrict i/o port access to 64K, disallow msr 32-bit wrap arround (thanks aiju) 2018-09-09 01:41:35 +02:00
cinap_lenrek 97a2e35a0c devarch: fix /dev/msr (thanks joe9, aiju)
the end condition port < offset+n could never become
false when offset truncated to 32 bit signed port is
negative. change the condition variables to unsigned
int.

msr's are not byte addressible, so advance reads by
one instead of 8.
2018-09-08 22:24:36 +02:00
cinap_lenrek 2d9147a33c rtl8169: fix receive for nuc BOXNUC7CJYH 2018-08-31 22:39:46 +02:00
cinap_lenrek 5c326d9f35 devvga: disable cursor on shutdown avoiding graphics glitches on reboot 2018-08-25 21:44:08 +02:00
mischief 4e938841f0 igfx: support blanking by turning off panel power and backlight
tested on t61, x200, x230, x301, t420, w520
2018-08-21 11:31:45 -07:00
cinap_lenrek 2b619dc966 etheriwl: add pci did for WifiLink 5300 (thans senthil) 2018-07-31 18:33:42 +02:00
cinap_lenrek 6cd83e5d24 audiohda: support Intel Sunrise Point-LP on thinkpad X1 2018-07-26 02:48:00 +02:00
cinap_lenrek 0431ea242d pc, pc64: look for "RSD PTR " in ACPI reserved memory region from e820 map
nobody passes us the "RSD PTR " address when doing multiboot/kexec
on UEFI systems. so we search for it manually in the ACPI reserved
area as indicated in the e820 memory map.
2018-07-22 21:00:20 +02:00
aiju 6b0de3de8e pc: fix ugly and partially broken switch() statement 2018-07-11 15:12:24 +01:00
aiju 3a77c01f43 pc kernel: get rid of ugly and partially broken cpuid macros 2018-07-11 14:50:22 +01:00
cinap_lenrek 39fb26df70 9pc, 9pc64: make mapalloc() and mapfree() static in memory.c 2018-06-14 20:22:34 +02:00
cinap_lenrek 5da4f0fc0f sdram: experimental ramdisk driver
this driver makes regions of physical memory accessible as a disk.

to use it, ramdiskinit() has to be called before confinit(), so
that conf.mem[] banks can be reserved. currently, only pc and pc64
kernel use it, but otherwise the implementation is portable.

ramdisks are not zeroed when allocated, so that the contents are
preserved across warm reboots.

to not waste memory, physical segments do not allocate Page structures
or populate the segment pte's anymore. theres also a new SG_CHACHED
attribute.
2018-05-27 22:59:19 +02:00
qwx 70c7a9eb07 add signed fixed size integer typedefs 2018-05-12 19:19:52 +02:00
kremlin 8666ec6b55 add missing ethermii.h dependencies. patch from cinap_lenrek 2018-04-12 17:50:10 -04:00
cinap_lenrek b2d7992025 kernel: properly handle bad attach specifiers
- only accept decimal for numeric device id's
- exclude negative device id's
- device id's out of range yield Enodev
2018-02-25 17:11:18 +01:00
cinap_lenrek f0a314605f devether: remove (unimplemented) detach, allow device creation on attach
we allow devether to create ethernet cards on attach. this is useull
for virtual cards like the sink driver, so we can create a sink
by simply: bind -a '#l2:sink ea=112233445566' /net

the detach routine was never called, so remove it from the few drivers
that attempted to implement it.
2018-02-25 03:42:38 +01:00
cinap_lenrek 729c9c39d9 devether: mux bridges, portable netconsole 2018-02-18 19:56:01 +01:00
cinap_lenrek 5d6a11c387 audiohda: add device id for x260's Intel Sunrise Point-LP. (thanks rodri) 2018-02-16 21:04:38 +01:00
cinap_lenrek d6e0e9c402 kernel: move devether and wifi to port/
the only architecture dependence of devether was enabling interrupts,
which is now done at the end of the driver's reset() function now.

the wifi stack and dummy ethersink also go to port/.

do the IRQ2->IRQ9 hack for pc kernels in intrenabale(), so not
every caller of intrenable() has to be aware of it.
2018-02-11 18:08:03 +01:00
cinap_lenrek 650e5db5a2 usbxhci: fix mistake in completering()
the td index "x" was incremented twice, once in for loop
and in the body expression. so r->rp only got updated
every second completion. this is wrong, but harmless.
2018-02-07 18:13:22 +01:00
cinap_lenrek 6a23ef917b kernel: initialize cyclefreq for machno > 0 in guesscpuhz() 2018-01-27 19:58:48 +01:00
cinap_lenrek 7b5cf8de2d ether79c970: dont disable promisc mode when multicast table is not empty 2018-01-13 11:41:37 +01:00
cinap_lenrek ad36593a99 ether82557: don't turn off promisc mode when mcast table is not empty
the driver doesnt implement multicast filter, but just turns
on promiscuous mode when a multicast address is added. but this
breaks when one actually enables and then disables promiscuous
mode with say, running snoopy.

we have to keep promisc mode active as long as multicast table
is not empty.
2018-01-13 07:16:17 +01:00
cinap_lenrek ba87e58876 wifi: learn target ip address from neighbor advertisements in dmat proxy 2018-01-12 18:28:50 +01:00
cinap_lenrek 2088f8c991 wifi: filter out loopback traffic from myself
broadcast traffic was received back on the wire causing
duplicate address detection to break with dmat proy as
the rewritten broadcasts where observable.

the fix is to just ignore packets from ourselfs received
from the air. devether already handles loopback.
2018-01-12 08:01:15 +01:00
cinap_lenrek acb206859d ether8169: deal with kernel memory exhaution
when kernel memory is exhausted, rtl8169replenish() can fail
to plant more receive descriptors and rtl8169receive() would
run over the receive tail and crash on the nil ctlr->rb[x].

rtl8169receive() is called on "Receive Descriptor Unavailable"
and "Packet Underrun" so we will try to replenish descriptors
in the beginning first in case memory was exhausted and memory
is available again and make sure not to run over the tail.
2018-01-08 00:23:26 +01:00
cinap_lenrek d3e54ff2d9 pc kernel: fix wrong simd exception mask (fixes go bootstrap) 2018-01-04 04:38:31 +01:00
cinap_lenrek ee89c82dd3 wifi: get rid of custom hextob() routine, use dec16(), avoid copies in parsekey() 2017-12-31 01:49:58 +01:00
cinap_lenrek ce2211b08c usbxhci: add missing pexit() in xhcirecover proc (thanks sam-d) 2017-12-29 06:10:25 +01:00
cinap_lenrek a021f054b0 wifi: revert rate adoption divider, breaks arpunks wifi 2017-12-29 03:41:32 +01:00
cinap_lenrek b9d2a9efd5 wifi: don't implicitely update lastseen timestamp on nodelookup()
in case we continue to send traffic (like ping) with the ap gone,
the sending would keep updating bss->lastseen which prevents the
timeout to happen to switch bss.
2017-12-28 04:34:03 +01:00
cinap_lenrek d13142b3da etheriwl, etherwpi: limit transmit queue buffer bloat to 48k (at 22Mbit ≅ 20ms) 2017-12-28 01:24:38 +01:00
cinap_lenrek ce9cc8a358 wifi: don't assume Wifi.rates[] is sorted, return net data rate for mbps (50% theoretical) 2017-12-28 01:19:14 +01:00
cinap_lenrek 96eb90fba1 devvga: removing #v/vgabios, use /dev/realmodemem instead 2017-12-23 04:26:50 +01:00
cinap_lenrek 50bea0348c kernel: convert textmode cga screen contents to kmesg only once
screeninit() might be called again by devvga when switching
to textmode, so only convert the text framebuffer to kmesg
the first time.
2017-12-23 03:56:12 +01:00
cinap_lenrek 417bdbb869 ether8169: add Macv45 for RTL8111HN, rename Macv45 -> Macv42 (thanks qeed, sam-d) 2017-12-19 00:03:54 +01:00
cinap_lenrek c1eb4b8d68 devether: dont forward loopback packets on bridges 2017-12-18 20:47:55 +01:00
cinap_lenrek 3e48a66665 pc, pc64: add devbridge to kernel configuration 2017-12-17 20:33:39 +01:00
cinap_lenrek 15ff38e818 wifi: use protocol constants from ip/ip.h and ip/ipv6.h for dmatproxy() 2017-12-17 17:17:26 +01:00
cinap_lenrek 070a9ef753 wifi: matt damon wifi bridging support 2017-12-16 21:43:47 +01:00
cinap_lenrek 9fd8894fec ether: allow spoofing of source mac address for bridges; used by vmx
to implement layer 2 bridges in userspace, we disable to auto filling
of the source mac address when bridge mode is enabled on the
connection.
2017-12-15 22:22:29 +01:00
cinap_lenrek 35bc3ac573 devether: remove duplicated parseether() implementation (pull from libip) 2017-12-09 22:07:32 +01:00
cinap_lenrek 65566dda8e devvga: properly handle physical screen size and panning
- remove arbitrary limits on screen size, just check with badrect()
- post resize when physgscreenr is changed (actualsize ctl command)
- preserve physgscreenr across softscreen flag toggle
- honor panning flag on resize
- fix nil dereference in panning ctl command when scr->gscreen == nil
- use clipr when drawing vga plan 9 console (vgascreenwin())
2017-12-03 18:54:25 +01:00
cinap_lenrek 4898050282 cga: capture cga console contents on boot, make sure cgapos is in range
to capture bios and bootloader messages, convert the contents
on the screen to kmesg.

on machines without legacy cga, the cga registers read out as
0xFF, resuting in out of bounds cgapos. so set cgapos to 0 in
that case.
2017-11-26 17:11:01 +01:00
cinap_lenrek af20ba6746 devvga: re-render text from kmesg after resize 2017-11-26 04:49:30 +01:00
cinap_lenrek f4880742fd igfx: allocate backing memory for framebuffer and hw cursor when not done by bios (from qu7uux)
new approach to graphics memory management:

the kernel driver never really cared about the size of stolen memory
directly. that was only to figure out the maximum allocation
to place the hardware cursor image somewhere at the end of the
allocation done by bios.

qu7uux's gm965 bios however wont steal enougth memory for his
native resolution so we have todo it manually.

the userspace igfx driver will figure out how much the bios
allocated by looking at the gtt only. then extend the memory by
creating a "fixed" physical segment.

the kernel driver allocates the memory for the cursor image
from normal kernel memory, and just maps it into the gtt at the
end of the virtual kernel framebuffer aperture.

thanks to qu7uux for the patch.
2017-11-13 00:48:46 +01:00
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 0e68b7551a kernel: pc/pc, fix comment line 2017-10-30 02:08:05 +01:00
cinap_lenrek f3f9392517 kernel: introduce devswap #¶ to serve /dev/swap and handle swapfile encryption 2017-10-29 23:09:54 +01:00
cinap_lenrek d9b37eff37 ether82598: support for T540-T1, use physical addresses for isaconf port
reading mac doesnt work yet, requires ea= option in isaconf.
2017-09-27 14:13:18 +02:00
cinap_lenrek 797952d065 sdnvme: identify namespace list fails on intel ssd, just assume nsid=[1] 2017-09-27 14:02:13 +02:00
cinap_lenrek 330e7ef39b kernel: don't tokenize inplace in isaconfig() to make /dev/reboot work 2017-09-27 13:59:55 +02:00
cinap_lenrek dad00a77da kernel: get rid of 36 bit Paerange mask in mtrr (supporting machines with more than 64GB of memory) 2017-09-27 13:58:00 +02:00
cinap_lenrek 546046b46b xhci: do bounds checking in capability walking, check if controller vanished on init (thunderbolt unplug) 2017-09-22 12:55:26 +02:00
cinap_lenrek be7f3fb5e4 rename pcf kernel to pc, remove pcf, pccpuf, pccpu64 kernels, update documentation
there isnt much of a point in keep maintaining separate
kernel configurations for terminal and cpu kernels as
the role can be switched with service=cpu boot parameter.

to make stuff cosistent, we will just have one "pc" kernel
and one "pc64" kernel configuration now.
2017-09-10 22:35:23 +02:00
BurnZeZ 9af1153451 audiohda: add pci id for nvidia GM204 2017-09-10 02:27:31 +00:00
BurnZeZ 1ab2fed7a4 audiohda: add pci id for Intel 9 Series 2017-09-10 02:21:31 +00:00
cinap_lenrek e6e745e776 audiohda: add pci id for ICH10 (thanks echoline) 2017-09-10 01:37:30 +02:00
aiju bd4513fe87 devvmx: call vmxshutdown from reboot() function manually 2017-09-02 10:43:37 +00:00
cinap_lenrek e44bf536af ether82563: make the ethernet of thinkpad p50 work (thanks sam-d) 2017-08-29 19:38:29 +02:00
cinap_lenrek b41bd1b007 audiohda: Intel Sunrise Point-H support (thanks sam-d) 2017-08-29 19:37:26 +02:00
cinap_lenrek 30ea7ad58a sdnvme: pass 0 instead of 0xffffffff as NSID for identify controller and create completion/submission queue commands (thanks Ori_B)
Samsung SSD 960 EVO fails with invalid namespace error otherwise...
2017-08-29 09:52:53 +02:00
aiju e5d3aaf1aa devvmx, vmx: lilu dallas multivm 2017-08-28 17:27:41 +00:00
cinap_lenrek 543ccb37f4 sdiahci: Intel 200 Series Chipset Family PCH support (thanks aiju)
we used to tweak arround in the ICH registers for all intel controllers,
which is wrong, as the 200 series has different magic registes. see
the datasheet:

https://www.intel.com/content/www/us/en/chipsets/200-series-chipset-pch-datasheet-vol-2.html

this caused the clocks to be disabled for the 6th port causing a full
machine lockup touching the 6th port registers.

the next problem was that aiju's bios disabled the unused ports somehow
but didnt clear ther PI bits, so that they would stay in Sbist status even
after a port reset. so the port would get stuck in the Dportreset state
forever. the fix for this was to use a one second timeout for the
port reset procedure.
2017-08-27 21:20:20 +02:00
aiju 9616f61872 devvmx: more efficient data structure for memory map; simplified (more reliable) step function 2017-08-24 07:53:10 +00:00
qwx eeb8007e60 igfx: add did for x220 2017-08-20 13:52:52 +03:00
cinap_lenrek c78d4c4ce7 ether82563: add more pci ids for i210 and i354 from 9atom / openbsd 2017-08-13 15:26:24 +02:00
cinap_lenrek b3d581752b ether82563: support for i211 with iNVM. (thanks mfny and brennan for testing) 2017-08-12 23:36:24 +02:00
cinap_lenrek e0474599dd usbxhci: implement recovery from host controller errors 2017-08-07 01:59:54 +02:00
cinap_lenrek bb625cebfc etheriwl: add pci id for Intel Centrino Advanced-N 6200 on x201 tablet (thanks arpunk) 2017-08-03 23:15:58 +02:00
cinap_lenrek 83b87729d9 usbxhci: handle out of memory in controller initialization 2017-08-02 21:17:50 +02:00
cinap_lenrek 1ea109345b usbxhci: abandon multiple requests per endpoint, cleanup
more conservative approach: only one transaction in flight
per endpoint (except iso). also serialize controller commands.
no driver currently uses this and i doubt it is usefull.

create constants for common TRB flags and remove bogus 1<<16
flag on TR_NORMAL.
2017-08-02 20:25:19 +02:00
cinap_lenrek 8ed13fe664 usbxhci: have to serialize and set read pointer for endpoint stop command 2017-08-02 01:45:30 +02:00
cinap_lenrek 5f23d78f06 usbohci, usbehci, usbxhci: save mmio base address in ctlr, cant PADDR() on 386... 2017-07-31 17:36:56 +02:00
cinap_lenrek 48352be825 usbxhci: provide shutdown function to halt the controller 2017-07-31 16:05:58 +02:00
cinap_lenrek 6e65596827 xhci: experimental usb3 support 2017-07-31 03:22:23 +02:00
cinap_lenrek adfb0e9371 pc, pc64: enable usbxhci in the configuration 2017-07-29 01:15:05 +02:00
cinap_lenrek cd108e2f0b usbxhci: simplify xecp() 2017-07-29 01:12:32 +02:00
cinap_lenrek c74538a67e usbxhci: implement controller handoff, ignore usb3.0 ports, honor pollival for isochronous endpoints 2017-07-29 01:02:23 +02:00
cinap_lenrek aaf6d7c558 usbxhci: basic iso write support (usb soundcard playback) 2017-07-24 23:48:50 +02:00
cinap_lenrek 0b4ace02c4 usbxhci: handle changing maxpkt on control endpoint by reevaluating endpoint context
while endpoints != 0 are opend after the device descriptor has been
parsed and the endpoint properties like maxpkt have been set, the
control endpoint is opend with a guessed maxpkt value. once the first
8 bytes of the descriptor have been read by usbd, maxpkt gets set and
we need to reevaluate the control endpoint 0 context to update the value.
2017-07-22 19:35:32 +02:00
cinap_lenrek f72bcce2c7 usbxhci: use physical register addresses for matcing controllers and printing. simplify endpoint slot initialization. 2017-07-22 16:37:05 +02:00
cinap_lenrek f0217d2c3f usbohci, usbuhci, usbehci: use physical address of registers for matching controllers and printing 2017-07-22 16:35:13 +02:00
cinap_lenrek ffb28698bf kernel: fix bounds check in screenputc() 2017-07-20 21:03:00 +02:00
cinap_lenrek 4fd68773e2 usbxhci: implement command timeouts and aborts, serialize unstall 2017-07-20 19:57:14 +02:00
cinap_lenrek 40dc39bf7d usbxhci: better approach to unstalling endpoint and fixup td ring
instead of guessing where the controllers dequeue pointer went,
stop the endpoint and then explicitely set te dequeue pointer to
the next write td position. that way we do not need to fix the cycle
bit in the td's and dont need to rely on if the controller
advanced the dequeue pointer after a stall or not.

add ctx and slot back pointers to ring.
2017-07-17 21:10:25 +02:00
cinap_lenrek e7e18aac7f pc kernel: mkfile target usbehcipc.$O needs ../port/usb.h, add usbxhci.$O 2017-07-16 22:33:24 +02:00
cinap_lenrek 5e6f1b5769 usbxhci: commit work in progress xhci driver, no config yet 2017-07-16 22:29:29 +02:00
cinap_lenrek befdd7d755 kernel: pass bootargs also in multiboot command line, retire the bootline mechanism to pass arguments to /boot/boot 2017-06-28 18:56:16 +02:00
cinap_lenrek 63b8965b42 devvmx: add support for SG_STICKY segments 2017-06-25 22:57:47 +02:00
cinap_lenrek aab4e32ce0 pc, pc64: support for multiboot framebuffer, common bootargs and multiboot code 2017-06-25 22:22:58 +02:00
aiju cabfa4e916 devvmx: add support for extrap command to configure halting on exceptions 2017-06-21 22:19:14 +00:00
aiju 37b9ab5a04 devvmx: error handling in clearmeminfo 2017-06-21 09:59:32 +00:00
aiju 779f6cb3b8 devvmx: remember segment names and free segments properly 2017-06-21 09:16:43 +00:00
aiju becb89bae5 pc, pc64: adapt devvmx to work on pc64 2017-06-20 15:10:08 +00:00
aiju ed040d676a devvmx: fix CR0/CR4 readout; also don't exit on PAUSE instruction 2017-06-18 22:13:20 +00:00
aiju 2bb65c40ab devvmx: support debug registers; simplify assembly 2017-06-17 22:38:16 +00:00
aiju 74241e31aa devvmx: support pat and efer registers 2017-06-14 17:38:01 +00:00
aiju 8029c3d8c4 pc: add vmx device 2017-06-13 14:15:09 +00:00
aiju 13869bab11 pc/pc64: keep shadow copy of DR7 in Mach and use that to check whether we need to reset DR7 in procsave(); remove superfluous reset of DR7 in mmurelease() 2017-06-13 00:10:36 +00:00
aiju e8082c1d1f remove accidentally committed reference to devvmx 2017-06-12 23:03:40 +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 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 48c5da7a64 ethervirtio: report correct length; fail gracefully if we can't initialize queues 2017-06-12 11:25:12 +00:00
aiju 48fa332c61 pc: actually call netconsole() 2017-06-01 06:40:05 +00:00
aiju 7134d62ccb pc: add netconsole 2017-05-31 23:41:21 +00:00
qwx 6f63752d84 igfx: add support for haswell graphics
add support for edp, dp and hdmi on haswell and haswell ult.
vga, dvi and specific configurations like ulx are unimplemented.

remaining issue: edp link training always fails (time out).
2017-05-22 18:19:24 +02:00
cinap_lenrek fa94532c08 vgamach64xx: remove drawdebug reference 2017-05-01 02:15:03 +02:00
cinap_lenrek 8829d51f50 devvga: remove unused copy of checkport() function 2017-04-02 20:17:44 +02:00
cinap_lenrek 8ea31ae7b2 devvga: fix mistake 2017-04-02 20:10:44 +02:00
cinap_lenrek a6d852d0a6 devvga: include hwgc in vgactl file 2017-04-02 20:08:15 +02:00
cinap_lenrek 557cbe10ad sdnvme: enable in pcf, pccpuf, pc64 kernel configuration 2017-03-30 23:37:28 +02:00
cinap_lenrek 8cacd2cc0a sdnvme: don't write completion queue doorbell register when nothing has been processed
turns out on real hardware, the front falls off if we write
the completion queue doorbell registers without consuming
an entry. so only write the register when we have processed
something.
2017-03-30 23:33:46 +02:00
cinap_lenrek bfae9e08be sdnvme: NVMe controller driver (work in progress)
basic NVMe controller driver, reads and writes work.
"namespaces" show up as logical units.
uses pin/msi interrupts (no msi-x support yet).
one submission queue per cpu, shared completion queue.
no recovery from fatal controller errors.
only tested in qemu (no hardware available).

commiting this so it can be found by someone who has
hardware.
2017-03-29 00:21:35 +02:00
cinap_lenrek 1889aa50c3 sdvirtio: return 1 for success in vioenable()/viodisable() 2017-03-26 16:43:32 +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 1a2aefcf11 devmouse: refactor screen blanking logic
devmouse controls the screen blanking timeout, so move the
code there avoiding cross calls between modules. the only
function that needs to be provided is blankscreen(), which
gets called with drawlock locked.

the blank timeout is set thru /dev/mousectl now, so kernels
without devvga can set it.

blanking now only happens while /dev/mouse is read. so this
avoids accidentally blanking the screen on cpu servers that
do not have a mouse to unblank it.
2017-03-18 16:58:27 +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
cinap_lenrek 812383473c pc kernel: assume tsc and lapic clock rate on application processors is the same as on bootrap processor 2017-03-11 16:18:01 +01:00
cinap_lenrek 3e0e77a852 pc kernel: don't use active.thunderbirdsargo in vunmap() tlb flush code 2017-03-11 16:13:58 +01:00
mischief 319a9cc905 pc, pc64: bump Qmax in devarch
my x301 and t420 run out of archfiles with *acpi= while trying to add
hdacmd from audiohda.
2017-03-01 02:43:14 -08:00
cinap_lenrek 04171d2477 ether8169: add support for RTL8106E (thanks _potato) 2017-02-21 21:53:10 +01:00
cinap_lenrek a32d11dff3 ether82563: work arround phyprobe() failing on 82579LM without cable plugged in (thanks mischief)
on 82579LM, the phy status is inaccessible without
a cable plugged, so we wait and retry phyprobe() once
the link status changes.
2017-02-20 22:01:54 +01:00
cinap_lenrek 52570a2a2d ether82563: support for i219 (tested on t460p, thanks aiju) 2017-02-19 18:20:46 +01:00
cinap_lenrek 3ea0572f4f wifi: timestamps in debug print, flush queue on deassoc, shorter roam timeout, timeout in blocked state, fix essid seprint race
- add some milisecond timestamps to the status change debug printing
- flush the packets in the queue on deassoc to avoid processing old pae
  packets on next association.
- make roaming timeout shorter (60 -> 20 seconds)
- automatically timeout and restart wpa/pae blocked state
- fix printing race when essid gets changed underneath seprint
2017-02-16 20:08:27 +01:00
cinap_lenrek c1c644d13c etheriwl: add support for Centrino Advanced-N 6030, 6235 (thanks khm, openbsd)
from openbsd driver, it seems the Centrino Advanced-N 6030 and 6235
cards share the same device revision as the 6205 (Type6005). Also
changing the device revision field from 4 to 5 bits.
2017-02-16 20:03:41 +01:00
cinap_lenrek 45d01d9c99 wifi: handle short preamble and short time slot capabilities
- drivers enable short preamble and sort timeslot depending
  on the ap beacon capinfo field (bss->cap)
- wifi sets short preamble bit in capinfo on association request
- wifi sets short timeslot bit when ap advertized it in beacon
2017-02-13 22:26:38 +01:00
cinap_lenrek 9278b94623 pc/pc64: get rid of timerset(0) case, was used with "i8253set off" ctl 2017-01-22 21:12:38 +01:00
cinap_lenrek 8547defe70 vgaigfx: enable softscreen by default
given that the igfx driver doesnt provide any acceleration functions
and drawing is usually faster with double buffering as it eleminates
reads over the pci bus, enable softscreen by default.
2016-12-29 03:46:08 +01:00
cinap_lenrek 2830cd7eb6 pc: modify cpu0 page tables in patwc() instead of current cpu ones
on 386 kernel, each processor has its own pdb where the primary
pdb for kernel mappings is on cpu0 and other cpu's lazily pull
pdb entries from cpu0 when they fault in vmapsync().

so we have to edit the table tables in the pdb of cpu0 and not
the current processor.
2016-12-17 19:47:35 +01: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 b3c1fa9ecf devmouse: change msec argument of *mousetrack() to ulong 2016-12-10 16:12:18 +01:00
cinap_lenrek 7a145e89b3 audioac97: support for ICH4-ICH7 based cards with memory mapped registers (thanks echoline) 2016-12-05 18:32:58 +01:00
cinap_lenrek 240590ab0a archacpi: fix format string warning on amd64 2016-11-05 18:31:50 +01:00
cinap_lenrek 98dba9a4a3 pc/archacpi: don't do acpi initialization in the kernel, provide generic acpimem routines
get rid of _INI and _REG method calls, this is not full acpi environment
anyway and all we really want todo at kernel boot time is figuring out
the interrupt routing. aux/acpi can try to enable more stuff if it needs
to later when battery status desired.

dont snoop memory space regions in amlmapio(), this is just wrong as
amlmapio() is *lazily* mapping regions as they are accessed, so the
range table would never be really complete. instead, we provide generic
access to the physical address space, excluding kernel and user memory
with acpimem file.
2016-10-23 04:09:27 +02:00
ftrvxmtrx e01577f8f6 archacpi: optionally export acpi memory regions; properly initialize environment 2016-10-18 23:04:19 +02: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 0ac260b18a wifi: update wifi.h header 2016-08-27 20:36:08 +02:00
cinap_lenrek 0b8851ddb6 wifi: allocate cipher states in secret memory, do AESstate key setup once 2016-08-27 20:35:39 +02:00
cinap_lenrek c0ab6c1d01 vga/igfx: add pci did's for kenjis intel graphics cards. 2016-08-20 19:06:57 +02:00
cinap_lenrek 1edd8d28a5 acpi: _ADR and _BBN might be methods, so use amleval() to evaluate the value 2016-06-30 19:11:06 +02:00
cinap_lenrek 92aa75e879 ether8169: fix wrong mbps setting (from qu7uux)
the first time rtl8169link is called (from rtl8169pnp), the link isn't up, so
setting edev->mbps based on Phystatus register is skipped. edev->mbps is then
still set at the default 100, and that ends up being what devether uses.
this is why some rtl8169 cards are misprinted as 100Mbps in kmesg.
later, after rtl8169link is called again from rtl8169interrupt, the link is up
and edev->mbps is set to the correct value (as shown by e.g. /net/ether0/stats).

so instead, set speed regardless of link status.
2016-06-30 17:16:11 +02:00
cinap_lenrek bc2a5d9b1e aml: define amlintmask and set it according to DSDT revision (64bit / 32bit) 2016-06-05 14:57:38 +02:00
stanley lieber 7c5ca77a6e etheriwl: add pcid 0x0082 for Intel Centrino Advanced-N 6205 variant 2016-06-01 21:45:46 -04:00
cinap_lenrek 7a28f9bd8c vgaigfx: check gtt to determine graphics memory size, add hw cursor support for g35 (thanks kenji) 2016-05-26 21:28:29 +02:00