Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp845489yba; Fri, 26 Apr 2019 09:39:12 -0700 (PDT) X-Google-Smtp-Source: APXvYqy1mER4KjOL8MlFD7MyOkKJWMLbEbQBsizcfvHd3/tfYCAiRj9CYajUMmf57YkvokOruGIW X-Received: by 2002:aa7:8b08:: with SMTP id f8mr24873260pfd.146.1556296752637; Fri, 26 Apr 2019 09:39:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556296752; cv=none; d=google.com; s=arc-20160816; b=0mlLz/UqrRcu3ywOU4hr4ghUBCUBIipYKLOewAQ2fdJo3v0RU/f6J0IBlWWPmTav9x DJEskWbkPCBn/k7FNKW0ftpFKG9vhk2JhrfBqUnISOkTyCefzz3gSA2ha7MLjOZW1KEc UoNp7bxNk9bNqkqPToOMVUOoqvn7tlb9ofbkYdXaLaw4MIV93bL6Dxoyw6IkQqPvNA2a D165Dj8gcAHunUqyGzz4Qsf9biIXoeYTrRmhxklujwSzQ23ZoHyU+bIjUF2EDoINXJV+ gCYqHzNtFtdgSIMC0cUb2ylCegoJpROmpMty2PKN7Aug9QOco7YKtrD25it/0YSZHxK/ 06/w== 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=Higz+pLq8qlahfmdcSDNd22wa2p8VaGvBbwtYA/siS0=; b=edejh8OTinttiDP8GOeJ2+tKUvLb+ezpxgomxk1+8YzkLHtDt9HkkgIj5iBxkmrAIV he5MnxisliwK1HOHC1KcVNctWuD9PKaO7VMY6rFZ1873vChWOH/kkbnCNdMnbTwthFpv cAewP/C3u84f8Mf1fdEMynDbVpbG1acZIij3qLDQg44omK9MzdERf0cIeggMsD1QPizU bJv76n4BG/97fgO5CuSM2rWcM30VExZG/RlUSZXsWjdqwVZEb6BpKOfWY0oAQZXd+pND GB3LZ2sLXd2mfIWWnh/EqFDoMql7A0NQsQDLII64xCCirCv0cUmZzIeJRI/u5aPBLKrg oTKw== 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 o32si27724888pld.190.2019.04.26.09.38.57; Fri, 26 Apr 2019 09:39:12 -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 S1726419AbfDZQh0 (ORCPT + 99 others); Fri, 26 Apr 2019 12:37:26 -0400 Received: from ale.deltatee.com ([207.54.116.67]:54016 "EHLO ale.deltatee.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726181AbfDZQh0 (ORCPT ); Fri, 26 Apr 2019 12:37:26 -0400 Received: from s01061831bf6ec98c.cg.shawcable.net ([68.147.80.180] helo=[192.168.6.141]) by ale.deltatee.com with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.89) (envelope-from ) id 1hK3qf-000743-KJ; Fri, 26 Apr 2019 10:37:18 -0600 To: Palmer Dabbelt Cc: linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org, sbates@raithlin.com, Christoph Hellwig , aou@eecs.berkeley.edu References: From: Logan Gunthorpe Message-ID: <479792a3-d049-9d93-8bd7-465156ce813d@deltatee.com> Date: Fri, 26 Apr 2019 10:37:15 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit X-SA-Exim-Connect-IP: 68.147.80.180 X-SA-Exim-Rcpt-To: aou@eecs.berkeley.edu, hch@lst.de, sbates@raithlin.com, linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, palmer@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=-6.9 required=5.0 tests=ALL_TRUSTED,BAYES_00 autolearn=ham autolearn_force=no version=3.4.2 Subject: Re: [PATCH 0/7] RISC-V: Sparsmem, Memory Hotplug and pte_devmap for P2P 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-04-24 5:23 p.m., Palmer Dabbelt wrote: > On Wed, 27 Mar 2019 14:36:36 PDT (-0700), logang@deltatee.com wrote: >> Hi, >> >> This patchset enables P2P on the RISC-V architecture. To do this on the >> current kernel, we only need to be able to back IO memory with struct >> pages using devm_memremap_pages(). This requires ARCH_HAS_ZONE_DEVICE, >> ARCH_ENABLE_MEMORY_HOTPLUG, and ARCH_ENABLE_MEMORY_HOTREMOVE; which in >> turn requires ARCH_SPARSEMEM_ENABLE. We also need to ensure that the >> IO memory regions in hardware can be covered by the linear region >> so that there is a linear relation ship between the virtual address and >> the struct page address in the vmemmap region. >> >> While our reason to do this work is for P2P, these features are all >> useful, more generally, and also enable other kernel features. >> >> The first patch in the series implements sparse mem. It was already >> submitted and reviewed last cycle, only forgotten. It has been rebased >> onto v5.1-rc2. >> >> Patches 2 through 4 rework the architecture's virtual address space >> mapping trying to get as much of the IO regions covered by the linear >> mapping. With Sv39, we do not have enough address space to cover all the >> typical hardware regions but we can get the majority of it. >> >> Patch 5 and 6 implement memory hotplug and remove. These are relatively >> straight forward additions similar to other arches. >> >> Patch 7 implements pte_devmap which allows us to set >> ARCH_HAS_ZONE_DEVICE. >> >> The patchset was tested in QEMU and on a HiFive Unleashed board. >> However, we were unable to actually test P2P transactions with this >> exact set because we have been unable to get PCI working with v5.1-rc2. >> We were able to get it running on a 4.19 era kernel (with a bunch of >> out-of-tree patches for PCI on a Microsemi PolarFire board). >> >> This series is based on v5.1-rc2 and a git tree is available here: >> >> https://github.com/sbates130272/linux-p2pmem riscv-p2p-v1 > > Looks like these don't build on rv32 when applied on top of 5.1-rc6.  We > now > have rv32_defconfig, which should make it easier to tests these sorts of > things. Thanks for the note. I've queued up the fixes for this. However, I'm still a bit stuck on the memory hot remove stuff. I'm waiting for the similar work in arm64 to be done so I can reuse some of it[1]. The first patch of this series that implements sparsemem builds on rv32 and was generally accepted in previous cycles; so I'd appreciate if you can pick that one up for v5.2. Thanks. Logan [1] https://lore.kernel.org/lkml/1555221553-18845-1-git-send-email-anshuman.khandual@arm.com/T/#u