iommu/vt-d: Disable translation if already enabled
authorTakao Indoh <indou.takao@jp.fujitsu.com>
Tue, 23 Apr 2013 08:35:03 +0000 (17:35 +0900)
committerJoerg Roedel <joro@8bytes.org>
Tue, 23 Apr 2013 12:47:08 +0000 (14:47 +0200)
commit3a93c841c2b3b14824f7728dd74bd00a1cedb806
tree7b4a66f8caceac55b0832b635d537f7a04126eae
parent35d3d814cbd46a85bed97cd74ba97fbbb51e0ccd
iommu/vt-d: Disable translation if already enabled

This patch disables translation(dma-remapping) before its initialization
if it is already enabled.

This is needed for kexec/kdump boot. If dma-remapping is enabled in the
first kernel, it need to be disabled before initializing its page table
during second kernel boot. Wei Hu also reported that this is needed
when second kernel boots with intel_iommu=off.

Basically iommu->gcmd is used to know whether translation is enabled or
disabled, but it is always zero at boot time even when translation is
enabled since iommu->gcmd is initialized without considering such a
case. Therefor this patch synchronizes iommu->gcmd value with global
command register when iommu structure is allocated.

Signed-off-by: Takao Indoh <indou.takao@jp.fujitsu.com>
Signed-off-by: Joerg Roedel <joro@8bytes.org>
drivers/iommu/dmar.c
drivers/iommu/intel-iommu.c