All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stefano Stabellini <sstabellini@kernel.org>
To: Christoph Hellwig <hch@lst.de>
Cc: Stefano Stabellini <sstabellini@kernel.org>,
	 Rahul Singh <Rahul.Singh@arm.com>,
	 xen-devel <xen-devel@lists.xenproject.org>,
	 Bertrand Marquis <Bertrand.Marquis@arm.com>,
	Julien Grall <julien@xen.org>,  Jan Beulich <jbeulich@suse.com>,
	"jgross@suse.com" <jgross@suse.com>,
	 "boris.ostrovsky@oracle.com" <boris.ostrovsky@oracle.com>
Subject: Re: xen-swiotlb issue when NVMe driver is enabled in Dom0 on ARM
Date: Fri, 15 Apr 2022 10:40:52 -0700 (PDT)	[thread overview]
Message-ID: <alpine.DEB.2.22.394.2204150917390.915916@ubuntu-linux-20-04-desktop> (raw)
In-Reply-To: <20220415063705.GA24262@lst.de>

On Fri, 15 Apr 2022, Christoph Hellwig wrote:
> On Thu, Apr 14, 2022 at 01:39:23PM -0700, Stefano Stabellini wrote:
> > OK, now we know that the code path with Xen is correct and it is the
> > same code path taken (dma_alloc_direct) as when !CONFIG_XEN and !SMMU.
> > That is how it should be.
> > 
> > I cannot explain why dma_alloc_direct() would fail when called from
> > xen_swiotlb_alloc_coherent(), but it would succeed when called from
> > dma_alloc_attrs() without Xen.
> > 
> > I am not aware of any restrictions that xen or swiotlb-xen would
> > introduce in that regard. Unless you are just running out of memory
> > because dom0_mem too low.
> 
> The crash is deep down in the page allocator.  Even if memory was low
> it should no crash.  So there is some odd interaction between Xen
> and the page allocator going on.  I think nvme and dma-direct really
> are only the messenger here.


I cannot think of anything but if that is the case I guess it is more
likely related to reserved-memory not properly advertised or ACPI tables
not properly populated.


Rahul,

What happens if you boot Linux on Xen with swiotlb-xen disabled?


diff --git a/arch/arm64/mm/dma-mapping.c b/arch/arm64/mm/dma-mapping.c
index 93e87b287556..26d9da58f2c6 100644
--- a/arch/arm64/mm/dma-mapping.c
+++ b/arch/arm64/mm/dma-mapping.c
@@ -51,9 +51,4 @@ void arch_setup_dma_ops(struct device *dev, u64 dma_base, u64 size,
 	dev->dma_coherent = coherent;
 	if (iommu)
 		iommu_setup_dma_ops(dev, dma_base, size);
-
-#ifdef CONFIG_XEN
-	if (xen_initial_domain())
-		dev->dma_ops = &xen_swiotlb_dma_ops;
-#endif
 }
 

I thought Bertrand said that "it works" but I can't imagine how
swiotlb-xen could be the cause of the Linux stacktrace now.


  reply	other threads:[~2022-04-15 17:41 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-13 13:04 xen-swiotlb issue when NVMe driver is enabled in Dom0 on ARM Rahul Singh
2022-04-13 21:24 ` Stefano Stabellini
2022-04-14 17:44   ` Rahul Singh
2022-04-14 20:39     ` Stefano Stabellini
2022-04-15  6:37       ` Christoph Hellwig
2022-04-15 17:40         ` Stefano Stabellini [this message]
2022-04-17  9:42           ` Rahul Singh
2022-04-18 20:04             ` Stefano Stabellini
2022-04-19 13:36               ` Rahul Singh
2022-04-20  2:36                 ` Stefano Stabellini
2022-04-20 11:05                   ` Rahul Singh
2022-04-20 22:46                     ` Stefano Stabellini
2022-04-21 17:45                       ` Rahul Singh
2022-04-21 22:01                         ` Stefano Stabellini
2022-04-22  5:04                           ` Christoph Hellwig
2022-04-22 11:34                             ` Rahul Singh
2022-04-22 12:07                               ` Juergen Gross
2022-04-22 20:29                                 ` Stefano Stabellini
2022-04-23  5:19                                   ` Christoph Hellwig

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=alpine.DEB.2.22.394.2204150917390.915916@ubuntu-linux-20-04-desktop \
    --to=sstabellini@kernel.org \
    --cc=Bertrand.Marquis@arm.com \
    --cc=Rahul.Singh@arm.com \
    --cc=boris.ostrovsky@oracle.com \
    --cc=hch@lst.de \
    --cc=jbeulich@suse.com \
    --cc=jgross@suse.com \
    --cc=julien@xen.org \
    --cc=xen-devel@lists.xenproject.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.