Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 945b4ac4 authored by Joerg Roedel's avatar Joerg Roedel
Browse files

x86/amd-iommu: Dump illegal command on ILLEGAL_COMMAND_ERROR



This patch adds code to dump the command which caused an
ILLEGAL_COMMAND_ERROR raised by the IOMMU hardware.

Signed-off-by: default avatarJoerg Roedel <joerg.roedel@amd.com>
parent e3e59876
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -147,6 +147,15 @@ static void dump_dte_entry(u16 devid)
			amd_iommu_dev_table[devid].data[i]);
}

static void dump_command(unsigned long phys_addr)
{
	struct iommu_cmd *cmd = phys_to_virt(phys_addr);
	int i;

	for (i = 0; i < 4; ++i)
		pr_err("AMD-Vi: CMD[%d]: %08x\n", i, cmd->data[i]);
}

static void iommu_print_event(void *__evt)
{
	u32 *event = __evt;
@@ -186,6 +195,7 @@ static void iommu_print_event(void *__evt)
		break;
	case EVENT_TYPE_ILL_CMD:
		printk("ILLEGAL_COMMAND_ERROR address=0x%016llx]\n", address);
		dump_command(address);
		break;
	case EVENT_TYPE_CMD_HARD_ERR:
		printk("COMMAND_HARDWARE_ERROR address=0x%016llx "