2 * internal execution defines for qemu
4 * Copyright (c) 2003 Fabrice Bellard
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, see <http://www.gnu.org/licenses/>.
25 #include "exec/cpu_ldst.h"
28 /* allow to see translation results - the slowdown should be negligible, so we leave it */
31 /* Page tracking code uses ram addresses in system mode, and virtual
32 addresses in userspace mode. Define tb_page_addr_t to be an appropriate
34 #if defined(CONFIG_USER_ONLY)
35 typedef abi_ulong tb_page_addr_t
;
36 #define TB_PAGE_ADDR_FMT TARGET_ABI_FMT_lx
38 typedef ram_addr_t tb_page_addr_t
;
39 #define TB_PAGE_ADDR_FMT RAM_ADDR_FMT
42 void restore_state_to_opc(CPUArchState
*env
, TranslationBlock
*tb
,
47 * @cpu: the vCPU state is to be restore to
48 * @searched_pc: the host PC the fault occurred at
49 * @will_exit: true if the TB executed will be interrupted after some
50 cpu adjustments. Required for maintaining the correct
52 * @return: true if state was restored, false otherwise
54 * Attempt to restore the state for a fault occurring in translated
55 * code. If the searched_pc is not in translated code no state is
56 * restored and the function returns false.
58 bool cpu_restore_state(CPUState
*cpu
, uintptr_t searched_pc
, bool will_exit
);
60 G_NORETURN
void cpu_loop_exit_noexc(CPUState
*cpu
);
61 G_NORETURN
void cpu_loop_exit(CPUState
*cpu
);
62 G_NORETURN
void cpu_loop_exit_restore(CPUState
*cpu
, uintptr_t pc
);
63 G_NORETURN
void cpu_loop_exit_atomic(CPUState
*cpu
, uintptr_t pc
);
66 * cpu_loop_exit_requested:
67 * @cpu: The CPU state to be tested
69 * Indicate if somebody asked for a return of the CPU to the main loop
70 * (e.g., via cpu_exit() or cpu_interrupt()).
72 * This is helpful for architectures that support interruptible
73 * instructions. After writing back all state to registers/memory, this
74 * call can be used to check if it makes sense to return to the main loop
75 * or to continue executing the interruptible instruction.
77 static inline bool cpu_loop_exit_requested(CPUState
*cpu
)
79 return (int32_t)qatomic_read(&cpu_neg(cpu
)->icount_decr
.u32
) < 0;
82 #if !defined(CONFIG_USER_ONLY) && defined(CONFIG_TCG)
85 * tlb_init - initialize a CPU's TLB
86 * @cpu: CPU whose TLB should be initialized
88 void tlb_init(CPUState
*cpu
);
90 * tlb_destroy - destroy a CPU's TLB
91 * @cpu: CPU whose TLB should be destroyed
93 void tlb_destroy(CPUState
*cpu
);
96 * @cpu: CPU whose TLB should be flushed
97 * @addr: virtual address of page to be flushed
99 * Flush one page from the TLB of the specified CPU, for all
102 void tlb_flush_page(CPUState
*cpu
, target_ulong addr
);
104 * tlb_flush_page_all_cpus:
105 * @cpu: src CPU of the flush
106 * @addr: virtual address of page to be flushed
108 * Flush one page from the TLB of the specified CPU, for all
111 void tlb_flush_page_all_cpus(CPUState
*src
, target_ulong addr
);
113 * tlb_flush_page_all_cpus_synced:
114 * @cpu: src CPU of the flush
115 * @addr: virtual address of page to be flushed
117 * Flush one page from the TLB of the specified CPU, for all MMU
118 * indexes like tlb_flush_page_all_cpus except the source vCPUs work
119 * is scheduled as safe work meaning all flushes will be complete once
120 * the source vCPUs safe work is complete. This will depend on when
121 * the guests translation ends the TB.
123 void tlb_flush_page_all_cpus_synced(CPUState
*src
, target_ulong addr
);
126 * @cpu: CPU whose TLB should be flushed
128 * Flush the entire TLB for the specified CPU. Most CPU architectures
129 * allow the implementation to drop entries from the TLB at any time
130 * so this is generally safe. If more selective flushing is required
131 * use one of the other functions for efficiency.
133 void tlb_flush(CPUState
*cpu
);
135 * tlb_flush_all_cpus:
136 * @cpu: src CPU of the flush
138 void tlb_flush_all_cpus(CPUState
*src_cpu
);
140 * tlb_flush_all_cpus_synced:
141 * @cpu: src CPU of the flush
143 * Like tlb_flush_all_cpus except this except the source vCPUs work is
144 * scheduled as safe work meaning all flushes will be complete once
145 * the source vCPUs safe work is complete. This will depend on when
146 * the guests translation ends the TB.
148 void tlb_flush_all_cpus_synced(CPUState
*src_cpu
);
150 * tlb_flush_page_by_mmuidx:
151 * @cpu: CPU whose TLB should be flushed
152 * @addr: virtual address of page to be flushed
153 * @idxmap: bitmap of MMU indexes to flush
155 * Flush one page from the TLB of the specified CPU, for the specified
158 void tlb_flush_page_by_mmuidx(CPUState
*cpu
, target_ulong addr
,
161 * tlb_flush_page_by_mmuidx_all_cpus:
162 * @cpu: Originating CPU of the flush
163 * @addr: virtual address of page to be flushed
164 * @idxmap: bitmap of MMU indexes to flush
166 * Flush one page from the TLB of all CPUs, for the specified
169 void tlb_flush_page_by_mmuidx_all_cpus(CPUState
*cpu
, target_ulong addr
,
172 * tlb_flush_page_by_mmuidx_all_cpus_synced:
173 * @cpu: Originating CPU of the flush
174 * @addr: virtual address of page to be flushed
175 * @idxmap: bitmap of MMU indexes to flush
177 * Flush one page from the TLB of all CPUs, for the specified MMU
178 * indexes like tlb_flush_page_by_mmuidx_all_cpus except the source
179 * vCPUs work is scheduled as safe work meaning all flushes will be
180 * complete once the source vCPUs safe work is complete. This will
181 * depend on when the guests translation ends the TB.
183 void tlb_flush_page_by_mmuidx_all_cpus_synced(CPUState
*cpu
, target_ulong addr
,
186 * tlb_flush_by_mmuidx:
187 * @cpu: CPU whose TLB should be flushed
188 * @wait: If true ensure synchronisation by exiting the cpu_loop
189 * @idxmap: bitmap of MMU indexes to flush
191 * Flush all entries from the TLB of the specified CPU, for the specified
194 void tlb_flush_by_mmuidx(CPUState
*cpu
, uint16_t idxmap
);
196 * tlb_flush_by_mmuidx_all_cpus:
197 * @cpu: Originating CPU of the flush
198 * @idxmap: bitmap of MMU indexes to flush
200 * Flush all entries from all TLBs of all CPUs, for the specified
203 void tlb_flush_by_mmuidx_all_cpus(CPUState
*cpu
, uint16_t idxmap
);
205 * tlb_flush_by_mmuidx_all_cpus_synced:
206 * @cpu: Originating CPU of the flush
207 * @idxmap: bitmap of MMU indexes to flush
209 * Flush all entries from all TLBs of all CPUs, for the specified
210 * MMU indexes like tlb_flush_by_mmuidx_all_cpus except except the source
211 * vCPUs work is scheduled as safe work meaning all flushes will be
212 * complete once the source vCPUs safe work is complete. This will
213 * depend on when the guests translation ends the TB.
215 void tlb_flush_by_mmuidx_all_cpus_synced(CPUState
*cpu
, uint16_t idxmap
);
218 * tlb_flush_page_bits_by_mmuidx
219 * @cpu: CPU whose TLB should be flushed
220 * @addr: virtual address of page to be flushed
221 * @idxmap: bitmap of mmu indexes to flush
222 * @bits: number of significant bits in address
224 * Similar to tlb_flush_page_mask, but with a bitmap of indexes.
226 void tlb_flush_page_bits_by_mmuidx(CPUState
*cpu
, target_ulong addr
,
227 uint16_t idxmap
, unsigned bits
);
229 /* Similarly, with broadcast and syncing. */
230 void tlb_flush_page_bits_by_mmuidx_all_cpus(CPUState
*cpu
, target_ulong addr
,
231 uint16_t idxmap
, unsigned bits
);
232 void tlb_flush_page_bits_by_mmuidx_all_cpus_synced
233 (CPUState
*cpu
, target_ulong addr
, uint16_t idxmap
, unsigned bits
);
236 * tlb_flush_range_by_mmuidx
237 * @cpu: CPU whose TLB should be flushed
238 * @addr: virtual address of the start of the range to be flushed
239 * @len: length of range to be flushed
240 * @idxmap: bitmap of mmu indexes to flush
241 * @bits: number of significant bits in address
243 * For each mmuidx in @idxmap, flush all pages within [@addr,@addr+@len),
244 * comparing only the low @bits worth of each virtual page.
246 void tlb_flush_range_by_mmuidx(CPUState
*cpu
, target_ulong addr
,
247 target_ulong len
, uint16_t idxmap
,
250 /* Similarly, with broadcast and syncing. */
251 void tlb_flush_range_by_mmuidx_all_cpus(CPUState
*cpu
, target_ulong addr
,
252 target_ulong len
, uint16_t idxmap
,
254 void tlb_flush_range_by_mmuidx_all_cpus_synced(CPUState
*cpu
,
261 * tlb_set_page_with_attrs:
262 * @cpu: CPU to add this TLB entry for
263 * @vaddr: virtual address of page to add entry for
264 * @paddr: physical address of the page
265 * @attrs: memory transaction attributes
266 * @prot: access permissions (PAGE_READ/PAGE_WRITE/PAGE_EXEC bits)
267 * @mmu_idx: MMU index to insert TLB entry for
268 * @size: size of the page in bytes
270 * Add an entry to this CPU's TLB (a mapping from virtual address
271 * @vaddr to physical address @paddr) with the specified memory
272 * transaction attributes. This is generally called by the target CPU
273 * specific code after it has been called through the tlb_fill()
274 * entry point and performed a successful page table walk to find
275 * the physical address and attributes for the virtual address
276 * which provoked the TLB miss.
278 * At most one entry for a given virtual address is permitted. Only a
279 * single TARGET_PAGE_SIZE region is mapped; the supplied @size is only
280 * used by tlb_flush_page.
282 void tlb_set_page_with_attrs(CPUState
*cpu
, target_ulong vaddr
,
283 hwaddr paddr
, MemTxAttrs attrs
,
284 int prot
, int mmu_idx
, target_ulong size
);
287 * This function is equivalent to calling tlb_set_page_with_attrs()
288 * with an @attrs argument of MEMTXATTRS_UNSPECIFIED. It's provided
289 * as a convenience for CPUs which don't use memory transaction attributes.
291 void tlb_set_page(CPUState
*cpu
, target_ulong vaddr
,
292 hwaddr paddr
, int prot
,
293 int mmu_idx
, target_ulong size
);
295 static inline void tlb_init(CPUState
*cpu
)
298 static inline void tlb_destroy(CPUState
*cpu
)
301 static inline void tlb_flush_page(CPUState
*cpu
, target_ulong addr
)
304 static inline void tlb_flush_page_all_cpus(CPUState
*src
, target_ulong addr
)
307 static inline void tlb_flush_page_all_cpus_synced(CPUState
*src
,
311 static inline void tlb_flush(CPUState
*cpu
)
314 static inline void tlb_flush_all_cpus(CPUState
*src_cpu
)
317 static inline void tlb_flush_all_cpus_synced(CPUState
*src_cpu
)
320 static inline void tlb_flush_page_by_mmuidx(CPUState
*cpu
,
321 target_ulong addr
, uint16_t idxmap
)
325 static inline void tlb_flush_by_mmuidx(CPUState
*cpu
, uint16_t idxmap
)
328 static inline void tlb_flush_page_by_mmuidx_all_cpus(CPUState
*cpu
,
333 static inline void tlb_flush_page_by_mmuidx_all_cpus_synced(CPUState
*cpu
,
338 static inline void tlb_flush_by_mmuidx_all_cpus(CPUState
*cpu
, uint16_t idxmap
)
342 static inline void tlb_flush_by_mmuidx_all_cpus_synced(CPUState
*cpu
,
346 static inline void tlb_flush_page_bits_by_mmuidx(CPUState
*cpu
,
352 static inline void tlb_flush_page_bits_by_mmuidx_all_cpus(CPUState
*cpu
,
359 tlb_flush_page_bits_by_mmuidx_all_cpus_synced(CPUState
*cpu
, target_ulong addr
,
360 uint16_t idxmap
, unsigned bits
)
363 static inline void tlb_flush_range_by_mmuidx(CPUState
*cpu
, target_ulong addr
,
364 target_ulong len
, uint16_t idxmap
,
368 static inline void tlb_flush_range_by_mmuidx_all_cpus(CPUState
*cpu
,
375 static inline void tlb_flush_range_by_mmuidx_all_cpus_synced(CPUState
*cpu
,
386 * @addr: guest virtual address to look up
387 * @size: size of the access
388 * @access_type: read, write or execute permission
389 * @mmu_idx: MMU index to use for lookup
390 * @retaddr: return address for unwinding
392 * Look up the guest virtual address @addr. Raise an exception if the
393 * page does not satisfy @access_type. Raise an exception if the
394 * access (@addr, @size) hits a watchpoint. For writes, mark a clean
397 * Finally, return the host address for a page that is backed by RAM,
398 * or NULL if the page requires I/O.
400 void *probe_access(CPUArchState
*env
, target_ulong addr
, int size
,
401 MMUAccessType access_type
, int mmu_idx
, uintptr_t retaddr
);
403 static inline void *probe_write(CPUArchState
*env
, target_ulong addr
, int size
,
404 int mmu_idx
, uintptr_t retaddr
)
406 return probe_access(env
, addr
, size
, MMU_DATA_STORE
, mmu_idx
, retaddr
);
409 static inline void *probe_read(CPUArchState
*env
, target_ulong addr
, int size
,
410 int mmu_idx
, uintptr_t retaddr
)
412 return probe_access(env
, addr
, size
, MMU_DATA_LOAD
, mmu_idx
, retaddr
);
416 * probe_access_flags:
418 * @addr: guest virtual address to look up
419 * @access_type: read, write or execute permission
420 * @mmu_idx: MMU index to use for lookup
421 * @nonfault: suppress the fault
422 * @phost: return value for host address
423 * @retaddr: return address for unwinding
425 * Similar to probe_access, loosely returning the TLB_FLAGS_MASK for
426 * the page, and storing the host address for RAM in @phost.
428 * If @nonfault is set, do not raise an exception but return TLB_INVALID_MASK.
429 * Do not handle watchpoints, but include TLB_WATCHPOINT in the returned flags.
430 * Do handle clean pages, so exclude TLB_NOTDIRY from the returned flags.
431 * For simplicity, all "mmio-like" flags are folded to TLB_MMIO.
433 int probe_access_flags(CPUArchState
*env
, target_ulong addr
,
434 MMUAccessType access_type
, int mmu_idx
,
435 bool nonfault
, void **phost
, uintptr_t retaddr
);
437 #define CODE_GEN_ALIGN 16 /* must be >= of the size of a icache line */
439 /* Estimated block size for TB allocation. */
440 /* ??? The following is based on a 2015 survey of x86_64 host output.
441 Better would seem to be some sort of dynamically sized TB array,
442 adapting to the block sizes actually being produced. */
443 #if defined(CONFIG_SOFTMMU)
444 #define CODE_GEN_AVG_BLOCK_SIZE 400
446 #define CODE_GEN_AVG_BLOCK_SIZE 150
450 * Translation Cache-related fields of a TB.
451 * This struct exists just for convenience; we keep track of TB's in a binary
452 * search tree, and the only fields needed to compare TB's in the tree are
454 * Note: the address of search data can be obtained by adding @size to @ptr.
457 const void *ptr
; /* pointer to the translated code */
461 struct TranslationBlock
{
462 target_ulong pc
; /* simulated PC corresponding to this block (EIP + CS base) */
463 target_ulong cs_base
; /* CS base for this block */
464 uint32_t flags
; /* flags defining in which context the code was generated */
465 uint32_t cflags
; /* compile flags */
467 /* Note that TCG_MAX_INSNS is 512; we validate this match elsewhere. */
468 #define CF_COUNT_MASK 0x000001ff
469 #define CF_NO_GOTO_TB 0x00000200 /* Do not chain with goto_tb */
470 #define CF_NO_GOTO_PTR 0x00000400 /* Do not chain with goto_ptr */
471 #define CF_SINGLE_STEP 0x00000800 /* gdbstub single-step in effect */
472 #define CF_LAST_IO 0x00008000 /* Last insn may be an IO access. */
473 #define CF_MEMI_ONLY 0x00010000 /* Only instrument memory ops */
474 #define CF_USE_ICOUNT 0x00020000
475 #define CF_INVALID 0x00040000 /* TB is stale. Set with @jmp_lock held */
476 #define CF_PARALLEL 0x00080000 /* Generate code for a parallel context */
477 #define CF_NOIRQ 0x00100000 /* Generate an uninterruptible TB */
478 #define CF_CLUSTER_MASK 0xff000000 /* Top 8 bits are cluster ID */
479 #define CF_CLUSTER_SHIFT 24
481 /* Per-vCPU dynamic tracing state used to generate this TB */
482 uint32_t trace_vcpu_dstate
;
485 * Above fields used for comparing
488 /* size of target code for this block (1 <= size <= TARGET_PAGE_SIZE) */
494 /* first and second physical page containing code. The lower bit
495 of the pointer tells the index in page_next[].
496 The list is protected by the TB's page('s) lock(s) */
497 uintptr_t page_next
[2];
498 tb_page_addr_t page_addr
[2];
500 /* jmp_lock placed here to fill a 4-byte hole. Its documentation is below */
503 /* The following data are used to directly call another TB from
504 * the code of this one. This can be done either by emitting direct or
505 * indirect native jump instructions. These jumps are reset so that the TB
506 * just continues its execution. The TB can be linked to another one by
507 * setting one of the jump targets (or patching the jump instruction). Only
508 * two of such jumps are supported.
510 uint16_t jmp_reset_offset
[2]; /* offset of original jump target */
511 #define TB_JMP_RESET_OFFSET_INVALID 0xffff /* indicates no jump generated */
512 uintptr_t jmp_target_arg
[2]; /* target address or offset */
515 * Each TB has a NULL-terminated list (jmp_list_head) of incoming jumps.
516 * Each TB can have two outgoing jumps, and therefore can participate
517 * in two lists. The list entries are kept in jmp_list_next[2]. The least
518 * significant bit (LSB) of the pointers in these lists is used to encode
519 * which of the two list entries is to be used in the pointed TB.
521 * List traversals are protected by jmp_lock. The destination TB of each
522 * outgoing jump is kept in jmp_dest[] so that the appropriate jmp_lock
523 * can be acquired from any origin TB.
525 * jmp_dest[] are tagged pointers as well. The LSB is set when the TB is
526 * being invalidated, so that no further outgoing jumps from it can be set.
528 * jmp_lock also protects the CF_INVALID cflag; a jump must not be chained
529 * to a destination TB that has CF_INVALID set.
531 uintptr_t jmp_list_head
;
532 uintptr_t jmp_list_next
[2];
533 uintptr_t jmp_dest
[2];
536 /* Hide the qatomic_read to make code a little easier on the eyes */
537 static inline uint32_t tb_cflags(const TranslationBlock
*tb
)
539 return qatomic_read(&tb
->cflags
);
542 /* current cflags for hashing/comparison */
543 uint32_t curr_cflags(CPUState
*cpu
);
545 /* TranslationBlock invalidate API */
546 #if defined(CONFIG_USER_ONLY)
547 void tb_invalidate_phys_addr(target_ulong addr
);
548 void tb_invalidate_phys_range(target_ulong start
, target_ulong end
);
550 void tb_invalidate_phys_addr(AddressSpace
*as
, hwaddr addr
, MemTxAttrs attrs
);
552 void tb_flush(CPUState
*cpu
);
553 void tb_phys_invalidate(TranslationBlock
*tb
, tb_page_addr_t page_addr
);
554 void tb_set_jmp_target(TranslationBlock
*tb
, int n
, uintptr_t addr
);
556 /* GETPC is the true target of the return instruction that we'll execute. */
557 #if defined(CONFIG_TCG_INTERPRETER)
558 extern __thread
uintptr_t tci_tb_ptr
;
559 # define GETPC() tci_tb_ptr
562 ((uintptr_t)__builtin_extract_return_addr(__builtin_return_address(0)))
565 /* The true return address will often point to a host insn that is part of
566 the next translated guest insn. Adjust the address backward to point to
567 the middle of the call insn. Subtracting one would do the job except for
568 several compressed mode architectures (arm, mips) which set the low bit
569 to indicate the compressed mode; subtracting two works around that. It
570 is also the case that there are no host isas that contain a call insn
571 smaller than 4 bytes, so we don't worry about special-casing this. */
574 #if !defined(CONFIG_USER_ONLY) && defined(CONFIG_DEBUG_TCG)
575 void assert_no_pages_locked(void);
577 static inline void assert_no_pages_locked(void)
582 #if !defined(CONFIG_USER_ONLY)
586 * @cpu: CPU performing the access
587 * @index: TCG CPU IOTLB entry
589 * Given a TCG CPU IOTLB entry, return the MemoryRegionSection that
590 * it refers to. @index will have been initially created and returned
591 * by memory_region_section_get_iotlb().
593 struct MemoryRegionSection
*iotlb_to_section(CPUState
*cpu
,
594 hwaddr index
, MemTxAttrs attrs
);
598 * get_page_addr_code_hostp()
600 * @addr: guest virtual address of guest code
602 * See get_page_addr_code() (full-system version) for documentation on the
605 * Sets *@hostp (when @hostp is non-NULL) as follows.
606 * If the return value is -1, sets *@hostp to NULL. Otherwise, sets *@hostp
607 * to the host address where @addr's content is kept.
609 * Note: this function can trigger an exception.
611 tb_page_addr_t
get_page_addr_code_hostp(CPUArchState
*env
, target_ulong addr
,
615 * get_page_addr_code()
617 * @addr: guest virtual address of guest code
619 * If we cannot translate and execute from the entire RAM page, or if
620 * the region is not backed by RAM, returns -1. Otherwise, returns the
621 * ram_addr_t corresponding to the guest code at @addr.
623 * Note: this function can trigger an exception.
625 static inline tb_page_addr_t
get_page_addr_code(CPUArchState
*env
,
628 return get_page_addr_code_hostp(env
, addr
, NULL
);
631 #if defined(CONFIG_USER_ONLY)
632 void mmap_lock(void);
633 void mmap_unlock(void);
634 bool have_mmap_lock(void);
638 * @pc: raw pc from the host signal ucontext_t.
639 * @is_write: host memory operation was write, or read-modify-write.
641 * Alter @pc as required for unwinding. Return the type of the
642 * guest memory access -- host reads may be for guest execution.
644 MMUAccessType
adjust_signal_pc(uintptr_t *pc
, bool is_write
);
647 * handle_sigsegv_accerr_write:
648 * @cpu: the cpu context
649 * @old_set: the sigset_t from the signal ucontext_t
650 * @host_pc: the host pc, adjusted for the signal
651 * @host_addr: the host address of the fault
653 * Return true if the write fault has been handled, and should be re-tried.
655 bool handle_sigsegv_accerr_write(CPUState
*cpu
, sigset_t
*old_set
,
656 uintptr_t host_pc
, abi_ptr guest_addr
);
659 * cpu_loop_exit_sigsegv:
660 * @cpu: the cpu context
661 * @addr: the guest address of the fault
662 * @access_type: access was read/write/execute
663 * @maperr: true for invalid page, false for permission fault
664 * @ra: host pc for unwinding
666 * Use the TCGCPUOps hook to record cpu state, do guest operating system
667 * specific things to raise SIGSEGV, and jump to the main cpu loop.
669 G_NORETURN
void cpu_loop_exit_sigsegv(CPUState
*cpu
, target_ulong addr
,
670 MMUAccessType access_type
,
671 bool maperr
, uintptr_t ra
);
674 * cpu_loop_exit_sigbus:
675 * @cpu: the cpu context
676 * @addr: the guest address of the alignment fault
677 * @access_type: access was read/write/execute
678 * @ra: host pc for unwinding
680 * Use the TCGCPUOps hook to record cpu state, do guest operating system
681 * specific things to raise SIGBUS, and jump to the main cpu loop.
683 G_NORETURN
void cpu_loop_exit_sigbus(CPUState
*cpu
, target_ulong addr
,
684 MMUAccessType access_type
,
688 static inline void mmap_lock(void) {}
689 static inline void mmap_unlock(void) {}
691 void tlb_reset_dirty(CPUState
*cpu
, ram_addr_t start1
, ram_addr_t length
);
692 void tlb_set_dirty(CPUState
*cpu
, target_ulong vaddr
);
694 MemoryRegionSection
*
695 address_space_translate_for_iotlb(CPUState
*cpu
, int asidx
, hwaddr addr
,
696 hwaddr
*xlat
, hwaddr
*plen
,
697 MemTxAttrs attrs
, int *prot
);
698 hwaddr
memory_region_section_get_iotlb(CPUState
*cpu
,
699 MemoryRegionSection
*section
);