ampintc: fix interrupt acknowledge mask

2016-12-23 Thread Patrick Wildt
Hi, while looking at OpenBSD/arm64 I had interrupt storm issues. Turns out the issue is in the interrupt controller code. It's the same controller as on your typical OpenBSD/armv7 machine. If the controller has for example 288 interrrupts, ((1 << 288) - 1) is a bit too much to handle. In the

Re: ampintc: fix interrupt acknowledge mask

2016-12-23 Thread Jonathan Gray
On Fri, Dec 23, 2016 at 10:07:03AM +0100, Patrick Wildt wrote: > Hi, > > while looking at OpenBSD/arm64 I had interrupt storm issues. Turns out > the issue is in the interrupt controller code. It's the same controller > as on your typical OpenBSD/armv7 machine. > > If the controller has for

Re: Interrupt race in NET_LOCK/NET_UNLOCK

2016-12-23 Thread Alexander Bluhm
On Fri, Dec 23, 2016 at 11:41:00AM +0100, Martin Pieuchot wrote: > On 23/12/16(Fri) 06:08, Visa Hankala wrote: > > NET_LOCK() should raise IPL before acquiring the lock, and NET_UNLOCK() > > should restore the level after releasing the lock. Otherwise, lock > > recursion can occur, most likely

Re: Interrupt race in NET_LOCK/NET_UNLOCK

2016-12-23 Thread Martin Pieuchot
On 23/12/16(Fri) 06:08, Visa Hankala wrote: > NET_LOCK() should raise IPL before acquiring the lock, and NET_UNLOCK() > should restore the level after releasing the lock. Otherwise, lock > recursion can occur, most likely right after the splx(). An example: > > nd6_slowtimo <- NET_LOCK() >

Re: Interrupt race in NET_LOCK/NET_UNLOCK

2016-12-23 Thread Mike Belopuhov
On 23 December 2016 at 11:41, Martin Pieuchot wrote: > On 23/12/16(Fri) 06:08, Visa Hankala wrote: >> NET_LOCK() should raise IPL before acquiring the lock, and NET_UNLOCK() >> should restore the level after releasing the lock. Otherwise, lock >> recursion can occur, most likely

Re: ssl: move begin hidden decls

2016-12-23 Thread Jeremie Courreges-Anglas
Patrick Wildt writes: > Hi, > > I kind of think the BEGIN should be before the static since static > is still part of the function declaration (if SHA1_ASM is not set). > Otherwise clang complains. > > Comments? ok -- jca | PGP : 0x1524E7EE / 5135 92C1 AD36 5293 2BDF DDCC

Re: ld.so: -fno-builtin?

2016-12-23 Thread Mark Kettenis
> Date: Fri, 23 Dec 2016 18:13:45 +0100 > From: Joerg Sonnenberger > > On Thu, Dec 22, 2016 at 10:35:25PM -0800, Philip Guenther wrote: > > I'm assuming clang handles asm names like gcc, such that declaring > >void *memcpy(void *__restrict, const void *__restrict, __size_t) >

pf state key link

2016-12-23 Thread Alexander Bluhm
Hi, Christiano Haesbaert has sent me this diff. They are setting pkt_sk to NULL if pkt_sk->reverse is not pf_statek_key_isvalid(), but the chunk that creates the pkt_sk->reverse link actually depends on pkt_sk != NULL. I

Re: ld.so: -fno-builtin?

2016-12-23 Thread Joerg Sonnenberger
On Thu, Dec 22, 2016 at 10:35:25PM -0800, Philip Guenther wrote: > I'm assuming clang handles asm names like gcc, such that declaring >void *memcpy(void *__restrict, const void *__restrict, __size_t) > __dso_hidden __asm("_dl_memcpy"); > > will make even internally generated calls go to

Re: BFD: route get and route monitor

2016-12-23 Thread Hrvoje Popovski
On 21.12.2016. 23:15, Sebastian Benoit wrote: >> Hi, >> >> it seems that bfd is working with Force10 S4810 and Extreme Networks >> x460 switches. I can test it with cisco c6k5 if you want? > > Hei, > > i'm sure phessler (who might not read this for a couple of days) is happy > about any test you

Re: llvm: skip installing a few headers

2016-12-23 Thread Mark Kettenis
> Date: Fri, 23 Dec 2016 16:01:24 +0100 > From: Patrick Wildt > > Hi, > > on my endeavour to OpenBSD/arm64 I stumbled upon the clang provided > headers that we install. Especially since clang includes its own > directories before /usr/include. This means that for example

ssl: move begin hidden decls

2016-12-23 Thread Patrick Wildt
Hi, I kind of think the BEGIN should be before the static since static is still part of the function declaration (if SHA1_ASM is not set). Otherwise clang complains. Comments? Patrick diff --git a/lib/libcrypto/sha/sha_locl.h b/lib/libcrypto/sha/sha_locl.h index bb5f1b20721..3b218a900c6 100644

ripd(8) use after free

