svn commit: r295834 - in head/sys: arm/arm conf

2016-02-19 Thread Svatopluk Kraus
Author: skra
Date: Sat Feb 20 07:45:21 2016
New Revision: 295834
URL: https://svnweb.freebsd.org/changeset/base/295834

Log:
  Rename busdma_machdep.c to busdma_machdep-v4.c, pmap.c to pmap-v4.c
  and trap.c to trap-v4.c to be plain and consistent with other armv4
  specific files.

Added:
  head/sys/arm/arm/busdma_machdep-v4.c
 - copied unchanged from r295833, head/sys/arm/arm/busdma_machdep.c
  head/sys/arm/arm/pmap-v4.c
 - copied unchanged from r295833, head/sys/arm/arm/pmap.c
  head/sys/arm/arm/trap-v4.c
 - copied unchanged from r295833, head/sys/arm/arm/trap.c
Deleted:
  head/sys/arm/arm/busdma_machdep.c
  head/sys/arm/arm/pmap.c
  head/sys/arm/arm/trap.c
Modified:
  head/sys/conf/files.arm

Copied: head/sys/arm/arm/busdma_machdep-v4.c (from r295833, 
head/sys/arm/arm/busdma_machdep.c)
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/sys/arm/arm/busdma_machdep-v4.cSat Feb 20 07:45:21 2016
(r295834, copy of r295833, head/sys/arm/arm/busdma_machdep.c)
@@ -0,0 +1,1609 @@
+/*-
+ * Copyright (c) 2012 Ian Lepore
+ * Copyright (c) 2004 Olivier Houchard
+ * Copyright (c) 2002 Peter Grehan
+ * Copyright (c) 1997, 1998 Justin T. Gibbs.
+ * 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,
+ *without modification, immediately at the beginning of the file.
+ * 2. The name of the author may not be used to endorse or promote products
+ *derived from this software without specific prior written permission.
+ *
+ * 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.
+ *
+ *   From i386/busdma_machdep.c,v 1.26 2002/04/19 22:58:09 alfred
+ */
+
+#include 
+__FBSDID("$FreeBSD$");
+
+/*
+ * ARM bus dma support routines.
+ *
+ * XXX Things to investigate / fix some day...
+ *  - What is the earliest that this API can be called?  Could there be any
+ *fallout from changing the SYSINIT() order from SI_SUB_VM to SI_SUB_KMEM?
+ *  - The manpage mentions the BUS_DMA_NOWAIT flag only in the context of the
+ *bus_dmamap_load() function.  This code has historically (and still does)
+ *honor it in bus_dmamem_alloc().  If we got rid of that we could lose some
+ *error checking because some resource management calls would become WAITOK
+ *and thus "cannot fail."
+ *  - The decisions made by _bus_dma_can_bounce() should be made once, at tag
+ *creation time, and the result stored in the tag.
+ *  - It should be possible to take some shortcuts when mapping a buffer we 
know
+ *came from the uma(9) allocators based on what we know about such buffers
+ *(aligned, contiguous, etc).
+ *  - The allocation of bounce pages could probably be cleaned up, then we 
could
+ *retire arm_remap_nocache().
+ */
+
+#define _ARM32_BUS_DMA_PRIVATE
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+#include 
+#include 
+#include 
+
+#defineMAX_BPAGES  64
+#defineMAX_DMA_SEGMENTS4096
+#defineBUS_DMA_COULD_BOUNCEBUS_DMA_BUS3
+#defineBUS_DMA_MIN_ALLOC_COMP  BUS_DMA_BUS4
+
+struct bounce_zone;
+
+struct bus_dma_tag {
+   bus_dma_tag_t   parent;
+   bus_size_t  alignment;
+   bus_addr_t  boundary;
+   bus_addr_t  lowaddr;
+   bus_addr_t  highaddr;
+   bus_dma_filter_t*filter;
+   void*filterarg;
+   bus_size_t  maxsize;
+   u_int   nsegments;
+   bus_size_t  maxsegsz;
+   int flags;
+   int ref_count;
+   int map_count;
+   bus_dma_lock_t  *lockfunc;
+   void*lockfuncarg;
+   struct bounce_zone  

Re: svn commit: r295833 - head/sys/sys

2016-02-19 Thread Justin Hibbits
On 2/19/16, Bruce Evans  wrote:
> On Sat, 20 Feb 2016, Justin Hibbits wrote:
>
>> Log:
>>  Fix the definition of RM_MAX_END.
>>
>>  Even though casting from signed to unsigned is well-defined in C, it's
>> better to
>>  first cast to the larger unsigned type, then negate.
>
> Casting ~0 is well-defined, but ~0 isn't.
>
> The operation is complementation, not negation.

Yes, brain fart. I stand corrected of course.

- Justin
___
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: r295756 - in head/sys: conf dev/ofw powerpc/mpc85xx powerpc/powermac powerpc/pseries

2016-02-19 Thread Justin Hibbits
This was not tinderboxed.  I'm getting build failures for powerpc and
sparc64.  Please revert or fix.

Least of which: sys/dev/ofw/ofw_pci.c conflicts with
sys/powerpc/ofw/ofw_pci.c, which I mentioned in phabricator long ago.

Additionally, several files are missing includes of dev/ofw/ofw_bus_subr.h.

One example from tinderbox:

make[5]: 
"/scratch/tmp/jhibbits/obj/powerpc.powerpc/home/jhibbits/head/sys/GENERIC/Makefile"
line 7308: warning: duplicate script for target "ofw_pci.ln" ignored
make[5]: 
"/scratch/tmp/jhibbits/obj/powerpc.powerpc/home/jhibbits/head/sys/GENERIC/Makefile"
line 2150: warning: using previous script for "ofw_pci.ln" defined
here
make[5]: 
"/scratch/tmp/jhibbits/obj/powerpc.powerpc/home/jhibbits/head/sys/GENERIC/Makefile"
line 7311: warning: duplicate script for target "ofw_pci.o" ignored
make[5]: 
"/scratch/tmp/jhibbits/obj/powerpc.powerpc/home/jhibbits/head/sys/GENERIC/Makefile"
line 2154: warning: using previous script for "ofw_pci.o" defined here
make[5]: 
"/scratch/tmp/jhibbits/obj/powerpc.powerpc/home/jhibbits/head/sys/GENERIC/Makefile"
line 7312: warning: duplicate script for target "ofw_pci.o" ignored
make[5]: 
"/scratch/tmp/jhibbits/obj/powerpc.powerpc/home/jhibbits/head/sys/GENERIC/Makefile"
line 2154: warning: using previous script for "ofw_pci.o" defined here
In file included from /home/jhibbits/head/sys/powerpc/powermac/uninorth.c:36:
/home/jhibbits/head/sys/dev/ofw/ofw_pci.h:144: error: field
'sc_pci_iinfo' has incomplete type


- Justin

On 2/18/16, Zbigniew Bodek  wrote:
> 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.c  optional fdt
>  dev/ofw/ofwbus.c optional fdt
>  dev/ofw/openfirm.c   optional fdt
>  dev/ofw/openfirmio.c optional fdt
> +dev/ofw/ofw_pci.coptional fdt pci
>  dev/ow/ow.c  optional 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.cThu 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, 

Re: svn commit: r295833 - head/sys/sys

2016-02-19 Thread Bruce Evans

On Sat, 20 Feb 2016, Justin Hibbits wrote:


Log:
 Fix the definition of RM_MAX_END.

 Even though casting from signed to unsigned is well-defined in C, it's better 
to
 first cast to the larger unsigned type, then negate.


Casting ~0 is well-defined, but ~0 isn't.

The operation is complementation, not negation.


Modified: head/sys/sys/rman.h
==
--- head/sys/sys/rman.h Sat Feb 20 01:32:58 2016(r295832)
+++ head/sys/sys/rman.h Sat Feb 20 01:34:13 2016(r295833)
@@ -61,7 +61,7 @@ enum  rman_type { RMAN_UNINIT = 0, RMAN_G
 */
#define RM_TEXTLEN  32

-#defineRM_MAX_END  ((rman_res_t)~0)
+#defineRM_MAX_END  (~(rman_res_t)0)


If the operation were negation, then its result -0 would actually be well-
defined.  It would be 0 again, even in the 1's complement and signed
magnitude cases where -0 can be represented.  -0 cast to unsigned must
give 0 again, and not be all-bits-1 even if it started as all-bits 1
representing -0 in 2's complement.

~0 was under-specified in C90 as being the bitwise complement.  The value
of that is not specified unless the promotion of the orginal type is
unsigned (~(unsigned char)0 is also not specified except on exotic
machines (no longer permitted by POSIX) with unsigned char the same size
as unsigned int).

~0 is even more under-specified in C99 because C99 is more careful
with representations and has trap representations.  (This is not fixed
in C11.) Complementing a non- trap-representation might give a trap
representation if done bitwise, even starting from a nondescript value
like 0.  But if there are no trap or padding bits, the only reasonable
interpretation of the spec is that ~0 gives all-bits-1 with whatever
value that has.  In the 2's complement case, the value is -1 and casting
this to unsigned works right.  In the 1's complement case, the value
is -0 and casting this to unsigned gives unsigned plain 0.  In the
signed-magnitude case, I think it gives -0x7fff with 32-bit ints
and casting this to unsigned gives 0x8001.  C90 allows other
representations, so the result can be anything.

The clearest way to write the expression is probably ((rman_res_t)-1)
like the buggy ~0 version did in the 2's complement case.

Everyone knows what -1 is.  Conversion of -1 to unsigned is better
known than what ~0 is.  It takes an explicit specification for both.

Conversion of -1 involves "[in extra precision] repeatedly adding or
subtracting one more than the maximim value that can be represented
in the new type until [the result is representable]".  Thus
((rman_res_t)-1) is maxof(rman_res_t) + 1 - 1 == maxof(rman_res_t).

(~(rman_res_t)0) involves the specification of the '~' operator
saying that complementing the bits actually works for the unsigned
case.  The precise wording is "If the promoted type [of E] is an
unsigned type, then the expression ~E is equivalent to the maximum
value representable in that type minus E".  Thus (~(rman_res_t)0)
is maxof(rman_res_t) - 0 = maxof(rman_res_t).  I think the precise
wording is redundant, but this is not clear.  Something is needed
to ensure that complementing bits doesn't give a trap representation
for the unsigned case.  Complementing only value bits wouldn't give
a trap representation, but complementing padding bits could (should)
give a trap representation.  The spec is too fuzzy to say which bits
are complemented, except in the unsigned case padding bits must not
be complemented if this would give a trap representation.

Bruce
___
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: r295800 - head/usr.bin/cap_mkdb

2016-02-19 Thread Eric van Gyzen

On 2/19/16 6:40 PM, Bryan Drewery wrote:

On 2/19/2016 12:42 AM, Stefan Esser wrote:

Author: se
Date: Fri Feb 19 08:42:13 2016
New Revision: 295800
URL: https://svnweb.freebsd.org/changeset/base/295800

Log:
   Remove O_SYNC from the options passed to dbmopen().

Uh, this is a full revert of r293312's changes to cap_mkdb which were
made for good reason. So this seems simply wrong without a better fix.

   
   The output file is created as a temporary file that is moved over the

   existing file after completion. Thus there is no need to immediately
   flush all created db records to the temporary file.

This is not right either. Depending on the use of soft updates /
journaling the data and metadata (file name / rename) may be written at
different times. It is entirely possible to get a renamed file with no
or junk content without an fsync. That's exactly what r293312 mentions
in its commit message.


dwmalone@ plans to put the fsync() in the db close method, which makes a lot of 
sense, and would fix this in a better way.


https://reviews.freebsd.org/D5186

This commit probably should have waited for D5186 to be committed, but at least 
that seems imminent.


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


Re: svn commit: r295768 - head/usr.sbin/iostat

2016-02-19 Thread Bruce Evans

On Sat, 20 Feb 2016, Dimitry Andric wrote:


On 19 Feb 2016, at 16:49, Alan Somers  wrote:


On Fri, Feb 19, 2016 at 5:24 AM, Sergey Kandaurov  wrote:

...

-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 },
[...]


You unlikely need this excessive explicit zeroization.
In this case it is implicitly prezeroed.

...

Yeah, it was being implicitly zeroized before.  But Clang complained
about the structures being only partially initialized.  Since the
whole point of my commit was to increase the WARNS level, I explicitly
zeroed the zero fields to silence Clang.


You got this warning, most likely:

usr.sbin/iostat/iostat.c:122:15: error: missing field 'n_type' initializer 
[-Werror,-Wmissing-field-initializers]
   { "_tty_nin" },
^

This warning is only produced when you use -Wall -W, and then initialize
structs partially, i.e. you initialize some fields but not others.  I
think this is a quite reasonable warning for a high warning level.


No, this more than defeats the reason for existence of C99 initializers.
With C90 initializors, you sometimes had to write initializers for all
the fields between the 2 that you care about, and get the order and number
of al the fields right.  At least you didn't have to write initializers
for the trailing fields.  With compiler warnings about missing initializers,
you also have to write initializers for trailing fields.  I forget if
C99 initializers allows mixing named fields with unnamed fields, but style
rules shouldn't allow it.


On the other hand, if this kind of construct is used throughout the
tree, and it is not seen as a big problem, we can simply silence this
particular warning using -Wno-missing-field -initializers.  There is
already quite a list of warnings which are suppressed by default, even
at WARNS=6, namely:

-Wno-empty-body
-Wno-format-y2k
-Wno-pointer-sign
-Wno-string-plus-int
-Wno-unused-const-variable
-Wno-unused-parameter


We started using it for lists of functions for vfs, where some of the
entries should be optional but all had to be supplied, in the correct
order, for C90 initializers.  These lists were reduced from excessively
dynamic lists, and they ended up with not many optional entries, so
they don't use the feature of omitting optional entries much.

Bruce

Bruce
___
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: r295768 - head/usr.sbin/iostat

2016-02-19 Thread Bruce Evans

On Fri, 19 Feb 2016, Benjamin Kaduk wrote:


On Fri, Feb 19, 2016 at 5:06 PM, Gleb Smirnoff  wrote:


On Fri, Feb 19, 2016 at 08:49:43AM -0700, Alan Somers wrote:
A> On Fri, Feb 19, 2016 at 5:24 AM, Sergey Kandaurov 
wrote:
A> Yeah, it was being implicitly zeroized before.  But Clang complained
A> about the structures being only partially initialized.  Since the
A> whole point of my commit was to increase the WARNS level, I explicitly
A> zeroed the zero fields to silence Clang.

Isn't zero filling part of the standard? I don't see why lack of
explicit zeroing is a warning? Looks a false warning to me.


It is not quite as simple as this would make it sound.  The elements or
members of an aggregate (e.g.) structure type are initialized as if it were
an object of static storage duration (i.e., to zero) if the initializer
list does not contain enough initializers for all members of the aggregate
type, per item 21 of section 6.7.8 of n1256.pdf.  However, such
initialization does not necessarily need to zero any padding bytes that are
present, which may take unspecified values.


Perhaps, but then there is even less reason to expect that initializing
all the struct members initialzes the padding between them.


Personally, I think this
particular clang warning can be too aggressive, especially for complex
structs, but on the other hand given the indeterminateness of padding,
bzero/memset are often a better choice anyway.


It is just a bug in clang.

Using auto structs with initialzers, auto structs initialized by memset/
bzero followed by initializing a few fields, are almost equally good
pessimizations.  Some compilers generate similar code for them (like the
code shown by pluknet -- the initializer is optimized to an inlined
memset followed by initializing 1 field.  But doing this this on every
function call is a good pessimization if the struct never changes or
rarely changes or only changes slightly.  Some compilers generate the
worse code of keeping a static copy and generating an inline memcpy to
the auto variable on every function call.

6.7.8p9 says that unnamed members have indeterminate values even after
initialization, except where explicitly stated otherwise.

I couldn't find anywhere "explicitly stating otherwise" that padding
is initialized.  It takes an explicit statements in p21 to get the
unnamed members in an initializer initialized, but padding isn't even.
p21 says that any unnamed struct member is initialized as if it had
static storage duration with no initializer, but I couldn't find
anything requiring initialization for padding in that case.  Apparently,
only quality of implementation prevents it being initialized with
passwords from the previous program :-(.

Bruce
___
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: r295768 - head/usr.sbin/iostat

2016-02-19 Thread Conrad Meyer
On Fri, Feb 19, 2016 at 3:14 PM, Benjamin Kaduk  wrote:
> On Fri, Feb 19, 2016 at 5:06 PM, Gleb Smirnoff  wrote:
>> Isn't zero filling part of the standard? I don't see why lack of
>> explicit zeroing is a warning? Looks a false warning to me.
>
>
> It is not quite as simple as this would make it sound.  The elements or
> members of an aggregate (e.g.) structure type are initialized as if it were
> an object of static storage duration (i.e., to zero) if the initializer list
> does not contain enough initializers for all members of the aggregate type,
> per item 21 of section 6.7.8 of n1256.pdf.  However, such initialization
> does not necessarily need to zero any padding bytes that are present, which
> may take unspecified values.  Personally, I think this particular clang
> warning can be too aggressive, especially for complex structs, but on the
> other hand given the indeterminateness of padding, bzero/memset are often a
> better choice anyway.


By definition, padding byte contents are unused.  There is no reason
their values matter one way or another, so why do we care about the
distinction between bzero and member zero initialization?

Best,
Conrad
___
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: r295833 - head/sys/sys

2016-02-19 Thread Justin Hibbits
Author: jhibbits
Date: Sat Feb 20 01:34:13 2016
New Revision: 295833
URL: https://svnweb.freebsd.org/changeset/base/295833

Log:
  Fix the definition of RM_MAX_END.
  
  Even though casting from signed to unsigned is well-defined in C, it's better 
to
  first cast to the larger unsigned type, then negate.

Modified:
  head/sys/sys/rman.h

Modified: head/sys/sys/rman.h
==
--- head/sys/sys/rman.h Sat Feb 20 01:32:58 2016(r295832)
+++ head/sys/sys/rman.h Sat Feb 20 01:34:13 2016(r295833)
@@ -61,7 +61,7 @@ enum  rman_type { RMAN_UNINIT = 0, RMAN_G
  */
 #define RM_TEXTLEN 32
 
-#defineRM_MAX_END  ((rman_res_t)~0)
+#defineRM_MAX_END  (~(rman_res_t)0)
 
 #defineRMAN_IS_DEFAULT_RANGE(s,e)  ((s) == 0 && (e) == RM_MAX_END)
 
___
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: r295832 - in head/sys: arm/at91 arm/cavium/cns11xx arm/mv arm64/arm64 arm64/cavium dev/acpica dev/eisa dev/fdt dev/gpio dev/mca dev/ofw dev/pccard dev/siba dev/vnic kern mips/adm5120 mi...

2016-02-19 Thread Justin Hibbits
Author: jhibbits
Date: Sat Feb 20 01:32:58 2016
New Revision: 295832
URL: https://svnweb.freebsd.org/changeset/base/295832

Log:
  Introduce a RMAN_IS_DEFAULT_RANGE() macro, and use it.
  
  This simplifies checking for default resource range for bus_alloc_resource(),
  and improves readability.
  
  This is part of, and related to, the migration of rman_res_t from u_long to
  uintmax_t.
  
  Discussed with:   jhb
  Suggested by: marcel

Modified:
  head/sys/arm/at91/at91.c
  head/sys/arm/at91/at91_pinctrl.c
  head/sys/arm/cavium/cns11xx/econa.c
  head/sys/arm/mv/mv_localbus.c
  head/sys/arm/mv/mv_pci.c
  head/sys/arm64/arm64/gic_fdt.c
  head/sys/arm64/arm64/gic_v3_fdt.c
  head/sys/arm64/arm64/nexus.c
  head/sys/arm64/cavium/thunder_pcie.c
  head/sys/arm64/cavium/thunder_pcie_fdt.c
  head/sys/arm64/cavium/thunder_pcie_pem.c
  head/sys/dev/acpica/acpi.c
  head/sys/dev/eisa/eisaconf.c
  head/sys/dev/fdt/simplebus.c
  head/sys/dev/gpio/gpiobus.c
  head/sys/dev/mca/mca_bus.c
  head/sys/dev/ofw/ofwbus.c
  head/sys/dev/pccard/pccard.c
  head/sys/dev/siba/siba.c
  head/sys/dev/vnic/mrml_bridge.c
  head/sys/kern/subr_bus.c
  head/sys/mips/adm5120/obio.c
  head/sys/mips/alchemy/obio.c
  head/sys/mips/atheros/apb.c
  head/sys/mips/beri/beri_simplebus.c
  head/sys/mips/idt/obio.c
  head/sys/mips/mips/nexus.c
  head/sys/mips/nlm/xlp_simplebus.c
  head/sys/mips/rt305x/obio.c
  head/sys/mips/sibyte/sb_zbbus.c
  head/sys/powerpc/mpc85xx/isa.c
  head/sys/riscv/riscv/nexus.c
  head/sys/sparc64/central/central.c
  head/sys/sparc64/ebus/ebus.c
  head/sys/sparc64/fhc/fhc.c
  head/sys/sparc64/isa/isa.c
  head/sys/sparc64/pci/apb.c
  head/sys/sparc64/sbus/sbus.c
  head/sys/sparc64/sparc64/nexus.c
  head/sys/sparc64/sparc64/upa.c
  head/sys/sys/rman.h
  head/sys/x86/isa/isa.c
  head/sys/x86/x86/nexus.c

Modified: head/sys/arm/at91/at91.c
==
--- head/sys/arm/at91/at91.cFri Feb 19 22:48:20 2016(r295831)
+++ head/sys/arm/at91/at91.cSat Feb 20 01:32:58 2016(r295832)
@@ -164,7 +164,7 @@ at91_alloc_resource(device_t dev, device
return (NULL);
if (rle->res)
panic("Resource rid %d type %d already in use", *rid, type);
-   if (start == 0UL && end == ~0UL) {
+   if (RMAN_IS_DEFAULT_RANGE(start, end)) {
start = rle->start;
count = ulmax(count, rle->count);
end = ulmax(rle->end, start + count - 1);

Modified: head/sys/arm/at91/at91_pinctrl.c
==
--- head/sys/arm/at91/at91_pinctrl.cFri Feb 19 22:48:20 2016
(r295831)
+++ head/sys/arm/at91/at91_pinctrl.cSat Feb 20 01:32:58 2016
(r295832)
@@ -280,7 +280,7 @@ pinctrl_alloc_resource(device_t bus, dev
 * Request for the default allocation with a given rid: use resource
 * list stored in the local device info.
 */
-   if ((start == 0UL) && (end == ~0UL)) {
+   if (RMAN_IS_DEFAULT_RANGE(start, end)) {
if ((di = device_get_ivars(child)) == NULL)
return (NULL);
 

Modified: head/sys/arm/cavium/cns11xx/econa.c
==
--- head/sys/arm/cavium/cns11xx/econa.c Fri Feb 19 22:48:20 2016
(r295831)
+++ head/sys/arm/cavium/cns11xx/econa.c Sat Feb 20 01:32:58 2016
(r295832)
@@ -425,7 +425,7 @@ econa_alloc_resource(device_t dev, devic
}
if (rle->res)
panic("Resource rid %d type %d already in use", *rid, type);
-   if (start == 0UL && end == ~0UL) {
+   if (RMAN_IS_DEFAULT_RANGE(start, end)) {
start = rle->start;
count = ulmax(count, rle->count);
end = ulmax(rle->end, start + count - 1);

Modified: head/sys/arm/mv/mv_localbus.c
==
--- head/sys/arm/mv/mv_localbus.c   Fri Feb 19 22:48:20 2016
(r295831)
+++ head/sys/arm/mv/mv_localbus.c   Sat Feb 20 01:32:58 2016
(r295832)
@@ -341,7 +341,7 @@ localbus_alloc_resource(device_t bus, de
 * Request for the default allocation with a given rid: use resource
 * list stored in the local device info.
 */
-   if ((start == 0UL) && (end == ~0UL)) {
+   if (RMAN_IS_DEFAULT_RANGE(start, end)) {
if ((di = device_get_ivars(child)) == NULL)
return (NULL);
 

Modified: head/sys/arm/mv/mv_pci.c
==
--- head/sys/arm/mv/mv_pci.cFri Feb 19 22:48:20 2016(r295831)
+++ head/sys/arm/mv/mv_pci.cSat Feb 20 01:32:58 2016(r295832)
@@ -844,7 +844,7 @@ mv_pcib_alloc_resource(device_t dev, dev
type, rid, start, end, count, flags));
};
 
-   if ((start == 0UL) && 

Re: svn commit: r295768 - head/usr.sbin/iostat

2016-02-19 Thread Conrad Meyer
On Fri, Feb 19, 2016 at 3:06 PM, Gleb Smirnoff  wrote:
> Isn't zero filling part of the standard? I don't see why lack of
> explicit zeroing is a warning? Looks a false warning to me.

Yep.  This is Clang being too whiney, IMO.  I think a good workaround
is to add -Wno-missing-field-initializers to warn flags (but otherwise
keep high WARNS).

Best,
Conrad
___
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: r295800 - head/usr.bin/cap_mkdb

2016-02-19 Thread Bryan Drewery
On 2/19/2016 12:42 AM, Stefan Esser wrote:
> Author: se
> Date: Fri Feb 19 08:42:13 2016
> New Revision: 295800
> URL: https://svnweb.freebsd.org/changeset/base/295800
> 
> Log:
>   Remove O_SYNC from the options passed to dbmopen().

Uh, this is a full revert of r293312's changes to cap_mkdb which were
made for good reason. So this seems simply wrong without a better fix.

>   
>   The output file is created as a temporary file that is moved over the
>   existing file after completion. Thus there is no need to immediately
>   flush all created db records to the temporary file.

This is not right either. Depending on the use of soft updates /
journaling the data and metadata (file name / rename) may be written at
different times. It is entirely possible to get a renamed file with no
or junk content without an fsync. That's exactly what r293312 mentions
in its commit message.

>   
>   This speeds up creation of the termcap db by a factor of 40 on my
>   ZFS based /etc filesytem (from 25 seconds to 0.6 seconds).
>   
>   I have compared multiple output files created with and without O_SYNC
>   and they came out identical each time.  Nonetheless it might be best
>   to MFC this change and the similar one for services_mkdb (r295465) at
>   the same time when the changes to hash.c in review D5186 are merged.
>   
>   MFC: 1 week
> 
> Modified:
>   head/usr.bin/cap_mkdb/cap_mkdb.c
> 
> Modified: head/usr.bin/cap_mkdb/cap_mkdb.c
> ==
> --- head/usr.bin/cap_mkdb/cap_mkdb.c  Fri Feb 19 08:41:47 2016
> (r295799)
> +++ head/usr.bin/cap_mkdb/cap_mkdb.c  Fri Feb 19 08:42:13 2016
> (r295800)
> @@ -119,7 +119,7 @@ main(int argc, char *argv[])
>   (void)snprintf(buf, sizeof(buf), "%s.db", capname ? capname : *argv);
>   if ((capname = strdup(buf)) == NULL)
>   errx(1, "strdup failed");
> - if ((capdbp = dbopen(capname, O_CREAT | O_TRUNC | O_RDWR | O_SYNC,
> + if ((capdbp = dbopen(capname, O_CREAT | O_TRUNC | O_RDWR,
>   DEFFILEMODE, DB_HASH, )) == NULL)
>   err(1, "%s", buf);
>  
> 


-- 
Regards,
Bryan Drewery



signature.asc
Description: OpenPGP digital signature


Re: svn commit: r295800 - head/usr.bin/cap_mkdb

2016-02-19 Thread Dmitry Marakasov
* Stefan Esser (s...@freebsd.org) wrote:

> Log:
>   Remove O_SYNC from the options passed to dbmopen().
>   
>   The output file is created as a temporary file that is moved over the
>   existing file after completion. Thus there is no need to immediately
>   flush all created db records to the temporary file.

How is it guaranteed that the temporary file is completely written to
disk before it's moved over the old database? I've run cap_mkdb under
ktrace and I don't see fsync call there.

-- 
Dmitry Marakasov   .   55B5 0596 FF1E 8D84 5F56  9510 D35A 80DD F9D2 F77D
amd...@amdmi3.ru  ..:  jabber: amd...@jabber.ru  http://amdmi3.ru
___
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: r295768 - head/usr.sbin/iostat

2016-02-19 Thread Gleb Smirnoff
On Sat, Feb 20, 2016 at 12:23:40AM +0100, Dimitry Andric wrote:
D> You got this warning, most likely:
D> 
D> usr.sbin/iostat/iostat.c:122:15: error: missing field 'n_type' initializer 
[-Werror,-Wmissing-field-initializers]
D> { "_tty_nin" },
D>  ^
D> 
D> This warning is only produced when you use -Wall -W, and then initialize
D> structs partially, i.e. you initialize some fields but not others.  I
D> think this is a quite reasonable warning for a high warning level.
D> 
D> On the other hand, if this kind of construct is used throughout the
D> tree, and it is not seen as a big problem, we can simply silence this
D> particular warning using -Wno-missing-field -initializers.  There is
D> already quite a list of warnings which are suppressed by default, even
D> at WARNS=6, namely:
D> 
D> -Wno-empty-body
D> -Wno-format-y2k
D> -Wno-pointer-sign
D> -Wno-string-plus-int
D> -Wno-unused-const-variable
D> -Wno-unused-parameter

I think we should add -Wno-missing-field-initializers there. We use this
feature in the kernel intentionally, since it allows to write code that
is less dependant on API changes.

-- 
Totus tuus, Glebius.
___
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: r295828 - head/sys/dev/ixl

2016-02-19 Thread Gleb Smirnoff
  Eric,

  do you mean that this specific PCI ID goes to a certain device manufacturer
who is known to install only specific software on their devices?

Even in that case I don't see any improvement in removing the PCI IDs from
the driver. People could use these devices aftermarket, and install what
ever they want. Even if that is very very low probability, still having
working PCI IDs in the driver doesn't hurt anyone.

IMHO, once Intel drops official maintainership for some hw/sw, the code
shouldn't be deleted from FreeBSD, since community may willing to take
maintainership.

As was discussed, we need official support matrix of Intel published,
and anything that doesn't fit into the matrix is community supported.

On Fri, Feb 19, 2016 at 11:12:08PM +, Eric Joyner wrote:
E> The driver worked for the most part on the 20G hardware, but it's specific
E> hardware for an OEM that doesn't use FreeBSD.
E> 
E> The KX_A device ID never made it into any hardware.
E> 
E> On Fri, Feb 19, 2016 at 3:08 PM Gleb Smirnoff  wrote:
E> 
E> > On Fri, Feb 19, 2016 at 10:33:51PM +, Eric Joyner wrote:
E> > E> Author: erj
E> > E> Date: Fri Feb 19 22:33:50 2016
E> > E> New Revision: 295828
E> > E> URL: https://svnweb.freebsd.org/changeset/base/295828
E> > E>
E> > E> Log:
E> > E>   ixl(4): Remove unsupported device IDs.
E> > E>
E> > E>   There is no official support for 20G SKUs on FreeBSD, and the KX_A
E> > E>   device ID was never used.
E> >
E> > Did the driver attach but failed to work before?
E> >
E> > --
E> > Totus tuus, Glebius.
E> >

-- 
Totus tuus, Glebius.
___
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: r295768 - head/usr.sbin/iostat

2016-02-19 Thread Dimitry Andric
On 19 Feb 2016, at 16:49, Alan Somers  wrote:
> 
> On Fri, Feb 19, 2016 at 5:24 AM, Sergey Kandaurov  wrote:
...
>>> -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 },
>>> [...]
>> 
>> You unlikely need this excessive explicit zeroization.
>> In this case it is implicitly prezeroed.
...
> Yeah, it was being implicitly zeroized before.  But Clang complained
> about the structures being only partially initialized.  Since the
> whole point of my commit was to increase the WARNS level, I explicitly
> zeroed the zero fields to silence Clang.

You got this warning, most likely:

usr.sbin/iostat/iostat.c:122:15: error: missing field 'n_type' initializer 
[-Werror,-Wmissing-field-initializers]
{ "_tty_nin" },
 ^

This warning is only produced when you use -Wall -W, and then initialize
structs partially, i.e. you initialize some fields but not others.  I
think this is a quite reasonable warning for a high warning level.

On the other hand, if this kind of construct is used throughout the
tree, and it is not seen as a big problem, we can simply silence this
particular warning using -Wno-missing-field -initializers.  There is
already quite a list of warnings which are suppressed by default, even
at WARNS=6, namely:

-Wno-empty-body
-Wno-format-y2k
-Wno-pointer-sign
-Wno-string-plus-int
-Wno-unused-const-variable
-Wno-unused-parameter

-Dimitry



signature.asc
Description: Message signed with OpenPGP using GPGMail


Re: svn commit: r295828 - head/sys/dev/ixl

2016-02-19 Thread Eric Joyner
The driver worked for the most part on the 20G hardware, but it's specific
hardware for an OEM that doesn't use FreeBSD.

The KX_A device ID never made it into any hardware.

On Fri, Feb 19, 2016 at 3:08 PM Gleb Smirnoff  wrote:

> On Fri, Feb 19, 2016 at 10:33:51PM +, Eric Joyner wrote:
> E> Author: erj
> E> Date: Fri Feb 19 22:33:50 2016
> E> New Revision: 295828
> E> URL: https://svnweb.freebsd.org/changeset/base/295828
> E>
> E> Log:
> E>   ixl(4): Remove unsupported device IDs.
> E>
> E>   There is no official support for 20G SKUs on FreeBSD, and the KX_A
> E>   device ID was never used.
>
> Did the driver attach but failed to work before?
>
> --
> Totus tuus, Glebius.
>
___
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: r295768 - head/usr.sbin/iostat

2016-02-19 Thread Benjamin Kaduk
On Fri, Feb 19, 2016 at 5:06 PM, Gleb Smirnoff  wrote:

> On Fri, Feb 19, 2016 at 08:49:43AM -0700, Alan Somers wrote:
> A> On Fri, Feb 19, 2016 at 5:24 AM, Sergey Kandaurov 
> wrote:
> A> Yeah, it was being implicitly zeroized before.  But Clang complained
> A> about the structures being only partially initialized.  Since the
> A> whole point of my commit was to increase the WARNS level, I explicitly
> A> zeroed the zero fields to silence Clang.
>
> Isn't zero filling part of the standard? I don't see why lack of
> explicit zeroing is a warning? Looks a false warning to me.
>

It is not quite as simple as this would make it sound.  The elements or
members of an aggregate (e.g.) structure type are initialized as if it were
an object of static storage duration (i.e., to zero) if the initializer
list does not contain enough initializers for all members of the aggregate
type, per item 21 of section 6.7.8 of n1256.pdf.  However, such
initialization does not necessarily need to zero any padding bytes that are
present, which may take unspecified values.  Personally, I think this
particular clang warning can be too aggressive, especially for complex
structs, but on the other hand given the indeterminateness of padding,
bzero/memset are often a better choice anyway.

-Ben
___
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: r295828 - head/sys/dev/ixl

2016-02-19 Thread Gleb Smirnoff
On Fri, Feb 19, 2016 at 10:33:51PM +, Eric Joyner wrote:
E> Author: erj
E> Date: Fri Feb 19 22:33:50 2016
E> New Revision: 295828
E> URL: https://svnweb.freebsd.org/changeset/base/295828
E> 
E> Log:
E>   ixl(4): Remove unsupported device IDs.
E>   
E>   There is no official support for 20G SKUs on FreeBSD, and the KX_A
E>   device ID was never used.

Did the driver attach but failed to work before?

-- 
Totus tuus, Glebius.
___
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: r295768 - head/usr.sbin/iostat

2016-02-19 Thread Gleb Smirnoff
On Fri, Feb 19, 2016 at 08:49:43AM -0700, Alan Somers wrote:
A> On Fri, Feb 19, 2016 at 5:24 AM, Sergey Kandaurov  wrote:
A> > On 18 February 2016 at 23:08, Alan Somers  wrote:
A> >> Author: asomers
A> >> Date: Thu Feb 18 20:08:01 2016
A> >> New Revision: 295768
A> >> URL: https://svnweb.freebsd.org/changeset/base/295768
A> >>
A> >> Log:
A> >>   Fix compiler warnings in iostat
A> >
A> >> Modified: head/usr.sbin/iostat/iostat.c
A> >> 
==
A> >> --- head/usr.sbin/iostat/iostat.c   Thu Feb 18 19:37:39 2016
(r295767)
A> >> +++ head/usr.sbin/iostat/iostat.c   Thu Feb 18 20:08:01 2016
(r295768)
A> >> @@ -117,30 +117,34 @@
A> >>  #include 
A> >>  #include 
A> >>
A> >> -struct nlist namelist[] = {
A> >> +static struct nlist namelist[] = {
A> >>  #define X_TTY_NIN  0
A> >> -   { "_tty_nin" },
A> >> +   { .n_name = "_tty_nin",
A> >> + .n_type = 0, .n_other = 0, .n_desc = 0, .n_value = 0 },
A> >>  [...]
A> >
A> > You unlikely need this excessive explicit zeroization.
A> > In this case it is implicitly prezeroed.
A> >
A> > Consider these two cases:
A> >
A> > : #include 
A> > :
A> > : int main(void) {
A> > :   struct nlist namelist[2] = {{ .n_type = 0x42 }};
A> > :   return sizeof(namelist);
A> > : }
A> >
A> > (__TEXT,__text) section
A> > _main:
A> > pushq%rbp
A> > 0001movq%rsp, %rbp
A> > 0004leaq-0x30(%rbp), %rdx
A> > 0008movl$0x0, %eax
A> > 000dmovl$0x6, %ecx
A> > 0012movq%rdx, %rdi
A> > 0015rep
A> > 0016stosq
A> > 0018movb$0x42, -0x28(%rbp)
A> > 001cmovl$0x30, %eax
A> > 0021popq%rbp
A> > 0022retq
A> >
A> > rep stosq does zero 48 bytes, that is namelist[].
A> >
A> > Or, if it is static.
A> >
A> > : #include 
A> > :
A> > : int main(void) {
A> > :   static struct nlist namelist[2] = {{ .n_type = 0x42 }};
A> > :   return sizeof(namelist);
A> > : }
A> >
A> > (__DATA,__data) section
A> > 002000 00 00 00 00 00 00 00 42 00 00 00 00 00 00 00
A> > 003000 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
A> > 004000 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
A> 
A> Yeah, it was being implicitly zeroized before.  But Clang complained
A> about the structures being only partially initialized.  Since the
A> whole point of my commit was to increase the WARNS level, I explicitly
A> zeroed the zero fields to silence Clang.

Isn't zero filling part of the standard? I don't see why lack of
explicit zeroing is a warning? Looks a false warning to me.

-- 
Totus tuus, Glebius.
___
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: r295831 - head/sys/dev/ixl

2016-02-19 Thread Eric Joyner
Author: erj
Date: Fri Feb 19 22:48:20 2016
New Revision: 295831
URL: https://svnweb.freebsd.org/changeset/base/295831

Log:
  ixl(4)/ixlv(4): Revert m_collapse() in ixl_xmit() to m_defrag().
  
  The m_collapse() call would fail when transmitting medium-sized packets
  when the interface mtu was set to 9000, so revert back to m_defrag(),
  which does not fail.
  
  Differential Revision:https://reviews.freebsd.org/D5207
  Tested by:jeffrey.e.pie...@intel.com
  Sponsored by: Intel Corporation

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

Modified: head/sys/dev/ixl/ixl_txrx.c
==
--- head/sys/dev/ixl/ixl_txrx.c Fri Feb 19 22:46:52 2016(r295830)
+++ head/sys/dev/ixl/ixl_txrx.c Fri Feb 19 22:48:20 2016(r295831)
@@ -286,7 +286,7 @@ ixl_xmit(struct ixl_queue *que, struct m
if (error == EFBIG) {
struct mbuf *m;
 
-   m = m_collapse(*m_headp, M_NOWAIT, maxsegs);
+   m = m_defrag(*m_headp, M_NOWAIT);
if (m == NULL) {
que->mbuf_defrag_failed++;
m_freem(*m_headp);
___
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: r295830 - head/sys/dev/bxe

2016-02-19 Thread David C Somayajulu
Author: davidcs
Date: Fri Feb 19 22:46:52 2016
New Revision: 295830
URL: https://svnweb.freebsd.org/changeset/base/295830

Log:
  Remove dead code. Code Cleanup. Improve clarity in debug messages
  
  MFC after:5 days

Modified:
  head/sys/dev/bxe/bxe.c
  head/sys/dev/bxe/bxe.h
  head/sys/dev/bxe/bxe_stats.c
  head/sys/dev/bxe/ecore_init.h

Modified: head/sys/dev/bxe/bxe.c
==
--- head/sys/dev/bxe/bxe.c  Fri Feb 19 22:45:09 2016(r295829)
+++ head/sys/dev/bxe/bxe.c  Fri Feb 19 22:46:52 2016(r295830)
@@ -124,14 +124,6 @@ static struct bxe_device_type bxe_devs[]
 PCI_ANY_ID, PCI_ANY_ID,
 "QLogic NetXtreme II BCM57712 MF 10GbE"
 },
-#if 0
-{
-BRCM_VENDORID,
-CHIP_NUM_57712_VF,
-PCI_ANY_ID, PCI_ANY_ID,
-"QLogic NetXtreme II BCM57712 VF 10GbE"
-},
-#endif
 {
 BRCM_VENDORID,
 CHIP_NUM_57800,
@@ -144,14 +136,6 @@ static struct bxe_device_type bxe_devs[]
 PCI_ANY_ID, PCI_ANY_ID,
 "QLogic NetXtreme II BCM57800 MF 10GbE"
 },
-#if 0
-{
-BRCM_VENDORID,
-CHIP_NUM_57800_VF,
-PCI_ANY_ID, PCI_ANY_ID,
-"QLogic NetXtreme II BCM57800 VF 10GbE"
-},
-#endif
 {
 BRCM_VENDORID,
 CHIP_NUM_57810,
@@ -164,14 +148,6 @@ static struct bxe_device_type bxe_devs[]
 PCI_ANY_ID, PCI_ANY_ID,
 "QLogic NetXtreme II BCM57810 MF 10GbE"
 },
-#if 0
-{
-BRCM_VENDORID,
-CHIP_NUM_57810_VF,
-PCI_ANY_ID, PCI_ANY_ID,
-"QLogic NetXtreme II BCM57810 VF 10GbE"
-},
-#endif
 {
 BRCM_VENDORID,
 CHIP_NUM_57811,
@@ -184,42 +160,18 @@ static struct bxe_device_type bxe_devs[]
 PCI_ANY_ID, PCI_ANY_ID,
 "QLogic NetXtreme II BCM57811 MF 10GbE"
 },
-#if 0
-{
-BRCM_VENDORID,
-CHIP_NUM_57811_VF,
-PCI_ANY_ID, PCI_ANY_ID,
-"QLogic NetXtreme II BCM57811 VF 10GbE"
-},
-#endif
 {
 BRCM_VENDORID,
 CHIP_NUM_57840_4_10,
 PCI_ANY_ID, PCI_ANY_ID,
 "QLogic NetXtreme II BCM57840 4x10GbE"
 },
-#if 0
-{
-BRCM_VENDORID,
-CHIP_NUM_57840_2_20,
-PCI_ANY_ID, PCI_ANY_ID,
-"QLogic NetXtreme II BCM57840 2x20GbE"
-},
-#endif
 {
 BRCM_VENDORID,
 CHIP_NUM_57840_MF,
 PCI_ANY_ID, PCI_ANY_ID,
 "QLogic NetXtreme II BCM57840 MF 10GbE"
 },
-#if 0
-{
-BRCM_VENDORID,
-CHIP_NUM_57840_VF,
-PCI_ANY_ID, PCI_ANY_ID,
-"QLogic NetXtreme II BCM57840 VF 10GbE"
-},
-#endif
 {
 0, 0, 0, 0, NULL
 }
@@ -245,10 +197,6 @@ static device_method_t bxe_methods[] = {
 DEVMETHOD(device_attach,bxe_attach),
 DEVMETHOD(device_detach,bxe_detach),
 DEVMETHOD(device_shutdown,  bxe_shutdown),
-#if 0
-DEVMETHOD(device_suspend,   bxe_suspend),
-DEVMETHOD(device_resume,bxe_resume),
-#endif
 /* Bus interface (bus_if.h) */
 DEVMETHOD(bus_print_child,  bus_generic_print_child),
 DEVMETHOD(bus_driver_added, bus_generic_driver_added),
@@ -458,12 +406,6 @@ static const struct {
 8, STATS_FLAGS_FUNC, "tpa_aggregated_frames"},
 { STATS_OFFSET32(total_tpa_bytes_hi),
 8, STATS_FLAGS_FUNC, "tpa_bytes"},
-#if 0
-{ STATS_OFFSET32(recoverable_error),
-4, STATS_FLAGS_FUNC, "recoverable_errors" },
-{ STATS_OFFSET32(unrecoverable_error),
-4, STATS_FLAGS_FUNC, "unrecoverable_errors" },
-#endif
 { STATS_OFFSET32(eee_tx_lpi),
 4, STATS_FLAGS_PORT, "eee_tx_lpi"},
 { STATS_OFFSET32(rx_calls),
@@ -516,12 +458,6 @@ static const struct {
 4, STATS_FLAGS_FUNC, "tx_window_violation_std"},
 { STATS_OFFSET32(tx_window_violation_tso),
 4, STATS_FLAGS_FUNC, "tx_window_violation_tso"},
-#if 0
-{ STATS_OFFSET32(tx_unsupported_tso_request_ipv6),
-4, STATS_FLAGS_FUNC, "tx_unsupported_tso_request_ipv6"},
-{ STATS_OFFSET32(tx_unsupported_tso_request_not_tcp),
-4, STATS_FLAGS_FUNC, "tx_unsupported_tso_request_not_tcp"},
-#endif
 { STATS_OFFSET32(tx_chain_lost_mbuf),
 4, STATS_FLAGS_FUNC, "tx_chain_lost_mbuf"},
 { STATS_OFFSET32(tx_frames_deferred),
@@ -633,12 +569,6 @@ static const struct {
 4, "tx_window_violation_std"},
 { Q_STATS_OFFSET32(tx_window_violation_tso),
 4, "tx_window_violation_tso"},
-#if 0
-{ Q_STATS_OFFSET32(tx_unsupported_tso_request_ipv6),
-4, "tx_unsupported_tso_request_ipv6"},
-{ Q_STATS_OFFSET32(tx_unsupported_tso_request_not_tcp),
-4, "tx_unsupported_tso_request_not_tcp"},
-#endif
 { Q_STATS_OFFSET32(tx_chain_lost_mbuf),
 4, "tx_chain_lost_mbuf"},
 { Q_STATS_OFFSET32(tx_frames_deferred),
@@ -906,12 +836,6 @@ bxe_dma_map_addr(void *arg, 

svn commit: r295829 - head/sys/dev/ixl

2016-02-19 Thread Eric Joyner
Author: erj
Date: Fri Feb 19 22:45:09 2016
New Revision: 295829
URL: https://svnweb.freebsd.org/changeset/base/295829

Log:
  ixl(4): Fix errors in queue interrupt setup in MSIX mode.
  
  - I40E_PFINT_DYN_CTLN needs to be cleared, and not have a queue index
written to it.
  - The interrupt linked list for each queue is changed to only include
the queue's Rx and Tx queues.
  
  Differential Revision:https://reviews.freebsd.org/D5206
  Reviewed by:  sbruno
  Tested by:jeffrey.e.pie...@intel.com
  Sponsored by: Intel Corporation

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 22:33:50 2016(r295828)
+++ head/sys/dev/ixl/if_ixl.c   Fri Feb 19 22:45:09 2016(r295829)
@@ -2246,7 +2246,8 @@ ixl_configure_msix(struct ixl_pf *pf)
 
/* Next configure the queues */
for (int i = 0; i < vsi->num_queues; i++, vector++) {
-   wr32(hw, I40E_PFINT_DYN_CTLN(i), i);
+   wr32(hw, I40E_PFINT_DYN_CTLN(i), 0);
+   /* First queue type is RX / type 0 */
wr32(hw, I40E_PFINT_LNKLSTN(i), i);
 
reg = I40E_QINT_RQCTL_CAUSE_ENA_MASK |
@@ -2259,11 +2260,8 @@ ixl_configure_msix(struct ixl_pf *pf)
reg = I40E_QINT_TQCTL_CAUSE_ENA_MASK |
(IXL_TX_ITR << I40E_QINT_TQCTL_ITR_INDX_SHIFT) |
(vector << I40E_QINT_TQCTL_MSIX_INDX_SHIFT) |
-   ((i+1) << I40E_QINT_TQCTL_NEXTQ_INDX_SHIFT) |
+   (IXL_QUEUE_EOL << I40E_QINT_TQCTL_NEXTQ_INDX_SHIFT) |
(I40E_QUEUE_TYPE_RX << I40E_QINT_TQCTL_NEXTQ_TYPE_SHIFT);
-   if (i == (vsi->num_queues - 1))
-   reg |= (IXL_QUEUE_EOL
-   << I40E_QINT_TQCTL_NEXTQ_INDX_SHIFT);
wr32(hw, I40E_QINT_TQCTL(i), reg);
}
 }
___
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: r295828 - head/sys/dev/ixl

2016-02-19 Thread Eric Joyner
Author: erj
Date: Fri Feb 19 22:33:50 2016
New Revision: 295828
URL: https://svnweb.freebsd.org/changeset/base/295828

Log:
  ixl(4): Remove unsupported device IDs.
  
  There is no official support for 20G SKUs on FreeBSD, and the KX_A
  device ID was never used.
  
  Differential Revision:https://reviews.freebsd.org/D5204
  Reviewed by:  sbruno, jeffrey.e.pie...@intel.com
  Sponsored by: Intel Corporation

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 22:28:45 2016(r295827)
+++ head/sys/dev/ixl/if_ixl.c   Fri Feb 19 22:33:50 2016(r295828)
@@ -63,7 +63,6 @@ char ixl_driver_version[] = "1.4.3";
 static ixl_vendor_info_t ixl_vendor_info_array[] =
 {
{I40E_INTEL_VENDOR_ID, I40E_DEV_ID_SFP_XL710, 0, 0, 0},
-   {I40E_INTEL_VENDOR_ID, I40E_DEV_ID_KX_A, 0, 0, 0},
{I40E_INTEL_VENDOR_ID, I40E_DEV_ID_KX_B, 0, 0, 0},
{I40E_INTEL_VENDOR_ID, I40E_DEV_ID_KX_C, 0, 0, 0},
{I40E_INTEL_VENDOR_ID, I40E_DEV_ID_QSFP_A, 0, 0, 0},
@@ -71,8 +70,6 @@ static ixl_vendor_info_t ixl_vendor_info
{I40E_INTEL_VENDOR_ID, I40E_DEV_ID_QSFP_C, 0, 0, 0},
{I40E_INTEL_VENDOR_ID, I40E_DEV_ID_10G_BASE_T, 0, 0, 0},
{I40E_INTEL_VENDOR_ID, I40E_DEV_ID_10G_BASE_T4, 0, 0, 0},
-   {I40E_INTEL_VENDOR_ID, I40E_DEV_ID_20G_KR2, 0, 0, 0},
-   {I40E_INTEL_VENDOR_ID, I40E_DEV_ID_20G_KR2_A, 0, 0, 0},
 #ifdef X722_SUPPORT
{I40E_INTEL_VENDOR_ID, I40E_DEV_ID_SFP_X722, 0, 0, 0},
{I40E_INTEL_VENDOR_ID, I40E_DEV_ID_1G_BASE_T_X722, 0, 0, 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: r295827 - head/share/mk

2016-02-19 Thread Bryan Drewery
Author: bdrewery
Date: Fri Feb 19 22:28:45 2016
New Revision: 295827
URL: https://svnweb.freebsd.org/changeset/base/295827

Log:
  DIRDEPS_BUILD: Enable the post-build footer/stats display.
  
  There is no real downside to this and it is useful to have enabled.
  
  Sponsored by: EMC / Isilon Storage Division

Modified:
  head/share/mk/local.meta.sys.mk

Modified: head/share/mk/local.meta.sys.mk
==
--- head/share/mk/local.meta.sys.mk Fri Feb 19 21:58:14 2016
(r295826)
+++ head/share/mk/local.meta.sys.mk Fri Feb 19 22:28:45 2016
(r295827)
@@ -204,6 +204,7 @@ CSU_DIR := ${CSU_DIR.${MACHINE_ARCH}}
 .if !empty(TIME_STAMP)
 TRACER= ${TIME_STAMP} ${:U}
 .endif
+WITH_META_STATS= t
 
 # toolchains can be a pain - especially bootstrappping them
 .if ${MACHINE} == "host"
___
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: r295826 - head/sys/dev/ixl

2016-02-19 Thread Eric Joyner
Author: erj
Date: Fri Feb 19 21:58:14 2016
New Revision: 295826
URL: https://svnweb.freebsd.org/changeset/base/295826

Log:
  ixl(4): Fix two important RSS bugs.
  
  - Change tc_mapping field to assign 64 queues instead of 16 to the PF's VSI;
add comments to describe how this is done.
  
  - Set hash lut size to 512 when setting filter control; the lut size defaults
to 128 if this isn't set.
  
  Differential Revision:https://reviews.freebsd.org/D5203
  Reviewed by:  gallatin
  Tested by:jeffrey.e.pie...@intel.com
  Sponsored by: Intel Corporation

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 21:53:12 2016(r295825)
+++ head/sys/dev/ixl/if_ixl.c   Fri Feb 19 21:58:14 2016(r295826)
@@ -1175,6 +1175,7 @@ ixl_init_locked(struct ixl_pf *pf)
 #ifdef IXL_FDIR
filter.enable_fdir = TRUE;
 #endif
+   filter.hash_lut_size = I40E_HASH_LUT_SIZE_512;
if (i40e_set_filter_control(hw, ))
device_printf(dev, "set_filter_control() failed\n");
 
@@ -2758,8 +2759,17 @@ ixl_initialize_vsi(struct ixl_vsi *vsi)
*/
ctxt.info.valid_sections = I40E_AQ_VSI_PROP_QUEUE_MAP_VALID;
ctxt.info.mapping_flags |= I40E_AQ_VSI_QUE_MAP_CONTIG;
-   ctxt.info.queue_mapping[0] = 0; 
-   ctxt.info.tc_mapping[0] = 0x0800; 
+   /* In contig mode, que_mapping[0] is first queue index used by this VSI 
*/
+   ctxt.info.queue_mapping[0] = 0;
+   /*
+* This VSI will only use traffic class 0; start traffic class 0's
+* queue allocation at queue 0, and assign it 64 (2^6) queues (though
+* the driver may not use all of them).
+*/
+   ctxt.info.tc_mapping[0] = ((0 << I40E_AQ_VSI_TC_QUE_OFFSET_SHIFT)
+   & I40E_AQ_VSI_TC_QUE_OFFSET_MASK) |
+   ((6 << I40E_AQ_VSI_TC_QUE_NUMBER_SHIFT)
+   & I40E_AQ_VSI_TC_QUE_NUMBER_MASK);
 
/* Set VLAN receive stripping mode */
ctxt.info.valid_sections |= I40E_AQ_VSI_PROP_VLAN_VALID;
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r295825 - in head/bin/sh: . tests/parser

2016-02-19 Thread Jilles Tjoelker
Author: jilles
Date: Fri Feb 19 21:53:12 2016
New Revision: 295825
URL: https://svnweb.freebsd.org/changeset/base/295825

Log:
  sh: Rework code to remove '\0' from shell input.
  
  This fixes bugs where '\0' was not removed correctly and speeds up the
  parser.

Added:
  head/bin/sh/tests/parser/nul1.0   (contents, props changed)
Modified:
  head/bin/sh/input.c
  head/bin/sh/tests/parser/Makefile

Modified: head/bin/sh/input.c
==
--- head/bin/sh/input.c Fri Feb 19 21:51:27 2016(r295824)
+++ head/bin/sh/input.c Fri Feb 19 21:53:12 2016(r295825)
@@ -195,8 +195,7 @@ retry:
 int
 preadbuffer(void)
 {
-   char *p, *q;
-   int more;
+   char *p, *q, *r, *end;
char savec;
 
while (parsefile->strpush) {
@@ -224,34 +223,31 @@ again:
}
}
 
-   q = p = parsefile->buf + (parsenextc - parsefile->buf);
-
-   /* delete nul characters */
-   for (more = 1; more;) {
-   switch (*p) {
-   case '\0':
-   p++;/* Skip nul */
-   goto check;
-
-   case '\n':
-   parsenleft = q - parsenextc;
-   more = 0; /* Stop processing here */
-   break;
-
-   default:
-   break;
-   }
-
-   *q++ = *p++;
-check:
-   if (--parselleft <= 0) {
-   parsenleft = q - parsenextc - 1;
-   if (parsenleft < 0)
-   goto again;
-   *q = '\0';
-   more = 0;
+   p = parsefile->buf + (parsenextc - parsefile->buf);
+   end = p + parselleft;
+   *end = '\0';
+   q = strchrnul(p, '\n');
+   if (q != end && *q == '\0') {
+   /* delete nul characters */
+   for (r = q; q != end; q++) {
+   if (*q != '\0')
+   *r++ = *q;
}
+   parselleft -= end - r;
+   if (parselleft == 0)
+   goto again;
+   end = p + parselleft;
+   *end = '\0';
+   q = strchrnul(p, '\n');
+   }
+   if (q == end) {
+   parsenleft = parselleft;
+   parselleft = 0;
+   } else /* *q == '\n' */ {
+   parsenleft = q - parsenextc + 1;
+   parselleft -= parsenleft;
}
+   parsenleft--;
 
savec = *q;
*q = '\0';

Modified: head/bin/sh/tests/parser/Makefile
==
--- head/bin/sh/tests/parser/Makefile   Fri Feb 19 21:51:27 2016
(r295824)
+++ head/bin/sh/tests/parser/Makefile   Fri Feb 19 21:53:12 2016
(r295825)
@@ -73,6 +73,7 @@ FILES+=   line-cont10.0
 FILES+=line-cont11.0
 FILES+=no-space1.0
 FILES+=no-space2.0
+FILES+=nul1.0
 FILES+=only-redir1.0
 FILES+=only-redir2.0
 FILES+=only-redir3.0

Added: head/bin/sh/tests/parser/nul1.0
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/bin/sh/tests/parser/nul1.0 Fri Feb 19 21:53:12 2016
(r295825)
@@ -0,0 +1,12 @@
+# $FreeBSD$
+# Although POSIX does not specify the effect of NUL bytes in scripts,
+# we ignore them.
+
+{
+   printf 'v=%03000d\0%02000d' 7 2
+   dd if=/dev/zero bs=1000 count=1 status=none
+   printf '1 w=%03000d%02000d1\0\n' 7 2
+   printf '\0l\0v\0=\0$\0{\0#\0v\0}\n'
+   printf '\0l\0w\0=\0\0$\0{\0#\0w}\0\0\0\n'
+   printf '[ "$lv.$lw.$v" = "5001.5001.$w" ]\n'
+} | ${SH}
___
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: r295823 - head/sys/dev/bxe

2016-02-19 Thread David C Somayajulu
Author: davidcs
Date: Fri Feb 19 21:32:49 2016
New Revision: 295823
URL: https://svnweb.freebsd.org/changeset/base/295823

Log:
  Modified the use of bxe_grc_dump() function so that it can be invoked 
directly at any potential error path, where a fwdump is needed. The fwdump 
(a.k.a grcdump) is stored in a driver buffer. The sysctl grcdump_done indicates 
if a fwdump was taken and waiting to be retrieved.
  The sysctl trigger_grcdump can be used to manually trigger a fwdump.
  
  MFC after:5 days

Modified:
  head/sys/dev/bxe/bxe.c
  head/sys/dev/bxe/bxe.h

Modified: head/sys/dev/bxe/bxe.c
==
--- head/sys/dev/bxe/bxe.c  Fri Feb 19 18:05:02 2016(r295822)
+++ head/sys/dev/bxe/bxe.c  Fri Feb 19 21:32:49 2016(r295823)
@@ -738,6 +738,7 @@ static void bxe_handle_fp_tq(void *conte
 
 static int bxe_add_cdev(struct bxe_softc *sc);
 static void bxe_del_cdev(struct bxe_softc *sc);
+static int bxe_grc_dump(struct bxe_softc *sc);
 
 /* calculate crc32 on a buffer (NOTE: crc32_length MUST be aligned to 8) */
 uint32_t
@@ -7934,6 +7935,16 @@ bxe_chk_parity_attn(struct bxe_softc *sc
 attn.sig[2] = REG_RD(sc, MISC_REG_AEU_AFTER_INVERT_3_FUNC_0 + port*4);
 attn.sig[3] = REG_RD(sc, MISC_REG_AEU_AFTER_INVERT_4_FUNC_0 + port*4);
 
+/*
+ * Since MCP attentions can't be disabled inside the block, we need to
+ * read AEU registers to see whether they're currently disabled
+ */
+attn.sig[3] &= ((REG_RD(sc, (!port ? MISC_REG_AEU_ENABLE4_FUNC_0_OUT_0
+  : MISC_REG_AEU_ENABLE4_FUNC_1_OUT_0)) &
+ MISC_AEU_ENABLE_MCP_PRTY_BITS) |
+~MISC_AEU_ENABLE_MCP_PRTY_BITS);
+
+
 if (!CHIP_IS_E1x(sc))
 attn.sig[4] = REG_RD(sc, MISC_REG_AEU_AFTER_INVERT_5_FUNC_0 + port*4);
 
@@ -16148,6 +16159,30 @@ bxe_sysctl_state(SYSCTL_HANDLER_ARGS)
 }
 
 static int
+bxe_sysctl_trigger_grcdump(SYSCTL_HANDLER_ARGS)
+{
+struct bxe_softc *sc;
+int error, result;
+
+result = 0;
+error = sysctl_handle_int(oidp, , 0, req);
+
+if (error || !req->newptr) {
+return (error);
+}
+
+if (result == 1) {
+sc = (struct bxe_softc *)arg1;
+
+BLOGI(sc, "... grcdump start ...\n");
+bxe_grc_dump(sc);
+BLOGI(sc, "... grcdump done ...\n");
+}
+
+return (error);
+}
+
+static int
 bxe_sysctl_eth_stat(SYSCTL_HANDLER_ARGS)
 {
 struct bxe_softc *sc = (struct bxe_softc *)arg1;
@@ -16279,11 +16314,15 @@ bxe_add_sysctls(struct bxe_softc *sc)
 CTLFLAG_RW, >debug,
 "debug logging mode");
 
-sc->trigger_grcdump = 0;
-SYSCTL_ADD_UINT(ctx, children, OID_AUTO, "trigger_grcdump",
-CTLFLAG_RW, >trigger_grcdump, 0,
+SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "trigger_grcdump",
+CTLTYPE_UINT | CTLFLAG_RW, sc, 0,
+bxe_sysctl_trigger_grcdump, "IU",
 "set by driver when a grcdump is needed");
 
+sc->grcdump_done = 0;
+SYSCTL_ADD_UINT(ctx, children, OID_AUTO, "grcdump_done",
+   CTLFLAG_RW, >grcdump_done, 0,
+   "set by driver when grcdump is done");
 
 sc->rx_budget = bxe_rx_budget;
 SYSCTL_ADD_UINT(ctx, children, OID_AUTO, "rx_budget",
@@ -18901,26 +18940,6 @@ bxe_get_preset_regs_len(struct bxe_softc
 }
 
 static int
-bxe_get_max_regs_len(struct bxe_softc *sc)
-{
-uint32_t preset_idx;
-int regdump_len32, len32;
-
-regdump_len32 = bxe_get_preset_regs_len(sc, 1);
-
-/* Calculate the total preset regs length */
-for (preset_idx = 2; preset_idx <= DUMP_MAX_PRESETS; preset_idx++) {
-
-len32 = bxe_get_preset_regs_len(sc, preset_idx);
-
-if (regdump_len32 < len32)
-regdump_len32 = len32;
-}
-
-return regdump_len32;
-}
-
-static int
 bxe_get_total_regs_len32(struct bxe_softc *sc)
 {
 uint32_t preset_idx;
@@ -19147,18 +19166,21 @@ bxe_get_preset_regs(struct bxe_softc *sc
 }
 
 static int
-bxe_grc_dump(struct bxe_softc *sc, bxe_grcdump_t *dump)
+bxe_grc_dump(struct bxe_softc *sc)
 {
 int rval = 0;
 uint32_t preset_idx;
 uint8_t *buf;
 uint32_t size;
 struct  dump_header *d_hdr;
+
+if (sc->grcdump_done)
+   return (rval);
 
 ecore_disable_blocks_parity(sc);
 
-buf = dump->grcdump;
-d_hdr = dump->grcdump;
+buf = sc->grc_dump;
+d_hdr = sc->grc_dump;
 
 d_hdr->header_size = (sizeof(struct  dump_header) >> 2) - 1;
 d_hdr->version = BNX2X_DUMP_VERSION;
@@ -19179,7 +19201,6 @@ bxe_grc_dump(struct bxe_softc *sc, bxe_g
 (BXE_PATH(sc) ? DUMP_PATH_1 : DUMP_PATH_0);
 }
 
-dump->grcdump_dwords = sizeof(struct  dump_header) >> 2;
 buf += sizeof(struct  dump_header);
 
 for (preset_idx = 1; preset_idx <= DUMP_MAX_PRESETS; preset_idx++) {
@@ -19196,13 +19217,6 @@ bxe_grc_dump(struct bxe_softc *sc, bxe_g
 

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

2016-02-19 Thread John Baldwin
On Thursday, February 18, 2016 09:15:27 PM Stefan Esser wrote:
> Am 18.02.2016 um 19:07 schrieb John Baldwin:
> >> @@ -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.

No, I think your current version is fine, was just lamenting the compilers. :)

> >> Modified: head/usr.sbin/pciconf/pciconf.c
> >> ==
> >> --- head/usr.sbin/pciconf/pciconf.cThu Feb 18 15:12:52 2016
> >> (r295759)
> >> +++ head/usr.sbin/pciconf/pciconf.cThu Feb 18 15:23:25 2016
> >> (r295760)
> >> @@ -913,7 +915,8 @@ parsesel(const char *str)
> >>ep += 3;
> >>i = 0;
> >>do {
> >> -  selarr[i++] = strtoul(ep, , 10);
> >> +selarr[i++] = strtoul(ep, , 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.

Thanks, the indentation is just a minor nit.

-- 
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: r295822 - head/sys/dev/qlxgb

2016-02-19 Thread Pedro F. Giffuni
Author: pfg
Date: Fri Feb 19 18:05:02 2016
New Revision: 295822
URL: https://svnweb.freebsd.org/changeset/base/295822

Log:
  qlxgb: fix mismatch.
  
  Found by: PVS Static Analysis
  Reviewed by:  davidcs
  MFC after:1 month

Modified:
  head/sys/dev/qlxgb/qla_hw.c

Modified: head/sys/dev/qlxgb/qla_hw.c
==
--- head/sys/dev/qlxgb/qla_hw.c Fri Feb 19 17:34:11 2016(r295821)
+++ head/sys/dev/qlxgb/qla_hw.c Fri Feb 19 18:05:02 2016(r295822)
@@ -797,7 +797,8 @@ qla_tx_tso(qla_host_t *ha, struct mbuf *
}
 
if ((*tcp_opt != 0x01) || (*(tcp_opt + 1) != 0x01) ||
-   (*(tcp_opt + 2) != 0x08) || (*(tcp_opt + 2) != 
10)) {
+   (*(tcp_opt + 2) != 0x08) ||
+   (*(tcp_opt + 3) != 10)) {
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: r295818 - head/bin/sh/tests/parser

2016-02-19 Thread Jilles Tjoelker
Author: jilles
Date: Fri Feb 19 16:56:07 2016
New Revision: 295818
URL: https://svnweb.freebsd.org/changeset/base/295818

Log:
  sh: Add tests for comments in sh -c.

Added:
  head/bin/sh/tests/parser/comment1.0   (contents, props changed)
  head/bin/sh/tests/parser/comment2.42   (contents, props changed)
Modified:
  head/bin/sh/tests/parser/Makefile

Modified: head/bin/sh/tests/parser/Makefile
==
--- head/bin/sh/tests/parser/Makefile   Fri Feb 19 16:53:41 2016
(r295817)
+++ head/bin/sh/tests/parser/Makefile   Fri Feb 19 16:56:07 2016
(r295818)
@@ -25,6 +25,8 @@ FILES+=   alias15.0 alias15.0.stdout
 FILES+=and-pipe-not.0
 FILES+=case1.0
 FILES+=case2.0
+FILES+=comment1.0
+FILES+=comment2.42
 FILES+=dollar-quote1.0
 FILES+=dollar-quote2.0
 FILES+=dollar-quote3.0

Added: head/bin/sh/tests/parser/comment1.0
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/bin/sh/tests/parser/comment1.0 Fri Feb 19 16:56:07 2016
(r295818)
@@ -0,0 +1,3 @@
+# $FreeBSD$
+
+${SH} -c '#'

Added: head/bin/sh/tests/parser/comment2.42
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/bin/sh/tests/parser/comment2.42Fri Feb 19 16:56:07 2016
(r295818)
@@ -0,0 +1,4 @@
+# $FreeBSD$
+
+${SH} -c '#
+exit 42'
___
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: r295816 - head/sys/dev/pci

2016-02-19 Thread Stefan Esser
Author: se
Date: Fri Feb 19 16:53:21 2016
New Revision: 295816
URL: https://svnweb.freebsd.org/changeset/base/295816

Log:
  Fix syntax error introduced in previous commit where I removed one
  character to few. I should have waited for the kernel compile to finish,
  even though the change seemed so trivial.

Modified:
  head/sys/dev/pci/pci_user.c

Modified: head/sys/dev/pci/pci_user.c
==
--- head/sys/dev/pci/pci_user.c Fri Feb 19 16:43:37 2016(r295815)
+++ head/sys/dev/pci/pci_user.c Fri Feb 19 16:53:21 2016(r295816)
@@ -711,7 +711,7 @@ pci_ioctl(struct cdev *dev, u_long cmd, 
for (cio->num_matches = 0, error = 0, i = 0,
 dinfo = STAILQ_FIRST(devlist_head);
 (dinfo != NULL) && (cio->num_matches < ionum) &&
-(error == 0) && (i < pci_numdevs));
+(error == 0) && (i < pci_numdevs);
 dinfo = STAILQ_NEXT(dinfo, pci_links), i++) {
 
if (i < cio->offset)
___
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: r295813 - head/sys/dev/pci

2016-02-19 Thread Stefan Esser
Author: se
Date: Fri Feb 19 16:43:03 2016
New Revision: 295813
URL: https://svnweb.freebsd.org/changeset/base/295813

Log:
  Remove redundant check for "(dinfo != NULL)", it has already been performed
  as the first part of this complex loop conditional.
  
  Found by:PVS Static Analysis

Modified:
  head/sys/dev/pci/pci_user.c

Modified: head/sys/dev/pci/pci_user.c
==
--- head/sys/dev/pci/pci_user.c Fri Feb 19 16:37:06 2016(r295812)
+++ head/sys/dev/pci/pci_user.c Fri Feb 19 16:43:03 2016(r295813)
@@ -709,9 +709,9 @@ pci_ioctl(struct cdev *dev, u_long cmd, 
 * that match the user's criteria.
 */
for (cio->num_matches = 0, error = 0, i = 0,
-dinfo = STAILQ_FIRST(devlist_head);
-(dinfo != NULL) && (cio->num_matches < ionum)
-&& (error == 0) && (i < pci_numdevs) && (dinfo != NULL);
+dinfo = STAILQ_FIRST(devlist_head);
+(dinfo != NULL) && (cio->num_matches < ionum) &&
+(error == 0) && (i < pci_numdevs));
 dinfo = STAILQ_NEXT(dinfo, pci_links), i++) {
 
if (i < cio->offset)
___
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: r295811 - head/sys/fs/ext2fs

2016-02-19 Thread Pedro F. Giffuni
Author: pfg
Date: Fri Feb 19 15:53:08 2016
New Revision: 295811
URL: https://svnweb.freebsd.org/changeset/base/295811

Log:
  Ext2: cleanup setting of ctime/mtime/birthtime.
  
  This adopts the same change as r291936 for UFS.
  Directly clear IN_ACCESS or IN_UPDATE when user supplied the time, and
  copy the value into the inode.
  
  This keeps the behaviour cleaner and is consistent with UFS.
  
  Reviewed by:  bde
  MFC after:1 month (only 10)

Modified:
  head/sys/fs/ext2fs/ext2_vnops.c

Modified: head/sys/fs/ext2fs/ext2_vnops.c
==
--- head/sys/fs/ext2fs/ext2_vnops.c Fri Feb 19 15:35:20 2016
(r295810)
+++ head/sys/fs/ext2fs/ext2_vnops.c Fri Feb 19 15:53:08 2016
(r295811)
@@ -464,16 +464,14 @@ ext2_setattr(struct vop_setattr_args *ap
((vap->va_vaflags & VA_UTIMES_NULL) == 0 ||
(error = VOP_ACCESS(vp, VWRITE, cred, td
return (error);
-   if (vap->va_atime.tv_sec != VNOVAL)
-   ip->i_flag |= IN_ACCESS;
-   if (vap->va_mtime.tv_sec != VNOVAL)
-   ip->i_flag |= IN_CHANGE | IN_UPDATE;
-   ext2_itimes(vp);
+   ip->i_flag |= IN_CHANGE | IN_MODIFIED;
if (vap->va_atime.tv_sec != VNOVAL) {
+   ip->i_flag &= ~IN_ACCESS;
ip->i_atime = vap->va_atime.tv_sec;
ip->i_atimensec = vap->va_atime.tv_nsec;
}
if (vap->va_mtime.tv_sec != VNOVAL) {
+   ip->i_flag &= ~IN_UPDATE;
ip->i_mtime = vap->va_mtime.tv_sec;
ip->i_mtimensec = vap->va_mtime.tv_nsec;
}
___
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: r295768 - head/usr.sbin/iostat

2016-02-19 Thread Alan Somers
On Fri, Feb 19, 2016 at 5:24 AM, Sergey Kandaurov  wrote:
> On 18 February 2016 at 23:08, Alan Somers  wrote:
>> 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
>
>> 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 },
>>  [...]
>
> You unlikely need this excessive explicit zeroization.
> In this case it is implicitly prezeroed.
>
> Consider these two cases:
>
> : #include 
> :
> : int main(void) {
> :   struct nlist namelist[2] = {{ .n_type = 0x42 }};
> :   return sizeof(namelist);
> : }
>
> (__TEXT,__text) section
> _main:
> pushq%rbp
> 0001movq%rsp, %rbp
> 0004leaq-0x30(%rbp), %rdx
> 0008movl$0x0, %eax
> 000dmovl$0x6, %ecx
> 0012movq%rdx, %rdi
> 0015rep
> 0016stosq
> 0018movb$0x42, -0x28(%rbp)
> 001cmovl$0x30, %eax
> 0021popq%rbp
> 0022retq
>
> rep stosq does zero 48 bytes, that is namelist[].
>
> Or, if it is static.
>
> : #include 
> :
> : int main(void) {
> :   static struct nlist namelist[2] = {{ .n_type = 0x42 }};
> :   return sizeof(namelist);
> : }
>
> (__DATA,__data) section
> 002000 00 00 00 00 00 00 00 42 00 00 00 00 00 00 00
> 003000 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
> 004000 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

Yeah, it was being implicitly zeroized before.  But Clang complained
about the structures being only partially initialized.  Since the
whole point of my commit was to increase the WARNS level, I explicitly
zeroed the zero fields to silence Clang.

-Alan
___
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: r295810 - head/sys/dev/firewire

2016-02-19 Thread Pedro F. Giffuni
Author: pfg
Date: Fri Feb 19 15:35:20 2016
New Revision: 295810
URL: https://svnweb.freebsd.org/changeset/base/295810

Log:
  firewire: fix a mismatch introduced in r230558.
  
  Found by: PVS Static Analysis
  Reviewed by:  sbruno
  MFC after:1 month

Modified:
  head/sys/dev/firewire/sbp_targ.c

Modified: head/sys/dev/firewire/sbp_targ.c
==
--- head/sys/dev/firewire/sbp_targ.cFri Feb 19 15:11:54 2016
(r295809)
+++ head/sys/dev/firewire/sbp_targ.cFri Feb 19 15:35:20 2016
(r295810)
@@ -1324,7 +1324,7 @@ sbp_targ_action1(struct cam_sim *sim, un
 | PIT_DISCONNECT
 | PIT_TERM_IO;
cpi->transport = XPORT_SPI; /* FIXME add XPORT_FW type to cam */
-   cpi->hba_misc = PIM_NOBUSRESET | PIM_NOBUSRESET;
+   cpi->hba_misc = PIM_NOBUSRESET | PIM_NO_6_BYTE;
cpi->hba_eng_cnt = 0;
cpi->max_target = 7; /* XXX */
cpi->max_lun = MAX_LUN - 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: r295809 - head/tools/build/mk

2016-02-19 Thread Ed Maste
Author: emaste
Date: Fri Feb 19 15:11:54 2016
New Revision: 295809
URL: https://svnweb.freebsd.org/changeset/base/295809

Log:
  Remove objcopy in WITHOUT_TOOLCHAIN if it's from elftoolchain

Modified:
  head/tools/build/mk/OptionalObsoleteFiles.inc

Modified: head/tools/build/mk/OptionalObsoleteFiles.inc
==
--- head/tools/build/mk/OptionalObsoleteFiles.inc   Fri Feb 19 14:15:31 
2016(r295808)
+++ head/tools/build/mk/OptionalObsoleteFiles.inc   Fri Feb 19 15:11:54 
2016(r295809)
@@ -7946,6 +7946,10 @@ OLD_FILES+=usr/share/man/man1/readelf.1.
 OLD_FILES+=usr/share/man/man1/size.1.gz
 OLD_FILES+=usr/share/man/man1/strings.1.gz
 OLD_FILES+=usr/share/man/man1/strip.1.gz
+.if ${MK_ELFCOPY_AS_OBJCOPY} != no
+OLD_FILES+=usr/bin/objcopy
+OLD_FILES+=usr/share/man/man1/objcopy.1.gz
+.endif
 .endif
 .if ${MK_TOOLCHAIN} == no || ${MK_ELFCOPY_AS_OBJCOPY} != no
 OLD_FILES+=usr/bin/elfcopy
___
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: r295808 - head/sys/arm/allwinner

2016-02-19 Thread Andrew Turner
Author: andrew
Date: Fri Feb 19 14:15:31 2016
New Revision: 295808
URL: https://svnweb.freebsd.org/changeset/base/295808

Log:
  Add initial support for the Allwinner A31i and A31s. This just adds the
  FDT platform code to detect when we are booting on one of these SoCs. The
  driver changes will be added shortly.
  
  Submitted by: Emmanuel Vadot 
  Differential Revision:https://reviews.freebsd.org/D5338

Modified:
  head/sys/arm/allwinner/allwinner_machdep.c
  head/sys/arm/allwinner/allwinner_machdep.h

Modified: head/sys/arm/allwinner/allwinner_machdep.c
==
--- head/sys/arm/allwinner/allwinner_machdep.c  Fri Feb 19 14:05:28 2016
(r295807)
+++ head/sys/arm/allwinner/allwinner_machdep.c  Fri Feb 19 14:15:31 2016
(r295808)
@@ -75,6 +75,23 @@ a20_attach(platform_t plat)
return (0);
 }
 
+static int
+a31_attach(platform_t plat)
+{
+   soc_type = ALLWINNERSOC_A31;
+   soc_family = ALLWINNERSOC_SUN6I;
+
+   return (0);
+}
+
+static int
+a31s_attach(platform_t plat)
+{
+   soc_type = ALLWINNERSOC_A31S;
+   soc_family = ALLWINNERSOC_SUN6I;
+
+   return (0);
+}
 
 static vm_offset_t
 allwinner_lastaddr(platform_t plat)
@@ -138,6 +155,22 @@ static platform_method_t a20_methods[] =
PLATFORMMETHOD_END,
 };
 
+static platform_method_t a31_methods[] = {
+   PLATFORMMETHOD(platform_attach, a31_attach),
+   PLATFORMMETHOD(platform_lastaddr,   allwinner_lastaddr),
+   PLATFORMMETHOD(platform_devmap_init,allwinner_devmap_init),
+
+   PLATFORMMETHOD_END,
+};
+
+static platform_method_t a31s_methods[] = {
+   PLATFORMMETHOD(platform_attach, a31s_attach),
+   PLATFORMMETHOD(platform_lastaddr,   allwinner_lastaddr),
+   PLATFORMMETHOD(platform_devmap_init,allwinner_devmap_init),
+
+   PLATFORMMETHOD_END,
+};
+
 u_int
 allwinner_soc_type(void)
 {
@@ -152,3 +185,5 @@ allwinner_soc_family(void)
 
 FDT_PLATFORM_DEF(a10, "a10", 0, "allwinner,sun4i-a10");
 FDT_PLATFORM_DEF(a20, "a20", 0, "allwinner,sun7i-a20");
+FDT_PLATFORM_DEF(a31, "a31", 0, "allwinner,sun6i-a31");
+FDT_PLATFORM_DEF(a31s, "a31s", 0, "allwinner,sun6i-a31s");

Modified: head/sys/arm/allwinner/allwinner_machdep.h
==
--- head/sys/arm/allwinner/allwinner_machdep.h  Fri Feb 19 14:05:28 2016
(r295807)
+++ head/sys/arm/allwinner/allwinner_machdep.h  Fri Feb 19 14:15:31 2016
(r295808)
@@ -34,9 +34,12 @@
 #defineALLWINNERSOC_A130x1300
 #defineALLWINNERSOC_A10S   0x1001
 #defineALLWINNERSOC_A200x2000
+#defineALLWINNERSOC_A310x3100
+#defineALLWINNERSOC_A31S   0x3101
 
 #defineALLWINNERSOC_SUN4I  0x4000
 #defineALLWINNERSOC_SUN5I  0x5000
+#defineALLWINNERSOC_SUN6I  0x6000
 #defineALLWINNERSOC_SUN7I  0x7000
 
 u_int allwinner_soc_type(void);
___
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: r295807 - head/sys/arm/mv

2016-02-19 Thread Andrew Turner
Author: andrew
Date: Fri Feb 19 14:05:28 2016
New Revision: 295807
URL: https://svnweb.freebsd.org/changeset/base/295807

Log:
  Include ofw_bus_subr.h before ofw_pci.h for the definition of struct
  ofw_bus_iinfo.
  
  Sponsored by: ABT Systems Ltd

Modified:
  head/sys/arm/mv/mv_pci.c

Modified: head/sys/arm/mv/mv_pci.c
==
--- head/sys/arm/mv/mv_pci.cFri Feb 19 14:01:35 2016(r295806)
+++ head/sys/arm/mv/mv_pci.cFri Feb 19 14:05:28 2016(r295807)
@@ -61,8 +61,8 @@ __FBSDID("$FreeBSD$");
 
 #include 
 #include 
-#include 
 #include 
+#include 
 #include 
 #include 
 #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: r295806 - head/usr.sbin/pciconf

2016-02-19 Thread Stefan Esser
Author: se
Date: Fri Feb 19 14:01:35 2016
New Revision: 295806
URL: https://svnweb.freebsd.org/changeset/base/295806

Log:
  Fix possible out-of-bounds access detected by Ulrich Spörleins "scan-build".
  Some invalid PCI device selectors could cause read access to an initialized
  variable next to the array (local loop index variable).
  
  While here, the parser has been made more strict with regard to the syntax
  of PCI device selectors as documented in the man-page. E.g. "pci:" used to
  be interpreted as "pci0:0".
  
  MFC after:3 days

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

Modified: head/usr.sbin/pciconf/pciconf.c
==
--- head/usr.sbin/pciconf/pciconf.c Fri Feb 19 11:25:18 2016
(r295805)
+++ head/usr.sbin/pciconf/pciconf.c Fri Feb 19 14:01:35 2016
(r295806)
@@ -897,7 +897,6 @@ static struct pcisel
 parsesel(const char *str)
 {
const char *ep;
-   const char *epbase;
char *eppos;
struct pcisel sel;
unsigned long selarr[4];
@@ -909,30 +908,27 @@ parsesel(const char *str)
else
ep = str;
 
-   epbase = ep;
-
if (strncmp(ep, "pci", 3) == 0) {
ep += 3;
i = 0;
-   do {
+   while (isdigit(*ep) && i < 4) {
selarr[i++] = strtoul(ep, , 10);
ep = eppos;
-   } while ((*ep == ':' || *ep == '.') && *++ep != '\0' && i < 4);
-
-   if (i > 2)
-   sel.pc_func = selarr[--i];
-   else
-   sel.pc_func = 0;
-   sel.pc_dev = selarr[--i];
-   sel.pc_bus = selarr[--i];
-   if (i > 0)
-   sel.pc_domain = selarr[--i];
-   else
-   sel.pc_domain = 0;
+   if (*ep == ':') {
+   ep++;
+   if (*ep  == '\0')
+   i = 0;
+   }
+   }
+   if (i > 0 && *ep == '\0') {
+   sel.pc_func = (i > 2) ? selarr[--i] : 0;
+   sel.pc_dev = (i > 0) ? selarr[--i] : 0;
+   sel.pc_bus = (i > 0) ? selarr[--i] : 0;
+   sel.pc_domain = (i > 0) ? selarr[--i] : 0;
+   return (sel);
+   }
}
-   if (*ep != '\x0' || ep == epbase)
-   errx(1, "cannot parse selector %s", str);
-   return sel;
+   errx(1, "cannot parse selector %s", str);
 }
 
 static struct pcisel
___
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: r295768 - head/usr.sbin/iostat

2016-02-19 Thread Sergey Kandaurov
On 18 February 2016 at 23:08, Alan Somers  wrote:
> 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

> 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 },
>  [...]

You unlikely need this excessive explicit zeroization.
In this case it is implicitly prezeroed.

Consider these two cases:

: #include 
:
: int main(void) {
:   struct nlist namelist[2] = {{ .n_type = 0x42 }};
:   return sizeof(namelist);
: }

(__TEXT,__text) section
_main:
pushq%rbp
0001movq%rsp, %rbp
0004leaq-0x30(%rbp), %rdx
0008movl$0x0, %eax
000dmovl$0x6, %ecx
0012movq%rdx, %rdi
0015rep
0016stosq
0018movb$0x42, -0x28(%rbp)
001cmovl$0x30, %eax
0021popq%rbp
0022retq

rep stosq does zero 48 bytes, that is namelist[].

Or, if it is static.

: #include 
:
: int main(void) {
:   static struct nlist namelist[2] = {{ .n_type = 0x42 }};
:   return sizeof(namelist);
: }

(__DATA,__data) section
002000 00 00 00 00 00 00 00 42 00 00 00 00 00 00 00
003000 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
004000 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

-- 
wbr,
pluknet
___
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: r295805 - head/sys/netinet

2016-02-19 Thread Michael Tuexen
Author: tuexen
Date: Fri Feb 19 11:25:18 2016
New Revision: 295805
URL: https://svnweb.freebsd.org/changeset/base/295805

Log:
  Use the SCTP level pointer, not the interface level.
  
  MFC after:3 days

Modified:
  head/sys/netinet/sctp_pcb.c

Modified: head/sys/netinet/sctp_pcb.c
==
--- head/sys/netinet/sctp_pcb.c Fri Feb 19 10:40:04 2016(r295804)
+++ head/sys/netinet/sctp_pcb.c Fri Feb 19 11:25:18 2016(r295805)
@@ -5432,7 +5432,7 @@ sctp_select_primary_destination(struct s
 
 
 /*
- * Delete the address from the endpoint local address list There is nothing
+ * Delete the address from the endpoint local address list. There is nothing
  * to be done if we are bound to all addresses
  */
 void
@@ -5483,8 +5483,7 @@ sctp_del_local_addr_ep(struct sctp_inpcb
 * to laddr
 */
TAILQ_FOREACH(net, >asoc.nets, sctp_next) {
-   if (net->ro._s_addr &&
-   (net->ro._s_addr->ifa == laddr->ifa)) {
+   if (net->ro._s_addr == laddr->ifa) {
/* Yep, purge src address selected */
sctp_rtentry_t *rt;
 
___
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: r295804 - head/sys/arm/arm

2016-02-19 Thread Svatopluk Kraus
Author: skra
Date: Fri Feb 19 10:40:04 2016
New Revision: 295804
URL: https://svnweb.freebsd.org/changeset/base/295804

Log:
  Remove not used static function pmap_kenter_attr().

Modified:
  head/sys/arm/arm/pmap-v6.c

Modified: head/sys/arm/arm/pmap-v6.c
==
--- head/sys/arm/arm/pmap-v6.c  Fri Feb 19 10:32:17 2016(r295803)
+++ head/sys/arm/arm/pmap-v6.c  Fri Feb 19 10:40:04 2016(r295804)
@@ -1267,13 +1267,6 @@ pmap_kenter_prot_attr(vm_offset_t va, vm
pte2_store(pte2p, PTE2_KERN(pa, prot, attr));
 }
 
-static __inline void
-pmap_kenter_attr(vm_offset_t va, vm_paddr_t pa, int attr)
-{
-
-   pmap_kenter_prot_attr(va, pa, PTE2_AP_KRW, attr);
-}
-
 PMAP_INLINE void
 pmap_kenter(vm_offset_t va, vm_paddr_t pa)
 {
___
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: r295803 - head/sys/arm/include

2016-02-19 Thread Svatopluk Kraus
Author: skra
Date: Fri Feb 19 10:32:17 2016
New Revision: 295803
URL: https://svnweb.freebsd.org/changeset/base/295803

Log:
  Remove not used definitions and fix some style nits.
  No functional changes.

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

Modified: head/sys/arm/include/pmap-v6.h
==
--- head/sys/arm/include/pmap-v6.h  Fri Feb 19 09:52:11 2016
(r295802)
+++ head/sys/arm/include/pmap-v6.h  Fri Feb 19 10:32:17 2016
(r295803)
@@ -88,21 +88,11 @@ typedef uint32_tttb_entry_t;/* TTB en
  */
 #define NKPT2PG32
 #endif
+#endif /* _KERNEL */
 
 /*
  * Pmap stuff
  */
-
-/*
- * This structure is used to hold a virtual<->physical address
- * association and is used mostly by bootstrap code
- */
-struct pv_addr {
-   SLIST_ENTRY(pv_addr) pv_list;
-   vm_offset_t pv_va;
-   vm_paddr_t  pv_pa;
-};
-#endif
 struct pv_entry;
 struct pv_chunk;
 
@@ -173,20 +163,18 @@ extern ttb_entry_t pmap_kern_ttb; /* TT
  * is called: pmap_kenter(), pmap_kextract(), pmap_kremove(), vtophys(), and
  * vtopte2().
  */
-void pmap_bootstrap(vm_offset_t );
-void pmap_kenter(vm_offset_t , vm_paddr_t );
+void pmap_bootstrap(vm_offset_t);
+void pmap_kenter(vm_offset_t, vm_paddr_t);
 void pmap_kremove(vm_offset_t);
 void *pmap_mapdev_attr(vm_paddr_t, vm_size_t, int);
-boolean_t pmap_page_is_mapped(vm_page_t );
-
-void pmap_tlb_flush(pmap_t , vm_offset_t );
-void pmap_tlb_flush_range(pmap_t , vm_offset_t , vm_size_t );
+boolean_t pmap_page_is_mapped(vm_page_t);
 
-void pmap_dcache_wb_range(vm_paddr_t , vm_size_t , vm_memattr_t );
+void pmap_tlb_flush(pmap_t, vm_offset_t);
+void pmap_tlb_flush_range(pmap_t, vm_offset_t, vm_size_t);
 
 vm_paddr_t pmap_dump_kextract(vm_offset_t, pt2_entry_t *);
 
-int pmap_fault(pmap_t , vm_offset_t , uint32_t , int , bool);
+int pmap_fault(pmap_t, vm_offset_t, uint32_t, int, bool);
 
 void pmap_set_tex(void);
 void reinit_mmu(ttb_entry_t ttb, u_int aux_clr, u_int aux_set);
@@ -194,11 +182,11 @@ void reinit_mmu(ttb_entry_t ttb, u_int a
 /*
  * Pre-bootstrap epoch functions set.
  */
-void pmap_bootstrap_prepare(vm_paddr_t );
-vm_paddr_t pmap_preboot_get_pages(u_int );
-void pmap_preboot_map_pages(vm_paddr_t , vm_offset_t , u_int );
-vm_offset_t pmap_preboot_reserve_pages(u_int );
-vm_offset_t pmap_preboot_get_vpages(u_int );
+void pmap_bootstrap_prepare(vm_paddr_t);
+vm_paddr_t pmap_preboot_get_pages(u_int);
+void pmap_preboot_map_pages(vm_paddr_t, vm_offset_t, u_int);
+vm_offset_t pmap_preboot_reserve_pages(u_int);
+vm_offset_t pmap_preboot_get_vpages(u_int);
 void pmap_preboot_map_attr(vm_paddr_t, vm_offset_t, vm_size_t, vm_prot_t,
 vm_memattr_t);
 
___
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: r295802 - head/sys/arm/include

2016-02-19 Thread Svatopluk Kraus
Author: skra
Date: Fri Feb 19 09:52:11 2016
New Revision: 295802
URL: https://svnweb.freebsd.org/changeset/base/295802

Log:
  Remove AP_KRW definition not needed after r295801.

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

Modified: head/sys/arm/include/pte-v6.h
==
--- head/sys/arm/include/pte-v6.h   Fri Feb 19 09:23:32 2016
(r295801)
+++ head/sys/arm/include/pte-v6.h   Fri Feb 19 09:52:11 2016
(r295802)
@@ -288,14 +288,4 @@
 #definePTE2_KERN(pa, ap, attr) PTE2(pa, (ap) | PTE2_A | 
PTE2_G, attr)
 #definePTE2_KERN_NG(pa, ap, attr)  PTE2(pa, (ap) | PTE2_A | 
PTE2_NG, attr)
 
-
-// - TO BE DELETED 
-
-
-/*
- * sys/arm/arm/elf_trampoline.c
- */
-#defineAP_KRW  0x01/* kernel read/write */
-
-// 
-
-
 #endif /* !_MACHINE_PTE_V6_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: r295801 - in head: lib/libkvm sys/arm/arm sys/arm/include

2016-02-19 Thread Svatopluk Kraus
Author: skra
Date: Fri Feb 19 09:23:32 2016
New Revision: 295801
URL: https://svnweb.freebsd.org/changeset/base/295801

Log:
  Rename pte.h to pte-v4.h and start including directly either pte-v4.h
  or pte-v6.h in files which needs it.
  
  There are quite internal definitions in pte-v4.h and pte-v6.h headers
  specific for corresponding pmap implementation. These headers should be
  included only in very few files and an intention is to not hide for
  which implementation such files are.
  
  Further, sys/arm/arm/elf_trampoline.c is an example of file which
  uses armv4 like pmap implementation for both armv4 and armv6 platforms.
  This is another reason why pte.h which includes specific header
  according to __ARM_ARCH is not created.

Added:
  head/sys/arm/include/pte-v4.h
 - copied, changed from r295800, head/sys/arm/include/pte.h
Deleted:
  head/sys/arm/include/pte.h
Modified:
  head/lib/libkvm/kvm_arm.h
  head/sys/arm/arm/elf_trampoline.c
  head/sys/arm/arm/locore-v4.S
  head/sys/arm/arm/locore-v6.S
  head/sys/arm/include/pmap-v4.h
  head/sys/arm/include/pte-v6.h

Modified: head/lib/libkvm/kvm_arm.h
==
--- head/lib/libkvm/kvm_arm.h   Fri Feb 19 08:42:13 2016(r295800)
+++ head/lib/libkvm/kvm_arm.h   Fri Feb 19 09:23:32 2016(r295801)
@@ -29,10 +29,6 @@
 #ifndef __KVM_ARM_H__
 #define__KVM_ARM_H__
 
-#ifdef __arm__
-#include 
-#endif
-
 typedef uint32_t   arm_physaddr_t;
 typedef uint32_t   arm_pd_entry_t;
 typedef uint32_t   arm_pt_entry_t;
@@ -75,6 +71,12 @@ typedef uint32_t arm_pt_entry_t;
 #ifdef __arm__
 #include 
 
+#if __ARM_ARCH >= 6
+#include 
+#else
+#include 
+#endif
+
 _Static_assert(PAGE_SHIFT == ARM_PAGE_SHIFT, "PAGE_SHIFT mismatch");
 _Static_assert(PAGE_SIZE == ARM_PAGE_SIZE, "PAGE_SIZE mismatch");
 _Static_assert(PAGE_MASK == ARM_PAGE_MASK, "PAGE_MASK mismatch");

Modified: head/sys/arm/arm/elf_trampoline.c
==
--- head/sys/arm/arm/elf_trampoline.c   Fri Feb 19 08:42:13 2016
(r295800)
+++ head/sys/arm/arm/elf_trampoline.c   Fri Feb 19 09:23:32 2016
(r295801)
@@ -36,7 +36,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
-#include 
+#include 
 #include 
 #include 
 

Modified: head/sys/arm/arm/locore-v4.S
==
--- head/sys/arm/arm/locore-v4.SFri Feb 19 08:42:13 2016
(r295800)
+++ head/sys/arm/arm/locore-v4.SFri Feb 19 09:23:32 2016
(r295801)
@@ -38,7 +38,7 @@
 #include 
 #include 
 #include 
-#include 
+#include 
 
 __FBSDID("$FreeBSD$");
 

Modified: head/sys/arm/arm/locore-v6.S
==
--- head/sys/arm/arm/locore-v6.SFri Feb 19 08:42:13 2016
(r295800)
+++ head/sys/arm/arm/locore-v6.SFri Feb 19 09:23:32 2016
(r295801)
@@ -36,7 +36,7 @@
 #include 
 #include 
 #include 
-#include 
+#include 
 
 __FBSDID("$FreeBSD$");
 

Modified: head/sys/arm/include/pmap-v4.h
==
--- head/sys/arm/include/pmap-v4.h  Fri Feb 19 08:42:13 2016
(r295800)
+++ head/sys/arm/include/pmap-v4.h  Fri Feb 19 09:23:32 2016
(r295801)
@@ -50,7 +50,7 @@
 #ifndef _MACHINE_PMAP_V4_H_
 #define _MACHINE_PMAP_V4_H_
 
-#include 
+#include 
 #include 
 /*
  * Pte related macros

Copied and modified: head/sys/arm/include/pte-v4.h (from r295800, 
head/sys/arm/include/pte.h)
==
--- head/sys/arm/include/pte.h  Fri Feb 19 08:42:13 2016(r295800, copy 
source)
+++ head/sys/arm/include/pte-v4.h   Fri Feb 19 09:23:32 2016
(r295801)
@@ -33,14 +33,9 @@
  *
  * $FreeBSD$
  */
-#include 
 
-#if __ARM_ARCH >= 6
-#include 
-#else /* __ARM_ARCH >= 6 */
-
-#ifndef _MACHINE_PTE_H_
-#define _MACHINE_PTE_H_
+#ifndef _MACHINE_PTE_V4_H_
+#define _MACHINE_PTE_V4_H_
 
 #ifndef LOCORE
 typedefuint32_tpd_entry_t; /* page directory entry 
*/
@@ -350,7 +345,6 @@ typedef pt_entry_t  pt2_entry_t;/* comp
  * 1 X 1 1 0   Y Y WT  Y   Y
  * 1 X 1 1 1   Y Y WT  Y   Y
  */
-#endif /* !_MACHINE_PTE_H_ */
-#endif /* __ARM_ARCH >= 6 */
+#endif /* !_MACHINE_PTE_V4_H_ */
 
 /* End of pte.h */

Modified: head/sys/arm/include/pte-v6.h
==
--- head/sys/arm/include/pte-v6.h   Fri Feb 19 08:42:13 2016
(r295800)
+++ head/sys/arm/include/pte-v6.h   Fri Feb 19 09:23:32 2016
(r295801)
@@ -27,8 +27,8 @@
  * $FreeBSD$
  */
 
-#ifndef _MACHINE_PTE_H_
-#define_MACHINE_PTE_H_
+#ifndef _MACHINE_PTE_V6_H_
+#define _MACHINE_PTE_V6_H_
 
 /*
  * 

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

2016-02-19 Thread Kubilay Kocak
On 19/02/2016 6:07 PM, Marcelo Araujo wrote:
> 
> 
> 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. .\. /_)
> 

Much love, thank you Marcelo!

Might help marking these as such in the original head commit to prevent
annoying people (me) from pinging about it :)

For example, I'm also interested in all the recent PVS fixes, none of
which were marked for MFC, but appear to be very good at least
stable/10,9 candidates, if not 10.3-R.

./koobs
___
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: r295800 - head/usr.bin/cap_mkdb

2016-02-19 Thread Stefan Esser
Author: se
Date: Fri Feb 19 08:42:13 2016
New Revision: 295800
URL: https://svnweb.freebsd.org/changeset/base/295800

Log:
  Remove O_SYNC from the options passed to dbmopen().
  
  The output file is created as a temporary file that is moved over the
  existing file after completion. Thus there is no need to immediately
  flush all created db records to the temporary file.
  
  This speeds up creation of the termcap db by a factor of 40 on my
  ZFS based /etc filesytem (from 25 seconds to 0.6 seconds).
  
  I have compared multiple output files created with and without O_SYNC
  and they came out identical each time.  Nonetheless it might be best
  to MFC this change and the similar one for services_mkdb (r295465) at
  the same time when the changes to hash.c in review D5186 are merged.
  
  MFC:   1 week

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

Modified: head/usr.bin/cap_mkdb/cap_mkdb.c
==
--- head/usr.bin/cap_mkdb/cap_mkdb.cFri Feb 19 08:41:47 2016
(r295799)
+++ head/usr.bin/cap_mkdb/cap_mkdb.cFri Feb 19 08:42:13 2016
(r295800)
@@ -119,7 +119,7 @@ main(int argc, char *argv[])
(void)snprintf(buf, sizeof(buf), "%s.db", capname ? capname : *argv);
if ((capname = strdup(buf)) == NULL)
errx(1, "strdup failed");
-   if ((capdbp = dbopen(capname, O_CREAT | O_TRUNC | O_RDWR | O_SYNC,
+   if ((capdbp = dbopen(capname, O_CREAT | O_TRUNC | O_RDWR,
DEFFILEMODE, DB_HASH, )) == NULL)
err(1, "%s", buf);
 
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r295799 - head/sys/arm/include

2016-02-19 Thread Svatopluk Kraus
Author: skra
Date: Fri Feb 19 08:41:47 2016
New Revision: 295799
URL: https://svnweb.freebsd.org/changeset/base/295799

Log:
  Move common definitions from both pmap-v4.h and pmap-v6.h into pmap.h.
  (1) MI interface needed for vm subsystem.
  (2) MD interface created for ARM architecture to be used in files
  shared by armv4 and armv6 platforms.

Modified:
  head/sys/arm/include/pmap-v4.h
  head/sys/arm/include/pmap-v6.h
  head/sys/arm/include/pmap.h

Modified: head/sys/arm/include/pmap-v4.h
==
--- head/sys/arm/include/pmap-v4.h  Fri Feb 19 08:35:29 2016
(r295798)
+++ head/sys/arm/include/pmap-v4.h  Fri Feb 19 08:41:47 2016
(r295799)
@@ -80,16 +80,8 @@ enum mem_type {
 #define PDESIZEsizeof(pd_entry_t)  /* for assembly files */
 #define PTESIZEsizeof(pt_entry_t)  /* for assembly files */
 
-#ifdef _KERNEL
-
-#define vtophys(va)pmap_kextract((vm_offset_t)(va))
-
-#endif
-
 #definepmap_page_get_memattr(m)((m)->md.pv_memattr)
-#definepmap_page_is_write_mapped(m)(((m)->aflags & PGA_WRITEABLE) 
!= 0)
 #definepmap_page_is_mapped(m)  (!TAILQ_EMPTY(&(m)->md.pv_list))
-void pmap_page_set_memattr(vm_page_t m, vm_memattr_t ma);
 
 /*
  * Pmap stuff
@@ -163,7 +155,6 @@ extern struct pmap  kernel_pmap_store;
 #definePMAP_UNLOCK(pmap)   mtx_unlock(&(pmap)->pm_mtx)
 #endif
 
-
 /*
  * For each vm_page_t, there is a list of all currently valid virtual
  * mappings of that page.  An entry is a pv_entry_t, the list is pv_list.
@@ -208,9 +199,6 @@ boolean_t pmap_get_pde_pte(pmap_t, vm_of
  */
 extern vm_offset_t pmap_curmaxkvaddr;
 
-struct pcb;
-
-void   pmap_set_pcb_pagedir(pmap_t, struct pcb *);
 /* Virtual address to page table entry */
 static __inline pt_entry_t *
 vtopte(vm_offset_t va)
@@ -223,23 +211,13 @@ vtopte(vm_offset_t va)
return (ptep);
 }
 
-extern vm_paddr_t phys_avail[];
-extern vm_offset_t virtual_avail;
-extern vm_offset_t virtual_end;
-
 void   pmap_bootstrap(vm_offset_t firstaddr, struct pv_addr *l1pt);
 intpmap_change_attr(vm_offset_t, vm_size_t, int);
 void   pmap_kenter(vm_offset_t va, vm_paddr_t pa);
 void   pmap_kenter_nocache(vm_offset_t va, vm_paddr_t pa);
-void   pmap_kenter_device(vm_offset_t, vm_size_t, vm_paddr_t);
-void   pmap_kremove_device(vm_offset_t, vm_size_t);
-void   *pmap_kenter_temporary(vm_paddr_t pa, int i);
 void   pmap_kenter_user(vm_offset_t va, vm_paddr_t pa);
-vm_paddr_t pmap_kextract(vm_offset_t va);
 vm_paddr_t pmap_dump_kextract(vm_offset_t, pt2_entry_t *);
 void   pmap_kremove(vm_offset_t);
-void   *pmap_mapdev(vm_offset_t, vm_size_t);
-void   pmap_unmapdev(vm_offset_t, vm_size_t);
 vm_page_t  pmap_use_pt(pmap_t, vm_offset_t);
 void   pmap_debug(int);
 void   pmap_map_section(vm_offset_t, vm_offset_t, vm_offset_t, int, int);
@@ -529,11 +507,8 @@ void   pmap_kenter_section(vm_offset_t, vm
 void   pmap_kenter_supersection(vm_offset_t, uint64_t, int flags);
 #endif
 
-extern char *_tmppt;
-
 void   pmap_postinit(void);
 
-extern vm_paddr_t dump_avail[];
 #endif /* _KERNEL */
 
 #endif /* !LOCORE */

Modified: head/sys/arm/include/pmap-v6.h
==
--- head/sys/arm/include/pmap-v6.h  Fri Feb 19 08:35:29 2016
(r295798)
+++ head/sys/arm/include/pmap-v6.h  Fri Feb 19 08:41:47 2016
(r295799)
@@ -89,12 +89,6 @@ typedef uint32_t ttb_entry_t;/* TTB en
 #define NKPT2PG32
 #endif
 
-extern vm_paddr_t phys_avail[];
-extern vm_paddr_t dump_avail[];
-extern char *_tmppt;  /* poor name! */
-extern vm_offset_t virtual_avail;
-extern vm_offset_t virtual_end;
-
 /*
  * Pmap stuff
  */
@@ -170,11 +164,9 @@ struct pv_chunk {
 };
 
 #ifdef _KERNEL
-struct pcb;
 extern ttb_entry_t pmap_kern_ttb;  /* TTB for kernel pmap */
 
 #definepmap_page_get_memattr(m)((m)->md.pat_mode)
-#definepmap_page_is_write_mapped(m)(((m)->aflags & PGA_WRITEABLE) 
!= 0)
 
 /*
  * Only the following functions or macros may be used before pmap_bootstrap()
@@ -183,27 +175,18 @@ extern ttb_entry_t pmap_kern_ttb; /* TT
  */
 void pmap_bootstrap(vm_offset_t );
 void pmap_kenter(vm_offset_t , vm_paddr_t );
-void *pmap_kenter_temporary(vm_paddr_t , int );
 void pmap_kremove(vm_offset_t);
-void *pmap_mapdev(vm_paddr_t, vm_size_t);
 void *pmap_mapdev_attr(vm_paddr_t, vm_size_t, int);
 boolean_t pmap_page_is_mapped(vm_page_t );
-void pmap_page_set_memattr(vm_page_t , vm_memattr_t );
-void pmap_unmapdev(vm_offset_t, vm_size_t);
-void pmap_kenter_device(vm_offset_t, vm_size_t, vm_paddr_t);
-void pmap_kremove_device(vm_offset_t, vm_size_t);
-void pmap_set_pcb_pagedir(pmap_t , struct pcb *);
 
 void pmap_tlb_flush(pmap_t , vm_offset_t );
 void pmap_tlb_flush_range(pmap_t , vm_offset_t , vm_size_t );
 
 void pmap_dcache_wb_range(vm_paddr_t , vm_size_t 

svn commit: r295798 - head/sys/arm/include

2016-02-19 Thread Svatopluk Kraus
Author: skra
Date: Fri Feb 19 08:35:29 2016
New Revision: 295798
URL: https://svnweb.freebsd.org/changeset/base/295798

Log:
  Rename pmap.h to pmap-v4.h and remove pmap-v6.h include from it.
  Create new pmap.h which includes specific header according to
  __ARM_ARCH.
  
  Note that  is included from  so one common
   must exist.

Added:
  head/sys/arm/include/pmap-v4.h
 - copied, changed from r295797, head/sys/arm/include/pmap.h
Replaced:
  head/sys/arm/include/pmap.h   (contents, props changed)
Modified:
  head/sys/arm/include/pmap-v6.h

Copied and modified: head/sys/arm/include/pmap-v4.h (from r295797, 
head/sys/arm/include/pmap.h)
==
--- head/sys/arm/include/pmap.h Fri Feb 19 06:50:00 2016(r295797, copy 
source)
+++ head/sys/arm/include/pmap-v4.h  Fri Feb 19 08:35:29 2016
(r295798)
@@ -46,14 +46,9 @@
  *
  * $FreeBSD$
  */
- #include 
 
-#if __ARM_ARCH >= 6
-#include 
-#else /* __ARM_ARCH >= 6 */
-
-#ifndef _MACHINE_PMAP_H_
-#define _MACHINE_PMAP_H_
+#ifndef _MACHINE_PMAP_V4_H_
+#define _MACHINE_PMAP_V4_H_
 
 #include 
 #include 
@@ -543,5 +538,4 @@ extern vm_paddr_t dump_avail[];
 
 #endif /* !LOCORE */
 
-#endif /* !_MACHINE_PMAP_H_ */
-#endif /* __ARM_ARCH >= 6 */
+#endif /* !_MACHINE_PMAP_V4_H_ */

Modified: head/sys/arm/include/pmap-v6.h
==
--- head/sys/arm/include/pmap-v6.h  Fri Feb 19 06:50:00 2016
(r295797)
+++ head/sys/arm/include/pmap-v6.h  Fri Feb 19 08:35:29 2016
(r295798)
@@ -45,8 +45,8 @@
  * $FreeBSD$
  */
 
-#ifndef _MACHINE_PMAP_H_
-#define _MACHINE_PMAP_H_
+#ifndef _MACHINE_PMAP_V6_H_
+#define _MACHINE_PMAP_V6_H_
 
 #include 
 #include 
@@ -220,4 +220,4 @@ void pmap_preboot_map_attr(vm_paddr_t, v
 vm_memattr_t);
 
 #endif /* _KERNEL */
-#endif /* !_MACHINE_PMAP_H_ */
+#endif /* !_MACHINE_PMAP_V6_H_ */

Added: head/sys/arm/include/pmap.h
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/sys/arm/include/pmap.h Fri Feb 19 08:35:29 2016(r295798)
@@ -0,0 +1,41 @@
+/*-
+ * Copyright (c) 2016 Svatopluk Kraus
+ * Copyright (c) 2016 Michal Meloun
+ * 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.
+ *
+ * $FreeBSD$
+ */
+
+#ifndef _MACHINE_PMAP_H_
+#define _MACHINE_PMAP_H_
+
+#include 
+
+#if __ARM_ARCH >= 6
+#include 
+#else
+#include 
+#endif
+
+#endif /* !_MACHINE_PMAP_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"