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

RE: [XEN RFC PATCH 04/40] xen/arm: return default DMA bit width when platform is not set


  • To: Julien Grall <julien@xxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>, "sstabellini@xxxxxxxxxx" <sstabellini@xxxxxxxxxx>
  • From: Wei Chen <Wei.Chen@xxxxxxx>
  • Date: Fri, 20 Aug 2021 11:58:09 +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-SenderADCheck; bh=lzmTUGknngJL0AS6h5LKJCtkJcSp2wujxJW8uX89Ocs=; b=Uxv0zn+44HDTJznBbvsGEyFJHju6V3cy4IDnQ27POkGihOLA+oWhd+ojV29ZSl1U7A4V8CePuB+9CYMSmaP5m0zg2WFBbPuHyTVoX/0DijvjmxiQGfFJbAVfuDch39FxW6delVT49+yy8/ZlHIu6TwZ9E5qRC79qGlUmIlKuYWLAF+/QV7E4R5jqr3grvvh3+3WIo8+dLYZjhTdReDiluq/diT64q1Oi3ANw5XVzft9T6Gfb084a8Q4tA3HYH3JRZwnar7WxiCw0o2uCNRLsOLRIlfvs889DlpdgaSGwhqFOkeSEKkfrNyXKxcbZWCjraIr/7gWdlED51U+p2aVHpA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=eAFqxkA7O+WYJUFr9KKDQepWqwQGLoxy7i8dmLRLzCtFbTykPMrSeufx6jKB436s1JE9PgBdJmVe7wUsdUyNdv+78t6rfCePJdMYf6ggF9DY/mFDf0KzUyxjpSSu+QjC4KA4tjBUTvd+GvLI55v3iEFMDxfGMwZlLNVB7rHgcLMTMpUAIgHo6wtVLVmn4AGbnDLQdsBKMeIotXcO05etvu7jfwRambBZyO1FMwMfCxR1VX61c3oaV2qbStSuooc0FqceuGmG6VJ+bKKVI93E4+LjlMGQiG1vmfWSdD9c3K1FbeUESkM648ji4+w6RrLpyYJpy/pFjoXtBT8jKuotDg==
  • Authentication-results-original: xen.org; dkim=none (message not signed) header.d=none;xen.org; dmarc=none action=none header.from=arm.com;
  • Cc: Bertrand Marquis <Bertrand.Marquis@xxxxxxx>
  • Delivery-date: Fri, 20 Aug 2021 11:58:24 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Nodisclaimer: true
  • Original-authentication-results: xen.org; dkim=none (message not signed) header.d=none;xen.org; dmarc=none action=none header.from=arm.com;
  • Thread-index: AQHXjpsgsRofIZVQlECQrMelX8Mpkqt63vUAgADFfsCAAHazAIAACk/ggAAneICAAAox8A==
  • Thread-topic: [XEN RFC PATCH 04/40] xen/arm: return default DMA bit width when platform is not set

Hi Julien,

