BACKPORT: FROMLIST: arch/mm: Export direct {un,}map functions

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.

Bug: 338347082
Link: https://lore.kernel.org/all/20240222-gunyah-v17-19-1e9da6763d38@quicinc.com/
Change-Id: Ib94aa30156db3a6b9a755228ed7c20c910caaf65
Signed-off-by: Elliot Berman <quic_eberman@quicinc.com>
Signed-off-by: Sreenad Menon <quic_sreemeno@quicinc.com>
Signed-off-by: Elliot Berman <elliot.berman@oss.qualcomm.com>
This commit is contained in:
Elliot Berman
2024-02-22 15:16:42 -08:00
committed by Treehugger Robot
parent 631ab9a1d7
commit 09b92d4199
+2
View File
@@ -176,6 +176,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 +192,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)