Re: svn commit: r301453 - in head/sys: arm/arm arm64/arm64 dev/fdt dev/gpio dev/iicbus dev/ofw dev/pci dev/vnic kern mips/mips sys

2016-07-21 Thread Nathan Whitehorn



On 07/21/16 14:35, John Baldwin wrote:

On Thursday, July 21, 2016 01:37:42 PM Andrew Turner wrote:

On Wed, 20 Jul 2016 13:28:53 +0200
Michal Meloun  wrote:

Dne 19.07.2016 v 17:06 Nathan Whitehorn napsal(a):

2. It partially duplicates the functionality of OFW_BUS_MAP_INTR(),
but is both problematically more general and less flexible (it has
requirements on timing of PIC attachment vs. driver resource
allocation)

OFW_BUS_MAP_INTR()  can parse only OFW  based data and expect that
parsed data are magicaly stored within the call.
The new method, bus_map_intr(),  can parse data from multiple sources
(OFW, UEFI / ACPI, synthetic[gpio device + pin number]).  It also
returns parsed data back to caller.
And no, it  doesn't  add any additional timing requirements .

I've been looking at ACPI on arm64. So far I have not found the need
for this with ACPI as we don't need to send the data to the interrupt
controller driver to be parsed in the way OFW/FDT needs to.

ACPI though has a gross hack where we call BUS_CONFIG_INTR on the IRQ
in bus_alloc_resource().


I hadn't realized that. It looks like you could do essentially the same 
thing we do on PowerPC to clean this up by explicitly mapping the ACPI 
interrupt domains to different PICs with varying default interrupt 
properties.



What I had advocated in the discussions
leading up to this was to have some sort of opaque structure containing
a set of properties (the sort of thing bus_map_resource and make_dev_s
use) that was passed up at bus_setup_intr() time.



I think it should now
be passed up at bus_alloc_resource() time instead, but it would allow bus
drivers to "decorate" a SYS_RES_IRQ request as it goes up the device tree
with properties that the interrupt controller can then associate with
the IRQ cookie it allocates in its own code.



We used to do this on PPC and MIPS, and the current code still supports 
it, but it turned out not to be useful in the end for IRQs. The 
hierarchy for IRQs rarely (read: almost never) follows the bus hierarchy 
and often is enumerated in a different order. I have hardware, for 
example, where the children of a single parent bus are all wired to 
different interrupt controllers and sometimes to a mixture of interrupt 
controllers. Those controllers are cascaded in ways that cross the 
newbus tree laterally and, on some of them, the parent device from the 
bus topology has interrupts handled by its own (bus) children. Trying to 
make the newbus parents do something sensible with all of this would be 
crazy and, in the case where parents depend on resources provided by 
their own children, impossible.


This is all to say that, since you want the interrupts to be decorated 
along a path that usually has nothing to do with the newbus hierarchy, 
it doesn't add much to add extra features to resource allocation. 
ofw_bus_map_intr() is a newbus method to support this kind of thing but, 
on all supported platforms, it is implemented only in nexus and no cases 
have appeared where anyone ever wanted anything at the intermediate layers.



I would let the particular
structure have different layouts for different resource types.  On x86 we
would replace bus_config_intr by passing the level and trigger-mode in
this structure.  However, I could also see allowing the memattr to be
set for a SYS_RES_MEMORY resource so you could have a much shorter way
than an explicit bus_map_resource to map an entire BAR as WC for example:

 struct alloc_resource_args {
 size_t len;
 union {
 struct {
 enum intr_trigger trigger;
 enum intr_polarity polarity;
 } irq;
 struct {
 vm_memattr_t memattr;
 } memory;
 }
 }

...

 union alloc_resource_args args;

 init_alloc_resource_args(, sizeof(args));
 args.memattr = VM_MEMATTR_WRITE_COMBINING;

 /* Uses WC for the implicit mapping. */
 res = bus_alloc_resource(, );

...

