Page MenuHomeFreeBSD

IOMMU guest VA space fix
ClosedPublic

Authored by br on Dec 20 2022, 11:28 AM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Nov 2, 3:01 AM
Unknown Object (File)
Fri, Oct 25, 9:54 AM
Unknown Object (File)
Oct 5 2024, 6:16 AM
Unknown Object (File)
Oct 1 2024, 1:29 PM
Unknown Object (File)
Sep 30 2024, 8:30 AM
Unknown Object (File)
Sep 30 2024, 8:30 AM
Unknown Object (File)
Sep 30 2024, 8:30 AM
Unknown Object (File)
Sep 30 2024, 6:20 AM
Subscribers

Details

Summary

currently, iommu gas could not allocate a guest VA.
setting domain->end to BUS_SPACE_MAXADDR resolve the issue, but the hardware does not fully support BUS_SPACE_MAXADDR range.
So we are currently trying to limit space to 48 or 52 bit based on hardware capabilities.

Diff Detail

Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

br requested review of this revision.Dec 20 2022, 11:28 AM
This revision is now accepted and ready to land.Dec 20 2022, 1:42 PM
andrew requested changes to this revision.Dec 20 2022, 2:52 PM

Having looked at it again we should ask the SMMU the maximum virtual address it supports. On the SMMUv3 it is the SMMU_IDR5.VAX field to decide if it's a 48 or 52 bit address space.

This revision now requires changes to proceed.Dec 20 2022, 2:52 PM

it does not seem to work with 52 bit

+       if (sc->features & SMMU_FEATURE_VAX)
+               iodom->end = MAXADDR_52BIT;
+       else
+               iodom->end = MAXADDR_48BIT;

set maxaddr correctly in tag and domain->end

sys/arm64/iommu/smmu.c
1752 ↗(On Diff #114336)

I would skip the VAX check and only use the 48-bit option. We can only use 52-bit with a 64k IOMMU PAGE_SIZE

Use 48-bit address space regardless of VAX bit

This revision is now accepted and ready to land.Dec 21 2022, 3:37 PM