Re: powerpc*: make EXC_LAST less awkward

2022-05-17 Thread Miod Vallat
> > As seen in sys/arch/powerpc64/include/trap.h, not-so-ancient PowerPC and > > POWER processors define exception addresses past EXC_LAST. > > Erh, wait, not really. EXC_AST is "fake" and EXC_USER is a flag that > indicates we came from userland. I was referring to the few hardware vectors abov

Re: Picky, but much more efficient arc4random_uniform!

2022-05-17 Thread Otto Moerbeek
On Wed, May 18, 2022 at 02:50:28PM +1000, Damien Miller wrote: > On Tue, 17 May 2022, Raimo Niskanen wrote: > > > Why reinvent the wheel? > > > > Here is a pretty good walkthrough of established methods: > > > > https://www.pcg-random.org/posts/bounded-rands.html > > > > It sounds to me as

Re: Picky, but much more efficient arc4random_uniform!

2022-05-17 Thread Theo de Raadt
> However, I don't see a speedup for either of the alternate approaches. Or maybe, just maybe, the underlying function (arc4random, which in the dominant case it is just a small chacha step) is so inexpensive relative to the proposed higher-level logic changes? So this is all tilting at windmills

Re: Picky, but much more efficient arc4random_uniform!

2022-05-17 Thread Damien Miller
On Tue, 17 May 2022, Raimo Niskanen wrote: > Why reinvent the wheel? > > Here is a pretty good walkthrough of established methods: > > https://www.pcg-random.org/posts/bounded-rands.html > > It sounds to me as if your suggested methor essentially is > "Bitmask with Rejection -- Apple's Meth

Re: Picky, but much more efficient arc4random_uniform!

2022-05-17 Thread Philip Guenther
On Tue, May 17, 2022 at 1:10 PM Steffen Nurpmeso wrote: > Joerg Sonnenberger wrote in > : > |Am Fri, May 13, 2022 at 09:43:26AM -0500 schrieb Luke Small: > |> I made a couple new versions of a new kind of arc4random_uniform-like > ... > |If your main use case is limiting the amount of crypto

Re: powerpc*: make EXC_LAST less awkward

2022-05-17 Thread Mark Kettenis
> Date: Tue, 17 May 2022 19:20:49 + > From: Miod Vallat > > As seen in sys/arch/powerpc64/include/trap.h, not-so-ancient PowerPC and > POWER processors define exception addresses past EXC_LAST. Erh, wait, not really. EXC_AST is "fake" and EXC_USER is a flag that indicates we came from userl

Re: pf: remove unused include files

2022-05-17 Thread Alexander Bluhm
On Tue, May 17, 2022 at 06:40:12PM +, Miod Vallat wrote: > sys/net/pf.c r1.968 added a call to m_print() #ifdef DDB in a > troublesome situation. > > Once the root cause of the problem was fixed, the DDB-specific code path > was removed in r1.970, but the added includes were kept, although > n

Re: Picky, but much more efficient arc4random_uniform!

2022-05-17 Thread Steffen Nurpmeso
Steffen Nurpmeso wrote in <20220517220924.xohqc%stef...@sdaoden.eu>: |Joerg Sonnenberger wrote in | : ||Am Fri, May 13, 2022 at 09:43:26AM -0500 schrieb Luke Small: ||> I made a couple new versions of a new kind of arc4random_uniform-like ... |0 bytes "do not occur", so a 32-bit RNG value "i

Re: Picky, but much more efficient arc4random_uniform!

2022-05-17 Thread Steffen Nurpmeso
Joerg Sonnenberger wrote in : |Am Fri, May 13, 2022 at 09:43:26AM -0500 schrieb Luke Small: |> I made a couple new versions of a new kind of arc4random_uniform-like ... |If your main use case is limiting the amount of cryptography when using |small bounds, there is a much simpler approach to

Re: Picky, but much more efficient arc4random_uniform!

