Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp3308203pxb; Fri, 12 Feb 2021 15:09:04 -0800 (PST) X-Google-Smtp-Source: ABdhPJzH/uKaZ8xL1zcYSfhG31jJ6wAb/NbMBQUdthnQqYVB7FbmXH5yH+LxfP/0H5d25g+73jJB X-Received: by 2002:a17:906:b047:: with SMTP id bj7mr5249910ejb.335.1613171344279; Fri, 12 Feb 2021 15:09:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1613171344; cv=none; d=google.com; s=arc-20160816; b=IA4MRJzUSK+bcXI+IhT2IVbTX8UfDTNqL5yHKewUg73v3k6dVv/82CGXTX+TIYd4As Xf6Ohj1yn9JH5MHzXfAb5/hgrYsTL+P52a2Hicpe4AXHD4+Md1vh1KmAU/LQC86NuwSP qgMfSI8JvaCnUz86f26QfAPb/yx3XTnd03f+i+T0R0ZFcqs8hzKBEWzJi1ZBZk0ley3T nZG9Kcc51LF5MNBnWjw4inp+23UomhbMszJsBazPt9DRXcJNYabsNWCjBzhwGFgn3fYs aF/56yXIPFIV7G5/KY59y4yO6a/kpG+sJpEXg1PJT1pE9P8LenzM/IbhI32BlRNwbsCe O8AQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=4TUrfPLjCOyKSuE1nyXWFy9lnG487MKF5ZZRs9ySCoU=; b=n8UzI63mNhZOpmKcTYqRIeDcOQ0Ykt+VJf/AtuM3rXwCpvUq1rohj9SMiGF2yxRhxZ K6Zt181CIFId6xAJijLnlHGtxI6ov3DsXLtu16OH6YN057uSqptpXRYLgWKadk+N7Kxl gxlh3EF0/hzOPtWdzJ29N2uslqNQUyiJ8U1DBjVPYKQzZJjs671/aSAiq80tpIx+qfaF J5FhDe1VpvfXH0VQCrS+/bMDBAKQ1RNfVg2K5nwUnNsEsyNAfJndyiHhA7U3Z6hm94mt zVuXfrp7FUrgl5gnlQ7leILR9fuc/sBUa2s+IsOnS6p2B5Z7ClsQOAY7k389VukWFqrY KY1g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="P4dvyU/z"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id s10si7096524edw.18.2021.02.12.15.08.40; Fri, 12 Feb 2021 15:09:04 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="P4dvyU/z"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229980AbhBLXGo (ORCPT + 99 others); Fri, 12 Feb 2021 18:06:44 -0500 Received: from mail.kernel.org ([198.145.29.99]:49538 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229497AbhBLXGm (ORCPT ); Fri, 12 Feb 2021 18:06:42 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id AF92864DAD for ; Fri, 12 Feb 2021 23:06:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1613171160; bh=tBxFZwoJWv3SOKBE5UTMo8+ru4YN5uJ1G3rmZ75B49s=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=P4dvyU/zSjY7l8uYUD1lMx2LClXtENKF/gXBIfxCZyCxTh9cn1R9vN1N7FkF2YORC UQLUbKkCmrGGUdO45uDrYXuhmC+8O0/sirHta4K4VSGeQ4kkLgyHyCcw/egadgm1k/ lBXwYpWfAEg8fObDi1V5zcX+5/zFyAb+8K2D4zuesEFqrP4ZNTvMKZUGoOxQajx2yd iHZYAz3mHLwsWX7k7del3CxM0Zk//wCZqJaLvSppRz6IEp+Kg8Nhal+TWwdLrOOPKA eQdq6UEjT7m/gkP3g3klf6jm/YUiA76wFnCRy0rwhOysuDB74/8ieKILjqA/Gi2VT5 NkYYxoDALOe/A== Received: by mail-ot1-f46.google.com with SMTP id y11so776035otq.1 for ; Fri, 12 Feb 2021 15:06:00 -0800 (PST) X-Gm-Message-State: AOAM530UD58R3psqepT10av4AFz+Q+qdpzJHwlL5y/WSGSvJUB/Jg2EJ UssJOY1vkA7GQAv8V3ALyHHQ3KQa/2ZO59d2RWA= X-Received: by 2002:a05:6830:18e6:: with SMTP id d6mr3914294otf.251.1613171159960; Fri, 12 Feb 2021 15:05:59 -0800 (PST) MIME-Version: 1.0 References: <24e0652b3afa48cdbf7c83287e43c087@hisilicon.com> In-Reply-To: <24e0652b3afa48cdbf7c83287e43c087@hisilicon.com> From: Arnd Bergmann Date: Sat, 13 Feb 2021 00:05:43 +0100 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [RFC] IRQ handlers run with some high-priority interrupts(not NMI) enabled on some platform To: "Song Bao Hua (Barry Song)" Cc: "tglx@linutronix.de" , "gregkh@linuxfoundation.org" , "arnd@arndb.de" , "geert@linux-m68k.org" , "funaho@jurai.org" , "philb@gnu.org" , "corbet@lwn.net" , "mingo@redhat.com" , "linux-m68k@lists.linux-m68k.org" , "fthain@telegraphics.com.au" , "linux-kernel@vger.kernel.org" Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Feb 13, 2021 at 12:00 AM Song Bao Hua (Barry Song) wrote: > > -----Original Message----- > > From: Arnd Bergmann [mailto:arnd@kernel.org] > > Sent: Saturday, February 13, 2021 11:34 AM > > To: Song Bao Hua (Barry Song) > > Cc: tglx@linutronix.de; gregkh@linuxfoundation.org; arnd@arndb.de; > > geert@linux-m68k.org; funaho@jurai.org; philb@gnu.org; corbet@lwn.net; > > mingo@redhat.com; linux-m68k@lists.linux-m68k.org; > > fthain@telegraphics.com.au; linux-kernel@vger.kernel.org > > Subject: Re: [RFC] IRQ handlers run with some high-priority interrupts(not NMI) > > enabled on some platform > > > > On Fri, Feb 12, 2021 at 2:18 AM Song Bao Hua (Barry Song) > > wrote: > > > > > So I am requesting comments on: > > > 1. are we expecting all interrupts except NMI to be disabled in irq handler, > > > or do we actually allow some high-priority interrupts between low and NMI > > to > > > come in some platforms? > > > > I tried to come to an answer but this does not seem particularly well-defined. > > There are a few things I noticed: > > > > - going through the local_irq_save()/restore() implementations on all > > architectures, I did not find any other ones besides m68k that leave > > high-priority interrupts enabled. I did see that at least alpha and openrisc > > are designed to support that in hardware, but the code just leaves the > > interrupts disabled. > > The case is a little different. Explicit local_irq_save() does disable all > high priority interrupts on m68k. The only difference is arch_irqs_disabled() > of m68k will return true while low-priority interrupts are masked and high > -priority are still open. M68k's hardIRQ also runs in this context with high > priority interrupts enabled. My point was that on most other architectures, local_irq_save()/restore() always disables/enables all interrupts, while on m68k it restores the specific level they were on before. On alpha, it does the same as on m68k, but then the top-level interrupt handler just disables them all before calling into any other code. It's possible that I missed some other implementation doing the same as m68k, as this code is fairly subtle on some architectures. Arnd