Skip to contentSkip to conversation

Question about PLATFORM_QUIRK_DOM0_MAPPING_11

DISCUSSION Chen Baozi 2 participants 4 messages Sep 3, 2013 – Sep 4, 2013

lore
Share & tools
lore

Chen Baozi

author
#0 lore raw

Hi all,

When porting Xen on OMAP5, we need to add .quirks handler which returns the PLATFORM_QUIRK_DOM0_MAPPING_11. I have read the related set_memory_reg() in domain_build.c. And My question is in which case we don't need to return PLATFORM_QUIRK_DOM0_MAPPING_11 in .quirks and how Xen handles that case to populate right P2M to dom0?

Thanks.

Chen Baozi

#1 lore raw
Quoted 5 lines · Chen Baozi

When porting Xen on OMAP5, we need to add .quirks handler which returns the PLATFORM_QUIRK_DOM0_MAPPING_11. I have read the related set_memory_reg() in domain_build.c. And My question is in which case we don't need to return PLATFORM_QUIRK_DOM0_MAPPING_11 in .quirks and how Xen handles that case to populate right P2M to dom0?

DOM0_MAPPING_11 is a workaround for lack of an iommu, either in hardware (e.g. ARM SMMU) or in software (e.g. Stefano's swiotlb patches). In the short term it seems like Stefano's patches are going to be ready before we have an SMMU driver in the hypervisor.

In any case DOM0_MAPPING_11 will hopefully go away before too long.

Ian.

author
#2 lore raw
Quoted 7 lines · Ian Campbell
Quoted 5 lines · Chen Baozi

When porting Xen on OMAP5, we need to add .quirks handler which returns the PLATFORM_QUIRK_DOM0_MAPPING_11. I have read the related set_memory_reg() in domain_build.c. And My question is in which case we don't need to return PLATFORM_QUIRK_DOM0_MAPPING_11 in .quirks and how Xen handles that case to populate right P2M to dom0?

Quoted 6 lines

DOM0_MAPPING_11 is a workaround for lack of an iommu, either in hardware (e.g. ARM SMMU) or in software (e.g. Stefano's swiotlb patches). In the short term it seems like Stefano's patches are going to be ready before we have an SMMU driver in the hypervisor.

In any case DOM0_MAPPING_11 will hopefully go away before too long.

Thanks a lot. And one more question :P

The reason that we cannot boot successfully without DOM0_MAPPING_11 on OMAP5 is because in that case the physical address dom0 writes to DMA controller is intermediate physical address rather than physical address. If we did the 1:1 mapping, the IPA of dom0 is then equal to the PA, in which case the DMA can work properly in dom0. Is this the right explanation why we need PLATFORM_QUIRK_DOM0_MAPPING_11 without either SMMU or swiotlb?

Cheers,

Baozi

#3 lore raw
Quoted 16 lines · Chen Baozi
Quoted 7 lines · Ian Campbell
Quoted 5 lines · Chen Baozi

When porting Xen on OMAP5, we need to add .quirks handler which returns the PLATFORM_QUIRK_DOM0_MAPPING_11. I have read the related set_memory_reg() in domain_build.c. And My question is in which case we don't need to return PLATFORM_QUIRK_DOM0_MAPPING_11 in .quirks and how Xen handles that case to populate right P2M to dom0?

Quoted 6 lines

DOM0_MAPPING_11 is a workaround for lack of an iommu, either in hardware (e.g. ARM SMMU) or in software (e.g. Stefano's swiotlb patches). In the short term it seems like Stefano's patches are going to be ready before we have an SMMU driver in the hypervisor.

In any case DOM0_MAPPING_11 will hopefully go away before too long.

Quoted 8 lines

Thanks a lot. And one more question :P

The reason that we cannot boot successfully without DOM0_MAPPING_11 on OMAP5 is because in that case the physical address dom0 writes to DMA controller is intermediate physical address rather than physical address. If we did the 1:1 mapping, the IPA of dom0 is then equal to the PA, in which case the DMA can work properly in dom0. Is this the right explanation why we need PLATFORM_QUIRK_DOM0_MAPPING_11 without either SMMU or swiotlb?

Correct.

BTW, ballooning dom0 tends to destroy the 1:1 map, so it's by no means a perfect bandaid.

Ian.