Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp1717827yba; Thu, 25 Apr 2019 04:42:27 -0700 (PDT) X-Google-Smtp-Source: APXvYqx3hlhagP3rP7Fr8IQ3HPUlckb1845Go3sK0m8rVjdn29K+7Qkm8jX1PSDx8bWlUwg3peCe X-Received: by 2002:aa7:9294:: with SMTP id j20mr40937939pfa.64.1556192547510; Thu, 25 Apr 2019 04:42:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556192547; cv=none; d=google.com; s=arc-20160816; b=VdryHd/vmL1fkNeM687ToJFBRM1T2+pHW6dt5aI4qxP/7mMHi/c+dNJ41KeFW1mDCq RjgQb7H4Z+DrEYDHjh98AvLbnXIGLustOibJ3Iyi+sMs8YV2MHb4QQujm3fS4qFxiQX8 Dxb3eDMcQ8lxuPUiMoCrd0gmIiJi7l5YNZKVAHSiVNF8ah+sx/nElbUbBBXmX7YQa28g JTaWcASVSJoOtuSscR03pzFYdCxBpqNddNHqsxn9533UFEGvsCD47UXIJZwEWBojJsZ6 1rrZUshYY/6JE7lnlKmPU5EYt7BXYRya2jaLuMAOxAemA9RrruSVp1f1jg+ZMSaW3PTf Oqng== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:to:from:cc:in-reply-to:subject:date:dkim-signature; bh=/z9H1bjGAN+NhWO4cJm4XUDJLQDERO7DpYsjfK91LLc=; b=OlJ44Tn36C+KC4rVB1gXebHLAA3fLeUMd4PP14Y3574LFS6OdHsPxU3hrICxVPjOqc ol5F7MSZFDwvhL7Lh0kFAchCmCkj8ZSWrnaB4qd4trhyWTH7GbdIqyRyv+iMZH8YFU4T WSZOXALUKtwf3LcFZtliwcFSlvyBgZdw7bpfe8kE2ueHTArqBL5jKE2JervRQzPcBsIZ hfCGjpmBuArAu861xsB8vKxHQxeCRmSflW5dB5tv6kTNqXEia/am69lhESSFJaqwEMCz Za2VuxGnDCtX9AGmYmRGFXLKsVFo6pLndz0cgASHBWhhszcqNaImmdbzkPbxkljPEUAD XZJQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sifive.com header.s=google header.b=YbkFofSF; 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 v23si10774679pga.500.2019.04.25.04.42.12; Thu, 25 Apr 2019 04:42:27 -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; dkim=pass header.i=@sifive.com header.s=google header.b=YbkFofSF; 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 S1728146AbfDXXXG (ORCPT + 99 others); Wed, 24 Apr 2019 19:23:06 -0400 Received: from mail-pf1-f196.google.com ([209.85.210.196]:34373 "EHLO mail-pf1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727358AbfDXXXE (ORCPT ); Wed, 24 Apr 2019 19:23:04 -0400 Received: by mail-pf1-f196.google.com with SMTP id b3so10128272pfd.1 for ; Wed, 24 Apr 2019 16:23:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sifive.com; s=google; h=date:subject:in-reply-to:cc:from:to:message-id:mime-version :content-transfer-encoding; bh=/z9H1bjGAN+NhWO4cJm4XUDJLQDERO7DpYsjfK91LLc=; b=YbkFofSFfog0jO7FGGCcAlnOh/4CSJOMHqL6e3bBGVQjiJk/cCD/K5LCnXZobO7XRE +8p7yjwtiMXTzJSk1f1kfhGLeDcmCrPBuFa3u84gyW/RbSK5hJudqYwsHX1J81Dl4FEd coTbWdFPhAaDYKU8rBBJUkE6yy6rCjqX+uwtG8SLGdjtXWRaEwedGp+XmhLQyw3JtL4/ fSuZk6y7gx0Bnj6UEGF8NyReO6/g/jm+D02fBNIL4prq4ahdzYWJeCtTUxlOc06xKgcH cBLj6qw5LmurioHtGKiLmbIr0oktn8kcSWSEezFdBPHAvEt2Neh0YIa8J27XfY7RHAG3 Wf4w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:subject:in-reply-to:cc:from:to:message-id :mime-version:content-transfer-encoding; bh=/z9H1bjGAN+NhWO4cJm4XUDJLQDERO7DpYsjfK91LLc=; b=LnDAz9pObr/9SIEglZeRlzInEI0B2AIfAv/XuPejf7PG1eV8TJZEUei29mqLJPdOBt P2lgXsBVNJt44F7qH7A9gKvKlmO6wJesCmG2rq/3gUjnWzEv2Iki028FEymF/kZOYPGV aswnkL+yN0uOXZoi83ZgdHTD8en6h8phOLJU4dML2OnEr2xShfY5z7ON+RZbJMrGQLRl uho7yX4JDzssAKdQUGgYZVXGRMDMyZj3oJKKmfqJjnB7Iolg0zoILf/vhCZHMWgv+SJx Gw5H9Np1apATtClamG/hPHZyNhbazAasCx1toQPLvA9tYl4o5ctdnO/gzy0F1iRHuLST J4IQ== X-Gm-Message-State: APjAAAW+x0NBTnEvyl0J1WTb5Hj0uVXIB2or5DCyWnXHIbA7xkxFg12v iGjMHqRgVToi7fCay7Dn0HnDUZp63U0= X-Received: by 2002:a62:2ad5:: with SMTP id q204mr35815462pfq.259.1556148183563; Wed, 24 Apr 2019 16:23:03 -0700 (PDT) Received: from localhost ([134.134.139.92]) by smtp.gmail.com with ESMTPSA id q24sm27357806pgm.16.2019.04.24.16.23.01 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 24 Apr 2019 16:23:01 -0700 (PDT) Date: Wed, 24 Apr 2019 16:23:01 -0700 (PDT) X-Google-Original-Date: Wed, 24 Apr 2019 15:49:08 PDT (-0700) Subject: Re: [PATCH 0/7] RISC-V: Sparsmem, Memory Hotplug and pte_devmap for P2P In-Reply-To: <20190327213643.23789-1-logang@deltatee.com> CC: linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org, sbates@raithlin.com, Christoph Hellwig , aou@eecs.berkeley.edu, logang@deltatee.com From: Palmer Dabbelt To: logang@deltatee.com Message-ID: Mime-Version: 1.0 (MHng) Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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.