Commit graph

5585 commits

Author SHA1 Message Date
cinap_lenrek
5c5c1b6666 bcm64: switch to 64k page size 2019-05-17 18:35:14 +02:00
cinap_lenrek
e0c19ae048 7l: don't hardcode 4k pagesize, use INITRND 2019-05-17 18:14:10 +02:00
cinap_lenrek
335e019746 mkone: fix man target (thanks Amavect)
Amavect wrote:
> mkone and mkmany have backwards targets for installing man pages.
> This patch makes 'mk man' actually work for mkfiles that include mkone.
> mkmany is not easily fixed without breaking changes.
> It may go without saying that external repos should write their own mkfiles.
2019-05-17 01:51:28 +02:00
cinap_lenrek
b24ed2bfac bcm64: generalize mmu code
make user page table list heads arrays so we can
index into the right level avoiding the special
cases for differen PTLEVELS.
2019-05-15 16:19:20 +02:00
cinap_lenrek
47d3e8fc63 bcm64: fix mmu0clear() mistake from previous commit 2019-05-15 13:24:34 +02:00
cinap_lenrek
adf96a529e bcm: add cache invalidate before accessing prop buffer 2019-05-13 19:21:14 +02:00
cinap_lenrek
a3b5e3994f bcm64: implement reboot support 2019-05-13 19:20:21 +02:00
cinap_lenrek
3b36daa2bb bcm, bcm64: preserve memsize across reboots, avoid trashing atags while parsing cmdline
we override atag memory on reboot, so preserve
the memsize learned from atag as *maxmem plan9
variable. the global memsize variable is not
needed anymore.

avoid trashing the following atag when zero
terminating the cmdline string.

zero memory after plan9.ini variables.
2019-05-13 19:12:41 +02:00
cinap_lenrek
157d7ebdbd devip: do not lock selftab in ipselftabread(), remove unused fields from Ipself
the Ipselftab is designed to not require locking on read
operation. locking the selftab in ipselftabread() risks
deadlock when accessing the user buffer creates a fault.

remove unused fields from the Ipself struct.
2019-05-12 01:20:21 +02:00
cinap_lenrek
333c320204 devip: reset speed and delay on bind, adjust burst on mtu change, ifc->m nil check, consistent error strings
initialize the rate limits when the device gets
bound, not when it is created. so that the
rate limtis get reset to default when the ifc
is reused.

adjust the burst delay when the mtu is changed.
this is to make sure that we allow at least one
full sized packet burst.

make a local copy of ifc->m before doing nil
check as it can change under us when we do
not have the ifc locked.

specify Ebound[] and Eunbound[] error strings
and use them consistently.
2019-05-11 17:22:33 +02:00
cinap_lenrek
7186be0424 devip: make sure ifc is bound in add6 ctl command 2019-05-11 14:54:10 +02:00
cinap_lenrek
3a0d5f41a8 devip: remove unused c->car qlock, avoid potential deadlock in ipifcregisterproxy()
remove references to the unused Conv.car qlock.

ipifcregisterproxy() is called with the proxy
ifc wlock'd, which means we cannot acquire the
rwlock of the interfaces that will proxy for us
because it is allowed to rlock() multiple ifc's
in any order. to get arround this, we use canrlock()
and skip the interface when we cannot acquire the
lock.

the ifc should get wlock'd only when we are about
to modify the ifc or its lifc chain. that is when
adding or removing addresses. wlock is not required
when we addresses to the selfcache, which has its
own qlock.
2019-05-11 14:01:26 +02:00
cinap_lenrek
a25819c43a devip: avoid media bind/unbind kproc reader startup race, simplify etherbind
mark reader process pointers with (void*)-1 to mean
not started yet. this avoids the race condition when
media unbind happens before the kproc has set its
Proc* pointer. then we would not post the note and
the reader would continue running after unbind.

