]> git.lizzy.rs Git - plan9front.git/log
plan9front.git
9 years agohgignore: ignore amd64 kernel and init
mischief [Sat, 27 Sep 2014 08:35:06 +0000 (01:35 -0700)]
hgignore: ignore amd64 kernel and init

9 years agondb/dns: request recursion only for local dns servers
cinap_lenrek [Sun, 28 Sep 2014 03:15:25 +0000 (05:15 +0200)]
ndb/dns: request recursion only for local dns servers

we used to set RD flag in requests unconditionally, which
is fine by the standard but some dns server administrators
seem to use it as a denial of service indicator (for ther
non recursive authoritative nameservers) and ignore the
request.

so only set the RD flag when talking to local dns servers.

9 years agodevcons: avoid division by zero reading Qsysstat
cinap_lenrek [Sun, 28 Sep 2014 00:42:33 +0000 (02:42 +0200)]
devcons: avoid division by zero reading Qsysstat

alexchandel got the kernel to crash with divide error
on qemu 2.1.2/macosx at this location. probably
caused by perfticks()/tsc being wrong or accounttime()
not having been called yet from timer interrupt yet for
some reason.

9 years agogames/gba: remove bogus file
aiju [Sun, 28 Sep 2014 20:42:11 +0000 (22:42 +0200)]
games/gba: remove bogus file

9 years agomerge
aiju [Sat, 27 Sep 2014 18:51:00 +0000 (20:51 +0200)]
merge

9 years agogames/gba: slowly working (no pun intended)
aiju [Sat, 27 Sep 2014 18:50:20 +0000 (20:50 +0200)]
games/gba: slowly working (no pun intended)

9 years agopc64: enable rtl8169 driver (thanks awabimakoto for testing)
mischief [Wed, 24 Sep 2014 21:19:22 +0000 (14:19 -0700)]
pc64: enable rtl8169 driver (thanks awabimakoto for testing)

9 years ago6c/8c: eleminate moves by swaping source and destination operands in peephole pass
cinap_lenrek [Wed, 24 Sep 2014 18:45:16 +0000 (20:45 +0200)]
6c/8c: eleminate moves by swaping source and destination operands in peephole pass

9 years agoacid: fix sysr1() stack corruption
cinap_lenrek [Mon, 22 Sep 2014 21:07:59 +0000 (23:07 +0200)]
acid: fix sysr1() stack corruption

the syscall stubs (for amd64) currently have a unconditional
spill of the first (register) argument to the stack.

sysr1 (and _nsec) are exceptional in that they do not
take any arguments, so the stub is writing unconditionally
to ther first argument slot on the stack.

i could avoid emiting the spill in the syscall stubs for
sysr1 but that would also break truss which assumes fixed
instruction sequence from stub start to the syscall number.

i'm not going to complicate the syscall stubs just for
sysr1 (_nsec is not used in 9front), but just add a dummy
argument to sysr1 definition that can receive the bogus
argument spill.

9 years agodevip: sanity check Nchan in Fsproto()
cinap_lenrek [Sun, 21 Sep 2014 17:24:38 +0000 (19:24 +0200)]
devip: sanity check Nchan in Fsproto()

devip can only handle Maskconv+1 conversations per
protocol depending on how many bits it uses in the
qid to encode the conversation number.

we check this when the protocol gets registered.

if we do not do this, the kernel will mysteriously
panic when the conversaion numbers collide which
took some time to debug.

9 years agosysinfo: relax regex for start of kernel boot messages
cinap_lenrek [Sun, 21 Sep 2014 16:28:35 +0000 (18:28 +0200)]
sysinfo: relax regex for start of kernel boot messages

we used to look for /^Plan 9$/ for the start of kernel
boot messages in /dev/kmesg. but the xen kernel prints
Plan 9 (.....) on boot. so just look for line starting
with /^Plan 9/ for now.

9 years agodevip: print protocol name in garbage collection notification
cinap_lenrek [Sun, 21 Sep 2014 16:02:53 +0000 (18:02 +0200)]
devip: print protocol name in garbage collection notification

