All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mathias Nyman <mathias.nyman@linux.intel.com>
To: "Jörg Rödel" <jroedel@suse.de>,
	"Mathias Nyman" <mathias.nyman@intel.com>
Cc: linux-usb@vger.kernel.org, Robin Murphy <robin.murphy@arm.com>,
	Jon Grimm <jon.grimm@amd.com>,
	"Suthikulpanit, Suravee" <suravee.suthikulpanit@amd.com>
Subject: Re: DMA Faults with XHCI driver
Date: Mon, 27 Jun 2022 13:52:44 +0300	[thread overview]
Message-ID: <8917c751-76dc-98d3-83ac-652aa2249b7d@linux.intel.com> (raw)
In-Reply-To: <YrXMY0Nd0Yn6XDSN@suse.de>

Hi

On 24.6.2022 17.38, Jörg Rödel wrote:
> Hi Mathias,
> 
> here is a report about something strange happening on my system after a
> recent IOMMU change. I am starting to see this message at boot:
> 
> 	xhci_hcd 0000:02:00.0: AMD-Vi: Event logged [IO_PAGE_FAULT domain=0x000f address=0xff00ffffffefe000 flags=0x0000]
> 
> It means that the XHCI device tried a DMA access at address
> 0xff00ffffffefe000, which was not mapped in the IOMMU page table.
> 
> Devices attached to that XHCI controller will not work after that
> message.
> 
> There is a related change in the IOMMU code which uncovered this, the
> change basically lets the IOMMU dma-allocator not allocate below 4GB by
> default, but use the whole space covered by the DMA mask.
> 
> To better track this down I limited the DMA-space to 48 bits, and the
> message still shows up.
> 
> I think this might be a problem in the XHCI driver, e.g. it might mangle
> an allocated DMA address somehow if it is bigger than 32 bit.
> 
> The device behind 0000:02:00.0 is a
> 
> 	02:00.0 USB controller: Advanced Micro Devices, Inc. [AMD] Device 43d0 (rev 01)
> 
> Please let me know what I can do to help tracking this down.

Thanks for reporting this.

Can you boot with xhci dynamic debug and tracing enabled? could help pinpoint
when the controller is trying to access the unmapped DMA address.

Add to kernel cmdline:
xhci_hcd.dyndbg=+p trace_event=xhci-hcd trace_buf_size=80M
<boot>
mount -t debugfs none /sys/kernel/debug
Send output of dmesg
Send content of /sys/kernel/debug/tracing/trace

Also if you could dump the content of following registers:
cat /sys/kernel/debug/usb/xhci/<pci address>/reg-op
cat /sys/kernel/debug/usb/xhci/<pci address>/reg-runtime

xhci driver writes dma addresses it allocated for the host into
some of those registers

Thanks
Mathias

  reply	other threads:[~2022-06-27 10:51 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-24 14:38 DMA Faults with XHCI driver Jörg Rödel
2022-06-27 10:52 ` Mathias Nyman [this message]
2022-06-28  7:51   ` Jörg Rödel
2022-06-29 14:39     ` Mathias Nyman
2022-07-04 15:54       ` Jörg Rödel

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=8917c751-76dc-98d3-83ac-652aa2249b7d@linux.intel.com \
    --to=mathias.nyman@linux.intel.com \
    --cc=jon.grimm@amd.com \
    --cc=jroedel@suse.de \
    --cc=linux-usb@vger.kernel.org \
    --cc=mathias.nyman@intel.com \
    --cc=robin.murphy@arm.com \
    --cc=suravee.suthikulpanit@amd.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 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.