2022-05-17 Thread Joerg Sonnenberger
Am Fri, May 13, 2022 at 09:43:26AM -0500 schrieb Luke Small: > I made a couple new versions of a new kind of arc4random_uniform-like > function and some example functions which use them. Instead of having a > sufficiently large random number greater than the modulus, I pick a random > number using

mg: dobeep_msgs and %s

2022-05-17 Thread Omar Polo
dobeep_msgs isn't printf-like: it just prints the two arguments separated by a space in the minibuffer. When it was introduced some call from ewprintf were incorrectly translated and the "%s" remained. For example, "M-g M-g abc RET" shows "Line number %s invalid". ok? diff bd057c8434699e3a647a8

powerpc*: make EXC_LAST less awkward

2022-05-17 Thread Miod Vallat
As seen in sys/arch/powerpc64/include/trap.h, not-so-ancient PowerPC and POWER processors define exception addresses past EXC_LAST. The following diff changes EXC_LAST to no longer be the last "traditional" (0x100 bytes long) exception address, but the (conveniently page-aligned) end of the except

pf: remove unused include files

2022-05-17 Thread Miod Vallat
sys/net/pf.c r1.968 added a call to m_print() #ifdef DDB in a troublesome situation. Once the root cause of the problem was fixed, the DDB-specific code path was removed in r1.970, but the added includes were kept, although nothing in pf.c depends on DDB anymore. Index: pf.c =

Re: start unlocking kbind(2)

2022-05-17 Thread Theo de Raadt
Martin Pieuchot wrote: > On 17/05/22(Tue) 10:44, David Gwynne wrote: > > this narrows the scope of the KERNEL_LOCK in kbind(2) so the syscall > > argument checks can be done without the kernel lock. > > > > care is taken to allow the pc/cookie checks to run without any lock by > > being careful

Re: start unlocking kbind(2)

2022-05-17 Thread Martin Pieuchot
On 17/05/22(Tue) 10:44, David Gwynne wrote: > this narrows the scope of the KERNEL_LOCK in kbind(2) so the syscall > argument checks can be done without the kernel lock. > > care is taken to allow the pc/cookie checks to run without any lock by > being careful with the order of the checks. all mod

Call uvm_vnp_uncache() before VOP_RENAME()

2022-05-17 Thread Martin Pieuchot
nfsrv_rename() should behave like dorenameat() and tell UVM to "flush" a possibly mmap'ed file before calling VOP_RENAME(). ok? Index: nfs/nfs_serv.c === RCS file: /cvs/src/sys/nfs/nfs_serv.c,v retrieving revision 1.120 diff -u -p -r

wsconscfg(8): added "-g" option

2022-05-17 Thread Sergiy Kopchalyuk
While debugging simplefb-related issues with /dev/console initialization on Pinebook Pro I've discovered that wsconscfg(8) does not provide a way to call WSDISPLAY_GETSCREEN ioctl. Hence this small patch. It is similar to what NetBSD has in their codebase. Index: usr.sbin/wsconscfg/wsconscfg.8

arpresolve: XXXXX route contains no arp information

2022-05-17 Thread Hrvoje Popovski
Hi all, here we have carp pfsync setup mostly for wireless and mobile users. Beside from pure forwarding and firewalling boxes are dhcp server with dhcpsync. >From time to time in logs i can see: May 17 11:44:18 bcbnfw1 /bsd: arpresolve: 10.30.0.0: route contains no arp information I've route

Re: mg and trailing whitespaces

2022-05-17 Thread Omar Polo
10 weeks bump :) (+cc lum@) Omar Polo wrote: > Hello tech, > > mg(1) has this tendency to leave a lot of trailing whitespaces around in > auto-indent-mode and c-mode which I find annoying. Yes, there's > delete-trailing-space but it works only on the current line (and not the > whole buffer as

turn rc_exec variable into an rcexec function

2022-05-17 Thread Antoine Jacoutot
Hi folks. I would like to move away from the rc_exec variable to an rcexec() function for rc.d scripts. That will allow daemon_logger to work out of the box even for manually crafted rc_start() functions. I will also simplify the addition of new features like daemon_startdir. I have tested this w