1 /*
2 * mem_access.h: architecture specific mem_access handling routines
3 *
4 * This program is free software; you can redistribute it and/or modify it
5 * under the terms and conditions of the GNU General Public License,
6 * version 2, as published by the Free Software Foundation.
7 *
8 * This program is distributed in the hope it will be useful, but WITHOUT
9 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
10 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
11 * more details.
12 *
13 * You should have received a copy of the GNU General Public License along with
14 * this program; If not, see <http://www.gnu.org/licenses/>.
15 */
16
17 #ifndef _ASM_ARM_MEM_ACCESS_H
18 #define _ASM_ARM_MEM_ACCESS_H
19
20 #include <xen/types.h>
21
22 static inline
p2m_mem_access_emulate_check(struct vcpu * v,const struct vm_event_st * rsp)23 bool p2m_mem_access_emulate_check(struct vcpu *v,
24 const struct vm_event_st *rsp)
25 {
26 /* Not supported on ARM. */
27 return false;
28 }
29
30 /* vm_event and mem_access are supported on any ARM guest */
p2m_mem_access_sanity_check(struct domain * d)31 static inline bool p2m_mem_access_sanity_check(struct domain *d)
32 {
33 return true;
34 }
35
36 /*
37 * Send mem event based on the access. Boolean return value indicates if trap
38 * needs to be injected into guest.
39 */
40 #ifdef CONFIG_VM_EVENT
41 bool p2m_mem_access_check(paddr_t gpa, vaddr_t gla, const struct npfec npfec);
42
43 struct page_info*
44 p2m_mem_access_check_and_get_page(vaddr_t gva, unsigned long flag,
45 const struct vcpu *v);
46 #else
47
48 static inline bool
p2m_mem_access_check(paddr_t gpa,vaddr_t gla,const struct npfec npfec)49 p2m_mem_access_check(paddr_t gpa, vaddr_t gla, const struct npfec npfec)
50 {
51 return false;
52 }
53
54 static inline struct page_info*
p2m_mem_access_check_and_get_page(vaddr_t gva,unsigned long flag,const struct vcpu * v)55 p2m_mem_access_check_and_get_page(vaddr_t gva, unsigned long flag,
56 const struct vcpu *v)
57 {
58 return NULL;
59 }
60
61 #endif /* CONFIG_VM_EVENT */
62 #endif /* _ASM_ARM_MEM_ACCESS_H */
63
64 /*
65 * Local variables:
66 * mode: C
67 * c-file-style: "BSD"
68 * c-basic-offset: 4
69 * indent-tabs-mode: nil
70 * End:
71 */
72