1 /* SPDX-License-Identifier: GPL-2.0-only */
2 #ifndef __ASM_PPC_GUEST_ACCESS_H__
3 #define __ASM_PPC_GUEST_ACCESS_H__
4 
5 #include <xen/mm.h>
6 
7 /* TODO */
8 
raw_copy_to_guest(void * to,const void * from,unsigned int len)9 static inline unsigned long raw_copy_to_guest(
10     void *to,
11     const void *from,
12     unsigned int len)
13 {
14     BUG_ON("unimplemented");
15 }
raw_copy_to_guest_flush_dcache(void * to,const void * from,unsigned int len)16 static inline unsigned long raw_copy_to_guest_flush_dcache(
17     void *to,
18     const void *from,
19     unsigned int len)
20 {
21     BUG_ON("unimplemented");
22 }
raw_copy_from_guest(void * to,const void * from,unsigned int len)23 static inline unsigned long raw_copy_from_guest(
24     void *to,
25     const void *from,
26     unsigned int len)
27 {
28     BUG_ON("unimplemented");
29 }
raw_clear_guest(void * to,unsigned int len)30 static inline unsigned long raw_clear_guest(void *to, unsigned int len)
31 {
32     BUG_ON("unimplemented");
33 }
34 
35 /* Copy data to guest physical address, then clean the region. */
copy_to_guest_phys_flush_dcache(struct domain * d,paddr_t gpa,void * buf,unsigned int len)36 static inline unsigned long copy_to_guest_phys_flush_dcache(
37     struct domain *d,
38     paddr_t gpa,
39     void *buf,
40     unsigned int len)
41 {
42     BUG_ON("unimplemented");
43 }
44 
access_guest_memory_by_gpa(struct domain * d,paddr_t gpa,void * buf,uint32_t size,bool is_write)45 static inline int access_guest_memory_by_gpa(
46     struct domain *d,
47     paddr_t gpa,
48     void *buf,
49     uint32_t size,
50     bool is_write)
51 {
52     BUG_ON("unimplemented");
53 }
54 
55 
56 #define __raw_copy_to_guest raw_copy_to_guest
57 #define __raw_copy_from_guest raw_copy_from_guest
58 #define __raw_clear_guest raw_clear_guest
59 
60 /*
61  * Pre-validate a guest handle.
62  * Allows use of faster __copy_* functions.
63  */
64 /* All PPC guests are paging mode external and hence safe */
65 #define guest_handle_okay(hnd, nr) (1)
66 #define guest_handle_subrange_okay(hnd, first, last) (1)
67 
68 #endif /* __ASM_PPC_GUEST_ACCESS_H__ */
69