9 years agopc64: print "Plan 9" on boot, cleanup pccpu64 files
cinap_lenrek [Sun, 21 Sep 2014 14:06:25 +0000 (16:06 +0200)]
pc64: print "Plan 9" on boot, cleanup pccpu64 files

9 years agostats: handle /dev/sysstat 32bit overflow in delta calculation
cinap_lenrek [Sat, 20 Sep 2014 16:06:59 +0000 (18:06 +0200)]
stats: handle /dev/sysstat 32bit overflow in delta calculation

the numbers from /dev/sysstat overflow on 32bit, so have
to do subtraction modulo 2^32 as we calculate with 64bit
integers.

thanks mischief for reporting this.

9 years agopc64: syscallfmt for nsec syscall
cinap_lenrek [Fri, 19 Sep 2014 23:37:11 +0000 (01:37 +0200)]
pc64: syscallfmt for nsec syscall

9 years agopc64: put return value of nsec syscall in register on amd64
cinap_lenrek [Fri, 19 Sep 2014 23:07:46 +0000 (01:07 +0200)]
pc64: put return value of nsec syscall in register on amd64

WHAT WHERE THEY *THINKING*??!?!

unlike seek, the (new) nsec syscall (not used in 9front libc)
returns the time value in register (from nix), so do the same
for compatibility.

9 years agolibmemdraw: fix byte ordering in memfillcolor()
cinap_lenrek [Fri, 19 Sep 2014 15:49:48 +0000 (17:49 +0200)]
libmemdraw: fix byte ordering in memfillcolor()

memfillcolor() used to write longs in host byte
order which is wrong. have to always use little
endian.

to simplify, moved little endian conversion into
memsetl() and memsets() avoiding code duplication.

9 years agolib9p: fix nil dereference crash in remove for directory permission check
cinap_lenrek [Fri, 19 Sep 2014 03:22:26 +0000 (05:22 +0200)]
lib9p: fix nil dereference crash in remove for directory permission check

file->parent can be nil when the file has been previously removed.
removefile() deals with this, so skip the permission check in
that case and let removefile() error out.

9 years agoteg2: fix wrong l2 setshift address in wholecache() (from sources)
cinap_lenrek [Wed, 17 Sep 2014 14:34:30 +0000 (16:34 +0200)]
teg2: fix wrong l2 setshift address in wholecache() (from sources)

9 years agooggdec: recognize "begin of stream" packets and restart decoding
cinap_lenrek [Tue, 16 Sep 2014 18:25:01 +0000 (20:25 +0200)]
oggdec: recognize "begin of stream" packets and restart decoding

9 years agomerge
cinap_lenrek [Tue, 16 Sep 2014 14:42:16 +0000 (16:42 +0200)]
merge

9 years agolibauthsrv: allow multiple auth= attributes for backup auth servers, authdial() tries...
cinap_lenrek [Tue, 16 Sep 2014 14:41:05 +0000 (16:41 +0200)]
libauthsrv: allow multiple auth= attributes for backup auth servers, authdial() tries each one in order

some of us run auth servers from home that are used by multiple
servers on the internet. when the home authserver becomes unreachable,
services on the outside servers stop working. so we thought about
specifing a secondary auth servers for backup when the primary
server is not reachable.

this changes authdial() to consult multiple auth= entries in
the authdom= or dom= tuples, trying each one in order until
dial() succeeds.

9 years agoramfs: allow changing mtime in wstats
mischief [Mon, 15 Sep 2014 22:49:39 +0000 (15:49 -0700)]
ramfs: allow changing mtime in wstats

9 years agohg: make intermediate directories like newer hg does
mischief [Mon, 15 Sep 2014 20:42:54 +0000 (13:42 -0700)]
hg: make intermediate directories like newer hg does

9 years agoramfs: fix directory check in wstat() (thanks mischief)
cinap_lenrek [Tue, 16 Sep 2014 20:33:27 +0000 (22:33 +0200)]
ramfs: fix directory check in wstat() (thanks mischief)

