Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp5548621yba; Tue, 30 Apr 2019 17:14:26 -0700 (PDT) X-Google-Smtp-Source: APXvYqwSWT+a+O2OWp4LAqktQmqfCAklSBXxfPrmEBNcH0QiJA8F97nBxkYNW8UBA2TKrNcobXvw X-Received: by 2002:a17:902:b614:: with SMTP id b20mr36498144pls.200.1556669666527; Tue, 30 Apr 2019 17:14:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556669666; cv=none; d=google.com; s=arc-20160816; b=dZXLfnbgKuMme+YRpon+Ap54uTeLPkVaB1iVWSYPua4yfvpKfCumVbqes1GLid1yOM nrHiJO7CRrgsPINGhhTQluU3jdCZlDSkvOoiboVH+kIZsuvzycfHG2ekNt4IDnD0F2g0 Yr2R4ZrqBWC5AAXpN+v9I2GLNmkPaasQreYKWCAYxZ9+ldKwOiukCtf9KUXVsJ3XKvJR rUVjd3sZjaABTR6F68if/tn7oWg+UHnDxJe+rLmR/B6juQbvYmRkkRI9No2PrfrJsVXD jgWtQw4BmKaJwiP7p/LlkMM/+kHybO13poVwZy4bOxvkiJiuNQWkzEzBENO/FW/pk1yQ 7HAQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:to:from:cc:in-reply-to:subject:date:dkim-signature; bh=n90B8MYDWGqupHdVkvG3Sa9M/75lyqhQ0w6dVuFCRvQ=; b=wOPlY4STz4+2zUFoWmobLHdCapa7xANhWPOL4rPMF6ttw55M8nuzC1RerQZHQrxvJF uUHl0YLxatyv9yJLcjYc/uPbQCJek/vifkilic2O5mVurFIDmXcHN90SCmuYKLHcsnNV BLtWIHDOSZuZmbP4zdrJrE5Yp7RDJ1z6eqKaU4/3xzBgOAZqdLsYGl9oW8KfmNLrpD1/ 5dygwX7sSo3b3p2iRoqjvDklRh4l8CnbzqZlY/fMSXesA2f8vhPanDf3oOcNIHI35imn PrTwquoeO2xITeiyTgQdoYD+pTVX0Bwjz1sXQGE9vy1HVx4AczTRTFYI8GiJyWzOUuxR VwAA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sifive.com header.s=google header.b=fz3LLeMX; 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 d185si30879135pgc.590.2019.04.30.17.14.11; Tue, 30 Apr 2019 17:14:26 -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=@sifive.com header.s=google header.b=fz3LLeMX; 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 S1727001AbfEAAL3 (ORCPT + 99 others); Tue, 30 Apr 2019 20:11:29 -0400 Received: from mail-pg1-f194.google.com ([209.85.215.194]:42527 "EHLO mail-pg1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726115AbfEAAL3 (ORCPT ); Tue, 30 Apr 2019 20:11:29 -0400 Received: by mail-pg1-f194.google.com with SMTP id p6so7594253pgh.9 for ; Tue, 30 Apr 2019 17:11:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sifive.com; s=google; h=date:subject:in-reply-to:cc:from:to:message-id:mime-version :content-transfer-encoding; bh=n90B8MYDWGqupHdVkvG3Sa9M/75lyqhQ0w6dVuFCRvQ=; b=fz3LLeMXyIc9PDobBtlU4B9pqlr0EaTXxaCBg/lt6J4NWYK5WAuaD9QH8xyaLon1ox l38C2RASV64lMgKvkO095dM6uV89n2zcJCHv9thNFJjvL7mAq8rHpYtugPzKXr/EMDs6 sqEpPqrqY20GvD33mNaSiJXIDJY38HjYrggp9aIHYOdR9QI1AbL/IPKdA/tl7salfe+G 9ocTqRTQXG/1e7AbXLPXZhgjMh8TlSMbXMJ/dV6GID2Y1oUaHDtGt78EMoOUO4RBIKWX OwZDqEACwVvEMWIqOyq6Jo2MTW5Gk3dC1uRNTUkZ4b3gdL7U3sl90LWdkkKLlzOKILse wz/w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:subject:in-reply-to:cc:from:to:message-id :mime-version:content-transfer-encoding; bh=n90B8MYDWGqupHdVkvG3Sa9M/75lyqhQ0w6dVuFCRvQ=; b=WF9aUXDVuGhUA+mnrNlRe2ImZIuhU6ATaPPkb8IcfPmZfG3bhNM4QYzUSgfhJ1AmB4 PNi/2h2/j/9aB3U6yFmfiy0BYmwszJhrIPwo5gNhjGWCalIvSrY0BFdET2kc6vRC3Aua HnxZ7sWr4HnYTTur43D45xKOmh6KWIoZfn2YRb3kmHxUTQ3ZA9XTc91MJJpwOsPm0HyJ Bo1UgN2dYiA2Bd/dc/XJpo1FvfR+HJCKVoBVDJSuZfL6zkMbOeJ0vTr4usLxEv16gdNy 8RQeT9zB47kCygrOqRiu4zhQMklF7+q9kqJ95fZN3M37IwOPbHGKIz5ZNikIf4oW7Qqa NBDA== X-Gm-Message-State: APjAAAXjnRVLtBtk+6dBLoYm75Al4mjQc2wzOXhmdluFvEhPdLTNgQ44 nMxJeJEcc3Gyki92dW5O+5kkcg== X-Received: by 2002:a62:e043:: with SMTP id f64mr17920095pfh.76.1556669488429; Tue, 30 Apr 2019 17:11:28 -0700 (PDT) Received: from localhost ([12.206.222.5]) by smtp.gmail.com with ESMTPSA id x6sm17984783pfm.114.2019.04.30.17.11.27 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 30 Apr 2019 17:11:27 -0700 (PDT) Date: Tue, 30 Apr 2019 17:11:27 -0700 (PDT) X-Google-Original-Date: Tue, 30 Apr 2019 17:06:59 PDT (-0700) Subject: Re: [PATCH v6 0/3] Allow accessing CSR using CSR number In-Reply-To: <20190425083804.11991-1-anup.patel@wdc.com> CC: aou@eecs.berkeley.edu, Atish Patra , Paul Walmsley , Christoph Hellwig , linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, Anup Patel From: Palmer Dabbelt To: Anup Patel Message-ID: Mime-Version: 1.0 (MHng) Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 25 Apr 2019 01:38:24 PDT (-0700), Anup Patel wrote: > This patch series adds support to access CSR using both CSR name and > CSR numbers. > > Also, we should prefer accessing CSRs using their CSR numbers because: > 1. It compiles fine with older toolchains. > 2. We can use latest CSR names in #define macro names of CSR numbers > as-per RISC-V spec. (e.g. sptbr => CSR_SATP, sbadaddr => CSR_STVAL, etc.) > 3. We can access newly added CSRs even if toolchain does not recognize > newly addes CSRs by name. (e.g. BSSTATUS, BSIE, SSIP, etc.) > > The patchset can be found in riscv_csr_number_v6 branch of > https//github.com/avpatel/linux.git > > Changes since v5: > - Drop redundant INTERRUPT_CAUSE_FLAG from kernel/irq.c > > Changes since v4: > - Express SCAUSE_IRQ_FLAG in-terms of __riscv_xlen > > Changes since v3: > - Keep old INTERRUPT_xyz defines in kernel/irq.c for PATCH2 > > Changes since v2: > - Dropped PATCH1 which added asm/encoding.h > - Added new PATCH1 which beautifies asm/csr.h by using tabs to > align macro values > > Changes since v1: > - Squash PATCH2 into cpatch3 > - Added new PATCH2 to add interrupt related SCAUSE defines > in asm/encoding.h > > Anup Patel (3): > RISC-V: Use tabs to align macro values in asm/csr.h > RISC-V: Add interrupt related SCAUSE defines in asm/csr.h > RISC-V: Access CSRs using CSR numbers > > arch/riscv/include/asm/csr.h | 123 +++++++++++++++++---------- > arch/riscv/include/asm/irqflags.h | 10 +-- > arch/riscv/include/asm/mmu_context.h | 7 +- > arch/riscv/kernel/entry.S | 22 ++--- > arch/riscv/kernel/head.S | 12 +-- > arch/riscv/kernel/irq.c | 16 +--- > arch/riscv/kernel/perf_event.c | 4 +- > arch/riscv/kernel/smp.c | 2 +- > arch/riscv/kernel/traps.c | 6 +- > arch/riscv/mm/fault.c | 6 +- > 10 files changed, 111 insertions(+), 97 deletions(-) > > -- > 2.17.1 Thanks. I've added these to for-next with a minor merge conflict, but I think I managed to avoid screwing it up!