hw/arm/smmu: Refactor SMMU OAS
commit6783a184bb381350c43b4e35b89cd188b40c7266
authorMostafa Saleh <smostafa@google.com>
Mon, 15 Jul 2024 08:45:18 +0000 (15 08:45 +0000)
committerPeter Maydell <peter.maydell@linaro.org>
Thu, 18 Jul 2024 12:49:30 +0000 (18 13:49 +0100)
tree0c065ed84b6d0559761d0c05147878de491c49c9
parent58377c363291d76d0a40be4be34f8bc42785e484
hw/arm/smmu: Refactor SMMU OAS

SMMUv3 OAS is currently hardcoded in the code to 44 bits, for nested
configurations that can be a problem, as stage-2 might be shared with
the CPU which might have different PARANGE, and according to SMMU manual
ARM IHI 0070F.b:
    6.3.6 SMMU_IDR5, OAS must match the system physical address size.

This patch doesn't change the SMMU OAS, but refactors the code to
make it easier to do that:
- Rely everywhere on IDR5 for reading OAS instead of using the
  SMMU_IDR5_OAS macro, so, it is easier just to change IDR5 and
  it propagages correctly.
- Add additional checks when OAS is greater than 48bits.
- Remove unused functions/macros: pa_range/MAX_PA.

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