Re: svn commit: r295796 - head/sys/net

2016-02-18 Thread Marcelo Araujo
2016-02-19 15:03 GMT+08:00 Kubilay Kocak :

> On 19/02/2016 5:35 PM, Marcelo Araujo wrote:
> > Author: araujo
> > Date: Fri Feb 19 06:35:53 2016
> > New Revision: 295796
> > URL: https://svnweb.freebsd.org/changeset/base/295796
> >
> > Log:
> >   Fix regression introduced on 272446r.
> >
> >   lagg(4) supports the protocol none, where it disables any traffic
> without
> >   disabling the lagg(4) interface itself.
> >
> >   PR: 206921
> >   Submitted by:   Pushkar Kothavade 
> >   Reviewed by:rpokala
> >   Approved by:bapt (mentor)
> >   MFC after:  3 weeks
> >   Sponsored by:   gandi.net
> >   Differential Revision:  https://reviews.freebsd.org/D5076
> >
>
> 10.3-R candidate?
>
>
Yes, it is!

But the patch for 10-Stable is different than the one for HEAD, because
lagg(4) code change between releases.

Patch for 10-Stable here:
https://reviews.freebsd.org/D5226

I have contacted re@ already! I will do again.


Best,
-- 

-- 
Marcelo Araujo(__)ara...@freebsd.org
\\\'',)http://www.FreeBSD.org    \/  \ ^
Power To Server. .\. /_)
___
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: r295796 - head/sys/net

2016-02-18 Thread Kubilay Kocak
On 19/02/2016 5:35 PM, Marcelo Araujo wrote:
> Author: araujo
> Date: Fri Feb 19 06:35:53 2016
> New Revision: 295796
> URL: https://svnweb.freebsd.org/changeset/base/295796
> 
> Log:
>   Fix regression introduced on 272446r.
>   
>   lagg(4) supports the protocol none, where it disables any traffic without
>   disabling the lagg(4) interface itself.
>   
>   PR: 206921
>   Submitted by:   Pushkar Kothavade 
>   Reviewed by:rpokala
>   Approved by:bapt (mentor)
>   MFC after:  3 weeks
>   Sponsored by:   gandi.net
>   Differential Revision:  https://reviews.freebsd.org/D5076
> 

10.3-R candidate?

___
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: r295797 - head/lib/libc/gen

2016-02-18 Thread Kevin Lo
Author: kevlo
Date: Fri Feb 19 06:50:00 2016
New Revision: 295797
URL: https://svnweb.freebsd.org/changeset/base/295797

Log:
  Remove sys/types.h

Modified:
  head/lib/libc/gen/directory.3

Modified: head/lib/libc/gen/directory.3
==
--- head/lib/libc/gen/directory.3   Fri Feb 19 06:35:53 2016
(r295796)
+++ head/lib/libc/gen/directory.3   Fri Feb 19 06:50:00 2016
(r295797)
@@ -28,7 +28,7 @@
 .\" @(#)directory.38.1 (Berkeley) 6/4/93
 .\" $FreeBSD$
 .\"
-.Dd May 6, 2015
+.Dd February 19, 2016
 .Dt DIRECTORY 3
 .Os
 .Sh NAME
@@ -46,7 +46,6 @@
 .Sh LIBRARY
 .Lb libc
 .Sh SYNOPSIS
-.In sys/types.h
 .In dirent.h
 .Ft DIR *
 .Fn opendir "const char *filename"
___
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: r295796 - head/sys/net

2016-02-18 Thread Marcelo Araujo
Author: araujo
Date: Fri Feb 19 06:35:53 2016
New Revision: 295796
URL: https://svnweb.freebsd.org/changeset/base/295796

Log:
  Fix regression introduced on 272446r.
  
  lagg(4) supports the protocol none, where it disables any traffic without
  disabling the lagg(4) interface itself.
  
  PR:   206921
  Submitted by: Pushkar Kothavade 
  Reviewed by:  rpokala
  Approved by:  bapt (mentor)
  MFC after:3 weeks
  Sponsored by: gandi.net
  Differential Revision:https://reviews.freebsd.org/D5076

Modified:
  head/sys/net/if_lagg.c

