svn commit: r255415 - head/sys/powerpc/include

2013-09-09 Thread Nathan Whitehorn
Author: nwhitehorn
Date: Mon Sep  9 12:44:48 2013
New Revision: 255415
URL: http://svnweb.freebsd.org/changeset/base/255415

Log:
  Use the canonical bits for wired, etc. in the PTE. This is important for
  interactions with certain kinds of hypervisors that look into the PTEs
  more closely than they should.
  
  Approved by:  re (kib)

Modified:
  head/sys/powerpc/include/pte.h

Modified: head/sys/powerpc/include/pte.h
==
--- head/sys/powerpc/include/pte.h  Mon Sep  9 08:07:46 2013
(r255414)
+++ head/sys/powerpc/include/pte.h  Mon Sep  9 12:44:48 2013
(r255415)
@@ -96,8 +96,9 @@ struct lpteg {
 #define LPTE_VSID_SHIFT12
 #define LPTE_AVPN_MASK 0xFF80ULL
 #define LPTE_API   0x0F80ULL
-#define LPTE_LOCKED0x0040ULL
-#define LPTE_WIRED 0x0008ULL
+#define LPTE_SWBITS0x0078ULL
+#define LPTE_WIRED 0x0010ULL
+#define LPTE_LOCKED0x0008ULL
 #define LPTE_BIG   0x0004ULL   /* 4kb/16Mb page */
 #define LPTE_HID   0x0002ULL
 #define LPTE_VALID 0x0001ULL
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r255416 - head/sys/powerpc/ofw

2013-09-09 Thread Nathan Whitehorn
Author: nwhitehorn
Date: Mon Sep  9 12:45:41 2013
New Revision: 255416
URL: http://svnweb.freebsd.org/changeset/base/255416

Log:
  Use a spin lock instead of a mutex to gate RTAS. This is required if RTAS
  calls are involved in interrupt handling.
  
  Approved by:  re (kib)

Modified:
  head/sys/powerpc/ofw/rtas.c

Modified: head/sys/powerpc/ofw/rtas.c
==
--- head/sys/powerpc/ofw/rtas.c Mon Sep  9 12:44:48 2013(r255415)
+++ head/sys/powerpc/ofw/rtas.c Mon Sep  9 12:45:41 2013(r255416)
@@ -93,7 +93,7 @@ rtas_setup(void *junk)
return;
}
 
-   mtx_init(&rtas_mtx, "RTAS", MTX_DEF, 0);
+   mtx_init(&rtas_mtx, "RTAS", NULL, MTX_SPIN);
 
