Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp598179ybz; Wed, 15 Apr 2020 14:51:46 -0700 (PDT) X-Google-Smtp-Source: APiQypLG/5JGouieKCbI/Ywb3h0VICFqfUybIprj5VBOW0A0PuFXTaT3ABIcemqEvWJxv7VCX+jz X-Received: by 2002:a17:906:6944:: with SMTP id c4mr7047924ejs.96.1586987506298; Wed, 15 Apr 2020 14:51:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1586987506; cv=none; d=google.com; s=arc-20160816; b=K1O8H58UuHOfJ1piEY5FiOZHXr32m4CbsQ3mG/A9X9B1au3qrfgy2fQfgbhxW02I22 Z8UTkfqU66NkxxAZPMb5Q8zxQ3W4sKZXTF0TUr8iHsUi8nygGn4vcTWvLRxVN/+PObu7 om9yV7ICkyx7gECK12Scw9M7BI/0gR44lfi7qfXrZalRFORkj1MSJZ9Hp0JFE4GwSozb /dO7hMxp9arutlUd9qcn9Pm0137ONBbJJ5p6T8ZvR3fIKvrraK+LEDKRww8MmWuq46Io 8p22jhrrBOr6h3CovQaiTlsJk1GP5lj4Eqch41eTYhI5AQIuOgZLnTVqTcvkwWOeFDde LsfQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version; bh=vwEpIy63mCp7p6IJUCWsO8m2bH9JPoxPbbC8HMS4EpQ=; b=WFlhZKwbyfffdhhlKF/LR/mr6eq/TdaDyKrzSPSNDv7O1YrseI5nTLVdYr9a8PiC6V pE87pllnxneUOZ7L+WVyBC+kPspmr1HRTFT8GFOvE4qsAZ6j0/y4iTtgb0la3sVgzOnW 81wa7s0yNQgEqevfk89TSMNdJH9droDzvFS1f7DJ3kYmDbIiUEDh6QGFtlcgpNCLk5fW lblRUabyinROGVZrnK8IUwH++W5ofIUhUtgwtAfc4w29He5tJZSDMQ8NpzADcldFxlJ0 8PXoGofPH8trtMMO1nhs5TKwJMLpv4tipclvniUJpFkr0vvfaijoVfz/Ogi+Vs4TtdlH lTzQ== 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 v11si1747919edq.225.2020.04.15.14.51.22; Wed, 15 Apr 2020 14:51:46 -0700 (PDT) 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 S2504808AbgDNTas (ORCPT + 99 others); Tue, 14 Apr 2020 15:30:48 -0400 Received: from mout.kundenserver.de ([212.227.126.187]:55329 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2504780AbgDNTaH (ORCPT ); Tue, 14 Apr 2020 15:30:07 -0400 Received: from mail-qk1-f172.google.com ([209.85.222.172]) by mrelayeu.kundenserver.de (mreue010 [212.227.15.129]) with ESMTPSA (Nemesis) id 1MQuwR-1jaLEZ0i2h-00NwtH for ; Tue, 14 Apr 2020 21:30:04 +0200 Received: by mail-qk1-f172.google.com with SMTP id s63so10483733qke.4 for ; Tue, 14 Apr 2020 12:30:04 -0700 (PDT) X-Gm-Message-State: AGi0Pub4pMjp5p2ppQ6UuhWsUgfnW/U2f029O279AsmsgkBrx6Fy8usM JdnMiEIJBHbt6G6jdP0Mw+/yF5yT1K2LNPb0rIU= X-Received: by 2002:a37:ba47:: with SMTP id k68mr11683991qkf.394.1586892602983; Tue, 14 Apr 2020 12:30:02 -0700 (PDT) MIME-Version: 1.0 References: <20200331093241.3728-1-tesheng@andestech.com> <20200408035118.GA1451@andestech.com> <20200414151748.GA5624@afzalpc> In-Reply-To: <20200414151748.GA5624@afzalpc> From: Arnd Bergmann Date: Tue, 14 Apr 2020 21:29:46 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 0/3] Highmem support for 32-bit RISC-V To: afzal mohammed Cc: Russell King , Alan Kao , Eric Lin , Gary Guo , alex@ghiti.fr, David Abdurachmanov , Anup Patel , "linux-kernel@vger.kernel.org" , Andrew Morton , Steven Price , atish.patra@wdc.com, yash.shah@sifive.com, Albert Ou , Palmer Dabbelt , Greentime Hu , zong.li@sifive.com, Paul Walmsley , Mike Rapoport , Thomas Gleixner , Borislav Petkov , Logan Gunthorpe , linux-riscv@lists.infradead.org Content-Type: text/plain; charset="UTF-8" X-Provags-ID: V03:K1:Df43qj2SA4S2VfPKp8EoZz7iC7KYLvuevpOVE9X1GwCJIlxOtjL 5WQw0WxGih7qczlKYVakdqMW9lNwr/mRzPGWz7SMShqo+Q15LT1n9VSOOW8bZY9potVaKB3 6k243y/o71F95TujfYuFin/0KS7HHgEnhNpUkwgMl5qJ6boX+Vqgb1IQzi5GnM1F1OSKL6r wTTuZuVwwK38nThXtvOLA== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:p7Mmpv5kuDE=:fgZEshYEnBtw4EEttDHdka qh+2tN/a2FLYxjGLFedVhXCyhOcfZr0WX4gayZ3wm8LQIPWV6Vr7Jbk0sPSbDYHLgXGayduY3 u3BUvHqNv1P0qj965m4JrEEPdnT1Gz8pBbhuHlf+wX3GNGHgTE31NRTOH/gYk+DgM/2UBQfiw hhGAPpa+yscuRaUm3csBqmxYlHUG5shWpycCvRi0Yr93Z3ubOH7PN09YXILeJNgr274vgpZfZ seWfejrRRdgmDBpDCBUitJ/2jLkTxh3gD9KDADGdPybzfOh+McyH+6Jkp8z882gl/0kTaUM7i pmHTLgJJf7jcj7ewukzM/aKoaB89KE7A7b1dyb/ZiJ5tdSFLj2Y/CulgpC8/Unk9E7JgRv3rk YvV7WJZ7aoMvv7U5+CBDLtJhHWcRjfRogiJQItEpv+vL0IRgIoaCZgl7Ntl1Nbxdh0D8XwKIX Q9HNIzkJJqO+RdipmSEXNcn0YBhkaameqYI22TRMglhSvhYoWKqBRCRSVUPvLtVkd+DXUl/zi owdOmR3+Twu/1f30Kdw0oX79rKh0tRXS8jy5RrqjEwIsnpFgb/X1KEV7ST1zriw11GF88ov4I mw9G6PAsp9azclU2AjxDEBI7o1eZUPuj08wOMcpIXcPP+tR6Y/1LQ2/QMeI8T1Ordb8mYEVL1 GHoe+qbOR1f7JSAAUUZoRoWvyVYlGqIuMV60WA1XJRIVXGNzMjWOwTkpYDWlqSsd1G6SmXjXJ t32MvRQXZeZpCiZpvS+jWJYFkqaOzNxdEH6Ldp0Terxhfb0S75PMO9pjwL65jLF8YNjJjNoH3 913Wli7tWmf+B4BLz7Gu+lEcKvGq+FMjlPr3tI/68pHtAX9xDI= Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Apr 14, 2020 at 5:17 PM afzal mohammed wrote: > > + rmk > > Hi Arnd, > > On Wed, Apr 08, 2020 at 04:40:17PM +0200, Arnd Bergmann wrote: > > > No code yet, so far not much more than the ideas that I listed. We > > are currently looking for someone interested in doing the work > > or maybe sponsoring it if they have a strong interest. > > If no one have yet taken it up, i am interested in doing the work, i > will sponsor myself :). i will proceed at a slow pace without derailing > my other things normal. > > To keep expectations realistic: i have not yet taken task of this > complexity, it is more of a learning for me. My familiarity with Linux > at the ARM architecture level is mostly on no-MMU (Cortex-M), have not > worked so far seriously on MMU Linux at the ARM architectural level, > though used to go through ARM ARM v7-AR at times. Thanks for offering to help, it's very much appreciated. Let me know how it goes and if you have any more detailed questions. > i have a few 32-bit ARM Cortex-A (A5, A8 & A9) boards, maximum RAM 1G, > none have LPAE, seems i have to buy one for this purpose. I would recommend starting in a qemu emulated system on a PC host, you can just set it to emulate a Cortex-A15 or A7, and you can attach gdb to the qemu instance to see where it crashes (which it inevitably will). You can also start by changing the functions in asm/uaccess.h to use the linear kernel mapping and memcpy(), like the version in arch/um/kernel/skas/uaccess.c does. This is slow, but will work on regardless of whether user space is mapped, and you can do a generic implementation that works on any architecture and put that into include/asm-generic/uaccess.h. A second step after that could be to unmap user space when entering the kernel, without any change in the memory layout, this is still mostly hardware independent and could easily be done in qemu or any 32-bit ARM CPU. Another thing to try early is to move the vmlinux virtual address from the linear mapping into vmalloc space. This does not require LPAE either, but it only works on relatively modern platforms that don't have conflicting fixed mappings there. If you get that far, I'll happily buy you a Raspberry Pi 4 with 4GB for further experiments ;-) That one can run both 64-bit and 32-bit kernels (with LPAE), so you'd be able to test the limits and not rely on qemu to find all bugs such as missing TLB flushes or barriers. Arnd