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

Re: [PATCH v2 09/10] xen/x86: use paddr_t for addresses in NUMA node structure


  • To: Wei Chen <wei.chen@xxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Tue, 26 Apr 2022 11:11:11 +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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=SbukDmSwJmoRBCLIetA2B8ev7EKGSo+vjX3+6kuuQ8A=; b=jvt5FIKnZ8FFOrmDqDvlnhGg5ZpPiK5SAQnYK6JjAZ2YA0Fx9MXn99HOxPVQBClwvPI6uU0bg44mlt5hCWlVdYU4ASp3wZ1T3caz+frropuIoBfjlKQnHyhPx7PWO1RZE1pWZ/umVWJANMjb8Ie/DihIq2lcJtAW2XaNKuz5+jgXKb6p1F5k5hh7yG9SmLQ5GQvItvLKKxhoTuQ8ZT2WCck0/2C6yHX1tt8FJpuM4aVf6BboXk6OwgQbvNz6/IhipHN2UtwRMwUcLvHLodRIkI8EMS6wuYKK4ibcE4EvDRyeKNSJCVFqh5dXkCOR9HLbNICRrK7p6MBM6UVsLKfDFw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=TuVQp1BI8O0I/AMOyLPrRBFTdv+AqH22O8kqU+Ipi+j8KDxg+zcZIcoHHKsk0hvrHg21i3itUICml1KIja7QoUY/HqvKrsERVdwwvXrGwvymYAdKkn/qnLpWvs+CGExJHZNmhiX+1VXLJMIzEjwLzdTAVsoAtO6ZWT6quU/7/q289v9cM+E8vuFoXSok9r1JnRvSxHWHoUQtN6ajvpk4nh387AWh5DuwGSqgl43n7j5I4vmrUVOAtl+k07KnX00Ez1jXfApBehnQ1zD7GGbg//b015LQdBvYnG8lqMlb2Yq4NCchV+GuPZGG30JxdauOnH91PKHpH47MoCbxk732nA==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: nd@xxxxxxx, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
  • Delivery-date: Tue, 26 Apr 2022 09:11:22 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 18.04.2022 11:07, Wei Chen wrote:
> v1 ->v2:
> 1. Drop useless cast.
> 2. Use initializers of the variables.

Would have been nice if this was extended to ...

> diff --git a/xen/arch/x86/numa.c b/xen/arch/x86/numa.c
> index 680b7d9002..2b3a51afd0 100644
> --- a/xen/arch/x86/numa.c
> +++ b/xen/arch/x86/numa.c
> @@ -162,12 +162,12 @@ int __init compute_hash_shift(struct node *nodes, int 
> numnodes,
>      return shift;
>  }
>  /* initialize NODE_DATA given nodeid and start/end */
> -void __init setup_node_bootmem(nodeid_t nodeid, u64 start, u64 end)
> -{ 
> +void __init setup_node_bootmem(nodeid_t nodeid, paddr_t start, paddr_t end)
> +{
>      unsigned long start_pfn, end_pfn;
>  
> -    start_pfn = start >> PAGE_SHIFT;
> -    end_pfn = end >> PAGE_SHIFT;
> +    start_pfn = paddr_to_pfn(start);
> +    end_pfn = paddr_to_pfn(end);

... these as well.

> @@ -218,9 +219,9 @@ static int __init numa_emulation(u64 start_pfn, u64 
> end_pfn)
>      memset(&nodes,0,sizeof(nodes));
>      for ( i = 0; i < numa_fake; i++ )
>      {
> -        nodes[i].start = (start_pfn<<PAGE_SHIFT) + i*sz;
> +        nodes[i].start = pfn_to_paddr(start_pfn) + i*sz;

Please add the missing blanks around * while touching this line.

> @@ -489,7 +489,8 @@ int __init acpi_scan_nodes(u64 start, u64 end)
>       /* Finally register nodes */
>       for_each_node_mask(i, all_nodes_parsed)
>       {
> -             u64 size = nodes[i].end - nodes[i].start;
> +             paddr_t size = nodes[i].end - nodes[i].start;

In numa_emulation() you use uint64_t for a size; here you use paddr_t.
Please be consistent.

Jan




 


Rackspace

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