Commit graph

10034 commits

Author SHA1 Message Date
Jacob Moody
6ebfbaa826 isalpharune(2): invalid Runes are just > Runemax 2024-10-05 00:43:38 +00:00
Jacob Moody
698ecf25e5 libc/runeistype: out of range is only > Runemax, Rune is a uint 2024-10-05 00:36:48 +00:00
Ori Bernstein
394e9c2235 libc/runeistype: accept out of range runes
out of range runes should just return 0 for whether
they're within any of the classes.
2024-10-05 00:06:50 +00:00
cinap_lenrek
4d484968bf kernel: avoid recursive lockloop() prints from screenputs() (thanks noam)
We cannot use lock() from screenputs() because lock calls
lockloop(), which would try to print() which on very slow
output (such as qemu) can cause kernel stack overflow.

It got triggered by noam with his rube-goldberg qemu setup:

lock 0xffffffff8058bbe0 loop key 0xdeaddead pc 0xffffffff80111114 held by pc 0xffffffff80111114 proc 339
 panic: kenter: -40 stack bytes left, up 0xffffffff80bdfd00 ureg 0xffffffff80bddcd8 at pc 0xffffffff80231597
 dumpstack
 ktrace /kernel/path 0xffffffff80117679 0xffffffff80bddae0 <<EOF

We might want move this locking logic outside of screenputs()
in the future. It is very similar to what iprint() does.
2024-10-03 20:25:58 +00:00
Ori Bernstein
d8973bdc75 git/export: don't try to diff dirs 2024-10-03 15:36:43 +00:00
Ori Bernstein
8e301036fa merge3: remove unnecessary variables 2024-10-02 21:45:17 +00:00
Ori Bernstein
1cf37db07a merge3: fix funny merge cases and crashes 2024-10-02 21:43:20 +00:00
Ori Bernstein
9fa2b25133 merge3: clamp aligned lines to be within the file. 2024-10-01 18:13:55 +00:00
Noam Preil
0c4e4cb9e9 git/diff: fix -c flag 2024-10-01 12:08:29 +00:00
Noam Preil
91b19a1983 aux/cddb: fix artist line splitting 2024-09-29 15:08:34 +00:00
Noam Preil
be48d656d3 mkmany: check more carefully for test folder 2024-09-17 07:45:01 +00:00
Noam Preil
8624a54632 aux/cddb: support very long artist+album name combos 2024-09-24 06:47:26 +00:00
Noam Preil
dcff4acbb6 git/commit: preserve merge-parents on failed commit 2024-09-22 20:24:16 +00:00
Jacob Moody
f3f659b54b look: fix case sensitivity when using base > 10
Old attempt at this did not make any sense.
Also fix the reference to look in ascii(1) to be more correct.
2024-09-29 18:35:30 +00:00
cinap_lenrek
dc318a6471 git/test: add noam.rc testcase 2024-09-29 17:29:48 +00:00
cinap_lenrek
798352644e git/save: and try again... 2024-09-29 17:28:48 +00:00
cinap_lenrek
0e7690a4f8 git/save: pffff. revert last change... 2024-09-29 16:47:47 +00:00
cinap_lenrek
de7d3753a5 git/save: fix the "noam" bug
git/save gets a list of paths (added or removed)
passed to it, and we have to ALWAYS stat the
file in the working directory to determine the
effective file-type.

There was a bug in the "skip children paths"
loop that would compare the next path element
instead of the full path prefix including
the next element.

reproducer:

	git/init
	touch a
	git/add a
	git/commit -m 'add a' a
	rm a
	mkdir a
	touch a/b
	git/add a/b
	git/commit -m 'switch to folder' a a/b
2024-09-29 16:30:39 +00:00
cinap_lenrek
1c682a98fe ip/ipconfig: make ra limiter less agressive (thanks cgnarne)
For handling route invalidations, we have to allow
short bursts of traffic. Therefore we keep track
of the number of ra's received in the ra interal
and only start dropping packets when reaching 100
packets.
2024-09-29 11:41:50 +00:00
cinap_lenrek
d0f4f620cf walk: qid.vers should be ignored (thanks BurnZeZ)
No idea who committed this in 2022 as its "glenda@9front.local",
but as qid.vers is incremented for each write and we definitely
should not use it as the cache tag.

Also, the initial code was stolen from du.c as the comment says,
and that one does the right thing.
2024-09-23 18:31:46 +00:00
Ori Bernstein
4374194306 git/branch: make it more robust
don't move to new branches or update the index until after
all changes are applied successfully, and the merge attempt
has been made.
2024-09-22 17:06:14 +00:00
cinap_lenrek
772f3099ef git/test: run tests with a temporary install bound to /bin/git
We want to run test before we do the installation
into the system.

