[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: Wei Chen <wei.chen@xxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Wed, 11 Aug 2021 12:54:18 +0200
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.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=q4i9zPn7wkgsPPfDLAFLhpffoo6NQlQzjC//1V43Y5s=; b=Bj/H7HtJ6vMVk2aS90Ava4rs/RATpvza8mde7OxWIXv1el2bfVZsG2AnEr3q8VA4jI7Ico9uLeJfr9QeCkaHkjiW3HM9eAC9lpzP311IErI8IBlwnFWG4UhktahAubMzGTuGrj/nUL2n7WNAyawexMp04zg5U8CblZxp9CI3EOp5SjOF1keEevHKekRYG2/iUKjmQVVY9u3l6hrizP1AY3KSyqzXg4/GgIn4o9fJSu/mQUxHfjvQt72F/tEr1IF52CLwEk6DPELz1o5a7oeMZCG9tcz2xoIMLWNag7dsqPRucedVuyefJ063Xbm8mRII4RAX1BPea/LlNLY0BeEbyg==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=TeAcxOsjhxNrjHpsE5FX2A5XRA8oDabWpshzHkvx8XYxAUTmVZGPSQW4KMho5l8o1H9PmiYwj3ODuLlDykbvYhFGNel7sw2huYZC/0Qw0U/bV0z0u8dYuh2HgvxXUQYZ06ENSCcjydj+zSyh35T8RxoiUhWFHatSg0Hzv3+/IMxnb0af1Pl6I1OS6pVWGTdGLNqSBSEhHn78ajLNWsq3p/bwVEdyNrKrJG0iKnDB82JRowXTFjBrb1IdkgLxq5oHW511JM/EBeTyfXaMiR/Lc8dJ/VVsdd+mZ/VEha/s5f+1eJ3aGtlvF7rIVSmaOf3tqKhC0gdI1AFzhm3Di7vUuQ==
  • Authentication-results: xen.org; dkim=none (message not signed) header.d=none;xen.org; dmarc=none action=none header.from=suse.com;
  • Cc: Bertrand.Marquis@xxxxxxx, xen-devel@xxxxxxxxxxxxxxxxxxxx, sstabellini@xxxxxxxxxx, julien@xxxxxxx
  • Delivery-date: Wed, 11 Aug 2021 10:54:32 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 11.08.2021 12:23, Wei Chen wrote:
> --- a/xen/arch/arm/platform.c
> +++ b/xen/arch/arm/platform.c
> @@ -27,6 +27,7 @@ extern const struct platform_desc _splatform[], 
> _eplatform[];
>  /* Pointer to the current platform description */
>  static const struct platform_desc *platform;
>  
> +extern unsigned int dma_bitsize;

This is a no-go: Declarations need to live in a header which the producer
and all consumers include. Else ...

> --- a/xen/common/page_alloc.c
> +++ b/xen/common/page_alloc.c
> @@ -227,7 +227,7 @@ static bool __read_mostly scrub_debug;
>   * Bit width of the DMA heap -- used to override NUMA-node-first.
>   * allocation strategy, which can otherwise exhaust low memory.
>   */
> -static unsigned int dma_bitsize;
> +unsigned int dma_bitsize;

... a change here (of e.g. the type) will go unnoticed by the compiler,
and the consumer of the variable may no longer work correctly.

Also I'm afraid the description does not make clear why this variable
is what you want to use. Connected to this is the question why you need
to consume it on Arm in the first place, when x86 never had the need.

Jan




 


Rackspace

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