diff options
Diffstat (limited to 'arch/i386/xen/mmu.h')
-rw-r--r-- | arch/i386/xen/mmu.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/arch/i386/xen/mmu.h b/arch/i386/xen/mmu.h index 49776fe9f02a..c9ff27f3ac3a 100644 --- a/arch/i386/xen/mmu.h +++ b/arch/i386/xen/mmu.h | |||
@@ -3,6 +3,19 @@ | |||
3 | #include <linux/linkage.h> | 3 | #include <linux/linkage.h> |
4 | #include <asm/page.h> | 4 | #include <asm/page.h> |
5 | 5 | ||
6 | /* | ||
7 | * Page-directory addresses above 4GB do not fit into architectural %cr3. | ||
8 | * When accessing %cr3, or equivalent field in vcpu_guest_context, guests | ||
9 | * must use the following accessor macros to pack/unpack valid MFNs. | ||
10 | * | ||
11 | * Note that Xen is using the fact that the pagetable base is always | ||
12 | * page-aligned, and putting the 12 MSB of the address into the 12 LSB | ||
13 | * of cr3. | ||
14 | */ | ||
15 | #define xen_pfn_to_cr3(pfn) (((unsigned)(pfn) << 12) | ((unsigned)(pfn) >> 20)) | ||
16 | #define xen_cr3_to_pfn(cr3) (((unsigned)(cr3) >> 12) | ((unsigned)(cr3) << 20)) | ||
17 | |||
18 | |||
6 | void set_pte_mfn(unsigned long vaddr, unsigned long pfn, pgprot_t flags); | 19 | void set_pte_mfn(unsigned long vaddr, unsigned long pfn, pgprot_t flags); |
7 | 20 | ||
8 | void xen_set_pte(pte_t *ptep, pte_t pteval); | 21 | void xen_set_pte(pte_t *ptep, pte_t pteval); |