Skip to contentSkip to conversation

selftests/vm: Add protection_keys tests to run_vmtests

PATCH Superseded Kalpana Shetty 2 participants 7 messages Jun 10, 2022 – Jun 17, 2022

Subsystems (2)

v2 of 4 Superseded Latest is v4 →

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 selftests/vm: Add protection_keys tests to run_vmtests

Adding "protected_keys" tests to "run_vmtests.sh" would help out to run all VM related tests from a single shell script.

---
Changes in V2:
* Added patch description.

 tools/testing/selftests/vm/run_vmtests.sh | 7 +++++++
 1 file changed, 7 insertions(+)
tools/testing/selftests/vm/run_vmtests.sh +7 -0
index 41fce8bea929..54a0c28f810c 100755
@@ -179,4 +179,11 @@ run_test ./ksm_tests -N -m 1
 # KSM test with 2 NUMA nodes and merge_across_nodes = 0
 run_test ./ksm_tests -N -m 0
 
+# protection_keys tests
+if [ $VADDR64 -eq 0 ]; then
+	run_test ./protection_keys_32
+else
+	run_test ./protection_keys_64
+fi
+
 exit $exitcode
Signature · 1 line
2.25.1
maintainer
#1 lore raw
Quoted 3 lines · Kalpana Shetty

Adding "protected_keys" tests to "run_vmtests.sh" would help out to run all VM related tests from a single shell script.

Makes sense - can you explain why you can't just run protection_keys_32 without checks? Why are you checking for VADDR64? All of this information helps us review the patch and give you feedback and suggest a different approach.

Quoted 5 lines

---
Changes in V2:
* Added patch description.

thanks,
-- Shuah

#2 lore raw
Quoted 7 lines · Shuah Khan
Quoted 3 lines · Kalpana Shetty

Adding "protected_keys" tests to "run_vmtests.sh" would help out to run all VM related tests from a single shell script.

Makes sense - can you explain why you can't just run protection_keys_32 without checks?

Yes; we can run protection_keys_32 without check.

Quoted 1 line

Why are you checking for VADDR64?

The check is added to ensure if the system is in 64-bit mode before executing 64-bit binary.

Quoted 2 lines

All of this information helps us review the
patch and give you feedback and suggest a different approach.

Thanks,

Kalpana

Quoted 9 lines
Quoted 6 lines

---
  Changes in V2:
   * Added patch description.

thanks,
-- Shuah

maintainer
#3 lore raw
Quoted 10 lines · Kalpana
Quoted 7 lines · Shuah Khan
Quoted 3 lines · Kalpana Shetty

Adding "protected_keys" tests to "run_vmtests.sh" would help out to run all VM related tests from a single shell script.

Makes sense - can you explain why you can't just run protection_keys_32 without checks?

Quoted 8 lines

Yes; we can run protection_keys_32 without check.

Quoted 1 line

Why are you checking for VADDR64?

The check is added to ensure if the system is in 64-bit mode before executing 64-bit binary.

Okay. protection_keys_32 will only be built on 32-bit system and. protection_keys_64 on 64-bit system.

Won't it be better to check if binary exists and run either _32 or _64 instead of checking for VADDR64?

thanks,
-- Shuah

#4 lore raw
Quoted 14 lines · Shuah Khan
Quoted 13 lines · Kalpana
Quoted 7 lines · Shuah Khan
Quoted 3 lines · Kalpana Shetty

Adding "protected_keys" tests to "run_vmtests.sh" would help out to run all VM related tests from a single shell script.

Makes sense - can you explain why you can't just run protection_keys_32 without checks?

Yes; we can run protection_keys_32 without check.

Quoted 8 lines
Quoted 5 lines
Quoted 1 line

Why are you checking for VADDR64?

The check is added to ensure if the system is in 64-bit mode before executing 64-bit binary.

Okay. protection_keys_32 will only be built on 32-bit system and. protection_keys_64 on 64-bit system.

On 64-bit system, we get both 32-bit and 64-bit binary.

Quoted 3 lines

Won't it be better to check if binary exists and run either _32 or _64 instead of checking for VADDR64?

makes sense;

In this case on 64-bit platform we would run both _32 and _64 and this should be fine.

Quoted 2 lines

thanks,
-- Shuah

Thanks,

Kalpana

maintainer
#5 lore raw
Quoted 29 lines · Kalpana
Quoted 14 lines · Shuah Khan
Quoted 13 lines · Kalpana
Quoted 7 lines · Shuah Khan
Quoted 3 lines · Kalpana Shetty

Adding "protected_keys" tests to "run_vmtests.sh" would help out to run all VM related tests from a single shell script.

Makes sense - can you explain why you can't just run protection_keys_32 without checks?

Yes; we can run protection_keys_32 without check.

Quoted 8 lines
Quoted 5 lines
Quoted 1 line

Why are you checking for VADDR64?

The check is added to ensure if the system is in 64-bit mode before executing 64-bit binary.

Okay. protection_keys_32 will only be built on 32-bit system and. protection_keys_64 on 64-bit system.

On 64-bit system, we get both 32-bit and 64-bit binary.

Quoted 1 line
Quoted 8 lines
Quoted 2 lines

Won't it be better to check if binary exists and run either _32 or _64 instead of checking for VADDR64?

makes sense;

In this case on 64-bit platform we would run both _32 and _64 and this should be fine.

Okay - send v3 with the change.

thanks,
-- Shuah

#6 lore raw
Quoted 33 lines · Shuah Khan
Quoted 32 lines · Kalpana
Quoted 14 lines · Shuah Khan
Quoted 13 lines · Kalpana
Quoted 7 lines · Shuah Khan
Quoted 3 lines · Kalpana Shetty

Adding "protected_keys" tests to "run_vmtests.sh" would help out to run all VM related tests from a single shell script.

Makes sense - can you explain why you can't just run protection_keys_32 without checks?

Yes; we can run protection_keys_32 without check.

Quoted 8 lines
Quoted 5 lines
Quoted 1 line

Why are you checking for VADDR64?

The check is added to ensure if the system is in 64-bit mode before executing 64-bit binary.

Okay. protection_keys_32 will only be built on 32-bit system and. protection_keys_64 on 64-bit system.

On 64-bit system, we get both 32-bit and 64-bit binary.

Quoted 3 lines

Won't it be better to check if binary exists and run either _32 or _64 instead of checking for VADDR64?

Quoted 7 lines
Quoted 5 lines

makes sense;

In this case on 64-bit platform we would run both _32 and _64 and this should be fine.

Okay - send v3 with the change.

Done; thanks for your input/review comments.

Quoted 3 lines

thanks,
-- Shuah

Thanks,

Kalpana