Commit graph

6734 commits

Author SHA1 Message Date
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 0c964838a1 distproto: add /lib/news/ (thanks lyndon) 2019-04-23 15:15:26 +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
cinap_lenrek 6bceabbc79 distproto: add /lib/ndb/dhcp/ directory (thanks lyndon) 2019-04-19 23:31:24 +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
BurnZeZ 71397d51d0 ip(3): document TCP ctl close command 2019-04-14 04:50:55 +00: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 f4f19cdf1a merge 2019-04-11 13:54:03 +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
BurnZeZ 424424fe50 fix bad function declarations in manpages 2019-04-09 18:34:17 +00:00
BurnZeZ 7b10062669 thread(2): threadsetname takes a fmt string 2019-04-08 22:18:15 +00: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 e897df33e6 rootstub: create arm64 directories 2019-04-08 13:07:18 +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 89a83271f4 sshnet(4): fix user@host syntax, add BUGS section, add ip(3) reference 2019-04-02 19:42:09 +02:00
cinap_lenrek 6d429cf9e8 ssh: print usage for unknown flags, cleanup 2019-04-02 19:22:19 +02:00
cinap_lenrek 009b624fe6 ssh(1): add sshnet(4) reference 2019-04-02 18:46:00 +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 fdcb55d696 sshnet(4): add documentation 2019-04-02 16:40:14 +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 ac3147a9c5 dist/mkfile: aux/stub -d /n/src9/usr to avoid overbinding /usr in case /n/src9 an / alias
when /n/src9 is an alias for / (bind / /n/src9), then the bind
from /sys/lib/dist/usr on /n/src9/usr would also overbind
/usr and potentially make the build target file inaccessible.

the solution is to run aux/stub -d /n/src9/usr.

