Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 25 Feb 2017 09:50:32 +0200
From:      Andriy Gapon <avg@FreeBSD.org>
To:        "Jonathan T. Looney" <jtl@FreeBSD.org>, src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, svn-src-head@FreeBSD.org
Subject:   Re: svn commit: r314216 - head/sys/x86/x86
Message-ID:  <a4bcfcbe-0244-e254-d437-5c203e6b0bf2@FreeBSD.org>
In-Reply-To: <201702241856.v1OIu150004903@repo.freebsd.org>
References:  <201702241856.v1OIu150004903@repo.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On 24/02/2017 20:56, Jonathan T. Looney wrote:
> Author: jtl
> Date: Fri Feb 24 18:56:00 2017
> New Revision: 314216
> URL: https://svnweb.freebsd.org/changeset/base/314216
> 
> Log:
>   We have seen several cases recently where we appear to get a double-fault:
>   We have an original panic. Then, instead of writing the core to the dump
>   device, the kernel has a second panic: "smp_targeted_tlb_shootdown:
>   interrupts disabled". This change is an attempt to fix that second panic.

Just curious if you were able to find out what code caused those shootdowns to
be sent.
It's pretty unusual for the after-panic code to do things like that.


>   When the other CPUs are stopped, we can't notify them of the TLB shootdown,
>   so we skip that operation. However, when the CPUs come back up, we
>   invalidate the TLB to ensure they correctly observe any changes to the
>   page mappings.
>   
>   Reviewed by:	kib
>   Sponsored by:	Netflix
>   Differential Revision:	https://reviews.freebsd.org/D9786
> 
> Modified:
>   head/sys/x86/x86/mp_x86.c
> 
> Modified: head/sys/x86/x86/mp_x86.c
> ==============================================================================
> --- head/sys/x86/x86/mp_x86.c	Fri Feb 24 17:36:55 2017	(r314215)
> +++ head/sys/x86/x86/mp_x86.c	Fri Feb 24 18:56:00 2017	(r314216)
> @@ -45,6 +45,7 @@ __FBSDID("$FreeBSD$");
>  #ifdef GPROF 
>  #include <sys/gmon.h>
>  #endif
> +#include <sys/kdb.h>
>  #include <sys/kernel.h>
>  #include <sys/ktr.h>
>  #include <sys/lock.h>
> @@ -1269,6 +1270,12 @@ cpustop_handler_post(u_int cpu)
>  	CPU_CLR_ATOMIC(cpu, &started_cpus);
>  	CPU_CLR_ATOMIC(cpu, &stopped_cpus);
>  
> +	/*
> +	 * We don't broadcast TLB invalidations to other CPUs when they are
> +	 * stopped. Hence, we clear the TLB before resuming.
> +	 */
> +	invltlb_glob();
> +
>  #if defined(__amd64__) && defined(DDB)
>  	amd64_db_resume_dbreg();
>  #endif
> @@ -1427,6 +1434,10 @@ smp_targeted_tlb_shootdown(cpuset_t mask
>  	uint32_t generation;
>  	int cpu;
>  
> +	/* It is not necessary to signal other CPUs while in the debugger. */
> +	if (kdb_active || panicstr != NULL)
> +		return;
> +
>  	/*
>  	 * Check for other cpus.  Return if none.
>  	 */
> 


-- 
Andriy Gapon



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?a4bcfcbe-0244-e254-d437-5c203e6b0bf2>