2016-12-23 Thread Jeremie Courreges-Anglas
In the neighbor fsm, NBR_ACT_DEL frees the neighbor structure. But fields of this structure are later accessed, this is mostly visible with debug output: nbr_del: neighbor ID 10.64.55.33, peerid 3 nbr_fsm: event 'RESPONSE SENT' resulted in action 'DELETE NBR' and changing state for neighbor ID

splassert with pppd

2016-12-23 Thread Stefan Sperling
When I kill pppd, running on top of umsm(4), I see the following splasserts: umsm0 at uhub1 port 1 configuration 1 interface 0 "HUAWEI Technologies HUAWEI Mobile Modem" rev 1.10/0.00 addr 2 umsm0: umass only mode. need to reattach umsm0 detached umsm0 at uhub1 port 1 configuration 1 interface 0

llvm: skip installing a few headers

2016-12-23 Thread Patrick Wildt
Hi, on my endeavour to OpenBSD/arm64 I stumbled upon the clang provided headers that we install. Especially since clang includes its own directories before /usr/include. This means that for example stddef.h is included from clang's directory and not /usr/include. But clang's stddef.h does not

clang fixes for iwn(4) and wpi(4)

2016-12-23 Thread Mark Kettenis
Clang warns about static inline functions that aren't used. There are a couple of those in iwn(4) and wpi(4) that are only used if the debug code is enabled. The diff below wraps them inside the proper #define. ok? Index: dev/pci/if_iwn.c

Re: ld.so: -fno-builtin?

2016-12-23 Thread Theo de Raadt
> On Thu, Dec 22, 2016 at 10:35:25PM -0800, Philip Guenther wrote: > > I'm assuming clang handles asm names like gcc, such that declaring > >void *memcpy(void *__restrict, const void *__restrict, __size_t) > > __dso_hidden __asm("_dl_memcpy"); > > > > will make even internally generated

Re: ND6 and splsoftnet()

2016-12-23 Thread Alexander Bluhm
On Thu, Dec 22, 2016 at 02:03:51PM +0100, Alexander Bluhm wrote: > Fine. But let's do the other changes. Move timer initialisation > to nd6_init() and call timeout_set() only once during init. Then > I don't have to think about wether it is MP safe. updated diff, parts have been commited ok?

Fix clang warning in usb code

2016-12-23 Thread Mark Kettenis
This one is similar to the athn(4) fix I committed a couple of days ago. The compiler complains, because the argument to the macro might be signed. An explicit cast does the trick here as well. ok? Index: dev/usb/uhcireg.h ===

Fix clang warning in ath(4)

2016-12-23 Thread Mark Kettenis
Here clang complains about an implicit enum conversion. Diff below fixes this by simply using the appropriate ieee80211 enum in the HAL_OPMODE typedef and defining HAL_M_XXX as aliases for IEEE80211_M_XXX. This matches what we already do for HAL_LED_STATE. ok? Index: dev/ic/ar5xxx.h

Re: ld.so: -fno-builtin?

2016-12-23 Thread Philip Guenther
On Fri, Dec 23, 2016 at 12:11 PM, Joerg Sonnenberger wrote: > On Fri, Dec 23, 2016 at 11:27:15AM -0800, Philip Guenther wrote: >> This is a form we use inside _libc_ so that calls to those functions >> generated by gcc will be redirected to aliases with hidden visibility >> and thus

Re: ld.so: -fno-builtin?

2016-12-23 Thread Joerg Sonnenberger
On Fri, Dec 23, 2016 at 06:43:42PM +0100, Mark Kettenis wrote: > > Date: Fri, 23 Dec 2016 18:13:45 +0100 > > From: Joerg Sonnenberger > > > > On Thu, Dec 22, 2016 at 10:35:25PM -0800, Philip Guenther wrote: > > > I'm assuming clang handles asm names like gcc, such that declaring >

acpials(4) fix

2016-12-23 Thread Mark Kettenis
Missing sentinel. We've been lucky so far with gcc, but clang does lay out the data in a different way and we crash. ok? Index: dev/acpi/acpials.c === RCS file: /cvs/src/sys/dev/acpi/acpials.c,v retrieving revision 1.1 diff -u -p

Re: clang fixes for iwn(4) and wpi(4)

2016-12-23 Thread Stefan Sperling
On Fri, Dec 23, 2016 at 06:51:48PM +0100, Mark Kettenis wrote: > Clang warns about static inline functions that aren't used. There are > a couple of those in iwn(4) and wpi(4) that are only used if the debug > code is enabled. The diff below wraps them inside the proper #define. > > ok? ok

Re: acpials(4) fix

2016-12-23 Thread Paul Irofti
On Fri, Dec 23, 2016 at 08:44:07PM +0100, Mark Kettenis wrote: > Missing sentinel. We've been lucky so far with gcc, but clang does > lay out the data in a different way and we crash. > > ok? OK > > > Index: dev/acpi/acpials.c >

Re: ld.so: -fno-builtin?

