Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 24 Nov 2019 19:02:13 +0000 (UTC)
From:      Konstantin Belousov <kib@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r355060 - head/sys/amd64/include
Message-ID:  <201911241902.xAOJ2D8G085494@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: kib
Date: Sun Nov 24 19:02:13 2019
New Revision: 355060
URL: https://svnweb.freebsd.org/changeset/base/355060

Log:
  amd64: assert that EARLY_COUNTER does not corrupt memory.
  
  Reviewed by:	imp
  Sponsored by:	The FreeBSD Foundation
  MFC after:	1 week
  Differential revision:	https://reviews.freebsd.org/D22514

Modified:
  head/sys/amd64/include/counter.h

Modified: head/sys/amd64/include/counter.h
==============================================================================
--- head/sys/amd64/include/counter.h	Sun Nov 24 16:40:54 2019	(r355059)
+++ head/sys/amd64/include/counter.h	Sun Nov 24 19:02:13 2019	(r355060)
@@ -82,6 +82,7 @@ static inline void
 counter_u64_add(counter_u64_t c, int64_t inc)
 {
 
+	KASSERT(IS_BSP() || c != EARLY_COUNTER, ("EARLY_COUNTER used on AP"));
 	__asm __volatile("addq\t%1,%%gs:(%0)"
 	    :
 	    : "r" ((char *)c - (char *)&__pcpu[0]), "ri" (inc)



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