Re: pluart(4): fifo support

2022-06-10 Thread Visa Hankala
On Wed, Jun 08, 2022 at 06:50:18AM +0200, Anton Lindqvist wrote: > On Sun, May 01, 2022 at 04:17:34PM +0000, Visa Hankala wrote: > > On Sat, Apr 30, 2022 at 09:40:24AM +0200, Anton Lindqvist wrote: > > > On Sun, Mar 13, 2022 at 04:17:07PM +0100, Mark Kettenis wrote: > >

mips64 bulk build report

2022-06-06 Thread visa
bulk build on octeon.ports.openbsd.org started on Sun May 29 16:05:09 UTC 2022 finished at Sun Jun 5 17:45:36 UTC 2022 lasted 08D01h40m done with kern.version=OpenBSD 7.1-current (GENERIC.MP) #948: Sat May 28 21:07:21 MDT 2022 built packages:8758 May 29:2056 May 30:962 May 31:525 Jun 1:475 Jun

Re: Fix clearing of sleep timeouts

2022-06-06 Thread Visa Hankala
On Mon, Jun 06, 2022 at 06:47:32AM +1000, David Gwynne wrote: > On Sun, Jun 05, 2022 at 03:57:39PM +0000, Visa Hankala wrote: > > On Sun, Jun 05, 2022 at 12:27:32PM +0200, Martin Pieuchot wrote: > > > On 05/06/22(Sun) 05:20, Visa Hankala wrote: > > > > E

Re: Fix clearing of sleep timeouts

2022-06-05 Thread Visa Hankala
On Sun, Jun 05, 2022 at 12:27:32PM +0200, Martin Pieuchot wrote: > On 05/06/22(Sun) 05:20, Visa Hankala wrote: > > Encountered the following panic: > > > > panic: kernel diagnostic assertion "(p->p_flag & P_TIMEOUT) == 0" failed: > > file "/usr

Fix clearing of sleep timeouts

2022-06-04 Thread Visa Hankala
Encountered the following panic: panic: kernel diagnostic assertion "(p->p_flag & P_TIMEOUT) == 0" failed: file "/usr/src/sys/kern/kern_synch.c", line 373 Stopped at db_enter+0x10: popq%rbp TIDPIDUID PRFLAGS PFLAGS CPU COMMAND 423109 57118 55 0x3

CVS: cvs.openbsd.org: src

2022-06-01 Thread Visa Hankala
CVSROOT:/cvs Module name:src Changes by: v...@cvs.openbsd.org2022/06/01 08:21:50 Modified files: regress/sys/kern/flock: Makefile flock.c Log message: Add a regress test for the end of lock range ambiguity bug.

CVS: cvs.openbsd.org: src

2022-06-01 Thread Visa Hankala
CVSROOT:/cvs Module name:src Changes by: v...@cvs.openbsd.org2022/06/01 08:18:43 Modified files: sys/kern : vfs_lockf.c Log message: Fix ambiguity with lock range end When the user requests a lock range that ends at LLONG_MAX, replace the end point with the

CVS: cvs.openbsd.org: src

2022-06-01 Thread Visa Hankala
CVSROOT:/cvs Module name:src Changes by: v...@cvs.openbsd.org2022/06/01 08:16:28 Modified files: sys/kern : vfs_lockf.c Log message: Fix lock range start when l_whence == SEEK_END and l_len < 0. OK anton@

CVS: cvs.openbsd.org: src

2022-05-30 Thread Visa Hankala
CVSROOT:/cvs Module name:src Changes by: v...@cvs.openbsd.org2022/05/30 08:06:16 Modified files: sys/kern : sys_pipe.c Log message: Replace selwakeup() with KNOTE() in pipe event activation. Recommit the reverted change selectively so that only pipes are

mips64 bulk build report

2022-05-29 Thread visa
bulk build on octeon.ports.openbsd.org started on Sun May 22 12:27:55 UTC 2022 finished at Sun May 29 15:05:00 UTC 2022 lasted 08D02h37m done with kern.version=OpenBSD 7.1-current (GENERIC.MP) #940: Sat May 21 21:03:52 MDT 2022 built packages:8745 May 22:2348 May 23:833 May 24:499 May 25:614

Re: Make pipes and sockets use KNOTE() instead of selwakeup()

2022-05-23 Thread Visa Hankala
On Tue, Feb 08, 2022 at 09:12:11AM +, Visa Hankala wrote: > Now that poll(2) is based on kqueue, the old, non-MP-safe poll backend > is not used any longer. Event sources can call KNOTE() directly instead > of selwakeup(). > > This diff does the KNOTE() conversion for pi

mips64 bulk build report

2022-05-22 Thread visa
bulk build on octeon.ports.openbsd.org started on Sun May 15 08:25:45 UTC 2022 finished at Sun May 22 06:21:20 UTC 2022 lasted 07D21h55m done with kern.version=OpenBSD 7.1-current (GENERIC.MP) #932: Sat May 14 18:56:38 MDT 2022 built packages:8739 May 15:2553 May 16:678 May 17:629 May 18:606

