From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3356DC3A589 for ; Fri, 16 Aug 2019 02:07:28 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 03D1F2086C for ; Fri, 16 Aug 2019 02:07:27 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="Pdj3WlEU"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=sifive.com header.i=@sifive.com header.b="Vrg1MvRS" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 03D1F2086C Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=sifive.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-riscv-bounces+infradead-linux-riscv=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:To:Subject:Message-ID:Date:From: In-Reply-To:References:MIME-Version:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=97LmymEkPDqIn1F+3ZUX6OG0gbB9YyiI9vOkgDt7MCw=; b=Pdj3WlEU+Ci1v4 gjxIQ2xxBOTgsAe59ZMakI3AdLLOkHRC6nhTuP8aIA+r3l4v5Cd5Y+th4ogVDHfHEsANrV9sGwOi1 vqx+aGNd3nGiagnevVPl7FyUGtfUJwjggsb4kjxu4x8W47vQjkqXP7tx+XyXyXwRL99O+sb/BEIOc HjKAH0NwEJ1ppn6wMUOUvMNdtkuxWhpA3Q+7/IfNkuG8/ulFoFDkWnhsFQpXzYYm/OXcxSYTjGawT 7ZDwFrKtwvQGhE0J7mCXj01Iz+QGBWRxLeXraJq3Owl4Ivpv6QDUxruAhO/RKSiumwLqV93y+L7Io bgxNzLQs49KOhIAtzLbg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92 #3 (Red Hat Linux)) id 1hyReD-0003Pl-Mr; Fri, 16 Aug 2019 02:07:21 +0000 Received: from mail-wm1-x343.google.com ([2a00:1450:4864:20::343]) by bombadil.infradead.org with esmtps (Exim 4.92 #3 (Red Hat Linux)) id 1hyReB-0003PN-ET for linux-riscv@lists.infradead.org; Fri, 16 Aug 2019 02:07:20 +0000 Received: by mail-wm1-x343.google.com with SMTP id f72so2800908wmf.5 for ; Thu, 15 Aug 2019 19:07:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sifive.com; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=4t96VrJO/aS/379GpZWL86SzmnziIJmi9L5o4u6HMF4=; b=Vrg1MvRSi8MEcTXWax28fm0Y94Y7L5w+dEhHm7nUDN1z0jmBLy24d5m6CjB6CtBncW cwSehAxMSaXQkSvTDrT0bkZx8wgxMt450myd8vIxr61UpKOG7hJ78gwa36Qs8GCcxGn5 /Cm2jQFdyB3LcbgB8kSa/5IqQ3L8KM3Z23Wf1UCneAopPqfQ6YaXBiLK2h9kb2eEmal4 cA3i9k9b55mm6naet6z3jF7eiquU/CxjIcGGUMhyO4dHR6qDzP4egWjhYqlbfOpvT5QZ uBNQt0gRL27bLoYVNBFSiVCtMB8/v2XNg5+xD8ZUy9gYPozeLXlnUsComPwI+KJ2H6LD B0Eg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=4t96VrJO/aS/379GpZWL86SzmnziIJmi9L5o4u6HMF4=; b=geI9MLmSLmLbtcg6xtOQoiMlRwTJUGCuz8m/YXZw1CpbBHEEx2FxFm9IW05iM9EyHU fwLKYTTpXsqRsqFwxWDA3XJmDTTo1KbIc+TtbJiPjUby9k1Tg50aPrsNH1j63bpkqYIJ zyf+xYAam4HzVT+4iU9PUu3oSmtpfH+P1oBW8Bth8g6V1PdSo5M1w725oGjerUcCLedx 09lk9dicO28HG/3cLjeqRxDEF7rx7T1BgrN4ry5Pw0umeGXyQVpq5vy+JIJLYGqHTKPI aoKc0LYmVOIXPPptDXAr4p5ADzVuQgml7Asz5EHNZcaTCiMe35P7jW7VTjRauQK1iO8I roKQ== X-Gm-Message-State: APjAAAUhS2T1vrPWR0QFYKy9Pl9lkA+sG8WGBfoIHG6X0WZAqJFEoodC LRryN/gKKBdjCVzmVtFq3illy9oCxZEx9b92Z937TKlgsOzbo08p X-Google-Smtp-Source: APXvYqzaPRbihIfvjiZQdpb4iYG/ZGbwtATyK9eaeJCOhTmwwtc9szneogjAecpmFOj7nVFCAbo0J7G18lcSWjtbQSU= X-Received: by 2002:a1c:2dcf:: with SMTP id t198mr4510657wmt.147.1565921237851; Thu, 15 Aug 2019 19:07:17 -0700 (PDT) MIME-Version: 1.0 References: <20190109203911.7887-1-logang@deltatee.com> <0926a261-520e-4c40-f926-ddd40bb8ce44@deltatee.com> <96156909-1453-d487-ff66-a041d67c74d6@deltatee.com> <5506c875-9387-acc9-a7fe-5b7c10036c40@deltatee.com> <8b7b6285-dd85-5895-8653-be1f6f08cca8@deltatee.com> <315f8a06-72f8-9ee8-4a3c-aa9e66b472fd@deltatee.com> In-Reply-To: <315f8a06-72f8-9ee8-4a3c-aa9e66b472fd@deltatee.com> From: Greentime Hu Date: Fri, 16 Aug 2019 10:07:05 +0800 Message-ID: Subject: Re: [PATCH v4 2/2] RISC-V: Implement sparsemem To: Logan Gunthorpe X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190815_190719_524505_36668E9A X-CRM114-Status: GOOD ( 18.83 ) X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Rob Herring , Albert Ou , Andrew Waterman , Palmer Dabbelt , Linux Kernel Mailing List , Stephen Bates , linux-mm@vger.kernel.org, Greentime Hu , Paul Walmsley , Olof Johansson , linux-riscv@lists.infradead.org, Michael Clark , Christoph Hellwig Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-riscv" Errors-To: linux-riscv-bounces+infradead-linux-riscv=archiver.kernel.org@lists.infradead.org On Fri, Aug 16, 2019 at 12:20 AM Logan Gunthorpe wrote: > > > > On 2019-08-15 3:31 a.m., Greentime Hu wrote: > > Hi Logan, > > > > On Thu, Aug 15, 2019 at 6:21 AM Logan Gunthorpe wrote: > >> > >> Hey, > >> > >> On 2019-08-14 7:35 a.m., Greentime Hu wrote: > >>> How about this fix? Not sure if it is good for everyone. > >> > >> I applied your fix to the patch and it seems ok. But it doesn't seem to > >> work on a recent version of the kernel. Have you got it working on v5.3? > >> It seems the following patch breaks things: > >> > >> 671f9a3e2e24 ("RISC-V: Setup initial page tables in two stages") > >> > >> I don't really have time right now to debug this any further. > >> > > > > I just tried v5.3-rc4 and it failed. I try to debug this case. > > I found it failed might be because of an unmapped virtual address is used > > in memblocks_present() -> memblock_alloc (). > > > > In this commit 671f9a3e2e24 ("RISC-V: Setup initial page tables in two > > stages"), it finishes all the VA/PA mapping after setup_vm_final() is > > called. > > So we have to call memblocks_present() and sparse_init() right after > > setup_vm_final(). > > > > Here is my patch and I tested with memory-with-hole. > > It can boot normally in Unleashed board after applying this patch. > > Great, thanks! I'll roll this into my patch and send v5 out when I have > a moment. Can I add your Signed-off-by for the bits you've contributed > to give you credit for your work? Sure. Please use my Signed-off-by: Greentime Hu _______________________________________________ linux-riscv mailing list linux-riscv@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-riscv