Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp296135yba; Sat, 13 Apr 2019 00:56:55 -0700 (PDT) X-Google-Smtp-Source: APXvYqz4G411PaoccTu3VG718/SoUMcEwihJy5FZyRd51vwxxmAB//sCW/oZ5fsBhPhqgNxk/CCT X-Received: by 2002:a17:902:854c:: with SMTP id d12mr15221404plo.150.1555142215725; Sat, 13 Apr 2019 00:56:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555142215; cv=none; d=google.com; s=arc-20160816; b=SIlGyEIPMUqfPvhhWMqnrhdbw3ZkBXNGBL/DTrKBnHgK9Q1vBTHokt2nODiiCwl+mL byR/CIXFYvzBEYO6Abn+ynPOVbRiJtkhf2X7q4Z+Pyxv1L7LQ1va7zgKa64jgAanjfpH lya9gYUmYtl5xJupXwlwnpM/mwVSFhQlBORu8Y8wHMvhSAFoaOwa5GQrm4qpQutg4gC5 1qWQDmh4FgD4dPMp93ZQrxy8HXU48XiMwhf1g1JEpxIdnkHBYu29Rt1lOtmP7wnlr7Gb 6AgT31E79Syy48gsW0aCpoRJaSBN+WfNgGGWC1WtO/rTCeU2PLWbGSc1ARnQ6P8zhRBu qOsA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=WaywDY2HZm18jBKPr1p1ZOnmZ3S+Qtg3xVeq74H9OUU=; b=tfZDP56/wdVUVqN9DzZigGlGEr+0xdKWZY9CED2vsQSYgcy9y3Wf0hM+uHAFlk8hS3 QOa3xlPynbqy0Yf9lpCwv507UGPWGIf9dXPeKWk6S4cd0brmR7YQSeCOiZGY+GAewCH/ 1o1WDCv8U2CVXAnQbWzggOsrAMp3dCbufOv0sZIo9I5bsUdf1RYRbJY41TcBwhlTPh9z 8v0wQHZ5hQmdpgoU87sFrH+fuwfG+lVtBM3XJ7XEojnkcq29VNxoagJo/6gdnW0D2JOp Eoh4Gn2BCbGFKi7scLnzCadCN6fu0+O7I2utLcD98cNd3MddeqncCym3Jg+A9ykcVvjz JPcg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=ZYOq66kx; 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 o3si3199509pld.61.2019.04.13.00.56.39; Sat, 13 Apr 2019 00:56:55 -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=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=ZYOq66kx; 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 S1727185AbfDMHzt (ORCPT + 99 others); Sat, 13 Apr 2019 03:55:49 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:40620 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727066AbfDMHzt (ORCPT ); Sat, 13 Apr 2019 03:55:49 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=WaywDY2HZm18jBKPr1p1ZOnmZ3S+Qtg3xVeq74H9OUU=; b=ZYOq66kx4UAaJi9ef+jhFsvu1 07O+Ga6cnQ21+YjflblEPJ/oqTw/Smvq8UNKX0/xz4A5xfSSGX1A6XHO+G2BjUtdv+v78eNn2/OLy 9HI9I5/h0vQwYgwHa9m4EZks8IWLfjOTU3lc4gLTYtwCF44Kmc5iV5qCAWGN6qdMll5j3baguhL20 arvF2YsINnYDrRL47Fj3WFyzXB3BHjaYQfja0o9YjeDR0s8FL7XtTZ4JKDbh/qUJlW8JioBiDjdSG tC0ABxeo3b7OWsy1FN/DSaW0mH7aIo0pfToPUQeWbluKqWCYPmO+DS2q3pqtt0eRXvy37e0iCArLQ AFhPqIKiw==; Received: from hch by bombadil.infradead.org with local (Exim 4.90_1 #2 (Red Hat Linux)) id 1hFDVs-0000xN-60; Sat, 13 Apr 2019 07:55:48 +0000 Date: Sat, 13 Apr 2019 00:55:48 -0700 From: Christoph Hellwig To: Anup Patel Cc: Palmer Dabbelt , Albert Ou , "linux-kernel@vger.kernel.org" , Christoph Hellwig , Atish Patra , Paul Walmsley , "linux-riscv@lists.infradead.org" Subject: Re: [PATCH 3/3] RISC-V: Access CSRs using CSR numbers Message-ID: <20190413075548.GC30428@infradead.org> References: <20190413073906.53676-1-anup.patel@wdc.com> <20190413073906.53676-4-anup.patel@wdc.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190413073906.53676-4-anup.patel@wdc.com> User-Agent: Mutt/1.9.2 (2017-12-15) X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Apr 13, 2019 at 07:39:44AM +0000, Anup Patel wrote: > 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. > 3. We can access newly added CSRs even if toolchain does not recognize > newly addes CSRs by name. This looks mostly fine, but also please remove all the comments regarding using sptbr instead of satp now that they are not true anymore.