From patchwork Thu Feb 22 23:16:42 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Elliot Berman X-Patchwork-Id: 13568237 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 E5C8AC47DD9 for ; Thu, 22 Feb 2024 23:17:23 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 1DE846B009C; Thu, 22 Feb 2024 18:16:49 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 16A366B009B; Thu, 22 Feb 2024 18:16:49 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id D9C556B009F; Thu, 22 Feb 2024 18:16:48 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id BF6456B009D for ; Thu, 22 Feb 2024 18:16:48 -0500 (EST) Received: from smtpin06.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id 95E8CC1049 for ; Thu, 22 Feb 2024 23:16:48 +0000 (UTC) X-FDA: 81821001696.06.BAC2A5F Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) by imf22.hostedemail.com (Postfix) with ESMTP id 88B22C0005 for ; Thu, 22 Feb 2024 23:16:46 +0000 (UTC) Authentication-Results: imf22.hostedemail.com; dkim=pass header.d=quicinc.com header.s=qcppdkim1 header.b=Aex6mvf2; dmarc=pass (policy=none) header.from=quicinc.com; spf=pass (imf22.hostedemail.com: domain of quic_eberman@quicinc.com designates 205.220.180.131 as permitted sender) smtp.mailfrom=quic_eberman@quicinc.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1708643806; a=rsa-sha256; cv=none; b=f9xtDjVvpleURG3KbEKUTLTxkHaopEA0ZK4/FpQ4d368pBSvzB8UxZ28JdG0waY80DZIdT hv2kd1hkGCHqMXD0MApLS/mP9aUoUzCAc+jA1MpHHaEyMCIfhVOGlOawI4PojbxlyLqM77 hbvy9XXufbo5/9K7dT/Ij9bM5PC6e1c= ARC-Authentication-Results: i=1; imf22.hostedemail.com; dkim=pass header.d=quicinc.com header.s=qcppdkim1 header.b=Aex6mvf2; dmarc=pass (policy=none) header.from=quicinc.com; spf=pass (imf22.hostedemail.com: domain of quic_eberman@quicinc.com designates 205.220.180.131 as permitted sender) smtp.mailfrom=quic_eberman@quicinc.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1708643806; 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:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=BqFFNu68PPJsdW9psryeqdBWeZaEA8iJMtTYpGjEiRs=; b=NJHbZ28n10jmDFiK8nXUC3S+vAvfJqXiCGlH4furAxKovuLojoRr/U49EWtiz6DlgR5/50 4Q0qF9KYlZLevRYQP+EbTFRPWuS4zTb4mRSG7biEojRKS1JXq21snP2Ii5xLDJvmCJLYGq IjR5gTqflqQk6zCJ7giC7nHYvHZsX7A= Received: from pps.filterd (m0279870.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.24/8.17.1.24) with ESMTP id 41MLSSYf024471; Thu, 22 Feb 2024 23:16:39 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h= from:date:subject:mime-version:content-type :content-transfer-encoding:message-id:references:in-reply-to:to :cc; s=qcppdkim1; bh=BqFFNu68PPJsdW9psryeqdBWeZaEA8iJMtTYpGjEiRs =; b=Aex6mvf2g3FnivTElXrRrrHWoO98H3rwWvOrmltuggNv3WUhHob6R/Efvf5 fth/r/0ebRdtGJN6hnNt00WxB+8pxKlu8y2Zjah3urXwGeZ2A8JIEuZNAzC80uvQ WlIeepmVse9WxaI/b//9J8xcsfewNrgxojbn1H3/NNwIMlcpN4bkj5HIqNF8ZUH7 RIuoI+MZZ6xj4SnJhmTgjSUiB7Us6pTFEBBECy0F6SLzOou0dnNdl49ruiqElAT2 F+J3iD96h5jsthaHd4CmCy/27vk8MDfgaFFPUXHpqcgipDVinxSZyXQCY0WIlNaK tnoNdc9MIJfm8YDvhpRbBPlK5Ig== Received: from nasanppmta05.qualcomm.com (i-global254.qualcomm.com [199.106.103.254]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3we3231h1r-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 22 Feb 2024 23:16:39 +0000 (GMT) Received: from nasanex01b.na.qualcomm.com (nasanex01b.na.qualcomm.com [10.46.141.250]) by NASANPPMTA05.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 41MNGc3b025583 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 22 Feb 2024 23:16:38 GMT Received: from hu-eberman-lv.qualcomm.com (10.49.16.6) by nasanex01b.na.qualcomm.com (10.46.141.250) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.40; Thu, 22 Feb 2024 15:16:37 -0800 From: Elliot Berman Date: Thu, 22 Feb 2024 15:16:42 -0800 Subject: [PATCH v17 19/35] arch/mm: Export direct {un,}map functions MIME-Version: 1.0 Message-ID: <20240222-gunyah-v17-19-1e9da6763d38@quicinc.com> References: <20240222-gunyah-v17-0-1e9da6763d38@quicinc.com> In-Reply-To: <20240222-gunyah-v17-0-1e9da6763d38@quicinc.com> To: Alex Elder , Srinivas Kandagatla , Murali Nalajal , Trilok Soni , Srivatsa Vaddagiri , Carl van Schaik , Philip Derrin , Prakruthi Deepak Heragu , Jonathan Corbet , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Catalin Marinas , Will Deacon , Konrad Dybcio , Bjorn Andersson , Dmitry Baryshkov , "Fuad Tabba" , Sean Christopherson , "Andrew Morton" CC: , , , , , , Elliot Berman X-Mailer: b4 0.12.4 X-Originating-IP: [10.49.16.6] X-ClientProxiedBy: nalasex01c.na.qualcomm.com (10.47.97.35) To nasanex01b.na.qualcomm.com (10.46.141.250) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-ORIG-GUID: MP-x340LqCsOeMxuGX6zrotY1v88l2Gs X-Proofpoint-GUID: MP-x340LqCsOeMxuGX6zrotY1v88l2Gs X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.1011,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2024-02-22_15,2024-02-22_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 bulkscore=0 impostorscore=0 priorityscore=1501 mlxscore=0 lowpriorityscore=0 clxscore=1015 suspectscore=0 malwarescore=0 mlxlogscore=828 adultscore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2402120000 definitions=main-2402220178 X-Rspam-User: X-Rspamd-Server: rspam06 X-Rspamd-Queue-Id: 88B22C0005 X-Stat-Signature: fmkka93hj5dzi5us6pjqmz6ippbmjyg7 X-HE-Tag: 1708643806-194854 X-HE-Meta: U2FsdGVkX194kOxJUTTXjibAQ1V68V15/oLktnfFkWmhMCKdu50qWVInempMK2OYP9pPMgGcUMFuAwxaqdJxThuS1ZyAwXO4Cu4thKiZrW14sMq1qeXUz0OF8ckMsdBgI223hh1boHatAX9bQnBhy3zFbz05vbSlhwW8XsIBBpuVEACfDsCAM2ouvyIzGYM6cuyJGlqkqDpFTQoXuSLrZ2TQSK9UERpD+RCPCLfR/XfCuUiPgY4Z8jhwVWnpwsc84AszpCC/Q2TRCMLO3DWE/PdcgSgLJkXl8hM/Pp1mm7je4idsDtNK8k2ZlzHP+/BBNxqFI2/upntZs7tQLJgv2gNJ9ELvb59Di28pIJiiRfTuZkSgha5VVzz0o5ShVcskHR6oMtKFsx4nmzPL8cyqXtfWaVGSCpvxPVAQTCciq3mx08OQzH1qEo+TuEIWeoGUVPJJoFUvaBCjM+aljGzbA/+/z/RccVZYIsD1sm/Xat1HDsK7K1ONYCQU8+BnEPV9LiPDdDTaxSlUaPYVA4+lN3QY2kpQ5pZhAFetoJOJoomURonLyiappneCy+kVfcRi44Oi3DZz11wepWZj8p9XqQmC/OjeZZuYOaYRwqdj+ib2f+lB/IYp6Us6cc5tCTSeeIDv5p0MgfciPFJa8/uRMn38mE8lzKPGRrH9u3LTxCxvrw3vzxfgEXM5hk/PDcS1yA8pWnDFYwGktx4rWqAmDhaKehyUW2eAUUMEAznW73XV5fR6cyDr8BIwB2ZgJchbAduiiGxGiBefEOZn9YRgmT9nR3XHZZQ0Sat5+66+1xW/G2JkeAgvjjXvmPtYmPTbadJYoSl90v6S7nzyClredbOEwv45joVW/1dTMOBbgXJwPxHtduUVYdqN2+1bYOne/jbwM/rumYTDSxQfZ1xEWbG9kYwJteJs4TohC7vwFAmlyFtdR6Z5oetZRHMCcT0bClWuLj1KC6k= 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: List-Subscribe: List-Unsubscribe: Firmware and hypervisor drivers can donate system heap memory to their respective firmware/hypervisor entities. Those drivers should unmap the pages from the kernel's logical map before doing so. Export can_set_direct_map, set_direct_map_invalid_noflush, and set_direct_map_default_noflush. Signed-off-by: Elliot Berman --- arch/arm64/mm/pageattr.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/arch/arm64/mm/pageattr.c b/arch/arm64/mm/pageattr.c index 924843f1f661b..a9bd84588c98a 100644 --- a/arch/arm64/mm/pageattr.c +++ b/arch/arm64/mm/pageattr.c @@ -32,6 +32,7 @@ bool can_set_direct_map(void) return rodata_full || debug_pagealloc_enabled() || arm64_kfence_can_set_direct_map(); } +EXPORT_SYMBOL_GPL(can_set_direct_map); static int change_page_range(pte_t *ptep, unsigned long addr, void *data) { @@ -176,6 +177,7 @@ int set_direct_map_invalid_noflush(struct page *page) (unsigned long)page_address(page), PAGE_SIZE, change_page_range, &data); } +EXPORT_SYMBOL_GPL(set_direct_map_invalid_noflush); int set_direct_map_default_noflush(struct page *page) { @@ -191,6 +193,7 @@ int set_direct_map_default_noflush(struct page *page) (unsigned long)page_address(page), PAGE_SIZE, change_page_range, &data); } +EXPORT_SYMBOL_GPL(set_direct_map_default_noflush); #ifdef CONFIG_DEBUG_PAGEALLOC void __kernel_map_pages(struct page *page, int numpages, int enable)