[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: xen-swiotlb issue when NVMe driver is enabled in Dom0 on ARM


  • To: Stefano Stabellini <sstabellini@xxxxxxxxxx>
  • From: Rahul Singh <Rahul.Singh@xxxxxxx>
  • Date: Sun, 17 Apr 2022 09:42:17 +0000
  • Accept-language: en-US
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=RKm1FiP+IHOUtOp2uEAHl66xiZrEvQsYWNPH0+ljHZg=; b=mT4dkx6/o+iz5ysTx7cZICqmDdN7hC+tiUPI8/cKBSBiDfnprwcQyFBKHFrhapj9uUgwWNzEg5aNKIMvRoJu9STLj8r3pntjoXzxVLBuu9M0IvgNT43HQwYybG7gDYnPGLLQ9J6vcOrSz2iGZRMvWHMIG+lhJSnIZkkbNqC61r5HBZEHd00eJI0ijf7n5YXsuE52YDynxPqZkBolVXeL5YE/fILIORLeI0TifZGKIY0SQrE2vZz0WAB0h1/gX6+uEUsCO6UPCmDcA4nK7jBJdxGNYEzGin1a7ojB6lmRt7RC8NlQ8nhPg9mcPIC5IM41GfoFqBEfCwT8XNfEWi/TKw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=hbDsUz0hnlrKfNMWejCXcm2AOUjMpPElf3xBLbogyxt3EeHpS6UNPF5+UgMoyVTOtILaa0rWP0D+/kbgDeYpoVclLaIXded7fFJ79VlqWkiV4EfnpDcCbgaFO/Fj4VwcCCFjKdaeJDQAZGUNQrIEfXpSdWHQsO5H/snsG9nluJNrkWgCyCrRgENKirzxee5yCYYeCyBEw/Z2f8VSSJaCOT9Mp1tAcc39/471DqoRhycGkaFAZOtY4LvY96v1YUxKuNMqJw60A5AWnw11SJQzdH3JbgUh8yVKDilowM3BKu64ae3XUYbbZE8txgcoT5SYtwLc7grGzvQE7Bje6UeFiA==
  • Authentication-results-original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com;
  • Cc: Christoph Hellwig <hch@xxxxxx>, xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Bertrand Marquis <Bertrand.Marquis@xxxxxxx>, Julien Grall <julien@xxxxxxx>, Jan Beulich <jbeulich@xxxxxxxx>, "jgross@xxxxxxxx" <jgross@xxxxxxxx>, "boris.ostrovsky@xxxxxxxxxx" <boris.ostrovsky@xxxxxxxxxx>
  • Delivery-date: Sun, 17 Apr 2022 09:43:04 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Nodisclaimer: true
  • Original-authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com;
  • Thread-index: AQHYTzcUggEUWxM2006iot1qnYxlIKzuW0oAgAFU1ACAADDmgIAApv+AgAC5dQCAAp7ugA==
  • Thread-topic: xen-swiotlb issue when NVMe driver is enabled in Dom0 on ARM

Hi Stefano,

> On 15 Apr 2022, at 6:40 pm, Stefano Stabellini <sstabellini@xxxxxxxxxx> wrote:
> 
> 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.

I am not sure if it is true as we are able to boot with the same reserved 
memory or
the same ACPI table populated if we boot without swiotlb-xen dma ops.

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

Linux boots fine without any issue if we disable swiotlb-xen as mentioned below.
> 
> 
> 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
> }
> 
> 

Regards,
Rahul




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.