Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp4218541imm; Mon, 15 Oct 2018 10:58:56 -0700 (PDT) X-Google-Smtp-Source: ACcGV6185gBP6XLWEXrzIh5JK1R391OKnpwBwrXDZbbh06wNqXfPiSYU1pfy2qO76bPeXHya5UZJ X-Received: by 2002:a17:902:447:: with SMTP id 65-v6mr17914980ple.325.1539626336698; Mon, 15 Oct 2018 10:58:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539626336; cv=none; d=google.com; s=arc-20160816; b=gkVrshXOPf7AJU8wCtWquomAIwKs1z4PRxyvR7/2351DeJ0qk9Y4MeTWSJw4L7kMm4 XRzh6FSTxDMB6wO6YG8RlMj+7620GP0JHUsQzN/bC7aZAFwBvJzt4Xd4Cr475mKUuaqu y2sX/KYBOpeG67D9l30eXQiv564FxfqKVKCy3VcMuDUmSlrRqyOaRLaJI40jPGGLlseS dtPSC2gibKx3c8VtljeeeWLArnZSJTQs4mEp+ptgq0yViopGoVP6uyHP494STlvF8YEc 3xYbE+JPqWqohqCYZ9PLiDtq7uf30OvPx2NX18PtCApmTLGSgXhU2Drnw0D2hWl9gRRo dTug== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:subject:content-transfer-encoding :mime-version:message-id:date:cc:to:from; bh=D2QpjoNmTVYsNFBf8qgbeNcuX/zg4UU7imfFExJB4KM=; b=GdUX1UG0BRIenM4FibaQ93UZIiT4XBNcP0PcBK52S+4L8Mp1SjNKtjWX9h6EXXwetC MjZmq1RuRQOgll+0TnnudIbvXdco0d+54C6+Qj6cG9h7w8V5eq2UI4tWYa/ObIfAdfoW euH+I9aWd+ucjbgsxhWIJ8R3YNTGu3zNs8hmC5sP6Wal4wmzToAITXwsACPPlGR6uh2I b1e/XHl+9KAiniU+x4lMFbrztauHbM6Q+zddLJ0oVH8WsKZuYrHhN1sW9qgSR1mrITzD 7AxygcIXyhp8C6hzYA5lLASvSa6BsgXtnyBKa6RvZpALKTIRHJ87WkPVtQ+xz3d3RPfi nHIQ== ARC-Authentication-Results: i=1; mx.google.com; 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 ay8-v6si10979293plb.235.2018.10.15.10.58.41; Mon, 15 Oct 2018 10:58:56 -0700 (PDT) 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; 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 S1727098AbeJPBng (ORCPT + 99 others); Mon, 15 Oct 2018 21:43:36 -0400 Received: from ale.deltatee.com ([207.54.116.67]:54690 "EHLO ale.deltatee.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727080AbeJPBnf (ORCPT ); Mon, 15 Oct 2018 21:43:35 -0400 Received: from cgy1-donard.priv.deltatee.com ([172.16.1.31]) by ale.deltatee.com with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1gC77C-0002IH-3R; Mon, 15 Oct 2018 11:57:14 -0600 Received: from gunthorp by cgy1-donard.priv.deltatee.com with local (Exim 4.89) (envelope-from ) id 1gC778-0002MY-Sf; Mon, 15 Oct 2018 11:57:10 -0600 From: Logan Gunthorpe To: linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-riscv@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-sh@vger.kernel.org Cc: Stephen Bates , Palmer Dabbelt , Albert Ou , Christoph Hellwig , Andrew Morton , Arnd Bergmann , Logan Gunthorpe Date: Mon, 15 Oct 2018 11:56:56 -0600 Message-Id: <20181015175702.9036-1-logang@deltatee.com> X-Mailer: git-send-email 2.19.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SA-Exim-Connect-IP: 172.16.1.31 X-SA-Exim-Rcpt-To: linux-mm@kvack.org, linux-riscv@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-sh@vger.kernel.org, sbates@raithlin.com, palmer@sifive.com, aou@eecs.berkeley.edu, hch@lst.de, akpm@linux-foundation.org, arnd@arndb.de, logang@deltatee.com X-SA-Exim-Mail-From: gunthorp@deltatee.com X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on ale.deltatee.com X-Spam-Level: X-Spam-Status: No, score=-8.7 required=5.0 tests=ALL_TRUSTED,BAYES_00, GREYLIST_ISWHITE,MYRULES_NO_TEXT autolearn=ham autolearn_force=no version=3.4.1 Subject: [PATCH v2 0/6] sparsemem support for RISC-V X-SA-Exim-Version: 4.2.1 (built Tue, 02 Aug 2016 21:08:31 +0000) X-SA-Exim-Scanned: Yes (on ale.deltatee.com) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This patchset implements sparsemem on RISC-V. The first few patches move some code in existing architectures into common helpers so they can be used by the new RISC-V implementation. The final patch actually adds sparsmem support to RISC-V. This is the first small step in supporting P2P on RISC-V. -- Changes in v2: * Rebase on v4.19-rc8 * Move the STRUCT_PAGE_MAX_SHIFT define into a common header (near the definition of struct page). As suggested by Christoph. * Clean up the unnecessary nid variable in the memblocks_present() function, per Christoph. * Collected tags from Palmer and Catalin. -- Logan Gunthorpe (6): mm: Introduce common STRUCT_PAGE_MAX_SHIFT define mm/sparse: add common helper to mark all memblocks present ARM: mm: make use of new memblocks_present() helper arm64: mm: make use of new memblocks_present() helper sh: mm: make use of new memblocks_present() helper RISC-V: Implement sparsemem arch/arm/mm/init.c | 17 +---------------- arch/arm64/include/asm/memory.h | 9 --------- arch/arm64/mm/init.c | 28 +--------------------------- arch/riscv/Kconfig | 23 +++++++++++++++++++++++ arch/riscv/include/asm/pgtable.h | 21 +++++++++++++++++---- arch/riscv/include/asm/sparsemem.h | 11 +++++++++++ arch/riscv/kernel/setup.c | 4 +++- arch/riscv/mm/init.c | 8 ++++++++ arch/sh/mm/init.c | 7 +------ include/asm-generic/fixmap.h | 1 + include/linux/mm_types.h | 5 +++++ include/linux/mmzone.h | 6 ++++++ mm/sparse.c | 14 ++++++++++++++ 13 files changed, 91 insertions(+), 63 deletions(-) create mode 100644 arch/riscv/include/asm/sparsemem.h -- 2.19.0