From nobody Thu Apr 13 22:10:55 2023 X-Original-To: freebsd-hackers@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PyDLG5vSTz44kfx for ; Thu, 13 Apr 2023 22:11:02 +0000 (UTC) (envelope-from dumbbell@FreeBSD.org) Received: from smtp-bc08.mail.infomaniak.ch (smtp-bc08.mail.infomaniak.ch [IPv6:2001:1600:4:17::bc08]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "relay.mail.infomaniak.ch", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4PyDLG0sVJz3H4s for ; Thu, 13 Apr 2023 22:11:02 +0000 (UTC) (envelope-from dumbbell@FreeBSD.org) Authentication-Results: mx1.freebsd.org; dkim=none; spf=softfail (mx1.freebsd.org: 2001:1600:4:17::bc08 is neither permitted nor denied by domain of dumbbell@FreeBSD.org) smtp.mailfrom=dumbbell@FreeBSD.org; dmarc=none Received: from smtp-2-0000.mail.infomaniak.ch (unknown [10.5.36.107]) by smtp-3-3000.mail.infomaniak.ch (Postfix) with ESMTPS id 4PyDL80KbHzMqP1C for ; Fri, 14 Apr 2023 00:10:56 +0200 (CEST) Received: from unknown by smtp-2-0000.mail.infomaniak.ch (Postfix) with ESMTPA id 4PyDL75fJwzMppDV for ; Fri, 14 Apr 2023 00:10:55 +0200 (CEST) Message-ID: Date: Fri, 14 Apr 2023 00:10:55 +0200 List-Id: Technical discussions relating to FreeBSD List-Archive: https://lists.freebsd.org/archives/freebsd-hackers List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-hackers@freebsd.org MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:102.0) Gecko/20100101 Thunderbird/102.10.0 Subject: Re: Handling panics inside vt(4) callbacks To: freebsd-hackers@freebsd.org References: <4ed85151-09e8-db3e-0e0b-d0a8f3bb937c@FreeBSD.org> Content-Language: fr, en-US From: =?UTF-8?Q?Jean-S=c3=a9bastien_P=c3=a9dron?= Organization: The FreeBSD Project In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Infomaniak-Routing: alpha X-Spamd-Result: default: False [-1.39 / 15.00]; R_MIXED_CHARSET(1.00)[subject]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_SHORT(-0.29)[-0.290]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[freebsd.org]; MLMMJ_DEST(0.00)[freebsd-hackers@freebsd.org]; FROM_EQ_ENVFROM(0.00)[]; ARC_NA(0.00)[]; ASN(0.00)[asn:29222, ipnet:2001:1600::/32, country:CH]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_TLS_LAST(0.00)[]; RCVD_COUNT_THREE(0.00)[3]; HAS_ORG_HEADER(0.00)[]; FROM_HAS_DN(0.00)[]; FREEFALL_USER(0.00)[dumbbell]; RCVD_VIA_SMTP_AUTH(0.00)[]; MID_RHS_MATCH_FROM(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; TO_DN_NONE(0.00)[]; PREVIOUSLY_DELIVERED(0.00)[freebsd-hackers@freebsd.org]; RCPT_COUNT_ONE(0.00)[1]; R_SPF_SOFTFAIL(0.00)[~all:c]; TO_DOM_EQ_FROM_DOM(0.00)[] X-Rspamd-Queue-Id: 4PyDLG0sVJz3H4s X-Spamd-Bar: - X-ThisMailContainsUnwantedMimeParts: N On 13/04/2023 17:18, Mark Johnston wrote: > On Wed, Apr 12, 2023 at 10:45:27PM +0200, Jean-Sébastien Pédron wrote: >> I could not find something in panic(9) code that would reboot the >> computer in case of a nested panic. > > In the case of a nested panic, vpanic() will not set RB_DUMP when it > calls kern_reboot(), so it won't write a kernel dump. And, if > debug.debugger_on_recursive_panic is not set, the kernel will not try to > re-enter the debugger. So the kernel will simply reboot. That was exactly the problem and I missed it even though I read that function many times... Thank you very much! If I always set RB_DUMP, it does what I want in the context of that forced nested panic. I will continue to test with the DRM driver and the actual issues I'm currently chasing. Once done, I will prepare a patch. > Perhaps we should set RB_DUMP in the case of a recursive panic so long > as dumping == 0, i.e., we did not panic again while trying to dump core. > In fact, kern_reboot() already checks this. In fact, "kern_reboot()" already verify if "dumping" is non-zero. I think "vpanic()" could set the flag regardless of that variable. Thank you! -- Jean-Sébastien Pédron The FreeBSD Project