9 years agodevtls: fix typo in debug print
cinap_lenrek [Mon, 15 Sep 2014 06:19:51 +0000 (08:19 +0200)]
devtls: fix typo in debug print

9 years agotelnetd: let the kernel place the shared segment in segattach() (thanks kenji arisawa)
cinap_lenrek [Sun, 14 Sep 2014 19:20:13 +0000 (21:20 +0200)]
telnetd: let the kernel place the shared segment in segattach() (thanks kenji arisawa)

9 years agolibmemdraw: update drawtest to use same rounding in alpha calculation as libmemdraw
cinap_lenrek [Sun, 14 Sep 2014 15:03:56 +0000 (17:03 +0200)]
libmemdraw: update drawtest to use same rounding in alpha calculation as libmemdraw

9 years agokernel: fix segattach() rounding of va+len (thanks kenji arisawa)
cinap_lenrek [Sun, 14 Sep 2014 14:04:22 +0000 (16:04 +0200)]
kernel: fix segattach() rounding of va+len (thanks kenji arisawa)

from segattach(2):

          Va and len specify the position of the segment in the
          process's address space.  Va is rounded down to the nearest
          page boundary and va+len is rounded up.  The system does not
          permit segments to overlap.  If va is zero, the system will
          choose a suitable address.

just rounding up len isnt enougth. we have to round up va+len
instead of just len so that the span [va, va+len) is covered
even if va is not page aligned.

kenjis example:

print("%p\n",ap); // 206cb0
ap = segattach(0, "shared", ap, 1024);
print("%p\n",ap); // 206000

term% cat /proc/612768/segment
Stack     defff000 dffff000    1
Text   R      1000     6000    1
Data          6000     7000    1
Bss           7000     7000    1
Shared      206000   207000    1
term%

note that 0x206cb0 + 0x400 > 0x20700.

9 years agohgignore: ignore intermediate object files for amd64
mischief [Sat, 13 Sep 2014 13:23:41 +0000 (06:23 -0700)]
hgignore: ignore intermediate object files for amd64

9 years agohgignore: ignore mips binaries
mischief [Sat, 13 Sep 2014 13:14:39 +0000 (06:14 -0700)]
hgignore: ignore mips binaries

9 years agovi: implement _nsec syscall
mischief [Sat, 13 Sep 2014 13:07:57 +0000 (06:07 -0700)]
vi: implement _nsec syscall

9 years agolibsec: experimental DHE client support for tls and cleanups
cinap_lenrek [Sun, 14 Sep 2014 00:30:46 +0000 (02:30 +0200)]
libsec: experimental DHE client support for tls and cleanups

9 years agolibsec: add diffie-hellman functions
cinap_lenrek [Sun, 14 Sep 2014 00:29:18 +0000 (02:29 +0200)]
libsec: add diffie-hellman functions

9 years agolibsec: fix hmac for keys bigger then 64 byte block size
cinap_lenrek [Sun, 14 Sep 2014 00:26:26 +0000 (02:26 +0200)]
libsec: fix hmac for keys bigger then 64 byte block size

RFC2104 defines HMAC for keys bigger than the 64 byte block
size as follows:

Applications that use keys longer than B (64) bytes will
first hash the key using H (the hash function) and then
use the resultant L byte string as the actual key to HMAC.

9 years agolibsec: ecgen() and ecdsasign() fix
aiju [Sat, 13 Sep 2014 17:46:41 +0000 (19:46 +0200)]
libsec: ecgen() and ecdsasign() fix

9 years agoacme: remove unused #include
BurnZeZ [Thu, 11 Sep 2014 16:47:04 +0000 (12:47 -0400)]
acme: remove unused #include

9 years agogames/gb: minor goof
aiju [Thu, 11 Sep 2014 09:36:35 +0000 (11:36 +0200)]
games/gb: minor goof

9 years agogames/nes: reduce volume, causes overflow and confuses ac97
aiju [Thu, 11 Sep 2014 09:20:57 +0000 (11:20 +0200)]
games/nes: reduce volume, causes overflow and confuses ac97