etherbind can be simplified by reading the #lX/addr
file to get the mac address, avoiding the temporary
buffer.
2019-05-11 07:22:34 +02:00
cinap_lenrek
db3bf8271b bcm64: use exclusive monitor on nrdy to wake up idlehands()
when the exclusive monitor is cleared, a event is generated
which we can use to wake up idlehands. that way we do not
need to wait for the next timer interrupt until a cpu takes
work from the run queue.
2019-05-10 14:05:04 +02:00
cinap_lenrek
addb36ee48 ape: fix malloc to deal with more than 4GB of memory on 64 bit systems 2019-05-10 12:10:02 +02:00
cinap_lenrek
a375c9ac38 libc: fix return value for arm64 memset() and memove() 2019-05-09 12:40:03 +02:00
cinap_lenrek
57e0786595 libc: use MOVP instruction for arm64 memmove() and memset() 2019-05-09 11:40:54 +02:00
cinap_lenrek
9d790238f2 bcm64: use MOVP instruction for saving and restoring registers 2019-05-09 11:11:45 +02:00
cinap_lenrek
1c0427e6dd libmach: remove newline 2019-05-09 10:27:17 +02:00
cinap_lenrek
a065270fd7 libmach: support for MOVP instruction disassembly for arm64 2019-05-09 10:24:37 +02:00
cinap_lenrek
e8cf753051 7l: implement MOVP instruction 2019-05-09 10:23:23 +02:00
cinap_lenrek
4e7fbabfc9 libc: provide arm64 assembly versions for memmove() and memset()
just a first approximation, uses unaligned 8 byte loads and stores.
MOVP not yet implemented by the linker. no ZVA cache magic yet.
2019-05-09 02:32:09 +02:00
cinap_lenrek
1046d3e30b bcm64: map framebuffer write-through to allow unaligned access 2019-05-09 02:17:50 +02:00
cinap_lenrek
5a934b56f5 wadfs: avoid comma operator after PBIT32() macros 2019-05-07 21:49:49 +02:00
cinap_lenrek
3a4a3faf29 nusb/usbd: work around devices that ignore the high byte of wLength in control transfer reads
there appear to be devices out there such as Realtek RTL2838UHIDIR
SDR that do not process control transfers correctly, ignoring the
high byte of the wLength field. to work around this, we specify an
odd number of bytes for read sizes >= 256 which keeps the low byte
0xFF.
2019-05-07 09:19:53 +02:00
cinap_lenrek
f22b4ecc77 bootrc: fix $rootdir and $rootspec handling (thanks lucio)
we did not interpret the $rootdir and $rootspec environment
variables right. $rootdir is what gets bound to / (usually /root)
and $rootspec is the mountspec of /root.
2019-05-05 17:02:37 +02:00
cinap_lenrek
75d44bc306 bcm: make sure fiq is on enabled on cpu0 2019-05-05 14:04:27 +02:00
cinap_lenrek
de7190ba6b bcm64: provide idlehands() function 2019-05-05 13:59:03 +02:00
cinap_lenrek
b0c402dfa6 bcm64: get rid of usb workaround delay 2019-05-05 13:57:48 +02:00
cinap_lenrek
4d96c40a47 usbdwc: enable Slowbuilkin workarround, improve split transaction timing, handle erroring sleep(), debugging
i'v been seeing the error condition described above in the
Slowbulkin comment. so i'm enabling the work arround which
seems to fix the lockup.

in the split transaction case where we want to start the
transaction at frame start, acquire the ctlr lock *before*
checking if we are in the right frame number. so the start
will happen atomically. checking the software ctlr->sofchan
instead of checking the interrupt mask register seems to
be quicker.

setting the haint mask bit for the chan under ctlr lock
in chanio() instead of chanwait() avoids needing to acquire
the ctlr lock twice.

mask wakechan bits with busychan bitmap in interrupt handlers
so we will not try to wake up released chans by accident.

sleep() and tsleep() might get interrupted so we have to
release the split qlock in the split transaction case and
in all cases, make sure to halt the channel before release.

