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>
Ziyang Zhang committed
Jul 19, 2026 at 15:47 UTC
99916cdb4dbf8459b6d908eea907ae18294e1635
1 file changed
+6
-3
tests/tcg/multiarch/test-plugin-syscall-filter.c
+6
-3
@@ -23,9 +23,12 @@ int main(int argc, char *argv[])
23
* "linux-user/arm/cpu_loop.c:cpu_loop".
24
* As well, some arch expect a minimum, like 4000 for mips 32 bits.
25
*
26
- * Therefore, we pick 4096 because, as of now, no ISA in Linux uses this
27
- * number. This is just a test case; replace this number as needed in the
28
- * future.
26
+ * Therefore, we pick 4096, which sits between those bounds. It is not
27
+ * unused everywhere though: mips 32 bits numbers from 4000, so 4096 is its
28
+ * getpriority. This test is unaffected because the filter also requires
29
+ * the first argument to be 0x66CCFF, so a real syscall carrying this
30
+ * number falls through untouched. This is just a test case, so replace
31
+ * this number as needed in the future.
32
*
33
* The corresponding syscall filter is implemented in
34
* "tests/tcg/plugins/syscall.c".