if ( unity_map->addr + unity_map->length > base &&
base + length > unity_map->addr )
{
- AMD_IOMMU_DEBUG("IVMD Error: overlap [%lx,%lx) vs [%lx,%lx)\n",
+ AMD_IOMMU_ERROR("IVMD: overlap [%lx,%lx) vs [%lx,%lx)\n",
base, base + length, unity_map->addr,
unity_map->addr + unity_map->length);
return -EPERM;
iommu = find_iommu_for_device(seg, bdf);
if ( !iommu )
{
- AMD_IOMMU_DEBUG("IVMD Error: No IOMMU for Dev_Id %#x!\n", bdf);
+ AMD_IOMMU_ERROR("IVMD: no IOMMU for Dev_Id %#x\n", bdf);
return -ENODEV;
}
req = ivrs_mappings[bdf].dte_requestor_id;
bdf = ivmd_block->header.device_id;
if ( bdf >= ivrs_bdf_entries )
{
- AMD_IOMMU_DEBUG("IVMD Error: Invalid Dev_Id %#x\n", bdf);
+ AMD_IOMMU_ERROR("IVMD: invalid Dev_Id %#x\n", bdf);
return -ENODEV;
}
first_bdf = ivmd_block->header.device_id;
if ( first_bdf >= ivrs_bdf_entries )
{
- AMD_IOMMU_DEBUG("IVMD Error: "
- "Invalid Range_First Dev_Id %#x\n", first_bdf);
+ AMD_IOMMU_ERROR("IVMD: invalid Range_First Dev_Id %#x\n", first_bdf);
return -ENODEV;
}
last_bdf = ivmd_block->aux_data;
if ( (last_bdf >= ivrs_bdf_entries) || (last_bdf <= first_bdf) )
{
- AMD_IOMMU_DEBUG("IVMD Error: "
- "Invalid Range_Last Dev_Id %#x\n", last_bdf);
+ AMD_IOMMU_ERROR("IVMD: invalid Range_Last Dev_Id %#x\n", last_bdf);
return -ENODEV;
}
ivmd_block->aux_data);
if ( !iommu )
{
- AMD_IOMMU_DEBUG("IVMD Error: No IOMMU for Dev_Id %#x Cap %#x\n",
+ AMD_IOMMU_ERROR("IVMD: no IOMMU for Dev_Id %#x Cap %#x\n",
ivmd_block->header.device_id, ivmd_block->aux_data);
return -ENODEV;
}
if ( ivmd_block->header.length < sizeof(*ivmd_block) )
{
- AMD_IOMMU_DEBUG("IVMD Error: Invalid Block Length!\n");
+ AMD_IOMMU_ERROR("IVMD: invalid block length\n");
return -ENODEV;
}
(addr_bits < BITS_PER_LONG &&
((start_addr + mem_length - 1) >> addr_bits)) )
{
- AMD_IOMMU_DEBUG("IVMD: [%lx,%lx) is not IOMMU addressable\n",
- start_addr, start_addr + mem_length);
+ AMD_IOMMU_WARN("IVMD: [%lx,%lx) is not IOMMU addressable\n",
+ start_addr, start_addr + mem_length);
return 0;
}
{
paddr_t addr;
- AMD_IOMMU_DEBUG("IVMD: [%lx,%lx) is not (entirely) in reserved memory\n",
- base, limit + PAGE_SIZE);
+ AMD_IOMMU_WARN("IVMD: [%lx,%lx) is not (entirely) in reserved memory\n",
+ base, limit + PAGE_SIZE);
for ( addr = base; addr <= limit; addr += PAGE_SIZE )
{
if ( e820_add_range(&e820, addr, addr + PAGE_SIZE,
E820_RESERVED) )
continue;
- AMD_IOMMU_DEBUG("IVMD Error: Page at %lx couldn't be reserved\n",
+ AMD_IOMMU_ERROR("IVMD: page at %lx couldn't be reserved\n",
addr);
return -EIO;
}
RAM_TYPE_UNUSABLE)) )
continue;
- AMD_IOMMU_DEBUG("IVMD Error: Page at %lx can't be converted\n",
- addr);
+ AMD_IOMMU_ERROR("IVMD: page at %lx can't be converted\n", addr);
return -EIO;
}
}
}
else
{
- AMD_IOMMU_DEBUG("IVMD Error: Invalid Flag Field!\n");
+ AMD_IOMMU_ERROR("IVMD: invalid flag field\n");
return -ENODEV;
}
iw, ir, exclusion);
default:
- AMD_IOMMU_DEBUG("IVMD Error: Invalid Block Type!\n");
+ AMD_IOMMU_ERROR("IVMD: unknown block type %#x\n",
+ ivmd_block->header.type);
return -ENODEV;
}
}
{
if ( header_length < (block_length + pad_length) )
{
- AMD_IOMMU_DEBUG("IVHD Error: Invalid Device_Entry Length!\n");
+ AMD_IOMMU_ERROR("IVHD: invalid Device_Entry length\n");
return 0;
}
bdf = select->header.id;
if ( bdf >= ivrs_bdf_entries )
{
- AMD_IOMMU_DEBUG("IVHD Error: Invalid Device_Entry Dev_Id %#x\n", bdf);
+ AMD_IOMMU_ERROR("IVHD: invalid Device_Entry Dev_Id %#x\n", bdf);
return 0;
}
dev_length = sizeof(*range);
if ( header_length < (block_length + dev_length) )
{
- AMD_IOMMU_DEBUG("IVHD Error: Invalid Device_Entry Length!\n");
+ AMD_IOMMU_ERROR("IVHD: invalid Device_Entry length\n");
return 0;
}
if ( range->end.header.type != ACPI_IVRS_TYPE_END )
{
- AMD_IOMMU_DEBUG("IVHD Error: "
- "Invalid Range: End_Type %#x\n",
+ AMD_IOMMU_ERROR("IVHD: invalid range: End_Type %#x\n",
range->end.header.type);
return 0;
}
first_bdf = range->start.header.id;
if ( first_bdf >= ivrs_bdf_entries )
{
- AMD_IOMMU_DEBUG("IVHD Error: "
- "Invalid Range: First Dev_Id %#x\n", first_bdf);
+ AMD_IOMMU_ERROR("IVHD: invalid range: First Dev_Id %#x\n", first_bdf);
return 0;
}
last_bdf = range->end.header.id;
if ( (last_bdf >= ivrs_bdf_entries) || (last_bdf <= first_bdf) )
{
- AMD_IOMMU_DEBUG("IVHD Error: "
- "Invalid Range: Last Dev_Id %#x\n", last_bdf);
+ AMD_IOMMU_ERROR("IVHD: invalid range: Last Dev_Id %#x\n", last_bdf);
return 0;
}
dev_length = sizeof(*alias);
if ( header_length < (block_length + dev_length) )
{
- AMD_IOMMU_DEBUG("IVHD Error: Invalid Device_Entry Length!\n");
+ AMD_IOMMU_ERROR("IVHD: invalid Device_Entry length\n");
return 0;
}
bdf = alias->header.id;
if ( bdf >= ivrs_bdf_entries )
{
- AMD_IOMMU_DEBUG("IVHD Error: Invalid Device_Entry Dev_Id %#x\n", bdf);
+ AMD_IOMMU_ERROR("IVHD: invalid Device_Entry Dev_Id %#x\n", bdf);
return 0;
}
alias_id = alias->used_id;
if ( alias_id >= ivrs_bdf_entries )
{
- AMD_IOMMU_DEBUG("IVHD Error: Invalid Alias Dev_Id %#x\n", alias_id);
+ AMD_IOMMU_ERROR("IVHD: invalid Alias Dev_Id %#x\n", alias_id);
return 0;
}
dev_length = sizeof(*range);
if ( header_length < (block_length + dev_length) )
{
- AMD_IOMMU_DEBUG("IVHD Error: Invalid Device_Entry Length!\n");
+ AMD_IOMMU_ERROR("IVHD: invalid Device_Entry length\n");
return 0;
}
if ( range->end.header.type != ACPI_IVRS_TYPE_END )
{
- AMD_IOMMU_DEBUG("IVHD Error: "
- "Invalid Range: End_Type %#x\n",
+ AMD_IOMMU_ERROR("IVHD: invalid range: End_Type %#x\n",
range->end.header.type);
return 0;
}
first_bdf = range->alias.header.id;
if ( first_bdf >= ivrs_bdf_entries )
{
- AMD_IOMMU_DEBUG("IVHD Error: "
- "Invalid Range: First Dev_Id %#x\n", first_bdf);
+ AMD_IOMMU_ERROR("IVHD: invalid range: First Dev_Id %#x\n", first_bdf);
return 0;
}
last_bdf = range->end.header.id;
if ( last_bdf >= ivrs_bdf_entries || last_bdf <= first_bdf )
{
- AMD_IOMMU_DEBUG(
- "IVHD Error: Invalid Range: Last Dev_Id %#x\n", last_bdf);
+ AMD_IOMMU_ERROR("IVHD: invalid range: Last Dev_Id %#x\n", last_bdf);
return 0;
}
dev_length = sizeof(*ext);
if ( header_length < (block_length + dev_length) )
{
- AMD_IOMMU_DEBUG("IVHD Error: Invalid Device_Entry Length!\n");
+ AMD_IOMMU_ERROR("IVHD: invalid Device_Entry length\n");
return 0;
}
bdf = ext->header.id;
if ( bdf >= ivrs_bdf_entries )
{
- AMD_IOMMU_DEBUG("IVHD Error: Invalid Device_Entry Dev_Id %#x\n", bdf);
+ AMD_IOMMU_ERROR("IVHD: invalid Device_Entry Dev_Id %#x\n", bdf);
return 0;
}
dev_length = sizeof(*range);
if ( header_length < (block_length + dev_length) )
{
- AMD_IOMMU_DEBUG("IVHD Error: Invalid Device_Entry Length!\n");
+ AMD_IOMMU_ERROR("IVHD: invalid Device_Entry length\n");
return 0;
}
if ( range->end.header.type != ACPI_IVRS_TYPE_END )
{
- AMD_IOMMU_DEBUG("IVHD Error: "
- "Invalid Range: End_Type %#x\n",
+ AMD_IOMMU_ERROR("IVHD: invalid range: End_Type %#x\n",
range->end.header.type);
return 0;
}
first_bdf = range->extended.header.id;
if ( first_bdf >= ivrs_bdf_entries )
{
- AMD_IOMMU_DEBUG("IVHD Error: "
- "Invalid Range: First Dev_Id %#x\n", first_bdf);
+ AMD_IOMMU_ERROR("IVHD: invalid range: First Dev_Id %#x\n", first_bdf);
return 0;
}
last_bdf = range->end.header.id;
if ( (last_bdf >= ivrs_bdf_entries) || (last_bdf <= first_bdf) )
{
- AMD_IOMMU_DEBUG("IVHD Error: "
- "Invalid Range: Last Dev_Id %#x\n", last_bdf);
+ AMD_IOMMU_ERROR("IVHD: invalid range: Last Dev_Id %#x\n", last_bdf);
return 0;
}
dev_length = sizeof(*special);
if ( header_length < (block_length + dev_length) )
{
- AMD_IOMMU_DEBUG("IVHD Error: Invalid Device_Entry Length!\n");
+ AMD_IOMMU_ERROR("IVHD: invalid Device_Entry length\n");
return 0;
}
bdf = special->used_id;
if ( bdf >= ivrs_bdf_entries )
{
- AMD_IOMMU_DEBUG("IVHD Error: Invalid Device_Entry Dev_Id %#x\n", bdf);
+ AMD_IOMMU_ERROR("IVHD: invalid Device_Entry Dev_Id %#x\n", bdf);
return 0;
}
{
if ( ioapic_sbdf[idx].bdf == bdf &&
ioapic_sbdf[idx].seg == seg )
- AMD_IOMMU_DEBUG("IVHD Warning: Duplicate IO-APIC %#x entries\n",
+ AMD_IOMMU_WARN("IVHD: duplicate IO-APIC %#x entries\n",
special->handle);
else
{
- printk(XENLOG_ERR "IVHD Error: Conflicting IO-APIC %#x entries\n",
- special->handle);
+ AMD_IOMMU_ERROR("IVHD: conflicting IO-APIC %#x entries\n",
+ special->handle);
if ( amd_iommu_perdev_intremap )
return 0;
}
if ( ivhd_block->header.length < hdr_size )
{
- AMD_IOMMU_DEBUG("IVHD Error: Invalid Block Length!\n");
+ AMD_IOMMU_ERROR("IVHD: invalid block length\n");
return -ENODEV;
}
ivhd_block->capability_offset);
if ( !iommu )
{
- AMD_IOMMU_DEBUG("IVHD Error: No IOMMU for Dev_Id %#x Cap %#x\n",
+ AMD_IOMMU_ERROR("IVHD: no IOMMU for Dev_Id %#x Cap %#x\n",
ivhd_block->header.device_id,
ivhd_block->capability_offset);
return -ENODEV;
ivhd_block->header.length, block_length, iommu);
break;
default:
- AMD_IOMMU_DEBUG("IVHD Error: Invalid Device Type!\n");
+ AMD_IOMMU_WARN("IVHD: unknown device type %#x\n",
+ ivhd_device->header.type);
dev_length = 0;
break;
}
if ( table->length < (length + ivrs_block->length) )
{
- AMD_IOMMU_DEBUG("IVRS Error: "
- "Table Length Exceeded: %#x -> %#lx\n",
+ AMD_IOMMU_ERROR("IVRS: table length exceeded: %#x -> %#lx\n",
table->length,
(length + ivrs_block->length));
return -ENODEV;
if ( ivhd_block->header.length < hdr_size )
{
- AMD_IOMMU_DEBUG("IVHD Error: Invalid Block Length!\n");
+ AMD_IOMMU_ERROR("IVHD: invalid block length\n");
return -ENODEV;
}
dev_length = sizeof(ivhd_device->special);
break;
default:
- AMD_IOMMU_DEBUG("IVHD Error: Invalid Device Type!\n");
+ AMD_IOMMU_WARN("IVHD: unknown device type %#x\n",
+ ivhd_device->header.type);
dev_length = 0;
break;
}
checksum = acpi_tb_checksum(ACPI_CAST_PTR(uint8_t, table), table->length);
if ( checksum )
{
- AMD_IOMMU_DEBUG("IVRS Error: Invalid Checksum %#x\n", checksum);
+ AMD_IOMMU_ERROR("IVRS: invalid checksum %#x\n", checksum);
return -ENODEV;
}
if ( table->length < (length + ivrs_block->length) )
{
- AMD_IOMMU_DEBUG("IVRS Error: "
- "Table Length Exceeded: %#x -> %#lx\n",
+ AMD_IOMMU_ERROR("IVRS: table length exceeded: %#x -> %#lx\n",
table->length,
(length + ivrs_block->length));
return -ENODEV;