Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp267435pxb; Thu, 25 Feb 2021 01:49:31 -0800 (PST) X-Google-Smtp-Source: ABdhPJzHd0b6jNnTdvicxoxosArfN457vzPhYBHbb40PUoyM8iw4X5iU5VmIpovziSZ0lm1DBCbI X-Received: by 2002:aa7:c150:: with SMTP id r16mr1971215edp.96.1614246571432; Thu, 25 Feb 2021 01:49:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614246571; cv=none; d=google.com; s=arc-20160816; b=AiyMgNZEdnSDoKiA0F3cXToE4/SUrRqKJRPlZYNHnHscy4OgtIywiF5d7ms1vSctWq BryDprib7BJm3Ljd3WtPLx1N8aGBJ3ROjqjHK36Aa34Q50val0ju4XxJd9id29vKUiFv S4I/aQUDQ9InxpOuqW/5u05bOP2J2cMfjpHm29nIDVIdf1dQ42uDrKzsSV/NUdlsQ20L CF7KluoBaAjOKesz1EBx9Kj8w7oK4lyNVisEbfiIaYAECMfkRMf73oKzCft7Ll32t1kr cAEzmKPGcEucV+m/XAiMT/3+7sAsz4brp7SZbGLDX4pVbtQPpIdrOvGa1qb4sT+OUadh kU8A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=zly2Ry5YXSL5utLsGmnSDhcl4t0gzeHVdGQlsZANfVs=; b=i3kIHMSiEOmi2jCseZHHi6z5CiRODDcGsdjhkwdMuoeUBB89LiJ/dKdQHVI+XlxMWA NgOofDwWttgXDkTEWg0mn+wMLksJKNCuCZkB0Pgfmqijt2OClFMesOGpNw7Bil7agBV/ RTwiiKUL5KX5Tw1BxsS3J1fyEqtqh++SM8tJbTxpuqJebnnG0ms72F96CduShQT0pOnq i/pvvowxOk3kYwKdwVJRVN3weIYn8+UjuTt5kXp6hY1b4d3cfnRmB1pItYGFxqZxzw6U 3wJeNwf53KFDy+pMg8sFkrcPn9ZBb/QMhtWSTsT1hccN8aTAJ1mCcmVgZY7RFiIulE2A 93fg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a73si3075134edf.23.2021.02.25.01.49.08; Thu, 25 Feb 2021 01:49:31 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235436AbhBYIGA (ORCPT + 99 others); Thu, 25 Feb 2021 03:06:00 -0500 Received: from relay1-d.mail.gandi.net ([217.70.183.193]:41463 "EHLO relay1-d.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231335AbhBYIF7 (ORCPT ); Thu, 25 Feb 2021 03:05:59 -0500 X-Originating-IP: 81.185.161.35 Received: from localhost.localdomain (35.161.185.81.rev.sfr.net [81.185.161.35]) (Authenticated sender: alex@ghiti.fr) by relay1-d.mail.gandi.net (Postfix) with ESMTPSA id 8449C240013; Thu, 25 Feb 2021 08:05:05 +0000 (UTC) From: Alexandre Ghiti To: Jonathan Corbet , Paul Walmsley , Palmer Dabbelt , Albert Ou , Arnd Bergmann , Andrey Ryabinin , Alexander Potapenko , Dmitry Vyukov , linux-doc@vger.kernel.org, linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, kasan-dev@googlegroups.com, linux-arch@vger.kernel.org, linux-mm@kvack.org Cc: Alexandre Ghiti Subject: [PATCH 0/3] Move kernel mapping outside the linear mapping Date: Thu, 25 Feb 2021 03:04:50 -0500 Message-Id: <20210225080453.1314-1-alex@ghiti.fr> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org I decided to split sv48 support in small series to ease the review. This patchset pushes the kernel mapping (modules and BPF too) to the last 4GB of the 64bit address space, this allows to: - implement relocatable kernel (that will come later in another patchset) that requires to move the kernel mapping out of the linear mapping to avoid to copy the kernel at a different physical address. - have a single kernel that is not relocatable (and then that avoids the performance penalty imposed by PIC kernel) for both sv39 and sv48. The first patch implements this behaviour, the second patch introduces a documentation that describes the virtual address space layout of the 64bit kernel and the last patch is taken from my sv48 series where I simply added the dump of the modules/kernel/BPF mapping. I removed the Reviewed-by on the first patch since it changed enough from last time and deserves a second look. Alexandre Ghiti (3): riscv: Move kernel mapping outside of linear mapping Documentation: riscv: Add documentation that describes the VM layout riscv: Prepare ptdump for vm layout dynamic addresses Documentation/riscv/index.rst | 1 + Documentation/riscv/vm-layout.rst | 61 ++++++++++++++++++++++ arch/riscv/boot/loader.lds.S | 3 +- arch/riscv/include/asm/page.h | 18 ++++++- arch/riscv/include/asm/pgtable.h | 37 +++++++++---- arch/riscv/include/asm/set_memory.h | 1 + arch/riscv/kernel/head.S | 3 +- arch/riscv/kernel/module.c | 6 +-- arch/riscv/kernel/setup.c | 3 ++ arch/riscv/kernel/vmlinux.lds.S | 3 +- arch/riscv/mm/fault.c | 13 +++++ arch/riscv/mm/init.c | 81 +++++++++++++++++++++++------ arch/riscv/mm/kasan_init.c | 9 ++++ arch/riscv/mm/physaddr.c | 2 +- arch/riscv/mm/ptdump.c | 67 +++++++++++++++++++----- 15 files changed, 258 insertions(+), 50 deletions(-) create mode 100644 Documentation/riscv/vm-layout.rst -- 2.20.1