this works as aux/stub mounts itself on /n/src9, so the bind
for /n/src9/usr will not override /usr in the root filesystem
but the stub directory from aux/stub.
2019-03-30 05:50:14 +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 4d3367d11f plan9.ini(8): add USB section, documenting various usb options 2019-03-27 14:31:45 +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 678be83990 merge 2019-03-18 07:16:37 +01:00
cinap_lenrek 746a99e10d python: clean and nuke pgen and libpython.a for all $CPUS 2019-03-18 07:15:09 +01:00
stanley lieber 36603ece3c fortunes: Open source may not be safe if it has no super excellent moderator. 2019-03-17 23:13:27 -04:00
cinap_lenrek c8fcefb38b dtracy(1): fix print(2) reference 2019-03-18 02:41:15 +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 5fe49f9c71 rootstub: create arm and mips directories in /usr/glenda/bin (tanks timclassic) 2019-03-17 02:43:49 +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 c0383d8291 mach(2): fix byteswapping function signatures 2019-03-06 19:10:58 -08: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
cinap_lenrek 4de506404b abaco: fix %.*s format in findctype() 2019-02-25 04:20:43 +01:00
cinap_lenrek 980d64826e atazz: fix %.*s format in special command processing 2019-02-25 04:20:00 +01:00
cinap_lenrek b4b4d2286b aux/depend: fix %.*s format in path concatenation 2019-02-25 04:18:30 +01:00
cinap_lenrek bc5b85c37c aux/statusmsg: fix %.*s format 2019-02-25 04:17:19 +01:00
cinap_lenrek 28bcea12aa aux/wpa: fix %.*s format in debug prints 2019-02-25 04:16:48 +01:00
cinap_lenrek 5d58b9573c cc: fix %.*s format usage in lexer "token too long" error 2019-02-25 04:15:43 +01:00
cinap_lenrek ac3e3c342f hgfs: fix %.*s usage in walk 2019-02-25 04:08:13 +01:00
cinap_lenrek a7ab815839 ip/cifsd: fix %.*s format xdirflush() path 2019-02-25 03:53:09 +01:00
cinap_lenrek 80b1890093 ip/ppp: fix %.*s format in debug print 2019-02-25 03:52:05 +01:00
cinap_lenrek cb8ef42b55 ip/pppoe: fix %.*s format in debug prints 2019-02-25 03:51:19 +01:00
cinap_lenrek b01b637889 ip/socksd: fix %.*s format in dialstring 2019-02-25 03:50:14 +01:00
cinap_lenrek 80a1d1ab93 ip/tftpd: fix %.*s format for homedir path 2019-02-25 03:49:17 +01:00
cinap_lenrek 1335a57865 ip/torrent: fix %.*s format in dialstring 2019-02-25 03:48:12 +01:00
cinap_lenrek bcaf95bb5a libpanel: fix %.*s format in pl_snarfentry() 2019-02-25 03:45:49 +01:00
cinap_lenrek a37402be19 nusb/audio: fix %.*s format usage 2019-02-25 03:41:10 +01:00
cinap_lenrek 5ec91a6413 upas/fs: fix %.*s format usage 2019-02-25 03:39:31 +01:00
cinap_lenrek 2e5cd278d7 upas/ned: fix %.*s format in parsesearch(), improve mkfile 2019-02-25 03:34:25 +01:00
cinap_lenrek 536805bce3 upas/scanmail: fix %.*s format in xprint(), improve mkfile 2019-02-25 03:31:50 +01:00
cinap_lenrek e3aee39a38 upas/smtp: fix %.*s format for challenge in smtpcram()
the challenge should already be in ASCII format,
but better safe than sorry.
2019-02-25 03:29:19 +01:00
cinap_lenrek 3043052e24 vt: fix %.*s in sendncars() 2019-02-25 03:25:36 +01:00
cinap_lenrek e1dcd2beb4 webfs: properly handle %.*s in url path and debug prints 2019-02-25 03:21:09 +01:00
cinap_lenrek 05227960c6 ssh: don't assume error messages are ASCII. format number of complete runes, not bytes. 2019-02-25 01:19:44 +01:00
cinap_lenrek cce5422e79 ip/tinc: fix mistake from previous commit 2019-02-15 02:16:31 +01:00
cinap_lenrek dc6772fccc libip: prefer v4 over v6 for myipaddr()
myipaddr() is used in legacy applications that assume a
single ip address per host. so prefer to retun a v4
address over a v6 one.
2019-02-13 18:56:21 +01:00
cinap_lenrek 06912e53e4 devip: remove unused eipconvtet.c and ptclbsum.c files 2019-02-13 17:42:20 +01:00
cinap_lenrek 57ed5cc3f0 devip: ipv6 loopback ::1 has link-local scope 2019-02-13 08:46:49 +01:00
cinap_lenrek cf5095143f merge 2019-02-13 04:47:29 +01:00
cinap_lenrek c0176a5051 ip/ipconfig: format ipmask with %M instead of %I 2019-02-13 04:45:41 +01:00
BurnZeZ ffdbfdf991 postscript: use PI 2019-02-13 03:24:31 +00:00
cinap_lenrek 0ed8f6ff5f libip: don't reject ipmask in v6 form for v4 address 2019-02-13 04:04:33 +01:00
cinap_lenrek 45213ee6c7 ip/ipconfig, ndb/dns, libndb: handle parseipmask() errors 2019-02-12 21:44:57 +01:00
cinap_lenrek d551a83ae4 libip: return -1 in parseipmask() and parseipandmask() when mask is not ipv4 and v4 argument was set 2019-02-12 21:43:22 +01:00
cinap_lenrek 7102a23245 devip: use parseipandmask() for ipifc and route control message parsing 2019-02-11 23:43:14 +01:00
cinap_lenrek b1c9ddb3f0 ndb/dns: provide v4 argument to parseipmask(), use snprint() instead of sprint() 2019-02-11 23:42:15 +01:00
cinap_lenrek fd277c053d upas/smtpd: implement ipv6 support for ip blacklist, replace v4parsecidr() with parseipandmask() 2019-02-11 23:40:34 +01:00
cinap_lenrek 50e617f8b6 ratfs: implement ipv6 support, replace v4parsecidr() with parseipandmask() 2019-02-11 23:38:58 +01:00
cinap_lenrek 168dabc142 ip/rip: use new parseipandmask() function 2019-02-11 23:36:29 +01:00
cinap_lenrek 595fbddb1c ip/ayiya: use parseipandmask(), use ipvmp() instead of equivip6() 2019-02-11 23:34:26 +01:00
cinap_lenrek 97d45a5468 ip/6in4: use parseipandmask(), use ipvmp() instead of equivip6() 2019-02-11 23:33:44 +01:00
cinap_lenrek 584343aa16 ip/tinc: use new parseipandmask() to parse subnets, use ipcmp()/ipmove(), remove prefixlen 2019-02-11 23:32:40 +01:00
cinap_lenrek 7a12930910 ip/dhcpd: provide v4 argument for parseipmask() 2019-02-11 23:30:52 +01:00
cinap_lenrek 7c3db1d620 ip/ipconfig: use new parseipandmask() function 2019-02-11 23:29:53 +01:00
cinap_lenrek a7c01127f9 libndb: provide parseipmask() v4 argument in subnet(), use snprint() instead of sprint() 2019-02-11 23:28:43 +01:00
cinap_lenrek 0af11f97b5 libip: replace v4parsecidr() with new parseipandmask()
we want to accept V4 subnets in CIDR notation consistently which
means we need to interpret the mask in context of the IP address.
so parseipmask() now has an additional v4 flag argument which
offsets the prefixlength by 96 so a /24 will be interpreted
as a /120.