add some common debug functions to dump channel and controller
registers.
2019-05-05 13:34:02 +02:00
cinap_lenrek
21ce34bd7f libc: fix NaN check precedence bug in modf() (thanks BurnZeZ) 2019-05-05 00:26:17 +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
0b5e782882 kernel: exec support for arm64 binaries 2019-05-03 23:15:42 +02:00
cinap_lenrek
c6ad540af5 bcm64: add experimental work in progress arm64 kernel for raspberry pi 3 2019-05-03 23:14:57 +02:00
cinap_lenrek
1a7c224b3e bcm: don't call nil on PADDR() in dmaaddr(), return busdram dummy address 2019-05-03 22:53:09 +02:00
cinap_lenrek
eb4bd4aa3e bcm: move fiq saved pc adjust into lexception.s so it can be shared with arm64 2019-05-03 22:02:07 +02:00
cinap_lenrek
3ca395a36c uartpl011: dont touch line control while uart is enabled 2019-05-03 21:34:20 +02:00
cinap_lenrek
4032db00a7 ktrace: arm64 support 2019-05-03 21:16:23 +02:00
cinap_lenrek
c57c8919e3 arm64: add mkfile 2019-05-03 21:12:31 +02:00
cinap_lenrek
db70c1d20d python: arm64 support 2019-05-03 21:11:17 +02:00
cinap_lenrek
bbf532dba8 gs: arm64 support 2019-05-03 21:10:45 +02:00
cinap_lenrek
5f5caa6733 gs: avoid stupid shifts by casting to uint64_t 2019-05-03 21:10:01 +02:00
cinap_lenrek
2994fccbe1 ape: initial support for arm64 2019-05-03 21:06:46 +02:00
cinap_lenrek
dfd915892a libthread: initial support for arm64 2019-05-03 21:03:12 +02:00
cinap_lenrek
a3b9243f71 libmp: add dummy mkfile for arm64 2019-05-03 21:02:13 +02:00
cinap_lenrek
a3beef2363 libsec: dummy mkfile for arm64 2019-05-03 21:01:29 +02:00
cinap_lenrek
14b69dcde0 libmach: initial arm64 support 2019-05-03 21:00:17 +02:00
cinap_lenrek
9920ecc04b libc: initial arm64 support 2019-05-03 20:57:30 +02:00
cinap_lenrek
59ff04ddb1 7l: add missing AFMOVD with EXT/AUTO/LOREG operands to optab 2019-05-01 13:11:20 +02:00
cinap_lenrek
fe594760eb kernel: get rid of checkpagerefs() debugging
was only implemented by the pc kernel. does not
account pages used by the mount cache.
2019-05-01 12:40:27 +02:00
cinap_lenrek
b452f8857f kernel: export freepages() function so it can be used in mmurelease() 2019-05-01 10:07:39 +02:00
cinap_lenrek
a6ee23a739 kernel: include lock pointer in error report, stop spamming lockloop prints when we are panicing 2019-05-01 09:39:02 +02:00
cinap_lenrek
54562b6ac2 kernel: insert memory barrier in the scheduler before setting up->mach = nil
we have to ensure that all stores saving the process state
have completed before setting up->mach = nil in the scheduler.
otherwise, another cpu could observe up->mach == nil while
the stores such as the processes p->sched label have not finnished.
2019-05-01 09:35:51 +02:00
cinap_lenrek
97a2f14b1c [5678vq]c: fix .safe node type for *FUNC() = *FUNC() sugen 2019-05-01 08:55:24 +02:00
cinap_lenrek
aa52d3b13d vmx: build vmx only for 386 or amd64
vmx uses non portable word unpacking macros, breaking
the build for arm64. vmx only works on a pc anyway.
this forces objtype to 386 on these machines, similar
to what the kernel mkfiles do.
2019-05-01 08:19:29 +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
3fe9730645 7c: don't emit SXTW for non-register source operand 2019-04-25 19:44:16 +02:00
cinap_lenrek
bd510d7fb0 7l: there is no BIC* $bimm variant 2019-04-22 03:05:51 +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
83ab780783 nusb/usbd: stop sending port enable commands
from what i can tell, sending port enable is a spec violation.

this fixes a hang during hub enumeration in the ASMedia
xhci controller when i plug in my IBM UltraNav SK-8845.

also, send unsuspend when port is suspended instead of enable.

from the USB 2 specification:

11.24.2.7.1.2 PORT_ENABLE
...
This bit may be set only as a result of a SetPortFeature(PORT_ENABLE).
...
The hub response to a SetPortFeature(PORT_ENABLE) request is not specified.
2019-04-18 02:48:35 -07:00
cinap_lenrek
8c95a221b0 7l: deal with huge (negative or > 24bit) register offsets, fix LACON, avoid DWORD in constant pool when we can sign extend 2019-04-17 23:43:59 +02:00
cinap_lenrek
15c3f45e5f 7c: fix long to vlong/pointer conversion, avoid negative immediate offsets
we have to explicitely convert to vlong by sign or
zero extending as not every operation leaves a proper
zero/sign extended result in the register. for example
NEGW will zero extend, breaking negative int offsets
on pointers.

we explicitely insert SXTW or MOVWU instructions which
the peephole optimizer takes out again when it is safe
todo so.