So do a temporary install into test/$cputype.git/
direcotry and bind it on /bin/git, that way,
all the scripts run the local source version.
2024-09-16 22:55:40 +00:00
Ori Bernstein
e2fa84d6cd git/serve: we don't do thin packs -- advertise it. 2024-09-16 22:51:25 +00:00
Ori Bernstein
0636bfc774 git/query: process full contents of queue, even with skips
When skipping objects, we need to process the full queue,
because some of the objects in the queue may have already
been painted with keep. This can cost a small amount of time,
but should not need to advance the frontier by more than
one object, so the additional time should be proportional
to the spread of the graph.
2024-09-16 22:48:02 +00:00
Ori Bernstein
d9edee8b1a merge3: correctly handle 1-based closed intervals
the previous bug wasn't a missing clamp, but a
mishandling of the 1-based closed intervals that
we were genrating internally, and some asserts
that assumed open intervals.
2024-09-15 02:22:27 +00:00
cinap_lenrek
1a53aacc60 git/test: improve ftype test (also test dir -> file transition)
The ftype.rc test now tests both: file->dir and dir->file changes.
2024-09-14 19:21:17 +00:00
Ori Bernstein
d03b67430f merge3: fix assert in merge of identical deletions 2024-09-14 15:57:24 +00:00
Ori Bernstein
f63dcb4b9b git/branch: handle dirents changing between file and dir correctly (thanks cinap) 2024-09-13 16:28:32 +00:00
rodri
9482f887f9 jpg/tga: decode TGA32 images into RGBA32 ones 2024-09-12 19:09:40 +00:00
cinap_lenrek
ce97bb4998 merge 2024-09-09 16:54:41 +00:00
aap
79eb47ef8e acme, abaco: render scrollbar like rio 2024-09-09 13:03:15 +00:00
Ori Bernstein
36e5075ded gefs: protect fids with rwlock 2024-09-07 19:00:06 +00:00
qwx
084c9d6eba g: add .in, fix earlier fuckup (thanks mkf)
2d63bdbb44 was pushed modified
compared to the patch actually submitted by mkf, in error.
2024-09-04 19:57:16 +00:00
cinap_lenrek
87cbf8e792 sshnet(4): fix title (thanks arne) 2024-08-31 18:50:25 +00:00
Jacob Moody
9d2f21b2cf ndb/dns: refuse recursive requests harder when given -R (thanks be0ba)
Before we would refuse to recurse, but would still give
a response with hints back. Some nefarious clients will interpret the
lack of a Refused response code as us being an open resolver.
2024-08-31 02:23:05 +00:00
cinap_lenrek
761452154a gefs: clunk dent and mnt when dropping rclose message
When clunking a Fid while the file-system is read
only, dont just free the Amsg, but also drop the
references to dent and mnt.

Make clunkfid() nil fid->rclose, so no reuse
after free is possible.

Make clunkfid() always set the return pointer,
avoid missing prior initialization.
2024-08-30 19:54:26 +00:00
cinap_lenrek
d31382ca17 gefs: fix fidtab locking order in clunkfid()
Do not abuse fidtab lock for serializing
clunking.

The clunk should serialize on Fid.Lock
instead, so add a canlock check here.

The lock order is strictly:

Fid.Lock > Conn.fidtab[x].Lock
2024-08-30 19:16:13 +00:00
cinap_lenrek
0ab0a036ed gefs: fix use after free in putconn() 2024-08-30 18:54:43 +00:00
cinap_lenrek
15341e1116 gefs: fix Fid refcounting bugs
The AuthRpc was attached to the Fid, but this doesnt
work as it does not handle dupfid() properly.

Instead attach the AuthRpc to the directory entry,
which is refcounted.

The dupfid() function retuns the new Fid* struct with
an extra reference. If we don't use it, we have to
putfid() it.

Use ainc()/adec() consistently and dont mix it with
agetl().
2024-08-30 18:46:50 +00:00
cinap_lenrek
d8cf26110d gefs: properly close and free connections
Before, we would just leak all the "Conn"
structures.

fshangup() could cause problems as it just
forcefully closes the file descriptors,
not considering someone else going to
write them afterwards.

Instead, we add a "hangup" flag to Conn,
which readers and writers check before
attempting i/o.

And we only close the file-descriptors
when the last reader/writer drops the
connection. (Make it ref-counted).

For faster teardown, also preserve the
"ctl" file descriptor from listen()
amd use it to kill the connection quickly
when fshangup() is called.
2024-08-28 18:34:14 +00:00
cinap_lenrek
b061a21bfa kbdfs: consult also escaped scancode table when decoding runes (thanks aap)
When at the task of decomposing a rune into its
"button" and "rune", also consider the keyboard
map table with the escaped scancodes.

This fixes Shift + left/right combinations in
drawterm.
2024-08-28 18:30:28 +00:00
cinap_lenrek
09d69e04b9 libc: cleanup hangup() function (avoid duplicated literal string) 2024-08-25 19:49:09 +00:00
cinap_lenrek
f384231c60 gefs: only allow 'none' attach when previously authenticated
For each connection, remember if authentication
protocol ran successfully and only then, allow
attach as 'none' user.

This prevents anonymous remote mounts of none.

The 'none' user also shouldnt attach to the dump
file system.
2024-08-25 14:47:17 +00:00
cinap_lenrek
9645ae07eb hjfs: implement "none" attaches properly
The Tauth for "none" should always fail,
but Tattach should only succeed when
the channel ran a successfull authentication
before.

Also, prevent "none" from attaching "dump".
2024-08-24 23:47:19 +00:00
cinap_lenrek
a97ee572b9 lib9p: add "authok" flag to Srv struct
We want to implement "none" attaches for hjfs,
but only if the 9p-"channel" ran a successfull
authentication before, to prevent anonymous
remote mounts as "none".

Add a flag to the Srv struct for this.
2024-08-24 23:45:51 +00:00
Jacob Moody
07aa9bfeef lib9p: verify uname against returned AuthInfo from factotum (thanks humm)
Before this it was possible to Tauth and Tattach with one
user name and then authenticate with factotum using a different
user name. To fix this we now ensure that the uname matches the returned
cuid from AuthInfo.

