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, see <http://www.gnu.org/licenses/>.
21  */
22 
23 extern int
24 SHADOW_INTERNAL_NAME(sh_map_and_validate_gl1e, GUEST_LEVELS)(
25     struct vcpu *v, mfn_t gl1mfn, void *new_gl1p, u32 size);
26 extern int
27 SHADOW_INTERNAL_NAME(sh_map_and_validate_gl2e, GUEST_LEVELS)(
28     struct vcpu *v, mfn_t gl2mfn, void *new_gl2p, u32 size);
29 extern int
30 SHADOW_INTERNAL_NAME(sh_map_and_validate_gl2he, GUEST_LEVELS)(
31     struct vcpu *v, mfn_t gl2mfn, void *new_gl2p, u32 size);
32 extern int
33 SHADOW_INTERNAL_NAME(sh_map_and_validate_gl3e, GUEST_LEVELS)(
34     struct vcpu *v, mfn_t gl3mfn, void *new_gl3p, u32 size);
35 extern int
36 SHADOW_INTERNAL_NAME(sh_map_and_validate_gl4e, GUEST_LEVELS)(
37     struct vcpu *v, mfn_t gl4mfn, void *new_gl4p, u32 size);
38 
39 extern void
40 SHADOW_INTERNAL_NAME(sh_destroy_l1_shadow, GUEST_LEVELS)(
41     struct domain *d, mfn_t smfn);
42 extern void
43 SHADOW_INTERNAL_NAME(sh_destroy_l2_shadow, GUEST_LEVELS)(
44     struct domain *d, mfn_t smfn);
45 extern void
46 SHADOW_INTERNAL_NAME(sh_destroy_l3_shadow, GUEST_LEVELS)(
47     struct domain *d, mfn_t smfn);
48 extern void
49 SHADOW_INTERNAL_NAME(sh_destroy_l4_shadow, GUEST_LEVELS)(
50     struct domain *d, mfn_t smfn);
51 
52 extern void
53 SHADOW_INTERNAL_NAME(sh_unhook_32b_mappings, GUEST_LEVELS)
54     (struct domain *d, mfn_t sl2mfn, int user_only);
55 extern void
56 SHADOW_INTERNAL_NAME(sh_unhook_pae_mappings, GUEST_LEVELS)
57     (struct domain *d, mfn_t sl3mfn, int user_only);
58 extern void
59 SHADOW_INTERNAL_NAME(sh_unhook_64b_mappings, GUEST_LEVELS)
60     (struct domain *d, mfn_t sl4mfn, int user_only);
61 
62 extern int
63 SHADOW_INTERNAL_NAME(sh_rm_write_access_from_l1, GUEST_LEVELS)
64     (struct domain *d, mfn_t sl1mfn, mfn_t readonly_mfn);
65 extern int
66 SHADOW_INTERNAL_NAME(sh_rm_mappings_from_l1, GUEST_LEVELS)
67     (struct domain *d, mfn_t sl1mfn, mfn_t target_mfn);
68 
69 extern void
70 SHADOW_INTERNAL_NAME(sh_clear_shadow_entry, GUEST_LEVELS)
71     (struct domain *d, void *ep, mfn_t smfn);
72 
73 extern int
74 SHADOW_INTERNAL_NAME(sh_remove_l1_shadow, GUEST_LEVELS)
75     (struct domain *d, mfn_t sl2mfn, mfn_t sl1mfn);
76 extern int
77 SHADOW_INTERNAL_NAME(sh_remove_l2_shadow, GUEST_LEVELS)
78     (struct domain *d, mfn_t sl3mfn, mfn_t sl2mfn);
79 extern int
80 SHADOW_INTERNAL_NAME(sh_remove_l3_shadow, GUEST_LEVELS)
81     (struct domain *d, mfn_t sl4mfn, mfn_t sl3mfn);
82 
83 #if SHADOW_AUDIT & SHADOW_AUDIT_ENTRIES
84 int
85 SHADOW_INTERNAL_NAME(sh_audit_l1_table, GUEST_LEVELS)
86     (struct vcpu *v, mfn_t sl1mfn, mfn_t x);
87 int
88 SHADOW_INTERNAL_NAME(sh_audit_fl1_table, GUEST_LEVELS)
89     (struct vcpu *v, mfn_t sl1mfn, mfn_t x);
90 int
91 SHADOW_INTERNAL_NAME(sh_audit_l2_table, GUEST_LEVELS)
92     (struct vcpu *v, mfn_t sl2mfn, mfn_t x);
93 int
94 SHADOW_INTERNAL_NAME(sh_audit_l3_table, GUEST_LEVELS)
95     (struct vcpu *v, mfn_t sl3mfn, mfn_t x);
96 int
97 SHADOW_INTERNAL_NAME(sh_audit_l4_table, GUEST_LEVELS)
98     (struct vcpu *v, mfn_t sl4mfn, mfn_t x);
99 #endif
100 
101 extern const struct paging_mode
102 SHADOW_INTERNAL_NAME(sh_paging_mode, GUEST_LEVELS);
103 
104 #if SHADOW_OPTIMIZATIONS & SHOPT_OUT_OF_SYNC
105 extern void
106 SHADOW_INTERNAL_NAME(sh_resync_l1, GUEST_LEVELS)
107      (struct vcpu *v, mfn_t gmfn, mfn_t snpmfn);
108 
109 extern int
110 SHADOW_INTERNAL_NAME(sh_safe_not_to_sync, GUEST_LEVELS)
111      (struct vcpu*v, mfn_t gmfn);
112 
113 extern int
114 SHADOW_INTERNAL_NAME(sh_rm_write_access_from_sl1p, GUEST_LEVELS)
115      (struct domain *d, mfn_t gmfn, mfn_t smfn, unsigned long off);
116 #endif
117