Modified: head/sys/net/if_lagg.c
==
--- head/sys/net/if_lagg.c  Fri Feb 19 05:59:38 2016(r295795)
+++ head/sys/net/if_lagg.c  Fri Feb 19 06:35:53 2016(r295796)
@@ -1260,7 +1260,7 @@ lagg_ioctl(struct ifnet *ifp, u_long cmd
error = priv_check(td, PRIV_NET_LAGG);
if (error)
break;
-   if (ra->ra_proto < 1 || ra->ra_proto >= LAGG_PROTO_MAX) {
+   if (ra->ra_proto >= LAGG_PROTO_MAX) {
error = EPROTONOSUPPORT;
break;
}
___
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: head/bin/dd

2016-02-18 Thread Maxim Sobolev
Thanks, Thomas. IMHO this is quite serious bug in one of the core
utilities, so I suggest it gets faster MFC before 10.3 goes into beta stage
on Feb 26. The old code in RELENG_10 is just plain broken anyway now, so it
could not make it any worse. Thanks!

On Thu, Feb 18, 2016 at 12:44 AM, Thomas Quinot  wrote:

> Author: thomas
> Date: Thu Feb 18 08:44:16 2016
> New Revision: 295749
> URL: https://svnweb.freebsd.org/changeset/base/295749
>
> Log:
>   Reorganize the handling all-zeroes terminal block in sparse mode
>
>   The intent of the previous code in that case was to force
>   an explicit write, but the implementation was incorrect, and
>   as a result the write was never performed. This new implementation
>   instead uses ftruncate(2) to extend the file with a trailing hole.
>
>   Also introduce regression tests for these cases.
>
>   PR: 189284
>   (original PR whose fix introduced this bug)
>
>   PR: 207092
>
>   Differential Revision:D5248
>   Reviewed by:  sobomax,kib
>   MFC after:2 weeks
>
> Added:
>   head/bin/dd/ref.obs_zeroes   (contents, props changed)
> Modified:
>   head/bin/dd/Makefile
>   head/bin/dd/dd.c
>   head/bin/dd/dd.h
>   head/bin/dd/gen.c
>
> Modified: head/bin/dd/Makefile
>
> ==
> --- head/bin/dd/MakefileThu Feb 18 07:44:14 2016(r295748)
> +++ head/bin/dd/MakefileThu Feb 18 08:44:16 2016(r295749)
> @@ -24,7 +24,18 @@ test: ${PROG} gen
> LC_ALL=en_US.US-ASCII hexdump -C | \
> diff -I FreeBSD - ${.CURDIR}/ref.${conv}
>  .endfor
> -   @rm -f gen
> +   @${ECHO} "testing sparse file (obs zeroes)"
> +   @./gen 189284 | ./dd ibs=16 obs=8 conv=sparse of=obs_zeroes 2>
> /dev/null
> +   @hexdump -C obs_zeroes | diff -I FreeBSD -
> ${.CURDIR}/ref.obs_zeroes
> +
> +   @${ECHO} "testing spase file (all zeroes)"
> +   @./dd if=/dev/zero of=1M_zeroes bs=1048576 count=1 2> /dev/null
> +   @./dd if=1M_zeroes of=1M_zeroes.1 bs=1048576 conv=sparse 2>
> /dev/null
> +   @./dd if=1M_zeroes of=1M_zeroes.2 bs=1048576 2> /dev/null
> +   @diff 1M_zeroes 1M_zeroes.1
> +   @diff 1M_zeroes 1M_zeroes.2
> +
> +   @rm -f gen 1M_zeroes* obs_zeroes
>
>  .if ${MK_TESTS} != "no"
>  SUBDIR+=   tests
>
> Modified: head/bin/dd/dd.c
>
> ==
> --- head/bin/dd/dd.cThu Feb 18 07:44:14 2016(r295748)
> +++ head/bin/dd/dd.cThu Feb 18 08:44:16 2016(r295749)
> @@ -77,7 +77,6 @@ STAT  st; /* statistics */
>  void   (*cfunc)(void); /* conversion function */
>  uintmax_t cpy_cnt; /* # of blocks to copy */
>  static off_t   pending = 0;/* pending seek if sparse */
> -static off_t   last_sp = 0;/* size of last added sparse block */
>  u_int  ddflags = 0;/* conversion options */
>  size_t cbsz;   /* conversion block size */
>  uintmax_t files_cnt = 1;   /* # of files to copy */
> @@ -409,6 +408,15 @@ dd_close(void)
> }
> if (out.dbcnt || pending)
> dd_out(1);
> +
> +   /*
> +* If the file ends with a hole, ftruncate it to extend its size
> +* up to the end of the hole (without having to write any data).
> +*/
> +   if (out.seek_offset > 0 && (out.flags & ISTRUNC)) {
> +   if (ftruncate(out.fd, out.seek_offset) == -1)
> +   err(1, "truncating %s", out.name);
> +   }
>  }
>
>  void
> @@ -457,29 +465,27 @@ dd_out(int force)
> }
> if (sparse && !force) {
> pending += cnt;
> -   last_sp = cnt;
> nw = cnt;
> } else {
> if (pending != 0) {
> -   /* If forced to write, and we have
> no
> -* data left, we need to write the
> last
> -* sparse block explicitly.
> +   /*
> +* Seek past hole.  Note that we
> need to record the
> +* reached offset, because we
> might have no more data
> +* to write, in which case we'll
> need to call
> +* ftruncate to extend the file
> size.
>  */
> -   if (force && cnt == 0) {
> -   pending -= last_sp;
> -   assert(outp == out.db);
> -   memset(outp, 0, cnt);
> -   }
> -   if

svn commit: r295795 - head/sys/net80211

2016-02-18 Thread Andriy Voskoboinyk
Author: avos
Date: Fri Feb 19 05:59:38 2016
New Revision: 295795
URL: https://svnweb.freebsd.org/changeset/base/295795

Log:
  net80211: add few missing subtype names.
  
  - Add definitions for Timing Advertisement and Control Wrapper frames.
  - Refresh ieee80211_mgt_subtype_name and ieee80211_ctl_subtype_name
  arrays.
  - Count Timing Advertisement frames as discarded management frames in all
  modes.
  
  Approved by:  adrian (mentor)
  Differential Revision:https://reviews.freebsd.org/D5331

Modified:
  head/sys/net80211/ieee80211.h
  head/sys/net80211/ieee80211_adhoc.c
  head/sys/net80211/ieee80211_hostap.c
  head/sys/net80211/ieee80211_mesh.c
  head/sys/net80211/ieee80211_proto.c
  head/sys/net80211/ieee80211_sta.c
  head/sys/net80211/ieee80211_wds.c

Modified: head/sys/net80211/ieee80211.h
==
--- head/sys/net80211/ieee80211.h   Fri Feb 19 05:13:56 2016
(r295794)
+++ head/sys/net80211/ieee80211.h   Fri Feb 19 05:59:38 2016
(r295795)
@@ -129,6 +129,7 @@ struct ieee80211_qosframe_addr4 {
 #defineIEEE80211_FC0_SUBTYPE_REASSOC_RESP  0x30
 #defineIEEE80211_FC0_SUBTYPE_PROBE_REQ 0x40
 #defineIEEE80211_FC0_SUBTYPE_PROBE_RESP0x50
+#defineIEEE80211_FC0_SUBTYPE_TIMING_ADV0x60
 #defineIEEE80211_FC0_SUBTYPE_BEACON0x80
 #defineIEEE80211_FC0_SUBTYPE_ATIM  0x90
 #defineIEEE80211_FC0_SUBTYPE_DISASSOC  0xa0
@@ -137,6 +138,7 @@ struct ieee80211_qosframe_addr4 {
 #defineIEEE80211_FC0_SUBTYPE_ACTION0xd0
 #defineIEEE80211_FC0_SUBTYPE_ACTION_NOACK  0xe0
 /* for TYPE_CTL */
+#defineIEEE80211_FC0_SUBTYPE_CONTROL_WRAP  0x70
 #defineIEEE80211_FC0_SUBTYPE_BAR   0x80
 #defineIEEE80211_FC0_SUBTYPE_BA0x90
 #defineIEEE80211_FC0_SUBTYPE_PS_POLL   0xa0

Modified: head/sys/net80211/ieee80211_adhoc.c
==
--- head/sys/net80211/ieee80211_adhoc.c Fri Feb 19 05:13:56 2016
(r295794)
+++ head/sys/net80211/ieee80211_adhoc.c Fri Feb 19 05:59:38 2016
(r295795)
@@ -899,6 +899,7 @@ adhoc_recv_mgmt(struct ieee80211_node *n
case IEEE80211_FC0_SUBTYPE_ASSOC_RESP:
case IEEE80211_FC0_SUBTYPE_REASSOC_REQ:
case IEEE80211_FC0_SUBTYPE_REASSOC_RESP:
+   case IEEE80211_FC0_SUBTYPE_TIMING_ADV:
case IEEE80211_FC0_SUBTYPE_ATIM:
case IEEE80211_FC0_SUBTYPE_DISASSOC:
case IEEE80211_FC0_SUBTYPE_AUTH:
@@ -941,6 +942,7 @@ ahdemo_recv_mgmt(struct ieee80211_node *
case IEEE80211_FC0_SUBTYPE_REASSOC_RESP:
case IEEE80211_FC0_SUBTYPE_PROBE_REQ:
case IEEE80211_FC0_SUBTYPE_PROBE_RESP:
+   case IEEE80211_FC0_SUBTYPE_TIMING_ADV:
case IEEE80211_FC0_SUBTYPE_BEACON:
case IEEE80211_FC0_SUBTYPE_ATIM:
case IEEE80211_FC0_SUBTYPE_DISASSOC:

Modified: head/sys/net80211/ieee80211_hostap.c
==
--- head/sys/net80211/ieee80211_hostap.cFri Feb 19 05:13:56 2016
(r295794)
+++ head/sys/net80211/ieee80211_hostap.cFri Feb 19 05:59:38 2016
(r295795)
@@ -2226,6 +2226,7 @@ hostap_recv_mgmt(struct ieee80211_node *
 
case IEEE80211_FC0_SUBTYPE_ASSOC_RESP:
case IEEE80211_FC0_SUBTYPE_REASSOC_RESP:
+   case IEEE80211_FC0_SUBTYPE_TIMING_ADV:
case IEEE80211_FC0_SUBTYPE_ATIM:
IEEE80211_DISCARD(vap, IEEE80211_MSG_INPUT,
wh, NULL, "%s", "not handled");

Modified: head/sys/net80211/ieee80211_mesh.c
==
--- head/sys/net80211/ieee80211_mesh.c  Fri Feb 19 05:13:56 2016
(r295794)
+++ head/sys/net80211/ieee80211_mesh.c  Fri Feb 19 05:59:38 2016
(r295795)
@@ -2093,6 +2093,7 @@ mesh_recv_mgmt(struct ieee80211_node *ni
case IEEE80211_FC0_SUBTYPE_ASSOC_RESP:
case IEEE80211_FC0_SUBTYPE_REASSOC_REQ:
case IEEE80211_FC0_SUBTYPE_REASSOC_RESP:
+   case IEEE80211_FC0_SUBTYPE_TIMING_ADV:
case IEEE80211_FC0_SUBTYPE_ATIM:
case IEEE80211_FC0_SUBTYPE_DISASSOC:
case IEEE80211_FC0_SUBTYPE_AUTH:

Modified: head/sys/net80211/ieee80211_proto.c
==
--- head/sys/net80211/ieee80211_proto.c Fri Feb 19 05:13:56 2016
(r295794)
+++ head/sys/net80211/ieee80211_proto.c Fri Feb 19 05:59:38 2016
(r295795)
@@ -64,14 +64,14 @@ __FBSDID("$FreeBSD$");
 
 const char *ieee80211_mgt_subtype_name[] = {
"assoc_req","assoc_resp",   "reassoc_req",  "reassoc_resp",
-   "probe_req","probe_resp",   "reserved#6",   "reserved#7",
+   "probe_req","probe_resp",   "t

Re: svn commit: r229537 - in head/sys: conf geom/uncompress modules/geom/geom_uncompress

2016-02-18 Thread Maxim Sobolev
On Thu, Feb 18, 2016 at 9:32 PM, Adrian Chadd  wrote:

> Sure. But someone has to do that, and I made a decision that it was
> better to commit /something/ than for everyone involved to run out of
> time and nothing to be committed.
>

Well, arguably at the time of commit you had somebody who was at least
somewhat motivated (i.e. ray@) to do it and you were in good position to
request it's to be done before the commit is allowed to go through. None of
which is probably true today, so we are stuck in this position with no real
plan on how/when it's going to be resolved.


> eg - a lot of ARM and MIPS work.
>
> So yes, I'd love to see it fixed. I mean, heck, I fix up other stuff
> and I completely forgot that this was still split. But geom_ulzma /
> geom_gzip actually got us a whole lot of MIPS (and maybe some ARM)
> users, so I believe it was worthwhile.
>

That's fine and dandy but on the flip side it also means there are some
users now to be distracted and possibly confused once things hopefully get
straightened out and one of those goes away. I am pretty sure there are
some build scripts  that would need to be adjusted and kernel/boot
configurations to be corrected by the said users and it's not a good thing.
Have few of those myself, no reasons to believe I am unique.

Anyway, I'll probably shut up now.
___
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: r229537 - in head/sys: conf geom/uncompress modules/geom/geom_uncompress

2016-02-18 Thread Maxim Sobolev
Also in purely technical department, that fork should have been done using
svn copy for all code, manpages etc, not svn add, so that we would keep all
history associated with the code going back to 2004. This would also make
it more prominent that the code is really very similar to anyone just
reading svn logs. Right now we have two disjoint histories, so once we
merge both into a single entity some of it would unavoidably get lost. Yes,
it's all just my rant at this point, but perhaps there are some lessons to
be learned from this incident.

On Thu, Feb 18, 2016 at 9:20 PM, Maxim Sobolev  wrote:

> Well, what about "do it once, do it right" motto and ongoing code
> maintenance cost? Don't you think there should be a balance between those?
> Considering how similar the code really is what we've gained in "immediate
> availability" department we've already lost since in the time people spend
> doing cross merges between those two since 2011. Not even to mention time
> wasted by users of the feature dealing with bugs already fixed in the twin
> implementation and associated frustration. All that would be eliminated had
> this fork never happened.
>
> On Thu, Feb 18, 2016 at 8:53 PM, Adrian Chadd  wrote:
>
>> It passed the "it's working code and it's immediately useful" filter.
>>
>> I'd love to see them both unified somehow. I really would!
>>
>>
>> -a
>>
>>
>> On 18 February 2016 at 17:28, Maxim Sobolev 
>> wrote:
>> > Sigh, I don't now how it managed to sleep through usually tight FreeBSD
>> > peer-review process. It would be interesting to hear some comments from
>> @ray
>> > and @adrian, perhaps there were some reasons for it being done this way,
>> > although I cannot see any in a hindsight.
>> >
>> > I am just in the middle of rather substantial overhaul of both kernel
>> and
>> > userland part here:
>> >
>> > https://reviews.freebsd.org/D5333
>> >
>> > And once that committed it will take them apart again. I've also spend
>> quite
>> > lot of time testing my change set, which would with very little effort
>> have
>> > covered both formats had I started with unified code base. :(
>> >
>> > I also plan on making further improvement into kernel module, as it is
>> right
>> > now both g_uzip and g_uncompress basically piggyback single "g_up"
>> thread,
>> > so you cannot use multiple cores even for different instances, let
>> alone one
>> > instance being accessed by multiple readers. And it also can delay other
>> > unrelated I/O requests by maxing out CPU time slice available for the
>> g_up.
>> >
>> > On Thu, Feb 18, 2016 at 4:38 PM, Bryan Drewery 
>> wrote:
>> >>
>> >> On 2/18/2016 3:57 PM, Maxim Sobolev wrote:
>> >> > Aleksandr, Adrian,
>> >> >
>> >> > I know it's 3 years later, but I really don't know why it's been done
>> >> > this way. Take a GEOM module and associated usr.bin utility, copy it
>> >> > verbatim add few lines of code and re-add that as a new module seems
>> >> > like just laziness and attempt to avoid doing extra work on making
>> >> > unified code. The same goes for the mkulzma, which is almost 1:1
>> copy of
>> >> > the mkuzip. Now people are merging back and forth and I've just spent
>> >> > few days testing some rather major rework of geom_uzip / mkuzip code
>> not
>> >> > even realizing that there is its evil twin in the tree. :(
>> >>
>> >> r283104 is an example of one of these problems. It was a catch-up of
>> >> uzip's r268986 done almost a year before. I did comparisons before
>> using
>> >> uzip last summer and ran across that one.
>> >>
>> >> >
>> >> > https://reviews.freebsd.org/D5333
>> >> >
>> >> > I suggest functionality from both geom_uncompress / mkulzma are
>> folded
>> >> > now back into geom_uzip / mkuzip and geom_uncompress / mkulzma are
>> nuked
>> >> > afterwards.
>> >> >
>> >> > Thanks!
>> >> >
>> >> >
>> >> >
>> >> > Author: ray
>> >> > Date: Wed Jan 4 23:39:11 2012
>> >> > New Revision: 229537
>> >> > URL: http://svn.freebsd.org/changeset/base/229537
>> >> > Log:
>> >> > GEOM_UNCOMPRESS module, can be used with uzip images and with new
>> >> > ulzma images.
>> >> > Approved by: adrian (mentor)
>> >> > Added:
>> >> > head/sys/geom/uncompress/
>> >> > head/sys/geom/uncompress/g_uncompress.c (contents, props changed)
>> >> > head/sys/modules/geom/geom_uncompress/
>> >> > head/sys/modules/geom/geom_uncompress/Makefile (contents, props
>> >> > changed)
>> >> > Modified:
>> >> > head/sys/conf/files
>> >> > head/sys/conf/options
>> >> >
>> >> >
>> >>
>> >>
>> >> --
>> >> Regards,
>> >> Bryan Drewery
>> >>
>> >
>> >
>> >
>> > --
>> > Maksym Sobolyev
>> > Sippy Software, Inc.
>> > Internet Telephony (VoIP) Experts
>> > Tel (Canada): +1-778-783-0474
>> > Tel (Toll-Free): +1-855-747-7779
>> > Fax: +1-866-857-6942
>> > Web: http://www.sippysoft.com
>> > MSN: sa...@sippysoft.com
>> > Skype: SippySoft
>>
>
>
___
svn-src-head@freebsd.org mailing list
https://lists.f

Re: svn commit: r229537 - in head/sys: conf geom/uncompress modules/geom/geom_uncompress

2016-02-18 Thread Adrian Chadd
On 18 February 2016 at 21:20, Maxim Sobolev  wrote:
> Well, what about "do it once, do it right" motto and ongoing code
> maintenance cost? Don't you think there should be a balance between those?
> Considering how similar the code really is what we've gained in "immediate
> availability" department we've already lost since in the time people spend
> doing cross merges between those two since 2011. Not even to mention time
> wasted by users of the feature dealing with bugs already fixed in the twin
> implementation and associated frustration. All that would be eliminated had
> this fork never happened.

Sure. But someone has to do that, and I made a decision that it was
better to commit /something/ than for everyone involved to run out of
time and nothing to be committed.

eg - a lot of ARM and MIPS work.

So yes, I'd love to see it fixed. I mean, heck, I fix up other stuff
and I completely forgot that this was still split. But geom_ulzma /
geom_gzip actually got us a whole lot of MIPS (and maybe some ARM)
users, so I believe it was worthwhile.

Thanks,



-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"


Re: svn commit: r229537 - in head/sys: conf geom/uncompress modules/geom/geom_uncompress

2016-02-18 Thread Maxim Sobolev
Well, what about "do it once, do it right" motto and ongoing code
maintenance cost? Don't you think there should be a balance between those?
Considering how similar the code really is what we've gained in "immediate
availability" department we've already lost since in the time people spend
doing cross merges between those two since 2011. Not even to mention time
wasted by users of the feature dealing with bugs already fixed in the twin
implementation and associated frustration. All that would be eliminated had
this fork never happened.

On Thu, Feb 18, 2016 at 8:53 PM, Adrian Chadd  wrote:

> It passed the "it's working code and it's immediately useful" filter.
>
> I'd love to see them both unified somehow. I really would!
>
>
> -a
>
>
> On 18 February 2016 at 17:28, Maxim Sobolev  wrote:
> > Sigh, I don't now how it managed to sleep through usually tight FreeBSD
> > peer-review process. It would be interesting to hear some comments from
> @ray
> > and @adrian, perhaps there were some reasons for it being done this way,
> > although I cannot see any in a hindsight.
> >
> > I am just in the middle of rather substantial overhaul of both kernel and
> > userland part here:
> >
> > https://reviews.freebsd.org/D5333
> >
> > And once that committed it will take them apart again. I've also spend
> quite
> > lot of time testing my change set, which would with very little effort
> have
> > covered both formats had I started with unified code base. :(
> >
> > I also plan on making further improvement into kernel module, as it is
> right
> > now both g_uzip and g_uncompress basically piggyback single "g_up"
> thread,
> > so you cannot use multiple cores even for different instances, let alone
> one
> > instance being accessed by multiple readers. And it also can delay other
> > unrelated I/O requests by maxing out CPU time slice available for the
> g_up.
> >
> > On Thu, Feb 18, 2016 at 4:38 PM, Bryan Drewery 
> wrote:
> >>
> >> On 2/18/2016 3:57 PM, Maxim Sobolev wrote:
> >> > Aleksandr, Adrian,
> >> >
> >> > I know it's 3 years later, but I really don't know why it's been done
> >> > this way. Take a GEOM module and associated usr.bin utility, copy it
> >> > verbatim add few lines of code and re-add that as a new module seems
> >> > like just laziness and attempt to avoid doing extra work on making
> >> > unified code. The same goes for the mkulzma, which is almost 1:1 copy
> of
> >> > the mkuzip. Now people are merging back and forth and I've just spent
> >> > few days testing some rather major rework of geom_uzip / mkuzip code
> not
> >> > even realizing that there is its evil twin in the tree. :(
> >>
> >> r283104 is an example of one of these problems. It was a catch-up of
> >> uzip's r268986 done almost a year before. I did comparisons before using
> >> uzip last summer and ran across that one.
> >>
> >> >
> >> > https://reviews.freebsd.org/D5333
> >> >
> >> > I suggest functionality from both geom_uncompress / mkulzma are folded
> >> > now back into geom_uzip / mkuzip and geom_uncompress / mkulzma are
> nuked
> >> > afterwards.
> >> >
> >> > Thanks!
> >> >
> >> >
> >> >
> >> > Author: ray
> >> > Date: Wed Jan 4 23:39:11 2012
> >> > New Revision: 229537
> >> > URL: http://svn.freebsd.org/changeset/base/229537
> >> > Log:
> >> > GEOM_UNCOMPRESS module, can be used with uzip images and with new
> >> > ulzma images.
> >> > Approved by: adrian (mentor)
> >> > Added:
> >> > head/sys/geom/uncompress/
> >> > head/sys/geom/uncompress/g_uncompress.c (contents, props changed)
> >> > head/sys/modules/geom/geom_uncompress/
> >> > head/sys/modules/geom/geom_uncompress/Makefile (contents, props
> >> > changed)
> >> > Modified:
> >> > head/sys/conf/files
> >> > head/sys/conf/options
> >> >
> >> >
> >>
> >>
> >> --
> >> Regards,
> >> Bryan Drewery
> >>
> >
> >
> >
> > --
> > Maksym Sobolyev
> > Sippy Software, Inc.
> > Internet Telephony (VoIP) Experts
> > Tel (Canada): +1-778-783-0474
> > Tel (Toll-Free): +1-855-747-7779
> > Fax: +1-866-857-6942
> > Web: http://www.sippysoft.com
> > MSN: sa...@sippysoft.com
> > Skype: SippySoft
>
___
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: r295794 - head/sys/dev/hyperv/netvsc

2016-02-18 Thread Sepherosa Ziehau
Author: sephe
Date: Fri Feb 19 05:13:56 2016
New Revision: 295794
URL: https://svnweb.freebsd.org/changeset/base/295794

Log:
  hyperv/hn: Free the txdesc buf_ring when the TX ring is destroyed
  
  Reviewed by:  adrian
  Approved by:  adrian (mentor)
  MFC after:1 week
  Sponsored by: Microsoft OSTC
  Differential Revision:https://reviews.freebsd.org/D5318

Modified:
  head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c

Modified: head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c
==
--- head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c  Fri Feb 19 05:08:44 
2016(r295793)
+++ head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c  Fri Feb 19 05:13:56 
2016(r295794)
@@ -2276,6 +2276,11 @@ hn_destroy_tx_ring(struct hn_tx_ring *tx
bus_dma_tag_destroy(txr->hn_tx_data_dtag);
if (txr->hn_tx_rndis_dtag != NULL)
bus_dma_tag_destroy(txr->hn_tx_rndis_dtag);
+
+#ifdef HN_USE_TXDESC_BUFRING
+   buf_ring_free(txr->hn_txdesc_br, M_NETVSC);
+#endif
+
free(txr->hn_txdesc, M_NETVSC);
txr->hn_txdesc = NULL;
 
___
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: r295793 - head/sys/dev/hyperv/netvsc

2016-02-18 Thread Sepherosa Ziehau
Author: sephe
Date: Fri Feb 19 05:08:44 2016
New Revision: 295793
URL: https://svnweb.freebsd.org/changeset/base/295793

Log:
  hyperv/hn: Enable IP header checksum offloading for WIN8 (WinServ2012)
  
  Tested on Windows Server 2012.
  
  Reviewed by:  adrian
  Approved by:  adrian (mentor)
  MFC after:1 week
  Sponsored by: Microsoft OSTC
  Differential Revision:https://reviews.freebsd.org/D5317

Modified:
  head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c

Modified: head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c
==
--- head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c  Fri Feb 19 05:03:17 
2016(r295792)
+++ head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c  Fri Feb 19 05:08:44 
2016(r295793)
@@ -176,7 +176,7 @@ struct hn_txdesc {
  * later.  UDP checksum offloading doesn't work on earlier
  * Windows releases.
  */
-#define HN_CSUM_ASSIST_WIN8(CSUM_TCP)
+#define HN_CSUM_ASSIST_WIN8(CSUM_IP | CSUM_TCP)
 #define HN_CSUM_ASSIST (CSUM_IP | CSUM_UDP | CSUM_TCP)
 
 #define HN_LRO_LENLIM_DEF  (25 * ETHERMTU)
___
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: r295792 - head/sys/dev/hyperv/netvsc

2016-02-18 Thread Sepherosa Ziehau
Author: sephe
Date: Fri Feb 19 05:03:17 2016
New Revision: 295792
URL: https://svnweb.freebsd.org/changeset/base/295792

Log:
  hyperv/hn: Add option to bind TX taskqueues to the specified CPU
  
  It will be used to help tracking host side transmission ring selection
  issue; and it will be turned on by default, once we have concrete result.
  
  Reviewed by:  adrian, Jun Su 
  Approved by:  adrian (mento)
  MFC after:1 week
  Sponsored by: Microsoft OSTC
  Differential Revision:https://reviews.freebsd.org/D5316

Modified:
  head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c

Modified: head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c
==
--- head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c  Fri Feb 19 05:02:17 
2016(r295791)
+++ head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c  Fri Feb 19 05:03:17 
2016(r295792)
@@ -269,6 +269,10 @@ static int hn_use_txdesc_bufring = 1;
 SYSCTL_INT(_hw_hn, OID_AUTO, use_txdesc_bufring, CTLFLAG_RD,
 &hn_use_txdesc_bufring, 0, "Use buf_ring for TX descriptors");
 
+static int hn_bind_tx_taskq = -1;
+SYSCTL_INT(_hw_hn, OID_AUTO, bind_tx_taskq, CTLFLAG_RDTUN,
+&hn_bind_tx_taskq, 0, "Bind TX taskqueue to the specified cpu");
+
 /*
  * Forward declarations
  */
@@ -383,8 +387,20 @@ netvsc_attach(device_t dev)
if (hn_tx_taskq == NULL) {
sc->hn_tx_taskq = taskqueue_create("hn_tx", M_WAITOK,
taskqueue_thread_enqueue, &sc->hn_tx_taskq);
-   taskqueue_start_threads(&sc->hn_tx_taskq, 1, PI_NET, "%s tx",
-   device_get_nameunit(dev));
+   if (hn_bind_tx_taskq >= 0) {
+   int cpu = hn_bind_tx_taskq;
+   cpuset_t cpu_set;
+
+   if (cpu > mp_ncpus - 1)
+   cpu = mp_ncpus - 1;
+   CPU_SETOF(cpu, &cpu_set);
+   taskqueue_start_threads_cpuset(&sc->hn_tx_taskq, 1,
+   PI_NET, &cpu_set, "%s tx",
+   device_get_nameunit(dev));
+   } else {
+   taskqueue_start_threads(&sc->hn_tx_taskq, 1, PI_NET,
+   "%s tx", device_get_nameunit(dev));
+   }
} else {
sc->hn_tx_taskq = hn_tx_taskq;
}
@@ -2409,7 +2425,18 @@ hn_tx_taskq_create(void *arg __unused)
 
hn_tx_taskq = taskqueue_create("hn_tx", M_WAITOK,
taskqueue_thread_enqueue, &hn_tx_taskq);
-   taskqueue_start_threads(&hn_tx_taskq, 1, PI_NET, "hn tx");
+   if (hn_bind_tx_taskq >= 0) {
+   int cpu = hn_bind_tx_taskq;
+   cpuset_t cpu_set;
+
+   if (cpu > mp_ncpus - 1)
+   cpu = mp_ncpus - 1;
+   CPU_SETOF(cpu, &cpu_set);
+   taskqueue_start_threads_cpuset(&hn_tx_taskq, 1, PI_NET,
+   &cpu_set, "hn tx");
+   } else {
+   taskqueue_start_threads(&hn_tx_taskq, 1, PI_NET, "hn tx");
+   }
 }
 SYSINIT(hn_txtq_create, SI_SUB_DRIVERS, SI_ORDER_FIRST,
 hn_tx_taskq_create, NULL);
___
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: r295791 - head/sys/dev/acpica

2016-02-18 Thread Adrian Chadd
Author: adrian
Date: Fri Feb 19 05:02:17 2016
New Revision: 295791
URL: https://svnweb.freebsd.org/changeset/base/295791

Log:
  document some ACPI related sysctls.
  
  Submitted by: Oliver Pinter 
  Sponsored by: HardenedBSD
  Differential Revision:https://reviews.freebsd.org/D5263

Modified:
  head/sys/dev/acpica/acpi.c

Modified: head/sys/dev/acpica/acpi.c
==
--- head/sys/dev/acpica/acpi.c  Fri Feb 19 03:37:56 2016(r295790)
+++ head/sys/dev/acpica/acpi.c  Fri Feb 19 05:02:17 2016(r295791)
@@ -558,16 +558,20 @@ acpi_attach(device_t dev)
   device_get_name(dev), CTLFLAG_RD, 0, "");
 SYSCTL_ADD_PROC(&sc->acpi_sysctl_ctx, 
SYSCTL_CHILDREN(sc->acpi_sysctl_tree),
OID_AUTO, "supported_sleep_state", CTLTYPE_STRING | CTLFLAG_RD,
-   0, 0, acpi_supported_sleep_state_sysctl, "A", "");
+   0, 0, acpi_supported_sleep_state_sysctl, "A",
+   "List supported ACPI sleep states.");
 SYSCTL_ADD_PROC(&sc->acpi_sysctl_ctx, 
SYSCTL_CHILDREN(sc->acpi_sysctl_tree),
OID_AUTO, "power_button_state", CTLTYPE_STRING | CTLFLAG_RW,
-   &sc->acpi_power_button_sx, 0, acpi_sleep_state_sysctl, "A", "");
+   &sc->acpi_power_button_sx, 0, acpi_sleep_state_sysctl, "A",
+   "Power button ACPI sleep state.");
 SYSCTL_ADD_PROC(&sc->acpi_sysctl_ctx, 
SYSCTL_CHILDREN(sc->acpi_sysctl_tree),
OID_AUTO, "sleep_button_state", CTLTYPE_STRING | CTLFLAG_RW,
-   &sc->acpi_sleep_button_sx, 0, acpi_sleep_state_sysctl, "A", "");
+   &sc->acpi_sleep_button_sx, 0, acpi_sleep_state_sysctl, "A",
+   "Sleep button ACPI sleep state.");
 SYSCTL_ADD_PROC(&sc->acpi_sysctl_ctx, 
SYSCTL_CHILDREN(sc->acpi_sysctl_tree),
OID_AUTO, "lid_switch_state", CTLTYPE_STRING | CTLFLAG_RW,
-   &sc->acpi_lid_switch_sx, 0, acpi_sleep_state_sysctl, "A", "");
+   &sc->acpi_lid_switch_sx, 0, acpi_sleep_state_sysctl, "A",
+   "Lid ACPI sleep state. Set to S3 if you want to suspend your laptop 
when close the Lid.");
 SYSCTL_ADD_PROC(&sc->acpi_sysctl_ctx, 
SYSCTL_CHILDREN(sc->acpi_sysctl_tree),
OID_AUTO, "standby_state", CTLTYPE_STRING | CTLFLAG_RW,
&sc->acpi_standby_sx, 0, acpi_sleep_state_sysctl, "A", "");
___
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: r229537 - in head/sys: conf geom/uncompress modules/geom/geom_uncompress

2016-02-18 Thread Adrian Chadd
It passed the "it's working code and it's immediately useful" filter.

I'd love to see them both unified somehow. I really would!


-a


On 18 February 2016 at 17:28, Maxim Sobolev  wrote:
> Sigh, I don't now how it managed to sleep through usually tight FreeBSD
> peer-review process. It would be interesting to hear some comments from @ray
> and @adrian, perhaps there were some reasons for it being done this way,
> although I cannot see any in a hindsight.
>
> I am just in the middle of rather substantial overhaul of both kernel and
> userland part here:
>
> https://reviews.freebsd.org/D5333
>
> And once that committed it will take them apart again. I've also spend quite
> lot of time testing my change set, which would with very little effort have
> covered both formats had I started with unified code base. :(
>
> I also plan on making further improvement into kernel module, as it is right
> now both g_uzip and g_uncompress basically piggyback single "g_up" thread,
> so you cannot use multiple cores even for different instances, let alone one
> instance being accessed by multiple readers. And it also can delay other
> unrelated I/O requests by maxing out CPU time slice available for the g_up.
>
> On Thu, Feb 18, 2016 at 4:38 PM, Bryan Drewery  wrote:
>>
>> On 2/18/2016 3:57 PM, Maxim Sobolev wrote:
>> > Aleksandr, Adrian,
>> >
>> > I know it's 3 years later, but I really don't know why it's been done
>> > this way. Take a GEOM module and associated usr.bin utility, copy it
>> > verbatim add few lines of code and re-add that as a new module seems
>> > like just laziness and attempt to avoid doing extra work on making
>> > unified code. The same goes for the mkulzma, which is almost 1:1 copy of
>> > the mkuzip. Now people are merging back and forth and I've just spent
>> > few days testing some rather major rework of geom_uzip / mkuzip code not
>> > even realizing that there is its evil twin in the tree. :(
>>
>> r283104 is an example of one of these problems. It was a catch-up of
>> uzip's r268986 done almost a year before. I did comparisons before using
>> uzip last summer and ran across that one.
>>
>> >
>> > https://reviews.freebsd.org/D5333
>> >
>> > I suggest functionality from both geom_uncompress / mkulzma are folded
>> > now back into geom_uzip / mkuzip and geom_uncompress / mkulzma are nuked
>> > afterwards.
>> >
>> > Thanks!
>> >
>> >
>> >
>> > Author: ray
>> > Date: Wed Jan 4 23:39:11 2012
>> > New Revision: 229537
>> > URL: http://svn.freebsd.org/changeset/base/229537
>> > Log:
>> > GEOM_UNCOMPRESS module, can be used with uzip images and with new
>> > ulzma images.
>> > Approved by: adrian (mentor)
>> > Added:
>> > head/sys/geom/uncompress/
>> > head/sys/geom/uncompress/g_uncompress.c (contents, props changed)
>> > head/sys/modules/geom/geom_uncompress/
>> > head/sys/modules/geom/geom_uncompress/Makefile (contents, props
>> > changed)
>> > Modified:
>> > head/sys/conf/files
>> > head/sys/conf/options
>> >
>> >
>>
>>
>> --
>> Regards,
>> Bryan Drewery
>>
>
>
>
> --
> Maksym Sobolyev
> Sippy Software, Inc.
> Internet Telephony (VoIP) Experts
> Tel (Canada): +1-778-783-0474
> Tel (Toll-Free): +1-855-747-7779
> Fax: +1-866-857-6942
> Web: http://www.sippysoft.com
> MSN: sa...@sippysoft.com
> Skype: SippySoft
___
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: r295790 - in head/sys: dev/arcmsr dev/cy dev/ed dev/fb dev/fdc dev/hpt27xx dev/hptiop dev/hptmv dev/hptnr dev/hptrr dev/isci dev/ixgb dev/lmc dev/mrsas dev/mxge dev/nvme dev/quicc dev/s...

2016-02-18 Thread Justin Hibbits
Author: jhibbits
Date: Fri Feb 19 03:37:56 2016
New Revision: 295790
URL: https://svnweb.freebsd.org/changeset/base/295790

Log:
  Replace several bus_alloc_resource() calls using default arguments with 
bus_alloc_resource_any()
  
  Since these calls only use default arguments, bus_alloc_resource_any() is the
  right call.
  
  Differential Revision: https://reviews.freebsd.org/D5306

Modified:
  head/sys/dev/arcmsr/arcmsr.c
  head/sys/dev/cy/cy_isa.c
  head/sys/dev/cy/cy_pci.c
  head/sys/dev/ed/if_ed_pccard.c
  head/sys/dev/fb/s3_pci.c
  head/sys/dev/fdc/fdc_pccard.c
  head/sys/dev/hpt27xx/hpt27xx_osm_bsd.c
  head/sys/dev/hptiop/hptiop.c
  head/sys/dev/hptmv/entry.c
  head/sys/dev/hptnr/hptnr_osm_bsd.c
  head/sys/dev/hptrr/hptrr_osm_bsd.c
  head/sys/dev/isci/isci.c
  head/sys/dev/ixgb/if_ixgb.c
  head/sys/dev/lmc/if_lmc.c
  head/sys/dev/mrsas/mrsas.c
  head/sys/dev/mxge/if_mxge.c
  head/sys/dev/nvme/nvme_ctrlr.c
  head/sys/dev/quicc/quicc_core.c
  head/sys/dev/sound/pci/envy24.c
  head/sys/dev/sound/pci/envy24ht.c
  head/sys/dev/sound/pci/hdspe.c
  head/sys/dev/sound/pci/vibes.c
  head/sys/dev/twa/tw_osl_freebsd.c
  head/sys/dev/tws/tws.c
  head/sys/isa/isa_common.c
  head/sys/isa/vga_isa.c
  head/sys/mips/sibyte/ata_zbbus.c

Modified: head/sys/dev/arcmsr/arcmsr.c
==
--- head/sys/dev/arcmsr/arcmsr.cFri Feb 19 02:03:14 2016
(r295789)
+++ head/sys/dev/arcmsr/arcmsr.cFri Feb 19 03:37:56 2016
(r295790)
@@ -4323,7 +4323,7 @@ static int arcmsr_attach(device_t dev)
}
/* After setting up the adapter, map our interrupt */
rid = 0;
-   irqres = bus_alloc_resource(dev, SYS_RES_IRQ, &rid, 0ul, ~0ul, 1, 
RF_SHAREABLE | RF_ACTIVE);
+   irqres = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, RF_SHAREABLE | 
RF_ACTIVE);
if(irqres == NULL || 
 #if __FreeBSD_version >= 700025
bus_setup_intr(dev, irqres, 
INTR_TYPE_CAM|INTR_ENTROPY|INTR_MPSAFE, NULL, arcmsr_intr_handler, acb, 
&acb->ih)) {

Modified: head/sys/dev/cy/cy_isa.c
==
--- head/sys/dev/cy/cy_isa.cFri Feb 19 02:03:14 2016(r295789)
+++ head/sys/dev/cy/cy_isa.cFri Feb 19 03:37:56 2016(r295790)
@@ -80,8 +80,8 @@ cy_isa_probe(device_t dev)
return (ENXIO);
 
mem_rid = 0;
-   mem_res = bus_alloc_resource(dev, SYS_RES_MEMORY, &mem_rid,
-   0ul, ~0ul, 0ul, RF_ACTIVE);
+   mem_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &mem_rid,
+   RF_ACTIVE);
if (mem_res == NULL) {
device_printf(dev, "ioport resource allocation failed\n");
return (ENXIO);
@@ -112,8 +112,8 @@ cy_isa_attach(device_t dev)
mem_res = NULL;
 
mem_rid = 0;
-   mem_res = bus_alloc_resource(dev, SYS_RES_MEMORY, &mem_rid,
-   0ul, ~0ul, 0ul, RF_ACTIVE);
+   mem_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &mem_rid,
+   RF_ACTIVE);
if (mem_res == NULL) {
device_printf(dev, "memory resource allocation failed\n");
goto fail;
@@ -127,7 +127,7 @@ cy_isa_attach(device_t dev)
}
 
irq_rid = 0;
-   irq_res = bus_alloc_resource(dev, SYS_RES_IRQ, &irq_rid, 0ul, ~0ul, 0ul,
+   irq_res = bus_alloc_resource_any(dev, SYS_RES_IRQ, &irq_rid,
RF_SHAREABLE | RF_ACTIVE);
if (irq_res == NULL) {
device_printf(dev, "interrupt resource allocation failed\n");

Modified: head/sys/dev/cy/cy_pci.c
==
--- head/sys/dev/cy/cy_pci.cFri Feb 19 02:03:14 2016(r295789)
+++ head/sys/dev/cy/cy_pci.cFri Feb 19 03:37:56 2016(r295790)
@@ -114,8 +114,8 @@ cy_pci_attach(dev)
mem_res = NULL;
 
ioport_rid = CY_PCI_BASE_ADDR1;
-   ioport_res = bus_alloc_resource(dev, SYS_RES_IOPORT, &ioport_rid,
-   0ul, ~0ul, 0ul, RF_ACTIVE);
+   ioport_res = bus_alloc_resource_(dev, SYS_RES_IOPORT, &ioport_rid,
+   RF_ACTIVE);
if (ioport_res == NULL) {
device_printf(dev, "ioport resource allocation failed\n");
goto fail;
@@ -123,8 +123,8 @@ cy_pci_attach(dev)
ioport = rman_get_start(ioport_res);
 
mem_rid = CY_PCI_BASE_ADDR2;
-   mem_res = bus_alloc_resource(dev, SYS_RES_MEMORY, &mem_rid,
-   0ul, ~0ul, 0ul, RF_ACTIVE);
+   mem_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &mem_rid,
+   RF_ACTIVE);
if (mem_res == NULL) {
device_printf(dev, "memory resource allocation failed\n");
goto fail;
@@ -138,7 +138,7 @@ cy_pci_attach(dev)
}
 
irq_rid = 0;
-   irq_res = bus_alloc_resource(dev, SYS_RES_IRQ, &irq_rid, 0ul, ~0ul, 0ul,
+   irq_res = bus_alloc_resource_any(dev, SYS_RES_IRQ, &irq_rid,
RF

svn commit: r295788 - head/sys/dev/iwn

2016-02-18 Thread Kevin Lo
Author: kevlo
Date: Fri Feb 19 01:57:51 2016
New Revision: 295788
URL: https://svnweb.freebsd.org/changeset/base/295788

Log:
  Remove bogus cast.

Modified:
  head/sys/dev/iwn/if_iwn.c

Modified: head/sys/dev/iwn/if_iwn.c
==
--- head/sys/dev/iwn/if_iwn.c   Fri Feb 19 01:56:59 2016(r295787)
+++ head/sys/dev/iwn/if_iwn.c   Fri Feb 19 01:57:51 2016(r295788)
@@ -417,7 +417,7 @@ iwn_is_3stream_device(struct iwn_softc *
 static int
 iwn_attach(device_t dev)
 {
-   struct iwn_softc *sc = (struct iwn_softc *)device_get_softc(dev);
+   struct iwn_softc *sc = device_get_softc(dev);
struct ieee80211com *ic;
int i, error, rid;
 
___
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: r295787 - head/sys/dev/ixl

2016-02-18 Thread Kevin Lo
Author: kevlo
Date: Fri Feb 19 01:56:59 2016
New Revision: 295787
URL: https://svnweb.freebsd.org/changeset/base/295787

Log:
  Add missing parentheses.
  
  Found by: PVS-Studio

Modified:
  head/sys/dev/ixl/if_ixl.c

Modified: head/sys/dev/ixl/if_ixl.c
==
--- head/sys/dev/ixl/if_ixl.c   Fri Feb 19 01:49:33 2016(r295786)
+++ head/sys/dev/ixl/if_ixl.c   Fri Feb 19 01:56:59 2016(r295787)
@@ -6311,7 +6311,7 @@ ixl_vf_config_promisc_msg(struct ixl_pf 
return;
}
 
-   if (!vf->vf_flags & VF_FLAG_PROMISC_CAP) {
+   if (!(vf->vf_flags & VF_FLAG_PROMISC_CAP)) {
i40e_send_vf_nack(pf, vf,
I40E_VIRTCHNL_OP_CONFIG_PROMISCUOUS_MODE, I40E_ERR_PARAM);
return;
___
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: r295786 - in head: sys/kern tests/sys/kqueue

2016-02-18 Thread Mark Johnston
Author: markj
Date: Fri Feb 19 01:49:33 2016
New Revision: 295786
URL: https://svnweb.freebsd.org/changeset/base/295786

Log:
  Ensure that we test the event condition when a disabled kevent is enabled.
  
  r274560 modified kqueue_register() to only test the event condition if the
  corresponding knote is not disabled. However, this check takes place before
  the EV_ENABLE flag is used to clear the KN_DISABLED flag on the knote, so
  enabling a previously-disabled kevent would not result in a notification for
  a triggered event. This change fixes the problem by testing for EV_ENABLED
  before possibly checking the event condition.
  
  This change also updates a kqueue regression test to exercise this case.
  
  PR:   206368
  Reviewed by:  kib
  Sponsored by: EMC / Isilon Storage Division
  Differential Revision:https://reviews.freebsd.org/D5307

Modified:
  head/sys/kern/kern_event.c
  head/tests/sys/kqueue/read.c

Modified: head/sys/kern/kern_event.c
==
--- head/sys/kern/kern_event.c  Fri Feb 19 01:35:01 2016(r295785)
+++ head/sys/kern/kern_event.c  Fri Feb 19 01:49:33 2016(r295786)
@@ -1323,27 +1323,24 @@ findkn:
 * kn_knlist.
 */
 done_ev_add:
-   if ((kev->flags & EV_DISABLE) &&
-   ((kn->kn_status & KN_DISABLED) == 0)) {
+   if ((kev->flags & EV_ENABLE) != 0)
+   kn->kn_status &= ~KN_DISABLED;
+   else if ((kev->flags & EV_DISABLE) != 0)
kn->kn_status |= KN_DISABLED;
-   }
 
if ((kn->kn_status & KN_DISABLED) == 0)
event = kn->kn_fop->f_event(kn, 0);
else
event = 0;
+
KQ_LOCK(kq);
if (event)
-   KNOTE_ACTIVATE(kn, 1);
+   kn->kn_status |= KN_ACTIVE;
+   if ((kn->kn_status & (KN_ACTIVE | KN_DISABLED | KN_QUEUED)) ==
+   KN_ACTIVE)
+   knote_enqueue(kn);
kn->kn_status &= ~(KN_INFLUX | KN_SCAN);
KN_LIST_UNLOCK(kn);
-
-   if ((kev->flags & EV_ENABLE) && (kn->kn_status & KN_DISABLED)) {
-   kn->kn_status &= ~KN_DISABLED;
-   if ((kn->kn_status & KN_ACTIVE) &&
-   ((kn->kn_status & KN_QUEUED) == 0))
-   knote_enqueue(kn);
-   }
KQ_UNLOCK_FLUX(kq);
 
 done:

Modified: head/tests/sys/kqueue/read.c
==
--- head/tests/sys/kqueue/read.cFri Feb 19 01:35:01 2016
(r295785)
+++ head/tests/sys/kqueue/read.cFri Feb 19 01:49:33 2016
(r295786)
@@ -124,15 +124,17 @@ test_kevent_socket_disable_and_enable(vo
 
 test_begin(test_id);
 
-/* Add an event, then disable it. */
-EV_SET(&kev, sockfd[0], EVFILT_READ, EV_ADD, 0, 0, &sockfd[0]);
-if (kevent(kqfd, &kev, 1, NULL, 0, NULL) < 0)
-err(1, "%s", test_id);
-EV_SET(&kev, sockfd[0], EVFILT_READ, EV_DISABLE, 0, 0, &sockfd[0]);
+/*
+ * Write to the socket before adding the event. This way we can verify that
+ * enabling a triggered kevent causes the event to be returned immediately.
+ */
+kevent_socket_fill();
+
+/* Add a disabled event. */
+EV_SET(&kev, sockfd[0], EVFILT_READ, EV_ADD | EV_DISABLE, 0, 0, 
&sockfd[0]);
 if (kevent(kqfd, &kev, 1, NULL, 0, NULL) < 0)
 err(1, "%s", test_id);
 
-kevent_socket_fill();
 test_no_kevents();
 
 /* Re-enable the knote, then see if an event is generated */
___
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: r295785 - head/sys/kern

2016-02-18 Thread Mark Johnston
Author: markj
Date: Fri Feb 19 01:35:01 2016
New Revision: 295785
URL: https://svnweb.freebsd.org/changeset/base/295785

Log:
  Return an error if both EV_ENABLE and EV_DISABLE are specified for a kevent.
  
  Currently, this combination results in EV_DISABLE being ignored.
  
  Reviewed by:  kib
  Sponsored by: EMC / Isilon Storage Division
  Differential Revision:https://reviews.freebsd.org/D5307

Modified:
  head/sys/kern/kern_event.c

Modified: head/sys/kern/kern_event.c
==
--- head/sys/kern/kern_event.c  Fri Feb 19 01:08:03 2016(r295784)
+++ head/sys/kern/kern_event.c  Fri Feb 19 01:35:01 2016(r295785)
@@ -1116,6 +1116,9 @@ kqueue_register(struct kqueue *kq, struc
int error, filt, event;
int haskqglobal, filedesc_unlock;
 
+   if ((kev->flags & (EV_ENABLE | EV_DISABLE)) == (EV_ENABLE | EV_DISABLE))
+   return (EINVAL);
+
fp = NULL;
kn = NULL;
error = 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: r229537 - in head/sys: conf geom/uncompress modules/geom/geom_uncompress

2016-02-18 Thread Maxim Sobolev
Sigh, I don't now how it managed to sleep through usually tight FreeBSD
peer-review process. It would be interesting to hear some comments from
@ray and @adrian, perhaps there were some reasons for it being done this
way, although I cannot see any in a hindsight.

I am just in the middle of rather substantial overhaul of both kernel and
userland part here:

https://reviews.freebsd.org/D5333

And once that committed it will take them apart again. I've also spend
quite lot of time testing my change set, which would with very little
effort have covered both formats had I started with unified code base. :(

I also plan on making further improvement into kernel module, as it is
right now both g_uzip and g_uncompress basically piggyback single "g_up"
thread, so you cannot use multiple cores even for different instances, let
alone one instance being accessed by multiple readers. And it also can
delay other unrelated I/O requests by maxing out CPU time slice available
for the g_up.

On Thu, Feb 18, 2016 at 4:38 PM, Bryan Drewery  wrote:

> On 2/18/2016 3:57 PM, Maxim Sobolev wrote:
> > Aleksandr, Adrian,
> >
> > I know it's 3 years later, but I really don't know why it's been done
> > this way. Take a GEOM module and associated usr.bin utility, copy it
> > verbatim add few lines of code and re-add that as a new module seems
> > like just laziness and attempt to avoid doing extra work on making
> > unified code. The same goes for the mkulzma, which is almost 1:1 copy of
> > the mkuzip. Now people are merging back and forth and I've just spent
> > few days testing some rather major rework of geom_uzip / mkuzip code not
> > even realizing that there is its evil twin in the tree. :(
>
> r283104 is an example of one of these problems. It was a catch-up of
> uzip's r268986 done almost a year before. I did comparisons before using
> uzip last summer and ran across that one.
>
> >
> > https://reviews.freebsd.org/D5333
> >
> > I suggest functionality from both geom_uncompress / mkulzma are folded
> > now back into geom_uzip / mkuzip and geom_uncompress / mkulzma are nuked
> > afterwards.
> >
> > Thanks!
> >
> >
> >
> > Author: ray
> > Date: Wed Jan 4 23:39:11 2012
> > New Revision: 229537
> > URL: http://svn.freebsd.org/changeset/base/229537
> > Log:
> > GEOM_UNCOMPRESS module, can be used with uzip images and with new
> > ulzma images.
> > Approved by: adrian (mentor)
> > Added:
> > head/sys/geom/uncompress/
> > head/sys/geom/uncompress/g_uncompress.c (contents, props changed)
> > head/sys/modules/geom/geom_uncompress/
> > head/sys/modules/geom/geom_uncompress/Makefile (contents, props
> changed)
> > Modified:
> > head/sys/conf/files
> > head/sys/conf/options
> >
> >
>
>
> --
> Regards,
> Bryan Drewery
>
>


-- 
Maksym Sobolyev
Sippy Software, Inc.
Internet Telephony (VoIP) Experts
Tel (Canada): +1-778-783-0474
Tel (Toll-Free): +1-855-747-7779
Fax: +1-866-857-6942
Web: http://www.sippysoft.com
MSN: sa...@sippysoft.com
Skype: SippySoft
___
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: r295784 - head/share/man/man5

2016-02-18 Thread Jason Helfman
Author: jgh (doc,ports committer)
Date: Fri Feb 19 01:08:03 2016
New Revision: 295784
URL: https://svnweb.freebsd.org/changeset/base/295784

Log:
  - language tightening
  - cleanup SEE ALSO section (thanks brueffer@)
  
  Approved by:  wblock (mentor)
  Differential Revision:https://reviews.freebsd.org/D5335

Modified:
  head/share/man/man5/mailer.conf.5

Modified: head/share/man/man5/mailer.conf.5
==
--- head/share/man/man5/mailer.conf.5   Fri Feb 19 01:06:45 2016
(r295783)
+++ head/share/man/man5/mailer.conf.5   Fri Feb 19 01:08:03 2016
(r295784)
@@ -101,9 +101,10 @@ mailq  /usr/libexec/sendmail/sendmail
 newaliases /usr/libexec/sendmail/sendmail
 .Ed
 .Pp
-This example shows how to invoke a sendmail-workalike like
+Using
 .Nm Postfix
-in place of
+(from ports)
+to replace
 .Xr sendmail 8 :
 .Bd -literal -offset indent
 # Emulate sendmail using postfix
@@ -113,12 +114,10 @@ mailq /usr/local/sbin/sendmail
 newaliases /usr/local/sbin/sendmail
 .Ed
 .Pp
-This example shows
-how to invoke
-a sendmail-workalike with
+Using
 .Nm Exim
 (from ports)
-in place of
+to replace
 .Xr sendmail 8 :
 .Bd -literal -offset indent
 # Emulate sendmail using exim
@@ -129,11 +128,11 @@ newaliases/usr/bin/true
 rmail  /usr/local/sbin/exim -i -oee
 .Ed
 .Pp
-This example shows the use of the
+Using
 .Nm mini_sendmail
-package from ports in place of
-.Xr sendmail 8 .
-Note the use of additional arguments.
+(from ports)
+to replace
+.Xr sendmail 8 :
 .Bd -literal -offset indent
 # Send outgoing mail to a smart relay using mini_sendmail
 sendmail   /usr/local/bin/mini_sendmail -srelayhost
@@ -153,14 +152,16 @@ newaliases/usr/libexec/dma
 rmail  /usr/libexec/dma
 .Ed
 .Sh SEE ALSO
-.Xr dma 8 ,
 .Xr mail 1 ,
 .Xr mailq 1 ,
 .Xr newaliases 1 ,
+.Xr dma 8 ,
 .Xr mailwrapper 8 ,
 .Xr sendmail 8
 .Pp
 .Xr postfix 1 Pq Pa ports/mail/postfix ,
+.Xr dma 8 Pq Pa ports/mail/dma ,
+.Xr exim 8 Pq Pa ports/mail/exim ,
 .Xr mini_sendmail 8 Pq Pa ports/mail/mini_sendmail
 .Sh HISTORY
 .Nm
___
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: r295783 - head/share/man/man4

2016-02-18 Thread Maxim Sobolev
Author: sobomax
Date: Fri Feb 19 01:06:45 2016
New Revision: 295783
URL: https://svnweb.freebsd.org/changeset/base/295783

Log:
  Fix section number of .Xr geom_uzip in r295782.
  
  MFC after:1 months
(together with r295782)

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

Modified: head/share/man/man4/geom_uncompress.4
==
--- head/share/man/man4/geom_uncompress.4   Fri Feb 19 01:00:48 2016
(r295782)
+++ head/share/man/man4/geom_uncompress.4   Fri Feb 19 01:06:45 2016
(r295783)
@@ -111,7 +111,7 @@ and added LZMA functionality .
 This manual page was written by
 .An Ceri Davies Aq Mt c...@freebsd.org
 for the
-.Xr geom_uzip 8 ,
+.Xr geom_uzip 4 ,
 and modified by
 .An Luiz Otavio O Souza Aq Mt l...@freebsd.org
 to match
___
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: r295782 - head/share/man/man4

2016-02-18 Thread Maxim Sobolev
Author: sobomax
Date: Fri Feb 19 01:00:48 2016
New Revision: 295782
URL: https://svnweb.freebsd.org/changeset/base/295782

Log:
  Clear up confision as to who the original historical authors of code
  and manual page were.
  
  For whatever reason it listed myself as a primary author, which is
  just not true.
  
  Also, majority of the manpage is copied verbatim from the geom_uzip(4),
  contributed by ceri, with only minor adjustments from loos, so put ceri
  back into the copyright secrion where he belongs and reflect that in the
  AUTHORS section.
  
  For what it's worth, I think this one should be deleted and LZMA
  support just folded back into geom_uzip(4) / mkuzip(4) whete it really
  belongs.
  
  MFC after:1 month

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

Modified: head/share/man/man4/geom_uncompress.4
==
--- head/share/man/man4/geom_uncompress.4   Fri Feb 19 00:41:41 2016
(r295781)
+++ head/share/man/man4/geom_uncompress.4   Fri Feb 19 01:00:48 2016
(r295782)
@@ -1,3 +1,4 @@
+.\" Copyright (c) 2006, Ceri Davies 
 .\" Copyright (c) 2014, Luiz Otavio O Souza 
 .\" All rights reserved.
 .\"
@@ -100,8 +101,18 @@ Consumers:
 The
 .Nm
 driver was written by
-.An Maxim Sobolev Aq Mt sobo...@freebsd.org
-and
-.An Aleksandr Rybalko Aq Mt r...@freebsd.org .
+.An Max Khon Aq Mt f...@freebsd.org
+as
+.Xr geom_uzip 4 .
+.An Aleksandr Rybalko Aq Mt r...@freebsd.org
+copied it over as
+.Nm
+and added LZMA functionality .
 This manual page was written by
-.An Luiz Otavio O Souza Aq Mt l...@freebsd.org .
+.An Ceri Davies Aq Mt c...@freebsd.org
+for the
+.Xr geom_uzip 8 ,
+and modified by
+.An Luiz Otavio O Souza Aq Mt l...@freebsd.org
+to match
+.Nm .
___
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: r295780 - head/usr.bin/clang/llvm-ar

2016-02-18 Thread Bryan Drewery
Author: bdrewery
Date: Fri Feb 19 00:41:38 2016
New Revision: 295780
URL: https://svnweb.freebsd.org/changeset/base/295780

Log:
  DIRDEPS_BUILD: Add dependencies somehow missed in r295681.
  
  Sponsored by: EMC / Isilon Storage Division

Modified:
  head/usr.bin/clang/llvm-ar/Makefile.depend

Modified: head/usr.bin/clang/llvm-ar/Makefile.depend
==
--- head/usr.bin/clang/llvm-ar/Makefile.depend  Fri Feb 19 00:41:24 2016
(r295779)
+++ head/usr.bin/clang/llvm-ar/Makefile.depend  Fri Feb 19 00:41:38 2016
(r295780)
@@ -2,10 +2,76 @@
 # Autogenerated - do NOT edit!
 
 DIRDEPS = \
+   gnu/lib/csu \
+   gnu/lib/libgcc \
include \
include/xlocale \
+   lib/${CSU_DIR} \
+   lib/clang/libllvmaarch64asmparser \
+   lib/clang/libllvmaarch64codegen \
+   lib/clang/libllvmaarch64desc \
+   lib/clang/libllvmaarch64disassembler \
+   lib/clang/libllvmaarch64info \
+   lib/clang/libllvmaarch64instprinter \
+   lib/clang/libllvmaarch64utils \
+   lib/clang/libllvmanalysis \
+   lib/clang/libllvmarmasmparser \
+   lib/clang/libllvmarmcodegen \
+   lib/clang/libllvmarmdesc \
+   lib/clang/libllvmarmdisassembler \
+   lib/clang/libllvmarminfo \
+   lib/clang/libllvmarminstprinter \
+   lib/clang/libllvmasmprinter \
+   lib/clang/libllvmbitreader \
+   lib/clang/libllvmcodegen \
+   lib/clang/libllvmcore \
+   lib/clang/libllvminstcombine \
+   lib/clang/libllvminstrumentation \
+   lib/clang/libllvmipa \
+   lib/clang/libllvmlibdriver \
+   lib/clang/libllvmmc \
+   lib/clang/libllvmmcdisassembler \
+   lib/clang/libllvmmcparser \
+   lib/clang/libllvmmipsasmparser \
+   lib/clang/libllvmmipscodegen \
+   lib/clang/libllvmmipsdesc \
+   lib/clang/libllvmmipsdisassembler \
+   lib/clang/libllvmmipsinfo \
+   lib/clang/libllvmmipsinstprinter \
+   lib/clang/libllvmobject \
+   lib/clang/libllvmoption \
+   lib/clang/libllvmpowerpcasmparser \
+   lib/clang/libllvmpowerpccodegen \
+   lib/clang/libllvmpowerpcdesc \
+   lib/clang/libllvmpowerpcdisassembler \
+   lib/clang/libllvmpowerpcinfo \
+   lib/clang/libllvmpowerpcinstprinter \
+   lib/clang/libllvmprofiledata \
+   lib/clang/libllvmscalaropts \
+   lib/clang/libllvmselectiondag \
+   lib/clang/libllvmsparcasmparser \
+   lib/clang/libllvmsparccodegen \
+   lib/clang/libllvmsparcdesc \
+   lib/clang/libllvmsparcdisassembler \
+   lib/clang/libllvmsparcinfo \
+   lib/clang/libllvmsparcinstprinter \
+   lib/clang/libllvmsupport \
+   lib/clang/libllvmtarget \
+   lib/clang/libllvmtransformutils \
+   lib/clang/libllvmx86asmparser \
+   lib/clang/libllvmx86codegen \
+   lib/clang/libllvmx86desc \
+   lib/clang/libllvmx86disassembler \
+   lib/clang/libllvmx86info \
+   lib/clang/libllvmx86instprinter \
+   lib/clang/libllvmx86utils \
+   lib/libc \
lib/libc++ \
+   lib/libcompiler_rt \
+   lib/libthr \
+   lib/libz \
lib/msun \
+   lib/ncurses/ncursesw \
 
 
 .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: r295781 - head/sys/conf

2016-02-18 Thread Bryan Drewery
Author: bdrewery
Date: Fri Feb 19 00:41:41 2016
New Revision: 295781
URL: https://svnweb.freebsd.org/changeset/base/295781

Log:
  FAST_DEPEND: Apply conditional -MF from r291945 to kernel as well.
  
  Sponsored by: EMC / Isilon Storage Division

Modified:
  head/sys/conf/kern.post.mk

Modified: head/sys/conf/kern.post.mk
==
--- head/sys/conf/kern.post.mk  Fri Feb 19 00:41:38 2016(r295780)
+++ head/sys/conf/kern.post.mk  Fri Feb 19 00:41:41 2016(r295781)
@@ -228,7 +228,14 @@ DEPENDFILES=   .depend
 DEPENDFILES+=  .depend.*
 DEPEND_CFLAGS+=-MD -MP -MF.depend.${.TARGET}
 DEPEND_CFLAGS+=-MT${.TARGET}
+.if defined(.PARSEDIR)
+# Only add in DEPEND_CFLAGS for CFLAGS on files we expect from DEPENDOBJS
+# as those are the only ones we will include.
+DEPEND_CFLAGS_CONDITION= !empty(DEPENDOBJS:M${.TARGET})
+CFLAGS+=   ${${DEPEND_CFLAGS_CONDITION}:?${DEPEND_CFLAGS}:}
+.else
 CFLAGS+=   ${DEPEND_CFLAGS}
+.endif
 DEPENDOBJS+=   ${SYSTEM_OBJS} genassym.o
 DEPENDFILES_OBJS=  ${DEPENDOBJS:O:u:C/^/.depend./}
 .if !defined(_SKIP_READ_DEPEND)
___
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: r295779 - in head: share/mk sys/conf

2016-02-18 Thread Bryan Drewery
Author: bdrewery
Date: Fri Feb 19 00:41:24 2016
New Revision: 295779
URL: https://svnweb.freebsd.org/changeset/base/295779

Log:
  Avoid reading .depend.* in simple cases where not needed.
  
  This will speed up some tree-walks with FAST_DEPEND which otherwise
  would include length(SRCS) .depend files.
  
  This also uses a trick suggested by sjg@ to still read them in when
  specifying _V_READ_DEPEND=1 in the env/make args.
  
  Sponsored by: EMC / Isilon Storage Division

Modified:
  head/share/mk/bsd.dep.mk
  head/sys/conf/kern.post.mk

Modified: head/share/mk/bsd.dep.mk
==
--- head/share/mk/bsd.dep.mkFri Feb 19 00:29:16 2016(r295778)
+++ head/share/mk/bsd.dep.mkFri Feb 19 00:41:24 2016(r295779)
@@ -81,6 +81,16 @@ tags: ${SRCS}
 .endif
 .endif
 
+# Skip reading .depend when not needed to speed up tree-walks
+# and simple lookups.
+.if !empty(.MAKEFLAGS:M-V${_V_READ_DEPEND}) || make(obj) || make(clean*) || \
+make(install*)
+_SKIP_READ_DEPEND= 1
+.if ${MK_DIRDEPS_BUILD} == "no"
+.MAKE.DEPENDFILE=  /dev/null
+.endif
+.endif
+
 .if defined(SRCS)
 CLEANFILES?=
 
@@ -181,7 +191,7 @@ DEPENDSRCS= ${SRCS:M*.[cSC]} ${SRCS:M*.c
 DEPENDOBJS+=   ${DEPENDSRCS:R:S,$,.o,}
 .endif
 DEPENDFILES_OBJS=  ${DEPENDOBJS:O:u:${DEPEND_FILTER}:C/^/${DEPENDFILE}./}
-.if ${.MAKEFLAGS:M-V} == ""
+.if !defined(_SKIP_READ_DEPEND)
 .for __depend_obj in ${DEPENDFILES_OBJS}
 .sinclude "${__depend_obj}"
 .endfor

Modified: head/sys/conf/kern.post.mk
==
--- head/sys/conf/kern.post.mk  Fri Feb 19 00:29:16 2016(r295778)
+++ head/sys/conf/kern.post.mk  Fri Feb 19 00:41:24 2016(r295779)
@@ -206,6 +206,15 @@ CFILES_OFED=${CFILES:M*/ofed/*}
 # We have "special" -I include paths for MLX5.
 CFILES_MLX5=${CFILES:M*/dev/mlx5/*}
 
+# Skip reading .depend when not needed to speed up tree-walks
+# and simple lookups.
+.if !empty(.MAKEFLAGS:M-V${_V_READ_DEPEND}) || make(obj) || make(clean*) || \
+make(install*) || make(kernel-obj) || make(kernel-clean*) || \
+make(kernel-install*)
+_SKIP_READ_DEPEND= 1
+.MAKE.DEPENDFILE=  /dev/null
+.endif
+
 kernel-depend: .depend
 # The argument list can be very long, so use make -V and xargs to
 # pass it to mkdep.
@@ -222,7 +231,7 @@ DEPEND_CFLAGS+= -MT${.TARGET}
 CFLAGS+=   ${DEPEND_CFLAGS}
 DEPENDOBJS+=   ${SYSTEM_OBJS} genassym.o
 DEPENDFILES_OBJS=  ${DEPENDOBJS:O:u:C/^/.depend./}
-.if ${.MAKEFLAGS:M-V} == ""
+.if !defined(_SKIP_READ_DEPEND)
 .for __depend_obj in ${DEPENDFILES_OBJS}
 .sinclude "${__depend_obj}"
 .endfor
___
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: r229537 - in head/sys: conf geom/uncompress modules/geom/geom_uncompress

2016-02-18 Thread Bryan Drewery
On 2/18/2016 3:57 PM, Maxim Sobolev wrote:
> Aleksandr, Adrian,
> 
> I know it's 3 years later, but I really don't know why it's been done
> this way. Take a GEOM module and associated usr.bin utility, copy it
> verbatim add few lines of code and re-add that as a new module seems
> like just laziness and attempt to avoid doing extra work on making
> unified code. The same goes for the mkulzma, which is almost 1:1 copy of
> the mkuzip. Now people are merging back and forth and I've just spent
> few days testing some rather major rework of geom_uzip / mkuzip code not
> even realizing that there is its evil twin in the tree. :(

r283104 is an example of one of these problems. It was a catch-up of
uzip's r268986 done almost a year before. I did comparisons before using
uzip last summer and ran across that one.

> 
> https://reviews.freebsd.org/D5333
> 
> I suggest functionality from both geom_uncompress / mkulzma are folded
> now back into geom_uzip / mkuzip and geom_uncompress / mkulzma are nuked
> afterwards.
> 
> Thanks!
> 
>  
> 
> Author: ray
> Date: Wed Jan 4 23:39:11 2012
> New Revision: 229537
> URL: http://svn.freebsd.org/changeset/base/229537
> Log:
> GEOM_UNCOMPRESS module, can be used with uzip images and with new
> ulzma images.
> Approved by: adrian (mentor)
> Added:
> head/sys/geom/uncompress/
> head/sys/geom/uncompress/g_uncompress.c (contents, props changed)
> head/sys/modules/geom/geom_uncompress/
> head/sys/modules/geom/geom_uncompress/Makefile (contents, props changed)
> Modified:
> head/sys/conf/files
> head/sys/conf/options
> 
> 


-- 
Regards,
Bryan Drewery



signature.asc
Description: OpenPGP digital signature


svn commit: r295778 - in head/sys/dev/cxgbe: . common tom

2016-02-18 Thread Navdeep Parhar
Author: np
Date: Fri Feb 19 00:29:16 2016
New Revision: 295778
URL: https://svnweb.freebsd.org/changeset/base/295778

Log:
  cxgbe: catch up with the latest hardware-related definitions.
  
  Obtained from:Chelsio Communications
  Sponsored by: Chelsio Communications

Modified:
  head/sys/dev/cxgbe/adapter.h
  head/sys/dev/cxgbe/common/common.h
  head/sys/dev/cxgbe/common/t4_hw.h
  head/sys/dev/cxgbe/common/t4_msg.h
  head/sys/dev/cxgbe/common/t4_regs.h
  head/sys/dev/cxgbe/common/t4_regs_values.h
  head/sys/dev/cxgbe/common/t4_tcb.h
  head/sys/dev/cxgbe/tom/t4_connect.c

Modified: head/sys/dev/cxgbe/adapter.h
==
--- head/sys/dev/cxgbe/adapter.hThu Feb 18 23:32:11 2016
(r295777)
+++ head/sys/dev/cxgbe/adapter.hFri Feb 19 00:29:16 2016
(r295778)
@@ -813,7 +813,7 @@ struct adapter {
struct mtx regwin_lock; /* for indirect reads and memory windows */
 
an_handler_t an_handler __aligned(CACHE_LINE_SIZE);
-   fw_msg_handler_t fw_msg_handler[5]; /* NUM_FW6_TYPES */
+   fw_msg_handler_t fw_msg_handler[7]; /* NUM_FW6_TYPES */
cpl_handler_t cpl_handler[0xef];/* NUM_CPL_CMDS */
 
 #ifdef INVARIANTS

Modified: head/sys/dev/cxgbe/common/common.h
==
--- head/sys/dev/cxgbe/common/common.h  Thu Feb 18 23:32:11 2016
(r295777)
+++ head/sys/dev/cxgbe/common/common.h  Fri Feb 19 00:29:16 2016
(r295778)
@@ -47,6 +47,7 @@ enum { MEM_EDC0, MEM_EDC1, MEM_MC, MEM_M
 enum {
MEMWIN0_APERTURE = 2048,
MEMWIN0_BASE = 0x1b800,
+
MEMWIN1_APERTURE = 32768,
MEMWIN1_BASE = 0x28000,
 

Modified: head/sys/dev/cxgbe/common/t4_hw.h
==
--- head/sys/dev/cxgbe/common/t4_hw.h   Thu Feb 18 23:32:11 2016
(r295777)
+++ head/sys/dev/cxgbe/common/t4_hw.h   Fri Feb 19 00:29:16 2016
(r295778)
@@ -1,5 +1,5 @@
 /*-
- * Copyright (c) 2011 Chelsio Communications, Inc.
+ * Copyright (c) 2011, 2016 Chelsio Communications, Inc.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -266,6 +266,12 @@ enum {
FLASH_CFG_MAX_SIZE = FLASH_MAX_SIZE(FLASH_CFG_NSECS),
 
/*
+* We don't support FLASH devices which can't support the full
+* standard set of sections which we need for normal operations.
+*/
+   FLASH_MIN_SIZE = FLASH_CFG_START + FLASH_CFG_MAX_SIZE,
+
+   /*
 * Sectors 32-63 are reserved for FLASH failover.
 */
 };
@@ -273,4 +279,9 @@ enum {
 #undef FLASH_START
 #undef FLASH_MAX_SIZE
 
+#define S_SGE_TIMESTAMP 0
+#define M_SGE_TIMESTAMP 0xfffULL
+#define V_SGE_TIMESTAMP(x) ((__u64)(x) << S_SGE_TIMESTAMP)
+#define G_SGE_TIMESTAMP(x) (((__u64)(x) >> S_SGE_TIMESTAMP) & M_SGE_TIMESTAMP)
+
 #endif /* __T4_HW_H */

Modified: head/sys/dev/cxgbe/common/t4_msg.h
==
--- head/sys/dev/cxgbe/common/t4_msg.h  Thu Feb 18 23:32:11 2016
(r295777)
+++ head/sys/dev/cxgbe/common/t4_msg.h  Fri Feb 19 00:29:16 2016
(r295778)
@@ -1,5 +1,5 @@
 /*-
- * Copyright (c) 2011 Chelsio Communications, Inc.
+ * Copyright (c) 2011, 2016 Chelsio Communications, Inc.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -55,8 +55,9 @@ enum {
CPL_BARRIER   = 0x18,
CPL_TID_RELEASE   = 0x1A,
CPL_TAG_READ_REQ  = 0x1B,
+   CPL_SRQ_TABLE_REQ = 0x1C,
CPL_TX_PKT_FSO= 0x1E,
-   CPL_TX_PKT_ISO= 0x1F,
+   CPL_TX_DATA_ISO   = 0x1F,
 
CPL_CLOSE_LISTSRV_RPL = 0x20,
CPL_ERROR = 0x21,
@@ -97,7 +98,7 @@ enum {
CPL_RX_DATA_DDP   = 0x42,
CPL_SMT_READ_RPL  = 0x43,
CPL_PASS_ACCEPT_REQ   = 0x44,
-   CPL_RX2TX_PKT = 0x45,
+   CPL_RX_ISCSI_CMP  = 0x45,
CPL_RX_FCOE_DDP   = 0x46,
CPL_FCOE_HDR  = 0x47,
CPL_T5_TRACE_PKT  = 0x48,
@@ -124,6 +125,7 @@ enum {
CPL_RDMA_ATOMIC_RPL   = 0xAB,
CPL_RDMA_IMM_DATA = 0xAC,
CPL_RDMA_IMM_DATA_SE  = 0xAD,
+   CPL_RX_MPS_PKT= 0xAF,
 
CPL_TRACE_PKT = 0xB0,
CPL_RX2TX_DATA= 0xB1,
@@ -133,9 +135,11 @@ enum {
CPL_FW4_MSG   = 0xC0,
CPL_FW4_PLD   = 0xC1,
CPL_FW4_ACK   = 0xC3,
+   CPL_SRQ_TABLE_RPL = 0xCC,
 
CPL_FW6_MSG   = 0xE0,
CPL_FW6_PLD   = 0xE1,
+   CPL_TX_TNL_LSO= 0xEC,
CPL_TX_PKT_LSO= 0xED,
CPL_TX_PKT_XT = 0xEE,
 
@@ -145,6 +149,7 @@ enum {
 enum CPL_error {
CPL_ERR_NONE   = 0,
CPL_ERR_TCAM_PARITY= 1,
+   CPL

Re: svn commit: r229537 - in head/sys: conf geom/uncompress modules/geom/geom_uncompress

2016-02-18 Thread Maxim Sobolev
And also geom_uncompress(4) lists myself as a primary historical author of
the kernel module code, which I think just plain confusion between my name
and name of Max Khon, who is the original creator of geom_uzip(4). It's
further reiterates the need to clean this up properly, so only the code
with longer history survives.

On Thu, Feb 18, 2016 at 3:57 PM, Maxim Sobolev  wrote:

> Aleksandr, Adrian,
>
> I know it's 3 years later, but I really don't know why it's been done this
> way. Take a GEOM module and associated usr.bin utility, copy it verbatim
> add few lines of code and re-add that as a new module seems like just
> laziness and attempt to avoid doing extra work on making unified code. The
> same goes for the mkulzma, which is almost 1:1 copy of the mkuzip. Now
> people are merging back and forth and I've just spent few days testing some
> rather major rework of geom_uzip / mkuzip code not even realizing that
> there is its evil twin in the tree. :(
>
> https://reviews.freebsd.org/D5333
>
> I suggest functionality from both geom_uncompress / mkulzma are folded now
> back into geom_uzip / mkuzip and geom_uncompress / mkulzma are nuked
> afterwards.
>
> Thanks!
>
>
>
>> Author: ray
>> Date: Wed Jan 4 23:39:11 2012
>> New Revision: 229537
>> URL: http://svn.freebsd.org/changeset/base/229537
>> Log:
>> GEOM_UNCOMPRESS module, can be used with uzip images and with new ulzma
>> images.
>> Approved by: adrian (mentor)
>> Added:
>> head/sys/geom/uncompress/
>> head/sys/geom/uncompress/g_uncompress.c (contents, props changed)
>> head/sys/modules/geom/geom_uncompress/
>> head/sys/modules/geom/geom_uncompress/Makefile (contents, props changed)
>> Modified:
>> head/sys/conf/files
>> head/sys/conf/options
>
>
>
___
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: r229537 - in head/sys: conf geom/uncompress modules/geom/geom_uncompress

2016-02-18 Thread Maxim Sobolev
Aleksandr, Adrian,

I know it's 3 years later, but I really don't know why it's been done this
way. Take a GEOM module and associated usr.bin utility, copy it verbatim
add few lines of code and re-add that as a new module seems like just
laziness and attempt to avoid doing extra work on making unified code. The
same goes for the mkulzma, which is almost 1:1 copy of the mkuzip. Now
people are merging back and forth and I've just spent few days testing some
rather major rework of geom_uzip / mkuzip code not even realizing that
there is its evil twin in the tree. :(

https://reviews.freebsd.org/D5333

I suggest functionality from both geom_uncompress / mkulzma are folded now
back into geom_uzip / mkuzip and geom_uncompress / mkulzma are nuked
afterwards.

Thanks!



> Author: ray
> Date: Wed Jan 4 23:39:11 2012
> New Revision: 229537
> URL: http://svn.freebsd.org/changeset/base/229537
> Log:
> GEOM_UNCOMPRESS module, can be used with uzip images and with new ulzma
> images.
> Approved by: adrian (mentor)
> Added:
> head/sys/geom/uncompress/
> head/sys/geom/uncompress/g_uncompress.c (contents, props changed)
> head/sys/modules/geom/geom_uncompress/
> head/sys/modules/geom/geom_uncompress/Makefile (contents, props changed)
> Modified:
> head/sys/conf/files
> head/sys/conf/options
___
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: r295777 - head/sys/dev/acpica

2016-02-18 Thread Jung-uk Kim
Author: jkim
Date: Thu Feb 18 23:32:11 2016
New Revision: 295777
URL: https://svnweb.freebsd.org/changeset/base/295777

Log:
  Remove a bogus bzero() call.
  
  Found by: PVS-Studio

Modified:
  head/sys/dev/acpica/acpi_package.c

Modified: head/sys/dev/acpica/acpi_package.c
==
--- head/sys/dev/acpica/acpi_package.c  Thu Feb 18 23:03:37 2016
(r295776)
+++ head/sys/dev/acpica/acpi_package.c  Thu Feb 18 23:32:11 2016
(r295777)
@@ -80,7 +80,6 @@ acpi_PkgStr(ACPI_OBJECT *res, int idx, v
 obj = &res->Package.Elements[idx];
 if (obj == NULL)
return (EINVAL);
-bzero(dst, sizeof(dst));
 
 switch (obj->Type) {
 case ACPI_TYPE_STRING:
___
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: r295776 - head/sys/contrib/x86emu

2016-02-18 Thread Jung-uk Kim
Author: jkim
Date: Thu Feb 18 23:03:37 2016
New Revision: 295776
URL: https://svnweb.freebsd.org/changeset/base/295776

Log:
  Optimize ROL and ROR emulations and fix comments.

Modified:
  head/sys/contrib/x86emu/x86emu.c

Modified: head/sys/contrib/x86emu/x86emu.c
==
--- head/sys/contrib/x86emu/x86emu.cThu Feb 18 23:00:01 2016
(r295775)
+++ head/sys/contrib/x86emu/x86emu.cThu Feb 18 23:03:37 2016
(r295776)
@@ -6995,15 +6995,13 @@ rol_byte(struct x86emu *emu, uint8_t d, 
mask = (1 << cnt) - 1;
res |= (d >> (8 - cnt)) & mask;
 
-   /* set the new carry flag, Note that it is the low order bit
-* of the result!!!   */
-   CONDITIONAL_SET_FLAG(res & 0x1, F_CF);
/* OVERFLOW is set *IFF* s==1, then it is the xor of CF and
 * the most significant bit.  Blecck. */
CONDITIONAL_SET_FLAG(s == 1 &&
XOR2((res & 0x1) + ((res >> 6) & 0x2)),
F_OF);
-   } else if (s != 0) {
+   }
+   if (s != 0) {
/* set the new carry flag, Note that it is the low order bit
 * of the result!!!   */
CONDITIONAL_SET_FLAG(res & 0x1, F_CF);
@@ -7025,11 +7023,11 @@ rol_word(struct x86emu *emu, uint16_t d,
res = (d << cnt);
mask = (1 << cnt) - 1;
res |= (d >> (16 - cnt)) & mask;
-   CONDITIONAL_SET_FLAG(res & 0x1, F_CF);
CONDITIONAL_SET_FLAG(s == 1 &&
XOR2((res & 0x1) + ((res >> 14) & 0x2)),
F_OF);
-   } else if (s != 0) {
+   }
+   if (s != 0) {
/* set the new carry flag, Note that it is the low order bit
 * of the result!!!   */
CONDITIONAL_SET_FLAG(res & 0x1, F_CF);
@@ -7051,11 +7049,11 @@ rol_long(struct x86emu *emu, uint32_t d,
res = (d << cnt);
mask = (1 << cnt) - 1;
res |= (d >> (32 - cnt)) & mask;
-   CONDITIONAL_SET_FLAG(res & 0x1, F_CF);
CONDITIONAL_SET_FLAG(s == 1 &&
XOR2((res & 0x1) + ((res >> 30) & 0x2)),
F_OF);
-   } else if (s != 0) {
+   }
+   if (s != 0) {
/* set the new carry flag, Note that it is the low order bit
 * of the result!!!   */
CONDITIONAL_SET_FLAG(res & 0x1, F_CF);
@@ -7093,14 +7091,12 @@ ror_byte(struct x86emu *emu, uint8_t d, 
mask = (1 << (8 - cnt)) - 1;
res |= (d >> (cnt)) & mask;
 
-   /* set the new carry flag, Note that it is the low order bit
-* of the result!!!   */
-   CONDITIONAL_SET_FLAG(res & 0x80, F_CF);
/* OVERFLOW is set *IFF* s==1, then it is the xor of the two
 * most significant bits.  Blecck. */
CONDITIONAL_SET_FLAG(s == 1 && XOR2(res >> 6), F_OF);
-   } else if (s != 0) {
-   /* set the new carry flag, Note that it is the low order bit
+   }
+   if (s != 0) {
+   /* set the new carry flag, Note that it is the high order bit
 * of the result!!!   */
CONDITIONAL_SET_FLAG(res & 0x80, F_CF);
}
@@ -7121,10 +7117,10 @@ ror_word(struct x86emu *emu, uint16_t d,
res = (d << (16 - cnt));
mask = (1 << (16 - cnt)) - 1;
res |= (d >> (cnt)) & mask;
-   CONDITIONAL_SET_FLAG(res & 0x8000, F_CF);
CONDITIONAL_SET_FLAG(s == 1 && XOR2(res >> 14), F_OF);
-   } else if (s != 0) {
-   /* set the new carry flag, Note that it is the low order bit
+   }
+   if (s != 0) {
+   /* set the new carry flag, Note that it is the high order bit
 * of the result!!!   */
CONDITIONAL_SET_FLAG(res & 0x8000, F_CF);
}
@@ -7145,10 +7141,10 @@ ror_long(struct x86emu *emu, uint32_t d,
res = (d << (32 - cnt));
mask = (1 << (32 - cnt)) - 1;
res |= (d >> (cnt)) & mask;
-   CONDITIONAL_SET_FLAG(res & 0x8000, F_CF);
CONDITIONAL_SET_FLAG(s == 1 && XOR2(res >> 30), F_OF);
-   } else if (s != 0) {
-   /* set the new carry flag, Note that it is the low order bit
+   }
+   if (s != 0) {
+   /* set the new carry flag, Note that it is the high order bit
 * of the result!!!   */
CONDITIONAL_SET_FLAG(res & 0x8000, F_CF);
}
___
svn

svn commit: r295775 - head/sys/contrib/x86emu

2016-02-18 Thread Jung-uk Kim
Author: jkim
Date: Thu Feb 18 23:00:01 2016
New Revision: 295775
URL: https://svnweb.freebsd.org/changeset/base/295775

Log:
  Silence VPS-Studio errors (V646).  These is no functional change.

Modified:
  head/sys/contrib/x86emu/x86emu.c

Modified: head/sys/contrib/x86emu/x86emu.c
==
--- head/sys/contrib/x86emu/x86emu.cThu Feb 18 22:40:24 2016
(r295774)
+++ head/sys/contrib/x86emu/x86emu.cThu Feb 18 23:00:01 2016
(r295775)
@@ -7003,7 +7003,7 @@ rol_byte(struct x86emu *emu, uint8_t d, 
CONDITIONAL_SET_FLAG(s == 1 &&
XOR2((res & 0x1) + ((res >> 6) & 0x2)),
F_OF);
-   } if (s != 0) {
+   } else if (s != 0) {
/* set the new carry flag, Note that it is the low order bit
 * of the result!!!   */
CONDITIONAL_SET_FLAG(res & 0x1, F_CF);
@@ -7029,7 +7029,7 @@ rol_word(struct x86emu *emu, uint16_t d,
CONDITIONAL_SET_FLAG(s == 1 &&
XOR2((res & 0x1) + ((res >> 14) & 0x2)),
F_OF);
-   } if (s != 0) {
+   } else if (s != 0) {
/* set the new carry flag, Note that it is the low order bit
 * of the result!!!   */
CONDITIONAL_SET_FLAG(res & 0x1, F_CF);
@@ -7055,7 +7055,7 @@ rol_long(struct x86emu *emu, uint32_t d,
CONDITIONAL_SET_FLAG(s == 1 &&
XOR2((res & 0x1) + ((res >> 30) & 0x2)),
F_OF);
-   } if (s != 0) {
+   } else if (s != 0) {
/* set the new carry flag, Note that it is the low order bit
 * of the result!!!   */
CONDITIONAL_SET_FLAG(res & 0x1, F_CF);
___
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: r295774 - head/share/man/man5

2016-02-18 Thread Jason Helfman
Author: jgh (doc,ports committer)
Date: Thu Feb 18 22:40:24 2016
New Revision: 295774
URL: https://svnweb.freebsd.org/changeset/base/295774

Log:
  - add dma(8) to examples in mailer.conf(5)
  
  PR:   207026
  Submitted by: lifa...@mail.lifanov.com
  Approved by:  wblock (mentor)
  Differential Revision:https://reviews.freebsd.org/D5259

Modified:
  head/share/man/man5/mailer.conf.5

Modified: head/share/man/man5/mailer.conf.5
==
--- head/share/man/man5/mailer.conf.5   Thu Feb 18 21:33:10 2016
(r295773)
+++ head/share/man/man5/mailer.conf.5   Thu Feb 18 22:40:24 2016
(r295774)
@@ -31,7 +31,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd October 8, 2010
+.Dd February 18, 2016
 .Dt MAILER.CONF 5
 .Os
 .Sh NAME
@@ -139,7 +139,21 @@ Note the use of additional arguments.
 sendmail   /usr/local/bin/mini_sendmail -srelayhost
 send-mail  /usr/local/bin/mini_sendmail -srelayhost
 .Ed
+.Pp
+Using
+.Xr dma 8
+to replace
+.Xr sendmail 8 :
+.Bd -literal -offset indent
+# Execute dma instead of sendmail
+sendmail   /usr/libexec/dma
+send-mail  /usr/libexec/dma
+mailq  /usr/libexec/dma
+newaliases /usr/libexec/dma
+rmail  /usr/libexec/dma
+.Ed
 .Sh SEE ALSO
+.Xr dma 8 ,
 .Xr mail 1 ,
 .Xr mailq 1 ,
 .Xr newaliases 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: r295773 - head/sys/netinet

2016-02-18 Thread Michael Tuexen
Author: tuexen
Date: Thu Feb 18 21:33:10 2016
New Revision: 295773
URL: https://svnweb.freebsd.org/changeset/base/295773

Log:
  Add protection code.
  
  MFC after:3 days
  CID:  748858

Modified:
  head/sys/netinet/sctp_output.c

Modified: head/sys/netinet/sctp_output.c
==
--- head/sys/netinet/sctp_output.c  Thu Feb 18 21:21:45 2016
(r295772)
+++ head/sys/netinet/sctp_output.c  Thu Feb 18 21:33:10 2016
(r295773)
@@ -3222,12 +3222,14 @@ plan_d:
}
}
 #ifdef INET
-   if ((retried == 0) && (stcb->asoc.scope.ipv4_local_scope == 0)) {
-   stcb->asoc.scope.ipv4_local_scope = 1;
-   retried = 1;
-   goto again_with_private_addresses_allowed;
-   } else if (retried == 1) {
-   stcb->asoc.scope.ipv4_local_scope = 0;
+   if (stcb) {
+   if ((retried == 0) && (stcb->asoc.scope.ipv4_local_scope == 0)) 
{
+   stcb->asoc.scope.ipv4_local_scope = 1;
+   retried = 1;
+   goto again_with_private_addresses_allowed;
+   } else if (retried == 1) {
+   stcb->asoc.scope.ipv4_local_scope = 0;
+   }
}
 #endif
 out:
___
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: r295772 - head/sys/netinet

2016-02-18 Thread Michael Tuexen
Author: tuexen
Date: Thu Feb 18 21:21:45 2016
New Revision: 295772
URL: https://svnweb.freebsd.org/changeset/base/295772

Log:
  Add some protection code.
  
  CID:  1331893
  MFC after:3 days

Modified:
  head/sys/netinet/sctp_input.c

Modified: head/sys/netinet/sctp_input.c
==
--- head/sys/netinet/sctp_input.c   Thu Feb 18 21:05:04 2016
(r295771)
+++ head/sys/netinet/sctp_input.c   Thu Feb 18 21:21:45 2016
(r295772)
@@ -365,8 +365,10 @@ sctp_process_init(struct sctp_init_chunk
}
SCTP_TCB_SEND_UNLOCK(stcb);
asoc->streamoutcnt = asoc->pre_open_streams;
-   for (i = 0; i < asoc->streamoutcnt; i++) {
-   asoc->strmout[i].state = SCTP_STREAM_OPEN;
+   if (asoc->strmout) {
+   for (i = 0; i < asoc->streamoutcnt; i++) {
+   asoc->strmout[i].state = SCTP_STREAM_OPEN;
+   }
}
/* EY - nr_sack: initialize highest tsn in nr_mapping_array */
asoc->highest_tsn_inside_nr_map = asoc->highest_tsn_inside_map;
___
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: r295771 - head/sys/netinet6

2016-02-18 Thread Michael Tuexen
Author: tuexen
Date: Thu Feb 18 21:05:04 2016
New Revision: 295771
URL: https://svnweb.freebsd.org/changeset/base/295771

Log:
  Fix reporting of mapped addressed in getpeername() and getsockname() for
  IPv6 SCTP sockets.
  This bugs were found because of an issue reported by PVS / D5245.

Modified:
  head/sys/netinet6/sctp6_usrreq.c

Modified: head/sys/netinet6/sctp6_usrreq.c
==
--- head/sys/netinet6/sctp6_usrreq.cThu Feb 18 20:37:12 2016
(r295770)
+++ head/sys/netinet6/sctp6_usrreq.cThu Feb 18 21:05:04 2016
(r295771)
@@ -1008,7 +1008,9 @@ sctp6_getaddr(struct socket *so, struct 
 
stcb = LIST_FIRST(&inp->sctp_asoc_list);
if (stcb == NULL) {
-   goto notConn6;
+   SCTP_INP_RUNLOCK(inp);
+   SCTP_LTRACE_ERR_RET(inp, NULL, NULL, 
SCTP_FROM_SCTP6_USRREQ, ENOENT);
+   return (ENOENT);
}
fnd = 0;
sin_a6 = NULL;
@@ -1025,7 +1027,9 @@ sctp6_getaddr(struct socket *so, struct 
}
if ((!fnd) || (sin_a6 == NULL)) {
/* punt */
-   goto notConn6;
+   SCTP_INP_RUNLOCK(inp);
+   SCTP_LTRACE_ERR_RET(inp, NULL, NULL, 
SCTP_FROM_SCTP6_USRREQ, ENOENT);
+   return (ENOENT);
}
vrf_id = inp->def_vrf_id;
sctp_ifa = sctp_source_address_selection(inp, stcb, 
(sctp_route_t *) & net->ro, net, 0, vrf_id);
@@ -1034,7 +1038,6 @@ sctp6_getaddr(struct socket *so, struct 
}
} else {
/* For the bound all case you get back 0 */
-   notConn6:
memset(&sin6->sin6_addr, 0, sizeof(sin6->sin6_addr));
}
} else {
@@ -1135,10 +1138,6 @@ sctp6_peeraddr(struct socket *so, struct
 static int
 sctp6_in6getaddr(struct socket *so, struct sockaddr **nam)
 {
-#ifdef INET
-   struct sockaddr *addr;
-
-#endif
struct in6pcb *inp6 = sotoin6pcb(so);
int error;
 
@@ -1150,19 +1149,21 @@ sctp6_in6getaddr(struct socket *so, stru
error = sctp6_getaddr(so, nam);
 #ifdef INET
if (error) {
+   struct sockaddr_in6 *sin6;
+
/* try v4 next if v6 failed */
error = sctp_ingetaddr(so, nam);
if (error) {
return (error);
}
-   addr = *nam;
-   /* if I'm V6ONLY, convert it to v4-mapped */
-   if (SCTP_IPV6_V6ONLY(inp6)) {
-   struct sockaddr_in6 sin6;
-
-   in6_sin_2_v4mapsin6((struct sockaddr_in *)addr, &sin6);
-   memcpy(addr, &sin6, sizeof(struct sockaddr_in6));
-   }
+   SCTP_MALLOC_SONAME(sin6, struct sockaddr_in6 *, sizeof *sin6);
+   if (sin6 == NULL) {
+   SCTP_FREE_SONAME(*nam);
+   return (ENOMEM);
+   }
+   in6_sin_2_v4mapsin6((struct sockaddr_in *)*nam, sin6);
+   SCTP_FREE_SONAME(*nam);
+   *nam = (struct sockaddr *)sin6;
}
 #endif
return (error);
@@ -1172,10 +1173,6 @@ sctp6_in6getaddr(struct socket *so, stru
 static int
 sctp6_getpeeraddr(struct socket *so, struct sockaddr **nam)
 {
-#ifdef INET
-   struct sockaddr *addr;
-
-#endif
struct in6pcb *inp6 = sotoin6pcb(so);
int error;
 
@@ -1187,19 +1184,21 @@ sctp6_getpeeraddr(struct socket *so, str
error = sctp6_peeraddr(so, nam);
 #ifdef INET
if (error) {
+   struct sockaddr_in6 *sin6;
+
/* try v4 next if v6 failed */
error = sctp_peeraddr(so, nam);
if (error) {
return (error);
}
-   addr = *nam;
-   /* if I'm V6ONLY, convert it to v4-mapped */
-   if (SCTP_IPV6_V6ONLY(inp6)) {
-   struct sockaddr_in6 sin6;
-
-   in6_sin_2_v4mapsin6((struct sockaddr_in *)addr, &sin6);
-   memcpy(addr, &sin6, sizeof(struct sockaddr_in6));
-   }
+   SCTP_MALLOC_SONAME(sin6, struct sockaddr_in6 *, sizeof *sin6);
+   if (sin6 == NULL) {
+   SCTP_FREE_SONAME(*nam);
+   return (ENOMEM);
+   }
+   in6_sin_2_v4mapsin6((struct sockaddr_in *)*nam, sin6);
+   SCTP_FREE_SONAME(*nam);
+   *nam = (struct sockaddr *)sin6;
}
 #endif
return (error);
___
svn-src-head@freebsd.or

svn commit: r295769 - head/usr.sbin/pciconf

2016-02-18 Thread Stefan Esser
Author: se
Date: Thu Feb 18 20:20:36 2016
New Revision: 295769
URL: https://svnweb.freebsd.org/changeset/base/295769

Log:
  Use __unused instead of casting to void to silence the unused parameter
  warning.
  
  Fix the indentation of 2 lines to conform with the style of this file.
  
  Submitted by: jhb

Modified:
  head/usr.sbin/pciconf/cap.c
  head/usr.sbin/pciconf/pciconf.c

Modified: head/usr.sbin/pciconf/cap.c
==
--- head/usr.sbin/pciconf/cap.c Thu Feb 18 20:08:01 2016(r295768)
+++ head/usr.sbin/pciconf/cap.c Thu Feb 18 20:20:36 2016(r295769)
@@ -117,12 +117,9 @@ cap_agp(int fd, struct pci_conf *p, uint
 }
 
 static void
-cap_vpd(int fd, struct pci_conf *p, uint8_t ptr)
+cap_vpd(int fd __unused, struct pci_conf *p __unused, uint8_t ptr __unused)
 {
 
-   (void)fd;   /* UNUSED */
-   (void)p;/* UNUSED */
-   (void)ptr;  /* UNUSED */
printf("VPD");
 }
 
@@ -520,12 +517,9 @@ cap_msix(int fd, struct pci_conf *p, uin
 }
 
 static void
-cap_sata(int fd, struct pci_conf *p, uint8_t ptr)
+cap_sata(int fd __unused, struct pci_conf *p __unused, uint8_t ptr __unused)
 {
 
-   (void)fd;   /* UNUSED */
-   (void)p;/* UNUSED */
-   (void)ptr;  /* UNUSED */
printf("SATA Index-Data Pair");
 }
 

Modified: head/usr.sbin/pciconf/pciconf.c
==
--- head/usr.sbin/pciconf/pciconf.c Thu Feb 18 20:08:01 2016
(r295768)
+++ head/usr.sbin/pciconf/pciconf.c Thu Feb 18 20:20:36 2016
(r295769)
@@ -915,8 +915,8 @@ parsesel(const char *str)
ep += 3;
i = 0;
do {
- selarr[i++] = strtoul(ep, &eppos, 10);
- ep = eppos;
+   selarr[i++] = strtoul(ep, &eppos, 10);
+   ep = eppos;
} while ((*ep == ':' || *ep == '.') && *++ep != '\0' && i < 4);
 
if (i > 2)
___
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: r295760 - head/usr.sbin/pciconf

2016-02-18 Thread Stefan Esser
Am 18.02.2016 um 19:07 schrieb John Baldwin:
> On Thursday, February 18, 2016 03:23:26 PM Stefan Esser wrote:
>> Author: se
>> Date: Thu Feb 18 15:23:25 2016
>> New Revision: 295760
>> URL: https://svnweb.freebsd.org/changeset/base/295760
>>
>> Log:
>>   Make WARNS=6 safe.
>>   
>>   Tested with Clang 3.7.1, GCC 4.2.1 and GCC 4.8.5 on amd64.
> 
> Thanks.
> 
>> Modified: head/usr.sbin/pciconf/cap.c
>> ==
>> --- head/usr.sbin/pciconf/cap.c  Thu Feb 18 15:12:52 2016
>> (r295759)
>> +++ head/usr.sbin/pciconf/cap.c  Thu Feb 18 15:23:25 2016
>> (r295760)
>> @@ -120,6 +120,9 @@ static void
>>  cap_vpd(int fd, struct pci_conf *p, uint8_t ptr)
>>  {
>>  
>> +(void)fd;   /* UNUSED */
>> +(void)p;/* UNUSED */
>> +(void)ptr;  /* UNUSED */
>>  printf("VPD");
>>  }
> 
> I think we prefer __unused in the parameter declaration instead?  That is:

Since I was not sure about the best way to silence this warning, I had
looked at the mail archive and found a mail thread from July 2012 with
subject "(void)foo or __unused foo ?". The cast to void seemed to be
the most portable method, but in fact I prefer the __unused modifier
myself.

> cap_vpd(int fd __unused, struct pci_conf *p __unused, uint8_t ptr __unused)

Yes, I'll commit that version in a minute.

>> @@ -172,6 +175,7 @@ cap_pcix(int fd, struct pci_conf *p, uin
>>  }
>>  if ((p->pc_hdr & PCIM_HDRTYPE) == 1)
>>  return;
>> +max_burst_read = 0;
>>  switch (status & PCIXM_STATUS_MAX_READ) {
>>  case PCIXM_STATUS_MAX_READ_512:
>>  max_burst_read = 512;
> 
> Compilers are simply not smart enough. :-P

Well, clang-3.7.1 in -CURRENT is ...

But both gcc-4.2.1 and gcc-4.8.5 warn about a possibly uninitialized
variable.

I could have changed the last case selector into "default" to silence
the warning without need for an initializer before the switch statement,
but that would be too ugly and misleading.

>> Modified: head/usr.sbin/pciconf/pciconf.c
>> ==
>> --- head/usr.sbin/pciconf/pciconf.c  Thu Feb 18 15:12:52 2016
>> (r295759)
>> +++ head/usr.sbin/pciconf/pciconf.c  Thu Feb 18 15:23:25 2016
>> (r295760)
>> @@ -913,7 +915,8 @@ parsesel(const char *str)
>>  ep += 3;
>>  i = 0;
>>  do {
>> -selarr[i++] = strtoul(ep, &ep, 10);
>> +  selarr[i++] = strtoul(ep, &eppos, 10);
>> +  ep = eppos;
>>  } while ((*ep == ':' || *ep == '.') && *++ep != '\0' && i < 4);
> 
> This is now indented oddly (2 spaces instead of a tab?).

Sorry, the pciconf sources do not comply with "style" and I'm to blame,
since I committed the initial version nearly 20 years ago ...

But you are correct, I got even the wrong indentation wrong ;-)

Thank you for the review and your comments, I'll commit a fixed version
now.

Best regards, STefan
___
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: r295768 - head/usr.sbin/iostat

2016-02-18 Thread Alan Somers
Author: asomers
Date: Thu Feb 18 20:08:01 2016
New Revision: 295768
URL: https://svnweb.freebsd.org/changeset/base/295768

Log:
  Fix compiler warnings in iostat
  
  Raise WARNS from 1 to 6 (the default)
  Fix warnings:
  * Use C99 designated initializers for structs, and initialize all fields
  * Mark global variables as static
  * Mark unused function arguments
  * Be careful about signed/unsigned comparisons
  
  Reviewed by:  eadler
  MFC after:4 weeks
  Sponsored by: Spectra Logic Corp
  Differential Revision:https://reviews.freebsd.org/D5328

Modified:
  head/usr.sbin/iostat/Makefile
  head/usr.sbin/iostat/iostat.c

Modified: head/usr.sbin/iostat/Makefile
==
--- head/usr.sbin/iostat/Makefile   Thu Feb 18 19:37:39 2016
(r295767)
+++ head/usr.sbin/iostat/Makefile   Thu Feb 18 20:08:01 2016
(r295768)
@@ -6,6 +6,4 @@ MAN=iostat.8
 
 LIBADD=devstat kvm m
 
-WARNS?=1
-
 .include 

Modified: head/usr.sbin/iostat/iostat.c
==
--- head/usr.sbin/iostat/iostat.c   Thu Feb 18 19:37:39 2016
(r295767)
+++ head/usr.sbin/iostat/iostat.c   Thu Feb 18 20:08:01 2016
(r295768)
@@ -117,30 +117,34 @@
 #include 
 #include 
 
-struct nlist namelist[] = {
+static struct nlist namelist[] = {
 #define X_TTY_NIN  0
-   { "_tty_nin" },
+   { .n_name = "_tty_nin",
+ .n_type = 0, .n_other = 0, .n_desc = 0, .n_value = 0 },
 #define X_TTY_NOUT 1
-   { "_tty_nout" },
+   { .n_name = "_tty_nout",
+ .n_type = 0, .n_other = 0, .n_desc = 0, .n_value = 0 },
 #define X_BOOTTIME 2
-   { "_boottime" },
+   { .n_name = "_boottime",
+ .n_type = 0, .n_other = 0, .n_desc = 0, .n_value = 0 },
 #define X_END  2
-   { NULL },
+   { .n_name = NULL,
+ .n_type = 0, .n_other = 0, .n_desc = 0, .n_value = 0 },
 };
 
 #defineIOSTAT_DEFAULT_ROWS 20  /* Traditional default `wrows' 
*/
 
-struct statinfo cur, last;
-int num_devices;
-struct device_selection *dev_select;
-int maxshowdevs;
-volatile sig_atomic_t headercount;
-volatile sig_atomic_t wresized;/* Tty resized, when non-zero. 
*/
-volatile sig_atomic_t alarm_rang;
-volatile sig_atomic_t return_requested;
-unsigned short wrows;  /* Current number of tty rows. */
-int dflag = 0, Iflag = 0, Cflag = 0, Tflag = 0, oflag = 0, Kflag = 0;
-int xflag = 0, zflag = 0;
+static struct statinfo cur, last;
+static int num_devices;
+static struct device_selection *dev_select;
+static int maxshowdevs;
+static volatile sig_atomic_t headercount;
+static volatile sig_atomic_t wresized; /* Tty resized, when non-zero. */
+static volatile sig_atomic_t alarm_rang;
+static volatile sig_atomic_t return_requested;
+static unsigned short wrows;   /* Current number of tty rows. */
+static int dflag = 0, Iflag = 0, Cflag = 0, Tflag = 0, oflag = 0, Kflag = 0;
+static int xflag = 0, zflag = 0;
 
 /* local function declarations */
 static void usage(void);
@@ -650,7 +654,7 @@ main(int argc, char **argv)
  * Force a header to be prepended to the next output.
  */
 void
-needhdr(int signo)
+needhdr(int signo __unused)
 {
 
headercount = 1;
@@ -662,7 +666,7 @@ needhdr(int signo)
  * prepended to the next output.
  */
 void
-needresize(int signo)
+needresize(int signo __unused)
 {
 
wresized = 1;
@@ -673,7 +677,7 @@ needresize(int signo)
  * Record the alarm so the main loop can break its sleep
  */
 void
-alarm_clock(int signo)
+alarm_clock(int signo __unused)
 {
alarm_rang = 1;
 }
@@ -682,7 +686,7 @@ alarm_clock(int signo)
  * Request that the main loop exit soon
  */
 void
-needreturn(int signo)
+needreturn(int signo __unused)
 {
return_requested = 1;
 }
@@ -998,8 +1002,7 @@ readvar(kvm_t *kd, const char *name, int
warnx("kvm_read(%s): %s", namelist[nlid].n_name,
kvm_geterr(kd));
return (1);
-   }
-   if (nbytes != len) {
+   } else if ((size_t)nbytes != len) {
warnx("kvm_read(%s): expected %zu bytes, got %zd bytes",
  namelist[nlid].n_name, len, nbytes);
return (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: r295767 - head/sys/compat/x86bios

2016-02-18 Thread Jung-uk Kim
Author: jkim
Date: Thu Feb 18 19:37:39 2016
New Revision: 295767
URL: https://svnweb.freebsd.org/changeset/base/295767

Log:
  Silence VPS-Studio errors (V512).  These buffer underflows are intentional.

Modified:
  head/sys/compat/x86bios/x86bios.c

Modified: head/sys/compat/x86bios/x86bios.c
==
--- head/sys/compat/x86bios/x86bios.c   Thu Feb 18 19:05:30 2016
(r295766)
+++ head/sys/compat/x86bios/x86bios.c   Thu Feb 18 19:37:39 2016
(r295767)
@@ -586,7 +586,7 @@ x86bios_call(struct x86regs *regs, uint1
X86BIOS_TRACE(Calling 0x%06x, (seg << 4) + off, regs);
 
mtx_lock(&x86bios_lock);
-   memcpy(&x86bios_emu.x86, regs, sizeof(*regs));
+   memcpy((struct x86regs *)&x86bios_emu.x86, regs, sizeof(*regs));
x86bios_fault = 0;
spinlock_enter();
x86emu_exec_call(&x86bios_emu, seg, off);
@@ -628,7 +628,7 @@ x86bios_intr(struct x86regs *regs, int i
X86BIOS_TRACE(Calling INT 0x%02x, intno, regs);
 
mtx_lock(&x86bios_lock);
-   memcpy(&x86bios_emu.x86, regs, sizeof(*regs));
+   memcpy((struct x86regs *)&x86bios_emu.x86, regs, sizeof(*regs));
x86bios_fault = 0;
spinlock_enter();
x86emu_exec_intr(&x86bios_emu, intno);
___
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: r295766 - head/sys/netpfil/ipfw

2016-02-18 Thread Gleb Smirnoff
Author: glebius
Date: Thu Feb 18 19:05:30 2016
New Revision: 295766
URL: https://svnweb.freebsd.org/changeset/base/295766

Log:
  Fix obvious typo, that lead to incorrect sorting.
  
  Found by: PVS-Studio

Modified:
  head/sys/netpfil/ipfw/ip_fw_sockopt.c

Modified: head/sys/netpfil/ipfw/ip_fw_sockopt.c
==
--- head/sys/netpfil/ipfw/ip_fw_sockopt.c   Thu Feb 18 18:50:03 2016
(r295765)
+++ head/sys/netpfil/ipfw/ip_fw_sockopt.c   Thu Feb 18 19:05:30 2016
(r295766)
@@ -2890,7 +2890,7 @@ compare_sh(const void *_a, const void *_
 
if ((uintptr_t)a->handler < (uintptr_t)b->handler)
return (-1);
-   else if ((uintptr_t)b->handler > (uintptr_t)b->handler)
+   else if ((uintptr_t)a->handler > (uintptr_t)b->handler)
return (1);
 
return (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: r295765 - head/lib/libc/sys

2016-02-18 Thread Benjamin Kaduk
Author: bjk (doc committer)
Date: Thu Feb 18 18:50:03 2016
New Revision: 295765
URL: https://svnweb.freebsd.org/changeset/base/295765

Log:
  Bump .Dd for r295764
  
  Also fix a spelling and grammar nit while here.

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

Modified: head/lib/libc/sys/lseek.2
==
--- head/lib/libc/sys/lseek.2   Thu Feb 18 18:41:40 2016(r295764)
+++ head/lib/libc/sys/lseek.2   Thu Feb 18 18:50:03 2016(r295765)
@@ -28,7 +28,7 @@
 .\" @(#)lseek.28.3 (Berkeley) 4/19/94
 .\" $FreeBSD$
 .\"
-.Dd May 26, 2012
+.Dd February 18, 2016
 .Dt LSEEK 2
 .Os
 .Sh NAME
@@ -134,9 +134,9 @@ find all such ranges in a file.
 Each file is presented as having a zero-size virtual hole at the very
 end of the file.
 The existence of a hole at the end of every data region allows for easy
-programming and also provides compatibility to the original imlementation
+programming and also provides compatibility to the original implementation
 in Solaris.
-It also causes the current file size (i.e. end-of-file offset) to be returned
+It also causes the current file size (i.e., end-of-file offset) to be returned
 to indicate that there are no more holes past the supplied
 .Fa offset .
 Applications should use
___
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: r295764 - head/lib/libc/sys

2016-02-18 Thread Maxim Sobolev
Author: sobomax
Date: Thu Feb 18 18:41:40 2016
New Revision: 295764
URL: https://svnweb.freebsd.org/changeset/base/295764

Log:
  Right now, the "virtual hole" API feature of lseek(2) is very vaguely
  documented and easy to miss.
  
  At the same time, it's pretty important for anyone who is trying to use
  SEEK_HOLE/SEEK_DATA in real app. Try to bridge that gap by making that
  description more pronounced and also document how it affects failure codes.
  
  Reviewed by:  kib
  Differential Revision:https://reviews.freebsd.org/D5162

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

Modified: head/lib/libc/sys/lseek.2
==
--- head/lib/libc/sys/lseek.2   Thu Feb 18 17:09:55 2016(r295763)
+++ head/lib/libc/sys/lseek.2   Thu Feb 18 18:41:40 2016(r295764)
@@ -131,8 +131,14 @@ Applications can use
 .Dv SEEK_HOLE
 to optimise their behavior for ranges of zeros, but must not depend on it to
 find all such ranges in a file.
+Each file is presented as having a zero-size virtual hole at the very
+end of the file.
 The existence of a hole at the end of every data region allows for easy
-programming and implies that a virtual hole exists at the end of the file.
+programming and also provides compatibility to the original imlementation
+in Solaris.
+It also causes the current file size (i.e. end-of-file offset) to be returned
+to indicate that there are no more holes past the supplied
+.Fa offset .
 Applications should use
 .Fn fpathconf _PC_MIN_HOLE_SIZE
 or
@@ -176,9 +182,11 @@ be negative for a non-character special 
 For
 .Dv SEEK_DATA ,
 there are no more data regions past the supplied offset.
-For
-.Dv SEEK_HOLE ,
-there are no more holes past the supplied offset.
+Due to existence of the hole at the end of the file, for
+.Dv SEEK_HOLE
+this error is only returned when the
+.Fa offset
+already points to the end-of-file position.
 .It Bq Er EOVERFLOW
 The resulting file offset would be a value which cannot be represented
 correctly in an object of type
___
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: r295760 - head/usr.sbin/pciconf

2016-02-18 Thread John Baldwin
On Thursday, February 18, 2016 03:23:26 PM Stefan Esser wrote:
> Author: se
> Date: Thu Feb 18 15:23:25 2016
> New Revision: 295760
> URL: https://svnweb.freebsd.org/changeset/base/295760
> 
> Log:
>   Make WARNS=6 safe.
>   
>   Tested with Clang 3.7.1, GCC 4.2.1 and GCC 4.8.5 on amd64.

Thanks.

> Modified: head/usr.sbin/pciconf/cap.c
> ==
> --- head/usr.sbin/pciconf/cap.c   Thu Feb 18 15:12:52 2016
> (r295759)
> +++ head/usr.sbin/pciconf/cap.c   Thu Feb 18 15:23:25 2016
> (r295760)
> @@ -120,6 +120,9 @@ static void
>  cap_vpd(int fd, struct pci_conf *p, uint8_t ptr)
>  {
>  
> + (void)fd;   /* UNUSED */
> + (void)p;/* UNUSED */
> + (void)ptr;  /* UNUSED */
>   printf("VPD");
>  }

I think we prefer __unused in the parameter declaration instead?  That is:

cap_vpd(int fd __unused, struct pci_conf *p __unused, uint8_t ptr __unused)

> @@ -172,6 +175,7 @@ cap_pcix(int fd, struct pci_conf *p, uin
>   }
>   if ((p->pc_hdr & PCIM_HDRTYPE) == 1)
>   return;
> + max_burst_read = 0;
>   switch (status & PCIXM_STATUS_MAX_READ) {
>   case PCIXM_STATUS_MAX_READ_512:
>   max_burst_read = 512;

Compilers are simply not smart enough. :-P

> Modified: head/usr.sbin/pciconf/pciconf.c
> ==
> --- head/usr.sbin/pciconf/pciconf.c   Thu Feb 18 15:12:52 2016
> (r295759)
> +++ head/usr.sbin/pciconf/pciconf.c   Thu Feb 18 15:23:25 2016
> (r295760)
> @@ -913,7 +915,8 @@ parsesel(const char *str)
>   ep += 3;
>   i = 0;
>   do {
> - selarr[i++] = strtoul(ep, &ep, 10);
> +   selarr[i++] = strtoul(ep, &eppos, 10);
> +   ep = eppos;
>   } while ((*ep == ':' || *ep == '.') && *++ep != '\0' && i < 4);

This is now indented oddly (2 spaces instead of a tab?).

-- 
John Baldwin
___
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: r295762 - in head/sys: dev/ofw kern

2016-02-18 Thread Zbigniew Bodek
Author: zbb
Date: Thu Feb 18 15:44:45 2016
New Revision: 295762
URL: https://svnweb.freebsd.org/changeset/base/295762

Log:
  Fix build for i386 and arm64 after r295755
  
  - Take bus_space_tag_t type into consideration when returning
default, zero value.
  - Include missing rman.h required by ofw_pci.h

Modified:
  head/sys/dev/ofw/ofw_subr.c
  head/sys/kern/subr_bus.c

Modified: head/sys/dev/ofw/ofw_subr.c
==
--- head/sys/dev/ofw/ofw_subr.c Thu Feb 18 15:28:57 2016(r295761)
+++ head/sys/dev/ofw/ofw_subr.c Thu Feb 18 15:44:45 2016(r295762)
@@ -34,6 +34,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#include 
 
 #include 
 

Modified: head/sys/kern/subr_bus.c
==
--- head/sys/kern/subr_bus.cThu Feb 18 15:28:57 2016(r295761)
+++ head/sys/kern/subr_bus.cThu Feb 18 15:44:45 2016(r295762)
@@ -4107,7 +4107,7 @@ bus_generic_get_bus_tag(device_t dev, de
/* Propagate up the bus hierarchy until someone handles it. */
if (dev->parent != NULL)
return (BUS_GET_BUS_TAG(dev->parent, child));
-   return (NULL);
+   return ((bus_space_tag_t)0);
 }
 
 /**
@@ -4604,7 +4604,7 @@ bus_get_bus_tag(device_t dev)
 
parent = device_get_parent(dev);
if (parent == NULL)
-   return (NULL);
+   return ((bus_space_tag_t)0);
return (BUS_GET_BUS_TAG(parent, 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: r295761 - in head/sys/riscv: include riscv

2016-02-18 Thread Ruslan Bukin
Author: br
Date: Thu Feb 18 15:28:57 2016
New Revision: 295761
URL: https://svnweb.freebsd.org/changeset/base/295761

Log:
  Increase kernel and user VA space.
  This allows us to boot with more than 128MB of physical memory.
  
  Sponsored by: DARPA, AFRL
  Sponsored by: HEIF5

Modified:
  head/sys/riscv/include/vmparam.h
  head/sys/riscv/riscv/locore.S
  head/sys/riscv/riscv/pmap.c

Modified: head/sys/riscv/include/vmparam.h
==
--- head/sys/riscv/include/vmparam.hThu Feb 18 15:23:25 2016
(r295760)
+++ head/sys/riscv/include/vmparam.hThu Feb 18 15:28:57 2016
(r295761)
@@ -43,19 +43,19 @@
  * Virtual memory related constants, all in bytes
  */
 #ifndef MAXTSIZ
-#defineMAXTSIZ (32*1024*1024)  /* max text size */
+#defineMAXTSIZ (1*1024*1024*1024)  /* max text size */
 #endif
 #ifndef DFLDSIZ
 #defineDFLDSIZ (128*1024*1024) /* initial data size 
limit */
 #endif
 #ifndef MAXDSIZ
-#defineMAXDSIZ (128*1024*1024) /* max data size */
+#defineMAXDSIZ (1*1024*1024*1024)  /* max data size */
 #endif
 #ifndef DFLSSIZ
-#defineDFLSSIZ (2*1024*1024)   /* initial stack size 
limit */
+#defineDFLSSIZ (128*1024*1024) /* initial stack size 
limit */
 #endif
 #ifndef MAXSSIZ
-#defineMAXSSIZ (8*1024*1024)   /* max stack size */
+#defineMAXSSIZ (1*1024*1024*1024)  /* max stack size */
 #endif
 #ifndef SGROWSIZ
 #defineSGROWSIZ(128*1024)  /* amount to grow stack 
*/
@@ -128,12 +128,12 @@
  * We limit the size of the two spaces to 39 bits each.
  *
  * Upper region:   0x
- * 0xc000
+ * 0xff80
  *
- * Hole:   0xbfff
- * 0x8000
+ * Hole:   0xff7f
+ * 0x0080
  *
- * Lower region:   0x7fff
+ * Lower region:   0x007f
  * 0x
  *
  * We use the upper region for the kernel, and the lower region for userland.
@@ -152,19 +152,20 @@
 #defineVM_MIN_ADDRESS  (0xUL)
 #defineVM_MAX_ADDRESS  (0xUL)
 
-/* 256 MiB of kernel addresses */
-#defineVM_MIN_KERNEL_ADDRESS   (0xc000UL)
-#defineVM_MAX_KERNEL_ADDRESS   (0xcfffUL)
-
-/* Direct Map for 512 MiB of PA: 0x0 - 0x1fff */
-#defineDMAP_MIN_ADDRESS(0xd000UL)
-#defineDMAP_MAX_ADDRESS(0xefffUL)
+/* 32 GiB of kernel addresses */
+#defineVM_MIN_KERNEL_ADDRESS   (0xff80UL)
+#defineVM_MAX_KERNEL_ADDRESS   (0xff88UL)
+
+/* Direct Map for 128 GiB of PA: 0x0 - 0x1f */
+#defineDMAP_MIN_ADDRESS(0xffc0UL)
+#defineDMAP_MAX_ADDRESS(0xffdfUL)
 
 #defineDMAP_MIN_PHYSADDR   (0xUL)
 #defineDMAP_MAX_PHYSADDR   (DMAP_MAX_ADDRESS - DMAP_MIN_ADDRESS)
 
 /* True if pa is in the dmap range */
-#definePHYS_IN_DMAP(pa)((pa) <= DMAP_MAX_PHYSADDR)
+#definePHYS_IN_DMAP(pa)((pa) >= DMAP_MIN_PHYSADDR && \
+(pa) <= DMAP_MAX_PHYSADDR)
 /* True if va is in the dmap range */
 #defineVIRT_IN_DMAP(va)((va) >= DMAP_MIN_ADDRESS && \
 (va) <= DMAP_MAX_ADDRESS)
@@ -186,13 +187,15 @@
 })
 
 #defineVM_MIN_USER_ADDRESS (0xUL)
-#defineVM_MAX_USER_ADDRESS (0x8000UL)
+#defineVM_MAX_USER_ADDRESS (0x0080UL)
 
 #defineVM_MINUSER_ADDRESS  (VM_MIN_USER_ADDRESS)
 #defineVM_MAXUSER_ADDRESS  (VM_MAX_USER_ADDRESS)
 
 #defineKERNBASE(VM_MIN_KERNEL_ADDRESS)
-#defineUSRSTACK(VM_MAX_USER_ADDRESS)
+#defineSHAREDPAGE  (VM_MAXUSER_ADDRESS - PAGE_SIZE)
+#defineUSRSTACKSHAREDPAGE
+
 #defineKERNENTRY   (0x200)
 
 /*

Modified: head/sys/riscv/riscv/locore.S
==
--- head/sys/riscv/riscv/locore.S   Thu Feb 18 15:23:25 2016
(r295760)
+++ head/sys/riscv/riscv/locore.S   Thu Feb 18 15:28:57 2016
(r295761)
@@ -102,7 +102,6 @@ _start:
/* finish building ring */
 
la  t0, hardstack_end
-   sub t0, t0, s11
csrwmscratch, t0
 
la  t0, mentry

Modified: head/sys/riscv/riscv/pmap.c
==
--- head/sys/riscv/riscv/pmap.c Thu Feb 18 15:23:25 2016(r295760)
+++ head/sys/riscv/riscv/pmap.c Thu Feb 18 15:28:57 2016(r29576

svn commit: r295760 - head/usr.sbin/pciconf

2016-02-18 Thread Stefan Esser
Author: se
Date: Thu Feb 18 15:23:25 2016
New Revision: 295760
URL: https://svnweb.freebsd.org/changeset/base/295760

Log:
  Make WARNS=6 safe.
  
  Tested with Clang 3.7.1, GCC 4.2.1 and GCC 4.8.5 on amd64.

Modified:
  head/usr.sbin/pciconf/Makefile
  head/usr.sbin/pciconf/cap.c
  head/usr.sbin/pciconf/pciconf.c

Modified: head/usr.sbin/pciconf/Makefile
==
--- head/usr.sbin/pciconf/Makefile  Thu Feb 18 15:12:52 2016
(r295759)
+++ head/usr.sbin/pciconf/Makefile  Thu Feb 18 15:23:25 2016
(r295760)
@@ -5,6 +5,4 @@ PROG=   pciconf
 SRCS=  pciconf.c cap.c err.c
 MAN=   pciconf.8
 
-WARNS?=3
-
 .include 

Modified: head/usr.sbin/pciconf/cap.c
==
--- head/usr.sbin/pciconf/cap.c Thu Feb 18 15:12:52 2016(r295759)
+++ head/usr.sbin/pciconf/cap.c Thu Feb 18 15:23:25 2016(r295760)
@@ -120,6 +120,9 @@ static void
 cap_vpd(int fd, struct pci_conf *p, uint8_t ptr)
 {
 
+   (void)fd;   /* UNUSED */
+   (void)p;/* UNUSED */
+   (void)ptr;  /* UNUSED */
printf("VPD");
 }
 
@@ -172,6 +175,7 @@ cap_pcix(int fd, struct pci_conf *p, uin
}
if ((p->pc_hdr & PCIM_HDRTYPE) == 1)
return;
+   max_burst_read = 0;
switch (status & PCIXM_STATUS_MAX_READ) {
case PCIXM_STATUS_MAX_READ_512:
max_burst_read = 512;
@@ -186,6 +190,7 @@ cap_pcix(int fd, struct pci_conf *p, uin
max_burst_read = 4096;
break;
}
+   max_splits = 0;
switch (status & PCIXM_STATUS_MAX_SPLITS) {
case PCIXM_STATUS_MAX_SPLITS_1:
max_splits = 1;
@@ -518,6 +523,9 @@ static void
 cap_sata(int fd, struct pci_conf *p, uint8_t ptr)
 {
 
+   (void)fd;   /* UNUSED */
+   (void)p;/* UNUSED */
+   (void)ptr;  /* UNUSED */
printf("SATA Index-Data Pair");
 }
 
@@ -759,7 +767,7 @@ ecap_sriov(int fd, struct pci_conf *p, u
print_bar(fd, p, "iov bar  ", ptr + PCIR_SRIOV_BAR(i));
 }
 
-struct {
+static struct {
uint16_t id;
const char *name;
 } ecap_names[] = {

Modified: head/usr.sbin/pciconf/pciconf.c
==
--- head/usr.sbin/pciconf/pciconf.c Thu Feb 18 15:12:52 2016
(r295759)
+++ head/usr.sbin/pciconf/pciconf.c Thu Feb 18 15:23:25 2016
(r295760)
@@ -67,7 +67,7 @@ struct pci_vendor_info
 char   *desc;
 };
 
-TAILQ_HEAD(,pci_vendor_info)   pci_vendors;
+static TAILQ_HEAD(,pci_vendor_info)pci_vendors;
 
 static struct pcisel getsel(const char *str);
 static void list_bridge(int fd, struct pci_conf *p);
@@ -896,16 +896,18 @@ getdevice(const char *name)
 static struct pcisel
 parsesel(const char *str)
 {
-   char *ep = strchr(str, '@');
-   char *epbase;
+   const char *ep;
+   const char *epbase;
+   char *eppos;
struct pcisel sel;
unsigned long selarr[4];
int i;
 
-   if (ep == NULL)
-   ep = (char *)str;
-   else
+   ep = strchr(str, '@');
+   if (ep != NULL)
ep++;
+   else
+   ep = str;
 
epbase = ep;
 
@@ -913,7 +915,8 @@ parsesel(const char *str)
ep += 3;
i = 0;
do {
-   selarr[i++] = strtoul(ep, &ep, 10);
+ selarr[i++] = strtoul(ep, &eppos, 10);
+ ep = eppos;
} while ((*ep == ':' || *ep == '.') && *++ep != '\0' && i < 4);
 
if (i > 2)
___
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: r295759 - head/sys/cam/scsi

2016-02-18 Thread Warner Losh
Author: imp
Date: Thu Feb 18 15:12:52 2016
New Revision: 295759
URL: https://svnweb.freebsd.org/changeset/base/295759

Log:
  Remove a stray else. It isn't needed (due to the return at the end of
  the if statement it pairs with). While not an error today, a careless
  edit in the future could cause problems (though given the nature of
  this specific code, the problems quite likely would be some variation
  of "most direct access SCSI storage devices won't attach," which is
  unlikely to go unnoticed).
  
  PVS-Studio: V705

Modified:
  head/sys/cam/scsi/scsi_da.c

Modified: head/sys/cam/scsi/scsi_da.c
==
--- head/sys/cam/scsi/scsi_da.c Thu Feb 18 14:38:37 2016(r295758)
+++ head/sys/cam/scsi/scsi_da.c Thu Feb 18 15:12:52 2016(r295759)
@@ -3228,7 +3228,8 @@ dadone(struct cam_periph *periph, union 
softc->state = DA_STATE_PROBE_RC;
xpt_schedule(periph, priority);
return;
-   } else
+   }
+
/*
 * Attach to anything that claims to be a
 * direct access or optical disk device,
___
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: r295755 - in head/sys: arm/arm arm64/arm64 kern powerpc/powerpc sparc64/sparc64 sys

2016-02-18 Thread John Baldwin
On Thursday, February 18, 2016 01:00:04 PM Zbigniew Bodek wrote:
> Author: zbb
> Date: Thu Feb 18 13:00:04 2016
> New Revision: 295755
> URL: https://svnweb.freebsd.org/changeset/base/295755
> 
> Log:
>   Introduce bus_get_bus_tag() method
>   
>   Provide bus_get_bus_tag() for sparc64, powerpc, arm, arm64 and mips
>   nexus and its children in order to return a platform specific default tag.
>   
>   This is required to ensure generic correctness of the bus_space tag.
>   It is especially needed for arches where child bus tag does not match
>   the parent bus tag. This solves the problem with ppc architecture
>   where the PCI bus tag differs from parent bus tag which is big-endian.
>   
>   This commit is a part of the following patch:
>   https://reviews.freebsd.org/D4879
>   
>   Submitted by:  Marcin Mazurek 
>   Obtained from: Semihalf
>   Sponsored by:  Annapurna Labs
>   Reviewed by:   jhibbits, mmel
>   Differential Revision: https://reviews.freebsd.org/D4879

It should be noted that this API is temporary.  It should probably be marked
as such so that no code depends on it long term.  Once bus_map_resource
is implemented in the parent drivers for this bus this should be removed.
I hope to have that in place for 11 so that no release ships with this API.

I have a review open on a prototype for bus_map_resource() in D5237.

-- 
John Baldwin
___
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: r295758 - head/sys/conf

2016-02-18 Thread Ruslan Bukin
Author: br
Date: Thu Feb 18 14:38:37 2016
New Revision: 295758
URL: https://svnweb.freebsd.org/changeset/base/295758

Log:
  Use medany (Medium/Anywhere) GCC code model for RISC-V.
  This will allow us to use bigger relocations and all
  the 64-bit VA space.

Modified:
  head/sys/conf/kern.mk

Modified: head/sys/conf/kern.mk
==
--- head/sys/conf/kern.mk   Thu Feb 18 14:17:28 2016(r295757)
+++ head/sys/conf/kern.mk   Thu Feb 18 14:38:37 2016(r295758)
@@ -105,6 +105,7 @@ CFLAGS += -ffixed-x18
 .endif
 
 .if ${MACHINE_CPUARCH} == "riscv"
+CFLAGS.gcc+=   -mcmodel=medany
 INLINE_LIMIT?= 8000
 .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: r295757 - in head: lib/libc/tests/gen/posix_spawn lib/libc/tests/sys sys/boot/efi/boot1 sys/boot/i386/boot2 sys/boot/i386/pxeldr sys/boot/i386/zfsboot

2016-02-18 Thread Ed Maste
Author: emaste
Date: Thu Feb 18 14:17:28 2016
New Revision: 295757
URL: https://svnweb.freebsd.org/changeset/base/295757

Log:
  Remove dd xfer stats emitted during buildworld
  
  They result in gratuitous differences when comparing build log output.

Modified:
  head/lib/libc/tests/gen/posix_spawn/Makefile
  head/lib/libc/tests/sys/Makefile
  head/sys/boot/efi/boot1/Makefile
  head/sys/boot/i386/boot2/Makefile
  head/sys/boot/i386/pxeldr/Makefile
  head/sys/boot/i386/zfsboot/Makefile

Modified: head/lib/libc/tests/gen/posix_spawn/Makefile
==
--- head/lib/libc/tests/gen/posix_spawn/MakefileThu Feb 18 13:07:21 
2016(r295756)
+++ head/lib/libc/tests/gen/posix_spawn/MakefileThu Feb 18 14:17:28 
2016(r295757)
@@ -20,7 +20,7 @@ CLEANFILES+=  h_nonexec
 .include "../../Makefile.netbsd-tests"
 
 h_zero:
-   dd if=/dev/zero of=h_zero bs=1k count=2
+   dd if=/dev/zero of=h_zero bs=1k count=2 status=none
chmod a+x h_zero
 
 CLEANFILES+=   h_zero

Modified: head/lib/libc/tests/sys/Makefile
==
--- head/lib/libc/tests/sys/MakefileThu Feb 18 13:07:21 2016
(r295756)
+++ head/lib/libc/tests/sys/MakefileThu Feb 18 14:17:28 2016
(r295757)
@@ -78,6 +78,6 @@ truncate_test_FILESGRP= wheel
 
 CLEANFILES=truncate_test.root_owned
 truncate_test.root_owned:
-   dd if=/dev/null bs=1 count=1 of=${.TARGET}
+   dd if=/dev/null bs=1 count=1 of=${.TARGET} status=none
 
 .include 

Modified: head/sys/boot/efi/boot1/Makefile
==
--- head/sys/boot/efi/boot1/MakefileThu Feb 18 13:07:21 2016
(r295756)
+++ head/sys/boot/efi/boot1/MakefileThu Feb 18 14:17:28 2016
(r295757)
@@ -113,7 +113,8 @@ boot1.efifat: boot1.efi
uudecode ${.CURDIR}/fat-${MACHINE}.tmpl.bz2.uu
mv fat-${MACHINE}.tmpl.bz2 ${.TARGET}.bz2
bzip2 -f -d ${.TARGET}.bz2
-   dd if=boot1.efi of=${.TARGET} seek=${BOOT1_OFFSET} conv=notrunc
+   dd if=boot1.efi of=${.TARGET} seek=${BOOT1_OFFSET} conv=notrunc \
+   status=none
 
 CLEANFILES= boot1.efi boot1.efifat
 

Modified: head/sys/boot/i386/boot2/Makefile
==
--- head/sys/boot/i386/boot2/Makefile   Thu Feb 18 13:07:21 2016
(r295756)
+++ head/sys/boot/i386/boot2/Makefile   Thu Feb 18 14:17:28 2016
(r295757)
@@ -72,14 +72,14 @@ CLEANFILES+=boot2 boot2.ld boot2.ldr bo
 boot2: boot2.ld
@set -- `ls -l boot2.ld`; x=$$((7680-$$5)); \
echo "$$x bytes available"; test $$x -ge 0
-   dd if=boot2.ld of=${.TARGET} obs=7680 conv=osync
+   dd if=boot2.ld of=${.TARGET} obs=7680 conv=osync status=none
 
 boot2.ld: boot2.ldr boot2.bin ${BTXKERN}
btxld -v -E ${ORG2} -f bin -b ${BTXKERN} -l boot2.ldr \
-o ${.TARGET} -P 1 boot2.bin
 
 boot2.ldr:
-   dd if=/dev/zero of=${.TARGET} bs=512 count=1
+   dd if=/dev/zero of=${.TARGET} bs=512 count=1 status=none
 
 boot2.bin: boot2.out
${OBJCOPY} -S -O binary boot2.out ${.TARGET}

Modified: head/sys/boot/i386/pxeldr/Makefile
==
--- head/sys/boot/i386/pxeldr/Makefile  Thu Feb 18 13:07:21 2016
(r295756)
+++ head/sys/boot/i386/pxeldr/Makefile  Thu Feb 18 14:17:28 2016
(r295757)
@@ -31,7 +31,7 @@ CLEANFILES+= ${BOOT}.tmp
 
 ${BOOT}: ${LDR} ${LOADER}
cat ${LDR} ${LOADER} > ${.TARGET}.tmp
-   dd if=${.TARGET}.tmp of=${.TARGET} obs=2k conv=osync
+   dd if=${.TARGET}.tmp of=${.TARGET} obs=2k conv=osync status=none
rm ${.TARGET}.tmp
 
 LDFLAGS+=-e start -Ttext ${ORG} -Wl,-N,-S,--oformat,binary

Modified: head/sys/boot/i386/zfsboot/Makefile
==
--- head/sys/boot/i386/zfsboot/Makefile Thu Feb 18 13:07:21 2016
(r295756)
+++ head/sys/boot/i386/zfsboot/Makefile Thu Feb 18 14:17:28 2016
(r295757)
@@ -65,7 +65,7 @@ BOOT2SIZE=65536
 zfsboot2: zfsboot.ld
@set -- `ls -l zfsboot.ld`; x=$$((${BOOT2SIZE}-$$5)); \
echo "$$x bytes available"; test $$x -ge 0
-   dd if=zfsboot.ld of=${.TARGET} obs=${BOOT2SIZE} conv=osync
+   dd if=zfsboot.ld of=${.TARGET} obs=${BOOT2SIZE} conv=osync status=none
 
 zfsboot.ld: zfsboot.ldr zfsboot.bin ${BTXKERN}
btxld -v -E ${ORG2} -f bin -b ${BTXKERN} -l zfsboot.ldr \
___
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: r295756 - in head/sys: conf dev/ofw powerpc/mpc85xx powerpc/powermac powerpc/pseries

2016-02-18 Thread Zbigniew Bodek
Author: zbb
Date: Thu Feb 18 13:07:21 2016
New Revision: 295756
URL: https://svnweb.freebsd.org/changeset/base/295756

Log:
  Extract common code from PowerPC's ofw_pci
  
  Import portions of the PowerPC OF PCI implementation into
  new file "ofw_pci.c", common for other platforms. The files ofw_pci.c and
  ofw_pci.h from sys/powerpc/ofw no longer exist. All required declarations
  are moved to sys/dev/ofw/ofw_pci.h.
  
  This creates a new ofw_pci_write_ivar() function and modifies
  ofw_pci_nranges(), ofw_pci_read_ivar(), ofw_pci_route_interrupt() methods.
  Most functions contain existing ppc implementations in the majority
  unchanged. Now there is no need to have multiple identical copies
  of methods for various architectures.
  
  Submitted by:  Marcin Mazurek 
  Obtained from: Semihalf
  Sponsored by:  Annapurna Labs
  Reviewed by:   jhibbits, mmel
  Differential Revision: https://reviews.freebsd.org/D4879

Added:
  head/sys/dev/ofw/ofw_pci.c   (contents, props changed)
Modified:
  head/sys/conf/files
  head/sys/dev/ofw/ofw_pci.h
  head/sys/dev/ofw/ofw_subr.c
  head/sys/powerpc/mpc85xx/pci_mpc85xx.c
  head/sys/powerpc/powermac/cpcht.c
  head/sys/powerpc/powermac/grackle.c
  head/sys/powerpc/powermac/uninorthpci.c
  head/sys/powerpc/powermac/uninorthvar.h
  head/sys/powerpc/pseries/rtas_pci.c

Modified: head/sys/conf/files
==
--- head/sys/conf/files Thu Feb 18 13:00:04 2016(r295755)
+++ head/sys/conf/files Thu Feb 18 13:07:21 2016(r295756)
@@ -2108,6 +2108,7 @@ dev/ofw/ofw_subr.coptional fdt
 dev/ofw/ofwbus.c   optional fdt
 dev/ofw/openfirm.c optional fdt
 dev/ofw/openfirmio.c   optional fdt
+dev/ofw/ofw_pci.c  optional fdt pci
 dev/ow/ow.coptional ow \
dependency  "owll_if.h" \
dependency  "own_if.h"

Added: head/sys/dev/ofw/ofw_pci.c
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/sys/dev/ofw/ofw_pci.c  Thu Feb 18 13:07:21 2016(r295756)
@@ -0,0 +1,622 @@
+/*-
+ * Copyright (c) 2011 Nathan Whitehorn
+ * 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, 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 AND CONTRIBUTORS ``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 OR CONTRIBUTORS 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.
+ */
+
+#include 
+__FBSDID("$FreeBSD$");
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+#include 
+#include 
+#include 
+
+#include 
+#include 
+
+#include 
+#include 
+#include 
+
+#include 
+#include 
+
+#include "pcib_if.h"
+
+/* 
+ * If it is necessary to set another value of this for 
+ * some platforms it should be set at fdt.h file
+ */
+#ifndef PCI_MAP_INTR
+#definePCI_MAP_INTR4
+#endif
+
+#definePCI_INTR_PINS   4
+
+/*
+ * bus interface.
+ */
+static struct resource * ofw_pci_alloc_resource(device_t, device_t,
+int, int *, u_long, u_long, u_long, u_int);
+static int ofw_pci_release_resource(device_t, device_t, int, int,
+struct resource *);
+static int ofw_pci_activate_resource(device_t, device_t, int, int,
+struct resource *);
+static int ofw_pci_deactivate_resource(device_t, device_t, int, int,
+struct resource *);
+static int ofw_pci_adjust_resource(device_t, device_t, int,
+struct resource *, u_long, u_long);
+
+/*
+ * pcib interface
+ */
+static int ofw_pci_maxslots(device_t);
+
+/*
+ * ofw_bus interface
+ */
+static phandle_t ofw_pci_get_node(device_t, device_t);
+
+/*
+ * local methods
+ */
+static int ofw_pci_fill_ranges(phandle_t, struct ofw_pci_range *);
+
+/*
+ * Driver methods.
+ */
+static device_method_t ofw_pci_method

svn commit: r295755 - in head/sys: arm/arm arm64/arm64 kern powerpc/powerpc sparc64/sparc64 sys

2016-02-18 Thread Zbigniew Bodek
Author: zbb
Date: Thu Feb 18 13:00:04 2016
New Revision: 295755
URL: https://svnweb.freebsd.org/changeset/base/295755

Log:
  Introduce bus_get_bus_tag() method
  
  Provide bus_get_bus_tag() for sparc64, powerpc, arm, arm64 and mips
  nexus and its children in order to return a platform specific default tag.
  
  This is required to ensure generic correctness of the bus_space tag.
  It is especially needed for arches where child bus tag does not match
  the parent bus tag. This solves the problem with ppc architecture
  where the PCI bus tag differs from parent bus tag which is big-endian.
  
  This commit is a part of the following patch:
  https://reviews.freebsd.org/D4879
  
  Submitted by:  Marcin Mazurek 
  Obtained from: Semihalf
  Sponsored by:  Annapurna Labs
  Reviewed by:   jhibbits, mmel
  Differential Revision: https://reviews.freebsd.org/D4879

Modified:
  head/sys/arm/arm/nexus.c
  head/sys/arm64/arm64/nexus.c
  head/sys/kern/bus_if.m
  head/sys/kern/subr_bus.c
  head/sys/powerpc/powerpc/nexus.c
  head/sys/sparc64/sparc64/nexus.c
  head/sys/sys/bus.h

Modified: head/sys/arm/arm/nexus.c
==
--- head/sys/arm/arm/nexus.cThu Feb 18 11:53:57 2016(r295754)
+++ head/sys/arm/arm/nexus.cThu Feb 18 13:00:04 2016(r295755)
@@ -85,6 +85,7 @@ staticstruct resource *nexus_alloc_reso
 rman_res_t, rman_res_t, rman_res_t, u_int);
 static int nexus_activate_resource(device_t, device_t, int, int,
 struct resource *);
+static bus_space_tag_t nexus_get_bus_tag(device_t, device_t);
 #ifdef ARM_INTRNG
 #ifdef SMP
 static int nexus_bind_intr(device_t, device_t, struct resource *, int);
@@ -124,6 +125,7 @@ static device_method_t nexus_methods[] =
DEVMETHOD(bus_release_resource, nexus_release_resource),
DEVMETHOD(bus_setup_intr,   nexus_setup_intr),
DEVMETHOD(bus_teardown_intr,nexus_teardown_intr),
+   DEVMETHOD(bus_get_bus_tag,  nexus_get_bus_tag),
 #ifdef ARM_INTRNG
DEVMETHOD(bus_describe_intr,nexus_describe_intr),
 #ifdef SMP
@@ -260,6 +262,17 @@ nexus_release_resource(device_t bus, dev
return (rman_release_resource(res));
 }
 
+static bus_space_tag_t
+nexus_get_bus_tag(device_t bus __unused, device_t child __unused)
+{
+
+#ifdef FDT
+   return(fdtbus_bs_tag);
+#else
+   return((void *)1);
+#endif
+}
+
 static int
 nexus_config_intr(device_t dev, int irq, enum intr_trigger trig,
 enum intr_polarity pol)

Modified: head/sys/arm64/arm64/nexus.c
==
--- head/sys/arm64/arm64/nexus.cThu Feb 18 11:53:57 2016
(r295754)
+++ head/sys/arm64/arm64/nexus.cThu Feb 18 13:00:04 2016
(r295755)
@@ -113,6 +113,7 @@ static  int nexus_deactivate_resource(dev
 static int nexus_setup_intr(device_t dev, device_t child, struct resource *res,
 int flags, driver_filter_t *filt, driver_intr_t *intr, void *arg, void 
**cookiep);
 static int nexus_teardown_intr(device_t, device_t, struct resource *, void *);
+static bus_space_tag_t nexus_get_bus_tag(device_t, device_t);
 #ifdef SMP
 static int nexus_bind_intr(device_t, device_t, struct resource *, int);
 #endif
@@ -134,6 +135,7 @@ static device_method_t nexus_methods[] =
DEVMETHOD(bus_deactivate_resource,  nexus_deactivate_resource),
DEVMETHOD(bus_setup_intr,   nexus_setup_intr),
DEVMETHOD(bus_teardown_intr,nexus_teardown_intr),
+   DEVMETHOD(bus_get_bus_tag,  nexus_get_bus_tag),
 #ifdef SMP
DEVMETHOD(bus_bind_intr,nexus_bind_intr),
 #endif
@@ -307,6 +309,13 @@ nexus_bind_intr(device_t dev, device_t c
 }
 #endif
 
+static bus_space_tag_t
+nexus_get_bus_tag(device_t bus __unused, device_t child __unused)
+{
+
+   return(&memmap_bus);
+}
+
 static int
 nexus_activate_resource(device_t bus, device_t child, int type, int rid,
 struct resource *r)

Modified: head/sys/kern/bus_if.m
==
--- head/sys/kern/bus_if.m  Thu Feb 18 11:53:57 2016(r295754)
+++ head/sys/kern/bus_if.m  Thu Feb 18 13:00:04 2016(r295755)
@@ -637,6 +637,17 @@ METHOD bus_dma_tag_t get_dma_tag {
 } DEFAULT bus_generic_get_dma_tag;
 
 /**
+ * @brief Returns bus_space_tag_t for use w/ devices on the bus.
+ *
+ * @param _dev the parent device of @p _child
+ * @param _child   the device to which the tag will belong
+ */
+METHOD bus_space_tag_t get_bus_tag {
+   device_t_dev;
+   device_t_child;
+} DEFAULT bus_generic_get_bus_tag;
+
+/**
  * @brief Allow the bus to determine the unit number of a device.
  *
  * @param _dev the parent device of @p _child

Modified: head/sys/kern/subr_bus.c
==
--- head/sys/kern/subr_bus.cThu Feb 18 11:53:57 2

svn commit: r295754 - head/sys/dev/ofw

2016-02-18 Thread Zbigniew Bodek
Author: zbb
Date: Thu Feb 18 11:53:57 2016
New Revision: 295754
URL: https://svnweb.freebsd.org/changeset/base/295754

Log:
  Fix bug in ofwbus_release_resource() for non-ofwbus descendants
  
  Resource list for devices that are not ofwbus descendants, but
  got to ofwbus method via bus_generic_release_resource() call chain,
  cannot be found using BUS_GET_RESOURCE_LIST() used by ofwbus.
  In that case, changing device's resource list should be avoided
  (will not contain resource list prepared by ofw or simplebus).
  
  Pointy-hat to: zbb
  Reviewed by:   wma
  Obtained from: Semihalf
  Sponsored by:  Cavium
  Differential Revision: https://reviews.freebsd.org/D5304

Modified:
  head/sys/dev/ofw/ofwbus.c

Modified: head/sys/dev/ofw/ofwbus.c
==
--- head/sys/dev/ofw/ofwbus.c   Thu Feb 18 11:26:08 2016(r295753)
+++ head/sys/dev/ofw/ofwbus.c   Thu Feb 18 11:53:57 2016(r295754)
@@ -271,12 +271,17 @@ ofwbus_release_resource(device_t bus, de
 int rid, struct resource *r)
 {
struct resource_list_entry *rle;
+   int passthrough;
int error;
 
-   /* Clean resource list entry */
-   rle = resource_list_find(BUS_GET_RESOURCE_LIST(bus, child), type, rid);
-   if (rle != NULL)
-   rle->res = NULL;
+   passthrough = (device_get_parent(child) != bus);
+   if (!passthrough) {
+   /* Clean resource list entry */
+   rle = resource_list_find(BUS_GET_RESOURCE_LIST(bus, child),
+   type, rid);
+   if (rle != NULL)
+   rle->res = NULL;
+   }
 
if ((rman_get_flags(r) & RF_ACTIVE) != 0) {
error = bus_deactivate_resource(child, type, rid, r);
___
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: r295753 - head/sys/arm64/arm64

2016-02-18 Thread Wojciech Macek
Author: wma
Date: Thu Feb 18 11:26:08 2016
New Revision: 295753
URL: https://svnweb.freebsd.org/changeset/base/295753

Log:
  Fix ThunderX external PEM bus offset
  
  Obtained from: Semihalf
  Sponsored by:  Cavium
  Approved by:   cognet (mentor)
  Reviewed by:   zbb
  Differential revision: https://reviews.freebsd.org/D5293

Modified:
  head/sys/arm64/arm64/gic_v3_its.c

Modified: head/sys/arm64/arm64/gic_v3_its.c
==
--- head/sys/arm64/arm64/gic_v3_its.c   Thu Feb 18 09:30:04 2016
(r295752)
+++ head/sys/arm64/arm64/gic_v3_its.c   Thu Feb 18 11:26:08 2016
(r295753)
@@ -59,7 +59,7 @@ __FBSDID("$FreeBSD$");
 #include "gic_v3_reg.h"
 #include "gic_v3_var.h"
 
-#defineGIC_V3_ITS_QUIRK_THUNDERX_PEM_BUS_OFFSET144
+#defineGIC_V3_ITS_QUIRK_THUNDERX_PEM_BUS_OFFSET88
 
 #include "pic_if.h"
 
___
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: r295752 - in head: lib/libkvm sys/arm/include

2016-02-18 Thread Svatopluk Kraus
Author: skra
Date: Thu Feb 18 09:30:04 2016
New Revision: 295752
URL: https://svnweb.freebsd.org/changeset/base/295752

Log:
  Remove redundant ARM_L2_ADDR_BITS and L2_ADDR_BITS definitions and
  replace them by primary ones where needed.

Modified:
  head/lib/libkvm/kvm_arm.c
  head/lib/libkvm/kvm_arm.h
  head/sys/arm/include/pmap.h
  head/sys/arm/include/pte-v6.h
  head/sys/arm/include/pte.h

Modified: head/lib/libkvm/kvm_arm.c
==
--- head/lib/libkvm/kvm_arm.c   Thu Feb 18 09:28:16 2016(r295751)
+++ head/lib/libkvm/kvm_arm.c   Thu Feb 18 09:30:04 2016(r295752)
@@ -183,7 +183,7 @@ _arm_initvtop(kvm_t *kd)
 #definel1pte_section_p(pde)(((pde) & ARM_L1_TYPE_MASK) == 
ARM_L1_TYPE_S)
 #definel1pte_valid(pde)((pde) != 0)
 #definel2pte_valid(pte)((pte) != 0)
-#define l2pte_index(v) (((v) & ARM_L2_ADDR_BITS) >> ARM_L2_S_SHIFT)
+#define l2pte_index(v) (((v) & ARM_L1_S_OFFSET) >> ARM_L2_S_SHIFT)
 
 
 static int

Modified: head/lib/libkvm/kvm_arm.h
==
--- head/lib/libkvm/kvm_arm.h   Thu Feb 18 09:28:16 2016(r295751)
+++ head/lib/libkvm/kvm_arm.h   Thu Feb 18 09:30:04 2016(r295752)
@@ -72,8 +72,6 @@ typedef uint32_t  arm_pt_entry_t;
 #defineARM_L2_TYPE_T   0x03/* Tiny Page  -  1k - not used 
*/
 #defineARM_L2_TYPE_MASK0x03
 
-#defineARM_L2_ADDR_BITS0x000ff000  /* L2 PTE address bits 
*/
-
 #ifdef __arm__
 #include 
 
@@ -106,7 +104,6 @@ _Static_assert(L2_TYPE_S == ARM_L2_TYPE_
 _Static_assert(L2_TYPE_T == ARM_L2_TYPE_T, "L2_TYPE_T mismatch");
 #endif
 _Static_assert(L2_TYPE_MASK == ARM_L2_TYPE_MASK, "L2_TYPE_MASK mismatch");
-_Static_assert(L2_ADDR_BITS == ARM_L2_ADDR_BITS, "L2_ADDR_BITS mismatch");
 #endif
 
 int_arm_native(kvm_t *);

Modified: head/sys/arm/include/pmap.h
==
--- head/sys/arm/include/pmap.h Thu Feb 18 09:28:16 2016(r295751)
+++ head/sys/arm/include/pmap.h Thu Feb 18 09:30:04 2016(r295752)
@@ -489,7 +489,7 @@ voidpmap_use_minicache(vm_offset_t, vm_
 #definel1pte_page_p(pde)   (((pde) & L1_TYPE_MASK) == L1_TYPE_C)
 #definel1pte_fpage_p(pde)  (((pde) & L1_TYPE_MASK) == L1_TYPE_F)
 
-#define l2pte_index(v) (((v) & L2_ADDR_BITS) >> L2_S_SHIFT)
+#define l2pte_index(v) (((v) & L1_S_OFFSET) >> L2_S_SHIFT)
 #definel2pte_valid(pte)((pte) != 0)
 #definel2pte_pa(pte)   ((pte) & L2_S_FRAME)
 #define l2pte_minidata(pte)(((pte) & \

Modified: head/sys/arm/include/pte-v6.h
==
--- head/sys/arm/include/pte-v6.h   Thu Feb 18 09:28:16 2016
(r295751)
+++ head/sys/arm/include/pte-v6.h   Thu Feb 18 09:30:04 2016
(r295752)
@@ -296,11 +296,6 @@
  */
 #defineAP_KRW  0x01/* kernel read/write */
 
-/*
- * lib/libkvm/kvm_arm.c
- */
-#defineL2_ADDR_BITS0x000ff000  /* L2 PTE address bits */
-
 // 
-
 
 #endif /* !_MACHINE_PTE_H_ */

Modified: head/sys/arm/include/pte.h
==
--- head/sys/arm/include/pte.h  Thu Feb 18 09:28:16 2016(r295751)
+++ head/sys/arm/include/pte.h  Thu Feb 18 09:30:04 2016(r295752)
@@ -148,8 +148,6 @@ typedef pt_entry_t  pt2_entry_t;/* comp
  * So, we allocate L2 tables 4 at a time, thus yielding a 4K L2
  * table.
  */
-#defineL2_ADDR_BITS0x000ff000  /* L2 PTE address bits */
-
 #defineL1_TABLE_SIZE   0x4000  /* 16K */
 #defineL2_TABLE_SIZE   0x1000  /* 4K */
 /*
___
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: r295751 - in head/sys/arm: arm include

2016-02-18 Thread Svatopluk Kraus
Author: skra
Date: Thu Feb 18 09:28:16 2016
New Revision: 295751
URL: https://svnweb.freebsd.org/changeset/base/295751

Log:
  Remove redundant L2_ADDR_MASK definition and replace it by primary one.

Modified:
  head/sys/arm/arm/pmap.c
  head/sys/arm/include/pte.h

Modified: head/sys/arm/arm/pmap.c
==
--- head/sys/arm/arm/pmap.c Thu Feb 18 09:26:58 2016(r295750)
+++ head/sys/arm/arm/pmap.c Thu Feb 18 09:28:16 2016(r295751)
@@ -2549,7 +2549,7 @@ pmap_remove_pages(pmap_t pmap)
l2b = pmap_get_l2_bucket(pmap, pv->pv_va);
KASSERT(l2b != NULL, ("No L2 bucket in pmap_remove_pages"));
pt = &l2b->l2b_kva[l2pte_index(pv->pv_va)];
-   m = PHYS_TO_VM_PAGE(*pt & L2_ADDR_MASK);
+   m = PHYS_TO_VM_PAGE(*pt & L2_S_FRAME);
KASSERT((vm_offset_t)m >= KERNBASE, ("Trying to access 
non-existent page va %x pte %x", pv->pv_va, *pt));
*pt = 0;
PTE_SYNC(pt);

Modified: head/sys/arm/include/pte.h
==
--- head/sys/arm/include/pte.h  Thu Feb 18 09:26:58 2016(r295750)
+++ head/sys/arm/include/pte.h  Thu Feb 18 09:28:16 2016(r295751)
@@ -72,9 +72,6 @@ typedef   pt_entry_t  pt2_entry_t;/* comp
 #define L2_MASK0x03/* Mask for L2 entry type */
 #define L2_INVAL   0x00/* L2 invalid type */
 
-/* L1 and L2 address masks */
-#define L2_ADDR_MASK   0xf000
-
 /*
  * The ARM MMU architecture was introduced with ARM v3 (previous ARM
  * architecture versions used an optional off-CPU memory controller
___
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: r295750 - head/sys/arm/include

2016-02-18 Thread Svatopluk Kraus
Author: skra
Date: Thu Feb 18 09:26:58 2016
New Revision: 295750
URL: https://svnweb.freebsd.org/changeset/base/295750

Log:
  Remove unneeded definitions after r291406. Also remove redundant and
  not used L1_ADDR_BITS definition.

Modified:
  head/sys/arm/include/pte-v6.h
  head/sys/arm/include/pte.h

Modified: head/sys/arm/include/pte-v6.h
==
--- head/sys/arm/include/pte-v6.h   Thu Feb 18 08:44:16 2016
(r295749)
+++ head/sys/arm/include/pte-v6.h   Thu Feb 18 09:26:58 2016
(r295750)
@@ -299,30 +299,8 @@
 /*
  * lib/libkvm/kvm_arm.c
  */
-#defineL1_ADDR_MASK0xfc00
-
-/*
- * lib/libkvm/kvm_arm.c
- */
 #defineL2_ADDR_BITS0x000ff000  /* L2 PTE address bits */
 
-#ifndef LOCORE
-/*
- * sys/arm/arm/minidump_machdep.c
- * sys/arm/arm/pmap.c
- * sys/arm/arm/pmap.h (hack for our hack in pmap.h )
- * lib/libkvm/kvm_arm.c
- */
-typedefuint32_tpd_entry_t; /* page directory entry 
*/
-
-/*
- * sys/arm/arm/minidump_machdep.c
- * sys/arm/arm/pmap.c
- * sys/arm/arm/pmap.h (hack for our hack in pmap.h )
- * sys/arm/include/param.h
- */
-typedefuint32_tpt_entry_t; /* page table entry */
-#endif
 // 
-
 
 #endif /* !_MACHINE_PTE_H_ */

Modified: head/sys/arm/include/pte.h
==
--- head/sys/arm/include/pte.h  Thu Feb 18 08:44:16 2016(r295749)
+++ head/sys/arm/include/pte.h  Thu Feb 18 09:26:58 2016(r295750)
@@ -73,7 +73,6 @@ typedef   pt_entry_t  pt2_entry_t;/* comp
 #define L2_INVAL   0x00/* L2 invalid type */
 
 /* L1 and L2 address masks */
-#define L1_ADDR_MASK   0xfc00
 #define L2_ADDR_MASK   0xf000
 
 /*
@@ -152,7 +151,6 @@ typedef pt_entry_t  pt2_entry_t;/* comp
  * So, we allocate L2 tables 4 at a time, thus yielding a 4K L2
  * table.
  */
-#defineL1_ADDR_BITS0xfff0  /* L1 PTE address bits */
 #defineL2_ADDR_BITS0x000ff000  /* L2 PTE address bits */
 
 #defineL1_TABLE_SIZE   0x4000  /* 16K */
___
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: r295749 - head/bin/dd

2016-02-18 Thread Thomas Quinot
Author: thomas
Date: Thu Feb 18 08:44:16 2016
New Revision: 295749
URL: https://svnweb.freebsd.org/changeset/base/295749

Log:
  Reorganize the handling all-zeroes terminal block in sparse mode
  
  The intent of the previous code in that case was to force
  an explicit write, but the implementation was incorrect, and
  as a result the write was never performed. This new implementation
  instead uses ftruncate(2) to extend the file with a trailing hole.
  
  Also introduce regression tests for these cases.
  
  PR: 189284
  (original PR whose fix introduced this bug)
  
  PR: 207092
  
  Differential Revision:D5248
  Reviewed by:  sobomax,kib
  MFC after:2 weeks

Added:
  head/bin/dd/ref.obs_zeroes   (contents, props changed)
Modified:
  head/bin/dd/Makefile
  head/bin/dd/dd.c
  head/bin/dd/dd.h
  head/bin/dd/gen.c

Modified: head/bin/dd/Makefile
==
--- head/bin/dd/MakefileThu Feb 18 07:44:14 2016(r295748)
+++ head/bin/dd/MakefileThu Feb 18 08:44:16 2016(r295749)
@@ -24,7 +24,18 @@ test: ${PROG} gen
LC_ALL=en_US.US-ASCII hexdump -C | \
diff -I FreeBSD - ${.CURDIR}/ref.${conv}
 .endfor
-   @rm -f gen
+   @${ECHO} "testing sparse file (obs zeroes)"
+   @./gen 189284 | ./dd ibs=16 obs=8 conv=sparse of=obs_zeroes 2> /dev/null
+   @hexdump -C obs_zeroes | diff -I FreeBSD - ${.CURDIR}/ref.obs_zeroes
+
+   @${ECHO} "testing spase file (all zeroes)"
+   @./dd if=/dev/zero of=1M_zeroes bs=1048576 count=1 2> /dev/null
+   @./dd if=1M_zeroes of=1M_zeroes.1 bs=1048576 conv=sparse 2> /dev/null
+   @./dd if=1M_zeroes of=1M_zeroes.2 bs=1048576 2> /dev/null
+   @diff 1M_zeroes 1M_zeroes.1
+   @diff 1M_zeroes 1M_zeroes.2
+
+   @rm -f gen 1M_zeroes* obs_zeroes
 
 .if ${MK_TESTS} != "no"
 SUBDIR+=   tests

Modified: head/bin/dd/dd.c
==
--- head/bin/dd/dd.cThu Feb 18 07:44:14 2016(r295748)
+++ head/bin/dd/dd.cThu Feb 18 08:44:16 2016(r295749)
@@ -77,7 +77,6 @@ STAT  st; /* statistics */
 void   (*cfunc)(void); /* conversion function */
 uintmax_t cpy_cnt; /* # of blocks to copy */
 static off_t   pending = 0;/* pending seek if sparse */
-static off_t   last_sp = 0;/* size of last added sparse block */
 u_int  ddflags = 0;/* conversion options */
 size_t cbsz;   /* conversion block size */
 uintmax_t files_cnt = 1;   /* # of files to copy */
@@ -409,6 +408,15 @@ dd_close(void)
}
if (out.dbcnt || pending)
dd_out(1);
+
+   /*
+* If the file ends with a hole, ftruncate it to extend its size
+* up to the end of the hole (without having to write any data).
+*/
+   if (out.seek_offset > 0 && (out.flags & ISTRUNC)) {
+   if (ftruncate(out.fd, out.seek_offset) == -1)
+   err(1, "truncating %s", out.name);
+   }
 }
 
 void
@@ -457,29 +465,27 @@ dd_out(int force)
}
if (sparse && !force) {
pending += cnt;
-   last_sp = cnt;
nw = cnt;
} else {
if (pending != 0) {
-   /* If forced to write, and we have no
-* data left, we need to write the last
-* sparse block explicitly.
+   /*
+* Seek past hole.  Note that we need 
to record the
+* reached offset, because we might 
have no more data
+* to write, in which case we'll need 
to call
+* ftruncate to extend the file size.
 */
-   if (force && cnt == 0) {
-   pending -= last_sp;
-   assert(outp == out.db);
-   memset(outp, 0, cnt);
-   }
-   if (lseek(out.fd, pending, SEEK_CUR) ==
-   -1)
+   out.seek_offset = lseek(out.fd, 
pending, SEEK_CUR);
+   if (out.seek_offset == -1)
err(2, "%s: seek error creating 
sparse file",
out.name);
-   pending = last_sp = 0;
+   pending = 0;