From patchwork Fri Jun 19 14:31:08 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Kroah-Hartman X-Patchwork-Id: 223860 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7A531C433DF for ; Fri, 19 Jun 2020 16:08:48 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 59E6721532 for ; Fri, 19 Jun 2020 16:08:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1592582928; bh=mTiX6BVUQ3jkX0Jh2seMK/MdH4mnuw+Iqv/QKtJSdaw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=kWMR7lmnK/RflcOg/oPjO8NNWDsPl+a4f5mWgUzB2SIsvTO0HnjJwgz0th8cRwv65 YhAN9JaDppZZpZtH93fSenmaQBhZTXfp7OahajBIJ9QlY7lEhHqSVbxuL8HtIuv+kT cY0naoC8fENUYyzwtIKm17jZ6yhk0Q3ION98MHi4= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2391586AbgFSPHc (ORCPT ); Fri, 19 Jun 2020 11:07:32 -0400 Received: from mail.kernel.org ([198.145.29.99]:36840 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2391583AbgFSPHb (ORCPT ); Fri, 19 Jun 2020 11:07:31 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id CD70D21D80; Fri, 19 Jun 2020 15:07:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1592579250; bh=mTiX6BVUQ3jkX0Jh2seMK/MdH4mnuw+Iqv/QKtJSdaw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=vi4L8Jjd0EawUsWdff92pGXZzvszAoV7RhTwECWQfPVewB3HGg2tUhOYs6nfkxBkI E5wYKRKp93b5zFmhqkNn5WZ0/TFVIMECIJMdMSZxQFllN/mHVUMYnys1/zD8qrNS82 uDeHCwkFMdEvZwad7+Q8YktT6AkoSBd8r8uI9wug= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Christoph Hellwig , Andrew Morton , "Peter Zijlstra (Intel)" , Christian Borntraeger , Christophe Leroy , Daniel Vetter , David Airlie , Gao Xiang , Haiyang Zhang , Johannes Weiner , "K. Y. Srinivasan" , Laura Abbott , Mark Rutland , Michael Kelley , Minchan Kim , Nitin Gupta , Robin Murphy , Sakari Ailus , Stephen Hemminger , Sumit Semwal , Wei Liu , Benjamin Herrenschmidt , Catalin Marinas , Heiko Carstens , Paul Mackerras , Vasily Gorbik , Will Deacon , Linus Torvalds , Sasha Levin Subject: [PATCH 5.4 057/261] staging: android: ion: use vmap instead of vm_map_ram Date: Fri, 19 Jun 2020 16:31:08 +0200 Message-Id: <20200619141652.652564491@linuxfoundation.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200619141649.878808811@linuxfoundation.org> References: <20200619141649.878808811@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Christoph Hellwig [ Upstream commit 5bf9917452112694b2c774465ee4dbe441c84b77 ] vm_map_ram can keep mappings around after the vm_unmap_ram. Using that with non-PAGE_KERNEL mappings can lead to all kinds of aliasing issues. Signed-off-by: Christoph Hellwig Signed-off-by: Andrew Morton Acked-by: Greg Kroah-Hartman Acked-by: Peter Zijlstra (Intel) Cc: Christian Borntraeger Cc: Christophe Leroy Cc: Daniel Vetter Cc: David Airlie Cc: Gao Xiang Cc: Haiyang Zhang Cc: Johannes Weiner Cc: "K. Y. Srinivasan" Cc: Laura Abbott Cc: Mark Rutland Cc: Michael Kelley Cc: Minchan Kim Cc: Nitin Gupta Cc: Robin Murphy Cc: Sakari Ailus Cc: Stephen Hemminger Cc: Sumit Semwal Cc: Wei Liu Cc: Benjamin Herrenschmidt Cc: Catalin Marinas Cc: Heiko Carstens Cc: Paul Mackerras Cc: Vasily Gorbik Cc: Will Deacon Link: http://lkml.kernel.org/r/20200414131348.444715-4-hch@lst.de Signed-off-by: Linus Torvalds Signed-off-by: Sasha Levin --- drivers/staging/android/ion/ion_heap.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/android/ion/ion_heap.c b/drivers/staging/android/ion/ion_heap.c index 473b465724f1..0755b11348ed 100644 --- a/drivers/staging/android/ion/ion_heap.c +++ b/drivers/staging/android/ion/ion_heap.c @@ -99,12 +99,12 @@ int ion_heap_map_user(struct ion_heap *heap, struct ion_buffer *buffer, static int ion_heap_clear_pages(struct page **pages, int num, pgprot_t pgprot) { - void *addr = vm_map_ram(pages, num, -1, pgprot); + void *addr = vmap(pages, num, VM_MAP, pgprot); if (!addr) return -ENOMEM; memset(addr, 0, PAGE_SIZE * num); - vm_unmap_ram(addr, num); + vunmap(addr); return 0; }