Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 28 Jan 2016 12:00:17 +0000 (UTC)
From:      Wojciech Macek <wma@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r294979 - head/sys/arm64/arm64
Message-ID:  <201601281200.u0SC0HLw054521@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: wma
Date: Thu Jan 28 12:00:17 2016
New Revision: 294979
URL: https://svnweb.freebsd.org/changeset/base/294979

Log:
  Fix mutex releasing in ARM64 cpu_switch
  
      The code should be comparing pointers, not any data
      gathered from a blocked_lock.
  
  Spotted by:            cognet
  Approved by:           zbb, cognet (mentor)
  Differential revision: https://reviews.freebsd.org/D5100

Modified:
  head/sys/arm64/arm64/swtch.S

Modified: head/sys/arm64/arm64/swtch.S
==============================================================================
--- head/sys/arm64/arm64/swtch.S	Thu Jan 28 09:25:15 2016	(r294978)
+++ head/sys/arm64/arm64/swtch.S	Thu Jan 28 12:00:17 2016	(r294979)
@@ -166,9 +166,8 @@ ENTRY(cpu_switch)
 	 */
 	str	x2, [x0, #TD_LOCK]
 #if defined(SCHED_ULE) && defined(SMP)
-	/* Read the value in blocked_lock */
-	ldr	x0, =_C_LABEL(blocked_lock)
-	ldr	x2, [x0]
+	/* Spin if TD_LOCK points to a blocked_lock */
+	ldr	x2, =_C_LABEL(blocked_lock)
 1:
 	ldar	x3, [x1, #TD_LOCK]
 	cmp	x3, x2



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