Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp487427iog; Wed, 15 Jun 2022 06:26:12 -0700 (PDT) X-Google-Smtp-Source: AGRyM1uYo6Z2cjA0eK1z4HJtcGQgs2SFcKmdlMqqbeMm01SMo2GfCH9qAHG9X7NghaUZv3rSuN33 X-Received: by 2002:a17:90b:1983:b0:1e3:52f5:306 with SMTP id mv3-20020a17090b198300b001e352f50306mr10425650pjb.96.1655299572162; Wed, 15 Jun 2022 06:26:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655299572; cv=none; d=google.com; s=arc-20160816; b=yS+GL/QdZqJMXSun13V24BfnAOMyYz8GTxAnWb/K8nNlgBaL2wJRPxrLmTaXgniOas u0F0t2T7fOFXDuYaHpgtuE9ym7rxLC8VY2M/t1RbQos16XoEDf7XAjMILDwtDMf+slh5 53dEEHv5WdMdWmE8fF0/0lgJIFHncXTgt7+biOS6y1gPkvZulH443/+bGFJlg7rGfwsR kN/PTofHWajAVQaVcA91o6JJR+1vtqkve8s27Ni2R/imp7eQdN9tT/lucJ6vRDEkN467 +Auo37/xmb++h1T1cHlYwGISNYVTt6TSRSNYs4cIdEFV6R+YCs4bAQnoiuZpVDjtw88H F1Vw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=S5rO2fxESB7zFTrCOirUhL+CIS2WKwnKsxp74VvAono=; b=GHEsu+AiOsdi2sH8HYgeIGkpgh1Lwd6vT+pFXmPpsqfgrxyFbfD1US4MDcFE+3P0MA w+HeU3hinJUd74r6AMBPa5K7OfD+XHtTDuQBngWwJcn/F5gd8pz2PocZQzlgSs9PxKEx /F8UykH/ZAcMDVMaEplwSlxGE9zX2+QK3q7tKbom/d+LekcL56KjzpN4yDivsmOn9nnm 96zWVxhIZcYP06uFaV+9C74oB4OurfnkglFoctVPCRKXAzCUhrvUJcz3HpTzAq92OW2q SvfSD2OSGFfm6unvkDA5151OTnbqEkCQUDe/6Y3cwhGp7txXKxqGGoJYZCXG0jm0y5lx mLvA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id c16-20020aa79530000000b0051b8c526443si16531245pfp.171.2022.06.15.06.25.59; Wed, 15 Jun 2022 06:26:12 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1347954AbiFONRI (ORCPT + 99 others); Wed, 15 Jun 2022 09:17:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53894 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237431AbiFONRH (ORCPT ); Wed, 15 Jun 2022 09:17:07 -0400 Received: from verein.lst.de (verein.lst.de [213.95.11.211]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E35702A97D for ; Wed, 15 Jun 2022 06:17:04 -0700 (PDT) Received: by verein.lst.de (Postfix, from userid 2407) id 1829A68AA6; Wed, 15 Jun 2022 15:17:01 +0200 (CEST) Date: Wed, 15 Jun 2022 15:17:00 +0200 From: Christoph Hellwig To: Robin Murphy Cc: Frank Wunderlich , linux-kernel@vger.kernel.org, iommu@lists.linux-foundation.org, Marek Szyprowski , Christoph Hellwig Subject: Re: helping with remapping vmem for dma Message-ID: <20220615131700.GA18061@lst.de> References: <6e58b50c-cd05-a37b-07e1-10ee24fb972f@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <6e58b50c-cd05-a37b-07e1-10ee24fb972f@arm.com> User-Agent: Mutt/1.5.17 (2007-11-01) X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jun 15, 2022 at 02:15:33PM +0100, Robin Murphy wrote: > Put simply, if you want to call dma_map_single() on a buffer, then that > buffer needs to be allocated with kmalloc() (or technically alloc_pages(), > but then dma_map_page() would make more sense when dealing with entire > pages. Yes. It sounds like the memory here comes from the dma coherent allocator, in which case the code need to use the address returned by that and not create another mapping.