Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp3008265imm; Mon, 10 Sep 2018 09:33:51 -0700 (PDT) X-Google-Smtp-Source: ANB0VdbWf1ssHqMflU9sqH0wSK0UDkgpewyoHyxXqWCewJlwUprQaA/sOrhxMc8levszsMGb4rU+ X-Received: by 2002:a62:f208:: with SMTP id m8-v6mr24593852pfh.222.1536597231036; Mon, 10 Sep 2018 09:33:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536597231; cv=none; d=google.com; s=arc-20160816; b=LGwx6EF15nnNqOXsCqXTNr0CrwHFNHf+AvnhHt/F55vf3y7oltVm/+fqpLy1iOpJm1 Q65l81FZj0C7gR3fqXmJ7GvySDniZiQ5RwN/C2chYPcL3UsWpC7R7E7cHzreWbcoXHcb eZzt8xlXZLz+CVwRIW/iHzhsKSarzurf29R5xOUF8aT24WbsLy8UhAdWpuUrrlWvpz0B unfyY8cDGlPvSorecSJcTordthAlr+u/cz2EwU+KnDLJ/sW5V7mflAYyWnxt3RVUREtc 8VC2xAYdE/llQaNKcZj1MBjOIvgZNtw+0o6hr8FXLxLkQXQN5LvEqNxuwtTtcpUriTi8 SjXQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature; bh=Y8o8dFPM6zwrUbeVMshpaO9zSXnOweyOOT+vxSZ/GYw=; b=N8KKENPPkbq30TJGX2M3fniGo3nv7b1KiaZtW41guWXLC1yTVkUgr10VxLug8eGpwm 7zNeJ67pACpaDAkXUAOGLimcX0QbWsMlomYngjithgl0tF72Oczna1rGpBlYcVN6XALO 2gPyX4yiK9w5+z13Y1lGs04kTBj2qNiVTT3l1vbmG247TiOth45b7wimtjviThD56KoR +DEwHu0Owy9urt2uv3KE607XUewTOh4jJTzT1Q7RigQf/Y0DyrCLq120tzwUekZWp/RD CXnsDQCnbZni3Rt4fVrS9rGqhV+vePXiHtSI/EqRwlc3hXnAvgf78akgo6DOYtJk7Rq5 DW0A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@brainfault-org.20150623.gappssmtp.com header.s=20150623 header.b=OR+dtauK; 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 a143-v6si18169166pfd.241.2018.09.10.09.33.34; Mon, 10 Sep 2018 09:33:51 -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; dkim=pass header.i=@brainfault-org.20150623.gappssmtp.com header.s=20150623 header.b=OR+dtauK; 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 S1728258AbeIJV1F (ORCPT + 99 others); Mon, 10 Sep 2018 17:27:05 -0400 Received: from mail-wm0-f67.google.com ([74.125.82.67]:50478 "EHLO mail-wm0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728052AbeIJV1F (ORCPT ); Mon, 10 Sep 2018 17:27:05 -0400 Received: by mail-wm0-f67.google.com with SMTP id s12-v6so22234400wmc.0 for ; Mon, 10 Sep 2018 09:32:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brainfault-org.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=Y8o8dFPM6zwrUbeVMshpaO9zSXnOweyOOT+vxSZ/GYw=; b=OR+dtauKFWxaJfE77Q0R9bxq/ais8PQHhdA5HW03RqlcTAG7voCCAdUzlbleUfUT+S eez50CAf/LuLJxegL2XG08Mxvx9eQhFFSWmFMj1eTOHqAMSjFBKv5prnsKOyS7xVNJfa ih6FPc7Gmtgfj6fiZ+95r4ssLMwrjOtkjEDqmcJHyECuwCjoYajRuhxbkIcj3XJ3OyIW mFIFb19/hcXh1U16NKu7efQiWaiBFc7YPY5/Ur1EnNWbcf+mPmvMpAGY/vmA5qNwQ5Sr HBUauHebcbTSHCH/NyCpFK40pjd9tdVc9aKYtUWuLWzPIH5rfZcQtqvMupfLvTXHdiOJ kbbw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=Y8o8dFPM6zwrUbeVMshpaO9zSXnOweyOOT+vxSZ/GYw=; b=XrTwLNkpj4ikpcflga8VXmtSIZw6QdLdh5V01yZjcXbEFtXoRoUb2pOP+V60aelNFh xH9vc1O7ZZ7veG9uSW72cP+WJMAvOp6hWRknujH01haZQqxDULHI6snSKTWmRa4HJKms hapeCRrjr8onAsA14Jczd4yCnRjbq5wvrM1ZWsp/HWscJe54a/0M4wuDFSYvJ4Y8cKa1 pvfJl/2Zwx2XCgUWF45PqneA2L7RBhFrgvydUAi53LKRghQjwVEM/3/kF9BydQE479Hw 8wIjqJSNdK+jNlVU64IqeBgwKro0IRY2cv3qiyf0GnO7oh9jjpNcKSsWMhDor6DC7t6d 27PA== X-Gm-Message-State: APzg51CgwX6j9+PkoYVmlO+kcsakQmIfx4VWv4bpg4pfkBb5V82iZUd0 ReedBOCgHm7LQiuxhYUNSMkO17pv+AYLgpwcGszwzw== X-Received: by 2002:a1c:ac04:: with SMTP id v4-v6mr1365809wme.51.1536597130197; Mon, 10 Sep 2018 09:32:10 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:adf:9dcb:0:0:0:0:0 with HTTP; Mon, 10 Sep 2018 09:32:09 -0700 (PDT) In-Reply-To: <20180910161328.GA13171@infradead.org> References: <20180906123651.28500-4-anup@brainfault.org> <20180906140628.GA10580@infradead.org> <20180910132924.GA6987@infradead.org> <20180910133902.GB21593@infradead.org> <20180910134915.GB30774@infradead.org> <20180910161328.GA13171@infradead.org> From: Anup Patel Date: Mon, 10 Sep 2018 22:02:09 +0530 Message-ID: Subject: Re: [PATCH v2 3/5] irqchip: RISC-V Local Interrupt Controller Driver To: Christoph Hellwig Cc: Thomas Gleixner , Daniel Lezcano , Jason Cooper , Marc Zyngier , Palmer Dabbelt , "linux-kernel@vger.kernel.org List" , Atish Patra , Albert Ou , Palmer Dabbelt , linux-riscv@lists.infradead.org Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Sep 10, 2018 at 9:43 PM, Christoph Hellwig wrote: > On Mon, Sep 10, 2018 at 07:59:15PM +0530, Anup Patel wrote: >> > Yes. external is chained and IPI is still handled explicitly. >> >> On riscv64, there are 64 local interrupts (i.e. per-CPU interrupts). > > There aren't. There are 9 right now, which are your three below: You are thinking very much in-context of SiFive CPUs only. Lot of SOC vendors are trying to come-up with their own CPUs and RISC-V spec does not restrict the use of local interrupts. The mie/mip/sie/sip/uie/uip are all machine word size so on riscv64 we can theoretically have maximum 64 local interrupts. > >> Three of these local interrupts have clearly defined use: >> 1. Software interrupt (inter-processor interrupt) >> 2. External interrupt (interrupt from PLIC) >> 3. Timer interrupt (interrupt from per-CPU timer) > > multiplied by 3 for machine, supervisor, user. Yes, 3 per-CPU interrupts for each CPU mode which makes it 9 per-CPU interrupts. In fact, initial intention was to have these separate for each mode but there is not restriction as explained by Andrew Waterman on ISA-DEV: "One key point is that UIRQ, SIRQ, and MIRQ are just names; the letters U, S, and M don't actually connote anything about privilege. UIRQ, SIRQ, and MIRQ are three different interrupt lines on equal footing. The prefix letters merely reflect the intended use case. So only one version of this description is necessary. I'll try to rewrite a version with a few corrections." > >> Other local interrupts are available for future use. > > The others aren't even defined as other interrupts, but just reserved > fields. And only one bit per privilege level would even fit into the > encoding scheme used right now. That's how it is implemented on SiFive CPUs. This does not mean we will not have more per-CPU interrupts in-future. Regards, Anup