ia64/xen-unstable

changeset 17486:e823b22c6017

amd iommu: clean up debug information.

Signed-off-by: Wei Wang <wei.wang2@amd.com>
author Keir Fraser <keir.fraser@citrix.com>
date Mon Apr 21 10:01:46 2008 +0100 (2008-04-21)
parents 3ecc9ab1f5df
children 658f031557f6
files xen/arch/x86/setup.c xen/drivers/passthrough/amd/iommu_acpi.c xen/drivers/passthrough/amd/iommu_detect.c xen/drivers/passthrough/amd/iommu_init.c xen/drivers/passthrough/amd/iommu_map.c xen/drivers/passthrough/amd/pci_amd_iommu.c xen/drivers/passthrough/iommu.c xen/drivers/passthrough/vtd/iommu.c xen/include/asm-x86/amd-iommu.h xen/include/asm-x86/hvm/svm/amd-iommu-proto.h
line diff
     1.1 --- a/xen/arch/x86/setup.c	Fri Apr 18 11:10:17 2008 +0100
     1.2 +++ b/xen/arch/x86/setup.c	Mon Apr 21 10:01:46 2008 +0100
     1.3 @@ -1021,8 +1021,6 @@ void __init __start_xen(unsigned long mb
     1.4  
     1.5      iommu_setup();
     1.6  
     1.7 -    amd_iommu_detect();
     1.8 -
     1.9      /*
    1.10       * We're going to setup domain0 using the module(s) that we stashed safely
    1.11       * above our heap. The second module, if present, is an initrd ramdisk.
     2.1 --- a/xen/drivers/passthrough/amd/iommu_acpi.c	Fri Apr 18 11:10:17 2008 +0100
     2.2 +++ b/xen/drivers/passthrough/amd/iommu_acpi.c	Mon Apr 21 10:01:46 2008 +0100
     2.3 @@ -139,7 +139,7 @@ static int __init register_exclusion_ran
     2.4      iommu = find_iommu_for_device(bus, devfn);
     2.5      if ( !iommu )
     2.6      {
     2.7 -        dprintk(XENLOG_ERR, "IVMD Error: No IOMMU for Dev_Id 0x%x!\n", bdf);
     2.8 +        amd_iov_error("IVMD Error: No IOMMU for Dev_Id 0x%x!\n", bdf);
     2.9          return -ENODEV;
    2.10      }
    2.11      req = ivrs_mappings[bdf].dte_requestor_id;
    2.12 @@ -221,7 +221,7 @@ static int __init parse_ivmd_device_sele
    2.13      bdf = ivmd_block->header.dev_id;
    2.14      if ( bdf >= ivrs_bdf_entries )
    2.15      {
    2.16 -        dprintk(XENLOG_ERR, "IVMD Error: Invalid Dev_Id 0x%x\n", bdf);
    2.17 +        amd_iov_error("IVMD Error: Invalid Dev_Id 0x%x\n", bdf);
    2.18          return -ENODEV;
    2.19      }
    2.20  
    2.21 @@ -238,22 +238,19 @@ static int __init parse_ivmd_device_rang
    2.22      first_bdf = ivmd_block->header.dev_id;
    2.23      if ( first_bdf >= ivrs_bdf_entries )
    2.24      {
    2.25 -        dprintk(XENLOG_ERR, "IVMD Error: "
    2.26 -                "Invalid Range_First Dev_Id 0x%x\n", first_bdf);
    2.27 +        amd_iov_error(
    2.28 +            "IVMD Error: Invalid Range_First Dev_Id 0x%x\n", first_bdf);
    2.29          return -ENODEV;
    2.30      }
    2.31  
    2.32      last_bdf = ivmd_block->last_dev_id;
    2.33      if ( (last_bdf >= ivrs_bdf_entries) || (last_bdf <= first_bdf) )
    2.34      {
    2.35 -        dprintk(XENLOG_ERR, "IVMD Error: "
    2.36 -                "Invalid Range_Last Dev_Id 0x%x\n", last_bdf);
    2.37 +        amd_iov_error(
    2.38 +            "IVMD Error: Invalid Range_Last Dev_Id 0x%x\n", last_bdf);
    2.39          return -ENODEV;
    2.40      }
    2.41  
    2.42 -    dprintk(XENLOG_ERR, " Dev_Id Range: 0x%x -> 0x%x\n",
    2.43 -            first_bdf, last_bdf);
    2.44 -
    2.45      for ( bdf = first_bdf, error = 0; (bdf <= last_bdf) && !error; bdf++ )
    2.46          error = register_exclusion_range_for_device(
    2.47              bdf, base, limit, iw, ir);
    2.48 @@ -272,8 +269,7 @@ static int __init parse_ivmd_device_iomm
    2.49                                      ivmd_block->cap_offset);
    2.50      if ( !iommu )
    2.51      {
    2.52 -        dprintk(XENLOG_ERR,
    2.53 -                "IVMD Error: No IOMMU for Dev_Id 0x%x  Cap 0x%x\n",
    2.54 +        amd_iov_error("IVMD Error: No IOMMU for Dev_Id 0x%x  Cap 0x%x\n",
    2.55                  ivmd_block->header.dev_id, ivmd_block->cap_offset);
    2.56          return -ENODEV;
    2.57      }
    2.58 @@ -290,7 +286,7 @@ static int __init parse_ivmd_block(struc
    2.59      if ( ivmd_block->header.length <
    2.60           sizeof(struct acpi_ivmd_block_header) )
    2.61      {
    2.62 -        dprintk(XENLOG_ERR, "IVMD Error: Invalid Block Length!\n");
    2.63 +        amd_iov_error("IVMD Error: Invalid Block Length!\n");
    2.64          return -ENODEV;
    2.65      }
    2.66  
    2.67 @@ -299,10 +295,9 @@ static int __init parse_ivmd_block(struc
    2.68      base = start_addr & PAGE_MASK;
    2.69      limit = (start_addr + mem_length - 1) & PAGE_MASK;
    2.70  
    2.71 -    dprintk(XENLOG_INFO, "IVMD Block: Type 0x%x\n",
    2.72 -            ivmd_block->header.type);
    2.73 -    dprintk(XENLOG_INFO, " Start_Addr_Phys 0x%lx\n", start_addr);
    2.74 -    dprintk(XENLOG_INFO, " Mem_Length 0x%lx\n", mem_length);
    2.75 +    amd_iov_info("IVMD Block: Type 0x%x\n",ivmd_block->header.type);
    2.76 +    amd_iov_info(" Start_Addr_Phys 0x%lx\n", start_addr);
    2.77 +    amd_iov_info(" Mem_Length 0x%lx\n", mem_length);
    2.78  
    2.79      if ( get_field_from_byte(ivmd_block->header.flags,
    2.80                               AMD_IOMMU_ACPI_EXCLUSION_RANGE_MASK,
    2.81 @@ -321,7 +316,7 @@ static int __init parse_ivmd_block(struc
    2.82      }
    2.83      else
    2.84      {
    2.85 -        dprintk(KERN_ERR, "IVMD Error: Invalid Flag Field!\n");
    2.86 +        amd_iov_error("IVMD Error: Invalid Flag Field!\n");
    2.87          return -ENODEV;
    2.88      }
    2.89  
    2.90 @@ -344,7 +339,7 @@ static int __init parse_ivmd_block(struc
    2.91                                         base, limit, iw, ir);
    2.92  
    2.93      default:
    2.94 -        dprintk(XENLOG_ERR, "IVMD Error: Invalid Block Type!\n");
    2.95 +        amd_iov_error("IVMD Error: Invalid Block Type!\n");
    2.96          return -ENODEV;
    2.97      }
    2.98  }
    2.99 @@ -354,7 +349,7 @@ static u16 __init parse_ivhd_device_padd
   2.100  {
   2.101      if ( header_length < (block_length + pad_length) )
   2.102      {
   2.103 -        dprintk(XENLOG_ERR, "IVHD Error: Invalid Device_Entry Length!\n");
   2.104 +        amd_iov_error("IVHD Error: Invalid Device_Entry Length!\n");
   2.105          return 0;
   2.106      }
   2.107  
   2.108 @@ -369,8 +364,7 @@ static u16 __init parse_ivhd_device_sele
   2.109      bdf = ivhd_device->header.dev_id;
   2.110      if ( bdf >= ivrs_bdf_entries )
   2.111      {
   2.112 -        dprintk(XENLOG_ERR, "IVHD Error: "
   2.113 -                "Invalid Device_Entry Dev_Id 0x%x\n", bdf);
   2.114 +        amd_iov_error("IVHD Error: Invalid Device_Entry Dev_Id 0x%x\n", bdf);
   2.115          return 0;
   2.116      }
   2.117  
   2.118 @@ -393,14 +387,14 @@ static u16 __init parse_ivhd_device_rang
   2.119      dev_length = sizeof(struct acpi_ivhd_device_range);
   2.120      if ( header_length < (block_length + dev_length) )
   2.121      {
   2.122 -        dprintk(XENLOG_ERR, "IVHD Error: Invalid Device_Entry Length!\n");
   2.123 +        amd_iov_error("IVHD Error: Invalid Device_Entry Length!\n");
   2.124          return 0;
   2.125      }
   2.126  
   2.127      if ( ivhd_device->range.trailer.type !=
   2.128           AMD_IOMMU_ACPI_IVHD_DEV_RANGE_END )
   2.129      {
   2.130 -        dprintk(XENLOG_ERR, "IVHD Error: "
   2.131 +        amd_iov_error("IVHD Error: "
   2.132                  "Invalid Range: End_Type 0x%x\n",
   2.133                  ivhd_device->range.trailer.type);
   2.134          return 0;
   2.135 @@ -409,21 +403,20 @@ static u16 __init parse_ivhd_device_rang
   2.136      first_bdf = ivhd_device->header.dev_id;
   2.137      if ( first_bdf >= ivrs_bdf_entries )
   2.138      {
   2.139 -        dprintk(XENLOG_ERR, "IVHD Error: "
   2.140 -                "Invalid Range: First Dev_Id 0x%x\n", first_bdf);
   2.141 +        amd_iov_error(
   2.142 +            "IVHD Error: Invalid Range: First Dev_Id 0x%x\n", first_bdf);
   2.143          return 0;
   2.144      }
   2.145  
   2.146      last_bdf = ivhd_device->range.trailer.dev_id;
   2.147      if ( (last_bdf >= ivrs_bdf_entries) || (last_bdf <= first_bdf) )
   2.148      {
   2.149 -        dprintk(XENLOG_ERR, "IVHD Error: "
   2.150 -                "Invalid Range: Last Dev_Id 0x%x\n", last_bdf);
   2.151 +        amd_iov_error(
   2.152 +            "IVHD Error: Invalid Range: Last Dev_Id 0x%x\n", last_bdf);
   2.153          return 0;
   2.154      }
   2.155  
   2.156 -    dprintk(XENLOG_INFO, " Dev_Id Range: 0x%x -> 0x%x\n",
   2.157 -            first_bdf, last_bdf);
   2.158 +    amd_iov_info(" Dev_Id Range: 0x%x -> 0x%x\n", first_bdf, last_bdf);
   2.159  
   2.160      /* override flags for range of devices */
   2.161      sys_mgt = get_field_from_byte(ivhd_device->header.flags,
   2.162 @@ -444,28 +437,25 @@ static u16 __init parse_ivhd_device_alia
   2.163      dev_length = sizeof(struct acpi_ivhd_device_alias);
   2.164      if ( header_length < (block_length + dev_length) )
   2.165      {
   2.166 -        dprintk(XENLOG_ERR, "IVHD Error: "
   2.167 -                "Invalid Device_Entry Length!\n");
   2.168 +        amd_iov_error("IVHD Error: Invalid Device_Entry Length!\n");
   2.169          return 0;
   2.170      }
   2.171  
   2.172      bdf = ivhd_device->header.dev_id;
   2.173      if ( bdf >= ivrs_bdf_entries )
   2.174      {
   2.175 -        dprintk(XENLOG_ERR, "IVHD Error: "
   2.176 -                "Invalid Device_Entry Dev_Id 0x%x\n", bdf);
   2.177 +        amd_iov_error("IVHD Error: Invalid Device_Entry Dev_Id 0x%x\n", bdf);
   2.178          return 0;
   2.179      }
   2.180  
   2.181      alias_id = ivhd_device->alias.dev_id;
   2.182      if ( alias_id >= ivrs_bdf_entries )
   2.183      {
   2.184 -        dprintk(XENLOG_ERR, "IVHD Error: "
   2.185 -                "Invalid Alias Dev_Id 0x%x\n", alias_id);
   2.186 +        amd_iov_error("IVHD Error: Invalid Alias Dev_Id 0x%x\n", alias_id);
   2.187          return 0;
   2.188      }
   2.189  
   2.190 -    dprintk(XENLOG_INFO, " Dev_Id Alias: 0x%x\n", alias_id);
   2.191 +    amd_iov_info(" Dev_Id Alias: 0x%x\n", alias_id);
   2.192  
   2.193      /* override requestor_id and flags for device */
   2.194      ivrs_mappings[bdf].dte_requestor_id = alias_id;
   2.195 @@ -490,15 +480,14 @@ static u16 __init parse_ivhd_device_alia
   2.196      dev_length = sizeof(struct acpi_ivhd_device_alias_range);
   2.197      if ( header_length < (block_length + dev_length) )
   2.198      {
   2.199 -        dprintk(XENLOG_ERR, "IVHD Error: "
   2.200 -                "Invalid Device_Entry Length!\n");
   2.201 +        amd_iov_error("IVHD Error: Invalid Device_Entry Length!\n");
   2.202          return 0;
   2.203      }
   2.204  
   2.205      if ( ivhd_device->alias_range.trailer.type !=
   2.206           AMD_IOMMU_ACPI_IVHD_DEV_RANGE_END )
   2.207      {
   2.208 -        dprintk(XENLOG_ERR, "IVHD Error: "
   2.209 +        amd_iov_error("IVHD Error: "
   2.210                  "Invalid Range: End_Type 0x%x\n",
   2.211                  ivhd_device->alias_range.trailer.type);
   2.212          return 0;
   2.213 @@ -507,30 +496,28 @@ static u16 __init parse_ivhd_device_alia
   2.214      first_bdf = ivhd_device->header.dev_id;
   2.215      if ( first_bdf >= ivrs_bdf_entries )
   2.216      {
   2.217 -        dprintk(XENLOG_ERR,"IVHD Error: "
   2.218 -                "Invalid Range: First Dev_Id 0x%x\n", first_bdf);
   2.219 +        amd_iov_error(
   2.220 +            "IVHD Error: Invalid Range: First Dev_Id 0x%x\n", first_bdf);
   2.221          return 0;
   2.222      }
   2.223  
   2.224      last_bdf = ivhd_device->alias_range.trailer.dev_id;
   2.225      if ( last_bdf >= ivrs_bdf_entries || last_bdf <= first_bdf )
   2.226      {
   2.227 -        dprintk(XENLOG_ERR, "IVHD Error: "
   2.228 -                "Invalid Range: Last Dev_Id 0x%x\n", last_bdf);
   2.229 +        amd_iov_error(
   2.230 +            "IVHD Error: Invalid Range: Last Dev_Id 0x%x\n", last_bdf);
   2.231          return 0;
   2.232      }
   2.233  
   2.234      alias_id = ivhd_device->alias_range.alias.dev_id;
   2.235      if ( alias_id >= ivrs_bdf_entries )
   2.236      {
   2.237 -        dprintk(XENLOG_ERR, "IVHD Error: "
   2.238 -                "Invalid Alias Dev_Id 0x%x\n", alias_id);
   2.239 +        amd_iov_error("IVHD Error: Invalid Alias Dev_Id 0x%x\n", alias_id);
   2.240          return 0;
   2.241      }
   2.242  
   2.243 -    dprintk(XENLOG_INFO, " Dev_Id Range: 0x%x -> 0x%x\n",
   2.244 -            first_bdf, last_bdf);
   2.245 -    dprintk(XENLOG_INFO, " Dev_Id Alias: 0x%x\n", alias_id);
   2.246 +    amd_iov_info(" Dev_Id Range: 0x%x -> 0x%x\n", first_bdf, last_bdf);
   2.247 +    amd_iov_info(" Dev_Id Alias: 0x%x\n", alias_id);
   2.248  
   2.249      /* override requestor_id and flags for range of devices */
   2.250      sys_mgt = get_field_from_byte(ivhd_device->header.flags,
   2.251 @@ -555,16 +542,14 @@ static u16 __init parse_ivhd_device_exte
   2.252      dev_length = sizeof(struct acpi_ivhd_device_extended);
   2.253      if ( header_length < (block_length + dev_length) )
   2.254      {
   2.255 -        dprintk(XENLOG_ERR, "IVHD Error: "
   2.256 -                "Invalid Device_Entry Length!\n");
   2.257 +        amd_iov_error("IVHD Error: Invalid Device_Entry Length!\n");
   2.258          return 0;
   2.259      }
   2.260  
   2.261      bdf = ivhd_device->header.dev_id;
   2.262      if ( bdf >= ivrs_bdf_entries )
   2.263      {
   2.264 -        dprintk(XENLOG_ERR, "IVHD Error: "
   2.265 -                "Invalid Device_Entry Dev_Id 0x%x\n", bdf);
   2.266 +        amd_iov_error("IVHD Error: Invalid Device_Entry Dev_Id 0x%x\n", bdf);
   2.267          return 0;
   2.268      }
   2.269  
   2.270 @@ -587,15 +572,14 @@ static u16 __init parse_ivhd_device_exte
   2.271      dev_length = sizeof(struct acpi_ivhd_device_extended_range);
   2.272      if ( header_length < (block_length + dev_length) )
   2.273      {
   2.274 -        dprintk(XENLOG_ERR, "IVHD Error: "
   2.275 -                "Invalid Device_Entry Length!\n");
   2.276 +        amd_iov_error("IVHD Error: Invalid Device_Entry Length!\n");
   2.277          return 0;
   2.278      }
   2.279  
   2.280      if ( ivhd_device->extended_range.trailer.type !=
   2.281           AMD_IOMMU_ACPI_IVHD_DEV_RANGE_END )
   2.282      {
   2.283 -        dprintk(XENLOG_ERR, "IVHD Error: "
   2.284 +        amd_iov_error("IVHD Error: "
   2.285                  "Invalid Range: End_Type 0x%x\n",
   2.286                  ivhd_device->extended_range.trailer.type);
   2.287          return 0;
   2.288 @@ -604,20 +588,20 @@ static u16 __init parse_ivhd_device_exte
   2.289      first_bdf = ivhd_device->header.dev_id;
   2.290      if ( first_bdf >= ivrs_bdf_entries )
   2.291      {
   2.292 -        dprintk(XENLOG_ERR, "IVHD Error: "
   2.293 -                "Invalid Range: First Dev_Id 0x%x\n", first_bdf);
   2.294 +        amd_iov_error(
   2.295 +            "IVHD Error: Invalid Range: First Dev_Id 0x%x\n", first_bdf);
   2.296          return 0;
   2.297      }
   2.298  
   2.299      last_bdf = ivhd_device->extended_range.trailer.dev_id;
   2.300      if ( (last_bdf >= ivrs_bdf_entries) || (last_bdf <= first_bdf) )
   2.301      {
   2.302 -        dprintk(XENLOG_ERR, "IVHD Error: "
   2.303 -                "Invalid Range: Last Dev_Id 0x%x\n", last_bdf);
   2.304 +        amd_iov_error(
   2.305 +            "IVHD Error: Invalid Range: Last Dev_Id 0x%x\n", last_bdf);
   2.306          return 0;
   2.307      }
   2.308  
   2.309 -    dprintk(XENLOG_INFO, " Dev_Id Range: 0x%x -> 0x%x\n",
   2.310 +    amd_iov_info(" Dev_Id Range: 0x%x -> 0x%x\n",
   2.311              first_bdf, last_bdf);
   2.312  
   2.313      /* override flags for range of devices */
   2.314 @@ -639,7 +623,7 @@ static int __init parse_ivhd_block(struc
   2.315      if ( ivhd_block->header.length <
   2.316           sizeof(struct acpi_ivhd_block_header) )
   2.317      {
   2.318 -        dprintk(XENLOG_ERR, "IVHD Error: Invalid Block Length!\n");
   2.319 +        amd_iov_error("IVHD Error: Invalid Block Length!\n");
   2.320          return -ENODEV;
   2.321      }
   2.322  
   2.323 @@ -647,21 +631,16 @@ static int __init parse_ivhd_block(struc
   2.324                                      ivhd_block->cap_offset);
   2.325      if ( !iommu )
   2.326      {
   2.327 -        dprintk(XENLOG_ERR,
   2.328 -                "IVHD Error: No IOMMU for Dev_Id 0x%x  Cap 0x%x\n",
   2.329 +        amd_iov_error("IVHD Error: No IOMMU for Dev_Id 0x%x  Cap 0x%x\n",
   2.330                  ivhd_block->header.dev_id, ivhd_block->cap_offset);
   2.331          return -ENODEV;
   2.332      }
   2.333  
   2.334 -    dprintk(XENLOG_INFO, "IVHD Block:\n");
   2.335 -    dprintk(XENLOG_INFO, " Cap_Offset 0x%x\n",
   2.336 -            ivhd_block->cap_offset);
   2.337 -    dprintk(XENLOG_INFO, " MMIO_BAR_Phys 0x%lx\n",
   2.338 -            (unsigned long)ivhd_block->mmio_base);
   2.339 -    dprintk(XENLOG_INFO, " PCI_Segment 0x%x\n",
   2.340 -            ivhd_block->pci_segment);
   2.341 -    dprintk(XENLOG_INFO, " IOMMU_Info 0x%x\n",
   2.342 -            ivhd_block->iommu_info);
   2.343 +    amd_iov_info("IVHD Block:\n");
   2.344 +    amd_iov_info(" Cap_Offset 0x%x\n", ivhd_block->cap_offset);
   2.345 +    amd_iov_info(" MMIO_BAR_Phys 0x%"PRIx64"\n",ivhd_block->mmio_base);
   2.346 +    amd_iov_info( " PCI_Segment 0x%x\n", ivhd_block->pci_segment);
   2.347 +    amd_iov_info( " IOMMU_Info 0x%x\n", ivhd_block->iommu_info);
   2.348  
   2.349      /* override IOMMU support flags */
   2.350      iommu->coherent = get_field_from_byte(ivhd_block->header.flags,
   2.351 @@ -692,13 +671,10 @@ static int __init parse_ivhd_block(struc
   2.352          ivhd_device = (union acpi_ivhd_device *)
   2.353              ((u8 *)ivhd_block + block_length);
   2.354  
   2.355 -        dprintk(XENLOG_INFO, "IVHD Device Entry:\n");
   2.356 -        dprintk(XENLOG_INFO, " Type 0x%x\n",
   2.357 -                ivhd_device->header.type);
   2.358 -        dprintk(XENLOG_INFO, " Dev_Id 0x%x\n",
   2.359 -                ivhd_device->header.dev_id);
   2.360 -        dprintk(XENLOG_INFO, " Flags 0x%x\n",
   2.361 -                ivhd_device->header.flags);
   2.362 +        amd_iov_info( "IVHD Device Entry:\n");
   2.363 +        amd_iov_info( " Type 0x%x\n", ivhd_device->header.type);
   2.364 +        amd_iov_info( " Dev_Id 0x%x\n", ivhd_device->header.dev_id);
   2.365 +        amd_iov_info( " Flags 0x%x\n", ivhd_device->header.flags);
   2.366  
   2.367          switch ( ivhd_device->header.type )
   2.368          {
   2.369 @@ -741,8 +717,7 @@ static int __init parse_ivhd_block(struc
   2.370                  ivhd_block->header.length, block_length);
   2.371              break;
   2.372          default:
   2.373 -            dprintk(XENLOG_ERR, "IVHD Error: "
   2.374 -                    "Invalid Device Type!\n");
   2.375 +            amd_iov_error("IVHD Error: Invalid Device Type!\n");
   2.376              dev_length = 0;
   2.377              break;
   2.378          }
   2.379 @@ -774,46 +749,49 @@ static int __init parse_ivrs_block(struc
   2.380          return parse_ivmd_block(ivmd_block);
   2.381  
   2.382      default:
   2.383 -        dprintk(XENLOG_ERR, "IVRS Error: Invalid Block Type!\n");
   2.384 +        amd_iov_error("IVRS Error: Invalid Block Type!\n");
   2.385          return -ENODEV;
   2.386      }
   2.387  
   2.388      return 0;
   2.389  }
   2.390  
   2.391 -void __init dump_acpi_table_header(struct acpi_table_header *table)
   2.392 +static void __init dump_acpi_table_header(struct acpi_table_header *table)
   2.393  {
   2.394 +#ifdef AMD_IOV_DEBUG
   2.395      int i;
   2.396  
   2.397 -    printk(XENLOG_INFO "AMD IOMMU: ACPI Table:\n");
   2.398 -    printk(XENLOG_INFO " Signature ");
   2.399 +    amd_iov_info("ACPI Table:\n");
   2.400 +    amd_iov_info(" Signature ");
   2.401      for ( i = 0; i < ACPI_NAME_SIZE; i++ )
   2.402          printk("%c", table->signature[i]);
   2.403      printk("\n");
   2.404  
   2.405 -    printk(" Length 0x%x\n", table->length);
   2.406 -    printk(" Revision 0x%x\n", table->revision);
   2.407 -    printk(" CheckSum 0x%x\n", table->checksum);
   2.408 +    amd_iov_info(" Length 0x%x\n", table->length);
   2.409 +    amd_iov_info(" Revision 0x%x\n", table->revision);
   2.410 +    amd_iov_info(" CheckSum 0x%x\n", table->checksum);
   2.411  
   2.412 -    printk(" OEM_Id ");
   2.413 +    amd_iov_info(" OEM_Id ");
   2.414      for ( i = 0; i < ACPI_OEM_ID_SIZE; i++ )
   2.415          printk("%c", table->oem_id[i]);
   2.416      printk("\n");
   2.417  
   2.418 -    printk(" OEM_Table_Id ");
   2.419 +    amd_iov_info(" OEM_Table_Id ");
   2.420      for ( i = 0; i < ACPI_OEM_TABLE_ID_SIZE; i++ )
   2.421          printk("%c", table->oem_table_id[i]);
   2.422      printk("\n");
   2.423  
   2.424 -    printk(" OEM_Revision 0x%x\n", table->oem_revision);
   2.425 +    amd_iov_info(" OEM_Revision 0x%x\n", table->oem_revision);
   2.426  
   2.427 -    printk(" Creator_Id ");
   2.428 +    amd_iov_info(" Creator_Id ");
   2.429      for ( i = 0; i < ACPI_NAME_SIZE; i++ )
   2.430          printk("%c", table->asl_compiler_id[i]);
   2.431      printk("\n");
   2.432  
   2.433 -    printk(" Creator_Revision 0x%x\n",
   2.434 +    amd_iov_info(" Creator_Revision 0x%x\n",
   2.435             table->asl_compiler_revision);
   2.436 +#endif
   2.437 +
   2.438  }
   2.439  
   2.440  int __init parse_ivrs_table(unsigned long phys_addr, unsigned long size)
   2.441 @@ -827,9 +805,7 @@ int __init parse_ivrs_table(unsigned lon
   2.442  
   2.443      BUG_ON(!table);
   2.444  
   2.445 -#if 0
   2.446      dump_acpi_table_header(table);
   2.447 -#endif
   2.448  
   2.449      /* validate checksum: sum of entire table == 0 */
   2.450      checksum = 0;
   2.451 @@ -838,7 +814,7 @@ int __init parse_ivrs_table(unsigned lon
   2.452          checksum += raw_table[i];
   2.453      if ( checksum )
   2.454      {
   2.455 -        dprintk(XENLOG_ERR, "IVRS Error: "
   2.456 +        amd_iov_error("IVRS Error: "
   2.457                  "Invalid Checksum 0x%x\n", checksum);
   2.458          return -ENODEV;
   2.459      }
   2.460 @@ -850,15 +826,15 @@ int __init parse_ivrs_table(unsigned lon
   2.461          ivrs_block = (struct acpi_ivrs_block_header *)
   2.462              ((u8 *)table + length);
   2.463  
   2.464 -        dprintk(XENLOG_INFO, "IVRS Block:\n");
   2.465 -        dprintk(XENLOG_INFO, " Type 0x%x\n", ivrs_block->type);
   2.466 -        dprintk(XENLOG_INFO, " Flags 0x%x\n", ivrs_block->flags);
   2.467 -        dprintk(XENLOG_INFO, " Length 0x%x\n", ivrs_block->length);
   2.468 -        dprintk(XENLOG_INFO, " Dev_Id 0x%x\n", ivrs_block->dev_id);
   2.469 +        amd_iov_info("IVRS Block:\n");
   2.470 +        amd_iov_info(" Type 0x%x\n", ivrs_block->type);
   2.471 +        amd_iov_info(" Flags 0x%x\n", ivrs_block->flags);
   2.472 +        amd_iov_info(" Length 0x%x\n", ivrs_block->length);
   2.473 +        amd_iov_info(" Dev_Id 0x%x\n", ivrs_block->dev_id);
   2.474  
   2.475          if ( table->length < (length + ivrs_block->length) )
   2.476          {
   2.477 -            dprintk(XENLOG_ERR, "IVRS Error: "
   2.478 +            amd_iov_error("IVRS Error: "
   2.479                      "Table Length Exceeded: 0x%x -> 0x%lx\n",
   2.480                      table->length,
   2.481                      (length + ivrs_block->length));
     3.1 --- a/xen/drivers/passthrough/amd/iommu_detect.c	Fri Apr 18 11:10:17 2008 +0100
     3.2 +++ b/xen/drivers/passthrough/amd/iommu_detect.c	Mon Apr 21 10:01:46 2008 +0100
     3.3 @@ -117,7 +117,7 @@ static int __init get_iommu_msi_capabili
     3.4      if ( !iommu->msi_cap )
     3.5          return -ENODEV;
     3.6  
     3.7 -    dprintk(XENLOG_INFO, "AMD IOMMU: Found MSI capability block \n");
     3.8 +    amd_iov_info("Found MSI capability block \n");
     3.9      control = pci_conf_read16(bus, dev, func,
    3.10              iommu->msi_cap + PCI_MSI_FLAGS);
    3.11      iommu->maskbit = control & PCI_MSI_FLAGS_MASKBIT;
    3.12 @@ -138,8 +138,7 @@ int __init get_iommu_capabilities(u8 bus
    3.13  
    3.14      if ( ((mmio_bar & 0x1) == 0) || (iommu->mmio_base_phys == 0) )
    3.15      {
    3.16 -        dprintk(XENLOG_ERR ,
    3.17 -                "AMD IOMMU: Invalid MMIO_BAR = 0x%"PRIx64"\n", mmio_bar);
    3.18 +        amd_iov_error("Invalid MMIO_BAR = 0x%"PRIx64"\n", mmio_bar);
    3.19          return -ENODEV;
    3.20      }
    3.21  
     4.1 --- a/xen/drivers/passthrough/amd/iommu_init.c	Fri Apr 18 11:10:17 2008 +0100
     4.2 +++ b/xen/drivers/passthrough/amd/iommu_init.c	Mon Apr 21 10:01:46 2008 +0100
     4.3 @@ -35,8 +35,7 @@ int __init map_iommu_mmio_region(struct 
     4.4  
     4.5      if ( nr_amd_iommus > MAX_AMD_IOMMUS )
     4.6      {
     4.7 -        gdprintk(XENLOG_ERR,
     4.8 -                 "IOMMU: nr_amd_iommus %d > MAX_IOMMUS\n", nr_amd_iommus);
     4.9 +        amd_iov_error("nr_amd_iommus %d > MAX_IOMMUS\n", nr_amd_iommus);
    4.10          return -ENOMEM;
    4.11      }
    4.12  
    4.13 @@ -395,7 +394,7 @@ static void parse_event_log_entry(u32 en
    4.14      if ( (code > IOMMU_EVENT_INVALID_DEV_REQUEST)
    4.15          || (code < IOMMU_EVENT_ILLEGAL_DEV_TABLE_ENTRY) )
    4.16      {
    4.17 -        dprintk(XENLOG_ERR, "Invalid event log entry!\n");
    4.18 +        amd_iov_error("Invalid event log entry!\n");
    4.19          return;
    4.20      }
    4.21  
    4.22 @@ -408,8 +407,8 @@ static void parse_event_log_entry(u32 en
    4.23                                             IOMMU_EVENT_DOMAIN_ID_MASK,
    4.24                                             IOMMU_EVENT_DOMAIN_ID_SHIFT);
    4.25          addr= (u64*) (entry + 2);
    4.26 -        dprintk(XENLOG_ERR,
    4.27 -            "%s: domain = %d, device id = 0x%x, fault address = 0x%"PRIx64"\n",
    4.28 +        printk(XENLOG_ERR "AMD_IOV: "
    4.29 +            "%s: domain:%d, device id:0x%x, fault address:0x%"PRIx64"\n",
    4.30              event_str[code-1], domain_id, device_id, *addr);
    4.31      }
    4.32  }
    4.33 @@ -445,7 +444,7 @@ static int set_iommu_interrupt_handler(s
    4.34  
    4.35      if ( !vector )
    4.36      {
    4.37 -        gdprintk(XENLOG_ERR, "AMD IOMMU: no vectors\n");
    4.38 +        amd_iov_error("no vectors\n");
    4.39          return 0;
    4.40      }
    4.41  
    4.42 @@ -453,7 +452,7 @@ static int set_iommu_interrupt_handler(s
    4.43      ret = request_irq(vector, amd_iommu_page_fault, 0, "dmar", iommu);
    4.44      if ( ret )
    4.45      {
    4.46 -        gdprintk(XENLOG_ERR, "AMD IOMMU: can't request irq\n");
    4.47 +        amd_iov_error("can't request irq\n");
    4.48          return 0;
    4.49      }
    4.50  
    4.51 @@ -483,5 +482,5 @@ void __init enable_iommu(struct amd_iomm
    4.52  
    4.53      spin_unlock_irqrestore(&iommu->lock, flags);
    4.54  
    4.55 -    printk("AMD IOMMU %d: Enabled\n", nr_amd_iommus);
    4.56 +    printk("AMD_IOV: IOMMU %d Enabled.\n", nr_amd_iommus);
    4.57  }
     5.1 --- a/xen/drivers/passthrough/amd/iommu_map.c	Fri Apr 18 11:10:17 2008 +0100
     5.2 +++ b/xen/drivers/passthrough/amd/iommu_map.c	Mon Apr 21 10:01:46 2008 +0100
     5.3 @@ -154,8 +154,7 @@ void flush_command_buffer(struct amd_iom
     5.4          }
     5.5          else
     5.6          {
     5.7 -            dprintk(XENLOG_WARNING, "AMD IOMMU: Warning:"
     5.8 -                    " ComWaitInt bit did not assert!\n");
     5.9 +            amd_iov_warning("Warning: ComWaitInt bit did not assert!\n");
    5.10          }
    5.11      }
    5.12  }
    5.13 @@ -402,10 +401,9 @@ int amd_iommu_map_page(struct domain *d,
    5.14      pte = get_pte_from_page_tables(hd->root_table, hd->paging_mode, gfn);
    5.15      if ( pte == NULL )
    5.16      {
    5.17 -        dprintk(XENLOG_ERR,
    5.18 -                "AMD IOMMU: Invalid IO pagetable entry gfn = %lx\n", gfn);
    5.19 +        amd_iov_error("Invalid IO pagetable entry gfn = %lx\n", gfn);
    5.20          spin_unlock_irqrestore(&hd->mapping_lock, flags);
    5.21 -        return -EIO;
    5.22 +        return -EFAULT;
    5.23      }
    5.24  
    5.25      set_page_table_entry_present((u32 *)pte, maddr, iw, ir);
    5.26 @@ -439,10 +437,9 @@ int amd_iommu_unmap_page(struct domain *
    5.27      pte = get_pte_from_page_tables(hd->root_table, hd->paging_mode, gfn);
    5.28      if ( pte == NULL )
    5.29      {
    5.30 -        dprintk(XENLOG_ERR,
    5.31 -                "AMD IOMMU: Invalid IO pagetable entry gfn = %lx\n", gfn);
    5.32 +        amd_iov_error("Invalid IO pagetable entry gfn = %lx\n", gfn);
    5.33          spin_unlock_irqrestore(&hd->mapping_lock, flags);
    5.34 -        return -EIO;
    5.35 +        return -EFAULT;
    5.36      }
    5.37  
    5.38      /* mark PTE as 'page not present' */
    5.39 @@ -479,9 +476,8 @@ int amd_iommu_reserve_domain_unity_map(
    5.40              hd->root_table, hd->paging_mode, phys_addr >> PAGE_SHIFT);
    5.41          if ( pte == NULL )
    5.42          {
    5.43 -            dprintk(XENLOG_ERR,
    5.44 -                    "AMD IOMMU: Invalid IO pagetable entry "
    5.45 -                    "phys_addr = %lx\n", phys_addr);
    5.46 +            amd_iov_error(
    5.47 +            "Invalid IO pagetable entry phys_addr = %lx\n", phys_addr);
    5.48              spin_unlock_irqrestore(&hd->mapping_lock, flags);
    5.49              return -EFAULT;
    5.50          }
    5.51 @@ -528,8 +524,7 @@ int amd_iommu_sync_p2m(struct domain *d)
    5.52          pte = get_pte_from_page_tables(hd->root_table, hd->paging_mode, gfn);
    5.53          if ( pte == NULL )
    5.54          {
    5.55 -            dprintk(XENLOG_ERR,
    5.56 -                    "AMD IOMMU: Invalid IO pagetable entry gfn = %lx\n", gfn);
    5.57 +            amd_iov_error("Invalid IO pagetable entry gfn = %lx\n", gfn);
    5.58              spin_unlock_irqrestore(&hd->mapping_lock, flags);
    5.59              return -EFAULT;
    5.60          }
     6.1 --- a/xen/drivers/passthrough/amd/pci_amd_iommu.c	Fri Apr 18 11:10:17 2008 +0100
     6.2 +++ b/xen/drivers/passthrough/amd/pci_amd_iommu.c	Mon Apr 21 10:01:46 2008 +0100
     6.3 @@ -39,7 +39,7 @@ struct ivrs_mappings *ivrs_mappings = NU
     6.4  int amd_iommu_enabled = 0;
     6.5  
     6.6  static int enable_amd_iommu = 0;
     6.7 -boolean_param("enable_amd_iommu", enable_amd_iommu);
     6.8 +boolean_param("enable_amd_iov", enable_amd_iommu);
     6.9  
    6.10  static void deallocate_domain_page_tables(struct hvm_iommu *hd)
    6.11  {
    6.12 @@ -104,7 +104,7 @@ static int __init allocate_iommu_table_s
    6.13  
    6.14      if ( !table->buffer )
    6.15      {
    6.16 -        dprintk(XENLOG_ERR, "AMD IOMMU: Error allocating %s\n", name);
    6.17 +        amd_iov_error("Error allocating %s\n", name);
    6.18          return -ENOMEM;
    6.19      }
    6.20  
    6.21 @@ -169,7 +169,7 @@ int iommu_detect_callback(u8 bus, u8 dev
    6.22      iommu = (struct amd_iommu *) xmalloc(struct amd_iommu);
    6.23      if ( !iommu )
    6.24      {
    6.25 -        dprintk(XENLOG_ERR, "AMD IOMMU: Error allocating amd_iommu\n");
    6.26 +        amd_iov_error("Error allocating amd_iommu\n");
    6.27          return -ENOMEM;
    6.28      }
    6.29      memset(iommu, 0, sizeof(struct amd_iommu));
    6.30 @@ -237,7 +237,7 @@ static int __init amd_iommu_init(void)
    6.31      }
    6.32  
    6.33      if ( acpi_table_parse(ACPI_IVRS, parse_ivrs_table) != 0 )
    6.34 -        dprintk(XENLOG_INFO, "AMD IOMMU: Did not find IVRS table!\n");
    6.35 +        amd_iov_error("Did not find IVRS table!\n");
    6.36  
    6.37      for_each_amd_iommu ( iommu )
    6.38      {
    6.39 @@ -308,7 +308,7 @@ void amd_iommu_setup_domain_device(
    6.40  
    6.41          invalidate_dev_table_entry(iommu, req_id);
    6.42          flush_command_buffer(iommu);
    6.43 -        dprintk(XENLOG_INFO, "AMD IOMMU: Set DTE req_id:%x, "
    6.44 +        amd_iov_info("Enable DTE:0x%x, "
    6.45                  "root_ptr:%"PRIx64", domain_id:%d, paging_mode:%d\n",
    6.46                  req_id, root_ptr, hd->domain_id, hd->paging_mode);
    6.47  
    6.48 @@ -354,7 +354,7 @@ void __init amd_iommu_setup_dom0_devices
    6.49      }
    6.50  }
    6.51  
    6.52 -int amd_iommu_detect(void)
    6.53 +int amd_iov_detect(void)
    6.54  {
    6.55      unsigned long i;
    6.56      int last_bus;
    6.57 @@ -362,7 +362,7 @@ int amd_iommu_detect(void)
    6.58  
    6.59      if ( !enable_amd_iommu )
    6.60      {
    6.61 -        printk("AMD IOMMU: Disabled\n");
    6.62 +        printk("AMD_IOV: Disabled.\n");
    6.63          return 0;
    6.64      }
    6.65  
    6.66 @@ -370,13 +370,13 @@ int amd_iommu_detect(void)
    6.67  
    6.68      if ( scan_for_iommu(iommu_detect_callback) != 0 )
    6.69      {
    6.70 -        dprintk(XENLOG_ERR, "AMD IOMMU: Error detection\n");
    6.71 +        amd_iov_error("Error detection\n");
    6.72          goto error_out;
    6.73      }
    6.74  
    6.75      if ( !iommu_found() )
    6.76      {
    6.77 -        printk("AMD IOMMU: Not found!\n");
    6.78 +        printk("AMD_IOV: IOMMU not found!\n");
    6.79          return 0;
    6.80      }
    6.81      else
    6.82 @@ -394,8 +394,7 @@ int amd_iommu_detect(void)
    6.83  
    6.84          if ( !ivrs_mappings )
    6.85          {
    6.86 -            dprintk(XENLOG_ERR, "AMD IOMMU:"
    6.87 -                    " Error allocating IVRS DevMappings table\n");
    6.88 +            amd_iov_error("Error allocating IVRS DevMappings table\n");
    6.89              goto error_out;
    6.90          }
    6.91          memset(ivrs_mappings, 0,
    6.92 @@ -404,7 +403,7 @@ int amd_iommu_detect(void)
    6.93  
    6.94      if ( amd_iommu_init() != 0 )
    6.95      {
    6.96 -        dprintk(XENLOG_ERR, "AMD IOMMU: Error initialization\n");
    6.97 +        amd_iov_error("Error initialization\n");
    6.98          goto error_out;
    6.99      }
   6.100  
   6.101 @@ -462,8 +461,6 @@ static int get_paging_mode(unsigned long
   6.102              return -ENOMEM;
   6.103      }
   6.104  
   6.105 -    dprintk(XENLOG_INFO, "AMD IOMMU: paging mode = %d\n", level);
   6.106 -
   6.107      return level;
   6.108  }
   6.109  
   6.110 @@ -505,7 +502,7 @@ static void amd_iommu_disable_domain_dev
   6.111          memset (dte, 0, IOMMU_DEV_TABLE_ENTRY_SIZE);
   6.112          invalidate_dev_table_entry(iommu, req_id);
   6.113          flush_command_buffer(iommu);
   6.114 -        dprintk(XENLOG_INFO , "AMD IOMMU: disable DTE 0x%x,"
   6.115 +        amd_iov_info("Disable DTE:0x%x,"
   6.116                  " domain_id:%d, paging_mode:%d\n",
   6.117                  req_id,  domain_hvm_iommu(domain)->domain_id,
   6.118                  domain_hvm_iommu(domain)->paging_mode);
   6.119 @@ -540,7 +537,7 @@ static int reassign_device( struct domai
   6.120  
   6.121          if ( !iommu )
   6.122          {
   6.123 -            gdprintk(XENLOG_ERR , "AMD IOMMU: fail to find iommu."
   6.124 +            amd_iov_error("Fail to find iommu."
   6.125                       " %x:%x.%x cannot be assigned to domain %d\n", 
   6.126                       bus, PCI_SLOT(devfn), PCI_FUNC(devfn), target->domain_id);
   6.127              return -ENODEV;
   6.128 @@ -555,8 +552,7 @@ static int reassign_device( struct domai
   6.129          spin_unlock_irqrestore(&source_hd->iommu_list_lock, flags);
   6.130  
   6.131          amd_iommu_setup_domain_device(target, iommu, bdf);
   6.132 -        gdprintk(XENLOG_INFO ,
   6.133 -                 "AMD IOMMU: reassign %x:%x.%x domain %d -> domain %d\n",
   6.134 +        amd_iov_info("reassign %x:%x.%x domain %d -> domain %d\n",
   6.135                   bus, PCI_SLOT(devfn), PCI_FUNC(devfn),
   6.136                   source->domain_id, target->domain_id);
   6.137  
   6.138 @@ -595,8 +591,7 @@ static void release_domain_devices(struc
   6.139      {
   6.140          pdev = list_entry(hd->pdev_list.next, typeof(*pdev), list);
   6.141          pdev_flr(pdev->bus, pdev->devfn);
   6.142 -        gdprintk(XENLOG_INFO ,
   6.143 -                 "AMD IOMMU: release devices %x:%x.%x\n",
   6.144 +        amd_iov_info("release domain %d devices %x:%x.%x\n", d->domain_id,
   6.145                   pdev->bus, PCI_SLOT(pdev->devfn), PCI_FUNC(pdev->devfn));
   6.146          reassign_device(d, dom0, pdev->bus, pdev->devfn);
   6.147      }
     7.1 --- a/xen/drivers/passthrough/iommu.c	Fri Apr 18 11:10:17 2008 +0100
     7.2 +++ b/xen/drivers/passthrough/iommu.c	Mon Apr 21 10:01:46 2008 +0100
     7.3 @@ -18,6 +18,8 @@
     7.4  
     7.5  extern struct iommu_ops intel_iommu_ops;
     7.6  extern struct iommu_ops amd_iommu_ops;
     7.7 +int intel_vtd_setup(void);
     7.8 +int amd_iov_detect(void);
     7.9  
    7.10  int iommu_domain_init(struct domain *domain)
    7.11  {
    7.12 @@ -134,3 +136,16 @@ void deassign_device(struct domain *d, u
    7.13  
    7.14      return hd->platform_ops->reassign_device(d, dom0, bus, devfn);
    7.15  }
    7.16 +
    7.17 +int iommu_setup(void)
    7.18 +{
    7.19 +    switch ( boot_cpu_data.x86_vendor )
    7.20 +    {
    7.21 +    case X86_VENDOR_INTEL:
    7.22 +        return intel_vtd_setup();
    7.23 +    case X86_VENDOR_AMD:
    7.24 +        return amd_iov_detect();
    7.25 +    }
    7.26 +
    7.27 +    return 0;
    7.28 +}
     8.1 --- a/xen/drivers/passthrough/vtd/iommu.c	Fri Apr 18 11:10:17 2008 +0100
     8.2 +++ b/xen/drivers/passthrough/vtd/iommu.c	Mon Apr 21 10:01:46 2008 +0100
     8.3 @@ -1903,7 +1903,7 @@ static void setup_dom0_rmrr(void)
     8.4      end_for_each_rmrr_device ( rmrr, pdev )
     8.5  }
     8.6  
     8.7 -int iommu_setup(void)
     8.8 +int intel_vtd_setup(void)
     8.9  {
    8.10      struct hvm_iommu *hd  = domain_hvm_iommu(dom0);
    8.11      struct acpi_drhd_unit *drhd;
     9.1 --- a/xen/include/asm-x86/amd-iommu.h	Fri Apr 18 11:10:17 2008 +0100
     9.2 +++ b/xen/include/asm-x86/amd-iommu.h	Mon Apr 21 10:01:46 2008 +0100
     9.3 @@ -31,7 +31,7 @@
     9.4  extern int amd_iommu_enabled;
     9.5  extern struct list_head amd_iommu_head;
     9.6  
     9.7 -extern int __init amd_iommu_detect(void);
     9.8 +extern int __init amd_iov_detect(void);
     9.9  
    9.10  struct table_struct {
    9.11      void *buffer;
    10.1 --- a/xen/include/asm-x86/hvm/svm/amd-iommu-proto.h	Fri Apr 18 11:10:17 2008 +0100
    10.2 +++ b/xen/include/asm-x86/hvm/svm/amd-iommu-proto.h	Mon Apr 21 10:01:46 2008 +0100
    10.3 @@ -35,6 +35,19 @@
    10.4  #define DMA_32BIT_MASK  0x00000000ffffffffULL
    10.5  #define PAGE_ALIGN(addr)    (((addr) + PAGE_SIZE - 1) & PAGE_MASK)
    10.6  
    10.7 +#ifdef AMD_IOV_DEBUG
    10.8 +#define amd_iov_info(fmt, args...) \
    10.9 +    printk(XENLOG_INFO "AMD_IOV: " fmt, ## args)
   10.10 +#define amd_iov_warning(fmt, args...) \
   10.11 +    printk(XENLOG_WARNING "AMD_IOV: " fmt, ## args)
   10.12 +#define amd_iov_error(fmt, args...) \
   10.13 +    printk(XENLOG_ERR "AMD_IOV: %s:%d: " fmt, __FILE__ , __LINE__ , ## args)
   10.14 +#else
   10.15 +#define amd_iov_info(fmt, args...)
   10.16 +#define amd_iov_warning(fmt, args...)
   10.17 +#define amd_iov_error(fmt, args...)
   10.18 +#endif
   10.19 +
   10.20  typedef int (*iommu_detect_callback_ptr_t)(
   10.21      u8 bus, u8 dev, u8 func, u8 cap_ptr);
   10.22