Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp1881396imm; Thu, 2 Aug 2018 02:36:59 -0700 (PDT) X-Google-Smtp-Source: AAOMgpfHhD4FDaeAdtEHOibIivnAFQPYmJ2kkyIqgmJtAY1tpQ4YA1v4TkIArB/bYNnKbAfd1KF4 X-Received: by 2002:a63:ea49:: with SMTP id l9-v6mr1970263pgk.427.1533202619497; Thu, 02 Aug 2018 02:36:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533202619; cv=none; d=google.com; s=arc-20160816; b=WfJl0ZPXxSebjtYtoTPLWZN7dCZLOIToYN0JTEDHj+Ug1bePqARrUeAG5Iday7ZVO6 NdGo0vJJNN0Wx3mxLFmTTJDdqwYJC1KXfyOSeX11tOz7LDHueT0b0sKULIYgq7s9pgE2 YDuCexKzwZ9x3BsjnkDaT/vM8PZpki9IRIh+gf30T0KIQJewyRe4wmlmKfLURtKweyqh Di8uj/Z9Y+l7XnmwGVMAK+0aX5q/D0xFJbp4nlN+YjjuF/QwhymuP9zHBe+VoV4hIE4n L7RvOIMkMX8AmJv771MN+IgfBN1vcmw51h/Q+fKcU+jMd3fGUsXYKVQJX8pYfHD0aFSc vJAA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :message-id:in-reply-to:subject:cc:to:from:date :arc-authentication-results; bh=HLze8Hayr7FvTnhtZ8+9gKpCnb/TaYJdrtOd2clKrBw=; b=XTlHg2pz/2hd7WMKtLWu8zD2iFT3tBJEOZaSIk8Z4g2v/HUfZiu/9E3OoduehsBvq6 wHFtsxnBOfL4Ul6f/REUeqmGa00bjR4jpOwPQZCN0PB5ayJO9TYHXWVNdvPa1djBq9t2 DaWJyW6OXCwTY0MplWhw73e4oabM6BYw8jjSbQ/eCLVGLC7CQfFJJqUFWwAqZOpDjkJA ze7lPdCLeVwqUOnWKrAA++37ZCd3mdH1aQrBhia9sGKHJMN+IojGNmRW0WL5+9ippQDk eD8jDc3BvTuVuB7lXs/QXUz92IYaMwNtWnGxZX3hj/JUsYPsmuSFVJsyNCHsFqxWZSgY RpFA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g6-v6si1019385plo.280.2018.08.02.02.36.44; Thu, 02 Aug 2018 02:36:59 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727027AbeHBL0P (ORCPT + 99 others); Thu, 2 Aug 2018 07:26:15 -0400 Received: from Galois.linutronix.de ([146.0.238.70]:36190 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726237AbeHBL0P (ORCPT ); Thu, 2 Aug 2018 07:26:15 -0400 Received: from hsi-kbw-5-158-153-52.hsi19.kabel-badenwuerttemberg.de ([5.158.153.52] helo=nanos.tec.linutronix.de) by Galois.linutronix.de with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1flA1L-0002eR-BP; Thu, 02 Aug 2018 11:35:47 +0200 Date: Thu, 2 Aug 2018 11:35:43 +0200 (CEST) From: Thomas Gleixner To: Christoph Hellwig cc: Marc Zyngier , palmer@sifive.com, jason@lakedaemon.net, robh+dt@kernel.org, mark.rutland@arm.com, devicetree@vger.kernel.org, aou@eecs.berkeley.edu, linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org, shorne@gmail.com, Palmer Dabbelt Subject: Re: [PATCH 3/6] irqchip: RISC-V Local Interrupt Controller Driver In-Reply-To: <20180802073452.GA11693@lst.de> Message-ID: References: <20180725093649.32332-1-hch@lst.de> <20180725093649.32332-4-hch@lst.de> <20180725112457.GA24502@lst.de> <20180802073452.GA11693@lst.de> User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 2 Aug 2018, Christoph Hellwig wrote: > The cpu local interrupt handling, which was irq-riscv-intc.c in this > series and has been moved to arch/riscv/kernel/irq.c in my new series > is split over a few control registers (CSRs in RISC-V speak): > > The exception handler, which includes the delivery of interrupts to > the CPU is set up using the stvec CSR (Section 4.1.4). The vector mode > mentioned there is not supported by Linux (and not by any hardware known > to me), so ignore it. And even if it would be available then it would just avoid the software decoding of the cause register. So no fundamental difference. > Once an exception has been triggered Linux reads the scause CSR > (Section 4.1.10) to check the exception cause. If the interrupt > bit is set we have three possible exception causes that matter for > the kernel: Supervisor software interrupt, Supervisor timer interrupt, > Supervisor external interrupt (ignore the user versions, I'm not even > sure they are implementable, and they certainly are not at the moment). Yeah. I would upfront declare the user stuff broken and not supported. > To enable / disable any of these logical interrupt sources the sie > CSR (Section 4.1.5) has a bit for each kind thast can be set/cleared. > > Also there is the sip CSR (also section 4.1.5) which tells if any of those > is pending at the moment. So that's the low level per cpu interrupt/exception distribution mechanism, i.e. a distinct per cpu 'vector' space with fixed functionality. It does not make sense to actually handle that as an irq chip. It has absolutely no relevance. The software interrupts are enabled when the CPU is started and the external ones as well as they are gated by the PLIC. The only thing which might need to access the enable register is the local timer interrupt. That really does not require an extra irq chip as the enable/disable is really just at cpu up/down time and the magic happens on the local CPU so no smp functional call hackery is required. The PLIC is the beast which wants a proper irqdomain/irqchip implementation. Thanks, tglx