when promoting constant offsets to immediate offsets,
make sure the offset will be in range. otherwise the
linker will produce not so optimal pointer arithmetic
instructions to calculate the offset.
2019-04-17 23:38:00 +02:00
cinap_lenrek
b44440bd16 devsd: fix sddelpart() AGAIN
the previous "fix" missed to advance pp so after
we hit a invalid partition all following partitions
would be ignored.
2019-04-16 16:25:33 +02:00
cinap_lenrek
7c33bdd2d3 awk: fix nextfile crash (thanks leetspete)
to reproduce the bug:

term% awk 'BEGIN{nextfile; nextfile;}'
sys: trap: fault read addr=0x10 pc=0x00019a3a
awk 6584: suicide: sys: trap: fault read addr=0x10 pc=0x00019a3a
2019-04-16 16:13:30 +02:00
BurnZeZ
75ee3b3081 devsd: fix panic when using "delpart" to remove a partition that was already removed 2019-04-15 19:48:03 +00: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
mischief
07674f6e8d nusb/usbd: fix dump %U formatter 2019-04-13 22:37:52 -07:00
cinap_lenrek
83c7a727e0 devip: reject bad numeric ports (such as 9fs -> 9) 2019-04-14 03:22:05 +02:00
cinap_lenrek
810aed76a5 bcm: move CONFADDR parsing into bootargs.c, simplify initcode start() args handling 2019-04-11 19:10:47 +02:00
cinap_lenrek
6aff58df75 bcm: don't use PADDR() to convert bus address to physical in vcore 2019-04-11 17:12:20 +02:00
cinap_lenrek
9ae99fb5ad kernel: get rid of KSTKSIZE alias for KSTACK 2019-04-11 14:05:23 +02:00
cinap_lenrek
37d36fdd7f kernel: get rid of PTR2UINT() and UINT2PTR() macros 2019-04-11 13:51:38 +02:00
cinap_lenrek
753fa51b77 bcm: dont assume PHYSDRAM 0 in dmaaddr(), fix dmaioaddr() 2019-04-11 13:49:41 +02:00
cinap_lenrek
6a3a3d69c6 bcm: add pl011 uart driver
the raspi has two uarts, the pl011 and the mini. only one
can be used at a time due to pin muxing. the bcm kernel
uses the mini by default.
2019-04-11 13:21:06 +02:00
cinap_lenrek
fe34e52d19 bcm: move okay() from uartmini.c to devarch.c 2019-04-10 15:06:56 +02:00
cinap_lenrek
f00aa6b92a bcm: add irq.c to mkfile 2019-04-10 15:06:24 +02:00
cinap_lenrek
55a3964517 bcm: move interrupt handling out of trap.c into irq.c 2019-04-10 15:04:59 +02: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
cinap_lenrek
b56ba6210f 7l: fix vlong constants in literal pool for non-MOV instructions 2019-04-08 14:15:39 +02:00
cinap_lenrek
12fc1c7d3e 7l: fix bitcon instruction selection and encoding
the possible bitmasks generated depend on the data width
of the instruction, so we introduce C_BITCON32 and C_BITCON64
operand types to keep them apart.

the encoding of the bitcon operation was wrong.
2019-04-08 14:12:01 +02:00
cinap_lenrek
d8d4802f80 7l: add arm64 linker (initial sync) 2019-04-08 14:05:27 +02:00
cinap_lenrek
394d095ee0 7a: fix indexreg operations 2019-04-08 13:53:41 +02:00
cinap_lenrek
275fbc93fd 7a: fix post increment operands 2019-04-08 13:50:11 +02:00
cinap_lenrek
14c7edf96e 7c: fix registerization of vlong constants 2019-04-08 13:47:45 +02:00
cinap_lenrek
b29d5ac7b1 add arm64 c compiler and assembler (thanks charles forsyth)
this is the the initial sync of charles forsyths plan9 c
compiler suite from http://bitbucket.org/plan9-from-bell-labs/9-cc
at changeset version 54:65fb8bb56c59
2019-04-08 13:45:49 +02:00
cinap_lenrek
d5a81af7be libauthsrv: authdial smprint() out of memory autism 2019-04-06 20:23:00 +02:00
cinap_lenrek
6540a9a21a sgi: remove obsolete TSTKTOP constant 2019-04-04 15:28:04 +02:00
cinap_lenrek
b7105fe066 xen: remove obsolete TSTKTOP constant 2019-04-04 15:25:10 +02:00
cinap_lenrek
8b160d1ea1 bcm: remove obsolete TSTKTOP constant 2019-04-04 15:23:20 +02:00
cinap_lenrek
0132e7fed0 pc64: get rid of TSTKTOP, USTKTOP is the end of user address space
the temporary stack segment used to be at a fixed address above or
below the user stack. these days, the temp stack is mapped dynamically
by sysexec so TSTKTOP is obsolete.
2019-04-04 15:21:25 +02:00
cinap_lenrek
ed6b42863c sshnet: get rid of Announced state, simplify 2019-04-03 23:49:22 +02:00
cinap_lenrek
634292c2f8 sshnet: implement listen (port forwarding) 2019-04-03 22:15:47 +02:00
cinap_lenrek
7a3ceb58fc sshnet: don't leak error string 2019-04-03 14:29:49 +02:00
cinap_lenrek
81f3b1a233 sshnet: don't leak "Dialing" connections when "connect" ctl write gets interrupted 2019-04-03 14:16:28 +02:00
cinap_lenrek
2251ef7a32 sshnet: pass on open failure error message, simplify
return the error message from MSG_CHANNEL_OPEN_FAILURE
in the "connect" control write.

