aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorJoerg Roedel <joerg.roedel@amd.com>2009-05-20 09:41:28 -0400
committerJoerg Roedel <joerg.roedel@amd.com>2009-05-28 11:52:04 -0400
commit42a698f40a0946f5517308411b9e003ae031414d (patch)
tree2c765a50aff4ea951e13ea754867351d2e7eba28 /arch
parent9c72041f719e2864d4208a89341c36b316dbf893 (diff)
amd-iommu: print ivhd information to dmesg when requested
Add information about devices belonging to an IOMMU as described in the IVRS ACPI table to the kernel log if amd_iommu_dump was specified on the kernel command line. Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
Diffstat (limited to 'arch')
-rw-r--r--arch/x86/kernel/amd_iommu_init.c73
1 files changed, 73 insertions, 0 deletions
diff --git a/arch/x86/kernel/amd_iommu_init.c b/arch/x86/kernel/amd_iommu_init.c
index 28165902ae25..fe3e6453cbf7 100644
--- a/arch/x86/kernel/amd_iommu_init.c
+++ b/arch/x86/kernel/amd_iommu_init.c
@@ -598,32 +598,83 @@ static void __init init_iommu_from_acpi(struct amd_iommu *iommu,
598 p += sizeof(struct ivhd_header); 598 p += sizeof(struct ivhd_header);
599 end += h->length; 599 end += h->length;
600 600
601
601 while (p < end) { 602 while (p < end) {
602 e = (struct ivhd_entry *)p; 603 e = (struct ivhd_entry *)p;
603 switch (e->type) { 604 switch (e->type) {
604 case IVHD_DEV_ALL: 605 case IVHD_DEV_ALL:
606
607 DUMP_printk(" DEV_ALL\t\t\t first devid: %02x:%02x.%x"
608 " last device %02x:%02x.%x flags: %02x\n",
609 PCI_BUS(iommu->first_device),
610 PCI_SLOT(iommu->first_device),
611 PCI_FUNC(iommu->first_device),
612 PCI_BUS(iommu->last_device),
613 PCI_SLOT(iommu->last_device),
614 PCI_FUNC(iommu->last_device),
615 e->flags);
616
605 for (dev_i = iommu->first_device; 617 for (dev_i = iommu->first_device;
606 dev_i <= iommu->last_device; ++dev_i) 618 dev_i <= iommu->last_device; ++dev_i)
607 set_dev_entry_from_acpi(iommu, dev_i, 619 set_dev_entry_from_acpi(iommu, dev_i,
608 e->flags, 0); 620 e->flags, 0);
609 break; 621 break;
610 case IVHD_DEV_SELECT: 622 case IVHD_DEV_SELECT:
623
624 DUMP_printk(" DEV_SELECT\t\t\t devid: %02x:%02x.%x "
625 "flags: %02x\n",
626 PCI_BUS(e->devid),
627 PCI_SLOT(e->devid),
628 PCI_FUNC(e->devid),
629 e->flags);
630
611 devid = e->devid; 631 devid = e->devid;
612 set_dev_entry_from_acpi(iommu, devid, e->flags, 0); 632 set_dev_entry_from_acpi(iommu, devid, e->flags, 0);
613 break; 633 break;
614 case IVHD_DEV_SELECT_RANGE_START: 634 case IVHD_DEV_SELECT_RANGE_START:
635
636 DUMP_printk(" DEV_SELECT_RANGE_START\t "
637 "devid: %02x:%02x.%x flags: %02x\n",
638 PCI_BUS(e->devid),
639 PCI_SLOT(e->devid),
640 PCI_FUNC(e->devid),
641 e->flags);
642
615 devid_start = e->devid; 643 devid_start = e->devid;
616 flags = e->flags; 644 flags = e->flags;
617 ext_flags = 0; 645 ext_flags = 0;
618 alias = false; 646 alias = false;
619 break; 647 break;
620 case IVHD_DEV_ALIAS: 648 case IVHD_DEV_ALIAS:
649
650 DUMP_printk(" DEV_ALIAS\t\t\t devid: %02x:%02x.%x "
651 "flags: %02x devid_to: %02x:%02x.%x\n",
652 PCI_BUS(e->devid),
653 PCI_SLOT(e->devid),
654 PCI_FUNC(e->devid),
655 e->flags,
656 PCI_BUS(e->ext >> 8),
657 PCI_SLOT(e->ext >> 8),
658 PCI_FUNC(e->ext >> 8));
659
621 devid = e->devid; 660 devid = e->devid;
622 devid_to = e->ext >> 8; 661 devid_to = e->ext >> 8;
623 set_dev_entry_from_acpi(iommu, devid, e->flags, 0); 662 set_dev_entry_from_acpi(iommu, devid, e->flags, 0);
624 amd_iommu_alias_table[devid] = devid_to; 663 amd_iommu_alias_table[devid] = devid_to;
625 break; 664 break;
626 case IVHD_DEV_ALIAS_RANGE: 665 case IVHD_DEV_ALIAS_RANGE:
666
667 DUMP_printk(" DEV_ALIAS_RANGE\t\t "
668 "devid: %02x:%02x.%x flags: %02x "
669 "devid_to: %02x:%02x.%x\n",
670 PCI_BUS(e->devid),
671 PCI_SLOT(e->devid),
672 PCI_FUNC(e->devid),
673 e->flags,
674 PCI_BUS(e->ext >> 8),
675 PCI_SLOT(e->ext >> 8),
676 PCI_FUNC(e->ext >> 8));
677
627 devid_start = e->devid; 678 devid_start = e->devid;
628 flags = e->flags; 679 flags = e->flags;
629 devid_to = e->ext >> 8; 680 devid_to = e->ext >> 8;
@@ -631,17 +682,39 @@ static void __init init_iommu_from_acpi(struct amd_iommu *iommu,
631 alias = true; 682 alias = true;
632 break; 683 break;
633 case IVHD_DEV_EXT_SELECT: 684 case IVHD_DEV_EXT_SELECT:
685
686 DUMP_printk(" DEV_EXT_SELECT\t\t devid: %02x:%02x.%x "
687 "flags: %02x ext: %08x\n",
688 PCI_BUS(e->devid),
689 PCI_SLOT(e->devid),
690 PCI_FUNC(e->devid),
691 e->flags, e->ext);
692
634 devid = e->devid; 693 devid = e->devid;
635 set_dev_entry_from_acpi(iommu, devid, e->flags, 694 set_dev_entry_from_acpi(iommu, devid, e->flags,
636 e->ext); 695 e->ext);
637 break; 696 break;
638 case IVHD_DEV_EXT_SELECT_RANGE: 697 case IVHD_DEV_EXT_SELECT_RANGE:
698
699 DUMP_printk(" DEV_EXT_SELECT_RANGE\t devid: "
700 "%02x:%02x.%x flags: %02x ext: %08x\n",
701 PCI_BUS(e->devid),
702 PCI_SLOT(e->devid),
703 PCI_FUNC(e->devid),
704 e->flags, e->ext);
705
639 devid_start = e->devid; 706 devid_start = e->devid;
640 flags = e->flags; 707 flags = e->flags;
641 ext_flags = e->ext; 708 ext_flags = e->ext;
642 alias = false; 709 alias = false;
643 break; 710 break;
644 case IVHD_DEV_RANGE_END: 711 case IVHD_DEV_RANGE_END:
712
713 DUMP_printk(" DEV_RANGE_END\t\t devid: %02x:%02x.%x\n",
714 PCI_BUS(e->devid),
715 PCI_SLOT(e->devid),
716 PCI_FUNC(e->devid));
717
645 devid = e->devid; 718 devid = e->devid;
646 for (dev_i = devid_start; dev_i <= devid; ++dev_i) { 719 for (dev_i = devid_start; dev_i <= devid; ++dev_i) {
647 if (alias) 720 if (alias)