Re: [PATCH] [1/1] pf refactoring

2016-08-19 Thread Mike Belopuhov
On 19 August 2016 at 11:49, Richard Procter wrote: > > The final patch in the pf series. Will commit when I do the previous one > in around 24 hours unless there are objections. > > > - pushes the 'field changed' guards into the 'change field' functions. > This lets us normalise many of the existi

Re: [PATCH] [0/1] pf refactoring

2016-08-19 Thread Mike Belopuhov
On 19 August 2016 at 11:33, Richard Procter wrote: > Hi, > > I've reduced the pf refactor (phase two) to two patches, which I'll be > committing in 24 hours or so unless there are any objections. > > I'm confident it won't, but supposing post-commit these have in > fact blown up, my first suspect

Re: [PATCH] fix mbuf leak in uicp_usrreq.c

2016-08-17 Thread Mike Belopuhov
On 17 August 2016 at 10:01, Simon Mages wrote: > Hi, > > while i was debugging dlg@'s diff regarding the bigger mbuf clusters i > stumbled > across a bug in the PRU_SEND case in uicp_usrreq.c. > > There is a call to sbappendcontrol which can fail, but there is no > error handling done. > If sbapp

Re: tcp output mbuf leak

2016-07-19 Thread Mike Belopuhov
On 19 July 2016 at 23:00, Alexander Bluhm wrote: > Hi, > > When looking at the error paths in tcp_output() I have found these > returns that look like mbuf leaks. > > ok? > > bluhm > looks correct indeed. ok mikeb

Re: Race in ARP

2016-07-13 Thread Mike Belopuhov
On 12 July 2016 at 10:45, Martin Pieuchot wrote: > dlg@ could reproduce a panic by running dhclient in a loop on one of his > machines. > > Turns out that there's a race between arplookup() and arpcache() inside > in_arpinput(). If another CPU removes the ARP entry from the table, via > RTM_DELET

Re: rwlock for sblock

2016-06-27 Thread Mike Belopuhov
On Mon, Jun 27, 2016 at 15:32 -0400, Ted Unangst wrote: > Mike Belopuhov wrote: > > On Thu, Jun 23, 2016 at 12:44 -0400, Ted Unangst wrote: > > > Instead of using the old flags and tsleep style lock, switch to rwlock in > > > sblock. That's what it's for. M

Re: rwlock for sblock

2016-06-27 Thread Mike Belopuhov
On Thu, Jun 23, 2016 at 12:44 -0400, Ted Unangst wrote: > Instead of using the old flags and tsleep style lock, switch to rwlock in > sblock. That's what it's for. More legible, and as a bonus, MP safer. > RW_NOSLEEP returns EBUSY if it has to wait, however old sblock macro would return EWOULDBLOC

Re: pf divert port reuse

2016-06-23 Thread Mike Belopuhov
On Thu, Jun 23, 2016 at 00:38 +0200, Alexander Bluhm wrote: > On Wed, Jun 22, 2016 at 08:15:09PM +0200, Mike Belopuhov wrote: > > Can you or benno test NAT64 with this change? > > In case of weird behavior do this: > > > > int sidx = pd->af == pd->naf ? pd->si

Re: pf divert port reuse

2016-06-21 Thread Mike Belopuhov
On Tue, Jun 21, 2016 at 16:08 +0200, Alexander Bluhm wrote: > On Tue, Jun 21, 2016 at 02:45:42PM +0200, Mike Belopuhov wrote: > > You're testing the sequence number > > of the new state with an existing one which has seen some > > traffic.. Are you sure this is correct?

Re: pf.conf macro with space

2016-06-21 Thread Mike Belopuhov
On 21 June 2016 at 14:57, Sebastian Benoit wrote: > Henning Brauer(hb-openbsdt...@ml.bsws.de) on 2016.06.21 13:11:16 +0200: >> * Stefan Sperling [2016-06-21 11:15]: >> > Generally, I would appreciate more detailed error messages from the pf.conf >> > parser. I recall several occasions where pfctl

Re: pf divert port reuse

2016-06-21 Thread Mike Belopuhov
On 21 June 2016 at 14:00, Alexander Bluhm wrote: > On Tue, Jun 21, 2016 at 11:24:14AM +0200, Mike Belopuhov wrote: >> So pf reused the port while some TCP segments were still in flight? > > No. The old state was in FIN_WAIT_2 and the socket in TIME_WAIT. Ah indeed, but hold on.

Re: ppp_compressors

2016-06-21 Thread Mike Belopuhov
On 21 June 2016 at 13:43, Jeremie Courreges-Anglas wrote: > > We don't support modules, so no need to reserve space for additional PPP > compression methods. > > ok? > Sure.

Re: pf divert port reuse

2016-06-21 Thread Mike Belopuhov
On 21 June 2016 at 00:14, Alexander Bluhm wrote: > Hi, > > I have seen a problem with pf divert when the dynamic port in a nat > rule got reused. The function pf_state_key_attach() reused the > state as it was in TCPS_FIN_WAIT_2. The corresponding socket was > not reused, as the the TCPS_TIME_WA

