From patchwork Mon Oct 15 17:56:56 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Logan Gunthorpe X-Patchwork-Id: 10642285 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 54443109C for ; Mon, 15 Oct 2018 17:57:20 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 459F42984E for ; Mon, 15 Oct 2018 17:57:20 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 39712298CA; Mon, 15 Oct 2018 17:57:20 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E75402984E for ; Mon, 15 Oct 2018 17:57:18 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 7E4196B0005; Mon, 15 Oct 2018 13:57:17 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 791696B0006; Mon, 15 Oct 2018 13:57:17 -0400 (EDT) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 65B6B6B0007; Mon, 15 Oct 2018 13:57:17 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-io1-f69.google.com (mail-io1-f69.google.com [209.85.166.69]) by kanga.kvack.org (Postfix) with ESMTP id 3B8F96B0005 for ; Mon, 15 Oct 2018 13:57:17 -0400 (EDT) Received: by mail-io1-f69.google.com with SMTP id m7-v6so19501456iop.9 for ; Mon, 15 Oct 2018 10:57:17 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-original-authentication-results:x-gm-message-state:from:to:cc :date:message-id:mime-version:content-transfer-encoding:subject; bh=D2QpjoNmTVYsNFBf8qgbeNcuX/zg4UU7imfFExJB4KM=; b=YhD+Jwv9clltAI3HDPoPT/Vkjp91EDlVf0gJ3XiFj2zMMrpC0fRaoEbASSSAEjaHtv y7c+0Pwn50soGRK3hR//dhysONpLjK8ASRtbXnn7UeydFCBPwAobmK8cT/7wQltheU8f b8M5GZl7sjFmh98DWPycpicj+xgoVUyTNj3/gmNryZAGcLU46RhLMK/1UH1HfR8YgJz4 gOVXn4VmBOMdaqmeWoqTWtP3YJLkwDRE0m2OEL8+ctC6s6E9sk5Y1fJS8IF9wNgIoWUa sWLlINmpAYr4JS2+agSyldcd6LF16sEaEbNlmZLbLpytXNZofv72ixMBMBirFLwFAI70 xWOg== X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of gunthorp@deltatee.com designates 207.54.116.67 as permitted sender) smtp.mailfrom=gunthorp@deltatee.com X-Gm-Message-State: ABuFfohgXswFXwkscwNdCHrHyTKGAFZ0BAoytt/+EQ394xIwm798Ap7b QufxBeaeXWqt4jdSxd8kO+Tl37tXIoPz0tNthzUbhL0q+fYqDvTs2rYFuWxGgkG7qk8NyKa+wi2 HLV39mOfcuNsyQYsyPv0vYbbVGHH6p0Km6YqjAMWBD9+/Asg7lj2PSCpwNToiKIpe9A== X-Received: by 2002:a6b:660b:: with SMTP id a11-v6mr12165197ioc.10.1539626236993; Mon, 15 Oct 2018 10:57:16 -0700 (PDT) X-Google-Smtp-Source: ACcGV60sKYZ+CzqvqgtFsYw/TIOoiVXS2m4h+JbFBHvLnATAvDkb1lGZOo4+FPeRBcXJ9v4CsKEI X-Received: by 2002:a6b:660b:: with SMTP id a11-v6mr12165158ioc.10.1539626236036; Mon, 15 Oct 2018 10:57:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539626236; cv=none; d=google.com; s=arc-20160816; b=mUmcvebYbm1rdrrwZLWVrlbS15ucEFSKpf3nLSIx0EMFSoIpPR7TyqSP5lWPKgOr+N h8tZQPFeFB5nULel5rPvv+Jqb6jqlrnTz1XdG37TLg3TJAnj80aD06Yu3GEDuam72uzt yUQLF92weVA41pIyraXY5lwMD3NN3XYdZw7kVyGuUZN76+eiRhhzQCcenkV/w3mLSV5E axGsKM3cBYwnkMxvoqoMAgy1bVszXFBcI2/un9SZSdT32pJSDwOvjtP1/ZALk69y4WW4 AGVN3EAmbBi5volWqqLRaTe8p+F5cyU1imrMJqb8Qdarwpnbocm7uc8qM1cqCYv/xi45 FXYQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=subject:content-transfer-encoding:mime-version:message-id:date:cc :to:from; bh=D2QpjoNmTVYsNFBf8qgbeNcuX/zg4UU7imfFExJB4KM=; b=RFUbxIeLaJjCRwwe/qBiL79t98+x54GxNXkgL+zMFFRnzi3tiQSjGk3Ax23Av/b8t+ JhyXeInYv3R2cDqwt/7e0R0SgISJqJGt036zhvlgjj3ZQsOxrVQ/LPEshp5wGf5ND2wI gV3KgGjQ2mNqEPns5QaAA7PbckrtwEXSXZYmorvZSpTstvjmLdLLMMCruaQVi8ZrT54u DIMUnsVUUkVchi+shhBF0OGOlWOMT1E87RBx2G7L5fx5kxpHMcyp1R7rQf8T9/Eo9mUj O1FY+Wm12o8yyAjvGkkZt4oLM2fC1eB3ehL9JFTKRpb0A4f4w1J1u5j4x6jPIEfWDZAa 58tQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of gunthorp@deltatee.com designates 207.54.116.67 as permitted sender) smtp.mailfrom=gunthorp@deltatee.com Received: from ale.deltatee.com (ale.deltatee.com. [207.54.116.67]) by mx.google.com with ESMTPS id q124-v6si7177309iod.118.2018.10.15.10.57.15 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 15 Oct 2018 10:57:16 -0700 (PDT) Received-SPF: pass (google.com: domain of gunthorp@deltatee.com designates 207.54.116.67 as permitted sender) client-ip=207.54.116.67; Authentication-Results: mx.google.com; spf=pass (google.com: domain of gunthorp@deltatee.com designates 207.54.116.67 as permitted sender) smtp.mailfrom=gunthorp@deltatee.com 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 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 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) X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: X-Virus-Scanned: ClamAV using ClamSMTP 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