From patchwork Fri Jun 19 14:32:41 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: 223669 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=ham 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 A75CDC433E0 for ; Fri, 19 Jun 2020 16:45:23 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 88E06204EC for ; Fri, 19 Jun 2020 16:45:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1592585123; bh=qdhBTkWSruYERr5czNpZSvHSiCknLERt9978u8aW+uc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=v5zjlSEp9y+7xt54oBEG4Wf+TC2y4yiAu8ZxN19tLRL/3fKHUaqRx0wXjn9Cd9Xm9 R3XxlULNefuQfzDyk+uEUr/hkd/vvGWptUVNFbcd0ZX68XDqnUmdt32HwA1Zi0cw9K 1zIExbx26ZK8XdhKKZVCZJF4M72l/RtJiStGIZHA= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2404673AbgFSQpV (ORCPT ); Fri, 19 Jun 2020 12:45:21 -0400 Received: from mail.kernel.org ([198.145.29.99]:32790 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387540AbgFSOmL (ORCPT ); Fri, 19 Jun 2020 10:42:11 -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 6B8D22158C; Fri, 19 Jun 2020 14:42:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1592577731; bh=qdhBTkWSruYERr5czNpZSvHSiCknLERt9978u8aW+uc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=fjWiQWMVT/98Yz2XMPNrEWXY70b0pkHkNUaSaZ7r/mkYoiOLXUlFKn3WcUy0CVIh8 tTbBStiOnwtYWaccrXL4s9UCFA5DcLtMaW1fc3Ya0S4WP+24Ra0eWb3l9ZGzEKO9hE Zi5I2tSQAQWYuQ7CYwElr9n/WF1D+VahhHVATJpA= 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 4.9 067/128] staging: android: ion: use vmap instead of vm_map_ram Date: Fri, 19 Jun 2020 16:32:41 +0200 Message-Id: <20200619141623.749733608@linuxfoundation.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200619141620.148019466@linuxfoundation.org> References: <20200619141620.148019466@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 c2a7cb95725b..4fc5de13582d 100644 --- a/drivers/staging/android/ion/ion_heap.c +++ b/drivers/staging/android/ion/ion_heap.c @@ -105,12 +105,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; }