Re: [PATCH v7u1 26/31] x86: Don't enable swiotlb if there is notenough ram for it

From: Konrad Rzeszutek Wilk
Date: Mon Jan 07 2013 - 14:30:22 EST

> Also, since IOMMU drivers can no longer assume swiotlb is allocated
> enough_mem_for_swiotlb() check fails, AMD IOMMU or another other iommu
> driver can't simply rely on changing swiotlb=1 and assuming the buffer
> is there.
> As Konrad suggested, a hook is needed, however, I think the logic to
> ensure switolb buffer belongs in swiotlb modules. How about changing
> pci_swiolb_late_init() logic to ensure swioltb late init is done
> instead of leaving it up to AMD IOMMU driver or some other driver.

Perhaps by having the 'swiotlb' be more than just on/off? It could
carry different flags, such as:

(if pci_swiotlb_detect_4gb or pci_swiotlb_detect_override sets it)
this would replace 'swiotlb=0'
replaces 'swiotlb_force'
this new option where pci_swiotlb_late_init()
would call the late init.

That would require some tweaking also in the IA64 code, but seems
like a step in the right direction. And we can get rid of that
'swiotlb_force' parameter.

Actually, that would also allow us to get rid of the pci_swiotlb_detect_override
and the setup_io_tlb_npages function could now just set swiotlb |= SWIOTLB_FORCE;

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at
Please read the FAQ at