[PATCH 1/1] iommu/amd: Fix the overwritten exclusion range with multiple IVMDs

Joerg Roedel joro at 8bytes.org
Mon Nov 11 15:22:03 UTC 2019


Hi Adrian,

On Mon, Nov 04, 2019 at 01:58:52PM +0800, Adrian Huang wrote:
> 	2) When set_device_exclusion_range() parses the IVMD of devce id
> 	   '4200', the exclusion range of the amd_iommu struct becomes:
> 
> 		iommu->exclusion_start = 0x9F58D000;
> 		iommu->exclusion_length = 0x8040000;
> 
> 	3) When parsing the second IVMD (device id '4300') in
> 	   set_device_exclusion_range(), the exclusion range of the
> 	   amd_iommu struct becomes:
> 
> 		iommu->exclusion_start = 0x9754D000;
> 		iommu->exclusion_length = 0x8040000;
> 
> 	   This overwrites the first IVMD configuration, which leads to
> 	   the failure of the first RAID controller.

Okay, I think this is clearly a BIOS bug as the BIOS should not define
two different exclusion ranges in the IVRS table.

So there are a couple of options here:

	1) Bail out and disable the IOMMU as the BIOS screwed up

	2) Treat per-device exclusion ranges just as r/w unity-mapped
	   regions.


I think option 2) is the best fix here.


Regards,

	Joerg


More information about the iommu mailing list