1 // SPDX-License-Identifier: GPL-2.0 2 /* 3 * Copyright IBM Corp. 2008 4 * 5 * Guest page hinting for unused pages. 6 * 7 * Author(s): Martin Schwidefsky <schwidefsky@de.ibm.com> 8 */ 9 10 #include <linux/mm.h> 11 #include <asm/page-states.h> 12 #include <asm/sections.h> 13 #include <asm/page.h> 14 15 int __bootdata_preserved(cmma_flag); 16 17 void arch_free_page(struct page *page, int order) 18 { 19 if (!cmma_flag) 20 return; 21 __set_page_unused(page_to_virt(page), 1UL << order); 22 } 23 24 void arch_alloc_page(struct page *page, int order) 25 { 26 if (!cmma_flag) 27 return; 28 if (cmma_flag < 2) 29 __set_page_stable_dat(page_to_virt(page), 1UL << order); 30 else 31 __set_page_stable_nodat(page_to_virt(page), 1UL << order); 32 } 33