From patchwork Wed Nov 18 15:13:37 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Bottomley X-Patchwork-Id: 61076 X-Patchwork-Delegate: kyle@mcmartin.ca Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id nAIFDhB4004072 for ; Wed, 18 Nov 2009 15:13:43 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757079AbZKRPNg (ORCPT ); Wed, 18 Nov 2009 10:13:36 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1757082AbZKRPNg (ORCPT ); Wed, 18 Nov 2009 10:13:36 -0500 Received: from bedivere.hansenpartnership.com ([66.63.167.143]:44949 "EHLO bedivere.hansenpartnership.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757060AbZKRPNf (ORCPT ); Wed, 18 Nov 2009 10:13:35 -0500 Received: from localhost (localhost [127.0.0.1]) by bedivere.hansenpartnership.com (Postfix) with ESMTP id A2FF08EE101; Wed, 18 Nov 2009 07:13:41 -0800 (PST) Received: from bedivere.hansenpartnership.com ([127.0.0.1]) by localhost (bedivere.hansenpartnership.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id AZ1f-vYiu-4W; Wed, 18 Nov 2009 07:13:41 -0800 (PST) Received: from [192.168.10.224] (newmulgrave.ext.hansenpartnership.com [192.168.10.224]) by bedivere.hansenpartnership.com (Postfix) with ESMTP id E6CCE8EE0DF; Wed, 18 Nov 2009 07:13:40 -0800 (PST) Subject: Re: [PATCH 1/6] mm: add coherence API for DMA to vmalloc/vmap areas From: James Bottomley To: Ralf Baechle Cc: linux-arch@vger.kernel.org, linux-parisc@vger.kernel.org In-Reply-To: <20091118143815.GA17146@linux-mips.org> References: <1258477432-2513-1-git-send-email-James.Bottomley@suse.de> <1258477432-2513-2-git-send-email-James.Bottomley@suse.de> <20091118143815.GA17146@linux-mips.org> Date: Wed, 18 Nov 2009 10:13:37 -0500 Message-Id: <1258557217.2540.12.camel@mulgrave.site> Mime-Version: 1.0 X-Mailer: Evolution 2.28.0 Sender: linux-parisc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-parisc@vger.kernel.org diff --git a/Documentation/cachetlb.txt b/Documentation/cachetlb.txt index da42ab4..7d1055c 100644 --- a/Documentation/cachetlb.txt +++ b/Documentation/cachetlb.txt @@ -377,3 +377,27 @@ maps this page at its virtual address. All the functionality of flush_icache_page can be implemented in flush_dcache_page and update_mmu_cache. In 2.7 the hope is to remove this interface completely. + +For machines where aliasing can be a problem, there exist two +additional APIs to handle I/O to vmap/vmalloc areas within the +kernel. These are areas that have two kernel mappings, one the regular +page offset map through which the page has likely been previously +accessed and the other, the new contiguous map in the kernel virtual +map area. This dual mapping sets up aliasing within the kernel and, +in particular since all kernel flushing goes through the offset map, +must be handled separately for I/O. to declare your architecture as +needing to use these functions, you must define +ARCH_HAS_FLUSH_KERNEL_DCACHE_PAGE in asm/cacheflush.h and add two API +helpers (usually as static inlines in cacheflush.h). The two new APIs +are: + + void flush_kernel_dcache_addr(void *addr) + Flush a single page through the vmap alias for addr. This is + usually executed prior to performing I/O on the page to make + sure the underlying physical page is up to date. + + void invalidate_kernel_dcache_addr(void *addr) + Invalidate the page after I/O has completed. This is necessary + on machines whose cache mechanisms might trigger cache movein + during I/O. If you can ensure architecturally that this movein + never occurs, this function can be empty on your architecture.