parseipandmask() is the new function which handles this automatically
depending on the ip address type.

v4parsecidr() is now obsolete.
2019-02-11 23:26:57 +01:00
cinap_lenrek 66b9196f77 segment(3): use bind -c in examples (thanks henesy) 2019-02-08 22:28:20 +01:00
cinap_lenrek 01b6aa0f9f cifs: merge with steve simons latest version. thank you very much! 2019-02-05 23:10:03 +01:00
cinap_lenrek a2abe177e4 cifs: fix pruning of . and .. directory entries (thanks steve simon)
steve wrote:

> I cam across a bug in cifs.
>
> An empty directory under windows 7 pro contains a single entry "." but it
> doesn't appear to contain "..". As a result "." is not removed on dirscan
> and plan9 gets when trying to traverse the hierarchy.
2019-02-05 20:53:40 +01:00
cinap_lenrek 31637404ba bcm: include sdmmc in pi kernel configuration 2019-02-01 23:31:44 +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 8e1218aceb bcm: list devswap only once in devtab array 2019-01-30 18:05:04 +01:00
cinap_lenrek 5b5416aa05 devdraw: simplify drawgen() 2019-01-28 23:29:22 +01:00
cinap_lenrek 8152e9d075 devip: tcp: Don't respond to FIN-less ACKs during TIME-WAIT (thanks Barret Rhoden)
Under the normal close sequence, when we receive a FIN|ACK, we enter
TIME-WAIT and respond to that LAST-ACK with an ACK.  Our TCP stack would
send an ACK in response to *any* ACK, which included FIN|ACK but also
included regular ACKs.  (Or PSH|ACKs, which is what we were actually
getting/sending).

That was more ACKs than is necessary and results in an endless ACK storm
if we were under the simultaneous close sequence.  In that scenario,
both sides of a connection are in TIME-WAIT.  Both sides receive
FIN|ACK, and both respond with an ACK.  Then both sides receive *those*
ACKs, and respond again.  This continues until the TIME-WAIT wait period
elapses and each side's TCP timers (in the Plan 9 / Akaros case) shut
down.

The fix for this is to only respond to a FIN|ACK when we are in TIME-WAIT.
2019-01-27 22:12:50 +01:00
cinap_lenrek 63a0d519bc dhcpd(8), ndb(6): group related ndb attributes together 2019-01-24 20:30:14 +01:00
cinap_lenrek 4e91e4a2db ip/dhcpd: remove undocumented dhcpgroup mechanism, group related ndb attributes together 2019-01-24 20:29:39 +01:00
cinap_lenrek eb7eea0bb9 troff: fix -ms mug (thanks aksr)
Executing .KS after .1C exhibits a bug.
Instead on the next page, the text between .KS and .KE is shown at
the bottom of the page (where footnote would be).
To reproduce the bug: http://sprunge.us/xyCUX7

