From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6062AC64EC7 for ; Sat, 11 Feb 2023 03:40:00 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id C20936B0073; Fri, 10 Feb 2023 22:39:59 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id B817B6B0074; Fri, 10 Feb 2023 22:39:59 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 9D4476B0075; Fri, 10 Feb 2023 22:39:59 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id 8A3106B0073 for ; Fri, 10 Feb 2023 22:39:59 -0500 (EST) Received: from smtpin14.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id D64B314139E for ; Sat, 11 Feb 2023 03:39:58 +0000 (UTC) X-FDA: 80453607276.14.8F4D7EF Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf09.hostedemail.com (Postfix) with ESMTP id 2EF5B14000C for ; Sat, 11 Feb 2023 03:39:56 +0000 (UTC) Authentication-Results: imf09.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=YLTkO73U; spf=none (imf09.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1676086797; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=goynt5niP0v9aEgqldbKfY9zrWSKLPIYoftetp9ETpc=; b=XYp0VhnCS5uwxGLSpzYMzbsWePObLmQrZqF12vVxT9ynLDQB3f58LwmI1iVC2rpFnKeIwk qtdSoXk4E73J8C1aj5En4I5iT+L914RKDvnnnPlTQlxxuklQk2pFUzCsjZwPw1jUgkeW5D txgCnxnqKNkP7a+ULheY/O3VkGKRasg= ARC-Authentication-Results: i=1; imf09.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=YLTkO73U; spf=none (imf09.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org; dmarc=none ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1676086797; a=rsa-sha256; cv=none; b=VDs6OvMSmr8PZeEv13dp8DbXIbMTuFVkNP7VPH8ZtG/t9NzcgUEFIYOS1MOZqPE0XEDjPW 2xX+xvy17lven6h2c9HmPxgIcEOfNPIDevfhqh1ko9Q8VOJGNJA+YxrizAYv6Myr7Om0P/ lVy4eU+OyjKKkUf5IjSPFN8qE/r53cs= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To: Content-Type:Content-ID:Content-Description; bh=goynt5niP0v9aEgqldbKfY9zrWSKLPIYoftetp9ETpc=; b=YLTkO73UnHtS+xHg6lDBRbDDQY cMswgE55oPYP1mOmCfoxOoxs+/tY9KtwYA+LuRKnZF8A1Lihd0kbn6+IBOfMz4xYdxIKbXS76m4VA OX1R5nCNghyPflpfHywAL1VA8Mwa8w/QUjbpkE/mrye8Wv0nIzKPLCzO3rJO0kyss0XDHdJfuRrGo bim+P/N2GA3Hk/5qbHGDkMaNdtmgCeQTFdSKDxUHjGtHLO5Twtx3T7BOuj4+OzOJunEc0ZVFsmu1l 5HwtMUuPd4USvm3c2YfK6Qrb1h4jHRz7EL2i4225TlUli4TpEOPbkx6R5unvh5iyEDYrXcT6myjfz h60rMx3w==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1pQgjv-003k2i-6l; Sat, 11 Feb 2023 03:39:51 +0000 From: "Matthew Wilcox (Oracle)" To: linux-mm@kvack.org, linux-arch@vger.kernel.org Cc: "Matthew Wilcox (Oracle)" Subject: [PATCH 2/7] mm: Add generic flush_icache_pages() and documentation Date: Sat, 11 Feb 2023 03:39:43 +0000 Message-Id: <20230211033948.891959-3-willy@infradead.org> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20230211033948.891959-1-willy@infradead.org> References: <20230211033948.891959-1-willy@infradead.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Rspam-User: X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: 2EF5B14000C X-Stat-Signature: zbsfsytje15iyz696r93ideys81oorhm X-HE-Tag: 1676086796-894044 X-HE-Meta: U2FsdGVkX187hX1vaqjfE/exEd4jEyurp6e5itL0aCkZBRpAA1dPxMmv6jYO16ZUl+WGV72vt6/DyIkXKgcsPDE/qnDY27xKLOZv4d3KoVLzUNrxMzeM970VrTPuPQHNGEFq3+geXyCG3WTPRIeeuBxP6+Qq2hZyOAZVs8ceeBcryGpC5br1rsTP6eqHBMIgBXIE6al0oEzTZi5csykAmgmyrlQvUfMdSHU6mGW7ZjObEAWKkW0qjZR+tXg0BBnVekQhsQWMPWUhaFjEE4NxAKYzyWtHpM5vjzU8Mm6LoH4B+FlkELbFbumkZs/xsZ2e8tw3vZxSmPVhMiEjZQkNXO2YPKZLMOQ3VxhFQ+hChu57fooFb5/uYSd5HxylEmWzBW7DTwabJYueJWmWtd18HTrNSGxIjrxuNMd/PV0V+7bK8VWlQ2r+zy50d7JCS3rM5st7C21cQmuSUuLL65e3PYx4mPxVU8t37yM3h9VFjOSyRzS2PL1ExCJ/g+8FQho3l+zgQwywtN5M5NQA89XeJV7yC4JEg40OS+wstXiAdnbBmYEYvR5ai0NoMhp9VmsQGj0Qe30f4SU1k+OhX6xIkqjxHnYYYhpJ3AV4l1Da9WnE1tjXeFV8ZUAWqYXFeF43by1DfiKJtuS2ciosy3H+dXMsr6qdnqtItIdLjjoBha4y1LCewTQJwjagPFzaAGa/cQ8j3tam2U9x6zz/I1BRhDCfKk5W+7edc5tknjUHrBoRNr+xz/dTXor4vhZi7lGMwf/KI5pXwZclulc4GOJ6uzsTmTDTiNoRBt96niT/ek6GCqdsXJ2mfdz1+6V7SzizsjWpgl5rASG5yl5KTWKYPMJ+uJv0DWOCkVNXst6NnGn+B+xfojxYeeizj+0X3xL7Gezq5uOPCr47vUXbWfqDVJzNpoUEEcetFoYkLizubVjd6VUuz1GLAjB/zSf/j9KE1YTFqWrtsvSJKFN+fRx x+DtQ2nM diol110cr7mGfOAGSIPkSFU5dAisfDXrragHu/XCkiXm9O2BAnqd9vgfKSu/eHl3cvQSfC7kzlPvxiMKpI027CBhDshY7zEX1VjcRK6JwZxROepl1E29z8vRaJAtZqRxIYMX/PtbRN0c0qzyI8P90Ajn+SX1YwYXvG60Cvih2SD8Tf/++DQ1w2i+uaULWaBoa09cbIXZJxfWIqBJBy7ecquqLbml+yUjEZPhWCkWBooGhJWSxsZN1XsLfYw== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: flush_icache_page() is deprecated but not yet removed, so add a range version of it. Change the documentation to refer to update_mmu_cache_range() instead of update_mmu_cache(). Signed-off-by: Matthew Wilcox (Oracle) --- Documentation/core-api/cachetlb.rst | 35 +++++++++++++++-------------- include/asm-generic/cacheflush.h | 5 +++++ 2 files changed, 23 insertions(+), 17 deletions(-) diff --git a/Documentation/core-api/cachetlb.rst b/Documentation/core-api/cachetlb.rst index 5c0552e78c58..d4c9e2a28d36 100644 --- a/Documentation/core-api/cachetlb.rst +++ b/Documentation/core-api/cachetlb.rst @@ -88,13 +88,13 @@ changes occur: This is used primarily during fault processing. -5) ``void update_mmu_cache(struct vm_area_struct *vma, - unsigned long address, pte_t *ptep)`` +5) ``void update_mmu_cache_range(struct vm_area_struct *vma, + unsigned long address, pte_t *ptep, unsigned int nr)`` - At the end of every page fault, this routine is invoked to - tell the architecture specific code that a translation - now exists at virtual address "address" for address space - "vma->vm_mm", in the software page tables. + At the end of every page fault, this routine is invoked to tell + the architecture specific code that translations now exists + in the software page tables for address space "vma->vm_mm" + at virtual address "address" for "nr" consecutive pages. A port may use this information in any way it so chooses. For example, it could use this event to pre-load TLB @@ -306,17 +306,18 @@ maps this page at its virtual address. private". The kernel guarantees that, for pagecache pages, it will clear this bit when such a page first enters the pagecache. - This allows these interfaces to be implemented much more efficiently. - It allows one to "defer" (perhaps indefinitely) the actual flush if - there are currently no user processes mapping this page. See sparc64's - flush_dcache_page and update_mmu_cache implementations for an example - of how to go about doing this. + This allows these interfaces to be implemented much more + efficiently. It allows one to "defer" (perhaps indefinitely) the + actual flush if there are currently no user processes mapping this + page. See sparc64's flush_dcache_page and update_mmu_cache_range + implementations for an example of how to go about doing this. - The idea is, first at flush_dcache_page() time, if page_file_mapping() - returns a mapping, and mapping_mapped on that mapping returns %false, - just mark the architecture private page flag bit. Later, in - update_mmu_cache(), a check is made of this flag bit, and if set the - flush is done and the flag bit is cleared. + The idea is, first at flush_dcache_page() time, if + page_file_mapping() returns a mapping, and mapping_mapped on that + mapping returns %false, just mark the architecture private page + flag bit. Later, in update_mmu_cache_range(), a check is made + of this flag bit, and if set the flush is done and the flag bit + is cleared. .. important:: @@ -369,7 +370,7 @@ maps this page at its virtual address. ``void flush_icache_page(struct vm_area_struct *vma, struct page *page)`` All the functionality of flush_icache_page can be implemented in - flush_dcache_page and update_mmu_cache. In the future, the hope + flush_dcache_page and update_mmu_cache_range. In the future, the hope is to remove this interface completely. The final category of APIs is for I/O to deliberately aliased address diff --git a/include/asm-generic/cacheflush.h b/include/asm-generic/cacheflush.h index f46258d1a080..09d51a680765 100644 --- a/include/asm-generic/cacheflush.h +++ b/include/asm-generic/cacheflush.h @@ -78,6 +78,11 @@ static inline void flush_icache_range(unsigned long start, unsigned long end) #endif #ifndef flush_icache_page +static inline void flush_icache_pages(struct vm_area_struct *vma, + struct page *page, unsigned int nr) +{ +} + static inline void flush_icache_page(struct vm_area_struct *vma, struct page *page) { -- 2.39.1