blob: 537bb9aab777ab00b446d1cec9daded81a3ed71f [file] [log] [blame]
Jeremy Fitzhardinge3b827c12007-07-17 18:37:04 -07001#ifndef _XEN_MMU_H
2
3#include <linux/linkage.h>
4#include <asm/page.h>
5
Mark McLoughlinf6433702008-04-02 15:36:36 +01006enum pt_level {
7 PT_PGD,
8 PT_PUD,
9 PT_PMD,
10 PT_PTE
11};
12
Jeremy Fitzhardingef87e4ca2007-07-17 18:37:06 -070013
Jeremy Fitzhardingee791ca02009-02-26 15:48:33 -080014bool __set_phys_to_machine(unsigned long pfn, unsigned long mfn);
Jeremy Fitzhardingee791ca02009-02-26 15:48:33 -080015
Jeremy Fitzhardinge3b827c12007-07-17 18:37:04 -070016void set_pte_mfn(unsigned long vaddr, unsigned long pfn, pgprot_t flags);
17
Jeremy Fitzhardinge3b827c12007-07-17 18:37:04 -070018
19void xen_activate_mm(struct mm_struct *prev, struct mm_struct *next);
20void xen_dup_mmap(struct mm_struct *oldmm, struct mm_struct *mm);
21void xen_exit_mmap(struct mm_struct *mm);
22
Jeremy Fitzhardinge3843fc22008-05-09 12:05:57 +010023pteval_t xen_pte_val(pte_t);
24pmdval_t xen_pmd_val(pmd_t);
25pgdval_t xen_pgd_val(pgd_t);
Jeremy Fitzhardinge3b827c12007-07-17 18:37:04 -070026
Jeremy Fitzhardinge3843fc22008-05-09 12:05:57 +010027pte_t xen_make_pte(pteval_t);
28pmd_t xen_make_pmd(pmdval_t);
29pgd_t xen_make_pgd(pgdval_t);
Jeremy Fitzhardinge3b827c12007-07-17 18:37:04 -070030
Jeremy Fitzhardingee2426cf2008-05-31 01:24:27 +010031void xen_set_pte(pte_t *ptep, pte_t pteval);
Jeremy Fitzhardinge3b827c12007-07-17 18:37:04 -070032void xen_set_pte_at(struct mm_struct *mm, unsigned long addr,
33 pte_t *ptep, pte_t pteval);
Jeremy Fitzhardingef6e58732008-07-08 15:06:38 -070034
35#ifdef CONFIG_X86_PAE
Jeremy Fitzhardinge3b827c12007-07-17 18:37:04 -070036void xen_set_pte_atomic(pte_t *ptep, pte_t pte);
Jeremy Fitzhardingef6e58732008-07-08 15:06:38 -070037void xen_pte_clear(struct mm_struct *mm, unsigned long addr, pte_t *ptep);
38void xen_pmd_clear(pmd_t *pmdp);
39#endif /* CONFIG_X86_PAE */
40
Jeremy Fitzhardingee2426cf2008-05-31 01:24:27 +010041void xen_set_pmd(pmd_t *pmdp, pmd_t pmdval);
Jeremy Fitzhardinge3b827c12007-07-17 18:37:04 -070042void xen_set_pud(pud_t *ptr, pud_t val);
Jeremy Fitzhardingee2426cf2008-05-31 01:24:27 +010043void xen_set_pmd_hyper(pmd_t *pmdp, pmd_t pmdval);
44void xen_set_pud_hyper(pud_t *ptr, pud_t val);
Jeremy Fitzhardingef6e58732008-07-08 15:06:38 -070045
46#if PAGETABLE_LEVELS == 4
47pudval_t xen_pud_val(pud_t pud);
48pud_t xen_make_pud(pudval_t pudval);
49void xen_set_pgd(pgd_t *pgdp, pgd_t pgd);
50void xen_set_pgd_hyper(pgd_t *pgdp, pgd_t pgd);
51#endif
Jeremy Fitzhardinge3b827c12007-07-17 18:37:04 -070052
Jeremy Fitzhardinged6182fb2008-07-08 15:07:13 -070053pgd_t *xen_get_user_pgd(pgd_t *pgd);
54
Jeremy Fitzhardingee57778a2008-06-16 04:30:02 -070055pte_t xen_ptep_modify_prot_start(struct mm_struct *mm, unsigned long addr, pte_t *ptep);
56void xen_ptep_modify_prot_commit(struct mm_struct *mm, unsigned long addr,
57 pte_t *ptep, pte_t pte);
58
Jeremy Fitzhardinge319f3ba2009-01-28 14:35:01 -080059unsigned long xen_read_cr2_direct(void);
60
Thomas Gleixner030cb6c2009-08-20 14:30:02 +020061extern void xen_init_mmu_ops(void);
Stefano Stabellini59151002010-06-17 14:22:52 +010062extern void xen_hvm_init_mmu_ops(void);
Jeremy Fitzhardinge3b827c12007-07-17 18:37:04 -070063#endif /* _XEN_MMU_H */