The bug can be fixed by changing two lines in tmac.s:

    if \\n(NX<1 .bp\}

to

    if \\n(NX<=1 .bp\}

and

    if \\n(NX<1 'bp\}
to

  if \\n(NX<=1 'bp\}
2019-01-23 21:28:22 +01:00
cinap_lenrek d1a0091b56 dhcpd(8), ndb(6): update documentation (thanks k0ga) 2019-01-23 20:58:52 +01:00
cinap_lenrek c58df62d06 ip/dhcpd: send vendor ndb attribute if available (thanks k0ga)
At this moment plan9 is using vendorinfo to communicate
some specific plan9 parameters, but there are some boards
that use this attribute to set specific values. This
patch allows netbooting of these boards using ndb attributes
instead of hard coded solutions in dhcpd(1). Vendor attribute
is used for that purpose because it is also used for the
same purpose in bootp.
2019-01-23 20:57:20 +01:00
cinap_lenrek ad6e6444f9 ip/dhcpd: add rootserverip read in lookupip() (thanks k0ga)
Lookupip() was already reading rootpath, but it didn't read the
address of the rootserver.  As they are very related it makes sense to
read them at the same time.

This patch also fixes a typo, where vendorclass was used instead of
vendor, resulting that vendor ndb attribute was never used.
2019-01-23 20:49:50 +01:00
cinap_lenrek 3cf63ee15f ip/dhcpd: change swap to rootserver (thanks k0ga) 2019-01-23 20:47:48 +01:00
cinap_lenrek 058951bb80 devtls: remove static "already" flag in tlsinit(). this function is only run once. 2019-01-22 22:08:07 +01:00
cinap_lenrek 26d36c3ae2 devswap: simplify, don't panic when writing swapfile fails
always start the pager kproc in swapinit(), simplifying kickpager().

allow zero conf.nswap and conf.nswppo. avoid allocating the reference
map and iolist arrays in that case.

use ulong for ioptr and iolist indices.

don't panic when writing pages out to the swapfile fails. just
requeue the page in the io transaction list so we will try
again next time executeio() is run or just free the page when
the swap reference was dropped.

remove unused pagersummary() function.
2019-01-22 22:06:42 +01:00
cinap_lenrek 4b2f31131a pc64: properly handle faulterror in faultamd64()
replicate what faulterror() would have done with up->nerrlab == 0,
that is, terminate the process.
2019-01-22 21:55:20 +01:00
Alex Musolino 927e342aca upas/fs: remove unused function pop3log 2019-01-22 15:11:53 +10:30
aiju b9745c60a1 merge 2019-01-20 12:55:31 +01:00
cinap_lenrek 116b075371 rc: clear out redirections on "rfork F" (RFCFDG)
rfork F closes all file descriptors, so we have to
invalidate the redirections as they are now refering
to closed files. not doing so causes the wrong file
descriptors being closed later on as the fd numbers
get reused.
2019-01-20 12:02:03 +01:00
aiju 62bedca19f dtracy: fix && 2019-01-20 03:07:10 +00: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 1759a1746d /sys/lib/plumb/basic: make plumbing page bookmarks work with relative paths (thanks Tobias Heinicke) 2019-01-12 20:07:23 +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 9ba89d63ef merge 2019-01-12 15:35:50 +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
qwx 9f755671fb torrent: avoid trying to fetch blocks past file 2019-01-08 13:22:09 +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 c88ed6488f upas/fs: don't put messages on the lru that cannot be uncached
the lru is there to track least recently used messages so
we can evict them from the cache and refetch them again on
demand. for pop3 mailbox, which doesnt provide fetch routine,
the messages should never be put on the freelist.
2019-01-02 10:26:38 +01:00
cinap_lenrek de8580ed9f upas/fs: include mkupas in mkfile last to get default target 2019-01-02 10:22:27 +01:00
Alex Musolino 2c6cc12133 upas/fs: fix infinite loop in putcache (again)
The previous attempt to fix this problem (see changesets b32199e0f90a
and 00ae79a6ba50) caused all calls to cachefree to free the cached
message contents in addition to updating the LRU list.  This causes
problems for the POP3 driver since it provides no fetch function; once
a message is evicted from the LRU cache, its contents is lost.

This time we fix cachefree to always update the LRU list but only free
the cached message contents if the driver provides a fetch function or
the force flag is set.
2018-12-31 00:00:09 +10:30
cinap_lenrek f464b7ff16 rsa(8): add example for tinc(8) (thanks k0ga, qwx) 2018-12-28 11:46:15 +01:00
aiju 83b854df0d dtracy: fix conditional branch generation 2018-12-28 10:26:25 +00:00
BurnZeZ ca10fccafe remove function prototype that leaked into last commit 2018-12-26 04:51:35 +00:00
BurnZeZ c650a7db0c tcs: clean up old port code, and avoid writing 0 to stdout 2018-12-26 04:47:22 +00:00
cinap_lenrek 27921a1ba0 mk: fix closing random fd from uninitialized stack variable (thanks BurnZeZ, mycroftiv)
mycroftiv → this is practically "500 mile email" territory - the "6 letter mk bug"
2018-12-26 05:04:56 +01:00
cinap_lenrek 1b619dea42 nusb/disk: revert previous attempts and just not issue capacity command when theres no media present 2018-12-24 19:06:01 +01:00
Ori Bernstein ee9b29550f Make the check work.
Embarrassing.
2018-12-23 23:10:42 -08:00
cinap_lenrek c80f22f74a nusb/disk: implement 64 bit lba read/write commands (16 byte commands)
untested.
2018-12-24 05:10:43 +01:00
cinap_lenrek 2aec1f8a09 nusb/disk: fix typo "(" 2018-12-24 05:05:41 +01:00
Ori Bernstein bb151fa789 Don't unnecessarily unstall devices.
Some SD card readers are slow to unstall. We try to unstall them
in a loop if there's no SD card in there, but they're not stalled.
They're happily reporting that there's no SD card in them by giving
back the appropriate error code.

Skipping the unstall speeds up the retry loop, cutting the time spent
attaching the USB device at boot from multiple minutes to nearly instant.
2018-12-23 19:44:58 -08:00
cinap_lenrek ec1c1b9b52 dossrv: cleanup 2018-12-24 01:21:47 +01:00
cinap_lenrek 1e0b65c8bf dossrv: make GLONG() return ulong, handle getsect() error in dostat() 2018-12-23 22:43: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
cinap_lenrek 4a634d2102 dossrv: use 64 bit vlong for sectors 2018-12-22 20:49:24 +01:00
cinap_lenrek 9fe1377336 dtracy: avoid pointer to integer truncation warning on amd64 2018-12-15 20:39:32 +01:00
aiju 192a222f5b fplot: fix operator associativity 2018-12-15 11:57:35 +00:00
aiju 3114102485 fplot: add min/max operators 2018-12-13 16:15:10 +00:00
aiju c7304ea03c dtracy: get rid of DTName struct, support more than three parts in a probe name, wildcard matching 2018-12-13 10:42:49 +00:00
aiju dae5a44111 pc(1): reference counting bug 2018-12-13 10:38:21 +00:00
Alex Musolino c69bf6e0bc merge 2018-12-13 12:00:32 +10:30
Alex Musolino b830824cba upas/fs: remove now unnecessary "force" argument to cachefree 2018-12-13 11:59:34 +10:30
cinap_lenrek eb5676d4be upas/fs: handle errors from fetch for cachebody()/cacheheaders()
for imap, when a fetch fails, error out of read and stat. also don't
add failed to download messages into the lru.
2018-12-12 19:33:08 +01:00
Alex Musolino 9b194f23b2 merge 2018-12-12 12:51:29 +10:30
Alex Musolino b836802fe6 upas/fs: fix infinite loop in putcache
Force the cacheclear operation in the LRU cache trimming loop in order
to guarantee that the cache becomes smaller with each iteration.

Without the force flag cacheclear is a no-op for mailboxes that do not
provide a fetch function, e.g. POP3.
2018-12-12 12:48:53 +10:30
stanley lieber 4c68cfa412 fortunes: [9fans] ..... UNSUBSCRIBE_HELP NEEDED 2018-12-11 12:57:36 -05:00
aiju 40d6302b5f forgotten files 2018-12-11 09:20:34 +00: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
BurnZeZ e93a85710e sshfs: add exits(nil) to threadmain 2018-12-10 05:18:05 +00:00
aiju ca851bbb5e dtracy: call dtptrigger with a struct pointer rather than a list of arguments; put return value in arg9 2018-12-09 21:43:22 +00:00
aiju b96be17376 dtracy: fix lexer bug 2018-12-08 18:04:25 +00:00
aiju 722a1a3334 fix dtracy man page 2018-12-08 17:24:23 +00:00
aiju 6056a46c64 add dtracy manpage 2018-12-08 16:35:21 +00:00
aiju 58fa29447b dtracy: add support for aggregations 2018-12-08 15:07:53 +00:00
cinap_lenrek 03e60450c2 rio: get rid of window delete thread, fix mysterious disappearing windows
because a client might not handle resize, rio would try to move ther
window offsceen after 750 ms. however, it does this by window name,
which could have been reassigned by another concurrent rio, causing the
wrong window to disappear.

now we always move the window offscreen before freeimage(). this way we
are sure to still have the right reference to the original window.
2018-12-07 16:32:04 +01:00
BurnZeZ 96b1debbf8 add entries for il rcpu 2018-12-07 01:41:27 +00:00
BurnZeZ c6d4cd09a3 ptrap(4): fix formatting 2018-12-06 06:53:41 +00:00
aiju 4415dde6d3 forp: change indexing to verilog-like semantics 2018-12-06 10:56:32 +00:00
BurnZeZ 023f5eca58 acid: fix transcript 2018-12-06 07:11:35 +00:00
aiju 64d0d3b8ac libmp: fix mptouv behaviour to match mptoui 2018-12-06 09:32:20 +00:00
aiju 17b80cbcf1 libmp: add tests for integer conversions 2018-12-06 09:32:07 +00:00
aiju 7e477cc769 mptov: make it actually work 2018-12-05 10:26:52 +00:00
cinap_lenrek 6891093034 kernel: remove unused static variable "sofar" from timerintr() (thanks mischief) 2018-12-05 03:59:08 +01:00
cinap_lenrek d15aca0532 kernel: fix tprof on multiprocessor
segclock() has to be called from hzclock(), otherwise
only processes running on cpu0 would catche the interrupt
and the time delta would be wrong.

lock the segment when allocating Seg->profile as
profile ctl might be issued from multiple processes.
Proc->debug qlock is not sufficient.

Seg->profile can never be freed or reallocated once
set as the timer interrupt accesses it without any
locking.
2018-12-05 01:43:19 +01:00
cinap_lenrek 79bfff6437 factotum: rsa: use mptober() to get right adjusted result instead of mptobe() and memset() 2018-12-04 19:34:36 +01:00
cinap_lenrek c5393d612f bootrc: remove $ff references (was old parsed /boot/boot argument list) 2018-12-04 18:55:56 +01:00
aiju b5f7e27f44 kencc: make "function not declared" a warning unless compiling with -T 2018-12-02 11:36:58 +00:00
mischief a847d7a53d python: explicitly declare WaitForThreadShutdown as void 2018-12-02 03:30:30 -08:00
mischief cb7375dcbc ape: declare gethostname 2018-12-02 03:30:22 -08:00
cinap_lenrek 9eeca04d87 merge 2018-12-02 03:27:19 +01:00
cinap_lenrek 117f177ccf libsec: fix memory leak in pkcs1_decrypt() 2018-12-02 03:23:48 +01:00
BurnZeZ 2b1454e81c libdtracy: wrong operator in XORI (thanks aiju) 2018-12-01 18:07:40 +00:00