Re: af-to on pass out should be a parser error

2016-06-19 Thread Mike Belopuhov
On Mon, Jun 20, 2016 at 00:27 +0200, Sebastian Benoit wrote: > Mike Belopuhov(m...@belopuhov.com) on 2016.06.20 00:11:03 +0200: > > On Sun, Jun 19, 2016 at 23:43 +0200, Sebastian Benoit wrote: > > > manpage documents that af-to does not work on pass out rules, but the > >

Re: af-to on pass out should be a parser error

2016-06-19 Thread Mike Belopuhov
On Sun, Jun 19, 2016 at 23:43 +0200, Sebastian Benoit wrote: > manpage documents that af-to does not work on pass out rules, but the > pf.conf parser allows it, which leads a non working configuration being > loaded. > > this changes the parser to make pass out .. af-to an error. > > ok? > forg

Re: af-to on pass out should be a parser error

2016-06-19 Thread Mike Belopuhov
On Sun, Jun 19, 2016 at 23:43 +0200, Sebastian Benoit wrote: > manpage documents that af-to does not work on pass out rules, but the > pf.conf parser allows it, which leads a non working configuration being > loaded. > > this changes the parser to make pass out .. af-to an error. > what happens i

Re: Set prio when bypassing pf(4)

2016-06-08 Thread Mike Belopuhov
On Mon, Jun 06, 2016 at 23:52 +0200, Vincent Gross wrote: > On Mon, 6 Jun 2016 17:33:36 +0100 > Stuart Henderson wrote: > > > On 2016/06/06 16:15, Vincent Gross wrote: > > > When sending ARP requests, or when writing to a bpf handle (as when > > > sending DHCP Discover), we bypass pf(4) so we hav

Re: Set prio when bypassing pf(4)

2016-06-08 Thread Mike Belopuhov
On Tue, Jun 07, 2016 at 22:02 +0100, Stuart Henderson wrote: > On 2016/06/07 21:49, Vincent Gross wrote: > > > > It's how henning@ set things up when integrating the new queuing mechanism. > > http://cvsweb.openbsd.org/cgi-bin/cvsweb/src/sys/kern/uipc_mbuf.c#rev1.160 > > > > > Is there any use fo

Re: wifind(8) find your wifi

2016-06-02 Thread Mike Belopuhov
On 3 June 2016 at 00:17, Gleydson Soares wrote: > I usually just use a small script that lives in ~/bin > It's a great name, though. > cat ~/bin/wifi > > #!/bin/sh > > if [[ $1 == "home" ]]; then > doas ifconfig run0 nwid foonet wpa wpakey ultrasecret > doas dhclient run0 > fi >

Re: iked: fix ipv6 address pool assignment

2016-06-01 Thread Mike Belopuhov
On 1 June 2016 at 17:46, Patrick Wildt wrote: > On Wed, Jun 01, 2016 at 03:47:45PM +0200, Mike Belopuhov wrote: >> On 1 June 2016 at 13:33, Patrick Wildt wrote: >> > Hi, >> > >> > The IPv6 address assignment was basically copied from the IPv4 >> >

Re: iked: fix ipv6 address pool assignment

2016-06-01 Thread Mike Belopuhov
On 1 June 2016 at 13:33, Patrick Wildt wrote: > Hi, > > The IPv6 address assignment was basically copied from the IPv4 > code. Instead of working on the last 32-bits, it actually worked > on the fourth byte. Thus it modified the network bits instead of > the host bits. > > This diff fixes the co

Re: iked: address pools for both families

2016-06-01 Thread Mike Belopuhov
On 1 June 2016 at 10:16, Patrick Wildt wrote: > Hi, > > Currently there is only one address pool which is either v4 or v6. > This means that we cannot have dual-stack VPNs via iked. Clients > then might tunnel all IPv4 traffic, but IPv6 traffic is still using > the non-encrypted default route, wh

Re: iked: fix iked_cp_fixaddr()

2016-06-01 Thread Mike Belopuhov
On 1 June 2016 at 09:56, Patrick Wildt wrote: > Hi, > > iked_cp_fixaddr() is called to replace unspecified (e.g. 0.0.0.0) > addresses by specified (e.g. 192.0.2.1) ones. The function should > return if the address is already set. The check is wrong for the > IPv6 case, as it returns if it's not

Re: pppoe(4) vlan priorities

2016-05-30 Thread Mike Belopuhov
On 30 May 2016 at 20:15, Stuart Henderson wrote: > On 2016/05/30 19:26, Daniel Gillen wrote: >> Just tested your patch on my 5.9-stable amd64 gateway. >> >> Setting SPPP_CTL_PRIO to 1 and adding "match out on pppoe0 set prio 1" >> to /etc/pf.conf solves my issues. > > Thanks for testing. > >> The

Re: utvfu driver port

2016-05-27 Thread Mike Belopuhov
On Thu, May 26, 2016 at 16:09 -0700, patrick keshishian wrote: > Hi, > > Included is my initial effort to port the dual-licensed driver > for Fushicai Audio-Video Grabber (vendor 0x1b71 product 0x3002). > > As I mentioned in previous email it is "mostly working". I have > tested it on amd64 and m

