From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758753Ab1E0Bcc (ORCPT ); Thu, 26 May 2011 21:32:32 -0400 Received: from relay1.sgi.com ([192.48.179.29]:58602 "EHLO relay.sgi.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758640Ab1E0BcZ (ORCPT ); Thu, 26 May 2011 21:32:25 -0400 Message-Id: <20110527013222.110734456@gulag1.americas.sgi.com> References: <20110527013221.231071058@gulag1.americas.sgi.com> User-Agent: quilt/0.46-1 Date: Thu, 26 May 2011 20:32:27 -0500 From: Mike Travis To: David Woodhouse , Chris Wright , Andrew Morton , Ingo Molnar Cc: Mike Habeck , Jesse Barnes , stable@kernel.org, iommu@lists.linux-foundation.org, linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 6/7] Intel pci: Add domain check in domain_remove_one_dev_info Content-Disposition: inline; filename=fix-domain_remove_one_dev_info.patch Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The comment in domain_remove_one_dev_info() states "No need to compare PCI domain; it has to be the same". But for the si_domain that isn't going to be true, as it consists of all the PCI devices that are identity mapped thus multiple PCI domains can be in si_domain. The code needs to validate the PCI domain too. From: Mike Habeck Signed-off-by: Mike Habeck Signed-off-by: Mike Travis --- drivers/pci/intel-iommu.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) --- linux.orig/drivers/pci/intel-iommu.c +++ linux/drivers/pci/intel-iommu.c @@ -3395,8 +3395,8 @@ static void domain_remove_one_dev_info(s spin_lock_irqsave(&device_domain_lock, flags); list_for_each_safe(entry, tmp, &domain->devices) { info = list_entry(entry, struct device_domain_info, link); - /* No need to compare PCI domain; it has to be the same */ - if (info->bus == pdev->bus->number && + if (info->segment == pci_domain_nr(pdev->bus) && + info->bus == pdev->bus->number && info->devfn == pdev->devfn) { list_del(&info->link); list_del(&info->global); --