This security bug is still pending a cute mascot and theme song.
2024-08-24 16:58:31 +00:00
rodri
b05c74e7cb geometry(2): correct typo (thanks ndeuteron!) 2024-08-23 10:14:50 +00:00
Ori Bernstein
3d497649e7 gefs: use correct snap name with autosnaps
*shame*
2024-08-20 04:27:40 +00:00
rodri
7059938e94 libgeometry: add lineXsphere function 2024-08-19 21:30:14 +00:00
Ori Bernstein
a584d29458 tmdate(2): fix formatting for sub-second specifiers 2024-08-10 10:04:22 +00:00
qwx
6dc60ec3a9 qcowfs: add 9p debug flag 2024-08-05 22:23:51 +00:00
Ori Bernstein
f0ef1a4be0 git/fs: don't allow walking blobs 2024-08-05 07:12:37 +00:00
Sigrid Solveig Haflínudóttir
4c6701041e vt: skip over vertical line marks (Contour terminal) 2024-08-05 01:35:19 +00:00
sl
91916b6896 /sys/games/lib/fortunes: redaction day 2024-08-02 03:06:08 +00:00
aap
d6d02abde5 libframe: always draw tick with current TEXT color. 2024-08-01 14:51:00 +00:00
Jacob Moody
9c0f4aa0e5 9p(2): typos
The changes from british to american spelling here follows
what spell(1) thinks, and seems to be more common based on
other manual pages.
2024-08-01 14:33:32 +00:00
qwx
f00a88b509 /sys/lib/dist/ndb/common: add hjgit port, remove unused 2024-08-01 14:31:59 +00:00
Ori Bernstein
462464ff4a ape/patch: also kill ape/patch 2024-07-30 17:36:02 +00:00
Ori Bernstein
76fe6e9693 ape/diff: one more ancient, unmaintained, buggy gnu utility gone 2024-07-30 17:13:21 +00:00
Ori Bernstein
2a47e4f086 hgfs: use merge3 2024-07-30 17:12:03 +00:00
Ori Bernstein
2dc68de342 git: use native merge3 program instead of ape/diff3 2024-07-30 01:55:29 +00:00
Ori Bernstein
0136b08a10 merge3: fix exit conditions -- l, r are never nil 2024-07-30 00:42:51 +00:00
Ori Bernstein
c409b9127d gefs: correct in-memory directory length for DMAPPEND files (thanks cinap)
when appending to a directory, the copy of the offset in the dent was
set to the offset that the write was supposed to happen at -- however,
for DMAPPEND files the offset is always at the end of the file. Until
the file was closed, stat would show the wrong directory info.
2024-07-29 00:37:33 +00:00
Jacob Moody
821e6690d3 2l(1): add 7l and 9l 2024-07-28 20:41:59 +00:00
Jacob Moody
f9212297bd 2c(1): add 9c 2024-07-28 20:17:16 +00:00
cinap_lenrek
67b0aeb219 ipmux: implement hangup ctl
Implement a hangup ctl command that flushes the
queues, but keeps the filter around.

This can be usefull for low-overhead traffic blocking,
as only the file-descriptor needs to be kept around
and the queues can be flushed.

No user-space process is needed to consume packets
and no buffers are wasted.

example:

aux/dial -e -o hangup 'ipmux!ver=4;src=8.8.8.8' rc -c 'echo 0 > /srv/blocked'

rm /srv/blocked
2024-07-28 19:40:54 +00:00
Ori Bernstein
460b007c35 gefs: we need an agetv for the qgen on 32 bit systems 2024-07-28 16:26:33 +00:00
cinap_lenrek
75ac2674de devip: do not raise error from ipoput*()
It seems some protocols are unprepared to
deal with ipoput*() raising an error
(thrown from ifc->m->bwrite()).

so catch it and return -1 (no route) instead.
2024-07-28 00:32:14 +00:00
cinap_lenrek
520d698c3e devip: same for loopbackmedium... 2024-07-27 22:22:55 +00:00
cinap_lenrek
c91d99c5de devip: dont shoot the messenger (dont unbind the interface when ipipu4/ipiput6 errors)
The medium should only self-unbind when we get a read error
from the device, not when ipiput4/8() throw an error,
which can happen for the nullmedium.
2024-07-27 22:03:48 +00:00
Ori Bernstein
439a525113 git: rewrite entcmp to be single pass, less stupid
move to single pass strcmp variant that knows about trailing '/' rule.
2024-07-27 15:36:23 +00:00
Jacob Moody
605bed312a devip: fix masks in ipmux filters
We were accidentally searching the key for '&', instead of the value.
Inferno received this exact fix at some point, but it never made it back to Plan 9.
2024-07-26 22:03:34 +00:00
Ori Bernstein
5ae675bebd libmp: sidestep git bug for now
the installed version of git has a bug; removing
this file will trigger some spurious removals of
test files, so hold off deleting it until people
have time to install a fixed git
2024-07-26 03:01:56 +00:00
Ori Bernstein
5eb5831b05 git/query: use git entry sorting when computing dir diff
directories need to sort as though they end with a '/',
when running through them for comparison, otherwise we
flag files as added and removed spuriously, leading to
them incorrectly getting deleted when merging commits.
2024-07-26 02:44:21 +00:00
Ori Bernstein
c220d0acc6 libmp: remove stale test file
we moved it to test/, so no need for the
old one.
2024-07-25 00:10:51 +00:00
cinap_lenrek
42940399b8 kernel: use flag and integer to handle affinity
Instead of Proc { Mach *mp; Mach *wired; },
track affinity by an integer representing
the mach number instead.

This simplifies the code as it avoids needing
to compare with MACHP(m->machno).

Wiering a process to a processor is now done
by just assigning affinity and then set a flag
that it should not change.

