[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: Jan Beulich <jbeulich@xxxxxxxx>
  • From: Wei Chen <Wei.Chen@xxxxxxx>
  • Date: Tue, 26 Apr 2022 18:42:17 +0800
  • Arc-authentication-results: i=2; mx.microsoft.com 1; spf=pass (sender ip is 63.35.35.123) smtp.rcpttodomain=lists.xenproject.org smtp.mailfrom=arm.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=arm.com; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com; arc=pass (0 oda=1 ltdi=1 spf=[1,1,smtp.mailfrom=arm.com] dkim=[1,1,header.d=arm.com] dmarc=[1,1,header.from=arm.com])
  • 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=2; 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=zOOZTuLcj0JpB7z4ygWsT6hFRft+aPwJKGfkraf1cM4=; b=hwE4vqH4pNa30Aabi3HUWVdz1YJpqeZHz7bY2tiuCkm6uXoLfx7BOb0w7bmsBdX82tB/uRC8GWpPp1R7wYj3bqzID0VsxUeVJ3hjpYzQ4m1iOcUlc+DhN+G6hRcCWSvGjVFhy0EL/s5xBh0V67fdtJVqLAm3xVRYKyQrswDJAivHcn8gKA6I/4efGBnDSG8aO1YHyPwIe2g2FrbWTCUwVCASnQp+RjL8ceTcn/doXFnD2BOywomO5KpSar9jzFgT8Z5z3xyTGPbYmo1LpHQjoQFeitUXl+H1ZROKOg9DQERQsox9uIVMKHrIpLCvYh/fapWaRSiIHNFGcSMeg4dTig==
  • 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=zOOZTuLcj0JpB7z4ygWsT6hFRft+aPwJKGfkraf1cM4=; b=REy/3bKIAuOgn43QNXPkOL0ICOkBJQtMx5OgT51NkZrBrPDS04UHyCPh3KO4wkytAbpme+/T5qttA9wmD+i0u8qmafIa2EOQyT+no2bbZ7OWWTkFQf1Rj2aqdIcWeNYZi+ZKH/mGSQZdvIPWOwhjRgiZWukuWRoSjFvtVQhSq2XBoiZk+aE2to+HZUKOxkkw8AhJ1WMX/DWf36RBZsQIrb9bwuMMh1wAC+iGs0BnA2uMbPoHzPlkkK66ydtaiXNGgtNj0poS7oN4jcjtLneT15aKoEpBnrSefTC5VmqRSj6yHgUP+bOkUTXc+Z39K3WRF7rrOs+3o+2j/9iy5nHDNA==
  • Arc-seal: i=2; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=pass; b=RucakaD6zxeQsL+/ALY/nGZ2tuEUDf2kwPjWX19/T+COnxtAMe7ISXU8VnQ4hiTrHNUsE9T8io4r89rrf5UOHuD4OO9ryU2xgLwgL2rkpHVzz4eHDQ5VI48NmLpRd3CxbER1M0Pi9GqCzh49WtJJxbHX/evxyFc1AogbsiT1MSNN901KP5IqpmlFZ6RC4QJTiEGfNHbMlrGzmzkJAhtvzn3nsXP76IyFcMcVpIqR1pSsU50U6ycEQj8iu/TxukHaSgQ5yDol6XOc0Mgn3U0xia1maXrw+5dwnl6KUjQOd4MeAq0W5eaehSfO2DcSrBFNEI0MCO29CYZOAWgwUdXqAw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=jGMI8j5NuRfCyKyG4b1dXXanr3pne4Xmx6G4InvMpwG4Mnix9JBtgOGcSbMBKHvb8R77R9Bqctwnnu3BQGzIrYBhf/4iTBmryFTneKcBniGVNOVV8jCWpIfe9AGli1hBmDs8DrjtvPNeSa/22pTBPp3JM9JznMVDOkRYGatu7A4AFv7T37XPV+2XCDwBQlMTturh295OCMm4uAXc1arKCcdY+hSHELbvgVN+KwSnNwMR8BogoX1Op5PrFhur5xTYqbyIbiq6zqVaI9N1NIwT8sRxJ83oTHky0GwDwT9T4bxCds7NVgmv7WbyUwdVrwlhuQJjB7aHd5WVrtOxH2sRpg==
  • Authentication-results-original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.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 10:42:40 +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;

Hi Jan,

On 2022/4/26 17:11, Jan Beulich wrote:
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.


Ok, I will do it.

@@ -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.


Ok.

@@ -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.


Ok.

Jan




 


Rackspace

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