Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 22 May 2011 20:24:36 +0000 (UTC)
From:      Attilio Rao <attilio@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-projects@freebsd.org
Subject:   svn commit: r222194 - in projects/largeSMP/sys/i386: i386 xen
Message-ID:  <201105222024.p4MKOaq7089142@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: attilio
Date: Sun May 22 20:24:36 2011
New Revision: 222194
URL: http://svn.freebsd.org/changeset/base/222194

Log:
  Add a "safety belt" check for lsb setting.
  I don't think it is really necessary because the cpumask is known to be
  != 0, but it is just in case.
  
  Requested by:	kib

Modified:
  projects/largeSMP/sys/i386/i386/pmap.c
  projects/largeSMP/sys/i386/xen/pmap.c

Modified: projects/largeSMP/sys/i386/i386/pmap.c
==============================================================================
--- projects/largeSMP/sys/i386/i386/pmap.c	Sun May 22 20:19:01 2011	(r222193)
+++ projects/largeSMP/sys/i386/i386/pmap.c	Sun May 22 20:24:36 2011	(r222194)
@@ -1947,6 +1947,7 @@ pmap_lazyfix(pmap_t pmap)
 
 		/* Find least significant set bit. */
 		lsb = cpusetobj_ffs(&mask);
+		MPASS(lsb != 0);
 		lsb--;
 		CPU_SETOF(lsb, &mask);
 		mtx_lock_spin(&smp_ipi_mtx);

Modified: projects/largeSMP/sys/i386/xen/pmap.c
==============================================================================
--- projects/largeSMP/sys/i386/xen/pmap.c	Sun May 22 20:19:01 2011	(r222193)
+++ projects/largeSMP/sys/i386/xen/pmap.c	Sun May 22 20:24:36 2011	(r222194)
@@ -1730,6 +1730,7 @@ pmap_lazyfix(pmap_t pmap)
 
 		/* Find least significant set bit. */
 		lsb = cpusetobj_ffs(&mask);
+		MPASS(lsb != 0);
 		lsb--;
 		CPU_SETOF(lsb, &mask);
 		mtx_lock_spin(&smp_ipi_mtx);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201105222024.p4MKOaq7089142>