|
1 | 1 | // Copyright 2017 syzkaller project authors. All rights reserved. |
2 | 2 | // Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file. |
3 | 3 |
|
| 4 | +// x86-specific definitions. |
| 5 | +#if GOARCH_amd64 |
4 | 6 | #define X86_ADDR_TEXT 0x0000 |
5 | 7 | #define X86_ADDR_PD_IOAPIC 0x0000 |
6 | 8 | #define X86_ADDR_GDT 0x1000 |
|
33 | 35 | #define X86_ADDR_VAR_USER_CODE 0x9100 |
34 | 36 | #define X86_ADDR_VAR_USER_CODE2 0x9120 |
35 | 37 |
|
36 | | -// x86 SYZOS definitions. |
37 | 38 | // Zero page (0x0 - 0xfff) is deliberately unused. |
38 | 39 | #define X86_SYZOS_ADDR_ZERO 0x0 |
39 | 40 | #define X86_SYZOS_ADDR_GDT 0x1000 |
|
52 | 53 | #define X86_SYZOS_ADDR_UEXIT (X86_SYZOS_ADDR_EXIT + 256) |
53 | 54 | #define X86_SYZOS_ADDR_DIRTY_PAGES 0x41000 |
54 | 55 | #define X86_SYZOS_ADDR_USER_CODE 0x50000 |
55 | | -#define X86_SYZOS_ADDR_EXECUTOR_CODE 0x54000 |
| 56 | +// Location of the SYZOS guest code. Name shared with ARM64 SYZOS. |
| 57 | +#define SYZOS_ADDR_EXECUTOR_CODE 0x54000 |
56 | 58 | #define X86_SYZOS_ADDR_SCRATCH_CODE 0x58000 |
57 | 59 | #define X86_SYZOS_ADDR_STACK_BOTTOM 0x90000 |
58 | 60 | #define X86_SYZOS_ADDR_STACK0 0x90f80 |
|
163 | 165 |
|
164 | 166 | #define X86_NEXT_INSN $0xbadc0de |
165 | 167 | #define X86_PREFIX_SIZE 0xba1d |
| 168 | +#endif // x86-specific definitions. |
166 | 169 |
|
167 | 170 | #define KVM_MAX_VCPU 4 |
168 | 171 | #define KVM_PAGE_SIZE (1 << 12) |
|
174 | 177 | (((~0ULL) - (1ULL << (l)) + 1ULL) & \ |
175 | 178 | (~0ULL >> (63 - (h)))) |
176 | 179 |
|
| 180 | +// ARM64 SYZOS definitions. |
| 181 | +#if GOARCH_arm64 |
177 | 182 | // GICv3 distributor address. |
178 | 183 | #define ARM64_ADDR_GICD_BASE 0x08000000 |
179 | 184 | // GICv3 ITS address. |
|
188 | 193 | // Two writable pages with KVM_MEM_LOG_DIRTY_PAGES explicitly set. |
189 | 194 | #define ARM64_ADDR_DIRTY_PAGES 0xdddd1000 |
190 | 195 | #define ARM64_ADDR_USER_CODE 0xeeee0000 |
191 | | -#define ARM64_ADDR_EXECUTOR_CODE 0xeeee8000 |
| 196 | +// Location of the SYZOS guest code. Name shared with x86 SYZOS. |
| 197 | +#define SYZOS_ADDR_EXECUTOR_CODE 0xeeee8000 |
192 | 198 | #define ARM64_ADDR_SCRATCH_CODE 0xeeef0000 |
193 | 199 | #define ARM64_ADDR_EL1_STACK_BOTTOM 0xffff1000 |
194 | 200 |
|
|
201 | 207 | #define ARM64_ADDR_ITS_ITT_TABLES (ARM64_ADDR_ITS_CMDQ_BASE + SZ_64K) |
202 | 208 | #define ARM64_ADDR_ITS_PROP_TABLE (ARM64_ADDR_ITS_ITT_TABLES + SZ_64K * ITS_MAX_DEVICES) |
203 | 209 | #define ARM64_ADDR_ITS_PEND_TABLES (ARM64_ADDR_ITS_PROP_TABLE + SZ_64K) |
| 210 | + |
| 211 | +#endif // ARM64 SYZOS definitions |
0 commit comments