From owner-svn-src-head@freebsd.org Thu Mar 22 00:36:23 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4F077F52FF8 for ; Thu, 22 Mar 2018 00:36:23 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-it0-x22e.google.com (mail-it0-x22e.google.com [IPv6:2607:f8b0:4001:c0b::22e]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C0EAF71BB5 for ; Thu, 22 Mar 2018 00:36:22 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-it0-x22e.google.com with SMTP id 19-v6so8965252itw.3 for ; Wed, 21 Mar 2018 17:36:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=2SY+Vn5yh1yjz1ZbKH8Uc8Bkp3mwMKf0hTJXx7GzGXw=; b=Ml6eLWbqgO7G97jhUr1oMSYd3n2pQR/v8vsmPtjOYYzf2EEpBNemZ3uYoF7jfq2CVD sY+H4kO66yzxU/NGu9r2Cdj1f6/SLKT7fdeKjqFN9stTncM/Ma8TcA4G8G1R460KDxY6 DrvmtD8FI/m1kpbFvqpKoT7A6OzkwZiMuSvWTCmYRSwqZD5DFhS3lE7Wu62rBUfS0a6b T8E824AY+NNAyTi11jZOOgbvhXW2QQfYJa1QUq9twVZIiY9574ajU/gZ78oz2sO4dzGZ CljUTHZUP0RpKQiNnt+ahUzyxMtRNzrskwEHeHxTn5IKNZEdxuEYcLle8EzYTJEEEzDS Lu3w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=2SY+Vn5yh1yjz1ZbKH8Uc8Bkp3mwMKf0hTJXx7GzGXw=; b=FPxziRFI4bH9yh/9SzB9jiIiyQuMCReIkZFAj4jTkmY4ih8Zt3/RrpT0e2fCN0lgiV 4U2WqkGGy7MGQuMAqzrYeSnPzTl4EGjowo6pn65FwXlyZEB4Ox1IiQelGCsCKn972Zgk aDYMgplXVRVnhNobZv+akXjqiX6Yp/LKfIcHIMLqTRAeltJO7pKTFgksmCxc2iIHEkgP B2Qth4KT0aK47hHC2zlUZCCJk1LphEZdKQND9A7eJF1R4vUbSON722Lg9nS1ZWG7l9cO x69dGIVecMN8pz2xeG58t8DsvpRoDmuZXXhorF/7eO3TnhX4YHx9dMPY0pEFMEkYVTye MbcA== X-Gm-Message-State: AElRT7EQaYk5g5yAIfkCpD6Ie/OwE2A+r87v7HAax416MCpNLEHmeS2o C1kMHs7a3hd4e8++JpSeiGc5e4uElRaGuWfYW1n1Sg== X-Google-Smtp-Source: AG47ELurNmIFsNjPCYDsyuhn2jDGAMvO5c4ZMvDhpM4+FlTfcViKDJ9Q5+INKOGU88kbWrsu5B6aQaSMuCxkNWv57VE= X-Received: by 2002:a24:4286:: with SMTP id i128-v6mr6765606itb.73.1521678982095; Wed, 21 Mar 2018 17:36:22 -0700 (PDT) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 10.79.203.196 with HTTP; Wed, 21 Mar 2018 17:36:21 -0700 (PDT) X-Originating-IP: [2603:300b:6:5100:1052:acc7:f9de:2b6d] In-Reply-To: <20180321202752.GO76926@kib.kiev.ua> References: <201803211447.w2LElDcK091988@repo.freebsd.org> <20180322024846.S4293@besplex.bde.org> <20180321202752.GO76926@kib.kiev.ua> From: Warner Losh Date: Wed, 21 Mar 2018 18:36:21 -0600 X-Google-Sender-Auth: MBCbBvSxwxZ0VXJ4fIP2YJ5Pgps Message-ID: Subject: Re: svn commit: r331298 - head/sys/dev/syscons To: Konstantin Belousov Cc: Bruce Evans , Warner Losh , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.25 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Mar 2018 00:36:23 -0000 On Wed, Mar 21, 2018 at 2:27 PM, Konstantin Belousov wrote: > On Thu, Mar 22, 2018 at 04:53:22AM +1100, Bruce Evans wrote: > > Serial console drivers with fast interrupt handlers have much more > > broken locking for ddb special keys. It is invalid to either drop locks > > or call the "any" function from a fast interrupt handler, but buggy > > serial console drivers calls kbd_alt_break(), and that now calls > > shutdown_nice() and other functions that cannot be called from a fast > > interrupt handler. ddb keys supply most of the shutdown_nice() > > functionality for serial consoles, and there are no escape sequence to > > get this without ddb or maybe another debugger, so these bugs don't > > affect most users. > > > > Handling this correctly requires much the same fix as an unsafe signal > > handler, and fixes have much the same problems -- not much more than > > setting a flag is safe, and the flag might never be looked at if the > > system is in a bad state. However, if a nice shutdown is possible then > > the sytem must be in a good enough state to poll for flags. > > Are you saying that fast interrupt handlers call shutdown_nice() ? This > is the quite serious bug on its own. To fix it, shutdown_nice() should > use a fast taskqueue to schedule the task which would lock the process > and send the signal. > Is there some way we know we're in a fast interrupt handler? If so, it should be simple to fix. If not, then there's an API change ahead of us... But bde is right: the system has to be in good enough shape to cope. I wonder if we should put that coping into kdb_reboot() instead. It's only an issue for TILDE ^R, which is a fairly edge case. Warner