9 years ago/lib/rob: Just write the code.
stanley lieber [Sat, 6 Sep 2014 05:11:18 +0000 (01:11 -0400)]
/lib/rob: Just write the code.

9 years agoadd /lib/terry
stanley lieber [Sat, 6 Sep 2014 05:09:37 +0000 (01:09 -0400)]
add /lib/terry

9 years agoip/ayiya: experimental anything in anything tunnel protocol client
cinap_lenrek [Sat, 6 Sep 2014 20:59:58 +0000 (22:59 +0200)]
ip/ayiya: experimental anything in anything tunnel protocol client

this is a work in progress implementation of the ayiya (anything
in anything) protocol as used by sixxs.net. hiro tested it and it
worked for him, but progress has stalled as sixxs.net rejected my
request for an account and ignored my emails since.

9 years agodoom: fix alignment issues for arm
cinap_lenrek [Thu, 4 Sep 2014 21:02:37 +0000 (23:02 +0200)]
doom: fix alignment issues for arm

9 years ago5e: fix signed long multiply
cinap_lenrek [Thu, 4 Sep 2014 20:53:54 +0000 (22:53 +0200)]
5e: fix signed long multiply

9 years ago5e: push ERRMAX for note message on stack avoiding unaligned stack pointer
cinap_lenrek [Wed, 3 Sep 2014 17:23:55 +0000 (19:23 +0200)]
5e: push ERRMAX for note message on stack avoiding unaligned stack pointer

9 years agoether8139: fix pointer to smaller int tuncation warning on amd64
cinap_lenrek [Tue, 2 Sep 2014 14:20:43 +0000 (16:20 +0200)]
ether8139: fix pointer to smaller int tuncation warning on amd64

9 years ago/sys/lib/dist/ndb/common: add auth=fs.stanleylieber.com authdom=inri
stanley lieber [Fri, 29 Aug 2014 00:46:56 +0000 (20:46 -0400)]
/sys/lib/dist/ndb/common: add auth=fs.stanleylieber.com authdom=inri

9 years agofortunes: $75K Prosthetic Arm Is Bricked When Paired iPod Is Stolen
stanley lieber [Wed, 27 Aug 2014 05:13:11 +0000 (01:13 -0400)]
fortunes: $75K Prosthetic Arm Is Bricked When Paired iPod Is Stolen

9 years agoipconfig: remove sleep() left over from debug :-)
cinap_lenrek [Tue, 26 Aug 2014 23:41:02 +0000 (01:41 +0200)]
ipconfig: remove sleep() left over from debug :-)

9 years agoipconfig: fix readipifc() memory leaks in recvra6 and sendra6 processes
cinap_lenrek [Tue, 26 Aug 2014 23:12:42 +0000 (01:12 +0200)]
ipconfig: fix readipifc() memory leaks in recvra6 and sendra6 processes

to avoid continuously leaking memory in recvra6 and sendra6
processes, pass the previous Ipifc* pointer to readipifc().

9 years agoip: set arp entry for own v6 address when not tentative
cinap_lenrek [Tue, 26 Aug 2014 19:29:37 +0000 (21:29 +0200)]
ip: set arp entry for own v6 address when not tentative

after running ip/ipconfig -6, we are unable to ping our
own link-local address and the arp daemon sends out useless
neighbor solicitation requests to itself. this change
adds an arp entry for our ipv6 address. however, this
must not be done for tentative interface configuration.

9 years agoipconfig: cleanup code duplication in ip6cfg()
cinap_lenrek [Tue, 26 Aug 2014 19:09:57 +0000 (21:09 +0200)]
ipconfig: cleanup code duplication in ip6cfg()

9 years agoping: don't spin when we get error reading icmp connection, print error and sleep
cinap_lenrek [Tue, 26 Aug 2014 19:07:59 +0000 (21:07 +0200)]
ping: don't spin when we get error reading icmp connection, print error and sleep

9 years agopc64: enable ether8139 in kernel config (thanks hiro)
cinap_lenrek [Thu, 21 Aug 2014 22:00:06 +0000 (00:00 +0200)]
pc64: enable ether8139 in kernel config (thanks hiro)

