]> git.baikalelectronics.ru Git - kernel.git/commit
intel-iommu: ignore page table validation in pass through mode
authorChris Wright <chrisw@sous-sol.org>
Wed, 2 Dec 2009 20:06:34 +0000 (12:06 -0800)
committerDavid Woodhouse <David.Woodhouse@intel.com>
Tue, 8 Dec 2009 10:03:25 +0000 (10:03 +0000)
commitf7415f5e1c1fd3633eb28a0f3ac55e6b87ca5807
treeb485a7cfb4b305906bb19c145cd3e4ff9e1fe349
parent50ce9832f0491a46c2ce7a4d1f5b47c0fc4a6c19
intel-iommu: ignore page table validation in pass through mode

We are seeing a bug when booting w/ iommu=pt with current upstream
(bisect blames b87e1ae12ac54e06fb8d08ac2a9e63b5f5f7ff83 "intel-iommu:
Unify hardware and software passthrough support).

The issue is specific to this loop during identity map initialization
of each device:

domain_context_mapping_one(si_domain, ..., CONTEXT_TT_PASS_THROUGH)
...
/* Skip top levels of page tables for
* iommu which has less agaw than default.
*/
for (agaw = domain->agaw; agaw != iommu->agaw; agaw--) {
pgd = phys_to_virt(dma_pte_addr(pgd));
if (!dma_pte_present(pgd)) {      <------ failing here
spin_unlock_irqrestore(&iommu->lock, flags);
return -ENOMEM;
}

This box has 2 iommu's in it.  The catchall iommu has MGAW == 48, and
SAGAW == 4.  The other iommu has MGAW == 39, SAGAW == 2.

The device that's failing the above pgd test is the only device connected
to the non-catchall iommu, which has a smaller address width than the
domain default.  This test is not necessary since the context is in PT
mode and the ASR is ignored.

Thanks to Don Dutile for discovering and debugging this one.

Cc: stable@kernel.org
Signed-off-by: Chris Wright <chrisw@sous-sol.org>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
drivers/pci/intel-iommu.c