Re: remove special vlan ioctls in ifconfig

2016-05-17 Thread Mike Belopuhov
On 17 May 2016 at 02:56, David Gwynne wrote: > the vlan ioctls have been superseded by the generic ifparent and > vnetid ioctls, and will eventually go away. > > this removes the vlan ioctl handling from ifconfig. however, to > continue to support existing vlan interface configuration files > (/et

Re: MSI-X support

2016-05-04 Thread Mike Belopuhov
On Tue, May 03, 2016 at 21:40 +0200, Mark Kettenis wrote: > Today mpi@ reminded me that I had written support for MSI-X some time > ago. Since he is interested in using multiple vectors, I extended the > code I had a bit to support that feature as well. This introduces a > new function: > > int

Re: Kill ipforward_rt

2016-04-19 Thread Mike Belopuhov
On 19 April 2016 at 11:06, Martin Pieuchot wrote: > This single cached route is a nice trick for having higher forwarding > numbers w/ benchmarks. But as soon as you start forwarding packets to > different end addresses, even using a single next hop, it becomes > useless. > > Since this single ca

Re: Fewer ip{_6,}forwart_rt

2016-04-18 Thread Mike Belopuhov
On 18 April 2016 at 15:40, Martin Pieuchot wrote: > On 18/04/16(Mon) 12:30, Mike Belopuhov wrote: >> On Mon, Apr 11, 2016 at 15:29 +0200, Martin Pieuchot wrote: >> > Instead of rtfree(9)ing the cached route after using it, if it is a >> > multipath one, f

Re: Fewer ip{_6,}forwart_rt

2016-04-18 Thread Mike Belopuhov
On Mon, Apr 11, 2016 at 15:29 +0200, Martin Pieuchot wrote: > Instead of rtfree(9)ing the cached route after using it, if it is a > multipath one, free it before. > > Ok? > This changes the case where ipforward_rt.ro_rt is NULL and the route that we allocate is RTF_MPATH (is that possible?). Befo

Re: less handrolled mbuf freeing code in uipc_mbuf.c

2016-04-15 Thread Mike Belopuhov
On 15 April 2016 at 07:35, David Gwynne wrote: > m_freem checks for NULL so the caller doesnt have to. > > ml_purge and m_purge were invented after some of the mq and ml code > was written, so fix that code to use the "new" functions. > > ok? > OK mikeb

Re: Fix for RDPMC on KVM OpenBSD guests

2016-04-13 Thread Mike Belopuhov
On 13 April 2016 at 15:26, Mike Larkin wrote: > The Intel SDM is a little unclear as to precisely how to check for the > presence > of the general purpose architectural performance monitoring counters (via the > 'rdpmc' instruction). In one place in the manual, it describes capabilities > based o

Re: Kill in_rtaddr()

2016-04-13 Thread Mike Belopuhov
On Mon, Apr 11, 2016 at 15:17 +0200, Martin Pieuchot wrote: > ``ipforward_rt'' is going away but rather than sending a big diff, > here's the first step. > > This diff replaces in_rtaddr() by rtalloc(9). Note that since the code > here is interested in rt_ifa it has to call rtisvalid(9) to preven

Re: pledge pstat

2016-04-12 Thread Mike Belopuhov
On 12 April 2016 at 22:25, Rob Pierce wrote: > Hoist sysct and kvm calls, and pledge stdio, rpath, vminfo. > > Rob > Please make sure that "pstat -d" still works. It's about the most useful thing it can do.

Re: manual section search order

2016-04-12 Thread Mike Belopuhov
On 12 April 2016 at 21:49, Theo Buehler wrote: > On Tue, Apr 12, 2016 at 03:37:42PM -0400, Ted Unangst wrote: >> Marc Espie wrote: >> > Parentheses are okay in urls, so I see no reason why: >> > >> > man.openbsd.org/carp(4) >> > >> > shouldn't work. >> >> There are an astounding number of text to

Re: manual section search order

2016-04-12 Thread Mike Belopuhov
On Tue, Apr 12, 2016 at 20:27 +0200, Ingo Schwarze wrote: > Hi Mike, > > Mike Belopuhov wrote on Tue, Apr 12, 2016 at 08:01:23PM +0200: > > > IMO it's a very bad idea to hardcode "3p/" like that. > > Aren't there packages using other funny section na

Re: pppoe(4): relax ifconfig command sequence requirements

2016-04-12 Thread Mike Belopuhov
On Wed, Apr 06, 2016 at 12:15 +0200, Mike Belopuhov wrote: > Hi, > > The EBUSY hack that I'm removing imposes an order on the ifconfig > commands issued against the pppoe interface used to configure the > sppp layer below. Right now ifconfig will fail with "

Re: manual section search order

2016-04-12 Thread Mike Belopuhov
On Tue, Apr 12, 2016 at 19:14 +0200, Ingo Schwarze wrote: > [moved to tech@, source-changes is not ideal for discussions] > > Marc Espie wrote on Tue, Apr 12, 2016 at 03:44:34PM +0200: > > On Tue, Apr 12, 2016 at 11:24:40PM +1000, Jonathan Gray wrote: > >> On Tue, Apr 12, 2016 at 02:36:09PM +0200,

Re: mpsafe aesni

2016-04-12 Thread Mike Belopuhov
On 26 March 2016 at 16:25, Mike Belopuhov wrote: > On Fri, Mar 25, 2016 at 22:43 +0100, Mark Kettenis wrote: >> > From: Mike Belopuhov >> > Date: Thu, 24 Mar 2016 21:33:25 +0100 >> > >> > On 24 March 2016 at 20:53, Mark Kettenis wrote: >> > >

Re: Spurious serial console interrupts

2016-04-12 Thread Mike Belopuhov
On 12 April 2016 at 15:12, Visa Hankala wrote: > On Fri, Apr 08, 2016 at 12:16:03PM +, Visa Hankala wrote: >> Every now and then I see "spurious interrupt 34" messages on octeon >> serial console. The root cause seems to be in comstart() which enables >> the TX holding register empty interrupt

Re: net80211: with more if_start()/if_enqueue()!

2016-04-12 Thread Mike Belopuhov
On 12 April 2016 at 08:34, Martin Pieuchot wrote: > As reported by jsg@ the wifi stack should use if_start() just like the > rest of the kernel. One of the patterns can even be converted to > if_enqueue(). > > Tested with: > iwn0 at pci2 dev 0 function 0 "Intel Centrino Advanced-N 6205" rev 0x3

Re: bufcache KNF

2016-04-11 Thread Mike Belopuhov
On 11 April 2016 at 15:51, Mark Kettenis wrote: > > And prototypes with names in public headers are still an issue. > Interesting point. What's a public header though? Are files that end up in /usr/include/dev/pci/ public headers? If so, why do we install all of them indiscriminately?

Re: rtableid in ip6_input()

2016-04-11 Thread Mike Belopuhov
On 11 April 2016 at 13:16, Martin Pieuchot wrote: > This variable is also used for route lookups, so it must always be > assigned. > > ok? > OK. Initially there was some pf glue that got removed.

Re: document NOLOCK in syscalls.master

2016-04-06 Thread Mike Belopuhov
On 6 April 2016 at 14:45, Michal Mazurek wrote: > * document NOLOCK - copy and paste from the commit message. > * keep MPSAFE undocumented, as it is never used. > * mention INDIR and NOLOCK in 'Fields'. > * sort the list of types in 'Fields'. > * sort the list of types in 'types'. > * place a dot

pppoe(4): relax ifconfig command sequence requirements

2016-04-06 Thread Mike Belopuhov
Hi, The EBUSY hack that I'm removing imposes an order on the ifconfig commands issued against the pppoe interface used to configure the sppp layer below. Right now ifconfig will fail with "device busy" after the authentication parameters have been set up because it kickstarts the LCP logic down i

Re: Patch for exporting PF queue status in snmpd

2016-04-05 Thread Mike Belopuhov
On Mon, Apr 04, 2016 at 15:45 +, Philip Higgins wrote: > If I'm not mistaken this information isn't exported already. > > I've been using this for a while to track queue usage over time in Cacti. > > Still need to add entries in OPENBSD-PF-MIB.txt, > but want to make sure I'm on the right tra

Re: increase clone bitmap size (again)

2016-04-02 Thread Mike Belopuhov
On 2 April 2016 at 18:36, Martin Natano wrote: > Below is the fixed v_specbitmap enlargements diff, including some tweaks > by mikeb@. I have tested this with fuse _and_ drm on amd64 and macppc. I > also tested on macppc with cloning bpf (not in the tree). Can anyone > come up with another interes

Re: increase v_specbitmap size (allow more cloned devices)

2016-03-31 Thread Mike Belopuhov
On 31 March 2016 at 16:37, Martin Natano wrote: > On Thu, Mar 31, 2016 at 06:02:07AM -0600, Todd C. Miller wrote: >> On Thu, 31 Mar 2016 09:34:32 +0200, Martin Natano wrote: >> >> > Thank you all for the input. Allocatig the bitmap via malloc() really >> > seems like the way to go, so we don't was

Re: remove PPPOE_SERVER codepaths

2016-03-31 Thread Mike Belopuhov
On 31 March 2016 at 08:49, Jonathan Gray wrote: > if_spppsubr.c has: > > revision 1.29 > date: 2005/03/24 16:37:52; author: claudio; state: Exp; lines: +15 -9; > Unbreak tree, mono_time may no longer be used because of timecounters. > Use getmicrouptime() instead. Found by grange@ and henning@.

Re: move "privileged port" check out of in(6)_pcbaddrisavail()

2016-03-31 Thread Mike Belopuhov
On 31 March 2016 at 09:55, Martin Pieuchot wrote: > On 30/03/16(Wed) 22:44, Vincent Gross wrote: >> Hello, >> >> This diff moves the "are we binding to a privileged port while not being >> root ?" >> check from in(6)_pcbaddrisavail() to in_pcbbind(). >> >> This way we have a cleaner separation be

Re: [PATCH] Proposal to remove -f for arp(8) and ndp(8)

2016-03-30 Thread Mike Belopuhov
Good day, Dimitris. Long time ago in a galaxy far far away I've been using this alongside the -F option that I've added. While managed switches are becoming cheaper, I don't see a reason for a working feature to go away, especially since there has been zero rationale provided apart from "ndp -f"

Re: mpsafe aesni

2016-03-26 Thread Mike Belopuhov
On Fri, Mar 25, 2016 at 22:43 +0100, Mark Kettenis wrote: > > From: Mike Belopuhov > > Date: Thu, 24 Mar 2016 21:33:25 +0100 > > > > On 24 March 2016 at 20:53, Mark Kettenis wrote: > > > Diff below makes aesni crypto "mpsafe". It adds a CRYPTOCA

Re: mpsafe aesni

2016-03-24 Thread Mike Belopuhov
On 24 March 2016 at 20:53, Mark Kettenis wrote: > Diff below makes aesni crypto "mpsafe". It adds a CRYPTOCAP_F_MPSAFE > flag that makes the crypto framework dispatch to an mpsafe taskq if it > is set. In order to make the aesni_process() function that does the > actual crypto work mpsafe, it mo

Re: Update `ticks' in the right place

2016-03-19 Thread Mike Belopuhov
On Wed, Mar 16, 2016 at 14:42 +0900, Masao Uebayashi wrote: > This doesn't use atomic operation, because: > > - hardclock() is the only writer > - Clock interrupt doesn't run simultaneously > - Reading int should be atomic on all architectures > Well, in reality both the new location and timeou

Re: CPUID in amd64/i386 boot code

2016-03-19 Thread Mike Belopuhov
On Wed, Mar 16, 2016 at 23:47 -0700, Mike Larkin wrote: > On Thu, Mar 17, 2016 at 03:31:45PM +0900, Masao Uebayashi wrote: > > On Wed, Mar 16, 2016 at 11:26:39PM -0700, Mike Larkin wrote: > > > On Thu, Mar 17, 2016 at 03:15:07PM +0900, Masao Uebayashi wrote: > > > > This is the intended use, avoid

Re: kern_sched.c: unused functions

2016-03-19 Thread Mike Belopuhov
On Wed, Mar 16, 2016 at 22:18 -0400, Michael McConville wrote: > Michal Mazurek wrote: > > On 17:19:39, 2.03.16, Martin Natano wrote: > > > On Wed, Mar 02, 2016 at 05:07:21PM +0100, Michal Mazurek wrote: > > > > kern_sched.c: > > > > - remove unused functions > > > > - mark static functions as sta

Re: New scheduler for OpenBSD

2016-03-19 Thread Mike Belopuhov
On 18 March 2016 at 18:02, Michal Mazurek wrote: > On 09:22:18, 18.03.16, Chris Cappuccio wrote: >> These are really rough observations. This box spawns lots of dirty >> perl processes and also lots of fping processes for monitoring. > > The next step I had planned was related to juggling processe

Re: CPUID in amd64/i386 boot code

2016-03-18 Thread Mike Belopuhov
On Thu, Mar 17, 2016 at 16:39 +0100, Mike Belopuhov wrote: > On Wed, Mar 16, 2016 at 23:47 -0700, Mike Larkin wrote: > > On Thu, Mar 17, 2016 at 03:31:45PM +0900, Masao Uebayashi wrote: > > > On Wed, Mar 16, 2016 at 11:26:39PM -0700, Mike Larkin wrote: > > > > On T

Re: x86 BPTTRAP

2016-03-02 Thread Mike Belopuhov
On 28 February 2016 at 17:34, Martin Pieuchot wrote: > On 28/02/16(Sun) 17:02, Mike Belopuhov wrote: >> On 28 February 2016 at 14:38, Martin Pieuchot wrote: >> > In order to dynamically instrument kernel functions, I plan to add >> > breakpoints where a probe needs to

Re: Remove more netinet6 cruft

2016-03-02 Thread Mike Belopuhov
On 2 March 2016 at 14:00, Jeremie Courreges-Anglas wrote: > > Router Renumbering was never supported, prefix ioctls were deprecated > back in 2002, nobody uses them anymore out there. struct in6_prefix > still uses a few bits from the prefix ioctl code, I've moved those bits > to nd6.h. The last

Re: ddb: show regs with address

2016-03-02 Thread Mike Belopuhov
On 1 March 2016 at 23:58, Martin Pieuchot wrote: > As explained previously I'm implementing an instrumentation system based > on ddb(4) and relying on breakpoints to execute kernel probes. > > For debugging purposes I need a way to dump the content of the registers > when a breakpoint-not-for-ddb(

Re: bump the max_linkhdr size from 16 bytes to 64

2016-03-02 Thread Mike Belopuhov
On 2 March 2016 at 05:50, David Gwynne wrote: > the max_link hdr is basically how much space to reserve before an > ip packet for link headers, eg, ethernet. > > 16 bytes was a good choice when everything was just ip inside > ethernet, but now we deal with a bunch of encapsulations which blow > th

Re: db_sym_numargs() is always false

2016-03-01 Thread Mike Belopuhov
On 1 March 2016 at 13:04, Martin Pieuchot wrote: > I'd like to remove this dead code because I'd like to unify to some > extend the frame walking code between archs and this doesn't help. > > ok? > OK mikeb

Re: Kill db_lookup()

2016-03-01 Thread Mike Belopuhov
On 1 March 2016 at 12:59, Martin Pieuchot wrote: > No need for an empty wrapper. ok? > I'm certainly fine with calling db_elf_sym_lookup directly from the db_value_of_name, but i'm not sure about moving db_value_of_name into db_elf.c as it makes it sort of stand out by not having consistent nami

Re: Kill db_find_trace_symbols()

2016-03-01 Thread Mike Belopuhov
On 1 March 2016 at 13:06, Martin Pieuchot wrote: > This is also dead code. ok? > Sure, OK mikeb

Re: properly inject UDP header for udpencap over IPv6

2016-02-28 Thread Mike Belopuhov
On Fri, Feb 26, 2016 at 21:55 +0100, Patrick Wildt wrote: > On Fri, Feb 26, 2016 at 08:25:02PM +0100, Alexander Bluhm wrote: > > On Fri, Feb 26, 2016 at 04:56:49PM +0100, Mike Belopuhov wrote: > > > I think your revised diff should be committed. Any objections?

Re: x86 BPTTRAP

2016-02-28 Thread Mike Belopuhov
On 28 February 2016 at 14:38, Martin Pieuchot wrote: > In order to dynamically instrument kernel functions, I plan to add > breakpoints where a probe needs to be executed. Trap handlers will > be modified to check if the address of the trapping instruction > correspond to a registered probe, and

Re: Correct error number in crypto(9)

2016-02-27 Thread Mike Belopuhov
On 27 February 2016 at 08:21, Michael McConville wrote: > Michael McConville wrote: >> Michael McConville wrote: >> > Does this make sense? >> >> I just realized that the allocation failure checks earlier in the >> function return ENOBUFS. This probably makes more sense for the sake of >> consiste

Re: properly inject UDP header for udpencap over IPv6

2016-02-26 Thread Mike Belopuhov
Hi Patrick, I think your revised diff should be committed. Any objections? On Fri, Feb 26, 2016 at 15:12 +0100, Patrick Wildt wrote: > Bump with updated diff, now that tree is unlocked again. > > Patrick > > diff --git sys/netinet/ipsec_output.c sys/netinet/ipsec_output.c > index 91c319f..18a3

Re: alignment fault on armv7 when using carp(4)

2016-02-09 Thread Mike Belopuhov
On 9 February 2016 at 12:19, David Gwynne wrote: > >> On 9 Feb 2016, at 9:12 PM, Mike Belopuhov wrote: >> >> On 9 February 2016 at 11:31, David Gwynne wrote: >>> On Mon, Feb 08, 2016 at 11:02:06PM +1000, David Gwynne wrote: >>>> On Sat, Feb 06, 20

Re: alignment fault on armv7 when using carp(4)

2016-02-09 Thread Mike Belopuhov
On 9 February 2016 at 11:31, David Gwynne wrote: > On Mon, Feb 08, 2016 at 11:02:06PM +1000, David Gwynne wrote: >> On Sat, Feb 06, 2016 at 04:43:28PM -0500, Anthony Eden wrote: >> > >Synopsis: >> > >> > To me that behavior might suggest the problem is deeper than a >> > bookkeeping mist

Re: Signed overflow in ufs i_modrev calculation

2016-02-04 Thread Mike Belopuhov
On Wed, Jan 27, 2016 at 09:52 +0100, Martin Natano wrote: > In ufs, the calculation of i_modrev can produce signed overflow on 32 > bit architectures (found on i386). The tv.tv_usec * 4294 calculation is > designed to move the microseconds part of a struct timeval to the upper > bits of an unsigned

Re: Signed overflow in ufs i_modrev calculation

2016-02-03 Thread Mike Belopuhov
Any OKs or objections to this diff? This looks solid to me, FWIW. On Wed, Jan 27, 2016 at 09:52 +0100, Martin Natano wrote: > In ufs, the calculation of i_modrev can produce signed overflow on 32 > bit architectures (found on i386). The tv.tv_usec * 4294 calculation is > designed to move the micr

Re: Signed overflow in ufs i_modrev calculation

2016-01-27 Thread Mike Belopuhov
On 27 January 2016 at 14:21, Martin Natano wrote: > On Wed, Jan 27, 2016 at 12:27:46PM +0100, Mike Belopuhov wrote: >> On 27 January 2016 at 09:52, Martin Natano wrote: >> > In ufs, the calculation of i_modrev can produce signed overflow on 32 >> > bit archite

Re: Signed overflow in ufs i_modrev calculation

2016-01-27 Thread Mike Belopuhov
On 27 January 2016 at 09:52, Martin Natano wrote: > In ufs, the calculation of i_modrev can produce signed overflow on 32 > bit architectures (found on i386). The tv.tv_usec * 4294 calculation is > designed to move the microseconds part of a struct timeval to the upper > bits of an unsigned(!) 32

Re: Xen virtual network (Netfront) driver

2016-01-25 Thread Mike Belopuhov
On 25 January 2016 at 01:38, Jonathon Sisson wrote: > tech@, > > I've uploaded a few of the dmesgs gathered to dmesgd.nycbug.org: > > http://dmesgd.nycbug.org/index.cgi?action=dmesgd&do=index&fts=Jonathon > > Currently I have m4.10xlarge, c4.8xlarge, m3.medium, and t2.nano > uploaded for perusal.

Re: Xen virtual network (Netfront) driver

2016-01-24 Thread Mike Belopuhov
On 24 January 2016 at 20:55, Jonathon Sisson wrote: > On Sun, Jan 24, 2016 at 02:16:37PM +0100, Mike Belopuhov wrote: >> Hi Jonathon, >> >> Thanks a lot for taking your time to test this. >> > No, thank you guys for all of the work you're doing to get &

Re: Xen virtual network (Netfront) driver

2016-01-24 Thread Mike Belopuhov
Hi Jonathon, Thanks a lot for taking your time to test this. On 24 January 2016 at 06:49, Jonathon Sisson wrote: > On Sat, Jan 23, 2016 at 02:18:17PM -0800, Jonathon Sisson wrote: >> Speaking of testing, is there any particular area non-devs could >> assist with at this time? Gathering dmesgs f

vmx: vmxnet3_load_mbuf will still do the wrong thing

2016-01-19 Thread Mike Belopuhov
Hi, We've just run into a vmx panic and code inspection revealed that my previous diff contained a mistake, the pullup operation is called on a wrong mbuf chain. I apologize for overlooking this issue. We're not 100% certain that this fixes our exact problem yet since we can't reproduce it at wi

Request for testing: amd64 interrupt acknowledgement issue

2016-01-14 Thread Mike Belopuhov
Hi, After some extensive hair pulling by OpenBSD developers and discussions with friendly folks at Microsoft, we've come to a conclusion that the reason why Hyper-V legacy network controller doesn't work on OpenBSD is due to particularities in the low level interrupt acknowledgement code. Basical

Re: fix iwn firmware error during init

2016-01-12 Thread Mike Belopuhov
On Tue, Jan 12, 2016 at 11:59 +0100, Stefan Sperling wrote: > On Sat, Jan 09, 2016 at 10:25:45PM +0100, Stefan Sperling wrote: > > I've run into an issue where iwn(4) fails to init the hardware. > > > > Running 'ifconfig iwn0 scan' resulted in: > > > > setting configuration > > iwn0: fatal firmwa

Re: Get PCI resources from ACPI

2016-01-07 Thread Mike Belopuhov
On Thu, Jan 07, 2016 at 06:28 +0100, Pablo Méndez Hernández wrote: > Hi team, > > On Thu, Dec 31, 2015 at 10:05 PM, Philip Guenther wrote: > > On Wed, 30 Dec 2015, Mark Kettenis wrote: > > ... > >> Updated diff. Once again the ACPI standard is ambiguous and/or violated > >> by the hardware vendo

Re: Xen virtual network (Netfront) driver

2016-01-06 Thread Mike Belopuhov
On Wed, Jan 06, 2016 at 16:37 +0100, Mike Belopuhov wrote: > There's still stuff to do, but it receives and transmits reliably > (at least on modern Xen) so I'd like to get it in. Man page will > follow. > > OK? > Just noticed that a couple of debug printfs have

Xen virtual network (Netfront) driver

2016-01-06 Thread Mike Belopuhov
0..7f8b08e --- /dev/null +++ sys/dev/pv/if_xnf.c @@ -0,0 +1,1022 @@ +/* + * Copyright (c) 2015 Mike Belopuhov + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permiss

Re: ntpd setting date incorrectly

2015-12-16 Thread Mike Belopuhov
On Wed, Dec 16, 2015 at 03:53 +, Ian Mcwilliam wrote: > > Disable sensors * in ntpd.conf and time is good again. > > I see this on boot up when things go strange. > > hw.sensors.vmt0.timedelta0=1450237689.498077 secs, OK, Tue Nov 29 18:36:38.371 > > I wonder if it's related to this change?

Re: removing expired once rules in pf_purge_thread()

2015-12-16 Thread Mike Belopuhov
On Wed, Dec 16, 2015 at 02:31 +0100, Alexandr Nedvedicky wrote: > Hello, > > > It just occurred to me that another possibility would be a match-only > > rule that matches one but doesn't involve any purging machinery. Right > > now we install ftp-proxy rules as having maximum number of states equ

Re: removing expired once rules in pf_purge_thread()

2015-12-15 Thread Mike Belopuhov
On 15 December 2015 at 15:36, Alexandr Nedvedicky wrote: > Hello, > >> > >> >Another possibility would be to require 'once' rules to be 'quick'. >> >This closes the candidacy window and makes its serialisation, to >> >preclude multiple matches, more feasible. >> > >> >Yet another p

Re: Reserve space for the L2 header in BPF injected frames

2015-12-15 Thread Mike Belopuhov
On Tue, Dec 15, 2015 at 14:30 +0100, Mike Belopuhov wrote: > Hi, > > This reserves max_linkhdr bytes for a link layer header in the newly > allocated cluster in the bpf injection path like it's done for the > packets originating on the host itself (cf. tcp_output). Saves us

Re: removing expired once rules in pf_purge_thread()

2015-12-15 Thread Mike Belopuhov
On 13 December 2015 at 18:56, Richard Procter wrote: > > If I understand this patch: > > Rule removal requires the consistency lock but to acquire it one must be > able to sleep. pf_test_rule() cannot sleep as it executes in a (soft) > interrupt handler, so it passes the expired rule to a thread w

Reserve space for the L2 header in BPF injected frames

2015-12-15 Thread Mike Belopuhov
Hi, This reserves max_linkhdr bytes for a link layer header in the newly allocated cluster in the bpf injection path like it's done for the packets originating on the host itself (cf. tcp_output). Saves us time doing costly pool allocations later on. I believe this has been tested by Yasuoka-san

vmx(4) incorrect m_pulldown usage

2015-12-15 Thread Mike Belopuhov
Hi, This has been in my tree for a while and I believe Yasuoka-san has tested it in the scenario where it was crashing. m_pulldown is done here with a zero offset which means that if there's been no space reserved for the Ethernet header in the mbuf or the cluster it will allocate a new chunk of

Re: Remove plain DES from kernel crypto

2015-12-10 Thread Mike Belopuhov
On Thu, Dec 10, 2015 at 14:29 +0100, Christian Weisgerber wrote: > We just removed DES support from IPsec and there are no other users, > so this deletes plain DES from the kernel crypto framework, including > the crypto accelerator drivers. > > ok? > Thanks for doing this work, OK mikeb

Re: IPsec: remove DES support

2015-12-08 Thread Mike Belopuhov
On 2 December 2015 at 23:36, Christian Weisgerber wrote: > Quoth ipsec.conf(5): > Use of DES as an encryption algorithm is considered to be insecure since > brute force attacks are practical due its short key length. > > The attached patch removes support for DES-CBC encryption in ESP > an

Re: Xen Patch-10: Add code to disable emulated devices

2015-12-05 Thread Mike Belopuhov
On Sat, Dec 05, 2015 at 20:13 +0100, Karel Gardas wrote: > > +void > > +xen_disable_emulated_devices(struct xen_softc *sc) > > +{ > > +#if defined(__i386__) || defined(__amd64__) > > just a nitpick, not in a position to comment on your patches but this > has caught my eyes. So far everything was j

Xen Patch-12: Netfront stub

2015-12-05 Thread Mike Belopuhov
This adds a Netfront device stub. Diff is more for educational purposes at the moment. Perhaps Paul will chip in and help me add flesh to it. --- sys/arch/amd64/conf/GENERIC | 1 + sys/dev/pv/files.pv | 4 sys/dev/pv/if_xnf.c | 46 +

Xen Patch-11: Provide simple device attachment logic

2015-12-05 Thread Mike Belopuhov
This implements simple device probing. I have discussed this with deraadt@ and then later with kettenis@ and mpi@ and we've decided that OpenFirmware emulation would be a bit too much (at least for now). This is a work in progress, it will improve a bit once we start working on the Netfront netwo

Xen Patch-09: XenStore

2015-12-05 Thread Mike Belopuhov
ev/pv/xenstore.c new file mode 100644 index 000..3abbf45 --- /dev/null +++ sys/dev/pv/xenstore.c @@ -0,0 +1,793 @@ +/* + * Copyright (c) 2015 Mike Belopuhov + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, pro

Xen Patch-10: Add code to disable emulated devices

2015-12-05 Thread Mike Belopuhov
Starting with this one, all further patches are sort of work in progress. This diff implements a way to detach emulated devices (like a em network interface) in order to switch them to paravirtualized drivers (e.g. Netfront). Currently I'm not detaching anything, but provide a way to do it via th

Xen Patch-08: Xen Platform Device driver

2015-12-05 Thread Mike Belopuhov
xspd + # VirtIO device virtio {} file dev/pci/virtio.cvirtio attach virtio at pci with virtio_pci diff --git sys/dev/pci/xspd.c sys/dev/pci/xspd.c new file mode 100644 index 000..cdb6543 --- /dev/null +++ sys/dev/pci/xspd.c @@ -0,0 +1,119 @@ +/* + * Copyright (c) 2015 Mike

Xen Patch-07: Xen interrupt subsystem

2015-12-05 Thread Mike Belopuhov
This adds support for establishing virtual interrupts via Xen event channel ports. During boot, Xen will use polling mode, but once the system enables interrupts after cpu_configure(), xen_intr_enable will be called from the mountrook hook to unmask event ports. xen_intr is the combined interrupt

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