svn commit: r303737 - head/sys/dev/hyperv/storvsc

2016-08-03 Thread Sepherosa Ziehau
Author: sephe
Date: Thu Aug  4 05:05:35 2016
New Revision: 303737
URL: https://svnweb.freebsd.org/changeset/base/303737

Log:
  hyperv/storvsc: Claim SPC-3 conformance, thus enable UNMAP support
  
  The Hyper-V on pre-win10 systems will only report SPC-2 conformance,
  but it actually conforms to SPC-3.  The INQUIRY response is adjusted
  to propagate the SPC-3 version information to CAM.
  
  Submitted by: Hongjiang Zhang 
  MFC after:3 days
  Sponsored by: Microsoft
  Differential Revision:https://reviews.freebsd.org/D7405

Modified:
  head/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c

Modified: head/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c
==
--- head/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.cThu Aug  4 
01:49:18 2016(r303736)
+++ head/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.cThu Aug  4 
05:05:35 2016(r303737)
@@ -2124,8 +2124,8 @@ storvsc_io_done(struct hv_storvsc_reques
 * For more information about INQUIRY, please refer to:
 *  
ftp://ftp.avc-pioneer.com/Mtfuji_7/Proposal/Jun09/INQUIRY.pdf
 */
-   const struct scsi_inquiry_data *inq_data =
-   (const struct scsi_inquiry_data *)csio->data_ptr;
+   struct scsi_inquiry_data *inq_data =
+   (struct scsi_inquiry_data *)csio->data_ptr;
uint8_t* resp_buf = (uint8_t*)csio->data_ptr;
/* Get the buffer length reported by host */
int resp_xfer_len = vm_srb->transfer_len;
@@ -2154,6 +2154,25 @@ storvsc_io_done(struct hv_storvsc_reques
mtx_unlock(>hs_lock);
}
} else {
+   char vendor[16];
+   cam_strvis(vendor, inq_data->vendor, 
sizeof(inq_data->vendor),
+   sizeof(vendor));
+   /**
+* XXX: upgrade SPC2 to SPC3 if host is WIN8 or WIN2012 
R2
+* in order to support UNMAP feature
+*/
+   if (!strncmp(vendor,"Msft",4) &&
+SID_ANSI_REV(inq_data) == SCSI_REV_SPC2 &&
+(vmstor_proto_version == 
VMSTOR_PROTOCOL_VERSION_WIN8_1 ||
+   vmstor_proto_version== 
VMSTOR_PROTOCOL_VERSION_WIN8)) {
+   inq_data->version = SCSI_REV_SPC3;
+   if (bootverbose) {
+   mtx_lock(>hs_lock);
+   xpt_print(ccb->ccb_h.path,
+   "storvsc upgrades SPC2 to 
SPC3\n");
+   mtx_unlock(>hs_lock);
+   }
+   }
ccb->ccb_h.status |= CAM_REQ_CMP;
if (bootverbose) {
mtx_lock(>hs_lock);
___
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: r303733 - head/contrib/libpcap

2016-08-03 Thread Bruce Evans

On Wed, 3 Aug 2016, Jung-uk Kim wrote:


Log:
 Support nanosecond time stamps for pcap_dispatch(3) and pcap_loop(3).

Modified:
 head/contrib/libpcap/pcap-bpf.c

Modified: head/contrib/libpcap/pcap-bpf.c
==
--- head/contrib/libpcap/pcap-bpf.c Wed Aug  3 19:23:22 2016
(r303732)
+++ head/contrib/libpcap/pcap-bpf.c Wed Aug  3 20:08:39 2016
(r303733)
@@ -1008,7 +1028,25 @@ pcap_read_bpf(pcap_t *p, int cnt, pcap_h
if (pb->filtering_in_kernel ||
bpf_filter(p->fcode.bf_insns, datap, bhp->bh_datalen, 
caplen)) {
struct pcap_pkthdr pkthdr;
+#ifdef BIOCSTSTAMP
+   struct bintime bt;
+
+   bt.sec = bhp->bh_tstamp.bt_sec;
+   bt.frac = bhp->bh_tstamp.bt_frac;


The names are very confusing since bt_sec and bt_frac are only misnamed as
sec and frac in struct bintime.


+   if (p->opt.tstamp_precision == 
PCAP_TSTAMP_PRECISION_NANO) {
+   struct timespec ts;
+
+   bintime2timespec(, );
+   pkthdr.ts.tv_sec = ts.tv_sec;
+   pkthdr.ts.tv_usec = ts.tv_nsec;


And this abuses tv_usec to hold nanoseconds.

Old code is even more confusing, and at least partly wrong.

X contrib/libpcap/pcap-bpf.c:   pkthdr.ts.tv_usec = 
bhp->bh_tstamp.tv_usec/1000;

This is to convert for tv_usec actually being tv_nsec on AIX.  If the above
works with no conversion, then it might work for AIX too.

X sys/net/bpf.c:struct timeval32 bh_tstamp; /* time stamp */

Banal comment.  The complexities are from what sort of timestamp this is.
It is obviously a timestamp.

This bh_tstamp is in struct bpf_hdr32 for the !BURN_BRIDGES case.  There
is also struct timeval bh_timestamp in struct bpf_hdr.  This header is
bogusly marked Obsolete.

X sys/net/bpf.c:hdr32_old.bh_tstamp.tv_usec = 
ts.bt_frac;

This is in the !BURN_BRIDGES && COMPAT_FREEBSD32 case.  Since struct timeval32
always has a 32-bit tv_usec, this assignment discards the most significant
bits in bt_frac but keeps the noise.

X sys/net/bpf.c:hdr_old.bh_tstamp.tv_usec = ts.bt_frac;

This is in the !BURN_BRIDGES && !COMPAT_FREEBSD32 case.  Since tv_sec in a
normal timetamp is bogusly long, this accidentally preserves all of the bits
in bt_frac on 64-bit arches.  On 32-bit arches, it loses the signal as for
the COMPAT_FREEBSD32 case.

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"


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

2016-08-03 Thread Adrian Chadd
Author: adrian
Date: Thu Aug  4 01:49:18 2016
New Revision: 303736
URL: https://svnweb.freebsd.org/changeset/base/303736

Log:
  Add in tap/tun for openvpn-on-mips experiments.
  
  (FWIW, it does work.)

Modified:
  head/sys/mips/conf/std.AR933X

Modified: head/sys/mips/conf/std.AR933X
==
--- head/sys/mips/conf/std.AR933X   Wed Aug  3 22:08:07 2016
(r303735)
+++ head/sys/mips/conf/std.AR933X   Thu Aug  4 01:49:18 2016
(r303736)
@@ -20,7 +20,7 @@ files "../atheros/files.ar71xx"
 hints  "AR933X_BASE.hints"
 
 makeoptionsDEBUG=-g#Build kernel with gdb(1) debug symbols
-makeoptionsMODULES_OVERRIDE="gpio ar71xx if_gif if_vlan if_gre if_bridge 
bridgestp usb wlan wlan_xauth wlan_acl wlan_wep wlan_tkip wlan_ccmp 
wlan_rssadapt wlan_amrr hwpmc ipfw ipfw_nat libalias ipfw_nptv6 urtwn urtwnfw 
otus otusfw"
+makeoptionsMODULES_OVERRIDE="gpio ar71xx if_gif if_vlan if_gre if_tap 
if_tun if_bridge bridgestp usb wlan wlan_xauth wlan_acl wlan_wep wlan_tkip 
wlan_ccmp wlan_rssadapt wlan_amrr hwpmc ipfw ipfw_nat libalias ipfw_nptv6 urtwn 
urtwnfw otus otusfw"
 
 optionsDDB
 optionsKDB
___
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: r303735 - head/usr.bin/indent

2016-08-03 Thread Pedro F. Giffuni
Author: pfg
Date: Wed Aug  3 22:08:07 2016
New Revision: 303735
URL: https://svnweb.freebsd.org/changeset/base/303735

Log:
  indent(1): add new -sac and -U options.
  
  Add -sac (space after cast) and -nsac options.
  These control whether space character is put after a cast operator or not.
  Default is -nsac.
  
  Add -U option for providing a file containing list of types.
  This is needed for properly deciding which asterisks denote unary
  operation and which denote binary.
  
  These come from PostgreSQL.
  
  Reference:
  
https://github.com/pstef/freebsd_indent/commit/84b00e3d46dfd6d955b2f481a1f3b275de9ad6d1
  
https://github.com/pstef/freebsd_indent/commit/49c52cf383fa2a246a1a22c6640a5a21b0f1fd90
  
  Differential Revision: https://reviews.freebsd.org/D6966  (Partial)
  Submitted by: Piotr Stefaniak

Modified:
  head/usr.bin/indent/args.c
  head/usr.bin/indent/indent.1
  head/usr.bin/indent/indent.c
  head/usr.bin/indent/indent_globs.h
  head/usr.bin/indent/lexi.c

Modified: head/usr.bin/indent/args.c
==
--- head/usr.bin/indent/args.c  Wed Aug  3 20:21:58 2016(r303734)
+++ head/usr.bin/indent/args.c  Wed Aug  3 22:08:07 2016(r303735)
@@ -74,8 +74,12 @@ __FBSDID("$FreeBSD$");
 
 static void scan_profile(FILE *);
 
+#defineKEY_FILE5   /* only used for args */
+
 const char *option_source = "?";
 
+void add_typedefs_from_file(const char *str);
+
 /*
  * N.B.: because of the way the table here is scanned, options whose names are
  * substrings of other options must occur later; that is, with -lp vs -l, -lp
@@ -91,6 +95,7 @@ struct pro {
 }   pro[] = {
 
 {"T", PRO_SPECIAL, 0, KEY, 0},
+{"U", PRO_SPECIAL, 0, KEY_FILE, 0},
 {"bacc", PRO_BOOL, false, ON, _around_conditional_compilation},
 {"badp", PRO_BOOL, false, ON, _after_declarations_at_proctop},
 {"bad", PRO_BOOL, false, ON, _after_declarations},
@@ -147,6 +152,7 @@ struct pro {
 {"npro", PRO_SPECIAL, 0, IGN, 0},
 {"npsl", PRO_BOOL, true, OFF, _start_line},
 {"nps", PRO_BOOL, false, OFF, _as_binop},
+{"nsac", PRO_BOOL, false, OFF, _after_cast},
 {"nsc", PRO_BOOL, true, OFF, _comment_cont},
 {"nsob", PRO_BOOL, false, OFF, _optional_blanklines},
 {"nut", PRO_BOOL, true, OFF, _tabs},
@@ -154,6 +160,7 @@ struct pro {
 {"pcs", PRO_BOOL, false, ON, _calls_space},
 {"psl", PRO_BOOL, true, ON, _start_line},
 {"ps", PRO_BOOL, false, ON, _as_binop},
+{"sac", PRO_BOOL, false, ON, _after_cast},
 {"sc", PRO_BOOL, true, ON, _comment_cont},
 {"sob", PRO_BOOL, false, ON, _optional_blanklines},
 {"st", PRO_SPECIAL, 0, STDIN, 0},
@@ -295,6 +302,12 @@ found:
}
break;
 
+   case KEY_FILE:
+   if (*param_start == 0)
+   goto need_param;
+   add_typedefs_from_file(param_start);
+   break;
+
default:
errx(1, "set_option: internal error: p_special %d", p->p_special);
}
@@ -323,3 +336,21 @@ found:
errx(1, "set_option: internal error: p_type %d", p->p_type);
 }
 }
+
+void
+add_typedefs_from_file(const char *str)
+{
+FILE *file;
+char line[BUFSIZ];
+
+if ((file = fopen(str, "r")) == NULL) {
+   fprintf(stderr, "indent: cannot open file %s\n", str);
+   exit(1);
+}
+while ((fgets(line, BUFSIZ, file)) != NULL) {
+   /* Remove trailing whitespace */
+   *(line + strcspn(line, " \t\n\r")) = '\0';
+   addkey(strdup(line), 4);
+}
+fclose(file);
+}

Modified: head/usr.bin/indent/indent.1
==
--- head/usr.bin/indent/indent.1Wed Aug  3 20:21:58 2016
(r303734)
+++ head/usr.bin/indent/indent.1Wed Aug  3 22:08:07 2016
(r303735)
@@ -30,7 +30,7 @@
 .\"@(#)indent.18.1 (Berkeley) 7/1/93
 .\" $FreeBSD$
 .\"
-.Dd March 3, 2012
+.Dd August 3, 2016
 .Dt INDENT 1
 .Os
 .Sh NAME
@@ -74,6 +74,7 @@
 .Op Fl npro
 .Op Fl pcs | Fl npcs
 .Op Fl psl | Fl npsl
+.Op Fl sac | Fl nsac
 .Op Fl \ | Fl nsc
 .Bk -words
 .Op Fl sob | Fl nsob
@@ -81,6 +82,7 @@
 .Op Fl \
 .Op Fl \
 .Op Fl troff
+.Op Fl U Ns Ar file
 .Op Fl ut | Fl nut
 .Op Fl v | Fl \
 .Sh DESCRIPTION
@@ -378,6 +380,11 @@ column 1 \- their types, if any, will be
 The
 default is
 .Fl psl .
+.It Fl sac , nsac
+Control whether parenthesized type names in casts are followed by a space or
+not.
+The default is
+.Fl nsac .
 .It Fl \ , nsc
 Enables (disables) the placement of asterisks (`*'s) at the left edge of all
 comments.
@@ -430,6 +437,10 @@ listing in much the same spirit as
 .Xr vgrind 1 .
 If the output file is not specified, the default is standard output,
 rather than formatting in place.
+.It Fl U Ns Ar file
+Adds type names from
+.Ar file
+to the list of type keywords.
 .It Fl ut , nut
 Enables (disables) the use of tab characters in the output.
 Tabs are assumed to be aligned 

svn commit: r303734 - head/contrib/libpcap

2016-08-03 Thread Jung-uk Kim
Author: jkim
Date: Wed Aug  3 20:21:58 2016
New Revision: 303734
URL: https://svnweb.freebsd.org/changeset/base/303734

Log:
  Fix a style(9) bug.

Modified:
  head/contrib/libpcap/pcap-bpf.c

Modified: head/contrib/libpcap/pcap-bpf.c
==
--- head/contrib/libpcap/pcap-bpf.c Wed Aug  3 20:08:39 2016
(r303733)
+++ head/contrib/libpcap/pcap-bpf.c Wed Aug  3 20:21:58 2016
(r303734)
@@ -442,7 +442,7 @@ pcap_create_interface(const char *device
snprintf(ebuf, PCAP_ERRBUF_SIZE, "malloc: %s",
pcap_strerror(errno));
free(p);
-   return NULL;
+   return (NULL);
}
p->tstamp_precision_list[0] = PCAP_TSTAMP_PRECISION_MICRO;
p->tstamp_precision_list[1] = PCAP_TSTAMP_PRECISION_NANO;
___
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: r303733 - head/contrib/libpcap

2016-08-03 Thread Jung-uk Kim
On 08/03/16 04:08 PM, Jung-uk Kim wrote:
> Author: jkim
> Date: Wed Aug  3 20:08:39 2016
> New Revision: 303733
> URL: https://svnweb.freebsd.org/changeset/base/303733
> 
> Log:
>   Support nanosecond time stamps for pcap_dispatch(3) and pcap_loop(3).
>
> Modified:
>   head/contrib/libpcap/pcap-bpf.c

Note the upstream accepted the patch:

https://github.com/the-tcpdump-group/libpcap/commit/0957dac

Jung-uk Kim



signature.asc
Description: OpenPGP digital signature


svn commit: r303733 - head/contrib/libpcap

2016-08-03 Thread Jung-uk Kim
Author: jkim
Date: Wed Aug  3 20:08:39 2016
New Revision: 303733
URL: https://svnweb.freebsd.org/changeset/base/303733

Log:
  Support nanosecond time stamps for pcap_dispatch(3) and pcap_loop(3).

Modified:
  head/contrib/libpcap/pcap-bpf.c

Modified: head/contrib/libpcap/pcap-bpf.c
==
--- head/contrib/libpcap/pcap-bpf.c Wed Aug  3 19:23:22 2016
(r303732)
+++ head/contrib/libpcap/pcap-bpf.c Wed Aug  3 20:08:39 2016
(r303733)
@@ -431,6 +431,22 @@ pcap_create_interface(const char *device
 
p->activate_op = pcap_activate_bpf;
p->can_set_rfmon_op = pcap_can_set_rfmon_bpf;
+#ifdef BIOCSTSTAMP
+   /*
+* We claim that we support microsecond and nanosecond time
+* stamps.
+*/
+   p->tstamp_precision_count = 2;
+   p->tstamp_precision_list = malloc(2 * sizeof(u_int));
+   if (p->tstamp_precision_list == NULL) {
+   snprintf(ebuf, PCAP_ERRBUF_SIZE, "malloc: %s",
+   pcap_strerror(errno));
+   free(p);
+   return NULL;
+   }
+   p->tstamp_precision_list[0] = PCAP_TSTAMP_PRECISION_MICRO;
+   p->tstamp_precision_list[1] = PCAP_TSTAMP_PRECISION_NANO;
+#endif /* BIOCSTSTAMP */
return (p);
 }
 
@@ -946,7 +962,11 @@ pcap_read_bpf(pcap_t *p, int cnt, pcap_h
/*
 * Loop through each packet.
 */
+#ifdef BIOCSTSTAMP
+#define bhp ((struct bpf_xhdr *)bp)
+#else
 #define bhp ((struct bpf_hdr *)bp)
+#endif
ep = bp + cc;
 #ifdef PCAP_FDDIPAD
pad = p->fddipad;
@@ -1008,7 +1028,25 @@ pcap_read_bpf(pcap_t *p, int cnt, pcap_h
if (pb->filtering_in_kernel ||
bpf_filter(p->fcode.bf_insns, datap, bhp->bh_datalen, 
caplen)) {
struct pcap_pkthdr pkthdr;
+#ifdef BIOCSTSTAMP
+   struct bintime bt;
+
+   bt.sec = bhp->bh_tstamp.bt_sec;
+   bt.frac = bhp->bh_tstamp.bt_frac;
+   if (p->opt.tstamp_precision == 
PCAP_TSTAMP_PRECISION_NANO) {
+   struct timespec ts;
+
+   bintime2timespec(, );
+   pkthdr.ts.tv_sec = ts.tv_sec;
+   pkthdr.ts.tv_usec = ts.tv_nsec;
+   } else {
+   struct timeval tv;
 
+   bintime2timeval(, );
+   pkthdr.ts.tv_sec = tv.tv_sec;
+   pkthdr.ts.tv_usec = tv.tv_usec;
+   }
+#else
pkthdr.ts.tv_sec = bhp->bh_tstamp.tv_sec;
 #ifdef _AIX
/*
@@ -1019,6 +1057,7 @@ pcap_read_bpf(pcap_t *p, int cnt, pcap_h
 #else
pkthdr.ts.tv_usec = bhp->bh_tstamp.tv_usec;
 #endif
+#endif /* BIOCSTSTAMP */
 #ifdef PCAP_FDDIPAD
if (caplen > pad)
pkthdr.caplen = caplen - pad;
@@ -2192,6 +2231,16 @@ pcap_activate_bpf(pcap_t *p)
}
}
 
+#ifdef BIOCSTSTAMP
+   v = BPF_T_BINTIME;
+   if (ioctl(p->fd, BIOCSTSTAMP, ) < 0) {
+   snprintf(p->errbuf, PCAP_ERRBUF_SIZE, "BIOCSTSTAMP: %s",
+   pcap_strerror(errno));
+   status = PCAP_ERROR;
+   goto bad;
+   }
+#endif /* BIOCSTSTAMP */
+
if (ioctl(fd, BIOCGBLEN, (caddr_t)) < 0) {
snprintf(p->errbuf, PCAP_ERRBUF_SIZE, "BIOCGBLEN: %s",
pcap_strerror(errno));
___
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: r303732 - head/sys/mips/conf

2016-08-03 Thread Adrian Chadd
Author: adrian
Date: Wed Aug  3 19:23:22 2016
New Revision: 303732
URL: https://svnweb.freebsd.org/changeset/base/303732

Log:
  [ar934x] shuffle AR93XX_BASE -> std.AR934X

Added:
  head/sys/mips/conf/std.AR934X
 - copied, changed from r303731, head/sys/mips/conf/AR934X_BASE
Deleted:
  head/sys/mips/conf/AR934X_BASE
Modified:
  head/sys/mips/conf/DB120
  head/sys/mips/conf/DIR-825C1
  head/sys/mips/conf/TL-WDR4300

Modified: head/sys/mips/conf/DB120
==
--- head/sys/mips/conf/DB120Wed Aug  3 19:18:53 2016(r303731)
+++ head/sys/mips/conf/DB120Wed Aug  3 19:23:22 2016(r303732)
@@ -5,7 +5,7 @@
 #
 
 # Include the default AR934x parameters
-include "AR934X_BASE"
+include "std.AR934X"
 
 #NO_UNIVERSE
 

Modified: head/sys/mips/conf/DIR-825C1
==
--- head/sys/mips/conf/DIR-825C1Wed Aug  3 19:18:53 2016
(r303731)
+++ head/sys/mips/conf/DIR-825C1Wed Aug  3 19:23:22 2016
(r303732)
@@ -15,7 +15,7 @@
 #NO_UNIVERSE
 
 # Include the default AR934x parameters
-include "AR934X_BASE"
+include "std.AR934X"
 ident   DIR825C1
 
 # Override hints with board values

Modified: head/sys/mips/conf/TL-WDR4300
==
--- head/sys/mips/conf/TL-WDR4300   Wed Aug  3 19:18:53 2016
(r303731)
+++ head/sys/mips/conf/TL-WDR4300   Wed Aug  3 19:23:22 2016
(r303732)
@@ -7,7 +7,7 @@
 #NO_UNIVERSE
 
 # Include the default AR934x parameters
-include "AR934X_BASE"
+include "std.AR934X"
 
 ident   TL-WDR4300
 

Copied and modified: head/sys/mips/conf/std.AR934X (from r303731, 
head/sys/mips/conf/AR934X_BASE)
==
--- head/sys/mips/conf/AR934X_BASE  Wed Aug  3 19:18:53 2016
(r303731, copy source)
+++ head/sys/mips/conf/std.AR934X   Wed Aug  3 19:23:22 2016
(r303732)
@@ -11,7 +11,7 @@
 #
 
 machine mips mips
-ident  AR934X_BASE
+#ident std.AR934X
 cpuCPU_MIPS74K
 makeoptionsKERNLOADADDR=0x8005
 optionsHZ=1000
___
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: r303731 - head/sys/mips/conf

2016-08-03 Thread Adrian Chadd
Author: adrian
Date: Wed Aug  3 19:18:53 2016
New Revision: 303731
URL: https://svnweb.freebsd.org/changeset/base/303731

Log:
  [ar9330] ok, fine, I'll finally undo the 2011-era mistake of _BASE config 
files.
  
  Repeated prodding by: imp

Added:
  head/sys/mips/conf/std.AR933X
 - copied, changed from r303730, head/sys/mips/conf/AR933X_BASE
Deleted:
  head/sys/mips/conf/AR933X_BASE
Modified:
  head/sys/mips/conf/ALFA_HORNET_UB
  head/sys/mips/conf/AP121
  head/sys/mips/conf/CARAMBOLA2
  head/sys/mips/conf/ONIONOMEGA
  head/sys/mips/conf/TL-WR740Nv4
  head/sys/mips/conf/TP-MR3020

Modified: head/sys/mips/conf/ALFA_HORNET_UB
==
--- head/sys/mips/conf/ALFA_HORNET_UB   Wed Aug  3 19:13:09 2016
(r303730)
+++ head/sys/mips/conf/ALFA_HORNET_UB   Wed Aug  3 19:18:53 2016
(r303731)
@@ -18,7 +18,7 @@
 #NO_UNIVERSE
 
 # Include the default AR933x parameters
-include "AR933X_BASE"
+include "std.AR933X"
 
 ident   ALFA_HORNET_UB
 

Modified: head/sys/mips/conf/AP121
==
--- head/sys/mips/conf/AP121Wed Aug  3 19:13:09 2016(r303730)
+++ head/sys/mips/conf/AP121Wed Aug  3 19:18:53 2016(r303731)
@@ -12,7 +12,7 @@
 #NO_UNIVERSE
 
 # Include the default AR933x parameters
-include "AR933X_BASE"
+include "std.AR933X"
 
 ident   AP121
 

Modified: head/sys/mips/conf/CARAMBOLA2
==
--- head/sys/mips/conf/CARAMBOLA2   Wed Aug  3 19:13:09 2016
(r303730)
+++ head/sys/mips/conf/CARAMBOLA2   Wed Aug  3 19:18:53 2016
(r303731)
@@ -14,7 +14,7 @@
 #NO_UNIVERSE
 
 # Include the default AR933x parameters
-include "AR933X_BASE"
+include "std.AR933X"
 
 ident   CARAMBOLA2
 

Modified: head/sys/mips/conf/ONIONOMEGA
==
--- head/sys/mips/conf/ONIONOMEGA   Wed Aug  3 19:13:09 2016
(r303730)
+++ head/sys/mips/conf/ONIONOMEGA   Wed Aug  3 19:18:53 2016
(r303731)
@@ -14,7 +14,7 @@
 #NO_UNIVERSE
 
 # Include the default AR933x parameters
-include "AR933X_BASE"
+include "std.AR933X"
 
 ident   ONIONOMEGA
 

Modified: head/sys/mips/conf/TL-WR740Nv4
==
--- head/sys/mips/conf/TL-WR740Nv4  Wed Aug  3 19:13:09 2016
(r303730)
+++ head/sys/mips/conf/TL-WR740Nv4  Wed Aug  3 19:18:53 2016
(r303731)
@@ -12,7 +12,7 @@
 #NO_UNIVERSE
 
 # Include the default AR933x parameters
-include "AR933X_BASE"
+include "std.AR933X"
 
 ident   TL-WR740Nv4
 

Modified: head/sys/mips/conf/TP-MR3020
==
--- head/sys/mips/conf/TP-MR3020Wed Aug  3 19:13:09 2016
(r303730)
+++ head/sys/mips/conf/TP-MR3020Wed Aug  3 19:18:53 2016
(r303731)
@@ -19,7 +19,7 @@
 #NO_UNIVERSE
 
 # Include the default AR933x parameters
-include"AR933X_BASE"
+include"std.AR933X"
 
 ident  TP-MR3020
 

Copied and modified: head/sys/mips/conf/std.AR933X (from r303730, 
head/sys/mips/conf/AR933X_BASE)
==
--- head/sys/mips/conf/AR933X_BASE  Wed Aug  3 19:13:09 2016
(r303730, copy source)
+++ head/sys/mips/conf/std.AR933X   Wed Aug  3 19:18:53 2016
(r303731)
@@ -11,7 +11,7 @@
 #
 
 machine mips mips
-ident  AR933X_BASE
+#ident std.AR933X
 cpuCPU_MIPS24K
 makeoptionsKERNLOADADDR=0x8005
 optionsHZ=1000
___
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: r303730 - head/sys/mips/conf

2016-08-03 Thread Adrian Chadd
Author: adrian
Date: Wed Aug  3 19:13:09 2016
New Revision: 303730
URL: https://svnweb.freebsd.org/changeset/base/303730

Log:
  [ar9330] add in module support for ipfw nat.
  
  This actually does work, and works pretty well.

Modified:
  head/sys/mips/conf/AR933X_BASE

Modified: head/sys/mips/conf/AR933X_BASE
==
--- head/sys/mips/conf/AR933X_BASE  Wed Aug  3 18:48:56 2016
(r303729)
+++ head/sys/mips/conf/AR933X_BASE  Wed Aug  3 19:13:09 2016
(r303730)
@@ -20,7 +20,7 @@ files "../atheros/files.ar71xx"
 hints  "AR933X_BASE.hints"
 
 makeoptionsDEBUG=-g#Build kernel with gdb(1) debug symbols
-makeoptionsMODULES_OVERRIDE="gpio ar71xx if_gif if_vlan if_gre if_bridge 
bridgestp usb wlan wlan_xauth wlan_acl wlan_wep wlan_tkip wlan_ccmp 
wlan_rssadapt wlan_amrr hwpmc ipfw urtwn urtwnfw otus otusfw"
+makeoptionsMODULES_OVERRIDE="gpio ar71xx if_gif if_vlan if_gre if_bridge 
bridgestp usb wlan wlan_xauth wlan_acl wlan_wep wlan_tkip wlan_ccmp 
wlan_rssadapt wlan_amrr hwpmc ipfw ipfw_nat libalias ipfw_nptv6 urtwn urtwnfw 
otus otusfw"
 
 optionsDDB
 optionsKDB
___
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: r303729 - head/sys/kern

2016-08-03 Thread Bryan Drewery
Author: bdrewery
Date: Wed Aug  3 18:48:56 2016
New Revision: 303729
URL: https://svnweb.freebsd.org/changeset/base/303729

Log:
  Correct some comments.
  
  Sponsored by: EMC / Isilon Storage Division
  MFC after:3 days

Modified:
  head/sys/kern/syscalls.master

Modified: head/sys/kern/syscalls.master
==
--- head/sys/kern/syscalls.master   Wed Aug  3 18:45:56 2016
(r303728)
+++ head/sys/kern/syscalls.master   Wed Aug  3 18:48:56 2016
(r303729)
@@ -25,10 +25,10 @@
 ; types:
 ;  STD always included
 ;  COMPAT  included on COMPAT #ifdef
-;  COMPAT4 included on COMPAT4 #ifdef (FreeBSD 4 compat)
-;  COMPAT6 included on COMPAT6 #ifdef (FreeBSD 6 compat)
-;  COMPAT7 included on COMPAT7 #ifdef (FreeBSD 7 compat)
-;  COMPAT10 included on COMPAT7 #ifdef (FreeBSD 10 compat)
+;  COMPAT4 included on COMPAT_FREEBSD4 #ifdef (FreeBSD 4 compat)
+;  COMPAT6 included on COMPAT_FREEBSD6 #ifdef (FreeBSD 6 compat)
+;  COMPAT7 included on COMPAT_FREEBSD7 #ifdef (FreeBSD 7 compat)
+;  COMPAT10 included on COMPAT_FREEBSD10 #ifdef (FreeBSD 10 compat)
 ;  OBSOL   obsolete, not included in system, only specifies name
 ;  UNIMPL  not implemented, placeholder only
 ;  NOSTD   implemented but as a lkm that can be statically
___
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: r303728 - head/sys/arm/allwinner

2016-08-03 Thread Emmanuel Vadot
Author: manu
Date: Wed Aug  3 18:45:56 2016
New Revision: 303728
URL: https://svnweb.freebsd.org/changeset/base/303728

Log:
  We need aw_nmi to be attached which needs GIC so attach a bit later.
  Also the GPIOC doesn't need to be attach early
  
  Reviewed by:  andrew
  MFC after:1 week
  Differential Revision:https://reviews.freebsd.org/D7082

Modified:
  head/sys/arm/allwinner/axp209.c

Modified: head/sys/arm/allwinner/axp209.c
==
--- head/sys/arm/allwinner/axp209.c Wed Aug  3 18:04:08 2016
(r303727)
+++ head/sys/arm/allwinner/axp209.c Wed Aug  3 18:45:56 2016
(r303728)
@@ -707,10 +707,10 @@ extern devclass_t ofwgpiobus_devclass, g
 extern driver_t ofw_gpiobus_driver, gpioc_driver;
 
 EARLY_DRIVER_MODULE(axp209, iicbus, axp209_driver, axp209_devclass,
-  0, 0, BUS_PASS_RESOURCE + BUS_PASS_ORDER_MIDDLE);
+  0, 0, BUS_PASS_INTERRUPT + BUS_PASS_ORDER_LATE);
 EARLY_DRIVER_MODULE(ofw_gpiobus, axp209_pmu, ofw_gpiobus_driver,
-ofwgpiobus_devclass, 0, 0, BUS_PASS_RESOURCE + BUS_PASS_ORDER_MIDDLE);
-EARLY_DRIVER_MODULE(gpioc, axp209_pmu, gpioc_driver, gpioc_devclass,
-0, 0, BUS_PASS_RESOURCE + BUS_PASS_ORDER_MIDDLE);
+ofwgpiobus_devclass, 0, 0, BUS_PASS_INTERRUPT + BUS_PASS_ORDER_LATE);
+DRIVER_MODULE(gpioc, axp209_pmu, gpioc_driver, gpioc_devclass,
+0, 0);
 MODULE_VERSION(axp209, 1);
 MODULE_DEPEND(axp209, iicbus, 1, 1, 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: r303727 - head/bin/uuidgen

2016-08-03 Thread Mariusz Zaborski
Author: oshogbo
Date: Wed Aug  3 18:04:08 2016
New Revision: 303727
URL: https://svnweb.freebsd.org/changeset/base/303727

Log:
  uuid_to_string(3) is allocating memory and can fail on that.
  Check if any error accrued.

Modified:
  head/bin/uuidgen/uuidgen.c

Modified: head/bin/uuidgen/uuidgen.c
==
--- head/bin/uuidgen/uuidgen.c  Wed Aug  3 18:03:14 2016(r303726)
+++ head/bin/uuidgen/uuidgen.c  Wed Aug  3 18:04:08 2016(r303727)
@@ -47,7 +47,7 @@ main(int argc, char *argv[])
FILE *fp;
uuid_t *store, *uuid;
char *p;
-   int ch, count, i, iterate;
+   int ch, count, i, iterate, status;
 
count = -1; /* no count yet */
fp = stdout;/* default output file */
@@ -101,7 +101,9 @@ main(int argc, char *argv[])
 
uuid = store;
while (count--) {
-   uuid_to_string(uuid++, , NULL);
+   uuid_to_string(uuid++, , );
+   if (status != uuid_s_ok)
+err(1, "cannot stringify a UUID");
fprintf(fp, "%s\n", p);
free(p);
}
___
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: r303725 - head/sbin/geom/class/eli

2016-08-03 Thread Mariusz Zaborski
Author: oshogbo
Date: Wed Aug  3 18:02:10 2016
New Revision: 303725
URL: https://svnweb.freebsd.org/changeset/base/303725

Log:
  Fix misleading description of the -b option in the geli init command.
  
  Reviewed by:  bjk, wblock
  Differential Revision:https://reviews.freebsd.org/D7226
  Discussed with:   AllanJude

Modified:
  head/sbin/geom/class/eli/geli.8

Modified: head/sbin/geom/class/eli/geli.8
==
--- head/sbin/geom/class/eli/geli.8 Wed Aug  3 17:20:35 2016
(r303724)
+++ head/sbin/geom/class/eli/geli.8 Wed Aug  3 18:02:10 2016
(r303725)
@@ -24,7 +24,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd July 10, 2015
+.Dd August 3, 2016
 .Dt GELI 8
 .Os
 .Sh NAME
@@ -266,7 +266,7 @@ If the option is not given, there will b
 The recommended algorithm is
 .Nm HMAC/SHA256 .
 .It Fl b
-Ask for the passphrase on boot, before the root partition is mounted.
+Try to decrypt this partition during boot, before the root partition is 
mounted.
 This makes it possible to use an encrypted root partition.
 One will still need bootable unencrypted storage with a
 .Pa /boot/
___
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: r303723 - head/sys/boot/efi/boot1

2016-08-03 Thread Mark Johnston
Author: markj
Date: Wed Aug  3 17:17:01 2016
New Revision: 303723
URL: https://svnweb.freebsd.org/changeset/base/303723

Log:
  Fix a few cosmetic issues in boot1.efi.
  
  - Use ANSI function signatures.
  - Remove unneeded checks for a NULL boot module.
  - Use nitems().
  
  MFC after:1 week
  Sponsored by: EMC / Isilon Storage Division

Modified:
  head/sys/boot/efi/boot1/boot1.c
  head/sys/boot/efi/boot1/ufs_module.c
  head/sys/boot/efi/boot1/zfs_module.c

Modified: head/sys/boot/efi/boot1/boot1.c
==
--- head/sys/boot/efi/boot1/boot1.c Wed Aug  3 17:11:08 2016
(r303722)
+++ head/sys/boot/efi/boot1/boot1.c Wed Aug  3 17:17:01 2016
(r303723)
@@ -43,7 +43,7 @@ static const boot_module_t *boot_modules
 #endif
 };
 
-#define NUM_BOOT_MODULES (sizeof(boot_modules) / sizeof(boot_module_t*))
+#defineNUM_BOOT_MODULESnitems(boot_modules)
 /* The initial number of handles used to query EFI for partitions. */
 #define NUM_HANDLES_INIT   24
 
@@ -331,8 +331,6 @@ load_loader(const boot_module_t **modp, 
const boot_module_t *mod;
 
for (i = 0; i < NUM_BOOT_MODULES; i++) {
-   if (boot_modules[i] == NULL)
-   continue;
mod = boot_modules[i];
for (dev = mod->devices(); dev != NULL; dev = dev->next) {
if (dev->preferred != preferred)
@@ -355,7 +353,7 @@ load_loader(const boot_module_t **modp, 
  * it simply boots, otherwise it returns the status of last EFI call.
  */
 static EFI_STATUS
-try_boot()
+try_boot(void)
 {
size_t bufsize, loadersize, cmdsize;
void *buf, *loaderbuf;
@@ -498,9 +496,6 @@ probe_handle(EFI_HANDLE h, EFI_DEVICE_PA
 
/* Run through each module, see if it can load this partition */
for (i = 0; i < NUM_BOOT_MODULES; i++) {
-   if (boot_modules[i] == NULL)
-   continue;
-
if ((status = bs->AllocatePool(EfiLoaderData,
sizeof(*devinfo), (void **))) !=
EFI_SUCCESS) {
@@ -605,9 +600,6 @@ efi_main(EFI_HANDLE Ximage, EFI_SYSTEM_T
printf("   Loader path: %s\n\n", PATH_LOADER_EFI);
printf("   Initializing modules:");
for (i = 0; i < NUM_BOOT_MODULES; i++) {
-   if (boot_modules[i] == NULL)
-   continue;
-
printf(" %s", boot_modules[i]->name);
if (boot_modules[i]->init != NULL)
boot_modules[i]->init();
@@ -667,10 +659,8 @@ efi_main(EFI_HANDLE Ximage, EFI_SYSTEM_T
 
/* Status summary. */
for (i = 0; i < NUM_BOOT_MODULES; i++) {
-   if (boot_modules[i] != NULL) {
-   printf("");
-   boot_modules[i]->status();
-   }
+   printf("");
+   boot_modules[i]->status();
}
 
try_boot();

Modified: head/sys/boot/efi/boot1/ufs_module.c
==
--- head/sys/boot/efi/boot1/ufs_module.cWed Aug  3 17:11:08 2016
(r303722)
+++ head/sys/boot/efi/boot1/ufs_module.cWed Aug  3 17:17:01 2016
(r303723)
@@ -142,7 +142,7 @@ load(const char *filepath, dev_info_t *d
 }
 
 static void
-status()
+status(void)
 {
int i;
dev_info_t *dev;
@@ -164,7 +164,7 @@ status()
 }
 
 static dev_info_t *
-_devices()
+_devices(void)
 {
 
return (devices);

Modified: head/sys/boot/efi/boot1/zfs_module.c
==
--- head/sys/boot/efi/boot1/zfs_module.cWed Aug  3 17:11:08 2016
(r303722)
+++ head/sys/boot/efi/boot1/zfs_module.cWed Aug  3 17:17:01 2016
(r303723)
@@ -154,7 +154,7 @@ load(const char *filepath, dev_info_t *d
 }
 
 static void
-status()
+status(void)
 {
spa_t *spa;
 
@@ -172,14 +172,14 @@ status()
 }
 
 static void
-init()
+init(void)
 {
 
zfs_init();
 }
 
 static dev_info_t *
-_devices()
+_devices(void)
 {
 
return (devices);
___
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: r303721 - in head: share/man/man9 sys/dev/pci

2016-08-03 Thread John Baldwin
Author: jhb
Date: Wed Aug  3 17:09:12 2016
New Revision: 303721
URL: https://svnweb.freebsd.org/changeset/base/303721

Log:
  Permit the name of the /dev/iov entry to be set by the driver.
  
  The PCI_IOV option creates character devices in /dev/iov for each PF
  device driver that registers support for creating VFs.  By default the
  character device is named after the PF device (e.g. /dev/iov/foo0).
  This change adds a variant of pci_iov_attach() called pci_iov_attach_name()
  that allows the name of the /dev/iov entry to be specified by the
  driver.
  
  Reviewed by:  rstone
  MFC after:1 month
  Sponsored by: Chelsio Communications
  Differential Revision:https://reviews.freebsd.org/D7400

Modified:
  head/share/man/man9/Makefile
  head/share/man/man9/pci.9
  head/sys/dev/pci/pci_if.m
  head/sys/dev/pci/pci_iov.c
  head/sys/dev/pci/pci_iov.h
  head/sys/dev/pci/pci_private.h

Modified: head/share/man/man9/Makefile
==
--- head/share/man/man9/MakefileWed Aug  3 16:52:00 2016
(r303720)
+++ head/share/man/man9/MakefileWed Aug  3 17:09:12 2016
(r303721)
@@ -1303,6 +1303,7 @@ MLINKS+=pci.9 pci_alloc_msi.9 \
pci.9 pci_get_vpd_ident.9 \
pci.9 pci_get_vpd_readonly.9 \
pci.9 pci_iov_attach.9 \
+   pci.9 pci_iov_attach_name.9 \
pci.9 pci_iov_detach.9 \
pci.9 pci_msi_count.9 \
pci.9 pci_msix_count.9 \

Modified: head/share/man/man9/pci.9
==
--- head/share/man/man9/pci.9   Wed Aug  3 16:52:00 2016(r303720)
+++ head/share/man/man9/pci.9   Wed Aug  3 17:09:12 2016(r303721)
@@ -25,7 +25,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd June 24, 2016
+.Dd August 3, 2016
 .Dt PCI 9
 .Os
 .Sh NAME
@@ -50,6 +50,7 @@
 .Nm pci_get_vpd_ident ,
 .Nm pci_get_vpd_readonly ,
 .Nm pci_iov_attach ,
+.Nm pci_iov_attach_name ,
 .Nm pci_iov_detach ,
 .Nm pci_msi_count ,
 .Nm pci_msix_count ,
@@ -152,6 +153,14 @@
 .Ft int
 .Fn pci_iov_attach "device_t dev" "nvlist_t *pf_schema" "nvlist_t *vf_schema"
 .Ft int
+.Fo pci_iov_attach_name
+.Fa "device_t dev"
+.Fa "nvlist_t *pf_schema"
+.Fa "nvlist_t *vf_schema"
+.Fa "const char *fmt"
+.Fa "..."
+.Fc
+.Ft int
 .Fn pci_iov_detach "device_t dev"
 .Sh DESCRIPTION
 The
@@ -595,6 +604,20 @@ and is responsible for freeing them.
 The driver must never free the schemas itself.
 .Pp
 The
+.Fn pci_iov_attach_name
+function is a variant of
+.Fn pci_iov_attach
+that allows the name of the associated character device in
+.Pa /dev/iov
+to be specified by
+.Fa fmt .
+The
+.Fn pci_iov_attach
+function uses the name of
+.Fa dev
+as the device name.
+.Pp
+The
 .Fn pci_iov_detach
 function is used to advise the SR-IOV infrastructure that the driver for the
 given device is attempting to detach and that all SR-IOV resources for the

Modified: head/sys/dev/pci/pci_if.m
==
--- head/sys/dev/pci/pci_if.m   Wed Aug  3 16:52:00 2016(r303720)
+++ head/sys/dev/pci/pci_if.m   Wed Aug  3 17:09:12 2016(r303721)
@@ -235,6 +235,7 @@ METHOD int iov_attach {
device_tchild;
struct nvlist   *pf_schema;
struct nvlist   *vf_schema;
+   const char  *name;
 };
 
 METHOD int iov_detach {

Modified: head/sys/dev/pci/pci_iov.c
==
--- head/sys/dev/pci/pci_iov.c  Wed Aug  3 16:52:00 2016(r303720)
+++ head/sys/dev/pci/pci_iov.c  Wed Aug  3 17:09:12 2016(r303721)
@@ -98,8 +98,22 @@ static nvlist_t  *pci_iov_get_pf_subsyste
 static nvlist_t*pci_iov_get_vf_subsystem_schema(void);
 
 int
+pci_iov_attach_name(device_t dev, struct nvlist *pf_schema,
+struct nvlist *vf_schema, const char *fmt, ...)
+{
+   char buf[NAME_MAX + 1];
+   va_list ap;
+
+   va_start(ap, fmt);
+   vsnprintf(buf, sizeof(buf), fmt, ap);
+   va_end(ap);
+   return (PCI_IOV_ATTACH(device_get_parent(dev), dev, pf_schema,
+   vf_schema, buf));
+}
+
+int
 pci_iov_attach_method(device_t bus, device_t dev, nvlist_t *pf_schema,
-nvlist_t *vf_schema)
+nvlist_t *vf_schema, const char *name)
 {
device_t pcib;
struct pci_devinfo *dinfo;
@@ -149,7 +163,7 @@ pci_iov_attach_method(device_t bus, devi
iov->iov_schema = schema;
 
iov->iov_cdev = make_dev(_cdevsw, device_get_unit(dev),
-   UID_ROOT, GID_WHEEL, 0600, "iov/%s", device_get_nameunit(dev));
+   UID_ROOT, GID_WHEEL, 0600, "iov/%s", name);
 
if (iov->iov_cdev == NULL) {
error = ENOMEM;

Modified: head/sys/dev/pci/pci_iov.h
==
--- head/sys/dev/pci/pci_iov.h  Wed Aug  3 16:52:00 2016(r303720)
+++ head/sys/dev/pci/pci_iov.h  Wed Aug  3 17:09:12 2016

svn commit: r303720 - head/sys/dev/hwpmc

2016-08-03 Thread John Baldwin
Author: jhb
Date: Wed Aug  3 16:52:00 2016
New Revision: 303720
URL: https://svnweb.freebsd.org/changeset/base/303720

Log:
  Apply the fix from r232612 to fixed function counters.
  
  Reviewed by:  emaste
  MFC after:1 month
  Differential Revision:https://reviews.freebsd.org/D7397

Modified:
  head/sys/dev/hwpmc/hwpmc_core.c

Modified: head/sys/dev/hwpmc/hwpmc_core.c
==
--- head/sys/dev/hwpmc/hwpmc_core.c Wed Aug  3 16:34:20 2016
(r303719)
+++ head/sys/dev/hwpmc/hwpmc_core.c Wed Aug  3 16:52:00 2016
(r303720)
@@ -365,7 +365,7 @@ iaf_read_pmc(int cpu, int ri, pmc_value_
if (PMC_IS_SAMPLING_MODE(PMC_TO_MODE(pm)))
*v = iaf_perfctr_value_to_reload_count(tmp);
else
-   *v = tmp;
+   *v = tmp & ((1ULL << core_iaf_width) - 1);
 
PMCDBG4(MDP,REA,1, "iaf-read cpu=%d ri=%d msr=0x%x -> v=%jx", cpu, ri,
IAF_RI_TO_MSR(ri), *v);
___
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: r303716 - head/crypto/openssh

2016-08-03 Thread Glen Barber
On Wed, Aug 03, 2016 at 04:08:22PM +, Dag-Erling Smørgrav wrote:
> Author: des
> Date: Wed Aug  3 16:08:21 2016
> New Revision: 303716
> URL: https://svnweb.freebsd.org/changeset/base/303716
> 
> Log:
>   Remove DSA from default cipher list and disable SSH1.
>   
>   Upstream did this a long time ago, but we kept DSA and SSH1 in FreeBSD for
>   reasons which boil down to POLA.  Now is a good time to catch up.
>   
>   MFC after:  3 days
>   Relnotes:   yes
> 

It might be worth considering doing the MFC before 3 days.  It's still
unclear if we'll need BETA4, but would be nice to have this change in
the next build regardless.

Glen



signature.asc
Description: PGP signature


svn commit: r303719 - head/etc/rc.d

2016-08-03 Thread Dag-Erling Smørgrav
Author: des
Date: Wed Aug  3 16:34:20 2016
New Revision: 303719
URL: https://svnweb.freebsd.org/changeset/base/303719

Log:
  Disable DSA again.
  
  MFC after:3 days

Modified:
  head/etc/rc.d/sshd

Modified: head/etc/rc.d/sshd
==
--- head/etc/rc.d/sshd  Wed Aug  3 16:33:34 2016(r303718)
+++ head/etc/rc.d/sshd  Wed Aug  3 16:34:20 2016(r303719)
@@ -23,7 +23,7 @@ extra_commands="configtest keygen reload
 
 : ${sshd_rsa1_enable:="no"}
 : ${sshd_rsa_enable:="yes"}
-: ${sshd_dsa_enable:="yes"}
+: ${sshd_dsa_enable:="no"}
 : ${sshd_ecdsa_enable:="yes"}
 : ${sshd_ed25519_enable:="yes"}
 
___
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: r303718 - head/usr.bin/indent

2016-08-03 Thread Pedro F. Giffuni
Author: pfg
Date: Wed Aug  3 16:33:34 2016
New Revision: 303718
URL: https://svnweb.freebsd.org/changeset/base/303718

Log:
  indent(1): accept offsetof(3) as a keyword.
  
  Reference:
  
https://github.com/pstef/freebsd_indent/commit/c470e5e2c974aa38450ca4762b93829f7a7bfa4d
  
  Differential Revision: https://reviews.freebsd.org/D6966  (Partial)
  Submitted by: Piotr Stefaniak

Modified:
  head/usr.bin/indent/indent.c
  head/usr.bin/indent/indent_globs.h
  head/usr.bin/indent/lexi.c

Modified: head/usr.bin/indent/indent.c
==
--- head/usr.bin/indent/indent.cWed Aug  3 16:10:53 2016
(r303717)
+++ head/usr.bin/indent/indent.cWed Aug  3 16:33:34 2016
(r303718)
@@ -510,8 +510,11 @@ check_type:
case lparen:/* got a '(' or '[' */
++ps.p_l_follow;/* count parens to make Healy happy */
if (ps.want_blank && *token != '[' &&
-   (ps.last_token != ident || proc_calls_space
- || (ps.its_a_keyword && (!ps.sizeof_keyword || Bill_Shannon
+   (ps.last_token != ident || proc_calls_space ||
+   /* offsetof (1) is never allowed a space; sizeof (2) gets
+* one iff -bs; all other keywords (>2) always get a space
+* before lparen */
+   (ps.keyword + Bill_Shannon > 2)))
*e_code++ = ' ';
ps.want_blank = false;
if (ps.in_decl && !ps.block_init && !ps.dumped_decl_indent &&
@@ -542,19 +545,20 @@ check_type:
ps.in_or_st = false;/* turn off flag for structure decl or
 * initialization */
}
-   if (ps.sizeof_keyword)
-   ps.sizeof_mask |= 1 << ps.p_l_follow;
+   /* parenthesized type following sizeof or offsetof is not a cast */
+   if (ps.keyword == 1 || ps.keyword == 2)
+   ps.not_cast_mask |= 1 << ps.p_l_follow;
break;
 
case rparen:/* got a ')' or ']' */
rparen_count--;
-   if (ps.cast_mask & (1 << ps.p_l_follow) & ~ps.sizeof_mask) {
+   if (ps.cast_mask & (1 << ps.p_l_follow) & ~ps.not_cast_mask) {
ps.last_u_d = true;
ps.cast_mask &= (1 << ps.p_l_follow) - 1;
ps.want_blank = false;
} else
ps.want_blank = true;
-   ps.sizeof_mask &= (1 << ps.p_l_follow) - 1;
+   ps.not_cast_mask &= (1 << ps.p_l_follow) - 1;
if (--ps.p_l_follow < 0) {
ps.p_l_follow = 0;
diag3(0, "Extra %c", *token);
@@ -712,7 +716,7 @@ check_type:
if (ps.last_token == rparen && rparen_count == 0)
ps.in_parameter_declaration = 0;
ps.cast_mask = 0;
-   ps.sizeof_mask = 0;
+   ps.not_cast_mask = 0;
ps.block_init = 0;
ps.block_init_level = 0;
ps.just_saw_decl--;
@@ -968,7 +972,7 @@ check_type:
 copy_id:
if (ps.want_blank)
*e_code++ = ' ';
-   if (troff && ps.its_a_keyword) {
+   if (troff && ps.keyword) {
e_code = chfont(, , e_code);
for (t_ptr = token; *t_ptr; ++t_ptr) {
CHECK_SIZE_CODE;

Modified: head/usr.bin/indent/indent_globs.h
==
--- head/usr.bin/indent/indent_globs.h  Wed Aug  3 16:10:53 2016
(r303717)
+++ head/usr.bin/indent/indent_globs.h  Wed Aug  3 16:33:34 2016
(r303718)
@@ -244,10 +244,10 @@ struct parser_state {
 * char should be lined up with the / in / 
followed by * */
 int comment_delta,
 n_comment_delta;
-int cast_mask; /* indicates which close parens close off
-* casts */
-int sizeof_mask;   /* indicates which close parens close off
-* sizeof''s */
+int cast_mask; /* indicates which close parens potentially
+* close off casts */
+int not_cast_mask; /* indicates which close parens definitely
+* close off something else than casts */
 int block_init;/* true iff inside a block initialization */
 int block_init_level;  /* The level of brace nesting in an
 * initialization */
@@ -317,8 +317,7 @@ struct parser_state {
 * specially */
 int decl_indent;   /* column to indent declared identifiers to */
 int local_decl_indent; /* like decl_indent but for locals */
-int its_a_keyword;
-int sizeof_keyword;
+int keyword;   /* the type of a keyword 

Re: svn commit: r303716 - head/crypto/openssh

2016-08-03 Thread Dag-Erling Smørgrav
Benjamin Kaduk  writes:
> Which branch(es) are MFC targets?

It will be merged to stable/11 before the release and documented in the
release notes.

> (Does POLA no longer apply to them?)

Things change over time.  Such is the nature of software (and of life).
POLA does not mean we don't change anything, just that we try not to
make disruptive changes during the lifetime of a release branch.

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

Re: svn commit: r303716 - head/crypto/openssh

2016-08-03 Thread Benjamin Kaduk
On Wed, Aug 3, 2016 at 11:08 AM, Dag-Erling Smørgrav 
wrote:

> Author: des
> Date: Wed Aug  3 16:08:21 2016
> New Revision: 303716
> URL: https://svnweb.freebsd.org/changeset/base/303716
>
> Log:
>   Remove DSA from default cipher list and disable SSH1.
>
>   Upstream did this a long time ago, but we kept DSA and SSH1 in FreeBSD
> for
>   reasons which boil down to POLA.  Now is a good time to catch up.
>
>   MFC after:3 days
>

Which branch(es) are MFC targets?  (Does POLA no longer apply to them?)

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

svn commit: r303716 - head/crypto/openssh

2016-08-03 Thread Dag-Erling Smørgrav
Author: des
Date: Wed Aug  3 16:08:21 2016
New Revision: 303716
URL: https://svnweb.freebsd.org/changeset/base/303716

Log:
  Remove DSA from default cipher list and disable SSH1.
  
  Upstream did this a long time ago, but we kept DSA and SSH1 in FreeBSD for
  reasons which boil down to POLA.  Now is a good time to catch up.
  
  MFC after:3 days
  Relnotes: yes

Modified:
  head/crypto/openssh/FREEBSD-upgrade
  head/crypto/openssh/config.h
  head/crypto/openssh/configure.ac
  head/crypto/openssh/myproposal.h
  head/crypto/openssh/servconf.c
  head/crypto/openssh/ssh_config.5
  head/crypto/openssh/sshd_config.5

Modified: head/crypto/openssh/FREEBSD-upgrade
==
--- head/crypto/openssh/FREEBSD-upgrade Wed Aug  3 15:58:20 2016
(r303715)
+++ head/crypto/openssh/FREEBSD-upgrade Wed Aug  3 16:08:21 2016
(r303716)
@@ -142,30 +142,25 @@
Support for TCP wrappers was removed in upstream 6.7p1.  We've
added it back by porting the 6.6p1 code forward.
 
-6) DSA keys
-
-   DSA keys were disabled by default in upstream 6.9p1.  We've added
-   them back.
-
-7) Agent client reference counting
+6) Agent client reference counting
 
We've added code to ssh-agent.c to implement client reference
counting; the agent will automatically exit when the last client
disconnects.
 
-8) Class-based login restrictions
+7) Class-based login restrictions
 
We've added code to auth2.c to enforce the host.allow, host.deny,
times.allow and times.deny login class capabilities.
 
-9) HPN
+8) HPN
 
We no longer have the HPN patches (adaptive buffer size for
increased throughput on high-BxD links), but we recognize and
ignore HPN-related configuration options to avoid breaking existing
configurations.
 
-A) AES-CBC
+9) AES-CBC
 
The AES-CBC ciphers were removed from the server-side proposal list
in 6.7p1 due to theoretical weaknesses and the availability of

Modified: head/crypto/openssh/config.h
==
--- head/crypto/openssh/config.hWed Aug  3 15:58:20 2016
(r303715)
+++ head/crypto/openssh/config.hWed Aug  3 16:08:21 2016
(r303716)
@@ -1701,7 +1701,7 @@
 /* #undef WITH_SELINUX */
 
 /* include SSH protocol version 1 support */
-#define WITH_SSH1 1
+/* #undef WITH_SSH1 */
 
 /* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most
significant byte first (like Motorola and SPARC, unlike Intel). */

Modified: head/crypto/openssh/configure.ac
==
--- head/crypto/openssh/configure.acWed Aug  3 15:58:20 2016
(r303715)
+++ head/crypto/openssh/configure.acWed Aug  3 16:08:21 2016
(r303716)
@@ -123,7 +123,7 @@ AC_CHECK_DECL([PR_SET_NO_NEW_PRIVS], [ha
 ])
 
 openssl=yes
-ssh1=yes
+ssh1=no
 AC_ARG_WITH([openssl],
[  --without-openssl   Disable use of OpenSSL; use only limited 
internal crypto **EXPERIMENTAL** ],
[  if test "x$withval" = "xno" ; then

Modified: head/crypto/openssh/myproposal.h
==
--- head/crypto/openssh/myproposal.hWed Aug  3 15:58:20 2016
(r303715)
+++ head/crypto/openssh/myproposal.hWed Aug  3 16:08:21 2016
(r303716)
@@ -100,13 +100,11 @@
HOSTKEY_ECDSA_CERT_METHODS \
"ssh-ed25519-cert-...@openssh.com," \
"ssh-rsa-cert-...@openssh.com," \
-   "ssh-dss-cert-...@openssh.com," \
HOSTKEY_ECDSA_METHODS \
"ssh-ed25519," \
"rsa-sha2-512," \
"rsa-sha2-256," \
-   "ssh-rsa," \
-   "ssh-dss"
+   "ssh-rsa"
 
 /* the actual algorithms */
 

Modified: head/crypto/openssh/servconf.c
==
--- head/crypto/openssh/servconf.c  Wed Aug  3 15:58:20 2016
(r303715)
+++ head/crypto/openssh/servconf.c  Wed Aug  3 16:08:21 2016
(r303716)
@@ -206,8 +206,6 @@ fill_default_server_options(ServerOption
/* Standard Options */
if (options->protocol == SSH_PROTO_UNKNOWN)
options->protocol = SSH_PROTO_2;
-   if (options->protocol & SSH_PROTO_1)
-   error("WARNING: SSH protocol version 1 enabled");
if (options->num_host_key_files == 0) {
/* fill default hostkeys for protocols */
if (options->protocol & SSH_PROTO_1)

Modified: head/crypto/openssh/ssh_config.5
==
--- head/crypto/openssh/ssh_config.5Wed Aug  3 15:58:20 2016
(r303715)
+++ head/crypto/openssh/ssh_config.5Wed Aug  3 16:08:21 2016
(r303716)
@@ -871,10 +871,8 @@ ecdsa-sha2-nistp384-cert-...@openssh.com
 ecdsa-sha2-nistp521-cert-...@openssh.com,
 

svn commit: r303713 - head/sys/amd64/vmm

2016-08-03 Thread John Baldwin
Author: jhb
Date: Wed Aug  3 15:20:10 2016
New Revision: 303713
URL: https://svnweb.freebsd.org/changeset/base/303713

Log:
  Correct assertion on vcpuid argument to vm_gpa_hold().
  
  PR:   208168
  Submitted by: Dave Cameron 
  Reviewed by:  grehan
  MFC after:1 month

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

Modified: head/sys/amd64/vmm/vmm.c
==
--- head/sys/amd64/vmm/vmm.cWed Aug  3 13:51:53 2016(r303712)
+++ head/sys/amd64/vmm/vmm.cWed Aug  3 15:20:10 2016(r303713)
@@ -914,7 +914,7 @@ vm_gpa_hold(struct vm *vm, int vcpuid, v
 * guaranteed if at least one vcpu is in the VCPU_FROZEN state.
 */
int state;
-   KASSERT(vcpuid >= -1 || vcpuid < VM_MAXCPU, ("%s: invalid vcpuid %d",
+   KASSERT(vcpuid >= -1 && vcpuid < VM_MAXCPU, ("%s: invalid vcpuid %d",
__func__, vcpuid));
for (i = 0; i < VM_MAXCPU; i++) {
if (vcpuid != -1 && vcpuid != i)
___
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: r303710 - head/sys/fs/nfsclient

2016-08-03 Thread Bruce Evans

On Wed, 3 Aug 2016, Konstantin Belousov wrote:


Log:
 Remove unneeded (recursing) Giant acquisition around vprintf(9).

 Reviewed by:   rmacklem
 Sponsored by:  The FreeBSD Foundation
 MFC after: 1 week

Modified:
 head/sys/fs/nfsclient/nfs_clsubs.c

Modified: head/sys/fs/nfsclient/nfs_clsubs.c
==
--- head/sys/fs/nfsclient/nfs_clsubs.c  Wed Aug  3 10:23:42 2016
(r303709)
+++ head/sys/fs/nfsclient/nfs_clsubs.c  Wed Aug  3 11:49:17 2016
(r303710)
@@ -166,11 +166,9 @@ ncl_printf(const char *fmt, ...)
{
va_list ap;

-   mtx_lock();
va_start(ap, fmt);
vprintf(fmt, ap);
va_end(ap);
-   mtx_unlock();
}

#ifdef NFS_ACDEBUG


This leaves the less than needed function nfs_printf().  Old versions
of nfs used the correct function printf().  All nfs_printf() ever did
was:
- when it was first implemented, almost never work.  It had
  printf(fmt, ap) instead of vprintf(fmt, ap).  This only worked when
  fmt had no % directives in it.  Otherwise, it gave undefined behaviour.
  FreeBSD-7 still has this version.
- to hold the Giant locking.  This was not completely unneeded.  It had
  the side effect of serializing printfs within nfs.

Serialization in -current is normally done using PRINTF_BUFR_SIZE, but
this is not the default and it gives deadlocks or drops output so I
don't use it.

I refined my old fix for serializing printf() and it now works very well.


@@ -197,9 +195,6 @@ ncl_getattrcache(struct vnode *vp, struc
vap = >n_vattr.na_vattr;
nmp = VFSTONFS(vp->v_mount);
mustflush = nfscl_mustflush(vp);/* must be before mtx_lock() */
-#ifdef NFS_ACDEBUG
-   mtx_lock();   /* ncl_printf() */
-#endif
mtx_lock(>n_mtx);
/* XXX n_mtime doesn't seem to be updated on a miss-and-reload */
timeo = (time_second - np->n_mtime.tv_sec) / 10;
@@ -236,9 +231,6 @@ ncl_getattrcache(struct vnode *vp, struc
(mustflush != 0 || np->n_attrstamp == 0)) {
newnfsstats.attrcache_misses++;
mtx_unlock(>n_mtx);
-#ifdef NFS_ACDEBUG
-   mtx_unlock(); /* ncl_printf() */
-#endif
KDTRACE_NFS_ATTRCACHE_GET_MISS(vp);
return( ENOENT);
}
@@ -266,9 +258,6 @@ ncl_getattrcache(struct vnode *vp, struc
vaper->va_mtime = np->n_mtim;
}
mtx_unlock(>n_mtx);
-#ifdef NFS_ACDEBUG
-   mtx_unlock(); /* ncl_printf() */
-#endif
KDTRACE_NFS_ATTRCACHE_GET_HIT(vp, vap);
return (0);
}


Unfortunately, these are probably still "needed".  printf() serialization
using PRINTF_BUFR_SIZE or my method only works for individual printf()s
or possibly single lines.  Just about any lock around a group of printf()s
serializes them as a group (only across subsystems using the same lock of
course).

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: r303712 - in head/sys: amd64/amd64 conf i386/i386 x86/x86

2016-08-03 Thread Konstantin Belousov
On Wed, Aug 03, 2016 at 01:51:53PM +, Konstantin Belousov wrote:
>   Merge i386 and amd64 variants of mp_watchdog.c into x86/, there is no
>   difference between files.
May be, the file should be deleted.
___
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: r303712 - in head/sys: amd64/amd64 conf i386/i386 x86/x86

2016-08-03 Thread Konstantin Belousov
Author: kib
Date: Wed Aug  3 13:51:53 2016
New Revision: 303712
URL: https://svnweb.freebsd.org/changeset/base/303712

Log:
  Merge i386 and amd64 variants of mp_watchdog.c into x86/, there is no
  difference between files.
  For pc98, put x86/mp_x86.c into the same place as used by i386 file list.
  Fix typo in comment.
  
  Sponsored by: The FreeBSD Foundation
  MFC after:1 week

Added:
  head/sys/x86/x86/mp_watchdog.c
 - copied, changed from r303711, head/sys/amd64/amd64/mp_watchdog.c
Deleted:
  head/sys/amd64/amd64/mp_watchdog.c
  head/sys/i386/i386/mp_watchdog.c
Modified:
  head/sys/conf/files.amd64
  head/sys/conf/files.i386
  head/sys/conf/files.pc98

Modified: head/sys/conf/files.amd64
==
--- head/sys/conf/files.amd64   Wed Aug  3 13:19:58 2016(r303711)
+++ head/sys/conf/files.amd64   Wed Aug  3 13:51:53 2016(r303712)
@@ -123,7 +123,6 @@ amd64/amd64/machdep.c   standard
 amd64/amd64/mem.c  optionalmem
 amd64/amd64/minidump_machdep.c standard
 amd64/amd64/mp_machdep.c   optionalsmp
-amd64/amd64/mp_watchdog.c  optionalmp_watchdog smp
 amd64/amd64/mpboot.S   optionalsmp
 amd64/amd64/pmap.c standard
 amd64/amd64/prof_machdep.c optionalprofiling-routine
@@ -621,6 +620,7 @@ x86/x86/mca.c   standard
 x86/x86/mptable.c  optionalmptable
 x86/x86/mptable_pci.c  optionalmptable pci
 x86/x86/mp_x86.c   optionalsmp
+x86/x86/mp_watchdog.c  optionalmp_watchdog smp
 x86/x86/msi.c  optionalpci
 x86/x86/nexus.cstandard
 x86/x86/pvclock.c  standard

Modified: head/sys/conf/files.i386
==
--- head/sys/conf/files.i386Wed Aug  3 13:19:58 2016(r303711)
+++ head/sys/conf/files.i386Wed Aug  3 13:51:53 2016(r303712)
@@ -481,7 +481,6 @@ i386/i386/mem.c optional mem
 i386/i386/minidump_machdep.c   standard
 i386/i386/mp_clock.c   optional smp
 i386/i386/mp_machdep.c optional smp
-i386/i386/mp_watchdog.coptional mp_watchdog smp
 i386/i386/mpboot.s optional smp
 i386/i386/perfmon.coptional perfmon
 i386/i386/pmap.c   standard
@@ -612,6 +611,7 @@ x86/x86/mca.c   standard
 x86/x86/mptable.c  optional apic
 x86/x86/mptable_pci.c  optional apic pci
 x86/x86/mp_x86.c   optional smp
+x86/x86/mp_watchdog.c  optional mp_watchdog smp
 x86/x86/msi.c  optional apic pci
 x86/x86/nexus.cstandard
 x86/x86/stack_machdep.coptional ddb | stack

Modified: head/sys/conf/files.pc98
==
--- head/sys/conf/files.pc98Wed Aug  3 13:19:58 2016(r303711)
+++ head/sys/conf/files.pc98Wed Aug  3 13:51:53 2016(r303712)
@@ -168,7 +168,6 @@ i386/i386/mem.c optional mem
 i386/i386/minidump_machdep.c   standard
 i386/i386/mp_clock.c   optional smp
 i386/i386/mp_machdep.c optional smp
-i386/i386/mp_watchdog.coptional mp_watchdog smp
 i386/i386/mpboot.s optional smp
 i386/i386/perfmon.coptional perfmon
 i386/i386/pmap.c   standard
@@ -269,9 +268,10 @@ x86/x86/io_apic.c  optional apic
 x86/x86/legacy.c   standard
 x86/x86/local_apic.c   optional apic
 x86/x86/mca.c  standard
-x86/x86/mp_x86.c   optional smp
 x86/x86/mptable.c  optional apic
 x86/x86/mptable_pci.c  optional apic pci
+x86/x86/mp_x86.c   optional smp
+x86/x86/mp_watchdog.c  optional mp_watchdog smp
 x86/x86/msi.c  optional apic pci
 x86/x86/nexus.cstandard
 x86/x86/stack_machdep.coptional ddb | stack

Copied and modified: head/sys/x86/x86/mp_watchdog.c (from r303711, 
head/sys/amd64/amd64/mp_watchdog.c)
==
--- head/sys/amd64/amd64/mp_watchdog.c  Wed Aug  3 13:19:58 2016
(r303711, copy source)
+++ head/sys/x86/x86/mp_watchdog.c  Wed Aug  3 13:51:53 2016
(r303712)
@@ -92,7 +92,7 @@ watchdog_init(void *arg)
 
 /*
  * This callout resets a timer until the watchdog kicks in.  It acquires some
- * critical locks to make sure things haven't gotten wedged with hose locks
+ * critical locks to make sure things haven't gotten wedged with those locks
  * held.
  */
 static void
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail 

svn commit: r303710 - head/sys/fs/nfsclient

2016-08-03 Thread Konstantin Belousov
Author: kib
Date: Wed Aug  3 11:49:17 2016
New Revision: 303710
URL: https://svnweb.freebsd.org/changeset/base/303710

Log:
  Remove unneeded (recursing) Giant acquisition around vprintf(9).
  
  Reviewed by:  rmacklem
  Sponsored by: The FreeBSD Foundation
  MFC after:1 week

Modified:
  head/sys/fs/nfsclient/nfs_clsubs.c

Modified: head/sys/fs/nfsclient/nfs_clsubs.c
==
--- head/sys/fs/nfsclient/nfs_clsubs.c  Wed Aug  3 10:23:42 2016
(r303709)
+++ head/sys/fs/nfsclient/nfs_clsubs.c  Wed Aug  3 11:49:17 2016
(r303710)
@@ -166,11 +166,9 @@ ncl_printf(const char *fmt, ...)
 {
va_list ap;
 
-   mtx_lock();
va_start(ap, fmt);
vprintf(fmt, ap);
va_end(ap);
-   mtx_unlock();
 }
 
 #ifdef NFS_ACDEBUG
@@ -197,9 +195,6 @@ ncl_getattrcache(struct vnode *vp, struc
vap = >n_vattr.na_vattr;
nmp = VFSTONFS(vp->v_mount);
mustflush = nfscl_mustflush(vp);/* must be before mtx_lock() */
-#ifdef NFS_ACDEBUG
-   mtx_lock();   /* ncl_printf() */
-#endif
mtx_lock(>n_mtx);
/* XXX n_mtime doesn't seem to be updated on a miss-and-reload */
timeo = (time_second - np->n_mtime.tv_sec) / 10;
@@ -236,9 +231,6 @@ ncl_getattrcache(struct vnode *vp, struc
(mustflush != 0 || np->n_attrstamp == 0)) {
newnfsstats.attrcache_misses++;
mtx_unlock(>n_mtx);
-#ifdef NFS_ACDEBUG
-   mtx_unlock(); /* ncl_printf() */
-#endif
KDTRACE_NFS_ATTRCACHE_GET_MISS(vp);
return( ENOENT);
}
@@ -266,9 +258,6 @@ ncl_getattrcache(struct vnode *vp, struc
vaper->va_mtime = np->n_mtim;
}
mtx_unlock(>n_mtx);
-#ifdef NFS_ACDEBUG
-   mtx_unlock(); /* ncl_printf() */
-#endif
KDTRACE_NFS_ATTRCACHE_GET_HIT(vp, vap);
return (0);
 }
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r303707 - head/sys/kern

2016-08-03 Thread Mateusz Guzik
Author: mjg
Date: Wed Aug  3 09:15:10 2016
New Revision: 303707
URL: https://svnweb.freebsd.org/changeset/base/303707

Log:
  locks: fix sx compilation on mips after r303643
  
  The kernel.h header is required for the SYSINIT macro, which apparently
  was present on amd64 by accident.
  
  Reported by:  kib

Modified:
  head/sys/kern/kern_sx.c

Modified: head/sys/kern/kern_sx.c
==
--- head/sys/kern/kern_sx.c Wed Aug  3 09:09:34 2016(r303706)
+++ head/sys/kern/kern_sx.c Wed Aug  3 09:15:10 2016(r303707)
@@ -46,6 +46,7 @@ __FBSDID("$FreeBSD$");
 #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: r303706 - head/lib/libc/gen

2016-08-03 Thread Andrey A. Chernov
Author: ache
Date: Wed Aug  3 09:09:34 2016
New Revision: 303706
URL: https://svnweb.freebsd.org/changeset/base/303706

Log:
  Although the code amount is not big, move POSIX error processing into
  two sepatate functions to make glob(3) code less obscure and more simple.
  There is no needs to make them inline since it is error path which supposed
  to not happes often.

Modified:
  head/lib/libc/gen/glob.c

Modified: head/lib/libc/gen/glob.c
==
--- head/lib/libc/gen/glob.cWed Aug  3 08:57:15 2016(r303705)
+++ head/lib/libc/gen/glob.cWed Aug  3 09:09:34 2016(r303706)
@@ -177,6 +177,8 @@ static int   globexp2(const Char *, const
 static int  globfinal(glob_t *, struct glob_limit *, size_t,
 const char *);
 static int  match(Char *, Char *, Char *);
+static int  err_nomatch(glob_t *, struct glob_limit *, const char *);
+static int  err_aborted(glob_t *, int, char *);
 #ifdef DEBUG
 static void qprintf(const char *, Char *);
 #endif
@@ -217,8 +219,7 @@ glob(const char * __restrict pattern, in
while (bufnext <= bufend) {
clen = mbrtowc(, patnext, MB_LEN_MAX, );
if (clen == (size_t)-1 || clen == (size_t)-2)
-   return (globfinal(pglob, ,
-   pglob->gl_pathc, pattern));
+   return (err_nomatch(pglob, , pattern));
else if (clen == 0) {
too_long = 0;
break;
@@ -240,8 +241,7 @@ glob(const char * __restrict pattern, in
prot = 0;
clen = mbrtowc(, patnext, MB_LEN_MAX, );
if (clen == (size_t)-1 || clen == (size_t)-2)
-   return (globfinal(pglob, ,
-   pglob->gl_pathc, pattern));
+   return (err_nomatch(pglob, , pattern));
else if (clen == 0) {
too_long = 0;
break;
@@ -251,7 +251,7 @@ glob(const char * __restrict pattern, in
}
}
if (too_long)
-   return (globfinal(pglob, , pglob->gl_pathc, pattern));
+   return (err_nomatch(pglob, , pattern));
*bufnext = EOS;
 
if (flags & GLOB_BRACE)
@@ -608,20 +608,9 @@ glob0(const Char *pattern, glob_t *pglob
 static int
 globfinal(glob_t *pglob, struct glob_limit *limit, size_t oldpathc,
 const char *origpat) {
-   /*
-* If there was no match we are going to append the origpat
-* if GLOB_NOCHECK was specified or if GLOB_NOMAGIC was specified
-* and the origpat did not contain any magic characters
-* GLOB_NOMAGIC is there just for compatibility with csh.
-*/
-   if (pglob->gl_pathc == oldpathc) {
-   if ((pglob->gl_flags & GLOB_NOCHECK) ||
-   ((pglob->gl_flags & GLOB_NOMAGIC) &&
-   !(pglob->gl_flags & GLOB_MAGCHAR)))
-   return (globextend(NULL, pglob, limit, origpat));
-   else
-   return (GLOB_NOMATCH);
-   }
+   if (pglob->gl_pathc == oldpathc)
+   return (err_nomatch(pglob, limit, origpat));
+
if (!(pglob->gl_flags & GLOB_NOSORT))
qsort(pglob->gl_pathv + pglob->gl_offs + oldpathc,
pglob->gl_pathc - oldpathc, sizeof(char *), compare);
@@ -750,16 +739,10 @@ glob3(Char *pathbuf, Char *pathend, Char
if ((dirp = g_opendir(pathbuf, pglob)) == NULL) {
if (errno == ENOENT || errno == ENOTDIR)
return (0);
-   if ((pglob->gl_errfunc != NULL &&
-   pglob->gl_errfunc(buf, errno)) ||
-   (pglob->gl_flags & GLOB_ERR)) {
-   if (errno == 0)
-   errno = saverrno;
-   return (GLOB_ABORTED);
-   }
+   err = err_aborted(pglob, errno, buf);
if (errno == 0)
errno = saverrno;
-   return (0);
+   return (err);
}
 
err = 0;
@@ -809,11 +792,9 @@ glob3(Char *pathbuf, Char *pathend, Char
}
sc += clen;
}
-   if (too_long && ((pglob->gl_errfunc != NULL &&
-   pglob->gl_errfunc(buf, ENAMETOOLONG)) ||
-   (pglob->gl_flags & GLOB_ERR))) {
+   if (too_long && (err = err_aborted(pglob, ENAMETOOLONG,
+   buf))) {
errno = ENAMETOOLONG;
-   err = GLOB_ABORTED;
break;
}
if (too_long || !match(pathend, pattern, restpattern)) {
@@ -840,9 

svn commit: r303705 - head/sys/fs/pseudofs

2016-08-03 Thread Konstantin Belousov
Author: kib
Date: Wed Aug  3 08:57:15 2016
New Revision: 303705
URL: https://svnweb.freebsd.org/changeset/base/303705

Log:
  Remove Giant asserts.  Update comment.
  
  Owning Giant in the init/uninit is accidental due to the moment where
  VFS modules initialization is performed, and is not enforced by the
  VFS interface.  The Giant lock does not prevent a parallel execution
  of the code, it is VFS which implements the proper protocol.
  
  Approved by:  des (pseudofs maintainer)
  Sponsored by: The FreeBSD Foundation
  MFC after:1 week

Modified:
  head/sys/fs/pseudofs/pseudofs.c
  head/sys/fs/pseudofs/pseudofs.h
  head/sys/fs/pseudofs/pseudofs_fileno.c
  head/sys/fs/pseudofs/pseudofs_vncache.c

Modified: head/sys/fs/pseudofs/pseudofs.c
==
--- head/sys/fs/pseudofs/pseudofs.c Wed Aug  3 08:53:29 2016
(r303704)
+++ head/sys/fs/pseudofs/pseudofs.c Wed Aug  3 08:57:15 2016
(r303705)
@@ -383,8 +383,6 @@ pfs_init(struct pfs_info *pi, struct vfs
struct pfs_node *root;
int error;
 
-   mtx_assert(, MA_OWNED);
-
pfs_fileno_init(pi);
 
/* set up the root directory */
@@ -414,8 +412,6 @@ pfs_uninit(struct pfs_info *pi, struct v
 {
int error;
 
-   mtx_assert(, MA_OWNED);
-
pfs_destroy(pi->pi_root);
pi->pi_root = NULL;
pfs_fileno_uninit(pi);

Modified: head/sys/fs/pseudofs/pseudofs.h
==
--- head/sys/fs/pseudofs/pseudofs.h Wed Aug  3 08:53:29 2016
(r303704)
+++ head/sys/fs/pseudofs/pseudofs.h Wed Aug  3 08:57:15 2016
(r303705)
@@ -189,9 +189,9 @@ typedef int (*pfs_destroy_t)(PFS_DESTROY
 /*
  * pfs_info: describes a pseudofs instance
  *
- * The pi_mutex is only used to avoid using the global subr_unit lock for
- * unrhdr.  The rest of struct pfs_info is only modified while Giant is
- * held (during vfs_init() and vfs_uninit()).
+ * The pi_mutex is only used to avoid using the global subr_unit lock
+ * for unrhdr.  The rest of struct pfs_info is only modified during
+ * vfs_init() and vfs_uninit() of the consumer filesystem.
  */
 struct pfs_info {
char pi_name[PFS_FSNAMELEN];

Modified: head/sys/fs/pseudofs/pseudofs_fileno.c
==
--- head/sys/fs/pseudofs/pseudofs_fileno.c  Wed Aug  3 08:53:29 2016
(r303704)
+++ head/sys/fs/pseudofs/pseudofs_fileno.c  Wed Aug  3 08:57:15 2016
(r303705)
@@ -52,7 +52,6 @@ void
 pfs_fileno_init(struct pfs_info *pi)
 {
 
-   mtx_assert(, MA_OWNED);
mtx_init(>pi_mutex, "pfs_fileno", NULL, MTX_DEF);
pi->pi_unrhdr = new_unrhdr(3, INT_MAX / NO_PID, >pi_mutex);
 }
@@ -64,7 +63,6 @@ void
 pfs_fileno_uninit(struct pfs_info *pi)
 {
 
-   mtx_assert(, MA_OWNED);
delete_unrhdr(pi->pi_unrhdr);
pi->pi_unrhdr = NULL;
mtx_destroy(>pi_mutex);

Modified: head/sys/fs/pseudofs/pseudofs_vncache.c
==
--- head/sys/fs/pseudofs/pseudofs_vncache.c Wed Aug  3 08:53:29 2016
(r303704)
+++ head/sys/fs/pseudofs/pseudofs_vncache.c Wed Aug  3 08:57:15 2016
(r303705)
@@ -84,7 +84,6 @@ void
 pfs_vncache_load(void)
 {
 
-   mtx_assert(, MA_OWNED);
mtx_init(_vncache_mutex, "pfs_vncache", NULL, MTX_DEF);
pfs_exit_tag = EVENTHANDLER_REGISTER(process_exit, pfs_exit, NULL,
EVENTHANDLER_PRI_ANY);
@@ -97,7 +96,6 @@ void
 pfs_vncache_unload(void)
 {
 
-   mtx_assert(, MA_OWNED);
EVENTHANDLER_DEREGISTER(process_exit, pfs_exit_tag);
KASSERT(pfs_vncache_entries == 0,
("%d vncache entries remaining", pfs_vncache_entries));
___
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: r303704 - head/sys/fs/pseudofs

2016-08-03 Thread Konstantin Belousov
Author: kib
Date: Wed Aug  3 08:53:29 2016
New Revision: 303704
URL: https://svnweb.freebsd.org/changeset/base/303704

Log:
  Some style changes.  Fix a typo in comment.
  
  Approved by:  des (pseudofs maintainer)
  Sponsored by: The FreeBSD Foundation
  MFC after:1 week

Modified:
  head/sys/fs/pseudofs/pseudofs.c
  head/sys/fs/pseudofs/pseudofs.h

Modified: head/sys/fs/pseudofs/pseudofs.c
==
--- head/sys/fs/pseudofs/pseudofs.c Wed Aug  3 07:11:19 2016
(r303703)
+++ head/sys/fs/pseudofs/pseudofs.c Wed Aug  3 08:53:29 2016
(r303704)
@@ -387,7 +387,7 @@ pfs_init(struct pfs_info *pi, struct vfs
 
pfs_fileno_init(pi);
 
-   /* set up the root diretory */
+   /* set up the root directory */
root = pfs_alloc_node(pi, "/", pfstype_root);
pi->pi_root = root;
pfs_fileno_alloc(root);

Modified: head/sys/fs/pseudofs/pseudofs.h
==
--- head/sys/fs/pseudofs/pseudofs.h Wed Aug  3 07:11:19 2016
(r303703)
+++ head/sys/fs/pseudofs/pseudofs.h Wed Aug  3 08:53:29 2016
(r303704)
@@ -198,7 +198,7 @@ struct pfs_info {
pfs_init_t   pi_init;
pfs_init_t   pi_uninit;
 
-   /* members below this line are initialized at run time*/
+   /* members below this line are initialized at run time */
struct pfs_node *pi_root;
struct mtx   pi_mutex;
struct unrhdr   *pi_unrhdr;
@@ -285,17 +285,17 @@ static int
\
 _##name##_mount(struct mount *mp) {\
 if (jflag && !prison_allow(curthread->td_ucred, jflag))
\
 return (EPERM);
\
-   return pfs_mount(##_info, mp); \
+   return (pfs_mount(##_info, mp));   \
 }  \
\
 static int \
 _##name##_init(struct vfsconf *vfc) {  \
-   return pfs_init(##_info, vfc); \
+   return (pfs_init(##_info, vfc));   \
 }  \
\
 static int \
 _##name##_uninit(struct vfsconf *vfc) {
\
-   return pfs_uninit(##_info, vfc);   \
+   return (pfs_uninit(##_info, vfc)); \
 }  \
\
 static struct vfsops name##_vfsops = { \
___
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: r303703 - head/sys/vm

2016-08-03 Thread Konstantin Belousov
Author: kib
Date: Wed Aug  3 07:11:19 2016
New Revision: 303703
URL: https://svnweb.freebsd.org/changeset/base/303703

Log:
  Explain why swapgeom_close_ev() is delegated.
  
  Sponsored by: The FreeBSD Foundation
  MFC after:1 week

Modified:
  head/sys/vm/swap_pager.c

Modified: head/sys/vm/swap_pager.c
==
--- head/sys/vm/swap_pager.cWed Aug  3 07:10:09 2016(r303702)
+++ head/sys/vm/swap_pager.cWed Aug  3 07:11:19 2016(r303703)
@@ -2431,8 +2431,9 @@ swapgeom_acquire(struct g_consumer *cp)
 }
 
 /*
- * Remove a reference from the g_consumer. Post a close event if
- * all references go away.
+ * Remove a reference from the g_consumer.  Post a close event if all
+ * references go away, since the function might be called from the
+ * biodone context.
  */
 static void
 swapgeom_release(struct g_consumer *cp, struct swdevt *sp)
@@ -2555,7 +2556,12 @@ swapgeom_close(struct thread *td, struct
cp = sw->sw_id;
sw->sw_id = NULL;
mtx_unlock(_dev_mtx);
-   /* XXX: direct call when Giant untangled */
+
+   /*
+* swapgeom_close() may be called from the biodone context,
+* where we cannot perform topology changes.  Delegate the
+* work to the events thread.
+*/
if (cp != NULL)
g_waitfor_event(swapgeom_close_ev, cp, M_WAITOK, NULL);
 }
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r303702 - head/sys/kern

2016-08-03 Thread Konstantin Belousov
Author: kib
Date: Wed Aug  3 07:10:09 2016
New Revision: 303702
URL: https://svnweb.freebsd.org/changeset/base/303702

Log:
  Remove mention of the Giant from the fork_return() description.
  Making emphasis on this lock in the core function comment is confusing
  for the modern kernel.
  
  Sponsored by: The FreeBSD Foundation
  MFC after:3 days

Modified:
  head/sys/kern/kern_fork.c

Modified: head/sys/kern/kern_fork.c
==
--- head/sys/kern/kern_fork.c   Wed Aug  3 06:36:45 2016(r303701)
+++ head/sys/kern/kern_fork.c   Wed Aug  3 07:10:09 2016(r303702)
@@ -1055,9 +1055,9 @@ fork_exit(void (*callout)(void *, struct
 
 /*
  * Simplified back end of syscall(), used when returning from fork()
- * directly into user mode.  Giant is not held on entry, and must not
- * be held on return.  This function is passed in to fork_exit() as the
- * first parameter and is called when returning to a new userland process.
+ * directly into user mode.  This function is passed in to fork_exit()
+ * as the first parameter and is called when returning to a new
+ * userland process.
  */
 void
 fork_return(struct thread *td, struct trapframe *frame)
___
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: r303700 - head/sys/kern

2016-08-03 Thread Ed Schouten
Author: ed
Date: Wed Aug  3 06:35:58 2016
New Revision: 303700
URL: https://svnweb.freebsd.org/changeset/base/303700

Log:
  Re-add traling slash that was removed in r303699.
  
  I must have accidentally pressed some random key in vim.

Modified:
  head/sys/kern/syscalls.master

Modified: head/sys/kern/syscalls.master
==
--- head/sys/kern/syscalls.master   Wed Aug  3 06:33:04 2016
(r303699)
+++ head/sys/kern/syscalls.master   Wed Aug  3 06:35:58 2016
(r303700)
@@ -175,7 +175,7 @@
 72 AUE_O_VADVISE   STD { int ovadvise(int anom); } vadvise \
ovadvise_args int
 73 AUE_MUNMAP  STD { int munmap(void *addr, size_t len); }
-74 AUE_MPROTECTSTD { int mprotect(void *addr, size_t len, 
+74 AUE_MPROTECTSTD { int mprotect(void *addr, size_t len, \
int prot); }
 75 AUE_MADVISE STD { int madvise(void *addr, size_t len, \
int behav); }
___
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: r303701 - in head/sys: compat/freebsd32 kern sys

2016-08-03 Thread Ed Schouten
Author: ed
Date: Wed Aug  3 06:36:45 2016
New Revision: 303701
URL: https://svnweb.freebsd.org/changeset/base/303701

Log:
  Regenerate system call tables for r303699 and r303700.

Modified:
  head/sys/compat/freebsd32/freebsd32_proto.h
  head/sys/compat/freebsd32/freebsd32_syscall.h
  head/sys/compat/freebsd32/freebsd32_syscalls.c
  head/sys/compat/freebsd32/freebsd32_sysent.c
  head/sys/compat/freebsd32/freebsd32_systrace_args.c
  head/sys/kern/init_sysent.c
  head/sys/kern/syscalls.c
  head/sys/kern/systrace_args.c
  head/sys/sys/syscall.h
  head/sys/sys/syscall.mk
  head/sys/sys/sysproto.h

Modified: head/sys/compat/freebsd32/freebsd32_proto.h
==
--- head/sys/compat/freebsd32/freebsd32_proto.h Wed Aug  3 06:35:58 2016
(r303700)
+++ head/sys/compat/freebsd32/freebsd32_proto.h Wed Aug  3 06:36:45 2016
(r303701)
@@ -3,7 +3,7 @@
  *
  * DO NOT EDIT-- this file is automatically generated.
  * $FreeBSD$
- * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 302094 
2016-06-22 21:15:59Z brooks 
+ * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 303699 
2016-08-03 06:33:04Z ed 
  */
 
 #ifndef _FREEBSD32_SYSPROTO_H_
@@ -82,7 +82,7 @@ struct freebsd32_execve_args {
char envv_l_[PADL_(uint32_t *)]; uint32_t * envv; char 
envv_r_[PADR_(uint32_t *)];
 };
 struct freebsd32_mprotect_args {
-   char addr_l_[PADL_(const void *)]; const void * addr; char 
addr_r_[PADR_(const void *)];
+   char addr_l_[PADL_(void *)]; void * addr; char addr_r_[PADR_(void *)];
char len_l_[PADL_(size_t)]; size_t len; char len_r_[PADR_(size_t)];
char prot_l_[PADL_(int)]; int prot; char prot_r_[PADR_(int)];
 };

Modified: head/sys/compat/freebsd32/freebsd32_syscall.h
==
--- head/sys/compat/freebsd32/freebsd32_syscall.h   Wed Aug  3 06:35:58 
2016(r303700)
+++ head/sys/compat/freebsd32/freebsd32_syscall.h   Wed Aug  3 06:36:45 
2016(r303701)
@@ -3,7 +3,7 @@
  *
  * DO NOT EDIT-- this file is automatically generated.
  * $FreeBSD$
- * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 302094 
2016-06-22 21:15:59Z brooks 
+ * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 303699 
2016-08-03 06:33:04Z ed 
  */
 
 #defineFREEBSD32_SYS_syscall   0

Modified: head/sys/compat/freebsd32/freebsd32_syscalls.c
==
--- head/sys/compat/freebsd32/freebsd32_syscalls.c  Wed Aug  3 06:35:58 
2016(r303700)
+++ head/sys/compat/freebsd32/freebsd32_syscalls.c  Wed Aug  3 06:36:45 
2016(r303701)
@@ -3,7 +3,7 @@
  *
  * DO NOT EDIT-- this file is automatically generated.
  * $FreeBSD$
- * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 302094 
2016-06-22 21:15:59Z brooks 
+ * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 303699 
2016-08-03 06:33:04Z ed 
  */
 
 const char *freebsd32_syscallnames[] = {

Modified: head/sys/compat/freebsd32/freebsd32_sysent.c
==
--- head/sys/compat/freebsd32/freebsd32_sysent.cWed Aug  3 06:35:58 
2016(r303700)
+++ head/sys/compat/freebsd32/freebsd32_sysent.cWed Aug  3 06:36:45 
2016(r303701)
@@ -3,7 +3,7 @@
  *
  * DO NOT EDIT-- this file is automatically generated.
  * $FreeBSD$
- * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 302094 
2016-06-22 21:15:59Z brooks 
+ * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 303699 
2016-08-03 06:33:04Z ed 
  */
 
 #include "opt_compat.h"

Modified: head/sys/compat/freebsd32/freebsd32_systrace_args.c
==
--- head/sys/compat/freebsd32/freebsd32_systrace_args.c Wed Aug  3 06:35:58 
2016(r303700)
+++ head/sys/compat/freebsd32/freebsd32_systrace_args.c Wed Aug  3 06:36:45 
2016(r303701)
@@ -462,7 +462,7 @@ systrace_args(int sysnum, void *params, 
/* freebsd32_mprotect */
case 74: {
struct freebsd32_mprotect_args *p = params;
-   uarg[0] = (intptr_t) p->addr; /* const void * */
+   uarg[0] = (intptr_t) p->addr; /* void * */
uarg[1] = p->len; /* size_t */
iarg[2] = p->prot; /* int */
*n_args = 3;
@@ -4020,7 +4020,7 @@ systrace_entry_setargdesc(int sysnum, in
case 74:
switch(ndx) {
case 0:
-   p = "const void *";
+   p = "void *";
break;
case 1:
p = "size_t";

Modified: head/sys/kern/init_sysent.c
==
--- head/sys/kern/init_sysent.c Wed 

svn commit: r303699 - in head: lib/libc/sys sys/compat/freebsd32 sys/kern sys/sys

2016-08-03 Thread Ed Schouten
Author: ed
Date: Wed Aug  3 06:33:04 2016
New Revision: 303699
URL: https://svnweb.freebsd.org/changeset/base/303699

Log:
  mprotect(): Change prototype to comply to POSIX.
  
  Our mprotect() function seems to take a "const void *" address to the
  pages whose permissions need to be adjusted. POSIX uses "void *". Simply
  stick to the POSIX one to prevent us from writing unportable code.
  
  PR:   211423 (exp-run)
  Tested by:antoine@ (Thanks!)

Modified:
  head/lib/libc/sys/mprotect.2
  head/sys/compat/freebsd32/syscalls.master
  head/sys/kern/syscalls.master
  head/sys/sys/mman.h

Modified: head/lib/libc/sys/mprotect.2
==
--- head/lib/libc/sys/mprotect.2Wed Aug  3 06:32:44 2016
(r303698)
+++ head/lib/libc/sys/mprotect.2Wed Aug  3 06:33:04 2016
(r303699)
@@ -28,7 +28,7 @@
 .\"@(#)mprotect.2  8.1 (Berkeley) 6/9/93
 .\" $FreeBSD$
 .\"
-.Dd June 9, 1993
+.Dd August 3, 2016
 .Dt MPROTECT 2
 .Os
 .Sh NAME
@@ -39,7 +39,7 @@
 .Sh SYNOPSIS
 .In sys/mman.h
 .Ft int
-.Fn mprotect "const void *addr" "size_t len" "int prot"
+.Fn mprotect "void *addr" "size_t len" "int prot"
 .Sh DESCRIPTION
 The
 .Fn mprotect

Modified: head/sys/compat/freebsd32/syscalls.master
==
--- head/sys/compat/freebsd32/syscalls.master   Wed Aug  3 06:32:44 2016
(r303698)
+++ head/sys/compat/freebsd32/syscalls.master   Wed Aug  3 06:33:04 2016
(r303699)
@@ -174,7 +174,7 @@
 72 AUE_O_VADVISE   NOPROTO { int ovadvise(int anom); } vadvise \
ovadvise_args int
 73 AUE_MUNMAP  NOPROTO { int munmap(void *addr, size_t len); }
-74 AUE_MPROTECTSTD { int freebsd32_mprotect(const void *addr, \
+74 AUE_MPROTECTSTD { int freebsd32_mprotect(void *addr, \
size_t len, int prot); }
 75 AUE_MADVISE NOPROTO { int madvise(void *addr, size_t len, \
int behav); }

Modified: head/sys/kern/syscalls.master
==
--- head/sys/kern/syscalls.master   Wed Aug  3 06:32:44 2016
(r303698)
+++ head/sys/kern/syscalls.master   Wed Aug  3 06:33:04 2016
(r303699)
@@ -175,7 +175,7 @@
 72 AUE_O_VADVISE   STD { int ovadvise(int anom); } vadvise \
ovadvise_args int
 73 AUE_MUNMAP  STD { int munmap(void *addr, size_t len); }
-74 AUE_MPROTECTSTD { int mprotect(const void *addr, size_t len, \
+74 AUE_MPROTECTSTD { int mprotect(void *addr, size_t len, 
int prot); }
 75 AUE_MADVISE STD { int madvise(void *addr, size_t len, \
int behav); }

Modified: head/sys/sys/mman.h
==
--- head/sys/sys/mman.h Wed Aug  3 06:32:44 2016(r303698)
+++ head/sys/sys/mman.h Wed Aug  3 06:33:04 2016(r303699)
@@ -258,7 +258,7 @@ int mlock(const void *, size_t);
 #define_MMAP_DECLARED
 void * mmap(void *, size_t, int, int, int, off_t);
 #endif
-intmprotect(const void *, size_t, int);
+intmprotect(void *, size_t, int);
 intmsync(void *, size_t, int);
 intmunlock(const void *, size_t);
 intmunmap(void *, size_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"