2 * Copyright (c) 2011, Max Filippov, Open Source and Linux Lab.
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are met:
7 * * Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.
9 * * Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the
11 * documentation and/or other materials provided with the distribution.
12 * * Neither the name of the Open Source and Linux Lab nor the
13 * names of its contributors may be used to endorse or promote products
14 * derived from this software without specific prior written permission.
16 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
17 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
20 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 #include "qemu/osdep.h"
30 #include "exec/exec-all.h"
31 #include "exec/gdbstub.h"
32 #include "qemu/host-utils.h"
33 #if !defined(CONFIG_USER_ONLY)
34 #include "hw/loader.h"
37 static struct XtensaConfigList
*xtensa_cores
;
39 static void xtensa_core_class_init(ObjectClass
*oc
, void *data
)
41 CPUClass
*cc
= CPU_CLASS(oc
);
42 XtensaCPUClass
*xcc
= XTENSA_CPU_CLASS(oc
);
43 const XtensaConfig
*config
= data
;
47 /* Use num_core_regs to see only non-privileged registers in an unmodified
48 * gdb. Use num_regs to see all registers. gdb modification is required
49 * for that: reset bit 0 in the 'flags' field of the registers definitions
50 * in the gdb/xtensa-config.c inside gdb source tree or inside gdb overlay.
52 cc
->gdb_num_core_regs
= config
->gdb_regmap
.num_regs
;
55 void xtensa_finalize_config(XtensaConfig
*config
)
59 if (config
->gdb_regmap
.num_regs
) {
63 for (i
= 0; config
->gdb_regmap
.reg
[i
].targno
>= 0; ++i
) {
64 n
+= (config
->gdb_regmap
.reg
[i
].type
!= 6);
66 config
->gdb_regmap
.num_regs
= n
;
69 void xtensa_register_core(XtensaConfigList
*node
)
72 .parent
= TYPE_XTENSA_CPU
,
73 .class_init
= xtensa_core_class_init
,
74 .class_data
= (void *)node
->config
,
77 node
->next
= xtensa_cores
;
79 type
.name
= g_strdup_printf(XTENSA_CPU_TYPE_NAME("%s"), node
->config
->name
);
81 g_free((gpointer
)type
.name
);
84 static uint32_t check_hw_breakpoints(CPUXtensaState
*env
)
88 for (i
= 0; i
< env
->config
->ndbreak
; ++i
) {
89 if (env
->cpu_watchpoint
[i
] &&
90 env
->cpu_watchpoint
[i
]->flags
& BP_WATCHPOINT_HIT
) {
91 return DEBUGCAUSE_DB
| (i
<< DEBUGCAUSE_DBNUM_SHIFT
);
97 void xtensa_breakpoint_handler(CPUState
*cs
)
99 XtensaCPU
*cpu
= XTENSA_CPU(cs
);
100 CPUXtensaState
*env
= &cpu
->env
;
102 if (cs
->watchpoint_hit
) {
103 if (cs
->watchpoint_hit
->flags
& BP_CPU
) {
106 cs
->watchpoint_hit
= NULL
;
107 cause
= check_hw_breakpoints(env
);
109 debug_exception_env(env
, cause
);
111 cpu_loop_exit_noexc(cs
);
116 void xtensa_cpu_list(FILE *f
, fprintf_function cpu_fprintf
)
118 XtensaConfigList
*core
= xtensa_cores
;
119 cpu_fprintf(f
, "Available CPUs:\n");
120 for (; core
; core
= core
->next
) {
121 cpu_fprintf(f
, " %s\n", core
->config
->name
);
125 hwaddr
xtensa_cpu_get_phys_page_debug(CPUState
*cs
, vaddr addr
)
127 XtensaCPU
*cpu
= XTENSA_CPU(cs
);
132 if (xtensa_get_physical_addr(&cpu
->env
, false, addr
, 0, 0,
133 &paddr
, &page_size
, &access
) == 0) {
136 if (xtensa_get_physical_addr(&cpu
->env
, false, addr
, 2, 0,
137 &paddr
, &page_size
, &access
) == 0) {
143 static uint32_t relocated_vector(CPUXtensaState
*env
, uint32_t vector
)
145 if (xtensa_option_enabled(env
->config
,
146 XTENSA_OPTION_RELOCATABLE_VECTOR
)) {
147 return vector
- env
->config
->vecbase
+ env
->sregs
[VECBASE
];
154 * Handle penging IRQ.
155 * For the high priority interrupt jump to the corresponding interrupt vector.
156 * For the level-1 interrupt convert it to either user, kernel or double
157 * exception with the 'level-1 interrupt' exception cause.
159 static void handle_interrupt(CPUXtensaState
*env
)
161 int level
= env
->pending_irq_level
;
163 if (level
> xtensa_get_cintlevel(env
) &&
164 level
<= env
->config
->nlevel
&&
165 (env
->config
->level_mask
[level
] &
167 env
->sregs
[INTENABLE
])) {
168 CPUState
*cs
= CPU(xtensa_env_get_cpu(env
));
171 env
->sregs
[EPC1
+ level
- 1] = env
->pc
;
172 env
->sregs
[EPS2
+ level
- 2] = env
->sregs
[PS
];
174 (env
->sregs
[PS
] & ~PS_INTLEVEL
) | level
| PS_EXCM
;
175 env
->pc
= relocated_vector(env
,
176 env
->config
->interrupt_vector
[level
]);
178 env
->sregs
[EXCCAUSE
] = LEVEL1_INTERRUPT_CAUSE
;
180 if (env
->sregs
[PS
] & PS_EXCM
) {
181 if (env
->config
->ndepc
) {
182 env
->sregs
[DEPC
] = env
->pc
;
184 env
->sregs
[EPC1
] = env
->pc
;
186 cs
->exception_index
= EXC_DOUBLE
;
188 env
->sregs
[EPC1
] = env
->pc
;
189 cs
->exception_index
=
190 (env
->sregs
[PS
] & PS_UM
) ? EXC_USER
: EXC_KERNEL
;
192 env
->sregs
[PS
] |= PS_EXCM
;
194 env
->exception_taken
= 1;
198 /* Called from cpu_handle_interrupt with BQL held */
199 void xtensa_cpu_do_interrupt(CPUState
*cs
)
201 XtensaCPU
*cpu
= XTENSA_CPU(cs
);
202 CPUXtensaState
*env
= &cpu
->env
;
204 if (cs
->exception_index
== EXC_IRQ
) {
205 qemu_log_mask(CPU_LOG_INT
,
206 "%s(EXC_IRQ) level = %d, cintlevel = %d, "
207 "pc = %08x, a0 = %08x, ps = %08x, "
208 "intset = %08x, intenable = %08x, "
210 __func__
, env
->pending_irq_level
, xtensa_get_cintlevel(env
),
211 env
->pc
, env
->regs
[0], env
->sregs
[PS
],
212 env
->sregs
[INTSET
], env
->sregs
[INTENABLE
],
214 handle_interrupt(env
);
217 switch (cs
->exception_index
) {
218 case EXC_WINDOW_OVERFLOW4
:
219 case EXC_WINDOW_UNDERFLOW4
:
220 case EXC_WINDOW_OVERFLOW8
:
221 case EXC_WINDOW_UNDERFLOW8
:
222 case EXC_WINDOW_OVERFLOW12
:
223 case EXC_WINDOW_UNDERFLOW12
:
228 qemu_log_mask(CPU_LOG_INT
, "%s(%d) "
229 "pc = %08x, a0 = %08x, ps = %08x, ccount = %08x\n",
230 __func__
, cs
->exception_index
,
231 env
->pc
, env
->regs
[0], env
->sregs
[PS
], env
->sregs
[CCOUNT
]);
232 if (env
->config
->exception_vector
[cs
->exception_index
]) {
233 env
->pc
= relocated_vector(env
,
234 env
->config
->exception_vector
[cs
->exception_index
]);
235 env
->exception_taken
= 1;
237 qemu_log_mask(CPU_LOG_INT
, "%s(pc = %08x) bad exception_index: %d\n",
238 __func__
, env
->pc
, cs
->exception_index
);
246 qemu_log("%s(pc = %08x) unknown exception_index: %d\n",
247 __func__
, env
->pc
, cs
->exception_index
);
250 check_interrupts(env
);
253 bool xtensa_cpu_exec_interrupt(CPUState
*cs
, int interrupt_request
)
255 if (interrupt_request
& CPU_INTERRUPT_HARD
) {
256 cs
->exception_index
= EXC_IRQ
;
257 xtensa_cpu_do_interrupt(cs
);
263 static void reset_tlb_mmu_all_ways(CPUXtensaState
*env
,
264 const xtensa_tlb
*tlb
, xtensa_tlb_entry entry
[][MAX_TLB_WAY_SIZE
])
268 for (wi
= 0; wi
< tlb
->nways
; ++wi
) {
269 for (ei
= 0; ei
< tlb
->way_size
[wi
]; ++ei
) {
270 entry
[wi
][ei
].asid
= 0;
271 entry
[wi
][ei
].variable
= true;
276 static void reset_tlb_mmu_ways56(CPUXtensaState
*env
,
277 const xtensa_tlb
*tlb
, xtensa_tlb_entry entry
[][MAX_TLB_WAY_SIZE
])
279 if (!tlb
->varway56
) {
280 static const xtensa_tlb_entry way5
[] = {
295 static const xtensa_tlb_entry way6
[] = {
310 memcpy(entry
[5], way5
, sizeof(way5
));
311 memcpy(entry
[6], way6
, sizeof(way6
));
314 for (ei
= 0; ei
< 8; ++ei
) {
315 entry
[6][ei
].vaddr
= ei
<< 29;
316 entry
[6][ei
].paddr
= ei
<< 29;
317 entry
[6][ei
].asid
= 1;
318 entry
[6][ei
].attr
= 3;
323 static void reset_tlb_region_way0(CPUXtensaState
*env
,
324 xtensa_tlb_entry entry
[][MAX_TLB_WAY_SIZE
])
328 for (ei
= 0; ei
< 8; ++ei
) {
329 entry
[0][ei
].vaddr
= ei
<< 29;
330 entry
[0][ei
].paddr
= ei
<< 29;
331 entry
[0][ei
].asid
= 1;
332 entry
[0][ei
].attr
= 2;
333 entry
[0][ei
].variable
= true;
337 void reset_mmu(CPUXtensaState
*env
)
339 if (xtensa_option_enabled(env
->config
, XTENSA_OPTION_MMU
)) {
340 env
->sregs
[RASID
] = 0x04030201;
341 env
->sregs
[ITLBCFG
] = 0;
342 env
->sregs
[DTLBCFG
] = 0;
343 env
->autorefill_idx
= 0;
344 reset_tlb_mmu_all_ways(env
, &env
->config
->itlb
, env
->itlb
);
345 reset_tlb_mmu_all_ways(env
, &env
->config
->dtlb
, env
->dtlb
);
346 reset_tlb_mmu_ways56(env
, &env
->config
->itlb
, env
->itlb
);
347 reset_tlb_mmu_ways56(env
, &env
->config
->dtlb
, env
->dtlb
);
349 reset_tlb_region_way0(env
, env
->itlb
);
350 reset_tlb_region_way0(env
, env
->dtlb
);
354 static unsigned get_ring(const CPUXtensaState
*env
, uint8_t asid
)
357 for (i
= 0; i
< 4; ++i
) {
358 if (((env
->sregs
[RASID
] >> i
* 8) & 0xff) == asid
) {
366 * Lookup xtensa TLB for the given virtual address.
369 * \param pwi: [out] way index
370 * \param pei: [out] entry index
371 * \param pring: [out] access ring
372 * \return 0 if ok, exception cause code otherwise
374 int xtensa_tlb_lookup(const CPUXtensaState
*env
, uint32_t addr
, bool dtlb
,
375 uint32_t *pwi
, uint32_t *pei
, uint8_t *pring
)
377 const xtensa_tlb
*tlb
= dtlb
?
378 &env
->config
->dtlb
: &env
->config
->itlb
;
379 const xtensa_tlb_entry (*entry
)[MAX_TLB_WAY_SIZE
] = dtlb
?
380 env
->dtlb
: env
->itlb
;
385 for (wi
= 0; wi
< tlb
->nways
; ++wi
) {
388 split_tlb_entry_spec_way(env
, addr
, dtlb
, &vpn
, wi
, &ei
);
389 if (entry
[wi
][ei
].vaddr
== vpn
&& entry
[wi
][ei
].asid
) {
390 unsigned ring
= get_ring(env
, entry
[wi
][ei
].asid
);
394 LOAD_STORE_TLB_MULTI_HIT_CAUSE
:
395 INST_TLB_MULTI_HIT_CAUSE
;
404 (dtlb
? LOAD_STORE_TLB_MISS_CAUSE
: INST_TLB_MISS_CAUSE
);
408 * Convert MMU ATTR to PAGE_{READ,WRITE,EXEC} mask.
411 static unsigned mmu_attr_to_access(uint32_t attr
)
421 access
|= PAGE_WRITE
;
424 switch (attr
& 0xc) {
426 access
|= PAGE_CACHE_BYPASS
;
430 access
|= PAGE_CACHE_WB
;
434 access
|= PAGE_CACHE_WT
;
437 } else if (attr
== 13) {
438 access
|= PAGE_READ
| PAGE_WRITE
| PAGE_CACHE_ISOLATE
;
444 * Convert region protection ATTR to PAGE_{READ,WRITE,EXEC} mask.
447 static unsigned region_attr_to_access(uint32_t attr
)
449 static const unsigned access
[16] = {
450 [0] = PAGE_READ
| PAGE_WRITE
| PAGE_CACHE_WT
,
451 [1] = PAGE_READ
| PAGE_WRITE
| PAGE_EXEC
| PAGE_CACHE_WT
,
452 [2] = PAGE_READ
| PAGE_WRITE
| PAGE_EXEC
| PAGE_CACHE_BYPASS
,
453 [3] = PAGE_EXEC
| PAGE_CACHE_WB
,
454 [4] = PAGE_READ
| PAGE_WRITE
| PAGE_EXEC
| PAGE_CACHE_WB
,
455 [5] = PAGE_READ
| PAGE_WRITE
| PAGE_EXEC
| PAGE_CACHE_WB
,
456 [14] = PAGE_READ
| PAGE_WRITE
| PAGE_CACHE_ISOLATE
,
459 return access
[attr
& 0xf];
463 * Convert cacheattr to PAGE_{READ,WRITE,EXEC} mask.
464 * See ISA, A.2.14 The Cache Attribute Register
466 static unsigned cacheattr_attr_to_access(uint32_t attr
)
468 static const unsigned access
[16] = {
469 [0] = PAGE_READ
| PAGE_WRITE
| PAGE_CACHE_WT
,
470 [1] = PAGE_READ
| PAGE_WRITE
| PAGE_EXEC
| PAGE_CACHE_WT
,
471 [2] = PAGE_READ
| PAGE_WRITE
| PAGE_EXEC
| PAGE_CACHE_BYPASS
,
472 [3] = PAGE_EXEC
| PAGE_CACHE_WB
,
473 [4] = PAGE_READ
| PAGE_WRITE
| PAGE_EXEC
| PAGE_CACHE_WB
,
474 [14] = PAGE_READ
| PAGE_WRITE
| PAGE_CACHE_ISOLATE
,
477 return access
[attr
& 0xf];
480 static bool is_access_granted(unsigned access
, int is_write
)
484 return access
& PAGE_READ
;
487 return access
& PAGE_WRITE
;
490 return access
& PAGE_EXEC
;
497 static int get_pte(CPUXtensaState
*env
, uint32_t vaddr
, uint32_t *pte
);
499 static int get_physical_addr_mmu(CPUXtensaState
*env
, bool update_tlb
,
500 uint32_t vaddr
, int is_write
, int mmu_idx
,
501 uint32_t *paddr
, uint32_t *page_size
, unsigned *access
,
504 bool dtlb
= is_write
!= 2;
510 const xtensa_tlb_entry
*entry
= NULL
;
511 xtensa_tlb_entry tmp_entry
;
512 int ret
= xtensa_tlb_lookup(env
, vaddr
, dtlb
, &wi
, &ei
, &ring
);
514 if ((ret
== INST_TLB_MISS_CAUSE
|| ret
== LOAD_STORE_TLB_MISS_CAUSE
) &&
515 may_lookup_pt
&& get_pte(env
, vaddr
, &pte
) == 0) {
516 ring
= (pte
>> 4) & 0x3;
518 split_tlb_entry_spec_way(env
, vaddr
, dtlb
, &vpn
, wi
, &ei
);
521 wi
= ++env
->autorefill_idx
& 0x3;
522 xtensa_tlb_set_entry(env
, dtlb
, wi
, ei
, vpn
, pte
);
523 env
->sregs
[EXCVADDR
] = vaddr
;
524 qemu_log_mask(CPU_LOG_MMU
, "%s: autorefill(%08x): %08x -> %08x\n",
525 __func__
, vaddr
, vpn
, pte
);
527 xtensa_tlb_set_entry_mmu(env
, &tmp_entry
, dtlb
, wi
, ei
, vpn
, pte
);
537 entry
= xtensa_tlb_get_entry(env
, dtlb
, wi
, ei
);
540 if (ring
< mmu_idx
) {
542 LOAD_STORE_PRIVILEGE_CAUSE
:
543 INST_FETCH_PRIVILEGE_CAUSE
;
546 *access
= mmu_attr_to_access(entry
->attr
) &
547 ~(dtlb
? PAGE_EXEC
: PAGE_READ
| PAGE_WRITE
);
548 if (!is_access_granted(*access
, is_write
)) {
551 STORE_PROHIBITED_CAUSE
:
552 LOAD_PROHIBITED_CAUSE
) :
553 INST_FETCH_PROHIBITED_CAUSE
;
556 *paddr
= entry
->paddr
| (vaddr
& ~xtensa_tlb_get_addr_mask(env
, dtlb
, wi
));
557 *page_size
= ~xtensa_tlb_get_addr_mask(env
, dtlb
, wi
) + 1;
562 static int get_pte(CPUXtensaState
*env
, uint32_t vaddr
, uint32_t *pte
)
564 CPUState
*cs
= CPU(xtensa_env_get_cpu(env
));
569 (env
->sregs
[PTEVADDR
] | (vaddr
>> 10)) & 0xfffffffc;
570 int ret
= get_physical_addr_mmu(env
, false, pt_vaddr
, 0, 0,
571 &paddr
, &page_size
, &access
, false);
573 qemu_log_mask(CPU_LOG_MMU
, "%s: trying autorefill(%08x) -> %08x\n",
574 __func__
, vaddr
, ret
? ~0 : paddr
);
577 *pte
= ldl_phys(cs
->as
, paddr
);
582 static int get_physical_addr_region(CPUXtensaState
*env
,
583 uint32_t vaddr
, int is_write
, int mmu_idx
,
584 uint32_t *paddr
, uint32_t *page_size
, unsigned *access
)
586 bool dtlb
= is_write
!= 2;
588 uint32_t ei
= (vaddr
>> 29) & 0x7;
589 const xtensa_tlb_entry
*entry
=
590 xtensa_tlb_get_entry(env
, dtlb
, wi
, ei
);
592 *access
= region_attr_to_access(entry
->attr
);
593 if (!is_access_granted(*access
, is_write
)) {
596 STORE_PROHIBITED_CAUSE
:
597 LOAD_PROHIBITED_CAUSE
) :
598 INST_FETCH_PROHIBITED_CAUSE
;
601 *paddr
= entry
->paddr
| (vaddr
& ~REGION_PAGE_MASK
);
602 *page_size
= ~REGION_PAGE_MASK
+ 1;
608 * Convert virtual address to physical addr.
609 * MMU may issue pagewalk and change xtensa autorefill TLB way entry.
611 * \return 0 if ok, exception cause code otherwise
613 int xtensa_get_physical_addr(CPUXtensaState
*env
, bool update_tlb
,
614 uint32_t vaddr
, int is_write
, int mmu_idx
,
615 uint32_t *paddr
, uint32_t *page_size
, unsigned *access
)
617 if (xtensa_option_enabled(env
->config
, XTENSA_OPTION_MMU
)) {
618 return get_physical_addr_mmu(env
, update_tlb
,
619 vaddr
, is_write
, mmu_idx
, paddr
, page_size
, access
, true);
620 } else if (xtensa_option_bits_enabled(env
->config
,
621 XTENSA_OPTION_BIT(XTENSA_OPTION_REGION_PROTECTION
) |
622 XTENSA_OPTION_BIT(XTENSA_OPTION_REGION_TRANSLATION
))) {
623 return get_physical_addr_region(env
, vaddr
, is_write
, mmu_idx
,
624 paddr
, page_size
, access
);
627 *page_size
= TARGET_PAGE_SIZE
;
628 *access
= cacheattr_attr_to_access(
629 env
->sregs
[CACHEATTR
] >> ((vaddr
& 0xe0000000) >> 27));
634 static void dump_tlb(FILE *f
, fprintf_function cpu_fprintf
,
635 CPUXtensaState
*env
, bool dtlb
)
638 const xtensa_tlb
*conf
=
639 dtlb
? &env
->config
->dtlb
: &env
->config
->itlb
;
640 unsigned (*attr_to_access
)(uint32_t) =
641 xtensa_option_enabled(env
->config
, XTENSA_OPTION_MMU
) ?
642 mmu_attr_to_access
: region_attr_to_access
;
644 for (wi
= 0; wi
< conf
->nways
; ++wi
) {
645 uint32_t sz
= ~xtensa_tlb_get_addr_mask(env
, dtlb
, wi
) + 1;
647 bool print_header
= true;
649 if (sz
>= 0x100000) {
657 for (ei
= 0; ei
< conf
->way_size
[wi
]; ++ei
) {
658 const xtensa_tlb_entry
*entry
=
659 xtensa_tlb_get_entry(env
, dtlb
, wi
, ei
);
662 static const char * const cache_text
[8] = {
663 [PAGE_CACHE_BYPASS
>> PAGE_CACHE_SHIFT
] = "Bypass",
664 [PAGE_CACHE_WT
>> PAGE_CACHE_SHIFT
] = "WT",
665 [PAGE_CACHE_WB
>> PAGE_CACHE_SHIFT
] = "WB",
666 [PAGE_CACHE_ISOLATE
>> PAGE_CACHE_SHIFT
] = "Isolate",
668 unsigned access
= attr_to_access(entry
->attr
);
669 unsigned cache_idx
= (access
& PAGE_CACHE_MASK
) >>
673 print_header
= false;
674 cpu_fprintf(f
, "Way %u (%d %s)\n", wi
, sz
, sz_text
);
676 "\tVaddr Paddr ASID Attr RWX Cache\n"
677 "\t---------- ---------- ---- ---- --- -------\n");
680 "\t0x%08x 0x%08x 0x%02x 0x%02x %c%c%c %-7s\n",
685 (access
& PAGE_READ
) ? 'R' : '-',
686 (access
& PAGE_WRITE
) ? 'W' : '-',
687 (access
& PAGE_EXEC
) ? 'X' : '-',
688 cache_text
[cache_idx
] ? cache_text
[cache_idx
] :
695 void dump_mmu(FILE *f
, fprintf_function cpu_fprintf
, CPUXtensaState
*env
)
697 if (xtensa_option_bits_enabled(env
->config
,
698 XTENSA_OPTION_BIT(XTENSA_OPTION_REGION_PROTECTION
) |
699 XTENSA_OPTION_BIT(XTENSA_OPTION_REGION_TRANSLATION
) |
700 XTENSA_OPTION_BIT(XTENSA_OPTION_MMU
))) {
702 cpu_fprintf(f
, "ITLB:\n");
703 dump_tlb(f
, cpu_fprintf
, env
, false);
704 cpu_fprintf(f
, "\nDTLB:\n");
705 dump_tlb(f
, cpu_fprintf
, env
, true);
707 cpu_fprintf(f
, "No TLB for this CPU core\n");
711 void xtensa_runstall(CPUXtensaState
*env
, bool runstall
)
713 CPUState
*cpu
= CPU(xtensa_env_get_cpu(env
));
715 env
->runstall
= runstall
;
716 cpu
->halted
= runstall
;
718 cpu_interrupt(cpu
, CPU_INTERRUPT_HALT
);
720 cpu_reset_interrupt(cpu
, CPU_INTERRUPT_HALT
);