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:

EARLY_BOOTMEM_ON
(if pci_swiotlb_detect_4gb or pci_swiotlb_detect_override sets it)
EARLY_BOOTMEM_OFF
this would replace 'swiotlb=0'
FORCE
replaces 'swiotlb_force'
LATE_INIT_ON
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 http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/