Re: svn commit: r314036 - head/usr.sbin/bsdinstall/scripts

2017-02-21 Thread Bartłomiej Rutkowski
On Tue, Feb 21, 2017 at 2:40 PM, Alexey Dokuchaev  wrote:

> On Tue, Feb 21, 2017 at 08:34:29AM -0600, Eric Badger wrote:
> > Thanks for working on making it easier to harden FreeBSD. While
> > defaulting some of these options to "on" seem pretty harmless (e.g.
> > random_pid), others are likely to cause confusion for new and
> > experienced users alike (e.g. proc_debug. I've never used that option
> > before, so I gave it a try. It simply causes gdb to hang when attempting
> > to start a process, with no obvious indication of why).
>
> I concur.  In fact, harmless knobs should probably be turned on by default
> in FreeBSD itself (i.e., without any "hardening" help from the installer),
> while more intrusive ones should be opt-in, not opt-out.
>
> ./danfe
>

I strongly believe we should, by default, ship as secured and hardened as
possible in order to improve overall security of new users installations.
Power users will and do change the OS as they please, they most likely
don't use bsdinstall in first place, so they're not affected in any way.
These options have been around forever, used by a lot of users (once they
got to know those even exist) and seem to cause no issues. However, despite
that, and numerous discussions and mail threads over the years, we've
struggled to enable them and, as you can se, we even struggle to present
and make them available via installer. That's bad and I aim to change it :)

Kind regards,
Bartek Rutkowski
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r314036 - head/usr.sbin/bsdinstall/scripts

2017-02-21 Thread Bartłomiej Rutkowski
On Tue, Feb 21, 2017 at 2:34 PM, Eric Badger  wrote:

> On 02/21/2017 03:37 AM, Bartek Rutkowski wrote:
>
>> Author: robak (ports committer)
>> Date: Tue Feb 21 09:37:33 2017
>> New Revision: 314036
>> URL: https://svnweb.freebsd.org/changeset/base/314036
>>
>> Log:
>>   Enable bsdinstall hardening options by default.
>>
>>   As discussed previously, in order to introduce new OS hardening
>>   defaults, we've added them to bsdinstall in 'off by default' mode.
>>   It has been there for a while, so the next step is to change them
>>   to 'on by defaul' mode, so that in future we could simply enable
>>   them in base OS.
>>
>>   Reviewed by:  brd
>>   Approved by:  adrian
>>   Differential Revision:https://reviews.freebsd.org/D9641
>>
>> Modified:
>>   head/usr.sbin/bsdinstall/scripts/hardening
>>
>> Modified: head/usr.sbin/bsdinstall/scripts/hardening
>> 
>> ==
>> --- head/usr.sbin/bsdinstall/scripts/hardening  Tue Feb 21 09:33:21
>> 2017(r314035)
>> +++ head/usr.sbin/bsdinstall/scripts/hardening  Tue Feb 21 09:37:33
>> 2017(r314036)
>> @@ -36,15 +36,15 @@ FEATURES=$( dialog --backtitle "FreeBSD
>>  --title "System Hardening" --nocancel --separate-output \
>>  --checklist "Choose system security hardening options:" \
>>  0 0 0 \
>> -   "0 hide_uids" "Hide processes running as other users"
>> ${hide_uids:-off} \
>> -   "1 hide_gids" "Hide processes running as other groups"
>> ${hide_gids:-off} \
>> -   "2 read_msgbuf" "Disable reading kernel message buffer for
>> unprivileged users" ${read_msgbuf:-off} \
>> -   "3 proc_debug" "Disable process debugging facilities for
>> unprivileged users" ${proc_debug:-off} \
>> -   "4 random_pid" "Randomize the PID of newly created processes"
>> ${random_pid:-off} \
>> -   "5 stack_guard" "Insert stack guard page ahead of the growable
>> segments" ${stack_guard:-off} \
>> -   "6 clear_tmp" "Clean the /tmp filesystem on system startup"
>> ${clear_tmp:-off} \
>> -   "7 disable_syslogd" "Disable opening Syslogd network socket
>> (disables remote logging)" ${disable_syslogd:-off} \
>> -   "8 disable_sendmail" "Disable Sendmail service"
>> ${disable_sendmail:-off} \
>> +   "0 hide_uids" "Hide processes running as other users"
>> ${hide_uids:-on} \
>> +   "1 hide_gids" "Hide processes running as other groups"
>> ${hide_gids:-on} \
>> +   "2 read_msgbuf" "Disable reading kernel message buffer for
>> unprivileged users" ${read_msgbuf:-on} \
>> +   "3 proc_debug" "Disable process debugging facilities for
>> unprivileged users" ${proc_debug:-on} \
>> +   "4 random_pid" "Randomize the PID of newly created processes"
>> ${random_pid:-on} \
>> +   "5 stack_guard" "Insert stack guard page ahead of the growable
>> segments" ${stack_guard:-on} \
>> +   "6 clear_tmp" "Clean the /tmp filesystem on system startup"
>> ${clear_tmp:-on} \
>> +   "7 disable_syslogd" "Disable opening Syslogd network socket
>> (disables remote logging)" ${disable_syslogd:-on} \
>> +   "8 disable_sendmail" "Disable Sendmail service"
>> ${disable_sendmail:-on} \
>>  2>&1 1>&3 )
>>  exec 3>&-
>>
>>
>>
> Hi Bartek,
>
> Thanks for working on making it easier to harden FreeBSD. While defaulting
> some of these options to "on" seem pretty harmless (e.g. random_pid),
> others are likely to cause confusion for new and experienced users alike
> (e.g. proc_debug. I've never used that option before, so I gave it a try.
> It simply causes gdb to hang when attempting to start a process, with no
> obvious indication of why). I think more discussion is merited before they
> are turned on by default; personally I think they have potential to sour a
> first impression of FreeBSD by making things people are used to doing on
> other OSes hard.


The audience of these changes is not someone like you, who's using gdb
daily. The audience is the new users who often don't know what they're
doing, why they're doing that and how to do differently, especially when it
comes to the security. Power users in most cases don't use bsdinstall to
install their systems, they use automation of some sort to fine tune the OS
exactly to their needs and use case, and in their case this change is
transparent and doesn't affect them. What it affects is the default FreeBSD
installation and our poor track record of default installation security and
great track record for not changing and improving things just becuase
they've been like that for past decade.

Kind regards,
Bartek Rutkowski
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r314036 - head/usr.sbin/bsdinstall/scripts

2017-02-21 Thread Bartłomiej Rutkowski
On Wed, Feb 22, 2017 at 7:07 AM, Joel Dahl  wrote:

> On Tue, Feb 21, 2017 at 02:40:02PM +, Alexey Dokuchaev wrote:
> > On Tue, Feb 21, 2017 at 08:34:29AM -0600, Eric Badger wrote:
> > > Thanks for working on making it easier to harden FreeBSD. While
> > > defaulting some of these options to "on" seem pretty harmless (e.g.
> > > random_pid), others are likely to cause confusion for new and
> > > experienced users alike (e.g. proc_debug. I've never used that option
> > > before, so I gave it a try. It simply causes gdb to hang when
> attempting
> > > to start a process, with no obvious indication of why).
> >
> > I concur.  In fact, harmless knobs should probably be turned on by
> default
> > in FreeBSD itself (i.e., without any "hardening" help from the
> installer),
> > while more intrusive ones should be opt-in, not opt-out.
>
> I agree. Can we back this out and discuss it on current@?
>

With all due respect, I would rather not. The only reason is that it's been
discussed so many times over the years and neither of the discussion ended
up in anything improving the security of the OS and this is exactly why I
took the action and started introducing the hardening options to the
bsdinstall. Mind, you can always disable them, they won't be enabled in
base OS for a while and this is the best way to assert wether they do have
any negative impact. They've been around as OFF by default since 11.0-R and
so far no one complained.

Kind regards,
Bartek Rutkowski
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r314088 - head/sys/dev/isp

2017-02-21 Thread Alexander Motin
Author: mav
Date: Wed Feb 22 07:12:20 2017
New Revision: 314088
URL: https://svnweb.freebsd.org/changeset/base/314088

Log:
  Slightly polish isp_dump_atpd().
  
  MFC after:2 weeks

Modified:
  head/sys/dev/isp/isp_freebsd.c

Modified: head/sys/dev/isp/isp_freebsd.c
==
--- head/sys/dev/isp/isp_freebsd.c  Wed Feb 22 07:07:05 2017
(r314087)
+++ head/sys/dev/isp/isp_freebsd.c  Wed Feb 22 07:12:20 2017
(r314088)
@@ -1008,7 +1008,9 @@ isp_dump_atpd(ispsoftc_t *isp, int chan)
 
ISP_GET_PC(isp, chan, atpool, atpool);
for (atp = atpool; atp < [ATPDPSIZE]; atp++) {
-   isp_prt(isp, ISP_LOGALL, "Chan %d ATP [0x%x] origdlen %u 
bytes_xfrd %u lun %jx nphdl 0x%04x s_id 0x%06x d_id 0x%06x oxid 0x%04x state 
%s\n",
+   if (atp->state == ATPD_STATE_FREE)
+   continue;
+   isp_prt(isp, ISP_LOGALL, "Chan %d ATP [0x%x] origdlen %u 
bytes_xfrd %u lun %jx nphdl 0x%04x s_id 0x%06x d_id 0x%06x oxid 0x%04x state 
%s",
chan, atp->tag, atp->orig_datalen, atp->bytes_xfered, 
(uintmax_t)atp->lun, atp->nphdl, atp->sid, atp->portid, atp->oxid, 
states[atp->state & 0x7]);
}
 }
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r314036 - head/usr.sbin/bsdinstall/scripts

2017-02-21 Thread Joel Dahl
On Tue, Feb 21, 2017 at 02:40:02PM +, Alexey Dokuchaev wrote:
> On Tue, Feb 21, 2017 at 08:34:29AM -0600, Eric Badger wrote:
> > Thanks for working on making it easier to harden FreeBSD. While
> > defaulting some of these options to "on" seem pretty harmless (e.g.
> > random_pid), others are likely to cause confusion for new and
> > experienced users alike (e.g. proc_debug. I've never used that option
> > before, so I gave it a try. It simply causes gdb to hang when attempting
> > to start a process, with no obvious indication of why).
> 
> I concur.  In fact, harmless knobs should probably be turned on by default
> in FreeBSD itself (i.e., without any "hardening" help from the installer),
> while more intrusive ones should be opt-in, not opt-out.

I agree. Can we back this out and discuss it on current@?

-- 
Joel
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r314087 - head/sys/x86/x86

2017-02-21 Thread Konstantin Belousov
Author: kib
Date: Wed Feb 22 07:07:05 2017
New Revision: 314087
URL: https://svnweb.freebsd.org/changeset/base/314087

Log:
  More fixes for regression in r313898 on i386.
  Use long long constants where needed.
  
  Reported and tested by:   kargl
  Sponsored by: The FreeBSD Foundation
  MFC after:10 days

Modified:
  head/sys/x86/x86/x86_mem.c

Modified: head/sys/x86/x86/x86_mem.c
==
--- head/sys/x86/x86/x86_mem.c  Wed Feb 22 06:43:49 2017(r314086)
+++ head/sys/x86/x86/x86_mem.c  Wed Feb 22 07:07:05 2017(r314087)
@@ -260,7 +260,7 @@ x86_mrfetch(struct mem_range_softc *sc)
 
/* Compute the range from the mask. Ick. */
mrd->mr_len = (~(msrv & mtrr_physmask) &
-   (mtrr_physmask | 0xfffL)) + 1;
+   (mtrr_physmask | 0xfffLL)) + 1;
if (!mrvalid(mrd->mr_base, mrd->mr_len))
mrd->mr_flags |= MDF_BOGUS;
 
@@ -638,7 +638,7 @@ x86_mrinit(struct mem_range_softc *sc)
 * Determine the size of the PhysMask and PhysBase fields in
 * the variable range MTRRs.
 */
-   mtrr_physmask = (((uint64_t)1 << cpu_maxphyaddr) - 1) & ~0xfffUL;
+   mtrr_physmask = (((uint64_t)1 << cpu_maxphyaddr) - 1) & ~0xfffULL;
 