foobus_alloc_resource(..., union alloc_resource_args *args)
{
 union alloc_resource_args args2;

 switch (type) {
 case SYS_RES_IRQ:
 if (args == NULL) {
 init_alloc_resource_args(, sizeof(args2));
 args = 
 }
 /* Replace call to BUS_CONFIG_INTR on ACPI: */
 if (args->irq.polarity == INTR_POLARITY_CONFORMING &&
 device_has_polarity_from_CRS)
 args->irq.polarity = polarity_from_CRS;
 ...
}

However, you could associate arbitrary data with a resource request by
adding more members to the approriate struct in the union.



For memory, I think this is an interesting concept, but it really 
doesn't match well with what you would want to do for interrupts or for, 
say, GPIOs in which the lines of control are fundamentally unrelated to 
the newbus hierarchy.

-Nathan
___
svn-src-all@freebsd.org 

svn commit: r303182 - head/sys/dev/hyperv/vmbus

2016-07-21 Thread Sepherosa Ziehau
Author: sephe
Date: Fri Jul 22 05:09:08 2016
New Revision: 303182
URL: https://svnweb.freebsd.org/changeset/base/303182

Log:
  hyperv/vmbus: Move vmbus bufring definition to vmbus_reg.h
  
  And add more comment about its fields.
  
  MFC after:1 week
  Sponsored by: Microsoft OSTC
  Differential Revision:https://reviews.freebsd.org/D7269

Modified:
  head/sys/dev/hyperv/vmbus/hv_ring_buffer.c
  head/sys/dev/hyperv/vmbus/vmbus_chanvar.h
  head/sys/dev/hyperv/vmbus/vmbus_reg.h

Modified: head/sys/dev/hyperv/vmbus/hv_ring_buffer.c
==
--- head/sys/dev/hyperv/vmbus/hv_ring_buffer.c  Fri Jul 22 03:48:44 2016
(r303181)
+++ head/sys/dev/hyperv/vmbus/hv_ring_buffer.c  Fri Jul 22 05:09:08 2016
(r303182)
@@ -32,6 +32,7 @@
 #include 
 
 #include "hv_vmbus_priv.h"
+#include 
 
 /* Amount of space to write to */
 #defineHV_BYTES_AVAIL_TO_WRITE(r, w, z)\
@@ -50,9 +51,9 @@ vmbus_br_sysctl_state(SYSCTL_HANDLER_ARG
uint32_t rindex, windex, intr_mask, ravail, wavail;
char state[256];
 
-   rindex = br->ring_buffer->read_index;
-   windex = br->ring_buffer->write_index;
-   intr_mask = br->ring_buffer->interrupt_mask;
+   rindex = br->ring_buffer->br_rindex;
+   windex = br->ring_buffer->br_windex;
+   intr_mask = br->ring_buffer->br_imask;
wavail = HV_BYTES_AVAIL_TO_WRITE(rindex, windex, br->ring_data_size);
ravail = br->ring_data_size - wavail;
 
@@ -78,13 +79,13 @@ vmbus_br_sysctl_state_bin(SYSCTL_HANDLER
const hv_vmbus_ring_buffer_info *br = arg1;
uint32_t rindex, windex, wavail, state[BR_STATE_MAX];
 
-   rindex = br->ring_buffer->read_index;
-   windex = br->ring_buffer->write_index;
+   rindex = br->ring_buffer->br_rindex;
+   windex = br->ring_buffer->br_windex;
wavail = HV_BYTES_AVAIL_TO_WRITE(rindex, windex, br->ring_data_size);
 
state[BR_STATE_RIDX] = rindex;
state[BR_STATE_WIDX] = windex;
-   state[BR_STATE_IMSK] = br->ring_buffer->interrupt_mask;
+   state[BR_STATE_IMSK] = br->ring_buffer->br_imask;
state[BR_STATE_WSPC] = wavail;
state[BR_STATE_RSPC] = br->ring_data_size - wavail;
 
@@ -127,8 +128,8 @@ get_ring_buffer_avail_bytes(hv_vmbus_rin
/*
 * Capture the read/write indices before they changed
 */
-   read_loc = rbi->ring_buffer->read_index;
-   write_loc = rbi->ring_buffer->write_index;
+   read_loc = rbi->ring_buffer->br_rindex;
+   write_loc = rbi->ring_buffer->br_windex;
 
*write = HV_BYTES_AVAIL_TO_WRITE(read_loc, write_loc,
rbi->ring_data_size);
@@ -141,7 +142,7 @@ get_ring_buffer_avail_bytes(hv_vmbus_rin
 static __inline uint32_t
 get_next_write_location(hv_vmbus_ring_buffer_info *ring_info)
 {
-   return ring_info->ring_buffer->write_index;
+   return ring_info->ring_buffer->br_windex;
 }
 
 /**
@@ -151,7 +152,7 @@ static __inline void
 set_next_write_location(hv_vmbus_ring_buffer_info *ring_info,
 uint32_t next_write_location)
 {
-   ring_info->ring_buffer->write_index = next_write_location;
+   ring_info->ring_buffer->br_windex = next_write_location;
 }
 
 /**
@@ -160,7 +161,7 @@ set_next_write_location(hv_vmbus_ring_bu
 static __inline uint32_t
 get_next_read_location(hv_vmbus_ring_buffer_info *ring_info)
 {
-   return ring_info->ring_buffer->read_index;
+   return ring_info->ring_buffer->br_rindex;
 }
 
 /**
@@ -171,7 +172,7 @@ static __inline uint32_t
 get_next_read_location_with_offset(hv_vmbus_ring_buffer_info *ring_info,
 uint32_t offset)
 {
-   uint32_t next = ring_info->ring_buffer->read_index;
+   uint32_t next = ring_info->ring_buffer->br_rindex;
 
next += offset;
next %= ring_info->ring_data_size;
@@ -185,7 +186,7 @@ static __inline void
 set_next_read_location(hv_vmbus_ring_buffer_info *ring_info,
 uint32_t next_read_location)
 {
-   ring_info->ring_buffer->read_index = next_read_location;
+   ring_info->ring_buffer->br_rindex = next_read_location;
 }
 
 /**
@@ -194,7 +195,7 @@ set_next_read_location(hv_vmbus_ring_buf
 static __inline void *
 get_ring_buffer(hv_vmbus_ring_buffer_info *ring_info)
 {
-   return ring_info->ring_buffer->buffer;
+   return ring_info->ring_buffer->br_data;
 }
 
 /**
@@ -212,13 +213,13 @@ get_ring_buffer_size(hv_vmbus_ring_buffe
 static __inline uint64_t
 get_ring_buffer_indices(hv_vmbus_ring_buffer_info *ring_info)
 {
-   return ((uint64_t)ring_info->ring_buffer->write_index) << 32;
+   return ((uint64_t)ring_info->ring_buffer->br_windex) << 32;
 }
 
 void
 hv_ring_buffer_read_begin(hv_vmbus_ring_buffer_info *ring_info)
 {
-   ring_info->ring_buffer->interrupt_mask = 1;
+   ring_info->ring_buffer->br_imask = 1;
mb();
 }
 
@@ -227,7 +228,7 @@ hv_ring_buffer_read_end(hv_vmbus_ring_bu
 {
uint32_t read, write;
 
-   

Re: svn commit: r303146 - head/usr.bin/sed

2016-07-21 Thread Alexey Dokuchaev
On Thu, Jul 21, 2016 at 02:17:36PM +, Pedro F. Giffuni wrote:
> New Revision: 303146
> URL: https://svnweb.freebsd.org/changeset/base/303146
> 
> Log:
>   sed(1): Appease older GCC.

Isn't it also being dictated by style(9) and common sense? :)

./danfe

> Modified:
>   head/usr.bin/sed/process.c
> 
> @@ -97,11 +97,12 @@ process(void)
>  {
>   struct s_command *cp;
>   SPACE tspace;
> - size_t oldpsl = 0;
> + size_t oldpsl;
>   char *p;
>   int oldpsanl;
>  
>   p = NULL;
> + oldpsanl = oldpsl = 0;
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r303181 - stable/10/sys/dev/e1000

2016-07-21 Thread Sean Bruno
Author: sbruno
Date: Fri Jul 22 03:48:44 2016
New Revision: 303181
URL: https://svnweb.freebsd.org/changeset/base/303181

Log:
  MFC r303110
  Remove uneeded parens.

Modified:
  stable/10/sys/dev/e1000/if_igb.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/dev/e1000/if_igb.c
==
--- stable/10/sys/dev/e1000/if_igb.cFri Jul 22 03:42:32 2016
(r303180)
+++ stable/10/sys/dev/e1000/if_igb.cFri Jul 22 03:48:44 2016
(r303181)
@@ -1091,7 +1091,7 @@ igb_ioctl(struct ifnet *ifp, u_long comm
ifp->if_mtu = ifr->ifr_mtu;
adapter->max_frame_size =
ifp->if_mtu + ETHER_HDR_LEN + ETHER_CRC_LEN;
-   if ((ifp->if_drv_flags & IFF_DRV_RUNNING))
+   if (ifp->if_drv_flags & IFF_DRV_RUNNING)
igb_init_locked(adapter);
IGB_CORE_UNLOCK(adapter);
break;
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r303180 - head/sys/dev/hyperv/vmbus

2016-07-21 Thread Sepherosa Ziehau
Author: sephe
Date: Fri Jul 22 03:42:32 2016
New Revision: 303180
URL: https://svnweb.freebsd.org/changeset/base/303180

Log:
  hyperv/vmbus: Cleanup and augment bufring sysctl tree creation
  
  Binary state node is added, so that userland programs do not have
  to parse human readable state string.
  
  MFC after:1 week
  Sponsored by: Microsoft OSTC
  Differential Revision:https://reviews.freebsd.org/D7268

Modified:
  head/sys/dev/hyperv/vmbus/hv_ring_buffer.c
  head/sys/dev/hyperv/vmbus/hv_vmbus_priv.h
  head/sys/dev/hyperv/vmbus/vmbus_chan.c

Modified: head/sys/dev/hyperv/vmbus/hv_ring_buffer.c
==
--- head/sys/dev/hyperv/vmbus/hv_ring_buffer.c  Fri Jul 22 03:34:15 2016
(r303179)
+++ head/sys/dev/hyperv/vmbus/hv_ring_buffer.c  Fri Jul 22 03:42:32 2016
(r303180)
@@ -44,36 +44,74 @@ static uint32_t copy_from_ring_buffer(hv
char *dest, uint32_t dest_len, uint32_t start_read_offset);
 
 static int
-hv_rbi_sysctl_stats(SYSCTL_HANDLER_ARGS)
+vmbus_br_sysctl_state(SYSCTL_HANDLER_ARGS)
 {
-   hv_vmbus_ring_buffer_info* rbi;
-   uint32_t read_index, write_index, interrupt_mask, sz;
-   uint32_t read_avail, write_avail;
-   char rbi_stats[256];
-
-   rbi = (hv_vmbus_ring_buffer_info*)arg1;
-   read_index = rbi->ring_buffer->read_index;
-   write_index = rbi->ring_buffer->write_index;
-   interrupt_mask = rbi->ring_buffer->interrupt_mask;
-   sz = rbi->ring_data_size;
-   write_avail = HV_BYTES_AVAIL_TO_WRITE(read_index,
-   write_index, sz);
-   read_avail = sz - write_avail;
-
-   snprintf(rbi_stats, sizeof(rbi_stats),
-   "r_idx:%d w_idx:%d int_mask:%d r_avail:%d w_avail:%d",
-   read_index, write_index, interrupt_mask, read_avail, write_avail);
-   return sysctl_handle_string(oidp, rbi_stats, sizeof(rbi_stats), req);
+   const hv_vmbus_ring_buffer_info *br = arg1;
+   uint32_t rindex, windex, intr_mask, ravail, wavail;
+   char state[256];
+
+   rindex = br->ring_buffer->read_index;
+   windex = br->ring_buffer->write_index;
+   intr_mask = br->ring_buffer->interrupt_mask;
+   wavail = HV_BYTES_AVAIL_TO_WRITE(rindex, windex, br->ring_data_size);
+   ravail = br->ring_data_size - wavail;
+
+   snprintf(state, sizeof(state),
+   "rindex:%u windex:%u intr_mask:%u ravail:%u wavail:%u",
+   rindex, windex, intr_mask, ravail, wavail);
+   return sysctl_handle_string(oidp, state, sizeof(state), req);
+}
+
+/*
+ * Binary bufring states.
+ */
+static int
+vmbus_br_sysctl_state_bin(SYSCTL_HANDLER_ARGS)
+{
+#define BR_STATE_RIDX  0
+#define BR_STATE_WIDX  1
+#define BR_STATE_IMSK  2
+#define BR_STATE_RSPC  3
+#define BR_STATE_WSPC  4
+#define BR_STATE_MAX   5
+
+   const hv_vmbus_ring_buffer_info *br = arg1;
+   uint32_t rindex, windex, wavail, state[BR_STATE_MAX];
+
+   rindex = br->ring_buffer->read_index;
+   windex = br->ring_buffer->write_index;
+   wavail = HV_BYTES_AVAIL_TO_WRITE(rindex, windex, br->ring_data_size);
+
+   state[BR_STATE_RIDX] = rindex;
+   state[BR_STATE_WIDX] = windex;
+   state[BR_STATE_IMSK] = br->ring_buffer->interrupt_mask;
+   state[BR_STATE_WSPC] = wavail;
+   state[BR_STATE_RSPC] = br->ring_data_size - wavail;
+
+   return sysctl_handle_opaque(oidp, state, sizeof(state), req);
 }
 
 void
-hv_ring_buffer_stat(struct sysctl_ctx_list *ctx,
-struct sysctl_oid_list *tree_node, hv_vmbus_ring_buffer_info *rbi,
-const char *desc)
-{
-   SYSCTL_ADD_PROC(ctx, tree_node, OID_AUTO,
-   "ring_buffer_stats", CTLTYPE_STRING|CTLFLAG_RD|CTLFLAG_MPSAFE,
-   rbi, 0, hv_rbi_sysctl_stats, "A", desc);
+vmbus_br_sysctl_create(struct sysctl_ctx_list *ctx, struct sysctl_oid *br_tree,
+hv_vmbus_ring_buffer_info *br, const char *name)
+{
+   struct sysctl_oid *tree;
+   char desc[64];
+
+   tree = SYSCTL_ADD_NODE(ctx, SYSCTL_CHILDREN(br_tree), OID_AUTO,
+   name, CTLFLAG_RD | CTLFLAG_MPSAFE, 0, "");
+   if (tree == NULL)
+   return;
+
+   snprintf(desc, sizeof(desc), "%s state", name);
+   SYSCTL_ADD_PROC(ctx, SYSCTL_CHILDREN(tree), OID_AUTO, "state",
+   CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_MPSAFE,
+   br, 0, vmbus_br_sysctl_state, "A", desc);
+
+   snprintf(desc, sizeof(desc), "%s binary state", name);
+   SYSCTL_ADD_PROC(ctx, SYSCTL_CHILDREN(tree), OID_AUTO, "state_bin",
+   CTLTYPE_OPAQUE | CTLFLAG_RD | CTLFLAG_MPSAFE,
+   br, 0, vmbus_br_sysctl_state_bin, "IU", desc);
 }
 
 /**

Modified: head/sys/dev/hyperv/vmbus/hv_vmbus_priv.h
==
--- head/sys/dev/hyperv/vmbus/hv_vmbus_priv.h   Fri Jul 22 03:34:15 2016
(r303179)
+++ head/sys/dev/hyperv/vmbus/hv_vmbus_priv.h   Fri Jul 22 03:42:32 2016
(r303180)

svn commit: r303179 - stable/10/sys/cam/scsi

2016-07-21 Thread Sean Bruno
Author: sbruno
Date: Fri Jul 22 03:34:15 2016
New Revision: 303179
URL: https://svnweb.freebsd.org/changeset/base/303179

Log:
  MFC r302281
  Correct PERSISTENT RESERVE OUT command and populate scsi_cmd->length.
  
  PR:   202625

Modified:
  stable/10/sys/cam/scsi/scsi_all.c

Modified: stable/10/sys/cam/scsi/scsi_all.c
==
--- stable/10/sys/cam/scsi/scsi_all.c   Fri Jul 22 03:30:00 2016
(r303178)
+++ stable/10/sys/cam/scsi/scsi_all.c   Fri Jul 22 03:34:15 2016
(r303179)
@@ -8539,6 +8539,7 @@ scsi_persistent_reserve_out(struct ccb_s
scsi_cmd->opcode = PERSISTENT_RES_OUT;
scsi_cmd->action = service_action;
scsi_cmd->scope_type = scope | res_type;
+   scsi_ulto4b(dxfer_len, scsi_cmd->length);
 
cam_fill_csio(csio,
  retries,
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r303178 - head/sys/dev/hyperv/vmbus

2016-07-21 Thread Sepherosa Ziehau
Author: sephe
Date: Fri Jul 22 03:30:00 2016
New Revision: 303178
URL: https://svnweb.freebsd.org/changeset/base/303178

Log:
  hyperv/vmbus: Cosmetic bufring cleanup.
  
  MFC after:1 week
  Sponsored by: Microsoft OSTC
  Differential Revision:https://reviews.freebsd.org/D7267

Modified:
  head/sys/dev/hyperv/vmbus/hv_ring_buffer.c

Modified: head/sys/dev/hyperv/vmbus/hv_ring_buffer.c
==
--- head/sys/dev/hyperv/vmbus/hv_ring_buffer.c  Fri Jul 22 03:26:01 2016
(r303177)
+++ head/sys/dev/hyperv/vmbus/hv_ring_buffer.c  Fri Jul 22 03:30:00 2016
(r303178)
@@ -26,7 +26,6 @@
  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-
 #include 
 #include 
 #include 
@@ -35,8 +34,14 @@
 #include "hv_vmbus_priv.h"
 
 /* Amount of space to write to */
-#defineHV_BYTES_AVAIL_TO_WRITE(r, w, z) ((w) >= (r))? \
-   ((z) - ((w) - (r))):((r) - (w))
+#defineHV_BYTES_AVAIL_TO_WRITE(r, w, z)\
+   ((w) >= (r)) ? ((z) - ((w) - (r))) : ((r) - (w))
+
+static uint32_tcopy_to_ring_buffer(hv_vmbus_ring_buffer_info 
*ring_info,
+   uint32_t start_write_offset, const uint8_t *src,
+   uint32_t src_len);
+static uint32_t copy_from_ring_buffer(hv_vmbus_ring_buffer_info *ring_info,
+   char *dest, uint32_t dest_len, uint32_t start_read_offset);
 
 static int
 hv_rbi_sysctl_stats(SYSCTL_HANDLER_ARGS)
@@ -54,40 +59,30 @@ hv_rbi_sysctl_stats(SYSCTL_HANDLER_ARGS)
write_avail = HV_BYTES_AVAIL_TO_WRITE(read_index,
write_index, sz);
read_avail = sz - write_avail;
-   snprintf(rbi_stats, sizeof(rbi_stats),
-   "r_idx:%d "
-   "w_idx:%d "
-   "int_mask:%d "
-   "r_avail:%d "
-   "w_avail:%d",
-   read_index, write_index, interrupt_mask,
-   read_avail, write_avail);
 
-   return (sysctl_handle_string(oidp, rbi_stats,
-   sizeof(rbi_stats), req));
+   snprintf(rbi_stats, sizeof(rbi_stats),
+   "r_idx:%d w_idx:%d int_mask:%d r_avail:%d w_avail:%d",
+   read_index, write_index, interrupt_mask, read_avail, write_avail);
+   return sysctl_handle_string(oidp, rbi_stats, sizeof(rbi_stats), req);
 }
 
 void
-hv_ring_buffer_stat(
-   struct sysctl_ctx_list  *ctx,
-   struct sysctl_oid_list  *tree_node,
-   hv_vmbus_ring_buffer_info   *rbi,
-   const char  *desc)  
+hv_ring_buffer_stat(struct sysctl_ctx_list *ctx,
+struct sysctl_oid_list *tree_node, hv_vmbus_ring_buffer_info *rbi,
+const char *desc)
 {
SYSCTL_ADD_PROC(ctx, tree_node, OID_AUTO,
-   "ring_buffer_stats",
-   CTLTYPE_STRING|CTLFLAG_RD|CTLFLAG_MPSAFE, rbi, 0,
-   hv_rbi_sysctl_stats, "A", desc);
+   "ring_buffer_stats", CTLTYPE_STRING|CTLFLAG_RD|CTLFLAG_MPSAFE,
+   rbi, 0, hv_rbi_sysctl_stats, "A", desc);
 }
+
 /**
  * @brief Get number of bytes available to read and to write to
  * for the specified ring buffer
  */
-static inline void
-get_ring_buffer_avail_bytes(
-   hv_vmbus_ring_buffer_info*  rbi,
-   uint32_t*   read,
-   uint32_t*   write)
+static __inline void
+get_ring_buffer_avail_bytes(hv_vmbus_ring_buffer_info *rbi, uint32_t *read,
+uint32_t *write)
 {
uint32_t read_loc, write_loc;
 
@@ -97,28 +92,26 @@ get_ring_buffer_avail_bytes(
read_loc = rbi->ring_buffer->read_index;
write_loc = rbi->ring_buffer->write_index;
 
-   *write = HV_BYTES_AVAIL_TO_WRITE(
-   read_loc, write_loc, rbi->ring_data_size);
+   *write = HV_BYTES_AVAIL_TO_WRITE(read_loc, write_loc,
+   rbi->ring_data_size);
*read = rbi->ring_data_size - *write;
 }
 
 /**
  * @brief Get the next write location for the specified ring buffer
  */
-static inline uint32_t
-get_next_write_location(hv_vmbus_ring_buffer_info* ring_info) 
+static __inline uint32_t
+get_next_write_location(hv_vmbus_ring_buffer_info *ring_info)
 {
-   uint32_t next = ring_info->ring_buffer->write_index;
-   return (next);
+   return ring_info->ring_buffer->write_index;
 }
 
 /**
  * @brief Set the next write location for the specified ring buffer
  */
-static inline void
-set_next_write_location(
-   hv_vmbus_ring_buffer_info*  ring_info,
-   uint32_tnext_write_location)
+static __inline void
+set_next_write_location(hv_vmbus_ring_buffer_info *ring_info,
+uint32_t next_write_location)
 {
ring_info->ring_buffer->write_index = next_write_location;
 }
@@ -126,23 +119,22 @@ set_next_write_location(
 /**
  * @brief Get the next read location for the specified ring buffer
  */
-static inline uint32_t
-get_next_read_location(hv_vmbus_ring_buffer_info* ring_info) 

svn commit: r303177 - stable/10/sys/dev/an

2016-07-21 Thread Sean Bruno
Author: sbruno
Date: Fri Jul 22 03:26:01 2016
New Revision: 303177
URL: https://svnweb.freebsd.org/changeset/base/303177

Log:
  MFC r300612
  Reject ioctl commands for FLSHGCHR and FLSHPCHR if the size is greater
  than sc->areq.  This is a bounds check to ensure we're not just cramming
  arbitrarily sized nonsense into the driver and overflowing the heap.
  
  PR:   209545

Modified:
  stable/10/sys/dev/an/if_an.c

Modified: stable/10/sys/dev/an/if_an.c
==
--- stable/10/sys/dev/an/if_an.cFri Jul 22 03:21:47 2016
(r303176)
+++ stable/10/sys/dev/an/if_an.cFri Jul 22 03:26:01 2016
(r303177)
@@ -3777,6 +3777,9 @@ flashcard(struct ifnet *ifp, struct airo
return ENOBUFS;
break;
case AIROFLSHGCHR:  /* Get char from aux */
+   if (l_ioctl->len > sizeof(sc->areq)) {
+   return -EINVAL;
+   }
AN_UNLOCK(sc);
status = copyin(l_ioctl->data, >areq, l_ioctl->len);
AN_LOCK(sc);
@@ -3788,6 +3791,9 @@ flashcard(struct ifnet *ifp, struct airo
else
return -1;
case AIROFLSHPCHR:  /* Send char to card. */
+   if (l_ioctl->len > sizeof(sc->areq)) {
+   return -EINVAL;
+   }
AN_UNLOCK(sc);
status = copyin(l_ioctl->data, >areq, l_ioctl->len);
AN_LOCK(sc);
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r303176 - stable/10/sys/dev/ciss

2016-07-21 Thread Sean Bruno
Author: sbruno
Date: Fri Jul 22 03:21:47 2016
New Revision: 303176
URL: https://svnweb.freebsd.org/changeset/base/303176

Log:
  MFC r300551
  Update some of the TBD entries in ciss(4) to match what's in the pci
  IDS data.

Modified:
  stable/10/sys/dev/ciss/ciss.c

Modified: stable/10/sys/dev/ciss/ciss.c
==
--- stable/10/sys/dev/ciss/ciss.c   Fri Jul 22 03:19:49 2016
(r303175)
+++ stable/10/sys/dev/ciss/ciss.c   Fri Jul 22 03:21:47 2016
(r303176)
@@ -345,21 +345,22 @@ static struct
 { 0x103C, 0x1928, CISS_BOARD_SA5,   "HP Smart Array P230i" },
 { 0x103C, 0x1929, CISS_BOARD_SA5,   "HP Smart Array P530" },
 { 0x103C, 0x192A, CISS_BOARD_SA5,   "HP Smart Array P531" },
-{ 0x103C, 0x21BD, CISS_BOARD_SA5,   "HP Smart Array TBD" },
-{ 0x103C, 0x21BE, CISS_BOARD_SA5,   "HP Smart Array TBD" },
-{ 0x103C, 0x21BF, CISS_BOARD_SA5,   "HP Smart Array TBD" },
-{ 0x103C, 0x21C0, CISS_BOARD_SA5,   "HP Smart Array TBD" },
-{ 0x103C, 0x21C2, CISS_BOARD_SA5,   "HP Smart Array TBD" },
-{ 0x103C, 0x21C3, CISS_BOARD_SA5,   "HP Smart Array TBD" },
-{ 0x103C, 0x21C5, CISS_BOARD_SA5,   "HP Smart Array TBD" },
-{ 0x103C, 0x21C6, CISS_BOARD_SA5,   "HP Smart Array TBD" },
-{ 0x103C, 0x21C7, CISS_BOARD_SA5,   "HP Smart Array TBD" },
-{ 0x103C, 0x21C8, CISS_BOARD_SA5,   "HP Smart Array TBD" },
-{ 0x103C, 0x21CA, CISS_BOARD_SA5,   "HP Smart Array TBD" },
-{ 0x103C, 0x21CB, CISS_BOARD_SA5,   "HP Smart Array TBD" },
+{ 0x103C, 0x21BD, CISS_BOARD_SA5,   "HP Smart Array P244br" },
+{ 0x103C, 0x21BE, CISS_BOARD_SA5,   "HP Smart Array P741m" },
+{ 0x103C, 0x21BF, CISS_BOARD_SA5,   "HP Smart Array H240ar" },
+{ 0x103C, 0x21C0, CISS_BOARD_SA5,   "HP Smart Array P440ar" },
+{ 0x103C, 0x21C1, CISS_BOARD_SA5,   "HP Smart Array P840ar" },
+{ 0x103C, 0x21C2, CISS_BOARD_SA5,   "HP Smart Array P440" },
+{ 0x103C, 0x21C3, CISS_BOARD_SA5,   "HP Smart Array P441" },
+{ 0x103C, 0x21C5, CISS_BOARD_SA5,   "HP Smart Array P841" },
+{ 0x103C, 0x21C6, CISS_BOARD_SA5,   "HP Smart Array H244br" },
+{ 0x103C, 0x21C7, CISS_BOARD_SA5,   "HP Smart Array H240" },
+{ 0x103C, 0x21C8, CISS_BOARD_SA5,   "HP Smart Array H241" },
+{ 0x103C, 0x21CA, CISS_BOARD_SA5,   "HP Smart Array P246br" },
+{ 0x103C, 0x21CB, CISS_BOARD_SA5,   "HP Smart Array P840" },
 { 0x103C, 0x21CC, CISS_BOARD_SA5,   "HP Smart Array TBD" },
-{ 0x103C, 0x21CD, CISS_BOARD_SA5,   "HP Smart Array TBD" },
-{ 0x103C, 0x21CE, CISS_BOARD_SA5,   "HP Smart Array TBD" },
+{ 0x103C, 0x21CD, CISS_BOARD_SA5,   "HP Smart Array P240nr" },
+{ 0x103C, 0x21CE, CISS_BOARD_SA5,   "HP Smart Array H240nr" },
 { 0, 0, 0, NULL }
 };
 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r303175 - stable/10/sys/dev/e1000

2016-07-21 Thread Sean Bruno
Author: sbruno
Date: Fri Jul 22 03:19:49 2016
New Revision: 303175
URL: https://svnweb.freebsd.org/changeset/base/303175

Log:
  MFC r299188
  Since igb_detach() cleans up all the data structures that will be
  free'd by the functions following its call, we can simply return instead
  of crashing and burning in the event of igb_detach() failing.
  
  PR:   197139

Modified:
  stable/10/sys/dev/e1000/if_igb.c

Modified: stable/10/sys/dev/e1000/if_igb.c
==
--- stable/10/sys/dev/e1000/if_igb.cFri Jul 22 03:16:37 2016
(r303174)
+++ stable/10/sys/dev/e1000/if_igb.cFri Jul 22 03:19:49 2016
(r303175)
@@ -664,7 +664,8 @@ igb_attach(device_t dev)
return (0);
 
 err_late:
-   igb_detach(dev);
+   if (igb_detach(dev) == 0) /* igb_detach() already did the cleanup */
+   return(error);
igb_free_transmit_structures(adapter);
igb_free_receive_structures(adapter);
igb_release_hw_control(adapter);
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r303174 - stable/10/sys/dev/e1000

2016-07-21 Thread Sean Bruno
Author: sbruno
Date: Fri Jul 22 03:16:37 2016
New Revision: 303174
URL: https://svnweb.freebsd.org/changeset/base/303174

Log:
  MFC r299182
  If ALTQ is defined in the kern conf, switch to Legacy Mode.
  
  PR:   208409

Modified:
  stable/10/sys/dev/e1000/if_igb.h

Modified: stable/10/sys/dev/e1000/if_igb.h
==
--- stable/10/sys/dev/e1000/if_igb.hFri Jul 22 03:09:47 2016
(r303173)
+++ stable/10/sys/dev/e1000/if_igb.hFri Jul 22 03:16:37 2016
(r303174)
@@ -35,6 +35,10 @@
 #ifndef _IF_IGB_H_
 #define _IF_IGB_H_
 
+#ifdef ALTQ
+#define IGB_LEGACY_TX
+#endif
+
 #include 
 #include 
 #ifndef IGB_LEGACY_TX
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r303173 - stable/10/sys/nlm

2016-07-21 Thread Sean Bruno
Author: sbruno
Date: Fri Jul 22 03:09:47 2016
New Revision: 303173
URL: https://svnweb.freebsd.org/changeset/base/303173

Log:
  MFC r298351
  
  Avoid a possible heap overflow in our nlm code by limiting the number
  of service to the arbitrary value of 256.  Log an appropriate message
  that indicates the hard limit.

Modified:
  stable/10/sys/nlm/nlm_prot_impl.c

Modified: stable/10/sys/nlm/nlm_prot_impl.c
==
--- stable/10/sys/nlm/nlm_prot_impl.c   Fri Jul 22 03:03:52 2016
(r303172)
+++ stable/10/sys/nlm/nlm_prot_impl.c   Fri Jul 22 03:09:47 2016
(r303173)
@@ -1439,6 +1439,12 @@ nlm_register_services(SVCPOOL *pool, int
return (EINVAL);
}
 
+   if (addr_count < 0 || addr_count > 256 ) {
+   NLM_ERR("NLM:  too many service addresses (%d) given, "
+   "max 256 - can't start server\n", addr_count);
+   return (EINVAL);
+   }
+
xprts = malloc(addr_count * sizeof(SVCXPRT *), M_NLM, M_WAITOK|M_ZERO);
for (i = 0; i < version_count; i++) {
for (j = 0; j < addr_count; j++) {
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r303172 - stable/10/sys/dev/hptmv

2016-07-21 Thread Sean Bruno
Author: sbruno
Date: Fri Jul 22 03:03:52 2016
New Revision: 303172
URL: https://svnweb.freebsd.org/changeset/base/303172

Log:
  MFC r298231
  hptmv(4) Fix potential buffer overflow in hpt_set_info.
  
  While here, adjust some whitespace and yeild some useful debug info.
  
  This is untested on this hardware, testing requests to -scsi went
  unanswered.

Modified:
  stable/10/sys/dev/hptmv/hptproc.c

Modified: stable/10/sys/dev/hptmv/hptproc.c
==
--- stable/10/sys/dev/hptmv/hptproc.c   Fri Jul 22 02:11:49 2016
(r303171)
+++ stable/10/sys/dev/hptmv/hptproc.c   Fri Jul 22 03:03:52 2016
(r303172)
@@ -290,7 +290,9 @@ hpt_set_info(int length)
/*
 * map buffer to kernel.
 */
-   if (piop->nInBufferSize+piop->nOutBufferSize > 
PAGE_SIZE) {
+   if (piop->nInBufferSize > PAGE_SIZE ||
+   piop->nOutBufferSize > PAGE_SIZE ||
+   piop->nInBufferSize+piop->nOutBufferSize > 
PAGE_SIZE) {
KdPrintE(("User buffer too large\n"));
return -EINVAL;
}
@@ -301,8 +303,13 @@ hpt_set_info(int length)
return -EINVAL;
}
 
-   if (piop->nInBufferSize)
-   copyin((void*)(ULONG_PTR)piop->lpInBuffer, 
ke_area, piop->nInBufferSize);
+   if (piop->nInBufferSize) {
+   if (copyin((void*)(ULONG_PTR)piop->lpInBuffer, 
ke_area, piop->nInBufferSize) != 0) {
+   KdPrintE(("Failed to copyin from 
lpInBuffer\n"));
+   free(ke_area, M_DEVBUF);
+   return -EFAULT;
+   }
+   }
 
/*
  * call kernel handler.
@@ -324,7 +331,7 @@ hpt_set_info(int length)
else  KdPrintW(("Kernel_ioctl(): return %d\n", err));
 
free(ke_area, M_DEVBUF);
-   return -EINVAL;
+   return -EINVAL;
} else  {
KdPrintW(("Wrong signature: %x\n", piop->Magic));
return -EINVAL;
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r303171 - in head/sys: netinet netinet6

2016-07-21 Thread Mike Karels
Author: karels
Date: Fri Jul 22 02:11:49 2016
New Revision: 303171
URL: https://svnweb.freebsd.org/changeset/base/303171

Log:
  Fix per-connection L2 caching in fast path
  
  r301217 re-added per-connection L2 caching from a previous change,
  but it omitted caching in the fast path.  Add it.
  
  Reviewed By: gallatin
  Approved by: gnn (mentor)
  Differential Revision: https://reviews.freebsd.org/D7239

Modified:
  head/sys/netinet/if_ether.c
  head/sys/netinet6/nd6.c

Modified: head/sys/netinet/if_ether.c
==
--- head/sys/netinet/if_ether.c Fri Jul 22 01:16:56 2016(r303170)
+++ head/sys/netinet/if_ether.c Fri Jul 22 02:11:49 2016(r303171)
@@ -607,7 +607,7 @@ arpresolve(struct ifnet *ifp, int is_gw,
}
 
IF_AFDATA_RLOCK(ifp);
-   la = lla_lookup(LLTABLE(ifp), LLE_UNLOCKED, dst);
+   la = lla_lookup(LLTABLE(ifp), plle ? LLE_EXCLUSIVE : LLE_UNLOCKED, dst);
if (la != NULL && (la->r_flags & RLLE_VALID) != 0) {
/* Entry found, let's copy lle info */
bcopy(la->r_linkdata, desten, la->r_hdrlen);
@@ -619,9 +619,16 @@ arpresolve(struct ifnet *ifp, int is_gw,
la->r_skip_req = 0; /* Notify that entry was used */
LLE_REQ_UNLOCK(la);
}
+   if (plle) {
+   LLE_ADDREF(la);
+   *plle = la;
+   LLE_WUNLOCK(la);
+   }
IF_AFDATA_RUNLOCK(ifp);
return (0);
}
+   if (plle && la)
+   LLE_WUNLOCK(la);
IF_AFDATA_RUNLOCK(ifp);
 
return (arpresolve_full(ifp, is_gw, la == NULL ? LLE_CREATE : 0, m, dst,

Modified: head/sys/netinet6/nd6.c
==
--- head/sys/netinet6/nd6.c Fri Jul 22 01:16:56 2016(r303170)
+++ head/sys/netinet6/nd6.c Fri Jul 22 02:11:49 2016(r303171)
@@ -,7 +,8 @@ nd6_resolve(struct ifnet *ifp, int is_gw
}
 
IF_AFDATA_RLOCK(ifp);
-   ln = nd6_lookup(>sin6_addr, LLE_UNLOCKED, ifp);
+   ln = nd6_lookup(>sin6_addr, plle ? LLE_EXCLUSIVE : LLE_UNLOCKED,
+   ifp);
if (ln != NULL && (ln->r_flags & RLLE_VALID) != 0) {
/* Entry found, let's copy lle info */
bcopy(ln->r_linkdata, desten, ln->r_hdrlen);
@@ -2235,9 +2236,15 @@ nd6_resolve(struct ifnet *ifp, int is_gw
ln->lle_hittime = time_uptime;
LLE_REQ_UNLOCK(ln);
}
+   if (plle) {
+   LLE_ADDREF(ln);
+   *plle = ln;
+   LLE_WUNLOCK(ln);
+   }
IF_AFDATA_RUNLOCK(ifp);
return (0);
-   }
+   } else if (plle && ln)
+   LLE_WUNLOCK(ln);
IF_AFDATA_RUNLOCK(ifp);
 
return (nd6_resolve_slow(ifp, 0, m, dst6, desten, pflags, plle));
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r303170 - stable/10/contrib/llvm/tools/clang/lib/Driver

2016-07-21 Thread Ed Maste
Author: emaste
Date: Fri Jul 22 01:16:56 2016
New Revision: 303170
URL: https://svnweb.freebsd.org/changeset/base/303170

Log:
  MFC r303031: clang++: Always use --eh-frame-hdr on FreeBSD, even for -static
  
  FreeBSD uses LLVM's libunwind on FreeBSD/arm64 today (and we expect to
  use it more widely in the future) and it requires the EH frame segment
  in static binaries.

Modified:
  stable/10/contrib/llvm/tools/clang/lib/Driver/Tools.cpp
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/contrib/llvm/tools/clang/lib/Driver/Tools.cpp
==
--- stable/10/contrib/llvm/tools/clang/lib/Driver/Tools.cpp Fri Jul 22 
00:43:32 2016(r303169)
+++ stable/10/contrib/llvm/tools/clang/lib/Driver/Tools.cpp Fri Jul 22 
01:16:56 2016(r303170)
@@ -5848,12 +5848,12 @@ void freebsd::Link::ConstructJob(Compila
   if (Args.hasArg(options::OPT_pie))
 CmdArgs.push_back("-pie");
 
+  CmdArgs.push_back("--eh-frame-hdr");
   if (Args.hasArg(options::OPT_static)) {
 CmdArgs.push_back("-Bstatic");
   } else {
 if (Args.hasArg(options::OPT_rdynamic))
   CmdArgs.push_back("-export-dynamic");
-CmdArgs.push_back("--eh-frame-hdr");
 if (Args.hasArg(options::OPT_shared)) {
   CmdArgs.push_back("-Bshareable");
 } else {
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r303169 - stable/10/libexec/rtld-elf

2016-07-21 Thread Bryan Drewery
Author: bdrewery
Date: Fri Jul 22 00:43:32 2016
New Revision: 303169
URL: https://svnweb.freebsd.org/changeset/base/303169

Log:
  MFC r302908:
  
Fix dlsym(RTLD_NEXT) handling to only return the next library in last 
library
cases.

Modified:
  stable/10/libexec/rtld-elf/rtld.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/libexec/rtld-elf/rtld.c
==
--- stable/10/libexec/rtld-elf/rtld.c   Fri Jul 22 00:00:09 2016
(r303168)
+++ stable/10/libexec/rtld-elf/rtld.c   Fri Jul 22 00:43:32 2016
(r303169)
@@ -3181,7 +3181,7 @@ do_dlsym(void *handle, const char *name,
   handle == RTLD_SELF) { /* ... caller included */
if (handle == RTLD_NEXT)
obj = globallist_next(obj);
-   TAILQ_FOREACH_FROM(obj, _list, next) {
+   for (; obj != NULL; obj = TAILQ_NEXT(obj, next)) {
if (obj->marker)
continue;
res = symlook_obj(, obj);
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r303168 - stable/11/sys/conf

2016-07-21 Thread Glen Barber
Author: gjb
Date: Fri Jul 22 00:00:09 2016
New Revision: 303168
URL: https://svnweb.freebsd.org/changeset/base/303168

Log:
  Update stable/11 to BETA2 as part of the 11.0-RELEASE cycle.
  
  Approved by:  re (implicit)
  Sponsored by: The FreeBSD Foundation

Modified:
  stable/11/sys/conf/newvers.sh

Modified: stable/11/sys/conf/newvers.sh
==
--- stable/11/sys/conf/newvers.sh   Thu Jul 21 23:49:26 2016
(r303167)
+++ stable/11/sys/conf/newvers.sh   Fri Jul 22 00:00:09 2016
(r303168)
@@ -32,7 +32,7 @@
 
 TYPE="FreeBSD"
 REVISION="11.0"
-BRANCH="BETA1"
+BRANCH="BETA2"
 if [ -n "${BRANCH_OVERRIDE}" ]; then
BRANCH=${BRANCH_OVERRIDE}
 fi
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r303167 - in stable/10/sys: conf geom/uzip modules/geom/geom_uzip

2016-07-21 Thread Maxim Sobolev
Author: sobomax
Date: Thu Jul 21 23:49:26 2016
New Revision: 303167
URL: https://svnweb.freebsd.org/changeset/base/303167

Log:
  MFC: merge in all new features and improvements into geom_uzip(8) from 
current,
  which includes:
  
   o LZMA compression;
   o block de-duplication;
   o performance improvements;
   o pop out worker kthread to do extraction.
  
  This includes the following revisions:
   r295943,r295952,r298502,r298619,r299195,r302284
  
  Suggested by: emaste

Added:
  stable/10/sys/geom/uzip/g_uzip.h   (contents, props changed)
  stable/10/sys/geom/uzip/g_uzip_cloop.h   (contents, props changed)
  stable/10/sys/geom/uzip/g_uzip_dapi.h   (contents, props changed)
  stable/10/sys/geom/uzip/g_uzip_lzma.c   (contents, props changed)
  stable/10/sys/geom/uzip/g_uzip_lzma.h   (contents, props changed)
  stable/10/sys/geom/uzip/g_uzip_softc.h   (contents, props changed)
  stable/10/sys/geom/uzip/g_uzip_wrkthr.c   (contents, props changed)
  stable/10/sys/geom/uzip/g_uzip_wrkthr.h   (contents, props changed)
  stable/10/sys/geom/uzip/g_uzip_zlib.c   (contents, props changed)
  stable/10/sys/geom/uzip/g_uzip_zlib.h   (contents, props changed)
Modified:
  stable/10/sys/conf/files
  stable/10/sys/geom/uzip/g_uzip.c
  stable/10/sys/modules/geom/geom_uzip/Makefile

Modified: stable/10/sys/conf/files
==
--- stable/10/sys/conf/filesThu Jul 21 23:29:16 2016(r303166)
+++ stable/10/sys/conf/filesThu Jul 21 23:49:26 2016(r303167)
@@ -2912,21 +2912,24 @@ geom/shsec/g_shsec.coptional geom_shse
 geom/stripe/g_stripe.c optional geom_stripe
 geom/uncompress/g_uncompress.c optional geom_uncompress
 contrib/xz-embedded/freebsd/xz_malloc.c\
-   optional xz_embedded | geom_uncompress \
+   optional xz_embedded | geom_uncompress | geom_uzip \
compile-with "${NORMAL_C} -I$S/contrib/xz-embedded/freebsd/ 
-I$S/contrib/xz-embedded/linux/lib/xz/ 
-I$S/contrib/xz-embedded/linux/include/linux/"
 contrib/xz-embedded/linux/lib/xz/xz_crc32.c \
-   optional xz_embedded | geom_uncompress \
+   optional xz_embedded | geom_uncompress | geom_uzip \
compile-with "${NORMAL_C} -I$S/contrib/xz-embedded/freebsd/ 
-I$S/contrib/xz-embedded/linux/lib/xz/ 
-I$S/contrib/xz-embedded/linux/include/linux/"
 contrib/xz-embedded/linux/lib/xz/xz_dec_bcj.c \
-   optional xz_embedded | geom_uncompress \
+   optional xz_embedded | geom_uncompress | geom_uzip \
compile-with "${NORMAL_C} -I$S/contrib/xz-embedded/freebsd/ 
-I$S/contrib/xz-embedded/linux/lib/xz/ 
-I$S/contrib/xz-embedded/linux/include/linux/"
 contrib/xz-embedded/linux/lib/xz/xz_dec_lzma2.c \
-   optional xz_embedded | geom_uncompress \
+   optional xz_embedded | geom_uncompress | geom_uzip \
compile-with "${NORMAL_C} -I$S/contrib/xz-embedded/freebsd/ 
-I$S/contrib/xz-embedded/linux/lib/xz/ 
-I$S/contrib/xz-embedded/linux/include/linux/"
 contrib/xz-embedded/linux/lib/xz/xz_dec_stream.c \
-   optional xz_embedded | geom_uncompress \
+   optional xz_embedded | geom_uncompress | geom_uzip \
compile-with "${NORMAL_C} -I$S/contrib/xz-embedded/freebsd/ 
-I$S/contrib/xz-embedded/linux/lib/xz/ 
-I$S/contrib/xz-embedded/linux/include/linux/"
 geom/uzip/g_uzip.c optional geom_uzip
+geom/uzip/g_uzip_lzma.coptional geom_uzip
+geom/uzip/g_uzip_wrkthr.c  optional geom_uzip
+geom/uzip/g_uzip_zlib.coptional geom_uzip
 geom/vinum/geom_vinum.coptional geom_vinum
 geom/vinum/geom_vinum_create.c optional geom_vinum
 geom/vinum/geom_vinum_drive.c  optional geom_vinum

Modified: stable/10/sys/geom/uzip/g_uzip.c
==
--- stable/10/sys/geom/uzip/g_uzip.cThu Jul 21 23:29:16 2016
(r303166)
+++ stable/10/sys/geom/uzip/g_uzip.cThu Jul 21 23:49:26 2016
(r303167)
@@ -1,6 +1,7 @@
 /*-
  * Copyright (c) 2004 Max Khon
  * Copyright (c) 2014 Juniper Networks, Inc.
+ * Copyright (c) 2006-2016 Maxim Sobolev 
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -38,91 +39,129 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#include 
 
 #include 
-#include 
 
-FEATURE(geom_uzip, "GEOM uzip read-only compressed disks support");
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include "opt_geom.h"
+
+MALLOC_DEFINE(M_GEOM_UZIP, "geom_uzip", "GEOM UZIP data structures");
+
+FEATURE(geom_uzip, "GEOM read-only compressed disks support");
+
+struct g_uzip_blk {
+uint64_t offset;
+uint32_t blen;
+unsigned char last:1;
+unsigned char padded:1;
+#define BLEN_UNDEF  UINT32_MAX
+};
+
+#ifndef ABS
+#defineABS(a)  ((a) < 0 ? -(a) : (a))
+#endif
+
+#define BLK_IN_RANGE(mcn, bcn, ilen)   \
+(((bcn) != 

svn commit: r303165 - head/sys/conf

2016-07-21 Thread Warner Losh
Author: imp
Date: Thu Jul 21 23:29:13 2016
New Revision: 303165
URL: https://svnweb.freebsd.org/changeset/base/303165

Log:
  Fix cam builds w/o nvme. This is a stop-gap fix until the real fix of
  dynamically loading XPTs is done and tested.
  
  MFC After: 1 week

Modified:
  head/sys/conf/files

Modified: head/sys/conf/files
==
--- head/sys/conf/files Thu Jul 21 22:49:47 2016(r303164)
+++ head/sys/conf/files Thu Jul 21 23:29:13 2016(r303165)
@@ -86,9 +86,9 @@ cam/cam_xpt.c optional scbus
 cam/ata/ata_all.c  optional scbus
 cam/ata/ata_xpt.c  optional scbus
 cam/ata/ata_pmp.c  optional scbus
-cam/nvme/nvme_all.coptional scbus nvme 
+cam/nvme/nvme_all.coptional scbus
 cam/nvme/nvme_da.c optional scbus nvme da !nvd
-cam/nvme/nvme_xpt.coptional scbus nvme
+cam/nvme/nvme_xpt.coptional scbus
 cam/scsi/scsi_xpt.coptional scbus
 cam/scsi/scsi_all.coptional scbus
 cam/scsi/scsi_cd.c optional cd
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r303166 - head/sys/modules/cam

2016-07-21 Thread Warner Losh
Author: imp
Date: Thu Jul 21 23:29:16 2016
New Revision: 303166
URL: https://svnweb.freebsd.org/changeset/base/303166

Log:
  Add opt_ddb.h.
  
  MFC after: 1 week

Modified:
  head/sys/modules/cam/Makefile

Modified: head/sys/modules/cam/Makefile
==
--- head/sys/modules/cam/Makefile   Thu Jul 21 23:29:13 2016
(r303165)
+++ head/sys/modules/cam/Makefile   Thu Jul 21 23:29:16 2016
(r303166)
@@ -14,6 +14,7 @@ SRCS+=opt_cd.h
 SRCS+= opt_pt.h
 SRCS+= opt_sa.h
 SRCS+= opt_ses.h
+SRCS+= opt_ddb.h
 SRCS+= device_if.h bus_if.h vnode_if.h
 SRCS+= cam.c
 SRCS+= cam_compat.c
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r303164 - in head: lib/libc/sys share/man/man4 sys/kern

2016-07-21 Thread John Baldwin
Author: jhb
Date: Thu Jul 21 22:49:47 2016
New Revision: 303164
URL: https://svnweb.freebsd.org/changeset/base/303164

Log:
  Add more documentation regarding unsafe AIO requests.
  
  The asynchronous I/O changes made previously result in different
  behavior out of the box. Previously all AIO requests failed with
  ENOSYS / SIGSYS unless aio.ko was explicitly loaded. Now, some AIO
  requests complete and others ("unsafe" requests) fail with EOPNOTSUPP.
  
  Reword the introductory paragraph in aio(4) to add a general
  description of AIO before describing the vfs.aio.enable_unsafe sysctl.
  
  Remove the ENOSYS error description from aio_fsync(2), aio_read(2),
  and aio_write(2) and replace it with a description of EOPNOTSUPP.
  
  Remove the ENOSYS error description from aio_mlock(2).
  
  Log a message to the system log the first time a process requests an
  "unsafe" AIO request that fails with EOPNOTSUPP. This is modeled on
  the log message used for processes using the legacy pty devices.
  
  Reviewed by:  kib (earlier version)
  MFC after:1 week
  Sponsored by: Chelsio Communications
  Differential Revision:https://reviews.freebsd.org/D7151

Modified:
  head/lib/libc/sys/aio_fsync.2
  head/lib/libc/sys/aio_mlock.2
  head/lib/libc/sys/aio_read.2
  head/lib/libc/sys/aio_write.2
  head/share/man/man4/aio.4
  head/sys/kern/vfs_aio.c

Modified: head/lib/libc/sys/aio_fsync.2
==
--- head/lib/libc/sys/aio_fsync.2   Thu Jul 21 22:13:40 2016
(r303163)
+++ head/lib/libc/sys/aio_fsync.2   Thu Jul 21 22:49:47 2016
(r303164)
@@ -24,7 +24,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd July 15, 2016
+.Dd July 21, 2016
 .Dt AIO_FSYNC 2
 .Os
 .Sh NAME
@@ -107,10 +107,10 @@ The request was not queued because of sy
 The asynchronous notification method in
 .Fa iocb->aio_sigevent.sigev_notify
 is invalid or not supported.
-.It Bq Er ENOSYS
-The
-.Fn aio_fsync
-system call is not supported.
+.It Bq Er EOPNOTSUPP
+Asynchronous file synchronization operations on the file descriptor
+.Fa iocb->aio_fildes
+are unsafe and unsafe asynchronous I/O operations are disabled.
 .It Bq Er EINVAL
 A value of the
 .Fa op

Modified: head/lib/libc/sys/aio_mlock.2
==
--- head/lib/libc/sys/aio_mlock.2   Thu Jul 21 22:13:40 2016
(r303163)
+++ head/lib/libc/sys/aio_mlock.2   Thu Jul 21 22:49:47 2016
(r303164)
@@ -24,7 +24,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd July 15, 2016
+.Dd July 21, 2016
 .Dt AIO_MLOCK 2
 .Os
 .Sh NAME
@@ -102,10 +102,6 @@ The request was not queued because of sy
 The asynchronous notification method in
 .Fa iocb->aio_sigevent.sigev_notify
 is invalid or not supported.
-.It Bq Er ENOSYS
-The
-.Fn aio_mlock
-system call is not supported.
 .El
 .Pp
 If the request is successfully enqueued, but subsequently cancelled

Modified: head/lib/libc/sys/aio_read.2
==
--- head/lib/libc/sys/aio_read.2Thu Jul 21 22:13:40 2016
(r303163)
+++ head/lib/libc/sys/aio_read.2Thu Jul 21 22:49:47 2016
(r303164)
@@ -24,7 +24,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd July 15, 2016
+.Dd July 21, 2016
 .Dt AIO_READ 2
 .Os
 .Sh NAME
@@ -125,10 +125,10 @@ The request was not queued because of sy
 The asynchronous notification method in
 .Fa iocb->aio_sigevent.sigev_notify
 is invalid or not supported.
-.It Bq Er ENOSYS
-The
-.Fn aio_read
-system call is not supported.
+.It Bq Er EOPNOTSUPP
+Asynchronous read operations on the file descriptor
+.Fa iocb->aio_fildes
+are unsafe and unsafe asynchronous I/O operations are disabled.
 .El
 .Pp
 The following conditions may be synchronously detected when the

Modified: head/lib/libc/sys/aio_write.2
==
--- head/lib/libc/sys/aio_write.2   Thu Jul 21 22:13:40 2016
(r303163)
+++ head/lib/libc/sys/aio_write.2   Thu Jul 21 22:49:47 2016
(r303164)
@@ -24,7 +24,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd July 15, 2016
+.Dd July 21, 2016
 .Dt AIO_WRITE 2
 .Os
 .Sh NAME
@@ -129,10 +129,10 @@ The request was not queued because of sy
 The asynchronous notification method in
 .Fa iocb->aio_sigevent.sigev_notify
 is invalid or not supported.
-.It Bq Er ENOSYS
-The
-.Fn aio_write
-system call is not supported.
+.It Bq Er EOPNOTSUPP
+Asynchronous write operations on the file descriptor
+.Fa iocb->aio_fildes
+are unsafe and unsafe asynchronous I/O operations are disabled.
 .El
 .Pp
 The following conditions may be synchronously detected when the

Modified: head/share/man/man4/aio.4
==
--- head/share/man/man4/aio.4   Thu Jul 21 22:13:40 2016(r303163)
+++ head/share/man/man4/aio.4   Thu Jul 21 22:49:47 2016(r303164)
@@ -27,7 +27,7 @@
 .\"
 .\" $FreeBSD$

svn commit: r303163 - stable/11/sys/arm/conf

2016-07-21 Thread Ian Lepore
Author: ian
Date: Thu Jul 21 22:13:40 2016
New Revision: 303163
URL: https://svnweb.freebsd.org/changeset/base/303163

Log:
  Disable debugging options in arm configurations.
  
  Approved by:  re (gjb)

Modified:
  stable/11/sys/arm/conf/std.arm
  stable/11/sys/arm/conf/std.armv6

Modified: stable/11/sys/arm/conf/std.arm
==
--- stable/11/sys/arm/conf/std.arm  Thu Jul 21 21:14:57 2016
(r303162)
+++ stable/11/sys/arm/conf/std.arm  Thu Jul 21 22:13:40 2016
(r303163)
@@ -9,28 +9,3 @@ makeoptionsDEBUG=-g# Build kernel wit
 optionsKDB # Enable kernel debugger support.
 optionsKDB_TRACE   # Print a stack trace for a panic.
 
-# For full debugger support use (turn off in stable branch):
-optionsDDB # Support DDB
-#options   DEADLKRES   # Enable the deadlock resolver
-optionsINVARIANTS  # Enable calls of extra sanity checking
-optionsINVARIANT_SUPPORT   # Extra sanity checks of internal 
structures, required by INVARIANTS
-optionsWITNESS # Enable checks to detect deadlocks and 
cycles
-optionsWITNESS_SKIPSPIN# Don't run witness on spinlocks for 
speed
-#options   MALLOC_DEBUG_MAXZONES=8 # Separate malloc(9) zones
-optionsALT_BREAK_TO_DEBUGGER   # Enter debugger on keyboard escape 
sequence
-optionsUSB_DEBUG   # Enable usb debug support code
-
-# Optional extras, never enabled by default:
-#options   BOOTVERBOSE
-#options   DEBUG   # May result in extreme spewage
-#options   KTR
-#options   KTR_COMPILE=KTR_ALL
-#options   KTR_ENTRIES=16384
-#options   KTR_MASK=(KTR_SPARE2)
-#options   KTR_VERBOSE=0
-#options   USB_REQ_DEBUG
-#options   USB_VERBOSE
-#options   VERBOSE_SYSINIT # Enable verbose sysinit messages
-
-
-

Modified: stable/11/sys/arm/conf/std.armv6
==
--- stable/11/sys/arm/conf/std.armv6Thu Jul 21 21:14:57 2016
(r303162)
+++ stable/11/sys/arm/conf/std.armv6Thu Jul 21 22:13:40 2016
(r303163)
@@ -52,26 +52,3 @@ makeoptions  DEBUG=-g# Build kernel wit
 optionsKDB # Enable kernel debugger support.
 optionsKDB_TRACE   # Print a stack trace for a panic.
 
-# For full debugger support use (turn off in stable branch):
-optionsDDB # Support DDB
-#options   DEADLKRES   # Enable the deadlock resolver
-optionsINVARIANTS  # Enable calls of extra sanity checking
-optionsINVARIANT_SUPPORT   # Extra sanity checks of internal 
structures, required by INVARIANTS
-optionsWITNESS # Enable checks to detect deadlocks and 
cycles
-optionsWITNESS_SKIPSPIN# Don't run witness on spinlocks for 
speed
-optionsMALLOC_DEBUG_MAXZONES=8 # Separate malloc(9) zones
-optionsALT_BREAK_TO_DEBUGGER   # Enter debugger on keyboard escape 
sequence
-optionsUSB_DEBUG   # Enable usb debug support code
-
-# Optional extras, never enabled by default:
-#options   BOOTVERBOSE
-#options   DEBUG   # May result in extreme spewage
-#options   KTR
-#options   KTR_COMPILE=KTR_ALL
-#options   KTR_ENTRIES=16384
-#options   KTR_MASK=(KTR_SPARE2)
-#options   KTR_VERBOSE=0
-#options   USB_REQ_DEBUG
-#options   USB_VERBOSE
-#options   VERBOSE_SYSINIT # Enable verbose sysinit messages
-
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r301453 - in head/sys: arm/arm arm64/arm64 dev/fdt dev/gpio dev/iicbus dev/ofw dev/pci dev/vnic kern mips/mips sys

2016-07-21 Thread John Baldwin
On Thursday, July 21, 2016 01:37:42 PM Andrew Turner wrote:
> On Wed, 20 Jul 2016 13:28:53 +0200
> Michal Meloun  wrote:
> > Dne 19.07.2016 v 17:06 Nathan Whitehorn napsal(a):
> > > 2. It partially duplicates the functionality of OFW_BUS_MAP_INTR(),
> > > but is both problematically more general and less flexible (it has
> > > requirements on timing of PIC attachment vs. driver resource
> > > allocation)  
> > OFW_BUS_MAP_INTR()  can parse only OFW  based data and expect that
> > parsed data are magicaly stored within the call.
> > The new method, bus_map_intr(),  can parse data from multiple sources 
> > (OFW, UEFI / ACPI, synthetic[gpio device + pin number]).  It also
> > returns parsed data back to caller.
> > And no, it  doesn't  add any additional timing requirements .
> 
> I've been looking at ACPI on arm64. So far I have not found the need
> for this with ACPI as we don't need to send the data to the interrupt
> controller driver to be parsed in the way OFW/FDT needs to.

ACPI though has a gross hack where we call BUS_CONFIG_INTR on the IRQ
in bus_alloc_resource().  What I had advocated in the discussions
leading up to this was to have some sort of opaque structure containing
a set of properties (the sort of thing bus_map_resource and make_dev_s
use) that was passed up at bus_setup_intr() time.  I think it should now
be passed up at bus_alloc_resource() time instead, but it would allow bus
drivers to "decorate" a SYS_RES_IRQ request as it goes up the device tree
with properties that the interrupt controller can then associate with
the IRQ cookie it allocates in its own code.  I would let the particular
structure have different layouts for different resource types.  On x86 we
would replace bus_config_intr by passing the level and trigger-mode in
this structure.  However, I could also see allowing the memattr to be
set for a SYS_RES_MEMORY resource so you could have a much shorter way
than an explicit bus_map_resource to map an entire BAR as WC for example:

struct alloc_resource_args {
size_t len;
union {
struct {
enum intr_trigger trigger;
enum intr_polarity polarity;
} irq;
struct {
vm_memattr_t memattr;
} memory;
}
}

...

union alloc_resource_args args;

init_alloc_resource_args(, sizeof(args));
args.memattr = VM_MEMATTR_WRITE_COMBINING;

/* Uses WC for the implicit mapping. */
res = bus_alloc_resource(, );

...

foobus_alloc_resource(..., union alloc_resource_args *args)
{
union alloc_resource_args args2;

switch (type) {
case SYS_RES_IRQ:
if (args == NULL) {
init_alloc_resource_args(, sizeof(args2));
args = 
}
/* Replace call to BUS_CONFIG_INTR on ACPI: */
if (args->irq.polarity == INTR_POLARITY_CONFORMING &&
device_has_polarity_from_CRS)
args->irq.polarity = polarity_from_CRS;
...
}

However, you could associate arbitrary data with a resource request by
adding more members to the approriate struct in the union.

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


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

2016-07-21 Thread John Baldwin
Thanks!

On Wednesday, July 20, 2016 05:53:57 PM Conrad Meyer wrote:
> Sure — r303122.
> 
> Conrad
> 
> On Wed, Jul 20, 2016 at 4:09 PM, John Baldwin  wrote:
> > On Wednesday, July 20, 2016 10:51:33 PM Conrad E. Meyer wrote:
> >> Author: cem
> >> Date: Wed Jul 20 22:51:33 2016
> >> New Revision: 303120
> >> URL: https://svnweb.freebsd.org/changeset/base/303120
> >>
> >> Log:
> >>   imgact_elf: Rename the segment iterator to match reality
> >>
> >>   The each_writable_segment routine evaluates segments on a slightly 
> >> little more
> >>   nuanced metric than simply "writable" or not.  Rename the function to 
> >> more
> >>   closely match its behavior (each_dumpable_segment).
> >>
> >>   Suggested by:   jhb
> >>   Sponsored by:   EMC / Isilon Storage Division
> >
> > Please do the same rename in gcore's elfcore.c as well.
> >
> > --
> > John Baldwin
> 


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

svn commit: r303162 - stable/11

2016-07-21 Thread Ian Lepore
Author: ian
Date: Thu Jul 21 21:14:57 2016
New Revision: 303162
URL: https://svnweb.freebsd.org/changeset/base/303162

Log:
  Add correct mergeinfo for r302915.
  
  It looks like I did the commit from the sys subdir and missed the mergeinfo
  in the original commit.
  
  Approved by:  re (gjb, as part of r302915)

Modified:
Directory Properties:
  stable/11/   (props changed)
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r303161 - stable/11/sys/vm

2016-07-21 Thread Alan Cox
Author: alc
Date: Thu Jul 21 20:11:43 2016
New Revision: 303161
URL: https://svnweb.freebsd.org/changeset/base/303161

Log:
  MFC r302980
Break up vm_fault()'s implementation of the read-ahead and delete-behind
optimizations into two distinct pieces.  The first piece consists of the
code that should only be performed once per page fault and requires the
map to be locked.  The second piece consists of the code that should be
performed each time a pager is called on an object in the shadow chain.
(This second piece expects the map to be unlocked.)
  
Previously, the entire implementation could be executed multiple times.
Moreover, the second and subsequent executions would occur with the map
unlocked.  Usually, the ensuing unsynchronized accesses to the map were
harmless because the map was not changing.  Nonetheless, it was possible
for a use-after-free error to occur, where vm_fault() wrote to a freed
map entry.  This change corrects that problem.
  
  Approved by:  re (gjb)

Modified:
  stable/11/sys/vm/vm_fault.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/vm/vm_fault.c
==
--- stable/11/sys/vm/vm_fault.c Thu Jul 21 19:27:04 2016(r303160)
+++ stable/11/sys/vm/vm_fault.c Thu Jul 21 20:11:43 2016(r303161)
@@ -291,14 +291,17 @@ vm_fault_hold(vm_map_t map, vm_offset_t 
int hardfault;
struct faultstate fs;
struct vnode *vp;
+   vm_offset_t e_end, e_start;
vm_page_t m;
-   int ahead, behind, cluster_offset, error, locked;
+   int ahead, behind, cluster_offset, error, locked, rv;
+   u_char behavior;
 
hardfault = 0;
growstack = TRUE;
PCPU_INC(cnt.v_vm_faults);
fs.vp = NULL;
faultcount = 0;
+   nera = -1;
 
 RetryFault:;
 
@@ -549,29 +552,25 @@ fast_failed:
 
 readrest:
/*
-* We have either allocated a new page or found an existing
-* page that is only partially valid.
-*
-* Attempt to fault-in the page if there is a chance that the
-* pager has it, and potentially fault in additional pages
-* at the same time.
+* If the pager for the current object might have the page,
+* then determine the number of additional pages to read and
+* potentially reprioritize previously read pages for earlier
+* reclamation.  These operations should only be performed
+* once per page fault.  Even if the current pager doesn't
+* have the page, the number of additional pages to read will
+* apply to subsequent objects in the shadow chain.
 */
-   if (fs.object->type != OBJT_DEFAULT) {
-   int rv;
-   u_char behavior = vm_map_entry_behavior(fs.entry);
-
+   if (fs.object->type != OBJT_DEFAULT && nera == -1 &&
+   !P_KILLED(curproc)) {
+   KASSERT(fs.lookup_still_valid, ("map unlocked"));
era = fs.entry->read_ahead;
-   if (behavior == MAP_ENTRY_BEHAV_RANDOM ||
-   P_KILLED(curproc)) {
-   behind = 0;
+   behavior = vm_map_entry_behavior(fs.entry);
+   if (behavior == MAP_ENTRY_BEHAV_RANDOM) {
nera = 0;
-   ahead = 0;
} else if (behavior == MAP_ENTRY_BEHAV_SEQUENTIAL) {
-   behind = 0;
nera = VM_FAULT_READ_AHEAD_MAX;
-   ahead = nera;
if (vaddr == fs.entry->next_read)
-   vm_fault_dontneed(, vaddr, ahead);
+   vm_fault_dontneed(, vaddr, nera);
} else if (vaddr == fs.entry->next_read) {
/*
 * This is a sequential fault.  Arithmetically
@@ -580,42 +579,51 @@ readrest:
 * number of pages is "# of sequential faults
 * x (read ahead min + 1) + read ahead min"
 */
-   behind = 0;
nera = VM_FAULT_READ_AHEAD_MIN;
if (era > 0) {
nera += era + 1;
if (nera > VM_FAULT_READ_AHEAD_MAX)
nera = VM_FAULT_READ_AHEAD_MAX;
}
-   ahead = nera;
if (era == 

svn commit: r303160 - head/etc/ntp

2016-07-21 Thread Cy Schubert
Author: cy
Date: Thu Jul 21 19:27:04 2016
New Revision: 303160
URL: https://svnweb.freebsd.org/changeset/base/303160

Log:
  Update leap-seconds to leap-seconds.3676752000.
  
  As per https://datacenter.iers.org/web/guest/eop/-/somos/5Rgv/latest/16:
  
UTC TIME STEP
  on the 1st of January 2017
  
   A positive leap second will be introduced at the end of December 2016.
   The sequence of dates of the UTC second markers will be:
  
2016 December 31, 23h 59m 59s
2016 December 31, 23h 59m 60s
2017 January   1,  0h  0m  0s
  
   The difference between UTC and the International Atomic Time TAI is:
  
from 2015 July 1, 0h UTC, to 2017 January 1 0h UTC   : UTC-TAI = - 36s
from 2017 January 1, 0h UTC, until further notice: UTC-TAI = - 37s
  
  Obtained from:
ftp://tycho.usno.navy.mil/pub/ntp/leap-seconds.3676752000
  See also: https://www.iers.org/SharedDocs/News/EN/BulletinC.html
https://datacenter.iers.org/web/guest/eop/-/somos/5Rgv/latest/16
  MFC after:1 week
  Relnotes: yes

Modified:
  head/etc/ntp/leap-seconds

Modified: head/etc/ntp/leap-seconds
==
--- head/etc/ntp/leap-seconds   Thu Jul 21 19:18:49 2016(r303159)
+++ head/etc/ntp/leap-seconds   Thu Jul 21 19:27:04 2016(r303160)
@@ -130,7 +130,7 @@
 #  Washington, DC
 #  jeffrey.prilla...@usno.navy.mil
 #
-#  Last Update of leap second values:  11 Jan 2016
+#  Last Update of leap second values:   6 Jul 2016
 #
 #  The following line shows this last update date in NTP timestamp 
 #  format. This is the date on which the most recent change to
@@ -138,7 +138,7 @@
 #  be identified by the unique pair of characters in the first two 
 #  columns as shown below.
 #
-#$  3661459200
+#$  3676752000
 #
 #  The data in this file will be updated periodically as new leap 
 #  seconds are announced. In addition to being entered on the line
@@ -170,10 +170,10 @@
 #  current -- the update time stamp, the data and the name of the file 
 #  will not change.
 #
-#  Updated through IERS Bulletin C 51
-#  File expires on:  1 Dec 2016
+#  Updated through IERS Bulletin C 52
+#  File expires on:  1 Jun 2017
 #
-#@ 3689539200
+#@ 3705264000
 #
 2272060800 10  # 1 Jan 1972
 2287785600 11  # 1 Jul 1972
@@ -202,6 +202,7 @@
 3439756800 34  # 1 Jan 2009
 3550089600 35  # 1 Jul 2012
 3644697600 36  # 1 Jul 2015
+3692217600 37  # 1 Jan 2017
 #
 #  the following special comment contains the
 #  hash value of the data in this file computed
@@ -217,5 +218,5 @@
 #  the hash line is also ignored in the
 #  computation.
 #
-#h 63b4df04 0907d94f 2dadb7a1 684f7767 2a372421
+#h 63f8fea8 587c099d abcf130a ad525eae 3e105052
 #
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r303159 - stable/11/sys/kern

2016-07-21 Thread Gleb Smirnoff
Author: glebius
Date: Thu Jul 21 19:18:49 2016
New Revision: 303159
URL: https://svnweb.freebsd.org/changeset/base/303159

Log:
  Merge r302894, r303098: fix regression caused by r302350. Stopping a
  not scheduled not running callout should return (-1).
  
  PR:   210884
  Approved by:  re (gjb)

Modified:
  stable/11/sys/kern/kern_timeout.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/kern/kern_timeout.c
==
--- stable/11/sys/kern/kern_timeout.c   Thu Jul 21 18:47:51 2016
(r303158)
+++ stable/11/sys/kern/kern_timeout.c   Thu Jul 21 19:18:49 2016
(r303159)
@@ -1380,6 +1380,12 @@ again:
if ((c->c_iflags & CALLOUT_PENDING) == 0) {
CTR3(KTR_CALLOUT, "failed to stop %p func %p arg %p",
c, c->c_func, c->c_arg);
+   /*
+* For not scheduled and not executing callout return
+* negative value.
+*/
+   if (cc_exec_curr(cc, direct) != c)
+   cancelled = -1;
CC_UNLOCK(cc);
return (cancelled);
}
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r303151 - in head/sys: dev/pty kern sys

2016-07-21 Thread Bryan Drewery
On 7/21/2016 9:34 AM, Konstantin Belousov wrote:
> Author: kib
> Date: Thu Jul 21 16:34:56 2016
> New Revision: 303151
> URL: https://svnweb.freebsd.org/changeset/base/303151
> 
> Log:
>   Provide counter_warning(9) KPI which allows to issue limited number of
>   warnings for some kernel events, mostly intended for the use of
>   obsoleted or otherwise undersired interfaces.
>   
>   This is an abstracted and race-expelled code from compat pty driver.

This is great. Thanks for this.

-- 
Regards,
Bryan Drewery



signature.asc
Description: OpenPGP digital signature


svn commit: r303158 - head/lib/libmd

2016-07-21 Thread Ed Maste
Author: emaste
Date: Thu Jul 21 18:47:51 2016
New Revision: 303158
URL: https://svnweb.freebsd.org/changeset/base/303158

Log:
  libmd: strip local absolute symbols (to link with lld)
  
  Old versions of gas produce an invalid section index. That is ignored by
  old versions of ld, but prevents a link with lld.
  
  Submitted by: Rafael Ávila de Espíndola (earlier version)
  Reviewed by:  allanjude
  Sponsored by: The FreeBSD Foundation
  Differential Revision:https://reviews.freebsd.org/D6789

Modified:
  head/lib/libmd/Makefile

Modified: head/lib/libmd/Makefile
==
--- head/lib/libmd/Makefile Thu Jul 21 18:20:35 2016(r303157)
+++ head/lib/libmd/Makefile Thu Jul 21 18:47:51 2016(r303158)
@@ -93,6 +93,7 @@ SRCS+=rmd160.S
 CFLAGS+= -DRMD160_ASM
 .endif
 .if exists(${MACHINE_ARCH}/skein_block_asm.s)
+AFLAGS += --strip-local-absolute
 SRCS+= skein_block_asm.s
 CFLAGS+= -DSKEIN_ASM -DSKEIN_USE_ASM=1792 # list of block functions to replace 
with assembly: 256+512+1024 = 1792
 .endif
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

svn commit: r303157 - head/contrib/libcxxrt

2016-07-21 Thread Ed Maste
Author: emaste
Date: Thu Jul 21 18:20:35 2016
New Revision: 303157
URL: https://svnweb.freebsd.org/changeset/base/303157

Log:
  libcxxrt: add padding in __cxa_allocate_* to fix alignment
  
  The addition of the referenceCount to __cxa_allocate_exception put the
  unwindHeader at offset 0x58 in __cxa_exception, but it requires 16-byte
  alignment. In order to avoid changing the current __cxa_exception ABI
  (and thus breaking its consumers), add explicit padding in the
  allocation routines (and account for it when freeing).
  
  This is intended as a lower-risk change for FreeBSD 11. A "more correct"
  fix should be prepared for upstream and -CURRENT.
  
  Reviewed by:  dim
  MFC after:3 days
  Sponsored by: The FreeBSD Foundation
  Differential Revision:https://reviews.freebsd.org/D7271

Modified:
  head/contrib/libcxxrt/exception.cc

Modified: head/contrib/libcxxrt/exception.cc
==
--- head/contrib/libcxxrt/exception.cc  Thu Jul 21 18:12:39 2016
(r303156)
+++ head/contrib/libcxxrt/exception.cc  Thu Jul 21 18:20:35 2016
(r303157)
@@ -572,6 +572,19 @@ static void free_exception(char *e)
}
 }
 
+#ifdef __LP64__
+/**
+ * There's an ABI bug in __cxa_exception: unwindHeader requires 16-byte
+ * alignment but it was broken by the addition of the referenceCount.
+ * The unwindHeader is at offset 0x58 in __cxa_exception.  In order to keep
+ * compatibility with consumers of the broken __cxa_exception, explicitly add
+ * padding on allocation (and account for it on free).
+ */
+static const int exception_alignment_padding = 8;
+#else
+static const int exception_alignment_padding = 0;
+#endif
+
 /**
  * Allocates an exception structure.  Returns a pointer to the space that can
  * be used to store an object of thrown_size bytes.  This function will use an
@@ -580,16 +593,19 @@ static void free_exception(char *e)
  */
 extern "C" void *__cxa_allocate_exception(size_t thrown_size)
 {
-   size_t size = thrown_size + sizeof(__cxa_exception);
+   size_t size = exception_alignment_padding + sizeof(__cxa_exception) +
+   thrown_size;
char *buffer = alloc_or_die(size);
-   return buffer+sizeof(__cxa_exception);
+   return buffer + exception_alignment_padding + sizeof(__cxa_exception);
 }
 
 extern "C" void *__cxa_allocate_dependent_exception(void)
 {
-   size_t size = sizeof(__cxa_dependent_exception);
+   size_t size = exception_alignment_padding +
+   sizeof(__cxa_dependent_exception);
char *buffer = alloc_or_die(size);
-   return buffer+sizeof(__cxa_dependent_exception);
+   return buffer + exception_alignment_padding +
+   sizeof(__cxa_dependent_exception);
 }
 
 /**
@@ -617,7 +633,8 @@ extern "C" void __cxa_free_exception(voi
}
}
 
-   free_exception(reinterpret_cast(ex));
+   free_exception(reinterpret_cast(ex) -
+   exception_alignment_padding);
 }
 
 static void releaseException(__cxa_exception *exception)
@@ -644,7 +661,8 @@ void __cxa_free_dependent_exception(void
{

releaseException(realExceptionFromException(reinterpret_cast<__cxa_exception*>(ex)));
}
-   free_exception(reinterpret_cast(ex));
+   free_exception(reinterpret_cast(ex) -
+   exception_alignment_padding);
 }
 
 /**
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r303156 - head/crypto/heimdal/lib/roken

2016-07-21 Thread Ed Maste
Author: emaste
Date: Thu Jul 21 18:12:39 2016
New Revision: 303156
URL: https://svnweb.freebsd.org/changeset/base/303156

Log:
  Remove duplicate symbols from libroken version-script.map
  
  Upstream commit r24759 (efed563) prefixed some symbols with rk_, but
  introduced 6 duplicate symbols in the version script (because the
  rk_-prefixed versions of the symbols were already present).

Modified:
  head/crypto/heimdal/lib/roken/version-script.map

Modified: head/crypto/heimdal/lib/roken/version-script.map
==
--- head/crypto/heimdal/lib/roken/version-script.mapThu Jul 21 17:59:30 
2016(r303155)
+++ head/crypto/heimdal/lib/roken/version-script.mapThu Jul 21 18:12:39 
2016(r303156)
@@ -123,17 +123,12 @@ HEIMDAL_ROKEN_1.0 {
rk_strptime;
rk_strsep_copy;
rk_strsvis;
-   rk_strsvis;
rk_strsvisx;
rk_strunvis;
-   rk_strunvis;
rk_strunvisx;
rk_strupr;
rk_strvis;
-   rk_strvis;
rk_strvisx;
-   rk_strvisx;
-   rk_svis;
rk_svis;
rk_timegm;
rk_timevaladd;
@@ -148,7 +143,6 @@ HEIMDAL_ROKEN_1.0 {
rk_vasnprintf;
rk_vasprintf;
rk_vis;
-   rk_vis;
rk_vsnprintf;
rk_vstrcollect;
rk_wait_for_process;
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r303151 - in head/sys: dev/pty kern sys

2016-07-21 Thread Konstantin Belousov
On Thu, Jul 21, 2016 at 06:52:25PM +0100, Ruslan Bukin wrote:
> Hi,
> 
> I get the issues below with GCC 6.1
> 
> [...]
> ===> lib/libsbuf (obj,all,install)
> /home/rb743/opt/new17/bin/riscv64-unknown-freebsd11.0-gcc -isystem 
> /home/rb743/obj//riscv.riscv64/home/rb743/dev/freebsd-riscv/tmp/usr/include 
> -L/home/rb743/obj//riscv.riscv64/home/rb743/dev/freebsd-riscv/tmp/usr/lib 
> --sysroot=/home/rb743/obj//riscv.riscv64/home/rb743/dev/freebsd-riscv/tmp 
> -B/home/rb743/obj//riscv.riscv64/home/rb743/dev/freebsd-riscv/tmp/usr/bin  
> -O2 -pipe -msoft-float   -MD  -MF.depend.subr_prf.o -MTsubr_prf.o -std=gnu99 
> -fstack-protector-strong -Wsystem-headers -Werror -Wall -Wno-format-y2k -W 
> -Wno-unused-parameter -Wstrict-prototypes -Wmissing-prototypes 
> -Wpointer-arith -Wreturn-type -Wcast-qual -Wwrite-strings -Wswitch -Wshadow 
> -Wunused-parameter -Wcast-align -Wchar-subscripts -Winline -Wnested-externs 
> -Wredundant-decls -Wold-style-definition -Wno-pointer-sign 
> -Wno-error=unused-function -Wno-error=enum-compare 
> -Wno-error=logical-not-parentheses -Wno-error=bool-compare 
> -Wno-error=uninitialized -Wno-error=array-bounds -Wno-error=clobbered 
> -Wno-error=cast-align -W
 no-error=extra -Wno-error=attributes -Wno-error=inline 
-Wno-error=unused-but-set-variable -Wno-error=unused-value 
-Wno-error=strict-aliasing -Wno-error=address -Wno-error=unused-const-variable= 
-Wno-error=nonnull-compare -Wno-error=shift-negative-value 
-Wno-error=misleading-indentation -Wno-error=tautological-compare -c 
/home/rb743/dev/freebsd-riscv/lib/libsbuf/../../sys/kern/subr_prf.c -o 
subr_prf.o
> /home/rb743/dev/freebsd-riscv/lib/libsbuf/../../sys/kern/subr_prf.c:1200:1: 
> error: no previous prototype for 'counted_warning' 
> [-Werror=missing-prototypes]
>  counted_warning(unsigned *counter, const char *msg)
>  ^~~
> /home/rb743/dev/freebsd-riscv/lib/libsbuf/../../sys/kern/subr_prf.c: In 
> function 'counted_warning':
> /home/rb743/dev/freebsd-riscv/lib/libsbuf/../../sys/kern/subr_prf.c:1209:7: 
> error: implicit declaration of function 'atomic_cmpset_int' 
> [-Werror=implicit-function-declaration]
>if (atomic_cmpset_int(counter, c, c - 1)) {
>^
> /home/rb743/dev/freebsd-riscv/lib/libsbuf/../../sys/kern/subr_prf.c:1209:3: 
> error: nested extern declaration of 'atomic_cmpset_int' 
> [-Werror=nested-externs]
>if (atomic_cmpset_int(counter, c, c - 1)) {
>^~
> /home/rb743/dev/freebsd-riscv/lib/libsbuf/../../sys/kern/subr_prf.c:1210:9: 
> error: 'curthread' undeclared (first use in this function)
> td = curthread;
>  ^
> /home/rb743/dev/freebsd-riscv/lib/libsbuf/../../sys/kern/subr_prf.c:1210:9: 
> note: each undeclared identifier is reported only once for each function it 
> appears in
> /home/rb743/dev/freebsd-riscv/lib/libsbuf/../../sys/kern/subr_prf.c:1211:4: 
> error: implicit declaration of function 'log' 
> [-Werror=implicit-function-declaration]
> log(LOG_INFO, "pid %d (%s) %s%s\n",
> ^~~
> /home/rb743/dev/freebsd-riscv/lib/libsbuf/../../sys/kern/subr_prf.c:1211:4: 
> error: incompatible implicit declaration of built-in function 'log' [-Werror]
> /home/rb743/dev/freebsd-riscv/lib/libsbuf/../../sys/kern/subr_prf.c:1211:4: 
> note: include '' or provide a declaration of 'log'
> /home/rb743/dev/freebsd-riscv/lib/libsbuf/../../sys/kern/subr_prf.c:1211:8: 
> error: 'LOG_INFO' undeclared (first use in this function)
> log(LOG_INFO, "pid %d (%s) %s%s\n",
> ^~~~
> /home/rb743/dev/freebsd-riscv/lib/libsbuf/../../sys/kern/subr_prf.c:1212:10: 
> error: dereferencing pointer to incomplete type 'struct thread'
> td->td_proc->p_pid, td->td_name, msg,
>   ^~
> /home/rb743/dev/freebsd-riscv/lib/libsbuf/../../sys/kern/subr_prf.c:1211:4: 
> error: too many arguments to function 'log'
> log(LOG_INFO, "pid %d (%s) %s%s\n",
> ^~~
> cc1: all warnings being treated as errors
> *** [subr_prf.o] Error code 1
> 
> bmake[4]: stopped in /home/rb743/dev/freebsd-riscv/lib/libsbuf
> 1 error
> 
> bmake[4]: stopped in /home/rb743/dev/freebsd-riscv/lib/libsbuf
> *** [lib/libsbuf__L] Error code 2
> 
> bmake[3]: stopped in /home/rb743/dev/freebsd-riscv
> 1 error
> 
> bmake[3]: stopped in /home/rb743/dev/freebsd-riscv
> *** [libraries] Error code 2
> 
> bmake[2]: stopped in /home/rb743/dev/freebsd-riscv
> 1 error
> 
> bmake[2]: stopped in /home/rb743/dev/freebsd-riscv
> *** [_libraries] Error code 2
> 
> bmake[1]: stopped in /home/rb743/dev/freebsd-riscv
> 1 error
> 
> bmake[1]: stopped in /home/rb743/dev/freebsd-riscv
> *** [buildworld] Error code 2
> 
> make: stopped in /home/rb743/dev/freebsd-riscv
> 
> make: stopped in /home/rb743/dev/freebsd-riscv

This should be fixed with r303155.
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r303155 - head/sys/kern

2016-07-21 Thread Konstantin Belousov
Author: kib
Date: Thu Jul 21 17:59:30 2016
New Revision: 303155
URL: https://svnweb.freebsd.org/changeset/base/303155

Log:
  Hide counted_warning(9) under #ifdef _KERNEL braces, to allow building
  subr_prf.c in userspace for libsbuf.
  
  Sponsored by: The FreeBSD Foundation
  MFC after:1 week

Modified:
  head/sys/kern/subr_prf.c

Modified: head/sys/kern/subr_prf.c
==
--- head/sys/kern/subr_prf.cThu Jul 21 17:07:06 2016(r303154)
+++ head/sys/kern/subr_prf.cThu Jul 21 17:59:30 2016(r303155)
@@ -1196,6 +1196,7 @@ sbuf_hexdump(struct sbuf *sb, const void
}
 }
 
+#ifdef _KERNEL
 void
 counted_warning(unsigned *counter, const char *msg)
 {
@@ -1215,3 +1216,4 @@ counted_warning(unsigned *counter, const
}
}
 }
+#endif
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r303151 - in head/sys: dev/pty kern sys

2016-07-21 Thread Ruslan Bukin
Hi,

I get the issues below with GCC 6.1

[...]
===> lib/libsbuf (obj,all,install)
/home/rb743/opt/new17/bin/riscv64-unknown-freebsd11.0-gcc -isystem 
/home/rb743/obj//riscv.riscv64/home/rb743/dev/freebsd-riscv/tmp/usr/include 
-L/home/rb743/obj//riscv.riscv64/home/rb743/dev/freebsd-riscv/tmp/usr/lib 
--sysroot=/home/rb743/obj//riscv.riscv64/home/rb743/dev/freebsd-riscv/tmp 
-B/home/rb743/obj//riscv.riscv64/home/rb743/dev/freebsd-riscv/tmp/usr/bin  -O2 
-pipe -msoft-float   -MD  -MF.depend.subr_prf.o -MTsubr_prf.o -std=gnu99 
-fstack-protector-strong -Wsystem-headers -Werror -Wall -Wno-format-y2k -W 
-Wno-unused-parameter -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith 
-Wreturn-type -Wcast-qual -Wwrite-strings -Wswitch -Wshadow -Wunused-parameter 
-Wcast-align -Wchar-subscripts -Winline -Wnested-externs -Wredundant-decls 
-Wold-style-definition -Wno-pointer-sign -Wno-error=unused-function 
-Wno-error=enum-compare -Wno-error=logical-not-parentheses 
-Wno-error=bool-compare -Wno-error=uninitialized -Wno-error=array-bounds 
-Wno-error=clobbered -Wno-error=cast-align -Wno
 -error=extra -Wno-error=attributes -Wno-error=inline 
-Wno-error=unused-but-set-variable -Wno-error=unused-value 
-Wno-error=strict-aliasing -Wno-error=address -Wno-error=unused-const-variable= 
-Wno-error=nonnull-compare -Wno-error=shift-negative-value 
-Wno-error=misleading-indentation -Wno-error=tautological-compare -c 
/home/rb743/dev/freebsd-riscv/lib/libsbuf/../../sys/kern/subr_prf.c -o 
subr_prf.o
/home/rb743/dev/freebsd-riscv/lib/libsbuf/../../sys/kern/subr_prf.c:1200:1: 
error: no previous prototype for 'counted_warning' [-Werror=missing-prototypes]
 counted_warning(unsigned *counter, const char *msg)
 ^~~
/home/rb743/dev/freebsd-riscv/lib/libsbuf/../../sys/kern/subr_prf.c: In 
function 'counted_warning':
/home/rb743/dev/freebsd-riscv/lib/libsbuf/../../sys/kern/subr_prf.c:1209:7: 
error: implicit declaration of function 'atomic_cmpset_int' 
[-Werror=implicit-function-declaration]
   if (atomic_cmpset_int(counter, c, c - 1)) {
   ^
/home/rb743/dev/freebsd-riscv/lib/libsbuf/../../sys/kern/subr_prf.c:1209:3: 
error: nested extern declaration of 'atomic_cmpset_int' [-Werror=nested-externs]
   if (atomic_cmpset_int(counter, c, c - 1)) {
   ^~
/home/rb743/dev/freebsd-riscv/lib/libsbuf/../../sys/kern/subr_prf.c:1210:9: 
error: 'curthread' undeclared (first use in this function)
td = curthread;
 ^
/home/rb743/dev/freebsd-riscv/lib/libsbuf/../../sys/kern/subr_prf.c:1210:9: 
note: each undeclared identifier is reported only once for each function it 
appears in
/home/rb743/dev/freebsd-riscv/lib/libsbuf/../../sys/kern/subr_prf.c:1211:4: 
error: implicit declaration of function 'log' 
[-Werror=implicit-function-declaration]
log(LOG_INFO, "pid %d (%s) %s%s\n",
^~~
/home/rb743/dev/freebsd-riscv/lib/libsbuf/../../sys/kern/subr_prf.c:1211:4: 
error: incompatible implicit declaration of built-in function 'log' [-Werror]
/home/rb743/dev/freebsd-riscv/lib/libsbuf/../../sys/kern/subr_prf.c:1211:4: 
note: include '' or provide a declaration of 'log'
/home/rb743/dev/freebsd-riscv/lib/libsbuf/../../sys/kern/subr_prf.c:1211:8: 
error: 'LOG_INFO' undeclared (first use in this function)
log(LOG_INFO, "pid %d (%s) %s%s\n",
^~~~
/home/rb743/dev/freebsd-riscv/lib/libsbuf/../../sys/kern/subr_prf.c:1212:10: 
error: dereferencing pointer to incomplete type 'struct thread'
td->td_proc->p_pid, td->td_name, msg,
  ^~
/home/rb743/dev/freebsd-riscv/lib/libsbuf/../../sys/kern/subr_prf.c:1211:4: 
error: too many arguments to function 'log'
log(LOG_INFO, "pid %d (%s) %s%s\n",
^~~
cc1: all warnings being treated as errors
*** [subr_prf.o] Error code 1

bmake[4]: stopped in /home/rb743/dev/freebsd-riscv/lib/libsbuf
1 error

bmake[4]: stopped in /home/rb743/dev/freebsd-riscv/lib/libsbuf
*** [lib/libsbuf__L] Error code 2

bmake[3]: stopped in /home/rb743/dev/freebsd-riscv
1 error

bmake[3]: stopped in /home/rb743/dev/freebsd-riscv
*** [libraries] Error code 2

bmake[2]: stopped in /home/rb743/dev/freebsd-riscv
1 error

bmake[2]: stopped in /home/rb743/dev/freebsd-riscv
*** [_libraries] Error code 2

bmake[1]: stopped in /home/rb743/dev/freebsd-riscv
1 error

bmake[1]: stopped in /home/rb743/dev/freebsd-riscv
*** [buildworld] Error code 2

make: stopped in /home/rb743/dev/freebsd-riscv

make: stopped in /home/rb743/dev/freebsd-riscv
0 vica:/home/rb743/dev/freebsd-riscv >


On Thu, Jul 21, 2016 at 04:34:57PM +, Konstantin Belousov wrote:
> Author: kib
> Date: Thu Jul 21 16:34:56 2016
> New Revision: 303151
> URL: https://svnweb.freebsd.org/changeset/base/303151
> 
> Log:
>   Provide counter_warning(9) KPI which allows to issue limited number of
>   warnings for some kernel events, mostly intended for the use of
>   obsoleted or otherwise undersired interfaces.
>   
>   This is an abstracted and race-expelled code from compat pty driver.
>   
>   Requested and 

svn commit: r303154 - head/sys/kern

2016-07-21 Thread Konstantin Belousov
Author: kib
Date: Thu Jul 21 17:07:06 2016
New Revision: 303154
URL: https://svnweb.freebsd.org/changeset/base/303154

Log:
  Declare aio requests on files from local filesystems safe.
  Two notes:
  - I allow AIO on reclaimed vnodes, since it is deterministically terminated
fast.
  - devfs mounts are marked as MNT_LOCAL, but device vnodes have type
VCHR, so the slow device io is not allowed.
  
  Reviewed by:  jhb
  Sponsored by: The FreeBSD Foundation
  MFC after:1 week
  Differential revision:https://reviews.freebsd.org/D7273

Modified:
  head/sys/kern/vfs_aio.c

Modified: head/sys/kern/vfs_aio.c
==
--- head/sys/kern/vfs_aio.c Thu Jul 21 16:58:53 2016(r303153)
+++ head/sys/kern/vfs_aio.c Thu Jul 21 17:07:06 2016(r303154)
@@ -1664,7 +1664,10 @@ aio_queue_file(struct file *fp, struct k
struct aioliojob *lj;
struct kaioinfo *ki;
struct kaiocb *job2;
+   struct vnode *vp;
+   struct mount *mp;
int error, opcode;
+   bool safe;
 
lj = job->lio;
ki = job->userproc->p_aioinfo;
@@ -1685,7 +1688,16 @@ aio_queue_file(struct file *fp, struct k
goto done;
 #endif
 queueit:
-   if (!enable_aio_unsafe)
+   safe = false;
+   if (fp->f_type == DTYPE_VNODE) {
+   vp = fp->f_vnode;
+   if (vp->v_type == VREG || vp->v_type == VDIR) {
+   mp = fp->f_vnode->v_mount;
+   if (mp == NULL || (mp->mnt_flag & MNT_LOCAL) != 0)
+   safe = true;
+   }
+   }
+   if (!(safe || enable_aio_unsafe))
return (EOPNOTSUPP);
 
if (opcode == LIO_SYNC) {
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r303153 - head/share/man/man7

2016-07-21 Thread Konstantin Belousov
Author: kib
Date: Thu Jul 21 16:58:53 2016
New Revision: 303153
URL: https://svnweb.freebsd.org/changeset/base/303153

Log:
  Remove spurious but harmless double-quote.
  
  Noted by: jhb

Modified:
  head/share/man/man7/arch.7

Modified: head/share/man/man7/arch.7
==
--- head/share/man/man7/arch.7  Thu Jul 21 16:56:04 2016(r303152)
+++ head/share/man/man7/arch.7  Thu Jul 21 16:58:53 2016(r303153)
@@ -47,7 +47,7 @@ On all supported architectures,
 .It float Ta 4
 .It double Ta 8
 .El
-.Bl -column -offset indent "Sy Architecture" "Sy sizeof(void *)" "Sy 
"sizeof(long double)"
+.Bl -column -offset indent "Sy Architecture" "Sy sizeof(void *)" "Sy 
sizeof(long double)"
 .It Sy Architecture Ta Sy sizeof(void *) Ta Sy sizeof(long double)
 .It amd64   Ta 8 Ta 16
 .It arm Ta 4 Ta  8
@@ -66,7 +66,7 @@ On all supported architectures,
 .It sparc64 Ta 8 Ta 16
 .El
 .Ss Endianness and Char Signedness
-.Bl -column -offset indent "Sy Architecture" "Sy Endianness" "Sy "char 
Signedness"
+.Bl -column -offset indent "Sy Architecture" "Sy Endianness" "Sy char 
Signedness"
 .It Sy Architecture Ta Sy Endianness Ta Sy char Signedness
 .It amd64   Ta little Ta   signed
 .It arm Ta little Ta unsigned
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r303151 - in head/sys: dev/pty kern sys

2016-07-21 Thread Konstantin Belousov
Author: kib
Date: Thu Jul 21 16:34:56 2016
New Revision: 303151
URL: https://svnweb.freebsd.org/changeset/base/303151

Log:
  Provide counter_warning(9) KPI which allows to issue limited number of
  warnings for some kernel events, mostly intended for the use of
  obsoleted or otherwise undersired interfaces.
  
  This is an abstracted and race-expelled code from compat pty driver.
  
  Requested and reviewed by:jhb
  Sponsored by: The FreeBSD Foundation
  MFC after:1 week
  Differential revision:https://reviews.freebsd.org/D7270

Modified:
  head/sys/dev/pty/pty.c
  head/sys/kern/subr_prf.c
  head/sys/sys/systm.h

Modified: head/sys/dev/pty/pty.c
==
--- head/sys/dev/pty/pty.c  Thu Jul 21 15:48:41 2016(r303150)
+++ head/sys/dev/pty/pty.c  Thu Jul 21 16:34:56 2016(r303151)
@@ -52,10 +52,10 @@ __FBSDID("$FreeBSD$");
  * binary emulation.
  */
 
-static unsigned int pty_warningcnt = 1;
+static unsigned pty_warningcnt = 1;
 SYSCTL_UINT(_kern, OID_AUTO, tty_pty_warningcnt, CTLFLAG_RW,
-   _warningcnt, 0,
-   "Warnings that will be triggered upon legacy PTY allocation");
+_warningcnt, 0,
+"Warnings that will be triggered upon legacy PTY allocation");
 
 static int
 ptydev_fdopen(struct cdev *dev, int fflags, struct thread *td, struct file *fp)
@@ -77,12 +77,7 @@ ptydev_fdopen(struct cdev *dev, int ffla
}
 
/* Raise a warning when a legacy PTY has been allocated. */
-   if (pty_warningcnt > 0) {
-   pty_warningcnt--;
-   log(LOG_INFO, "pid %d (%s) is using legacy pty devices%s\n",
-   td->td_proc->p_pid, td->td_name,
-   pty_warningcnt ? "" : " - not logging anymore");
-   }
+   counted_warning(_warningcnt, "is using legacy pty devices");
 
return (0);
 }

Modified: head/sys/kern/subr_prf.c
==
--- head/sys/kern/subr_prf.cThu Jul 21 15:48:41 2016(r303150)
+++ head/sys/kern/subr_prf.cThu Jul 21 16:34:56 2016(r303151)
@@ -1196,3 +1196,22 @@ sbuf_hexdump(struct sbuf *sb, const void
}
 }
 
+void
+counted_warning(unsigned *counter, const char *msg)
+{
+   struct thread *td;
+   unsigned c;
+
+   for (;;) {
+   c = *counter;
+   if (c == 0)
+   break;
+   if (atomic_cmpset_int(counter, c, c - 1)) {
+   td = curthread;
+   log(LOG_INFO, "pid %d (%s) %s%s\n",
+   td->td_proc->p_pid, td->td_name, msg,
+   c > 1 ? "" : " - not logging anymore");
+   break;
+   }
+   }
+}

Modified: head/sys/sys/systm.h
==
--- head/sys/sys/systm.hThu Jul 21 15:48:41 2016(r303150)
+++ head/sys/sys/systm.hThu Jul 21 16:34:56 2016(r303151)
@@ -447,4 +447,6 @@ voidintr_prof_stack_use(struct thread *
 
 extern void (*softdep_ast_cleanup)(void);
 
+void counted_warning(unsigned *counter, const char *msg);
+
 #endif /* !_SYS_SYSTM_H_ */
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r301453 - in head/sys: arm/arm arm64/arm64 dev/fdt dev/gpio dev/iicbus dev/ofw dev/pci dev/vnic kern mips/mips sys

2016-07-21 Thread Nathan Whitehorn



On 07/21/16 00:34, Michal Meloun wrote:

Dne 20.07.2016 v 17:45 Nathan Whitehorn napsal(a):



On 07/20/16 04:28, Michal Meloun wrote:

Dne 19.07.2016 v 17:06 Nathan Whitehorn napsal(a):



On 07/19/16 04:13, Michal Meloun wrote:

Dne 19.07.2016 v 2:11 Nathan Whitehorn napsal(a):
Hi Nathan,
I’m afraid that skra is on vacation, for next 2 weeks (at 
minimum), so

please don’t expect quick response.


Could you please describe what this change is in more detail?

Short description is appended.

It breaks a lot of encapsulations we have worked very hard to 
maintain,
moves ARM code into MI parts of the kernel, and the OFW parts 
violate

IEEE 1275 (the Open Firmware standard). In particular, there is no
guarantee that the interrupts for a newbus (or OF) device are 
encoded in
a property called "interrupts" (or, indeed, in any property at 
all) on
that node and there are many, many device trees where that is not 
the

case (e.g. ones with interrupt maps, as well as Apple hardware). By
putting that knowledge into the OF root bus device, which we have 
tried
to keep it out of, this enforces a standard that doesn't actually 
exist.
Imho, this patch doesn’t change anything in this area. Only 
handling of

“interrupts” property is changed, all other cases are unchanged (I
hope).  Also, INTRNG code is currently shared by ARM, ARM64 and MIPS.


But "interrupts" isn't a generic part of OF. This makes it one, 
incorrectly.

How? Can you be little more exact ?


Because it puts knowledge into ofwbus that expects that children at 
arbitrary levels of nesting have interrupts defined by an 
"interrupts" property. You could patch this through on sub-devices, 
of course, but that's already done correctly by the existing 
ofw_bus_map_intr() code in a much more robust way that doesn't 
involve trying to guess how sub-buses and devices have chosen to 
allocate resources. Why reinvent the wheel all the way through the 
bus hierarchy?
 Nope, the code only expect that „interrupts" property is default way 
hot to get interrupt description.  Any device or bus in the hierarchy 
can fill appropriate resource list, or terminate call at any level.


"interrupts" should not be the default -- it's part of the OF bindings 
for the bus and is used (notably) by simplebus. The issue of 
cross-correlating RIDs is a much larger problem, however.


[snip]




The patch simply postpones reading of interrupt property to
bus_alloc_resource() (called by consumer driver) time.

Due to this, we can:
- parse  interrupt property. The interrupt driver must exist
   at this time.


This only works with some types of interrupt properties, not all, 
and breaks if the interrupt driver hasn't attached yet (which it 
can't be guaranteed to -- some PPC systems have interrupt drivers 
that live on the PCI bus, for example).
How you can allocate (and reserve it in rman) interrupt if is not 
mapped (so you have not real IRQ number for it). Just for notice -  
multiple virtual IRQs can be mapped into single real IRQ.


The core idea is to think of the full interrupt specifier -- the 
interrupt parent and the full byte string in the device tree -- as 
the IRQ rather than the interrupt pin on some chip (which is usually, 
but not always, the first word in that byte string). The "virtual" 
IRQ number is just a compression of that longer piece of data, which 
usually can't fit in an rman resource.
I understand.  While this approach can works (and actually works) for 
single sourced OFW world, it immediately fails if you must be able to 
parse data from different sources (which uses different encoding) 
(OFW, UEFI / ACPI, GPIO...) within one system.



On PowerPC, GENERIC64 supports FDT systems (some IBM hardware), OFW 
systems (Macs, some IBM hardware), systems with no device trees at all 
(old-style PS3), and systems with a mixture of device tree and no device 
tree (new-style PS3). On these, there is a mixture of "real" interrupts 
and GPIO-type interrupts. There is no limitation that this be used only 
for device-tree-type systems.


The system requires two things: an interrupt domain key and an arbitrary 
unique byte string describing the interrupt. When running with a device 
tree, these are set to the phandle of the interrupt-parent and the 
contents of the device tree interrupt specifier, respectively, and the 
system was of course developed with that in mind. But they don't need to 
be, and often aren't. You could make the domain an element of an enum 
(where "ACPI" is a choice, for instance -- this is what PS3 does), or 
set it to a pointer to a device_t, or really anything you like. 
Similarly, the interrupt specifier is totally free-form. You could, for 
instance, set it to one of the structures introduced in r301453 if you 
wanted to.


I would have zero problems with changing the prototype of the existing 
dev/ofw function to something more generic in name, like:


bus_map_intr(device_t dev, uintptr_t iparent, size_t intrlen, void *intr)

instead of 

svn commit: r303150 - head/sys/dev/flash

2016-07-21 Thread Adrian Chadd
Author: adrian
Date: Thu Jul 21 15:48:41 2016
New Revision: 303150
URL: https://svnweb.freebsd.org/changeset/base/303150

Log:
  [mx25l] add new device id.
  
  Tested:
  
  * (submitter) TP-Link TL-WR1043nd v3
  
  Submitted by: t...@enoti.me

Modified:
  head/sys/dev/flash/mx25l.c

Modified: head/sys/dev/flash/mx25l.c
==
--- head/sys/dev/flash/mx25l.c  Thu Jul 21 15:42:19 2016(r303149)
+++ head/sys/dev/flash/mx25l.c  Thu Jul 21 15:48:41 2016(r303150)
@@ -133,6 +133,9 @@ struct mx25l_flash_ident flash_devices[]
 
 /* Atmel */
{ "at25df641",  0x1f, 0x4800, 64 * 1024, 128, FL_ERASE_4K },
+
+   /* GigaDevice */
+   { "gd25q64",0xc8, 0x4017, 64 * 1024, 128, FL_ERASE_4K },
 };
 
 static uint8_t
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r303149 - svnadmin/conf

2016-07-21 Thread Adrian Chadd
Author: adrian
Date: Thu Jul 21 15:42:19 2016
New Revision: 303149
URL: https://svnweb.freebsd.org/changeset/base/303149

Log:
  Add Imre Vadasz to the fold.
  
  Approved by:  core (implicit)

Modified:
  svnadmin/conf/access
  svnadmin/conf/mentors

Modified: svnadmin/conf/access
==
--- svnadmin/conf/accessThu Jul 21 15:28:08 2016(r303148)
+++ svnadmin/conf/accessThu Jul 21 15:42:19 2016(r303149)
@@ -107,6 +107,7 @@ hrs
 hselasky
 ian
 imp
+imre
 ivoras
 iwasaki
 jah

Modified: svnadmin/conf/mentors
==
--- svnadmin/conf/mentors   Thu Jul 21 15:28:08 2016(r303148)
+++ svnadmin/conf/mentors   Thu Jul 21 15:42:19 2016(r303149)
@@ -18,6 +18,7 @@ benl  philip  Co-mentor: simon
 carl   jimharris
 cherry gibbs
 erignn Co-mentor: thompsa
+imre   adrian  Co-mentor: cognet
 jceel  trasz
 jkhrwatson
 jonathan   rwatson
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r303148 - svnadmin/conf

2016-07-21 Thread Adrian Chadd
Author: adrian
Date: Thu Jul 21 15:28:08 2016
New Revision: 303148
URL: https://svnweb.freebsd.org/changeset/base/303148

Log:
  Welcome Michael Zhilin to the fold.
  
  Approved by:  core (implicit)

Modified:
  svnadmin/conf/access
  svnadmin/conf/mentors

Modified: svnadmin/conf/access
==
--- svnadmin/conf/accessThu Jul 21 15:26:21 2016(r303147)
+++ svnadmin/conf/accessThu Jul 21 15:28:08 2016(r303148)
@@ -162,6 +162,7 @@ maxim
 mckay
 mckusick
 melifaro
+mizhka
 mjg
 mm
 mmel

Modified: svnadmin/conf/mentors
==
--- svnadmin/conf/mentors   Thu Jul 21 15:26:21 2016(r303147)
+++ svnadmin/conf/mentors   Thu Jul 21 15:28:08 2016(r303148)
@@ -27,6 +27,7 @@ karelsgnn
 landonfadrian
 mahrensmckusick
 miwi   rwatson
+mizhka adrian  Co-mentor: cognet
 monthadar  adrian
 peterj jhb Co-mentor: grog
 phil   theravenCo-mentor: sjg
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r303147 - head/contrib/binutils/bfd

2016-07-21 Thread Pedro F. Giffuni
Author: pfg
Date: Thu Jul 21 15:26:21 2016
New Revision: 303147
URL: https://svnweb.freebsd.org/changeset/base/303147

Log:
  binutils: fix "Bad value" error in bfd for MIPS when using -Bsymbolic.
  
  From OpenBSD's log:
  
  Inspired by https://sourceware.org/ml/binutils/2010-08/msg00333.html,
  but expressed differently so there are no GPLv3 issues.
  
  Obtained from:OpenBSD (CVS rev. 1.7)
  MFC after:1 month

Modified:
  head/contrib/binutils/bfd/elfxx-mips.c

Modified: head/contrib/binutils/bfd/elfxx-mips.c
==
--- head/contrib/binutils/bfd/elfxx-mips.c  Thu Jul 21 14:17:36 2016
(r303146)
+++ head/contrib/binutils/bfd/elfxx-mips.c  Thu Jul 21 15:26:21 2016
(r303147)
@@ -4801,7 +4801,7 @@ mips_elf_create_dynamic_relocation (bfd 
   /* We must now calculate the dynamic symbol table index to use
  in the relocation.  */
   if (h != NULL
-  && (!h->root.def_regular
+  && (sec == NULL || !h->root.def_regular
  || (info->shared && !info->symbolic && !h->root.forced_local)))
 {
   indx = h->root.dynindx;
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r303123 - head/sys/cam

2016-07-21 Thread Emmanuel Vadot

 Hello Warner,

 This break every kernel build that don't have nvme(4).

On Thu, 21 Jul 2016 03:11:35 + (UTC)
Warner Losh  wrote:

> Author: imp
> Date: Thu Jul 21 03:11:35 2016
> New Revision: 303123
> URL: https://svnweb.freebsd.org/changeset/base/303123
> 
> Log:
>   Fix mismerge and include the nvme support.
>   Also, print out the name of any CCB's functions that's not supported.
>   
>   MFC after: 1 week
> 
> Modified:
>   head/sys/cam/cam_xpt.c
> 
> Modified: head/sys/cam/cam_xpt.c
> ==
> --- head/sys/cam/cam_xpt.cThu Jul 21 00:53:14 2016(r303122)
> +++ head/sys/cam/cam_xpt.cThu Jul 21 03:11:35 2016(r303123)
> @@ -1033,6 +1033,8 @@ xpt_announce_periph(struct cam_periph *p
>   else if (path->device->protocol == PROTO_SEMB)
>   semb_print_ident(
>   (struct sep_identify_data *)>device->ident_data);
> + else if (path->device->protocol == PROTO_NVME)
> + nvme_print_ident(path->device->nvme_cdata, 
> path->device->nvme_data);
>   else
>   printf("Unknown protocol device\n");
>   if (path->device->serial_num_len > 0) {
> @@ -1086,6 +1088,8 @@ xpt_denounce_periph(struct cam_periph *p
>   else if (path->device->protocol == PROTO_SEMB)
>   semb_print_ident_short(
>   (struct sep_identify_data *)>device->ident_data);
> + else if (path->device->protocol == PROTO_NVME)
> + nvme_print_ident(path->device->nvme_cdata, 
> path->device->nvme_data);
>   else
>   printf("Unknown protocol device");
>   if (path->device->serial_num_len > 0)
> @@ -2516,6 +2520,10 @@ xpt_action_default(union ccb *start_ccb)
>   if (start_ccb->ccb_h.func_code == XPT_ATA_IO)
>   start_ccb->ataio.resid = 0;
>   /* FALLTHROUGH */
> + case XPT_NVME_IO:
> + if (start_ccb->ccb_h.func_code == XPT_NVME_IO)
> + start_ccb->nvmeio.resid = 0;
> + /* FALLTHROUGH */
>   case XPT_RESET_DEV:
>   case XPT_ENG_EXEC:
>   case XPT_SMP_IO:
> @@ -2655,6 +2663,8 @@ call_sim:
>   cgd->inq_data = dev->inq_data;
>   cgd->ident_data = dev->ident_data;
>   cgd->inq_flags = dev->inq_flags;
> + cgd->nvme_data = dev->nvme_data;
> + cgd->nvme_cdata = dev->nvme_cdata;
>   cgd->ccb_h.status = CAM_REQ_CMP;
>   cgd->serial_num_len = dev->serial_num_len;
>   if ((dev->serial_num_len > 0)
> @@ -3011,8 +3021,10 @@ call_sim:
>   case XPT_TERM_IO:
>   case XPT_ENG_INQ:
>   /* XXX Implement */
> - printf("%s: CCB type %#x not supported\n", __func__,
> -start_ccb->ccb_h.func_code);
> + xpt_print_path(start_ccb->ccb_h.path);
> + printf("%s: CCB type %#x %s not supported\n", __func__,
> + start_ccb->ccb_h.func_code,
> + xpt_action_name(start_ccb->ccb_h.func_code));
>   start_ccb->ccb_h.status = CAM_PROVIDE_FAIL;
>   if (start_ccb->ccb_h.func_code & XPT_FC_DEV_QUEUED) {
>   xpt_done(start_ccb);
> @@ -3315,6 +3327,13 @@ xpt_run_devq(struct cam_devq *devq)
>ata_cmd_string(_ccb->ataio.cmd,
>   cdb_str, sizeof(cdb_str;
>   break;
> + case XPT_NVME_IO:
> + CAM_DEBUG(work_ccb->ccb_h.path,
> + CAM_DEBUG_CDB,("%s. NCB: %s\n",
> +  nvme_op_string(_ccb->nvmeio.cmd),
> +  nvme_cmd_string(_ccb->nvmeio.cmd,
> + cdb_str, sizeof(cdb_str;
> + break;
>   default:
>   break;
>   }
> @@ -3904,6 +3923,9 @@ xpt_bus_register(struct cam_sim *sim, de
>   case XPORT_SATA:
>   new_bus->xport = ata_get_xport();
>   break;
> + case XPORT_NVME:
> + new_bus->xport = nvme_get_xport();
> + break;
>   default:
>   new_bus->xport = _default;
>   break;


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


svn commit: r303146 - head/usr.bin/sed

2016-07-21 Thread Pedro F. Giffuni
Author: pfg
Date: Thu Jul 21 14:17:36 2016
New Revision: 303146
URL: https://svnweb.freebsd.org/changeset/base/303146

Log:
  sed(1): Appease older GCC.

Modified:
  head/usr.bin/sed/process.c

Modified: head/usr.bin/sed/process.c
==
--- head/usr.bin/sed/process.c  Thu Jul 21 13:28:07 2016(r303145)
+++ head/usr.bin/sed/process.c  Thu Jul 21 14:17:36 2016(r303146)
@@ -97,11 +97,12 @@ process(void)
 {
struct s_command *cp;
SPACE tspace;
-   size_t oldpsl = 0;
+   size_t oldpsl;
char *p;
int oldpsanl;
 
p = NULL;
+   oldpsanl = oldpsl = 0;
 
for (linenum = 0; mf_fgets(, REPLACE);) {
pd = 0;
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r301453 - in head/sys: arm/arm arm64/arm64 dev/fdt dev/gpio dev/iicbus dev/ofw dev/pci dev/vnic kern mips/mips sys

2016-07-21 Thread Jonathan T. Looney
On 7/21/16, 3:34 AM, "owner-src-committ...@freebsd.org on behalf of Michal 
Meloun"  wrote:

> The API is part of still unstable, experimental INTRNG, so its not fixed we 
> we can 
> change it at any time, I think.

If INTRNG is unstable and experimental, why is it in the GENERIC kernel for 
arm64? Or, is the entire arm64 architecture considered unstable and 
experimental in 11.0?

(I'm not trying to take sides; these are honest questions.)

Jonathan


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


svn commit: r303145 - head/sys/arm/allwinner

2016-07-21 Thread Emmanuel Vadot
Author: manu
Date: Thu Jul 21 13:28:07 2016
New Revision: 303145
URL: https://svnweb.freebsd.org/changeset/base/303145

Log:
  axp209 needs aw_nmi so attach a bit earlier
  
  Reviewed by:  andrew
  Differential Revision:https://reviews.freebsd.org/D7081

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

Modified: head/sys/arm/allwinner/aw_nmi.c
==
--- head/sys/arm/allwinner/aw_nmi.c Thu Jul 21 13:26:39 2016
(r303144)
+++ head/sys/arm/allwinner/aw_nmi.c Thu Jul 21 13:28:07 2016
(r303145)
@@ -401,4 +401,4 @@ static driver_t aw_nmi_driver = {
 static devclass_t aw_nmi_devclass;
 
 EARLY_DRIVER_MODULE(aw_nmi, simplebus, aw_nmi_driver,
-aw_nmi_devclass, 0, 0, BUS_PASS_INTERRUPT + BUS_PASS_ORDER_LAST);
+aw_nmi_devclass, 0, 0, BUS_PASS_INTERRUPT + BUS_PASS_ORDER_LATE);
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r303144 - head/sys/arm/allwinner

2016-07-21 Thread Emmanuel Vadot
Author: manu
Date: Thu Jul 21 13:26:39 2016
New Revision: 303144
URL: https://svnweb.freebsd.org/changeset/base/303144

Log:
  We need the GIC to be attached so attach later at BUS_PASS_INTERRUPT + 
BUS_PASS_ORDER_LATE
  
  Reviewed by:  andrew
  MFC after:1 week
  Differential Revision:https://reviews.freebsd.org/D7080

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

Modified: head/sys/arm/allwinner/a10_gpio.c
==
--- head/sys/arm/allwinner/a10_gpio.c   Thu Jul 21 13:01:35 2016
(r303143)
+++ head/sys/arm/allwinner/a10_gpio.c   Thu Jul 21 13:26:39 2016
(r303144)
@@ -743,4 +743,4 @@ static driver_t a10_gpio_driver = {
 };
 
 EARLY_DRIVER_MODULE(a10_gpio, simplebus, a10_gpio_driver, a10_gpio_devclass, 
0, 0,
-BUS_PASS_INTERRUPT + BUS_PASS_ORDER_MIDDLE);
+BUS_PASS_INTERRUPT + BUS_PASS_ORDER_LATE);
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r303143 - in head/sys: dev/uart modules/uart

2016-07-21 Thread Andrew Turner
Author: andrew
Date: Thu Jul 21 13:01:35 2016
New Revision: 303143
URL: https://svnweb.freebsd.org/changeset/base/303143

Log:
  Fix the build:
   * Add acpi_if.h to the SRC list in the uart module
   * Only include new acpi headers when they are needed
  
  Obtained from:ABT Systems Ltd
  MFC after:1 month
  Sponsored by: The FreeBSD Foundation

Modified:
  head/sys/dev/uart/uart_bus_acpi.c
  head/sys/modules/uart/Makefile

Modified: head/sys/dev/uart/uart_bus_acpi.c
==
--- head/sys/dev/uart/uart_bus_acpi.c   Thu Jul 21 12:53:36 2016
(r303142)
+++ head/sys/dev/uart/uart_bus_acpi.c   Thu Jul 21 13:01:35 2016
(r303143)
@@ -41,9 +41,11 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 
+#ifdef __aarch64__
 #include 
 #include 
 #include 
+#endif
 
 static int uart_acpi_probe(device_t dev);
 

Modified: head/sys/modules/uart/Makefile
==
--- head/sys/modules/uart/Makefile  Thu Jul 21 12:53:36 2016
(r303142)
+++ head/sys/modules/uart/Makefile  Thu Jul 21 13:01:35 2016
(r303143)
@@ -32,7 +32,8 @@ SRCS= uart_bus_acpi.c ${uart_bus_ebus} u
uart_dev_z8530.c \
uart_if.c uart_if.h uart_subr.c uart_tty.c
 
-SRCS+= bus_if.h card_if.h device_if.h isa_if.h ${ofw_bus_if} pci_if.h \
+SRCS+= acpi_if.h bus_if.h card_if.h device_if.h isa_if.h ${ofw_bus_if} \
+   pci_if.h \
power_if.h pccarddevs.h serdev_if.h
 SRCS+= opt_platform.h opt_uart.h
 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r303142 - head/lib/libc/gen

2016-07-21 Thread Andrey A. Chernov
Author: ache
Date: Thu Jul 21 12:53:36 2016
New Revision: 303142
URL: https://svnweb.freebsd.org/changeset/base/303142

Log:
  1) GLOB_BRACE was somewhat broken. First it repeatedly calls glob0() in
  globexp1() recursive calls, but glob0() was not supposed to be called
  repeatedly in the original code. It finalize results by possible adding
  original pattern for no match case, may return GLOB_NOMATCH error and
  by sorting all things. Original pattern adding or GLOB_NOMATCH error
  can happens each time glob0() called repeatedly, and sorting happens
  for one item only, all things are never sorted. Second, f.e. "a{a"
  pattern does not match "a{a" file but match "a" file instead
  (just one example, there are many). Third, some errors (f.e. for limits
  or overflow) can be ignored by GLOB_BRACE code because it forces return (0).
  Add non-finalizing flag to glob0() and make globexp0() wrapper around
  recursively called globexp1() to finalize things like glob0() does.
  Reorganize braces code to work correctly.
  
  2) Don't allow MB_CUR_MAX * strlen overallocation hits GLOB_LIMIT_STRING
  (ARG_MAX) limit, use final string length, not malloced space for it.
  
  3) Revive DEBUG-ifdefed section.

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

Modified: head/lib/libc/gen/glob.c
==
--- head/lib/libc/gen/glob.cThu Jul 21 12:50:23 2016(r303141)
+++ head/lib/libc/gen/glob.cThu Jul 21 12:53:36 2016(r303142)
@@ -128,8 +128,6 @@ struct glob_limit {
 #defineRBRACE  L'}'
 #defineCOMMA   L','
 
-#ifndef DEBUG
-
 #defineM_QUOTE 0x80ULL
 #defineM_PROTECT   0x40ULL
 #defineM_MASK  0xffULL
@@ -137,18 +135,6 @@ struct glob_limit {
 
 typedef uint_fast64_t Char;
 
-#else
-
-#defineM_QUOTE 0x80
-#defineM_PROTECT   0x40
-#defineM_MASK  0xff
-#defineM_CHAR  0x7f
-
-typedef char Char;
-
-#endif
-
-
 #defineCHAR(c) ((Char)((c)_CHAR))
 #defineMETA(c) ((Char)((c)|M_QUOTE))
 #defineUNPROT(c)   ((c) & ~M_PROTECT)
@@ -171,7 +157,7 @@ static const Char *g_strchr(const Char *
 static Char*g_strcat(Char *, const Char *);
 #endif
 static int  g_stat(Char *, struct stat *, glob_t *);
-static int  glob0(const Char *, glob_t *, struct glob_limit *);
+static int  glob0(const Char *, glob_t *, struct glob_limit *, int);
 static int  glob1(Char *, glob_t *, struct glob_limit *);
 static int  glob2(Char *, Char *, Char *, Char *, glob_t *,
 struct glob_limit *);
@@ -180,8 +166,9 @@ static int   glob3(Char *, Char *, Char *
 static int  globextend(const Char *, glob_t *, struct glob_limit *, int);
 static const Char *
 globtilde(const Char *, Char *, size_t, glob_t *);
+static int  globexp0(const Char *, glob_t *, struct glob_limit *);
 static int  globexp1(const Char *, glob_t *, struct glob_limit *);
-static int  globexp2(const Char *, const Char *, glob_t *, int *,
+static int  globexp2(const Char *, const Char *, glob_t *,
 struct glob_limit *);
 static int  match(Char *, Char *, Char *);
 #ifdef DEBUG
@@ -260,9 +247,49 @@ glob(const char * __restrict pattern, in
*bufnext = EOS;
 
if (flags & GLOB_BRACE)
-   return (globexp1(patbuf, pglob, ));
+   return (globexp0(patbuf, pglob, ));
else
-   return (glob0(patbuf, pglob, ));
+   return (glob0(patbuf, pglob, , 1));
+}
+
+static int
+globexp0(const Char *pattern, glob_t *pglob, struct glob_limit *limit)
+{
+   int rv;
+   size_t oldpathc;
+
+   /* Protect a single {}, for find(1), like csh */
+   if (pattern[0] == LBRACE && pattern[1] == RBRACE && pattern[2] == EOS) {
+   if ((pglob->gl_flags & GLOB_LIMIT) &&
+   limit->l_brace_cnt++ >= GLOB_LIMIT_BRACE) {
+   errno = 0;
+   return (GLOB_NOSPACE);
+   }
+   return (glob0(pattern, pglob, limit, 1));
+   }
+
+   oldpathc = pglob->gl_pathc;
+
+   if ((rv = globexp1(pattern, pglob, limit)) != 0)
+   return rv;
+   /*
+* If there was no match we are going to append the pattern
+* if GLOB_NOCHECK was specified or if GLOB_NOMAGIC was specified
+* and the pattern 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(pattern, pglob, limit, 1));
+   else
+   return (GLOB_NOMATCH);
+   }
+   if (!(pglob->gl_flags & 

svn commit: r303141 - stable/11/sys/kern

2016-07-21 Thread Konstantin Belousov
Author: kib
Date: Thu Jul 21 12:50:23 2016
New Revision: 303141
URL: https://svnweb.freebsd.org/changeset/base/303141

Log:
  MFC r302981:
  Fix another bug after r302350.
  
  Approved by:  re (gjb)

Modified:
  stable/11/sys/kern/kern_exit.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/kern/kern_exit.c
==
--- stable/11/sys/kern/kern_exit.c  Thu Jul 21 12:15:04 2016
(r303140)
+++ stable/11/sys/kern/kern_exit.c  Thu Jul 21 12:50:23 2016
(r303141)
@@ -344,7 +344,7 @@ exit1(struct thread *td, int rval, int s
 * executing, prevent it from rearming itself and let it finish.
 */
if (timevalisset(>p_realtimer.it_value) &&
-   callout_stop(>p_itcallout) == 0) {
+   _callout_stop_safe(>p_itcallout, CS_EXECUTING, NULL) == 0) {
timevalclear(>p_realtimer.it_interval);
msleep(>p_itcallout, >p_mtx, PWAIT, "ritwait", 0);
KASSERT(!timevalisset(>p_realtimer.it_value),
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r301453 - in head/sys: arm/arm arm64/arm64 dev/fdt dev/gpio dev/iicbus dev/ofw dev/pci dev/vnic kern mips/mips sys

2016-07-21 Thread Andrew Turner
On Wed, 20 Jul 2016 13:28:53 +0200
Michal Meloun  wrote:
> Dne 19.07.2016 v 17:06 Nathan Whitehorn napsal(a):
> > 2. It partially duplicates the functionality of OFW_BUS_MAP_INTR(),
> > but is both problematically more general and less flexible (it has
> > requirements on timing of PIC attachment vs. driver resource
> > allocation)  
> OFW_BUS_MAP_INTR()  can parse only OFW  based data and expect that
> parsed data are magicaly stored within the call.
> The new method, bus_map_intr(),  can parse data from multiple sources 
> (OFW, UEFI / ACPI, synthetic[gpio device + pin number]).  It also
> returns parsed data back to caller.
> And no, it  doesn't  add any additional timing requirements .

I've been looking at ACPI on arm64. So far I have not found the need
for this with ACPI as we don't need to send the data to the interrupt
controller driver to be parsed in the way OFW/FDT needs to.

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


svn commit: r303140 - stable/11/sys/cam/ata

2016-07-21 Thread Alexander Motin
Author: mav
Date: Thu Jul 21 12:15:04 2016
New Revision: 303140
URL: https://svnweb.freebsd.org/changeset/base/303140

Log:
  MFC r302960: Restore PIM_ATA_EXT flag handling, lost at r300207.
  
  This re-enables NCQ TRIM usage on capable hardware (bhyve).
  
  Approved by:  re (kib)

Modified:
  stable/11/sys/cam/ata/ata_da.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/cam/ata/ata_da.c
==
--- stable/11/sys/cam/ata/ata_da.c  Thu Jul 21 11:58:47 2016
(r303139)
+++ stable/11/sys/cam/ata/ata_da.c  Thu Jul 21 12:15:04 2016
(r303140)
@@ -1774,6 +1774,8 @@ adaregister(struct cam_periph *periph, v
softc->disk->d_flags |= DISKFLAG_UNMAPPED_BIO;
softc->unmappedio = 1;
}
+   if (cpi.hba_misc & PIM_ATA_EXT)
+   softc->flags |= ADA_FLAG_PIM_ATA_EXT;
strlcpy(softc->disk->d_descr, cgd->ident_data.model,
MIN(sizeof(softc->disk->d_descr), sizeof(cgd->ident_data.model)));
strlcpy(softc->disk->d_ident, cgd->ident_data.serial,
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r303139 - stable/10/usr.sbin/bhyve

2016-07-21 Thread Alexander Motin
Author: mav
Date: Thu Jul 21 11:58:47 2016
New Revision: 303139
URL: https://svnweb.freebsd.org/changeset/base/303139

Log:
  MFC r302957: Fix NCQ TRIM emulation.
  
  When this code was written, there was no guests using it to test.

Modified:
  stable/10/usr.sbin/bhyve/pci_ahci.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/usr.sbin/bhyve/pci_ahci.c
==
--- stable/10/usr.sbin/bhyve/pci_ahci.c Thu Jul 21 11:57:41 2016
(r303138)
+++ stable/10/usr.sbin/bhyve/pci_ahci.c Thu Jul 21 11:58:47 2016
(r303139)
@@ -788,7 +788,15 @@ next:
done += 8;
if (elen == 0) {
if (done >= len) {
-   ahci_write_fis_d2h(p, slot, cfis, ATA_S_READY | 
ATA_S_DSC);
+   if (ncq) {
+   if (first)
+   ahci_write_fis_d2h_ncq(p, slot);
+   ahci_write_fis_sdb(p, slot, cfis,
+   ATA_S_READY | ATA_S_DSC);
+   } else {
+   ahci_write_fis_d2h(p, slot, cfis,
+   ATA_S_READY | ATA_S_DSC);
+   }
p->pending &= ~(1 << slot);
ahci_check_stopped(p);
if (!first)
@@ -1672,7 +1680,7 @@ ahci_handle_cmd(struct ahci_port *p, int
case ATA_SEND_FPDMA_QUEUED:
if ((cfis[13] & 0x1f) == ATA_SFPDMA_DSM &&
cfis[17] == 0 && cfis[16] == ATA_DSM_TRIM &&
-   cfis[11] == 0 && cfis[13] == 1) {
+   cfis[11] == 0 && cfis[3] == 1) {
ahci_handle_dsm_trim(p, slot, cfis, 0);
break;
}
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r303138 - stable/11/usr.sbin/bhyve

2016-07-21 Thread Alexander Motin
Author: mav
Date: Thu Jul 21 11:57:41 2016
New Revision: 303138
URL: https://svnweb.freebsd.org/changeset/base/303138

Log:
  MFC r302957: Fix NCQ TRIM emulation.
  
  When this code was written, there was no guests using it to test.
  
  Approved by:  re (kib)

Modified:
  stable/11/usr.sbin/bhyve/pci_ahci.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/usr.sbin/bhyve/pci_ahci.c
==
--- stable/11/usr.sbin/bhyve/pci_ahci.c Thu Jul 21 11:41:27 2016
(r303137)
+++ stable/11/usr.sbin/bhyve/pci_ahci.c Thu Jul 21 11:57:41 2016
(r303138)
@@ -784,7 +784,15 @@ next:
done += 8;
if (elen == 0) {
if (done >= len) {
-   ahci_write_fis_d2h(p, slot, cfis, ATA_S_READY | 
ATA_S_DSC);
+   if (ncq) {
+   if (first)
+   ahci_write_fis_d2h_ncq(p, slot);
+   ahci_write_fis_sdb(p, slot, cfis,
+   ATA_S_READY | ATA_S_DSC);
+   } else {
+   ahci_write_fis_d2h(p, slot, cfis,
+   ATA_S_READY | ATA_S_DSC);
+   }
p->pending &= ~(1 << slot);
ahci_check_stopped(p);
if (!first)
@@ -1665,7 +1673,7 @@ ahci_handle_cmd(struct ahci_port *p, int
case ATA_SEND_FPDMA_QUEUED:
if ((cfis[13] & 0x1f) == ATA_SFPDMA_DSM &&
cfis[17] == 0 && cfis[16] == ATA_DSM_TRIM &&
-   cfis[11] == 0 && cfis[13] == 1) {
+   cfis[11] == 0 && cfis[3] == 1) {
ahci_handle_dsm_trim(p, slot, cfis, 0);
break;
}
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r303137 - stable/10/sys/dev/vmware/vmxnet3

2016-07-21 Thread Alexander Motin
Author: mav
Date: Thu Jul 21 11:41:27 2016
New Revision: 303137
URL: https://svnweb.freebsd.org/changeset/base/303137

Log:
  MFC r303000: Update if_hwassist when interface options are changed.
  
  In particular for me this fixes checksum problem when if_bridge attached
  to the interface requests TXCSUM to be disabled, but effectively ignored.

Modified:
  stable/10/sys/dev/vmware/vmxnet3/if_vmx.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/dev/vmware/vmxnet3/if_vmx.c
==
--- stable/10/sys/dev/vmware/vmxnet3/if_vmx.c   Thu Jul 21 11:39:43 2016
(r303136)
+++ stable/10/sys/dev/vmware/vmxnet3/if_vmx.c   Thu Jul 21 11:41:27 2016
(r303137)
@@ -128,6 +128,7 @@ static int  vmxnet3_alloc_queue_data(stru
 static voidvmxnet3_free_queue_data(struct vmxnet3_softc *);
 static int vmxnet3_alloc_mcast_table(struct vmxnet3_softc *);
 static voidvmxnet3_init_shared_data(struct vmxnet3_softc *);
+static voidvmxnet3_init_hwassist(struct vmxnet3_softc *);
 static voidvmxnet3_reinit_interface(struct vmxnet3_softc *);
 static voidvmxnet3_reinit_rss_shared_data(struct vmxnet3_softc *);
 static voidvmxnet3_reinit_shared_data(struct vmxnet3_softc *);
@@ -1584,6 +1585,24 @@ vmxnet3_init_shared_data(struct vmxnet3_
 }
 
 static void
+vmxnet3_init_hwassist(struct vmxnet3_softc *sc)
+{
+   struct ifnet *ifp = sc->vmx_ifp;
+   uint64_t hwassist;
+
+   hwassist = 0;
+   if (ifp->if_capenable & IFCAP_TXCSUM)
+   hwassist |= VMXNET3_CSUM_OFFLOAD;
+   if (ifp->if_capenable & IFCAP_TXCSUM_IPV6)
+   hwassist |= VMXNET3_CSUM_OFFLOAD_IPV6;
+   if (ifp->if_capenable & IFCAP_TSO4)
+   hwassist |= CSUM_IP_TSO;
+   if (ifp->if_capenable & IFCAP_TSO6)
+   hwassist |= CSUM_IP6_TSO;
+   ifp->if_hwassist = hwassist;
+}
+
+static void
 vmxnet3_reinit_interface(struct vmxnet3_softc *sc)
 {
struct ifnet *ifp;
@@ -1594,15 +1613,7 @@ vmxnet3_reinit_interface(struct vmxnet3_
bcopy(IF_LLADDR(sc->vmx_ifp), sc->vmx_lladdr, ETHER_ADDR_LEN);
vmxnet3_set_lladdr(sc);
 
-   ifp->if_hwassist = 0;
-   if (ifp->if_capenable & IFCAP_TXCSUM)
-   ifp->if_hwassist |= VMXNET3_CSUM_OFFLOAD;
-   if (ifp->if_capenable & IFCAP_TXCSUM_IPV6)
-   ifp->if_hwassist |= VMXNET3_CSUM_OFFLOAD_IPV6;
-   if (ifp->if_capenable & IFCAP_TSO4)
-   ifp->if_hwassist |= CSUM_IP_TSO;
-   if (ifp->if_capenable & IFCAP_TSO6)
-   ifp->if_hwassist |= CSUM_IP6_TSO;
+   vmxnet3_init_hwassist(sc);
 }
 
 static void
@@ -3284,6 +3295,8 @@ vmxnet3_ioctl(struct ifnet *ifp, u_long 
if (reinit && (ifp->if_drv_flags & IFF_DRV_RUNNING)) {
ifp->if_drv_flags &= ~IFF_DRV_RUNNING;
vmxnet3_init_locked(sc);
+   } else {
+   vmxnet3_init_hwassist(sc);
}
 
VMXNET3_CORE_UNLOCK(sc);
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r303136 - stable/11/sys/dev/vmware/vmxnet3

2016-07-21 Thread Alexander Motin
Author: mav
Date: Thu Jul 21 11:39:43 2016
New Revision: 303136
URL: https://svnweb.freebsd.org/changeset/base/303136

Log:
  Update if_hwassist when interface options are changed.
  
  In particular for me this fixes checksum problem when if_bridge attached
  to the interface requests TXCSUM to be disabled, but effectively ignored.
  
  Approved by:  re (kib)

Modified:
  stable/11/sys/dev/vmware/vmxnet3/if_vmx.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/dev/vmware/vmxnet3/if_vmx.c
==
--- stable/11/sys/dev/vmware/vmxnet3/if_vmx.c   Thu Jul 21 10:44:26 2016
(r303135)
+++ stable/11/sys/dev/vmware/vmxnet3/if_vmx.c   Thu Jul 21 11:39:43 2016
(r303136)
@@ -130,6 +130,7 @@ static int  vmxnet3_alloc_queue_data(stru
 static voidvmxnet3_free_queue_data(struct vmxnet3_softc *);
 static int vmxnet3_alloc_mcast_table(struct vmxnet3_softc *);
 static voidvmxnet3_init_shared_data(struct vmxnet3_softc *);
+static voidvmxnet3_init_hwassist(struct vmxnet3_softc *);
 static voidvmxnet3_reinit_interface(struct vmxnet3_softc *);
 static voidvmxnet3_reinit_rss_shared_data(struct vmxnet3_softc *);
 static voidvmxnet3_reinit_shared_data(struct vmxnet3_softc *);
@@ -1583,6 +1584,24 @@ vmxnet3_init_shared_data(struct vmxnet3_
 }
 
 static void
+vmxnet3_init_hwassist(struct vmxnet3_softc *sc)
+{
+   struct ifnet *ifp = sc->vmx_ifp;
+   uint64_t hwassist;
+
+   hwassist = 0;
+   if (ifp->if_capenable & IFCAP_TXCSUM)
+   hwassist |= VMXNET3_CSUM_OFFLOAD;
+   if (ifp->if_capenable & IFCAP_TXCSUM_IPV6)
+   hwassist |= VMXNET3_CSUM_OFFLOAD_IPV6;
+   if (ifp->if_capenable & IFCAP_TSO4)
+   hwassist |= CSUM_IP_TSO;
+   if (ifp->if_capenable & IFCAP_TSO6)
+   hwassist |= CSUM_IP6_TSO;
+   ifp->if_hwassist = hwassist;
+}
+
+static void
 vmxnet3_reinit_interface(struct vmxnet3_softc *sc)
 {
struct ifnet *ifp;
@@ -1593,15 +1612,7 @@ vmxnet3_reinit_interface(struct vmxnet3_
bcopy(IF_LLADDR(sc->vmx_ifp), sc->vmx_lladdr, ETHER_ADDR_LEN);
vmxnet3_set_lladdr(sc);
 
-   ifp->if_hwassist = 0;
-   if (ifp->if_capenable & IFCAP_TXCSUM)
-   ifp->if_hwassist |= VMXNET3_CSUM_OFFLOAD;
-   if (ifp->if_capenable & IFCAP_TXCSUM_IPV6)
-   ifp->if_hwassist |= VMXNET3_CSUM_OFFLOAD_IPV6;
-   if (ifp->if_capenable & IFCAP_TSO4)
-   ifp->if_hwassist |= CSUM_IP_TSO;
-   if (ifp->if_capenable & IFCAP_TSO6)
-   ifp->if_hwassist |= CSUM_IP6_TSO;
+   vmxnet3_init_hwassist(sc);
 }
 
 static void
@@ -3284,6 +3295,8 @@ vmxnet3_ioctl(struct ifnet *ifp, u_long 
if (reinit && (ifp->if_drv_flags & IFF_DRV_RUNNING)) {
ifp->if_drv_flags &= ~IFF_DRV_RUNNING;
vmxnet3_init_locked(sc);
+   } else {
+   vmxnet3_init_hwassist(sc);
}
 
VMXNET3_CORE_UNLOCK(sc);
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r303135 - stable/11/release

2016-07-21 Thread Glen Barber
Author: gjb
Date: Thu Jul 21 10:44:26 2016
New Revision: 303135
URL: https://svnweb.freebsd.org/changeset/base/303135

Log:
  MFC r303003:
  
   Make sure we clean up the rdoc and reldoc directories if NODOC
   is not set.
  
  Approved by:  re (kib)
  Sponsored by: The FreeBSD Foundation

Modified:
  stable/11/release/Makefile
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/release/Makefile
==
--- stable/11/release/Makefile  Thu Jul 21 09:37:17 2016(r303134)
+++ stable/11/release/Makefile  Thu Jul 21 10:44:26 2016(r303135)
@@ -119,6 +119,9 @@ CLEANFILES+=${I}.xz
 CLEANFILES+=   pkg-stage
 .endif
 CLEANDIRS= dist ftp disc1 bootonly dvd
+.if !defined(NODOC)
+CLEANDIRS+=reldoc rdoc
+.endif
 beforeclean:
chflags -R noschg .
 .include 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r303133 - head/sys/dev/uart

2016-07-21 Thread Andrew Turner
On Thu, 21 Jul 2016 09:32:56 + (UTC)
Andrew Turner  wrote:

> Author: andrew
> Date: Thu Jul 21 09:32:55 2016
> New Revision: 303133
> URL: https://svnweb.freebsd.org/changeset/base/303133
> 
> Log:
>   Add support for arm64 to uart_dev_acpi by using the _HID property
> to find the uart class to use in a similar way as the fdt driver.
>   

Reviewed by: jhb

>   Obtained from:  ABT Systems Ltd
>   MFC after:  1 month
>   Sponsored by:   The FreeBSD Foundation
>   Differential Revision:  https://reviews.freebsd.org/D7248

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


svn commit: r303134 - head/share/man/man7

2016-07-21 Thread Konstantin Belousov
Author: kib
Date: Thu Jul 21 09:37:17 2016
New Revision: 303134
URL: https://svnweb.freebsd.org/changeset/base/303134

Log:
  Improve typesetting.
  
  Reviewed by:  bapt
  No objections from:   emaste
  Sponsored by: The FreeBSD Foundation
  Differential revision:https://reviews.freebsd.org/D7261

Modified:
  head/share/man/man7/arch.7

Modified: head/share/man/man7/arch.7
==
--- head/share/man/man7/arch.7  Thu Jul 21 09:32:55 2016(r303133)
+++ head/share/man/man7/arch.7  Thu Jul 21 09:37:17 2016(r303134)
@@ -47,7 +47,7 @@ On all supported architectures,
 .It float Ta 4
 .It double Ta 8
 .El
-.Bl -column -offset indent ".Sy Architecture" ".Sy sizeof(void *)" ".Sy 
"sizeof(long double)"
+.Bl -column -offset indent "Sy Architecture" "Sy sizeof(void *)" "Sy 
"sizeof(long double)"
 .It Sy Architecture Ta Sy sizeof(void *) Ta Sy sizeof(long double)
 .It amd64   Ta 8 Ta 16
 .It arm Ta 4 Ta  8
@@ -66,7 +66,7 @@ On all supported architectures,
 .It sparc64 Ta 8 Ta 16
 .El
 .Ss Endianness and Char Signedness
-.Bl -column -offset indent ".Sy Architecture" ".Sy Endianness" ".Sy "char 
Signedness"
+.Bl -column -offset indent "Sy Architecture" "Sy Endianness" "Sy "char 
Signedness"
 .It Sy Architecture Ta Sy Endianness Ta Sy char Signedness
 .It amd64   Ta little Ta   signed
 .It arm Ta little Ta unsigned
@@ -85,7 +85,7 @@ On all supported architectures,
 .It sparc64 Ta bigTa   signed
 .El
 .Ss Page Size
-.Bl -column -offset indent ".Sy Architecture" ".Sy Page Sizes"
+.Bl -column -offset indent "Sy Architecture" "Sy Page Sizes"
 .It Sy Architecture Ta Sy Page Sizes
 .It amd64   Ta 4K, 2M, 1G
 .It arm Ta 4K
@@ -104,7 +104,7 @@ On all supported architectures,
 .It sparc64 Ta 8K
 .El
 .Ss Floating Point
-.Bl -column -offset indent ".Sy Architecture" ".Sy float, double" ".Sy long 
double"
+.Bl -column -offset indent "Sy Architecture" "Sy float, double" "Sy long 
double"
 .It Sy Architecture Ta Sy float, double Ta Sy long double
 .It amd64   Ta hard Ta hard, 80 bit
 .It arm Ta soft Ta soft, double precision
@@ -134,16 +134,18 @@ cc -x c -Dm -E /dev/null
 .Ed
 .Pp
 Common type size and endianness macros:
-.Bl -column -offset indent "BYTE_ORDER" ".Sy Meaning"
+.Bl -column -offset indent "BYTE_ORDER" "Sy Meaning"
 .It Sy Macro Ta Sy Meaning
 .It Dv __LP64__ Ta 64-bit (8-byte) long and pointer, 32-bit (4-byte) int
 .It Dv __ILP32__ Ta 32-bit (4-byte) int, long and pointer
 .It Dv BYTE_ORDER Ta Either Dv BIG_ENDIAN or Dv LITTLE_ENDIAN .
-.Dv PDP11_ENDIAN is not used on FreeBSD.
+.Dv PDP11_ENDIAN
+is not used on
+.Fx .
 .El
 .Pp
 Architecture-specific macros:
-.Bl -column -offset indent ".Sy Architecture" ".Sy Predefined macros"
+.Bl -column -offset indent "Sy Architecture" "Sy Predefined macros"
 .It Sy Architecture Ta Sy Predefined macros
 .It amd64   Ta Dv __amd64__, Dv __x86_64__
 .It arm Ta Dv __arm__
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r303133 - head/sys/dev/uart

2016-07-21 Thread Andrew Turner
Author: andrew
Date: Thu Jul 21 09:32:55 2016
New Revision: 303133
URL: https://svnweb.freebsd.org/changeset/base/303133

Log:
  Add support for arm64 to uart_dev_acpi by using the _HID property to find
  the uart class to use in a similar way as the fdt driver.
  
  Obtained from:ABT Systems Ltd
  MFC after:1 month
  Sponsored by: The FreeBSD Foundation
  Differential Revision:https://reviews.freebsd.org/D7248

Added:
  head/sys/dev/uart/uart_cpu_acpi.h   (contents, props changed)
Modified:
  head/sys/dev/uart/uart_bus_acpi.c
  head/sys/dev/uart/uart_dev_pl011.c

Modified: head/sys/dev/uart/uart_bus_acpi.c
==
--- head/sys/dev/uart/uart_bus_acpi.c   Thu Jul 21 08:22:25 2016
(r303132)
+++ head/sys/dev/uart/uart_bus_acpi.c   Thu Jul 21 09:32:55 2016
(r303133)
@@ -39,6 +39,11 @@ __FBSDID("$FreeBSD$");
 
 #include 
 #include 
+#include 
+
+#include 
+#include 
+#include 
 
 static int uart_acpi_probe(device_t dev);
 
@@ -57,6 +62,7 @@ static driver_t uart_acpi_driver = {
sizeof(struct uart_softc),
 };
 
+#if defined(__i386__) || defined(__amd64__)
 static struct isa_pnp_id acpi_ns8250_ids[] = {
{0x0005d041, "Standard PC COM port"},   /* PNP0500 */
{0x0105d041, "16550A-compatible COM port"}, /* PNP0501 */
@@ -67,6 +73,27 @@ static struct isa_pnp_id acpi_ns8250_ids
{0xe502aa1a, "Wacom Tablet at FuS Lifebook T"}, /* FUJ02E5 */
{0}
 };
+#endif
+
+#ifdef __aarch64__
+static struct uart_class *
+uart_acpi_find_device(device_t dev)
+{
+   struct acpi_uart_compat_data **cd;
+   ACPI_HANDLE h;
+
+   if ((h = acpi_get_handle(dev)) == NULL)
+   return (NULL);
+
+   SET_FOREACH(cd, uart_acpi_class_and_device_set) {
+   if (acpi_MatchHid(h, (*cd)->hid)) {
+   return ((*cd)->clas);
+   }
+   }
+
+   return (NULL);
+}
+#endif
 
 static int
 uart_acpi_probe(device_t dev)
@@ -77,12 +104,18 @@ uart_acpi_probe(device_t dev)
parent = device_get_parent(dev);
sc = device_get_softc(dev);
 
+#if defined(__i386__) || defined(__amd64__)
if (!ISA_PNP_PROBE(parent, dev, acpi_ns8250_ids)) {
sc->sc_class = _ns8250_class;
return (uart_bus_probe(dev, 0, 0, 0, 0));
}
 
/* Add checks for non-ns8250 IDs here. */
+#elif defined(__aarch64__)
+   if ((sc->sc_class = uart_acpi_find_device(dev)) != NULL)
+   return (uart_bus_probe(dev, 2, 0, 0, 0));
+#endif
+
return (ENXIO);
 }
 

Added: head/sys/dev/uart/uart_cpu_acpi.h
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/sys/dev/uart/uart_cpu_acpi.h   Thu Jul 21 09:32:55 2016
(r303133)
@@ -0,0 +1,62 @@
+/*-
+ * Copyright (c) 2015 Michal Meloun
+ * Copyright (c) 2016 The FreeBSD Foundation
+ * All rights reserved.
+ *
+ * This software was developed by Andrew Turner under
+ * sponsorship from the FreeBSD Foundation.
+ *
+ * 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 _DEV_UART_CPU_ACPI_H_
+#define _DEV_UART_CPU_ACPI_H_
+
+#include 
+
+struct uart_class;
+
+struct acpi_uart_compat_data {
+   const char *hid;
+   struct uart_class *clas;
+};
+
+/*
+ * If your UART driver implements only uart_class and uses uart_cpu_acpi.c
+ * for device instantiation, then use UART_ACPI_CLASS_AND_DEVICE for its
+ * declaration
+ */
+SET_DECLARE(uart_acpi_class_and_device_set, struct acpi_uart_compat_data);
+#define UART_ACPI_CLASS_AND_DEVICE(data)   \
+   

Re: svn commit: r303123 - head/sys/cam

2016-07-21 Thread Andrew Turner
On Thu, 21 Jul 2016 03:11:35 + (UTC)
Warner Losh  wrote:

> Author: imp
> Date: Thu Jul 21 03:11:35 2016
> New Revision: 303123
> URL: https://svnweb.freebsd.org/changeset/base/303123
> 
> Log:
>   Fix mismerge and include the nvme support.
>   Also, print out the name of any CCB's functions that's not
> supported. 
>   MFC after: 1 week
> 
> Modified:
>   head/sys/cam/cam_xpt.c
> 
> Modified: head/sys/cam/cam_xpt.c
> ==
> --- head/sys/cam/cam_xpt.cThu Jul 21 00:53:14 2016
> (r303122) +++ head/sys/cam/cam_xpt.c  Thu Jul 21 03:11:35
> 2016  (r303123) @@ -1033,6 +1033,8 @@
> xpt_announce_periph(struct cam_periph *p else if
> (path->device->protocol == PROTO_SEMB) semb_print_ident(
>   (struct sep_identify_data
> *)>device->ident_data);
> + else if (path->device->protocol == PROTO_NVME)
> + nvme_print_ident(path->device->nvme_cdata,
> path->device->nvme_data);
This breaks kernel configs with scbus but not nvme. This seems to be
most of the non-x86 configs.

linking kernel.full
cam_xpt.o: In function `xpt_announce_periph':
/usr/home/andrew/freebsd/repo/head-svn/sys/cam/cam_xpt.c:1037: undefined 
reference to `nvme_print_ident'
cam_xpt.o: In function `xpt_denounce_periph':
/usr/home/andrew/freebsd/repo/head-svn/sys/cam/cam_xpt.c:1092: undefined 
reference to `nvme_print_ident'
cam_xpt.o: In function `xpt_run_devq':
/usr/home/andrew/freebsd/repo/head-svn/sys/cam/cam_xpt.c:3331: undefined 
reference to `nvme_op_string'
/usr/home/andrew/freebsd/repo/head-svn/sys/cam/cam_xpt.c:3331: undefined 
reference to `nvme_cmd_string'
cam_xpt.o: In function `xpt_bus_register':
/usr/home/andrew/freebsd/repo/head-svn/sys/cam/cam_xpt.c:3927: undefined 
reference to `nvme_get_xport'
--- kernel.full ---
*** [kernel.full] Error code 1


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


svn commit: r303132 - head/usr.sbin/ctld

2016-07-21 Thread Edward Tomasz Napierala
Author: trasz
Date: Thu Jul 21 08:22:25 2016
New Revision: 303132
URL: https://svnweb.freebsd.org/changeset/base/303132

Log:
  Add documentation for "ctld -u", the UCL configuration file format.
  
  Submitted by: jceel@
  Reviewed by:  wblock@
  MFC after:3 days
  Differential Revision:https://reviews.freebsd.org/D7222

Modified:
  head/usr.sbin/ctld/ctl.conf.5
  head/usr.sbin/ctld/ctld.8

Modified: head/usr.sbin/ctld/ctl.conf.5
==
--- head/usr.sbin/ctld/ctl.conf.5   Thu Jul 21 06:09:47 2016
(r303131)
+++ head/usr.sbin/ctld/ctl.conf.5   Thu Jul 21 08:22:25 2016
(r303132)
@@ -28,7 +28,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd November 9, 2015
+.Dd July 21, 2016
 .Dt CTL.CONF 5
 .Os
 .Sh NAME
@@ -481,6 +481,97 @@ target naa.50015178f369f092 {
lun 0 example_1
 }
 .Ed
+.Pp
+An equivalent configuration in UCL format, for use with
+.Fl u : 
+.Bd -literal
+auth-group {
+   ag0 {
+   chap-mutual = [
+   {
+   user = "user"
+   secret = "secretsecret"
+   mutual-user = "mutualuser"
+   mutual-secret = "mutualsecret"
+   },
+   {
+   user = "user2"
+   secret = "secret2secret2"
+   mutual-user = "mutualuser"
+   mutual-secret = "mutualsecret"
+   }
+   ]
+   }
+
+   ag1 {
+   auth-type = none
+   initiator-name = [
+   "iqn.2012-06.com.example:initiatorhost1",
+   "iqn.2012-06.com.example:initiatorhost2"
+   ]
+   initiator-portal = [192.168.1.1/24, "[2001:db8::de:ef]"]
+   }
+}
+
+portal-group {
+   pg0 {
+   discovery-auth-group = no-authentication
+   listen = [
+   0.0.0.0:3260,
+   "[::]:3260",
+   "[fe80::be:ef]:3261"
+   ]
+   }
+}
+
+lun {
+   example_0 {
+   path = /dev/zvol/tank/example_0
+   blocksize = 4096
+   size = "4G"
+   }
+
+   example_1 {
+   path = /dev/zvol/tank/example_1
+   options {
+   naa = "0x50015178f369f093"
+   }
+   }
+
+   example_2 {
+   path = /dev/zvol/tank/example_2
+   options {
+   vendor = "FreeBSD"
+   }
+   }
+}
+
+target {
+   "iqn.2012-06.com.example:target0" {
+   alias = "Example target"
+   auth-group = no-authentication
+   lun = [
+   { number = 0, name = example_0 },
+   ]
+   }
+
+   "iqn.2012-06.com.example:target1" {
+   auth-group = ag0
+   portal-group { name = pg0 }
+   lun = [
+   { number = 0, name = example_1 },
+   { number = 1, name = example_2 }
+   ]
+   }
+
+   naa.50015178f369f092 {
+   port = isp0
+   lun = [
+   { number = 0, name = example_1 }
+   ]
+   }
+}
+.Ed
 .Sh SEE ALSO
 .Xr ctl 4 ,
 .Xr ctladm 8 ,

Modified: head/usr.sbin/ctld/ctld.8
==
--- head/usr.sbin/ctld/ctld.8   Thu Jul 21 06:09:47 2016(r303131)
+++ head/usr.sbin/ctld/ctld.8   Thu Jul 21 08:22:25 2016(r303132)
@@ -27,7 +27,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd May 22, 2015
+.Dd July 21, 2016
 .Dt CTLD 8
 .Os
 .Sh NAME
@@ -37,6 +37,7 @@
 .Nm
 .Op Fl d
 .Op Fl f Ar config-file
+.Op Fl u
 .Sh DESCRIPTION
 The
 .Nm
@@ -84,6 +85,8 @@ The daemon sends verbose debug output to
 put itself in the background.
 The daemon will also not fork and will exit after processing one connection.
 This option is only intended for debugging the target.
+.It Fl u
+Use UCL configuration file format instead of the traditional non-UCL format.
 .El
 .Sh FILES
 .Bl -tag -width ".Pa /var/run/ctld.pid" -compact
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


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

2016-07-21 Thread Hans Petter Selasky

On 07/21/16 10:12, Hans Petter Selasky wrote:

On 07/20/16 18:44, Gleb Smirnoff wrote:

Author: glebius
Date: Wed Jul 20 16:44:22 2016
New Revision: 303096
URL: https://svnweb.freebsd.org/changeset/base/303096

Log:
  Revert r303037. It re-introduces the panic with TCP timers.

  Agreed by:rrs, re (gjb)

Modified:
  head/sys/kern/kern_timeout.c



Hi,

The panic with TCP timers can also be fixes calling callout_stop() twice
instead of once.


s/fixes/fixed



First time out call it it will return 1,0,-1. Second time only 0 or -1.


First call will return 1,0,-1 and second time it will return 0 or -1, 
which is what you are looking for.


--HPS

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


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

2016-07-21 Thread Hans Petter Selasky

On 07/20/16 18:44, Gleb Smirnoff wrote:

Author: glebius
Date: Wed Jul 20 16:44:22 2016
New Revision: 303096
URL: https://svnweb.freebsd.org/changeset/base/303096

Log:
  Revert r303037. It re-introduces the panic with TCP timers.

  Agreed by:rrs, re (gjb)

Modified:
  head/sys/kern/kern_timeout.c



Hi,

The panic with TCP timers can also be fixes calling callout_stop() twice 
instead of once.


First time out call it it will return 1,0,-1. Second time only 0 or -1.

--HPS

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


Re: svn commit: r301453 - in head/sys: arm/arm arm64/arm64 dev/fdt dev/gpio dev/iicbus dev/ofw dev/pci dev/vnic kern mips/mips sys

2016-07-21 Thread Michal Meloun
Dne 20.07.2016 v 17:45 Nathan Whitehorn napsal(a):
>
>
> On 07/20/16 04:28, Michal Meloun wrote:
>> Dne 19.07.2016 v 17:06 Nathan Whitehorn napsal(a):
>>>
>>>
>>> On 07/19/16 04:13, Michal Meloun wrote:
 Dne 19.07.2016 v 2:11 Nathan Whitehorn napsal(a):
 Hi Nathan,
 I’m afraid that skra is on vacation, for next 2 weeks (at minimum), so
 please don’t expect quick response.

> Could you please describe what this change is in more detail?
 Short description is appended.

> It breaks a lot of encapsulations we have worked very hard to
> maintain,
> moves ARM code into MI parts of the kernel, and the OFW parts violate
> IEEE 1275 (the Open Firmware standard). In particular, there is no
> guarantee that the interrupts for a newbus (or OF) device are
> encoded in
> a property called "interrupts" (or, indeed, in any property at
> all) on
> that node and there are many, many device trees where that is not the
> case (e.g. ones with interrupt maps, as well as Apple hardware). By
> putting that knowledge into the OF root bus device, which we have
> tried
> to keep it out of, this enforces a standard that doesn't actually
> exist.
 Imho, this patch doesn’t change anything in this area. Only
 handling of
 “interrupts” property is changed, all other cases are unchanged (I
 hope).  Also, INTRNG code is currently shared by ARM, ARM64 and MIPS.
>>>
>>> But "interrupts" isn't a generic part of OF. This makes it one,
>>> incorrectly.
>> How? Can you be little more exact ?
>
> Because it puts knowledge into ofwbus that expects that children at
> arbitrary levels of nesting have interrupts defined by an "interrupts"
> property. You could patch this through on sub-devices, of course, but
> that's already done correctly by the existing ofw_bus_map_intr() code
> in a much more robust way that doesn't involve trying to guess how
> sub-buses and devices have chosen to allocate resources. Why reinvent
> the wheel all the way through the bus hierarchy?
 Nope, the code only expect that „interrupts" property is default way
hot to get interrupt description.  Any device or bus in the hierarchy
can fill appropriate resource list, or terminate call at any level.
>
>>>

> I'm hesitant to ask for reversion on something that landed 6 weeks
> ago
> without me noticing, but this needs a lot more architectural work
> before
> any parts of the kernel should use it.
> -Nathan
 I think that it’s too late.  This patch series consist of r301451
 (https://reviews.freebsd.org/D6632),
 r301453, r301539 and 301543.  And new GPIO interrupts are currently
 used
 (by in tree drivers or in development trees).
>>>
>>> Well, then we need in-place rearchitecture.
>>>


 The root of problem is that standard way of delivering interrupt
 resource to consumer driver doesn’t works in OFW world.

 So we have some fact:
 - the format of interrupt property is dependent of interrupt
controller and only interrupt controller can parse it.
 - the interrupt property can have more data than just interrupt
number.
 - single interrupt controller must be able to handle multiple
format of interrupt description.

 In pre-patchset era, simplebus enumerates children and attempts to set
 memory and interrupts to resource list for them. But the interrupt
 controllers are not yet populated so nobody can parse interrupt
 property. Moreover, in all cases (parsed or not), we cannot store
 complete interrupt description into resource list.
>>>
>>> We have done this for many years on PowerPC and sparc64 with delayed
>>> configuration of interrupts and a look-up table. This handles
>>> complicated bus configurations better than this code and requires no
>>> changes outside of a few MD files. That is why the (now partially
>>> duplicated) OFW_BUS_MAP_INTR() function exists. That one also has
>>> the benefit of still working when used in conjunction with, e.g.,
>>> devices with an interrupt-map-mask property.
>>>

 The patch simply postpones reading of interrupt property to
 bus_alloc_resource() (called by consumer driver) time.

 Due to this, we can:
 - parse  interrupt property. The interrupt driver must exist
at this time.
>>>
>>> This only works with some types of interrupt properties, not all,
>>> and breaks if the interrupt driver hasn't attached yet (which it
>>> can't be guaranteed to -- some PPC systems have interrupt drivers
>>> that live on the PCI bus, for example).
>> How you can allocate (and reserve it in rman) interrupt if is not
>> mapped (so you have not real IRQ number for it). Just for notice - 
>> multiple virtual IRQs can be mapped into single real IRQ.
>
> The core idea is to think of the full interrupt specifier -- the
> interrupt parent and the full byte string in the device tree -- as the
> IRQ rather 

svn commit: r303131 - in head/sys/dev/hyperv: include netvsc storvsc utilities vmbus

2016-07-21 Thread Sepherosa Ziehau
Author: sephe
Date: Thu Jul 21 06:09:47 2016
New Revision: 303131
URL: https://svnweb.freebsd.org/changeset/base/303131

Log:
  hyperv: hv_vmbus_channel -> vmbus_channel
  
  MFC after:1 week
  Sponsored by: Microsoft OSTC
  Differential Revision:https://reviews.freebsd.org/D7260

Modified:
  head/sys/dev/hyperv/include/vmbus.h
  head/sys/dev/hyperv/netvsc/hv_net_vsc.c
  head/sys/dev/hyperv/netvsc/hv_net_vsc.h
  head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c
  head/sys/dev/hyperv/netvsc/hv_rndis.h
  head/sys/dev/hyperv/netvsc/hv_rndis_filter.c
  head/sys/dev/hyperv/netvsc/hv_rndis_filter.h
  head/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c
  head/sys/dev/hyperv/utilities/hv_heartbeat.c
  head/sys/dev/hyperv/utilities/hv_kvp.c
  head/sys/dev/hyperv/utilities/hv_shutdown.c
  head/sys/dev/hyperv/utilities/hv_timesync.c
  head/sys/dev/hyperv/utilities/hv_util.c
  head/sys/dev/hyperv/utilities/hv_util.h
  head/sys/dev/hyperv/vmbus/vmbus.c
  head/sys/dev/hyperv/vmbus/vmbus_chan.c
  head/sys/dev/hyperv/vmbus/vmbus_chanvar.h
  head/sys/dev/hyperv/vmbus/vmbus_var.h

Modified: head/sys/dev/hyperv/include/vmbus.h
==
--- head/sys/dev/hyperv/include/vmbus.h Thu Jul 21 06:06:11 2016
(r303130)
+++ head/sys/dev/hyperv/include/vmbus.h Thu Jul 21 06:09:47 2016
(r303131)
@@ -104,56 +104,56 @@ struct vmbus_chanpkt_rxbuf {
 #define VMBUS_CHAN_SGLIST_MAX  32
 #define VMBUS_CHAN_PRPLIST_MAX 32
 
-struct hv_vmbus_channel;
+struct vmbus_channel;
 struct hyperv_guid;
 
-typedef void   (*vmbus_chan_callback_t)(struct hv_vmbus_channel *, void *);
+typedef void   (*vmbus_chan_callback_t)(struct vmbus_channel *, void *);
 
-static __inline struct hv_vmbus_channel *
+static __inline struct vmbus_channel *
 vmbus_get_channel(device_t dev)
 {
return device_get_ivars(dev);
 }
 
-intvmbus_chan_open(struct hv_vmbus_channel *chan,
+intvmbus_chan_open(struct vmbus_channel *chan,
int txbr_size, int rxbr_size, const void *udata, int udlen,
vmbus_chan_callback_t cb, void *cbarg);
-void   vmbus_chan_close(struct hv_vmbus_channel *chan);
+void   vmbus_chan_close(struct vmbus_channel *chan);
 
-intvmbus_chan_gpadl_connect(struct hv_vmbus_channel *chan,
+intvmbus_chan_gpadl_connect(struct vmbus_channel *chan,
bus_addr_t paddr, int size, uint32_t *gpadl);
-intvmbus_chan_gpadl_disconnect(struct hv_vmbus_channel *chan,
+intvmbus_chan_gpadl_disconnect(struct vmbus_channel *chan,
uint32_t gpadl);
 
-void   vmbus_chan_cpu_set(struct hv_vmbus_channel *chan, int cpu);
-void   vmbus_chan_cpu_rr(struct hv_vmbus_channel *chan);
-struct hv_vmbus_channel *
-   vmbus_chan_cpu2chan(struct hv_vmbus_channel *chan, int cpu);
-void   vmbus_chan_set_readbatch(struct hv_vmbus_channel *chan, bool on);
-
-struct hv_vmbus_channel **
-   vmbus_subchan_get(struct hv_vmbus_channel *pri_chan, int subchan_cnt);
-void   vmbus_subchan_rel(struct hv_vmbus_channel **subchan, int subchan_cnt);
-void   vmbus_subchan_drain(struct hv_vmbus_channel *pri_chan);
+void   vmbus_chan_cpu_set(struct vmbus_channel *chan, int cpu);
+void   vmbus_chan_cpu_rr(struct vmbus_channel *chan);
+struct vmbus_channel *
+   vmbus_chan_cpu2chan(struct vmbus_channel *chan, int cpu);
+void   vmbus_chan_set_readbatch(struct vmbus_channel *chan, bool on);
+
+struct vmbus_channel **
+   vmbus_subchan_get(struct vmbus_channel *pri_chan, int subchan_cnt);
+void   vmbus_subchan_rel(struct vmbus_channel **subchan, int subchan_cnt);
+void   vmbus_subchan_drain(struct vmbus_channel *pri_chan);
 
-intvmbus_chan_recv(struct hv_vmbus_channel *chan, void *data, int *dlen,
+intvmbus_chan_recv(struct vmbus_channel *chan, void *data, int *dlen,
uint64_t *xactid);
-intvmbus_chan_recv_pkt(struct hv_vmbus_channel *chan,
+intvmbus_chan_recv_pkt(struct vmbus_channel *chan,
struct vmbus_chanpkt_hdr *pkt, int *pktlen);
 
-intvmbus_chan_send(struct hv_vmbus_channel *chan, uint16_t type,
+intvmbus_chan_send(struct vmbus_channel *chan, uint16_t type,
uint16_t flags, void *data, int dlen, uint64_t xactid);
-intvmbus_chan_send_sglist(struct hv_vmbus_channel *chan,
+intvmbus_chan_send_sglist(struct vmbus_channel *chan,
struct vmbus_gpa sg[], int sglen, void *data, int dlen,
uint64_t xactid);
-intvmbus_chan_send_prplist(struct hv_vmbus_channel *chan,
+intvmbus_chan_send_prplist(struct vmbus_channel *chan,
struct vmbus_gpa_range *prp, int prp_cnt, void *data, int dlen,
uint64_t xactid);
 
-uint32_t vmbus_chan_id(const struct hv_vmbus_channel *chan);
-uint32_t vmbus_chan_subidx(const struct hv_vmbus_channel *chan);
-bool   vmbus_chan_is_primary(const struct hv_vmbus_channel *chan);
+uint32_t vmbus_chan_id(const struct vmbus_channel *chan);
+uint32_t vmbus_chan_subidx(const struct vmbus_channel 

svn commit: r303130 - in head: . share/man/man7

2016-07-21 Thread Bryan Drewery
Author: bdrewery
Date: Thu Jul 21 06:06:11 2016
New Revision: 303130
URL: https://svnweb.freebsd.org/changeset/base/303130

Log:
  Add LOCAL_XTOOL_DIRS to add into cross-tools.
  
  Sponsored by: EMC / Isilon Storage Division

Modified:
  head/Makefile.inc1
  head/share/man/man7/build.7

Modified: head/Makefile.inc1
==
--- head/Makefile.inc1  Thu Jul 21 05:46:26 2016(r303129)
+++ head/Makefile.inc1  Thu Jul 21 06:06:11 2016(r303130)
@@ -22,6 +22,8 @@
 #  to be created before files are installed
 #  LOCAL_TOOL_DIRS="list of dirs" to add additional dirs to the build-tools
 #  list
+#  LOCAL_XTOOL_DIRS="list of dirs" to add additional dirs to the
+#  cross-tools target
 #  METALOG="path to metadata log" to write permission and ownership
 #  when NO_ROOT is set.  (default: ${DESTDIR}/METALOG)
 #  TARGET="machine" to crossbuild world for a different machine type
@@ -1815,6 +1817,7 @@ _usb_tools=   sys/boot/usb/tools
 
 cross-tools: .MAKE .PHONY
 .for _tool in \
+${LOCAL_XTOOL_DIRS} \
 ${_clang_libs} \
 ${_clang} \
 ${_binutils} \

Modified: head/share/man/man7/build.7
==
--- head/share/man/man7/build.7 Thu Jul 21 05:46:26 2016(r303129)
+++ head/share/man/man7/build.7 Thu Jul 21 06:06:11 2016(r303130)
@@ -24,7 +24,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd April 28, 2016
+.Dd July 20, 2016
 .Dt BUILD 7
 .Os
 .Sh NAME
@@ -462,6 +462,11 @@ If set, this variable supplies a list of
 the root of the source tree to build as part of the
 .Cm build-tools
 target.
+.It Va LOCAL_XTOOL_DIRS
+If set, this variable supplies a list of additional directories relative to
+the root of the source tree to build as part of the
+.Cm cross-tools
+target.
 .It Va PORTS_MODULES
 A list of ports with kernel modules that should be built and installed
 as part of the
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"