CVS: cvs.openbsd.org: src

2022-05-21 Thread Visa Hankala
CVSROOT:/cvs Module name:src Changes by: v...@cvs.openbsd.org2022/05/21 22:52:17 Modified files: sys/nfs: nfs_socket.c Log message: Lock kernel in nfsrv_rcv() because NFS subsystem is not MP-safe yet. Tested in snaps for a week. OK bluhm@

mips64 bulk build report

2022-05-15 Thread visa
bulk build on octeon.ports.openbsd.org started on Fri May 6 15:33:54 UTC 2022 finished at Fri May 13 16:07:42 UTC 2022 lasted 08D00h33m done with kern.version=OpenBSD 7.1-current (GENERIC.MP) #921: Fri May 6 04:30:57 MDT 2022 built packages:8749 May 6:2116 May 7:862 May 8:500 May 9:457 May

Lock kernel in nfsrv_rcv()

2022-05-13 Thread Visa Hankala
The NFS subsystem is not MP-safe yet. Take this into account in the NFS server socket upcall by locking the kernel. This might help with the NFS server hanging that was seen recently as a result of the now-reverted selwakeup()-to-KNOTE() conversion. Unfortunately, I have not been able to confirm

CVS: cvs.openbsd.org: src

2022-05-12 Thread Visa Hankala
CVSROOT:/cvs Module name:src Changes by: v...@cvs.openbsd.org2022/05/12 07:33:00 Modified files: sys/kern : kern_event.c Log message: kqueue: Fix race condition in knote_remove() Always fetch the knlist array pointer at the start of every iteration in

CVS: cvs.openbsd.org: src

2022-05-09 Thread Visa Hankala
CVSROOT:/cvs Module name:src Changes by: v...@cvs.openbsd.org2022/05/09 08:49:55 Modified files: sys/kern : sys_pipe.c uipc_socket.c uipc_socket2.c Log message: Revert "Replace selwakeup() with KNOTE() in pipe and socket event activation." The commit caused

[PATCH] D125189: Added parameter names to signature help.

2022-05-08 Thread Visa via Phabricator via cfe-commits
Qwinci created this revision. Herald added subscribers: usaxena95, kadircet, arphaman. Herald added a project: All. Qwinci requested review of this revision. Herald added projects: clang, clang-tools-extra. Herald added a subscriber: cfe-commits. Repository: rG LLVM Github Monorepo

Re: ktrace assert failure on OpenBSD 7.1

2022-05-07 Thread Visa Hankala
On Sat, May 07, 2022 at 07:47:12PM +1000, Joel Sing wrote: > After upgrading an OpenBSD arm64 (pine64+ board) Go builder to 7.1, the > following has been triggered twice (once every couple of days): > > panic: kernel diagnostic assertion "kn->kn_kq == kq" failed: file >

Re: ktrace assert failure on OpenBSD 7.1

2022-05-07 Thread Visa Hankala
On Sat, May 07, 2022 at 07:47:12PM +1000, Joel Sing wrote: > After upgrading an OpenBSD arm64 (pine64+ board) Go builder to 7.1, the > following has been triggered twice (once every couple of days): > > panic: kernel diagnostic assertion "kn->kn_kq == kq" failed: file >

Remove fo_poll from struct fileops

2022-05-07 Thread Visa Hankala
Remove unused struct fileops field fo_poll and callbacks. (After this, VOP_POLL() is next in line for removal.) OK? Index: sys/dev/pci/drm/drm_linux.c === RCS file: src/sys/dev/pci/drm/drm_linux.c,v retrieving revision 1.92 diff -u

[PATCH] D125120: Initial work on parameter info for function pointers

2022-05-06 Thread Visa via Phabricator via cfe-commits
Qwinci created this revision. Herald added subscribers: usaxena95, kadircet, arphaman. Herald added a project: All. Qwinci requested review of this revision. Herald added projects: clang, clang-tools-extra. Herald added a subscriber: cfe-commits. Repository: rG LLVM Github Monorepo

CVS: cvs.openbsd.org: src

2022-05-06 Thread Visa Hankala
CVSROOT:/cvs Module name:src Changes by: v...@cvs.openbsd.org2022/05/06 07:12:16 Modified files: sys/kern : kern_event.c Log message: Replace selwakeup() with KNOTE() in kqueue event activation. The deferred activation can now run in an MP-safe task queue.

CVS: cvs.openbsd.org: src

2022-05-06 Thread Visa Hankala
CVSROOT:/cvs Module name:src Changes by: v...@cvs.openbsd.org2022/05/06 07:09:41 Modified files: sys/kern : sys_pipe.c uipc_socket.c uipc_socket2.c Log message: Replace selwakeup() with KNOTE() in pipe and socket event activation. OK mpi@

Re: pluart(4): fifo support