Call procpriority() when we want to change
priority of a process instead of managing
the fields directly.
2024-07-24 19:55:42 +00:00
Ori Bernstein
487c2dc215 git: provide symref extension 2024-07-23 23:42:59 +00:00
cinap_lenrek
703bcae2ed kernel: only reset processor affinity p->mp when p->wired == nil 2024-07-23 22:29:13 +00:00
cinap_lenrek
cbbce6b301 ip/ipconfig: fix logic bug (thanks cgnarne)
We must not skip conf.preflt == 0 (only conf.validlt == 0)
so that we can change the kernels preflt timeout.
2024-07-23 21:35:51 +00:00
cinap_lenrek
2076c934d0 kernel: make schedinit() _Noreturn void 2024-07-23 21:23:26 +00:00
cinap_lenrek
8a6c61c8ef kernel: remove global balancetime variable -> make function static 2024-07-23 21:03:08 +00:00
cinap_lenrek
4a7c44fee4 kernel: improve nlocks print in sleep() 2024-07-23 21:00:04 +00:00
cinap_lenrek
f1e7d6da67 kernel: sched() should not imply spllo()
The idea is:

When we call sched() with interrupts disabled,
it must not return with them re-enabled.

The code becomes easier to reason about if
we make sched() preserve interrupt status,
which lets us call sched() from an interrupt
handler (with interrupts disabled) without
risking preemption by another interrupt once
sched() returns which can pump-up the stack.

This allows removing Proc.preempted flag as
it is now impossible for interrupts to
preempt each other in preempted().

Extra cleanups:

make interrupted() _Noreturn void
and remove unused Proc.yield flag.
2024-07-23 19:50:36 +00:00
cinap_lenrek
fc859af624 etherimx: fix missing barrier for doorbell (thanks sigrid)
the symptom is that ping is apparently skipping
transmits which recover with the next send,
resulting in exactly send-period spikes in
the ping rtt.

It appears that the core seems to reorder writes
to uncached memory, which can result in the doorbell
being written before the descriptor status bits
are written.

put a coherence() barrier before writing doorbell
fixes it.

thanks sigrid for reporting the issue!
2024-07-21 17:35:18 +00:00
cinap_lenrek
3598b7cf36 kernel: hack processor affinity to allow load sharing
On a multiprocessor, the scheduler can run into
a very unfair distribution of processes to cpus
when there are more long-running processes than cpus.

Say we have a 4 cpu machine and we run 4 long-running
proesses, each cpu will pick up a single process
and each process will get 100% of its fair share.

Everything is good so far.

If we start more long-running processes, all these
processes are going to be picked up by the cpu core
that runs most sporanic / bursty work loads as it
is calling sched() more often.

This results in all the extra long-running prcoesses
to cluster around the same core resulting in very
unfair sharing of load.

The problem is that once a process runs on a cpu,
it stays on that cpu as processor affinity
is never reset.

Process migration only happens when a cpu cannot
find any process to run, given the affinity
constrains, but this can never happen when
the system is under full load and each cpu
always has a low-priority long running
process to run.

How do we fix this?

The idea of this hack is to reset processor
affinity in ready() when its priority changes or,
when it appears to be a long-running process.

That way, we give every cpu a chance to pick
it up and share the load.

This is not a ideal solution of course. Long term,
we should probably have separate runqueues per cpu
and do the balancing explicitely.
2024-07-21 13:44:18 +00:00
cinap_lenrek
11cd33bcec kernel: make fixedpri work.
Fix and document the "fixedpri" control.
2024-07-21 13:00:48 +00:00
cinap_lenrek
706b44c15d kernel: fix wrong updatecpu() context regression
In the sched() function, the call to reprioritize()
must be done before we set up, as reprioritize()
calls updatecpu(), which determines if the process
was running or not based on p == up. So move
the call to runproc() itself.
2024-07-21 12:44:23 +00:00
Ori Bernstein
b0d33c09ff gefs: more/stricter asserts and checks 2024-07-19 20:37:11 +00:00
Ori Bernstein
108f94b25a gefs: set super dir in Qadm correctly
gefs: ream uplink for root dir in adm correctly
2024-07-19 20:13:46 +00:00
Ori Bernstein
6a049aafed history: add support for gefs dumps 2024-07-18 16:49:31 +00:00
Ori Bernstein
1ca26f9924 gefs: work around 8c bug
8c doesn't like assigning struct literals with vlongs
into array indexes, so work around it for now.
2024-07-18 16:25:46 +00:00
Ori Bernstein
0956f48633 git/commit: filter to changed files for git/save
while rehashing the same files over and over will work
just fine, it can be slow with a large number of large
files; this makes 'git/comit .' perform much better in
repos with a large number of large binary blobs.
2024-07-18 13:13:42 +00:00
Ori Bernstein
338e78a024 gefs: dump dirs are dirs too
even if they're down in the dumps
2024-07-17 21:48:15 +00:00
Ori Bernstein
48edf79c69 gefs: modifying a directory should update qid.vers 2024-07-17 15:07:11 +00:00
Ori Bernstein
201fe8de4b gefs: change log compression heuristic
compress when the log doubles in size, rather than
using a fixed size heuristic; this means that we
don't start compressing frequently as the log gets
big and the file system gets fragmented.
2024-07-08 03:29:40 +00:00
Ori Bernstein
a19d90dc8c gefs: fix allocation log compression
We could overwrite the log tail when compressing the
allocation log; this would be bad. Stop doing that.
2024-07-08 03:23:40 +00:00
rodri
1442891a3e samterm: avoid division-by-zero when $tabstop is zero or empty
this happens in libframe:

	/sys/src/libframe/frutil.c:80: 	x -= (x-f->r.min.x)%f->maxtab;