9 years agoether8139: fix pointer truncation by ulong cast, use mallocalign()
cinap_lenrek [Thu, 21 Aug 2014 08:56:15 +0000 (10:56 +0200)]
ether8139: fix pointer truncation by ulong cast, use mallocalign()

9 years agosecstore: improve error messages, newSConn() can't fail
cinap_lenrek [Wed, 20 Aug 2014 23:18:36 +0000 (01:18 +0200)]
secstore: improve error messages, newSConn() can't fail

9 years agoip: fix memory leak in ipicadd6()
cinap_lenrek [Wed, 20 Aug 2014 22:30:13 +0000 (00:30 +0200)]
ip: fix memory leak in ipicadd6()

allocate the Iplifc structure on the stack instead.
i assuming that it was allocated on heap in fear of
causing stack oveflow. on 386, this adds arround
88 bytes on the stack but it doesnt seem to cause
any trouble. (checked with poolcheck after ctl write)

9 years agopc, pc64: fix off by one error in _multibootentry
cinap_lenrek [Mon, 18 Aug 2014 01:16:11 +0000 (03:16 +0200)]
pc, pc64: fix off by one error in _multibootentry

9 years agoboot: dont print errors if ethernet has no ifstats file, can happen with usb ethernet
cinap_lenrek [Sun, 17 Aug 2014 04:08:06 +0000 (06:08 +0200)]
boot: dont print errors if ethernet has no ifstats file, can happen with usb ethernet

9 years ago5a: revert MOVM .S and .W are exclusive (broke bcm build)
cinap_lenrek [Sun, 17 Aug 2014 02:26:28 +0000 (04:26 +0200)]
5a: revert MOVM .S and .W are exclusive (broke bcm build)

9 years agokernel: make noswap flag exclude processes from killbig() if not eve, reset noswap...
cinap_lenrek [Sat, 16 Aug 2014 22:50:20 +0000 (00:50 +0200)]
kernel: make noswap flag exclude processes from killbig() if not eve, reset noswap flag on exec

9 years agoFix acme crash: Get D in a new window with D being an existing directory
iru [Sat, 16 Aug 2014 21:50:42 +0000 (18:50 -0300)]
Fix acme crash: Get D in a new window with D being an existing directory

9 years agokernel: fix todfix() race
cinap_lenrek [Sat, 16 Aug 2014 19:04:41 +0000 (21:04 +0200)]
kernel: fix todfix() race

we have to recheck the condition under tod lock, otherwise
another process can come in and updated tod.last and
tod.off and once we have the lock, we would make time
jump backwards.

9 years agokernel: xinit() use ulong for page counts, cleanup
cinap_lenrek [Sat, 16 Aug 2014 15:26:12 +0000 (17:26 +0200)]
kernel: xinit() use ulong for page counts, cleanup

9 years agonusb/kb: delete code for keyboard boot protocol handling, just use hid parser
cinap_lenrek [Sat, 16 Aug 2014 21:34:28 +0000 (23:34 +0200)]
nusb/kb: delete code for keyboard boot protocol handling, just use hid parser

unify the keyboard and mouse readers into one using the hid
report parser for both. remove the keyboard protocol handling,
as it is now handled by hid parser and all we get is a sequence
of keycodes in Hiddev.k[] which we diff for up/down and translate
to pc scancodes.

9 years agospred: command window improvements
aiju [Thu, 14 Aug 2014 08:42:39 +0000 (10:42 +0200)]
spred: command window improvements

9 years agoimport: make aan (-p flag) work in ``backwards mode'' (-B)
cinap_lenrek [Wed, 13 Aug 2014 22:11:14 +0000 (00:11 +0200)]
import: make aan (-p flag) work in ``backwards mode'' (-B)

in backwards mode, the roles of the aan filters need to be
reversed. add "-n address" option to import to override the
announce address for the aan server part (default tcp!*!0).