use a extra state "Finished" to distinguish server from client
initiated teardown. that way we do not need to track if we
send the MSG_CHANNEL_CLOSE message in closeclient(). this way
we also cannot be fooled by misbehaving server.

simplify hangupclient() by removing state transitions and doing
them in the caller explicitely. that way we can use hangupclient()
instead of dialedclient().
2019-04-03 13:45:54 +02:00
cinap_lenrek
a278545e3c sshnet: fix eof and close handling, use proper packet size, cleanup 2019-04-03 10:49:47 +02:00
cinap_lenrek
3bb1804631 vt: dont make fs procs hang arround when closing rio window 2019-04-02 20:44:35 +02:00
cinap_lenrek
6d429cf9e8 ssh: print usage for unknown flags, cleanup 2019-04-02 19:22:19 +02:00
cinap_lenrek
a4ab7dbe46 sshnet: reduce memory consumption by lowering stack sizes 2019-04-02 18:29:22 +02:00
cinap_lenrek
48a82f2641 sshnet: fix memory leak 2019-04-02 18:06:25 +02:00
cinap_lenrek
d4033c31bb sshnet: allow 0 port 2019-04-02 17:51:15 +02:00
cinap_lenrek
dd8af39bce sshnet: fix write count for ctl message writes 2019-04-02 17:32:34 +02:00
cinap_lenrek
e0bdfe1e76 sshnet: actually make sure ssh established connection before exiting main proc
this fixes password prompts and handles errors properly.
2019-04-02 17:28:56 +02:00
cinap_lenrek
ae8a9f8b90 sshnet: bring back sshnet using ssh(1) mux mode
this is a port of the original ssh1 sshnet to our
ssh2 client using mux mode.
2019-04-02 16:23:01 +02:00
cinap_lenrek
38c2cdf164 ssh: add experimental mux mode
in mux mode, ssh relays raw MSG_CHANNEL_*
messages on standard input and output while
still handling authentication and key exchange
internally.

the intend is to use the mux mode to implement
something like the old sshnet ontop of ssh.
2019-04-02 11:18:50 +02:00
cinap_lenrek
ccbffa6731 merge 2019-04-02 09:05:01 +02:00
cinap_lenrek
47ec5de29e ssh: implement -W option for making remote tcp connections 2019-04-02 09:03:35 +02:00
BurnZeZ
5b81e7de3f walk: remove unused depth argument from dofile() 2019-03-30 15:10:36 +00:00
BurnZeZ
3f1fefeafb bootrc: simplify if statement 2019-03-30 15:09:00 +00:00
cinap_lenrek
4f0bfe0fb8 dtracy: avoid dmachlock() race
between being commited to a machno and having acquired the lock, the
scheduler could come in an schedule us on a different processor. the
solution is to have dtmachlock() take a special -1 argument to mean
"current mach" and return the actual mach number after the lock has
been acquired and interrupts being disabled.
2019-03-30 09:17:46 +01:00
cinap_lenrek
dea28126ae 5c: dont substibute (destination) registers contained in MOVM reglist
this fixes the miscompilation of 6l with 5c resulting in bogus
vlong -> long conversion at the top of asmandsz():