but there's no way to control when the user changes the
maxtab value, so it's samterm's responsibility to
sanitize it.
2024-07-16 11:29:49 +00:00
Ori Bernstein
51c899ca01 bio(2): fix formatting 2024-07-14 19:49:00 +00:00
Ori Bernstein
ee51c91f6f gefs: copy mode down on create, don't truncate walks with no DMEXEC
we were copying the owner and group of the parent dir into the fid
on create, but we forgot the mode; fix that, so that we don't check
perms against the wrong dir.
2024-07-13 15:55:37 +00:00
mkf
23e7a57172 rx: add ssh 2024-07-04 20:26:20 +00:00
sl
79822e96dc /sys/src/9/pc/audiohda.c: add vid/did for Intel Tiger Lake 2024-07-07 21:42:30 +00:00
Ori Bernstein
f628dc850d gefs: temporarily disable log compression
There are some bugs with fixes in progress, but
let's not take any risks while those fixes are
in flight.
2024-07-02 02:55:55 +00:00
Ori Bernstein
ed73544be6 gefs: remove useless cachedel
copy paste error
2024-06-27 05:17:05 +00:00
Ori Bernstein
2350b08401 gefs: remove trace noise
this pushes useful entries out of the ring.
2024-06-23 15:33:09 +00:00
qwx
a71a76745b etheriwl: add support for 3168 2024-06-25 19:08:54 +00:00
Sigrid Solveig Haflínudóttir
9b5d186746 it kbmap: more mapping fixes (thank shura)
The Italian keyboard layout is ISO, and unlike the ANSI layout,
it has an extra key between Shift and Z, and the key above Enter,
which becomes vertical, is moved to the bottom left of it.

 - the key between Shift and Z is mapped to `<`, and shift+`<` is mapped to `>`
 - the old `>` (at the bottom left of Enter) is mapped to `ù`
 - shift+`ù` is mapped to `§`
 - the old shift+`"` is mapped to `°`
 - altgr+`'` is mapped to backtick
 - altgr+`ì` is mapped to `~`
 - altgr+`e` is mapped to `€`
 - shiftaltgr+`[` is mapped to `{`
 - shiftaltgr+`]` is mapped to `}`
2024-06-25 15:52:36 +00:00
Emery Hemingway
2760eef549 kbmap: add Workman layout 2024-01-22 11:13:14 +00:00
Sigrid Solveig Haflínudóttir
c05ee321f8 it kbmap: fix > and < (thanks NeuraL) 2024-06-25 13:23:06 +00:00
mia soweli
f43c301827 9/pc: Remove unused lm78 driver
This seems to have been around but not compiled since the third edition.
Remove it and the accompanying SMBus machinery that is only used
for this driver.
2024-06-24 20:22:31 +00:00
Ori Bernstein
6b5d2ac468 gefs: weaken overzealous assert
When modifying a sparse file, it's possible to get
clobbers and clears to item s that don't exist; in
this case, we try to apply to an empty kvp, and
assert -- we should just not apply.
2024-06-23 14:26:44 +00:00
Ori Bernstein
107a7ba971 git: allow longer authors in commits
there are git repos where the author line is longer than
128 chars; bump our limit up.
2024-06-19 17:42:52 +00:00
Sigrid Solveig Haflínudóttir
c9a153088d sam(1): ^ does not take any range 2024-06-17 22:03:20 +00:00
cinap_lenrek
68b4a8e6ef cc: logical operations (& | ^) operate on integers only (thanks sigrid)
void
main(void)
{
	uchar a[3];
	float f = a[2] | a[1] | (a[0]/1.2);
	USED(f);
}

the code above used to generate impossible
code in the linker like:

main: doasm: notfound from=34 to=35 (872)	ORL	X0,X1
main: doasm: notfound from=34 to=35 (872)	ORL	X0,X1
main: doasm: notfound from=34 to=35 (872)	ORL	X0,X1

with the change, the compiler correctly rejects it:

incompatible types: "UINT" and "DOUBLE" for op "OR"

i assume the BNUMBER in the type matrix must have been
a oversight.
2024-06-17 20:31:01 +00:00
Sigrid Solveig Haflínudóttir
12ad6dffeb sam: make X/.../b work 2024-06-16 15:58:07 +00:00
mia soweli
3d6deb3f69 9/port: make sure MSI-X is off before enabling and disabling MSI 2024-06-16 14:22:58 +00:00
cinap_lenrek
82f44b3ffc ip/ipconfig: properly handle ipv6 address deprecations
do not add default route when address is
deprecated (preflt == 0).

delete previous default route on router change.

implement rfc4862 section 5.5.3 processing rules
in regard to remaining valid lifetime.
2024-06-15 17:20:45 +00:00
Romano
0dc37f9794 dhcpd(8): typos 2024-06-10 04:42:52 +00:00
Ori Bernstein
16369de87d gefs: correctly set duid/dgid on Tcreate
we were updating the dir that the fid pointed
to, but not updating the parent uid/gid.
2024-06-09 14:40:40 +00:00
cinap_lenrek
f3ee064802 ip/ipconfig: ask devip to delete expired ipv6 prefixes (thanks arne)
In addition to removing expired default routes,
ask devip to clean out expired addresses as well.

In the future, devip might do something more
sophisticated than just checking the valid life time
like also considering if the address is still begin
used by active connections.
2024-06-09 13:02:06 +00:00
Ori Bernstein
c91e9322f1 gefs: only start epochs for console procs that need them
we shouldn't need to defer reclamation for procs that
don't actually interact with the tree directly, especially
since if they send on a channel they can stall for a while.
2024-06-08 16:21:16 +00:00
Ori Bernstein
5e6f3db0d7 gefs: fix deadlock between epochclean and truncwait
epochclean should not hold the mutation lock, which
should allow procs within an epoch to make progress
and end their epoch.
2024-06-08 16:02:11 +00:00
Arne Meyer
0db5d2bdd6 nusb/ether: fix typo in previous commit 2024-06-07 21:30:15 +00:00
Arne Meyer
43166ed050 nusb/ether: Don't pass ethernet fcs to the network stack for smsc and lan78xx 2024-06-05 09:22:31 +00:00
Ori Bernstein
f9b061c9bd gefs: bring back write cancellation for free blocks. 2024-06-07 14:50:05 +00:00
Ori Bernstein
f91852c653 gefs: improve flow of blocks/frees
This change covers three improvements:
- inline the limbo entry into the objects
  being freed, meaning we don't need to
  allocate, and thus can't fail to free
  an object when we're out of memory
