From 9f00bb2ed5685ae295c1e6f0716ff7e46b8bd395 Mon Sep 17 00:00:00 2001 From: "Takacs, Philipp" Date: Tue, 21 Feb 2023 14:48:58 +0100 Subject: [PATCH] update faq add How can I interact with MMU/TLB --- docs/FAQ.md | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/docs/FAQ.md b/docs/FAQ.md index ce29a62a..b0bdd622 100644 --- a/docs/FAQ.md +++ b/docs/FAQ.md @@ -113,6 +113,19 @@ To provide end users with simple API, Unicorn does lots of dirty hacks within qe Yes, it’s possible but that is not Unicorn’s goal and there is no simple switch in qemu to disable softmmu. +## How can I interact with MMU/TLB? + +By default Unicorn will emulate the MMU depending on the emulated architecture. +So you can use the features and interfaces of this MMU. +You or the emulated code can write to the memory and corresponding register to use the MMU. + +There is also use the `UC_TLB_VIRTUAL` mode. +This mode defaults to a simple paddr := vaddr mapping. + +You can also add an `UC_HOOK_TLB_FILL` hook to manage the TLB. +The hook is called, when a virtuall address is not cached and Unicorn is in `UC_TLB_VIRTUAL` mode. +You can manual flush the cache with `uc_ctl_flush_tlb`. + ## I'd like to make contributions, where do I start? See [milestones](https://github.com/unicorn-engine/unicorn/milestones) and [coding convention](https://github.com/unicorn-engine/unicorn/wiki/Coding-Convention @@ -122,4 +135,4 @@ Be sure to send pull requests for our **dev** branch only. ## Which qemu version is Unicorn based on? -Prior to 2.0.0, Unicorn is based on qemu 2.2.1. After that, Unicorn is based on qemu 5.0.1. \ No newline at end of file +Prior to 2.0.0, Unicorn is based on qemu 2.2.1. After that, Unicorn is based on qemu 5.0.1.