asmandsz 0x0000aec4	MOVW.W	R14,#-0x2c(R13)
asmandsz+0x4 0x0000aec8	MOVW	rex+8(FP),R5
asmandsz+0x8 0x0000aecc	MOVW	$andptr-SB(SB),R7
asmandsz+0xc 0x0000aed0	MOVW	R0,R6
asmandsz+0x10 0x0000aed4	AND	$#0x44,R5,R8
asmandsz+0x14 0x0000aed8	MOVW	R8,rex+8(FP)
asmandsz+0x18 0x0000aedc	MOVW	R0,R4
asmandsz+0x1c 0x0000aee0	MOVM.IA	(R0),[R1,R3] <- R1 used here
asmandsz+0x20 0x0000aee4	MOVW	R8,v-4(SP) <- substituted by R8
2019-03-29 06:35:41 +01:00
cinap_lenrek
a2fb8e4289 merge 2019-03-27 14:33:15 +01:00
cinap_lenrek
2f5983ba02 bootrc: handle automatic ip configuration on gbe media 2019-03-27 14:17:51 +01:00
cinap_lenrek
8d9f3906fa plan9.ini: add nora6= option to disable automatic ipv6 configuration 2019-03-27 14:11:25 +01:00
BurnZeZ
6da89d6266 added walk(1) 2019-03-25 23:10:02 +00:00
cinap_lenrek
41d4cecf6d upas/fs: release mailbox syncing lock after encountering error 2019-03-23 05:47:17 +01:00
cinap_lenrek
151039caf0 webfs: bracket literal ipv6 host in "Host:" header 2019-03-23 00:49:07 +01:00
cinap_lenrek
1e97adc86b nusbrc: detect "keyboardio model 01", appears as multifuction device with IAD csp(0102EF) (thanks sam-d) 2019-03-21 02:14:40 +01:00
cinap_lenrek
58668339bc nusb/kb: fix continuous scrollwheel delta not being reported (thanks sam-d) 2019-03-21 01:27:28 +01:00
cinap_lenrek
746a99e10d python: clean and nuke pgen and libpython.a for all $CPUS 2019-03-18 07:15:09 +01:00
cinap_lenrek
8f5d831e9e python: remove /$objtype/lib/ape/libpython.a, track graminit.h dependencies, remove graminit.c 2019-03-17 23:52:07 +01:00
cinap_lenrek
8f00b7096e ip/ipconfig: use defaults for loopback
- do not write /net/ndb for loopback medium unless -p is specified
- use defmask() instead of hardcoded /64 for v6 to get correct /128 mask for ::1
- only do duplicate address detection on ethernet
2019-03-17 05:44:55 +01:00
cinap_lenrek
7aac23b02b ip/ipconfig: use ewrite() to enable routing command for sendra 2019-03-17 04:07:30 +01:00
cinap_lenrek
d75f7d273b ip/tinc: 4096 bit RSA, (passive) pmtu discovery, fix udpfd close() race, cleanup
- increase buffer size to support up to 4096 bit RSA keys
- handle PMTUDiscovery option and respond to pmtu probes
- handle port in Address option
- wlock(&netlk) before closing udpfd to sync with writers
- move default subnet handling out of gethost()
2019-03-10 19:07:58 +01:00
cinap_lenrek
a0acae173e libmemdraw: remove static Point p00 and use ZP instead 2019-03-09 17:36:19 +01:00
cinap_lenrek
5a724464d9 libmemdraw: handle memarc() phi == 0 and phi <= -360, keep alpha in bounds 2019-03-09 17:34:22 +01:00
cinap_lenrek
c7b2ca5716 merge 2019-03-07 22:41:42 +01:00
cinap_lenrek
4b8f7a2110 devip: ignore the evil bit in fragment info field
using ~IP_DF mask to select offset and "more fragments" bits
includes the evil bit 15. so instead define a constant IP_FO
for the fragment offset bits and use (IP_MF|IP_FO). that way
the evil bit gets ignored and doesnt cause any useless calls
to ipreassemble().
2019-03-07 22:39:50 +01:00
mischief
617bf42890 vmx: check for draw initialization errors 2019-03-06 19:10:48 -08:00
cinap_lenrek
4885c75526 devip: ignore icmp advise about laggard fragments
icmp has to advise protocols about the first
fragment only. all other fragments should be
ignored.
2019-03-07 01:25:11 +01: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
14da3b8a1f ip/tinc: honor TcpOnly and IndirectData settings, script support, prefer incoming udp connections
only try listen/dial on udp when IndirectData/TcpOnly is not
enabled.

