1 /*
2  * Copyright (c) 2016 Oracle and/or its affiliates. All rights reserved.
3  *
4  */
5 
6 #ifndef __XEN_ARM_LIVEPATCH_H__
7 #define __XEN_ARM_LIVEPATCH_H__
8 
9 #include <xen/sizes.h> /* For SZ_* macros. */
10 
11 /* On ARM32,64 instructions are always 4 bytes long. */
12 #define ARCH_PATCH_INSN_SIZE 4
13 
14 /*
15  * The va of the hypervisor .text region. We need this as the
16  * normal va are write protected.
17  */
18 extern void *vmap_of_xen_text;
19 
20 /* These ranges are only for unconditional branches. */
21 #ifdef CONFIG_ARM_32
22 /* ARM32: A4.3 IN ARM DDI 0406C.c -  we are using only ARM instructions in Xen.*/
23 #define ARCH_LIVEPATCH_RANGE SZ_32M
24 #else
25 /* ARM64: C1.3.2 in ARM DDI 0487A.j */
26 #define ARCH_LIVEPATCH_RANGE SZ_128M
27 #endif
28 
29 #endif /* __XEN_ARM_LIVEPATCH_H__ */
30 
31 /*
32  * Local variables:
33  * mode: C
34  * c-file-style: "BSD"
35  * c-basic-offset: 4
36  * tab-width: 4
37  * indent-tabs-mode: nil
38  * End:
39  */
40