From mboxrd@z Thu Jan 1 00:00:00 1970 From: Sheng Yang Subject: Re: [PATCH] intel-iommu: Fix reference by physical address in intel_iommu_attach_device() Date: Thu, 17 Jun 2010 18:10:45 +0800 Message-ID: <201006171810.45403.sheng@linux.intel.com> References: <1276341702-16540-1-git-send-email-sheng@linux.intel.com> Mime-Version: 1.0 Content-Type: Text/Plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Cc: iommu@lists.linux-foundation.org, Tom Lyon To: David Woodhouse , kvm@vger.kernel.org Return-path: Received: from mga14.intel.com ([143.182.124.37]:3707 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754131Ab0FQKKh (ORCPT ); Thu, 17 Jun 2010 06:10:37 -0400 In-Reply-To: <1276341702-16540-1-git-send-email-sheng@linux.intel.com> Sender: kvm-owner@vger.kernel.org List-ID: On Saturday 12 June 2010 19:21:42 Sheng Yang wrote: > Commit a99c47a2 "intel-iommu: errors with smaller iommu widths" replace the > dmar_domain->pgd with the first entry of page table when iommu's supported > width is smaller than dmar_domain's. But it use physical address directly > for new dmar_domain->pgd... > > This result in KVM oops with VT-d on some machines. BTW: I think this need to be queued for 2.6.35-rc as well. -- regards Yang, Sheng > > Reported-by: Allen Kay > Cc: Tom Lyon > Signed-off-by: Sheng Yang > --- > drivers/pci/intel-iommu.c | 3 ++- > 1 files changed, 2 insertions(+), 1 deletions(-) > > diff --git a/drivers/pci/intel-iommu.c b/drivers/pci/intel-iommu.c > index 796828f..3bd3055 100644 > --- a/drivers/pci/intel-iommu.c > +++ b/drivers/pci/intel-iommu.c > @@ -3603,7 +3603,8 @@ static int intel_iommu_attach_device(struct > iommu_domain *domain, pte = dmar_domain->pgd; > if (dma_pte_present(pte)) { > free_pgtable_page(dmar_domain->pgd); > - dmar_domain->pgd = (struct dma_pte *)dma_pte_addr(pte); > + dmar_domain->pgd = (struct dma_pte *) > + phys_to_virt(dma_pte_addr(pte)); > } > dmar_domain->agaw--; > }