svn commit: r335131 - in head/sys: amd64/amd64 i386/i386

Konstantin Belousov kib at FreeBSD.org
Thu Jun 14 10:33:27 UTC 2018


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);


More information about the svn-src-head mailing list