/* RTAS must be called with everything turned off in MSR */
rtasmsr = mfmsr();
@@ -208,7 +208,7 @@ rtas_call_method(cell_t token, int nargs
args.token = token;
va_start(ap, nreturns);
 
-   mtx_lock(&rtas_mtx);
+   mtx_lock_spin(&rtas_mtx);
rtas_bounce_offset = 0;
 
args.nargs = nargs;
@@ -232,7 +232,7 @@ rtas_call_method(cell_t token, int nargs
__asm __volatile ("sync");
 
rtas_real_unmap(argsptr, &args, sizeof(args));
-   mtx_unlock(&rtas_mtx);
+   mtx_unlock_spin(&rtas_mtx);
 
if (result < 0)
return (result);
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r255417 - in head/sys/powerpc: include powerpc

2013-09-09 Thread Nathan Whitehorn
Author: nwhitehorn
Date: Mon Sep  9 12:49:19 2013
New Revision: 255417
URL: http://svnweb.freebsd.org/changeset/base/255417

Log:
  Add hook called when every new processor is brought online -- including the
  BSP -- so that platform modules have a chance to add the new CPU to any
  internal bookkeeping.
  
  Approved by:  re (kib)

Modified:
  head/sys/powerpc/include/platform.h
  head/sys/powerpc/powerpc/mp_machdep.c
  head/sys/powerpc/powerpc/platform.c
  head/sys/powerpc/powerpc/platform_if.m

Modified: head/sys/powerpc/include/platform.h
==
--- head/sys/powerpc/include/platform.h Mon Sep  9 12:45:41 2013
(r255416)
+++ head/sys/powerpc/include/platform.h Mon Sep  9 12:49:19 2013
(r255417)
@@ -52,6 +52,7 @@ int   platform_smp_first_cpu(struct cpuref
 intplatform_smp_next_cpu(struct cpuref *);
 intplatform_smp_get_bsp(struct cpuref *);
 intplatform_smp_start_cpu(struct pcpu *);
+void   platform_smp_ap_init(void);
   
 const char *installed_platform(void);
 void platform_probe_and_attach(void);

Modified: head/sys/powerpc/powerpc/mp_machdep.c
==
--- head/sys/powerpc/powerpc/mp_machdep.c   Mon Sep  9 12:45:41 2013
(r255416)
+++ head/sys/powerpc/powerpc/mp_machdep.c   Mon Sep  9 12:49:19 2013
(r255417)
@@ -91,6 +91,9 @@ machdep_ap_bootstrap(void)
 #endif
decr_ap_init();
 
+   /* Give platform code a chance to do anything necessary */
+   platform_smp_ap_init();
+
/* Serialize console output and AP count increment */
mtx_lock_spin(&ap_boot_mtx);
ap_awake++;

Modified: head/sys/powerpc/powerpc/platform.c
==
--- head/sys/powerpc/powerpc/platform.c Mon Sep  9 12:45:41 2013
(r255416)
+++ head/sys/powerpc/powerpc/platform.c Mon Sep  9 12:49:19 2013
(r255417)
@@ -141,6 +141,12 @@ platform_smp_start_cpu(struct pcpu *cpu)
return (PLATFORM_SMP_START_CPU(plat_obj, cpu));
 }
 
+void
+platform_smp_ap_init()
+{
+   PLATFORM_SMP_AP_INIT(plat_obj);
+}
+
 #ifdef SMP
 struct cpu_group *
 cpu_topo(void)

Modified: head/sys/powerpc/powerpc/platform_if.m
==
--- head/sys/powerpc/powerpc/platform_if.m  Mon Sep  9 12:45:41 2013
(r255416)
+++ head/sys/powerpc/powerpc/platform_if.m  Mon Sep  9 12:49:19 2013
(r255417)
@@ -80,6 +80,10 @@ CODE {
{
return (VM_MAX_ADDRESS);
}
+   static void platform_null_smp_ap_init(platform_t plat)
+   {
+   return;
+   }
 };
 
 /**
@@ -185,6 +189,14 @@ METHOD int smp_start_cpu {
 };
 
 /**
+ * @brief Start a CPU
+ *
+ */
+METHOD void smp_ap_init {
+   platform_t  _plat;
+} DEFAULT platform_null_smp_ap_init;
+
+/**
  * @brief Return SMP topology
  */
 METHOD cpu_group_t smp_topo {
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r255418 - in head/sys/powerpc: aim powerpc

2013-09-09 Thread Nathan Whitehorn
Author: nwhitehorn
Date: Mon Sep  9 12:51:24 2013
New Revision: 255418
URL: http://svnweb.freebsd.org/changeset/base/255418

Log:
  Add POWER CPUs to the kernel's knowledge. This does not imply we currently
  actually run on any machines with POWER CPUs but avoids closing that door
  unnecessarily.
  
  Approved by:  re (kib)

Modified:
  head/sys/powerpc/aim/mmu_oea64.c
  head/sys/powerpc/aim/mmu_oea64.h
  head/sys/powerpc/powerpc/cpu.c

Modified: head/sys/powerpc/aim/mmu_oea64.c
==
--- head/sys/powerpc/aim/mmu_oea64.cMon Sep  9 12:49:19 2013
(r255417)
+++ head/sys/powerpc/aim/mmu_oea64.cMon Sep  9 12:51:24 2013
(r255418)
@@ -263,7 +263,7 @@ uintptr_t   moea64_scratchpage_pte[2];
 struct mtx moea64_scratchpage_mtx;
 
 uint64_t   moea64_large_page_mask = 0;
-intmoea64_large_page_size = 0;
+uint64_t   moea64_large_page_size = 0;
 intmoea64_large_page_shift = 0;
 
 /*
@@ -546,12 +546,9 @@ moea64_probe_large_page(void)
powerpc_sync(); isync();

/* FALLTHROUGH */
-   case IBMCELLBE:
+   default:
moea64_large_page_size = 0x100; /* 16 MB */
moea64_large_page_shift = 24;
-   break;
-   default:
-   moea64_large_page_size = 0;
}
 
moea64_large_page_mask = moea64_large_page_size - 1;

Modified: head/sys/powerpc/aim/mmu_oea64.h
==
--- head/sys/powerpc/aim/mmu_oea64.hMon Sep  9 12:49:19 2013
(r255417)
+++ head/sys/powerpc/aim/mmu_oea64.hMon Sep  9 12:51:24 2013
(r255418)
@@ -70,6 +70,7 @@ extern u_int  moea64_pte_overflow;
 
 extern struct pvo_head *moea64_pvo_table;
 extern int moea64_large_page_shift;
+extern uint64_tmoea64_large_page_size;
 extern u_int   moea64_pteg_count;
 extern u_int   moea64_pteg_mask;
 

Modified: head/sys/powerpc/powerpc/cpu.c
==
--- head/sys/powerpc/powerpc/cpu.c  Mon Sep  9 12:49:19 2013
(r255417)
+++ head/sys/powerpc/powerpc/cpu.c  Mon Sep  9 12:51:24 2013
(r255418)
@@ -127,6 +127,20 @@ static const struct cputab models[] = {
 { "IBM PowerPC 970MP", IBM970MP,   REVFMT_MAJMIN,
   PPC_FEATURE_64 | PPC_FEATURE_HAS_ALTIVEC | PPC_FEATURE_HAS_FPU,
   cpu_970_setup },
+{ "IBM POWER4",IBMPOWER4,  REVFMT_MAJMIN,
+  PPC_FEATURE_64 | PPC_FEATURE_HAS_FPU, NULL },
+{ "IBM POWER4+",   IBMPOWER4PLUS,  REVFMT_MAJMIN,
+  PPC_FEATURE_64 | PPC_FEATURE_HAS_FPU, NULL },
+{ "IBM POWER5",IBMPOWER5,  REVFMT_MAJMIN,
+  PPC_FEATURE_64 | PPC_FEATURE_HAS_FPU, NULL },
+{ "IBM POWER5+",   IBMPOWER5PLUS,  REVFMT_MAJMIN,
+  PPC_FEATURE_64 | PPC_FEATURE_HAS_FPU, NULL },
+{ "IBM POWER6",IBMPOWER6,  REVFMT_MAJMIN,
+  PPC_FEATURE_64 | PPC_FEATURE_HAS_ALTIVEC | PPC_FEATURE_HAS_FPU,
+  NULL },
+{ "IBM POWER7",IBMPOWER7,  REVFMT_MAJMIN,
+  PPC_FEATURE_64 | PPC_FEATURE_HAS_ALTIVEC | PPC_FEATURE_HAS_FPU,
+  NULL },
 { "Motorola PowerPC 7400", MPC7400,REVFMT_MAJMIN,
   PPC_FEATURE_HAS_ALTIVEC | PPC_FEATURE_HAS_FPU, cpu_6xx_setup },
 { "Motorola PowerPC 7410", MPC7410,REVFMT_MAJMIN,
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r255419 - in head/sys/powerpc: aim include powerpc

2013-09-09 Thread Nathan Whitehorn
Author: nwhitehorn
Date: Mon Sep  9 12:52:34 2013
New Revision: 255419
URL: http://svnweb.freebsd.org/changeset/base/255419

Log:
  Raise artificial limits on number of CPUs and number of interrupts.
  
  Approved by:  re (kib)

Modified:
  head/sys/powerpc/aim/nexus.c
  head/sys/powerpc/include/param.h
  head/sys/powerpc/powerpc/intr_machdep.c

Modified: head/sys/powerpc/aim/nexus.c
==
--- head/sys/powerpc/aim/nexus.cMon Sep  9 12:51:24 2013
(r255418)
+++ head/sys/powerpc/aim/nexus.cMon Sep  9 12:52:34 2013
(r255419)
@@ -195,7 +195,8 @@ static driver_t nexus_driver = {
 
 static devclass_t nexus_devclass;
 
-DRIVER_MODULE(nexus, root, nexus_driver, nexus_devclass, 0, 0);
+EARLY_DRIVER_MODULE(nexus, root, nexus_driver, nexus_devclass, 0, 0,
+BUS_PASS_BUS);
 
 static int
 nexus_probe(device_t dev)
@@ -216,7 +217,7 @@ nexus_attach(device_t dev)
sc = device_get_softc(dev);
 
start = 0;
-   end = MAX_PICS*INTR_VECTORS - 1;
+   end = ~0;
 
sc->sc_rman.rm_start = start;
sc->sc_rman.rm_end = end;

Modified: head/sys/powerpc/include/param.h
==
--- head/sys/powerpc/include/param.hMon Sep  9 12:51:24 2013
(r255418)
+++ head/sys/powerpc/include/param.hMon Sep  9 12:52:34 2013
(r255419)
@@ -69,7 +69,7 @@
 
 #if defined(SMP) || defined(KLD_MODULE)
 #ifndef MAXCPU
-#defineMAXCPU  8
+#defineMAXCPU  32  
 #endif
 #else
 #defineMAXCPU  1

Modified: head/sys/powerpc/powerpc/intr_machdep.c
==
--- head/sys/powerpc/powerpc/intr_machdep.c Mon Sep  9 12:51:24 2013
(r255418)
+++ head/sys/powerpc/powerpc/intr_machdep.c Mon Sep  9 12:52:34 2013
(r255419)
@@ -176,7 +176,7 @@ intrcnt_add(const char *name, u_long **c
 static struct powerpc_intr *
 intr_lookup(u_int irq)
 {
-   char intrname[8];
+   char intrname[16];
struct powerpc_intr *i, *iscan;
int vector;
 
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r255420 - in head/sys/powerpc: ofw powermac

2013-09-09 Thread Nathan Whitehorn
Author: nwhitehorn
Date: Mon Sep  9 12:54:08 2013
New Revision: 255420
URL: http://svnweb.freebsd.org/changeset/base/255420

Log:
  Attach only on hardware that is actually supported as opposed to hardware
  that seems like it has some of the problems we might want.
  
  Approved by:  re (kib)

Modified:
  head/sys/powerpc/ofw/ofw_syscons.c
  head/sys/powerpc/powermac/platform_powermac.c

Modified: head/sys/powerpc/ofw/ofw_syscons.c
==
--- head/sys/powerpc/ofw/ofw_syscons.c  Mon Sep  9 12:52:34 2013
(r255419)
+++ head/sys/powerpc/ofw/ofw_syscons.c  Mon Sep  9 12:54:08 2013
(r255420)
@@ -218,6 +218,7 @@ ofwfb_configure(int flags)
 ihandle_t stdout;
phandle_t node;
uint32_t fb_phys;
+   ssize_t proplen;
int depth;
int disable;
int len;
@@ -264,12 +265,21 @@ ofwfb_configure(int flags)
} else
return (0);
 
+   if (OF_getproplen(node, "height") != sizeof(sc->sc_height) ||
+   OF_getproplen(node, "width") != sizeof(sc->sc_width))
+   return (0);
+
sc->sc_depth = depth;
sc->sc_node = node;
sc->sc_console = 1;
+   sc->sc_stride = -1;
OF_getprop(node, "height", &sc->sc_height, sizeof(sc->sc_height));
OF_getprop(node, "width", &sc->sc_width, sizeof(sc->sc_width));
-   OF_getprop(node, "linebytes", &sc->sc_stride, sizeof(sc->sc_stride));
+   proplen = OF_getprop(node, "linebytes", &sc->sc_stride,
+   sizeof(sc->sc_stride));
+   if (proplen != sizeof(sc->sc_stride) ||
+   sc->sc_stride < sc->sc_width*sc->sc_depth/4)
+   sc->sc_stride = sc->sc_width*sc->sc_depth/4;
 
/*
 * Grab the physical address of the framebuffer, and then map it
@@ -278,6 +288,8 @@ ofwfb_configure(int flags)
 *
 * XXX We assume #address-cells is 1 at this point.
 */
+   if (OF_getproplen(node, "address") != sizeof(fb_phys))
+   return (0);
OF_getprop(node, "address", &fb_phys, sizeof(fb_phys));
 
bus_space_map(&bs_be_tag, fb_phys, sc->sc_height * sc->sc_stride,

Modified: head/sys/powerpc/powermac/platform_powermac.c
==
--- head/sys/powerpc/powermac/platform_powermac.c   Mon Sep  9 12:52:34 
2013(r255419)
+++ head/sys/powerpc/powermac/platform_powermac.c   Mon Sep  9 12:54:08 
2013(r255420)
@@ -91,8 +91,22 @@ PLATFORM_DEF(powermac_platform);
 static int
 powermac_probe(platform_t plat)
 {
-   if (OF_finddevice("/memory") != -1 || OF_finddevice("/memory@0") != -1)
-   return (BUS_PROBE_GENERIC);
+   char compat[255];
+   ssize_t compatlen;
+   char *curstr;
+   phandle_t root;
+
+   root = OF_peer(0);
+   if (root == 0)
+   return (ENXIO);
+
+   compatlen = OF_getprop(root, "compatible", compat, sizeof(compat));
+   
+   for (curstr = compat; curstr < compat + compatlen;
+   curstr += strlen(curstr) + 1) {
+   if (strncmp(curstr, "MacRISC", 7) == 0)
+   return (BUS_PROBE_SPECIFIC);
+   }
 
return (ENXIO);
 }
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r255421 - head/sys/powerpc/ofw

2013-09-09 Thread Nathan Whitehorn
Author: nwhitehorn
Date: Mon Sep  9 13:40:53 2013
New Revision: 255421
URL: http://svnweb.freebsd.org/changeset/base/255421

Log:
  Revert r255420. This seems to break some Powermac systems and will be
  revisited much later.
  
  Pointy hat to:me
  Approved by:  re (kib, implicit due to breakage 10 minutes ago)

Modified:
  head/sys/powerpc/ofw/ofw_syscons.c

Modified: head/sys/powerpc/ofw/ofw_syscons.c
==
--- head/sys/powerpc/ofw/ofw_syscons.c  Mon Sep  9 12:54:08 2013
(r255420)
+++ head/sys/powerpc/ofw/ofw_syscons.c  Mon Sep  9 13:40:53 2013
(r255421)
@@ -218,7 +218,6 @@ ofwfb_configure(int flags)
 ihandle_t stdout;
phandle_t node;
uint32_t fb_phys;
-   ssize_t proplen;
int depth;
int disable;
int len;
@@ -265,21 +264,12 @@ ofwfb_configure(int flags)
} else
return (0);
 
-   if (OF_getproplen(node, "height") != sizeof(sc->sc_height) ||
-   OF_getproplen(node, "width") != sizeof(sc->sc_width))
-   return (0);
-
sc->sc_depth = depth;
sc->sc_node = node;
sc->sc_console = 1;
-   sc->sc_stride = -1;
OF_getprop(node, "height", &sc->sc_height, sizeof(sc->sc_height));
OF_getprop(node, "width", &sc->sc_width, sizeof(sc->sc_width));
-   proplen = OF_getprop(node, "linebytes", &sc->sc_stride,
-   sizeof(sc->sc_stride));
-   if (proplen != sizeof(sc->sc_stride) ||
-   sc->sc_stride < sc->sc_width*sc->sc_depth/4)
-   sc->sc_stride = sc->sc_width*sc->sc_depth/4;
+   OF_getprop(node, "linebytes", &sc->sc_stride, sizeof(sc->sc_stride));
 
/*
 * Grab the physical address of the framebuffer, and then map it
@@ -288,8 +278,6 @@ ofwfb_configure(int flags)
 *
 * XXX We assume #address-cells is 1 at this point.
 */
-   if (OF_getproplen(node, "address") != sizeof(fb_phys))
-   return (0);
OF_getprop(node, "address", &fb_phys, sizeof(fb_phys));
 
bus_space_map(&bs_be_tag, fb_phys, sc->sc_height * sc->sc_stride,
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r255422 - in head/crypto/openssh: . openbsd-compat

2013-09-09 Thread Dag-Erling Smørgrav
Author: des
Date: Mon Sep  9 13:56:58 2013
New Revision: 255422
URL: http://svnweb.freebsd.org/changeset/base/255422

Log:
  These three files appeared in 6.0p1, which was imported into the vendor
  branch but never merged to head.  They were inadvertantly left out when
  6.1p1 was merged to head.  It didn't make any difference at the time,
  because they were unused, but one of them is required for DNS-based host
  key verification.
  
  Approved by:  re (blanket)

Added:
  head/crypto/openssh/openbsd-compat/getrrsetbyname-ldns.c
 - copied unchanged from r255414, 
vendor-crypto/openssh/dist/openbsd-compat/getrrsetbyname-ldns.c
  head/crypto/openssh/openbsd-compat/strnlen.c
 - copied unchanged from r255414, 
vendor-crypto/openssh/dist/openbsd-compat/strnlen.c
  head/crypto/openssh/sandbox-seccomp-filter.c
 - copied unchanged from r255414, 
vendor-crypto/openssh/dist/sandbox-seccomp-filter.c

Copied: head/crypto/openssh/openbsd-compat/getrrsetbyname-ldns.c (from r255414, 
vendor-crypto/openssh/dist/openbsd-compat/getrrsetbyname-ldns.c)
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/crypto/openssh/openbsd-compat/getrrsetbyname-ldns.cMon Sep  9 
13:56:58 2013(r255422, copy of r255414, 
vendor-crypto/openssh/dist/openbsd-compat/getrrsetbyname-ldns.c)
@@ -0,0 +1,285 @@
+/* $OpenBSD: getrrsetbyname.c,v 1.10 2005/03/30 02:58:28 tedu Exp $ */
+
+/*
+ * Copyright (c) 2007 Simon Vallet / Genoscope 
+ *
+ * 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 ``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 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.
+ */
+
+/*
+ * Portions Copyright (c) 1999-2001 Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM
+ * DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
+ * INTERNET SOFTWARE CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING
+ * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
+ * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
+ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+#include "includes.h"
+
+#if !defined (HAVE_GETRRSETBYNAME) && defined (HAVE_LDNS)
+
+#include 
+#include 
+
+#include 
+
+#include "getrrsetbyname.h"
+#include "log.h"
+#include "xmalloc.h"
+
+#define malloc(x)  (xmalloc(x))
+#define calloc(x, y)   (xcalloc((x),(y)))
+#define free(x)(xfree(x))
+
+int
+getrrsetbyname(const char *hostname, unsigned int rdclass,
+  unsigned int rdtype, unsigned int flags,
+  struct rrsetinfo **res)
+{
+   int result;
+   unsigned int i, j, index_ans, index_sig;
+   struct rrsetinfo *rrset = NULL;
+   struct rdatainfo *rdata;
+   size_t len;
+   ldns_resolver *ldns_res;
+   ldns_rdf *domain = NULL;
+   ldns_pkt *pkt = NULL;
+   ldns_rr_list *rrsigs = NULL, *rrdata = NULL;
+   ldns_status err;
+   ldns_rr *rr;
+
+   /* check for invalid class and type */
+   if (rdclass > 0x || rdtype > 0x) {
+   result = ERRSET_INVAL;
+   goto fail;
+   }
+
+   /* don't allow queries of class or type ANY */
+   if (rdclass == 0xff || rdtype == 0xff) {
+   result = ERRSET_INVAL;
+   goto fail;
+   }
+
+   /* don't allow flags yet, unimplemented */
+   if (flags) {
+   result = ERRSET_INVAL;

Re: svn commit: r255413 - in head/etc: . etc.amd64

2013-09-09 Thread Dag-Erling Smørgrav
Jase Thew  writes:
> This appears to break "make distribution" (in this example, called as
> part of ezjail-admin update -i) :

Can you try replacing TARGET_ARCH with MACHINE?

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

Re: svn commit: r255413 - in head/etc: . etc.amd64

2013-09-09 Thread Jase Thew

On 09/09/2013 07:02, Dag-Erling Smørgrav wrote:

Author: des
Date: Mon Sep  9 06:02:30 2013
New Revision: 255413
URL: http://svnweb.freebsd.org/changeset/base/255413

Log:
   Remove unneeded mappings from libmap32.conf.  Move it up one level and
   install it on powerpc64 in addition to amd64.

   Reviewed by: kib
   Approved by: re (blanket)

Added:
   head/etc/libmap32.conf
  - copied, changed from r255393, head/etc/etc.amd64/libmap32.conf
Deleted:
   head/etc/etc.amd64/libmap32.conf
Modified:
   head/etc/Makefile

Modified: head/etc/Makefile
==
--- head/etc/Makefile   Mon Sep  9 05:01:18 2013(r255412)
+++ head/etc/Makefile   Mon Sep  9 06:02:30 2013(r255413)
@@ -50,8 +50,8 @@ BIN1= crontab \
syslog.conf \
termcap.small

-.if ${MACHINE} == "amd64"
-BIN1+= etc.${MACHINE}/libmap32.conf
+.if ${TARGET_ARCH} == "amd64" || ${TARGET_ARCH} == "powerpc64"
+BIN1+= libmap32.conf
  .endif

  .if exists(${.CURDIR}/etc.${MACHINE}/ttys)



Hi des,

This appears to break "make distribution" (in this example, called as 
part of ezjail-admin update -i) :


===> libheimipcs (install)
cd /usr/src/libexec/rtld-elf;  PROG=ld-elf32.so.1 MACHINE=i386 
MACHINE_ARCH=i386 MACHINE_CPU="i686 mmx sse sse2" 
MAKEOBJDIRPREFIX=/usr/obj/lib32 _SHLIBDIRPREFIX=/usr/obj/usr/src/lib32 
VERSION="FreeBSD 10.0-CURRENT amd64 154" 
PATH=/usr/obj/usr/src/tmp/legacy/usr/sbin:/usr/obj/usr/src/tmp/legacy/usr/bin:/usr/obj/usr/src/tmp/legacy/usr/games:/usr/obj/usr/src/tmp/legacy/bin:/usr/obj/usr/src/tmp/usr/sbin:/usr/obj/usr/src/tmp/usr/bin:/usr/obj/usr/src/tmp/usr/games:/usr/obj/usr/src/tmp/legacy/usr/sbin:/usr/obj/usr/src/tmp/legacy/usr/bin:/usr/obj/usr/src/tmp/legacy/usr/games:/usr/obj/usr/src/tmp/legacy/bin:/usr/obj/usr/src/tmp/usr/sbin:/usr/obj/usr/src/tmp/usr/bin:/usr/obj/usr/src/tmp/usr/games:/tmp/install.soOoCtKH 
LIBDIR=/usr/lib32 SHLIBDIR=/usr/lib32 LIBPRIVATEDIR=/usr/lib32/private 
COMPILER_TYPE=clang make AS="as --32" LD="ld -m elf_i386_fbsd -Y 
P,/usr/obj/usr/src/lib32/usr/lib32" CC="cc -m32 -march=i686 -mmmx -msse 
-msse2 -DCOMPAT_32BIT  -isystem /usr/obj/usr/src/lib32/usr/include/ 
-L/usr/obj/usr/src/lib32/usr/lib32  -B/usr/obj/usr/src/lib32/usr/lib32" 
CXX="c++ -m32 -march=i686 -mmmx -msse -msse2 -DCOMPAT_32BIT  -isystem 
/usr/obj/usr/src/lib32/usr/include/  -L/usr/obj/usr/src/lib32/usr/lib32 
 -B/usr/obj/usr/src/lib32/usr/lib32" -DCOMPAT_32BIT -DLIBRARIES_ONLY 
-DNO_CPU_CFLAGS -DNO_CTF -DNO_LINT -DWITHOUT_BIND -DWITHOUT_MAN 
-DWITHOUT_INFO -DWITHOUT_HTML -DNO_INCS   install
install -s -o root -g wheel -m 555  -C -b -fschg -S ld-elf32.so.1 
/usr/jails/fulljail/libexec/ld-elf32.so.1

/usr/jails/fulljail/usr/libexec/ld-elf32.so.1 -> /libexec/ld-elf32.so.1
cd /usr/src/usr.bin/ldd; PROG=ldd32 MACHINE=i386 MACHINE_ARCH=i386 
MACHINE_CPU="i686 mmx sse sse2" MAKEOBJDIRPREFIX=/usr/obj/lib32 
_SHLIBDIRPREFIX=/usr/obj/usr/src/lib32 VERSION="FreeBSD 10.0-CURRENT 
amd64 154" 
PATH=/usr/obj/usr/src/tmp/legacy/usr/sbin:/usr/obj/usr/src/tmp/legacy/usr/bin:/usr/obj/usr/src/tmp/legacy/usr/games:/usr/obj/usr/src/tmp/legacy/bin:/usr/obj/usr/src/tmp/usr/sbin:/usr/obj/usr/src/tmp/usr/bin:/usr/obj/usr/src/tmp/usr/games:/usr/obj/usr/src/tmp/legacy/usr/sbin:/usr/obj/usr/src/tmp/legacy/usr/bin:/usr/obj/usr/src/tmp/legacy/usr/games:/usr/obj/usr/src/tmp/legacy/bin:/usr/obj/usr/src/tmp/usr/sbin:/usr/obj/usr/src/tmp/usr/bin:/usr/obj/usr/src/tmp/usr/games:/tmp/install.soOoCtKH 
LIBDIR=/usr/lib32 SHLIBDIR=/usr/lib32 LIBPRIVATEDIR=/usr/lib32/private 
COMPILER_TYPE=clang make AS="as --32" LD="ld -m elf_i386_fbsd -Y 
P,/usr/obj/usr/src/lib32/usr/lib32" CC="cc -m32 -march=i686 -mmmx -msse 
-msse2 -DCOMPAT_32BIT  -isystem /usr/obj/usr/src/lib32/usr/include/ 
-L/usr/obj/usr/src/lib32/usr/lib32  -B/usr/obj/usr/src/lib32/usr/lib32" 
CXX="c++ -m32 -march=i686 -mmmx -msse -msse2 -DCOMPAT_32BIT  -isystem 
/usr/obj/usr/src/lib32/usr/include/  -L/usr/obj/usr/src/lib32/usr/lib32 
 -B/usr/obj/usr/src/lib32/usr/lib32" -DCOMPAT_32BIT -DLIBRARIES_ONLY 
-DNO_CPU_CFLAGS -DNO_CTF -DNO_LINT -DWITHOUT_BIND -DWITHOUT_MAN 
-DWITHOUT_INFO -DWITHOUT_HTML -DNO_INCS   install

install -s -o root -g wheel -m 555   ldd32 /usr/jails/fulljail/usr/bin/ldd32
make: "/usr/src/etc/Makefile" line 53: Malformed conditional 
(${TARGET_ARCH} == "amd64" || ${TARGET_ARCH} == "powerpc64")

make: Fatal errors encountered -- cannot continue
make: stopped in /usr/src/etc
Error: The command 'make distribution' failed.
  Refer to the error report(s) above.

└[~]> uname -a
FreeBSD fbsd10-dev.localdomain 10.0-CURRENT FreeBSD 10.0-CURRENT #0 
r255414M: Mon Sep  9 15:46:28 BST 2013 
toor@fbsd10-dev.localdomain:/usr/obj/usr/src/sys/GENERIC  amd64


Regards,

Jase.
--
Jase Thew
j...@freebsd.org
FreeBSD Ports Committer

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

Re: svn commit: r255413 - in head/etc: . etc.amd64

2013-09-09 Thread Ian Lepore
On Mon, 2013-09-09 at 18:09 +0200, Dag-Erling Smørgrav wrote:
> Jase Thew  writes:
> > This appears to break "make distribution" (in this example, called as
> > part of ezjail-admin update -i) :
> 
> Can you try replacing TARGET_ARCH with MACHINE?
> 
> DES

That doesn't sound right... what if you're doing a cross-build/install?

-- Ian


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


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

2013-09-09 Thread Nathan Whitehorn
Author: nwhitehorn
Date: Mon Sep  9 16:51:35 2013
New Revision: 255424
URL: http://svnweb.freebsd.org/changeset/base/255424

Log:
  Make the primary name of the OF console device /dev/ofwcons, and only
  alias it to the contents of the output property if it is defined. This
  avoids a panic when booting machines (QEMU) where the output-device
  property is not defined.
  
  Since output-device is free-form and potentially conflicts with other
  entries in /dev, I also am not sure we should be doing the aliasing at
  all, but this at least makes things work again.
  
  Approved by:  re (kib)

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

Modified: head/sys/dev/ofw/ofw_console.c
==
--- head/sys/dev/ofw/ofw_console.c  Mon Sep  9 15:38:51 2013
(r255423)
+++ head/sys/dev/ofw/ofw_console.c  Mon Sep  9 16:51:35 2013
(r255424)
@@ -88,17 +88,19 @@ cn_drvinit(void *unused)
 
if (ofw_consdev.cn_pri != CN_DEAD &&
ofw_consdev.cn_name[0] != '\0') {
-   if ((options = OF_finddevice("/options")) == -1 ||
-   OF_getprop(options, "output-device", output,
-   sizeof(output)) == -1)
-   return;
+   tp = tty_alloc(&ofw_ttydevsw, NULL);
+   tty_makedev(tp, NULL, "%s", "ofwcons");
+
/*
 * XXX: This is a hack and it may result in two /dev/ttya
 * XXX: devices on platforms where the sab driver works.
 */
-   tp = tty_alloc(&ofw_ttydevsw, NULL);
-   tty_makedev(tp, NULL, "%s", output);
-   tty_makealias(tp, "ofwcons");
+   if ((options = OF_finddevice("/options")) == -1 ||
+   OF_getprop(options, "output-device", output,
+   sizeof(output)) == -1)
+   return;
+   if (strlen(output) > 0)
+   tty_makealias(tp, output);
}
 }
 
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r255413 - in head/etc: . etc.amd64

2013-09-09 Thread Jase Thew

On 09/09/2013 17:09, Dag-Erling Smørgrav wrote:

Jase Thew  writes:

This appears to break "make distribution" (in this example, called as
part of ezjail-admin update -i) :


Can you try replacing TARGET_ARCH with MACHINE?

DES



Changing it back from TARGET_ARCH to MACHINE allows make distribution to 
successfully complete.


Regards,

Jase.
--
Jase Thew
j...@freebsd.org
FreeBSD Ports Committer

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

Re: svn commit: r255413 - in head/etc: . etc.amd64

2013-09-09 Thread Nathan Whitehorn

On 09/09/13 11:37, Jase Thew wrote:

On 09/09/2013 17:09, Dag-Erling Smørgrav wrote:

Jase Thew  writes:

This appears to break "make distribution" (in this example, called as
part of ezjail-admin update -i) :


Can you try replacing TARGET_ARCH with MACHINE?

DES



Changing it back from TARGET_ARCH to MACHINE allows make distribution 
to successfully complete.


Regards,

Jase.


I think you want MACHINE_ARCH instead of MACHINE? The Makefile.inc1 
stuff usually takes care of permuting TARGET* into MACHINE*.

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

Re: svn commit: r255413 - in head/etc: . etc.amd64

2013-09-09 Thread Dag-Erling Smørgrav
Dag-Erling Smørgrav  writes:
> Ian Lepore  writes:
> > That doesn't sound right... what if you're doing a cross-build/install?
> My thoughts exactly, but judging from the rest of the Makefile, the
> correct variable is MACHINE_ARCH, not TARGET_ARCH.

This (in Makefile.inc1) is why it works:

CROSSENV=   MAKEOBJDIRPREFIX=${OBJTREE} \
MACHINE_ARCH=${TARGET_ARCH} \
MACHINE=${TARGET} \
CPUTYPE=${TARGET_CPUTYPE}
# ...
distrib-dirs distribution:
cd ${.CURDIR}/etc; ${CROSSENV} PATH=${TMPPATH} ${MAKE} \
${IMAKE_INSTALL} ${IMAKE_MTREE} METALOG=${METALOG} ${.TARGET}

although I would have written it differently:

distrib-dirs distribution:
(cd ${.CURDIR}/etc && ${CROSSENV} PATH=${TMPPATH} ${MAKE} \
${IMAKE_INSTALL} ${IMAKE_MTREE} METALOG=${METALOG} ${.TARGET})

but that's a nit.

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

Re: svn commit: r255413 - in head/etc: . etc.amd64

2013-09-09 Thread Dag-Erling Smørgrav
Ian Lepore  writes:
> Dag-Erling Smørgrav  writes:
> > Can you try replacing TARGET_ARCH with MACHINE?
> That doesn't sound right... what if you're doing a cross-build/install?

My thoughts exactly, but judging from the rest of the Makefile, the
correct variable is MACHINE_ARCH, not TARGET_ARCH.

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

svn commit: r255425 - head/etc

2013-09-09 Thread Dag-Erling Smørgrav
Author: des
Date: Mon Sep  9 17:38:02 2013
New Revision: 255425
URL: http://svnweb.freebsd.org/changeset/base/255425

Log:
  The correct variable is apparently MACHINE_ARCH, not TARGET_ARCH.
  
  Approved by:  re (blanket)

Modified:
  head/etc/Makefile

Modified: head/etc/Makefile
==
--- head/etc/Makefile   Mon Sep  9 16:51:35 2013(r255424)
+++ head/etc/Makefile   Mon Sep  9 17:38:02 2013(r255425)
@@ -50,7 +50,7 @@ BIN1= crontab \
syslog.conf \
termcap.small
 
-.if ${TARGET_ARCH} == "amd64" || ${TARGET_ARCH} == "powerpc64"
+.if ${MACHINE_ARCH} == "amd64" || ${MACHINE_ARCH} == "powerpc64"
 BIN1+= libmap32.conf
 .endif
 
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r255426 - in head: lib/libc/sys sys/compat/freebsd32 sys/compat/linux sys/compat/svr4 sys/dev/drm2/i915 sys/i386/ibcs2 sys/i386/linux sys/ia64/ia32 sys/kern sys/sparc64/sparc64 sys/sys ...

2013-09-09 Thread John Baldwin
Author: jhb
Date: Mon Sep  9 18:11:59 2013
New Revision: 255426
URL: http://svnweb.freebsd.org/changeset/base/255426

Log:
  Add a mmap flag (MAP_32BIT) on 64-bit platforms to request that a mapping use
  an address in the first 2GB of the process's address space.  This flag should
  have the same semantics as the same flag on Linux.
  
  To facilitate this, add a new parameter to vm_map_find() that specifies an
  optional maximum virtual address.  While here, fix several callers of
  vm_map_find() to use a VMFS_* constant for the findspace argument instead of
  TRUE and FALSE.
  
  Reviewed by:  alc
  Approved by:  re (kib)

Modified:
  head/lib/libc/sys/mmap.2
  head/sys/compat/freebsd32/freebsd32_misc.c
  head/sys/compat/linux/linux_misc.c
  head/sys/compat/svr4/imgact_svr4.c
  head/sys/dev/drm2/i915/i915_gem.c
  head/sys/i386/ibcs2/imgact_coff.c
  head/sys/i386/linux/imgact_linux.c
  head/sys/ia64/ia32/ia32_signal.c
  head/sys/kern/imgact_elf.c
  head/sys/kern/imgact_gzip.c
  head/sys/kern/init_main.c
  head/sys/kern/link_elf.c
  head/sys/kern/link_elf_obj.c
  head/sys/kern/sys_pipe.c
  head/sys/kern/sysv_shm.c
  head/sys/kern/uipc_shm.c
  head/sys/sparc64/sparc64/pmap.c
  head/sys/sys/mman.h
  head/sys/vm/vm_init.c
  head/sys/vm/vm_kern.c
  head/sys/vm/vm_map.c
  head/sys/vm/vm_map.h
  head/sys/vm/vm_mmap.c
  head/usr.bin/kdump/mksubr
  head/usr.bin/truss/syscalls.c

Modified: head/lib/libc/sys/mmap.2
==
--- head/lib/libc/sys/mmap.2Mon Sep  9 17:38:02 2013(r255425)
+++ head/lib/libc/sys/mmap.2Mon Sep  9 18:11:59 2013(r255426)
@@ -28,7 +28,7 @@
 .\"@(#)mmap.2  8.4 (Berkeley) 5/11/95
 .\" $FreeBSD$
 .\"
-.Dd August 16, 2013
+.Dd September 9, 2013
 .Dt MMAP 2
 .Os
 .Sh NAME
@@ -98,6 +98,12 @@ argument by
 .Em or Ns 'ing
 the following values:
 .Bl -tag -width MAP_PREFAULT_READ
+.It Dv MAP_32BIT
+Request a region in the first 2GB of the current process's address space.
+If a suitable region cannot be found,
+.Fn mmap
+will fail.
+This flag is only available on 64-bit platforms.
 .It Dv MAP_ALIGNED Ns Pq Fa n
 Align the region on a requested boundary.
 If a suitable region cannot be found,
@@ -362,6 +368,13 @@ was specified and the
 argument was not page aligned, or part of the desired address space
 resides out of the valid address space for a user process.
 .It Bq Er EINVAL
+Both
+.Dv MAP_FIXED
+and
+.Dv MAP_32BIT
+were specified and part of the desired address space resides outside
+of the first 2GB of user address space.
+.It Bq Er EINVAL
 The
 .Fa len
 argument

Modified: head/sys/compat/freebsd32/freebsd32_misc.c
==
--- head/sys/compat/freebsd32/freebsd32_misc.c  Mon Sep  9 17:38:02 2013
(r255425)
+++ head/sys/compat/freebsd32/freebsd32_misc.c  Mon Sep  9 18:11:59 2013
(r255426)
@@ -448,9 +448,8 @@ freebsd32_mmap_partial(struct thread *td
}
} else {
vm_offset_t addr = trunc_page(start);
-   rv = vm_map_find(map, 0, 0,
-&addr, PAGE_SIZE, FALSE, prot,
-VM_PROT_ALL, 0);
+   rv = vm_map_find(map, NULL, 0, &addr, PAGE_SIZE, 0,
+   VMFS_NO_SPACE, prot, VM_PROT_ALL, 0);
if (rv != KERN_SUCCESS)
return (EINVAL);
}
@@ -542,9 +541,8 @@ freebsd32_mmap(struct thread *td, struct
rv = vm_map_remove(map, start, end);
if (rv != KERN_SUCCESS)
return (EINVAL);
-   rv = vm_map_find(map, 0, 0,
-&start, end - start, FALSE,
-prot, VM_PROT_ALL, 0);
+   rv = vm_map_find(map, NULL, 0, &start, end - start,
+   0, VMFS_NO_SPACE, prot, VM_PROT_ALL, 0);
if (rv != KERN_SUCCESS)
return (EINVAL);
r.fd = fd;

Modified: head/sys/compat/linux/linux_misc.c
==
--- head/sys/compat/linux/linux_misc.c  Mon Sep  9 17:38:02 2013
(r255425)
+++ head/sys/compat/linux/linux_misc.c  Mon Sep  9 18:11:59 2013
(r255426)
@@ -410,8 +410,8 @@ linux_uselib(struct thread *td, struct l
 
/* get anon user mapping, read+write+execute */
error = vm_map_find(&td->td_proc->p_vmspace->vm_map, NULL, 0,
-   &vmaddr, a_out->a_text + a_out->a_data, FALSE, VM_PROT_ALL,
-   VM_PROT_ALL, 0);
+   &vmaddr, a_out->a_text + a_out->a_data, 0, VMFS_NO_SPACE,
+   VM_PROT_ALL, VM_PROT_ALL, 0);
if (error)
goto cleanup;
 
@@ -455,7 +455,8 @@ linux_uselib(struct thread *td,

Re: svn commit: r254882 - head/sys/dev/pci

2013-09-09 Thread John Baldwin
On Friday, September 06, 2013 4:01:14 am Jean-Sébastien Pédron wrote:
> Le 03/09/2013 20:10, John Baldwin a écrit :
> > Yes, orm0 is eating it.  Try this along with using RF_SHAREABLE in your
> > call to BUS_ALLOC_RESOURCE():
> >
> > Index: x86/isa/orm.c
> > (...)
> > -   res = bus_alloc_resource_any(child, SYS_RES_MEMORY, &rid, 0);
> > +   res = bus_alloc_resource_any(child, SYS_RES_MEMORY, &rid,
> > +   RF_SHAREABLE);
> 
> I tried this patch + RF_SHAREABLE in vga_pci.c but without success. In 
> the call to BUS_ALLOC_RESOURCE in vga_pci.c, I tried with various 
> "parents"/"grand-parents" but it always returns NULL.

Ok, let's punt on changing the API perhaps, but use the vgapci softc to find 
the resource:

Index: vga_pci.c
===
--- vga_pci.c   (revision 255414)
+++ vga_pci.c   (working copy)
@@ -67,6 +67,12 @@ struct vga_pci_softc {
 
 SYSCTL_DECL(_hw_pci);
 
+static struct vga_resource *lookup_res(struct vga_pci_softc *sc, int rid);
+static struct resource *vga_pci_alloc_resource(device_t dev, device_t child,
+int type, int *rid, u_long start, u_long end, u_long count, u_int flags);
+static int vga_pci_release_resource(device_t dev, device_t child, int type,
+int rid, struct resource *r);
+
 int vga_pci_default_unit = -1;
 TUNABLE_INT("hw.pci.default_vgapci_unit", &vga_pci_default_unit);
 SYSCTL_INT(_hw_pci, OID_AUTO, default_vgapci_unit, CTLFLAG_RDTUN,
@@ -80,7 +86,6 @@ vga_pci_is_boot_display(device_t dev)
 * Return true if the given device is the default display used
 * at boot time.
 */
-
return (
(pci_get_class(dev) == PCIC_DISPLAY ||
 (pci_get_class(dev) == PCIC_OLD &&
@@ -111,7 +116,8 @@ vga_pci_map_bios(device_t dev, size_t *size)
 #endif
 
rid = PCIR_BIOS;
-   res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, RF_ACTIVE);
+   res = vga_pci_alloc_resource(dev, NULL, SYS_RES_MEMORY, &rid, 0ul,
+   ~0ul, 1, RF_ACTIVE);
if (res == NULL) {
return (NULL);
}
@@ -123,8 +129,7 @@ vga_pci_map_bios(device_t dev, size_t *size)
 void
 vga_pci_unmap_bios(device_t dev, void *bios)
 {
-   int rid;
-   struct resource *res;
+   struct vga_resource *vr;
 
if (bios == NULL) {
return;
@@ -140,25 +145,15 @@ vga_pci_unmap_bios(device_t dev, void *bios)
 #endif
 
/*
-* FIXME: We returned only the virtual address of the resource
-* to the caller. Now, to get the resource struct back, we
-* allocate it again: the struct exists once in memory in
-* device softc. Therefore, we release twice now to release the
-* reference we just obtained to get the structure back and the
-* caller's reference.
+* Look up the PCIR_BIOS resource in our softc.  It should match
+* the address we returned previously.
 */
-
-   rid = PCIR_BIOS;
-   res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, RF_ACTIVE);
-
-   KASSERT(res != NULL,
-   ("%s: Can't get BIOS resource back", __func__));
-   KASSERT(bios == rman_get_virtual(res),
-   ("%s: Given BIOS address doesn't match "
-"resource virtual address", __func__));
-
-   bus_release_resource(dev, SYS_RES_MEMORY, rid, bios);
-   bus_release_resource(dev, SYS_RES_MEMORY, rid, bios);
+   vr = lookup_res(device_get_softc(dev), PCIR_BIOS);
+   KASSERT(vr->vr_res != NULL, ("vga_pci_unmap_bios: bios not mapped"));
+   KASSERT(rman_get_virtual(vr->vr_res) == bios,
+   ("vga_pci_unmap_bios: mismatch"));
+   vga_pci_release_resource(dev, NULL, SYS_RES_MEMORY, PCIR_BIOS,
+   vr->vr_res);
 }
 
 static int


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


Re: svn commit: r254199 - in head/sys: contrib/dev/iwn modules/iwnfw/iwn6000g2a

2013-09-09 Thread John Baldwin
On Saturday, August 10, 2013 9:03:32 pm Adrian Chadd wrote:
> Author: adrian
> Date: Sun Aug 11 01:03:32 2013
> New Revision: 254199
> URL: http://svnweb.freebsd.org/changeset/base/254199
> 
> Log:
>   Update the 6000g2a image.
>   
>   Obtained from:  Linux, Intel
> 
> Added:
>   head/sys/contrib/dev/iwn/iwlwifi-6000g2a-18.168.6.1.fw.uu
> Modified:
>   head/sys/modules/iwnfw/iwn6000g2a/Makefile

This exposed a bug in sys/conf/kmod.mk for me.  I use NO_KERNELCLEAN by 
default when upgrading my kernels (and have for many years), but the version 
information in the 'FIRMWS' variable used to generate the C stub is not 
treated as a dependency of the generated stub.  Thus, when I upgraded past 
this, the firmware module reused the previous C stub which used a symbol that 
hardcoded the previous firmware version number, so the linker saw it as an 
unresolved symbol and failed to load it.  I don't think anything is wrong with 
this commit at all.  I just wonder if there's a good way to make the C stub 
depend on the value of FIRMWS and have it be regenerated if FIRMWS changes.

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


Re: svn commit: r255219 - in head: contrib/tcpdump lib/libc lib/libc/capability lib/libc/include lib/libc/sys lib/libprocstat sbin/dhclient sbin/hastd sys/amd64/linux32 sys/bsm sys/cddl/compat/opensol

2013-09-09 Thread .

I think r255219 broke compilation on amd64 with WITHOUT_CLANG=yes.
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r255428 - head/usr.sbin/mergemaster

2013-09-09 Thread Xin LI
Author: delphij
Date: Mon Sep  9 20:36:28 2013
New Revision: 255428
URL: http://svnweb.freebsd.org/changeset/base/255428

Log:
  Pass -n (do not emit comments) when saving mtree information for future
  mergemaster(8) runs.
  
  MFC after:3 days
  Approved by:  re (kib)

Modified:
  head/usr.sbin/mergemaster/mergemaster.sh

Modified: head/usr.sbin/mergemaster/mergemaster.sh
==
--- head/usr.sbin/mergemaster/mergemaster.shMon Sep  9 19:27:44 2013
(r255427)
+++ head/usr.sbin/mergemaster/mergemaster.shMon Sep  9 20:36:28 2013
(r255428)
@@ -707,7 +707,7 @@ case "${RERUN}" in
   # Build the mtree database in a temporary location.
   case "${PRE_WORLD}" in
   '') MTREENEW=`mktemp -t mergemaster.mtree`
-  mtree -ci -p ${TEMPROOT} -k size,md5digest > ${MTREENEW} 2>/dev/null
+  mtree -nci -p ${TEMPROOT} -k size,md5digest > ${MTREENEW} 2>/dev/null
   ;;
   *) # We don't want to mess with the mtree database on a pre-world run or
  # when re-scanning a previously-built tree.
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r255431 - head/share/mk

2013-09-09 Thread Dag-Erling Smørgrav
Author: des
Date: Mon Sep  9 21:18:16 2013
New Revision: 255431
URL: http://svnweb.freebsd.org/changeset/base/255431

Log:
  Emit the correct standard library dependency line for C++ programs.  In
  the CLANG_IS_CC case, the default is now libc++.  Only use libstdc++ if
  !CLANG_IS_CC or it was explicitly requested in CXXFLAGS.
  
  Submitted by: theraven
  Approved by:  re (gjb)

Modified:
  head/share/mk/bsd.prog.mk

Modified: head/share/mk/bsd.prog.mk
==
--- head/share/mk/bsd.prog.mk   Mon Sep  9 21:05:01 2013(r255430)
+++ head/share/mk/bsd.prog.mk   Mon Sep  9 21:18:16 2013(r255431)
@@ -173,7 +173,7 @@ _EXTRADEPEND:
 .else
echo ${PROG}: ${LIBC} ${DPADD} >> ${DEPENDFILE}
 .if defined(PROG_CXX)
-.if !empty(CXXFLAGS:M-stdlib=libc++)
+.if ${MK_CLANG_IS_CC} != "no" && empty(CXXFLAGS:M-stdlib=libstdc++)
echo ${PROG}: ${LIBCPLUSPLUS} >> ${DEPENDFILE}
 .else
echo ${PROG}: ${LIBSTDCPLUSPLUS} >> ${DEPENDFILE}
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r255434 - head/sys/netinet

2013-09-09 Thread Michael Tuexen
Author: tuexen
Date: Mon Sep  9 21:40:07 2013
New Revision: 255434
URL: http://svnweb.freebsd.org/changeset/base/255434

Log:
  Fix the aborting of association with the iterator using an empty
  user initiated error cause (using SCTP_ABORT|SCTP_SENDALL).
  
  Approved by: re (delphij)
  MFC after: 1 week

Modified:
  head/sys/netinet/sctp_output.c

Modified: head/sys/netinet/sctp_output.c
==
--- head/sys/netinet/sctp_output.c  Mon Sep  9 21:26:18 2013
(r255433)
+++ head/sys/netinet/sctp_output.c  Mon Sep  9 21:40:07 2013
(r255434)
@@ -6412,7 +6412,7 @@ sctp_sendall_iterator(struct sctp_inpcb 
/* TSNH */
return;
}
-   if ((ca->m) && ca->sndlen) {
+   if (ca->sndlen > 0) {
m = SCTP_M_COPYM(ca->m, 0, M_COPYALL, M_NOWAIT);
if (m == NULL) {
/* can't copy so we are done */
@@ -6441,38 +6441,40 @@ sctp_sendall_iterator(struct sctp_inpcb 
}
if (ca->sndrcv.sinfo_flags & SCTP_ABORT) {
/* Abort this assoc with m as the user defined reason */
-   if (m) {
+   if (m != NULL) {
+   SCTP_BUF_PREPEND(m, sizeof(struct sctp_paramhdr), 
M_NOWAIT);
+   } else {
+   m = sctp_get_mbuf_for_msg(sizeof(struct sctp_paramhdr),
+   0, M_NOWAIT, 1, MT_DATA);
+   SCTP_BUF_LEN(m) = sizeof(struct sctp_paramhdr);
+   }
+   if (m != NULL) {
struct sctp_paramhdr *ph;
 
-   SCTP_BUF_PREPEND(m, sizeof(struct sctp_paramhdr), 
M_NOWAIT);
-   if (m) {
-   ph = mtod(m, struct sctp_paramhdr *);
-   ph->param_type = 
htons(SCTP_CAUSE_USER_INITIATED_ABT);
-   ph->param_length = htons(sizeof(struct 
sctp_paramhdr) + ca->sndlen);
-   }
-   /*
-* We add one here to keep the assoc from
-* dis-appearing on us.
-*/
-   atomic_add_int(&stcb->asoc.refcnt, 1);
-   sctp_abort_an_association(inp, stcb, m, 
SCTP_SO_NOT_LOCKED);
-   /*
-* sctp_abort_an_association calls sctp_free_asoc()
-* free association will NOT free it since we
-* incremented the refcnt .. we do this to prevent
-* it being freed and things getting tricky since we
-* could end up (from free_asoc) calling inpcb_free
-* which would get a recursive lock call to the
-* iterator lock.. But as a consequence of that the
-* stcb will return to us un-locked.. since
-* free_asoc returns with either no TCB or the TCB
-* unlocked, we must relock.. to unlock in the
-* iterator timer :-0
-*/
-   SCTP_TCB_LOCK(stcb);
-   atomic_add_int(&stcb->asoc.refcnt, -1);
-   goto no_chunk_output;
+   ph = mtod(m, struct sctp_paramhdr *);
+   ph->param_type = htons(SCTP_CAUSE_USER_INITIATED_ABT);
+   ph->param_length = htons(sizeof(struct sctp_paramhdr) + 
ca->sndlen);
}
+   /*
+* We add one here to keep the assoc from dis-appearing on
+* us.
+*/
+   atomic_add_int(&stcb->asoc.refcnt, 1);
+   sctp_abort_an_association(inp, stcb, m, SCTP_SO_NOT_LOCKED);
+   /*
+* sctp_abort_an_association calls sctp_free_asoc() free
+* association will NOT free it since we incremented the
+* refcnt .. we do this to prevent it being freed and things
+* getting tricky since we could end up (from free_asoc)
+* calling inpcb_free which would get a recursive lock call
+* to the iterator lock.. But as a consequence of that the
+* stcb will return to us un-locked.. since free_asoc
+* returns with either no TCB or the TCB unlocked, we must
+* relock.. to unlock in the iterator timer :-0
+*/
+   SCTP_TCB_LOCK(stcb);
+   atomic_add_int(&stcb->asoc.refcnt, -1);
+   goto no_chunk_output;
} else {
if (m) {
ret = sctp_msg_append(stcb, net, m,
@@ -6566,8 +6568,7 @@ sctp_sendall_iterator(struct sctp_inpcb 
 
if ((sctp_is_feature_off(inp, SCTP_PCB_FLAGS_NODELAY)) &&
(stcb->asoc.total_flight > 0) &&

svn commit: r255437 - in head: cddl/contrib/opensolaris/lib/libzpool/common cddl/contrib/opensolaris/lib/libzpool/common/sys sys/cddl/compat/opensolaris/sys sys/cddl/contrib/opensolaris/uts/common/...

2013-09-09 Thread Xin LI
Author: delphij
Date: Tue Sep 10 01:46:47 2013
New Revision: 255437
URL: http://svnweb.freebsd.org/changeset/base/255437

Log:
  MFV r247844 (illumos-gate 13975:ef6409bc370f)
  
  Illumos ZFS issues:
3582 zfs_delay() should support a variable resolution
3584 DTrace sdt probes for ZFS txg states
  
  Provide a compatibility shim for Solaris's cv_timedwait_hires
  to help aid future porting.
  
  Approved by:  re (ZFS blanket)

Modified:
  head/cddl/contrib/opensolaris/lib/libzpool/common/kernel.c
  head/cddl/contrib/opensolaris/lib/libzpool/common/sys/zfs_context.h
  head/sys/cddl/compat/opensolaris/sys/kcondvar.h
  head/sys/cddl/compat/opensolaris/sys/time.h
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dir.c
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_pool.c
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scan.c
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/txg.h
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/txg_impl.h
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/txg.c
Directory Properties:
  head/cddl/contrib/opensolaris/   (props changed)
  head/sys/cddl/contrib/opensolaris/   (props changed)

Modified: head/cddl/contrib/opensolaris/lib/libzpool/common/kernel.c
==
--- head/cddl/contrib/opensolaris/lib/libzpool/common/kernel.c  Tue Sep 10 
01:38:41 2013(r255436)
+++ head/cddl/contrib/opensolaris/lib/libzpool/common/kernel.c  Tue Sep 10 
01:46:47 2013(r255437)
@@ -349,6 +349,41 @@ top:
return (1);
 }
 
+/*ARGSUSED*/
+clock_t
+cv_timedwait_hires(kcondvar_t *cv, kmutex_t *mp, hrtime_t tim, hrtime_t res,
+int flag)
+{
+   int error;
+   timestruc_t ts;
+   hrtime_t delta;
+
+   ASSERT(flag == 0);
+
+top:
+   delta = tim - gethrtime();
+   if (delta <= 0)
+   return (-1);
+
+   ts.tv_sec = delta / NANOSEC;
+   ts.tv_nsec = delta % NANOSEC;
+
+   ASSERT(mutex_owner(mp) == curthread);
+   mp->m_owner = NULL;
+   error = pthread_cond_timedwait(cv, &mp->m_lock, &ts);
+   mp->m_owner = curthread;
+
+   if (error == ETIMEDOUT)
+   return (-1);
+
+   if (error == EINTR)
+   goto top;
+
+   ASSERT(error == 0);
+
+   return (1);
+}
+
 void
 cv_signal(kcondvar_t *cv)
 {

Modified: head/cddl/contrib/opensolaris/lib/libzpool/common/sys/zfs_context.h
==
--- head/cddl/contrib/opensolaris/lib/libzpool/common/sys/zfs_context.h Tue Sep 
10 01:38:41 2013(r255436)
+++ head/cddl/contrib/opensolaris/lib/libzpool/common/sys/zfs_context.h Tue Sep 
10 01:46:47 2013(r255437)
@@ -313,6 +313,8 @@ extern void cv_init(kcondvar_t *cv, char
 extern void cv_destroy(kcondvar_t *cv);
 extern void cv_wait(kcondvar_t *cv, kmutex_t *mp);
 extern clock_t cv_timedwait(kcondvar_t *cv, kmutex_t *mp, clock_t abstime);
+extern clock_t cv_timedwait_hires(kcondvar_t *cvp, kmutex_t *mp, hrtime_t tim,
+hrtime_t res, int flag);
 extern void cv_signal(kcondvar_t *cv);
 extern void cv_broadcast(kcondvar_t *cv);
 

Modified: head/sys/cddl/compat/opensolaris/sys/kcondvar.h
==
--- head/sys/cddl/compat/opensolaris/sys/kcondvar.h Tue Sep 10 01:38:41 
2013(r255436)
+++ head/sys/cddl/compat/opensolaris/sys/kcondvar.h Tue Sep 10 01:46:47 
2013(r255437)
@@ -1,5 +1,6 @@
 /*-
  * Copyright (c) 2007 Pawel Jakub Dawidek 
+ * Copyright (c) 2013 iXsystems, Inc.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -36,6 +37,7 @@
 
 #include 
 #include 
+#include 
 
 typedef struct cv  kcondvar_t;
 
@@ -57,6 +59,19 @@ typedef enum {
 } while (0)
 #definecv_init(cv, name, type, arg)zfs_cv_init(cv, name, type, arg)
 
+static clock_t
+cv_timedwait_hires(kcondvar_t *cvp, kmutex_t *mp, hrtime_t tim, hrtime_t res,
+int flag)
+{
+   sbintime_t sbt;
+   sbintime_t pr;
+
+   sbt = tim * SBT_1NS;
+   pr = res * SBT_1NS;
+
+   return (cv_timedwait_sbt(cvp, mp, sbt, pr, 0));
+}
+
 #endif /* _KERNEL */
 
 #endif /* _OPENSOLARIS_SYS_CONDVAR_H_ */

Modified: head/sys/cddl/compat/opensolaris/sys/time.h
==
--- head/sys/cddl/compat/opensolaris/sys/time.h Tue Sep 10 01:38:41 2013
(r255436)
+++ head/sys/cddl/compat/opensolaris/sys/time.h Tue Sep 10 01:46:47 2013
(r255437)
@@ -37,6 +37,9 @@
 #define NANOSEC10
 #define TIME_MAX   LLONG_MAX
 
+#defineMSEC2NSEC(m)((hrtime_t)(m) * (NANOSEC / MILLISEC))
+#defineNSEC2MSEC(n)((n) / (NANOSEC / MILLISEC))
+
 typedef longlong_t hrtime_t;
 
 #if defined(__i386__) || defined(__powerpc__)

Mod

svn commit: r255438 - in head: sys/amd64/include usr.sbin/bhyve

2013-09-09 Thread Peter Grehan
Author: grehan
Date: Tue Sep 10 03:48:18 2013
New Revision: 255438
URL: http://svnweb.freebsd.org/changeset/base/255438

Log:
  Go way past 11 and bump bhyve's max vCPUs to 16.
  
  This should be sufficient for 10.0 and will do
  until forthcoming work to avoid limitations
  in this area is complete.
  
  Thanks to Bela Lubkin at tidalscale for the
  headsup on the apic/cpu id/io apic ASL parameters
  that are actually hex values and broke when
  written as decimal when 11 vCPUs were configured.
  
  Approved by:  re@

Modified:
  head/sys/amd64/include/vmm.h
  head/usr.sbin/bhyve/acpi.c

Modified: head/sys/amd64/include/vmm.h
==
--- head/sys/amd64/include/vmm.hTue Sep 10 01:46:47 2013
(r255437)
+++ head/sys/amd64/include/vmm.hTue Sep 10 03:48:18 2013
(r255438)
@@ -150,7 +150,7 @@ void vm_interrupt_hostcpu(struct vm *vm,
 
 #include 
 
-#defineVM_MAXCPU   8   /* maximum virtual cpus 
*/
+#defineVM_MAXCPU   16  /* maximum virtual cpus 
*/
 
 /*
  * Identifiers for events that can be injected into the VM

Modified: head/usr.sbin/bhyve/acpi.c
==
--- head/usr.sbin/bhyve/acpi.c  Tue Sep 10 01:46:47 2013(r255437)
+++ head/usr.sbin/bhyve/acpi.c  Tue Sep 10 03:48:18 2013(r255438)
@@ -241,8 +241,9 @@ basl_fwrite_madt(FILE *fp)
for (i = 0; i < basl_ncpu; i++) {
EFPRINTF(fp, "[0001]\t\tSubtable Type : 00\n");
EFPRINTF(fp, "[0001]\t\tLength : 08\n");
-   EFPRINTF(fp, "[0001]\t\tProcessor ID : %02d\n", i);
-   EFPRINTF(fp, "[0001]\t\tLocal Apic ID : %02d\n", i);
+   /* iasl expects hex values for the proc and apic id's */
+   EFPRINTF(fp, "[0001]\t\tProcessor ID : %02x\n", i);
+   EFPRINTF(fp, "[0001]\t\tLocal Apic ID : %02x\n", i);
EFPRINTF(fp, "[0004]\t\tFlags (decoded below) : 0001\n");
EFPRINTF(fp, "\t\t\tProcessor Enabled : 1\n");
EFPRINTF(fp, "\n");
@@ -251,7 +252,8 @@ basl_fwrite_madt(FILE *fp)
/* Always a single IOAPIC entry, with ID ncpu+1 */
EFPRINTF(fp, "[0001]\t\tSubtable Type : 01\n");
EFPRINTF(fp, "[0001]\t\tLength : 0C\n");
-   EFPRINTF(fp, "[0001]\t\tI/O Apic ID : %02d\n", basl_ncpu);
+   /* iasl expects a hex value for the i/o apic id */
+   EFPRINTF(fp, "[0001]\t\tI/O Apic ID : %02x\n", basl_ncpu);
EFPRINTF(fp, "[0001]\t\tReserved : 00\n");
EFPRINTF(fp, "[0004]\t\tAddress : fec0\n");
EFPRINTF(fp, "[0004]\t\tInterrupt : \n");
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r255439 - head/sys/dev/cpuctl

2013-09-09 Thread Konstantin Belousov
Author: kib
Date: Tue Sep 10 05:17:53 2013
New Revision: 255439
URL: http://svnweb.freebsd.org/changeset/base/255439

Log:
  Call free() on the pointer returned from malloc().
  
  Reported and tested by:   Oliver Pinter 
  Sponsored by: The FreeBSD Foundation
  MFC after:3 days
  Approved by:  re (delphij)

Modified:
  head/sys/dev/cpuctl/cpuctl.c

Modified: head/sys/dev/cpuctl/cpuctl.c
==
--- head/sys/dev/cpuctl/cpuctl.cTue Sep 10 03:48:18 2013
(r255438)
+++ head/sys/dev/cpuctl/cpuctl.cTue Sep 10 05:17:53 2013
(r255439)
@@ -295,10 +295,10 @@ cpuctl_do_update(int cpu, cpuctl_update_
 static int
 update_intel(int cpu, cpuctl_update_args_t *args, struct thread *td)
 {
-   void *ptr = NULL;
+   void *ptr;
uint64_t rev0, rev1;
uint32_t tmp[4];
-   int is_bound = 0;
+   int is_bound;
int oldcpu;
int ret;
 
@@ -312,10 +312,11 @@ update_intel(int cpu, cpuctl_update_args
}
 
/*
-* 16 byte alignment required.
+* 16 byte alignment required.  Rely on the fact that
+* malloc(9) always returns the pointer aligned at least on
+* the size of the allocation.
 */
ptr = malloc(args->size + 16, M_CPUCTL, M_WAITOK);
-   ptr = (void *)(16 + ((intptr_t)ptr & ~0xf));
if (copyin(args->data, ptr, args->size) != 0) {
DPRINTF("[cpuctl,%d]: copyin %p->%p of %zd bytes failed",
__LINE__, args->data, ptr, args->size);
@@ -408,10 +409,10 @@ fail:
 static int
 update_via(int cpu, cpuctl_update_args_t *args, struct thread *td)
 {
-   void *ptr = NULL;
+   void *ptr;
uint64_t rev0, rev1, res;
uint32_t tmp[4];
-   int is_bound = 0;
+   int is_bound;
int oldcpu;
int ret;
 
@@ -427,8 +428,7 @@ update_via(int cpu, cpuctl_update_args_t
/*
 * 4 byte alignment required.
 */
-   ptr = malloc(args->size + 16, M_CPUCTL, M_WAITOK);
-   ptr = (void *)(16 + ((intptr_t)ptr & ~0xf));
+   ptr = malloc(args->size, M_CPUCTL, M_WAITOK);
if (copyin(args->data, ptr, args->size) != 0) {
DPRINTF("[cpuctl,%d]: copyin %p->%p of %zd bytes failed",
__LINE__, args->data, ptr, args->size);
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r255440 - in head/sys: conf modules/aesni

2013-09-09 Thread David E. O'Brien
Author: obrien
Date: Tue Sep 10 05:49:31 2013
New Revision: 255440
URL: http://svnweb.freebsd.org/changeset/base/255440

Log:
  Only use a clang'ism if ${CC} is clang.
  
  Reviewed by:  sjg
  Approved by:  re (kib)

Modified:
  head/sys/conf/files.amd64
  head/sys/conf/files.i386
  head/sys/modules/aesni/Makefile

Modified: head/sys/conf/files.amd64
==
--- head/sys/conf/files.amd64   Tue Sep 10 05:17:53 2013(r255439)
+++ head/sys/conf/files.amd64   Tue Sep 10 05:49:31 2013(r255440)
@@ -142,7 +142,7 @@ crypto/aesni/aeskeys_amd64.Soptional ae
 crypto/aesni/aesni.c   optional aesni
 aesni_wrap.o   optional aesni  \
dependency  "$S/crypto/aesni/aesni_wrap.c"  \
-   compile-with"${CC} -c ${CFLAGS:C/^-O2$/-O3/:N-nostdinc} ${WERROR} 
${PROF} -mmmx -msse -maes ${.IMPSRC}" \
+   compile-with"${CC} -c ${CFLAGS:C/^-O2$/-O3/:N-nostdinc} ${WERROR} 
${PROF} -mmmx -msse ${COMPILER_TYPE:Mclang:S/clang/-maes} ${.IMPSRC}" \
no-implicit-rule\
clean   "aesni_wrap.o"
 crypto/blowfish/bf_enc.c   optionalcrypto | ipsec

Modified: head/sys/conf/files.i386
==
--- head/sys/conf/files.i386Tue Sep 10 05:17:53 2013(r255439)
+++ head/sys/conf/files.i386Tue Sep 10 05:49:31 2013(r255440)
@@ -128,7 +128,7 @@ crypto/aesni/aeskeys_i386.S optional aes
 crypto/aesni/aesni.c   optional aesni
 aesni_wrap.o   optional aesni  \
dependency  "$S/crypto/aesni/aesni_wrap.c"  \
-   compile-with"${CC} -c ${CFLAGS:C/^-O2$/-O3/:N-nostdinc} ${WERROR} 
${PROF} -mmmx -msse -maes ${.IMPSRC}" \
+   compile-with"${CC} -c ${CFLAGS:C/^-O2$/-O3/:N-nostdinc} ${WERROR} 
${PROF} -mmmx -msse ${COMPILER_TYPE} ${COMPILER_TYPE:Mclang:S/clang/-maes} 
${.IMPSRC}" \
no-implicit-rule\
clean   "aesni_wrap.o"
 crypto/des/arch/i386/des_enc.S optional crypto | ipsec | netsmb

Modified: head/sys/modules/aesni/Makefile
==
--- head/sys/modules/aesni/Makefile Tue Sep 10 05:17:53 2013
(r255439)
+++ head/sys/modules/aesni/Makefile Tue Sep 10 05:49:31 2013
(r255440)
@@ -12,7 +12,7 @@ OBJS+=aesni_wrap.o
 # Remove -nostdinc so we can get the intrinsics.
 aesni_wrap.o: aesni_wrap.c
${CC} -c ${CFLAGS:C/^-O2$/-O3/:N-nostdinc} ${WERROR} ${PROF} \
--mmmx -msse -maes ${.IMPSRC}
+-mmmx -msse ${COMPILER_TYPE:Mclang:S/clang/-maes/} ${.IMPSRC}
${CTFCONVERT_CMD}
 
 .include 
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r255187 - in head/sys: conf crypto/aesni modules/aesni

2013-09-09 Thread David O'Brien
On Tue, Sep 03, 2013 at 06:31:23PM +, John-Mark Gurney wrote:
> Log:
>   Use the fact that the AES-NI instructions can be pipelined to improve
>   performance... Use SSE2 instructions for calculating the XTS tweek
>   factor...  Let the compiler do more work and handle register allocation
>   by using intrinsics, now only the key schedule is in assembly...

Hi John-Mark,
Unfortunately this does not work with /usr/bin/gcc (which I still use as
/usr/bin/cc on this old IBM T60 laptop due to clang's enormous pestimation
on 'make world' and build times.

Please fix this ASAP or back it out out of 10-CURRENT as it does not work
with /usr/bin/gcc:

1. /usr/bin/gcc cannot handle the "-maes" option.
I committed r255440 to address this.

2. /usr/src/sys/modules/aesni/../../crypto/aesni/aesencdec.h:30:23: error: 
wmmintrin.h: No such file or directory
and then a cascade of errors follow.

For now, I've sent a patch to re@ for approval to remove the 'aesni'
module from the build if not using clang.  But the LINT build is
still broken with /usr/bin/gcc.


>   Replace .byte hard coded instructions w/ the proper instructions now
>   that both clang and gcc support them...

Is this out-of-tree latest GCC that supports this?

thanks,
-- 
-- David  (obr...@freebsd.org)
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r255187 - in head/sys: conf crypto/aesni modules/aesni

2013-09-09 Thread John-Mark Gurney
David O'Brien wrote this message on Mon, Sep 09, 2013 at 23:01 -0700:
> On Tue, Sep 03, 2013 at 06:31:23PM +, John-Mark Gurney wrote:
> > Log:
> >   Use the fact that the AES-NI instructions can be pipelined to improve
> >   performance... Use SSE2 instructions for calculating the XTS tweek
> >   factor...  Let the compiler do more work and handle register allocation
> >   by using intrinsics, now only the key schedule is in assembly...
> 
> Hi John-Mark,
> Unfortunately this does not work with /usr/bin/gcc (which I still use as
> /usr/bin/cc on this old IBM T60 laptop due to clang's enormous pestimation
> on 'make world' and build times.
> 
> Please fix this ASAP or back it out out of 10-CURRENT as it does not work
> with /usr/bin/gcc:
> 
> 1. /usr/bin/gcc cannot handle the "-maes" option.
> I committed r255440 to address this.

Please back that out until you have an understand of what the real
problem is...  I'm sad that the commit was approved w/o bothering to
attempt to figure out the problem...

> 2. /usr/src/sys/modules/aesni/../../crypto/aesni/aesencdec.h:30:23: error: 
> wmmintrin.h: No such file or directory
> and then a cascade of errors follow.

Sounds like you don't have the latest in-tree gcc... I've been
compiling the AES module w/ the in tree gcc for a while..  This is
w/ the changes in r255185...

> For now, I've sent a patch to re@ for approval to remove the 'aesni'
> module from the build if not using clang.  But the LINT build is
> still broken with /usr/bin/gcc.

I'll strongly object to this change...

> >   Replace .byte hard coded instructions w/ the proper instructions now
> >   that both clang and gcc support them...
> 
> Is this out-of-tree latest GCC that supports this?

Nope, in-tree...  Sounds like you haven't installed the latest version
of gcc in tree...

It could be a problem with a bad interaction w/ delete-old as glebius
added the wmmintrin.h header to the delete-old target in r255354...

I'll take a closer look at this in the morning, but next time please
attempt to contact the author before taking such actions...

-- 
  John-Mark Gurney  Voice: +1 415 225 5579

 "All that I will do, has been done, All that I have, has not."
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"