tcg-plugins.rst 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586
  1. ..
  2. Copyright (C) 2017, Emilio G. Cota <cota@braap.org>
  3. Copyright (c) 2019, Linaro Limited
  4. Written by Emilio Cota and Alex Bennée
  5. .. _TCG Plugins:
  6. QEMU TCG Plugins
  7. ================
  8. QEMU TCG plugins provide a way for users to run experiments taking
  9. advantage of the total system control emulation can have over a guest.
  10. It provides a mechanism for plugins to subscribe to events during
  11. translation and execution and optionally callback into the plugin
  12. during these events. TCG plugins are unable to change the system state
  13. only monitor it passively. However they can do this down to an
  14. individual instruction granularity including potentially subscribing
  15. to all load and store operations.
  16. Usage
  17. -----
  18. Any QEMU binary with TCG support has plugins enabled by default.
  19. Earlier releases needed to be explicitly enabled with::
  20. configure --enable-plugins
  21. Once built a program can be run with multiple plugins loaded each with
  22. their own arguments::
  23. $QEMU $OTHER_QEMU_ARGS \
  24. -plugin contrib/plugin/libhowvec.so,inline=on,count=hint \
  25. -plugin contrib/plugin/libhotblocks.so
  26. Arguments are plugin specific and can be used to modify their
  27. behaviour. In this case the howvec plugin is being asked to use inline
  28. ops to count and break down the hint instructions by type.
  29. Linux user-mode emulation also evaluates the environment variable
  30. ``QEMU_PLUGIN``::
  31. QEMU_PLUGIN="file=contrib/plugins/libhowvec.so,inline=on,count=hint" $QEMU
  32. Writing plugins
  33. ---------------
  34. API versioning
  35. ~~~~~~~~~~~~~~
  36. This is a new feature for QEMU and it does allow people to develop
  37. out-of-tree plugins that can be dynamically linked into a running QEMU
  38. process. However the project reserves the right to change or break the
  39. API should it need to do so. The best way to avoid this is to submit
  40. your plugin upstream so they can be updated if/when the API changes.
  41. All plugins need to declare a symbol which exports the plugin API
  42. version they were built against. This can be done simply by::
  43. QEMU_PLUGIN_EXPORT int qemu_plugin_version = QEMU_PLUGIN_VERSION;
  44. The core code will refuse to load a plugin that doesn't export a
  45. ``qemu_plugin_version`` symbol or if plugin version is outside of QEMU's
  46. supported range of API versions.
  47. Additionally the ``qemu_info_t`` structure which is passed to the
  48. ``qemu_plugin_install`` method of a plugin will detail the minimum and
  49. current API versions supported by QEMU. The API version will be
  50. incremented if new APIs are added. The minimum API version will be
  51. incremented if existing APIs are changed or removed.
  52. Lifetime of the query handle
  53. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  54. Each callback provides an opaque anonymous information handle which
  55. can usually be further queried to find out information about a
  56. translation, instruction or operation. The handles themselves are only
  57. valid during the lifetime of the callback so it is important that any
  58. information that is needed is extracted during the callback and saved
  59. by the plugin.
  60. Plugin life cycle
  61. ~~~~~~~~~~~~~~~~~
  62. First the plugin is loaded and the public qemu_plugin_install function
  63. is called. The plugin will then register callbacks for various plugin
  64. events. Generally plugins will register a handler for the *atexit*
  65. if they want to dump a summary of collected information once the
  66. program/system has finished running.
  67. When a registered event occurs the plugin callback is invoked. The
  68. callbacks may provide additional information. In the case of a
  69. translation event the plugin has an option to enumerate the
  70. instructions in a block of instructions and optionally register
  71. callbacks to some or all instructions when they are executed.
  72. There is also a facility to add an inline event where code to
  73. increment a counter can be directly inlined with the translation.
  74. Currently only a simple increment is supported. This is not atomic so
  75. can miss counts. If you want absolute precision you should use a
  76. callback which can then ensure atomicity itself.
  77. Finally when QEMU exits all the registered *atexit* callbacks are
  78. invoked.
  79. Exposure of QEMU internals
  80. ~~~~~~~~~~~~~~~~~~~~~~~~~~
  81. The plugin architecture actively avoids leaking implementation details
  82. about how QEMU's translation works to the plugins. While there are
  83. conceptions such as translation time and translation blocks the
  84. details are opaque to plugins. The plugin is able to query select
  85. details of instructions and system configuration only through the
  86. exported *qemu_plugin* functions.
  87. Internals
  88. ---------
  89. Locking
  90. ~~~~~~~
  91. We have to ensure we cannot deadlock, particularly under MTTCG. For
  92. this we acquire a lock when called from plugin code. We also keep the
  93. list of callbacks under RCU so that we do not have to hold the lock
  94. when calling the callbacks. This is also for performance, since some
  95. callbacks (e.g. memory access callbacks) might be called very
  96. frequently.
  97. * A consequence of this is that we keep our own list of CPUs, so that
  98. we do not have to worry about locking order wrt cpu_list_lock.
  99. * Use a recursive lock, since we can get registration calls from
  100. callbacks.
  101. As a result registering/unregistering callbacks is "slow", since it
  102. takes a lock. But this is very infrequent; we want performance when
  103. calling (or not calling) callbacks, not when registering them. Using
  104. RCU is great for this.
  105. We support the uninstallation of a plugin at any time (e.g. from
  106. plugin callbacks). This allows plugins to remove themselves if they no
  107. longer want to instrument the code. This operation is asynchronous
  108. which means callbacks may still occur after the uninstall operation is
  109. requested. The plugin isn't completely uninstalled until the safe work
  110. has executed while all vCPUs are quiescent.
  111. Example Plugins
  112. ---------------
  113. There are a number of plugins included with QEMU and you are
  114. encouraged to contribute your own plugins plugins upstream. There is a
  115. ``contrib/plugins`` directory where they can go. There are also some
  116. basic plugins that are used to test and exercise the API during the
  117. ``make check-tcg`` target in ``tests\plugins``.
  118. - tests/plugins/empty.c
  119. Purely a test plugin for measuring the overhead of the plugins system
  120. itself. Does no instrumentation.
  121. - tests/plugins/bb.c
  122. A very basic plugin which will measure execution in course terms as
  123. each basic block is executed. By default the results are shown once
  124. execution finishes::
  125. $ qemu-aarch64 -plugin tests/plugin/libbb.so \
  126. -d plugin ./tests/tcg/aarch64-linux-user/sha1
  127. SHA1=15dd99a1991e0b3826fede3deffc1feba42278e6
  128. bb's: 2277338, insns: 158483046
  129. Behaviour can be tweaked with the following arguments:
  130. * inline=true|false
  131. Use faster inline addition of a single counter. Not per-cpu and not
  132. thread safe.
  133. * idle=true|false
  134. Dump the current execution stats whenever the guest vCPU idles
  135. - tests/plugins/insn.c
  136. This is a basic instruction level instrumentation which can count the
  137. number of instructions executed on each core/thread::
  138. $ qemu-aarch64 -plugin tests/plugin/libinsn.so \
  139. -d plugin ./tests/tcg/aarch64-linux-user/threadcount
  140. Created 10 threads
  141. Done
  142. cpu 0 insns: 46765
  143. cpu 1 insns: 3694
  144. cpu 2 insns: 3694
  145. cpu 3 insns: 2994
  146. cpu 4 insns: 1497
  147. cpu 5 insns: 1497
  148. cpu 6 insns: 1497
  149. cpu 7 insns: 1497
  150. total insns: 63135
  151. Behaviour can be tweaked with the following arguments:
  152. * inline=true|false
  153. Use faster inline addition of a single counter. Not per-cpu and not
  154. thread safe.
  155. * sizes=true|false
  156. Give a summary of the instruction sizes for the execution
  157. * match=<string>
  158. Only instrument instructions matching the string prefix. Will show
  159. some basic stats including how many instructions have executed since
  160. the last execution. For example::
  161. $ qemu-aarch64 -plugin tests/plugin/libinsn.so,match=bl \
  162. -d plugin ./tests/tcg/aarch64-linux-user/sha512-vector
  163. ...
  164. 0x40069c, 'bl #0x4002b0', 10 hits, 1093 match hits, Δ+1257 since last match, 98 avg insns/match
  165. 0x4006ac, 'bl #0x403690', 10 hits, 1094 match hits, Δ+47 since last match, 98 avg insns/match
  166. 0x4037fc, 'bl #0x4002b0', 18 hits, 1095 match hits, Δ+22 since last match, 98 avg insns/match
  167. 0x400720, 'bl #0x403690', 10 hits, 1096 match hits, Δ+58 since last match, 98 avg insns/match
  168. 0x4037fc, 'bl #0x4002b0', 19 hits, 1097 match hits, Δ+22 since last match, 98 avg insns/match
  169. 0x400730, 'bl #0x403690', 10 hits, 1098 match hits, Δ+33 since last match, 98 avg insns/match
  170. 0x4037ac, 'bl #0x4002b0', 12 hits, 1099 match hits, Δ+20 since last match, 98 avg insns/match
  171. ...
  172. For more detailed execution tracing see the ``execlog`` plugin for
  173. other options.
  174. - tests/plugins/mem.c
  175. Basic instruction level memory instrumentation::
  176. $ qemu-aarch64 -plugin tests/plugin/libmem.so,inline=true \
  177. -d plugin ./tests/tcg/aarch64-linux-user/sha1
  178. SHA1=15dd99a1991e0b3826fede3deffc1feba42278e6
  179. inline mem accesses: 79525013
  180. Behaviour can be tweaked with the following arguments:
  181. * inline=true|false
  182. Use faster inline addition of a single counter. Not per-cpu and not
  183. thread safe.
  184. * callback=true|false
  185. Use callbacks on each memory instrumentation.
  186. * hwaddr=true|false
  187. Count IO accesses (only for system emulation)
  188. - tests/plugins/syscall.c
  189. A basic syscall tracing plugin. This only works for user-mode. By
  190. default it will give a summary of syscall stats at the end of the
  191. run::
  192. $ qemu-aarch64 -plugin tests/plugin/libsyscall \
  193. -d plugin ./tests/tcg/aarch64-linux-user/threadcount
  194. Created 10 threads
  195. Done
  196. syscall no. calls errors
  197. 226 12 0
  198. 99 11 11
  199. 115 11 0
  200. 222 11 0
  201. 93 10 0
  202. 220 10 0
  203. 233 10 0
  204. 215 8 0
  205. 214 4 0
  206. 134 2 0
  207. 64 2 0
  208. 96 1 0
  209. 94 1 0
  210. 80 1 0
  211. 261 1 0
  212. 78 1 0
  213. 160 1 0
  214. 135 1 0
  215. - contrib/plugins/hotblocks.c
  216. The hotblocks plugin allows you to examine the where hot paths of
  217. execution are in your program. Once the program has finished you will
  218. get a sorted list of blocks reporting the starting PC, translation
  219. count, number of instructions and execution count. This will work best
  220. with linux-user execution as system emulation tends to generate
  221. re-translations as blocks from different programs get swapped in and
  222. out of system memory.
  223. If your program is single-threaded you can use the ``inline`` option for
  224. slightly faster (but not thread safe) counters.
  225. Example::
  226. $ qemu-aarch64 \
  227. -plugin contrib/plugins/libhotblocks.so -d plugin \
  228. ./tests/tcg/aarch64-linux-user/sha1
  229. SHA1=15dd99a1991e0b3826fede3deffc1feba42278e6
  230. collected 903 entries in the hash table
  231. pc, tcount, icount, ecount
  232. 0x0000000041ed10, 1, 5, 66087
  233. 0x000000004002b0, 1, 4, 66087
  234. ...
  235. - contrib/plugins/hotpages.c
  236. Similar to hotblocks but this time tracks memory accesses::
  237. $ qemu-aarch64 \
  238. -plugin contrib/plugins/libhotpages.so -d plugin \
  239. ./tests/tcg/aarch64-linux-user/sha1
  240. SHA1=15dd99a1991e0b3826fede3deffc1feba42278e6
  241. Addr, RCPUs, Reads, WCPUs, Writes
  242. 0x000055007fe000, 0x0001, 31747952, 0x0001, 8835161
  243. 0x000055007ff000, 0x0001, 29001054, 0x0001, 8780625
  244. 0x00005500800000, 0x0001, 687465, 0x0001, 335857
  245. 0x0000000048b000, 0x0001, 130594, 0x0001, 355
  246. 0x0000000048a000, 0x0001, 1826, 0x0001, 11
  247. The hotpages plugin can be configured using the following arguments:
  248. * sortby=reads|writes|address
  249. Log the data sorted by either the number of reads, the number of writes, or
  250. memory address. (Default: entries are sorted by the sum of reads and writes)
  251. * io=on
  252. Track IO addresses. Only relevant to full system emulation. (Default: off)
  253. * pagesize=N
  254. The page size used. (Default: N = 4096)
  255. - contrib/plugins/howvec.c
  256. This is an instruction classifier so can be used to count different
  257. types of instructions. It has a number of options to refine which get
  258. counted. You can give a value to the ``count`` argument for a class of
  259. instructions to break it down fully, so for example to see all the system
  260. registers accesses::
  261. $ qemu-system-aarch64 $(QEMU_ARGS) \
  262. -append "root=/dev/sda2 systemd.unit=benchmark.service" \
  263. -smp 4 -plugin ./contrib/plugins/libhowvec.so,count=sreg -d plugin
  264. which will lead to a sorted list after the class breakdown::
  265. Instruction Classes:
  266. Class: UDEF not counted
  267. Class: SVE (68 hits)
  268. Class: PCrel addr (47789483 hits)
  269. Class: Add/Sub (imm) (192817388 hits)
  270. Class: Logical (imm) (93852565 hits)
  271. Class: Move Wide (imm) (76398116 hits)
  272. Class: Bitfield (44706084 hits)
  273. Class: Extract (5499257 hits)
  274. Class: Cond Branch (imm) (147202932 hits)
  275. Class: Exception Gen (193581 hits)
  276. Class: NOP not counted
  277. Class: Hints (6652291 hits)
  278. Class: Barriers (8001661 hits)
  279. Class: PSTATE (1801695 hits)
  280. Class: System Insn (6385349 hits)
  281. Class: System Reg counted individually
  282. Class: Branch (reg) (69497127 hits)
  283. Class: Branch (imm) (84393665 hits)
  284. Class: Cmp & Branch (110929659 hits)
  285. Class: Tst & Branch (44681442 hits)
  286. Class: AdvSimd ldstmult (736 hits)
  287. Class: ldst excl (9098783 hits)
  288. Class: Load Reg (lit) (87189424 hits)
  289. Class: ldst noalloc pair (3264433 hits)
  290. Class: ldst pair (412526434 hits)
  291. Class: ldst reg (imm) (314734576 hits)
  292. Class: Loads & Stores (2117774 hits)
  293. Class: Data Proc Reg (223519077 hits)
  294. Class: Scalar FP (31657954 hits)
  295. Individual Instructions:
  296. Instr: mrs x0, sp_el0 (2682661 hits) (op=0xd5384100/ System Reg)
  297. Instr: mrs x1, tpidr_el2 (1789339 hits) (op=0xd53cd041/ System Reg)
  298. Instr: mrs x2, tpidr_el2 (1513494 hits) (op=0xd53cd042/ System Reg)
  299. Instr: mrs x0, tpidr_el2 (1490823 hits) (op=0xd53cd040/ System Reg)
  300. Instr: mrs x1, sp_el0 (933793 hits) (op=0xd5384101/ System Reg)
  301. Instr: mrs x2, sp_el0 (699516 hits) (op=0xd5384102/ System Reg)
  302. Instr: mrs x4, tpidr_el2 (528437 hits) (op=0xd53cd044/ System Reg)
  303. Instr: mrs x30, ttbr1_el1 (480776 hits) (op=0xd538203e/ System Reg)
  304. Instr: msr ttbr1_el1, x30 (480713 hits) (op=0xd518203e/ System Reg)
  305. Instr: msr vbar_el1, x30 (480671 hits) (op=0xd518c01e/ System Reg)
  306. ...
  307. To find the argument shorthand for the class you need to examine the
  308. source code of the plugin at the moment, specifically the ``*opt``
  309. argument in the InsnClassExecCount tables.
  310. - contrib/plugins/lockstep.c
  311. This is a debugging tool for developers who want to find out when and
  312. where execution diverges after a subtle change to TCG code generation.
  313. It is not an exact science and results are likely to be mixed once
  314. asynchronous events are introduced. While the use of -icount can
  315. introduce determinism to the execution flow it doesn't always follow
  316. the translation sequence will be exactly the same. Typically this is
  317. caused by a timer firing to service the GUI causing a block to end
  318. early. However in some cases it has proved to be useful in pointing
  319. people at roughly where execution diverges. The only argument you need
  320. for the plugin is a path for the socket the two instances will
  321. communicate over::
  322. $ qemu-system-sparc -monitor none -parallel none \
  323. -net none -M SS-20 -m 256 -kernel day11/zImage.elf \
  324. -plugin ./contrib/plugins/liblockstep.so,sockpath=lockstep-sparc.sock \
  325. -d plugin,nochain
  326. which will eventually report::
  327. qemu-system-sparc: warning: nic lance.0 has no peer
  328. @ 0x000000ffd06678 vs 0x000000ffd001e0 (2/1 since last)
  329. @ 0x000000ffd07d9c vs 0x000000ffd06678 (3/1 since last)
  330. Δ insn_count @ 0x000000ffd07d9c (809900609) vs 0x000000ffd06678 (809900612)
  331. previously @ 0x000000ffd06678/10 (809900609 insns)
  332. previously @ 0x000000ffd001e0/4 (809900599 insns)
  333. previously @ 0x000000ffd080ac/2 (809900595 insns)
  334. previously @ 0x000000ffd08098/5 (809900593 insns)
  335. previously @ 0x000000ffd080c0/1 (809900588 insns)
  336. - contrib/plugins/hwprofile.c
  337. The hwprofile tool can only be used with system emulation and allows
  338. the user to see what hardware is accessed how often. It has a number of options:
  339. * track=read or track=write
  340. By default the plugin tracks both reads and writes. You can use one
  341. of these options to limit the tracking to just one class of accesses.
  342. * source
  343. Will include a detailed break down of what the guest PC that made the
  344. access was. Not compatible with the pattern option. Example output::
  345. cirrus-low-memory @ 0xfffffd00000a0000
  346. pc:fffffc0000005cdc, 1, 256
  347. pc:fffffc0000005ce8, 1, 256
  348. pc:fffffc0000005cec, 1, 256
  349. * pattern
  350. Instead break down the accesses based on the offset into the HW
  351. region. This can be useful for seeing the most used registers of a
  352. device. Example output::
  353. pci0-conf @ 0xfffffd01fe000000
  354. off:00000004, 1, 1
  355. off:00000010, 1, 3
  356. off:00000014, 1, 3
  357. off:00000018, 1, 2
  358. off:0000001c, 1, 2
  359. off:00000020, 1, 2
  360. ...
  361. - contrib/plugins/execlog.c
  362. The execlog tool traces executed instructions with memory access. It can be used
  363. for debugging and security analysis purposes.
  364. Please be aware that this will generate a lot of output.
  365. The plugin needs default argument::
  366. $ qemu-system-arm $(QEMU_ARGS) \
  367. -plugin ./contrib/plugins/libexeclog.so -d plugin
  368. which will output an execution trace following this structure::
  369. # vCPU, vAddr, opcode, disassembly[, load/store, memory addr, device]...
  370. 0, 0xa12, 0xf8012400, "movs r4, #0"
  371. 0, 0xa14, 0xf87f42b4, "cmp r4, r6"
  372. 0, 0xa16, 0xd206, "bhs #0xa26"
  373. 0, 0xa18, 0xfff94803, "ldr r0, [pc, #0xc]", load, 0x00010a28, RAM
  374. 0, 0xa1a, 0xf989f000, "bl #0xd30"
  375. 0, 0xd30, 0xfff9b510, "push {r4, lr}", store, 0x20003ee0, RAM, store, 0x20003ee4, RAM
  376. 0, 0xd32, 0xf9893014, "adds r0, #0x14"
  377. 0, 0xd34, 0xf9c8f000, "bl #0x10c8"
  378. 0, 0x10c8, 0xfff96c43, "ldr r3, [r0, #0x44]", load, 0x200000e4, RAM
  379. the output can be filtered to only track certain instructions or
  380. addresses using the ``ifilter`` or ``afilter`` options. You can stack the
  381. arguments if required::
  382. $ qemu-system-arm $(QEMU_ARGS) \
  383. -plugin ./contrib/plugins/libexeclog.so,ifilter=st1w,afilter=0x40001808 -d plugin
  384. - contrib/plugins/cache.c
  385. Cache modelling plugin that measures the performance of a given L1 cache
  386. configuration, and optionally a unified L2 per-core cache when a given working
  387. set is run::
  388. $ qemu-x86_64 -plugin ./contrib/plugins/libcache.so \
  389. -d plugin -D cache.log ./tests/tcg/x86_64-linux-user/float_convs
  390. will report the following::
  391. core #, data accesses, data misses, dmiss rate, insn accesses, insn misses, imiss rate
  392. 0 996695 508 0.0510% 2642799 18617 0.7044%
  393. address, data misses, instruction
  394. 0x424f1e (_int_malloc), 109, movq %rax, 8(%rcx)
  395. 0x41f395 (_IO_default_xsputn), 49, movb %dl, (%rdi, %rax)
  396. 0x42584d (ptmalloc_init.part.0), 33, movaps %xmm0, (%rax)
  397. 0x454d48 (__tunables_init), 20, cmpb $0, (%r8)
  398. ...
  399. address, fetch misses, instruction
  400. 0x4160a0 (__vfprintf_internal), 744, movl $1, %ebx
  401. 0x41f0a0 (_IO_setb), 744, endbr64
  402. 0x415882 (__vfprintf_internal), 744, movq %r12, %rdi
  403. 0x4268a0 (__malloc), 696, andq $0xfffffffffffffff0, %rax
  404. ...
  405. The plugin has a number of arguments, all of them are optional:
  406. * limit=N
  407. Print top N icache and dcache thrashing instructions along with their
  408. address, number of misses, and its disassembly. (default: 32)
  409. * icachesize=N
  410. * iblksize=B
  411. * iassoc=A
  412. Instruction cache configuration arguments. They specify the cache size, block
  413. size, and associativity of the instruction cache, respectively.
  414. (default: N = 16384, B = 64, A = 8)
  415. * dcachesize=N
  416. * dblksize=B
  417. * dassoc=A
  418. Data cache configuration arguments. They specify the cache size, block size,
  419. and associativity of the data cache, respectively.
  420. (default: N = 16384, B = 64, A = 8)
  421. * evict=POLICY
  422. Sets the eviction policy to POLICY. Available policies are: :code:`lru`,
  423. :code:`fifo`, and :code:`rand`. The plugin will use the specified policy for
  424. both instruction and data caches. (default: POLICY = :code:`lru`)
  425. * cores=N
  426. Sets the number of cores for which we maintain separate icache and dcache.
  427. (default: for linux-user, N = 1, for full system emulation: N = cores
  428. available to guest)
  429. * l2=on
  430. Simulates a unified L2 cache (stores blocks for both instructions and data)
  431. using the default L2 configuration (cache size = 2MB, associativity = 16-way,
  432. block size = 64B).
  433. * l2cachesize=N
  434. * l2blksize=B
  435. * l2assoc=A
  436. L2 cache configuration arguments. They specify the cache size, block size, and
  437. associativity of the L2 cache, respectively. Setting any of the L2
  438. configuration arguments implies ``l2=on``.
  439. (default: N = 2097152 (2MB), B = 64, A = 16)
  440. API
  441. ---
  442. The following API is generated from the inline documentation in
  443. ``include/qemu/qemu-plugin.h``. Please ensure any updates to the API
  444. include the full kernel-doc annotations.
  445. .. kernel-doc:: include/qemu/qemu-plugin.h