Commit 99916cdb4d for qemu.org
commit 99916cdb4dbf8459b6d908eea907ae18294e1635
Author: Ziyang Zhang <functioner@sjtu.edu.cn>
Date: Sun Jul 19 15:47:29 2026 +0800
tests/tcg: correct why the magic syscall number is safe here
The comment said 4096 was picked because no ISA in Linux uses it. The same
comment already notes that mips 32 bits numbers from 4000, which makes 4096 its
getpriority.
What actually keeps this test safe is the filter, which matches on the first
argument as well, so a real syscall carrying this number is left alone. Say
that instead.
Co-authored-by: Kailiang Xu <xukl2019@sjtu.edu.cn>
Co-authored-by: Mingyuan Xia <xiamy@ultrarisc.com>
Signed-off-by: Ziyang Zhang <functioner@sjtu.edu.cn>
Reviewed-by: Pierrick Bouvier <pierrick.bouvier@oss.qualcomm.com>
Link: https://lore.kernel.org/qemu-devel/20260719074730.1520517-3-functioner@sjtu.edu.cn
Signed-off-by: Pierrick Bouvier <pierrick.bouvier@oss.qualcomm.com>
diff --git a/tests/tcg/multiarch/test-plugin-syscall-filter.c b/tests/tcg/multiarch/test-plugin-syscall-filter.c
index 951e338a7c..089fb2a110 100644
--- a/tests/tcg/multiarch/test-plugin-syscall-filter.c
+++ b/tests/tcg/multiarch/test-plugin-syscall-filter.c
@@ -23,9 +23,12 @@ int main(int argc, char *argv[])
* "linux-user/arm/cpu_loop.c:cpu_loop".
* As well, some arch expect a minimum, like 4000 for mips 32 bits.
*
- * Therefore, we pick 4096 because, as of now, no ISA in Linux uses this
- * number. This is just a test case; replace this number as needed in the
- * future.
+ * Therefore, we pick 4096, which sits between those bounds. It is not
+ * unused everywhere though: mips 32 bits numbers from 4000, so 4096 is its
+ * getpriority. This test is unaffected because the filter also requires
+ * the first argument to be 0x66CCFF, so a real syscall carrying this
+ * number falls through untouched. This is just a test case, so replace
+ * this number as needed in the future.
*
* The corresponding syscall filter is implemented in
* "tests/tcg/plugins/syscall.c".