- Preallocate Bfree objects, for the same
  reason above.
2024-06-07 14:41:15 +00:00
qwx
dd4b1abbe6 gs: ignore more autogenerated headers
the build process could be cleaned up a lot more.  the default.*.h headers are
basically only used in cross-compilation, but every usable arch has its default
header already, so all the mkfile effectively does is copy it to $objtype.h.  it
would perhaps make more sense to just run mk on any new arch and copy to a new
default.$objtype.h and get rid of a lot of this stuff.  but then it's not really
worth messing with this further, so leaving it as is.
2024-06-06 23:05:42 +00:00
qwx
aad45634c8 gs: don't track autogenerated header (thanks James) 2024-06-06 10:35:37 +00:00
Ori Bernstein
8c046fe451 gefs: revert cacheflag()
it seems likely that it was causing writeback
bugs, revert until further testing, and likely
move to a different approach.
2024-06-04 17:49:49 +00:00
Sigrid Solveig Haflínudóttir
005bd2b7e1 sam: M: don't require a current file to operate (thanks umbraticus) 2024-06-04 14:27:41 +00:00
Ori Bernstein
8759403bdb gefs: fix file truncation performance (thanks cinap)
We were inserting very oversized deletion messages when
removing a file, instead of inserting the right size
message. This also batches the insertions, reducing the
number of upserts.
2024-06-02 19:52:12 +00:00
Ori Bernstein
5c0670bfae gefs: remove vestigial bucket lock
it was doing nothing
2024-06-02 18:53:43 +00:00
umbraticus
828c577e03 sam: introduce a new command M for adding commands to mouse b2 menu 2024-06-01 22:55:26 +00:00
Jacob Moody
4e4bd869e9 9[cl]: correct previous changes
37e65b331b
Was to adjust the compiler to better match the ISA w.r.t.
subtraction, but was overzelous and rewrote all additions instead of
just those with constants.

5390130426
Intended to restrict compiler generated immediate operations to only
those of which can be encodable by the ISA.  However the check for
signed constants was incorrect and resulted in constants that do not
properly encode.

0c6fd079ce
Attempted to classify address literals to save on instruction
encoding, but this is actually not possible.  We have to walk the
program first to derive some of the constants (INITDAT depends on
etext) so we can not classify them here.  Instead we should just limit
address literals to 32 bits (with sign extension) as a worst case.  It
would be possible in the future to do a pass over to program later and
find address literals that only need one instruction instead of two
but this works for now.
2024-06-01 17:53:20 +00:00
cinap_lenrek
01e7d784df sdaoe: remove unfinished atapi code (thanks arne) 2024-06-01 16:14:25 +00:00
cinap_lenrek
40cb72e7f8 2c: fix indirect calls
The peeophole optimizer was removing MOVL R0, A0
instructions before BSR (A0) because copyu()
decided all registers are being written (because
function calls clobber the registers).

For indirect calls, the register operand must
be correctly reported as being used (and then
clobbered).
2024-05-31 21:04:41 +00:00
cinap_lenrek
865a0f43f1 hjfs: check mount spec (aname) in Tauth
Filesystems should ensure that the mount
spec (aname) is valid before handing out
an auth fid.

This avoids pointless authenticaiton
protocols being run just for the
mount later to fail.

This happens with our current /lib/namespace
file for the opportunistic line:

mount /srv/boot /n/other other
2024-05-31 20:50:41 +00:00
rodri
9bbbc13ce2 libgeometry: simplify rframes
i got rid of redundant code, and added routines
to get the xform matrix out of an rframe, so it
can be stored and used separately or as part of
a composition of xforms.

also replaced the big example in the man page for
more concise, useful ones.
2024-05-30 21:11:33 +00:00
Alex Musolino
33572bd895 sshnet: update usage text to match man page 2024-05-30 12:46:36 +00:00
Alex Musolino
31b7b7a75b sshnet(4): merge usage lines 2024-05-30 12:46:01 +00:00
Ori Bernstein
eddf77b8f9 gefs: revert the last commit; we added a deadlock 2024-05-29 23:53:41 +00:00
Ori Bernstein
dd82b07a86 gefs: correctly serialize updates to mounts
we don't need a lock free list, we just need an
rwlock; this isn't a high contention data structure.
2024-05-29 19:34:14 +00:00
Ori Bernstein
79323e05d1 gefs: make dent cache per-mount
with a global dent cache, directory entries from different
trees can be cached. This almost works, but QID state can
change as the files get modified -- ownership, permissions,
and similar can get changed.

A global mount cache means that changes to a qid may leak
across mount boundaries. Don't do that.
2024-05-29 17:12:21 +00:00
Ori Bernstein
04d0d77e4b gefs: improve 'print fid' on cons 2024-05-28 14:45:01 +00:00
cinap_lenrek
68a98ec9d1 devip: don't send and ignore MLD messages for invalid multicast groups
RFC2710 states that MLD messages should never
be sent for scope 0 and 1 mcast addresses
as well as FF02::1.
2024-05-28 18:16:44 +00:00
cinap_lenrek
dc85e6d01a ipconfig(8): fix /net/null vs /dev/null (thanks humm) 2024-05-28 17:25:52 +00:00
Ori Bernstein
857d06b644 gefs: skip writeback on data blocks
when writing back data blocks, we didn't
read the data back from disk, and instead
just enqueued the block pointer; This means
that we don't have the Blk struct to set
the freed flag on, so we would commit every
IO operation to a data block.

