Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp240392yba; Tue, 23 Apr 2019 23:49:14 -0700 (PDT) X-Google-Smtp-Source: APXvYqyHUlKiEVbUL7134HeqSITCKaSgeGw7b1FlyeelMVHOhHcTY0yMUt/JT+7g0tNYVfFbJC1Q X-Received: by 2002:a17:902:b10c:: with SMTP id q12mr31427467plr.254.1556088554197; Tue, 23 Apr 2019 23:49:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556088554; cv=none; d=google.com; s=arc-20160816; b=QxaDSu+LmbBDXBWFWyhd14HA2p1Lukd1aaNxYsD27pB946mZ/+i3subYTEWaynMXry wMuw+gtvjrnhgmtUZkmxW/lg9YuJlYcxbnNVVRj8cassFsTiwpPvQQtugGrj7bO1N3Lr 1+PkZNYUzFXsU8djxuxbvRUnIGYgtU/mFQF1Kg0aw/H90TorH/Xti9cS+G2oNDtbXzgD 9FkSnN2S3d8/M8dLQcGx7E0lIHCU5a1w9ObnOxWWVz5QZfkdtZ2Ko51VbZfzrC6oE6u9 1dhK9QilWBFJ7FX3vdXGKXuVATj2TR3iRAlY5Reky28KEPPoTdWVtMbhAvRbsRmnbIhC VQmA== 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 :in-reply-to:references:mime-version:dkim-signature; bh=AyVK2GRakZiSagpjjAHHtZd/+k3S6z9JMKxhTl4oqnk=; b=sForgtqyECemgyhY1fW+tVPR6UoWYAV+9g2IQPbC8lxzv+oG5tUYrY35i172qZEqYw lfFkehh4JG5G0yKcZLQPPI26imBUDsTwfpLs7hVyEffUdBMW7a6wrDoyQXyTCN4ortoH uYELKgKdvAAV7QVlSOYdwDoT/nv0LLzP0QlgXPdeGaSt2FHZwTxbZ8giiY1ag0jqEOjV pL1TCAn9lpwfOGNlVdLD5AbXbSoDSS39uL0NQ8NxQZ4S2o3KIjvurMlZmvQiPK6Dlowf aFoTnN33Gdj914NuZ7ORWgBMHdRQ3VwPHKljY9qJY9+DbLlOghbFjLOxIHq7xhDE/wvU KhVA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@brainfault-org.20150623.gappssmtp.com header.s=20150623 header.b=HBY7dkAy; 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 c12si17032822pgj.461.2019.04.23.23.48.58; Tue, 23 Apr 2019 23:49:14 -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=HBY7dkAy; 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 S1729862AbfDXGp7 (ORCPT + 99 others); Wed, 24 Apr 2019 02:45:59 -0400 Received: from mail-wr1-f68.google.com ([209.85.221.68]:33383 "EHLO mail-wr1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727039AbfDXGp6 (ORCPT ); Wed, 24 Apr 2019 02:45:58 -0400 Received: by mail-wr1-f68.google.com with SMTP id a3so13816323wrx.0 for ; Tue, 23 Apr 2019 23:45:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brainfault-org.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=AyVK2GRakZiSagpjjAHHtZd/+k3S6z9JMKxhTl4oqnk=; b=HBY7dkAyqC/HNR6mbKXMpZUMyhGjlkdKC62ZFnZYR5uBPx8SHDEmBv6ED1ytC9vtH4 RTVl6nNHJQbWTzaozEuAwJSbGgIPnbI83yCwU3+gE+YVQDkVtjlRf0ZM2Ouj9KzfYfUp YnWsVi7npWgoTCdpANmv807o7SDGbttPdKMVqK3N9jNvdyr/s2DoGwPdcXav8wGPb1zf OJ/9pxg5K10iquAiPB6zFKbM/xDGiEXIN4wYtSVhxSRn68arFNd9FQj6RRzsOW5Y/8l2 qck+ko5bSQm9K4CCVJb9fW605JGurqLUudZz0jhCZI12+1ZlUoMUMkCMg4cpuTUcQWU2 uenQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=AyVK2GRakZiSagpjjAHHtZd/+k3S6z9JMKxhTl4oqnk=; b=VJvujiSRYoFqVofHFercmgRgJO2LHvTDqVy9acVU6mVb0gGxUNXOHt1N1EmYvf023u IOiMov3xf9kq/YlugvnoQpg4Zmj850a5aar4zw9Un7qUurPleSqesJBckmCwSEwOfWS6 Iiwe3135t825eu66WzoR5FMI8P22LLctb/oVwA6IGxTtwvgqaH9tObWqla22b8LupKgq XQXqTeYF1FgfgMfJLTRgLi5ZpslKBcl6OqLrLHxAX2f60q95cRGaPK/MrBCJOn+EeHPL K73KxENwLXmRSoaTazp8DnfNcRe6NMT/aBvvWCMG+HEXvO9m2YCUNxAgk6rVM9XALwHe cl+Q== X-Gm-Message-State: APjAAAW2zM/QDea8RiE4ALtvHb+NQxpJAw/qDJbtDOaSutDT0fQW/siN 4jDyuwENnYZ/rTnMPCYLBRkw7u6mcy7GHGi+0+XP8kbfNbk= X-Received: by 2002:a5d:5346:: with SMTP id t6mr21566738wrv.59.1556088357115; Tue, 23 Apr 2019 23:45:57 -0700 (PDT) MIME-Version: 1.0 References: <20190415093648.7525-1-anup.patel@wdc.com> <20190415093648.7525-3-anup.patel@wdc.com> <20190424062947.GB10400@infradead.org> In-Reply-To: <20190424062947.GB10400@infradead.org> From: Anup Patel Date: Wed, 24 Apr 2019 12:15:45 +0530 Message-ID: Subject: Re: [PATCH v3 2/3] RISC-V: Add interrupt related SCAUSE defines in asm/csr.h To: Christoph Hellwig Cc: Anup Patel , Palmer Dabbelt , Albert Ou , "linux-kernel@vger.kernel.org" , Atish Patra , Paul Walmsley , "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 Wed, Apr 24, 2019 at 11:59 AM Christoph Hellwig wrote: > > On Mon, Apr 15, 2019 at 09:37:23AM +0000, Anup Patel wrote: > > This patch adds SCAUSE interrupt flag and SCAUSE interrupt related > > defines to asm/csr.h. We also use these defines in kernel/irq.c and > > express SIE/SIP flags in-terms of SCAUSE interrupt causes. > > I'm not a fan of this. For one this pollutes csr.h with bits not really > needed by most users, and it makes adding the M-mode nommu port which has > to use the M-mode causes much harder: It's not polluting asm/csr.h because when we get interrupt numer in lower bits of SCAUSE CSR. These defines certainly belong to asm/csr.h because they represent possible exception causes when we get interrupt. We need these defines for programming HIDELEG CSR in KVM kernel module so it will be used at multiple places. > > http://git.infradead.org/users/hch/misc.git/commitdiff/1221f5c32345ebe7ea2c1cd6e8a01ad4b422aaba You can certainly use these defines in your nommu commit by using "#ifdef CONFIG_M_MODE" in switch case of do_IRQ(). Regards, Anup