Hi Felix, On 8/5/20 3:37 PM, FelixCui-oc wrote:
Hi baolu, Let me talk about why acpi_device_create_direct_mappings() is needed and please tell me if there is an error.
Sure. Before that, let me sync my understanding with you. You have an acpi namespace device in ANDD table, it also shows up in the device scope of a RMRR. Current code doesn't enumerate that device for the RMRR, hence iommu_create_device_direct_mappings() doesn't work for this device. At the same time, probe_acpi_namespace_devices() doesn't work for this device, hence you want to add a home-made acpi_device_create_direct_mappings() helper. Did I get it right?
In the probe_acpi_namespace_devices() function, only the device in the addev->physical_node_list is probed, but we need to establish identity mapping for the namespace device in RMRR. These are two different devices.
The namespace device has been probed and put in one drhd's device list. Hence, it should be processed by probe_acpi_namespace_devices(). So the question is why there are no devices in addev->physical_node_list?
Therefore, the namespace device in RMRR is not mapped in probe_acpi_namespace_devices(). acpi_device_create_direct_mappings() is to create direct mappings for namespace devices in RMRR.
Best regards, baolu _______________________________________________ iommu mailing list iommu@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/iommu