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)
Wed, May 8, 7:33 AM
Unknown Object (File)
Mar 11 2024, 9:52 PM
Unknown Object (File)
Jan 17 2024, 9:41 PM
Unknown Object (File)
Dec 23 2023, 12:56 AM
Unknown Object (File)
Sep 12 2023, 10:54 AM
Unknown Object (File)
Aug 26 2023, 3:34 PM
Unknown Object (File)
Aug 26 2023, 3:28 PM
Unknown Object (File)
Jun 21 2023, 8:31 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

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

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

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