9 years agonusb/ptp: do maxpkt reads to avoid babble error with usb 2.0 devices (thanks mischief!)
cinap_lenrek [Tue, 12 Aug 2014 23:10:59 +0000 (01:10 +0200)]
nusb/ptp: do maxpkt reads to avoid babble error with usb 2.0 devices (thanks mischief!)

mischief got babble error with his mobile phone as we used to
read at max 64 bytes for the data response phase. his device
has 512 byte packet size.

thans to mischief for the patience.

9 years agodevenv: prevent non-hostowner from creating or removing variables in '#ec', cleanup
cinap_lenrek [Wed, 13 Aug 2014 21:09:47 +0000 (23:09 +0200)]
devenv: prevent non-hostowner from creating or removing variables in '#ec', cleanup

9 years agoip: fix missed unlocks and waserror handlers
cinap_lenrek [Tue, 12 Aug 2014 19:35:31 +0000 (21:35 +0200)]
ip: fix missed unlocks and waserror handlers

ipifcunbind() could error out from ipifcremlifc() and Medium.unbind()
*after* decrementing ifc->conv->inuse! move the decrement after
calling these functions.

make ipifcremlifc() never raise error but return error string.
the only places where it could error is when it calls into
medium functions like Medium.remroute() and Medium.remmulti().
Ignore these errors as they could happen when the ethernet driver
crashed (think imported ethernet device or usb ethernet
in userspace), so we will be able to unbind.

add waserror() handlers as neccesary to deal with errors from
Medium.addmulti(), Medium.areg() and arpenter() to properly
unlock the data structures.

9 years agoaux/8prefix: fix usage
mischief [Tue, 12 Aug 2014 17:33:47 +0000 (10:33 -0700)]
aux/8prefix: fix usage

9 years agosecstore(1): clarify how the server is dialed and add new $secstore environment variable
mischief [Mon, 11 Aug 2014 03:38:59 +0000 (20:38 -0700)]
secstore(1): clarify how the server is dialed and add new $secstore environment variable

9 years agosecstore: read server from $secstore environment variable
mischief [Mon, 11 Aug 2014 01:05:57 +0000 (18:05 -0700)]
secstore: read server from $secstore environment variable

this allows setting the secstore server with secstore=tcp!example.com!secstore or secstore='$secstore' to read from ndb.

9 years agofortunes: it´s easy but you are complicated
stanley lieber [Sun, 10 Aug 2014 23:04:20 +0000 (19:04 -0400)]
fortunes: it´s easy but you are complicated

9 years agofs(8): correct spelling
stanley lieber [Sun, 10 Aug 2014 23:00:55 +0000 (19:00 -0400)]
fs(8): correct spelling

9 years agocwfs: add optional uid argument to allow command, unify permission override code
cinap_lenrek [Mon, 11 Aug 2014 20:36:59 +0000 (22:36 +0200)]
cwfs: add optional uid argument to allow command, unify permission override code

the allow command now takes an optional uid argument for the user
to be granted temporary god status on the fileserver for maintenance.

this was kenji okomotos idea, so thanks :)

remove wstatallow and writeallow flags. instead, we have global:

int allowed;

that contains the uid of the currently allowed user id or -1
if permission checking is globally disabled for the fileserver.
when zero, normal permission checking takes place.

added int isallowed(File*) function that returns non-zero when the
context is the console, or the allowed user. this is also used internally
by iaccess(), so all the extra code of in the callers of iaccess()
is gone now.

dont conflate allowed user with noauth flag and auto-allow on ream.
the installer already knows about noauth and allow flags so theres no
problem with bootstraping.

9 years ago5a: MOVM.IA.W.S ..., [R15] is exception return and needs to be allowed (thanks aiju)
cinap_lenrek [Sat, 9 Aug 2014 16:23:14 +0000 (18:23 +0200)]
5a: MOVM.IA.W.S ..., [R15] is exception return and needs to be allowed (thanks aiju)

9 years agocwfs: fix 32bit multiplication overflows for allocation sizes (thanks kenji okomoto)
cinap_lenrek [Sat, 9 Aug 2014 15:37:02 +0000 (17:37 +0200)]
cwfs: fix 32bit multiplication overflows for allocation sizes (thanks kenji okomoto)

