Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp4801729imu; Tue, 15 Jan 2019 06:17:35 -0800 (PST) X-Google-Smtp-Source: ALg8bN7c3Vybs2ZSUhLgTPbZzW/TO+8p4iMj11254oEYMvodq05Zze0p9slWZNCyj3qEQvlSeGpu X-Received: by 2002:a17:902:8a91:: with SMTP id p17mr4381160plo.316.1547561855854; Tue, 15 Jan 2019 06:17:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547561855; cv=none; d=google.com; s=arc-20160816; b=heaokaOtXrkpXTV6hcu10/fsHZC7TW0tqnI8PXc7cglmQQ43GU52gdKyZoXZBV+7+O HAB+T9NUoGxXvkgZNdx4Zm+zeYamPixqMvefZeGHM+RQFuSAvyBu4CmMN0JQsxvveP6C kRryEiCy+a1XbG/JzF4tyqmoheSx+KbWlkS77EL10FbRMT6Bt1ZSNvezdOX/xim5MRGu 1kNIJB+AoqksD5c/ek95pyoMqimI1btUSdxAK3U9V2a0CzlEAlT8DEJjHMTHqC6jN49x vlUGdpx8hDdrK+zWWWjGLh5QpO0ImRPDpJSPk3yQ4bZH4tMXeXOQZCpQR7kz/vclqcUC kvbA== 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=HKwWGfjFsBOepYIjsvu+8/WUfnnmynO3PAyY32Kp0b4=; b=ba7NBUsRxGAmpIiaBqn2ZIec+rsi3XQl8YmMV9AF/TjO1POyo1ulhQq/up8wbZc0T8 RlurZ3p15gfSgPNS8DQ8A/W54BJJ4nCg6lpslX7GgoX7cjuB0hf9yPFwlIEGVXfknSGC Mt9M761UQ/qyt2r6nX+OU+zYyuV/4Cy2DJgSIVBznz5HzFoJQO96hREqYxLmaLaaBhC/ 4/MCWHMAvc50BiMiFsqstK3AvwV1Fuil+CuG68mlQzP8uxgCw6/OoG2Hw4x6vEFC0Yw1 WN/2TuWiFuO8X4YXDx5O6gKx9xRKoc6YfWKVPv6pXRBVEzn5EapvvqmqDbtWXTWg3PQB hQWA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=fXM3Hw6n; 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 q20si3452930pgl.268.2019.01.15.06.17.14; Tue, 15 Jan 2019 06:17:35 -0800 (PST) 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=fXM3Hw6n; 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 S1730047AbfAONrv (ORCPT + 99 others); Tue, 15 Jan 2019 08:47:51 -0500 Received: from bombadil.infradead.org ([198.137.202.133]:60874 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729451AbfAONrs (ORCPT ); Tue, 15 Jan 2019 08:47:48 -0500 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=HKwWGfjFsBOepYIjsvu+8/WUfnnmynO3PAyY32Kp0b4=; b=fXM3Hw6nCzDANnVvjxrhdpcvZ IjcTotK5uLRE45G5QGErESA9zg9CJxAljIx6qNqQq2boo8qKWQ6l3IO1z7gNJr1usQNAp8XOaHWRf +1GBP2YDC/osT3+VWdZhHXUxpA0aBUiX0UJ3FbQECARIJN5BX7lD1kzXeLLhv7QUnbv0Y/M6HvahZ cXqPM3WXIlCAKGzgFY1FOnrymPCxbBbZBobegrbwMsICWY536N9Ta8YuvZB4z0u+Pt1m1CRS8eIrV AR4rXxVzGDHiJfwNPTeLtMtNM9fKRL57Cgje7El0squU3jZgo2GI+OYv5BL8ePHzgAgCNPX32H3JP HBT4aSFmg==; Received: from hch by bombadil.infradead.org with local (Exim 4.90_1 #2 (Red Hat Linux)) id 1gjP4F-0007SO-0D; Tue, 15 Jan 2019 13:47:47 +0000 Date: Tue, 15 Jan 2019 05:47:46 -0800 From: Christoph Hellwig To: Anup Patel Cc: Palmer Dabbelt , Albert Ou , Anup Patel , linux-kernel@vger.kernel.org, Christoph Hellwig , Atish Patra , Paul Walmsley , linux-riscv@lists.infradead.org Subject: Re: [PATCH 5/5] RISC-V: Implement compile-time fixed mappings Message-ID: <20190115134746.GF13216@infradead.org> References: <20190107161047.10516-1-anup@brainfault.org> <20190107161047.10516-6-anup@brainfault.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190107161047.10516-6-anup@brainfault.org> 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 Mon, Jan 07, 2019 at 09:40:47PM +0530, Anup Patel wrote: > From: Anup Patel > > This patch implements compile-time virtual to physical > mappings. These compile-time fixed mappings can be used > by earlycon, ACPI, and early ioremap for creating fixed > mappings when FIX_EARLYCON_MEM=y. > > To start with, we have enabled compile-time fixed > mappings for earlycon. > > Signed-off-by: Anup Patel > --- > arch/riscv/Kconfig | 3 ++ > arch/riscv/include/asm/fixmap.h | 52 +++++++++++++++++++++++++++++++++ > arch/riscv/mm/init.c | 32 ++++++++++++++++++++ > 3 files changed, 87 insertions(+) > create mode 100644 arch/riscv/include/asm/fixmap.h > > diff --git a/arch/riscv/Kconfig b/arch/riscv/Kconfig > index e0d7d61779a6..66094aba9a59 100644 > --- a/arch/riscv/Kconfig > +++ b/arch/riscv/Kconfig > @@ -86,6 +86,9 @@ config GENERIC_CSUM > config GENERIC_HWEIGHT > def_bool y > > +config FIX_EARLYCON_MEM > + def_bool y > + Can you please throw in a prep patch to move FIX_EARLYCON_MEM to drivers/tty/serial/Kconfig and only select it from the architectures that use it? > + * fixmap.h: compile-time virtual memory allocation No need to mention the header name. > + */ > + > +#ifndef _ASM_RISCV_FIXMAP_H > +#define _ASM_RISCV_FIXMAP_H > + > +#ifndef __ASSEMBLY__ As far as I can tell we never include this header from assembly files, so this ifdef should not be needed. > +/* > + * Here we define all the compile-time 'special' virtual > + * addresses. The point is to have a constant address at > + * compile time, but to set the physical address only > + * in the boot process. > + * > + * These 'compile-time allocated' memory buffers are > + * page-sized. Use set_fixmap(idx,phys) to associate > + * physical memory with fixmap indices. > + */ Please use up the available 80 chars per line for comments.