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

[PATCH] automation: Modify static-mem check in qemu-smoke-dom0less-arm64.sh


  • To: <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Michal Orzel <michal.orzel@xxxxxxx>
  • Date: Mon, 23 Jan 2023 14:10:23 +0100
  • 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
  • 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=1S9RGzAXZbvL+p2nKWN2tHznjQW89E7pjL+KiBsk+Tw=; b=gr2rEoa+oF01X5JHjJcBrgDi6xZ16bzHNomBRCinWcNTIY0UUMr4bMPP7T/3igT117yAS59+3xaasTOnS/jpH7ltmRsfvzXA8JZQWzeNUTy6mzzka7a657g6d6j3oDmhGR/5O4XJIwI/IWMrHIak2i65U/DBt26RHqCGrJ7mSxu2Q0SvHaZ+58bMjhD2AeOvSCCdeSwSUXnsZQ3fsI6akUqWc63JJ/tpv80UlRNE+fuxeuS6RDtvBqlEw3xHutCdPDp+ydSAfzk2QTlY1TDvsg289Ag7cM6S/LplUUZHMdG2vSppdUxdp2tPU0GfnZGwEZ3j8Eu77bWwd+7xqmx+GA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=XaxQRjwEKlCKIYQSHei0VjDhCk87oT9CA2qD/R/ubt5m64r2zEK4+6Dq/3EGuF4tjwHy37ZbtB0IAdIR3znkZrAsKpvL5AObv0c5Cp4JSeMgaRpF0dYY8yb5IREWyvnaLfWdXgfNh6bTNDVGsSfJz+Hrc9PMb5K8ZFdpjcia3ZQjv5qz1V7qI0n9aH0TAZnKmew9DxSj8gyllwL7U8UABRwywCyXqqcfM4FtHi5TWgrq3D2oJmGv/WIumRC9jxoPbCctl5ocgVySBOSLNdOC/C0nYs45hzWBZHPn8Dy1Byj2/EwyvqTGnLyLpdW+SOoIAMa/10qdKKAZJm+wgR482A==
  • Cc: Michal Orzel <michal.orzel@xxxxxxx>, Doug Goldstein <cardoe@xxxxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, <julien@xxxxxxx>, <ayankuma@xxxxxxx>
  • Delivery-date: Mon, 23 Jan 2023 13:11:25 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

At the moment, the static-mem check relies on the way Xen exposes the
memory banks in device tree. As this might change, the check should be
modified to be generic and not to rely on device tree. In this case,
let's use /proc/iomem which exposes the memory ranges in %08x format
as follows:
<start_addr>-<end_addr> : <description>

This way, we can grep in /proc/iomem for an entry containing memory
region defined by the static-mem configuration with "System RAM"
description. If it exists, mark the test as passed. Also, take the
opportunity to add 0x prefix to domu_{base,size} definition rather than
adding it in front of each occurence.

Signed-off-by: Michal Orzel <michal.orzel@xxxxxxx>
---
Patch made as part of the discussion:
https://lore.kernel.org/xen-devel/ba37ee02-c07c-2803-0867-149c779890b6@xxxxxxx/

CC: Julien, Ayan
---
 automation/scripts/qemu-smoke-dom0less-arm64.sh | 13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)

diff --git a/automation/scripts/qemu-smoke-dom0less-arm64.sh 
b/automation/scripts/qemu-smoke-dom0less-arm64.sh
index 2b59346fdcfd..182a4b6c18fc 100755
--- a/automation/scripts/qemu-smoke-dom0less-arm64.sh
+++ b/automation/scripts/qemu-smoke-dom0less-arm64.sh
@@ -16,14 +16,13 @@ fi
 
 if [[ "${test_variant}" == "static-mem" ]]; then
     # Memory range that is statically allocated to DOM1
-    domu_base="50000000"
-    domu_size="10000000"
+    domu_base="0x50000000"
+    domu_size="0x10000000"
     passed="${test_variant} test passed"
     domU_check="
-current=\$(hexdump -e '16/1 \"%02x\"' 
/proc/device-tree/memory@${domu_base}/reg 2>/dev/null)
-expected=$(printf \"%016x%016x\" 0x${domu_base} 0x${domu_size})
-if [[ \"\${expected}\" == \"\${current}\" ]]; then
-       echo \"${passed}\"
+mem_range=$(printf \"%08x-%08x\" ${domu_base} $(( ${domu_base} + ${domu_size} 
- 1 )))
+if grep -q -x \"\${mem_range} : System RAM\" /proc/iomem; then
+    echo \"${passed}\"
 fi
 "
 fi
@@ -126,7 +125,7 @@ UBOOT_SOURCE="boot.source"
 UBOOT_SCRIPT="boot.scr"' > binaries/config
 
 if [[ "${test_variant}" == "static-mem" ]]; then
-    echo -e "\nDOMU_STATIC_MEM[0]=\"0x${domu_base} 0x${domu_size}\"" >> 
binaries/config
+    echo -e "\nDOMU_STATIC_MEM[0]=\"${domu_base} ${domu_size}\"" >> 
binaries/config
 fi
 
 if [[ "${test_variant}" == "boot-cpupools" ]]; then
-- 
2.25.1




 


Rackspace

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