Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp542129ybl; Mon, 12 Aug 2019 21:57:29 -0700 (PDT) X-Google-Smtp-Source: APXvYqwA4b2ZtmPIdrIykN1t4iG4vtY3xevIw6dxEF69nnZAUk74sL1EkO88V3CPTLAwnDP8c6pz X-Received: by 2002:a63:4c5c:: with SMTP id m28mr33059726pgl.333.1565672249556; Mon, 12 Aug 2019 21:57:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565672249; cv=none; d=google.com; s=arc-20160816; b=fPxl9Q4kLTIXYUw49ggWxGGDauuKNoZEtuOqhC58Ns2SYz/fzLPYABoAyfO8bFzfSQ PDKswuM/0DtYz5a0lSSQk255a9OX7rAktbeJj7OexUyY9NjlxmLuAUQ8aY0J7WhFHAqz mB4ERcWuRGH0m+qAB9lkHI/JASJcrLP6ZWamK6arZDPIux9EXczp/d6/qZA7aZGi4/mE 0jr8yK7MGj4UJiEzi0DAYPxHPY7LW6DIDoh6oga1JOW485rx+jfuOZg5ey6aXx7GaH09 LOQv5/PUtt9sWdWz/G0FL+H1MY+rjLuJzF9dMfFjelv6qq2uaIPHPwonSKakRLNJTwCC o1ug== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:user-agent:in-reply-to :content-disposition:mime-version:references:reply-to:subject:cc:to :from:date; bh=J2j9N2SW5IqYwyZXMowvF0zk62zbyplcnxVbfi9q2Ag=; b=n+Nu8sMANIlZwRO0/y97bTXasQP0Pqx+bjosPQUuA7qPlkHiiI8MEb4p67kccQFB5u cjH4ucgL+OML+nGX2kzz2q57eQNN1pdpqweDU462JBsmIeqJOTvNNC9NgOdB3nt2tynZ ZK/5u/j1tgdI158N11bZqePWJJ78yVAe4F5vkyE2Q1CfZB3OZqE2uhlfua7P/wQrEX1g O6BLabyPMM5jEqFQpHpKUWbqr0a+TO/BQxsoPgCiSKnrbD6TZuyAez3iM50xxZ5HmM/Q AESn/DZEo2iszVvZgC4df4RU5ZD1gOEqnivuAk8TYXMe6WmissqJEx7IGjFVCp9nksG/ r4Iw== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t134si64823404pgc.361.2019.08.12.21.57.13; Mon, 12 Aug 2019 21:57:29 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726884AbfHME4X (ORCPT + 99 others); Tue, 13 Aug 2019 00:56:23 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:60492 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725867AbfHME4W (ORCPT ); Tue, 13 Aug 2019 00:56:22 -0400 Received: from pps.filterd (m0098416.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x7D4rD84021638 for ; Tue, 13 Aug 2019 00:56:21 -0400 Received: from e06smtp04.uk.ibm.com (e06smtp04.uk.ibm.com [195.75.94.100]) by mx0b-001b2d01.pphosted.com with ESMTP id 2ubneua4ce-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Tue, 13 Aug 2019 00:56:21 -0400 Received: from localhost by e06smtp04.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 13 Aug 2019 05:56:19 +0100 Received: from b06cxnps3075.portsmouth.uk.ibm.com (9.149.109.195) by e06smtp04.uk.ibm.com (192.168.101.134) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Tue, 13 Aug 2019 05:56:17 +0100 Received: from d06av26.portsmouth.uk.ibm.com (d06av26.portsmouth.uk.ibm.com [9.149.105.62]) by b06cxnps3075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id x7D4uGc161210818 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 13 Aug 2019 04:56:16 GMT Received: from d06av26.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 6413FAE04D; Tue, 13 Aug 2019 04:56:16 +0000 (GMT) Received: from d06av26.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id D03E5AE051; Tue, 13 Aug 2019 04:56:14 +0000 (GMT) Received: from in.ibm.com (unknown [9.199.41.101]) by d06av26.portsmouth.uk.ibm.com (Postfix) with ESMTPS; Tue, 13 Aug 2019 04:56:14 +0000 (GMT) Date: Tue, 13 Aug 2019 10:26:11 +0530 From: Bharata B Rao To: Christoph Hellwig Cc: Dan Williams , Jason Gunthorpe , Andrew Morton , linux-mm@kvack.org, linux-kernel@vger.kernel.org, linux-nvdimm@lists.01.org Subject: Re: [PATCH 5/5] memremap: provide a not device managed memremap_pages Reply-To: bharata@linux.ibm.com References: <20190811081247.22111-1-hch@lst.de> <20190811081247.22111-6-hch@lst.de> <20190812145058.GA16950@in.ibm.com> <20190812150012.GA12700@lst.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190812150012.GA12700@lst.de> User-Agent: Mutt/1.12.0 (2019-05-25) X-TM-AS-GCONF: 00 x-cbid: 19081304-0016-0000-0000-0000029E0A31 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 19081304-0017-0000-0000-000032FE1C90 Message-Id: <20190813045611.GB16950@in.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2019-08-13_01:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=344 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1906280000 definitions=main-1908130052 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Aug 12, 2019 at 05:00:12PM +0200, Christoph Hellwig wrote: > On Mon, Aug 12, 2019 at 08:20:58PM +0530, Bharata B Rao wrote: > > On Sun, Aug 11, 2019 at 10:12:47AM +0200, Christoph Hellwig wrote: > > > The kvmppc ultravisor code wants a device private memory pool that is > > > system wide and not attached to a device. Instead of faking up one > > > provide a low-level memremap_pages for it. Note that this function is > > > not exported, and doesn't have a cleanup routine associated with it to > > > discourage use from more driver like users. > > > > The kvmppc secure pages management code will be part of kvm-hv which > > can be built as module too. So it would require memremap_pages() to be > > exported. > > > > Additionally, non-dev version of the cleanup routine > > devm_memremap_pages_release() or equivalent would also be requried. > > With device being present, put_device() used to take care of this > > cleanup. > > Oh well. We can add them fairly easily if we really need to, but I > tried to avoid that. Can you try to see if this works non-modular > for you for now until we hear more feedback from Dan? Yes, this patchset works non-modular and with kvm-hv as module, it works with devm_memremap_pages_release() and release_mem_region() in the cleanup path. The cleanup path will be required in the non-modular case too for proper recovery from failures. Regards, Bharata.