From patchwork Thu Feb 6 15:33:18 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lorenzo Stoakes X-Patchwork-Id: 863676 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8C85922DFA4; Thu, 6 Feb 2025 15:34:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=205.220.177.32 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738856081; cv=fail; b=mF9Xoat8X83CrPB5H3U7Q1MRdbdmvxC22UIi8mU295VQRfLoygzpSuZ+q97FtXlGCpJ3lKB+DOMVEOQccxATBm987LD9QjBiVTaTS22PdZfXdyLfJwjvGi7wEH8/NYhw6SX1tAhhl9UgvG6cN1kdg2kk/GK4H2EE1ZYJc8tTI74= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738856081; c=relaxed/simple; bh=9cEM6C5qZUJcTrJ6Smv8pN5G1lJKHOPyEKyZjqlp4jQ=; h=From:To:Cc:Subject:Date:Message-ID:Content-Type:MIME-Version; b=cmUHe+vHudS5NHkquJZzPu9qwG/22ULJlAaw6FzwKoZCMCJKudwfKsiV9wtPV73jzXCvKHh1KPmxOzrEtTmnudQfD4cAy4qM9+BRNEcnVhE9mKlKrxh5uQ95O1vjFIyg5NelioeSUHJpVfNGK01hRCyiiKA9g/RofzhtGo0hzkg= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oracle.com; spf=pass smtp.mailfrom=oracle.com; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b=cyO5A7lu; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b=b+mGDFek; arc=fail smtp.client-ip=205.220.177.32 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oracle.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oracle.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b="cyO5A7lu"; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b="b+mGDFek" Received: from pps.filterd (m0246630.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 516EP7Y7007509; Thu, 6 Feb 2025 15:33:50 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=cc :content-transfer-encoding:content-type:date:from:message-id :mime-version:subject:to; s=corp-2023-11-20; bh=aObSFrw1OWoRgwcP eX9KsauJhBapUFHT+saMzjeqznI=; b=cyO5A7luh1DBGBVNnfwIY/Pq9VhZZJ5G 4Jh3km/6QH5iLx8vdi4l5JcZ0pWM3Fksb8Bpsf1f5sUgmZYabMDa6yAZoxSj09dy 4AFK/VwHLS96nlkMmLaSKyTqqtCinDUmJBL7lGpEl+8LGWLq0Qs39YWE82ubcYEN EW0MIyMLqu2LxaGijojIRRwC8kii0gV3QJIEnZC+tHYR0iYZVTQ4ExlZcSG8JhNt XlsOTVfdpp1MjZO+WBRG4bVZg0z5+upa78/P3Qzomir+VxUnKnrsfiuzq0UF8IbG UVXUzWSJsEl157V2DA3UIo3Kgenge+U3x2CwSGTmXA2ffzr+PjrpPA== Received: from iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta02.appoci.oracle.com [147.154.18.20]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 44m50uavd8-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 06 Feb 2025 15:33:50 +0000 (GMT) Received: from pps.filterd (iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (8.18.1.2/8.18.1.2) with ESMTP id 516EHAU4027902; Thu, 6 Feb 2025 15:33:49 GMT Received: from nam10-dm6-obe.outbound.protection.outlook.com (mail-dm6nam10lp2047.outbound.protection.outlook.com [104.47.58.47]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 44j8p5yvuu-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 06 Feb 2025 15:33:49 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=oqPIKZCphooIHiZ5cmCpMM+BAh0P6hqKBdgHqp9ZCxPN+lq30MW88SXS1tGEqu8xLIQ4X1VF6BOC9o9sPRGF07OUZDUXwS8PYDL/lrhd0jlC0ewuquOAG0bWa7/1YyEIryEMT0O4O1y/ycs7umYaba+R5ZTTnGgjraSvS8zI58JryfToyj5UXGOV7oEzfGgCgQZJJgPQbzb+FHcNPJ4iLrSc83PD1VXbrSHaIIp8XLw219zLhXB4NFyBuibIg9+4ceS5nLzqU6CsEKmKortD4HuYwtqcc+Tz5MmmjBZxyGQ6MD6YdL4eGIoZJWQXH32z77dg32YoTkrxGi7/L1/WhQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=aObSFrw1OWoRgwcPeX9KsauJhBapUFHT+saMzjeqznI=; b=vO0QJKCeKA6jEomJUHoJyC2Vl8TRGBSbTMyPsKt+3zO0VT0brsMLL5bVrNRUfXC/mI5wXVa6NR/0UQFbLy94UJsXBW/6LqOPbmSzwFrF2JNcPOp0omBzoNB4GBMzDffZgAff7esFNsKdsgODNGl0zAMW9jPqZl09wiTjmPmrhH08NVHsl29r/lYHCgKdunyN4oEkhPzwEhbCEbiGkV7q4RtaH9QcAw+RG5L4a9E+AFzbMJFzwjzgIj5yY+C4ZWk0JWxAzXZ1EFqIhzzf6/k62bW+jC1CnctfZF4MqJHka/xrBnfoHBMNIFoohkg6/kW/lCCLvDRbyn5Her2xDLU5Sw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=aObSFrw1OWoRgwcPeX9KsauJhBapUFHT+saMzjeqznI=; b=b+mGDFekOJxwmLrqtaFCK4Gwxth9S78wmLa35BlB7G69EpY/OEjMOgQpE4ruAbONmXg09OBJr24ia9PbKDbrzZ9UIx3LKKHfBwW0VL8gyGmg6v8MhYrFAPb6ku2t4oNy//LGVBX5QiWStQ+9Nlws9+uKwwxSdHQ3SIpKGaSbTD4= Received: from BYAPR10MB3366.namprd10.prod.outlook.com (2603:10b6:a03:14f::25) by IA1PR10MB7417.namprd10.prod.outlook.com (2603:10b6:208:448::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8422.10; Thu, 6 Feb 2025 15:33:47 +0000 Received: from BYAPR10MB3366.namprd10.prod.outlook.com ([fe80::baf2:dff1:d471:1c9]) by BYAPR10MB3366.namprd10.prod.outlook.com ([fe80::baf2:dff1:d471:1c9%4]) with mapi id 15.20.8398.025; Thu, 6 Feb 2025 15:33:47 +0000 From: Lorenzo Stoakes To: Andrew Morton Cc: Jaya Kumar , Simona Vetter , Helge Deller , linux-fbdev@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, Matthew Wilcox , David Hildenbrand , Kajtar Zsolt , Maira Canal , Simona Vetter , Thomas Zimmermann Subject: [PATCH v2 0/3] expose mapping wrprotect, fix fb_defio use Date: Thu, 6 Feb 2025 15:33:18 +0000 Message-ID: X-Mailer: git-send-email 2.48.1 X-ClientProxiedBy: LNXP123CA0018.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:d2::30) To BYAPR10MB3366.namprd10.prod.outlook.com (2603:10b6:a03:14f::25) Precedence: bulk X-Mailing-List: linux-fbdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BYAPR10MB3366:EE_|IA1PR10MB7417:EE_ X-MS-Office365-Filtering-Correlation-Id: 7513ed1b-1027-44ad-e78b-08dd46c3a5d8 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|7416014|376014|366016; X-Microsoft-Antispam-Message-Info: jVqCl6hP6+G28UwnqTqb9xK+5oCQl4RL6MAvAAwKBd2YIOKqdZsfUi+IiEFvl6mxjC7sc0KNCtzvFdMkv8sEs+SE1ixq9ZL3GfbvqIiZkbcJ172QqmjufW013LAvsDypsYgECezHT3mCA14EvhdjM8vrz2y/PUmapYx6pdMji0xhD1EUXhD4iK/M3Z2zZm41/5WEbXgjksJAQiX4nkPa/kfXw/YEy+RYdc662qwNu8zeQYHKfCiB7TVNYBSiilNmfyFEeeD4qTe8ApoTzHyQXgf4t5ERB0gCDGY7YtlYGuQILuUGYrFoKycpvOKP6w77uvEexrH30f1bXTOpaa+WM2JSIQ6vcxz9M1Xbj9sAYFJ3IWtj01GZ2SrVwzrKKW+npefNqkMqLqaQfR+AO5ZnapEnPMiy+oCphGHht4lromKNVvLfDFutp3ymq3F9OTOYdWBlFDh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PTR:; CAT:NONE; SFS:(13230040)(1800799024)(7416014)(376014)(366016); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: exF6B1vOZH7MM8uFeAYZRZ/cbo3SlFPl9NuVPjaZOgxKWCYxQtPXZZpwcaoHqlEsoT7FrQboQIAW5a2jftcN171y2mnxVPCflDIzUG9HBgOeoYuly8k0w9YnHXz4uQKckB6YQSP/cIPEFWx89xZ4qR1MU4rONGv+Z/1/dz9Ug968FwgNsj8+H4i/3KnfYsMD+n4XJdMWFlXtexuUmScpwOVU1HAdwez9IYE/qImDfJGgDE64TF53FKDj+4xHrvO3+PEedFBi5TZlJlGQBj4ZKt4XKGwsd0Zc+Nc/+ofawu6AsTu0mvSvFoB0buzIhQTivekvCPZuFLRIPXOSuVeM+l44n9vXtqnUv/Fpnej/mUFEEelu+4UMaGE2ld/x2gAGwv3Oa55WpTCE1dIfUMYS+cJcVNo7kmQlH3nuATDa+2lxbBbf/7P8HkR2Zzs1eglY3+wF3s7OgjntrxkajRNA3n4hiqIRnmzHfGgcp26SBE0SgoFy7gz7NUpP1pefoMdfe70zHmrmzLA6BxJRrSKKLPhQyoPne+M4fmbYRrfKP71TcXCNY+NLVtsMzMd6YT8QZwC46E7mHl8b4077xCiP7ynCJD0bEoZdmONCjYpkSyO4De136FToOdKWwQJmjYugX8giEvZhmb1AIfc9VNASx3ybq3D6dfVODUMpSyMg9qV1FDgPfb2uLYJvEXTMGd1E2MX/aFi5sWyvalQqnrqzvBSUaTPLu3H06IWiY+X52ht7nbF+OB9J4iPNKYSUm6HmF89petzpl5Y562e/iZxFN4pnwmQoDQEd8reV2/ph65JWhPcmZPuW0M5EnXDBAhc3UFpz6xGVmV3CJZqLBHm4s6MTimMFuaLlAf7SWlmS7BKVLd4ow9tK1+TNAIgaCQijXsNHz6g0ifZhxVWO9WE2TweCBwufDOcE2jTZJsRb2aWkx5UA3rN5quTmAJRrI32hUoP4h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/dPA+QEV8WnjVbysqyHcvZlmJ8jkZIut4SxO7jKpblU898FCnuLP5DITYbJXbpZjNqOAIU5+EVvJl91w/bM6gg/cVplPHn2L53ysYw0T4JbXlaz9cuqgxA46HEtVWn+GdWu8HYdtQF1pycDe8qFJtNz+gqNyF7ftfqxKdl+2cxVSI4h78FuAjKeBLXKFa1zLJ2OIb42OnuHYDB/4rFGFH3p74ahsMXt29ZVeIXQvbQKJMY+Olhan+btPrcVfU3/djhqfbMfh/y/wWV3ZE7GNAYFk= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 7513ed1b-1027-44ad-e78b-08dd46c3a5d8 X-MS-Exchange-CrossTenant-AuthSource: BYAPR10MB3366.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Feb 2025 15:33:47.2938 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: Bwr9ruTl0EDOfDzUT+UZbqNG1Fi2WJrk6YTtx3Q/E7DK9hbmItJOTQSDP+FiQsSIMtXE0mCLJOeA9Fi9Czef+nWjEsjNG4JGUuXcM9QjY2g= X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA1PR10MB7417 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1057,Hydra:6.0.680,FMLib:17.12.68.34 definitions=2025-02-06_03,2025-02-05_03,2024-11-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 bulkscore=0 phishscore=0 suspectscore=0 adultscore=0 mlxscore=0 spamscore=0 malwarescore=0 mlxlogscore=999 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2501170000 definitions=main-2502060127 X-Proofpoint-GUID: S9sIAal1XuX9jidJ3_2ug7-EHtscNsSC X-Proofpoint-ORIG-GUID: S9sIAal1XuX9jidJ3_2ug7-EHtscNsSC Right now the only means by which we can write-protect a range using the reverse mapping is via folio_mkclean(). However this is not always the appropriate means of doing so, specifically in the case of the framebuffer deferred I/O logic (fb_defio enabled by CONFIG_FB_DEFERRED_IO). There, kernel pages are mapped read-only and write-protect faults used to batch up I/O operations. Each time the deferred work is done, folio_mkclean() is used to mark the framebuffer page as having had I/O performed on it. However doing so requires the kernel page (perhaps allocated via vmalloc()) to have its page->mapping, index fields set so the rmap can find everything that maps it in order to write-protect. This is problematic as firstly, these fields should not be set for kernel-allocated memory, and secondly these are not folios (it's not user memory) and page->index, mapping fields are now deprecated and soon to be removed. The removal of these fields is imminent, rendering this series more urgent than it might first appear. The implementers cannot be blamed for having used this however, as there is simply no other way of performing this operation correctly. This series fixes this - we provide the mapping_wrprotect_range() function to allow the reverse mapping to be used to look up mappings from the page cache object (i.e. its address_space pointer) at a specific offset. The fb_defio logic already stores this offset, and can simply be expanded to keep track of the page cache object, so the change then becomes straight-forward. This series should have no functional change. v2: * Make CONFIG_FB_DEFERRED_IO depend on CONFIG_MMU (as it strictly relies upon it) to fix randconfig builds. * Replace mapping_wrprotect_page() with mapping_wrprotect_range() accepting a PFN, as per Simona. While it is not suited for use with DMA addresses (as pointed out by hch), it is still worth doing so to make the function more flexible. * Also update the mapping_wrprotect_range() signature to be more logical - with the pfn argument appearing before nr_pages. * Use fb_err() for error output as per Thomas. non-RFC: * Kajtar kindly smoke-tested the defio side of this change and confirmed that it appears to work correctly. I am therefore stripping the RFC and putting forward as a non-RFC series. https://lore.kernel.org/all/cover.1738347308.git.lorenzo.stoakes@oracle.com/ RFC v2: * Updated Jaya Kumar's email on cc - the MAINTAINERS section is apparently incorrect. * Corrected rmap_walk_file() comment to refer to folios as per Matthew. * Reference folio->mapping rather than folio_mapping(folio) in rmap_walk_file() as per Matthew. * Reference folio->index rather than folio_pgoff(folio) in rmap_walk_file() as per Matthew. * Renamed rmap_wrprotect_file_page() to mapping_wrprotect_page() as per Matthew. * Fixed kerneldoc and moved to implementation as per Matthew. * Updated mapping_wrprotect_page() to take a struct page pointer as per David. * Removed folio lock when invoking mapping_wrprotect_page() in fb_deferred_io_work() as per Matthew. * Removed compound_nr() in fb_deferred_io_work() as per Matthew. RFC v1: https://lore.kernel.org/all/1e452b5b65f15a9a5d0c2ed3f5f812fdd1367603.1736352361.git.lorenzo.stoakes@oracle.com/ Lorenzo Stoakes (3): mm: refactor rmap_walk_file() to separate out traversal logic mm: provide mapping_wrprotect_range() function fb_defio: do not use deprecated page->mapping, index fields drivers/video/fbdev/core/Kconfig | 1 + drivers/video/fbdev/core/fb_defio.c | 41 +++----- include/linux/fb.h | 1 + include/linux/rmap.h | 3 + mm/rmap.c | 153 +++++++++++++++++++++++----- 5 files changed, 145 insertions(+), 54 deletions(-) --- 2.48.1