From: Takao Indoh Date: Tue, 23 Apr 2013 08:35:03 +0000 (+0900) Subject: iommu/vt-d: Disable translation if already enabled X-Git-Tag: v3.2.64~237 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=73f98b0930b1871bbf515aa4abc2484f2d5095b4;p=pandora-kernel.git iommu/vt-d: Disable translation if already enabled commit 3a93c841c2b3b14824f7728dd74bd00a1cedb806 upstream. 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 Signed-off-by: Joerg Roedel [wyj: Backported to 3.4: adjust context] Signed-off-by: Yijing Wang Signed-off-by: Ben Hutchings --- Reading git-diff-tree failed