From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Jan Beulich" Subject: [PATCH] VT-d: reduce default verbosity Date: Tue, 16 Mar 2010 16:32:12 +0000 Message-ID: <4B9FC09C0200007800035395@vpn.id2.novell.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=__Part92B84B9C.0__=" Return-path: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org This is a MIME message. If you are reading this text, you may want to consider changing to a mail reader or gateway that understands how to properly handle MIME multipart messages. --=__Part92B84B9C.0__= Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Introduce a new sub-option "verbose" to "iommu=3D", and hide most (debugging) messages when that option is not specified. Particularly messages printed after time management was initialized can, on sufficiently large systems and with a graphical console, lead to time management issues (therefore a call to process_pending_softirqs() also gets added in case the new sub-option is being used). While touching that code, also convert all improper uses of gdprintk() to dprintk(), and convert all boolean iommu config variables to bool_t residing in the .data.read_mostly section. Signed-off-by: Jan Beulich --- 2010-03-02.orig/xen/arch/x86/x86_64/mmconfig-shared.c 2010-03-16 = 14:11:32.000000000 +0100 +++ 2010-03-02/xen/arch/x86/x86_64/mmconfig-shared.c 2010-03-16 = 12:02:05.000000000 +0100 @@ -454,12 +454,7 @@ int pci_find_ext_capability(int seg, int * cap version and next pointer all being 0. */ if ( (header =3D=3D 0) || (header =3D=3D -1) ) - { - dprintk(XENLOG_INFO VTDPREFIX, - "next cap:%x:%x.%x: no extended config\n", - bus, PCI_SLOT(devfn), PCI_FUNC(devfn)); return 0; - } =20 while ( ttl-- > 0 ) { if ( PCI_EXT_CAP_ID(header) =3D=3D cap ) --- 2010-03-02.orig/xen/drivers/passthrough/amd/iommu_init.c 2010-03-16 = 14:11:32.000000000 +0100 +++ 2010-03-02/xen/drivers/passthrough/amd/iommu_init.c 2010-03-16 = 13:30:07.000000000 +0100 @@ -355,7 +355,7 @@ static void iommu_msi_set_affinity(unsig =20 dest =3D set_desc_affinity(desc, mask); if (dest =3D=3D BAD_APICID){ - gdprintk(XENLOG_ERR, "Set iommu interrupt affinity error!\n"); + dprintk(XENLOG_ERR, "Set iommu interrupt affinity error!\n"); return; } =20 @@ -531,7 +531,7 @@ static int set_iommu_interrupt_handler(s irq =3D create_irq(); if ( irq <=3D 0 ) { - gdprintk(XENLOG_ERR VTDPREFIX, "IOMMU: no irqs\n"); + dprintk(XENLOG_ERR, "IOMMU: no irqs\n"); return 0; } =20 --- 2010-03-02.orig/xen/drivers/passthrough/io.c 2010-03-16 = 14:11:32.000000000 +0100 +++ 2010-03-02/xen/drivers/passthrough/io.c 2010-03-16 13:43:51.0000000= 00 +0100 @@ -292,10 +292,12 @@ int pt_irq_create_bind_vtd( } } =20 - gdprintk(XENLOG_INFO VTDPREFIX, - "VT-d irq bind: m_irq =3D %x device =3D %x intx =3D = %x\n", - machine_gsi, device, intx); spin_unlock(&d->event_lock); + + if ( iommu_verbose ) + dprintk(VTDPREFIX, + "d%d: bind: m_gsi=3D%u g_gsi=3D%u device=3D%u = intx=3D%u\n", + d->domain_id, machine_gsi, guest_gsi, device, intx); } return 0; } @@ -316,10 +318,11 @@ int pt_irq_destroy_bind_vtd( guest_gsi =3D hvm_pci_intx_gsi(device, intx); link =3D hvm_pci_intx_link(device, intx); =20 - gdprintk(XENLOG_INFO, - "pt_irq_destroy_bind_vtd: machine_gsi=3D%d " - "guest_gsi=3D%d, device=3D%d, intx=3D%d.\n", - machine_gsi, guest_gsi, device, intx); + if ( iommu_verbose ) + dprintk(VTDPREFIX, + "d%d: unbind: m_gsi=3D%u g_gsi=3D%u device=3D%u intx=3D%u\= n", + d->domain_id, machine_gsi, guest_gsi, device, intx); + spin_lock(&d->event_lock); =20 hvm_irq_dpci =3D domain_get_irq_dpci(d); @@ -372,9 +375,11 @@ int pt_irq_destroy_bind_vtd( } } spin_unlock(&d->event_lock); - gdprintk(XENLOG_INFO, - "XEN_DOMCTL_irq_unmapping: m_irq =3D 0x%x device =3D 0x%x = intx =3D 0x%x\n", - machine_gsi, device, intx); + + if ( iommu_verbose ) + dprintk(VTDPREFIX, + "d%d unmap: m_irq=3D%u device=3D%u intx=3D%u\n", + d->domain_id, machine_gsi, device, intx); =20 return 0; } --- 2010-03-02.orig/xen/drivers/passthrough/iommu.c 2010-03-16 = 14:11:32.000000000 +0100 +++ 2010-03-02/xen/drivers/passthrough/iommu.c 2010-03-16 13:41:49.0000000= 00 +0100 @@ -39,16 +39,17 @@ static int iommu_populate_page_table(str * no-intremap Disable VT-d Interrupt Remapping */ custom_param("iommu", parse_iommu_param); -int iommu_enabled =3D 1; -int iommu_pv_enabled; -int force_iommu; -int iommu_workaround_bios_bug; -int iommu_passthrough; -int iommu_snoop =3D 1; -int iommu_qinval =3D 1; -int iommu_intremap =3D 1; -int amd_iommu_debug; -int amd_iommu_perdev_intremap; +bool_t __read_mostly iommu_enabled =3D 1; +bool_t __read_mostly iommu_pv_enabled; +bool_t __read_mostly force_iommu; +bool_t __read_mostly iommu_verbose; +bool_t __read_mostly iommu_workaround_bios_bug; +bool_t __read_mostly iommu_passthrough; +bool_t __read_mostly iommu_snoop =3D 1; +bool_t __read_mostly iommu_qinval =3D 1; +bool_t __read_mostly iommu_intremap =3D 1; +bool_t __read_mostly amd_iommu_debug; +bool_t __read_mostly amd_iommu_perdev_intremap; =20 static void __init parse_iommu_param(char *s) { @@ -72,6 +73,8 @@ static void __init parse_iommu_param(cha iommu_workaround_bios_bug =3D 1; else if ( !strcmp(s, "passthrough") ) iommu_passthrough =3D 1; + else if ( !strcmp(s, "verbose") ) + iommu_verbose =3D 1; else if ( !strcmp(s, "no-snoop") ) iommu_snoop =3D 0; else if ( !strcmp(s, "no-qinval") ) @@ -251,17 +254,17 @@ int deassign_device(struct domain *d, u8 =20 if ( pdev->domain !=3D d ) { - gdprintk(XENLOG_ERR VTDPREFIX, - "IOMMU: deassign a device not owned\n"); + dprintk(XENLOG_ERR VTDPREFIX, + "d%d: deassign a device not owned\n", d->domain_id); return -EINVAL; } =20 ret =3D hd->platform_ops->reassign_device(d, dom0, bus, devfn); if ( ret ) { - gdprintk(XENLOG_ERR VTDPREFIX, - "Deassign device (%x:%x.%x) failed!\n", - bus, PCI_SLOT(devfn), PCI_FUNC(devfn)); + dprintk(XENLOG_ERR VTDPREFIX, + "d%d: Deassign device (%x:%x.%x) failed!\n", + d->domain_id, bus, PCI_SLOT(devfn), PCI_FUNC(devfn)); return ret; } =20 --- 2010-03-02.orig/xen/drivers/passthrough/vtd/dmar.c 2010-02-12 = 08:48:15.000000000 +0100 +++ 2010-03-02/xen/drivers/passthrough/vtd/dmar.c 2010-03-16 = 14:23:56.000000000 +0100 @@ -313,27 +313,31 @@ static int __init acpi_parse_dev_scope(v bus, path->dev, path->fn, PCI_SECONDARY_BUS); sub_bus =3D pci_conf_read8( bus, path->dev, path->fn, PCI_SUBORDINATE_BUS); - dprintk(XENLOG_INFO VTDPREFIX, - " bridge: %x:%x.%x start =3D %x sec =3D %x sub =3D = %x\n", - bus, path->dev, path->fn, - acpi_scope->start_bus, sec_bus, sub_bus); + if ( iommu_verbose ) + dprintk(VTDPREFIX, + " bridge: %x:%x.%x start =3D %x sec =3D %x sub = =3D %x\n", + bus, path->dev, path->fn, + acpi_scope->start_bus, sec_bus, sub_bus); =20 dmar_scope_add_buses(scope, sec_bus, sub_bus); break; =20 case ACPI_DEV_MSI_HPET: - dprintk(XENLOG_INFO VTDPREFIX, " MSI HPET: %x:%x.%x\n", - bus, path->dev, path->fn); + if ( iommu_verbose ) + dprintk(VTDPREFIX, " MSI HPET: %x:%x.%x\n", + bus, path->dev, path->fn); break; =20 case ACPI_DEV_ENDPOINT: - dprintk(XENLOG_INFO VTDPREFIX, " endpoint: %x:%x.%x\n", - bus, path->dev, path->fn); + if ( iommu_verbose ) + dprintk(VTDPREFIX, " endpoint: %x:%x.%x\n", + bus, path->dev, path->fn); break; =20 case ACPI_DEV_IOAPIC: - dprintk(XENLOG_INFO VTDPREFIX, " IOAPIC: %x:%x.%x\n", - bus, path->dev, path->fn); + if ( iommu_verbose ) + dprintk(VTDPREFIX, " IOAPIC: %x:%x.%x\n", + bus, path->dev, path->fn); =20 if ( type =3D=3D DMAR_TYPE ) { @@ -375,8 +379,9 @@ acpi_parse_one_drhd(struct acpi_dmar_ent dmaru->address =3D drhd->address; dmaru->include_all =3D drhd->flags & 1; /* BIT0: INCLUDE_ALL */ INIT_LIST_HEAD(&dmaru->ioapic_list); - dprintk(XENLOG_INFO VTDPREFIX, " dmaru->address =3D %"PRIx64"\n", - dmaru->address); + if ( iommu_verbose ) + dprintk(VTDPREFIX, " dmaru->address =3D %"PRIx64"\n", + dmaru->address); =20 addr =3D map_to_nocache_virt(0, drhd->address); dmaru->ecap =3D dmar_readq(addr, DMAR_ECAP_REG); @@ -388,7 +393,8 @@ acpi_parse_one_drhd(struct acpi_dmar_ent =20 if ( dmaru->include_all ) { - dprintk(XENLOG_INFO VTDPREFIX, " flags: INCLUDE_ALL\n"); + if ( iommu_verbose ) + dprintk(VTDPREFIX, " flags: INCLUDE_ALL\n"); /* Only allow one INCLUDE_ALL */ if ( include_all ) { @@ -535,9 +541,11 @@ acpi_parse_one_rmrr(struct acpi_dmar_ent } else { - dprintk(XENLOG_INFO VTDPREFIX, - " RMRR region: base_addr %"PRIx64" end_address %"PRIx64"\= n", - rmrru->base_address, rmrru->end_address); + if ( iommu_verbose ) + dprintk(VTDPREFIX, + " RMRR region: base_addr %"PRIx64 + " end_address %"PRIx64"\n", + rmrru->base_address, rmrru->end_address); acpi_register_rmrr_unit(rmrru); } } @@ -560,8 +568,9 @@ acpi_parse_one_atsr(struct acpi_dmar_ent memset(atsru, 0, sizeof(struct acpi_atsr_unit)); =20 atsru->all_ports =3D atsr->flags & 1; /* BIT0: ALL_PORTS */ - dprintk(XENLOG_INFO VTDPREFIX, - " atsru->all_ports: %x\n", atsru->all_ports); + if ( iommu_verbose ) + dprintk(VTDPREFIX, + " atsru->all_ports: %x\n", atsru->all_ports); if ( !atsru->all_ports ) { dev_scope_start =3D (void *)(atsr + 1); @@ -571,7 +580,8 @@ acpi_parse_one_atsr(struct acpi_dmar_ent } else { - dprintk(XENLOG_INFO VTDPREFIX, " flags: ALL_PORTS\n"); + if ( iommu_verbose ) + dprintk(VTDPREFIX, " flags: ALL_PORTS\n"); /* Only allow one ALL_PORTS */ if ( all_ports ) { @@ -604,9 +614,11 @@ acpi_parse_one_rhsa(struct acpi_dmar_ent rhsau->address =3D rhsa->address; rhsau->proximity_domain =3D rhsa->proximity_domain; list_add_tail(&rhsau->list, &acpi_rhsa_units); - dprintk(XENLOG_INFO VTDPREFIX, - " rhsau->address: %"PRIx64" rhsau->proximity_domain: = %"PRIx32"\n", - rhsau->address, rhsau->proximity_domain); + if ( iommu_verbose ) + dprintk(VTDPREFIX, + " rhsau->address: %"PRIx64 + " rhsau->proximity_domain: %"PRIx32"\n", + rhsau->address, rhsau->proximity_domain); =20 return ret; } @@ -633,8 +645,9 @@ static int __init acpi_parse_dmar(struct } =20 dmar_host_address_width =3D dmar->width + 1; - dprintk(XENLOG_INFO VTDPREFIX, "Host address width %d\n", - dmar_host_address_width); + if ( iommu_verbose ) + dprintk(VTDPREFIX, "Host address width %d\n", + dmar_host_address_width); =20 entry_header =3D (struct acpi_dmar_entry_header *)(dmar + 1); while ( ((unsigned long)entry_header) < @@ -643,23 +656,29 @@ static int __init acpi_parse_dmar(struct switch ( entry_header->type ) { case ACPI_DMAR_DRHD: - dprintk(XENLOG_INFO VTDPREFIX, "found ACPI_DMAR_DRHD:\n"); + if ( iommu_verbose ) + dprintk(VTDPREFIX, "found ACPI_DMAR_DRHD:\n"); ret =3D acpi_parse_one_drhd(entry_header); break; case ACPI_DMAR_RMRR: - dprintk(XENLOG_INFO VTDPREFIX, "found ACPI_DMAR_RMRR:\n"); + if ( iommu_verbose ) + dprintk(VTDPREFIX, "found ACPI_DMAR_RMRR:\n"); ret =3D acpi_parse_one_rmrr(entry_header); break; case ACPI_DMAR_ATSR: - dprintk(XENLOG_INFO VTDPREFIX, "found ACPI_DMAR_ATSR:\n"); + if ( iommu_verbose ) + dprintk(VTDPREFIX, "found ACPI_DMAR_ATSR:\n"); ret =3D acpi_parse_one_atsr(entry_header); break; case ACPI_DMAR_RHSA: - dprintk(XENLOG_INFO VTDPREFIX, "found ACPI_DMAR_RHSA:\n"); + if ( iommu_verbose ) + dprintk(VTDPREFIX, "found ACPI_DMAR_RHSA:\n"); ret =3D acpi_parse_one_rhsa(entry_header); break; default: - dprintk(XENLOG_WARNING VTDPREFIX, "Unknown DMAR structure = type\n"); + dprintk(XENLOG_WARNING VTDPREFIX, + "Unknown DMAR structure type %x\n", + entry_header->type); ret =3D -EINVAL; break; } --- 2010-03-02.orig/xen/drivers/passthrough/vtd/intremap.c 2010-03-16 = 14:11:32.000000000 +0100 +++ 2010-03-02/xen/drivers/passthrough/vtd/intremap.c 2010-03-16 = 13:20:28.000000000 +0100 @@ -475,9 +475,9 @@ static void set_msi_source_id(struct pci break; =20 default: - gdprintk(XENLOG_WARNING VTDPREFIX, - "set_msi_source_id: unknown type : bdf =3D %x:%x.%x\n", - bus, PCI_SLOT(devfn), PCI_FUNC(devfn)); + dprintk(XENLOG_WARNING VTDPREFIX, "d%d: unknown(%u): bdf =3D = %x:%x.%x\n", + pdev->domain->domain_id, type, + bus, PCI_SLOT(devfn), PCI_FUNC(devfn)); break; } } --- 2010-03-02.orig/xen/drivers/passthrough/vtd/iommu.c 2010-03-16 = 14:11:32.000000000 +0100 +++ 2010-03-02/xen/drivers/passthrough/vtd/iommu.c 2010-03-16 = 15:19:21.000000000 +0100 @@ -63,9 +63,9 @@ static int domain_iommu_domid(struct dom i =3D find_next_bit(iommu->domid_bitmap, nr_dom, i+1); } =20 - gdprintk(XENLOG_ERR VTDPREFIX, - "Cannot get valid iommu domid: domid=3D%d iommu->index=3D%d\n= ", - d->domain_id, iommu->index); + dprintk(XENLOG_ERR VTDPREFIX, + "Cannot get valid iommu domid: domid=3D%d iommu->index=3D%d\n"= , + d->domain_id, iommu->index); return -1; } =20 @@ -97,7 +97,7 @@ static int context_set_domain_id(struct=20 i =3D find_first_zero_bit(iommu->domid_bitmap, nr_dom); if ( i >=3D nr_dom ) { - gdprintk(XENLOG_ERR VTDPREFIX, "IOMMU: no free domain = ids\n"); + dprintk(XENLOG_ERR VTDPREFIX, "IOMMU: no free domain ids\n"); return -EFAULT; } iommu->domid_map[i] =3D d->domain_id; @@ -690,8 +690,9 @@ static void iommu_enable_translation(str u32 sts; unsigned long flags; =20 - dprintk(XENLOG_INFO VTDPREFIX, - "iommu_enable_translation: iommu->reg =3D %p\n", iommu->reg); + if ( iommu_verbose ) + dprintk(VTDPREFIX, + "iommu_enable_translation: iommu->reg =3D %p\n", = iommu->reg); spin_lock_irqsave(&iommu->register_lock, flags); sts =3D dmar_readl(iommu->reg, DMAR_GSTS_REG); dmar_writel(iommu->reg, DMAR_GCMD_REG, sts | DMA_GCMD_TE); @@ -1070,11 +1071,14 @@ static int __init iommu_alloc(struct acp =20 drhd->iommu =3D iommu; =20 - dprintk(XENLOG_DEBUG VTDPREFIX, - "drhd->address =3D %"PRIx64" iommu->reg =3D %p\n", - drhd->address, iommu->reg); - dprintk(XENLOG_DEBUG VTDPREFIX, - "cap =3D %"PRIx64" ecap =3D %"PRIx64"\n", iommu->cap, = iommu->ecap); + if ( iommu_verbose ) + { + dprintk(VTDPREFIX, + "drhd->address =3D %"PRIx64" iommu->reg =3D %p\n", + drhd->address, iommu->reg); + dprintk(VTDPREFIX, + "cap =3D %"PRIx64" ecap =3D %"PRIx64"\n", iommu->cap, = iommu->ecap); + } if ( cap_fault_reg_offset(iommu->cap) + cap_num_fault_regs(iommu->cap) * PRIMARY_FAULT_REG_LEN >=3D = PAGE_SIZE || ecap_iotlb_offset(iommu->ecap) >=3D PAGE_SIZE ) @@ -1316,16 +1320,16 @@ static int domain_context_mapping(struct break; =20 case DEV_TYPE_PCIe_ENDPOINT: - gdprintk(XENLOG_INFO VTDPREFIX, - "domain_context_mapping:PCIe: bdf =3D %x:%x.%x\n", - bus, PCI_SLOT(devfn), PCI_FUNC(devfn)); + if ( iommu_verbose ) + dprintk(VTDPREFIX, "d%d:PCIe: map bdf =3D %x:%x.%x\n", + domain->domain_id, bus, PCI_SLOT(devfn), PCI_FUNC(devf= n)); ret =3D domain_context_mapping_one(domain, drhd->iommu, bus, = devfn); break; =20 case DEV_TYPE_PCI: - gdprintk(XENLOG_INFO VTDPREFIX, - "domain_context_mapping:PCI: bdf =3D %x:%x.%x\n", - bus, PCI_SLOT(devfn), PCI_FUNC(devfn)); + if ( iommu_verbose ) + dprintk(VTDPREFIX, "d%d:PCI: map bdf =3D %x:%x.%x\n", + domain->domain_id, bus, PCI_SLOT(devfn), PCI_FUNC(devf= n)); =20 ret =3D domain_context_mapping_one(domain, drhd->iommu, bus, = devfn); if ( ret ) @@ -1355,13 +1359,16 @@ static int domain_context_mapping(struct break; =20 default: - gdprintk(XENLOG_ERR VTDPREFIX, - "domain_context_mapping:unknown type : bdf =3D %x:%x.%x\n= ", - bus, PCI_SLOT(devfn), PCI_FUNC(devfn)); + dprintk(XENLOG_ERR VTDPREFIX, "d%d:unknown(%u): bdf =3D %x:%x.%x\n= ", + domain->domain_id, type, + bus, PCI_SLOT(devfn), PCI_FUNC(devfn)); ret =3D -EINVAL; break; } =20 + if ( iommu_verbose ) + process_pending_softirqs(); + return ret; } =20 @@ -1442,16 +1449,16 @@ static int domain_context_unmap(struct d goto out; =20 case DEV_TYPE_PCIe_ENDPOINT: - gdprintk(XENLOG_INFO VTDPREFIX, - "domain_context_unmap:PCIe: bdf =3D %x:%x.%x\n", - bus, PCI_SLOT(devfn), PCI_FUNC(devfn)); + if ( iommu_verbose ) + dprintk(VTDPREFIX, "d%d:PCIe: unmap bdf =3D %x:%x.%x\n", + domain->domain_id, bus, PCI_SLOT(devfn), PCI_FUNC(devf= n)); ret =3D domain_context_unmap_one(domain, iommu, bus, devfn); break; =20 case DEV_TYPE_PCI: - gdprintk(XENLOG_INFO VTDPREFIX, - "domain_context_unmap:PCI: bdf =3D %x:%x.%x\n", - bus, PCI_SLOT(devfn), PCI_FUNC(devfn)); + if ( iommu_verbose ) + dprintk(VTDPREFIX, "d%d:PCI: unmap bdf =3D %x:%x.%x\n", + domain->domain_id, bus, PCI_SLOT(devfn), PCI_FUNC(devf= n)); ret =3D domain_context_unmap_one(domain, iommu, bus, devfn); if ( ret ) break; @@ -1476,9 +1483,9 @@ static int domain_context_unmap(struct d break; =20 default: - gdprintk(XENLOG_ERR VTDPREFIX, - "domain_context_unmap:unknown type: bdf =3D %x:%x.%x\n", - bus, PCI_SLOT(devfn), PCI_FUNC(devfn)); + dprintk(XENLOG_ERR VTDPREFIX, "d%d:unknown(%u): bdf =3D %x:%x.%x\n= ", + domain->domain_id, type, + bus, PCI_SLOT(devfn), PCI_FUNC(devfn)); ret =3D -EINVAL; goto out; } @@ -1702,8 +1709,8 @@ static int intel_iommu_add_device(struct ret =3D domain_context_mapping(pdev->domain, pdev->bus, pdev->devfn); if ( ret ) { - gdprintk(XENLOG_ERR VTDPREFIX, - "intel_iommu_add_device: context mapping failed\n"); + dprintk(XENLOG_ERR VTDPREFIX, "d%d: context mapping failed\n", + pdev->domain->domain_id); return ret; } =20 @@ -1713,8 +1720,8 @@ static int intel_iommu_add_device(struct { ret =3D rmrr_identity_mapping(pdev->domain, rmrr); if ( ret ) - gdprintk(XENLOG_ERR VTDPREFIX, - "intel_iommu_add_device: RMRR mapping failed\n");= + dprintk(XENLOG_ERR VTDPREFIX, "d%d: RMRR mapping = failed\n", + pdev->domain->domain_id); } } =20 @@ -2031,7 +2038,7 @@ static int intel_iommu_assign_device(str =20 if (pdev->domain !=3D dom0) { - gdprintk(XENLOG_ERR VTDPREFIX, + dprintk(XENLOG_ERR VTDPREFIX, "IOMMU: assign a assigned device\n"); return -EBUSY; } @@ -2057,8 +2064,8 @@ static int intel_iommu_assign_device(str ret =3D rmrr_identity_mapping(d, rmrr); if ( ret ) { - gdprintk(XENLOG_ERR VTDPREFIX, - "IOMMU: mapping reserved region failed\n"); + dprintk(XENLOG_ERR VTDPREFIX, + "IOMMU: mapping reserved region failed\n"); goto done; } } --- 2010-03-02.orig/xen/include/xen/iommu.h 2010-03-16 14:11:32.0000000= 00 +0100 +++ 2010-03-02/xen/include/xen/iommu.h 2010-03-16 13:40:48.000000000 = +0100 @@ -26,14 +26,10 @@ #include #include =20 -extern int iommu_enabled; -extern int iommu_pv_enabled; -extern int force_iommu; -extern int iommu_workaround_bios_bug; -extern int iommu_passthrough; -extern int iommu_snoop; -extern int iommu_qinval; -extern int iommu_intremap; +extern bool_t iommu_enabled, iommu_pv_enabled; +extern bool_t force_iommu, iommu_verbose; +extern bool_t iommu_workaround_bios_bug, iommu_passthrough; +extern bool_t iommu_snoop, iommu_qinval, iommu_intremap; =20 #define domain_hvm_iommu(d) (&d->arch.hvm_domain.hvm_iommu) =20 --=__Part92B84B9C.0__= Content-Type: text/plain; name="vtd-quiesce.patch" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="vtd-quiesce.patch" Introduce a new sub-option "verbose" to "iommu=3D", and hide most=0A(debugg= ing) messages when that option is not specified. Particularly=0Amessages = printed after time management was initialized can, on=0Asufficiently large = systems and with a graphical console, lead to=0Atime management issues = (therefore a call to process_pending_softirqs()=0Aalso gets added in case = the new sub-option is being used).=0A=0AWhile touching that code, also = convert all improper uses of gdprintk()=0Ato dprintk(), and convert all = boolean iommu config variables to bool_t=0Aresiding in the .data.read_mostl= y section.=0A=0ASigned-off-by: Jan Beulich =0A=0A--- = 2010-03-02.orig/xen/arch/x86/x86_64/mmconfig-shared.c 2010-03-16 = 14:11:32.000000000 +0100=0A+++ 2010-03-02/xen/arch/x86/x86_64/mmconfig-shar= ed.c 2010-03-16 12:02:05.000000000 +0100=0A@@ -454,12 +454,7 @@ int = pci_find_ext_capability(int seg, int=0A * cap version and next = pointer all being 0.=0A */=0A if ( (header =3D=3D 0) || (header = =3D=3D -1) )=0A- {=0A- dprintk(XENLOG_INFO VTDPREFIX,=0A- = "next cap:%x:%x.%x: no extended config\n",=0A- = bus, PCI_SLOT(devfn), PCI_FUNC(devfn));=0A return 0;=0A- }=0A = =0A while ( ttl-- > 0 ) {=0A if ( PCI_EXT_CAP_ID(header) = =3D=3D cap )=0A--- 2010-03-02.orig/xen/drivers/passthrough/amd/iommu_init.c= 2010-03-16 14:11:32.000000000 +0100=0A+++ 2010-03-02/xen/drivers/pa= ssthrough/amd/iommu_init.c 2010-03-16 13:30:07.000000000 +0100=0A@@ = -355,7 +355,7 @@ static void iommu_msi_set_affinity(unsig=0A =0A dest = =3D set_desc_affinity(desc, mask);=0A if (dest =3D=3D BAD_APICID){=0A- = gdprintk(XENLOG_ERR, "Set iommu interrupt affinity error!\n");=0A+ = dprintk(XENLOG_ERR, "Set iommu interrupt affinity error!\n");=0A = return;=0A }=0A =0A@@ -531,7 +531,7 @@ static int set_iommu_interru= pt_handler(s=0A irq =3D create_irq();=0A if ( irq <=3D 0 )=0A = {=0A- gdprintk(XENLOG_ERR VTDPREFIX, "IOMMU: no irqs\n");=0A+ = dprintk(XENLOG_ERR, "IOMMU: no irqs\n");=0A return 0;=0A }=0A = =0A--- 2010-03-02.orig/xen/drivers/passthrough/io.c 2010-03-16 = 14:11:32.000000000 +0100=0A+++ 2010-03-02/xen/drivers/passthrough/io.c = 2010-03-16 13:43:51.000000000 +0100=0A@@ -292,10 +292,12 @@ int pt_irq_crea= te_bind_vtd(=0A }=0A }=0A =0A- gdprintk(XENLOG_I= NFO VTDPREFIX,=0A- "VT-d irq bind: m_irq =3D %x device =3D = %x intx =3D %x\n",=0A- machine_gsi, device, intx);=0A = spin_unlock(&d->event_lock);=0A+=0A+ if ( iommu_verbose )=0A+ = dprintk(VTDPREFIX,=0A+ "d%d: bind: m_gsi=3D%u = g_gsi=3D%u device=3D%u intx=3D%u\n",=0A+ d->domain_id, = machine_gsi, guest_gsi, device, intx);=0A }=0A return 0;=0A }=0A@@ = -316,10 +318,11 @@ int pt_irq_destroy_bind_vtd(=0A guest_gsi =3D = hvm_pci_intx_gsi(device, intx);=0A link =3D hvm_pci_intx_link(device, = intx);=0A =0A- gdprintk(XENLOG_INFO,=0A- "pt_irq_destroy_bin= d_vtd: machine_gsi=3D%d "=0A- "guest_gsi=3D%d, device=3D%d, = intx=3D%d.\n",=0A- machine_gsi, guest_gsi, device, intx);=0A+ = if ( iommu_verbose )=0A+ dprintk(VTDPREFIX,=0A+ = "d%d: unbind: m_gsi=3D%u g_gsi=3D%u device=3D%u intx=3D%u\n",=0A+ = d->domain_id, machine_gsi, guest_gsi, device, intx);=0A+=0A = spin_lock(&d->event_lock);=0A =0A hvm_irq_dpci =3D domain_get_irq_dpci(= d);=0A@@ -372,9 +375,11 @@ int pt_irq_destroy_bind_vtd(=0A }=0A = }=0A spin_unlock(&d->event_lock);=0A- gdprintk(XENLOG_INFO,=0A- = "XEN_DOMCTL_irq_unmapping: m_irq =3D 0x%x device =3D 0x%x intx = =3D 0x%x\n",=0A- machine_gsi, device, intx);=0A+=0A+ if ( = iommu_verbose )=0A+ dprintk(VTDPREFIX,=0A+ "d%d = unmap: m_irq=3D%u device=3D%u intx=3D%u\n",=0A+ d->domain_id= , machine_gsi, device, intx);=0A =0A return 0;=0A }=0A--- 2010-03-02.or= ig/xen/drivers/passthrough/iommu.c 2010-03-16 14:11:32.000000000 = +0100=0A+++ 2010-03-02/xen/drivers/passthrough/iommu.c 2010-03-16 = 13:41:49.000000000 +0100=0A@@ -39,16 +39,17 @@ static int iommu_populate_pa= ge_table(str=0A * no-intremap Disable VT-d Interrupt = Remapping=0A */=0A custom_param("iommu", parse_iommu_param);=0A-int = iommu_enabled =3D 1;=0A-int iommu_pv_enabled;=0A-int force_iommu;=0A-int = iommu_workaround_bios_bug;=0A-int iommu_passthrough;=0A-int iommu_snoop = =3D 1;=0A-int iommu_qinval =3D 1;=0A-int iommu_intremap =3D 1;=0A-int = amd_iommu_debug;=0A-int amd_iommu_perdev_intremap;=0A+bool_t __read_mostly = iommu_enabled =3D 1;=0A+bool_t __read_mostly iommu_pv_enabled;=0A+bool_t = __read_mostly force_iommu;=0A+bool_t __read_mostly iommu_verbose;=0A+bool_t= __read_mostly iommu_workaround_bios_bug;=0A+bool_t __read_mostly = iommu_passthrough;=0A+bool_t __read_mostly iommu_snoop =3D 1;=0A+bool_t = __read_mostly iommu_qinval =3D 1;=0A+bool_t __read_mostly iommu_intremap = =3D 1;=0A+bool_t __read_mostly amd_iommu_debug;=0A+bool_t __read_mostly = amd_iommu_perdev_intremap;=0A =0A static void __init parse_iommu_param(char= *s)=0A {=0A@@ -72,6 +73,8 @@ static void __init parse_iommu_param(cha=0A = iommu_workaround_bios_bug =3D 1;=0A else if ( !strcmp(s,= "passthrough") )=0A iommu_passthrough =3D 1;=0A+ else = if ( !strcmp(s, "verbose") )=0A+ iommu_verbose =3D 1;=0A = else if ( !strcmp(s, "no-snoop") )=0A iommu_snoop =3D 0;=0A = else if ( !strcmp(s, "no-qinval") )=0A@@ -251,17 +254,17 @@ int = deassign_device(struct domain *d, u8=0A =0A if ( pdev->domain !=3D d = )=0A {=0A- gdprintk(XENLOG_ERR VTDPREFIX,=0A- = "IOMMU: deassign a device not owned\n");=0A+ dprintk(XENLOG_ERR = VTDPREFIX,=0A+ "d%d: deassign a device not owned\n", = d->domain_id);=0A return -EINVAL;=0A }=0A =0A ret =3D = hd->platform_ops->reassign_device(d, dom0, bus, devfn);=0A if ( ret = )=0A {=0A- gdprintk(XENLOG_ERR VTDPREFIX,=0A- = "Deassign device (%x:%x.%x) failed!\n",=0A- bus, PCI_SLOT(d= evfn), PCI_FUNC(devfn));=0A+ dprintk(XENLOG_ERR VTDPREFIX,=0A+ = "d%d: Deassign device (%x:%x.%x) failed!\n",=0A+ = d->domain_id, bus, PCI_SLOT(devfn), PCI_FUNC(devfn));=0A return = ret;=0A }=0A =0A--- 2010-03-02.orig/xen/drivers/passthrough/vtd/dmar.c = 2010-02-12 08:48:15.000000000 +0100=0A+++ 2010-03-02/xen/drivers/passthroug= h/vtd/dmar.c 2010-03-16 14:23:56.000000000 +0100=0A@@ -313,27 +313,31 = @@ static int __init acpi_parse_dev_scope(v=0A bus, = path->dev, path->fn, PCI_SECONDARY_BUS);=0A sub_bus =3D = pci_conf_read8(=0A bus, path->dev, path->fn, PCI_SUBORDINAT= E_BUS);=0A- dprintk(XENLOG_INFO VTDPREFIX,=0A- = " bridge: %x:%x.%x start =3D %x sec =3D %x sub =3D %x\n",=0A- = bus, path->dev, path->fn,=0A- acpi_scope->sta= rt_bus, sec_bus, sub_bus);=0A+ if ( iommu_verbose )=0A+ = dprintk(VTDPREFIX,=0A+ " bridge: %x:%x.%x = start =3D %x sec =3D %x sub =3D %x\n",=0A+ bus, = path->dev, path->fn,=0A+ acpi_scope->start_bus, = sec_bus, sub_bus);=0A =0A dmar_scope_add_buses(scope, sec_bus, = sub_bus);=0A break;=0A =0A case ACPI_DEV_MSI_HPET:=0A- = dprintk(XENLOG_INFO VTDPREFIX, " MSI HPET: %x:%x.%x\n",=0A- = bus, path->dev, path->fn);=0A+ if ( iommu_verbos= e )=0A+ dprintk(VTDPREFIX, " MSI HPET: %x:%x.%x\n",=0A+ = bus, path->dev, path->fn);=0A break;=0A = =0A case ACPI_DEV_ENDPOINT:=0A- dprintk(XENLOG_INFO = VTDPREFIX, " endpoint: %x:%x.%x\n",=0A- bus, path->dev,= path->fn);=0A+ if ( iommu_verbose )=0A+ = dprintk(VTDPREFIX, " endpoint: %x:%x.%x\n",=0A+ = bus, path->dev, path->fn);=0A break;=0A =0A case = ACPI_DEV_IOAPIC:=0A- dprintk(XENLOG_INFO VTDPREFIX, " IOAPIC: = %x:%x.%x\n",=0A- bus, path->dev, path->fn);=0A+ = if ( iommu_verbose )=0A+ dprintk(VTDPREFIX, " IOAPIC: = %x:%x.%x\n",=0A+ bus, path->dev, path->fn);=0A =0A = if ( type =3D=3D DMAR_TYPE )=0A {=0A@@ -375,8 = +379,9 @@ acpi_parse_one_drhd(struct acpi_dmar_ent=0A dmaru->address = =3D drhd->address;=0A dmaru->include_all =3D drhd->flags & 1; /* BIT0: = INCLUDE_ALL */=0A INIT_LIST_HEAD(&dmaru->ioapic_list);=0A- = dprintk(XENLOG_INFO VTDPREFIX, " dmaru->address =3D %"PRIx64"\n",=0A- = dmaru->address);=0A+ if ( iommu_verbose )=0A+ dprintk(VTDP= REFIX, " dmaru->address =3D %"PRIx64"\n",=0A+ dmaru->addres= s);=0A =0A addr =3D map_to_nocache_virt(0, drhd->address);=0A = dmaru->ecap =3D dmar_readq(addr, DMAR_ECAP_REG);=0A@@ -388,7 +393,8 @@ = acpi_parse_one_drhd(struct acpi_dmar_ent=0A =0A if ( dmaru->include_all= )=0A {=0A- dprintk(XENLOG_INFO VTDPREFIX, " flags: INCLUDE_ALL= \n");=0A+ if ( iommu_verbose )=0A+ dprintk(VTDPREFIX, " = flags: INCLUDE_ALL\n");=0A /* Only allow one INCLUDE_ALL */=0A = if ( include_all )=0A {=0A@@ -535,9 +541,11 @@ acpi_parse_one_r= mrr(struct acpi_dmar_ent=0A }=0A else=0A {=0A- = dprintk(XENLOG_INFO VTDPREFIX,=0A- " RMRR region: = base_addr %"PRIx64" end_address %"PRIx64"\n",=0A- rmrru->bas= e_address, rmrru->end_address);=0A+ if ( iommu_verbose )=0A+ = dprintk(VTDPREFIX,=0A+ " RMRR region: = base_addr %"PRIx64=0A+ " end_address %"PRIx64"\n",= =0A+ rmrru->base_address, rmrru->end_address);=0A = acpi_register_rmrr_unit(rmrru);=0A }=0A }=0A@@ = -560,8 +568,9 @@ acpi_parse_one_atsr(struct acpi_dmar_ent=0A memset(ats= ru, 0, sizeof(struct acpi_atsr_unit));=0A =0A atsru->all_ports =3D = atsr->flags & 1; /* BIT0: ALL_PORTS */=0A- dprintk(XENLOG_INFO = VTDPREFIX,=0A- " atsru->all_ports: %x\n", atsru->all_ports);=0A= + if ( iommu_verbose )=0A+ dprintk(VTDPREFIX,=0A+ = " atsru->all_ports: %x\n", atsru->all_ports);=0A if ( !atsru->all_port= s )=0A {=0A dev_scope_start =3D (void *)(atsr + 1);=0A@@ = -571,7 +580,8 @@ acpi_parse_one_atsr(struct acpi_dmar_ent=0A }=0A = else=0A {=0A- dprintk(XENLOG_INFO VTDPREFIX, " flags: = ALL_PORTS\n");=0A+ if ( iommu_verbose )=0A+ dprintk(VTDPR= EFIX, " flags: ALL_PORTS\n");=0A /* Only allow one ALL_PORTS = */=0A if ( all_ports )=0A {=0A@@ -604,9 +614,11 @@ = acpi_parse_one_rhsa(struct acpi_dmar_ent=0A rhsau->address =3D = rhsa->address;=0A rhsau->proximity_domain =3D rhsa->proximity_domain;= =0A list_add_tail(&rhsau->list, &acpi_rhsa_units);=0A- dprintk(XENLO= G_INFO VTDPREFIX,=0A- " rhsau->address: %"PRIx64" rhsau->proxim= ity_domain: %"PRIx32"\n",=0A- rhsau->address, rhsau->proximity_d= omain);=0A+ if ( iommu_verbose )=0A+ dprintk(VTDPREFIX,=0A+ = " rhsau->address: %"PRIx64=0A+ " rhsau->proximity= _domain: %"PRIx32"\n",=0A+ rhsau->address, rhsau->proximity_= domain);=0A =0A return ret;=0A }=0A@@ -633,8 +645,9 @@ static int = __init acpi_parse_dmar(struct=0A }=0A =0A dmar_host_address_width = =3D dmar->width + 1;=0A- dprintk(XENLOG_INFO VTDPREFIX, "Host address = width %d\n",=0A- dmar_host_address_width);=0A+ if ( = iommu_verbose )=0A+ dprintk(VTDPREFIX, "Host address width = %d\n",=0A+ dmar_host_address_width);=0A =0A entry_header= =3D (struct acpi_dmar_entry_header *)(dmar + 1);=0A while ( ((unsigned= long)entry_header) <=0A@@ -643,23 +656,29 @@ static int __init acpi_parse_= dmar(struct=0A switch ( entry_header->type )=0A {=0A = case ACPI_DMAR_DRHD:=0A- dprintk(XENLOG_INFO VTDPREFIX, = "found ACPI_DMAR_DRHD:\n");=0A+ if ( iommu_verbose )=0A+ = dprintk(VTDPREFIX, "found ACPI_DMAR_DRHD:\n");=0A ret = =3D acpi_parse_one_drhd(entry_header);=0A break;=0A = case ACPI_DMAR_RMRR:=0A- dprintk(XENLOG_INFO VTDPREFIX, "found = ACPI_DMAR_RMRR:\n");=0A+ if ( iommu_verbose )=0A+ = dprintk(VTDPREFIX, "found ACPI_DMAR_RMRR:\n");=0A ret =3D = acpi_parse_one_rmrr(entry_header);=0A break;=0A case = ACPI_DMAR_ATSR:=0A- dprintk(XENLOG_INFO VTDPREFIX, "found = ACPI_DMAR_ATSR:\n");=0A+ if ( iommu_verbose )=0A+ = dprintk(VTDPREFIX, "found ACPI_DMAR_ATSR:\n");=0A ret =3D = acpi_parse_one_atsr(entry_header);=0A break;=0A case = ACPI_DMAR_RHSA:=0A- dprintk(XENLOG_INFO VTDPREFIX, "found = ACPI_DMAR_RHSA:\n");=0A+ if ( iommu_verbose )=0A+ = dprintk(VTDPREFIX, "found ACPI_DMAR_RHSA:\n");=0A ret =3D = acpi_parse_one_rhsa(entry_header);=0A break;=0A = default:=0A- dprintk(XENLOG_WARNING VTDPREFIX, "Unknown DMAR = structure type\n");=0A+ dprintk(XENLOG_WARNING VTDPREFIX,=0A+ = "Unknown DMAR structure type %x\n",=0A+ = entry_header->type);=0A ret =3D -EINVAL;=0A = break;=0A }=0A--- 2010-03-02.orig/xen/drivers/passthrough/vtd/intre= map.c 2010-03-16 14:11:32.000000000 +0100=0A+++ 2010-03-02/xen/drivers/pa= ssthrough/vtd/intremap.c 2010-03-16 13:20:28.000000000 +0100=0A@@ = -475,9 +475,9 @@ static void set_msi_source_id(struct pci=0A = break;=0A =0A default:=0A- gdprintk(XENLOG_WARNING VTDPREFIX,=0A= - "set_msi_source_id: unknown type : bdf =3D %x:%x.%x\n",= =0A- bus, PCI_SLOT(devfn), PCI_FUNC(devfn));=0A+ = dprintk(XENLOG_WARNING VTDPREFIX, "d%d: unknown(%u): bdf =3D %x:%x.%x\n",= =0A+ pdev->domain->domain_id, type,=0A+ bus, = PCI_SLOT(devfn), PCI_FUNC(devfn));=0A break;=0A }=0A }=0A--- = 2010-03-02.orig/xen/drivers/passthrough/vtd/iommu.c 2010-03-16 = 14:11:32.000000000 +0100=0A+++ 2010-03-02/xen/drivers/passthrough/vtd/iommu= .c 2010-03-16 15:19:21.000000000 +0100=0A@@ -63,9 +63,9 @@ static int = domain_iommu_domid(struct dom=0A i =3D find_next_bit(iommu->domid_b= itmap, nr_dom, i+1);=0A }=0A =0A- gdprintk(XENLOG_ERR VTDPREFIX,=0A-= "Cannot get valid iommu domid: domid=3D%d iommu->index=3D%d\n"= ,=0A- d->domain_id, iommu->index);=0A+ dprintk(XENLOG_ERR = VTDPREFIX,=0A+ "Cannot get valid iommu domid: domid=3D%d = iommu->index=3D%d\n",=0A+ d->domain_id, iommu->index);=0A = return -1;=0A }=0A =0A@@ -97,7 +97,7 @@ static int context_set_domain_id(st= ruct =0A i =3D find_first_zero_bit(iommu->domid_bitmap, nr_dom);=0A= if ( i >=3D nr_dom )=0A {=0A- gdprintk(XENLOG_E= RR VTDPREFIX, "IOMMU: no free domain ids\n");=0A+ dprintk(XENLOG= _ERR VTDPREFIX, "IOMMU: no free domain ids\n");=0A return = -EFAULT;=0A }=0A iommu->domid_map[i] =3D d->domain_id;=0A@@= -690,8 +690,9 @@ static void iommu_enable_translation(str=0A u32 = sts;=0A unsigned long flags;=0A =0A- dprintk(XENLOG_INFO VTDPREFIX,= =0A- "iommu_enable_translation: iommu->reg =3D %p\n", iommu->reg= );=0A+ if ( iommu_verbose )=0A+ dprintk(VTDPREFIX,=0A+ = "iommu_enable_translation: iommu->reg =3D %p\n", iommu->reg);=0A = spin_lock_irqsave(&iommu->register_lock, flags);=0A sts =3D dmar_readl(= iommu->reg, DMAR_GSTS_REG);=0A dmar_writel(iommu->reg, DMAR_GCMD_REG, = sts | DMA_GCMD_TE);=0A@@ -1070,11 +1071,14 @@ static int __init iommu_alloc= (struct acp=0A =0A drhd->iommu =3D iommu;=0A =0A- dprintk(XENLOG_DEB= UG VTDPREFIX,=0A- "drhd->address =3D %"PRIx64" iommu->reg =3D = %p\n",=0A- drhd->address, iommu->reg);=0A- dprintk(XENLOG_DEB= UG VTDPREFIX,=0A- "cap =3D %"PRIx64" ecap =3D %"PRIx64"\n", = iommu->cap, iommu->ecap);=0A+ if ( iommu_verbose )=0A+ {=0A+ = dprintk(VTDPREFIX,=0A+ "drhd->address =3D %"PRIx64" = iommu->reg =3D %p\n",=0A+ drhd->address, iommu->reg);=0A+ = dprintk(VTDPREFIX,=0A+ "cap =3D %"PRIx64" ecap =3D = %"PRIx64"\n", iommu->cap, iommu->ecap);=0A+ }=0A if ( cap_fault_reg_= offset(iommu->cap) +=0A cap_num_fault_regs(iommu->cap) * = PRIMARY_FAULT_REG_LEN >=3D PAGE_SIZE ||=0A ecap_iotlb_offset(iommu= ->ecap) >=3D PAGE_SIZE )=0A@@ -1316,16 +1320,16 @@ static int domain_contex= t_mapping(struct=0A break;=0A =0A case DEV_TYPE_PCIe_ENDPOINT:= =0A- gdprintk(XENLOG_INFO VTDPREFIX,=0A- "domain_con= text_mapping:PCIe: bdf =3D %x:%x.%x\n",=0A- bus, PCI_SLOT(d= evfn), PCI_FUNC(devfn));=0A+ if ( iommu_verbose )=0A+ = dprintk(VTDPREFIX, "d%d:PCIe: map bdf =3D %x:%x.%x\n",=0A+ = domain->domain_id, bus, PCI_SLOT(devfn), PCI_FUNC(devfn));=0A = ret =3D domain_context_mapping_one(domain, drhd->iommu, bus, devfn);=0A = break;=0A =0A case DEV_TYPE_PCI:=0A- gdprintk(XENLOG_INFO = VTDPREFIX,=0A- "domain_context_mapping:PCI: bdf =3D = %x:%x.%x\n",=0A- bus, PCI_SLOT(devfn), PCI_FUNC(devfn));=0A= + if ( iommu_verbose )=0A+ dprintk(VTDPREFIX, "d%d:PCI: = map bdf =3D %x:%x.%x\n",=0A+ domain->domain_id, bus, = PCI_SLOT(devfn), PCI_FUNC(devfn));=0A =0A ret =3D domain_context_ma= pping_one(domain, drhd->iommu, bus, devfn);=0A if ( ret )=0A@@ = -1355,13 +1359,16 @@ static int domain_context_mapping(struct=0A = break;=0A =0A default:=0A- gdprintk(XENLOG_ERR VTDPREFIX,=0A- = "domain_context_mapping:unknown type : bdf =3D %x:%x.%x\n",= =0A- bus, PCI_SLOT(devfn), PCI_FUNC(devfn));=0A+ = dprintk(XENLOG_ERR VTDPREFIX, "d%d:unknown(%u): bdf =3D %x:%x.%x\n",=0A+ = domain->domain_id, type,=0A+ bus, PCI_SLOT(devf= n), PCI_FUNC(devfn));=0A ret =3D -EINVAL;=0A break;=0A = }=0A =0A+ if ( iommu_verbose )=0A+ process_pending_softirqs();=0A= +=0A return ret;=0A }=0A =0A@@ -1442,16 +1449,16 @@ static int = domain_context_unmap(struct d=0A goto out;=0A =0A case = DEV_TYPE_PCIe_ENDPOINT:=0A- gdprintk(XENLOG_INFO VTDPREFIX,=0A- = "domain_context_unmap:PCIe: bdf =3D %x:%x.%x\n",=0A- = bus, PCI_SLOT(devfn), PCI_FUNC(devfn));=0A+ if ( iommu_verbose= )=0A+ dprintk(VTDPREFIX, "d%d:PCIe: unmap bdf =3D %x:%x.%x\n",= =0A+ domain->domain_id, bus, PCI_SLOT(devfn), PCI_FUNC(d= evfn));=0A ret =3D domain_context_unmap_one(domain, iommu, bus, = devfn);=0A break;=0A =0A case DEV_TYPE_PCI:=0A- = gdprintk(XENLOG_INFO VTDPREFIX,=0A- "domain_context_unmap:P= CI: bdf =3D %x:%x.%x\n",=0A- bus, PCI_SLOT(devfn), = PCI_FUNC(devfn));=0A+ if ( iommu_verbose )=0A+ dprintk(VT= DPREFIX, "d%d:PCI: unmap bdf =3D %x:%x.%x\n",=0A+ = domain->domain_id, bus, PCI_SLOT(devfn), PCI_FUNC(devfn));=0A ret = =3D domain_context_unmap_one(domain, iommu, bus, devfn);=0A if ( = ret )=0A break;=0A@@ -1476,9 +1483,9 @@ static int domain_conte= xt_unmap(struct d=0A break;=0A =0A default:=0A- = gdprintk(XENLOG_ERR VTDPREFIX,=0A- "domain_context_unmap:un= known type: bdf =3D %x:%x.%x\n",=0A- bus, PCI_SLOT(devfn), = PCI_FUNC(devfn));=0A+ dprintk(XENLOG_ERR VTDPREFIX, "d%d:unknown(%u)= : bdf =3D %x:%x.%x\n",=0A+ domain->domain_id, type,=0A+ = bus, PCI_SLOT(devfn), PCI_FUNC(devfn));=0A ret =3D = -EINVAL;=0A goto out;=0A }=0A@@ -1702,8 +1709,8 @@ static int = intel_iommu_add_device(struct=0A ret =3D domain_context_mapping(pdev->d= omain, pdev->bus, pdev->devfn);=0A if ( ret )=0A {=0A- = gdprintk(XENLOG_ERR VTDPREFIX,=0A- "intel_iommu_add_device:= context mapping failed\n");=0A+ dprintk(XENLOG_ERR VTDPREFIX, = "d%d: context mapping failed\n",=0A+ pdev->domain->domain_id= );=0A return ret;=0A }=0A =0A@@ -1713,8 +1720,8 @@ static int = intel_iommu_add_device(struct=0A {=0A ret =3D = rmrr_identity_mapping(pdev->domain, rmrr);=0A if ( ret )=0A- = gdprintk(XENLOG_ERR VTDPREFIX,=0A- = "intel_iommu_add_device: RMRR mapping failed\n");=0A+ = dprintk(XENLOG_ERR VTDPREFIX, "d%d: RMRR mapping failed\n",=0A+ = pdev->domain->domain_id);=0A }=0A }=0A =0A@@ = -2031,7 +2038,7 @@ static int intel_iommu_assign_device(str=0A =0A if = (pdev->domain !=3D dom0)=0A {=0A- gdprintk(XENLOG_ERR VTDPREFIX,= =0A+ dprintk(XENLOG_ERR VTDPREFIX,=0A "IOMMU: = assign a assigned device\n");=0A return -EBUSY;=0A }=0A@@ = -2057,8 +2064,8 @@ static int intel_iommu_assign_device(str=0A = ret =3D rmrr_identity_mapping(d, rmrr);=0A if ( ret )=0A = {=0A- gdprintk(XENLOG_ERR VTDPREFIX,=0A- = "IOMMU: mapping reserved region failed\n");=0A+ = dprintk(XENLOG_ERR VTDPREFIX,=0A+ "IOMMU: mapping = reserved region failed\n");=0A goto done;=0A = }=0A }=0A--- 2010-03-02.orig/xen/include/xen/iommu.h 2010-03-16 = 14:11:32.000000000 +0100=0A+++ 2010-03-02/xen/include/xen/iommu.h = 2010-03-16 13:40:48.000000000 +0100=0A@@ -26,14 +26,10 @@=0A #include = =0A #include =0A =0A-extern int = iommu_enabled;=0A-extern int iommu_pv_enabled;=0A-extern int force_iommu;= =0A-extern int iommu_workaround_bios_bug;=0A-extern int iommu_passthrough;= =0A-extern int iommu_snoop;=0A-extern int iommu_qinval;=0A-extern int = iommu_intremap;=0A+extern bool_t iommu_enabled, iommu_pv_enabled;=0A+extern= bool_t force_iommu, iommu_verbose;=0A+extern bool_t iommu_workaround_bios_= bug, iommu_passthrough;=0A+extern bool_t iommu_snoop, iommu_qinval, = iommu_intremap;=0A =0A #define domain_hvm_iommu(d) (&d->arch.hvm_domain= .hvm_iommu)=0A =0A --=__Part92B84B9C.0__= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel --=__Part92B84B9C.0__=--