/* If fixed MTRRs supported and enabled. */
if ((mtrrcap & MTRR_CAP_FIXED) && (mtrrdef & MTRR_DEF_FIXED_ENABLE)) {
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r314086 - head/sys/dev/isp

2017-02-21 Thread Alexander Motin
Author: mav
Date: Wed Feb 22 06:43:49 2017
New Revision: 314086
URL: https://svnweb.freebsd.org/changeset/base/314086

Log:
  Fix multiple problems around LUN disable under load.
  
   - Move private data about ATIOs/INOTs from per-LUN to per-channel data.
  This allows active commands to continue operation after LUN destruction.
  This also simplifies lookup of the data by tag in some situations.
   - Unify three restart_queue processing implementations.
   - Complete all ATIOs from restart_queue on LUN disable.
   - Delete ATIO private data when command completed or aborted, not depending
  on the ATIO being requeued, that was ugly hack and could never happen.  CAM
  should always call ether XPT_CONT_TARGET_IO with status or XPT_ABORT.
   - Implement XPT_ABORT for queued ATIOs/INOTs to allow CAM do graceful
  shutdown, not depending on LUN disable, as it is done in ahd(4)/targ(4).
   - Unify isp_endcmd() arguments to make it more usable in generic code.
   - Remove never really used LUN state reference counter.
  
  MFC after:2 weeks

Modified:
  head/sys/dev/isp/isp_freebsd.c
  head/sys/dev/isp/isp_freebsd.h
  head/sys/dev/isp/isp_target.c

Modified: head/sys/dev/isp/isp_freebsd.c
==
--- head/sys/dev/isp/isp_freebsd.c  Wed Feb 22 06:26:50 2017
(r314085)
+++ head/sys/dev/isp/isp_freebsd.c  Wed Feb 22 06:43:49 2017
(r314086)
@@ -109,6 +109,9 @@ isp_attach_chan(ispsoftc_t *isp, struct 
struct ccb_setasync csa;
struct cam_sim *sim;
struct cam_path *path;
+#ifdef ISP_TARGET_MODE
+   int i;
+#endif
 
/*
 * Construct our SIM entry.
@@ -149,6 +152,14 @@ isp_attach_chan(ispsoftc_t *isp, struct 
spi->path = path;
 #ifdef ISP_TARGET_MODE
TAILQ_INIT(>waitq);
+   STAILQ_INIT(>ntfree);
+   for (i = 0; i < ATPDPSIZE; i++)
+   STAILQ_INSERT_TAIL(>ntfree, >ntpool[i], next);
+   LIST_INIT(>atfree);
+   for (i = ATPDPSIZE-1; i >= 0; i--)
+   LIST_INSERT_HEAD(>atfree, >atpool[i], next);
+   for (i = 0; i < ATPDPHASHSIZE; i++)
+   LIST_INIT(>atused[i]);
 #endif
} else {
fcparam *fcp = FCPARAM(isp, chan);
@@ -167,6 +178,14 @@ isp_attach_chan(ispsoftc_t *isp, struct 
TASK_INIT(>gtask, 1, isp_gdt_task, fc);
 #ifdef ISP_TARGET_MODE
TAILQ_INIT(>waitq);
+   STAILQ_INIT(>ntfree);
+   for (i = 0; i < ATPDPSIZE; i++)
+   STAILQ_INSERT_TAIL(>ntfree, >ntpool[i], next);
+   LIST_INIT(>atfree);
+   for (i = ATPDPSIZE-1; i >= 0; i--)
+   LIST_INSERT_HEAD(>atfree, >atpool[i], next);
+   for (i = 0; i < ATPDPHASHSIZE; i++)
+   LIST_INIT(>atused[i]);
 #endif
isp_loop_changed(isp, chan);
ISP_UNLOCK(isp);
@@ -831,19 +850,15 @@ isp_free_pcmd(ispsoftc_t *isp, union ccb
  * Put the target mode functions here, because some are inlines
  */
 #ifdef ISP_TARGET_MODE
-static ISP_INLINE int is_lun_enabled(ispsoftc_t *, int, lun_id_t);
 static ISP_INLINE tstate_t *get_lun_statep(ispsoftc_t *, int, lun_id_t);
-static ISP_INLINE tstate_t *get_lun_statep_from_tag(ispsoftc_t *, int, 
uint32_t);
-static ISP_INLINE void rls_lun_statep(ispsoftc_t *, tstate_t *);
-static ISP_INLINE inot_private_data_t *get_ntp_from_tagdata(ispsoftc_t *, 
uint32_t, uint32_t, tstate_t **);
-static ISP_INLINE atio_private_data_t *isp_get_atpd(ispsoftc_t *, tstate_t *, 
uint32_t);
-static ISP_INLINE atio_private_data_t *isp_find_atpd(ispsoftc_t *, tstate_t *, 
uint32_t);
-static ISP_INLINE void isp_put_atpd(ispsoftc_t *, tstate_t *, 
atio_private_data_t *);
-static ISP_INLINE inot_private_data_t *isp_get_ntpd(ispsoftc_t *, tstate_t *);
-static ISP_INLINE inot_private_data_t *isp_find_ntpd(ispsoftc_t *, tstate_t *, 
uint32_t, uint32_t);
-static ISP_INLINE void isp_put_ntpd(ispsoftc_t *, tstate_t *, 
inot_private_data_t *);
+static atio_private_data_t *isp_get_atpd(ispsoftc_t *, int, uint32_t);
+static atio_private_data_t *isp_find_atpd(ispsoftc_t *, int, uint32_t);
+static void isp_put_atpd(ispsoftc_t *, int, atio_private_data_t *);
+static inot_private_data_t *isp_get_ntpd(ispsoftc_t *, int);
+static inot_private_data_t *isp_find_ntpd(ispsoftc_t *, int, uint32_t, 
uint32_t);
+static void isp_put_ntpd(ispsoftc_t *, int, inot_private_data_t *);
 static cam_status create_lun_state(ispsoftc_t *, int, struct cam_path *, 
tstate_t **);
-static void destroy_lun_state(ispsoftc_t *, tstate_t *);
+static void destroy_lun_state(ispsoftc_t *, int, tstate_t *);
 static void isp_enable_lun(ispsoftc_t *, union ccb *);
 static void isp_disable_lun(ispsoftc_t *, union ccb *);
 static timeout_t isp_refire_putback_atio;
@@ -859,43 +874,7 @@ static void isp_handle_platform_notify_f
 static void 

svn commit: r314082 - head/sys/dev/iwm

2017-02-21 Thread Adrian Chadd
Author: adrian
Date: Wed Feb 22 05:11:24 2017
New Revision: 314082
URL: https://svnweb.freebsd.org/changeset/base/314082

Log:
  [iwm] Move iwm_dma_contig_alloc/_free functions to if_iwm_util.c.
  
  Obtained from:dragonflybsd.git 
83a1185edeede081051a6c00417d4c5a8f5988eb

Modified:
  head/sys/dev/iwm/if_iwm.c
  head/sys/dev/iwm/if_iwm_util.c
  head/sys/dev/iwm/if_iwm_util.h

Modified: head/sys/dev/iwm/if_iwm.c
==
--- head/sys/dev/iwm/if_iwm.c   Wed Feb 22 04:53:33 2017(r314081)
+++ head/sys/dev/iwm/if_iwm.c   Wed Feb 22 05:11:24 2017(r314082)
@@ -239,10 +239,6 @@ static int iwm_firmware_store_section(st
 static int iwm_set_default_calib(struct iwm_softc *, const void *);
 static voidiwm_fw_info_free(struct iwm_fw_info *);
 static int iwm_read_firmware(struct iwm_softc *, enum iwm_ucode_type);
-static voidiwm_dma_map_addr(void *, bus_dma_segment_t *, int, int);
-static int iwm_dma_contig_alloc(bus_dma_tag_t, struct iwm_dma_info *,
- bus_size_t, bus_size_t);
-static voidiwm_dma_contig_free(struct iwm_dma_info *);
 static int iwm_alloc_fwmem(struct iwm_softc *);
 static int iwm_alloc_sched(struct iwm_softc *);
 static int iwm_alloc_kw(struct iwm_softc *);
@@ -893,71 +889,6 @@ iwm_read_firmware(struct iwm_softc *sc, 
  * DMA resource routines
  */
 
-static void
-iwm_dma_map_addr(void *arg, bus_dma_segment_t *segs, int nsegs, int error)
-{
-if (error != 0)
-return;
-   KASSERT(nsegs == 1, ("too many DMA segments, %d should be 1", nsegs));
-   *(bus_addr_t *)arg = segs[0].ds_addr;
-}
-
-static int
-iwm_dma_contig_alloc(bus_dma_tag_t tag, struct iwm_dma_info *dma,
-bus_size_t size, bus_size_t alignment)
-{
-   int error;
-
-   dma->tag = NULL;
-   dma->map = NULL;
-   dma->size = size;
-   dma->vaddr = NULL;
-
-   error = bus_dma_tag_create(tag, alignment,
-0, BUS_SPACE_MAXADDR_32BIT, BUS_SPACE_MAXADDR, NULL, NULL, size,
-1, size, 0, NULL, NULL, >tag);
-if (error != 0)
-goto fail;
-
-error = bus_dmamem_alloc(dma->tag, (void **)>vaddr,
-BUS_DMA_NOWAIT | BUS_DMA_ZERO | BUS_DMA_COHERENT, >map);
-if (error != 0)
-goto fail;
-
-error = bus_dmamap_load(dma->tag, dma->map, dma->vaddr, size,
-iwm_dma_map_addr, >paddr, BUS_DMA_NOWAIT);
-if (error != 0) {
-   bus_dmamem_free(dma->tag, dma->vaddr, dma->map);
-   dma->vaddr = NULL;
-   goto fail;
-   }
-
-   bus_dmamap_sync(dma->tag, dma->map, BUS_DMASYNC_PREWRITE);
-
-   return 0;
-
-fail:
-   iwm_dma_contig_free(dma);
-
-   return error;
-}
-
-static void
-iwm_dma_contig_free(struct iwm_dma_info *dma)
-{
-   if (dma->vaddr != NULL) {
-   bus_dmamap_sync(dma->tag, dma->map,
-   BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE);
-   bus_dmamap_unload(dma->tag, dma->map);
-   bus_dmamem_free(dma->tag, dma->vaddr, dma->map);
-   dma->vaddr = NULL;
-   }
-   if (dma->tag != NULL) {
-   bus_dma_tag_destroy(dma->tag);
-   dma->tag = NULL;
-   }
-}
-
 /* fwmem is used to load firmware onto the card */
 static int
 iwm_alloc_fwmem(struct iwm_softc *sc)

Modified: head/sys/dev/iwm/if_iwm_util.c
==
--- head/sys/dev/iwm/if_iwm_util.c  Wed Feb 22 04:53:33 2017
(r314081)
+++ head/sys/dev/iwm/if_iwm_util.c  Wed Feb 22 05:11:24 2017
(r314082)
@@ -421,3 +421,68 @@ iwm_free_resp(struct iwm_softc *sc, stru
sc->sc_wantresp = -1;
wakeup(>sc_wantresp);
 }
+
+static void
+iwm_dma_map_addr(void *arg, bus_dma_segment_t *segs, int nsegs, int error)
+{
+if (error != 0)
+return;
+   KASSERT(nsegs == 1, ("too many DMA segments, %d should be 1", nsegs));
+   *(bus_addr_t *)arg = segs[0].ds_addr;
+}
+
+int
+iwm_dma_contig_alloc(bus_dma_tag_t tag, struct iwm_dma_info *dma,
+bus_size_t size, bus_size_t alignment)
+{
+   int error;
+
+   dma->tag = NULL;
+   dma->map = NULL;
+   dma->size = size;
+   dma->vaddr = NULL;
+
+   error = bus_dma_tag_create(tag, alignment,
+0, BUS_SPACE_MAXADDR_32BIT, BUS_SPACE_MAXADDR, NULL, NULL, size,
+1, size, 0, NULL, NULL, >tag);
+if (error != 0)
+goto fail;
+
+error = bus_dmamem_alloc(dma->tag, (void **)>vaddr,
+BUS_DMA_NOWAIT | BUS_DMA_ZERO | BUS_DMA_COHERENT, >map);
+if (error != 0)
+goto fail;
+
+error = bus_dmamap_load(dma->tag, dma->map, dma->vaddr, size,
+iwm_dma_map_addr, >paddr, BUS_DMA_NOWAIT);
+if (error != 0) {
+   bus_dmamem_free(dma->tag, dma->vaddr, 

svn commit: r314081 - head/sys/dev/iwm

2017-02-21 Thread Adrian Chadd
Author: adrian
Date: Wed Feb 22 04:53:33 2017
New Revision: 314081
URL: https://svnweb.freebsd.org/changeset/base/314081

Log:
  [iwm] Switch 7265D and 3165 devices to 7265D firmware.
  
  Obtained from:dragonflybsd.git 
0cb0a810cb4e04b30937cb4260e779f717a86492

Modified:
  head/sys/dev/iwm/if_iwm_7000.c

Modified: head/sys/dev/iwm/if_iwm_7000.c
==
--- head/sys/dev/iwm/if_iwm_7000.c  Wed Feb 22 04:51:37 2017
(r314080)
+++ head/sys/dev/iwm/if_iwm_7000.c  Wed Feb 22 04:53:33 2017
(r314081)
@@ -105,8 +105,7 @@ const struct iwm_cfg iwm3160_cfg = {
 
 const struct iwm_cfg iwm3165_cfg = {
.name = "Intel(R) Dual Band Wireless AC 3165",
-   /* XXX IWM7265D_FW doesn't seem to work properly yet */
-   .fw_name = IWM7265_FW,
+   .fw_name = IWM7265D_FW,
IWM_DEVICE_7000_COMMON,
.host_interrupt_operation_mode = 0,
 };
@@ -120,8 +119,7 @@ const struct iwm_cfg iwm7265_cfg = {
 
 const struct iwm_cfg iwm7265d_cfg = {
.name = "Intel(R) Dual Band Wireless AC 7265",
-   /* XXX IWM7265D_FW doesn't seem to work properly yet */
-   .fw_name = IWM7265_FW,
+   .fw_name = IWM7265D_FW,
IWM_DEVICE_7000_COMMON,
.host_interrupt_operation_mode = 0,
 };
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r314080 - head/share/man/man4

2017-02-21 Thread Adrian Chadd
Author: adrian
Date: Wed Feb 22 04:51:37 2017
New Revision: 314080
URL: https://svnweb.freebsd.org/changeset/base/314080

Log:
  add 7265D firmware mention in the iwmfw manpage.

Modified:
  head/share/man/man4/iwmfw.4

Modified: head/share/man/man4/iwmfw.4
==
--- head/share/man/man4/iwmfw.4 Wed Feb 22 04:50:52 2017(r314079)
+++ head/share/man/man4/iwmfw.4 Wed Feb 22 04:51:37 2017(r314080)
@@ -55,6 +55,7 @@ module at boot time, place the following
 iwm3160fw_load="YES"
 iwm7260fw_load="YES"
 iwm7265fw_load="YES"
+iwm7265Dfw_load="YES"
 iwm8000Cfw_load="YES"
 .Ed
 .Sh DESCRIPTION
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r314079 - in head/sys/modules/iwmfw: . iwm7265Dfw

2017-02-21 Thread Adrian Chadd
Author: adrian
Date: Wed Feb 22 04:50:52 2017
New Revision: 314079
URL: https://svnweb.freebsd.org/changeset/base/314079

Log:
  [iwmfw] add 7265D firmware.

Added:
  head/sys/modules/iwmfw/iwm7265Dfw/
  head/sys/modules/iwmfw/iwm7265Dfw/Makefile   (contents, props changed)
Modified:
  head/sys/modules/iwmfw/Makefile

Modified: head/sys/modules/iwmfw/Makefile
==
--- head/sys/modules/iwmfw/Makefile Wed Feb 22 04:44:08 2017
(r314078)
+++ head/sys/modules/iwmfw/Makefile Wed Feb 22 04:50:52 2017
(r314079)
@@ -1,5 +1,5 @@
 # $FreeBSD$
 
-SUBDIR=iwm3160fw iwm7260fw iwm7265fw iwm8000Cfw
+SUBDIR=iwm3160fw iwm7260fw iwm7265fw iwm8000Cfw iwm7265Dfw
 
 .include 

Added: head/sys/modules/iwmfw/iwm7265Dfw/Makefile
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/sys/modules/iwmfw/iwm7265Dfw/Makefile  Wed Feb 22 04:50:52 2017
(r314079)
@@ -0,0 +1,6 @@
+# $FreeBSD$
+
+KMOD=  iwm7265Dfw
+IMG=   iwm-7265D-17
+
+.include 
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r314078 - head/sys/conf

2017-02-21 Thread Adrian Chadd
Author: adrian
Date: Wed Feb 22 04:44:08 2017
New Revision: 314078
URL: https://svnweb.freebsd.org/changeset/base/314078

Log:
  add 7265D firmware.

Modified:
  head/sys/conf/files

Modified: head/sys/conf/files
==
--- head/sys/conf/files Wed Feb 22 04:42:02 2017(r314077)
+++ head/sys/conf/files Wed Feb 22 04:44:08 2017(r314078)
@@ -1916,6 +1916,20 @@ iwm7265.fw   optional iwm7265fw | 
iwmfw  
compile-with"${NORMAL_FW}"  \
no-obj no-implicit-rule \
clean   "iwm7265.fw"
+iwm7265Dfw.c   optional iwm7265Dfw | iwmfw \
+   compile-with"${AWK} -f $S/tools/fw_stub.awk iwm7265D.fw:iwm7265Dfw 
-miwm7265Dfw -c${.TARGET}" \
+   no-implicit-rule before-depend local\
+   clean   "iwm7265Dfw.c"
+iwm7265Dfw.fwo optional iwm7265Dfw | iwmfw \
+   dependency  "iwm7265D.fw"   \
+   compile-with"${NORMAL_FWO}" \
+   no-implicit-rule\
+   clean   "iwm7265Dfw.fwo"
+iwm7265D.fwoptional iwm7265Dfw | iwmfw \
+   dependency  "$S/contrib/dev/iwm/iwm-7265D-17.fw.uu" \
+   compile-with"${NORMAL_FW}"  \
+   no-obj no-implicit-rule \
+   clean   "iwm7265D.fw"
 iwm8000Cfw.c   optional iwm8000Cfw | iwmfw \
compile-with"${AWK} -f $S/tools/fw_stub.awk iwm8000C.fw:iwm8000Cfw 
-miwm8000Cfw -c${.TARGET}" \
no-implicit-rule before-depend local\
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r314077 - head/sys/contrib/dev/iwm

2017-02-21 Thread Adrian Chadd
Author: adrian
Date: Wed Feb 22 04:42:02 2017
New Revision: 314077
URL: https://svnweb.freebsd.org/changeset/base/314077

Log:
  Add 7265D firmware.

Added:
  head/sys/contrib/dev/iwm/iwm-7265D-17.fw.uu

Added: head/sys/contrib/dev/iwm/iwm-7265D-17.fw.uu
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/sys/contrib/dev/iwm/iwm-7265D-17.fw.uu Wed Feb 22 04:42:02 2017
(r314077)
@@ -0,0 +1,30750 @@
+begin 644 iwm-7265D-17.fw
+M`$E73`IS=')E86TZ3=7A?0V]R94-Y8VQE,31?"`(`'!``
+M0!$P2``0```(```!$```#B
+M804```$```"`O8``5#2``"ST@`#DY(``"!Z```#G@```
+M``!L(,`0#QL)(MP=P!`*`!M`(``;;@H``&&``!MN/```
+M80`!]``!A``(;;CX``&$0`!MN`0``84P``&%'``!A```;)"``'<`1
+MB`;A&!\`"&(``!LE`0`;)```!24!``4D``@%.0$`!6*((,`1`@`%)``(!3D!
+M``5BC"#`$00`!20`"`4Y`0`%8I`@P!$(``4D``@%.0$`!6*4(,`1$``%)``(
+M!3D!``5BF"#`$2``!20`"`4Y`0`%8IP@P!%```4D``@%.0$`!6*@(,`1```(
+M)0``""2(!N$9A`;A&4`!(!`!MP"```80\<'2($`!TFZ!W`$`$`#H'<`1
+M@@0;)`@`$*,`1O@\`80!LEY!W`$01LEY!W`$0```
+M`ALEY!W`$0@`7W`$``!AV!W`$/_^+8'<`1KP\`8=@=P!```1LPV!W`$:L/
+M`&$``!LE``$;)%P!,B``#&$0,`
+M`20```$E#T4`(@!<`#GO_P`R'```9`"`$R0!`!,E.!S`$0]W$R+@',`1`@`!
+M8@\!$R($",`1!P`3)0<.$R0$*,`1C`G`$@0HP!&0"<`2R$G'$0]P$R(!`!,P
+M!"C`$9@)P!(8*,`1#Q,#(@@`6#$#`!,D```3)00(P!$``!,D.$7`$04``&$`
+M`%@X!`!8,0``$R0!`!,E.!S`$0``%20AZ!W`$`\3!R(/9`$B"@`!0`@`
+M`7`>``!A"`!8;@D``&$(``=P!0``80`"7#$!``@D```()80"``!A`"!8
+M,&$!0A,D```3)00HP!&"!!,D&``3)00HP!'H'<`0YO\3,O__$S/H'<`1
+M```!)`@``24/`6,B`0!2)`@`!VX"``!A```5)"$4``!A0`;`$N@=P!$!
+M`%(DM!_`$`(`$W`"``!A"`!D,>,/`&$/$U(B#Q-2(@$`4FX$``!A@@03)`@`
+M$R4$*,`1!```88($$R08`!,E!"C`$0```&$L-H"!``#`%@(!$V1"`1,D!"C`
+M$>C"@($``,`6!@$38@0(P!`$`!-D#UP`(@H``$``!@!P&@``80``$R0``!,E
+M``#`%R``6#'((,`0<$7`$!`(P!```!,E`P`3)!P(P!$<",`1```3)`0(P!$/
+M%!4B!``5)@\P("+[_S`R`P`3)!@(P!$/%!4B`@`5)@\@,"(``!,D$$7`$1@(
+MP!$0`%@Q#P`3(@$`$S`$*,`1#WP3(@@`S!$``!,E```3)#1(QQ$/>Q,B`0`3
+M,`0HP!$/%!4B`@`5)@]-$R($$,41`@`3)/``#H!@L`>`!@!P\`%``<#1$`&`!,"A(`
+MI`$``!,`#`!`#10``P!,#14`!`!0#0``
+M`!X>B!Z(6@```%8```!6B%:(`@$``*H`
+M``"JB*J(_@$``(P*``!4C%2,I!\```#^```!`/\``@'_`0#_

Re: svn commit: r313992 - in head: sys/kern sys/sys tests/sys/kern

2017-02-21 Thread Eric Badger

On 02/21/2017 05:45 PM, Ravi Pokala wrote:

Hi Eric,

This appears to break buildworld for a bunch of platforms -- possibly all the 
ones that use gcc rather than clang?

A representative example from sparc64:

/usr/home/rpokala/freebsd/clean/base/head/tests/sys/kern/ptrace_test.c: In 
function 'atfu_ptrace__PT_KILL_breakpoint_body':

/usr/home/rpokala/freebsd/clean/base/head/tests/sys/kern/ptrace_test.c:1693: 
warning: implicit declaration of function '__builtin_debugtrap'
*** [ptrace_test.o] Error code 1

Thanks,

Ravi (rpokala@)


Hi Ravi,

Thanks for letting me know, and sorry for the breakage. It should be 
fixed as of r314075.


Eric

___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r314076 - in head/sys: conf dev/iwm

2017-02-21 Thread Adrian Chadd
Author: adrian
Date: Wed Feb 22 04:35:53 2017
New Revision: 314076
URL: https://svnweb.freebsd.org/changeset/base/314076

Log:
  [iwm] Move struct iwm_cfg chipset configs to if_iwm_7000.c and _8000.c
  
  * This is more similar to how code/definitions are distributed in
Linux's iwlwifi.
  
  * This should make recognizing new chipset variants, and adding additional
flags from the Linux iwlwifi code easier, without blowing up if_iwm.c
  
  Obtained from:dragonflybsd.git 
27d11320e707d2c41424efc1983762f6799941d6

Added:
  head/sys/dev/iwm/if_iwm_7000.c   (contents, props changed)
  head/sys/dev/iwm/if_iwm_8000.c   (contents, props changed)
  head/sys/dev/iwm/if_iwm_config.h   (contents, props changed)
Modified:
  head/sys/conf/files
  head/sys/dev/iwm/if_iwm.c
  head/sys/dev/iwm/if_iwm_pcie_trans.c
  head/sys/dev/iwm/if_iwmvar.h

Modified: head/sys/conf/files
==
--- head/sys/conf/files Wed Feb 22 04:35:07 2017(r314075)
+++ head/sys/conf/files Wed Feb 22 04:35:53 2017(r314076)
@@ -1861,6 +1861,8 @@ iwi_monitor.fwoptional iwimonitorfw |
no-obj no-implicit-rule \
clean   "iwi_monitor.fw"
 dev/iwm/if_iwm.c   optional iwm
+dev/iwm/if_iwm_7000.c  optional iwm
+dev/iwm/if_iwm_8000.c  optional iwm
 dev/iwm/if_iwm_binding.c   optional iwm
 dev/iwm/if_iwm_led.c   optional iwm
 dev/iwm/if_iwm_mac_ctxt.c  optional iwm

Modified: head/sys/dev/iwm/if_iwm.c
==
--- head/sys/dev/iwm/if_iwm.c   Wed Feb 22 04:35:07 2017(r314075)
+++ head/sys/dev/iwm/if_iwm.c   Wed Feb 22 04:35:53 2017(r314076)
@@ -152,6 +152,7 @@ __FBSDID("$FreeBSD$");
 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -166,68 +167,6 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 
-#define IWM_NVM_HW_SECTION_NUM_FAMILY_7000 0
-#define IWM_NVM_HW_SECTION_NUM_FAMILY_8000 10
-
-/* lower blocks contain EEPROM image and calibration data */
-#define IWM_OTP_LOW_IMAGE_SIZE_FAMILY_7000 (16 * 512 * sizeof(uint16_t)) 
/* 16 KB */
-#define IWM_OTP_LOW_IMAGE_SIZE_FAMILY_8000 (32 * 512 * sizeof(uint16_t)) 
/* 32 KB */
-
-#define IWM7260_FW "iwm7260fw"
-#define IWM3160_FW "iwm3160fw"
-#define IWM7265_FW "iwm7265fw"
-#define IWM7265D_FW"iwm7265Dfw"
-#define IWM8000_FW "iwm8000Cfw"
-
-#define IWM_DEVICE_7000_COMMON \
-   .device_family = IWM_DEVICE_FAMILY_7000,\
-   .eeprom_size = IWM_OTP_LOW_IMAGE_SIZE_FAMILY_7000,  \
-   .nvm_hw_section_num = IWM_NVM_HW_SECTION_NUM_FAMILY_7000,   \
-   .apmg_wake_up_wa = 1
-
-const struct iwm_cfg iwm7260_cfg = {
-   .fw_name = IWM7260_FW,
-   IWM_DEVICE_7000_COMMON,
-   .host_interrupt_operation_mode = 1,
-};
-
-const struct iwm_cfg iwm3160_cfg = {
-   .fw_name = IWM3160_FW,
-   IWM_DEVICE_7000_COMMON,
-   .host_interrupt_operation_mode = 1,
-};
-
-const struct iwm_cfg iwm3165_cfg = {
-   /* XXX IWM7265D_FW doesn't seem to work properly yet */
-   .fw_name = IWM7265_FW,
-   IWM_DEVICE_7000_COMMON,
-   .host_interrupt_operation_mode = 0,
-};
-
-const struct iwm_cfg iwm7265_cfg = {
-   .fw_name = IWM7265_FW,
-   IWM_DEVICE_7000_COMMON,
-   .host_interrupt_operation_mode = 0,
-};
-
-const struct iwm_cfg iwm7265d_cfg = {
-   /* XXX IWM7265D_FW doesn't seem to work properly yet */
-   .fw_name = IWM7265_FW,
-   IWM_DEVICE_7000_COMMON,
-   .host_interrupt_operation_mode = 0,
-};
-
-#define IWM_DEVICE_8000_COMMON \
-   .device_family = IWM_DEVICE_FAMILY_8000,\
-   .eeprom_size = IWM_OTP_LOW_IMAGE_SIZE_FAMILY_8000,  \
-   .nvm_hw_section_num = IWM_NVM_HW_SECTION_NUM_FAMILY_8000
-
-const struct iwm_cfg iwm8260_cfg = {
-   .fw_name = IWM8000_FW,
-   IWM_DEVICE_8000_COMMON,
-   .host_interrupt_operation_mode = 0,
-};
-
 const uint8_t iwm_nvm_channels[] = {
/* 2.4 GHz */
1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
@@ -5951,29 +5890,18 @@ iwm_intr(void *arg)
 
 static const struct iwm_devices {
uint16_tdevice;
-   const char  *name;
const struct iwm_cfg*cfg;
 } iwm_devices[] = {
-   { PCI_PRODUCT_INTEL_WL_3160_1, "Intel Dual Band Wireless AC 3160",
- _cfg },
-   { PCI_PRODUCT_INTEL_WL_3160_2, "Intel Dual Band Wireless AC 3160",
- _cfg },
-   { PCI_PRODUCT_INTEL_WL_3165_1, "Intel Dual Band Wireless AC 3165",
- _cfg },
-   { PCI_PRODUCT_INTEL_WL_3165_2, "Intel Dual Band Wireless AC 3165",
- _cfg },
-   { PCI_PRODUCT_INTEL_WL_7260_1, "Intel Dual Band Wireless AC 7260",
- _cfg },
-   { 

svn commit: r314075 - head/tests/sys/kern

2017-02-21 Thread Eric Badger
Author: badger
Date: Wed Feb 22 04:35:07 2017
New Revision: 314075
URL: https://svnweb.freebsd.org/changeset/base/314075

Log:
  Fix world build for archs where __builtin_debugtrap() does not work.
  
  The offending code was introduced in r313992.
  
  Reported by:  rpokala
  Approved by:  kib (mentor)

Modified:
  head/tests/sys/kern/ptrace_test.c

Modified: head/tests/sys/kern/ptrace_test.c
==
--- head/tests/sys/kern/ptrace_test.c   Wed Feb 22 04:28:10 2017
(r314074)
+++ head/tests/sys/kern/ptrace_test.c   Wed Feb 22 04:35:07 2017
(r314075)
@@ -37,6 +37,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -1690,7 +1691,7 @@ ATF_TC_BODY(ptrace__PT_KILL_breakpoint, 
ATF_REQUIRE((fpid = fork()) != -1);
if (fpid == 0) {
trace_me();
-   __builtin_debugtrap();
+   breakpoint();
exit(1);
}
 
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r314074 - head/sys/dev/iwm

2017-02-21 Thread Adrian Chadd
Author: adrian
Date: Wed Feb 22 04:28:10 2017
New Revision: 314074
URL: https://svnweb.freebsd.org/changeset/base/314074

Log:
  [iwm] Simplify device id matching code a bit.
  
  * Just add the struct iwm_cfg pointers to the iwm_devices array, to get
rid of the large switch clause.
  
  Obtained from:dragonflybsd.git 
35f0e6c86c1654323d6b19f7a077f4ab8ac85868

Modified:
  head/sys/dev/iwm/if_iwm.c

Modified: head/sys/dev/iwm/if_iwm.c
==
--- head/sys/dev/iwm/if_iwm.c   Wed Feb 22 04:27:07 2017(r314073)
+++ head/sys/dev/iwm/if_iwm.c   Wed Feb 22 04:28:10 2017(r314074)
@@ -5950,19 +5950,30 @@ iwm_intr(void *arg)
 #definePCI_PRODUCT_INTEL_WL_8260_2 0x24f4
 
 static const struct iwm_devices {
-   uint16_tdevice;
-   const char  *name;
+   uint16_tdevice;
+   const char  *name;
+   const struct iwm_cfg*cfg;
 } iwm_devices[] = {
-   { PCI_PRODUCT_INTEL_WL_3160_1, "Intel Dual Band Wireless AC 3160" },
-   { PCI_PRODUCT_INTEL_WL_3160_2, "Intel Dual Band Wireless AC 3160" },
-   { PCI_PRODUCT_INTEL_WL_3165_1, "Intel Dual Band Wireless AC 3165" },
-   { PCI_PRODUCT_INTEL_WL_3165_2, "Intel Dual Band Wireless AC 3165" },
-   { PCI_PRODUCT_INTEL_WL_7260_1, "Intel Dual Band Wireless AC 7260" },
-   { PCI_PRODUCT_INTEL_WL_7260_2, "Intel Dual Band Wireless AC 7260" },
-   { PCI_PRODUCT_INTEL_WL_7265_1, "Intel Dual Band Wireless AC 7265" },
-   { PCI_PRODUCT_INTEL_WL_7265_2, "Intel Dual Band Wireless AC 7265" },
-   { PCI_PRODUCT_INTEL_WL_8260_1, "Intel Dual Band Wireless AC 8260" },
-   { PCI_PRODUCT_INTEL_WL_8260_2, "Intel Dual Band Wireless AC 8260" },
+   { PCI_PRODUCT_INTEL_WL_3160_1, "Intel Dual Band Wireless AC 3160",
+ _cfg },
+   { PCI_PRODUCT_INTEL_WL_3160_2, "Intel Dual Band Wireless AC 3160",
+ _cfg },
+   { PCI_PRODUCT_INTEL_WL_3165_1, "Intel Dual Band Wireless AC 3165",
+ _cfg },
+   { PCI_PRODUCT_INTEL_WL_3165_2, "Intel Dual Band Wireless AC 3165",
+ _cfg },
+   { PCI_PRODUCT_INTEL_WL_7260_1, "Intel Dual Band Wireless AC 7260",
+ _cfg },
+   { PCI_PRODUCT_INTEL_WL_7260_2, "Intel Dual Band Wireless AC 7260",
+ _cfg },
+   { PCI_PRODUCT_INTEL_WL_7265_1, "Intel Dual Band Wireless AC 7265",
+ _cfg },
+   { PCI_PRODUCT_INTEL_WL_7265_2, "Intel Dual Band Wireless AC 7265",
+ _cfg },
+   { PCI_PRODUCT_INTEL_WL_8260_1, "Intel Dual Band Wireless AC 8260",
+ _cfg },
+   { PCI_PRODUCT_INTEL_WL_8260_2, "Intel Dual Band Wireless AC 8260",
+ _cfg },
 };
 
 static int
@@ -5985,34 +5996,20 @@ static int
 iwm_dev_check(device_t dev)
 {
struct iwm_softc *sc;
+   uint16_t devid;
+   int i;
 
sc = device_get_softc(dev);
 
-   switch (pci_get_device(dev)) {
-   case PCI_PRODUCT_INTEL_WL_3160_1:
-   case PCI_PRODUCT_INTEL_WL_3160_2:
-   sc->cfg = _cfg;
-   return (0);
-   case PCI_PRODUCT_INTEL_WL_3165_1:
-   case PCI_PRODUCT_INTEL_WL_3165_2:
-   sc->cfg = _cfg;
-   return (0);
-   case PCI_PRODUCT_INTEL_WL_7260_1:
-   case PCI_PRODUCT_INTEL_WL_7260_2:
-   sc->cfg = _cfg;
-   return (0);
-   case PCI_PRODUCT_INTEL_WL_7265_1:
-   case PCI_PRODUCT_INTEL_WL_7265_2:
-   sc->cfg = _cfg;
-   return (0);
-   case PCI_PRODUCT_INTEL_WL_8260_1:
-   case PCI_PRODUCT_INTEL_WL_8260_2:
-   sc->cfg = _cfg;
-   return (0);
-   default:
-   device_printf(dev, "unknown adapter type\n");
-   return ENXIO;
+   devid = pci_get_device(dev);
+   for (i = 0; i < nitems(iwm_devices); i++) {
+   if (iwm_devices[i].device == devid) {
+   sc->cfg = iwm_devices[i].cfg;
+   return (0);
+   }
}
+   device_printf(dev, "unknown adapter type\n");
+   return ENXIO;
 }
 
 /* PCI registers */
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r314073 - head/sys/dev/iwm

2017-02-21 Thread Adrian Chadd
Author: adrian
Date: Wed Feb 22 04:27:07 2017
New Revision: 314073
URL: https://svnweb.freebsd.org/changeset/base/314073

Log:
  [iwm] Remove OpenBSD-specific comment. Beautify pci cfg space accesses.
  
  Obtained from:dragonflybsd.git 
710fdd011c30a1bd9f53b87c843fb8907c4a6cfd

Modified:
  head/sys/dev/iwm/if_iwm.c

Modified: head/sys/dev/iwm/if_iwm.c
==
--- head/sys/dev/iwm/if_iwm.c   Wed Feb 22 04:15:39 2017(r314072)
+++ head/sys/dev/iwm/if_iwm.c   Wed Feb 22 04:27:07 2017(r314073)
@@ -3511,11 +3511,6 @@ iwm_mvm_rx_tx_cmd(struct iwm_softc *sc,
if (--ring->queued < IWM_TX_RING_LOMARK) {
sc->qfullmsk &= ~(1 << ring->qid);
if (sc->qfullmsk == 0) {
-   /*
-* Well, we're in interrupt context, but then again
-* I guess net80211 does all sorts of stunts in
-* interrupt context, so maybe this is no biggie.
-*/
iwm_start(sc);
}
}
@@ -6020,6 +6015,9 @@ iwm_dev_check(device_t dev)
}
 }
 
+/* PCI registers */
+#define PCI_CFG_RETRY_TIMEOUT  0x041
+
 static int
 iwm_pci_attach(device_t dev)
 {
@@ -6029,9 +6027,9 @@ iwm_pci_attach(device_t dev)
 
sc = device_get_softc(dev);
 
-   /* Clear device-specific "PCI retry timeout" register (41h). */
-   reg = pci_read_config(dev, 0x40, sizeof(reg));
-   pci_write_config(dev, 0x40, reg & ~0xff00, sizeof(reg));
+   /* We disable the RETRY_TIMEOUT register (0x41) to keep
+* PCI Tx retries from interfering with C3 CPU state */
+   pci_write_config(dev, PCI_CFG_RETRY_TIMEOUT, 0x00, 1);
 
/* Enable bus-mastering and hardware bug workaround. */
pci_enable_busmaster(dev);
@@ -6539,11 +6537,12 @@ iwm_resume(device_t dev)
 {
struct iwm_softc *sc = device_get_softc(dev);
int do_reinit = 0;
-   uint16_t reg;
 
-   /* Clear device-specific "PCI retry timeout" register (41h). */
-   reg = pci_read_config(dev, 0x40, sizeof(reg));
-   pci_write_config(dev, 0x40, reg & ~0xff00, sizeof(reg));
+   /*
+* We disable the RETRY_TIMEOUT register (0x41) to keep
+* PCI Tx retries from interfering with C3 CPU state.
+*/
+   pci_write_config(dev, PCI_CFG_RETRY_TIMEOUT, 0x00, 1);
iwm_init_task(device_get_softc(dev));
 
IWM_LOCK(sc);
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r314071 - head/sys/arm/ti

2017-02-21 Thread Ian Lepore
Author: ian
Date: Wed Feb 22 03:49:46 2017
New Revision: 314071
URL: https://svnweb.freebsd.org/changeset/base/314071

Log:
  Revert to this driver's historic behavior: assume an sd card is writable
  if the fdt data doesn't provide a gpio pin for reading the write protect
  switch and also doesn't contain a "wp-disable" property.
  
  In r311735 the long-bitrotted code in this driver for using the non-
  standard fdt "mmchs-wp-gpio-pin" property was replaced with new common
  support code for handling write-protect and card-detect gpio pins.  The
  old code never found a property with that name, and the logic was to
  assume that no gpio pin meant that the card was not write protected.
  
  The new common code behaves differently.  If there is no fdt data saying
  what to do about sensing write protect, the value in the standard SDHCI
  PRESENT_STATE register is used.  On this hardware, if there is no signal
  for write protect muxed into the sd controller then that bit in the
  register indicates write protect.
  
  The real problem here is the fdt data, which should contain "wp-disable"
  properties for eMMC and micro-sd slots where write protect is not even
  an option in the hardware, but we are not in control of that data, it
  comes from linux.  So we have to make the same flawed assumption in our
  driver that the corresponding linux driver has: no info means no protect.
  
  Reported by:  several users on the arm@ list
  Pointy hat:   me, for not testing enough before committing r311735

Modified:
  head/sys/arm/ti/ti_sdhci.c

Modified: head/sys/arm/ti/ti_sdhci.c
==
--- head/sys/arm/ti/ti_sdhci.c  Wed Feb 22 02:51:30 2017(r314070)
+++ head/sys/arm/ti/ti_sdhci.c  Wed Feb 22 03:49:46 2017(r314071)
@@ -75,6 +75,7 @@ struct ti_sdhci_softc {
uint32_tsdhci_clkdiv;
boolean_t   disable_highspeed;
boolean_t   force_card_present;
+   boolean_t   disable_readonly;
 };
 
 /*
@@ -363,6 +364,9 @@ ti_sdhci_get_ro(device_t brdev, device_t
 {
struct ti_sdhci_softc *sc = device_get_softc(brdev);
 
+   if (sc->disable_readonly)
+   return (0);
+
return (sdhci_fdt_gpio_get_readonly(sc->gpio));
 }
 
@@ -557,8 +561,21 @@ ti_sdhci_attach(device_t dev)
goto fail;
}
 
+   /*
+* Set up handling of card-detect and write-protect gpio lines.
+*
+* If there is no write protect info in the fdt data, fall back to the
+* historical practice of assuming that the card is writable.  This
+* works around bad fdt data from the upstream source.  The alternative
+* would be to trust the sdhci controller's PRESENT_STATE register WP
+* bit, but it may say write protect is in effect when it's not if the
+* pinmux setup doesn't route the WP signal into the sdchi block.
+*/
sc->gpio = sdhci_fdt_gpio_setup(sc->dev, >slot);
 
+   if (!OF_hasprop(node, "wp-gpios") && !OF_hasprop(node, "wp-disable"))
+   sc->disable_readonly = true;
+
/* Initialise the MMCHS hardware. */
ti_sdhci_hw_init(dev);
 
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r314070 - head/sys/dev/iwm

2017-02-21 Thread Adrian Chadd
Author: adrian
Date: Wed Feb 22 02:51:30 2017
New Revision: 314070
URL: https://svnweb.freebsd.org/changeset/base/314070

Log:
  [iwm] Fix typo in commit a7697ea01c11fd493aec52260a02f31df680eb91.
  
  * The sc->sc_uc.uc_error_event_table value is now at sc->error_event_table,
and not sc->umac_error_event_table.
  
  Obtained from:dragonflybsd.git 
612855b1a8c321ec9ba34f63edf913e7ecff8363

Modified:
  head/sys/dev/iwm/if_iwm.c

Modified: head/sys/dev/iwm/if_iwm.c
==
--- head/sys/dev/iwm/if_iwm.c   Wed Feb 22 02:49:57 2017(r314069)
+++ head/sys/dev/iwm/if_iwm.c   Wed Feb 22 02:51:30 2017(r314070)
@@ -5410,7 +5410,7 @@ iwm_nic_error(struct iwm_softc *sc)
uint32_t base;
 
device_printf(sc->sc_dev, "dumping device error log\n");
-   base = sc->umac_error_event_table;
+   base = sc->error_event_table;
if (base < 0x80) {
device_printf(sc->sc_dev,
"Invalid error log pointer 0x%08x\n", base);
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r314069 - head/sys/dev/iwm

2017-02-21 Thread Adrian Chadd
Author: adrian
Date: Wed Feb 22 02:49:57 2017
New Revision: 314069
URL: https://svnweb.freebsd.org/changeset/base/314069

Log:
  [iwm] Get rid of unneeded IWM_FWDMASEGSZ and IWM_FWMAXSIZE constants
  
  * We only need IWM_FH_MEM_TB_MAX_LENGTH bytes for the fw_dma memory.
  
  Obtained from:dragonflybsd.git 
f414b8da30816705e32573cc58097cacac34f161

Modified:
  head/sys/dev/iwm/if_iwm.c
  head/sys/dev/iwm/if_iwmvar.h

Modified: head/sys/dev/iwm/if_iwm.c
==
--- head/sys/dev/iwm/if_iwm.c   Wed Feb 22 02:35:59 2017(r314068)
+++ head/sys/dev/iwm/if_iwm.c   Wed Feb 22 02:49:57 2017(r314069)
@@ -1025,7 +1025,7 @@ iwm_alloc_fwmem(struct iwm_softc *sc)
 {
/* Must be aligned on a 16-byte boundary. */
return iwm_dma_contig_alloc(sc->sc_dmat, >fw_dma,
-   sc->sc_fwdmasegsz, 16);
+   IWM_FH_MEM_TB_MAX_LENGTH, 16);
 }
 
 /* tx scheduler rings.  not used? */
@@ -5997,27 +5997,22 @@ iwm_dev_check(device_t dev)
case PCI_PRODUCT_INTEL_WL_3160_1:
case PCI_PRODUCT_INTEL_WL_3160_2:
sc->cfg = _cfg;
-   sc->sc_fwdmasegsz = IWM_FWDMASEGSZ;
return (0);
case PCI_PRODUCT_INTEL_WL_3165_1:
case PCI_PRODUCT_INTEL_WL_3165_2:
sc->cfg = _cfg;
-   sc->sc_fwdmasegsz = IWM_FWDMASEGSZ;
return (0);
case PCI_PRODUCT_INTEL_WL_7260_1:
case PCI_PRODUCT_INTEL_WL_7260_2:
sc->cfg = _cfg;
-   sc->sc_fwdmasegsz = IWM_FWDMASEGSZ;
return (0);
case PCI_PRODUCT_INTEL_WL_7265_1:
case PCI_PRODUCT_INTEL_WL_7265_2:
sc->cfg = _cfg;
-   sc->sc_fwdmasegsz = IWM_FWDMASEGSZ;
return (0);
case PCI_PRODUCT_INTEL_WL_8260_1:
case PCI_PRODUCT_INTEL_WL_8260_2:
sc->cfg = _cfg;
-   sc->sc_fwdmasegsz = IWM_FWDMASEGSZ_8000;
return (0);
default:
device_printf(dev, "unknown adapter type\n");

Modified: head/sys/dev/iwm/if_iwmvar.h
==
--- head/sys/dev/iwm/if_iwmvar.hWed Feb 22 02:35:59 2017
(r314068)
+++ head/sys/dev/iwm/if_iwmvar.hWed Feb 22 02:49:57 2017
(r314069)
@@ -138,10 +138,6 @@ struct iwm_tx_radiotap_header {
 
 
 #define IWM_UCODE_SECTION_MAX 16
-#define IWM_FWDMASEGSZ (192*1024)
-#define IWM_FWDMASEGSZ_8000 (320*1024)
-/* sanity check value */
-#define IWM_FWMAXSIZE (2*1024*1024)
 
 /*
  * fw_status is used to determine if we've already parsed the firmware file
@@ -476,7 +472,6 @@ struct iwm_softc {
 */
int sc_generation;
 
-   bus_size_t  sc_fwdmasegsz;
struct iwm_fw_info  sc_fw;
struct iwm_tlv_calib_ctrl sc_default_calib[IWM_UCODE_TYPE_MAX];
 
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r314068 - in head/sys: amd64/amd64 boot/common boot/efi/libefi boot/fdt boot/ficl boot/kshim boot/ofw/libofw boot/sparc64/loader boot/userboot/userboot boot/zfs libkern mips/atheros/ar5...

2017-02-21 Thread Pedro F. Giffuni
Author: pfg
Date: Wed Feb 22 02:35:59 2017
New Revision: 314068
URL: https://svnweb.freebsd.org/changeset/base/314068

Log:
  sys: Replace zero with NULL for pointers.
  
  Found with:   devel/coccinelle
  MFC after:3 weeks
  Differential Revision:https://reviews.freebsd.org/D9694

Modified:
  head/sys/amd64/amd64/db_disasm.c
  head/sys/amd64/amd64/pmap.c
  head/sys/boot/common/md.c
  head/sys/boot/efi/libefi/efinet.c
  head/sys/boot/fdt/fdt_overlay.c
  head/sys/boot/ficl/ficl.c
  head/sys/boot/kshim/bsd_kernel.c
  head/sys/boot/ofw/libofw/ofw_memory.c
  head/sys/boot/sparc64/loader/main.c
  head/sys/boot/userboot/userboot/userboot_disk.c
  head/sys/boot/zfs/zfs.c
  head/sys/boot/zfs/zfsimpl.c
  head/sys/libkern/iconv_xlat16.c
  head/sys/mips/atheros/ar531x/apb.c
  head/sys/net/if_fddisubr.c
  head/sys/net/if_iso88025subr.c
  head/sys/net/iflib.c
  head/sys/netpfil/ipfw/ip_fw_sockopt.c

Modified: head/sys/amd64/amd64/db_disasm.c
==
--- head/sys/amd64/amd64/db_disasm.cWed Feb 22 02:24:42 2017
(r314067)
+++ head/sys/amd64/amd64/db_disasm.cWed Feb 22 02:35:59 2017
(r314068)
@@ -1044,7 +1044,7 @@ db_read_address(loc, short_addr, rex, re
return (loc);
}
addrp->is_reg = FALSE;
-   addrp->index = 0;
+   addrp->index = NULL;
 
if (short_addr)
size = LONG;
@@ -1067,7 +1067,7 @@ db_read_address(loc, short_addr, rex, re
if (rm == 5) {
get_value_inc(addrp->disp, loc, 4, FALSE);
if (have_sib)
-   addrp->base = 0;
+   addrp->base = NULL;
else if (short_addr)
addrp->base = "%eip";
else
@@ -1109,9 +1109,9 @@ db_print_address(seg, size, rex, addrp)
db_printf("%s:", seg);
}
 
-   if (addrp->disp != 0 || (addrp->base == 0 && addrp->index == 0))
+   if (addrp->disp != 0 || (addrp->base == NULL && addrp->index == NULL))
db_printsym((db_addr_t)addrp->disp, DB_STGY_ANY);
-   if (addrp->base != 0 || addrp->index != 0) {
+   if (addrp->base != NULL || addrp->index != NULL) {
db_printf("(");
if (addrp->base)
db_printf("%s", addrp->base);
@@ -1248,7 +1248,7 @@ db_disasm(db_addr_t loc, bool altfmt)
get_value_inc(inst, loc, 1, FALSE);
short_addr = FALSE;
size = LONG;
-   seg = 0;
+   seg = NULL;
 
/*
 * Get prefixes
@@ -1313,7 +1313,7 @@ db_disasm(db_addr_t loc, bool altfmt)
while (ip->i_size == ESC) {
get_value_inc(inst, loc, 1, FALSE);
ip = ((const struct inst * const *)ip->i_extra)[inst>>4];
-   if (ip == 0) {
+   if (ip == NULL) {
ip = _bad_inst;
}
else {

Modified: head/sys/amd64/amd64/pmap.c
==
--- head/sys/amd64/amd64/pmap.c Wed Feb 22 02:24:42 2017(r314067)
+++ head/sys/amd64/amd64/pmap.c Wed Feb 22 02:35:59 2017(r314068)
@@ -391,7 +391,7 @@ static struct md_page pv_dummy;
 /*
  * All those kernel PT submaps that BSD is so fond of
  */
-pt_entry_t *CMAP1 = 0;
+pt_entry_t *CMAP1 = NULL;
 caddr_t CADDR1 = 0;
 static vm_offset_t qframe = 0;
 static struct mtx qframe_mtx;

Modified: head/sys/boot/common/md.c
==
--- head/sys/boot/common/md.c   Wed Feb 22 02:24:42 2017(r314067)
+++ head/sys/boot/common/md.c   Wed Feb 22 02:35:59 2017(r314068)
@@ -103,7 +103,7 @@ md_strategy(void *devdata, int rw, daddr
if ((ofs + size) > MD_IMAGE_SIZE)
size = MD_IMAGE_SIZE - ofs;
 
-   if (rsize != 0)
+   if (rsize != NULL)
*rsize = size;
 
switch (rw) {

Modified: head/sys/boot/efi/libefi/efinet.c
==
--- head/sys/boot/efi/libefi/efinet.c   Wed Feb 22 02:24:42 2017
(r314067)
+++ head/sys/boot/efi/libefi/efinet.c   Wed Feb 22 02:35:59 2017
(r314068)
@@ -131,13 +131,13 @@ efinet_put(struct iodesc *desc, void *pk
 
/* Wait for the buffer to be transmitted */
do {
-   buf = 0;/* XXX Is this needed? */
+   buf = NULL; /* XXX Is this needed? */
status = net->GetStatus(net, 0, );
/*
 * XXX EFI1.1 and the E1000 card returns a different 
 * address than we gave.  Sigh.
 */
-   } while (status == EFI_SUCCESS && buf == 0);
+   } while (status == EFI_SUCCESS && buf == NULL);
 
/* XXX How do we deal with status != EFI_SUCCESS now? */
return ((status == EFI_SUCCESS) ? len : -1);

Modified: head/sys/boot/fdt/fdt_overlay.c

svn commit: r314067 - head/sys/dev/iwm

2017-02-21 Thread Adrian Chadd
Author: adrian
Date: Wed Feb 22 02:24:42 2017
New Revision: 314067
URL: https://svnweb.freebsd.org/changeset/base/314067

Log:
  [iwm] With the previous commits, this DELAY no longer seems to be needed.
  
  Obtained from:dragonflybsd.git 
516272d3d02c821ace16a91cfdeb28540ac74ecc

Modified:
  head/sys/dev/iwm/if_iwm.c

Modified: head/sys/dev/iwm/if_iwm.c
==
--- head/sys/dev/iwm/if_iwm.c   Wed Feb 22 02:23:14 2017(r314066)
+++ head/sys/dev/iwm/if_iwm.c   Wed Feb 22 02:24:42 2017(r314067)
@@ -2602,11 +2602,6 @@ iwm_pcie_load_cpu_sections_8000(struct i
IWM_WRITE(sc, IWM_FH_UCODE_LOAD_STATUS, val);
sec_num = (sec_num << 1) | 0x1;
iwm_nic_unlock(sc);
-
-   /*
-* The firmware won't load correctly without this delay.
-*/
-   DELAY(8000);
}
}
 
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r314066 - head/sys/dev/iwm

2017-02-21 Thread Adrian Chadd
Author: adrian
Date: Wed Feb 22 02:23:14 2017
New Revision: 314066
URL: https://svnweb.freebsd.org/changeset/base/314066

Log:
  [iwm] Sync IWM_MVM_ALIVE waiting and start_fw handling with iwlwifi.
  
  * Use the notification wait API, like it's done in the Linux iwlwifi code,
to wait for the IWM_MVM_ALIVE notification.
  
  * This also should fix some firmware load interrupt issues, and errors
in the nic lock using.
  
  Tested:
  
  * (adrian) Intel 7260, STA mode
  
  Obtained from:dragonflybsd.git 
a7697ea01c11fd493aec52260a02f31df680eb91

Modified:
  head/sys/dev/iwm/if_iwm.c
  head/sys/dev/iwm/if_iwmreg.h
  head/sys/dev/iwm/if_iwmvar.h

Modified: head/sys/dev/iwm/if_iwm.c
==
--- head/sys/dev/iwm/if_iwm.c   Wed Feb 22 02:18:04 2017(r314065)
+++ head/sys/dev/iwm/if_iwm.c   Wed Feb 22 02:23:14 2017(r314066)
@@ -285,8 +285,14 @@ struct iwm_nvm_section {
uint8_t *data;
 };
 
+#define IWM_MVM_UCODE_ALIVE_TIMEOUThz
 #define IWM_MVM_UCODE_CALIB_TIMEOUT(2*hz)
 
+struct iwm_mvm_alive_data {
+   int valid;
+   uint32_t scd_base_addr;
+};
+
 static int iwm_store_cscheme(struct iwm_softc *, const uint8_t *, size_t);
 static int iwm_firmware_store_section(struct iwm_softc *,
enum iwm_ucode_type,
@@ -320,7 +326,7 @@ static int  iwm_nic_rx_init(struct iwm_so
 static int iwm_nic_tx_init(struct iwm_softc *);
 static int iwm_nic_init(struct iwm_softc *);
 static int iwm_enable_txq(struct iwm_softc *, int, int, int);
-static int iwm_post_alive(struct iwm_softc *);
+static int iwm_trans_pcie_fw_alive(struct iwm_softc *, uint32_t);
 static int iwm_nvm_read_chunk(struct iwm_softc *, uint16_t, uint16_t,
uint16_t, uint8_t *, uint16_t *);
 static int iwm_nvm_read_section(struct iwm_softc *, uint16_t, uint8_t *,
@@ -367,7 +373,7 @@ static int  iwm_pcie_load_given_ucode_800
   const struct iwm_fw_sects *);
 static int iwm_pcie_load_given_ucode(struct iwm_softc *,
  const struct iwm_fw_sects *);
-static int iwm_start_fw(struct iwm_softc *, enum iwm_ucode_type);
+static int iwm_start_fw(struct iwm_softc *, const struct iwm_fw_sects *);
 static int iwm_send_tx_ant_cfg(struct iwm_softc *, uint8_t);
 static int iwm_send_phy_cfg_cmd(struct iwm_softc *);
 static int iwm_mvm_load_ucode_wait_alive(struct iwm_softc *,
@@ -1633,20 +1639,33 @@ iwm_enable_txq(struct iwm_softc *sc, int
(0 << IWM_SCD_QUEUE_STTS_REG_POS_ACTIVE)
| (1 << IWM_SCD_QUEUE_STTS_REG_POS_SCD_ACT_EN));
 
+   iwm_nic_unlock(sc);
+
iwm_clear_bits_prph(sc, IWM_SCD_AGGR_SEL, (1 << qid));
 
+   if (!iwm_nic_lock(sc)) {
+   device_printf(sc->sc_dev,
+   "%s: cannot enable txq %d\n", __func__, qid);
+   return EBUSY;
+   }
iwm_write_prph(sc, IWM_SCD_QUEUE_RDPTR(qid), 0);
+   iwm_nic_unlock(sc);
 
-   iwm_write_mem32(sc, sc->sched_base + 
IWM_SCD_CONTEXT_QUEUE_OFFSET(qid), 0);
+   iwm_write_mem32(sc, sc->scd_base_addr + 
IWM_SCD_CONTEXT_QUEUE_OFFSET(qid), 0);
/* Set scheduler window size and frame limit. */
iwm_write_mem32(sc,
-   sc->sched_base + IWM_SCD_CONTEXT_QUEUE_OFFSET(qid) +
+   sc->scd_base_addr + IWM_SCD_CONTEXT_QUEUE_OFFSET(qid) +
sizeof(uint32_t),
((IWM_FRAME_LIMIT << IWM_SCD_QUEUE_CTX_REG2_WIN_SIZE_POS) &
IWM_SCD_QUEUE_CTX_REG2_WIN_SIZE_MSK) |
((IWM_FRAME_LIMIT << 
IWM_SCD_QUEUE_CTX_REG2_FRAME_LIMIT_POS) &
IWM_SCD_QUEUE_CTX_REG2_FRAME_LIMIT_MSK));
 
+   if (!iwm_nic_lock(sc)) {
+   device_printf(sc->sc_dev,
+   "%s: cannot enable txq %d\n", __func__, qid);
+   return EBUSY;
+   }
iwm_write_prph(sc, IWM_SCD_QUEUE_STATUS_BITS(qid),
(1 << IWM_SCD_QUEUE_STTS_REG_POS_ACTIVE) |
(fifo << IWM_SCD_QUEUE_STTS_REG_POS_TXF) |
@@ -1690,33 +1709,37 @@ iwm_enable_txq(struct iwm_softc *sc, int
 }
 
 static int
-iwm_post_alive(struct iwm_softc *sc)
+iwm_trans_pcie_fw_alive(struct iwm_softc *sc, uint32_t scd_base_addr)
 {
-   int nwords;
int error, chnl;
-   uint32_t base;
+
+   int clear_dwords = (IWM_SCD_TRANS_TBL_MEM_UPPER_BOUND -
+   IWM_SCD_CONTEXT_MEM_LOWER_BOUND) / sizeof(uint32_t);
 
if (!iwm_nic_lock(sc))
return EBUSY;
 
-   base = iwm_read_prph(sc, IWM_SCD_SRAM_BASE_ADDR);
-   if (sc->sched_base != base) {
+   iwm_ict_reset(sc);
+
+   

svn commit: r314065 - head/sys/dev/iwm

2017-02-21 Thread Adrian Chadd
Author: adrian
Date: Wed Feb 22 02:18:04 2017
New Revision: 314065
URL: https://svnweb.freebsd.org/changeset/base/314065

Log:
  [iwm] Synchronize firmware loading code with Linux iwlwifi.
  
  * While there, rename some functions to match the names and functionality
of the similarly named functions in Linux iwlwifi.
  
  Obtained from:dragonflybsd.git 
e98ee77a816bfd8b4912047b93dfb2c560788f24

Modified:
  head/sys/dev/iwm/if_iwm.c
  head/sys/dev/iwm/if_iwmvar.h

Modified: head/sys/dev/iwm/if_iwm.c
==
--- head/sys/dev/iwm/if_iwm.c   Wed Feb 22 01:07:04 2017(r314064)
+++ head/sys/dev/iwm/if_iwm.c   Wed Feb 22 02:18:04 2017(r314065)
@@ -353,15 +353,20 @@ static void   iwm_set_radio_cfg(const stru
 static struct iwm_nvm_data *
iwm_parse_nvm_sections(struct iwm_softc *, struct iwm_nvm_section *);
 static int iwm_nvm_init(struct iwm_softc *);
-static int iwm_firmware_load_sect(struct iwm_softc *, uint32_t,
-   const uint8_t *, uint32_t);
-static int iwm_firmware_load_chunk(struct iwm_softc *, uint32_t,
-const uint8_t *, uint32_t);
-static int iwm_load_firmware_7000(struct iwm_softc *, enum iwm_ucode_type);
-static int iwm_load_cpu_sections_8000(struct iwm_softc *,
-  struct iwm_fw_sects *, int , int *);
-static int iwm_load_firmware_8000(struct iwm_softc *, enum iwm_ucode_type);
-static int iwm_load_firmware(struct iwm_softc *, enum iwm_ucode_type);
+static int iwm_pcie_load_section(struct iwm_softc *, uint8_t,
+ const struct iwm_fw_desc *);
+static int iwm_pcie_load_firmware_chunk(struct iwm_softc *, uint32_t,
+bus_addr_t, uint32_t);
+static int iwm_pcie_load_cpu_sections_8000(struct iwm_softc *sc,
+   const struct iwm_fw_sects *,
+   int, int *);
+static int iwm_pcie_load_cpu_sections(struct iwm_softc *,
+  const struct iwm_fw_sects *,
+  int, int *);
+static int iwm_pcie_load_given_ucode_8000(struct iwm_softc *,
+  const struct iwm_fw_sects *);
+static int iwm_pcie_load_given_ucode(struct iwm_softc *,
+ const struct iwm_fw_sects *);
 static int iwm_start_fw(struct iwm_softc *, enum iwm_ucode_type);
 static int iwm_send_tx_ant_cfg(struct iwm_softc *, uint8_t);
 static int iwm_send_phy_cfg_cmd(struct iwm_softc *);
@@ -485,7 +490,7 @@ iwm_firmware_store_section(struct iwm_so
 enum iwm_ucode_type type, const uint8_t *data, size_t dlen)
 {
struct iwm_fw_sects *fws;
-   struct iwm_fw_onesect *fwone;
+   struct iwm_fw_desc *fwone;
 
if (type >= IWM_UCODE_TYPE_MAX)
return EINVAL;
@@ -499,11 +504,11 @@ iwm_firmware_store_section(struct iwm_so
fwone = >fw_sect[fws->fw_count];
 
/* first 32bit are device load offset */
-   memcpy(>fws_devoff, data, sizeof(uint32_t));
+   memcpy(>offset, data, sizeof(uint32_t));
 
/* rest is data */
-   fwone->fws_data = data + sizeof(uint32_t);
-   fwone->fws_len = dlen - sizeof(uint32_t);
+   fwone->data = data + sizeof(uint32_t);
+   fwone->len = dlen - sizeof(uint32_t);
 
fws->fw_count++;
 
@@ -559,6 +564,7 @@ iwm_read_firmware(struct iwm_softc *sc, 
const uint8_t *data;
uint32_t usniffer_img;
uint32_t paging_mem_size;
+   int num_of_cpus;
int error = 0;
size_t len;
 
@@ -699,18 +705,24 @@ iwm_read_firmware(struct iwm_softc *sc, 
goto parse_out;
}
break;
-   case IWM_UCODE_TLV_NUM_OF_CPU: {
-   uint32_t num_cpu;
+   case IWM_UCODE_TLV_NUM_OF_CPU:
if (tlv_len != sizeof(uint32_t)) {
device_printf(sc->sc_dev,
-   "%s: IWM_UCODE_TLV_NUM_OF_CPU: tlv_len (%d) 
< sizeof(uint32_t)\n",
+   "%s: IWM_UCODE_TLV_NUM_OF_CPU: tlv_len (%d) 
!= sizeof(uint32_t)\n",
__func__,
(int) tlv_len);
error = EINVAL;
goto parse_out;
}
-   num_cpu = le32toh(*(const uint32_t *)tlv_data);
-   if (num_cpu < 1 || num_cpu > 2) {
+   num_of_cpus = le32toh(*(const uint32_t *)tlv_data);
+   if (num_of_cpus == 2) {
+   

svn commit: r314064 - head/sys/arm/ti

2017-02-21 Thread Ian Lepore
Author: ian
Date: Wed Feb 22 01:07:04 2017
New Revision: 314064
URL: https://svnweb.freebsd.org/changeset/base/314064

Log:
  Remove a variable that has been unused since r311735 (it should have been
  removed as part of those changes).

Modified:
  head/sys/arm/ti/ti_sdhci.c

Modified: head/sys/arm/ti/ti_sdhci.c
==
--- head/sys/arm/ti/ti_sdhci.c  Wed Feb 22 00:50:36 2017(r314063)
+++ head/sys/arm/ti/ti_sdhci.c  Wed Feb 22 01:07:04 2017(r314064)
@@ -71,7 +71,6 @@ struct ti_sdhci_softc {
uint32_tmmchs_reg_off;
uint32_tsdhci_reg_off;
uint32_tbaseclk_hz;
-   uint32_twp_gpio_pin;
uint32_tcmd_and_mode;
uint32_tsdhci_clkdiv;
boolean_t   disable_highspeed;
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r313992 - in head: sys/kern sys/sys tests/sys/kern

2017-02-21 Thread Ravi Pokala
Hi Eric,

This appears to break buildworld for a bunch of platforms -- possibly all the 
ones that use gcc rather than clang?

A representative example from sparc64:

/usr/home/rpokala/freebsd/clean/base/head/tests/sys/kern/ptrace_test.c: In 
function 'atfu_ptrace__PT_KILL_breakpoint_body':

/usr/home/rpokala/freebsd/clean/base/head/tests/sys/kern/ptrace_test.c:1693: 
warning: implicit declaration of function '__builtin_debugtrap'
*** [ptrace_test.o] Error code 1

Thanks,

Ravi (rpokala@)

-Original Message-
From:  on behalf of Eric Badger 

Date: 2017-02-20, Monday at 07:53
To: , , 

Subject: svn commit: r313992 - in head: sys/kern sys/sys tests/sys/kern

Author: badger
Date: Mon Feb 20 15:53:16 2017
New Revision: 313992
URL: https://svnweb.freebsd.org/changeset/base/313992

Log:
  Defer ptracestop() signals that cannot be delivered immediately
  
  When a thread is stopped in ptracestop(), the ptrace(2) user may request
  a signal be delivered upon resumption of the thread. Heretofore, those signals
  were discarded unless ptracestop()'s caller was issignal(). Fix this by
  modifying ptracestop() to queue up signals requested by the ptrace user that
  will be delivered when possible. Take special care when the signal is SIGKILL
  (usually generated from a PT_KILL request); no new stop events should be
  triggered after a PT_KILL.
  
  Add a number of tests for the new functionality. Several tests were authored
  by jhb.
  
  PR:   212607
  Reviewed by:  kib
  Approved by:  kib (mentor)
  MFC after:2 weeks
  Sponsored by: Dell EMC
  In collaboration with:jhb
  Differential Revision:https://reviews.freebsd.org/D9260

Modified:
  head/sys/kern/kern_fork.c
  head/sys/kern/kern_sig.c
  head/sys/kern/kern_thr.c
  head/sys/kern/subr_syscall.c
  head/sys/kern/sys_process.c
  head/sys/sys/signalvar.h
  head/tests/sys/kern/Makefile
  head/tests/sys/kern/ptrace_test.c

Modified: head/sys/kern/kern_fork.c
==
--- head/sys/kern/kern_fork.c   Mon Feb 20 10:51:46 2017(r313991)
+++ head/sys/kern/kern_fork.c   Mon Feb 20 15:53:16 2017(r313992)
@@ -1081,7 +1081,7 @@ fork_return(struct thread *td, struct tr
proc_reparent(p, dbg);
sx_xunlock(_lock);
td->td_dbgflags |= TDB_CHILD | TDB_SCX | TDB_FSTP;
-   ptracestop(td, SIGSTOP);
+   ptracestop(td, SIGSTOP, NULL);
td->td_dbgflags &= ~(TDB_CHILD | TDB_SCX);
} else {
/*
@@ -1102,7 +1102,7 @@ fork_return(struct thread *td, struct tr
_STOPEVENT(p, S_SCX, td->td_dbg_sc_code);
if ((p->p_ptevents & PTRACE_SCX) != 0 ||
(td->td_dbgflags & TDB_BORN) != 0)
-   ptracestop(td, SIGTRAP);
+   ptracestop(td, SIGTRAP, NULL);
td->td_dbgflags &= ~(TDB_SCX | TDB_BORN);
PROC_UNLOCK(p);
}

Modified: head/sys/kern/kern_sig.c
==
--- head/sys/kern/kern_sig.cMon Feb 20 10:51:46 2017(r313991)
+++ head/sys/kern/kern_sig.cMon Feb 20 15:53:16 2017(r313992)
@@ -278,6 +278,7 @@ sigqueue_init(sigqueue_t *list, struct p
 {
SIGEMPTYSET(list->sq_signals);
SIGEMPTYSET(list->sq_kill);
+   SIGEMPTYSET(list->sq_ptrace);
TAILQ_INIT(>sq_list);
list->sq_proc = p;
list->sq_flags = SQ_INIT;
@@ -301,9 +302,15 @@ sigqueue_get(sigqueue_t *sq, int signo, 
if (!SIGISMEMBER(sq->sq_signals, signo))
return (0);
 
+   if (SIGISMEMBER(sq->sq_ptrace, signo)) {
+   count++;
+   SIGDELSET(sq->sq_ptrace, signo);
+   si->ksi_flags |= KSI_PTRACE;
+   }
if (SIGISMEMBER(sq->sq_kill, signo)) {
count++;
-   SIGDELSET(sq->sq_kill, signo);
+   if (count == 1)
+   SIGDELSET(sq->sq_kill, signo);
}
 
TAILQ_FOREACH_SAFE(ksi, >sq_list, ksi_link, next) {
@@ -347,7 +354,8 @@ sigqueue_take(ksiginfo_t *ksi)
if (kp->ksi_signo == ksi->ksi_signo)
break;
}
-   if (kp == NULL && !SIGISMEMBER(sq->sq_kill, ksi->ksi_signo))
+   if (kp == NULL && !SIGISMEMBER(sq->sq_kill, ksi->ksi_signo) &&
+   !SIGISMEMBER(sq->sq_ptrace, ksi->ksi_signo))
SIGDELSET(sq->sq_signals, ksi->ksi_signo);
 }
 
@@ -360,6 +368,10 @@ sigqueue_add(sigqueue_t *sq, int signo, 
 
KASSERT(sq->sq_flags & SQ_INIT, ("sigqueue not inited"));
 
+   /*
+* SIGKILL/SIGSTOP cannot be caught or masked, so take the fast path
+* for 

svn commit: r314062 - head/sys/dev/qlxgbe

2017-02-21 Thread David C Somayajulu
Author: davidcs
Date: Tue Feb 21 23:32:27 2017
New Revision: 314062
URL: https://svnweb.freebsd.org/changeset/base/314062

Log:
  add bus_dmamap_unload in ql_free_dmabuf()
  
  MFC after:5 days

Modified:
  head/sys/dev/qlxgbe/ql_os.c

Modified: head/sys/dev/qlxgbe/ql_os.c
==
--- head/sys/dev/qlxgbe/ql_os.c Tue Feb 21 21:48:45 2017(r314061)
+++ head/sys/dev/qlxgbe/ql_os.c Tue Feb 21 23:32:27 2017(r314062)
@@ -735,6 +735,7 @@ ql_alloc_dmabuf_exit:
 void
 ql_free_dmabuf(qla_host_t *ha, qla_dma_t *dma_buf)
 {
+   bus_dmamap_unload(dma_buf->dma_tag, dma_buf->dma_map); 
 bus_dmamem_free(dma_buf->dma_tag, dma_buf->dma_b, dma_buf->dma_map);
 bus_dma_tag_destroy(dma_buf->dma_tag);
 }
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r314043 - in head/sys: compat/linuxkpi/common/include/linux compat/linuxkpi/common/src conf modules/linuxkpi

2017-02-21 Thread Adrian Chadd
Hiya,

My understanding of tasklets is that they run on the CPU that they
were scheduled on, rather than there being a single tasklet thread?

Is that the direction you're thinking of heading in, or?



-adrian
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r314061 - head/lib/libcxxrt

2017-02-21 Thread Dimitry Andric
Author: dim
Date: Tue Feb 21 21:48:45 2017
New Revision: 314061
URL: https://svnweb.freebsd.org/changeset/base/314061

Log:
  Add __int128-related symbols to libcxxrt's version map.  Put these into
  the same CXXABI verions as recent libstdc++.
  
  Note that __int128 types are only available on arches where long long is
  128 bit wide.
  
  Noticed by:   harti
  MFC after:2 weeks

Modified:
  head/lib/libcxxrt/Version.map

Modified: head/lib/libcxxrt/Version.map
==
--- head/lib/libcxxrt/Version.map   Tue Feb 21 21:21:58 2017
(r314060)
+++ head/lib/libcxxrt/Version.map   Tue Feb 21 21:48:45 2017
(r314061)
@@ -254,10 +254,27 @@ CXXABI_1.3.1 {
 __cxa_get_exception_ptr;
 } CXXABI_1.3;
 
+CXXABI_1.3.5 {
+"typeinfo for __int128 const*";
+"typeinfo for __int128";
+"typeinfo for __int128*";
+"typeinfo for unsigned __int128 const*";
+"typeinfo for unsigned __int128";
+"typeinfo for unsigned __int128*";
+} CXXABI_1.3.1;
+
 CXXABI_1.3.6 {
 __cxa_deleted_virtual;
-} CXXABI_1.3.1;
+} CXXABI_1.3.5;
 
+CXXABI_1.3.9 {
+"typeinfo name for __int128 const*";
+"typeinfo name for __int128";
+"typeinfo name for __int128*";
+"typeinfo name for unsigned __int128 const*";
+"typeinfo name for unsigned __int128";
+"typeinfo name for unsigned __int128*";
+} CXXABI_1.3.6;
 
 CXXRT_1.0 {
 
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r313982 - in head/sys/dev: agp al_eth an arcmsr bce beri/virtio bhnd/cores/usb buslogic ce cm cp ctau cx de ed fatm fe firewire hptiop hptmv iicbus isp le md ncr netmap ofw patm pccard

2017-02-21 Thread Piotr P. Stefaniak

On 2017-02-21 21:59:47, Piotr P. Stefaniak wrote:

$ tcc -Wt,f ./test.c -o test


Oops, of course it's "-Wt,-f". 


signature.asc
Description: PGP signature


Re: svn commit: r313850 - in head/sys/cddl/dev/dtrace: amd64 i386

2017-02-21 Thread Mark Johnston
On Fri, Feb 17, 2017 at 05:05:54PM +1100, Bruce Evans wrote:
> On Fri, 17 Feb 2017, Mark Johnston wrote:
> 
> > Log:
> >  Directly include needed headers rather than relying on pollution.
> >
> >  We get machine/cpu.h via kmem.h -> proc.h -> _vm_domain.h -> seq.h.
> 
> machine/cpu.h is not added here.  Do you mean machine/cpufnc.h?
> 
> > Modified: head/sys/cddl/dev/dtrace/amd64/dtrace_subr.c
> > ==
> > --- head/sys/cddl/dev/dtrace/amd64/dtrace_subr.cFri Feb 17 00:50:00 
> > 2017(r313849)
> > +++ head/sys/cddl/dev/dtrace/amd64/dtrace_subr.cFri Feb 17 03:27:20 
> > 2017(r313850)
> > @@ -41,7 +41,9 @@
> > #include 
> > #include 
> > #include 
> > +#include 
> 
> This was correct.   is standard pollution in ,
> and it is a style bug to include it directly, and a bug to not include
>  after  and before all other headers in kernel
> .c files.
> 
> It is pollution to include  in any header except
> .  kmem.h has grosser pollution (param, proc, malloc, vmem,
> vm/uma, vm/vm, vm/vm_extern, but not systm which is a prerequisite for
> most of the other headers that kmem.h includes).  Most of the other headers
> also have gross pollution, ending with seq.h which includes systm.h and
> its standard pollution.
> 
> seq.h also includes machine/cpu.h.  Apparently kmem.h does depend on this,
> and this commit doesn't fix it.

This commit was intended to address an issue with r313841, which added a
"KASSERT((read_rflags() & PSL_I) == 0, ...);" to dtrace_subr.c. That
change fails to compile when ported to a kernel that predates seq.h;
it's only because we include kmem.h and thus seq.h that r313841 compiles
on HEAD - kmem.h itself doesn't depend on cpufunc.h as far as I know.

> 
> > #include 
> > +#include 
> 
> This include is not mentioned in the log message.
> 
> machine/psl.h is stamdard pollution in machine/cpu.h (on at least amd64 and
> i386), so would not be needed here if machine/cpu.h had been spelled
> correctly.

Sorry, my commit log message wasn't very good. psl.h is needed for the
definition of PSL_I. I take it then that the diff below is the correct
fix, since sys/systm.h isn't sufficient.

diff --git a/sys/cddl/dev/dtrace/amd64/dtrace_subr.c 
b/sys/cddl/dev/dtrace/amd64/dtrace_subr.c
index 717f4557a64d..e180f4d0a57c 100644
--- a/sys/cddl/dev/dtrace/amd64/dtrace_subr.c
+++ b/sys/cddl/dev/dtrace/amd64/dtrace_subr.c
@@ -41,9 +41,8 @@
 #include 
 #include 
 #include 
-#include 
+#include 
 #include 
-#include 
 #include 
 
 extern void dtrace_getnanotime(struct timespec *tsp);
diff --git a/sys/cddl/dev/dtrace/i386/dtrace_subr.c 
b/sys/cddl/dev/dtrace/i386/dtrace_subr.c
index 3801c1ba772c..c266f27bbd52 100644
--- a/sys/cddl/dev/dtrace/i386/dtrace_subr.c
+++ b/sys/cddl/dev/dtrace/i386/dtrace_subr.c
@@ -42,9 +42,8 @@
 #include 
 #include 
 #include 
-#include 
+#include 
 #include 
-#include 
 #include 
 
 extern uintptr_t   kernelbase;
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r314060 - head/sys/dev/sdhci

2017-02-21 Thread Ian Lepore
Author: ian
Date: Tue Feb 21 21:21:58 2017
New Revision: 314060
URL: https://svnweb.freebsd.org/changeset/base/314060

Log:
  Fix typos in bootverbose printfs... display the write-protect pin info,
  not the card-detect pin info.

Modified:
  head/sys/dev/sdhci/sdhci_fdt_gpio.c

Modified: head/sys/dev/sdhci/sdhci_fdt_gpio.c
==
--- head/sys/dev/sdhci/sdhci_fdt_gpio.c Tue Feb 21 21:11:58 2017
(r314059)
+++ head/sys/dev/sdhci/sdhci_fdt_gpio.c Tue Feb 21 21:21:58 2017
(r314060)
@@ -192,7 +192,7 @@ wp_setup(struct sdhci_fdt_gpio *gpio, ph
 
if (bootverbose)
device_printf(dev, "Write protect switch on %s pin %u\n",
-   device_get_nameunit(gpio->cd_pin->dev), gpio->cd_pin->pin);
+   device_get_nameunit(gpio->wp_pin->dev), gpio->wp_pin->pin);
 }
 
 struct sdhci_fdt_gpio *
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r314059 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs

2017-02-21 Thread Andriy Gapon
Author: avg
Date: Tue Feb 21 21:11:58 2017
New Revision: 314059
URL: https://svnweb.freebsd.org/changeset/base/314059

Log:
  zfs: move zio_taskq_basedc under SYSDC
  
  That knob is useless without SDC (or alike) scheduling class support.
  That is, it's unused on FreeBSD.
  
  MFC after:4 days

Modified:
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c
==
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c   Tue Feb 21 
21:09:21 2017(r314058)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c   Tue Feb 21 
21:11:58 2017(r314059)
@@ -168,8 +168,8 @@ id_tzio_taskq_psrset_bind = PS_NONE;
 #endif
 #ifdef SYSDC
 boolean_t  zio_taskq_sysdc = B_TRUE;   /* use SDC scheduling class */
-#endif
 uint_t zio_taskq_basedc = 80;  /* base duty cycle */
+#endif
 
 boolean_t  spa_create_process = B_TRUE;/* no process ==> no sysdc */
 extern int zfs_sync_pass_deferred_free;
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r314058 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs

2017-02-21 Thread Andriy Gapon
Author: avg
Date: Tue Feb 21 21:09:21 2017
New Revision: 314058
URL: https://svnweb.freebsd.org/changeset/base/314058

Log:
  zfs: lower priority of zio_write_issue threads by four
  
  The difference of one was insignificant because zio_write_issue threads
  ended up on the same run queues as other zio threads.
  See sys/priority.h and sys/runq.h for more details.
  
  Add a comment describing FreeBSD priority considerations and restore
  the illumos variant of the code for comparison.
  
  Obtained from:Panzura
  MFC after:2 weeks
  Sponsored by: Panzura

Modified:
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c
==
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c   Tue Feb 21 
21:06:12 2017(r314057)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c   Tue Feb 21 
21:09:21 2017(r314058)
@@ -922,9 +922,17 @@ spa_taskqs_init(spa_t *spa, zio_type_t t
 * The write issue taskq can be extremely CPU
 * intensive.  Run it at slightly lower priority
 * than the other taskqs.
+* FreeBSD notes:
+* - numerically higher priorities are lower priorities;
+* - if priorities divided by four (RQ_PPQ) are equal
+*   then a difference between them is insignificant.
 */
if (t == ZIO_TYPE_WRITE && q == ZIO_TASKQ_ISSUE)
-   pri++;
+#ifdef illumos
+   pri--;
+#else
+   pri += 4;
+#endif
 
tq = taskq_create_proc(name, value, pri, 50,
INT_MAX, spa->spa_proc, flags);
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r314057 - head/sys/amd64/amd64

2017-02-21 Thread Mark Johnston
Author: markj
Date: Tue Feb 21 21:06:12 2017
New Revision: 314057
URL: https://svnweb.freebsd.org/changeset/base/314057

Log:
  ddb show pte: use pmap of kdb_thread
  
  show pte from the pmap of the process of the current DDB thread, instead
  of necessarily the PCPU pmap.
  
  Submitted by: Ryan Libby 
  Reviewed by:  kib
  MFC after:1 week
  Sponsored by: Dell EMC Isilon
  Differential Revision:https://reviews.freebsd.org/D9645

Modified:
  head/sys/amd64/amd64/pmap.c

Modified: head/sys/amd64/amd64/pmap.c
==
--- head/sys/amd64/amd64/pmap.c Tue Feb 21 21:01:01 2017(r314056)
+++ head/sys/amd64/amd64/pmap.c Tue Feb 21 21:06:12 2017(r314057)
@@ -7239,6 +7239,7 @@ pmap_quick_remove_page(vm_offset_t addr)
 
 #include "opt_ddb.h"
 #ifdef DDB
+#include 
 #include 
 
 DB_SHOW_COMMAND(pte, pmap_print_pte)
@@ -7250,13 +7251,17 @@ DB_SHOW_COMMAND(pte, pmap_print_pte)
pt_entry_t *pte, PG_V;
vm_offset_t va;
 
-   if (have_addr) {
-   va = (vm_offset_t)addr;
-   pmap = PCPU_GET(curpmap); /* XXX */
-   } else {
+   if (!have_addr) {
db_printf("show pte addr\n");
return;
}
+   va = (vm_offset_t)addr;
+
+   if (kdb_thread != NULL)
+   pmap = vmspace_pmap(kdb_thread->td_proc->p_vmspace);
+   else
+   pmap = PCPU_GET(curpmap);
+
PG_V = pmap_valid_bit(pmap);
pml4 = pmap_pml4e(pmap, va);
db_printf("VA %#016lx pml4e %#016lx", va, *pml4);
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r314056 - in head: share/doc/pjdfstest tests/sys/pjdfstest/tests

2017-02-21 Thread Alan Somers
Author: asomers
Date: Tue Feb 21 21:01:01 2017
New Revision: 314056
URL: https://svnweb.freebsd.org/changeset/base/314056

Log:
  Improve pjdfstest run instructions
  
  In the Kyua era, it's no longer necessary to set PJDFSTEST_TEST_PATH.  Just
  use TMPDIR instead.
  
  Reviewed by:  ngie
  MFC after:3 weeks
  Relnotes: yes
  Sponsored by: Spectra Logic Corp
  Differential Revision:https://reviews.freebsd.org/D9340

Modified:
  head/share/doc/pjdfstest/README
  head/tests/sys/pjdfstest/tests/conf

Modified: head/share/doc/pjdfstest/README
==
--- head/share/doc/pjdfstest/README Tue Feb 21 19:51:41 2017
(r314055)
+++ head/share/doc/pjdfstest/README Tue Feb 21 21:01:01 2017
(r314056)
@@ -1,6 +1,6 @@
-pjdfstest test suite execution is integrated into kyua. This README describes
-how to use pjdfstest in the default configuration (kyua work directory), and
-with a specific filesystem path.
+The pjdfstest test suite is normally run by kyua.  It requires kyua 0.11 or
+newer. This README describes how to use pjdfstest in the default configuration
+(kyua work directory), with a specific filesystem path, and with prove(1).
 
 Method 1. Executing with default configuration (kyua work directory)
 
@@ -23,14 +23,17 @@ Method 2. Executing with a specific file
 2. cd to the tests directory:
% cd /usr/tests/sys/pjdfstest
 3. Run kyua:
-   % env PJDFSTEST_TEST_PATH=/mnt kyua test
+   % env TMPDIR=/mnt kyua test
 
-   WARNING: the above method violates the test program isolation algorithm
-   described in kyua(1); as such, $PJDFSTEST_TEST_PATH must be cleaned up after
-   executing the testcases.
-
-   It's highly recommended that $PJDFSTEST_TEST_PATH be pointed to a sandboxed
-   filesystem, e.g. a small UFS-formatted memory disk or ZFS dataset with
-   quotas enabled, so the filesystem can be easily destroyed after the test
-   execution is complete, and the testcases are properly bounded both in terms
-   of time and space.
+   Note that if HOME is undefined, this will result in kyua's logfile being
+   placed in TMPDIR, which may not be what you want.  You can always use
+   --logfile to explicitly select the log location.
+
+Method 3. Executing pjdfstest with prove
+
+1. Elevate privileges:
+   % su -
+2. cd to the temporary directory of your choice
+   % cd /mnt
+3. Invoke a specific test manually
+   % prove -rv /usr/tests/sys/pjdfstest/chmod/00

Modified: head/tests/sys/pjdfstest/tests/conf
==
--- head/tests/sys/pjdfstest/tests/conf Tue Feb 21 19:51:41 2017
(r314055)
+++ head/tests/sys/pjdfstest/tests/conf Tue Feb 21 21:01:01 2017
(r314056)
@@ -2,13 +2,6 @@
 #
 # $FreeBSD$
 
-: ${PJDFSTEST_TEST_PATH=.}
-if ! cd ${PJDFSTEST_TEST_PATH}/; then
-   echo 'Please set PJDFSTEST_TEST_PATH to a valid filesystem path'
-   echo 'Bail out!'
-   exit 1
-fi
-
 GREP=grep
 mountpoint=$(df . | tail -1 | awk '{print $6}')
 fs=$(mount -p | awk '$2 == "'$mountpoint'" { print toupper($3) }')
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r313982 - in head/sys/dev: agp al_eth an arcmsr bce beri/virtio bhnd/cores/usb buslogic ce cm cp ctau cx de ed fatm fe firewire hptiop hptmv iicbus isp le md ncr netmap ofw patm pccard

2017-02-21 Thread Piotr P. Stefaniak

On 2017-02-22 00:46:31, Bruce Evans wrote:

On Mon, 20 Feb 2017, Conrad Meyer wrote:

Maybe this is moot.  I don't believe any architecture FreeBSD actually
supports has non-zero bitpattern NULL, but something weird like CHERI
might.


Compilers should do portability checks on it.  In fact, the convolutions
in this file do little except define nullptr and __null to let compilers
do more checking.  Only the C++ case even has them.  Compilers can do
most checks using just the C90 definition of null pointer constants.


tcc(1) of the TenDRA project can set the null pointer representation to
0x via -f option of trans(1) (but only on x86):

$ cat test.c
#include 
int main(void)
{
char *x = NULL;
unsigned long int y = (unsigned long int)x;
printf("%lx\n", y);
return 0;
}

$ tcc ./test.c -o test
$ ./test
0
$ tcc -Wt,f ./test.c -o test
$ ./test


See http://www.tendra.org/trans.1/ for more details.


signature.asc
Description: PGP signature


svn commit: r314055 - head/lib/libc/sys

2017-02-21 Thread Eric van Gyzen
Author: vangyzen
Date: Tue Feb 21 19:51:41 2017
New Revision: 314055
URL: https://svnweb.freebsd.org/changeset/base/314055

Log:
  Make several improvements and corrections in the kenv(2) man page
  
  MFC after:3 days
  Sponsored by: Dell EMC

Modified:
  head/lib/libc/sys/kenv.2

Modified: head/lib/libc/sys/kenv.2
==
--- head/lib/libc/sys/kenv.2Tue Feb 21 18:59:17 2017(r314054)
+++ head/lib/libc/sys/kenv.2Tue Feb 21 19:51:41 2017(r314055)
@@ -26,7 +26,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd April 17, 2002
+.Dd February 20, 2017
 .Dt KENV 2
 .Os
 .Sh NAME
@@ -51,71 +51,59 @@ The
 argument can be one of the following:
 .Bl -tag -width ".Dv KENV_UNSET"
 .It Dv KENV_GET
-Returns the value associated with the named kernel environment variable.
-If the variable is not found, \-1 is returned and
-the global variable
-.Va errno
-is set to
-.Er ENOENT .
-Only the number of bytes available in
+Get the
+.Fa value
+of the variable with the given
+.Fa name .
+The size of the
 .Fa value
-are copied out.
+buffer is given by
+.Fa len ,
+which should be at least
+.Dv KENV_MVALLEN
++ 1 bytes to avoid truncation and to ensure NUL termination.
 .It Dv KENV_SET
-Sets or adds a new kernel environment variable.
+Set or add a variable.
+The
+.Fa name
+and
+.Fa value
+are limited to
+.Dv KENV_MNAMELEN
+and
+.Dv KENV_MVALLEN
+characters, respectively
+.Pq not including the NUL terminator.
+The
+.Fa len
+argument indicates the length of the
+.Fa value
+and must include the NUL terminator.
 This option is only available to the superuser.
 .It Dv KENV_UNSET
-Unsets the kernel environment variable
+Unset the variable with the given
 .Fa name .
-If the variable does not exist, \-1 is returned and
-the global variable
-.Va errno
-is set to
-.Er EINVAL .
+The
+.Fa value
+and
+.Fa len
+arguments are ignored.
 This option is only available to the superuser.
 .It Dv KENV_DUMP
-Dumps as much of the kernel environment as will fit in
-.Fa value .
+Dump as much of the kernel environment as will fit in
+.Fa value ,
+whose size is given in
+.Fa len .
 If
 .Fa value
 is
 .Dv NULL ,
 .Fn kenv
 will return the number of bytes required to copy out the entire environment.
-.El
-.Pp
-The
-.Fa name
-argument is the name of the environment variable to be affected.
-In the case of
-.Dv KENV_DUMP
-it is ignored.
-.Pp
 The
-.Fa value
-argument contains either the value to set the environment variable
 .Fa name
-to in the case of
-.Dv KENV_SET ,
-or it points to the location where
-.Fn kenv
-should copy return data to in the case of
-.Dv KENV_DUMP
-and
-.Dv KENV_GET .
-If
-.Fa value
-is
-.Dv NULL
-in the case of
-.Dv KENV_DUMP ,
-.Fn kenv
-will return the number of bytes required to copy out the entire environment.
-.Pp
-The
-.Fa len
-argument indicates how many bytes of storage
-.Fa value
-points to.
+is ignored.
+.El
 .Sh RETURN VALUES
 The
 .Fn kenv
@@ -148,23 +136,31 @@ is not a valid option, or the length of 
 is less than 1 for a
 .Dv KENV_SET .
 .It Bq Er ENOENT
-no value could be found for
+No value could be found for
 .Fa name
 for a
-.Dv KENV_SET
+.Dv KENV_GET
 or
 .Dv KENV_UNSET .
 .It Bq Er EPERM
-a user other than the superuser attempted to set or unset a kernel
+A user other than the superuser attempted to set or unset a kernel
 environment variable.
 .It Bq Er EFAULT
-bad address was encountered while attempting to copy in user arguments,
+A bad address was encountered while attempting to copy in user arguments
 or copy out value(s).
 .It Bq Er ENAMETOOLONG
-the name of a variable supplied by the user is longer than
+The
+.Fa name
+or the
+.Fa value
+is longer than
 .Dv KENV_MNAMELEN
-or the value of a variable is longer than
-.Dv KENV_MVALLEN .
+or
+.Dv KENV_MVALLEN
+characters, respectively, or
+.Fa len
+did not include the NUL terminator for a
+.Dv KENV_SET .
 .El
 .Sh SEE ALSO
 .Xr kenv 1
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r314054 - in head/sys: conf modules/linux modules/linux64 modules/svr4 modules/vmm

2017-02-21 Thread Ed Maste
Author: emaste
Date: Tue Feb 21 18:59:17 2017
New Revision: 314054
URL: https://svnweb.freebsd.org/changeset/base/314054

Log:
  Exclude -flto when building *genassym.o
  
  The build process generates *assym.h using nm from *genassym.o (which is
  in turn created from *genassym.c).
  
  When compiling with link-time optimization (LTO) using -flto, .o files
  are LLVM bitcode, not ELF objects. This is not usable by genassym.sh,
  so remove -flto from those ${CC} invocations.
  
  Submitted by: George Rimar
  Reviewed by:  dim
  MFC after:1 month
  Differential Revision:https://reviews.freebsd.org/D9659

Modified:
  head/sys/conf/files.amd64
  head/sys/conf/files.i386
  head/sys/conf/kern.post.mk
  head/sys/conf/kmod.mk
  head/sys/modules/linux/Makefile
  head/sys/modules/linux64/Makefile
  head/sys/modules/svr4/Makefile
  head/sys/modules/vmm/Makefile

Modified: head/sys/conf/files.amd64
==
--- head/sys/conf/files.amd64   Tue Feb 21 18:56:06 2017(r314053)
+++ head/sys/conf/files.amd64   Tue Feb 21 18:59:17 2017(r314054)
@@ -34,7 +34,7 @@ cloudabi64_vdso_blob.ooptionalcompat_
 #
 linux32_genassym.o optionalcompat_linux32  \
dependency  "$S/amd64/linux32/linux32_genassym.c"   \
-   compile-with"${CC} ${CFLAGS:N-fno-common} -c ${.IMPSRC}"\
+   compile-with"${CC} ${CFLAGS:N-flto:N-fno-common} -c ${.IMPSRC}" \
no-obj no-implicit-rule \
clean   "linux32_genassym.o"
 #
@@ -58,7 +58,7 @@ linux32_vdso.so   optionalcompat_linux32
 #
 ia32_genassym.ostandard
\
dependency  "$S/compat/ia32/ia32_genassym.c"\
-   compile-with"${CC} ${CFLAGS:N-fno-common} -c ${.IMPSRC}"\
+   compile-with"${CC} ${CFLAGS:N-flto:N-fno-common} -c ${.IMPSRC}" \
no-obj no-implicit-rule \
clean   "ia32_genassym.o"
 #

Modified: head/sys/conf/files.i386
==
--- head/sys/conf/files.i386Tue Feb 21 18:56:06 2017(r314053)
+++ head/sys/conf/files.i386Tue Feb 21 18:59:17 2017(r314054)
@@ -21,7 +21,7 @@ cloudabi32_vdso_blob.ooptionalcompat_
 #
 linux_genassym.o   optionalcompat_linux\
dependency  "$S/i386/linux/linux_genassym.c"\
-   compile-with"${CC} ${CFLAGS:N-fno-common} -c ${.IMPSRC}"\
+   compile-with"${CC} ${CFLAGS:N-flto:N-fno-common} -c ${.IMPSRC}" \
no-obj no-implicit-rule \
clean   "linux_genassym.o"
 #
@@ -45,7 +45,7 @@ linux_vdso.so optionalcompat_linux
\
 #
 svr4_genassym.ooptionalcompat_svr4 
\
dependency  "$S/i386/svr4/svr4_genassym.c"  \
-   compile-with"${CC} ${CFLAGS:N-fno-common} -c ${.IMPSRC}"\
+   compile-with"${CC} ${CFLAGS:N-flto:N-fno-common} -c ${.IMPSRC}" \
no-obj no-implicit-rule \
clean   "svr4_genassym.o"
 #

Modified: head/sys/conf/kern.post.mk
==
--- head/sys/conf/kern.post.mk  Tue Feb 21 18:56:06 2017(r314053)
+++ head/sys/conf/kern.post.mk  Tue Feb 21 18:59:17 2017(r314054)
@@ -189,7 +189,7 @@ assym.s: $S/kern/genassym.sh genassym.o
NM='${NM}' NMFLAGS='${NMFLAGS}' sh $S/kern/genassym.sh genassym.o > 
${.TARGET}
 
 genassym.o: $S/$M/$M/genassym.c
-   ${CC} -c ${CFLAGS:N-fno-common} $S/$M/$M/genassym.c
+   ${CC} -c ${CFLAGS:N-flto:N-fno-common} $S/$M/$M/genassym.c
 
 ${SYSTEM_OBJS} genassym.o vers.o: opt_global.h
 

Modified: head/sys/conf/kmod.mk
==
--- head/sys/conf/kmod.mk   Tue Feb 21 18:56:06 2017(r314053)
+++ head/sys/conf/kmod.mk   Tue Feb 21 18:59:17 2017(r314054)
@@ -461,7 +461,7 @@ assym.s: ${SYSDIR}/kern/genassym.sh
sh ${SYSDIR}/kern/genassym.sh genassym.o > ${.TARGET}
 genassym.o: ${SYSDIR}/${MACHINE}/${MACHINE}/genassym.c
 genassym.o: ${SRCS:Mopt_*.h}
-   ${CC} -c ${CFLAGS:N-fno-common} \
+   ${CC} -c ${CFLAGS:N-flto:N-fno-common} \
${SYSDIR}/${MACHINE}/${MACHINE}/genassym.c
 .endif
 

Modified: head/sys/modules/linux/Makefile
==
--- head/sys/modules/linux/Makefile Tue Feb 21 18:56:06 2017
(r314053)
+++ head/sys/modules/linux/Makefile Tue Feb 21 18:59:17 2017
(r314054)
@@ -71,7 +71,7 @@ 

Re: svn commit: r313975 - in head: contrib/openpam contrib/openpam/bin contrib/openpam/bin/openpam_dump_policy contrib/openpam/bin/pamtest contrib/openpam/bin/su contrib/openpam/doc contrib/openpam/do

2017-02-21 Thread Ngie Cooper (yaneurabeya)

> On Feb 21, 2017, at 05:41, Dag-Erling Smørgrav  wrote:
> 
> Bryan Drewery  writes:
>> Did you intend to delete the tests?
> 
> Yes.  It just occurred to me that they should probably be added to
> ObsoleteFiles.inc…

Already done :). I figured that you had good reasons for doing this 
after some of the discussion we had off-list about testing in general, but I’ll 
see what I can do to bring back coverage in lib/libpam.
Thanks!
-Ngie

r313976 | ngie | 2017-02-19 17:45:12 -0800 (Sun, 19 Feb 2017) | 5 lines

Remove lib/libpam tests after they were removed from the source tree in r313975

X-MFC with: r313975
Sponsored by:   Dell EMC Isilon


signature.asc
Description: Message signed with OpenPGP using GPGMail


svn commit: r314053 - head/sys/kern

2017-02-21 Thread Warner Losh
Author: imp
Date: Tue Feb 21 18:56:06 2017
New Revision: 314053
URL: https://svnweb.freebsd.org/changeset/base/314053

Log:
  Make the code match the comments: If we have ANY buf's that failed
  then return EAGAIN. The current code just returns that if the LAST buf
  failed.
  
  Reviewed by: kib@, trasz@
  Differential Revision: https://reviews.freebsd.org/D9677

Modified:
  head/sys/kern/vfs_default.c

Modified: head/sys/kern/vfs_default.c
==
--- head/sys/kern/vfs_default.c Tue Feb 21 18:49:51 2017(r314052)
+++ head/sys/kern/vfs_default.c Tue Feb 21 18:56:06 2017(r314053)
@@ -718,8 +718,8 @@ loop2:
 * to write them out.
 */
TAILQ_FOREACH(bp, >bo_dirty.bv_hd, b_bobufs)
-   if ((error = bp->b_error) == 0)
-   continue;
+   if ((error = bp->b_error) != 0)
+   break;
if (error == 0 && --maxretry >= 0)
goto loop1;
error = EAGAIN;
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r313938 - head/usr.bin/lam

2017-02-21 Thread Ngie Cooper (yaneurabeya)

> On Feb 18, 2017, at 22:02, Allan Jude  wrote:
> 
> Author: allanjude
> Date: Sun Feb 19 06:02:41 2017
> New Revision: 313938
> URL: https://svnweb.freebsd.org/changeset/base/313938
> 
> Log:
>  Capsicum-ize lam(1)
> 
>  lam(1) is used in portsnap(8), so lock it down
> 
>  Reviewed by: emaste, cem, jonathan
>  Sponsored by:ScaleEngine Inc.
>  Differential Revision:   https://reviews.freebsd.org/D8076

Hi,
There are multiple reports of portsnap being broken after this change. 
Could you please revise the change or back it out if need be?
Thank you,
-Ngie


signature.asc
Description: Message signed with OpenPGP using GPGMail


svn commit: r314052 - head/sys/sys

2017-02-21 Thread Warner Losh
Author: imp
Date: Tue Feb 21 18:49:51 2017
New Revision: 314052
URL: https://svnweb.freebsd.org/changeset/base/314052

Log:
  Document what the different flags mean for locking.

Modified:
  head/sys/sys/bufobj.h

Modified: head/sys/sys/bufobj.h
==
--- head/sys/sys/bufobj.h   Tue Feb 21 18:49:30 2017(r314051)
+++ head/sys/sys/bufobj.h   Tue Feb 21 18:49:51 2017(r314052)
@@ -88,6 +88,12 @@ struct buf_ops {
 #define BO_WRITE(bo, bp)   ((bo)->bo_ops->bop_write((bp)))
 #define BO_BDFLUSH(bo, bp) ((bo)->bo_ops->bop_bdflush((bo), (bp)))
 
+/*
+ * Locking notes:
+ * 'S' is sync_mtx
+ * 'v' is the vnode lock which embeds the bufobj.
+ * '-' Constant and unchanging after initialization.
+ */
 struct bufobj {
struct rwlock   bo_lock;/* Lock which protects "i" things */
struct buf_ops  *bo_ops;/* - Buffer operations */
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r314051 - head

2017-02-21 Thread Warner Losh
Author: imp
Date: Tue Feb 21 18:49:30 2017
New Revision: 314051
URL: https://svnweb.freebsd.org/changeset/base/314051

Log:
  Document why cat is a bootstrap tool.

Modified:
  head/Makefile.inc1

Modified: head/Makefile.inc1
==
--- head/Makefile.inc1  Tue Feb 21 18:04:21 2017(r314050)
+++ head/Makefile.inc1  Tue Feb 21 18:49:30 2017(r314051)
@@ -1625,6 +1625,7 @@ _nmtree=  lib/libnetbsd \
 ${_bt}-usr.sbin/nmtree: ${_bt}-lib/libnetbsd
 .endif
 
+# r246097: log addition login.conf.db, passwd, pwd.db, and spwd.db with cat -l
 .if ${BOOTSTRAPPING} < 127
 _cat=  bin/cat
 .endif
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r314050 - in head/sys: compat/linuxkpi/common/include/linux compat/linuxkpi/common/src conf modules/linuxkpi

2017-02-21 Thread Hans Petter Selasky
Author: hselasky
Date: Tue Feb 21 18:04:21 2017
New Revision: 314050
URL: https://svnweb.freebsd.org/changeset/base/314050

Log:
  Replace dummy implementation of RCU in the LinuxKPI with one based on
  the in-kernel concurrency kit's ck_epoch API. Factor RCU hlist_xxx()
  functions into own rculist.h header file.
  
  Obtained from:kmacy @
  MFC after:1 week
  Sponsored by: Mellanox Technologies

Added:
  head/sys/compat/linuxkpi/common/include/linux/rculist.h   (contents, props 
changed)
  head/sys/compat/linuxkpi/common/src/linux_rcu.c   (contents, props changed)
Modified:
  head/sys/compat/linuxkpi/common/include/linux/rcupdate.h
  head/sys/compat/linuxkpi/common/include/linux/srcu.h
  head/sys/compat/linuxkpi/common/include/linux/types.h
  head/sys/compat/linuxkpi/common/src/linux_compat.c
  head/sys/conf/files
  head/sys/modules/linuxkpi/Makefile

Added: head/sys/compat/linuxkpi/common/include/linux/rculist.h
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/sys/compat/linuxkpi/common/include/linux/rculist.h Tue Feb 21 
18:04:21 2017(r314050)
@@ -0,0 +1,85 @@
+/*-
+ * Copyright (c) 2015 François Tigeot
+ * Copyright (c) 2016-2017 Mellanox Technologies, Ltd.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice unmodified, this list of conditions, and the following
+ *disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * $FreeBSD$
+ */
+
+#ifndef _LINUX_RCULIST_H_
+#define_LINUX_RCULIST_H_
+
+#include 
+#include 
+
+#definehlist_first_rcu(head)   (*((struct hlist_node 
**)(&(head)->first)))
+#definehlist_next_rcu(node)(*((struct hlist_node 
**)(&(node)->next)))
+#definehlist_pprev_rcu(node)   (*((struct hlist_node 
**)((node)->pprev)))
+
+static inline void
+hlist_add_behind_rcu(struct hlist_node *n, struct hlist_node *prev)
+{
+   n->next = prev->next;
+   n->pprev = >next;
+   rcu_assign_pointer(hlist_next_rcu(prev), n);
+   if (n->next)
+   n->next->pprev = >next;
+}
+
+#definehlist_for_each_entry_rcu(pos, head, member) \
+   hlist_for_each_entry(pos, head, member)
+
+static inline void
+hlist_del_rcu(struct hlist_node *n)
+{
+   struct hlist_node *next = n->next;
+   struct hlist_node **pprev = n->pprev;
+
+   WRITE_ONCE(*pprev, next);
+   if (next)
+   next->pprev = pprev;
+}
+
+static inline void
+hlist_add_head_rcu(struct hlist_node *n, struct hlist_head *h)
+{
+   struct hlist_node *first = h->first;
+
+   n->next = first;
+   n->pprev = >first;
+   rcu_assign_pointer(hlist_first_rcu(h), n);
+   if (first)
+   first->pprev = >next;
+}
+
+static inline void
+hlist_del_init_rcu(struct hlist_node *n)
+{
+   if (!hlist_unhashed(n)) {
+   hlist_del_rcu(n);
+   n->pprev = NULL;
+   }
+}
+
+#endif /* _LINUX_RCULIST_H_ */

Modified: head/sys/compat/linuxkpi/common/include/linux/rcupdate.h
==
--- head/sys/compat/linuxkpi/common/include/linux/rcupdate.hTue Feb 21 
17:54:38 2017(r314049)
+++ head/sys/compat/linuxkpi/common/include/linux/rcupdate.hTue Feb 21 
18:04:21 2017(r314050)
@@ -1,5 +1,5 @@
 /*-
- * Copyright (c) 2016 Mellanox Technologies, Ltd.
+ * Copyright (c) 2016-2017 Mellanox Technologies, Ltd.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -28,70 +28,73 @@
 #ifndef_LINUX_RCUPDATE_H_
 #define_LINUX_RCUPDATE_H_
 
-#include 
-#include 
-#include 
-
-extern struct sx linux_global_rcu_lock;
-
-struct rcu_head {
-};
-
-typedef void 

svn commit: r314049 - head

2017-02-21 Thread Andriy Gapon
Author: avg
Date: Tue Feb 21 17:54:38 2017
New Revision: 314049
URL: https://svnweb.freebsd.org/changeset/base/314049

Log:
  add UPDATING entry for r314048, re-work of .zfs code

Modified:
  head/UPDATING

Modified: head/UPDATING
==
--- head/UPDATING   Tue Feb 21 17:47:08 2017(r314048)
+++ head/UPDATING   Tue Feb 21 17:54:38 2017(r314049)
@@ -51,6 +51,12 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 12
 
 ** SPECIAL WARNING: **
 
+20170221:
+   The code that provides support for ZFS .zfs/ directory functionality
+   has been reimplemented.  It's not possible now to create a snapshot
+   by mkdir under .zfs/snapshot/.  That should be the only user visible
+   change.
+
 20170216:
EISA bus support has been removed. The WITH_EISA option is no longer
valid.
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r314048 - in head/sys/cddl: compat/opensolaris/kern contrib/opensolaris/uts/common/fs/zfs contrib/opensolaris/uts/common/fs/zfs/sys

2017-02-21 Thread Andriy Gapon
Author: avg
Date: Tue Feb 21 17:47:08 2017
New Revision: 314048
URL: https://svnweb.freebsd.org/changeset/base/314048

Log:
  reimplement zfsctl (.zfs) support
  
  The current code is written on top of GFS, a library with the generic
  support for writing filesystems, which was ported from illumos.
  Because of significant differences between illumos VFS and FreeBSD
  VFS models, both the GFS and zfsctl code were heavily modified to
  work on FreeBSD.  Nonetheless, they still contain quite a few ugly
  hacks and bugs.
  
  This is a reimplementation of the zfsctl code where the VFS-specific
  bits are written from scratch and only the code that interacts with
  the rest of ZFS is reused.
  
  Some highlights.
  
  We use two types of nodes, static and on-demand. The static nodes
  are used for permanent directories like .zfs, .zfs/snapshot, etc. The
  on-demand nodes are used for ephemeral directories that act as snapshot
  mount points.
  Initially only static nodes are created. Their vnodes are instantiated
  when they are looked up. The on-demand nodes and vnodes are instantiated
  as needed and the nodes are destroyed as soon as the corresponding
  vnodes are reclaimed.
  We also try very hard to ensure that uncovered snapshot vnodes do not
  linger.  They are supposed to become inactive as soon as they are
  uncovered and we try to recycle them immediately.
  When a filesystem is unmounted all snapshots under .zfs are unmounted
  first, then all vnodes are flushed and finally the static .zfs nodes
  are destroyed.
  
  There are some changes outside of zfsctl code too.
  z_ctldir is never used directly (as it is an opaque pointer),
  zfsctl_root() has to be used instead.  The function returns a locked
  vnode now, so it accepts a lock flags parameter.  The function can
  also fail now, e.g. during force unmounting, whereas previously it
  was infallible.
  zfsctl_root_lookup() is retired, instead of it VOP_LOOKUP() on the .zfs
  vnode (obtained with zfsctl_root) is used.
  
  Some ideas are picked from an independent work by will.
  
  Reviewed by:  asomers, smh
  MFC after:1 month
  Relnotes: maybe
  Differential Revision: https://reviews.freebsd.org/D7421

Modified:
  head/sys/cddl/compat/opensolaris/kern/opensolaris_vfs.c
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_ctldir.h
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_vfsops.h
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c

Modified: head/sys/cddl/compat/opensolaris/kern/opensolaris_vfs.c
==
--- head/sys/cddl/compat/opensolaris/kern/opensolaris_vfs.c Tue Feb 21 
17:34:27 2017(r314047)
+++ head/sys/cddl/compat/opensolaris/kern/opensolaris_vfs.c Tue Feb 21 
17:47:08 2017(r314048)
@@ -196,10 +196,17 @@ mount_snapshot(kthread_t *td, vnode_t **
td->td_ucred = cr;
 
if (error != 0) {
+   /*
+* Clear VI_MOUNT and decrement the use count "atomically",
+* under the vnode lock.  This is not strictly required,
+* but makes it easier to reason about the life-cycle and
+* ownership of the covered vnode.
+*/
+   vn_lock(vp, LK_EXCLUSIVE | LK_RETRY);
VI_LOCK(vp);
vp->v_iflag &= ~VI_MOUNT;
VI_UNLOCK(vp);
-   vrele(vp);
+   vput(vp);
vfs_unbusy(mp);
vfs_freeopts(mp->mnt_optnew);
vfs_mount_destroy(mp);

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_ctldir.h
==
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_ctldir.h
Tue Feb 21 17:34:27 2017(r314047)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_ctldir.h
Tue Feb 21 17:47:08 2017(r314048)
@@ -44,7 +44,7 @@ extern "C" {
 
 void zfsctl_create(zfsvfs_t *);
 void zfsctl_destroy(zfsvfs_t *);
-vnode_t *zfsctl_root(znode_t *);
+int zfsctl_root(zfsvfs_t *, int, vnode_t **);
 void zfsctl_init(void);
 void zfsctl_fini(void);
 boolean_t zfsctl_is_node(vnode_t *);
@@ -53,10 +53,6 @@ int zfsctl_rename_snapshot(const char *f
 int zfsctl_destroy_snapshot(const char *snapname, int force);
 int zfsctl_umount_snapshots(vfs_t *, int, cred_t *);
 
-int zfsctl_root_lookup(vnode_t *dvp, char *nm, vnode_t **vpp, pathname_t *pnp,
-int flags, vnode_t *rdir, cred_t *cr, caller_context_t *ct,
-int *direntflags, pathname_t *realpnp);
-
 int zfsctl_lookup_objset(vfs_t *vfsp, uint64_t objsetid, zfsvfs_t **zfsvfsp);
 
 #defineZFSCTL_INO_ROOT 0x1

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_vfsops.h

svn commit: r314047 - head/sys/mips/conf

2017-02-21 Thread Brooks Davis
Author: brooks
Date: Tue Feb 21 17:34:27 2017
New Revision: 314047
URL: https://svnweb.freebsd.org/changeset/base/314047

Log:
  Rename BERI_TEMPLATE to std.BERI to be more like other configs.
  
  Sponsored by: DARPA, AFRL

Added:
  head/sys/mips/conf/std.BERI
 - copied, changed from r314046, head/sys/mips/conf/BERI_TEMPLATE
Deleted:
  head/sys/mips/conf/BERI_TEMPLATE
Modified:
  head/sys/mips/conf/BERI_DE4_BASE
  head/sys/mips/conf/BERI_NETFPGA_MDROOT
  head/sys/mips/conf/BERI_SIM_BASE
  head/sys/mips/conf/BERI_SOCKIT

Modified: head/sys/mips/conf/BERI_DE4_BASE
==
--- head/sys/mips/conf/BERI_DE4_BASETue Feb 21 15:57:01 2017
(r314046)
+++ head/sys/mips/conf/BERI_DE4_BASETue Feb 21 17:34:27 2017
(r314047)
@@ -7,7 +7,7 @@
 # $FreeBSD$
 #
 
-include "BERI_TEMPLATE"
+include "std.BERI"
 
 ident  BERI_DE4_BASE
 

Modified: head/sys/mips/conf/BERI_NETFPGA_MDROOT
==
--- head/sys/mips/conf/BERI_NETFPGA_MDROOT  Tue Feb 21 15:57:01 2017
(r314046)
+++ head/sys/mips/conf/BERI_NETFPGA_MDROOT  Tue Feb 21 17:34:27 2017
(r314047)
@@ -6,7 +6,7 @@
 # $FreeBSD$
 #
 
-include "BERI_TEMPLATE"
+include "std.BERI"
 
 ident  BERI_NETFPGA_MDROOT
 

Modified: head/sys/mips/conf/BERI_SIM_BASE
==
--- head/sys/mips/conf/BERI_SIM_BASETue Feb 21 15:57:01 2017
(r314046)
+++ head/sys/mips/conf/BERI_SIM_BASETue Feb 21 17:34:27 2017
(r314047)
@@ -6,7 +6,7 @@
 # $FreeBSD$
 #
 
-include "BERI_TEMPLATE"
+include "std.BERI"
 
 optionsFDT
 optionsFDT_DTB_STATIC

Modified: head/sys/mips/conf/BERI_SOCKIT
==
--- head/sys/mips/conf/BERI_SOCKIT  Tue Feb 21 15:57:01 2017
(r314046)
+++ head/sys/mips/conf/BERI_SOCKIT  Tue Feb 21 17:34:27 2017
(r314047)
@@ -7,7 +7,7 @@
 # $FreeBSD$
 #
 
-include "BERI_TEMPLATE"
+include "std.BERI"
 
 ident  BERI_SOCKIT
 

Copied and modified: head/sys/mips/conf/std.BERI (from r314046, 
head/sys/mips/conf/BERI_TEMPLATE)
==
--- head/sys/mips/conf/BERI_TEMPLATETue Feb 21 15:57:01 2017
(r314046, copy source)
+++ head/sys/mips/conf/std.BERI Tue Feb 21 17:34:27 2017(r314047)
@@ -7,8 +7,6 @@
 # $FreeBSD$
 #
 
-ident  BERI_TEMPLATE
-
 machinemips mips64
 
 cpuCPU_BERI
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r313909 - head/sys/kern

2017-02-21 Thread Bryan Drewery
On 2/17/2017 9:07 PM, Bryan Drewery wrote:
> Author: bdrewery
> Date: Sat Feb 18 05:07:53 2017
> New Revision: 313909
> URL: https://svnweb.freebsd.org/changeset/base/313909
> 
> Log:
>   Fix panic with unlocked vnode to vrecycle().
>   
>   MFC after:  2 weeks
> 
> Modified:
>   head/sys/kern/uipc_mqueue.c
> 
> Modified: head/sys/kern/uipc_mqueue.c
> ==
> --- head/sys/kern/uipc_mqueue.c   Sat Feb 18 01:52:10 2017
> (r313908)
> +++ head/sys/kern/uipc_mqueue.c   Sat Feb 18 05:07:53 2017
> (r313909)
> @@ -714,7 +714,9 @@ do_recycle(void *context, int pending __
>  {
>   struct vnode *vp = (struct vnode *)context;
>  
> + vn_lock(vp, LK_EXCLUSIVE | LK_RETRY);
>   vrecycle(vp);
> + VOP_UNLOCK(vp, 0);
>   vdrop(vp);
>  }
>  
> 

Just looking at this, it seemed questionable and most likely bitrotted.
I added the lock to avoid an assertion to unblock me and allow the
module to be used by others with INVARIANTS.  Most of the vnode handling
here is from the initial commit, long before a lot of refactoring around
vnode lifecycle management.  It does appear to need someone more
familiar with vnode handling to go through and clean it up.


-- 
Regards,
Bryan Drewery



signature.asc
Description: OpenPGP digital signature


svn commit: r314046 - head/sys/compat/linux

2017-02-21 Thread Edward Tomasz Napierala
Author: trasz
Date: Tue Feb 21 15:57:01 2017
New Revision: 314046
URL: https://svnweb.freebsd.org/changeset/base/314046

Log:
  Get rid of foo_sys() in linuxulator code.  It was commented out, and it
  would be useless anyway - there is no point in pretending to have block
  devices; our "block" devices are in fact character ones, and can only
  be accessed as such.
  
  Discussed with:   dchagin
  MFC after:2 weeks
  Sponsored by: DARPA, AFRL

Modified:
  head/sys/compat/linux/linux_stats.c

Modified: head/sys/compat/linux/linux_stats.c
==
--- head/sys/compat/linux/linux_stats.c Tue Feb 21 14:31:58 2017
(r314045)
+++ head/sys/compat/linux/linux_stats.c Tue Feb 21 15:57:01 2017
(r314046)
@@ -98,42 +98,6 @@ linux_kern_lstat(struct thread *td, char
pathseg, sbp));
 }
 
-/*
- * XXX: This was removed from newstat_copyout(), and almost identical
- * XXX: code was in stat64_copyout().  findcdev() needs to be replaced
- * XXX: with something that does lookup and locking properly.
- * XXX: When somebody fixes this: please try to avoid duplicating it.
- */
-#if 0
-static void
-disk_foo(struct somestat *tbuf)
-{
-   struct cdevsw *cdevsw;
-   struct cdev *dev;
-
-   /* Lie about disk drives which are character devices
-* in FreeBSD but block devices under Linux.
-*/
-   if (S_ISCHR(tbuf.st_mode) &&
-   (dev = findcdev(buf->st_rdev)) != NULL) {
-   cdevsw = dev_refthread(dev);
-   if (cdevsw != NULL) {
-   if (cdevsw->d_flags & D_DISK) {
-   tbuf.st_mode &= ~S_IFMT;
-   tbuf.st_mode |= S_IFBLK;
-
-   /* XXX this may not be quite right */
-   /* Map major number to 0 */
-   tbuf.st_dev = minor(buf->st_dev) & 0xf;
-   tbuf.st_rdev = buf->st_rdev & 0xff;
-   }
-   dev_relthread(dev);
-   }
-   }
-
-}
-#endif
-
 static void
 translate_fd_major_minor(struct thread *td, int fd, struct stat *buf)
 {
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r313878 - head/sys/kern

2017-02-21 Thread Ryan Stone
On Tue, Feb 21, 2017 at 10:07 AM, Pedro Giffuni  wrote:

> Good point: it doesn't.
>
> The change gets ignored but it doesn't break the converter. At least not
> immediately, the github converter in AOO breaks frequently but it is
> probably unrelated.
>

It wouldn't "break" the converter but it would prevent reproducible
conversions.
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r313878 - head/sys/kern

2017-02-21 Thread Pedro Giffuni



On 2/21/2017 2:11 AM, Andriy Gapon wrote:

On 21/02/2017 02:42, Pedro Giffuni wrote:

FWIW,


On 2/20/2017 7:24 PM, Bryan Drewery wrote:

On 2/17/2017 7:40 AM, Mateusz Guzik wrote:

Author: mjg
Date: Fri Feb 17 15:40:24 2017
New Revision: 313878
URL: https://svnweb.freebsd.org/changeset/base/313878

Log:
mtx: get rid of file/line args from slow paths if they are unused
   This denotes changes which went in by accident in r313877.

I really wish people would just revert their changes and recommit them
properly.  The 'svn blame' on the code in r313877 will never show the
commit message here (r313878).  So a person would only find this
explanation if they read 'svn log' on the file, which in the case of
sys/kern/kern_mutex.c there are 273 commits for.  Are we expected to
read 'svn log' (in the future) for all changes in the hopes that a later
commit happens to mention it?

As someone who so often is 'svn blame'ing code to understand it better
and to track regressions, commits like this that explain other commits
might as well have never been done.

As I mentioned in another thread, other svn configurations (ASF, for example)
permit editing the log message:

http://help.collab.net/index.jsp?topic=/faq/changelog.html

How well do various svn exporters handle that?
Specifically, svn-> git ?



Good point: it doesn't.

The change gets ignored but it doesn't break the converter. At least not 
immediately, the github converter in AOO breaks frequently but it is 
probably unrelated.


Pedro.
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r313878 - head/sys/kern

2017-02-21 Thread Kyle Evans
On Tue, Feb 21, 2017 at 1:11 AM, Andriy Gapon  wrote:
> On 21/02/2017 02:42, Pedro Giffuni wrote:
>> [...]
>>
>> As I mentioned in another thread, other svn configurations (ASF, for example)
>> permit editing the log message:
>>
>> http://help.collab.net/index.jsp?topic=/faq/changelog.html
>
> How well do various svn exporters handle that?
> Specifically, svn-> git ?

git in general would not handle this well if it's already pushed
commits at or after the one you're changing, since a change in commit
message requires a change in commit hash. I'd guess that the exporter
would be fine with it, but you'd run into problems as it's trying to
rewrite history and push to Github.
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r314036 - head/usr.sbin/bsdinstall/scripts

2017-02-21 Thread Alexey Dokuchaev
On Tue, Feb 21, 2017 at 08:34:29AM -0600, Eric Badger wrote:
> Thanks for working on making it easier to harden FreeBSD. While
> defaulting some of these options to "on" seem pretty harmless (e.g.
> random_pid), others are likely to cause confusion for new and
> experienced users alike (e.g. proc_debug. I've never used that option
> before, so I gave it a try. It simply causes gdb to hang when attempting
> to start a process, with no obvious indication of why).

I concur.  In fact, harmless knobs should probably be turned on by default
in FreeBSD itself (i.e., without any "hardening" help from the installer),
while more intrusive ones should be opt-in, not opt-out.

./danfe
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r314036 - head/usr.sbin/bsdinstall/scripts

2017-02-21 Thread Eric Badger

On 02/21/2017 03:37 AM, Bartek Rutkowski wrote:

Author: robak (ports committer)
Date: Tue Feb 21 09:37:33 2017
New Revision: 314036
URL: https://svnweb.freebsd.org/changeset/base/314036

Log:
  Enable bsdinstall hardening options by default.

  As discussed previously, in order to introduce new OS hardening
  defaults, we've added them to bsdinstall in 'off by default' mode.
  It has been there for a while, so the next step is to change them
  to 'on by defaul' mode, so that in future we could simply enable
  them in base OS.

  Reviewed by:  brd
  Approved by:  adrian
  Differential Revision:https://reviews.freebsd.org/D9641

Modified:
  head/usr.sbin/bsdinstall/scripts/hardening

Modified: head/usr.sbin/bsdinstall/scripts/hardening
==
--- head/usr.sbin/bsdinstall/scripts/hardening  Tue Feb 21 09:33:21 2017
(r314035)
+++ head/usr.sbin/bsdinstall/scripts/hardening  Tue Feb 21 09:37:33 2017
(r314036)
@@ -36,15 +36,15 @@ FEATURES=$( dialog --backtitle "FreeBSD
 --title "System Hardening" --nocancel --separate-output \
 --checklist "Choose system security hardening options:" \
 0 0 0 \
-   "0 hide_uids" "Hide processes running as other users" ${hide_uids:-off} 
\
-   "1 hide_gids" "Hide processes running as other groups" 
${hide_gids:-off} \
-   "2 read_msgbuf" "Disable reading kernel message buffer for unprivileged 
users" ${read_msgbuf:-off} \
-   "3 proc_debug" "Disable process debugging facilities for unprivileged 
users" ${proc_debug:-off} \
-   "4 random_pid" "Randomize the PID of newly created processes" 
${random_pid:-off} \
-   "5 stack_guard" "Insert stack guard page ahead of the growable 
segments" ${stack_guard:-off} \
-   "6 clear_tmp" "Clean the /tmp filesystem on system startup" 
${clear_tmp:-off} \
-   "7 disable_syslogd" "Disable opening Syslogd network socket (disables remote 
logging)" ${disable_syslogd:-off} \
-   "8 disable_sendmail" "Disable Sendmail service" 
${disable_sendmail:-off} \
+   "0 hide_uids" "Hide processes running as other users" ${hide_uids:-on} \
+   "1 hide_gids" "Hide processes running as other groups" ${hide_gids:-on} 
\
+   "2 read_msgbuf" "Disable reading kernel message buffer for unprivileged 
users" ${read_msgbuf:-on} \
+   "3 proc_debug" "Disable process debugging facilities for unprivileged 
users" ${proc_debug:-on} \
+   "4 random_pid" "Randomize the PID of newly created processes" 
${random_pid:-on} \
+   "5 stack_guard" "Insert stack guard page ahead of the growable 
segments" ${stack_guard:-on} \
+   "6 clear_tmp" "Clean the /tmp filesystem on system startup" 
${clear_tmp:-on} \
+   "7 disable_syslogd" "Disable opening Syslogd network socket (disables remote 
logging)" ${disable_syslogd:-on} \
+   "8 disable_sendmail" "Disable Sendmail service" ${disable_sendmail:-on} 
\
 2>&1 1>&3 )
 exec 3>&-




Hi Bartek,

Thanks for working on making it easier to harden FreeBSD. While 
defaulting some of these options to "on" seem pretty harmless (e.g. 
random_pid), others are likely to cause confusion for new and 
experienced users alike (e.g. proc_debug. I've never used that option 
before, so I gave it a try. It simply causes gdb to hang when attempting 
to start a process, with no obvious indication of why). I think more 
discussion is merited before they are turned on by default; personally I 
think they have potential to sour a first impression of FreeBSD by 
making things people are used to doing on other OSes hard.


Eric
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r314045 - head/sys/dev/isp

2017-02-21 Thread Alexander Motin
Author: mav
Date: Tue Feb 21 14:31:58 2017
New Revision: 314045
URL: https://svnweb.freebsd.org/changeset/base/314045

Log:
  Remove duplicate INOT allocation.
  
  For some reason isp_handle_platform_notify_fc() allocated INOT just
  before calling isp_handle_platform_target_tmf(), which also allocates
  INOT.  It seems to be a braino introduced in r196008.
  
  MFC after:2 weeks

Modified:
  head/sys/dev/isp/isp_freebsd.c

Modified: head/sys/dev/isp/isp_freebsd.c
==
--- head/sys/dev/isp/isp_freebsd.c  Tue Feb 21 14:22:14 2017
(r314044)
+++ head/sys/dev/isp/isp_freebsd.c  Tue Feb 21 14:31:58 2017
(r314045)
@@ -2564,13 +2564,11 @@ isp_handle_platform_notify_fc(ispsoftc_t
break;
case IN_ABORT_TASK:
{
-   tstate_t *tptr;
uint16_t nphdl, lun;
uint32_t sid;
uint64_t wwn;
-   atio_private_data_t *atp;
fcportdb_t *lp;
-   struct ccb_immediate_notify *inot = NULL;
+   isp_notify_t tmp, *nt = 
 
if (ISP_CAP_SCCFW(isp)) {
lun = inp->in_scclun;
@@ -2592,47 +2590,25 @@ isp_handle_platform_notify_fc(ispsoftc_t
wwn = INI_ANY;
sid = PORT_ANY;
}
-   tptr = get_lun_statep(isp, 0, lun);
-   if (tptr == NULL) {
-   tptr = get_lun_statep(isp, 0, CAM_LUN_WILDCARD);
-   if (tptr == NULL) {
-   isp_prt(isp, ISP_LOGWARN, "ABORT TASK for lun 
%x, but no tstate", lun);
-   return;
-   }
-   }
-   atp = isp_find_atpd(isp, tptr, inp->in_seqid);
-
-   if (atp) {
-   inot = (struct ccb_immediate_notify *) 
SLIST_FIRST(>inots);
-   isp_prt(isp, ISP_LOGTDEBUG0, "ABORT TASK RX_ID %x WWN 
0x%016llx state %d", inp->in_seqid, (unsigned long long) wwn, atp->state);
-   if (inot) {
-   tptr->inot_count--;
-   SLIST_REMOVE_HEAD(>inots, sim_links.sle);
-   ISP_PATH_PRT(isp, ISP_LOGTDEBUG2, 
inot->ccb_h.path, "%s: Take FREE INOT count now %d\n", __func__, 
tptr->inot_count);
-   } else {
-   ISP_PATH_PRT(isp, ISP_LOGWARN, tptr->owner, 
"out of INOT structures\n");
-   }
-   } else {
-   ISP_PATH_PRT(isp, ISP_LOGWARN, tptr->owner, "abort task 
RX_ID %x from wwn 0x%016llx, state unknown\n", inp->in_seqid, wwn);
-   }
-   if (inot) {
-   isp_notify_t tmp, *nt = 
-   ISP_MEMZERO(nt, sizeof (isp_notify_t));
-   nt->nt_hba = isp;
-   nt->nt_tgt = FCPARAM(isp, 0)->isp_wwpn;
-   nt->nt_wwn = wwn;
-   nt->nt_nphdl = nphdl;
-   nt->nt_sid = sid;
-   nt->nt_did = PORT_ANY;
-   nt->nt_lun = lun;
-   nt->nt_need_ack = 1;
-   nt->nt_channel = 0;
-   nt->nt_ncode = NT_ABORT_TASK;
-   nt->nt_lreserved = inot;
-   isp_handle_platform_target_tmf(isp, nt);
-   needack = 0;
-   }
-   rls_lun_statep(isp, tptr);
+   isp_prt(isp, ISP_LOGTDEBUG0, "ABORT TASK RX_ID %x WWN 
0x%016llx",
+   inp->in_seqid, (unsigned long long) wwn);
+
+   ISP_MEMZERO(nt, sizeof (isp_notify_t));
+   nt->nt_hba = isp;
+   nt->nt_tgt = FCPARAM(isp, 0)->isp_wwpn;
+   nt->nt_wwn = wwn;
+   nt->nt_nphdl = nphdl;
+   nt->nt_sid = sid;
+   nt->nt_did = PORT_ANY;
+   nt->nt_lun = lun;
+   nt->nt_tagval = inp->in_seqid;
+   nt->nt_tagval |= (((uint64_t)(isp->isp_serno++)) << 32);
+   nt->nt_need_ack = 1;
+   nt->nt_channel = 0;
+   nt->nt_ncode = NT_ABORT_TASK;
+   nt->nt_lreserved = inp;
+   isp_handle_platform_target_tmf(isp, nt);
+   needack = 0;
break;
}
default:
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r314044 - head/sys/compat/linuxkpi/common/include/linux

2017-02-21 Thread Hans Petter Selasky
Author: hselasky
Date: Tue Feb 21 14:22:14 2017
New Revision: 314044
URL: https://svnweb.freebsd.org/changeset/base/314044

Log:
  Streamline the LinuxKPI spinlock wrappers.
  
  1) Add better spinlock debug names when WITNESS_ALL is defined.
  
  2) Make sure that the calling thread gets bound to the current CPU
  while a spinlock is locked. Some Linux kernel code depends on that the
  CPU ID doesn't change while a spinlock is locked.
  
  3) Add support for using LinuxKPI spinlocks during a panic().
  
  MFC after:1 week
  Sponsored by: Mellanox Technologies

Modified:
  head/sys/compat/linuxkpi/common/include/linux/spinlock.h

Modified: head/sys/compat/linuxkpi/common/include/linux/spinlock.h
==
--- head/sys/compat/linuxkpi/common/include/linux/spinlock.hTue Feb 21 
13:23:53 2017(r314043)
+++ head/sys/compat/linuxkpi/common/include/linux/spinlock.hTue Feb 21 
14:22:14 2017(r314044)
@@ -2,7 +2,7 @@
  * Copyright (c) 2010 Isilon Systems, Inc.
  * Copyright (c) 2010 iX Systems, Inc.
  * Copyright (c) 2010 Panasas, Inc.
- * Copyright (c) 2013, 2014 Mellanox Technologies, Ltd.
+ * Copyright (c) 2013-2017 Mellanox Technologies, Ltd.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -35,36 +35,126 @@
 #include 
 #include 
 #include 
-#include 
+#include 
 
 #include 
 #include 
+#include 
 
 typedef struct {
struct mtx m;
 } spinlock_t;
 
-#definespin_lock(_l)   mtx_lock(&(_l)->m)
-#definespin_unlock(_l) mtx_unlock(&(_l)->m)
-#definespin_trylock(_l)mtx_trylock(&(_l)->m)
-#definespin_lock_nested(_l, _n) mtx_lock_flags(&(_l)->m, MTX_DUPOK)
-#definespin_lock_irq(lock) spin_lock(lock)
-#definespin_unlock_irq(lock)   spin_unlock(lock)
-#definespin_lock_irqsave(lock, flags)  
\
-do {(flags) = 0; spin_lock(lock); } while (0)
-#definespin_unlock_irqrestore(lock, flags) 
\
-do { spin_unlock(lock); } while (0)
+/*
+ * By defining CONFIG_SPIN_SKIP LinuxKPI spinlocks and asserts will be
+ * skipped during panic(). By default it is disabled due to
+ * performance reasons.
+ */
+#ifdef CONFIG_SPIN_SKIP
+#defineSPIN_SKIP(void) unlikely(SCHEDULER_STOPPED() || kdb_active)
+#else
+#defineSPIN_SKIP(void) 0
+#endif
+
+#definespin_lock(_l) do {  \
+   if (SPIN_SKIP())\
+   break;  \
+   mtx_lock(&(_l)->m); \
+   local_bh_disable(); \
+} while (0)
+
+#definespin_lock_bh(_l) do {   \
+   spin_lock(_l);  \
+} while (0)
+
+#definespin_lock_irq(_l) do {  \
+   spin_lock(_l);  \
+} while (0)
+
+#definespin_unlock(_l) do {\
+   if (SPIN_SKIP())\
+   break;  \
+   local_bh_enable();  \
+   mtx_unlock(&(_l)->m);   \
+} while (0)
+
+#definespin_unlock_bh(_l) do { \
+   spin_unlock(_l);\
+} while (0)
+
+#definespin_unlock_irq(_l) do {\
+   spin_unlock(_l);\
+} while (0)
+
+#definespin_trylock(_l) ({ \
+   int __ret;  \
+   if (SPIN_SKIP()) {  \
+   __ret = 1;  \
+   } else {\
+   __ret = mtx_trylock(&(_l)->m);  \
+   if (likely(__ret != 0)) \
+   local_bh_disable(); \
+   }   \
+   __ret;  \
+})
+
+#definespin_lock_nested(_l, _n) do {   \
+   if (SPIN_SKIP())\
+   break;  \
+   mtx_lock_flags(&(_l)->m, MTX_DUPOK);\
+   local_bh_disable(); \
+} while (0)
+
+#definespin_lock_irqsave(_l, flags) do {   \
+   (flags) = 0;\
+   spin_lock(_l);  \
+} while (0)
+
+#definespin_lock_irqsave_nested(_l, flags, _n) do {\
+   (flags) = 0;\
+   spin_lock_nested(_l, _n);   \
+} while (0)
+
+#definespin_unlock_irqrestore(_l, flags) do {  \
+   spin_unlock(_l);\
+} while (0)
+
+#ifdef WITNESS_ALL
+/* NOTE: the maximum WITNESS name is 64 chars */
+#define__spin_lock_name(name, file, line)  \
+   (((const char *){file ":" #line 

Re: svn commit: r313982 - in head/sys/dev: agp al_eth an arcmsr bce beri/virtio bhnd/cores/usb buslogic ce cm cp ctau cx de ed fatm fe firewire hptiop hptmv iicbus isp le md ncr netmap ofw patm pccard

2017-02-21 Thread Bruce Evans

On Mon, 20 Feb 2017, Conrad Meyer wrote:


On Sun, Feb 19, 2017 at 7:43 PM, Pedro F. Giffuni  wrote:

...
Log:
  sys/dev: Replace zero with NULL for pointers.

  Makes things easier to read, plus architectures may set NULL to something
  different than zero.

...
I like the change for style reasons.

The comment about architectures with non-zero NULL is a little
misleading, though.  This change has no impact on non-zero bit pattern
NULL architectures.  The zero pointer value in C is NULL and NULL is
the zero pointer value in C.  It may have a bit pattern other than
zero (i.e., printf("%p", NULL) may be non-zero and memset(, 0,
sizeof(p)) is bogus in portable code) but assigning the logical zero
value is always legitimate.


This is well known.  Some details in the above are mis-stated:
- that this change has no effect might depend on using prototypes.  The
  changed areas sometimes used NULL for function args near plain 0 in
  assignments.  This is just a larger style bug than using either 0 or
  NULL consistently, since everything in the kernel uses prototypes.
  This was a bug in K code.  Correct K has cast 0 or NULL in function
  args, but this is painful, so nearby assignments shouldn't use the same
  style.  NULL can be:
(a) an integer constant expression with value 0.  E.g., (2 + 2L - 4ULL)
(b) ((void *)(a))
  So for unprototypes functions taking a pointer arg, uncast NULL is only
  correct if NULL happens to be ((void *)(a)) and the type that the
  function takes is 'void *' or possibly 'qualified void *'.  (I forget
  if there is magic to allow qualifiers.)
- there is no such thing as the zero pointer value.  There are only
  null pointer constants.  Null pointer constants are (a) and (b) as
  above.  These arq quite different from null pointers.  (a) only has
  value 0 as an integer.  Casting this to (void *) gives a pointer,
  but I think it is still magic, so can have a different representation
  than when it is converted to a null pointer:
np = (void *)0;
  may either retain all-bits-0 or change them to a nonzero magic value
  in the cast of 0, then convert to different magic bits (even back
  to all-bits 0) in np.
- printf("%p", NULL) is not just unportable, but undefined in general,
  since printf() is variadic so this is broken like the unprototyped
  case.  It is undefined even if pointers have all bits 0, since NULL
- the changed code retains the style bug of explicit initialization of
  static null pointers.  It is implicitly to null pointer constants
  which get converted in the same way as integer 0 or NULL.



After all, NULL is just a casted zero value:

#define NULL((void *)0)


Hmm, that is correct for C, but this is an implementation detail.  NULL
is actually a convoluted mess:  from sys/_null.h

X #ifndef NULL
X 
X #if !defined(__cplusplus)

X #define   NULL((void *)0)

The non-C++ case is now simple, but this defeats the excuse for
existence of this file.  This file was originally just to support C
and allow defining NULL in a central place as 0L for __LP64__ only,
while keeping the old definition as 0 for other cases, with extra
complications for __KERNEL.  Only broken programs noticed the
difference.  Mainly ones not using prototypes which has mostly gone
away before this change was made.  The ifdef allowed exposing type
errors by changing the definition to weirder ones.  0L for __LP64__
and 0 for !__LP64__ did the reverse.  ((void *)0) is even more
forgiving, except it exposes the type error of using NULL for integer 0.

Eventually the definition was changed to ((void *)0) as above.  I don't
like this since it only helps broken C programs and is wrong for C++.
The file was retained to support C++, and grew messes.

X #else
X #if __cplusplus >= 201103L
X #define   NULLnullptr
X #elif defined(__GNUG__) && defined(__GNUC__) && __GNUC__ >= 4
X #define   NULL__null
X #else
X #if defined(__LP64__)
X #define   NULL(0L)

The commit that changed the C case to use ((void *)0) was missing
parentheses.  The commit that fixed this also added parentheses that
were not missing to 0L.  This remains as a style bug.

X #else
X #define   NULL0
X #endif/* __LP64__ */
X #endif/* __GNUG__ */
X #endif/* !__cplusplus */

Style bugs:
- tab instead of space after #endif
- no comment on any #else, and perhaps too comments on too many #endif's.
  Comments on the inner ifdefs unimprove readabilty, but the set of ifdefs
  is so convoluted that it is hard to see which #else or #elseif is inner.


Maybe this is moot.  I don't believe any architecture FreeBSD actually
supports has non-zero bitpattern NULL, but something weird like CHERI
might.


Compilers should do portability checks on it.  In fact, the convolutions
in this file do little except define nullptr and __null to let compilers
do more checking.  Only the C++ case even has them.  Compilers can do
most checks using just the C90 definition of null 

Re: svn commit: r313975 - in head: contrib/openpam contrib/openpam/bin contrib/openpam/bin/openpam_dump_policy contrib/openpam/bin/pamtest contrib/openpam/bin/su contrib/openpam/doc contrib/openpam/do

2017-02-21 Thread Dag-Erling Smørgrav
Bryan Drewery  writes:
> Did you intend to delete the tests?

Yes.  It just occurred to me that they should probably be added to
ObsoleteFiles.inc...

DES
-- 
Dag-Erling Smørgrav - d...@des.no
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

svn commit: r314043 - in head/sys: compat/linuxkpi/common/include/linux compat/linuxkpi/common/src conf modules/linuxkpi

2017-02-21 Thread Hans Petter Selasky
Author: hselasky
Date: Tue Feb 21 13:23:53 2017
New Revision: 314043
URL: https://svnweb.freebsd.org/changeset/base/314043

Log:
  Add support for LinuxKPI tasklets.
  
  Tasklets are implemented using a taskqueue and a small statemachine on
  top. The additional statemachine is required to ensure all LinuxKPI
  tasklets get serialized. FreeBSD taskqueues do not guarantee
  serialisation of its tasks, except when there is only one worker
  thread configured.
  
  MFC after:1 week
  Sponsored by: Mellanox Technologies

Added:
  head/sys/compat/linuxkpi/common/include/linux/bottom_half.h   (contents, 
props changed)
  head/sys/compat/linuxkpi/common/src/linux_tasklet.c   (contents, props 
changed)
Modified:
  head/sys/compat/linuxkpi/common/include/linux/interrupt.h
  head/sys/conf/files
  head/sys/modules/linuxkpi/Makefile

Added: head/sys/compat/linuxkpi/common/include/linux/bottom_half.h
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/sys/compat/linuxkpi/common/include/linux/bottom_half.h Tue Feb 21 
13:23:53 2017(r314043)
@@ -0,0 +1,34 @@
+/*-
+ * Copyright (c) 2017 Hans Petter Selasky
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice unmodified, this list of conditions, and the following
+ *disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * $FreeBSD$
+ */
+#ifndef _LINUX_BOTTOM_HALF_H_
+#define_LINUX_BOTTOM_HALF_H_
+
+extern void local_bh_enable(void);
+extern void local_bh_disable(void);
+
+#endif /* _LINUX_BOTTOM_HALF_H_ */

Modified: head/sys/compat/linuxkpi/common/include/linux/interrupt.h
==
--- head/sys/compat/linuxkpi/common/include/linux/interrupt.h   Tue Feb 21 
12:51:45 2017(r314042)
+++ head/sys/compat/linuxkpi/common/include/linux/interrupt.h   Tue Feb 21 
13:23:53 2017(r314043)
@@ -148,4 +148,25 @@ free_irq(unsigned int irq, void *device)
kfree(irqe);
 }
 
+/*
+ * LinuxKPI tasklet support
+ */
+typedef void tasklet_func_t(unsigned long);
+
+struct tasklet_struct {
+   TAILQ_ENTRY(tasklet_struct) entry;
+   tasklet_func_t *func;
+   unsigned long data;
+};
+
+#defineDECLARE_TASKLET(name, func, data)   \
+struct tasklet_struct name = { { NULL, NULL }, func, data }
+
+#definetasklet_hi_schedule(t)  tasklet_schedule(t)
+
+extern void tasklet_schedule(struct tasklet_struct *);
+extern void tasklet_kill(struct tasklet_struct *);
+extern void tasklet_init(struct tasklet_struct *, tasklet_func_t *,
+unsigned long data);
+
 #endif /* _LINUX_INTERRUPT_H_ */

Added: head/sys/compat/linuxkpi/common/src/linux_tasklet.c
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/sys/compat/linuxkpi/common/src/linux_tasklet.c Tue Feb 21 13:23:53 
2017(r314043)
@@ -0,0 +1,183 @@
+/*-
+ * Copyright (c) 2017 Hans Petter Selasky
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice unmodified, this list of conditions, and the following
+ *disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY 

svn commit: r314040 - in head/sys: compat/linuxkpi/common/include/linux compat/linuxkpi/common/src conf modules/linuxkpi sys

2017-02-21 Thread Hans Petter Selasky
Author: hselasky
Date: Tue Feb 21 12:43:02 2017
New Revision: 314040
URL: https://svnweb.freebsd.org/changeset/base/314040

Log:
  Make the LinuxKPI task struct persistent accross system calls.
  
  A set of helper functions have been added to manage the life of the
  LinuxKPI task struct. When an external system call or task is invoked,
  a check is made to create the task struct by demand. A thread
  destructor callback is registered to free the task struct when a
  thread exits to avoid memory leaks.
  
  This change lays the ground for emulating the Linux kernel more
  closely which is a dependency by the code using the LinuxKPI APIs.
  
  Add new dedicated td_lkpi_task field has been added to struct thread
  instead of abusing td_retval[1].
  
  Fix some header file inclusions to make LINT kernel build properly
  after this change.
  
  Bump the __FreeBSD_version to force a rebuild of all kernel modules.
  
  MFC after:1 week
  Sponsored by: Mellanox Technologies

Added:
  head/sys/compat/linuxkpi/common/src/linux_current.c   (contents, props 
changed)
  head/sys/compat/linuxkpi/common/src/linux_kthread.c   (contents, props 
changed)
Modified:
  head/sys/compat/linuxkpi/common/include/linux/bitops.h
  head/sys/compat/linuxkpi/common/include/linux/compat.h
  head/sys/compat/linuxkpi/common/include/linux/file.h
  head/sys/compat/linuxkpi/common/include/linux/jiffies.h
  head/sys/compat/linuxkpi/common/include/linux/kdev_t.h
  head/sys/compat/linuxkpi/common/include/linux/kernel.h
  head/sys/compat/linuxkpi/common/include/linux/kthread.h
  head/sys/compat/linuxkpi/common/include/linux/rwlock.h
  head/sys/compat/linuxkpi/common/include/linux/rwsem.h
  head/sys/compat/linuxkpi/common/include/linux/sched.h
  head/sys/compat/linuxkpi/common/include/linux/semaphore.h
  head/sys/compat/linuxkpi/common/include/linux/spinlock.h
  head/sys/compat/linuxkpi/common/include/linux/types.h
  head/sys/compat/linuxkpi/common/include/linux/wait.h
  head/sys/compat/linuxkpi/common/src/linux_compat.c
  head/sys/compat/linuxkpi/common/src/linux_pci.c
  head/sys/conf/files
  head/sys/modules/linuxkpi/Makefile
  head/sys/sys/param.h
  head/sys/sys/proc.h

Modified: head/sys/compat/linuxkpi/common/include/linux/bitops.h
==
--- head/sys/compat/linuxkpi/common/include/linux/bitops.h  Tue Feb 21 
12:37:59 2017(r314039)
+++ head/sys/compat/linuxkpi/common/include/linux/bitops.h  Tue Feb 21 
12:43:02 2017(r314040)
@@ -31,6 +31,7 @@
 #ifndef_LINUX_BITOPS_H_
 #define_LINUX_BITOPS_H_
 
+#include 
 #include 
 #include 
 #include 

Modified: head/sys/compat/linuxkpi/common/include/linux/compat.h
==
--- head/sys/compat/linuxkpi/common/include/linux/compat.h  Tue Feb 21 
12:37:59 2017(r314039)
+++ head/sys/compat/linuxkpi/common/include/linux/compat.h  Tue Feb 21 
12:43:02 2017(r314040)
@@ -2,7 +2,7 @@
  * Copyright (c) 2010 Isilon Systems, Inc.
  * Copyright (c) 2010 iX Systems, Inc.
  * Copyright (c) 2010 Panasas, Inc.
- * Copyright (c) 2013, 2014 Mellanox Technologies, Ltd.
+ * Copyright (c) 2013-2017 Mellanox Technologies, Ltd.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -31,10 +31,29 @@
 #ifndef_LINUX_COMPAT_H_
 #define_LINUX_COMPAT_H_
 
+#include 
+#include 
+#include 
+
 struct thread;
 struct task_struct;
 
-void linux_set_current(struct thread *td, struct task_struct *t);
-void linux_clear_current(struct thread *td);
+extern int linux_alloc_current(struct thread *, int flags);
+extern void linux_free_current(struct task_struct *);
+
+static inline void
+linux_set_current(struct thread *td)
+{
+   if (__predict_false(td->td_lkpi_task == NULL))
+   linux_alloc_current(td, M_WAITOK);
+}
+
+static inline int
+linux_set_current_flags(struct thread *td, int flags)
+{
+   if (__predict_false(td->td_lkpi_task == NULL))
+   return (linux_alloc_current(td, flags));
+   return (0);
+}
 
 #endif /* _LINUX_COMPAT_H_ */

Modified: head/sys/compat/linuxkpi/common/include/linux/file.h
==
--- head/sys/compat/linuxkpi/common/include/linux/file.hTue Feb 21 
12:37:59 2017(r314039)
+++ head/sys/compat/linuxkpi/common/include/linux/file.hTue Feb 21 
12:43:02 2017(r314040)
@@ -39,6 +39,7 @@
 #include 
 
 #include 
+#include 
 
 struct linux_file;
 

Modified: head/sys/compat/linuxkpi/common/include/linux/jiffies.h
==
--- head/sys/compat/linuxkpi/common/include/linux/jiffies.h Tue Feb 21 
12:37:59 2017(r314039)
+++ head/sys/compat/linuxkpi/common/include/linux/jiffies.h Tue Feb 21 
12:43:02 2017(r314040)
@@ 

svn commit: r314039 - head/usr.bin/sockstat

2017-02-21 Thread Renato Botelho
Author: garga (ports committer)
Date: Tue Feb 21 12:37:59 2017
New Revision: 314039
URL: https://svnweb.freebsd.org/changeset/base/314039

Log:
  Fix style(9)
  
  Reviewed by:  ngie, tuexen, vangyzen, allanjude
  Approved by:  allanjude
  MFC after:1 week
  Sponsored by: Rubicon Communications (Netgate)
  Differential Revision:https://reviews.freebsd.org/D9588

Modified:
  head/usr.bin/sockstat/sockstat.c

Modified: head/usr.bin/sockstat/sockstat.c
==
--- head/usr.bin/sockstat/sockstat.cTue Feb 21 12:29:07 2017
(r314038)
+++ head/usr.bin/sockstat/sockstat.cTue Feb 21 12:37:59 2017
(r314039)
@@ -88,9 +88,9 @@ static size_t  numprotos; /* allocated s
 
 static int *ports;
 
-#define INT_BIT (sizeof(int)*CHAR_BIT)
-#define SET_PORT(p) do { ports[p / INT_BIT] |= 1 << (p % INT_BIT); } while (0)
-#define CHK_PORT(p) (ports[p / INT_BIT] & (1 << (p % INT_BIT)))
+#defineINT_BIT (sizeof(int)*CHAR_BIT)
+#defineSET_PORT(p) do { ports[p / INT_BIT] |= 1 << (p % INT_BIT); } 
while (0)
+#defineCHK_PORT(p) (ports[p / INT_BIT] & (1 << (p % INT_BIT)))
 
 struct addr {
struct sockaddr_storage address;
@@ -111,7 +111,7 @@ struct sock {
struct sock *next;
 };
 
-#define HASHSIZE 1009
+#defineHASHSIZE 1009
 static struct sock *sockhash[HASHSIZE];
 
 static struct xfile *xfiles;
@@ -131,7 +131,6 @@ xprintf(const char *fmt, ...)
return (len);
 }
 
-
 static int
 get_proto_type(const char *proto)
 {
@@ -147,7 +146,6 @@ get_proto_type(const char *proto)
return (pent->p_proto);
 }
 
-
 static void
 init_protos(int num)
 {
@@ -167,7 +165,6 @@ init_protos(int num)
numprotos = proto_count;
 }
 
-
 static int
 parse_protos(char *protospec)
 {
@@ -190,7 +187,6 @@ parse_protos(char *protospec)
return (proto_index);
 }
 
-
 static void
 parse_ports(const char *portspec)
 {
@@ -359,27 +355,27 @@ gather_sctp(void)
err(1, "malloc()");
switch (xladdr->address.sa.sa_family) {
case AF_INET:
-#define __IN_IS_ADDR_LOOPBACK(pina) \
+#define__IN_IS_ADDR_LOOPBACK(pina) \
((ntohl((pina)->s_addr) >> IN_CLASSA_NSHIFT) == IN_LOOPBACKNET)
-   if 
(!__IN_IS_ADDR_LOOPBACK(>address.sin.sin_addr))
+   if (!__IN_IS_ADDR_LOOPBACK(
+   >address.sin.sin_addr))
local_all_loopback = 0;
-#undef __IN_IS_ADDR_LOOPBACK
-   sockaddr(>address,
-AF_INET,
->address.sin.sin_addr,
-htons(xinpcb->local_port));
+#undef __IN_IS_ADDR_LOOPBACK
+   sockaddr(>address, AF_INET,
+   >address.sin.sin_addr,
+   htons(xinpcb->local_port));
break;
case AF_INET6:
-   if 
(!IN6_IS_ADDR_LOOPBACK(>address.sin6.sin6_addr))
+   if (!IN6_IS_ADDR_LOOPBACK(
+   >address.sin6.sin6_addr))
local_all_loopback = 0;
-   sockaddr(>address,
-AF_INET6,
->address.sin6.sin6_addr,
-htons(xinpcb->local_port));
+   sockaddr(>address, AF_INET6,
+   >address.sin6.sin6_addr,
+   htons(xinpcb->local_port));
break;
default:
errx(1, "address family %d not supported",
-xladdr->address.sa.sa_family);
+   xladdr->address.sa.sa_family);
}
laddr->next = NULL;
if (prev_laddr == NULL)
@@ -389,33 +385,38 @@ gather_sctp(void)
prev_laddr = laddr;
}
if (sock->laddr == NULL) {
-   if ((sock->laddr = calloc(1, sizeof(struct addr))) == 
NULL)
+   if ((sock->laddr =
+   calloc(1, sizeof(struct addr))) == NULL)
err(1, "malloc()");
sock->laddr->address.ss_family = sock->family;
if (sock->family == AF_INET)
-   sock->laddr->address.ss_len = sizeof(struct 
sockaddr_in);
+   sock->laddr->address.ss_len =
+   sizeof(struct sockaddr_in);

svn commit: r314038 - head/sys/dev/isp

2017-02-21 Thread Alexander Motin
Author: mav
Date: Tue Feb 21 12:29:07 2017
New Revision: 314038
URL: https://svnweb.freebsd.org/changeset/base/314038

Log:
  Remove ancient __FreeBSD_version checks.
  
  MFC after:2 weeks

Modified:
  head/sys/dev/isp/isp_freebsd.c
  head/sys/dev/isp/isp_freebsd.h

Modified: head/sys/dev/isp/isp_freebsd.c
==
--- head/sys/dev/isp/isp_freebsd.c  Tue Feb 21 12:24:31 2017
(r314037)
+++ head/sys/dev/isp/isp_freebsd.c  Tue Feb 21 12:29:07 2017
(r314038)
@@ -41,12 +41,6 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 
-#if__FreeBSD_version < 82 
-#defineTHREAD_CREATE   kthread_create
-#else
-#defineTHREAD_CREATE   kproc_create
-#endif
-
 MODULE_VERSION(isp, 1);
 MODULE_DEPEND(isp, cam, 1, 1, 1);
 int isp_announced = 0;
@@ -176,7 +170,8 @@ isp_attach_chan(ispsoftc_t *isp, struct 
 #endif
isp_loop_changed(isp, chan);
ISP_UNLOCK(isp);
-   if (THREAD_CREATE(isp_kthread, fc, >kproc, 0, 0, "%s: 
fc_thrd%d", device_get_nameunit(isp->isp_osinfo.dev), chan)) {
+   if (kproc_create(isp_kthread, fc, >kproc, 0, 0,
+   "%s_%d", device_get_nameunit(isp->isp_osinfo.dev), chan)) {
xpt_free_path(fc->path);
ISP_LOCK(isp);
xpt_bus_deregister(cam_sim_path(fc->sim));

Modified: head/sys/dev/isp/isp_freebsd.h
==
--- head/sys/dev/isp/isp_freebsd.h  Tue Feb 21 12:24:31 2017
(r314037)
+++ head/sys/dev/isp/isp_freebsd.h  Tue Feb 21 12:29:07 2017
(r314038)
@@ -88,14 +88,6 @@ isp_ecmd_t * isp_get_ecmd(struct ispsoft
 void   isp_put_ecmd(struct ispsoftc *, isp_ecmd_t *);
 
 #ifdef ISP_TARGET_MODE
-/* Not quite right, but there was no bump for this change */
-#if __FreeBSD_version < 225469
-#defineSDFIXED(x)  ()
-#else
-#defineSDFIXED(x)  ((struct scsi_sense_data_fixed *)())
-#endif
-
-#defineISP_TARGET_FUNCTIONS1
 #defineATPDPSIZE   4096
 #defineATPDPHASHSIZE   32
 #defineATPDPHASH(x)x) >> 24) ^ ((x) >> 16) ^ ((x) >> 8) ^ (x)) 
&  \
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r314037 - head/sys/dev/jedec_ts

2017-02-21 Thread Andriy Gapon
Author: avg
Date: Tue Feb 21 12:24:31 2017
New Revision: 314037
URL: https://svnweb.freebsd.org/changeset/base/314037

Log:
  jedec_ts: fix slave address check
  
  The mask should cover all bits that can not vary.
  
  MFC after:3 days

Modified:
  head/sys/dev/jedec_ts/jedec_ts.c

Modified: head/sys/dev/jedec_ts/jedec_ts.c
==
--- head/sys/dev/jedec_ts/jedec_ts.cTue Feb 21 09:37:33 2017
(r314036)
+++ head/sys/dev/jedec_ts/jedec_ts.cTue Feb 21 12:24:31 2017
(r314037)
@@ -104,7 +104,7 @@ ts_attach(device_t dev)
uint8_t addr;
 
addr = smbus_get_addr(dev);
-   if ((addr & 0x30) != 0x30) {
+   if ((addr & 0xf0) != 0x30) {
/* Up to 8 slave devices starting at 0x30. */
return (ENXIO);
}
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r314036 - head/usr.sbin/bsdinstall/scripts

2017-02-21 Thread Bartek Rutkowski
Author: robak (ports committer)
Date: Tue Feb 21 09:37:33 2017
New Revision: 314036
URL: https://svnweb.freebsd.org/changeset/base/314036

Log:
  Enable bsdinstall hardening options by default.
  
  As discussed previously, in order to introduce new OS hardening
  defaults, we've added them to bsdinstall in 'off by default' mode.
  It has been there for a while, so the next step is to change them
  to 'on by defaul' mode, so that in future we could simply enable
  them in base OS.
  
  Reviewed by:  brd
  Approved by:  adrian
  Differential Revision:https://reviews.freebsd.org/D9641

Modified:
  head/usr.sbin/bsdinstall/scripts/hardening

Modified: head/usr.sbin/bsdinstall/scripts/hardening
==
--- head/usr.sbin/bsdinstall/scripts/hardening  Tue Feb 21 09:33:21 2017
(r314035)
+++ head/usr.sbin/bsdinstall/scripts/hardening  Tue Feb 21 09:37:33 2017
(r314036)
@@ -36,15 +36,15 @@ FEATURES=$( dialog --backtitle "FreeBSD 
 --title "System Hardening" --nocancel --separate-output \
 --checklist "Choose system security hardening options:" \
 0 0 0 \
-   "0 hide_uids" "Hide processes running as other users" ${hide_uids:-off} 
\
-   "1 hide_gids" "Hide processes running as other groups" 
${hide_gids:-off} \
-   "2 read_msgbuf" "Disable reading kernel message buffer for unprivileged 
users" ${read_msgbuf:-off} \
-   "3 proc_debug" "Disable process debugging facilities for unprivileged 
users" ${proc_debug:-off} \
-   "4 random_pid" "Randomize the PID of newly created processes" 
${random_pid:-off} \
-   "5 stack_guard" "Insert stack guard page ahead of the growable 
segments" ${stack_guard:-off} \
-   "6 clear_tmp" "Clean the /tmp filesystem on system startup" 
${clear_tmp:-off} \
-   "7 disable_syslogd" "Disable opening Syslogd network socket (disables 
remote logging)" ${disable_syslogd:-off} \
-   "8 disable_sendmail" "Disable Sendmail service" 
${disable_sendmail:-off} \
+   "0 hide_uids" "Hide processes running as other users" ${hide_uids:-on} \
+   "1 hide_gids" "Hide processes running as other groups" ${hide_gids:-on} 
\
+   "2 read_msgbuf" "Disable reading kernel message buffer for unprivileged 
users" ${read_msgbuf:-on} \
+   "3 proc_debug" "Disable process debugging facilities for unprivileged 
users" ${proc_debug:-on} \
+   "4 random_pid" "Randomize the PID of newly created processes" 
${random_pid:-on} \
+   "5 stack_guard" "Insert stack guard page ahead of the growable 
segments" ${stack_guard:-on} \
+   "6 clear_tmp" "Clean the /tmp filesystem on system startup" 
${clear_tmp:-on} \
+   "7 disable_syslogd" "Disable opening Syslogd network socket (disables 
remote logging)" ${disable_syslogd:-on} \
+   "8 disable_sendmail" "Disable Sendmail service" ${disable_sendmail:-on} 
\
 2>&1 1>&3 )
 exec 3>&-
 
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r313268 - head/sys/kern [through -r313271 for atomic_fcmpset use and later: fails on PowerMac G5 "Quad Core"; -r313266 works]

2017-02-21 Thread Mark Millard
[Back to the powerpc64 context.]

On 2017-Feb-20, at 11:10 AM, Mateusz Guzik  wrote:

> On Sat, Feb 18, 2017 at 04:18:05AM -0800, Mark Millard wrote:
>> [Note: I experiment with clang based powerpc64 builds,
>> reporting problems that I find. Justin is familiar
>> with this, as is Nathan.]
>> 
>> I tried to update the PowerMac G5 (a so-called "Quad Core")
>> that I have access to from head -r312761 to -r313864 and
>> ended up with random panics and hang ups in fairly short
>> order after booting.
>> 
>> Some approximate bisecting for the kernel lead to:
>> (sometimes getting part way into a buildkernel attempt
>> for a different version before a failure happens)
>> 
>> -r313266: works (just before use of atomic_fcmpset)
>> vs.
>> -r313271: fails (last of the "use atomic_fcmpset" check-ins)
>> 
>> (I did not try -r313268 through -r313270 as the use was
>> gradually added.)
>> 
>> So I'm currently running a -r313864 world with a -r313266
>> kernel.
>> 
>> No kernel that I tried that was from before -r313266 had the
>> problems.
>> 
>> Any kernel that I tried that was from after -r313271 had the
>> problems.
>> 
>> Of course I did not try them all in other direction. :)
>> 
> 
> I found that spin mutexes were not properly handling this, fixed in
> r313996.
> 
> Locally I added a if (cpu_tick() % 2) return (0); snipped to amd64
> fcmpset to simulate failures. Everything works, while it would easily
> fail without the patch.
> 
> That said, I hope this concludes the 'missing check for not-reread value
> of failed fcmpset' saga.
> 
> -- 
> Mateusz Guzik 

-r313999 is an improvement for powerpc64: it boots and I can
log in on the old PowerMac G5 so-called "Quad Core".

But, e.g., buildworld buildkernel eventually hangs and later
the powerpc64 panics for "spin lock held too long".

===
Mark Millard
markmi at dsl-only.net

___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r314035 - head/sys/x86/x86

2017-02-21 Thread Andriy Gapon
Author: avg
Date: Tue Feb 21 09:33:21 2017
New Revision: 314035
URL: https://svnweb.freebsd.org/changeset/base/314035

Log:
  mca: change type of last_intr to time_t for consinstency
  
  time_uptime is time_t
  
  MFC after:1 day
  X-MFC with:   r313752

Modified:
  head/sys/x86/x86/mca.c

Modified: head/sys/x86/x86/mca.c
==
--- head/sys/x86/x86/mca.c  Tue Feb 21 09:29:46 2017(r314034)
+++ head/sys/x86/x86/mca.c  Tue Feb 21 09:33:21 2017(r314035)
@@ -73,7 +73,7 @@ enum scan_mode {
  */
 struct cmc_state {
int max_threshold;
-   int last_intr;
+   time_t  last_intr;
 };
 #endif
 
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"