This change opportunistically reaches into
the cache and flags the data block as dead,
so we can skip writeback.
2024-05-28 01:57:52 +00:00
Ori Bernstein
89017223e1 gefs: allow halting read-only file system
we would bail out of any adm op when we were in
read-only mode; we should really complain and
skip when we're not shutting it down.
2024-05-28 01:56:26 +00:00
sl
421057ca68 /sys/man/8/plan9.ini: document the existence of git.9front.org/plan9front/firmware (thanks, orib) 2024-05-27 23:59:22 +00:00
Ori Bernstein
1a1b1c4b6a git/clone: allow cloning into an empty directory 2024-05-27 15:02:28 +00:00
Ori Bernstein
45b5336f88 gefs: add command to show free ranges on console 2024-05-27 04:17:29 +00:00
Ori Bernstein
33b0e1bb81 users(6): it's not just older servers 2024-05-27 01:35:22 +00:00
Ori Bernstein
12bf41489c gefs(8): docment user creation commands 2024-05-26 23:39:07 +00:00
Ori Bernstein
469573c3fe gefs: avoid holding the wrlock when syncing the file system
we only need to enforce ordering or syncedness to disk when
writing out the blocks during sync, we don't need to prevent
mutation on the tree once the arenas and superblock are
serialized.
2024-05-26 22:01:41 +00:00
Ori Bernstein
843b2168c6 gefs: tweak block address heuristic to sequentialize allocation
When churning through data blocks and writing out of order, we would
copy blocks and release them often, leading to gaps at the back of
the file. Retrying an allocation could also lead to allocating a block
in the same arena as the metadata.

This would leave gaps in the allocated files, which would cause seeks
when accessing the data later.

This set of changes allocates blocks that are expected to be accessed
sequentially from the start of the arena, and blocks that are expected
to be accessed out of order at the end of the arena.

For full data blocks (ie, where the write is at the end of the block),
we assume that the accesses will be sequential. For partial data blocks,
when the write offset is not at the end of the data block, we assume
that future appends are inbound, and we allocate the block in the non
sequential part of the arena. As a result, when we eventuall fill the
block, we will allocate the sequential block.

This doesn't help us too much if we have writes to files interleaved,
or we overwrite the same section of a file over and over, but it's
better than nothing.
2024-05-27 00:42:36 +00:00
Ori Bernstein
90d8e4d944 gefs: improve heuristic for arena selection 2024-05-27 00:17:35 +00:00
Ori Bernstein
80ed3922c3 gefs: use a single syncer proc to flush to disk 2024-05-27 00:11:26 +00:00
qwx
ded308e576 devsegment: don't use ulong as negative index
len is ulong, hence &l[-len] makes no sense.
&l[-(uintptr)len] and l - len are correct.

igfx uses a fixed segment to extend its memory when stolen memory is
insufficient for the requested mode.  this caused segment allocation
to always fail since no page in the loop would fall within the range.
modesetting then fails but the bottom of the screen stays garbled.
2024-05-26 02:02:29 +00:00
Ori Bernstein
8a2efea90c gefs: fix memory leak on nop syncs
when syncing a clean file system, we would leak
the sync messsage; stop doing that.
2024-05-26 03:05:20 +00:00
Ori Bernstein
ae8836d46a gefs(8): say some words about snapshots 2024-05-24 12:59:21 +00:00
Ori Bernstein
85ca0c9adc gefs: set gid correctly when creating directory entries 2024-05-23 03:28:38 +00:00
Ori Bernstein
95077e876a gefs: clean up blk logging code 2024-05-23 02:30:00 +00:00
Ori Bernstein
d7b6319891 gefs: add lock assertion for paranoia 2024-05-23 02:29:48 +00:00
Ori Bernstein
e6fa5a21f9 fs: acquire mutation lock around ORCLOSE upsert
only one upsert can go at once.
2024-05-23 01:51:11 +00:00
Keegan Saunders
5b13dcf68d boot: add honeycomb 2024-05-22 01:20:23 +00:00
Keegan Saunders
8e03baff8b add honeycomb kernel
This is a kernel for the NXP LX2160A, specifically the SolidRun
Honeycomb board which is available for sale on the SolidRun
website.

It currently boots on U-Boot. UEFI support is planned. Build or
download the U-Boot firmware from the SolidRun site and then write
it to the on-board SD card. Then, plug in a USB with the honeycomb
image and proceed to install as normal. Only NVMe or USB storage
is supported (SATA is planned).