add support for scipts:
 host-up
 host-down
 tinc-up
 tinc-down
 subnet-up
 subnet-down

when dialing udp connection, only switch when there is no
other udp connection active. when we receive an authenticated
message, we switch to that connection immidiately.
2019-03-04 20:29:33 +01:00
cinap_lenrek
57284d07ca devip: ignore reserved fragment offset bits 2019-03-04 12:07:40 +01:00
cinap_lenrek
e2d310e623 devip: handle packet too big advise for icmp6, remove fragment header 2019-03-04 03:13:29 +01:00
cinap_lenrek
2af6b08960 devip: use common code in icmp for handling advise 2019-03-04 03:09:39 +01:00
cinap_lenrek
827020f686 devip: zero fragment offset after reassembly, remove tos magic, cleanup 2019-03-04 03:08:27 +01:00
cinap_lenrek
a1fceabd5b devip: fix fragment forwarding
unfraglen() had the side effect that it would always copy the
nexthdr field from the fragment header to the previous nexthdr
field. this is fine when we reassemble packets but breaks
fragments that we want to just forward unchanged.
2019-03-04 03:05:30 +01:00
cinap_lenrek
fa97c3dd10 devip: simplify ip reassembly functions, getting rid of Ipfrag.hlen
given that we now keep the block size consistent with the
ip packet size, the variable header part of the ip packet
is just: BLEN(bp) - fp->flen == fp->hlen.

fix bug in ip6reassemble() in the non-fragmented case:
reload ih after ip header was moved before writing ih->ploadlen.

use concatbloc() instead of pullupblock().
2019-03-03 18:56:18 +01:00
cinap_lenrek
a859f05837 devip: fix block list handling for icmp/icmp6, use proper MinAdvise for icmp6 2019-03-03 09:01:23 +01:00
cinap_lenrek
a2c0e55e68 qio: handle common case in trimblock() 2019-03-03 05:26:09 +01:00
cinap_lenrek
5b972a9aea devip: fix ip fragmentation handling issues with header options
some protocols assume that Ip4hdr.length[] and Ip6hdr.ploadlen[]
are valid and not out of range within the block but this has
not been verified. also, the ipv4 and ipv6 headers can have variable
length options, which was not considered in the fragmentation and
reassembly code.

to make this sane, ipiput4() and ipiput6() now verify that everything
is in range and trims to block to the expected size before it does
any further processing. now blocklen() and Ip4hdr.length[] are conistent.

ipoput4() and ipoput6() are simpler now, as they can rely on
blocklen() only, not having a special routing case.

ip fragmentation reassembly has to consider that fragments could
arrive with different ip header options, so we store the header+option
size in new Ipfrag.hlen field.

unfraglen() has to make sure not to run past the buffer, and hadle
the case when it encounters multiple fragment headers.
2019-03-03 05:25:00 +01:00
cinap_lenrek
0aac600fb3 lib9p: fix zero msize abort() due to unknown version (thanks kivik)
kivik wrote:

I've found a nasty bug in lib9p handling of Tversion
messages, where an invalid version string in the request
leads to servers abort()ing the spaceship.

To reproduce:
	; ramfs -S ram
	; aux/9pcon /srv/ram
	Tversion ~0 DIE

The issue lies in sversion() where in case an invalid
version string is received we respond right away with
ofcall.version="unknown"; however, we fail to set the
ofcall.msize, which at this point is cleared to 0.  This
causes the convS2M call in respond() to fail and abort being
called.
2019-03-01 01:43:55 +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
88ccea37f6 kernel: remove ptclbsum dependencies from configs 2019-02-27 08:47:17 +01:00
cinap_lenrek
242403d9f9 pi, pi2: remove ptclbsum dependency from config 2019-02-27 08:38:19 +01:00
cinap_lenrek
b76a78c1a1 cwfs: fix %.*s format in cmd_printconf() 2019-02-25 04:36:37 +01:00
cinap_lenrek
66ab4ac223 pc, pc64: fix %.*s format in multibootargs 2019-02-25 04:25:36 +01:00
cinap_lenrek
96d6f44335 wifi: fix %.*s format in wifictl 2019-02-25 04:22:03 +01:00