9 years ago5a: reject MOVM instruction with .S and .W bits both set (aijus idea)
cinap_lenrek [Sat, 9 Aug 2014 20:47:46 +0000 (22:47 +0200)]
5a: reject MOVM instruction with .S and .W bits both set (aijus idea)

9 years agokernel: more nil vs 0 cleanup in chan.c
cinap_lenrek [Fri, 8 Aug 2014 15:02:10 +0000 (17:02 +0200)]
kernel: more nil vs 0 cleanup in chan.c

9 years agokernel: use nil for pointers instead of 0, zero channel umc and dirrock in newchan()
cinap_lenrek [Fri, 8 Aug 2014 14:44:41 +0000 (16:44 +0200)]
kernel: use nil for pointers instead of 0, zero channel umc and dirrock in newchan()

9 years agondb/dns: fix nil dereference crash with convM2DNS() returning reqmsg.qd == nil
cinap_lenrek [Fri, 8 Aug 2014 00:06:03 +0000 (02:06 +0200)]
ndb/dns: fix nil dereference crash with convM2DNS() returning reqmsg.qd == nil

9 years agodevmnt: fix potential race with mntflushfree(), remove mntstats, 0 vs nil cleanup
cinap_lenrek [Fri, 8 Aug 2014 21:28:47 +0000 (23:28 +0200)]
devmnt: fix potential race with mntflushfree(), remove mntstats, 0 vs nil cleanup

when mountmux() completes a request for another process, enforce odering
of the loads and stores to the request prior to writing q->done = 1
so mntflushfree() sees q->done != 0 only when the request has actually
completed. otherwise, the q->done = 1 store could have been reordered
before the load from q->z, reading from already freed request and causing
spurious wakeups.

removing unused mntstats callback.

use nil for pointers instead of 0.

9 years ago8c, 6c: generate enam.c file, just like 5c
cinap_lenrek [Thu, 7 Aug 2014 19:35:52 +0000 (21:35 +0200)]
8c, 6c: generate enam.c file, just like 5c

9 years agopc, pc64: make pc kaddr() check reject -KZERO address (thanks aiju)
cinap_lenrek [Thu, 7 Aug 2014 19:11:11 +0000 (21:11 +0200)]
pc, pc64: make pc kaddr() check reject -KZERO address (thanks aiju)

9 years ago5a, 5l: add LDREX/STREX/CLREX instructions
cinap_lenrek [Thu, 7 Aug 2014 18:22:00 +0000 (20:22 +0200)]
5a, 5l: add LDREX/STREX/CLREX instructions

9 years agopc64: fix wrong Ureg* argument on note handler (thanks _sl!)
cinap_lenrek [Thu, 7 Aug 2014 17:55:25 +0000 (19:55 +0200)]
pc64: fix wrong Ureg* argument on note handler (thanks _sl!)

_sl reported crash:

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

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

note how a in alarmed is a kernel address!

the first Ureg* argument is passed to the note handler in the
RARG (BX) register, which was not loaded when returning to
userspace from syscall() thru forkret(). fix by returning thru
noteret() from syscall().

9 years agosamterm: fix ctrl-b crash when cmd window resized (thanks revex)
cinap_lenrek [Mon, 4 Aug 2014 07:33:23 +0000 (09:33 +0200)]
samterm: fix ctrl-b crash when cmd window resized (thanks revex)

for reference:

On IRC revex reported that samterm crashes on Ctrl-b if the command window has
been resized. I was able to reproduce:

http://plan9.stanleylieber.com/sam/bugs/ctrl-b.png

