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

[ImageBuilder] Add support for omitting host paddr for static shmem regions


  • To: <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Michal Orzel <michal.orzel@xxxxxxx>
  • Date: Mon, 24 Jun 2024 09:55:59 +0200
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=lists.xenproject.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0)
  • 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=8p9N3jX+sDeQrnUZwbq8aFuht35rrHShuG3TJ+r3T7g=; b=fkHf79Lv81MQRfWysQ3HPIBNtkKKDXine1dbhUZDr2ihzBgdwP08Xeso48NuBm2WiRzGFQaquEQOwK8UNl5hFt5VEhIlL6aGNnahd8t1ZgAnbR2RS2D4tmo/RFWJJMofPJVEs9L+wvope5CTB3f6w/XQzFBsFvfu1ht7Bnthx6d5RA2heKhyyYkxuPAU9nkoufQJD/1CUavIS3HMNwhZ0NVyvc8cs4wY4cgTJiH8n2w5qqH2fPAdt4SPydnvGu5cnEDsrIKG8802wIDfmSf2A3iNT3S2NnjhV4k5NwdyUFB+mCeDFPC1gkwRcJZ+AajX+A0esIoai6fWQvDevIpTbw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=OYJOOumKGL8/qdyEgk6IVSIxUBPeowec3pZmn1WTpU3bJWjRypUZxWNrwuBok7T1we9VU/xYBqPbkNxA5xCLU6yG0m5OKXG0hAmUTWnSi3wFsRnyJVg99Mz0OdwBN6wVJtwkT7uRGp7jlJM5WQ/cWKXi1ewpUyX9fICTfrG9rfUXFsiIFWDdC+gTXNMQ88lDJwmpyHXvFx+AhdCI1mtfC+5M0YKBc1CpDe6tTFasaXIIFjG78hLXVLsjeD87Px+QmZ0t6bd4p/LsCvFeaCBVDImDo+BEWb6vV8T4sidp/qcGGrM4FZ1MOJi2OoFx2JtoNJrw8QPi8wZfQ/r2fvWCGA==
  • Cc: <sstabellini@xxxxxxxxxx>, Michal Orzel <michal.orzel@xxxxxxx>
  • Delivery-date: Mon, 24 Jun 2024 07:56:24 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

Reflect the latest Xen support to be able to omit the host physical
address for static shared memory regions, in which case the address will
come from the Xen heap.

Signed-off-by: Michal Orzel <michal.orzel@xxxxxxx>
---
 README.md                |  7 ++++---
 scripts/uboot-script-gen | 19 +++++++++++++------
 2 files changed, 17 insertions(+), 9 deletions(-)

diff --git a/README.md b/README.md
index 7683492a6f7f..4fcd908c2c2f 100644
--- a/README.md
+++ b/README.md
@@ -199,9 +199,10 @@ Where:
 
 - DOMU_SHARED_MEM[number]="SHM-ID HPA GPA size"
   if specified, indicate SHM-ID represents the unique identifier of the shared
-  memory region, the host physical address HPA will get mapped at guest
-  address GPA in domU and the memory of size will be reserved to be shared
-  memory. The shared memory is used between two dom0less domUs.
+  memory region. The host physical address HPA is optional, if specified, will
+  get mapped at guest address GPA in domU (otherwise it will come from Xen 
heap)
+  and the memory of size will be reserved to be shared memory. The shared 
memory
+  is used between two dom0less domUs.
 
   Below is an example:
   NUM_DOMUS=2
diff --git a/scripts/uboot-script-gen b/scripts/uboot-script-gen
index 20cc6ef7f892..8b664e711b10 100755
--- a/scripts/uboot-script-gen
+++ b/scripts/uboot-script-gen
@@ -211,18 +211,25 @@ function add_device_tree_static_shared_mem()
     local shared_mem_id=${shared_mem%% *}
     local regions="${shared_mem#* }"
     local cells=()
-    local shared_mem_host=${regions%% *}
-
-    dt_mknode "${path}" "shared-mem@${shared_mem_host}"
+    local node_name=
 
     for val in ${regions[@]}
     do
         cells+=("$(split_value $val)")
     done
 
-    dt_set "${path}/shared-mem@${shared_mem_host}" "compatible" "str" 
"xen,domain-shared-memory-v1"
-    dt_set "${path}/shared-mem@${shared_mem_host}" "xen,shm-id" "str" 
"${shared_mem_id}"
-    dt_set "${path}/shared-mem@${shared_mem_host}" "xen,shared-mem" "hex" 
"${cells[*]}"
+    # Less than 3 cells means host address not provided
+    if [ ${#cells[@]} -lt 3 ]; then
+        node_name="shared-mem-${shared_mem_id}"
+    else
+        node_name="shared-mem@${regions%% *}"
+    fi
+
+    dt_mknode "${path}" "${node_name}"
+
+    dt_set "${path}/${node_name}" "compatible" "str" 
"xen,domain-shared-memory-v1"
+    dt_set "${path}/${node_name}" "xen,shm-id" "str" "${shared_mem_id}"
+    dt_set "${path}/${node_name}" "xen,shared-mem" "hex" "${cells[*]}"
 }
 
 function add_device_tree_cpupools()
-- 
2.25.1




 


Rackspace

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