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 0737AC433FE for ; Tue, 4 Oct 2022 06:33:09 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 1415D6B0072; Tue, 4 Oct 2022 02:33:09 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 0F0A86B0073; Tue, 4 Oct 2022 02:33:09 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id EFAC46B0074; Tue, 4 Oct 2022 02:33:08 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id DC10E6B0072 for ; Tue, 4 Oct 2022 02:33:08 -0400 (EDT) Received: from smtpin08.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id A5958A0B74 for ; Tue, 4 Oct 2022 06:33:08 +0000 (UTC) X-FDA: 79982299656.08.98EEE52 Received: from mail-ed1-f41.google.com (mail-ed1-f41.google.com [209.85.208.41]) by imf18.hostedemail.com (Postfix) with ESMTP id 4B4391C0010 for ; Tue, 4 Oct 2022 06:33:08 +0000 (UTC) Received: by mail-ed1-f41.google.com with SMTP id y100so16972121ede.6 for ; Mon, 03 Oct 2022 23:33:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date; bh=40EB989ap/jlDrQk+YofbZyu1M7dTC7R64ohBxLyxpA=; b=RsOkXObDHsS5M9vMEVhzww+3TyKqx/fSVGCDzwn8bE2SJ4XBfVjA6DBOfQGzk0vOfm HQ+0qf53Nmq469fDycnwgk4jTQzRJLL5TYP40dK1aY0vN/boSw4BspGnC7YpJ/gQzsHX R+MCAdiH+c2Cj9/T3yhm3Nd7lZ4mFoLUtPBTV5ckEmHd9HHaE1UGT1ZeZl62hEAIhxf2 UduvSiya4dHsNzouqM7tTp/5ntrnoxPXgyXa4+Oi/4J8UuPs8OcgkeXox2r34MHV49Sj HpZMnq5sB6EM7R3xPyIC62FnKACmCkcjwwcRijsVYyulHdF2dTAiY5tdzCT2oxDOKCgu iVnw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date; bh=40EB989ap/jlDrQk+YofbZyu1M7dTC7R64ohBxLyxpA=; b=tOkS067PucIg42LOgDtzVDSNRnRd8CfR9SYS+NTfZUgpr4AsRjkqAhcgvia14AJc6y LOMxWt/sSJNmCj09imw9rh7rNKPrEuKbnaqDYXWIxhBYW3jVyBMhc5VmlAvNGNvQOry2 3XSW2Dh5/tyFVURbrtCW7DTyhLc+37jN4qrLhIxbHYIL3xmBUQ8q2EEqG+6Z6NxkkmOy QjX4gszPRqwdeFsV1BopNy0pLyS8frVM7cC5Xc2zCLkzy4OnsAXmqN1f4DP5L9vng/gl nZCY23J6FQ1UZtfxdWL2cDQqbp87V98cwgKLe/OcQJcQjojL/PN9baLzQlNiqtedRaRQ h/Pg== X-Gm-Message-State: ACrzQf21FC+o0DbMmCnrtNX1Tm4mme/Q5Q1rvtKrU+9KoMCsjJ6xbj8x FWlqxuwK+Yg169dOZnlKpdKE26fumeU212EbBjBeNQ== X-Google-Smtp-Source: AMsMyM7qjXZ5GzHL7UurLoeux8UK9R11Y82SEjMtHPQA+OfQuE9PKKLQuLtlXNFMbrPx6PHtjBbzYpOEOOOG+Qr6WK4= X-Received: by 2002:a05:6402:11cc:b0:458:f610:8404 with SMTP id j12-20020a05640211cc00b00458f6108404mr8166538edw.75.1664865186870; Mon, 03 Oct 2022 23:33:06 -0700 (PDT) MIME-Version: 1.0 References: <20221002002326.946620-1-ira.weiny@intel.com> In-Reply-To: From: Sumit Garg Date: Tue, 4 Oct 2022 12:02:55 +0530 Message-ID: Subject: Re: [PATCH 0/4] Remove get_kernel_pages() To: Ira Weiny Cc: Jens Wiklander , Andrew Morton , "Fabio M. De Francesco" , op-tee@lists.trustedfirmware.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org Content-Type: text/plain; charset="UTF-8" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1664865188; 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-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=40EB989ap/jlDrQk+YofbZyu1M7dTC7R64ohBxLyxpA=; b=Ug1oNMZ2P+Am0ZzyjaDsTcc3IH6rv7Eei2PQhE4iihAjwwz8MrOVmdzQoIT71Wm86kIdwp 1X2mdDLw74DJblE9cCwzlyzQ6z8G7GoIdZLoeaUXtRVBjb47yQATLk7hktnysW95GFYRpP eQtBkTGZ1i52vUDw3dgZHG/Mgn/euwQ= ARC-Authentication-Results: i=1; imf18.hostedemail.com; dkim=pass header.d=linaro.org header.s=google header.b=RsOkXObD; spf=pass (imf18.hostedemail.com: domain of sumit.garg@linaro.org designates 209.85.208.41 as permitted sender) smtp.mailfrom=sumit.garg@linaro.org; dmarc=pass (policy=none) header.from=linaro.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1664865188; a=rsa-sha256; cv=none; b=wqoWHCE7MeA446umBDcXsXmICY3cgkCKWLpMg87fXqa336No4eWt0jFSRV9oYYLZSeO8La DLJoYy3ND8Wrglo2+/z/uJHIorr6H8pVjF3JosWGO0y+vbfiMfUhXzBPG89KuOgwDmadGi NyYBcTauMXCnipCthBwKFUuui51nu8k= X-Rspam-User: Authentication-Results: imf18.hostedemail.com; dkim=pass header.d=linaro.org header.s=google header.b=RsOkXObD; spf=pass (imf18.hostedemail.com: domain of sumit.garg@linaro.org designates 209.85.208.41 as permitted sender) smtp.mailfrom=sumit.garg@linaro.org; dmarc=pass (policy=none) header.from=linaro.org X-Rspamd-Server: rspam12 X-Rspamd-Queue-Id: 4B4391C0010 X-Stat-Signature: zqqzjo9yo5nx5z48kcgxtbqxuge1du7i X-HE-Tag: 1664865188-116443 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: On Mon, 3 Oct 2022 at 20:52, Ira Weiny wrote: > > On Mon, Oct 03, 2022 at 02:55:02PM +0530, Sumit Garg wrote: > > Hi Ira, > > > > On Sun, 2 Oct 2022 at 05:53, wrote: > > > > > > From: Ira Weiny > > > > > > get_kernel_pages() only had one caller [shm_get_kernel_pages()] which did not > > > need the functionality it provided. Furthermore, it called kmap_to_page() > > > which we are looking to removed. > > > > > > Alter shm_get_kernel_pages() to no longer call get_kernel_pages() and remove > > > get_kernel_pages(). Along the way it was noted that shm_get_kernel_pages() > > > does not have any need to support vmalloc'ed addresses either. Remove that > > > functionality to clean up the logic. > > > > > > This series also fixes and uses is_kmap_addr(). > > > > From the above description, I am failing to see the motivation behind > > this change. Can you elaborate here? > > Al Viro found[1] that kmap_to_page() is broken. But not only was it broken but > it presents confusion over how highmem should be used because kmap() and > friends should not be used for 'long term' mappings. > > [1] https://lore.kernel.org/lkml/YzSSl1ItVlARDvG3@ZenIV > Thanks for the background info. This should be part of the cover letter. > > > > Also, since you are targeting to remove kmap_to_page(), is there any > > alternative way to support highmem for future TEE bus drivers? As I > > can see higmem being enabled for multiple Arm defconfigs [1] which can > > also support TEE (an example which already does it: > > arch/arm/configs/imx_v6_v7_defconfig). > > With TEE how are the highmem pages used? Right now the code does not seem to > use any user pages. So I can't really say how this should work. Why does the > kernel need a mapping of those pages? Fair enough, I don't have a real kernel driver use-case for highmem which is required to be registered with TEE. -Sumit > > Ira > > > > > [1] git grep CONFIG_HIGHMEM arch/arm/ > > > > -Sumit > > > > > > > > Ira Weiny (4): > > > highmem: Enhance is_kmap_addr() to check kmap_local_page() mappings > > > tee: Remove vmalloc page support > > > tee: Remove call to get_kernel_pages() > > > mm: Remove get_kernel_pages() > > > > > > drivers/tee/tee_shm.c | 41 ++++++++++++-------------------- > > > include/linux/highmem-internal.h | 5 +++- > > > include/linux/mm.h | 2 -- > > > mm/swap.c | 30 ----------------------- > > > 4 files changed, 19 insertions(+), 59 deletions(-) > > > > > > > > > base-commit: 274d7803837da78dfc911bcda0d593412676fc20 > > > -- > > > 2.37.2 > > >