NetBSD Problem Report #55062

From www@netbsd.org  Tue Mar 10 01:32:04 2020
Return-Path: <www@netbsd.org>
Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(Client CN "mail.NetBSD.org", Issuer "mail.NetBSD.org CA" (not verified))
	by mollari.NetBSD.org (Postfix) with ESMTPS id ACE631A9213
	for <gnats-bugs@gnats.NetBSD.org>; Tue, 10 Mar 2020 01:32:04 +0000 (UTC)
Message-Id: <20200310013203.EB9351A9217@mollari.NetBSD.org>
Date: Tue, 10 Mar 2020 01:32:03 +0000 (UTC)
From: thorpej@me.com
Reply-To: thorpej@me.com
To: gnats-bugs@NetBSD.org
Subject: Failed assertion in pmap_md_tlb_check_entry()
X-Send-Pr-Version: www-1.0

>Number:         55062
>Category:       port-mips
>Synopsis:       Failed assertion in pmap_md_tlb_check_entry()
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    thorpej
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Mar 10 01:35:00 +0000 2020
>Closed-Date:    Wed Mar 11 13:50:55 +0000 2020
>Last-Modified:  Wed Mar 11 13:50:55 +0000 2020
>Originator:     Jason Thorpe
>Release:        NetBSD 9.99.48
>Organization:
Riscy Business
>Environment:
NetBSD cobalt 9.99.48 NetBSD 9.99.48 (GENERIC)
>Description:
I am occasionally having the following panic:

kernel diagnostic assertion \"pte == xpte\" failed: file \"../../../../arch/mips/mips/pmap_machdep.c\", line 871 pmap=0x80641be4 va=0xc3018000 asid=0: TLB pte (0x7e01f) != real pte (0x1/0x1) @ 0x80712

It doesn't happen frequently, but in a bit over a week it's happened 4 times.
>How-To-Repeat:
No readily reproducible case.

>Fix:
N/A

>Release-Note:

>Audit-Trail:

Responsible-Changed-From-To: port-mips-maintainer->thorpej
Responsible-Changed-By: thorpej@NetBSD.org
Responsible-Changed-When: Wed, 11 Mar 2020 00:40:04 +0000
Responsible-Changed-Why:
Take.


State-Changed-From-To: open->analyzed
State-Changed-By: thorpej@NetBSD.org
State-Changed-When: Wed, 11 Mar 2020 00:40:04 +0000
State-Changed-Why:
I believe I have analyzed the failure.


From: "Jason R Thorpe" <thorpej@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/55062 CVS commit: src/sys
Date: Wed, 11 Mar 2020 13:30:32 +0000

 Module Name:	src
 Committed By:	thorpej
 Date:		Wed Mar 11 13:30:31 UTC 2020

 Modified Files:
 	src/sys/arch/mips/mips: pmap_machdep.c
 	src/sys/arch/powerpc/booke: booke_pmap.c
 	src/sys/arch/powerpc/include/booke: pmap.h
 	src/sys/arch/riscv/include: pmap.h
 	src/sys/arch/riscv/riscv: pmap_machdep.c riscv_machdep.c
 	src/sys/uvm/pmap: pmap.c pmap.h

 Log Message:
 With DEBUG defined, it's possible to execute a TLB-vs-segmap consistency
 check from a (soft) interrupt handler.  But if a platform does not otherwise
 require the pmap_tlb_miss_lock, then where will be a brief window of
 inconsistency that, while harmless, will still fire an assertion in the
 consistency check.

 Fix this with the following changes:
 1- Refactor the pmap_tlb_miss_lock into MI code and rename it from
    pmap_tlb_miss_lock_{enter,exit}() to pmap_tlb_miss_lock_{enter,exit}().
    MD code can still define the "md" hooks as necessary, and if so, will
    override the common implementation.
 2- Provde a pmap_bootstrap_common() function to perform common pmap bootstrap
    operations, namely initializing the pmap_tlb_miss_lock if it's needed.
    If MD code overrides the implementation, it's responsible for initializing
    its own lock.
 3- Call pmap_bootstrap_common() from the mips, powerpc booke, and riscv
    pmap_bootstrap() routines.  (This required adding one for riscv.)
 4- Switch powerpc booke to the common pmap_tlb_miss_lock.
 5- Enable pmap_tlb_miss_lock if DEBUG is defined, even if it's not otherwise
    required.

 PR port-mips/55062 (Failed assertion in pmap_md_tlb_check_entry())


 To generate a diff of this commit:
 cvs rdiff -u -r1.26 -r1.27 src/sys/arch/mips/mips/pmap_machdep.c
 cvs rdiff -u -r1.26 -r1.27 src/sys/arch/powerpc/booke/booke_pmap.c
 cvs rdiff -u -r1.18 -r1.19 src/sys/arch/powerpc/include/booke/pmap.h
 cvs rdiff -u -r1.3 -r1.4 src/sys/arch/riscv/include/pmap.h
 cvs rdiff -u -r1.4 -r1.5 src/sys/arch/riscv/riscv/pmap_machdep.c
 cvs rdiff -u -r1.8 -r1.9 src/sys/arch/riscv/riscv/riscv_machdep.c
 cvs rdiff -u -r1.45 -r1.46 src/sys/uvm/pmap/pmap.c
 cvs rdiff -u -r1.12 -r1.13 src/sys/uvm/pmap/pmap.h

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

State-Changed-From-To: analyzed->closed
State-Changed-By: thorpej@NetBSD.org
State-Changed-When: Wed, 11 Mar 2020 13:50:55 +0000
State-Changed-Why:
Fix committed.


>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.46 2020/01/03 16:35:01 leot Exp $
$NetBSD: gnats_config.sh,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2020 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.