diff mbox series

[v3,15/50] tcg: add MO_HADDR to TCGMemOp

Message ID 20190614171200.21078-16-alex.bennee@linaro.org
State New
Headers show
Series tcg plugin support | expand

Commit Message

Alex Bennée June 14, 2019, 5:11 p.m. UTC
From: "Emilio G. Cota" <cota@braap.org>


We will use this from plugins to mark mem accesses so that
we can later obtain their host address.

Signed-off-by: Emilio G. Cota <cota@braap.org>

---
 tcg/tcg.h | 7 +++++++
 1 file changed, 7 insertions(+)

-- 
2.20.1

Comments

Richard Henderson June 17, 2019, 8:43 p.m. UTC | #1
On 6/14/19 10:11 AM, Alex Bennée wrote:
> +    /*

> +     * SoftMMU-only: if set, the TCG backend puts the corresponding host address

> +     * in CPUArchState.hostaddr.

> +     */

> +    MO_HSHIFT = MO_ASHIFT + 3,

> +    MO_HADDR = 1 << MO_HSHIFT,


FYI, Alex and I talked about recomputing the host address within the helper.

For at least a few of the hosts, we currently never compute the full host
address into a single register -- we use reg+reg addressing when possible.
It's only a couple of instructions to re-compute, given that we know that the
tlb lookup succeeded, and importantly they are all out of line and not bloating
the inline code further.


r~
diff mbox series

Patch

diff --git a/tcg/tcg.h b/tcg/tcg.h
index 2385e758e5..966e89104d 100644
--- a/tcg/tcg.h
+++ b/tcg/tcg.h
@@ -367,6 +367,13 @@  typedef enum TCGMemOp {
     MO_ALIGN_32 = 5 << MO_ASHIFT,
     MO_ALIGN_64 = 6 << MO_ASHIFT,
 
+    /*
+     * SoftMMU-only: if set, the TCG backend puts the corresponding host address
+     * in CPUArchState.hostaddr.
+     */
+    MO_HSHIFT = MO_ASHIFT + 3,
+    MO_HADDR = 1 << MO_HSHIFT,
+
     /* Combinations of the above, for ease of use.  */
     MO_UB    = MO_8,
     MO_UW    = MO_16,