This kernel supports PCIe and USB. On-board ethernet and SFP are
not supported (yet). It uses 2GB of memory by default, but that
can be increased using *maxmem depending on how much RAM you have
in the system. As well, SMP is currently disabled until an
uncommon deadlock issue is fixed (could be a hardware issue, unknown
at this point).
2024-05-21 23:54:48 +00:00
Ori Bernstein
5e34f6ae06 gefs: dump set of directory entry attributes 2024-05-21 14:17:59 +00:00
Jacob Moody
5ed2ea3310 mp(2): typos (thanks sirjofri) 2024-05-21 04:42:03 +00:00
Jacob Moody
a9d09ee1f1 webfs(4): typo around connection close (thanks halfwit) 2024-05-21 04:28:08 +00:00
Jacob Moody
5994b10942 /sys/src/cmd/test: enable zones.rc test (thanks unobe) 2024-05-21 04:27:27 +00:00
Ori Bernstein
796e4078d2 gefs: remove unused blk field 2024-05-21 01:34:43 +00:00
Sigrid Solveig Haflínudóttir
93da12e8aa nusb/audio: use correct buffer size for d2h requests, else some devices stalls 2024-05-20 22:26:42 +00:00
Sigrid Solveig Haflínudóttir
078d7a0281 nusb/audio: don't add a control if getvalues errored 2024-05-20 17:14:31 +00:00
Ori Bernstein
b2518fd92a fs: correct mode check for other group
we copied and pasted the structure of this from
cwfs, but they lay out the bits differently. We
fixed this for the other cases, but forgot this
one, which lead to exec being permitted when it
shouldn't have been.
2024-05-20 00:38:55 +00:00
Jacob Moody
17f7f6be4e /sys/src: cleanup power64 assembly 2024-05-19 20:57:04 +00:00
mia soweli
01140dbe17 gefs: convert to atomic instructions
8[al] now support the required atomics, so let's
stop using byte constants.
2024-05-19 15:35:55 +00:00
mia soweli
1b09060f46 8[al]: support XADD 2024-05-19 15:31:32 +00:00
mia soweli
1c7e58e75b 8[al]: support CMPXCHG and CMPXCHG8B 2024-05-19 14:54:06 +00:00
Ori Bernstein
61c6a24d35 gefs(8): small formatting fixes (thanks kvik) 2024-05-18 19:00:16 +00:00
Ori Bernstein
020b9bdd65 upas/smtp: add -C flag to disable thumbprint verification (thanks sirjofri) 2024-05-18 18:47:36 +00:00
Igor Böhm
6cd07cf340 gefs.ms: Minor fixes and improvements. 2024-05-16 22:16:45 +00:00
Ori Bernstein
037bc7b432 gefs: make it impossible for clunkfid to error
in out of memory situations, clunkfid could run
out of memory and error; preallocating moves the
error to fscreate/fsopen, which are prepared to
handle them.
2024-05-18 18:28:17 +00:00
Ori Bernstein
b2cd4959fe gefs: check name lengths before packing them 2024-05-18 18:26:38 +00:00
Jacob Moody
b37238edb8 vdiff: show filename instead of "/dev/null" when removing entire file 2024-05-18 18:07:46 +00:00
Jacob Moody
96c4dbca89 /sys/src/cmd: ?[cl] mkfile consistency 2024-05-18 17:21:43 +00:00
Sigrid Solveig Haflínudóttir
9c5fc1ce37 /sys/doc/mkfile: gefs 2024-05-17 13:12:20 +00:00
Ori Bernstein
b1e897ae44 gefs.ms: sycer => syncer (thanks sigrid) 2024-05-16 21:01:48 +00:00
Ori Bernstein
da1daf3012 gefs: initial import 2024-05-16 20:47:43 +00:00
Jacob Moody
94c69c4f68 9[acl], libmach: L?AR/ST?CCC 2024-05-14 18:26:29 +00:00
Jacob Moody
178cd4d113 9[acl], libmach: LWSYNC/CMPW/CMPWU 2024-05-14 01:54:07 +00:00
Sigrid Solveig Haflínudóttir
2734fa8545 riow(1): mention having to put the rc pipeline into its own script 2024-05-13 20:28:18 +00:00
rodri
ff6a0f490a tmdate(2): fix two little typos in the examples 2024-05-13 13:37:22 +00:00
cinap_lenrek
a74c7ca5ea ipconfig(8): document loopback and null media 2024-05-12 13:50:52 +00:00
cinap_lenrek
c76cc12a17 ip/ipconfig: add "null" verb to bind nullmedium
Example usage:

ip/ipconfig null /dev/mordor 8.8.8.8 /128
2024-05-12 13:42:26 +00:00
cinap_lenrek
0a7279b3af devip: make "null" medium bindable
It can actually be usefull to bind this dummy
"null" medium to an address, which gives a way to
divert packets towards it that should be discarded.
2024-05-12 13:39:58 +00:00
cinap_lenrek
11fa01778a devip: increase MTU to 64k for loopback medium
We should ever attempt fragmenting packets
towards the loopback medium.
2024-05-12 13:35:03 +00:00
phil9
025a2d172e vdiff: exit if diff is empty
currently vdiff will display an empty window if there is no diff.
	Print a message and exit early instead.
2024-05-09 17:18:45 +00:00
rodri
039015ad71 vdiff: fix scrolling and mouse button handling.
vertical scrolling now works in a line-wise manner,
just like in rio(1), sam(1) and friends. horizontal
scrolling showed problems with some line widths
where they got cut before showing the last
characters.

finally, pressing LMB or RMB and swiping while going
through any of the blocks caused a storm of plumbs
and visibility toggling (when over the expander line).
this doesn't happen anymore.
2024-05-09 11:49:09 +00:00
Jacob Moody
92d5d58784 flambe: pass correct name to initdraw() 2024-05-08 23:24:55 +00:00
Jacob Moody
88faa807aa flambe: flame graphs for prof(1) data 2024-05-08 18:01:08 +00:00
Jacob Moody
c8544c91d9 prof: increase precision of measurements
Currently we use millisecond ticks for time spent in each function.
This is not good enough for modern machines where fast functions could
be completed in a handful of nanoseconds.  Instead let us just use the
raw ticks and store the cyclecfreq in the output prof data.  This
requires that we enlargen the time section in the data to 8 bytes,
which broke the assumptions for struct allignment and required a
slight refactor of the code used to read it in prof(1).  Since this is
a breaking change, we've devised a small format to communicate the
version for future revision of this format and this patch includes a
modification to file(1) for recognizing this format.  Additionally
some minor improvements were made across the board.
2024-05-08 17:20:22 +00:00