1 | /****************************************************************************** |
---|
2 | * arch/x86/mm/shadow/multi.h |
---|
3 | * |
---|
4 | * Shadow declarations which will be multiply compiled. |
---|
5 | * Parts of this code are Copyright (c) 2006 by XenSource Inc. |
---|
6 | * Parts of this code are Copyright (c) 2006 by Michael A Fetterman |
---|
7 | * Parts based on earlier work by Michael A Fetterman, Ian Pratt et al. |
---|
8 | * |
---|
9 | * This program is free software; you can redistribute it and/or modify |
---|
10 | * it under the terms of the GNU General Public License as published by |
---|
11 | * the Free Software Foundation; either version 2 of the License, or |
---|
12 | * (at your option) any later version. |
---|
13 | * |
---|
14 | * This program is distributed in the hope that it will be useful, |
---|
15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
17 | * GNU General Public License for more details. |
---|
18 | * |
---|
19 | * You should have received a copy of the GNU General Public License |
---|
20 | * along with this program; if not, write to the Free Software |
---|
21 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
---|
22 | */ |
---|
23 | |
---|
24 | extern int |
---|
25 | SHADOW_INTERNAL_NAME(sh_map_and_validate_gl1e, SHADOW_LEVELS, GUEST_LEVELS)( |
---|
26 | struct vcpu *v, mfn_t gl1mfn, void *new_gl1p, u32 size); |
---|
27 | extern int |
---|
28 | SHADOW_INTERNAL_NAME(sh_map_and_validate_gl2e, SHADOW_LEVELS, GUEST_LEVELS)( |
---|
29 | struct vcpu *v, mfn_t gl2mfn, void *new_gl2p, u32 size); |
---|
30 | extern int |
---|
31 | SHADOW_INTERNAL_NAME(sh_map_and_validate_gl2he, SHADOW_LEVELS, GUEST_LEVELS)( |
---|
32 | struct vcpu *v, mfn_t gl2mfn, void *new_gl2p, u32 size); |
---|
33 | extern int |
---|
34 | SHADOW_INTERNAL_NAME(sh_map_and_validate_gl3e, SHADOW_LEVELS, GUEST_LEVELS)( |
---|
35 | struct vcpu *v, mfn_t gl3mfn, void *new_gl3p, u32 size); |
---|
36 | extern int |
---|
37 | SHADOW_INTERNAL_NAME(sh_map_and_validate_gl4e, SHADOW_LEVELS, GUEST_LEVELS)( |
---|
38 | struct vcpu *v, mfn_t gl4mfn, void *new_gl4p, u32 size); |
---|
39 | |
---|
40 | extern void |
---|
41 | SHADOW_INTERNAL_NAME(sh_destroy_l1_shadow, SHADOW_LEVELS, GUEST_LEVELS)( |
---|
42 | struct vcpu *v, mfn_t smfn); |
---|
43 | extern void |
---|
44 | SHADOW_INTERNAL_NAME(sh_destroy_l2_shadow, SHADOW_LEVELS, GUEST_LEVELS)( |
---|
45 | struct vcpu *v, mfn_t smfn); |
---|
46 | extern void |
---|
47 | SHADOW_INTERNAL_NAME(sh_destroy_l3_shadow, SHADOW_LEVELS, GUEST_LEVELS)( |
---|
48 | struct vcpu *v, mfn_t smfn); |
---|
49 | extern void |
---|
50 | SHADOW_INTERNAL_NAME(sh_destroy_l4_shadow, SHADOW_LEVELS, GUEST_LEVELS)( |
---|
51 | struct vcpu *v, mfn_t smfn); |
---|
52 | |
---|
53 | extern void |
---|
54 | SHADOW_INTERNAL_NAME(sh_unhook_32b_mappings, SHADOW_LEVELS, GUEST_LEVELS) |
---|
55 | (struct vcpu *v, mfn_t sl2mfn); |
---|
56 | extern void |
---|
57 | SHADOW_INTERNAL_NAME(sh_unhook_pae_mappings, SHADOW_LEVELS, GUEST_LEVELS) |
---|
58 | (struct vcpu *v, mfn_t sl3mfn); |
---|
59 | extern void |
---|
60 | SHADOW_INTERNAL_NAME(sh_unhook_64b_mappings, SHADOW_LEVELS, GUEST_LEVELS) |
---|
61 | (struct vcpu *v, mfn_t sl4mfn); |
---|
62 | |
---|
63 | extern int |
---|
64 | SHADOW_INTERNAL_NAME(sh_rm_write_access_from_l1, SHADOW_LEVELS, GUEST_LEVELS) |
---|
65 | (struct vcpu *v, mfn_t sl1mfn, mfn_t readonly_mfn); |
---|
66 | extern int |
---|
67 | SHADOW_INTERNAL_NAME(sh_rm_mappings_from_l1, SHADOW_LEVELS, GUEST_LEVELS) |
---|
68 | (struct vcpu *v, mfn_t sl1mfn, mfn_t target_mfn); |
---|
69 | |
---|
70 | extern void |
---|
71 | SHADOW_INTERNAL_NAME(sh_clear_shadow_entry, SHADOW_LEVELS, GUEST_LEVELS) |
---|
72 | (struct vcpu *v, void *ep, mfn_t smfn); |
---|
73 | |
---|
74 | extern int |
---|
75 | SHADOW_INTERNAL_NAME(sh_remove_l1_shadow, SHADOW_LEVELS, GUEST_LEVELS) |
---|
76 | (struct vcpu *v, mfn_t sl2mfn, mfn_t sl1mfn); |
---|
77 | extern int |
---|
78 | SHADOW_INTERNAL_NAME(sh_remove_l2_shadow, SHADOW_LEVELS, GUEST_LEVELS) |
---|
79 | (struct vcpu *v, mfn_t sl3mfn, mfn_t sl2mfn); |
---|
80 | extern int |
---|
81 | SHADOW_INTERNAL_NAME(sh_remove_l3_shadow, SHADOW_LEVELS, GUEST_LEVELS) |
---|
82 | (struct vcpu *v, mfn_t sl4mfn, mfn_t sl3mfn); |
---|
83 | |
---|
84 | #if SHADOW_AUDIT & SHADOW_AUDIT_ENTRIES |
---|
85 | int |
---|
86 | SHADOW_INTERNAL_NAME(sh_audit_l1_table, SHADOW_LEVELS, GUEST_LEVELS) |
---|
87 | (struct vcpu *v, mfn_t sl1mfn, mfn_t x); |
---|
88 | int |
---|
89 | SHADOW_INTERNAL_NAME(sh_audit_fl1_table, SHADOW_LEVELS, GUEST_LEVELS) |
---|
90 | (struct vcpu *v, mfn_t sl1mfn, mfn_t x); |
---|
91 | int |
---|
92 | SHADOW_INTERNAL_NAME(sh_audit_l2_table, SHADOW_LEVELS, GUEST_LEVELS) |
---|
93 | (struct vcpu *v, mfn_t sl2mfn, mfn_t x); |
---|
94 | int |
---|
95 | SHADOW_INTERNAL_NAME(sh_audit_l3_table, SHADOW_LEVELS, GUEST_LEVELS) |
---|
96 | (struct vcpu *v, mfn_t sl3mfn, mfn_t x); |
---|
97 | int |
---|
98 | SHADOW_INTERNAL_NAME(sh_audit_l4_table, SHADOW_LEVELS, GUEST_LEVELS) |
---|
99 | (struct vcpu *v, mfn_t sl4mfn, mfn_t x); |
---|
100 | #endif |
---|
101 | |
---|
102 | extern void * |
---|
103 | SHADOW_INTERNAL_NAME(sh_guest_map_l1e, CONFIG_PAGING_LEVELS, CONFIG_PAGING_LEVELS) |
---|
104 | (struct vcpu *v, unsigned long va, unsigned long *gl1mfn); |
---|
105 | extern void |
---|
106 | SHADOW_INTERNAL_NAME(sh_guest_get_eff_l1e, CONFIG_PAGING_LEVELS, CONFIG_PAGING_LEVELS) |
---|
107 | (struct vcpu *v, unsigned long va, void *eff_l1e); |
---|
108 | |
---|
109 | #if SHADOW_LEVELS == GUEST_LEVELS |
---|
110 | extern mfn_t |
---|
111 | SHADOW_INTERNAL_NAME(sh_make_monitor_table, SHADOW_LEVELS, GUEST_LEVELS) |
---|
112 | (struct vcpu *v); |
---|
113 | extern void |
---|
114 | SHADOW_INTERNAL_NAME(sh_destroy_monitor_table, SHADOW_LEVELS, GUEST_LEVELS) |
---|
115 | (struct vcpu *v, mfn_t mmfn); |
---|
116 | #endif |
---|
117 | |
---|
118 | extern struct paging_mode |
---|
119 | SHADOW_INTERNAL_NAME(sh_paging_mode, SHADOW_LEVELS, GUEST_LEVELS); |
---|