Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp144661pxb; Tue, 9 Mar 2021 18:56:31 -0800 (PST) X-Google-Smtp-Source: ABdhPJwuRqaG0rETRgQmOBkdxx3IkQIkkqnEE3Rey1W/xIUBjfABqbgCCm8+7mFWwMJK7fIFI9Rk X-Received: by 2002:a17:907:211b:: with SMTP id qn27mr1150039ejb.203.1615344991346; Tue, 09 Mar 2021 18:56:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1615344991; cv=none; d=google.com; s=arc-20160816; b=Dl8O4FnCWXgA0XYGnzRhRQoCuXwNvfdCo4vML8O/xsDumJfHLWFUdDhtn61V4S6vY9 zz5ZdgdwnPiJA3vMsfclBTp7nLfUnJT/G1kAU0yPDRiqs/VAYEfuX6CDD1aCqMgInQEH ISZHw0PnLtEWquhG3rWJojK+3BLcgoJXaXUAyd/OP0a+pD0dHHrdDNsMBEs4s3Q8V7Gj uhlNe63PV0tTY02QUeqOrFR0djZOI6+NzGYAUu6/5RWX3buPuO1NIdncBGPMeRPbsx5a dAsGqv8E1D/obMvE7AoZXAEZRHyQrNTSzt3E/XeclbT/WE5xdtI3BFik3F2vJZfgEfiS ikGA== 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:to:from:cc:in-reply-to:subject:date:dkim-signature; bh=YBxARwCSnvP/MPs48fuZLZiuQ0mo/90Nc+1kxldAXvY=; b=KbjWMQE67GxueKKobTguBuFeJCdIDzPdcqOEI/KiB5rIocN7NFxTyNburheeqKLiSV o9c+lNhyYeP6V64V7Xz+Nhcv9MhSyhyry2ExwfgB73DJxg8UZV4KSnhGCcwsVMIbUqcA s+CQHNpiu8opwyUrzIBB2iaKC3GulOoQ7gXvhB/97GfTH6G6dfvpJ3fgp2oqwlgZGhDe RfobXhsZ9XtWVTcMpi3pZu0ysAvuepmybzezj+cuD9EfSdm3EsLJ9nrueCsKtN4rajl5 vlgRzdkXCe+WFC43tdd0C5qxghft9AfjCHrlwHlzmj/Yf+Xmkhi4fvuPsbJolYQyaOu+ Ty8w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@dabbelt-com.20150623.gappssmtp.com header.s=20150623 header.b=mgPjitEL; 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 s9si10316995edu.474.2021.03.09.18.56.09; Tue, 09 Mar 2021 18:56: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; dkim=pass header.i=@dabbelt-com.20150623.gappssmtp.com header.s=20150623 header.b=mgPjitEL; 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 S231378AbhCJCyx (ORCPT + 99 others); Tue, 9 Mar 2021 21:54:53 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50528 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232004AbhCJCyl (ORCPT ); Tue, 9 Mar 2021 21:54:41 -0500 Received: from mail-pf1-x42d.google.com (mail-pf1-x42d.google.com [IPv6:2607:f8b0:4864:20::42d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5B21CC06174A for ; Tue, 9 Mar 2021 18:54:30 -0800 (PST) Received: by mail-pf1-x42d.google.com with SMTP id y67so11107079pfb.2 for ; Tue, 09 Mar 2021 18:54:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dabbelt-com.20150623.gappssmtp.com; s=20150623; h=date:subject:in-reply-to:cc:from:to:message-id:mime-version :content-transfer-encoding; bh=YBxARwCSnvP/MPs48fuZLZiuQ0mo/90Nc+1kxldAXvY=; b=mgPjitELPEW/P5qmpcLVfVoA0D6sHZbihRmkHn2T6K9SBG4Ha/LJO/otu10peacMhr LuL0fRZdQLwP7M9wEDrTpBtLj8K8tudZNldX6kZxxwpgoOUxKITkywSl2jzbDDQ+LlzB pAfWpubnARGarXUbdueVAOGEZZwgdwg38kjUrvpm8UlRyhUcHqhOLh/KTMLubon7Kb4n SDBddPEB0kPjpJ49JkLLyjwoA35CMpN5HTgdd0VAg06YzUz21lg3gZ8E6/aU6kC48WxF Iv+Fz7wjENWwmVReUBuT2iyV4vRqfYBaKfQMpvTe0Mkt1040FtnGxaGlyV9nF1Rgq6o4 4rKA== 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=YBxARwCSnvP/MPs48fuZLZiuQ0mo/90Nc+1kxldAXvY=; b=YBCOlLKTsHC9aCtfHGP9Iz6n5zTEH/pqe1/BoWAT/MIy9gz/t6Tj1+vXUzlSUABfuG gy3EWB2Rfam/wuy5VGe9hEeu3QoK9hD/P26dhrfp2di4zoo+l0uKzLDCNwQPOJv/sFE7 Hw+wau+rRHXg4aQnISDoUDJRNvUUpHxEv4CijbRCKiXMqjNreF+UTDvXgoLisz7qAwRN D2RYQIM0UmtEAPON4XaSU8dbv7WJyoIty4r8CIndz8X1loKjM+EhJigqvBncuT+ZrHaK F6Mx57C4cVek7/lk3JXOFxD/iqJqFcBg+yTzmE/wH+XVUk9q/9OIQkjSKslJ7i0HybNT MhtQ== X-Gm-Message-State: AOAM533KXIlWM1AsfN1jwZiCbvwCxcvaNq0N9Y7jjkwuagnTAhPsuhq4 ITDBjdoHj8Gv1T/UcGA6uaukYw== X-Received: by 2002:a62:b410:0:b029:1a4:7868:7e4e with SMTP id h16-20020a62b4100000b02901a478687e4emr891769pfn.62.1615344869693; Tue, 09 Mar 2021 18:54:29 -0800 (PST) Received: from localhost (76-210-143-223.lightspeed.sntcca.sbcglobal.net. [76.210.143.223]) by smtp.gmail.com with ESMTPSA id v1sm4250210pjt.1.2021.03.09.18.54.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 09 Mar 2021 18:54:28 -0800 (PST) Date: Tue, 09 Mar 2021 18:54:28 -0800 (PST) X-Google-Original-Date: Tue, 09 Mar 2021 18:54:03 PST (-0800) Subject: Re: [PATCH 0/3] Move kernel mapping outside the linear mapping In-Reply-To: <20210225080453.1314-1-alex@ghiti.fr> CC: corbet@lwn.net, Paul Walmsley , aou@eecs.berkeley.edu, Arnd Bergmann , aryabinin@virtuozzo.com, glider@google.com, dvyukov@google.com, 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, alex@ghiti.fr From: Palmer Dabbelt To: alex@ghiti.fr Message-ID: Mime-Version: 1.0 (MHng) Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 25 Feb 2021 00:04:50 PST (-0800), alex@ghiti.fr wrote: > 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 This generally looks good, but I'm getting a bunch of checkpatch warnings and some conflicts, do you mind fixing those up (and including your other kasan patch, as that's likely to conflict)?