2022-05-01 Thread Visa Hankala
On Sat, Apr 30, 2022 at 09:40:24AM +0200, Anton Lindqvist wrote: > On Sun, Mar 13, 2022 at 04:17:07PM +0100, Mark Kettenis wrote: > > > Date: Fri, 11 Mar 2022 07:53:13 +0100 > > > From: Anton Lindqvist > > > > > > On Tue, Mar 08, 2022 at 01:44:47PM +,

CVS: cvs.openbsd.org: src

2022-04-30 Thread Visa Hankala
CVSROOT:/cvs Module name:src Changes by: v...@cvs.openbsd.org2022/04/30 08:44:04 Modified files: share/man/man9 : refcnt_init.9 sys/kern : kern_synch.c Log message: Enforce proper memory ordering in refcnt_rele() and refcnt_finalize() Make

EVFILT_USER and kevent(2)

2022-04-30 Thread Visa Hankala
-user.c diff -N regress/sys/kern/kqueue/kqueue-user.c --- /dev/null 1 Jan 1970 00:00:00 - +++ regress/sys/kern/kqueue/kqueue-user.c 30 Apr 2022 13:33:12 - @@ -0,0 +1,189 @@ +/* $OpenBSD$ */ + +/* + * Copyright (c) 2022 Visa Hankala + * + * Permission to use, copy, modify

Re: Make pipes and sockets use KNOTE() instead of selwakeup()

2022-04-25 Thread Visa Hankala
On Tue, Feb 08, 2022 at 09:12:11AM +, Visa Hankala wrote: > Now that poll(2) is based on kqueue, the old, non-MP-safe poll backend > is not used any longer. Event sources can call KNOTE() directly instead > of selwakeup(). > > This diff does the KNOTE() conversion for pi

Re: Provide memory barriers in refcnt_rele() and refcnt_finalize()

2022-04-25 Thread Visa Hankala
On Thu, Apr 21, 2022 at 11:10:40PM +0200, Mark Kettenis wrote: > > Date: Thu, 21 Apr 2022 22:17:31 +0200 > > From: Alexander Bluhm > > > > On Mon, Apr 18, 2022 at 08:33:06AM +, Visa Hankala wrote: > > > I think the sanest solution is to add

Re: Provide memory barriers in refcnt_rele() and refcnt_finalize()

2022-04-18 Thread Visa Hankala
On Mon, Mar 14, 2022 at 04:14:47PM +, Visa Hankala wrote: > On Mon, Mar 14, 2022 at 02:01:07AM -0700, Philip Guenther wrote: > > On Mon, Mar 14, 2022 at 12:47 AM Visa Hankala wrote: > > > > > On Sun, Mar 13, 2022 at 06:26:19PM -0700, Philip Guenther wrote: > >

CVS: cvs.openbsd.org: www

2022-04-15 Thread Visa Hankala
CVSROOT:/cvs Module name:www Changes by: v...@cvs.openbsd.org2022/04/15 09:55:54 Modified files: . : 71.html Log message: mips64 package count

mips64 bulk build report

2022-04-15 Thread visa
bulk build on octeon.ports.openbsd.org started on Fri Apr 8 15:58:37 UTC 2022 finished at Fri Apr 15 15:35:46 UTC 2022 lasted 07D23h37m done with kern.version=OpenBSD 7.1 (GENERIC.MP) #903: Thu Apr 7 20:59:31 MDT 2022 built packages:8782 Apr 8:2083 Apr 9:1089 Apr 10:503 Apr 11:652 Apr 12:830

Re: vfs: document (and correct) the protection required for manipulating v_numoutput

2022-04-12 Thread Visa Hankala
raid.c. I > added > them. > > Comments or OK ? Please move the declarations of `s' next to the other variable declarations at the starts of the functions. With that, OK visa@ > Index: dev/softraid.c > === > RCS f

Re: Kill selrecord()

2022-04-12 Thread Visa Hankala
On Mon, Apr 11, 2022 at 07:14:46PM +0200, Martin Pieuchot wrote: > Now that poll(2) & select(2) use the kqueue backend under the hood we > can start retiring the old machinery. > > The diff below does not touch driver definitions, however it : > > - kills selrecord() & doselwakeup() > > - make

CVS: cvs.openbsd.org: src

2022-04-11 Thread Visa Hankala
CVSROOT:/cvs Module name:src Changes by: v...@cvs.openbsd.org2022/04/11 08:30:05 Modified files: sys/dev/gpio : gpio.c Log message: gpio: Add missing device_unref() calls device_lookup() returns a reference that the caller has to release. OK jca@

gpio: Add missing device_unref()

2022-04-10 Thread Visa Hankala
Make gpio(4) release the device reference that device_lookup() takes. OK? Index: dev/gpio/gpio.c === RCS file: src/sys/dev/gpio/gpio.c,v retrieving revision 1.16 diff -u -p -r1.16 gpio.c --- dev/gpio/gpio.c 6 Apr 2022 18:59:28

CVS: cvs.openbsd.org: src

2022-04-10 Thread Visa Hankala
CVSROOT:/cvs Module name:src Changes by: v...@cvs.openbsd.org2022/04/10 07:23:14 Modified files: sys/arch/mips64/mips64: ipifuncs.c Log message: mips64: Enforce memory ordering on SMP rendezvous Make sure that each CPU sees the initiator's pre-action state when

Re: refcount btrace

2022-04-07 Thread Visa Hankala
On Thu, Apr 07, 2022 at 07:55:11PM +0200, Alexander Bluhm wrote: > On Wed, Mar 23, 2022 at 06:13:27PM +0100, Alexander Bluhm wrote: > > In my opinion tracepoints give insight at minimal cost. It is worth > > it to have it in GENERIC to make it easy to use. > > After release I want to revive the

mips64 bulk build report

2022-04-03 Thread visa
bulk build on octeon.ports.openbsd.org started on Sat Mar 26 11:57:09 UTC 2022 finished at Sat Apr 2 08:50:09 UTC 2022 lasted 07D20h53m done with kern.version=OpenBSD 7.1-beta (GENERIC.MP) #889: Fri Mar 25 20:10:55 MDT 2022 built packages:8766 Mar 26:2431 Mar 27:741 Mar 28:534 Mar 29:479 Mar

mips64 bulk build report

2022-03-26 Thread visa
bulk build on octeon.ports.openbsd.org started on Thu Mar 10 09:53:44 UTC 2022 finished at Sat Mar 26 09:24:06 UTC 2022 lasted 16D23h30m done with kern.version=OpenBSD 7.1-beta (GENERIC.MP) #880: Wed Mar 9 16:52:25 MST 2022 built packages:8758 Mar 10:2468 Mar 11:639 Mar 12:621 Mar 13:585 Mar

CVS: cvs.openbsd.org: src

2022-03-20 Thread Visa Hankala
CVSROOT:/cvs Module name:src Changes by: v...@cvs.openbsd.org2022/03/20 23:45:52 Modified files: sys/sys: atomic.h Log message: Remove data dependency barrier from atomic_load_* functions This makes the atomic_load_* functions relaxed in terms of memory

__read_mostly

2022-03-20 Thread Visa Hankala
Linux uses pseudo-attribute __read_mostly to tag variables that are read frequently but written seldom. These variables are grouped together at link time. This improves cache usage by reducing false sharing. __read_mostly has been adopted by FreeBSD, DragonFly BSD and NetBSD. The former two also

Re: refcount btrace

2022-03-19 Thread Visa Hankala
On Sat, Mar 19, 2022 at 12:10:11AM +0100, Alexander Bluhm wrote: > On Thu, Mar 17, 2022 at 07:25:27AM +0000, Visa Hankala wrote: > > On Thu, Mar 17, 2022 at 12:42:13AM +0100, Alexander Bluhm wrote: > > > I would like to use btrace to debug refernce counting. The idea > >

CVS: cvs.openbsd.org: src

2022-03-18 Thread Visa Hankala
CVSROOT:/cvs Module name:src Changes by: v...@cvs.openbsd.org2022/03/18 08:45:39 Modified files: sys/kern : kern_resource.c sys/sys: resourcevar.h Log message: Use the refcnt API with struct plimit. OK bluhm@ dlg@

Re: refcount btrace

2022-03-18 Thread Visa Hankala
On Thu, Mar 17, 2022 at 06:16:51PM +0100, Alexander Bluhm wrote: > On Thu, Mar 17, 2022 at 07:25:27AM +0000, Visa Hankala wrote: > > On Thu, Mar 17, 2022 at 12:42:13AM +0100, Alexander Bluhm wrote: > > > I would like to use btrace to debug refernce counting. The idea > >

Use refcnt API with struct plimit

2022-03-17 Thread Visa Hankala
Use the refcnt API with struct plimit. OK? Index: kern/kern_resource.c === RCS file: src/sys/kern/kern_resource.c,v retrieving revision 1.71 diff -u -p -r1.71 kern_resource.c --- kern/kern_resource.c8 Feb 2021 10:51:01 -

CVS: cvs.openbsd.org: src

2022-03-17 Thread Visa Hankala
CVSROOT:/cvs Module name:src Changes by: v...@cvs.openbsd.org2022/03/17 08:23:34 Modified files: sys/nfs: nfs_socket.c sys/kern : kern_fork.c kern_prot.c sys/sys: ucred.h Log message: Use the refcnt API with struct ucred. OK

CVS: cvs.openbsd.org: src

2022-03-17 Thread Visa Hankala
CVSROOT:/cvs Module name:src Changes by: v...@cvs.openbsd.org2022/03/17 08:22:03 Modified files: sys/net: bpf.c bpfdesc.h Log message: Use the refcnt API in bpf. OK sashan@ bluhm@

Re: refcount btrace

2022-03-17 Thread Visa Hankala
On Thu, Mar 17, 2022 at 12:42:13AM +0100, Alexander Bluhm wrote: > I would like to use btrace to debug refernce counting. The idea > is to a a tracepoint for every type of refcnt we have. When it > changes, print the actual object, the current counter and the change > value. > Do we want that

Re: Remove data dependency barrier from atomic_load_*

2022-03-17 Thread Visa Hankala
On Wed, Mar 16, 2022 at 11:09:12PM +0100, Alexander Bluhm wrote: > On Tue, Mar 15, 2022 at 09:15:34AM +0000, Visa Hankala wrote: > > However, some DEC Alpha CPUs have their data caches divided into cache > > banks to improve bandwidth. These cache banks are relatively > > in

CVS: cvs.openbsd.org: src

2022-03-16 Thread Visa Hankala
CVSROOT:/cvs Module name:src Changes by: v...@cvs.openbsd.org2022/03/16 10:17:47 Modified files: sys/kern : kern_event.c Log message: Remove an unneeded include.

Use refcnt API with struct ucred

2022-03-16 Thread Visa Hankala
Use the refcnt API with struct ucred. OK? Index: nfs/nfs_socket.c === RCS file: src/sys/nfs/nfs_socket.c,v retrieving revision 1.139 diff -u -p -r1.139 nfs_socket.c --- nfs/nfs_socket.c22 Feb 2022 01:15:02 - 1.139 +++

Use refcnt API in bpf

2022-03-16 Thread Visa Hankala
Use the refcnt API in bpf. OK? Index: net/bpf.c === RCS file: src/sys/net/bpf.c,v retrieving revision 1.215 diff -u -p -r1.215 bpf.c --- net/bpf.c 15 Feb 2022 08:43:50 - 1.215 +++ net/bpf.c 16 Mar 2022 15:42:05 - @@

CVS: cvs.openbsd.org: src

2022-03-16 Thread Visa Hankala
CVSROOT:/cvs Module name:src Changes by: v...@cvs.openbsd.org2022/03/16 08:38:43 Modified files: sys/kern : kern_event.c sys/sys: eventvar.h Log message: Use the refcnt API in kqueue. OK dlg@ bluhm@

CVS: cvs.openbsd.org: src

2022-03-16 Thread Visa Hankala
CVSROOT:/cvs Module name:src Changes by: v...@cvs.openbsd.org2022/03/16 08:13:01 Modified files: share/man/man9 : refcnt_init.9 sys/kern : kern_synch.c sys/sys: refcnt.h Log message: Add refcnt_shared() and refcnt_read()

Use refcnt API in kqueue

2022-03-15 Thread Visa Hankala
Make kqueue use the refcnt API. OK? Index: sys/kern/kern_event.c === RCS file: src/sys/kern/kern_event.c,v retrieving revision 1.183 diff -u -p -r1.183 kern_event.c --- sys/kern/kern_event.c 22 Feb 2022 01:15:01 -

Re: Add refcnt_read()

2022-03-15 Thread Visa Hankala
On Tue, Mar 15, 2022 at 09:11:30AM +, Visa Hankala wrote: > This patch adds a function for getting a snapshot of a reference > counter. This will let code like crcopy() access the value in an > API-observing way. Here is a revised version. Based on input from dlg@, the patch

Remove data dependency barrier from atomic_load_*

2022-03-15 Thread Visa Hankala
This removes the data dependency consumer barrier from the atomic_load_* functions. I think the intent was to keep these functions relaxed in terms of CPU memory order. This makes these functions more agreeable in code that assertions may use, such as the suggested refcnt_read(). Removing the

Add refcnt_read()

2022-03-15 Thread Visa Hankala
This patch adds a function for getting a snapshot of a reference counter. This will let code like crcopy() access the value in an API-observing way. OK? Index: share/man/man9/refcnt_init.9 === RCS file:

Re: Provide memory barriers in refcnt_rele() and refcnt_finalize()

2022-03-14 Thread Visa Hankala
On Mon, Mar 14, 2022 at 02:01:07AM -0700, Philip Guenther wrote: > On Mon, Mar 14, 2022 at 12:47 AM Visa Hankala wrote: > > > On Sun, Mar 13, 2022 at 06:26:19PM -0700, Philip Guenther wrote: > > > On Sun, Mar 13, 2022 at 10:27 AM Visa Hankala wrote: > > > > &g

Re: Provide memory barriers in refcnt_rele() and refcnt_finalize()

2022-03-14 Thread Visa Hankala
On Sun, Mar 13, 2022 at 06:26:19PM -0700, Philip Guenther wrote: > On Sun, Mar 13, 2022 at 10:27 AM Visa Hankala wrote: > > > On Sun, Mar 13, 2022 at 04:29:44PM +0100, Mark Kettenis wrote: > > > ... > > > > Under what circumstances does memory ordering

Re: Provide memory barriers in refcnt_rele() and refcnt_finalize()

2022-03-13 Thread Visa Hankala
On Sun, Mar 13, 2022 at 04:29:44PM +0100, Mark Kettenis wrote: > > Date: Sun, 13 Mar 2022 12:47:13 + > > From: Visa Hankala > > > > This makes the refcnt implementation issue memory barriers when > > releasing references, splitting memory activity cleanly int

Provide memory barriers in refcnt_rele() and refcnt_finalize()

2022-03-13 Thread Visa Hankala
This makes the refcnt implementation issue memory barriers when releasing references, splitting memory activity cleanly into preceding and succeeding stages around refcnt 1->0 transition. I think the while loop could be optimized a little by re-reading r->r_refs just after sleep_finish(). That

Provide memory barriers in FRELE()

2022-03-13 Thread Visa Hankala
This is a slightly tweaked version of the FRELE() memory barrier patch. The barriers aim to provide clearer memory access behaviour around the f_count 1->0 transition. With the barriers, the transition splits the memory activity into preceding and succeeding stages that do not overlap. OK?

CVS: cvs.openbsd.org: src

2022-03-11 Thread Visa Hankala
CVSROOT:/cvs Module name:src Changes by: v...@cvs.openbsd.org2022/03/11 07:42:08 Modified files: share/man/man9 : cond_init.9 Log message: Fix formatting of cond_signal().

Re: atomic read write

2022-03-11 Thread Visa Hankala
On Fri, Mar 11, 2022 at 11:51:31AM +0100, Alexander Bluhm wrote: > On Fri, Mar 11, 2022 at 05:32:11AM +0000, Visa Hankala wrote: > > On Thu, Mar 10, 2022 at 07:17:43PM +0100, Alexander Bluhm wrote: > > > On Thu, Mar 10, 2022 at 04:39:49PM +0100, Alexander Bluhm wrote: > >

Re: atomic read write

2022-03-10 Thread Visa Hankala
On Thu, Mar 10, 2022 at 07:17:43PM +0100, Alexander Bluhm wrote: > On Thu, Mar 10, 2022 at 04:39:49PM +0100, Alexander Bluhm wrote: > > > Below is a patch that shows how to accomplish release semantics with > > > the file and refcnt APIs. (The added memory barriers ensure that the > > > CPU

Re: atomic read write

2022-03-10 Thread Visa Hankala
On Thu, Mar 10, 2022 at 10:45:47AM +, Laurence Tratt wrote: > On Thu, Mar 10, 2022 at 09:05:54AM +0000, Visa Hankala wrote: > > Hello Visa, > > > In general, atomic_* functions have not provided implicit memory > > barriers on OpenBSD. > > I've used atomi

Re: atomic read write

2022-03-10 Thread Visa Hankala
ery weak and does not seem useful in any of the use cases in the patch. However, the barrier does not appear to make things worse in terms of correctness. Except maybe in assertions where they cause subtle side effects. However, the patch looks good. OK visa@ > Index: sys/dev/pci/if_iwm.c > ==

mips64 bulk build report

2022-03-09 Thread visa
bulk build on octeon.ports.openbsd.org started on Wed Mar 2 16:47:19 UTC 2022 finished at Wed Mar 9 16:21:10 UTC 2022 lasted 07D23h33m done with kern.version=OpenBSD 7.1-beta (GENERIC.MP) #870: Tue Mar 1 18:30:28 MST 2022 built packages:8747 Mar 2:1912 Mar 3:1183 Mar 4:503 Mar 5:544 Mar 6:772

Re: Add kernel stack trace saving for riscv64

2022-03-09 Thread Visa Hankala
On Wed, Mar 09, 2022 at 08:40:50AM +0100, Jeremie Courreges-Anglas wrote: > On Tue, Mar 08 2022, Visa Hankala wrote: > > This patch adds kernel stack trace saving for riscv64, for the benefit > > of dt(4) and witness(4). > > Nice! > > > The unwinder is slow be

Add kernel stack trace saving for riscv64

2022-03-08 Thread Visa Hankala
This patch adds kernel stack trace saving for riscv64, for the benefit of dt(4) and witness(4). The unwinder is slow because of the symbol lookup, but this can be tweaked later. The limit variable prevents the unwinder from using user-controllable register values. The limit has to reflect the

CVS: cvs.openbsd.org: src

2022-03-08 Thread Visa Hankala
CVSROOT:/cvs Module name:src Changes by: v...@cvs.openbsd.org2022/03/08 09:13:08 Modified files: sys/dev/fdt: if_cad.c Log message: Make cad(4) handle rxr ioctl.

Re: pluart(4): fifo support

2022-03-08 Thread Visa Hankala
On Tue, Mar 08, 2022 at 08:04:36AM +0100, Anton Lindqvist wrote: > On Mon, Mar 07, 2022 at 07:36:35AM +0000, Visa Hankala wrote: > > I still think that checking TXFF and using the same code for both > > SBSA and true PL011 UARTs would be the best choice. This would avoid > >

CVS: cvs.openbsd.org: src

2022-03-07 Thread Visa Hankala
CVSROOT:/cvs Module name:src Changes by: v...@cvs.openbsd.org2022/03/07 06:02:53 Modified files: sys/dev/fdt: if_cad.c Log message: Prevent deadlock in cad_down() Introduce an rwlock to serialize cad(4) ioctl operations so that cad_down() can release NET_LOCK()

Re: pluart(4): fifo support

2022-03-06 Thread Visa Hankala
On Wed, Mar 02, 2022 at 07:25:36AM +0100, Anton Lindqvist wrote: > On Tue, Mar 01, 2022 at 01:41:10PM +0000, Visa Hankala wrote: > > On Tue, Mar 01, 2022 at 07:08:51AM +0100, Anton Lindqvist wrote: > > > On Sun, Feb 27, 2022 at 05:33:17PM +0100, Mark Kettenis wrote: > >

mips64 bulk build report

2022-03-02 Thread visa
bulk build on octeon.ports.openbsd.org started on Mon Feb 21 17:16:58 UTC 2022 finished at Wed Mar 2 07:33:37 UTC 2022 lasted 09D14h16m done with kern.version=OpenBSD 7.1-beta (GENERIC.MP) #857: Sun Feb 20 19:35:55 MST 2022 built packages:9037 Feb 21:1808 Feb 22:1006 Feb 23:647 Feb 24:475 Feb

Re: Fix deadlock in cad_down()

2022-03-02 Thread Visa Hankala
On Wed, Mar 02, 2022 at 12:11:30PM +0100, Mark Kettenis wrote: > > Date: Wed, 2 Mar 2022 10:53:54 + > > From: Visa Hankala > > > > Holding NET_LOCK() while invoking a taskq barrier can result in > > a deadlock because the lock can prevent the taskq f

Fix deadlock in cad_down()

2022-03-02 Thread Visa Hankala
Holding NET_LOCK() while invoking a taskq barrier can result in a deadlock because the lock can prevent the taskq from making progress. Avoid this problem in cad_down() by serializing the driver's ioctl handler with an rwlock so that NET_LOCK() can be released temporarily. The patch additionally

Re: pluart(4): fifo support

2022-03-01 Thread Visa Hankala
On Tue, Mar 01, 2022 at 07:08:51AM +0100, Anton Lindqvist wrote: > On Sun, Feb 27, 2022 at 05:33:17PM +0100, Mark Kettenis wrote: > > > Date: Sun, 27 Feb 2022 16:01:25 +0100 > > > From: Anton Lindqvist > > > > > > r1p5 is revision 3 with a 32 bytes FIFO. My only concern is that the > > >

CVS: cvs.openbsd.org: src

2022-02-28 Thread Visa Hankala
CVSROOT:/cvs Module name:src Changes by: v...@cvs.openbsd.org2022/02/28 08:49:57 Modified files: sys/arch/mips64/mips64: trap.c Log message: Remove unneeded symbol name lookup.

Re: pluart(4): fifo support

2022-02-27 Thread Visa Hankala
On Sun, Feb 27, 2022 at 09:56:38AM +0100, Anton Lindqvist wrote: > On Sun, Feb 27, 2022 at 06:19:02AM +0000, Visa Hankala wrote: > > On Sat, Feb 26, 2022 at 08:40:25AM +0100, Anton Lindqvist wrote: > > > Hi, > > > This enables fifo support in pluart(4). While here, I c

Re: pluart(4): fifo support

2022-02-26 Thread Visa Hankala
On Sat, Feb 26, 2022 at 08:40:25AM +0100, Anton Lindqvist wrote: > Hi, > This enables fifo support in pluart(4). While here, I changed the > attachment output to look more like com(4). Tested on my rpi3b which has > a 16 byte fifo. > > Comments? OK? > > diff --git sys/dev/ic/pluart.c

CVS: cvs.openbsd.org: src

2022-02-25 Thread Visa Hankala
CVSROOT:/cvs Module name:src Changes by: v...@cvs.openbsd.org2022/02/25 06:51:02 Modified files: sys/arch/arm64/arm64: machdep.c sys/arch/arm64/conf: GENERIC RAMDISK Log message: Enable cduart(4) on arm64. OK kettenis@

CVS: cvs.openbsd.org: src

2022-02-24 Thread Visa Hankala
CVSROOT:/cvs Module name:src Changes by: v...@cvs.openbsd.org2022/02/24 07:19:10 Modified files: sys/arch/riscv64/include: frame.h sys/arch/riscv64/riscv64: vm_machdep.c Log message: Fix kernel stack alignment on riscv64 Pad trapframe and switchframe

CVS: cvs.openbsd.org: src

2022-02-24 Thread Visa Hankala
CVSROOT:/cvs Module name:src Changes by: v...@cvs.openbsd.org2022/02/24 07:16:53 Modified files: sys/arch/riscv64/riscv64: vm_machdep.c Log message: Reserve room for holding curcpu pointer in u-area The tp register contains the curcpu pointer in kernel mode. The

Re: assert "sc->sc_dev == NUM" failed in if_tun.c (2)

2022-02-24 Thread Visa Hankala
create calls. if the vnode has been made bad/dead after > all the sleeping, it returns with ENXIO. > > this appears to fix the issue. i had a test program that would trigger > the KASSERT in a matter of seconds and it's been running for an hour > now. > > here's the diff. The di

Re: Fix kernel stack alignment on riscv64

2022-02-23 Thread Visa Hankala
So far this patch has worked fine on my test system. On Tue, Feb 22, 2022 at 06:41:31PM +, Visa Hankala wrote: > Index: arch/riscv64/include/frame.h > === > RCS file: src/sys/arch/riscv64/include/frame.h,v > retriev

Re: Fix kernel stack alignment on riscv64

2022-02-22 Thread Visa Hankala
On Tue, Feb 22, 2022 at 07:04:23PM +0100, Mark Kettenis wrote: > > Date: Tue, 22 Feb 2022 17:45:26 + > > From: Visa Hankala > > > > On Tue, Feb 22, 2022 at 06:13:54PM +0100, Mark Kettenis wrote: > > > > Date: Tue, 22 Feb 2022 16:59:24 + > > >

Re: Fix kernel stack alignment on riscv64

2022-02-22 Thread Visa Hankala
On Tue, Feb 22, 2022 at 06:13:54PM +0100, Mark Kettenis wrote: > > Date: Tue, 22 Feb 2022 16:59:24 + > > From: Visa Hankala > > > > On Tue, Feb 22, 2022 at 05:31:31PM +0100, Mark Kettenis wrote: > > > > Date: Tue, 22 Feb 2022 15:58

Re: Fix kernel stack alignment on riscv64

2022-02-22 Thread Visa Hankala
On Tue, Feb 22, 2022 at 05:31:31PM +0100, Mark Kettenis wrote: > > Date: Tue, 22 Feb 2022 15:58:31 + > > From: Visa Hankala > > > > The standard RISC-V calling convention says that the stack pointer > > should be 16-byte aligned. > > > > The patch

Fix kernel stack alignment on riscv64

2022-02-22 Thread Visa Hankala
The standard RISC-V calling convention says that the stack pointer should be 16-byte aligned. The patch below corrects the alignment of the kernel stack in context switching and exception handling. OK? The diff reveals that curcpu is stored in an unnamed spot near the upper end of u-area when

CVS: cvs.openbsd.org: src

2022-02-22 Thread Visa Hankala
CVSROOT:/cvs Module name:src Changes by: v...@cvs.openbsd.org2022/02/22 06:34:23 Modified files: sys/arch/powerpc64/dev: ipmi_opal.c kexec.c sys/arch/riscv64/riscv64: syscall.c Log message: Remove extra ; No functional change.

CVS: cvs.openbsd.org: src

2022-02-21 Thread Visa Hankala
CVSROOT:/cvs Module name:src Changes by: v...@cvs.openbsd.org2022/02/22 00:47:46 Modified files: sys/arch/riscv64/riscv64: cpuswitch.S vm_machdep.c Log message: Clear frame pointer in cpu_fork() on riscv64 This ensures the chain of call frames is terminated

CVS: cvs.openbsd.org: src

2022-02-21 Thread Visa Hankala
CVSROOT:/cvs Module name:src Changes by: v...@cvs.openbsd.org2022/02/22 00:46:04 Modified files: sys/arch/riscv64/riscv64: db_trace.c Log message: ddb: Improve stack unwinding on riscv64 Add logic to navigate across trapframes. Stop unwinding if the frame pointer is

CVS: cvs.openbsd.org: src

2022-02-21 Thread Visa Hankala
CVSROOT:/cvs Module name:src Changes by: v...@cvs.openbsd.org2022/02/22 00:34:06 Modified files: sys/dev: audio.c Log message: Make audio(4) event filters MP-safe Add f_modify and f_process callbacks, and initialize the knote lists to use audio_lock. This

Zero frame pointer in cpu_fork() on riscv64

2022-02-21 Thread Visa Hankala
When setting up the stack for a (kernel) thread on riscv64, zero the frame pointer in switchframe so that the frame chain terminates cleanly. At the moment, the unwinding of kernel thread stacks stops to "bad frame pointer" error. OK? Index: arch/riscv64/riscv64/cpuswitch.S

Improve ddb's stack trace printing on riscv64

2022-02-21 Thread Visa Hankala
On riscv64, ddb's stack unwinder performs poorly. The main problem is that the exception handlers use a frame structure (trapframe) that differs from the typical call frame. The following patch does several adjustments, including: * Detect and handle exception frames. (Alternatively, the

mips64 bulk build report

2022-02-21 Thread visa
bulk build on octeon.ports.openbsd.org started on Sat Feb 12 15:10:36 UTC 2022 finished at Mon Feb 21 09:13:10 UTC 2022 lasted 09D18h02m done with kern.version=OpenBSD 7.0-current (GENERIC.MP) #848: Fri Feb 11 18:31:13 MST 2022 built packages:9018 Feb 12:2144 Feb 13:894 Feb 14:279 Feb 15:413

CVS: cvs.openbsd.org: src

2022-02-19 Thread Visa Hankala
CVSROOT:/cvs Module name:src Changes by: v...@cvs.openbsd.org2022/02/19 01:33:28 Modified files: distrib/armv7/ramdisk: install.md list Log message: Use installboot(8) in install.md of armv7. OK kettenis@ deraadt@

<    1   2   3   4   5   6   7   8   9   10   >