svn commit: r322406 - head/sys/kern

2017-08-11 Thread Mark Johnston
Author: markj
Date: Fri Aug 11 16:32:24 2017
New Revision: 322406
URL: https://svnweb.freebsd.org/changeset/base/322406

Log:
  Have sendfile_swapin() use vm_page_grab_pages().
  
  Reviewed by:  alc, kib
  MFC after:2 weeks
  Differential Revision:https://reviews.freebsd.org/D11942

Modified:
  head/sys/kern/kern_sendfile.c

Modified: head/sys/kern/kern_sendfile.c
==
--- head/sys/kern/kern_sendfile.c   Fri Aug 11 16:29:22 2017
(r322405)
+++ head/sys/kern/kern_sendfile.c   Fri Aug 11 16:32:24 2017
(r322406)
@@ -309,7 +309,7 @@ sendfile_swapin(vm_object_t obj, struct sf_io *sfio, o
 int npages, int rhpages, int flags)
 {
vm_page_t *pa = sfio->pa;
-   int nios;
+   int grabbed, nios;
 
nios = 0;
flags = (flags & SF_NODISKIO) ? VM_ALLOC_NOWAIT : 0;
@@ -319,14 +319,14 @@ sendfile_swapin(vm_object_t obj, struct sf_io *sfio, o
 * only required pages.  Readahead pages are dealt with later.
 */
VM_OBJECT_WLOCK(obj);
-   for (int i = 0; i < npages; i++) {
-   pa[i] = vm_page_grab(obj, OFF_TO_IDX(vmoff(i, off)),
-   VM_ALLOC_WIRED | VM_ALLOC_NORMAL | flags);
-   if (pa[i] == NULL) {
-   npages = i;
-   rhpages = 0;
-   break;
-   }
+
+   grabbed = vm_page_grab_pages(obj, OFF_TO_IDX(off),
+   VM_ALLOC_NORMAL | VM_ALLOC_WIRED | flags, pa, npages);
+   if (grabbed < npages) {
+   for (int i = grabbed; i < npages; i++)
+   pa[i] = NULL;
+   npages = grabbed;
+   rhpages = 0;
}
 
for (int i = 0; i < npages;) {
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r322371 - head/lib/libc/tests/gen

2017-08-11 Thread Ngie Cooper

> On Aug 10, 2017, at 11:03, Pedro F. Giffuni  wrote:
> 
> Author: pfg
> Date: Thu Aug 10 17:03:46 2017
> New Revision: 322371
> URL: https://svnweb.freebsd.org/changeset/base/322371
> 
> Log:
>  fnmatch(3): Update testcase for r322368.
> 
> Modified:
>  head/lib/libc/tests/gen/fnmatch_testcases.h

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


svn commit: r322405 - in head/sys: kern sparc64/sparc64 vm

2017-08-11 Thread Mark Johnston
Author: markj
Date: Fri Aug 11 16:29:22 2017
New Revision: 322405
URL: https://svnweb.freebsd.org/changeset/base/322405

Log:
  Modify vm_page_grab_pages() to handle VM_ALLOC_NOWAIT.
  
  This will allow its use in sendfile_swapin().
  
  Reviewed by:  alc, kib
  MFC after:2 weeks
  Differential Revision:https://reviews.freebsd.org/D11942

Modified:
  head/sys/kern/vfs_bio.c
  head/sys/sparc64/sparc64/pmap.c
  head/sys/vm/vm_glue.c
  head/sys/vm/vm_page.c
  head/sys/vm/vm_page.h

Modified: head/sys/kern/vfs_bio.c
==
--- head/sys/kern/vfs_bio.c Fri Aug 11 16:27:54 2017(r322404)
+++ head/sys/kern/vfs_bio.c Fri Aug 11 16:29:22 2017(r322405)
@@ -2746,7 +2746,7 @@ vfs_vmio_extend(struct buf *bp, int desiredpages, int 
 * deadlocks once allocbuf() is called after
 * pages are vfs_busy_pages().
 */
-   vm_page_grab_pages(obj,
+   (void)vm_page_grab_pages(obj,
OFF_TO_IDX(bp->b_offset) + bp->b_npages,
VM_ALLOC_SYSTEM | VM_ALLOC_IGN_SBUSY |
VM_ALLOC_NOBUSY | VM_ALLOC_WIRED,

Modified: head/sys/sparc64/sparc64/pmap.c
==
--- head/sys/sparc64/sparc64/pmap.c Fri Aug 11 16:27:54 2017
(r322404)
+++ head/sys/sparc64/sparc64/pmap.c Fri Aug 11 16:29:22 2017
(r322405)
@@ -1248,7 +1248,7 @@ pmap_pinit(pmap_t pm)
CPU_ZERO(>pm_active);
 
VM_OBJECT_WLOCK(pm->pm_tsb_obj);
-   vm_page_grab_pages(pm->pm_tsb_obj, 0, VM_ALLOC_NORMAL |
+   (void)vm_page_grab_pages(pm->pm_tsb_obj, 0, VM_ALLOC_NORMAL |
VM_ALLOC_NOBUSY | VM_ALLOC_WIRED | VM_ALLOC_ZERO, ma, TSB_PAGES);
VM_OBJECT_WUNLOCK(pm->pm_tsb_obj);
for (i = 0; i < TSB_PAGES; i++)

Modified: head/sys/vm/vm_glue.c
==
--- head/sys/vm/vm_glue.c   Fri Aug 11 16:27:54 2017(r322404)
+++ head/sys/vm/vm_glue.c   Fri Aug 11 16:29:22 2017(r322405)
@@ -391,7 +391,7 @@ vm_thread_new(struct thread *td, int pages)
 * page of stack.
 */
VM_OBJECT_WLOCK(ksobj);
-   vm_page_grab_pages(ksobj, 0, VM_ALLOC_NORMAL | VM_ALLOC_NOBUSY |
+   (void)vm_page_grab_pages(ksobj, 0, VM_ALLOC_NORMAL | VM_ALLOC_NOBUSY |
VM_ALLOC_WIRED, ma, pages);
for (i = 0; i < pages; i++)
ma[i]->valid = VM_PAGE_BITS_ALL;
@@ -568,7 +568,7 @@ vm_thread_swapin(struct thread *td)
pages = td->td_kstack_pages;
ksobj = td->td_kstack_obj;
VM_OBJECT_WLOCK(ksobj);
-   vm_page_grab_pages(ksobj, 0, VM_ALLOC_NORMAL | VM_ALLOC_WIRED, ma,
+   (void)vm_page_grab_pages(ksobj, 0, VM_ALLOC_NORMAL | VM_ALLOC_WIRED, ma,
pages);
for (int i = 0; i < pages;) {
int j, a, count, rv;

Modified: head/sys/vm/vm_page.c
==
--- head/sys/vm/vm_page.c   Fri Aug 11 16:27:54 2017(r322404)
+++ head/sys/vm/vm_page.c   Fri Aug 11 16:29:22 2017(r322405)
@@ -3173,13 +3173,15 @@ retrylookup:
  * optional allocation flags:
  * VM_ALLOC_IGN_SBUSY  do not sleep on soft busy pages
  * VM_ALLOC_NOBUSY do not exclusive busy the page
+ * VM_ALLOC_NOWAIT do not sleep
  * VM_ALLOC_SBUSY  set page to sbusy state
  * VM_ALLOC_WIRED  wire the pages
  * VM_ALLOC_ZERO   zero and validate any invalid pages
  *
- * This routine may sleep.
+ * If VM_ALLOC_NOWAIT is not specified, this routine may sleep.  Otherwise, it
+ * may return a partial prefix of the requested range.
  */
-void
+int
 vm_page_grab_pages(vm_object_t object, vm_pindex_t pindex, int allocflags,
 vm_page_t *ma, int count)
 {
@@ -3197,7 +3199,7 @@ vm_page_grab_pages(vm_object_t object, vm_pindex_t pin
(allocflags & VM_ALLOC_IGN_SBUSY) != 0,
("vm_page_grab_pages: VM_ALLOC_SBUSY/IGN_SBUSY mismatch"));
if (count == 0)
-   return;
+   return (0);
i = 0;
 retrylookup:
m = vm_page_lookup(object, pindex + i);
@@ -3206,6 +3208,8 @@ retrylookup:
sleep = (allocflags & VM_ALLOC_IGN_SBUSY) != 0 ?
vm_page_xbusied(m) : vm_page_busied(m);
if (sleep) {
+   if ((allocflags & VM_ALLOC_NOWAIT) != 0)
+   break;
/*
 * Reference the page before unlocking and
 * sleeping so that the page daemon is less
@@ -3233,6 +3237,8 @@ retrylookup:
m = vm_page_alloc(object, pindex + i, (allocflags &

svn commit: r322404 - head/sys/kern

2017-08-11 Thread Alan Cox
Author: alc
Date: Fri Aug 11 16:27:54 2017
New Revision: 322404
URL: https://svnweb.freebsd.org/changeset/base/322404

Log:
  An invalid page can't be dirty.
  
  Reviewed by:  kib
  MFC after:1 week

Modified:
  head/sys/kern/kern_sendfile.c

Modified: head/sys/kern/kern_sendfile.c
==
--- head/sys/kern/kern_sendfile.c   Fri Aug 11 14:19:55 2017
(r322403)
+++ head/sys/kern/kern_sendfile.c   Fri Aug 11 16:27:54 2017
(r322404)
@@ -355,7 +355,7 @@ sendfile_swapin(vm_object_t obj, struct sf_io *sfio, o
)) {
pmap_zero_page(pa[i]);
pa[i]->valid = VM_PAGE_BITS_ALL;
-   pa[i]->dirty = 0;
+   MPASS(pa[i]->dirty == 0);
vm_page_xunbusy(pa[i]);
i++;
continue;
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r322411 - in head/sys: dev/xen/timer isa x86/isa

2017-08-11 Thread Ian Lepore
Author: ian
Date: Fri Aug 11 19:02:11 2017
New Revision: 322411
URL: https://svnweb.freebsd.org/changeset/base/322411

Log:
  Stop calling atrtc_set() from the xen timer clock_settime() method.  That
  removes the only reference to atrtc_set() from outside of atrtc.c, so make
  it static.
  
  The xen timer driver registers as a realtime clock with 1us resolution.  In
  the past that resulted in only the xen timer's clock_settime() getting
  called, so it would call atrtc_set() to set the hardware clock as well.  As
  of r32090, the clock_settime() method of all registered realtime clocks gets
  called, so the xen driver no longer needs to chain-call the lower-resolution
  driver.
  
  Thanks to royger@ for talking me through the xen stuff, and for testing.

Modified:
  head/sys/dev/xen/timer/timer.c
  head/sys/isa/rtc.h
  head/sys/x86/isa/atrtc.c

Modified: head/sys/dev/xen/timer/timer.c
==
--- head/sys/dev/xen/timer/timer.c  Fri Aug 11 18:43:52 2017
(r322410)
+++ head/sys/dev/xen/timer/timer.c  Fri Aug 11 19:02:11 2017
(r322411)
@@ -64,8 +64,6 @@ __FBSDID("$FreeBSD$");
 
 #include 
 
-#include 
-
 #include "clock_if.h"
 
 static devclass_t xentimer_devclass;
@@ -228,9 +226,6 @@ xentimer_settime(device_t dev __unused, struct timespe
 */
if (!xen_initial_domain())
return (0);
-
-   /* Set the native RTC. */
-   atrtc_set(ts);
 
settime.cmd = XENPF_settime64;
settime.u.settime64.mbz = 0;

Modified: head/sys/isa/rtc.h
==
--- head/sys/isa/rtc.h  Fri Aug 11 18:43:52 2017(r322410)
+++ head/sys/isa/rtc.h  Fri Aug 11 19:02:11 2017(r322411)
@@ -118,7 +118,6 @@ extern  int atrtcclock_disable;
 intrtcin(int reg);
 void   atrtc_restore(void);
 void   writertc(int reg, u_char val);
-void   atrtc_set(struct timespec *ts);
 #endif
 
 #endif /* _I386_ISA_RTC_H_ */

Modified: head/sys/x86/isa/atrtc.c
==
--- head/sys/x86/isa/atrtc.cFri Aug 11 18:43:52 2017(r322410)
+++ head/sys/x86/isa/atrtc.cFri Aug 11 19:02:11 2017(r322411)
@@ -164,7 +164,7 @@ atrtc_restore(void)
rtcin(RTC_INTR);
 }
 
-void
+static void
 atrtc_set(struct timespec *ts)
 {
struct clocktime ct;
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r322409 - head/sys/arm/at91

2017-08-11 Thread Ed Maste
Author: emaste
Date: Fri Aug 11 18:09:26 2017
New Revision: 322409
URL: https://svnweb.freebsd.org/changeset/base/322409

Log:
  Rename at91_pmc's M_PMC malloc type to avoid duplicate definition
  
  M_PMC is defined in sys/dev/hwpmc/hwpmc_mod.c, and the LINT kernel build
  fails when linking with lld due to a duplicate symbol error.
  
  Sponsored by: The FreeBSD Foundation

Modified:
  head/sys/arm/at91/at91_pmc.c

Modified: head/sys/arm/at91/at91_pmc.c
==
--- head/sys/arm/at91/at91_pmc.cFri Aug 11 17:43:25 2017
(r322408)
+++ head/sys/arm/at91/at91_pmc.cFri Aug 11 18:09:26 2017
(r322409)
@@ -63,8 +63,8 @@ static struct at91_pmc_softc {
 
 static uint32_t pllb_init;
 
-MALLOC_DECLARE(M_PMC);
-MALLOC_DEFINE(M_PMC, "at91_pmc_clocks", "AT91 PMC Clock descriptors");
+MALLOC_DECLARE(M_PMC_CLK);
+MALLOC_DEFINE(M_PMC_CLK, "at91_pmc_clocks", "AT91 PMC Clock descriptors");
 
 #define AT91_PMC_BASE 0xc00
 
@@ -300,12 +300,12 @@ at91_pmc_clock_add(const char *name, uint32_t irq,
struct at91_pmc_clock *clk;
int i, buflen;
 
-   clk = malloc(sizeof(*clk), M_PMC, M_NOWAIT | M_ZERO);
+   clk = malloc(sizeof(*clk), M_PMC_CLK, M_NOWAIT | M_ZERO);
if (clk == NULL)
goto err;
 
buflen = strlen(name) + 1;
-   clk->name = malloc(buflen, M_PMC, M_NOWAIT);
+   clk->name = malloc(buflen, M_PMC_CLK, M_NOWAIT);
if (clk->name == NULL)
goto err;
 
@@ -326,8 +326,8 @@ at91_pmc_clock_add(const char *name, uint32_t irq,
 err:
if (clk != NULL) {
if (clk->name != NULL)
-   free(clk->name, M_PMC);
-   free(clk, M_PMC);
+   free(clk->name, M_PMC_CLK);
+   free(clk, M_PMC_CLK);
}
 
panic("could not allocate pmc clock '%s'", name);
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r322408 - in head/sys: dev/qlnx/qlnxe modules/qlnx/qlnxe

2017-08-11 Thread David C Somayajulu
Author: davidcs
Date: Fri Aug 11 17:43:25 2017
New Revision: 322408
URL: https://svnweb.freebsd.org/changeset/base/322408

Log:
  Performance enhancements to reduce CPU utililization for large number of
  TCP connections (order of tens of thousands), with predominantly Transmits.
  
  Choice to perform receive operations either in IThread or Taskqueue Thread.
  
  Submitted by:vaishali.kulka...@cavium.com
  MFC after:5 days

Modified:
  head/sys/dev/qlnx/qlnxe/qlnx_def.h
  head/sys/dev/qlnx/qlnxe/qlnx_os.c
  head/sys/dev/qlnx/qlnxe/qlnx_ver.h
  head/sys/modules/qlnx/qlnxe/Makefile

Modified: head/sys/dev/qlnx/qlnxe/qlnx_def.h
==
--- head/sys/dev/qlnx/qlnxe/qlnx_def.h  Fri Aug 11 17:05:31 2017
(r322407)
+++ head/sys/dev/qlnx/qlnxe/qlnx_def.h  Fri Aug 11 17:43:25 2017
(r322408)
@@ -50,9 +50,10 @@ struct qlnx_ivec {
 
 typedef struct qlnx_ivec qlnx_ivec_t;
 
-//#define QLNX_MAX_RSS 30
-#define QLNX_MAX_RSS   16
-#define QLNX_MAX_TC1
+//#define QLNX_MAX_RSS 30
+#define QLNX_MAX_RSS   36
+#define QLNX_DEFAULT_RSS   16
+#define QLNX_MAX_TC1
 
 enum QLNX_STATE {
 QLNX_STATE_CLOSED,
@@ -201,6 +202,17 @@ struct qlnx_fastpath {
uint64_ttx_pkts_freed;
uint64_ttx_pkts_transmitted;
uint64_ttx_pkts_completed;
+   uint64_ttx_tso_pkts;
+   uint64_ttx_non_tso_pkts;
+
+#ifdef QLNX_TRACE_PERF_DATA
+   uint64_ttx_pkts_trans_ctx;
+   uint64_ttx_pkts_compl_ctx;
+   uint64_ttx_pkts_trans_fp;
+   uint64_ttx_pkts_compl_fp;
+   uint64_ttx_pkts_compl_intr;
+#endif
+
uint64_ttx_lso_wnd_min_len;
uint64_ttx_defrag;
uint64_ttx_nsegs_gt_elem_left;
@@ -209,6 +221,13 @@ struct qlnx_fastpath {
uint32_ttx_tso_max_pkt_len;
uint32_ttx_tso_min_pkt_len;
uint64_ttx_pkts[QLNX_FP_MAX_SEGS];
+
+#ifdef QLNX_TRACE_PERF_DATA
+   uint64_ttx_pkts_hist[QLNX_FP_MAX_SEGS];
+   uint64_ttx_comInt[QLNX_FP_MAX_SEGS];
+   uint64_ttx_pkts_q[QLNX_FP_MAX_SEGS];
+#endif
+
uint64_terr_tx_nsegs_gt_elem_left;
 uint64_terr_tx_dmamap_create;
 uint64_terr_tx_defrag_dmamap_load;
@@ -301,8 +320,13 @@ typedef struct qlnx_link_output qlnx_link_output_t;
 #define QLNX_MFW_VERSION_LENGTH 32
 #define QLNX_STORMFW_VERSION_LENGTH 32
 
-#define QLNX_TX_ELEM_RESERVE   2
+#define QLNX_TX_ELEM_RESERVE   2
+#define QLNX_TX_ELEM_THRESH128
+#define QLNX_TX_ELEM_MAX_THRESH512
+#define QLNX_TX_ELEM_MIN_THRESH32
+#define QLNX_TX_COMPL_THRESH   32
 
+
 #define QLNX_TPA_MAX_AGG_BUFFERS (20)
 
 #define QLNX_MAX_NUM_MULTICAST_ADDRS   ECORE_MAX_MC_ADDRS
@@ -454,6 +478,7 @@ struct qlnx_host {
qlnx_storm_stats_t  storm_stats[QLNX_STORM_STATS_TOTAL];
uint32_tstorm_stats_index;
uint32_tstorm_stats_enable;
+   uint32_tstorm_stats_gather;
 
uint32_tpersonality;
 };
@@ -470,8 +495,11 @@ typedef struct qlnx_host qlnx_host_t;
 
 #define QLNX_MAX_MTU   9000
 #define QLNX_MAX_SEGMENTS_NON_TSO  (ETH_TX_MAX_BDS_PER_NON_LSO_PACKET - 1)
-#define QLNX_MAX_TSO_FRAME_SIZE((64 * 1024 - 1) + 22)
+//#define QLNX_MAX_TSO_FRAME_SIZE  ((64 * 1024 - 1) + 22)
+#define QLNX_MAX_TSO_FRAME_SIZE65536
+#define QLNX_MAX_TX_MBUF_SIZE  65536/* bytes - bd_len = 16bits */
 
+
 #define QL_MAC_CMP(mac1, mac2)\
 *(uint32_t *) mac1) == (*(uint32_t *) mac2) && \
 (*(uint16_t *)(mac1 + 4)) == (*(uint16_t *)(mac2 + 4 ? 0 : 1)
@@ -702,6 +730,18 @@ extern void qlnx_fill_link(struct ecore_hwfn *hwfn,
 #define CQE_HAS_VLAN(flags) \
 ((flags) & (PARSING_AND_ERR_FLAGS_TAG8021QEXIST_MASK \
 << PARSING_AND_ERR_FLAGS_TAG8021QEXIST_SHIFT))
+
+#if defined(__i386__) || defined(__amd64__)
+
+static __inline
+void prefetch(void *x)
+{
+__asm volatile("prefetcht0 %0" :: "m" (*(unsigned long *)x));
+}
+
+#else
+#define prefetch(x)
+#endif
 
 
 #endif /* #ifndef _QLNX_DEF_H_ */

Modified: head/sys/dev/qlnx/qlnxe/qlnx_os.c
==
--- head/sys/dev/qlnx/qlnxe/qlnx_os.c   Fri Aug 11 17:05:31 2017
(r322407)
+++ head/sys/dev/qlnx/qlnxe/qlnx_os.c   Fri Aug 11 17:43:25 2017
(r322408)
@@ -94,6 +94,8 @@ static int qlnx_get_ifq_snd_maxlen(qlnx_host_t *ha);
 static uint32_t qlnx_get_optics(qlnx_host_t *ha,
struct qlnx_link_output 

svn commit: r322407 - head/sys/libkern/x86

2017-08-11 Thread Ryan Libby
Author: rlibby
Date: Fri Aug 11 17:05:31 2017
New Revision: 322407
URL: https://svnweb.freebsd.org/changeset/base/322407

Log:
  x86/crc32_sse42.c: quiet unused function warning
  
  Reviewed by:  cem
  Approved by:  markj (mentor)
  Sponsored by: Dell EMC Isilon
  Differential Revision:https://reviews.freebsd.org/D11980

Modified:
  head/sys/libkern/x86/crc32_sse42.c

Modified: head/sys/libkern/x86/crc32_sse42.c
==
--- head/sys/libkern/x86/crc32_sse42.c  Fri Aug 11 16:32:24 2017
(r322406)
+++ head/sys/libkern/x86/crc32_sse42.c  Fri Aug 11 17:05:31 2017
(r322407)
@@ -52,19 +52,21 @@ _mm_crc32_u8(uint32_t x, uint8_t y)
return (x);
 }
 
-static __inline uint32_t
-_mm_crc32_u32(uint32_t x, uint32_t y)
-{
-   __asm("crc32l %1,%0" : "+r" (x) : "r" (y));
-   return (x);
-}
-
+#ifdef __amd64__
 static __inline uint64_t
 _mm_crc32_u64(uint64_t x, uint64_t y)
 {
__asm("crc32q %1,%0" : "+r" (x) : "r" (y));
return (x);
 }
+#else
+static __inline uint32_t
+_mm_crc32_u32(uint32_t x, uint32_t y)
+{
+   __asm("crc32l %1,%0" : "+r" (x) : "r" (y));
+   return (x);
+}
+#endif
 
 /* CRC-32C (iSCSI) polynomial in reversed bit order. */
 #define POLY   0x82f63b78
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r322400 - head/sys/kern

2017-08-11 Thread Andrew Turner
Author: andrew
Date: Fri Aug 11 12:45:58 2017
New Revision: 322400
URL: https://svnweb.freebsd.org/changeset/base/322400

Log:
  Only return the current cpu if it's in the cpumask. When we restrict the
  cpumask it probably means we are unable to sent interrupts to CPUs outside
  the map. As such only return the current CPU when it's within the mask
  otherwise return the first valid CPU.
  
  This is needed on ThunderX as, in a dual socket configuration, we are
  unable to send MSI/MSI-X interrupts between sockets.
  
  Reviewed by:  mmel
  Sponsored by: DARPA, AFRL
  Differential Revision:https://reviews.freebsd.org/D11957

Modified:
  head/sys/kern/subr_intr.c

Modified: head/sys/kern/subr_intr.c
==
--- head/sys/kern/subr_intr.c   Fri Aug 11 11:38:04 2017(r322399)
+++ head/sys/kern/subr_intr.c   Fri Aug 11 12:45:58 2017(r322400)
@@ -1169,9 +1169,17 @@ intr_bind_irq(device_t dev, struct resource *res, int 
 u_int
 intr_irq_next_cpu(u_int last_cpu, cpuset_t *cpumask)
 {
+   u_int cpu;
 
-   if (!irq_assign_cpu || mp_ncpus == 1)
-   return (PCPU_GET(cpuid));
+   KASSERT(!CPU_EMPTY(cpumask), ("%s: Empty CPU mask", __func__));
+   if (!irq_assign_cpu || mp_ncpus == 1) {
+   cpu = PCPU_GET(cpuid);
+
+   if (CPU_ISSET(cpu, cpumask))
+   return (curcpu);
+
+   return (CPU_FFS(cpumask) - 1);
+   }
 
do {
last_cpu++;
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r322397 - in head/sys/compat/linuxkpi/common: include/linux src

2017-08-11 Thread Hans Petter Selasky
Author: hselasky
Date: Fri Aug 11 10:44:40 2017
New Revision: 322397
URL: https://svnweb.freebsd.org/changeset/base/322397

Log:
  Make sure the "vm_flags" and "vm_page_prot" fields get set correctly
  in the VM area structure in the LinuxKPI when doing mmap() and that
  unsupported bits are masked away.
  
  While at it fix some redundant use of parenthesing inside some related
  macros.
  
  Found by: KrishnamRaju ErapaRaju 
  MFC after:1 week
  Sponsored by: Mellanox Technologies

Modified:
  head/sys/compat/linuxkpi/common/include/linux/page.h
  head/sys/compat/linuxkpi/common/src/linux_compat.c

Modified: head/sys/compat/linuxkpi/common/include/linux/page.h
==
--- head/sys/compat/linuxkpi/common/include/linux/page.hFri Aug 11 
10:08:18 2017(r322396)
+++ head/sys/compat/linuxkpi/common/include/linux/page.hFri Aug 11 
10:44:40 2017(r322397)
@@ -48,38 +48,36 @@ typedef unsigned long pgprot_t;
 
 #define page   vm_page
 
-#defineLINUXKPI_PROT_VALID (1 << 4)
-#defineLINUXKPI_CACHE_MODE_SHIFT 3
+#defineLINUXKPI_PROT_VALID (1 << 3)
+#defineLINUXKPI_CACHE_MODE_SHIFT 4
 
+CTASSERT((VM_PROT_ALL & -LINUXKPI_PROT_VALID) == 0);
+
 static inline pgprot_t
 cachemode2protval(vm_memattr_t attr)
 {
-   return ((attr | LINUXKPI_PROT_VALID) << LINUXKPI_CACHE_MODE_SHIFT);
+   return ((attr << LINUXKPI_CACHE_MODE_SHIFT) | LINUXKPI_PROT_VALID);
 }
 
 static inline vm_memattr_t
 pgprot2cachemode(pgprot_t prot)
 {
-   int val;
-
-   val = prot >> LINUXKPI_CACHE_MODE_SHIFT;
-
-   if (val & LINUXKPI_PROT_VALID)
-   return (val & ~LINUXKPI_PROT_VALID);
+   if (prot & LINUXKPI_PROT_VALID)
+   return (prot >> LINUXKPI_CACHE_MODE_SHIFT);
else
return (VM_MEMATTR_DEFAULT);
 }
 
-#definevirt_to_page(x) PHYS_TO_VM_PAGE(vtophys((x)))
-#definepage_to_pfn(pp) (VM_PAGE_TO_PHYS((pp)) >> PAGE_SHIFT)
+#definevirt_to_page(x) PHYS_TO_VM_PAGE(vtophys(x))
+#definepage_to_pfn(pp) (VM_PAGE_TO_PHYS(pp) >> PAGE_SHIFT)
 #definepfn_to_page(pfn)(PHYS_TO_VM_PAGE((pfn) << PAGE_SHIFT))
-#definenth_page(page,n)pfn_to_page(page_to_pfn((page)) + (n))
+#definenth_page(page,n)pfn_to_page(page_to_pfn(page) + (n))
 
-#defineclear_page(page)memset((page), 0, PAGE_SIZE)
+#defineclear_page(page)memset(page, 0, PAGE_SIZE)
 #definepgprot_noncached(prot)  \
-   ((prot) | cachemode2protval(VM_MEMATTR_UNCACHEABLE))
+   (((prot) & VM_PROT_ALL) | cachemode2protval(VM_MEMATTR_UNCACHEABLE))
 #definepgprot_writecombine(prot)   \
-   ((prot) | cachemode2protval(VM_MEMATTR_WRITE_COMBINING))
+   (((prot) & VM_PROT_ALL) | cachemode2protval(VM_MEMATTR_WRITE_COMBINING))
 
 #undef PAGE_MASK
 #definePAGE_MASK   (~(PAGE_SIZE-1))

Modified: head/sys/compat/linuxkpi/common/src/linux_compat.c
==
--- head/sys/compat/linuxkpi/common/src/linux_compat.c  Fri Aug 11 10:08:18 
2017(r322396)
+++ head/sys/compat/linuxkpi/common/src/linux_compat.c  Fri Aug 11 10:44:40 
2017(r322397)
@@ -1210,7 +1210,7 @@ linux_dev_mmap_single(struct cdev *dev, vm_ooffset_t *
vmap->vm_end = size;
vmap->vm_pgoff = *offset / PAGE_SIZE;
vmap->vm_pfn = 0;
-   vmap->vm_flags = vmap->vm_page_prot = nprot;
+   vmap->vm_flags = vmap->vm_page_prot = (nprot & VM_PROT_ALL);
vmap->vm_ops = NULL;
vmap->vm_file = get_file(filp);
vmap->vm_mm = mm;
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r322347 - in head/sys/x86: acpica include x86 xen

2017-08-11 Thread Li-Wen Hsu
On Thu, Aug 10, 2017 at 18:48:53 +0100, Roger Pau Monn wrote:
> On Thu, Aug 10, 2017 at 10:20:59AM -0400, Ed Maste wrote:
> > On 10 August 2017 at 05:15, Roger Pau Monné  wrote:
> > > Author: royger
> > > Date: Thu Aug 10 09:15:18 2017
> > > New Revision: 322347
> > > URL: https://svnweb.freebsd.org/changeset/base/322347
> > >
> > > Log:
> > >   apic_enumerator: only set mp_ncpus and mp_maxid at probe cpus phase
> > 
> > i386 is failing with:
> 
> Thanks for the heads up! Should be fixed in r322372, will keep an eye on
> the CI.

It seems i386 LINT is still failing:

/workspace/src/sys/x86/acpica/srat.c:446:28: error: implicit declaration of 
function 'PHYS_TO_DMAP' is invalid in C99 
[-Werror,-Wimplicit-function-declaration]
cpus = (struct cpu_info *)PHYS_TO_DMAP(addr);
  ^

Could you also chcek this one? 
https://ci.freebsd.org/job/FreeBSD-head-i386-LINT/2833/console

Thanks,
Li-Wen

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


svn commit: r322413 - head/sys/sys

2017-08-11 Thread Mark Johnston
Author: markj
Date: Fri Aug 11 19:24:08 2017
New Revision: 322413
URL: https://svnweb.freebsd.org/changeset/base/322413

Log:
  Bump KERNELDUMP_BUFFER_SIZE to 4096.
  
  The encrypted kernel dump code writes data in blocks of this size. A buffer
  size of 4096 allows encrypted dumps to work with 4Kn drives.
  
  Reviewed by:  cem
  Sponsored by: Dell EMC Isilon
  Differential Revision:https://reviews.freebsd.org/D11870

Modified:
  head/sys/sys/kerneldump.h

Modified: head/sys/sys/kerneldump.h
==
--- head/sys/sys/kerneldump.h   Fri Aug 11 19:21:40 2017(r322412)
+++ head/sys/sys/kerneldump.h   Fri Aug 11 19:24:08 2017(r322413)
@@ -58,7 +58,7 @@
 #defineKERNELDUMP_ENC_NONE 0
 #defineKERNELDUMP_ENC_AES_256_CBC  1
 
-#defineKERNELDUMP_BUFFER_SIZE  1024
+#defineKERNELDUMP_BUFFER_SIZE  4096
 #defineKERNELDUMP_IV_MAX_SIZE  32
 #defineKERNELDUMP_KEY_MAX_SIZE 64
 #defineKERNELDUMP_ENCKEY_MAX_SIZE  (16384 / 8)
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r322403 - head/sys/x86/acpica

2017-08-11 Thread John Baldwin
On Friday, August 11, 2017 02:19:55 PM Roger Pau Monné wrote:
> Author: royger
> Date: Fri Aug 11 14:19:55 2017
> New Revision: 322403
> URL: https://svnweb.freebsd.org/changeset/base/322403
> 
> Log:
>   acpi/srat: fix build without DMAP
>   
>   Use pmap_mapbios to map memory used to store the cpus array.
>   
>   Reported by:lwhsu
>   X-MFC-with: r322348
> 
> Modified:
>   head/sys/x86/acpica/srat.c
> 
> Modified: head/sys/x86/acpica/srat.c
> ==
> --- head/sys/x86/acpica/srat.cFri Aug 11 14:19:31 2017
> (r322402)
> +++ head/sys/x86/acpica/srat.cFri Aug 11 14:19:55 2017
> (r322403)
> @@ -443,7 +443,12 @@ parse_srat(void)
>   ("Not enough memory for SRAT table items"));
>   phys_avail[idx + 1] = addr - 1;
>  
> - cpus = (struct cpu_info *)PHYS_TO_DMAP(addr);
> + /*
> +  * We cannot rely on PHYS_TO_DMAP because this code is also used in
> +  * i386, so use pmap_mapbios to map the memory, this will end up using
> +  * the default memory attribute (WB), and the DMAP when available.
> +  */
> + cpus = (struct cpu_info *)pmap_mapbios(addr, size);
>  
>   /*
>* Make a pass over the table to populate the cpus[] and
> @@ -529,6 +534,10 @@ srat_set_cpus(void *dummy)
>   printf("SRAT: CPU %u has memory domain %d\n", i,
>   cpu->domain);
>   }
> +
> + /* Last usage of the cpus array, unmap it. */
> + pmap_unmapdev((vm_offset_t)cpus, sizeof(*cpus) * (max_apic_id + 1));

Please pair pmap_mapbios with pmap_unmapbios.

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


svn commit: r322416 - head/usr.bin/calendar/calendars

2017-08-11 Thread Bjoern Heidotting
Author: bhd (doc committer)
Date: Fri Aug 11 20:44:17 2017
New Revision: 322416
URL: https://svnweb.freebsd.org/changeset/base/322416

Log:
  add myself to calendar.freebsd
  
  Requested by: mckusick

Modified:
  head/usr.bin/calendar/calendars/calendar.freebsd

Modified: head/usr.bin/calendar/calendars/calendar.freebsd
==
--- head/usr.bin/calendar/calendars/calendar.freebsdFri Aug 11 20:11:43 
2017(r322415)
+++ head/usr.bin/calendar/calendars/calendar.freebsdFri Aug 11 20:44:17 
2017(r322416)
@@ -60,6 +60,7 @@
 02/04  Eitan Adler  born in West Hempstead, New York, 
United States, 1991
 02/05  Frank Laszlo  born in Howell, Michigan, United 
States, 1983
 02/06  Julien Charbon  born in Saint Etienne, Loire, France, 
1978
+02/07  Bjoern Heidotting  born in Uelsen, Germany, 1980
 02/10  David Greenman  born in Portland, Oregon, United 
States, 1968
 02/10  Paul Richards  born in Ammanford, Carmarthenshire, 
United Kingdom, 1968
 02/10  Simon Barner  born in Rosenheim, Bayern, Germany, 
1980
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r322414 - head/sys/arm/conf

2017-08-11 Thread Ed Maste
Author: emaste
Date: Fri Aug 11 19:49:29 2017
New Revision: 322414
URL: https://svnweb.freebsd.org/changeset/base/322414

Log:
  arm: enable ARM_MANY_BOARD in NOTES for LINT build
  
  Added in r238189, ARM_MANY_BOARD adds support for multiple ARM boards in
  a single kernel. Include it for LINT builds to avoid duplicate symbol
  errors when linking with lld.
  
  Sponsored by: The FreeBSD Foundation

Modified:
  head/sys/arm/conf/NOTES

Modified: head/sys/arm/conf/NOTES
==
--- head/sys/arm/conf/NOTES Fri Aug 11 19:24:08 2017(r322413)
+++ head/sys/arm/conf/NOTES Fri Aug 11 19:49:29 2017(r322414)
@@ -36,6 +36,7 @@ options   SOC_MV_DISCOVERY
 optionsSOC_MV_KIRKWOOD
 optionsSOC_MV_ORION
 
+optionsARM_MANY_BOARD
 device at91_board_bwct
 device at91_board_ethernut5
 device at91_board_hl200
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r322412 - in head: . release/packages share/mk

2017-08-11 Thread Glen Barber
Author: gjb
Date: Fri Aug 11 19:21:40 2017
New Revision: 322412
URL: https://svnweb.freebsd.org/changeset/base/322412

Log:
  Add SVNVERSION_CMD to bsd.own.mk, adding the capability to include
  svnversion metadata to the runtime and kernel packages.
  
  Instead of traversing src/sys, as is done by newvers.sh for uname(1),
  a full tree walk is done to prevent userland and/or modifications
  from not being reflected in a modified tree (M).
  
  MFC after:5 days
  Sponsored by: The FreeBSD Foundation

Modified:
  head/Makefile.inc1
  head/release/packages/kernel.ucl
  head/release/packages/runtime.ucl
  head/share/mk/bsd.own.mk

Modified: head/Makefile.inc1
==
--- head/Makefile.inc1  Fri Aug 11 19:02:11 2017(r322411)
+++ head/Makefile.inc1  Fri Aug 11 19:21:40 2017(r322412)
@@ -346,6 +346,12 @@ SVN=   ${_P}/${_S}
 . endfor
 .endif
 SVNFLAGS?= -r HEAD
+.if !defined(VCS_REVISION) && empty(VCS_REVISION)
+_VCS_REVISION?=$$(eval ${SVNVERSION_CMD} ${SRCDIR})
+. if !empty(_VCS_REVISION)
+VCS_REVISION=  $$(echo r${_VCS_REVISION})
+. endif
+.endif
 
 .if !defined(OSRELDATE)
 .if exists(/usr/include/osreldate.h)
@@ -1626,9 +1632,10 @@ create-world-package-${pkgname}: .PHONY
@awk -F\" ' \
/^name/ { printf("===> Creating %s-", $$2); next } \
/^version/ { print $$2; next } \
-   ' ${WSTAGEDIR}/${pkgname}.ucl ;
+   ' ${WSTAGEDIR}/${pkgname}.ucl
@if [ "${pkgname}" == "runtime" ]; then \
sed -i '' -e "s/%KERNCONF%/${INSTALLKERNEL:tl}/" 
${WSTAGEDIR}/${pkgname}.ucl ; \
+   sed -i '' -e "s/%VCS_REVISION%/${VCS_REVISION}/" 
${WSTAGEDIR}/${pkgname}.ucl ; \
fi
${PKG_CMD} -o ABI_FILE=${WSTAGEDIR}/bin/sh -o ALLOW_BASE_SHLIBS=yes \
create -M ${WSTAGEDIR}/${pkgname}.ucl \
@@ -1658,6 +1665,7 @@ create-kernel-packages-flavor${flavor:C,^""$,${_defaul
-e "s/%DESC%/FreeBSD ${INSTALLKERNEL} kernel ${flavor}/" \
-e "s/%CAP_MKDB_ENDIAN%/$${cap_arg}/g" \
-e "s/%PWD_MKDB_ENDIAN%/$${pwd_arg}/g" \
+   -e "s/ %VCS_REVISION%/${VCS_REVISION}/" \
${SRCDIR}/release/packages/kernel.ucl \
> ${KSTAGEDIR}/${DISTDIR}/kernel.${INSTALLKERNEL}${flavor}.ucl 
; \
awk -F\" ' \
@@ -1692,6 +1700,7 @@ create-kernel-packages-extra-flavor${flavor:C,^""$,${_
-e "s/%DESC%/FreeBSD ${_kernel} kernel ${flavor}/" \
-e "s/%CAP_MKDB_ENDIAN%/$${cap_arg}/g" \
-e "s/%PWD_MKDB_ENDIAN%/$${pwd_arg}/g" \
+   -e "s/ %VCS_REVISION%/${VCS_REVISION}/" \
${SRCDIR}/release/packages/kernel.ucl \
> ${KSTAGEDIR}/kernel.${_kernel}/kernel.${_kernel}${flavor}.ucl 
; \
awk -F\" ' \

Modified: head/release/packages/kernel.ucl
==
--- head/release/packages/kernel.uclFri Aug 11 19:02:11 2017
(r322411)
+++ head/release/packages/kernel.uclFri Aug 11 19:21:40 2017
(r322412)
@@ -5,7 +5,7 @@
 name = "FreeBSD-%PKGNAME%"
 origin = "base"
 version = "%VERSION%"
-comment = "%COMMENT%"
+comment = "%COMMENT% %VCS_REVISION%"
 categories = [ base ]
 maintainer = "r...@freebsd.org"
 www = "https://www.FreeBSD.org;

Modified: head/release/packages/runtime.ucl
==
--- head/release/packages/runtime.ucl   Fri Aug 11 19:02:11 2017
(r322411)
+++ head/release/packages/runtime.ucl   Fri Aug 11 19:21:40 2017
(r322412)
@@ -5,7 +5,7 @@
 name = "FreeBSD-%PKGNAME%"
 origin = "base"
 version = "%VERSION%"
-comment = "%COMMENT%"
+comment = "%COMMENT% %VCS_REVISION%"
 categories = [ base ]
 maintainer = "r...@freebsd.org"
 www = "https://www.FreeBSD.org;

Modified: head/share/mk/bsd.own.mk
==
--- head/share/mk/bsd.own.mkFri Aug 11 19:02:11 2017(r322411)
+++ head/share/mk/bsd.own.mkFri Aug 11 19:21:40 2017(r322412)
@@ -233,6 +233,17 @@ XZ_CMD?=   xz -T ${XZ_THREADS}
 XZ_CMD?=   xz
 .endif
 
+.if !defined(SVNVERSION_CMD) && empty(SVNVERSION_CMD)
+. for _D in ${PATH:S,:, ,g}
+.  if exists(${_D}/svnversion)
+SVNVERSION_CMD?=${_D}/svnversion
+.  endif
+.  if exists(${_D}/svnliteversion)
+SVNVERSION_CMD?=${_D}/svnliteversion
+.  endif
+. endfor
+.endif
+
 PKG_CMD?=  pkg
 
 # Pointer to the top directory into which tests are installed.  Should not be
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r322415 - head/share/mk

2017-08-11 Thread Ed Maste
Author: emaste
Date: Fri Aug 11 20:11:43 2017
New Revision: 322415
URL: https://svnweb.freebsd.org/changeset/base/322415

Log:
  lldb: enable on i386
  
  It is functional on FreeBSD/i386 as of r322326.
  
  Sponsored by: The FreeBSD Foundation

Modified:
  head/share/mk/src.opts.mk

Modified: head/share/mk/src.opts.mk
==
--- head/share/mk/src.opts.mk   Fri Aug 11 19:49:29 2017(r322414)
+++ head/share/mk/src.opts.mk   Fri Aug 11 20:11:43 2017(r322415)
@@ -255,7 +255,7 @@ __DEFAULT_YES_OPTIONS+=LLD_BOOTSTRAP LLD_IS_LD
 .else
 __DEFAULT_NO_OPTIONS+=LLD_BOOTSTRAP LLD_IS_LD
 .endif
-.if ${__T} == "aarch64" || ${__T} == "amd64"
+.if ${__T} == "aarch64" || ${__T} == "amd64" || ${__T} == "i386"
 __DEFAULT_YES_OPTIONS+=LLDB
 .else
 __DEFAULT_NO_OPTIONS+=LLDB
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r322419 - head/sys/arm64/arm64

2017-08-11 Thread John Baldwin
Author: jhb
Date: Fri Aug 11 22:47:32 2017
New Revision: 322419
URL: https://svnweb.freebsd.org/changeset/base/322419

Log:
  Fix a typo.

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

Modified: head/sys/arm64/arm64/vfp.c
==
--- head/sys/arm64/arm64/vfp.c  Fri Aug 11 22:41:24 2017(r322418)
+++ head/sys/arm64/arm64/vfp.c  Fri Aug 11 22:47:32 2017(r322419)
@@ -206,7 +206,7 @@ vfp_restore_state(void)
 
/*
 * If the previous thread on this cpu to use the VFP was not the
-* current threas, or the current thread last used it on a different
+* current thread, or the current thread last used it on a different
 * cpu we need to restore the old state.
 */
if (PCPU_GET(fpcurthread) != curthread || cpu != curpcb->pcb_vfpcpu) {
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r322418 - head/lib/msun/src

2017-08-11 Thread Ryan Libby
Author: rlibby
Date: Fri Aug 11 22:41:24 2017
New Revision: 322418
URL: https://svnweb.freebsd.org/changeset/base/322418

Log:
  lib/msun: avoid referring to broken LDBL_MAX
  
  LDBL_MAX is broken on i386:
  
https://lists.freebsd.org/pipermail/freebsd-numerics/2012-September/000288.html
  
  Gcc has produced +Infinity for LDBL_MAX on i386 and amd64 with -m32
  for some time, and newer versions of gcc are now warning that the
  "floating constant exceeds range of 'long double'".  Avoid this by
  referring to half the value of LDBL_MAX instead.
  
  Reviewed by:  bde
  Approved by:  markj (mentor)
  Sponsored by: Dell EMC Isilon

Modified:
  head/lib/msun/src/catrigl.c
  head/lib/msun/src/math_private.h
  head/lib/msun/src/s_csqrtl.c

Modified: head/lib/msun/src/catrigl.c
==
--- head/lib/msun/src/catrigl.c Fri Aug 11 22:39:38 2017(r322417)
+++ head/lib/msun/src/catrigl.c Fri Aug 11 22:41:24 2017(r322418)
@@ -307,7 +307,7 @@ clog_for_large_values(long double complex z)
ay = t;
}
 
-   if (ax > LDBL_MAX / 2)
+   if (ax >= HALF_LDBL_MAX)
return (CMPLXL(logl(hypotl(x / m_e, y / m_e)) + 1,
atan2l(y, x)));
 

Modified: head/lib/msun/src/math_private.h
==
--- head/lib/msun/src/math_private.hFri Aug 11 22:39:38 2017
(r322417)
+++ head/lib/msun/src/math_private.hFri Aug 11 22:41:24 2017
(r322418)
@@ -272,6 +272,15 @@ do {   
\
 #defineLD80C(m, ex, v) { .e = (v), }
 #endif
 
+/*
+ * XXX LDBL_MAX is broken on i386.  If the precise value of LDBL_MAX is not
+ * needed, this may be worked around by instead referring to a proxy, such
+ * as HALF_LDBL_MAX, below.  HALF_LDBL_MAX is approximately LDBL_MAX / 2,
+ * actually just greater than.  Note that 2 * HALF_LDBL_MAX will always
+ * overflow to infinity, regardless of the precision and rounding modes.
+ */
+#defineHALF_LDBL_MAX   __CONCAT(__CONCAT(0x0.8p, LDBL_MAX_EXP), L)
+
 #ifdef FLT_EVAL_METHOD
 /*
  * Attempt to get strict C99 semantics for assignment with non-C99 compilers.

Modified: head/lib/msun/src/s_csqrtl.c
==
--- head/lib/msun/src/s_csqrtl.cFri Aug 11 22:39:38 2017
(r322417)
+++ head/lib/msun/src/s_csqrtl.cFri Aug 11 22:41:24 2017
(r322418)
@@ -43,7 +43,7 @@ __FBSDID("$FreeBSD$");
 #pragmaSTDC CX_LIMITED_RANGE   ON
 
 /* We risk spurious overflow for components >= LDBL_MAX / (1 + sqrt(2)). */
-#defineTHRESH  (LDBL_MAX / 2.414213562373095048801688724209698L)
+#defineTHRESH  (HALF_LDBL_MAX / 1.207106781186547524400844362104849L)
 
 long double complex
 csqrtl(long double complex z)
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


RE: svn commit: r322331 - in head/sys: dev/qlnx/qlnxe modules/qlnx/qlnxe

2017-08-11 Thread Somayajulu, David
HI All,
Apologize for the inconvenience. 
I forgot to mention the following.

MFC after:5 days

Thanks
David S. (davi...@freebsd.org)
-Original Message-
From: owner-src-committ...@freebsd.org 
[mailto:owner-src-committ...@freebsd.org] On Behalf Of David C Somayajulu
Sent: Wednesday, August 09, 2017 3:19 PM
To: src-committ...@freebsd.org; svn-src-...@freebsd.org; 
svn-src-head@freebsd.org
Subject: svn commit: r322331 - in head/sys: dev/qlnx/qlnxe modules/qlnx/qlnxe

Author: davidcs
Date: Wed Aug  9 22:18:49 2017
New Revision: 322331
URL: https://svnweb.freebsd.org/changeset/base/322331

Log:
  Provide compile to choose receive processing in either Ithread or Taskqueue 
Thread.

Modified:
  head/sys/dev/qlnx/qlnxe/qlnx_os.c
  head/sys/dev/qlnx/qlnxe/qlnx_ver.h
  head/sys/modules/qlnx/qlnxe/Makefile

Modified: head/sys/dev/qlnx/qlnxe/qlnx_os.c 
==
--- head/sys/dev/qlnx/qlnxe/qlnx_os.c   Wed Aug  9 21:44:55 2017
(r322330)
+++ head/sys/dev/qlnx/qlnxe/qlnx_os.c   Wed Aug  9 22:18:49 2017
(r322331)
@@ -397,10 +397,14 @@ qlnx_fp_taskqueue(void *context, int pending)
 struct ifnet   *ifp;
 struct mbuf*mp;
 intret = -1;
+   struct thread   *cthread;
+
+#ifdef QLNX_RCV_IN_TASKQ
int lro_enable;
int rx_int = 0, total_rx_count = 0;
-   struct thread   *cthread;
 
+#endif /* #ifdef QLNX_RCV_IN_TASKQ */
+
 fp = context;
 
 if (fp == NULL)
@@ -419,55 +423,60 @@ qlnx_fp_taskqueue(void *context, int pending)
 
 ifp = ha->ifp;
 
-   lro_enable = ha->ifp->if_capenable & IFCAP_LRO;
+#ifdef QLNX_RCV_IN_TASKQ
+   {
+   lro_enable = ifp->if_capenable & IFCAP_LRO;
 
-   rx_int = qlnx_rx_int(ha, fp, ha->rx_pkt_threshold, lro_enable);
+   rx_int = qlnx_rx_int(ha, fp, ha->rx_pkt_threshold, lro_enable);
 
-   if (rx_int) {
-   fp->rx_pkts += rx_int;
-   total_rx_count += rx_int;
-   }
+   if (rx_int) {
+   fp->rx_pkts += rx_int;
+   total_rx_count += rx_int;
+   }
 
 #ifdef QLNX_SOFT_LRO
-   {
-   struct lro_ctrl *lro;
+   {
+   struct lro_ctrl *lro;
+   
+   lro = >rxq->lro;
 
-   lro = >rxq->lro;
+   if (lro_enable && total_rx_count) {
 
-   if (lro_enable && total_rx_count) {
-
 #if (__FreeBSD_version >= 1100101) || (defined QLNX_QSORT_LRO)
 
-   if (ha->dbg_trace_lro_cnt) {
-   if (lro->lro_mbuf_count & ~1023)
-   fp->lro_cnt_1024++;
-   else if (lro->lro_mbuf_count & ~511)
-   fp->lro_cnt_512++;
-   else if (lro->lro_mbuf_count & ~255)
-   fp->lro_cnt_256++;
-   else if (lro->lro_mbuf_count & ~127)
-   fp->lro_cnt_128++;
-   else if (lro->lro_mbuf_count & ~63)
-   fp->lro_cnt_64++;
-   }
-   tcp_lro_flush_all(lro);
+   if (ha->dbg_trace_lro_cnt) {
+   if (lro->lro_mbuf_count & ~1023)
+   fp->lro_cnt_1024++;
+   else if (lro->lro_mbuf_count & ~511)
+   fp->lro_cnt_512++;
+   else if (lro->lro_mbuf_count & ~255)
+   fp->lro_cnt_256++;
+   else if (lro->lro_mbuf_count & ~127)
+   fp->lro_cnt_128++;
+   else if (lro->lro_mbuf_count & ~63)
+   fp->lro_cnt_64++;
+   }
+   tcp_lro_flush_all(lro);
 
 #else
-   struct lro_entry *queued;
+   struct lro_entry *queued;
 
-   while ((!SLIST_EMPTY(>lro_active))) {
-   queued = SLIST_FIRST(>lro_active);
-   SLIST_REMOVE_HEAD(>lro_active, next);
-   tcp_lro_flush(lro, queued);
-   }
+   while ((!SLIST_EMPTY(>lro_active))) {
+   queued = SLIST_FIRST(>lro_active);
+   SLIST_REMOVE_HEAD(>lro_active, 
next);
+   tcp_lro_flush(lro, queued);
+

svn commit: r322402 - head

2017-08-11 Thread Glen Barber
Author: gjb
Date: Fri Aug 11 14:19:31 2017
New Revision: 322402
URL: https://svnweb.freebsd.org/changeset/base/322402

Log:
  Fix indentation from r322401.
  
  MFC after:3 days
  MFC with: r322401
  Sponsored by: The FreeBSD Foundation

Modified:
  head/Makefile.inc1

Modified: head/Makefile.inc1
==
--- head/Makefile.inc1  Fri Aug 11 14:18:11 2017(r322401)
+++ head/Makefile.inc1  Fri Aug 11 14:19:31 2017(r322402)
@@ -1640,9 +1640,9 @@ create-world-package-${pkgname}: .PHONY
 create-kernel-packages:.PHONY
 _default_flavor=   -default
 .if exists(${KSTAGEDIR}/kernel.meta)
-.if ${MK_DEBUG_FILES} != "no"
+. if ${MK_DEBUG_FILES} != "no"
 _debug=-debug
-.endif
+. endif
 . for flavor in "" ${_debug}
 create-kernel-packages: 
create-kernel-packages-flavor${flavor:C,^""$,${_default_flavor},}
 create-kernel-packages-flavor${flavor:C,^""$,${_default_flavor},}: 
_pkgbootstrap .PHONY
@@ -1674,9 +1674,9 @@ create-kernel-packages-flavor${flavor:C,^""$,${_defaul
 .if ${BUILDKERNELS:[#]} > 1 && ${NO_INSTALLEXTRAKERNELS} != "yes"
 . for _kernel in ${BUILDKERNELS:[2..-1]}
 .  if exists(${KSTAGEDIR}/kernel.${_kernel}.meta)
-.  if ${MK_DEBUG_FILES} != "no"
+.   if ${MK_DEBUG_FILES} != "no"
 _debug=-debug
-.  endif
+.   endif
 .   for flavor in "" ${_debug}
 create-kernel-packages: 
create-kernel-packages-extra-flavor${flavor:C,^""$,${_default_flavor},}-${_kernel}
 
create-kernel-packages-extra-flavor${flavor:C,^""$,${_default_flavor},}-${_kernel}:
 _pkgbootstrap .PHONY
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r322410 - head/usr.bin/mt

2017-08-11 Thread Kenneth D. Merry
Author: ken
Date: Fri Aug 11 18:43:52 2017
New Revision: 322410
URL: https://svnweb.freebsd.org/changeset/base/322410

Log:
  Add historical notes on QIC tape drives and fix a couple of issues in mt(1).
  
   o Density code 0x5 is also known as QIC-11, and should have a footnote
 reference.
   o Add notes on QIC tape drives from the bug report.  These may help anyone
 trying to use a QIC drive.
   o Take out a "more more" instance found by igor.
   o Bump the man page date.
  
  The PR is 14 years old, so it's past time to retire it.
  
  PR:   doc/53596
  Submitted by: t...@toybox.placo.com
  Reviewed by:  bcr
  Sponsored by: Spectra Logic

Modified:
  head/usr.bin/mt/mt.1

Modified: head/usr.bin/mt/mt.1
==
--- head/usr.bin/mt/mt.1Fri Aug 11 18:09:26 2017(r322409)
+++ head/usr.bin/mt/mt.1Fri Aug 11 18:43:52 2017(r322410)
@@ -29,7 +29,7 @@
 .\"@(#)mt.18.1 (Berkeley) 6/6/93
 .\" $FreeBSD$
 .\"
-.Dd August 3, 2017
+.Dd August 11, 2017
 .Dt MT 1
 .Os
 .Sh NAME
@@ -333,7 +333,7 @@ The default protection method used is Reed-Solomon CRC
 1), as specified in ECMA-319.
 The default protection information length used with Reed-Solomon CRC is
 4 bytes.
-To enable all settings except one more more settings, specify the
+To enable all settings except one more setting, specify the
 .Fl e
 argument and then explicitly disable settings that you do not wish to
 enable.
@@ -463,7 +463,7 @@ Value  WidthTracksDensity Code Typ
 0x01   12.7  (0.5)9 32 (800)  NRZI  R   X3.22-1983   2
 0x02   12.7  (0.5)9 63   (1,600)  PER   X3.39-1986   2
 0x03   12.7  (0.5)9246   (6,250)  GCR   R   X3.54-1986   2
-0x056.3  (0.25)  4/9   315   (8,000)  GCR   C   X3.136-1986  1
+0x056.3  (0.25)  4/9   315   (8,000)  GCR   C   X3.136-1986  1,3
 0x06   12.7  (0.5)9126   (3,200)  PER   X3.157-1987  2
 0x076.3  (0.25)   4252   (6,400)  IMFM  C   X3.116-1986  1
 0x083.81 (0.15)   4315   (8,000)  GCR   CS  X3.158-1987  1
@@ -566,6 +566,60 @@ NOTES
 density code is 0x8c.
 13. This density code (0x48) was also used for DAT-160.
 .Ed
+.Bd -literal -offset 2n
+NOTE ON QIC STREAMERS
+
+The following is a table of Data Cartridge types as used in the 1/4 inch
+tape drives such as the Archive Viper 150, Wangtek 5525ES, and Tandberg
+TDC4220 tape drives:
+
+Value Reference FormatCartridge Type  Capacity   Tracks  Length
+- - ----     --  --
+
+0x05QIC-11DC300   15MB   4300ft
+0x05QIC-11DC300XL/P   20MB   4450ft
+0x05QIC-11DC600   27MB   4600ft
+0x05  X3.136-1986   QIC-24DC615A  15MB   9150ft
+0x05  X3.136-1986   QIC-24DC300XL/P   45MB   9450ft
+0x05  X3.136-1986   QIC-24DC600A  60MB   9600ft
+0x0F  QIC-120   QIC-120   DC600A/DC6150   120MB  15   620ft
+0x10  QIC-150   QIC-150   DC600XTD/DC6150 150MB  18   620ft
+0x10  QIC-150   QIC-150   DC6250  250MB  18 1,020ft
+0x11  QIC-320   QIC-525   DC6320  320MB  26   620ft
+0x11  QIC-320   QIC-525   DC6525  525MB  26 1,020ft
+0x1E  QIC-1000C QIC-1000  DC9100/DL9135   1.0GB  30   760ft
+0x1E  QIC-1000C QIC-1000  DC9150  1.2GB  30   950ft
+0x22  QIC-2GB(C)QIC-2GB   DC9200  2.0GB  42   950ft
+0x22  QIC-2GB(C)QIC-2GB   DC9250  2.5GB  42 1,200ft
+.Ed
+.Pp
+Notes:
+.Pp
+QIC-24, QIC-120, QIC-150 use fixed blocksize of 512 bytes, QIC-525, QIC-1000
+and QIC-2GB can use blocksize of 1,024 bytes.
+DDS (DAT) drives generally use variable blocks.
+.Pp
+QIC-02 and QIC-36 are interface standards for tape drives.
+The QIC-02 and QIC-36 streamers such as the Wangtek 5250EQ are otherwise
+identical to their SCSI versions (i.e.: Wangtek 5250ES).
+.Pp
+It seems that the 150MB and larger streamers cannot write QIC-24 9 track
+formats, only read them.
+.Pp
+DC600A cartridges marked "10,000ftpi" can only be used as QIC-11, QIC-24,
+and QIC-120 format.
+DC600A cartridges marked 12,500ftpi can be used as both QIC-120 and QIC-150
+format.
+.Pp
+Some manufacturers do not use "DC" on their cartridges.
+Verbatim uses DL, Maxell uses MC, Sony uses QD, Quill uses DQ.
+.Pp
+3M/Imation & Fuji use DC.
+Thus a DL6250, MC-6250, QD6250, DQ6250 are all identical media to a DC6250.
+.Pp
+QIC tape media is not "connected" to the take up reels and will de-spool
+if the tape drive has dust covering the light sensor that looks for the end
+of tape holes in the media.
 .Sh ENVIRONMENT
 .Bl -tag -width ".Ev TAPE"
 .It Ev TAPE
___
svn-src-head@freebsd.org mailing list

svn commit: r322403 - head/sys/x86/acpica

2017-08-11 Thread Roger Pau Monné
Author: royger
Date: Fri Aug 11 14:19:55 2017
New Revision: 322403
URL: https://svnweb.freebsd.org/changeset/base/322403

Log:
  acpi/srat: fix build without DMAP
  
  Use pmap_mapbios to map memory used to store the cpus array.
  
  Reported by:  lwhsu
  X-MFC-with:   r322348

Modified:
  head/sys/x86/acpica/srat.c

Modified: head/sys/x86/acpica/srat.c
==
--- head/sys/x86/acpica/srat.c  Fri Aug 11 14:19:31 2017(r322402)
+++ head/sys/x86/acpica/srat.c  Fri Aug 11 14:19:55 2017(r322403)
@@ -443,7 +443,12 @@ parse_srat(void)
("Not enough memory for SRAT table items"));
phys_avail[idx + 1] = addr - 1;
 
-   cpus = (struct cpu_info *)PHYS_TO_DMAP(addr);
+   /*
+* We cannot rely on PHYS_TO_DMAP because this code is also used in
+* i386, so use pmap_mapbios to map the memory, this will end up using
+* the default memory attribute (WB), and the DMAP when available.
+*/
+   cpus = (struct cpu_info *)pmap_mapbios(addr, size);
 
/*
 * Make a pass over the table to populate the cpus[] and
@@ -529,6 +534,10 @@ srat_set_cpus(void *dummy)
printf("SRAT: CPU %u has memory domain %d\n", i,
cpu->domain);
}
+
+   /* Last usage of the cpus array, unmap it. */
+   pmap_unmapdev((vm_offset_t)cpus, sizeof(*cpus) * (max_apic_id + 1));
+   cpus = NULL;
 }
 SYSINIT(srat_set_cpus, SI_SUB_CPU, SI_ORDER_ANY, srat_set_cpus, NULL);
 
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r322401 - head

2017-08-11 Thread Glen Barber
Author: gjb
Date: Fri Aug 11 14:18:11 2017
New Revision: 322401
URL: https://svnweb.freebsd.org/changeset/base/322401

Log:
  Avoid creating kernel-dbg.txz distribution sets and kernel-debug
  packages when MK_DEBUG_FILES is 'no'.
  
  MFC after:5 days
  Sponsored by: The FreeBSD Foundation

Modified:
  head/Makefile.inc1

Modified: head/Makefile.inc1
==
--- head/Makefile.inc1  Fri Aug 11 12:45:58 2017(r322400)
+++ head/Makefile.inc1  Fri Aug 11 14:18:11 2017(r322401)
@@ -1493,20 +1493,24 @@ packagekernel: .PHONY
@${DESTDIR}/${DISTDIR}/kernel.meta | \
${XZ_CMD} > ${PACKAGEDIR}/kernel.txz
 .endif
+.if ${MK_DEBUG_FILES} != "no"
cd ${DESTDIR}/${DISTDIR}/kernel; \
tar cvf - --include '*/*/*.debug' \
@${DESTDIR}/${DISTDIR}/kernel.meta | \
${XZ_CMD} > ${DESTDIR}/${DISTDIR}/kernel-dbg.txz
+.endif
 .if ${BUILDKERNELS:[#]} > 1 && ${NO_INSTALLEXTRAKERNELS} != "yes"
 .for _kernel in ${BUILDKERNELS:[2..-1]}
cd ${DESTDIR}/${DISTDIR}/kernel.${_kernel}; \
tar cvf - --exclude '*.debug' \
@${DESTDIR}/${DISTDIR}/kernel.${_kernel}.meta | \
${XZ_CMD} > ${PACKAGEDIR}/kernel.${_kernel}.txz
+.if ${MK_DEBUG_FILES} != "no"
cd ${DESTDIR}/${DISTDIR}/kernel.${_kernel}; \
tar cvf - --include '*/*/*.debug' \
@${DESTDIR}/${DISTDIR}/kernel.${_kernel}.meta | \
${XZ_CMD} > ${DESTDIR}/${DISTDIR}/kernel.${_kernel}-dbg.txz
+.endif
 .endfor
 .endif
 .else
@@ -1515,17 +1519,21 @@ packagekernel: .PHONY
tar cvf - --exclude '*.debug' . | \
${XZ_CMD} > ${PACKAGEDIR}/kernel.txz
 .endif
+.if ${MK_DEBUG_FILES} != "no"
cd ${DESTDIR}/${DISTDIR}/kernel; \
tar cvf - --include '*/*/*.debug' $$(eval find .) | \
${XZ_CMD} > ${DESTDIR}/${DISTDIR}/kernel-dbg.txz
+.endif
 .if ${BUILDKERNELS:[#]} > 1 && ${NO_INSTALLEXTRAKERNELS} != "yes"
 .for _kernel in ${BUILDKERNELS:[2..-1]}
cd ${DESTDIR}/${DISTDIR}/kernel.${_kernel}; \
tar cvf - --exclude '*.debug' . | \
${XZ_CMD} > ${PACKAGEDIR}/kernel.${_kernel}.txz
+.if ${MK_DEBUG_FILES} != "no"
cd ${DESTDIR}/${DISTDIR}/kernel.${_kernel}; \
tar cvf - --include '*/*/*.debug' $$(eval find .) | \
${XZ_CMD} > ${DESTDIR}/${DISTDIR}/kernel.${_kernel}-dbg.txz
+.endif
 .endfor
 .endif
 .endif
@@ -1632,7 +1640,10 @@ create-world-package-${pkgname}: .PHONY
 create-kernel-packages:.PHONY
 _default_flavor=   -default
 .if exists(${KSTAGEDIR}/kernel.meta)
-. for flavor in "" -debug
+.if ${MK_DEBUG_FILES} != "no"
+_debug=-debug
+.endif
+. for flavor in "" ${_debug}
 create-kernel-packages: 
create-kernel-packages-flavor${flavor:C,^""$,${_default_flavor},}
 create-kernel-packages-flavor${flavor:C,^""$,${_default_flavor},}: 
_pkgbootstrap .PHONY
@cd ${KSTAGEDIR}/${DISTDIR} ; \
@@ -1663,7 +1674,10 @@ create-kernel-packages-flavor${flavor:C,^""$,${_defaul
 .if ${BUILDKERNELS:[#]} > 1 && ${NO_INSTALLEXTRAKERNELS} != "yes"
 . for _kernel in ${BUILDKERNELS:[2..-1]}
 .  if exists(${KSTAGEDIR}/kernel.${_kernel}.meta)
-.   for flavor in "" -debug
+.  if ${MK_DEBUG_FILES} != "no"
+_debug=-debug
+.  endif
+.   for flavor in "" ${_debug}
 create-kernel-packages: 
create-kernel-packages-extra-flavor${flavor:C,^""$,${_default_flavor},}-${_kernel}
 
create-kernel-packages-extra-flavor${flavor:C,^""$,${_default_flavor},}-${_kernel}:
 _pkgbootstrap .PHONY
@cd ${KSTAGEDIR}/kernel.${_kernel} ; \
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r322347 - in head/sys/x86: acpica include x86 xen

2017-08-11 Thread Roger Pau Monn
On Fri, Aug 11, 2017 at 10:10:15AM +, Li-Wen Hsu wrote:
> On Thu, Aug 10, 2017 at 18:48:53 +0100, Roger Pau Monn wrote:
> > On Thu, Aug 10, 2017 at 10:20:59AM -0400, Ed Maste wrote:
> > > On 10 August 2017 at 05:15, Roger Pau Monné  wrote:
> > > > Author: royger
> > > > Date: Thu Aug 10 09:15:18 2017
> > > > New Revision: 322347
> > > > URL: https://svnweb.freebsd.org/changeset/base/322347
> > > >
> > > > Log:
> > > >   apic_enumerator: only set mp_ncpus and mp_maxid at probe cpus phase
> > > 
> > > i386 is failing with:
> > 
> > Thanks for the heads up! Should be fixed in r322372, will keep an eye on
> > the CI.
> 
> It seems i386 LINT is still failing:
> 
> /workspace/src/sys/x86/acpica/srat.c:446:28: error: implicit declaration of 
> function 'PHYS_TO_DMAP' is invalid in C99 
> [-Werror,-Wimplicit-function-declaration]
> cpus = (struct cpu_info *)PHYS_TO_DMAP(addr);
>   ^
> 
> Could you also chcek this one? 
> https://ci.freebsd.org/job/FreeBSD-head-i386-LINT/2833/console

Sorry again for the breakage, should be fixed in r322403. Not sure if
it makes much sense to parse the SRAT on i386 anyway.

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