From: Wei Wang <wei.wang2@amd.com>
To: Jan Beulich <JBeulich@suse.com>,
"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
Sander Eikelenboom <linux@eikelenboom.it>
Subject: [PATCH] amd iommu: Dump flags of IO page faults
Date: Wed, 5 Sep 2012 16:42:42 +0200 [thread overview]
Message-ID: <504764E2.4000809@amd.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 216 bytes --]
Hi Jan,
Attached patch dumps io page fault flags. The flags show the reason of
the fault and tell us if this is an unmapped interrupt fault or a DMA fault.
Thanks,
Wei
signed-off-by: Wei Wang <wei.wang2@amd.com>
[-- Attachment #2: iommu_flags.patch --]
[-- Type: text/x-patch, Size: 2020 bytes --]
diff -r 4746414def65 xen/drivers/passthrough/amd/iommu_init.c
--- a/xen/drivers/passthrough/amd/iommu_init.c Mon Sep 03 09:40:38 2012 +0200
+++ b/xen/drivers/passthrough/amd/iommu_init.c Wed Sep 05 16:35:23 2012 +0200
@@ -564,7 +564,7 @@ static hw_irq_controller iommu_msi_type
static void parse_event_log_entry(struct amd_iommu *iommu, u32 entry[])
{
- u16 domain_id, device_id, bdf, cword;
+ u16 domain_id, device_id, bdf, cword, flags;
u32 code;
u64 *addr;
int count = 0;
@@ -609,11 +609,14 @@ static void parse_event_log_entry(struct
domain_id = get_field_from_reg_u32(entry[1],
IOMMU_EVENT_DOMAIN_ID_MASK,
IOMMU_EVENT_DOMAIN_ID_SHIFT);
+ flags = get_field_from_reg_u32(entry[1],
+ IOMMU_EVENT_FLAGS_MASK,
+ IOMMU_EVENT_FLAGS_SHIFT);
addr= (u64*) (entry + 2);
printk(XENLOG_ERR "AMD-Vi: "
"%s: domain = %d, device id = 0x%04x, "
- "fault address = 0x%"PRIx64"\n",
- event_str[code-1], domain_id, device_id, *addr);
+ "fault address = 0x%"PRIx64", flags = 0x%03x\n",
+ event_str[code-1], domain_id, device_id, *addr, flags);
/* Tell the device to stop DMAing; we can't rely on the guest to
* control it for us. */
diff -r 4746414def65 xen/include/asm-x86/hvm/svm/amd-iommu-defs.h
--- a/xen/include/asm-x86/hvm/svm/amd-iommu-defs.h Mon Sep 03 09:40:38 2012 +0200
+++ b/xen/include/asm-x86/hvm/svm/amd-iommu-defs.h Wed Sep 05 16:35:23 2012 +0200
@@ -283,6 +283,8 @@
#define IOMMU_EVENT_DOMAIN_ID_SHIFT 0
#define IOMMU_EVENT_DEVICE_ID_MASK 0x0000FFFF
#define IOMMU_EVENT_DEVICE_ID_SHIFT 0
+#define IOMMU_EVENT_FLAGS_SHIFT 16
+#define IOMMU_EVENT_FLAGS_MASK 0x0FFF0000
/* PPR Log */
#define IOMMU_PPR_LOG_ENTRY_SIZE 16
[-- Attachment #3: Type: text/plain, Size: 126 bytes --]
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel
next reply other threads:[~2012-09-05 14:42 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-09-05 14:42 Wei Wang [this message]
2012-09-05 22:59 ` [PATCH] amd iommu: Dump flags of IO page faults Sander Eikelenboom
2012-09-06 13:32 ` Wei Wang
2012-09-06 13:50 ` Sander Eikelenboom
2012-09-06 15:03 ` Wei Wang
2012-09-06 15:08 ` Sander Eikelenboom
2012-09-07 7:32 ` Sander Eikelenboom
2012-09-07 8:54 ` Wei Wang
2012-09-07 10:01 ` Sander Eikelenboom
2012-09-07 11:29 ` Jan Beulich
2012-09-07 20:51 ` Konrad Rzeszutek Wilk
2012-09-24 8:38 ` Sander Eikelenboom
2012-09-24 12:24 ` Wei Wang
[not found] ` <74647167 <506050F0.7020703@amd.com>
[not found] ` <74647167<506050F0.7020703@amd.com>
2012-09-24 12:27 ` Sander Eikelenboom
2012-09-24 21:08 ` Sander Eikelenboom
2012-10-01 15:02 ` Sander Eikelenboom
2012-09-07 9:17 ` [PATCH] amd iommu: Dump flags of IO page faults (off topic - pci devices) Andrew Cooper
2012-09-07 9:53 ` [PATCH] amd iommu: Dump flags of IO page faults Jan Beulich
2012-09-07 10:00 ` Sander Eikelenboom
2012-09-07 10:06 ` Jan Beulich
2012-09-07 10:15 ` Sander Eikelenboom
2012-09-07 11:17 ` Jan Beulich
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=504764E2.4000809@amd.com \
--to=wei.wang2@amd.com \
--cc=JBeulich@suse.com \
--cc=linux@eikelenboom.it \
--cc=xen-devel@lists.xensource.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).