xref: /qemu/include/qemu/plugin-memory.h (revision 6d1829fce4ea50d343f2df63eeff96685a359bf5)
1 /*
2  * Plugin Memory API
3  *
4  * Copyright (c) 2019 Linaro Ltd
5  *
6  * SPDX-License-Identifier: GPL-2.0-or-later
7  */
8 
9 #ifndef PLUGIN_MEMORY_H
10 #define PLUGIN_MEMORY_H
11 
12 #include "exec/hwaddr.h"
13 
14 struct qemu_plugin_hwaddr {
15     bool is_io;
16     bool is_store;
17     hwaddr phys_addr;
18     MemoryRegion *mr;
19 };
20 
21 /**
22  * tlb_plugin_lookup: query last TLB lookup
23  * @cpu: cpu environment
24  *
25  * This function can be used directly after a memory operation to
26  * query information about the access. It is used by the plugin
27  * infrastructure to expose more information about the address.
28  *
29  * It would only fail if not called from an instrumented memory access
30  * which would be an abuse of the API.
31  */
32 bool tlb_plugin_lookup(CPUState *cpu, vaddr addr, int mmu_idx,
33                        bool is_store, struct qemu_plugin_hwaddr *data);
34 
35 #endif /* PLUGIN_MEMORY_H */
36