Received: by 2002:a25:683:0:0:0:0:0 with SMTP id 125csp112696ybg; Mon, 8 Jun 2020 17:58:17 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzmrs4jw5oiAJBC3+db3xw1kKkXWr2x/Hxxxz3Y/SkEMjHvW/uU7ehcbNXuBdsYRRdGO2hc X-Received: by 2002:a17:906:1d1a:: with SMTP id n26mr22368188ejh.351.1591664296870; Mon, 08 Jun 2020 17:58:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591664296; cv=none; d=google.com; s=arc-20160816; b=tKdYLVu6s9y+HU3rX9fpq4mOtUgoAeCMVC5QCanja9E+ZgKc9v9ys1hKf9C7aUY0rT Mt2e6+S3JqgG7LNcpU0lt8akEHMV0wT7g0A0z3XhRrWMfWfyrQTIXc/9QCmhIrZwBYhs Z490bETT+L4N+lIYZKv7Jpb7HoItZ7EQewu6xZui97YPcZ9SG1v6RnQb9t331reLkdtW gNcxNsEH8B7f3nZ6HCWKNDgVKKnVgSYD2O4nLLpRxQmjZp3WxbQU+F/6b90DwOCFH9Fw wu8LpbuC2Dqhgww6YAz8LVpDyGUYc6Pg3g1X3fVfigtUYcBaAuJ9ZnPuAF3JQow4qDYz 5Lgg== 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:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=WR9oeJSg/SJhByWjEbRJm3cc97c+vaM44mzG7WNIG84=; b=0snt204kT6vKTJ3PBLW+/SCP464+htyw8mxZbSZrNNH17F51rVs5FmDmUgfTV02UUk vtIvxlAQbfF0b4sqP6ecRpL0QB3tYHJlUoktYzItz5qAr4tL8a/Uv2EaAu33WaDbZPJp oMNSo7y+0YH/oeP93FSX2piRggO64gVECmAw/lrqyGvCRBlsiuLJMuorslCAs3JVyGOC 9A7HmLJcy36PnrTT9B0BVmdntRIZsFQjOfSqCJ8aigtCFqr/oioXA6sA/c5gcdBVtjzS irkg3HhVfXkjZDl735KJJM0Z3gkqdiUH6RuJ6cgrAFvIYT//vangiNKko9VSiwIBgPte LMww== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="Q/RrEdZF"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ay2si9415347edb.45.2020.06.08.17.57.53; Mon, 08 Jun 2020 17:58:16 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="Q/RrEdZF"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728327AbgFHXJF (ORCPT + 99 others); Mon, 8 Jun 2020 19:09:05 -0400 Received: from mail.kernel.org ([198.145.29.99]:53008 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728088AbgFHXIE (ORCPT ); Mon, 8 Jun 2020 19:08:04 -0400 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 6F5B62087E; Mon, 8 Jun 2020 23:08:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1591657684; bh=mTiX6BVUQ3jkX0Jh2seMK/MdH4mnuw+Iqv/QKtJSdaw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Q/RrEdZFoYdnbeV5uhaByT/rfltudEfsIryDIin6zJfhYKoVEcp9e0cZ2C328Bv4p f7t7L9ZvTNgw/3B4uViJp2MkUgX0LWdUUs4OG54cP9O7VsCHo9aD3tSijRsV1pxaxF wkUGMk6IpKpLHzogGluIDzELIjl+3k0RkRheaIhU= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Christoph Hellwig , Andrew Morton , Greg Kroah-Hartman , Peter Zijlstra , 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 , devel@driverdev.osuosl.org, dri-devel@lists.freedesktop.org, linaro-mm-sig@lists.linaro.org Subject: [PATCH AUTOSEL 5.7 087/274] staging: android: ion: use vmap instead of vm_map_ram Date: Mon, 8 Jun 2020 19:03:00 -0400 Message-Id: <20200608230607.3361041-87-sashal@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200608230607.3361041-1-sashal@kernel.org> References: <20200608230607.3361041-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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; } -- 2.25.1