From patchwork Thu Jul 22 11:25:03 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gleb Natapov X-Patchwork-Id: 113569 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.4/8.14.3) with ESMTP id o6MBPB0C014158 for ; Thu, 22 Jul 2010 11:25:11 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759060Ab0GVLZJ (ORCPT ); Thu, 22 Jul 2010 07:25:09 -0400 Received: from mx1.redhat.com ([209.132.183.28]:61680 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755554Ab0GVLZI (ORCPT ); Thu, 22 Jul 2010 07:25:08 -0400 Received: from int-mx05.intmail.prod.int.phx2.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.18]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o6MBP5Du009774 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 22 Jul 2010 07:25:05 -0400 Received: from dhcp-1-237.tlv.redhat.com (dhcp-1-237.tlv.redhat.com [10.35.1.237]) by int-mx05.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o6MBP4iw007887; Thu, 22 Jul 2010 07:25:05 -0400 Received: by dhcp-1-237.tlv.redhat.com (Postfix, from userid 13519) id 0CA1218D3BA; Thu, 22 Jul 2010 14:25:03 +0300 (IDT) Date: Thu, 22 Jul 2010 14:25:03 +0300 From: Gleb Natapov To: "Hao, Xudong" Cc: "kvm@vger.kernel.org" Subject: Re: VT-d regression issue Message-ID: <20100722112503.GB25915@redhat.com> References: <20100722082122.GE27177@redhat.com> <20100722085209.GF27177@redhat.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-Scanned-By: MIMEDefang 2.67 on 10.5.11.18 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Thu, 22 Jul 2010 11:25:11 +0000 (UTC) diff --git a/hw/device-assignment.c b/hw/device-assignment.c index 2bba22f..b7e7dc0 100644 --- a/hw/device-assignment.c +++ b/hw/device-assignment.c @@ -238,9 +238,10 @@ static void assigned_dev_iomem_map_slow(PCIDevice *pci_dev, int region_num, DEBUG("%s", "slow map\n"); if (region_num == PCI_ROM_SLOT) m = cpu_register_io_memory(slow_bar_read, NULL, region); - else + else { m = cpu_register_io_memory(slow_bar_read, slow_bar_write, region); - cpu_register_physical_memory(e_phys, e_size, m); + cpu_register_physical_memory(e_phys, e_size, m); + } /* MSI-X MMIO page */ if ((e_size > 0) && @@ -272,7 +273,8 @@ static void assigned_dev_iomem_map(PCIDevice *pci_dev, int region_num, if (region_num == PCI_ROM_SLOT) flags |= IO_MEM_ROM; - cpu_register_physical_memory(e_phys, e_size, region->memory_index | flags); + if (region_num != PCI_ROM_SLOT) + cpu_register_physical_memory(e_phys, e_size, region->memory_index | flags); /* deal with MSI-X MMIO page */ if (real_region->base_addr <= r_dev->msix_table_addr &&