2 * Copyright IBM Corp. 2008
4 * Guest page hinting for unused pages.
6 * Author(s): Martin Schwidefsky <schwidefsky@de.ibm.com>
9 #include <linux/kernel.h>
10 #include <linux/errno.h>
11 #include <linux/types.h>
13 #include <linux/init.h>
15 #define ESSA_SET_STABLE 1
16 #define ESSA_SET_UNUSED 2
18 static int cmma_flag
= 1;
20 static int __init
cmma(char *str
)
25 if (strcmp(parm
, "yes") == 0 || strcmp(parm
, "on") == 0) {
30 if (strcmp(parm
, "no") == 0 || strcmp(parm
, "off") == 0)
34 __setup("cmma=", cmma
);
36 void __init
cmma_init(void)
38 register unsigned long tmp
asm("0") = 0;
39 register int rc
asm("1") = -EOPNOTSUPP
;
44 " .insn rrf,0xb9ab0000,%1,%1,0,0\n"
48 : "+&d" (rc
), "+&d" (tmp
));
53 void arch_free_page(struct page
*page
, int order
)
59 for (i
= 0; i
< (1 << order
); i
++)
60 asm volatile(".insn rrf,0xb9ab0000,%0,%1,%2,0"
62 : "a" ((page_to_pfn(page
) + i
) << PAGE_SHIFT
),
63 "i" (ESSA_SET_UNUSED
));
66 void arch_alloc_page(struct page
*page
, int order
)
72 for (i
= 0; i
< (1 << order
); i
++)
73 asm volatile(".insn rrf,0xb9ab0000,%0,%1,%2,0"
75 : "a" ((page_to_pfn(page
) + i
) << PAGE_SHIFT
),
76 "i" (ESSA_SET_STABLE
));