Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp2419667ybp; Thu, 10 Oct 2019 07:11:01 -0700 (PDT) X-Google-Smtp-Source: APXvYqyxpNlGmYMzZ/zkvvIOszCXHphdzHfwKls8Cn/8NUTonizBbraWxz92M6Yxbmgd3s283gTq X-Received: by 2002:a50:ec96:: with SMTP id e22mr8388504edr.109.1570716660953; Thu, 10 Oct 2019 07:11:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570716660; cv=none; d=google.com; s=arc-20160816; b=zVwcY8RT2lXONj5ljbuqeKh9rsTz80zxsXGJRp0yAAoimK6UCApF/KJVE/VcwUE54/ N1uhPNA/kbhIAr5ufGnzJ1Q1nSopxOi6P2+23CJr+uT1FJsDwpojKVXppEuhz4IMbkzF IcPS7UHBg+IGkK5o1L9q1PnMTusYV4vkkrsH4D3KTxqOQ7u6SOKKau2Nh2XjUhy3Mtyb i79I43TICt8EesSOr2budJEgFbAvqgEdz7+M8Nu3LY9js+/G+B4gax/SNiTfPxEpbX2L V8hRbf/QQ1Pwu8PgXEcSFjNsT8k4VXeJZ0ae3ybQkBUCWXTxgITeeENWOqEmslSWnXJV Vtgg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=t00CB4B7aneZjcEIb9GdT3xuLgUTlGoBlIV60QwAFAI=; b=o1dL7Z9RcWl9UsUBmSWbYbyY4WOXaAusJI+NR17Y47UArGrTA6U1NAD8QkdWdOtx4z RAXaQI2bqmh7p7B8FjqnwMxViT72QT+qsxgZqQl+R7thLpQnwCzl+aTI2sy37L+uV8QS UDTFjYSRA5GqlnwvPqkRuFxRj7E5iDy8DsHcnnn2/T+6e7xgertY0iWuPiWKUbRmOk2l EBcE2mlEOMT8+xbfuPl20YmE6B281tRGtXIiCaglRh3PKfymZj0Z2nAaPtSCWcOOZMe8 yju5fLmUFIT6/af6NgNDW961qtGS3UEWAOtZX4FuoePNKCzGmiJR56fgTiLAVSHKWtgB i00Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=llgvZRim; 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 q20si3379859ejn.18.2019.10.10.07.10.33; Thu, 10 Oct 2019 07:11:00 -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=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=llgvZRim; 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 S1726285AbfJJOJw (ORCPT + 99 others); Thu, 10 Oct 2019 10:09:52 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:38270 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726017AbfJJOJv (ORCPT ); Thu, 10 Oct 2019 10:09:51 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=t00CB4B7aneZjcEIb9GdT3xuLgUTlGoBlIV60QwAFAI=; b=llgvZRimzB46/10WFD9fxvxap dDeZk5Sp6UYN+9iddtNmluGdwe5rA3gen8HLF6Q+r12BubqTr1YrwSJWLWTMrJgmd5yjGM4joFFRO LoRlFB99yoJ17CJ79jdBGFzBsPoyb3bwshXCMS5dIKpspheUCsQPwz7axJ4YZ+c0E4LhhLNuHaved Np4KVrjD+ErLODLvpyhaEuRmYiz9X+Ja7M1zMO4eTA0qPVV312K9jmT1QMkzrvcGtDt5oy/E1W68I pG79vpNcH9W0c6BaNICbsPxCQw1crQHS3nviMYGycVP/10ZRtlIVW3SVoGCU2XAPFHg1HU/ggKjJ1 DHSXJoQQg==; Received: from hch by bombadil.infradead.org with local (Exim 4.92.3 #3 (Red Hat Linux)) id 1iIZ8Y-0007n3-Jn; Thu, 10 Oct 2019 14:09:50 +0000 Date: Thu, 10 Oct 2019 07:09:50 -0700 From: Christoph Hellwig To: Omer Shpigelman Cc: "oded.gabbay@gmail.com" , "linux-kernel@vger.kernel.org" Subject: Re: [PATCH 1/2] habanalabs: support vmalloc memory mapping Message-ID: <20191010140950.GA27176@infradead.org> References: <20191010140615.26460-1-oshpigelman@habana.ai> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20191010140615.26460-1-oshpigelman@habana.ai> User-Agent: Mutt/1.12.1 (2019-06-15) X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Oct 10, 2019 at 02:06:22PM +0000, Omer Shpigelman wrote: > This patch adds support in mapping of vmalloc memory. > In contrary to user memory, vmalloc memory is already pinned and has no > vm_area structure. Therefore a new capability was needed in order to map > this memory. Unless I am missing something you mix user and kernel pointers in your is_vmalloc_addr checks. That will break on those architectures that have separate kernel and user address spaces. > Mapping vmalloc memory is needed for Gaudi ASIC. How does that ASIC pass in the vmalloc memory? I don't fully understand the code, but it seems like the addresses are fed from ioctl, which means they only come from userspace.