Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 14 Jun 2018 10:33:26 +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: r335131 - in head/sys: amd64/amd64 i386/i386
Message-ID:  <201806141033.w5EAXQkL086941@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: kib
Date: Thu Jun 14 10:33:26 2018
New Revision: 335131
URL: https://svnweb.freebsd.org/changeset/base/335131

Log:
  Remove printf() in #NM handler.
  
  Give up and remove the almost useless informational message reporting
  that device not available exception occured while our state tracking
  indicates the current CPU has FPU context loaded for the current
  thread.
  
  It seems that this is recurring bug with some VM monitors.
  
  Sponsored by:	The FreeBSD Foundation

Modified:
  head/sys/amd64/amd64/fpu.c
  head/sys/i386/i386/npx.c

Modified: head/sys/amd64/amd64/fpu.c
==============================================================================
--- head/sys/amd64/amd64/fpu.c	Thu Jun 14 10:00:19 2018	(r335130)
+++ head/sys/amd64/amd64/fpu.c	Thu Jun 14 10:33:26 2018	(r335131)
@@ -723,7 +723,12 @@ fpudna(void)
 	KASSERT((curpcb->pcb_flags & PCB_FPUNOSAVE) == 0,
 	    ("fpudna while in fpu_kern_enter(FPU_KERN_NOCTX)"));
 	if (PCPU_GET(fpcurthread) == td) {
-		printf("fpudna: fpcurthread == curthread\n");
+		/*
+		 * Some virtual machines seems to set %cr0.TS at
+		 * arbitrary moments.  Silently clear the TS bit
+		 * regardless of the eager/lazy FPU context switch
+		 * mode.
+		 */
 		stop_emulating();
 		critical_exit();
 		return;

Modified: head/sys/i386/i386/npx.c
==============================================================================
--- head/sys/i386/i386/npx.c	Thu Jun 14 10:00:19 2018	(r335130)
+++ head/sys/i386/i386/npx.c	Thu Jun 14 10:33:26 2018	(r335131)
@@ -826,9 +826,6 @@ restore_npx_curthread(struct thread *td, struct pcb *p
  * and not necessarily for every context switch, but it is too hard to
  * access foreign pcb's.
  */
-
-static int err_count = 0;
-
 int
 npxdna(void)
 {
@@ -839,8 +836,12 @@ npxdna(void)
 	td = curthread;
 	critical_enter();
 	if (PCPU_GET(fpcurthread) == td) {
-		printf("npxdna: fpcurthread == curthread %d times\n",
-		    ++err_count);
+		/*
+		 * Some virtual machines seems to set %cr0.TS at
+		 * arbitrary moments.  Silently clear the TS bit
+		 * regardless of the eager/lazy FPU context switch
+		 * mode.
+		 */
 		stop_emulating();
 		critical_exit();
 		return (1);



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