hw/arm/smmu-common: Support nested translation
commitf42a0a57c0a22210456e83676f43e88782e43942
authorMostafa Saleh <smostafa@google.com>
Mon, 15 Jul 2024 08:45:11 +0000 (15 08:45 +0000)
committerPeter Maydell <peter.maydell@linaro.org>
Thu, 18 Jul 2024 12:49:29 +0000 (18 13:49 +0100)
tree5e41bd94dde52b04f254714acb27c5d72daec350
parentd7cdf89c276abeb392cbf9b9d0dde5060a8c778f
hw/arm/smmu-common: Support nested translation

When nested translation is requested, do the following:
- Translate stage-1 table address IPA into PA through stage-2.
- Translate stage-1 table walk output (IPA) through stage-2.
- Create a single TLB entry from stage-1 and stage-2 translations
  using logic introduced before.

smmu_ptw() has a new argument SMMUState which include the TLB as
stage-1 table address can be cached in there.

Also in smmu_ptw(), a separate path used for nesting to simplify the
code, although some logic can be combined.

With nested translation class of translation fault can be different,
from the class of the translation, as faults from translating stage-1
tables are considered as CLASS_TT and not CLASS_IN, a new member
"is_ipa_descriptor" added to "SMMUPTWEventInfo" to differ faults
from walking stage 1 translation table and faults from translating
an IPA for a transaction.

Signed-off-by: Mostafa Saleh <smostafa@google.com>
Reviewed-by: Jean-Philippe Brucker <jean-philippe@linaro.org>
Reviewed-by: Eric Auger <eric.auger@redhat.com>
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Message-id: 20240715084519.1189624-12-smostafa@google.com
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
hw/arm/smmu-common.c
hw/arm/smmuv3.c
include/hw/arm/smmu-common.h