aboutsummaryrefslogtreecommitdiff
path: root/hw/misc/sifive_u_otp.c
diff options
context:
space:
mode:
authorMostafa Saleh <smostafa@google.com>2023-05-25 10:37:50 +0100
committerPeter Maydell <peter.maydell@linaro.org>2023-05-30 13:02:53 +0100
commite703f7076a255cd13b1d9fc0934480a613614f14 (patch)
treea57ebbc8d3832031cb326b8f90dd5e5fef557e9e /hw/misc/sifive_u_otp.c
parentbcc919e756cd793e59038f59ad69d543b369f689 (diff)
downloadqemu-e703f7076a255cd13b1d9fc0934480a613614f14.zip
qemu-e703f7076a255cd13b1d9fc0934480a613614f14.tar.gz
qemu-e703f7076a255cd13b1d9fc0934480a613614f14.tar.bz2
hw/arm/smmuv3: Add page table walk for stage-2
In preparation for adding stage-2 support, add Stage-2 PTW code. Only Aarch64 format is supported as stage-1. Nesting stage-1 and stage-2 is not supported right now. HTTU is not supported, SW is expected to maintain the Access flag. This is described in the SMMUv3 manual(IHI 0070.E.a) "5.2. Stream Table Entry" in "[181] S2AFFD". This flag determines the behavior on access of a stage-2 page whose descriptor has AF == 0: - 0b0: An Access flag fault occurs (stall not supported). - 0b1: An Access flag fault never occurs. An Access fault takes priority over a Permission fault. There are 3 address size checks for stage-2 according to (IHI 0070.E.a) in "3.4. Address sizes". - As nesting is not supported, input address is passed directly to stage-2, and is checked against IAS. We use cfg->oas to hold the OAS when stage-1 is not used, this is set in the next patch. This check is done outside of smmu_ptw_64_s2 as it is not part of stage-2(it throws stage-1 fault), and the stage-2 function shouldn't change it's behavior when nesting is supported. When nesting is supported and we figure out how to combine TLB for stage-1 and stage-2 we can move this check into the stage-1 function as described in ARM DDI0487I.a in pseudocode aarch64/translation/vmsa_translation/AArch64.S1Translate aarch64/translation/vmsa_translation/AArch64.S1DisabledOutput - Input to stage-2 is checked against s2t0sz, and throws stage-2 transaltion fault if exceeds it. - Output of stage-2 is checked against effective PA output range. Reviewed-by: Eric Auger <eric.auger@redhat.com> Signed-off-by: Mostafa Saleh <smostafa@google.com> Tested-by: Eric Auger <eric.auger@redhat.com> Tested-by: Jean-Philippe Brucker <jean-philippe@linaro.org> Message-id: 20230516203327.2051088-5-smostafa@google.com Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'hw/misc/sifive_u_otp.c')
0 files changed, 0 insertions, 0 deletions