; acid 831213
/proc/831213/text:amd64 plan 9 executable
/sys/lib/acid/port
/sys/lib/acid/amd64
acid: lstk()
abort()+0x0 /sys/src/libc/9sys/abort.c:6
panic1(s=0x400448)+0x27 /sys/src/cmd/samterm/main.c:692
panic()+0x19 /sys/src/cmd/samterm/main.c:684
lldelete()+0x71 /sys/src/cmd/samterm/flayer.c:221
flupfront(l=0x40eac0)+0x18 /sys/src/cmd/samterm/flayer.c:139
v=0x20062900000001
current(nw=0x40eac0)+0x49 /sys/src/cmd/samterm/main.c:156
type(l=0x40eac0,res=0x15300000001)+0x37c /sys/src/cmd/samterm/main.c:658
t=0x40eaa8
buf=0x419ec0
p=0x41dd48
a=0x0
backspacing=0x200000000
c=0x41dd4800000002
cursor=0x0
a0=0x0
threadmain(argv=0x7ffffeffefa0)+0x21c /sys/src/cmd/samterm/main.c:75
r=0xb0000001b1
got=0xfefefefe00000002
chord=0x0
nwhich=0x43c310
scr=0x200000000
t=0xfefefefefefefefe
w=0x43c310fefefefe
mainlauncher()+0x18 /sys/src/libthread/main.c:59
launcheramd64(arg=0x4194a0,f=0x221673)+0x10 /sys/src/libthread/amd64.c:11
0xfefefefefefefefe ?file?:0
acid:

9 years agoiostats: properly distribute exit status and give usefull error messages
cinap_lenrek [Sun, 3 Aug 2014 15:09:28 +0000 (17:09 +0200)]
iostats: properly distribute exit status and give usefull error messages

9 years agoiostats: remove unused fcallfmt, dont leak our mount pipe end into exportfs proc
cinap_lenrek [Sun, 3 Aug 2014 14:28:07 +0000 (16:28 +0200)]
iostats: remove unused fcallfmt, dont leak our mount pipe end into exportfs proc

9 years agoiostats: bring back standard filedescriptor spying
cinap_lenrek [Sun, 3 Aug 2014 14:02:47 +0000 (16:02 +0200)]
iostats: bring back standard filedescriptor spying

9 years agoexportfs: simplify freefile() code
cinap_lenrek [Sat, 2 Aug 2014 17:22:10 +0000 (19:22 +0200)]
exportfs: simplify freefile() code

remove impossible checks, rewrite as while loop.

9 years agoexportfs: remove getsbuf() nil check, can't happen
cinap_lenrek [Sat, 2 Aug 2014 17:04:33 +0000 (19:04 +0200)]
exportfs: remove getsbuf() nil check, can't happen

9 years agoiostats: isolate fs from interrupt notes
cinap_lenrek [Sat, 2 Aug 2014 16:45:19 +0000 (18:45 +0200)]
iostats: isolate fs from interrupt notes

interrupt notes go to the child process, not the filesystem
and filter process.

9 years agoiostats: cannot spy on fd 0,1,2 as /fd is per process
cinap_lenrek [Sat, 2 Aug 2014 13:47:24 +0000 (15:47 +0200)]
iostats: cannot spy on fd 0,1,2 as /fd is per process

9 years agoexportfs: cleanup
cinap_lenrek [Sat, 2 Aug 2014 13:07:29 +0000 (15:07 +0200)]
exportfs: cleanup

9 years agoftpfs: dont convert names to latin when string is valid utf-8
cinap_lenrek [Sat, 2 Aug 2014 12:37:16 +0000 (14:37 +0200)]
ftpfs: dont convert names to latin when string is valid utf-8

9 years agopython: disable symlink and readlink compile options, ape has no reasonable way emula...
cinap_lenrek [Sat, 2 Aug 2014 12:28:19 +0000 (14:28 +0200)]
python: disable symlink and readlink compile options, ape has no reasonable way emulating it

9 years agoiostats: dont prefix /bin to argv[0] when already absolute or relative path
cinap_lenrek [Sat, 2 Aug 2014 01:06:09 +0000 (03:06 +0200)]
iostats: dont prefix /bin to argv[0] when already absolute or relative path

9 years agoiostats: cleanup, remove bogus Maxrpc constant
cinap_lenrek [Sat, 2 Aug 2014 00:41:57 +0000 (02:41 +0200)]
iostats: cleanup, remove bogus Maxrpc constant