All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] automation: Modify static-mem check in qemu-smoke-dom0less-arm64.sh
@ 2023-01-23 13:10 Michal Orzel
  2023-01-23 14:30 ` Xenia Ragiadakou
  2023-01-23 20:12 ` Stefano Stabellini
  0 siblings, 2 replies; 4+ messages in thread
From: Michal Orzel @ 2023-01-23 13:10 UTC (permalink / raw)
  To: xen-devel
  Cc: Michal Orzel, Doug Goldstein, Stefano Stabellini, julien, ayankuma

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@amd.com>
---
Patch made as part of the discussion:
https://lore.kernel.org/xen-devel/ba37ee02-c07c-2803-0867-149c779890b6@amd.com/

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



^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] automation: Modify static-mem check in qemu-smoke-dom0less-arm64.sh
  2023-01-23 13:10 [PATCH] automation: Modify static-mem check in qemu-smoke-dom0less-arm64.sh Michal Orzel
@ 2023-01-23 14:30 ` Xenia Ragiadakou
  2023-01-23 16:00   ` Ayan Kumar Halder
  2023-01-23 20:12 ` Stefano Stabellini
  1 sibling, 1 reply; 4+ messages in thread
From: Xenia Ragiadakou @ 2023-01-23 14:30 UTC (permalink / raw)
  To: Michal Orzel, xen-devel
  Cc: Doug Goldstein, Stefano Stabellini, julien, ayankuma


On 1/23/23 15:10, Michal Orzel wrote:
> 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@amd.com>

Reviewed-by: Xenia Ragiadakou <burzalodowa@gmail.com>

Also you fixed the hard tab.

> ---
> Patch made as part of the discussion:
> https://lore.kernel.org/xen-devel/ba37ee02-c07c-2803-0867-149c779890b6@amd.com/
> 
> 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

-- 
Xenia


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] automation: Modify static-mem check in qemu-smoke-dom0less-arm64.sh
  2023-01-23 14:30 ` Xenia Ragiadakou
@ 2023-01-23 16:00   ` Ayan Kumar Halder
  0 siblings, 0 replies; 4+ messages in thread
From: Ayan Kumar Halder @ 2023-01-23 16:00 UTC (permalink / raw)
  To: Xenia Ragiadakou, Michal Orzel, xen-devel
  Cc: Doug Goldstein, Stefano Stabellini, julien


On 23/01/2023 14:30, Xenia Ragiadakou wrote:
>
> On 1/23/23 15:10, Michal Orzel wrote:
>> 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@amd.com>
>
> Reviewed-by: Xenia Ragiadakou <burzalodowa@gmail.com>
Reviewed-by: Ayan Kumar Halder <ayan.kumar.halder@amd.com>
>
> Also you fixed the hard tab.
>
>> ---
>> Patch made as part of the discussion:
>> https://lore.kernel.org/xen-devel/ba37ee02-c07c-2803-0867-149c779890b6@amd.com/ 
>>
>>
>> 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
>


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] automation: Modify static-mem check in qemu-smoke-dom0less-arm64.sh
  2023-01-23 13:10 [PATCH] automation: Modify static-mem check in qemu-smoke-dom0less-arm64.sh Michal Orzel
  2023-01-23 14:30 ` Xenia Ragiadakou
@ 2023-01-23 20:12 ` Stefano Stabellini
  1 sibling, 0 replies; 4+ messages in thread
From: Stefano Stabellini @ 2023-01-23 20:12 UTC (permalink / raw)
  To: Michal Orzel
  Cc: xen-devel, Doug Goldstein, Stefano Stabellini, julien, ayankuma

On Mon, 23 Jan 2023, Michal Orzel wrote:
> 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@amd.com>

Acked-by: Stefano Stabellini <sstabellini@kernel.org>


> ---
> Patch made as part of the discussion:
> https://lore.kernel.org/xen-devel/ba37ee02-c07c-2803-0867-149c779890b6@amd.com/
> 
> 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
> 


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-01-23 20:13 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-01-23 13:10 [PATCH] automation: Modify static-mem check in qemu-smoke-dom0less-arm64.sh Michal Orzel
2023-01-23 14:30 ` Xenia Ragiadakou
2023-01-23 16:00   ` Ayan Kumar Halder
2023-01-23 20:12 ` Stefano Stabellini

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.