svn commit: r276175 - head/share/misc

2014-12-24 Thread Muhammad Moinur Rahman
Author: bofh (ports committer)
Date: Wed Dec 24 09:25:16 2014
New Revision: 276175
URL: https://svnweb.freebsd.org/changeset/base/276175

Log:
  Update Mentor and Mentee Information (bofh)
  
  Differential Revision:https://reviews.freebsd.org/D1363
  Reviewed by:  bapt
  Approved by:  bapt

Modified:
  head/share/misc/committers-ports.dot

Modified: head/share/misc/committers-ports.dot
==
--- head/share/misc/committers-ports.dotWed Dec 24 07:04:04 2014
(r276174)
+++ head/share/misc/committers-ports.dotWed Dec 24 09:25:16 2014
(r276175)
@@ -67,6 +67,7 @@ beech [label="Beech Rintoul\nbeech@FreeB
 bf [label="Brendan Fabeny\n...@freebsd.org\n2010/06/02"]
 bland [label="Alexander Nedotsukov\nbl...@freebsd.org\n2003/08/14"]
 bmah [label="Bruce A. Mah\nb...@freebsd.org\n2000/08/23"]
+bofh [label="Muhammad Moinur Rahman\b...@freebsd.org\n2014/12/23"]
 brix [label="Henrik Brix Andersen\nb...@freebsd.org\n2007/10/31"]
 brooks [label="Brooks Davies\nbro...@freebsd.org\n2004/05/03"]
 bsam [label="Boris Samorodov\nb...@freebsd.org\n2006/07/20"]
@@ -263,6 +264,7 @@ bdrewery -> sbruno
 bdrewery -> trociny
 
 bapt -> bdrewery
+bapt -> bofh
 bapt -> eadler
 bapt -> grembo
 bapt -> jlaffaye
@@ -430,6 +432,7 @@ marcus -> bland
 marcus -> eik
 marcus -> jmallett
 
+marino -> bofh
 marino -> robak
 
 makc -> alonso
___
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: r276176 - head/lib/msun/src

2014-12-24 Thread Ed Schouten
Author: ed
Date: Wed Dec 24 10:13:53 2014
New Revision: 276176
URL: https://svnweb.freebsd.org/changeset/base/276176

Log:
  Clarify to explain that C99 conforming compilers don't need CMPLX*().
  
  Discussed with: kargl@

Modified:
  head/lib/msun/src/math_private.h

Modified: head/lib/msun/src/math_private.h
==
--- head/lib/msun/src/math_private.hWed Dec 24 09:25:16 2014
(r276175)
+++ head/lib/msun/src/math_private.hWed Dec 24 10:13:53 2014
(r276176)
@@ -456,9 +456,8 @@ typedef union {
  * to -0.0+I*0.0.
  *
  * The C11 standard introduced the macros CMPLX(), CMPLXF() and CMPLXL()
- * to construct complex values. The functions below are modelled after
- * these macros, with the exception that they cannot be used to
- * construct compile-time complex values.
+ * to construct complex values.  Compilers that conform to the C99
+ * standard require the following functions to avoid the above issues.
  */
 
 #ifndef CMPLXF
___
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: r276177 - in head/sys/arm: conf freescale/imx

2014-12-24 Thread Andrew Turner
Author: andrew
Date: Wed Dec 24 12:26:43 2014
New Revision: 276177
URL: https://svnweb.freebsd.org/changeset/base/276177

Log:
  Switch i.MX to use the platform code to help with a single Freescale kernel.
  
  Differential Revision:https://reviews.freebsd.org/D1349
  Reviewed by:  ian, rpaulo

Modified:
  head/sys/arm/conf/EFIKA_MX
  head/sys/arm/conf/IMX53
  head/sys/arm/conf/IMX6
  head/sys/arm/freescale/imx/imx51_machdep.c
  head/sys/arm/freescale/imx/imx53_machdep.c
  head/sys/arm/freescale/imx/imx6_machdep.c

Modified: head/sys/arm/conf/EFIKA_MX
==
--- head/sys/arm/conf/EFIKA_MX  Wed Dec 24 10:13:53 2014(r276176)
+++ head/sys/arm/conf/EFIKA_MX  Wed Dec 24 12:26:43 2014(r276177)
@@ -59,6 +59,7 @@ options   SYSVMSG # SYSV-style message 
 optionsSYSVSEM # SYSV-style semaphores
 options_KPOSIX_PRIORITY_SCHEDULING # POSIX P1003_1B real-time 
extensions
 optionsKBD_INSTALL_CDEV# install a CDEV entry in /dev
+optionsPLATFORM
 optionsINCLUDE_CONFIG_FILE # Include this file in kernel
 optionsVFP # Enable floating point hardware support
 

Modified: head/sys/arm/conf/IMX53
==
--- head/sys/arm/conf/IMX53 Wed Dec 24 10:13:53 2014(r276176)
+++ head/sys/arm/conf/IMX53 Wed Dec 24 12:26:43 2014(r276177)
@@ -56,6 +56,7 @@ options   SYSVMSG # SYSV-style message 
 optionsSYSVSEM # SYSV-style semaphores
 options_KPOSIX_PRIORITY_SCHEDULING # POSIX P1003_1B real-time 
extensions
 optionsKBD_INSTALL_CDEV# install a CDEV entry in /dev
+optionsPLATFORM
 optionsINCLUDE_CONFIG_FILE # Include this file in kernel
 optionsVFP # Enable floating point hardware support
 

Modified: head/sys/arm/conf/IMX6
==
--- head/sys/arm/conf/IMX6  Wed Dec 24 10:13:53 2014(r276176)
+++ head/sys/arm/conf/IMX6  Wed Dec 24 12:26:43 2014(r276177)
@@ -53,6 +53,7 @@ options   SYSVSEM # SYSV-style semaphor
 options_KPOSIX_PRIORITY_SCHEDULING # POSIX P1003_1B real-time 
extensions
 optionsKBD_INSTALL_CDEV# install a CDEV entry in /dev
 optionsINCLUDE_CONFIG_FILE # Include this file in kernel
+optionsPLATFORM
 optionsFREEBSD_BOOT_LOADER # Process metadata passed from loader(8)
 optionsVFP # Enable floating point hardware support
 optionsSMP # Enable multiple cores

Modified: head/sys/arm/freescale/imx/imx51_machdep.c
==
--- head/sys/arm/freescale/imx/imx51_machdep.c  Wed Dec 24 10:13:53 2014
(r276176)
+++ head/sys/arm/freescale/imx/imx51_machdep.c  Wed Dec 24 12:26:43 2014
(r276177)
@@ -39,36 +39,28 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
-#include  
+#include  
 
 #include 
 
-vm_offset_t
-platform_lastaddr(void)
+#include "platform_if.h"
+
+static vm_offset_t
+imx51_lastaddr(platform_t plat)
 {
 
return (arm_devmap_lastaddr());
 }
 
-void
-platform_probe_and_attach(void)
+static int
+imx51_attach(platform_t plat)
 {
 
/* XXX - Get rid of this stuff soon. */
boothowto |= RB_VERBOSE|RB_MULTIPLE;
bootverbose = 1;
-}
-
-void
-platform_gpio_init(void)
-{
-
-}
-
-void
-platform_late_init(void)
-{
 
+   return (0);
 }
 
 /*
@@ -78,8 +70,8 @@ platform_late_init(void)
  *
  * Notably missing are entries for GPU, IPU, in general anything video related.
  */
-int
-platform_devmap_init(void)
+static int
+imx51_devmap_init(platform_t plat)
 {
 
arm_devmap_add_entry(0x7000, 0x0010);
@@ -101,3 +93,12 @@ u_int imx_soc_type()
return (IMXSOC_51);
 }
 
+static platform_method_t imx51_methods[] = {
+   PLATFORMMETHOD(platform_attach, imx51_attach),
+   PLATFORMMETHOD(platform_devmap_init,imx51_devmap_init),
+   PLATFORMMETHOD(platform_lastaddr,   imx51_lastaddr),
+
+   PLATFORMMETHOD_END,
+};
+
+FDT_PLATFORM_DEF(imx51, "i.MX51", 0, "fsl,imx51");

Modified: head/sys/arm/freescale/imx/imx53_machdep.c
==
--- head/sys/arm/freescale/imx/imx53_machdep.c  Wed Dec 24 10:13:53 2014
(r276176)
+++ head/sys/arm/freescale/imx/imx53_machdep.c  Wed Dec 24 12:26:43 2014
(r276177)
@@ -39,36 +39,28 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
-#include  
+#include  
 
 #include 
 
-vm_offset_t
-platform_lastaddr(void)
+#include "platform_if.h"
+
+static vm_offset_t
+imx53_lastaddr(platform_t plat)
 {
 
return (arm_devmap_lastadd

svn commit: r276178 - head/share/misc

2014-12-24 Thread Muhammad Moinur Rahman
Author: bofh (ports committer)
Date: Wed Dec 24 13:25:22 2014
New Revision: 276178
URL: https://svnweb.freebsd.org/changeset/base/276178

Log:
  Fix missing \n in committers-ports.dot while adding myself
  
  Differential Revision:https://reviews.freebsd.org/D1365
  Submitted by: danfe
  Approved by:  bapt(mentor)

Modified:
  head/share/misc/committers-ports.dot

Modified: head/share/misc/committers-ports.dot
==
--- head/share/misc/committers-ports.dotWed Dec 24 12:26:43 2014
(r276177)
+++ head/share/misc/committers-ports.dotWed Dec 24 13:25:22 2014
(r276178)
@@ -67,7 +67,7 @@ beech [label="Beech Rintoul\nbeech@FreeB
 bf [label="Brendan Fabeny\n...@freebsd.org\n2010/06/02"]
 bland [label="Alexander Nedotsukov\nbl...@freebsd.org\n2003/08/14"]
 bmah [label="Bruce A. Mah\nb...@freebsd.org\n2000/08/23"]
-bofh [label="Muhammad Moinur Rahman\b...@freebsd.org\n2014/12/23"]
+bofh [label="Muhammad Moinur Rahman\nb...@freebsd.org\n2014/12/23"]
 brix [label="Henrik Brix Andersen\nb...@freebsd.org\n2007/10/31"]
 brooks [label="Brooks Davies\nbro...@freebsd.org\n2004/05/03"]
 bsam [label="Boris Samorodov\nb...@freebsd.org\n2006/07/20"]
___
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: r276180 - in head/sys/arm: arm include mv

2014-12-24 Thread Andrew Turner
Author: andrew
Date: Wed Dec 24 15:25:18 2014
New Revision: 276180
URL: https://svnweb.freebsd.org/changeset/base/276180

Log:
  Rename pic_ipi_get to pic_ipi_read for intrng.

Modified:
  head/sys/arm/arm/gic.c
  head/sys/arm/arm/mp_machdep.c
  head/sys/arm/include/smp.h
  head/sys/arm/mv/mpic.c

Modified: head/sys/arm/arm/gic.c
==
--- head/sys/arm/arm/gic.c  Wed Dec 24 13:49:40 2014(r276179)
+++ head/sys/arm/arm/gic.c  Wed Dec 24 15:25:18 2014(r276180)
@@ -436,7 +436,7 @@ pic_ipi_send(cpuset_t cpus, u_int ipi)
 }
 
 int
-pic_ipi_get(int i)
+pic_ipi_read(int i)
 {
 
if (i != -1) {

Modified: head/sys/arm/arm/mp_machdep.c
==
--- head/sys/arm/arm/mp_machdep.c   Wed Dec 24 13:49:40 2014
(r276179)
+++ head/sys/arm/arm/mp_machdep.c   Wed Dec 24 15:25:18 2014
(r276180)
@@ -266,7 +266,7 @@ ipi_handler(void *arg)
 
cpu = PCPU_GET(cpuid);
 
-   ipi = pic_ipi_get((int)arg);
+   ipi = pic_ipi_read((int)arg);
 
while ((ipi != 0x3ff)) {
switch (ipi) {
@@ -329,7 +329,7 @@ ipi_handler(void *arg)
}
 
pic_ipi_clear(ipi);
-   ipi = pic_ipi_get(-1);
+   ipi = pic_ipi_read(-1);
}
 
return (FILTER_HANDLED);

Modified: head/sys/arm/include/smp.h
==
--- head/sys/arm/include/smp.h  Wed Dec 24 13:49:40 2014(r276179)
+++ head/sys/arm/include/smp.h  Wed Dec 24 15:25:18 2014(r276180)
@@ -24,7 +24,7 @@ void  ipi_selected(cpuset_t cpus, u_int i
 /* PIC interface */
 void   pic_ipi_send(cpuset_t cpus, u_int ipi);
 void   pic_ipi_clear(int ipi);
-intpic_ipi_get(int arg);
+intpic_ipi_read(int arg);
 
 /* Platform interface */
 void   platform_mp_setmaxid(void);

Modified: head/sys/arm/mv/mpic.c
==
--- head/sys/arm/mv/mpic.c  Wed Dec 24 13:49:40 2014(r276179)
+++ head/sys/arm/mv/mpic.c  Wed Dec 24 15:25:18 2014(r276180)
@@ -375,7 +375,7 @@ pic_ipi_send(cpuset_t cpus, u_int ipi)
 }
 
 int
-pic_ipi_get(int i __unused)
+pic_ipi_read(int i __unused)
 {
uint32_t val;
 
___
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: r276187 - head/sys/arm/arm

2014-12-24 Thread Ian Lepore
Author: ian
Date: Wed Dec 24 17:12:51 2014
New Revision: 276187
URL: https://svnweb.freebsd.org/changeset/base/276187

Log:
  Eliminate unnecessary references to pte.h internals by using the standard
  pmap_kenter_temporary() to map pages while dumping.
  
  Submitted by: Svatopluk Kraus ,
Michal Meloun 

Modified:
  head/sys/arm/arm/dump_machdep.c

Modified: head/sys/arm/arm/dump_machdep.c
==
--- head/sys/arm/arm/dump_machdep.c Wed Dec 24 16:11:15 2014
(r276186)
+++ head/sys/arm/arm/dump_machdep.c Wed Dec 24 17:12:51 2014
(r276187)
@@ -160,11 +160,13 @@ static int
 cb_dumpdata(struct md_pa *mdp, int seqnr, void *arg)
 {
struct dumperinfo *di = (struct dumperinfo*)arg;
-   vm_paddr_t pa;
+   vm_paddr_t a, pa;
+   void *va;
uint32_t pgs;
size_t counter, sz, chunk;
-   int c, error;
+   int i, c, error;
 
+   va = 0;
error = 0;  /* catch case in which chunk size is 0 */
counter = 0;
pgs = mdp->md_size / PAGE_SIZE;
@@ -194,16 +196,14 @@ cb_dumpdata(struct md_pa *mdp, int seqnr
printf(" %d", pgs * PAGE_SIZE);
counter &= (1<<24) - 1;
}
-   if (pa == (pa & L1_ADDR_BITS)) {
-   pmap_kenter_section(0, pa & L1_ADDR_BITS, 0);
-   cpu_tlb_flushID_SE(0);
-   cpu_cpwait();
+   for (i = 0; i < chunk; i++) {
+   a = pa + i * PAGE_SIZE;
+   va = pmap_kenter_temporary(trunc_page(a), i);
}
 #ifdef SW_WATCHDOG
wdog_kern_pat(WD_LASTVAL);
 #endif
-   error = dump_write(di,
-   (void *)(pa - (pa & L1_ADDR_BITS)),0, dumplo, sz);
+   error = dump_write(di, va, 0, dumplo, sz);
if (error)
break;
dumplo += sz;
___
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: r276188 - head/sys/netipsec

2014-12-24 Thread Andrey V. Elsukov
Author: ae
Date: Wed Dec 24 18:34:56 2014
New Revision: 276188
URL: https://svnweb.freebsd.org/changeset/base/276188

Log:
  Rename ip4_def_policy variable to def_policy. It is used by both IPv4 and
  IPv6. Initialize it only once in def_policy_init(). Remove its
  initialization from key_init() and make it static.
  
  Remove several fields from struct secpolicy:
  * lock - it isn't so useful having mutex in the structure, but the only
thing we do with it is initialization and destroying.
  * state - it has only two values - DEAD and ALIVE. Instead of take a lock
and change the state to DEAD, then take lock again in GC function and
delete policy from the chain - keep in the chain only ALIVE policies.
  * scangen - it was used in GC function to protect from sending several
SADB_SPDEXPIRE messages for one SPD entry. Now we don't keep DEAD entries
in the chain and there is no need to have scangen variable.
  
  Use TAILQ to implement SPD entries chain. Use rmlock to protect access
  to SPD entries chain. Protect all SP lookup with RLOCK, and use WLOCK
  when we are inserting (or removing) SP entry in the chain.
  
  Instead of using pattern "LOCK(); refcnt++; UNLOCK();", use refcount(9)
  API to implement refcounting in SPD. Merge code from key_delsp() and
  _key_delsp() into _key_freesp(). And use KEY_FREESP() macro in all cases
  when we want to release reference or just delete SP entry.
  
  Obtained from:Yandex LLC
  Sponsored by: Yandex LLC

Modified:
  head/sys/netipsec/ipsec.c
  head/sys/netipsec/ipsec.h
  head/sys/netipsec/key.c
  head/sys/netipsec/key_debug.c

Modified: head/sys/netipsec/ipsec.c
==
--- head/sys/netipsec/ipsec.c   Wed Dec 24 17:12:51 2014(r276187)
+++ head/sys/netipsec/ipsec.c   Wed Dec 24 18:34:56 2014(r276188)
@@ -118,11 +118,12 @@ VNET_DEFINE(int, ip4_esp_trans_deflev) =
 VNET_DEFINE(int, ip4_esp_net_deflev) = IPSEC_LEVEL_USE;
 VNET_DEFINE(int, ip4_ah_trans_deflev) = IPSEC_LEVEL_USE;
 VNET_DEFINE(int, ip4_ah_net_deflev) = IPSEC_LEVEL_USE;
-VNET_DEFINE(struct secpolicy, ip4_def_policy);
 /* ECN ignore(-1)/forbidden(0)/allowed(1) */
 VNET_DEFINE(int, ip4_ipsec_ecn) = 0;
 VNET_DEFINE(int, ip4_esp_randpad) = -1;
 
+static VNET_DEFINE(struct secpolicy, def_policy);
+#defineV_def_policyVNET(def_policy)
 /*
  * Crypto support requirements:
  *
@@ -141,7 +142,7 @@ SYSCTL_DECL(_net_inet_ipsec);
 
 /* net.inet.ipsec */
 SYSCTL_INT(_net_inet_ipsec, IPSECCTL_DEF_POLICY, def_policy,
-   CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(ip4_def_policy).policy, 0,
+   CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(def_policy).policy, 0,
"IPsec default policy.");
 SYSCTL_INT(_net_inet_ipsec, IPSECCTL_DEF_ESP_TRANSLEV, esp_trans_deflev,
CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(ip4_esp_trans_deflev), 0,
@@ -213,7 +214,7 @@ SYSCTL_DECL(_net_inet6_ipsec6);
 
 /* net.inet6.ipsec6 */
 SYSCTL_INT(_net_inet6_ipsec6, IPSECCTL_DEF_POLICY, def_policy,
-   CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(ip4_def_policy).policy, 0,
+   CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(def_policy).policy, 0,
"IPsec default policy.");
 SYSCTL_INT(_net_inet6_ipsec6, IPSECCTL_DEF_ESP_TRANSLEV, esp_trans_deflev,
CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(ip6_esp_trans_deflev), 0,
@@ -262,7 +263,7 @@ key_allocsp_default(const char* where, i
KEYDEBUG(KEYDEBUG_IPSEC_STAMP,
printf("DP key_allocsp_default from %s:%u\n", where, tag));
 
-   sp = &V_ip4_def_policy;
+   sp = &V_def_policy;
if (sp->policy != IPSEC_POLICY_DISCARD &&
sp->policy != IPSEC_POLICY_NONE) {
ipseclog((LOG_INFO, "fixed system default policy: %d->%d\n",
@@ -828,17 +829,13 @@ ipsec_init_policy(struct socket *so, str
ipsec_delpcbpolicy(new);
return (ENOBUFS);
}
-   new->sp_in->state = IPSEC_SPSTATE_ALIVE;
new->sp_in->policy = IPSEC_POLICY_ENTRUST;
-
if ((new->sp_out = KEY_NEWSP()) == NULL) {
KEY_FREESP(&new->sp_in);
ipsec_delpcbpolicy(new);
return (ENOBUFS);
}
-   new->sp_out->state = IPSEC_SPSTATE_ALIVE;
new->sp_out->policy = IPSEC_POLICY_ENTRUST;
-
*pcb_sp = new;
 
return (0);
@@ -927,7 +924,6 @@ ipsec_deepcopy_policy(struct secpolicy *
}
 
dst->req = newchain;
-   dst->state = src->state;
dst->policy = src->policy;
/* Do not touch the refcnt fields. */
 
@@ -979,8 +975,6 @@ ipsec_set_policy_internal(struct secpoli
if ((newsp = key_msg2sp(xpl, len, &error)) == NULL)
return (error);
 
-   newsp->state = IPSEC_SPSTATE_ALIVE;
-
/* Clear old SP and set new SP. */
KEY_FREESP(pcb_sp);
*pcb_sp = newsp;
@@ -1693,14 +1687,15 @@ ipsec_dumpmbuf(struct mbuf *m)
 }
 
 static void
-ipsec_init(const void *unused __unused)
+def_policy_init(const 

svn commit: r276189 - head/release/arm

2014-12-24 Thread Ed Maste
Author: emaste
Date: Wed Dec 24 18:51:25 2014
New Revision: 276189
URL: https://svnweb.freebsd.org/changeset/base/276189

Log:
  Build gperf before gcc
  
  The ARM image builds build the in-tree gcc in order to build u-boot
  and gperf is needed to build gcc, but is no longer installed on archs
  that use clang.
  
  Invoking the make targets as separate steps is done to work around
  a build failure which is not yet fully understood.
  
  Reviewed by:  gjb, imp
  Sponsored by: The FreeBSD Foundation
  Differential Revision: https://reviews.freebsd.org/D1317

Modified:
  head/release/arm/release.sh

Modified: head/release/arm/release.sh
==
--- head/release/arm/release.sh Wed Dec 24 18:34:56 2014(r276188)
+++ head/release/arm/release.sh Wed Dec 24 18:51:25 2014(r276189)
@@ -127,6 +127,14 @@ main() {
BATCH=1 FORCE_PKG_REGISTER=1 install clean distclean
done
 
+   # Certain u-boot versions hardcode the use of a host gcc, and gcc's
+   # build relies on having gperf installed.
+   eval chroot ${CHROOTDIR} make -C /usr/src/gnu/usr.bin/gperf \
+   WITH_GCC=1 ${WORLD_FLAGS} obj
+   eval chroot ${CHROOTDIR} make -C /usr/src/gnu/usr.bin/gperf \
+   WITH_GCC=1 ${WORLD_FLAGS} -j1 depend all
+   eval chroot ${CHROOTDIR} make -C /usr/src/gnu/usr.bin/gperf \
+   WITH_GCC=1 ${WORLD_FLAGS} -j1 install
eval chroot ${CHROOTDIR} make -C /usr/src/gnu/usr.bin/cc \
WITH_GCC=1 ${WORLD_FLAGS} -j1 obj depend all install
 
___
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: r276190 - in head: gnu/usr.bin/gdb/kgdb sys/arm/arm sys/arm/include

2014-12-24 Thread Ian Lepore
Author: ian
Date: Wed Dec 24 18:54:31 2014
New Revision: 276190
URL: https://svnweb.freebsd.org/changeset/base/276190

Log:
  Cleanup up ARM *frame structures...
  
   - Eliminate unused irqframe
   - Eliminate unused saframe
   - Instead of splitting r4-sp storage between the stack and switchframe,
 just put all the registers in switchframe and eliminate the un_32 struct.
  
  Submitted by: Svatopluk Kraus ,
Michal Meloun 

Modified:
  head/gnu/usr.bin/gdb/kgdb/trgt_arm.c
  head/sys/arm/arm/db_trace.c
  head/sys/arm/arm/gdb_machdep.c
  head/sys/arm/arm/genassym.c
  head/sys/arm/arm/machdep.c
  head/sys/arm/arm/stack_machdep.c
  head/sys/arm/arm/swtch.S
  head/sys/arm/arm/trap.c
  head/sys/arm/arm/vm_machdep.c
  head/sys/arm/include/db_machdep.h
  head/sys/arm/include/frame.h
  head/sys/arm/include/pcb.h

Modified: head/gnu/usr.bin/gdb/kgdb/trgt_arm.c
==
--- head/gnu/usr.bin/gdb/kgdb/trgt_arm.cWed Dec 24 18:51:25 2014
(r276189)
+++ head/gnu/usr.bin/gdb/kgdb/trgt_arm.cWed Dec 24 18:54:31 2014
(r276190)
@@ -72,20 +72,12 @@ kgdb_trgt_fetch_registers(int regno __un
warnx("kvm_read: %s", kvm_geterr(kvm));
memset(&pcb, 0, sizeof(pcb));
}
-   for (i = ARM_A1_REGNUM + 8; i <= ARM_SP_REGNUM; i++) {
-   supply_register(i, (char *)&pcb.un_32.pcb32_r8 +
-   (i - (ARM_A1_REGNUM + 8 )) * 4);
-   }
-   if (pcb.un_32.pcb32_sp != 0) {
-   for (i = 0; i < 4; i++) {
-   if (kvm_read(kvm, pcb.un_32.pcb32_sp + (i) * 4,
-   ®, 4) != 4) {
-   warnx("kvm_read: %s", kvm_geterr(kvm));
-   break;
-   }
-   supply_register(ARM_A1_REGNUM + 4 + i, (char *)®);
-   }
-   if (kvm_read(kvm, pcb.un_32.pcb32_sp + 4 * 4, ®, 4) != 4)
+   for (i = ARM_A1_REGNUM + 4; i <= ARM_SP_REGNUM; i++) {
+   supply_register(i, (char *)&pcb.pcb_regs.sf_r4 +
+   (i - (ARM_A1_REGNUM + 4 )) * 4);
+   }
+   if (pcb.pcb_regs.sf_sp != 0) {
+   if (kvm_read(kvm, pcb.pcb_regs.sf_sp + 4 * 4, ®, 4) != 4)
warnx("kvm_read :%s", kvm_geterr(kvm));
else
supply_register(ARM_PC_REGNUM, (char *)®);

Modified: head/sys/arm/arm/db_trace.c
==
--- head/sys/arm/arm/db_trace.c Wed Dec 24 18:51:25 2014(r276189)
+++ head/sys/arm/arm/db_trace.c Wed Dec 24 18:54:31 2014(r276190)
@@ -609,14 +609,14 @@ db_trace_thread(struct thread *thr, int 
ctx = kdb_thr_ctx(thr);
 
 #ifdef __ARM_EABI__
-   state.registers[FP] = ctx->un_32.pcb32_r11;
-   state.registers[SP] = ctx->un_32.pcb32_sp;
-   state.registers[LR] = ctx->un_32.pcb32_lr;
-   state.registers[PC] = ctx->un_32.pcb32_pc;
+   state.registers[FP] = ctx->pcb_regs.sf_r11;
+   state.registers[SP] = ctx->pcb_regs.sf_sp;
+   state.registers[LR] = ctx->pcb_regs.sf_lr;
+   state.registers[PC] = ctx->pcb_regs.sf_pc;
 
db_stack_trace_cmd(&state);
 #else
-   db_stack_trace_cmd(ctx->un_32.pcb32_r11, -1, TRUE);
+   db_stack_trace_cmd(ctx->pcb_regs.sf_r11, -1, TRUE);
 #endif
} else
db_trace_self();

Modified: head/sys/arm/arm/gdb_machdep.c
==
--- head/sys/arm/arm/gdb_machdep.c  Wed Dec 24 18:51:25 2014
(r276189)
+++ head/sys/arm/arm/gdb_machdep.c  Wed Dec 24 18:54:31 2014
(r276190)
@@ -67,22 +67,26 @@ gdb_cpu_getreg(int regnum, size_t *regsz
}
 
switch (regnum) {
-   case 8:  return (&kdb_thrctx->un_32.pcb32_r8);
-   case 9:  return (&kdb_thrctx->un_32.pcb32_r9);
-   case 10:  return (&kdb_thrctx->un_32.pcb32_r10);
-   case 11:  return (&kdb_thrctx->un_32.pcb32_r11);
-   case 12:  return (&kdb_thrctx->un_32.pcb32_r12);
-   case 13:  stacktest = kdb_thrctx->un_32.pcb32_sp + 5 * 4;
+   case 4:  return (&kdb_thrctx->pcb_regs.sf_r4);
+   case 5:  return (&kdb_thrctx->pcb_regs.sf_r5);
+   case 6:  return (&kdb_thrctx->pcb_regs.sf_r6);
+   case 7:  return (&kdb_thrctx->pcb_regs.sf_r7);
+   case 8:  return (&kdb_thrctx->pcb_regs.sf_r8);
+   case 9:  return (&kdb_thrctx->pcb_regs.sf_r9);
+   case 10:  return (&kdb_thrctx->pcb_regs.sf_r10);
+   case 11:  return (&kdb_thrctx->pcb_regs.sf_r11);
+   case 12:  return (&kdb_thrctx->pcb_regs.sf_r12);
+   case 13:  stacktest = kdb_thrctx->pcb_regs.sf_sp + 5 * 4;
  return (&stacktest);
case 15:
  /*
   * On context switch, the PC 

svn commit: r276191 - head/sys/arm/arm

2014-12-24 Thread Ian Lepore
Author: ian
Date: Wed Dec 24 19:47:50 2014
New Revision: 276191
URL: https://svnweb.freebsd.org/changeset/base/276191

Log:
  Display the correct value for cache Level of Coherency.  Like the other
  levels being displayed here, its value needs a +1 adjustment.

Modified:
  head/sys/arm/arm/identcpu.c

Modified: head/sys/arm/arm/identcpu.c
==
--- head/sys/arm/arm/identcpu.c Wed Dec 24 18:54:31 2014(r276190)
+++ head/sys/arm/arm/identcpu.c Wed Dec 24 19:47:50 2014(r276191)
@@ -457,7 +457,7 @@ identify_arm_cpu(void)
 
if (arm_cache_level) {
printf("LoUU:%d LoC:%d LoUIS:%d \n", 
CPU_CLIDR_LOUU(arm_cache_level) + 1,
-   arm_cache_loc, CPU_CLIDR_LOUIS(arm_cache_level) + 1);
+   arm_cache_loc + 1, CPU_CLIDR_LOUIS(arm_cache_level) + 1);
i = 0;
while (((type = CPU_CLIDR_CTYPE(arm_cache_level, i)) != 0) && i 
< 7) {
printf("Cache level %d: \n", i + 1);
___
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: r276187 - head/sys/arm/arm

2014-12-24 Thread Andrew Turner
On Wed, 24 Dec 2014 17:12:52 + (UTC)
Ian Lepore  wrote:

> Author: ian
> Date: Wed Dec 24 17:12:51 2014
> New Revision: 276187
> URL: https://svnweb.freebsd.org/changeset/base/276187
> 
> Log:
>   Eliminate unnecessary references to pte.h internals by using the
> standard pmap_kenter_temporary() to map pages while dumping.
>   
>   Submitted by:   Svatopluk Kraus ,
>   Michal Meloun 
> 
> Modified:
>   head/sys/arm/arm/dump_machdep.c
> 
> Modified: head/sys/arm/arm/dump_machdep.c
> ==
> --- head/sys/arm/arm/dump_machdep.c   Wed Dec 24 16:11:15
> 2014  (r276186) +++ head/sys/arm/arm/dump_machdep.c   Wed
> Dec 24 17:12:51 2014  (r276187) @@ -160,11 +160,13 @@ static int
>  cb_dumpdata(struct md_pa *mdp, int seqnr, void *arg)
>  {
>   struct dumperinfo *di = (struct dumperinfo*)arg;
> - vm_paddr_t pa;
> + vm_paddr_t a, pa;
> + void *va;
>   uint32_t pgs;
>   size_t counter, sz, chunk;
> - int c, error;
> + int i, c, error;
>  
> + va = 0;
>   error = 0;  /* catch case in which chunk size is 0 */
>   counter = 0;
>   pgs = mdp->md_size / PAGE_SIZE;
> @@ -194,16 +196,14 @@ cb_dumpdata(struct md_pa *mdp, int seqnr
>   printf(" %d", pgs * PAGE_SIZE);
>   counter &= (1<<24) - 1;
>   }
> - if (pa == (pa & L1_ADDR_BITS)) {
> - pmap_kenter_section(0, pa & L1_ADDR_BITS, 0);
> - cpu_tlb_flushID_SE(0);
> - cpu_cpwait();
> + for (i = 0; i < chunk; i++) {
> + a = pa + i * PAGE_SIZE;
> + va = pmap_kenter_temporary(trunc_page(a), i);

Is this correct? It may map multiple chunks here.
>   }
>  #ifdef SW_WATCHDOG
>   wdog_kern_pat(WD_LASTVAL);
>  #endif
> - error = dump_write(di,
> - (void *)(pa - (pa & L1_ADDR_BITS)),0, dumplo,
> sz);
> + error = dump_write(di, va, 0, dumplo, sz);

Then uses the last virtual address to dump the data here. Wouldn't this
miss the chunks mapped other than the last one?

Andrew
___
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: r276187 - head/sys/arm/arm

2014-12-24 Thread Ian Lepore
On Wed, 2014-12-24 at 22:26 +, Andrew Turner wrote:
> On Wed, 24 Dec 2014 17:12:52 + (UTC)
> Ian Lepore  wrote:
> 
> > Author: ian
> > Date: Wed Dec 24 17:12:51 2014
> > New Revision: 276187
> > URL: https://svnweb.freebsd.org/changeset/base/276187
> > 
> > Log:
> >   Eliminate unnecessary references to pte.h internals by using the
> > standard pmap_kenter_temporary() to map pages while dumping.
> >   
> >   Submitted by: Svatopluk Kraus ,
> > Michal Meloun 
> > 
> > Modified:
> >   head/sys/arm/arm/dump_machdep.c
> > 
> > Modified: head/sys/arm/arm/dump_machdep.c
> > ==
> > --- head/sys/arm/arm/dump_machdep.c Wed Dec 24 16:11:15
> > 2014(r276186) +++ head/sys/arm/arm/dump_machdep.c   Wed
> > Dec 24 17:12:51 2014(r276187) @@ -160,11 +160,13 @@ static int
> >  cb_dumpdata(struct md_pa *mdp, int seqnr, void *arg)
> >  {
> > struct dumperinfo *di = (struct dumperinfo*)arg;
> > -   vm_paddr_t pa;
> > +   vm_paddr_t a, pa;
> > +   void *va;
> > uint32_t pgs;
> > size_t counter, sz, chunk;
> > -   int c, error;
> > +   int i, c, error;
> >  
> > +   va = 0;
> > error = 0;  /* catch case in which chunk size is 0 */
> > counter = 0;
> > pgs = mdp->md_size / PAGE_SIZE;
> > @@ -194,16 +196,14 @@ cb_dumpdata(struct md_pa *mdp, int seqnr
> > printf(" %d", pgs * PAGE_SIZE);
> > counter &= (1<<24) - 1;
> > }
> > -   if (pa == (pa & L1_ADDR_BITS)) {
> > -   pmap_kenter_section(0, pa & L1_ADDR_BITS, 0);
> > -   cpu_tlb_flushID_SE(0);
> > -   cpu_cpwait();
> > +   for (i = 0; i < chunk; i++) {
> > +   a = pa + i * PAGE_SIZE;
> > +   va = pmap_kenter_temporary(trunc_page(a), i);
> 
> Is this correct? It may map multiple chunks here.
> > }
> >  #ifdef SW_WATCHDOG
> > wdog_kern_pat(WD_LASTVAL);
> >  #endif
> > -   error = dump_write(di,
> > -   (void *)(pa - (pa & L1_ADDR_BITS)),0, dumplo,
> > sz);
> > +   error = dump_write(di, va, 0, dumplo, sz);
> 
> Then uses the last virtual address to dump the data here. Wouldn't this
> miss the chunks mapped other than the last one?

Yeah, but a quirk of pmap_kenter_temporary() is that its return value is
constant, so this wrong-looking code is actually right.

-- 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: r276192 - head/sys/kern

2014-12-24 Thread Rick Macklem
Author: rmacklem
Date: Wed Dec 24 22:58:08 2014
New Revision: 276192
URL: https://svnweb.freebsd.org/changeset/base/276192

Log:
  Modify vop_stdadvlock{async}() so that it only
  locks/unlocks the vnode and does a VOP_GETATTR()
  for the SEEK_END case. This is safe to do, since
  lf_advlock{async}() only uses the size argument
  for the SEEK_END case.
  The NFSv4 server needs this when
  vfs.nfsd.enable_locallocks!=0 since locking the
  vnode results in a LOR that can cause a deadlock
  for the nfsd threads.
  
  Reviewed by:  kib
  MFC after:1 week

Modified:
  head/sys/kern/vfs_default.c

Modified: head/sys/kern/vfs_default.c
==
--- head/sys/kern/vfs_default.c Wed Dec 24 19:47:50 2014(r276191)
+++ head/sys/kern/vfs_default.c Wed Dec 24 22:58:08 2014(r276192)
@@ -401,17 +401,23 @@ int
 vop_stdadvlock(struct vop_advlock_args *ap)
 {
struct vnode *vp;
-   struct ucred *cred;
struct vattr vattr;
int error;
 
vp = ap->a_vp;
-   cred = curthread->td_ucred;
-   vn_lock(vp, LK_SHARED | LK_RETRY);
-   error = VOP_GETATTR(vp, &vattr, cred);
-   VOP_UNLOCK(vp, 0);
-   if (error)
-   return (error);
+   if (ap->a_fl->l_whence == SEEK_END) {
+   /*
+* The NFSv4 server will LOR/deadlock if a vn_lock() call
+* is done on vp. Fortunately, vattr.va_size is only
+* needed for SEEK_END and the NFSv4 server only uses SEEK_SET.
+*/
+   vn_lock(vp, LK_SHARED | LK_RETRY);
+   error = VOP_GETATTR(vp, &vattr, curthread->td_ucred);
+   VOP_UNLOCK(vp, 0);
+   if (error)
+   return (error);
+   } else
+   vattr.va_size = 0;
 
return (lf_advlock(ap, &(vp->v_lockf), vattr.va_size));
 }
@@ -420,17 +426,19 @@ int
 vop_stdadvlockasync(struct vop_advlockasync_args *ap)
 {
struct vnode *vp;
-   struct ucred *cred;
struct vattr vattr;
int error;
 
vp = ap->a_vp;
-   cred = curthread->td_ucred;
-   vn_lock(vp, LK_SHARED | LK_RETRY);
-   error = VOP_GETATTR(vp, &vattr, cred);
-   VOP_UNLOCK(vp, 0);
-   if (error)
-   return (error);
+   if (ap->a_fl->l_whence == SEEK_END) {
+   /* The size argument is only needed for SEEK_END. */
+   vn_lock(vp, LK_SHARED | LK_RETRY);
+   error = VOP_GETATTR(vp, &vattr, curthread->td_ucred);
+   VOP_UNLOCK(vp, 0);
+   if (error)
+   return (error);
+   } else
+   vattr.va_size = 0;
 
return (lf_advlockasync(ap, &(vp->v_lockf), vattr.va_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"


Re: svn commit: r276187 - head/sys/arm/arm

2014-12-24 Thread Rui Paulo
On Dec 24, 2014, at 14:40, Ian Lepore  wrote:
> 
> On Wed, 2014-12-24 at 22:26 +, Andrew Turner wrote:
>> On Wed, 24 Dec 2014 17:12:52 + (UTC)
>> Ian Lepore  wrote:
>> 
>>> Author: ian
>>> Date: Wed Dec 24 17:12:51 2014
>>> New Revision: 276187
>>> URL: https://svnweb.freebsd.org/changeset/base/276187
>>> 
>>> Log:
>>>  Eliminate unnecessary references to pte.h internals by using the
>>> standard pmap_kenter_temporary() to map pages while dumping.
>>> 
>>>  Submitted by:  Svatopluk Kraus ,
>>> Michal Meloun 
>>> 
>>> Modified:
>>>  head/sys/arm/arm/dump_machdep.c
>>> 
>>> Modified: head/sys/arm/arm/dump_machdep.c
>>> ==
>>> --- head/sys/arm/arm/dump_machdep.c Wed Dec 24 16:11:15
>>> 2014(r276186) +++ head/sys/arm/arm/dump_machdep.c   Wed
>>> Dec 24 17:12:51 2014(r276187) @@ -160,11 +160,13 @@ static int
>>> cb_dumpdata(struct md_pa *mdp, int seqnr, void *arg)
>>> {
>>> struct dumperinfo *di = (struct dumperinfo*)arg;
>>> -   vm_paddr_t pa;
>>> +   vm_paddr_t a, pa;
>>> +   void *va;
>>> uint32_t pgs;
>>> size_t counter, sz, chunk;
>>> -   int c, error;
>>> +   int i, c, error;
>>> 
>>> +   va = 0;
>>> error = 0;  /* catch case in which chunk size is 0 */
>>> counter = 0;
>>> pgs = mdp->md_size / PAGE_SIZE;
>>> @@ -194,16 +196,14 @@ cb_dumpdata(struct md_pa *mdp, int seqnr
>>> printf(" %d", pgs * PAGE_SIZE);
>>> counter &= (1<<24) - 1;
>>> }
>>> -   if (pa == (pa & L1_ADDR_BITS)) {
>>> -   pmap_kenter_section(0, pa & L1_ADDR_BITS, 0);
>>> -   cpu_tlb_flushID_SE(0);
>>> -   cpu_cpwait();
>>> +   for (i = 0; i < chunk; i++) {
>>> +   a = pa + i * PAGE_SIZE;
>>> +   va = pmap_kenter_temporary(trunc_page(a), i);
>> 
>> Is this correct? It may map multiple chunks here.
>>> }
>>> #ifdef SW_WATCHDOG
>>> wdog_kern_pat(WD_LASTVAL);
>>> #endif
>>> -   error = dump_write(di,
>>> -   (void *)(pa - (pa & L1_ADDR_BITS)),0, dumplo,
>>> sz);
>>> +   error = dump_write(di, va, 0, dumplo, sz);
>> 
>> Then uses the last virtual address to dump the data here. Wouldn't this
>> miss the chunks mapped other than the last one?
> 
> Yeah, but a quirk of pmap_kenter_temporary() is that its return value is
> constant, so this wrong-looking code is actually right.

I'm a bit surprised about this.  This most likely warrants a comment.


--
Rui Paulo



___
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: r276187 - head/sys/arm/arm

2014-12-24 Thread Ian Lepore
On Wed, 2014-12-24 at 17:05 -0800, Rui Paulo wrote:
> On Dec 24, 2014, at 14:40, Ian Lepore  wrote:
> > 
> > On Wed, 2014-12-24 at 22:26 +, Andrew Turner wrote:
> >> On Wed, 24 Dec 2014 17:12:52 + (UTC)
> >> Ian Lepore  wrote:
> >> 
> >>> Author: ian
> >>> Date: Wed Dec 24 17:12:51 2014
> >>> New Revision: 276187
> >>> URL: https://svnweb.freebsd.org/changeset/base/276187
> >>> 
> >>> Log:
> >>>  Eliminate unnecessary references to pte.h internals by using the
> >>> standard pmap_kenter_temporary() to map pages while dumping.
> >>> 
> >>>  Submitted by:Svatopluk Kraus ,
> >>>   Michal Meloun 
> >>> 
> >>> Modified:
> >>>  head/sys/arm/arm/dump_machdep.c
> >>> 
> >>> Modified: head/sys/arm/arm/dump_machdep.c
> >>> ==
> >>> --- head/sys/arm/arm/dump_machdep.c   Wed Dec 24 16:11:15
> >>> 2014  (r276186) +++ head/sys/arm/arm/dump_machdep.c   Wed
> >>> Dec 24 17:12:51 2014  (r276187) @@ -160,11 +160,13 @@ static int
> >>> cb_dumpdata(struct md_pa *mdp, int seqnr, void *arg)
> >>> {
> >>>   struct dumperinfo *di = (struct dumperinfo*)arg;
> >>> - vm_paddr_t pa;
> >>> + vm_paddr_t a, pa;
> >>> + void *va;
> >>>   uint32_t pgs;
> >>>   size_t counter, sz, chunk;
> >>> - int c, error;
> >>> + int i, c, error;
> >>> 
> >>> + va = 0;
> >>>   error = 0;  /* catch case in which chunk size is 0 */
> >>>   counter = 0;
> >>>   pgs = mdp->md_size / PAGE_SIZE;
> >>> @@ -194,16 +196,14 @@ cb_dumpdata(struct md_pa *mdp, int seqnr
> >>>   printf(" %d", pgs * PAGE_SIZE);
> >>>   counter &= (1<<24) - 1;
> >>>   }
> >>> - if (pa == (pa & L1_ADDR_BITS)) {
> >>> - pmap_kenter_section(0, pa & L1_ADDR_BITS, 0);
> >>> - cpu_tlb_flushID_SE(0);
> >>> - cpu_cpwait();
> >>> + for (i = 0; i < chunk; i++) {
> >>> + a = pa + i * PAGE_SIZE;
> >>> + va = pmap_kenter_temporary(trunc_page(a), i);
> >> 
> >> Is this correct? It may map multiple chunks here.
> >>>   }
> >>> #ifdef SW_WATCHDOG
> >>>   wdog_kern_pat(WD_LASTVAL);
> >>> #endif
> >>> - error = dump_write(di,
> >>> - (void *)(pa - (pa & L1_ADDR_BITS)),0, dumplo,
> >>> sz);
> >>> + error = dump_write(di, va, 0, dumplo, sz);
> >> 
> >> Then uses the last virtual address to dump the data here. Wouldn't this
> >> miss the chunks mapped other than the last one?
> > 
> > Yeah, but a quirk of pmap_kenter_temporary() is that its return value is
> > constant, so this wrong-looking code is actually right.
> 
> I'm a bit surprised about this.  This most likely warrants a comment.

In every architecture and every place it's used, or just arm just here?
This appears to be an idiom, or at least something that has been pasted
in identical form in every arch so far.

-- 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: r276193 - head/sys/fs/nfsserver

2014-12-24 Thread Rick Macklem
Author: rmacklem
Date: Thu Dec 25 01:55:17 2014
New Revision: 276193
URL: https://svnweb.freebsd.org/changeset/base/276193

Log:
  A deadlock in the NFSv4 server with vfs.nfsd.enable_locallocks=1
  was reported via email. This was caused by a LOR between the
  sleep lock used to serialize the local locking (nfsrv_locklf())
  and locking the vnode. I believe this patch fixes the problem
  by delaying relocking of the vnode until the sleep lock is
  unlocked (nfsrv_unlocklf()). To avoid nfsvno_advlock() having the side
  effect of unlocking the vnode, unlocking the vnode was moved to before
  the functions that call nfsvno_advlock().
  It shouldn't affect the execution of the default case where
  vfs.nfsd.enable_locallocks=0.
  
  Reported by:  loic.b...@unix-experience.fr
  Discussed with:   kib
  MFC after:1 week

Modified:
  head/sys/fs/nfsserver/nfs_nfsdport.c
  head/sys/fs/nfsserver/nfs_nfsdstate.c

Modified: head/sys/fs/nfsserver/nfs_nfsdport.c
==
--- head/sys/fs/nfsserver/nfs_nfsdport.cWed Dec 24 22:58:08 2014
(r276192)
+++ head/sys/fs/nfsserver/nfs_nfsdport.cThu Dec 25 01:55:17 2014
(r276193)
@@ -2970,12 +2970,7 @@ nfsvno_advlock(struct vnode *vp, int fty
 
if (nfsrv_dolocallocks == 0)
goto out;
-
-   /* Check for VI_DOOMED here, so that VOP_ADVLOCK() isn't performed. */
-   if ((vp->v_iflag & VI_DOOMED) != 0) {
-   error = EPERM;
-   goto out;
-   }
+   ASSERT_VOP_UNLOCKED(vp, "nfsvno_advlock: vp locked");
 
fl.l_whence = SEEK_SET;
fl.l_type = ftype;
@@ -2999,14 +2994,12 @@ nfsvno_advlock(struct vnode *vp, int fty
fl.l_pid = (pid_t)0;
fl.l_sysid = (int)nfsv4_sysid;
 
-   NFSVOPUNLOCK(vp, 0);
if (ftype == F_UNLCK)
error = VOP_ADVLOCK(vp, (caddr_t)td->td_proc, F_UNLCK, &fl,
(F_POSIX | F_REMOTE));
else
error = VOP_ADVLOCK(vp, (caddr_t)td->td_proc, F_SETLK, &fl,
(F_POSIX | F_REMOTE));
-   NFSVOPLOCK(vp, LK_EXCLUSIVE | LK_RETRY);
 
 out:
NFSEXITCODE(error);

Modified: head/sys/fs/nfsserver/nfs_nfsdstate.c
==
--- head/sys/fs/nfsserver/nfs_nfsdstate.c   Wed Dec 24 22:58:08 2014
(r276192)
+++ head/sys/fs/nfsserver/nfs_nfsdstate.c   Thu Dec 25 01:55:17 2014
(r276193)
@@ -1344,6 +1344,8 @@ nfsrv_freeallnfslocks(struct nfsstate *s
vnode_t tvp = NULL;
uint64_t first, end;
 
+   if (vp != NULL)
+   ASSERT_VOP_UNLOCKED(vp, "nfsrv_freeallnfslocks: vnode locked");
lop = LIST_FIRST(&stp->ls_lock);
while (lop != LIST_END(&stp->ls_lock)) {
nlop = LIST_NEXT(lop, lo_lckowner);
@@ -1363,9 +1365,10 @@ nfsrv_freeallnfslocks(struct nfsstate *s
if (gottvp == 0) {
if (nfsrv_dolocallocks == 0)
tvp = NULL;
-   else if (vp == NULL && cansleep != 0)
+   else if (vp == NULL && cansleep != 0) {
tvp = nfsvno_getvp(&lfp->lf_fh);
-   else
+   NFSVOPUNLOCK(tvp, 0);
+   } else
tvp = vp;
gottvp = 1;
}
@@ -1386,7 +1389,7 @@ nfsrv_freeallnfslocks(struct nfsstate *s
lop = nlop;
}
if (vp == NULL && tvp != NULL)
-   vput(tvp);
+   vrele(tvp);
 }
 
 /*
@@ -1497,7 +1500,7 @@ nfsrv_lockctrl(vnode_t vp, struct nfssta
struct nfsclient *clp = NULL;
u_int32_t bits;
int error = 0, haslock = 0, ret, reterr;
-   int getlckret, delegation = 0, filestruct_locked;
+   int getlckret, delegation = 0, filestruct_locked, vnode_unlocked = 0;
fhandle_t nfh;
uint64_t first, end;
uint32_t lock_flags;
@@ -1587,6 +1590,11 @@ tryagain:
 * locking rolled back.
 */
NFSUNLOCKSTATE();
+   if (vnode_unlocked == 0) {
+   ASSERT_VOP_ELOCKED(vp, "nfsrv_lockctrl1");
+   vnode_unlocked = 1;
+   NFSVOPUNLOCK(vp, 0);
+   }
reterr = nfsrv_locallock(vp, lfp,
(new_lop->lo_flags & (NFSLCK_READ | NFSLCK_WRITE)),
new_lop->lo_first, new_lop->lo_end, cfp, p);
@@ -1756,6 +1764,11 @@ tryagain:
if (filestruct_locked != 0) {
/* Roll back local locks. */
NFSUNLOCKSTATE();
+   if (vnode_unlocked == 0) {
+   ASSERT_VOP_ELOCKED(vp, "nfsrv_lockctrl2");
+ 

Re: svn commit: r276187 - head/sys/arm/arm

2014-12-24 Thread Rui Paulo
On Dec 24, 2014, at 17:31, Ian Lepore  wrote:
> In every architecture and every place it's used, or just arm just here?

You're right, it can be found at least in MIPS and amd64.

> This appears to be an idiom, or at least something that has been pasted
> in identical form in every arch so far.

The idiom is a bit different in amd64: the variable in the for-loop isn't 
immediately reused, but it's a global variable anyway...  That's what I thought 
deserves a comment.

Regarding the pmap_kenter_temporary(), the first problem is the function name: 
it might be a temporary mapping, but the real use is for crash dumps (I wonder 
why ACPI abuses this mapping).  The other problem is the fact that a pmap 
function is so tied to crash dumps.  However, that's a bigger problem.

--
Rui Paulo



___
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: r276194 - head/cddl/contrib/opensolaris/cmd/zpool

2014-12-24 Thread Steven Hartland
Author: smh
Date: Thu Dec 25 02:17:17 2014
New Revision: 276194
URL: https://svnweb.freebsd.org/changeset/base/276194

Log:
  Prevent zpool upgrade failing due to unavailable pools
  
  Prior to this fix "zpool upgrade" and "zpool upgrade -a" would fail due to
  an assert when operating on unavailable pools.
  
  We now print a warning to stderr but allow the processing of other pools
  to procesed.
  
  MFC after:1 month

Modified:
  head/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c

Modified: head/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c
==
--- head/cddl/contrib/opensolaris/cmd/zpool/zpool_main.cThu Dec 25 
01:55:17 2014(r276193)
+++ head/cddl/contrib/opensolaris/cmd/zpool/zpool_main.cThu Dec 25 
02:17:17 2014(r276194)
@@ -4629,6 +4629,13 @@ upgrade_cb(zpool_handle_t *zhp, void *ar
boolean_t printnl = B_FALSE;
int ret;
 
+   if (zpool_get_state(zhp) == POOL_STATE_UNAVAIL) {
+   (void) fprintf(stderr, gettext("cannot upgrade '%s': pool is "
+   "currently unavailable\n\n"), zpool_get_name(zhp));
+   /* Allow iteration to continue. */
+   return (0);
+   }
+
config = zpool_get_config(zhp, NULL);
verify(nvlist_lookup_uint64(config, ZPOOL_CONFIG_VERSION,
&version) == 0);
@@ -4729,6 +4736,14 @@ upgrade_list_disabled_cb(zpool_handle_t 
nvlist_t *config;
uint64_t version;
 
+   if (zpool_get_state(zhp) == POOL_STATE_UNAVAIL) {
+   (void) fprintf(stderr, gettext("cannot check supported "
+   "features on '%s': pool is currently unavailable\n\n"),
+   zpool_get_name(zhp));
+   /* Allow iteration to continue. */
+   return (0);
+   }
+
config = zpool_get_config(zhp, NULL);
verify(nvlist_lookup_uint64(config, ZPOOL_CONFIG_VERSION,
&version) == 0);
___
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: r276195 - in head: . lib/libxo

2014-12-24 Thread Alfred Perlstein
Author: alfred
Date: Thu Dec 25 03:15:56 2014
New Revision: 276195
URL: https://svnweb.freebsd.org/changeset/base/276195

Log:
  Move libxo to /lib
  
  Update ObsoleteFiles to reflect libxo move.
  
  Reviewed by: ngie
  Differential Revision: https://reviews.freebsd.org/D1370

Modified:
  head/ObsoleteFiles.inc
  head/lib/libxo/Makefile

Modified: head/ObsoleteFiles.inc
==
--- head/ObsoleteFiles.inc  Thu Dec 25 02:17:17 2014(r276194)
+++ head/ObsoleteFiles.inc  Thu Dec 25 03:15:56 2014(r276195)
@@ -38,6 +38,9 @@
 #   xargs -n1 | sort | uniq -d;
 # done
 
+# 20141224: libxo moved to /lib
+OLD_FILES+=usr/lib/libxo.a
+OLD_FILES+=usr/lib/libxo_p.a
 # 20141223: remove in6_gif.h, in_gif.h and if_stf.h
 OLD_FILES+=usr/include/net/if_stf.h
 OLD_FILES+=usr/include/netinet/in_gif.h

Modified: head/lib/libxo/Makefile
==
--- head/lib/libxo/Makefile Thu Dec 25 02:17:17 2014(r276194)
+++ head/lib/libxo/Makefile Thu Dec 25 03:15:56 2014(r276195)
@@ -7,6 +7,8 @@ LIBXO=  ${.CURDIR:H:H}/contrib/libxo
 LIB=   xo
 SHLIB_MAJOR=0
 
+SHLIBDIR?=  /lib
+
 SRCS=  libxo.c
 
 CFLAGS+=-I${LIBXO}/libxo
___
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: r276196 - head/sys/arm/arm

2014-12-24 Thread Ian Lepore
Author: ian
Date: Thu Dec 25 03:41:56 2014
New Revision: 276196
URL: https://svnweb.freebsd.org/changeset/base/276196

Log:
  Change the style of the DO_AST macro to match the others in this file --
  semicolons between the code and comments instead of after the comments,
  and line continuations in the arbitrary but now consistant column 76.
  
  No functional changes.

Modified:
  head/sys/arm/arm/exception.S

Modified: head/sys/arm/arm/exception.S
==
--- head/sys/arm/arm/exception.SThu Dec 25 03:15:56 2014
(r276195)
+++ head/sys/arm/arm/exception.SThu Dec 25 03:41:56 2014
(r276196)
@@ -241,26 +241,26 @@ __FBSDID("$FreeBSD$");
 #defineUNWINDSVCFRAME
 #endif
 
-#defineDO_AST  
\
-   ldr r0, [sp]/* Get the SPSR from stack */   ;\
-   mrs r4, cpsr/* save CPSR */ ;\
-   orr r1, r4, #(PSR_I|PSR_F)  ;\
-   msr cpsr_c, r1  /* Disable interrupts */;\
-   and r0, r0, #(PSR_MODE) /* Returning to USR mode? */;\
-   teq r0, #(PSR_USR32_MODE)   ;\
-   bne 2f  /* Nope, get out now */ ;\
-   bic r4, r4, #(PSR_I|PSR_F)  ;\
-1: GET_CURTHREAD_PTR(r5)   ;\
-   ldr r1, [r5, #(TD_FLAGS)]   ;\
-   and r1, r1, #(TDF_ASTPENDING|TDF_NEEDRESCHED)   ;\
-   teq r1, #0x ;\
-   beq 2f  /* Nope. Just bail */   ;\
-   msr cpsr_c, r4  /* Restore interrupts */;\
-   mov r0, sp  ;\
-   bl  _C_LABEL(ast)   /* ast(frame) */;\
-   orr r0, r4, #(PSR_I|PSR_F)  ;\
-   msr cpsr_c, r0  ;\
-   b   1b  ;\
+#defineDO_AST  
   \
+   ldr r0, [sp];   /* Get the SPSR from stack */  \
+   mrs r4, cpsr;   /* save CPSR */\
+   orr r1, r4, #(PSR_I|PSR_F);\
+   msr cpsr_c, r1; /* Disable interrupts */   \
+   and r0, r0, #(PSR_MODE);/* Returning to USR mode? */   \
+   teq r0, #(PSR_USR32_MODE); \
+   bne 2f; /* Nope, get out now */\
+   bic r4, r4, #(PSR_I|PSR_F);\
+1: GET_CURTHREAD_PTR(r5); \
+   ldr r1, [r5, #(TD_FLAGS)]; \
+   and r1, r1, #(TDF_ASTPENDING|TDF_NEEDRESCHED); \
+   teq r1, #0;\
+   beq 2f; /* Nope. Just bail */  \
+   msr cpsr_c, r4; /* Restore interrupts */   \
+   mov r0, sp;\
+   bl  _C_LABEL(ast);  /* ast(frame) */   \
+   orr r0, r4, #(PSR_I|PSR_F);\
+   msr cpsr_c, r0;\
+   b   1b \
 2:
 
 
___
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: r276195 - in head: . lib/libxo

2014-12-24 Thread Garrett Cooper

> On Dec 24, 2014, at 19:15, Alfred Perlstein  wrote:
> 
> Author: alfred
> Date: Thu Dec 25 03:15:56 2014
> New Revision: 276195
> URL: https://svnweb.freebsd.org/changeset/base/276195
> 
> Log:
>  Move libxo to /lib
> 
>  Update ObsoleteFiles to reflect libxo move.
> 
>  Reviewed by: ngie
>  Differential Revision: https://reviews.freebsd.org/D1370
> 
> Modified:
>  head/ObsoleteFiles.inc
>  head/lib/libxo/Makefile
> 
> Modified: head/ObsoleteFiles.inc
> ==
> --- head/ObsoleteFiles.incThu Dec 25 02:17:17 2014(r276194)
> +++ head/ObsoleteFiles.incThu Dec 25 03:15:56 2014(r276195)
> @@ -38,6 +38,9 @@
> #   xargs -n1 | sort | uniq -d;
> # done
> 
> +# 20141224: libxo moved to /lib
> +OLD_FILES+=usr/lib/libxo.a
> +OLD_FILES+=usr/lib/libxo_p.a

This should actually be the .so file only. Static libraries are always in 
/usr/lib .

Sorry for not being explicit about this (I'm currently writing from the boonies 
so bandwidth is limited) :/.

> # 20141223: remove in6_gif.h, in_gif.h and if_stf.h
> OLD_FILES+=usr/include/net/if_stf.h
> OLD_FILES+=usr/include/netinet/in_gif.h
> 
> Modified: head/lib/libxo/Makefile
> ==
> --- head/lib/libxo/MakefileThu Dec 25 02:17:17 2014(r276194)
> +++ head/lib/libxo/MakefileThu Dec 25 03:15:56 2014(r276195)
> @@ -7,6 +7,8 @@ LIBXO=${.CURDIR:H:H}/contrib/libxo
> LIB=xo
> SHLIB_MAJOR=0
> 
> +SHLIBDIR?=  /lib
> +
> SRCS=libxo.c
> 
> CFLAGS+=-I${LIBXO}/libxo
> 
___
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: r276195 - in head: . lib/libxo

2014-12-24 Thread Alfred Perlstein


On 12/24/14 7:36 PM, Garrett Cooper wrote:

On Dec 24, 2014, at 19:15, Alfred Perlstein  wrote:

Author: alfred
Date: Thu Dec 25 03:15:56 2014
New Revision: 276195
URL: https://svnweb.freebsd.org/changeset/base/276195

Log:
  Move libxo to /lib

  Update ObsoleteFiles to reflect libxo move.

  Reviewed by: ngie
  Differential Revision: https://reviews.freebsd.org/D1370

Modified:
  head/ObsoleteFiles.inc
  head/lib/libxo/Makefile

Modified: head/ObsoleteFiles.inc
==
--- head/ObsoleteFiles.incThu Dec 25 02:17:17 2014(r276194)
+++ head/ObsoleteFiles.incThu Dec 25 03:15:56 2014(r276195)
@@ -38,6 +38,9 @@
#   xargs -n1 | sort | uniq -d;
# done

+# 20141224: libxo moved to /lib
+OLD_FILES+=usr/lib/libxo.a
+OLD_FILES+=usr/lib/libxo_p.a

This should actually be the .so file only. Static libraries are always in 
/usr/lib .

Sorry for not being explicit about this (I'm currently writing from the boonies 
so bandwidth is limited) :/.




I think the .so gets clobbered with a symlink, so it should be fine?

Meaning that after I moved the lib to /lib this is what I see in /usr/lib:
/usr/src/contrib/libxo % ls -l /usr/lib/libxo*
-r--r--r--  1 root  wheel  83764 Dec 24 19:31 /usr/lib/libxo.a
lrwxr-xr-x  1 root  wheel 15 Dec 24 19:31 /usr/lib/libxo.so -> 
/lib/libxo.so.0

-r--r--r--  1 root  wheel  95164 Dec 24 19:31 /usr/lib/libxo_p.a


Or should I reference it explicitly?

What is the end result here?



-Alfred

___
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: r276197 - head/sys/arm/arm

2014-12-24 Thread Ian Lepore
Author: ian
Date: Thu Dec 25 04:18:31 2014
New Revision: 276197
URL: https://svnweb.freebsd.org/changeset/base/276197

Log:
  Oops, I fumbled a semicolon on the style changes; recover it.

Modified:
  head/sys/arm/arm/exception.S

Modified: head/sys/arm/arm/exception.S
==
--- head/sys/arm/arm/exception.SThu Dec 25 03:41:56 2014
(r276196)
+++ head/sys/arm/arm/exception.SThu Dec 25 04:18:31 2014
(r276197)
@@ -260,7 +260,7 @@ __FBSDID("$FreeBSD$");
bl  _C_LABEL(ast);  /* ast(frame) */   \
orr r0, r4, #(PSR_I|PSR_F);\
msr cpsr_c, r0;\
-   b   1b \
+   b   1b;\
 2:
 
 
___
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: r276198 - head/sys/arm/include

2014-12-24 Thread Ian Lepore
Author: ian
Date: Thu Dec 25 04:41:43 2014
New Revision: 276198
URL: https://svnweb.freebsd.org/changeset/base/276198

Log:
  Remove _PROF_PROLOGUE from the EENTRY() macros.  These macros define
  'extra' entry points which are nested within or provide a synonym name
  for another function.  It's most likely not safe to be messing with the
  IP and LR registers at anything other than the primary entry point to a
  function.  Anywhere beyond initial function entry, those registers may
  be in use as scratch or variable registers.

Modified:
  head/sys/arm/include/asm.h

Modified: head/sys/arm/include/asm.h
==
--- head/sys/arm/include/asm.h  Thu Dec 25 04:18:31 2014(r276197)
+++ head/sys/arm/include/asm.h  Thu Dec 25 04:41:43 2014(r276198)
@@ -90,17 +90,17 @@
 #endif
 
 #defineENTRY(y)_ENTRY(_C_LABEL(y)); _PROF_PROLOGUE
-#defineEENTRY(y)   _EENTRY(_C_LABEL(y)); _PROF_PROLOGUE
+#defineEENTRY(y)   _EENTRY(_C_LABEL(y));
 #defineENTRY_NP(y) _ENTRY(_C_LABEL(y))
 #defineEENTRY_NP(y)_EENTRY(_C_LABEL(y))
 #defineEND(y)  _END(_C_LABEL(y))
-#defineEEND(y)
+#defineEEND(y) _EEND(_C_LABEL(y))
 #defineASENTRY(y)  _ENTRY(_ASM_LABEL(y)); _PROF_PROLOGUE
-#defineASEENTRY(y) _EENTRY(_ASM_LABEL(y)); _PROF_PROLOGUE
+#defineASEENTRY(y) _EENTRY(_ASM_LABEL(y));
 #defineASENTRY_NP(y)   _ENTRY(_ASM_LABEL(y))
 #defineASEENTRY_NP(y)  _EENTRY(_ASM_LABEL(y))
 #defineASEND(y)_END(_ASM_LABEL(y))
-#defineASEEND(y)
+#defineASEEND(y)   _EEND(_ASM_LABEL(y))
 
 #defineASMSTR  .asciz
 
___
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"