From ec31ef9115a7511c90fcdc0d89cb1491c2702003 Mon Sep 17 00:00:00 2001 From: Mostafa Saleh Date: Mon, 15 Jul 2024 08:45:07 +0000 Subject: hw/arm/smmu: Introduce CACHED_ENTRY_TO_ADDR MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Soon, smmuv3_do_translate() will be used to translate the CD and the TTBx, instead of re-writting the same logic to convert the returned cached entry to an address, add a new macro CACHED_ENTRY_TO_ADDR. Reviewed-by: Eric Auger Signed-off-by: Mostafa Saleh Reviewed-by: Jean-Philippe Brucker Reviewed-by: Alex Bennée Message-id: 20240715084519.1189624-8-smostafa@google.com Signed-off-by: Peter Maydell --- include/hw/arm/smmu-common.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'include/hw/arm/smmu-common.h') diff --git a/include/hw/arm/smmu-common.h b/include/hw/arm/smmu-common.h index 5cb3024464..f793b54388 100644 --- a/include/hw/arm/smmu-common.h +++ b/include/hw/arm/smmu-common.h @@ -37,6 +37,9 @@ #define VMSA_IDXMSK(isz, strd, lvl) ((1ULL << \ VMSA_BIT_LVL(isz, strd, lvl)) - 1) +#define CACHED_ENTRY_TO_ADDR(ent, addr) ((ent)->entry.translated_addr + \ + ((addr) & (ent)->entry.addr_mask)) + /* * Page table walk error types */ -- cgit v1.2.3