2016-12-23 Thread Philip Guenther
On Fri, Dec 23, 2016 at 9:13 AM, Joerg Sonnenberger wrote: > On Thu, Dec 22, 2016 at 10:35:25PM -0800, Philip Guenther wrote: >> I'm assuming clang handles asm names like gcc, such that declaring >>void *memcpy(void *__restrict, const void *__restrict, __size_t) >> __dso_hidden

Re: ld.so: -fno-builtin?

2016-12-23 Thread Joerg Sonnenberger
On Fri, Dec 23, 2016 at 11:27:15AM -0800, Philip Guenther wrote: > This is a form we use inside _libc_ so that calls to those functions > generated by gcc will be redirected to aliases with hidden visibility > and thus be local calls, without using the PLT. If that won't work > with clang, then

Re: syslogd klog read size

2016-12-23 Thread Todd C. Miller
Nice find, that explains the reports of broken lines. OK millert@ - todd

pf route-to rtisvalid

2016-12-23 Thread Alexander Bluhm
Hi, I think it is better to check for a valid route than for an existing route in pf route-to. So call rtisvalid() now. I want to have pf_route() and pf_route6() as simmilar as possible so I can merge them some day. As rtalloc() has to stay after embeding the v6 scope, I have moved it down in

syslogd chdir

2016-12-23 Thread Alexander Bluhm
Hi, When syslogd is started with a relative path, the reexec in the parent process fails. The chdir(2) should be done after execvp(3) in the parrent so that the same executable is found. Note that the child always does a chdir(2) after chroot(2). This allows to start ./syslogd which is useful

syslogd klog read size

2016-12-23 Thread Alexander Bluhm
Hi, When the kernel message buffer overflows, a message is printed by syslogd and the buffer is overwritten. The log file looks like this: Dec 23 22:20:54 q70 /bsd: klog: dropped 5687 bytes, message buffer full Dec 23 22:20:54 q70 /bsd: rch, if=vio1: TCP wire: (0) fdd7:e83e:66bc:210::17[27871]

Build kernels with -ffreestanding?

2016-12-23 Thread Mark Kettenis
We already do this on some architectures, but not on amd64 for example. The main reason is that this disables memcpy() optimizations that have a measurable impact on the network stack performance. We can get those optimizations back by doing: #define memcpy(d, s, n) __builtin_memcpy((d), (s),

Re: Fix clang warning in ath(4)

2016-12-23 Thread Stefan Sperling
On Fri, Dec 23, 2016 at 09:41:07PM +0100, Mark Kettenis wrote: > Here clang complains about an implicit enum conversion. > > Diff below fixes this by simply using the appropriate ieee80211 enum > in the HAL_OPMODE typedef and defining HAL_M_XXX as aliases for > IEEE80211_M_XXX. This matches what

Re: ospfd - add metric and type to print_redistribute

2016-12-23 Thread Jeremie Courreges-Anglas
Claudio Jeker writes: > On Sat, Nov 19, 2016 at 11:38:56AM +, Stuart Henderson wrote: >> On 2016/11/19 10:06, Remi Locherer wrote: >> > Hi, >> > >> > In the output of ospfd -nv I miss metric and type for the redistribute >> > statement. The below patch adds this.

Mistake in flex man page

2016-12-23 Thread Andras Farkas
Afternoon! The attached flexdiff changes flex.1 to be accurate about how flex currently works: -lfl does not provide yywrap() by default. Attached also are two lex files I used to find out that the man page wasn't correct. The man page says one can either use %option noyywrap or link with -lfl

Re: Mistake in flex man page

2016-12-23 Thread Philip Guenther
On Fri, Dec 23, 2016 at 7:26 PM, Andras Farkas wrote: > The attached flexdiff changes flex.1 to be accurate about how flex > currently works: -lfl does not provide yywrap() by default. > > Attached also are two lex files I used to find out that the man page > wasn't

Re: syslogd chdir

2016-12-23 Thread Theo de Raadt
>When syslogd is started with a relative path, the reexec in the >parent process fails. The chdir(2) should be done after execvp(3) >in the parrent so that the same executable is found. Note that the >child always does a chdir(2) after chroot(2). > >This allows to start ./syslogd which is useful

Re: Mistake in flex man page

2016-12-23 Thread Andras Farkas
On Fri, Dec 23, 2016 at 11:14 PM, Philip Guenther wrote: > Many options to cc are position sensitive, including the -l > option. Oh wow, I see. You're absolutely right. Thank you!

Re: splassert: ip_output: want 1 have 0

2016-12-23 Thread Mark Kettenis
> Date: Thu, 22 Dec 2016 14:56:43 +0100 > From: Martin Pieuchot > > On 22/12/16(Thu) 10:45, Martin Pieuchot wrote: > > On 22/12/16(Thu) 00:32, Mark Kettenis wrote: > > > splassert: ip_output: want 1 have 0 > > > Starting stack trace... > > > ip_output() at ip_output+0x7d > > >