From: Joerg Roedel <joro@8bytes.org>
To: Lennert Buytenhek <buytenh@wantstofly.org>
Cc: iommu@lists.linux-foundation.org
Subject: Re: [PATCH,RFC] iommu/amd: Use report_iommu_fault()
Date: Mon, 26 Jul 2021 13:54:49 +0200 [thread overview]
Message-ID: <YP6iiR8wuszflhnN@8bytes.org> (raw)
In-Reply-To: <YPVL41ZO8Ih8WrKa@wantstofly.org>
Hi Lennert,
On Mon, Jul 19, 2021 at 12:54:43PM +0300, Lennert Buytenhek wrote:
> + if (dev_data) {
> + int report_flags;
> +
> + /*
> + * AMD I/O Virtualization Technology (IOMMU) Specification,
> + * revision 3.00, section 2.5.3 ("IO_PAGE_FAULT Event") says
> + * that the RW ("read-write") bit is only valid if the I/O
> + * page fault was caused by a memory transaction request
> + * referencing a page that was marked present.
> + */
> + report_flags = 0;
> + if ((flags & (EVENT_FLAG_TR | EVENT_FLAG_PR | EVENT_FLAG_I)) ==
> + EVENT_FLAG_PR) {
> + if (flags & EVENT_FLAG_RW)
> + report_flags |= IOMMU_FAULT_WRITE;
> + else
> + report_flags |= IOMMU_FAULT_READ;
> + }
> +
> + if (!report_iommu_fault(&dev_data->domain->domain,
> + &pdev->dev, address, report_flags))
> + goto out;
> + }
I'd like to limit calling report_iommu_fault() to dma-faults and leave
IRQ remapping faults unreported. The IOMMU layer does not really care a
lot about IRQs and a potential domain handler will also not be prepared
to handler IRQ specific faults (there is no generic way to detect them).
Regards,
Joerg
_______________________________________________
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu
next prev parent reply other threads:[~2021-07-26 11:54 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-07-19 9:54 [PATCH,RFC] iommu/amd: Use report_iommu_fault() Lennert Buytenhek
2021-07-22 19:26 ` Suthikulpanit, Suravee via iommu
2021-07-22 21:59 ` Lennert Buytenhek
2021-07-26 11:54 ` Joerg Roedel [this message]
2021-07-26 16:26 ` Lennert Buytenhek
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=YP6iiR8wuszflhnN@8bytes.org \
--to=joro@8bytes.org \
--cc=buytenh@wantstofly.org \
--cc=iommu@lists.linux-foundation.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.