Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp1268556ybl; Tue, 13 Aug 2019 09:51:41 -0700 (PDT) X-Google-Smtp-Source: APXvYqzW2MRfvC7+7jHqcG3GEeS5WqBfUXwkjddVRLsrX6b59Y6QXxBc7EkMiGmoCCffjADYJtj3 X-Received: by 2002:a17:90a:a404:: with SMTP id y4mr2977739pjp.69.1565715101143; Tue, 13 Aug 2019 09:51:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565715101; cv=none; d=google.com; s=arc-20160816; b=JggFDDzwL+pJ/r1m4SnlCcboAoc2wuA1zLFD4e5/9BWAGnMpcuEQS4TqEbUnbpDBXJ ZPHib8Ac20mU5geIjjuqoLXxqnL6oBNIuI9a1KcUSZtD+X1C0th4bu/WeaCHSCPJr5hO 51Sq1GcpuLNJPCnxHc/HbYa7b74n9y3eXuPmy+28aLmesc3id4VlK95j3j1Ktaf8o1Ll Ky8MH41JsSBPVWslEYlpWjKqAlY6Pm57KuxkdPyyumzhkLDbW3GXXFG/IBplp4ZDegww 7YXg6vsZ1CL+lX0+v7S/CdPoun4SbUykgL4UOiK8fRDB63X5i7pYHnITZwXt2HnIPS6A PbIw== 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 :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to; bh=qngzj7MncFI013M54aXYceNv6wPFza97c//K0eWDPmA=; b=W6tdvqkHC3oaf9lEAM27deITxZBsSgx4M0VjLAQy+aPsd5OBbv9pOZ/jSon8qHtuwM Gf6poFVDDux8bEU75yLBpi+Cj3uRoWaCSorklNn3mbgcP04qH6rmBYhh99MuV4/tq8C0 QgJDYeYUEjswZm49d0SK7WeMugloIL8Sb3/r3iJd16kcshR+FsKdtaNWTptGXPBn6f+1 Pn2/8YRH5QRE5PaacGUM/yDUy8/29xf4SeGjylwdDWqb7rFfhIWPYM6LNkBXYUjTDSJL EOLQ4hnk5zTzOTQl5mLbyZ0hLJchj7NWlIuHSgDTlJmu+F4HyB/kisGGBxEZy8rleOZv HU2A== 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 f131si62026322pgc.265.2019.08.13.09.51.25; Tue, 13 Aug 2019 09:51:41 -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 S1727772AbfHMQt7 (ORCPT + 99 others); Tue, 13 Aug 2019 12:49:59 -0400 Received: from ale.deltatee.com ([207.54.116.67]:51090 "EHLO ale.deltatee.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726769AbfHMQt7 (ORCPT ); Tue, 13 Aug 2019 12:49:59 -0400 Received: from guinness.priv.deltatee.com ([172.16.1.162]) by ale.deltatee.com with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.89) (envelope-from ) id 1hxZzc-0000UT-Fb; Tue, 13 Aug 2019 10:49:53 -0600 To: Paul Walmsley Cc: Greentime Hu , Rob Herring , Albert Ou , Andrew Waterman , Palmer Dabbelt , Linux Kernel Mailing List , Stephen Bates , Olof Johansson , greentime.hu@sifive.com, linux-riscv@lists.infradead.org, Michael Clark , Christoph Hellwig , linux-mm@vger.kernel.org References: <20190109203911.7887-1-logang@deltatee.com> <20190109203911.7887-3-logang@deltatee.com> <0926a261-520e-4c40-f926-ddd40bb8ce44@deltatee.com> <96156909-1453-d487-ff66-a041d67c74d6@deltatee.com> <5506c875-9387-acc9-a7fe-5b7c10036c40@deltatee.com> From: Logan Gunthorpe Message-ID: Date: Tue, 13 Aug 2019 10:49:51 -0600 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-CA Content-Transfer-Encoding: 7bit X-SA-Exim-Connect-IP: 172.16.1.162 X-SA-Exim-Rcpt-To: linux-mm@vger.kernel.org, hch@lst.de, michaeljclark@mac.com, linux-riscv@lists.infradead.org, greentime.hu@sifive.com, olof@lixom.net, sbates@raithlin.com, linux-kernel@vger.kernel.org, palmer@sifive.com, andrew@sifive.com, aou@eecs.berkeley.edu, robh@kernel.org, green.hu@gmail.com, paul.walmsley@sifive.com X-SA-Exim-Mail-From: logang@deltatee.com X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on ale.deltatee.com X-Spam-Level: X-Spam-Status: No, score=-7.9 required=5.0 tests=ALL_TRUSTED,BAYES_00, GREYLIST_ISWHITE,LR_URI_NUMERIC_ENDING autolearn=ham autolearn_force=no version=3.4.2 Subject: Re: [PATCH v4 2/2] RISC-V: Implement sparsemem 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 On 2019-08-13 10:39 a.m., Paul Walmsley wrote: > On Tue, 13 Aug 2019, Logan Gunthorpe wrote: > >> On 2019-08-13 12:04 a.m., Greentime Hu wrote: >> >>> Every architecture with mmu defines their own pfn_valid(). >> >> Not true. Arm64, for example just uses the generic implementation in >> mmzone.h. > > arm64 seems to define their own: > > https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/arch/arm64/Kconfig#n899 Oh, yup. My mistake. > https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/arch/arm64/mm/init.c#n235 > > While there are many architectures which have their own pfn_valid(); > oddly, almost none of them set HAVE_ARCH_PFN_VALID ? Yes, much of this is super confusing. Seems HAVE_ARCH_PFN_VALID only matters if SPARSEMEM is set. So risc-v probably doesn't need to set it and we just need a #ifdef !CONFIG_FLATMEM around the pfn_valid definition like other arches. Logan