Received: by 10.223.176.5 with SMTP id f5csp1150329wra; Fri, 9 Feb 2018 13:26:34 -0800 (PST) X-Google-Smtp-Source: AH8x224BqSMWgGQwwT0Yb+eaG3SuEFjUEm0qUG4+bLZQMZzVpkDt00cRH9SlqHnB1cXycXL8AD2s X-Received: by 10.99.174.5 with SMTP id q5mr3369919pgf.3.1518211594010; Fri, 09 Feb 2018 13:26:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518211593; cv=none; d=google.com; s=arc-20160816; b=t0to7mHiC6k7GslSNoNbZz78zGr6xKyeFexR93coHKxfEmy7sBt4F0LN1hr1X+WeM5 1qkScb88lNhTd0+KJJXvEIEboJHS+V2JSOG7GgNvi3fOygGAXQhoSSxAPJz7K7clU55b EXldb8RV/2QZAc6EEFiFbGoSQjzMX1oxHEOK77VZyGN21gmgLa1U399ybTQXuZa6S1lV mUuWbvaYnJ9Ps/A+sKcfWwY9dMgxuq9OML1CbrjpAcjUXSPrADW+Xs44xSf1IlHP6CMY ZQF+iEajAqgPdVY+ZMRefVAVMLMAO0szhI2Jr9BYi1HDBPKGb5V8TtwPqUcrk6oWNLMn hnqw== 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 :content-language:mime-version:user-agent:date:message-id:cc:subject :from:to:arc-authentication-results; bh=s1McNSrwA/Qs73Dq88YajOQu01sgrXHJDirvQDtC25A=; b=jZkyXlvw7nOOeRTpsSTJj/kkmnPFTxprjcL6ZuPrXEXICebxB57C7nlI6vKoTUc6LF CkWfOEghAvaZTkeY097DbdOXLBusQxdZVVaocJJXahwcpiVJ4VHmTyzi6uFpFXRYav4y XgfdeRooVpyxhMKwKaMVuFg6S0VesiBRhOa3hcHSOUWNx1lmNwtjpbM8yzbP0J02jZ25 bzITMMPjw9Y4XgnNfFflj9vWM+/MP5OiHiAEQNWLUn0GnQPdStpojsVTwU32IXGio7P0 1cFDneZuqPab8b4v0P3py9r2YyLNxs7T1mCJHEsCmmNvt9Kk36kcIjzkpzxQRqiVhceR MwBQ== 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 bd6-v6si2023134plb.602.2018.02.09.13.26.19; Fri, 09 Feb 2018 13:26:33 -0800 (PST) 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 S1752879AbeBIVZ0 (ORCPT + 99 others); Fri, 9 Feb 2018 16:25:26 -0500 Received: from mga04.intel.com ([192.55.52.120]:29548 "EHLO mga04.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750993AbeBIVZZ (ORCPT ); Fri, 9 Feb 2018 16:25:25 -0500 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 09 Feb 2018 13:25:24 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.46,485,1511856000"; d="scan'208";a="16851053" Received: from alexey-system-product-name.iil.intel.com (HELO [10.236.193.131]) ([10.236.193.131]) by fmsmga008.fm.intel.com with ESMTP; 09 Feb 2018 13:25:13 -0800 To: sumit.semwal@linaro.org, linux-media@vger.kernel.org, linux-kernel@vger.kernel.org From: Alexey Skidanov Subject: dma-buf CPU access Cc: Laura Abbott Message-ID: Date: Fri, 9 Feb 2018 23:25:44 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, According to the CPU access instructions in the dma-buf.c, I understand that on 32 bit platforms, due to the limited number of persistent kernel mappings or limited vmalloc range, the CPU access pattern should look like this: dma_buf_start_cpu_access(); void *ptr = dma_buf_kmap(); /*Access the page pointed by ptr*/ dma_buf_kunmap(ptr); dma_buf_end_cpu_access(); or dma_buf_start_cpu_access(); void *ptr = dma_buf_vmap(); /*Access the buffer pointed by ptr*/ dma_buf_vunmap(ptr); dma_buf_end_cpu_access(); But on 64 bit platforms, there are no such restrictions (there is no highmem at all). So, frequently accessed buffer, may be mapped once, but every access should be surrounded by : dma_buf_start_cpu_access(); /*Access the buffer pointed by ptr*/ dma_buf_end_cpu_access() Am I correct? Thanks, Alexey