> -----Original Message-----
> From: Julien Grall <julien@xxxxxxx>
> Sent: 2021年8月20日 19:18
> To: Wei Chen <Wei.Chen@xxxxxxx>; xen-devel@xxxxxxxxxxxxxxxxxxxx;
> sstabellini@xxxxxxxxxx
> Cc: Bertrand Marquis <Bertrand.Marquis@xxxxxxx>
> Subject: Re: [XEN RFC PATCH 04/40] xen/arm: return default DMA bit width
> when platform is not set
> 
> On 20/08/2021 10:37, Wei Chen wrote:
> > Hi Julien,
> 
> Hi Wei,
> 
> >> -----Original Message-----
> >> From: Julien Grall <julien@xxxxxxx>
> >> Sent: 2021年8月20日 16:20
> >> To: Wei Chen <Wei.Chen@xxxxxxx>; xen-devel@xxxxxxxxxxxxxxxxxxxx;
> >> sstabellini@xxxxxxxxxx; jbeulich@xxxxxxxx
> >> Cc: Bertrand Marquis <Bertrand.Marquis@xxxxxxx>
> >> Subject: Re: [XEN RFC PATCH 04/40] xen/arm: return default DMA bit
> width
> >> when platform is not set
> >>
> >>
> >>
> >> On 20/08/2021 03:04, Wei Chen wrote:
> >>> Hi Julien,
> >>
> >> Hi Wei,
> >>
> >>>> -----Original Message-----
> >>>> From: Julien Grall <julien@xxxxxxx>
> >>>> Sent: 2021年8月19日 21:28
> >>>> To: Wei Chen <Wei.Chen@xxxxxxx>; xen-devel@xxxxxxxxxxxxxxxxxxxx;
> >>>> sstabellini@xxxxxxxxxx; jbeulich@xxxxxxxx
> >>>> Cc: Bertrand Marquis <Bertrand.Marquis@xxxxxxx>
> >>>> Subject: Re: [XEN RFC PATCH 04/40] xen/arm: return default DMA bit
> >> width
> >>>> when platform is not set
> >>>>
> >>>> Hi,
> >>>>
> >>>> On 11/08/2021 11:23, Wei Chen wrote:
> >>>>> From: Hongda Deng <Hongda.Deng@xxxxxxx>
> >>>>>
> >>>>> In current code, arch_get_dma_bitsize will return 32 when platorm
> >>>>> or platform->dma_bitsize is not set. It's not resonable, for Arm,
> >>>>
> >>>> s/resonable/reasonable/
> >>>>
> >>>
> >>> Ok
> >>>
> >>>>> we don't require to reserve DMA memory. So we set dma_bitsize always
> >>>>> be 0. In NO-NUMA system, arch_get_dma_bitsize will not be invoked,
> >>>>> so dma_bitsize will not be overrided by this function.
> >>>>
> >>>> arch_get_dma_bitsize() is also used to allocate dom0 memory. We need
> to
> >>>> be able to allocate some DMA-able memory that can be used by every
> >> devices.
> >>>>
> >>>>> But in NUMA
> >>>>> system, once the online nodes are greater than 1, this function will
> >>>>> be invoked. The dma_bitsize will be limited to 32. That means, only
> >>>>> first 4GB memory can be used for DMA. But that's against our
> hardware
> >>>>> design. We don't have that kind of restriction on hardware.
> >>>>
> >>>> What do you mean by "hardware design"? Are you referring to the
> server
> >>>> you boot Xen on?
> >>>>
> >>>
> >>> Yes. I will change it to some neutral words. something like:
> >>> "But that could not reflect some hardware's real DMA ability. They may
> >> not
> >>> have kind of restriction on hardware." ?
> >>
> >> The thing is DMA ability is not about the platform itself. It is more
> >> about the devices (this could just be a PCI card you just plugged).
> What
> >> you seem to suggest is no-one will ever plug such card on your platform.
> >> Is that correct?
> >>
> >
> > OK, I understand now. Let's keep 32-bit as default value, but even in
> this
> > case, how about DMA-16 devices? Although these devices are very rare,
> they
> > still exist : )
> 
> I haven't heard anyone reporting issues with them on Xen on Arm. So I
> assume that either it works or no-one is using them.
> 
> My main point is we need to care about the common use case. 32-bit DMA
> device is still a thing and caused trouble to some of our users (e.g. NXP).
> 
> If tomorrow, someone report issue with 16-bit DMA device, then we can
> consider our options how to handle.
> 
> >>>> So I would explore to remove the NUMA check for drop the DMA zone.
> FAOD,
> >>>> both suggestion are for Arm only. For x86, they need to be kept.
> >>>>
> >>>
> >>> Without introducing new flag, such as lowmem_for_dma, it's a little
> >>> hard to skip the numa node check. Unless we crudely add #ifdef ARCH to
> >>> common code, which is not what we want to see ...
> >>>         if ( !dma_bitsize && (num_online_nodes() > 1) )
> >>>             dma_bitsize = arch_get_dma_bitsize();
> >>
> >> ... Why do you think we need this check on Arm when NUMA is enabled?
> >>
> >
> > I didn't think Arm needs, what I said is introduce a flag to disable
> > this check for Arm or other Architectures that they don't need this
> check.
> >
> >> We can discuss how to remove it once this is answered.
> >>
> >
> > I think we can start to discuss it.
> 
> How about replacing the second part of the check with a new helper
> arch_have_default_dma_zone() (or a different name)?

This seems like a method worth trying, I will try to follow this way
to compose next version.

> 
> Cheers,
> 
> --
> Julien Grall

 


Rackspace

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