| Seq | Timestamp | Type | Name | Duration |
|---|---|---|---|---|
| 0/0 | 2026/09/30 17:52 | flow | patch-triage |
0mArgs:null Results: {
"EnableConfigs": null,
"FocusSymbols": [],
"KMSANReasoning": "",
"NeedsKMSAN": false,
"Reasoning": "The patch only modifies a userspace selftest file (tools/testing/selftests/kvm/arm64/set_id_regs.c). It does not alter the kernel image (vmlinux) or any kernel modules, and it is also specific to arm64 while the target architecture is amd64. Therefore, it does not warrant fuzzing.",
"WorthFuzzing": false
} |
| 1/1 | 2026/09/30 17:52 | action | read-patch-diff |
0mArgs:null Results: {
"PatchDiff": "commit 879656cdeb371c5c484a69d5d126495793df2cea\nAuthor: syz-cluster \u003ctriage@syzkaller.com\u003e\nDate: Wed Sep 30 17:52:39 2026 +0000\n\n syz-cluster: applied patch under review\n\ndiff --git a/tools/testing/selftests/kvm/arm64/set_id_regs.c b/tools/testing/selftests/kvm/arm64/set_id_regs.c\nindex 7429a1055df56..43dd9506036cf 100644\n--- a/tools/testing/selftests/kvm/arm64/set_id_regs.c\n+++ b/tools/testing/selftests/kvm/arm64/set_id_regs.c\n@@ -43,6 +43,7 @@ struct reg_ftr_bits {\n };\n \n struct test_feature_reg {\n+\tconst char *name;\n \tu32 reg;\n \tconst struct reg_ftr_bits *ftr_bits;\n };\n@@ -227,30 +228,32 @@ static const struct reg_ftr_bits ftr_id_aa64zfr0_el1[] = {\n \n #define TEST_REG(id, table)\t\t\t\\\n \t{\t\t\t\t\t\\\n-\t\t.reg = id,\t\t\t\\\n+\t\t.name = #id,\t\t\t\\\n+\t\t.reg = SYS_ ## id,\t\t\\\n \t\t.ftr_bits = \u0026((table)[0]),\t\\\n \t}\n \n static struct test_feature_reg test_regs[] = {\n-\tTEST_REG(SYS_ID_AA64DFR0_EL1, ftr_id_aa64dfr0_el1),\n-\tTEST_REG(SYS_ID_DFR0_EL1, ftr_id_dfr0_el1),\n-\tTEST_REG(SYS_ID_AA64ISAR0_EL1, ftr_id_aa64isar0_el1),\n-\tTEST_REG(SYS_ID_AA64ISAR1_EL1, ftr_id_aa64isar1_el1),\n-\tTEST_REG(SYS_ID_AA64ISAR2_EL1, ftr_id_aa64isar2_el1),\n-\tTEST_REG(SYS_ID_AA64ISAR3_EL1, ftr_id_aa64isar3_el1),\n-\tTEST_REG(SYS_ID_AA64PFR0_EL1, ftr_id_aa64pfr0_el1),\n-\tTEST_REG(SYS_ID_AA64PFR1_EL1, ftr_id_aa64pfr1_el1),\n-\tTEST_REG(SYS_ID_AA64MMFR0_EL1, ftr_id_aa64mmfr0_el1),\n-\tTEST_REG(SYS_ID_AA64MMFR1_EL1, ftr_id_aa64mmfr1_el1),\n-\tTEST_REG(SYS_ID_AA64MMFR2_EL1, ftr_id_aa64mmfr2_el1),\n-\tTEST_REG(SYS_ID_AA64MMFR3_EL1, ftr_id_aa64mmfr3_el1),\n-\tTEST_REG(SYS_ID_AA64ZFR0_EL1, ftr_id_aa64zfr0_el1),\n+\tTEST_REG(ID_AA64DFR0_EL1, ftr_id_aa64dfr0_el1),\n+\tTEST_REG(ID_DFR0_EL1, ftr_id_dfr0_el1),\n+\tTEST_REG(ID_AA64ISAR0_EL1, ftr_id_aa64isar0_el1),\n+\tTEST_REG(ID_AA64ISAR1_EL1, ftr_id_aa64isar1_el1),\n+\tTEST_REG(ID_AA64ISAR2_EL1, ftr_id_aa64isar2_el1),\n+\tTEST_REG(ID_AA64ISAR3_EL1, ftr_id_aa64isar3_el1),\n+\tTEST_REG(ID_AA64PFR0_EL1, ftr_id_aa64pfr0_el1),\n+\tTEST_REG(ID_AA64PFR1_EL1, ftr_id_aa64pfr1_el1),\n+\tTEST_REG(ID_AA64MMFR0_EL1, ftr_id_aa64mmfr0_el1),\n+\tTEST_REG(ID_AA64MMFR1_EL1, ftr_id_aa64mmfr1_el1),\n+\tTEST_REG(ID_AA64MMFR2_EL1, ftr_id_aa64mmfr2_el1),\n+\tTEST_REG(ID_AA64MMFR3_EL1, ftr_id_aa64mmfr3_el1),\n+\tTEST_REG(ID_AA64ZFR0_EL1, ftr_id_aa64zfr0_el1),\n };\n \n #define GUEST_REG_SYNC(id) GUEST_SYNC_ARGS(0, id, read_sysreg_s(id), 0, 0);\n \n static void guest_code(void)\n {\n+\t/* Registers in test_regs array */\n \tGUEST_REG_SYNC(SYS_ID_AA64DFR0_EL1);\n \tGUEST_REG_SYNC(SYS_ID_DFR0_EL1);\n \tGUEST_REG_SYNC(SYS_ID_AA64ISAR0_EL1);\n@@ -264,6 +267,8 @@ static void guest_code(void)\n \tGUEST_REG_SYNC(SYS_ID_AA64MMFR2_EL1);\n \tGUEST_REG_SYNC(SYS_ID_AA64MMFR3_EL1);\n \tGUEST_REG_SYNC(SYS_ID_AA64ZFR0_EL1);\n+\n+\t/* Additional registers counted in NUM_EXTRA_REGS */\n \tGUEST_REG_SYNC(SYS_MPIDR_EL1);\n \tGUEST_REG_SYNC(SYS_CLIDR_EL1);\n \tGUEST_REG_SYNC(SYS_CTR_EL0);\n@@ -274,6 +279,35 @@ static void guest_code(void)\n \tGUEST_DONE();\n }\n \n+#define NUM_EXTRA_REGS 6\n+#define GUEST_READ_TEST (ARRAY_SIZE(test_regs) + NUM_EXTRA_REGS)\n+\n+static const char *get_reg_name(u64 id)\n+{\n+\tint i;\n+\n+\tfor (i = 0; i \u003c ARRAY_SIZE(test_regs); i++)\n+\t\tif (test_regs[i].reg == id)\n+\t\t\treturn test_regs[i].name;\n+\n+\tswitch (id) {\n+\tcase SYS_MPIDR_EL1:\n+\t\treturn \"MPIDR_EL1\";\n+\tcase SYS_CLIDR_EL1:\n+\t\treturn \"CLIDR_EL1\";\n+\tcase SYS_CTR_EL0:\n+\t\treturn \"CTR_EL0\";\n+\tcase SYS_MIDR_EL1:\n+\t\treturn \"MIDR_EL1\";\n+\tcase SYS_REVIDR_EL1:\n+\t\treturn \"REVIDR_EL1\";\n+\tcase SYS_AIDR_EL1:\n+\t\treturn \"AIDR_EL1\";\n+\tdefault:\n+\t\tTEST_FAIL(\"Unknown register\");\n+\t}\n+}\n+\n /* Return a safe value to a given ftr_bits an ftr value */\n u64 get_safe_value(const struct reg_ftr_bits *ftr_bits, u64 ftr)\n {\n@@ -388,6 +422,7 @@ static u64 test_reg_set_success(struct kvm_vcpu *vcpu, u64 reg,\n \tu8 shift = ftr_bits-\u003eshift;\n \tu64 mask = ftr_bits-\u003emask;\n \tu64 val, new_val, ftr;\n+\tbool match;\n \n \tval = vcpu_get_reg(vcpu, reg);\n \tftr = (val \u0026 mask) \u003e\u003e shift;\n@@ -400,7 +435,10 @@ static u64 test_reg_set_success(struct kvm_vcpu *vcpu, u64 reg,\n \n \tvcpu_set_reg(vcpu, reg, val);\n \tnew_val = vcpu_get_reg(vcpu, reg);\n-\tTEST_ASSERT_EQ(new_val, val);\n+\tmatch = new_val == val;\n+\tif (!match)\n+\t\tksft_print_msg(\"%lx != %lx\\n\", new_val, val);\n+\tksft_test_result(match, \"%s valid write succeeded\\n\", ftr_bits-\u003ename);\n \n \treturn new_val;\n }\n@@ -412,6 +450,7 @@ static void test_reg_set_fail(struct kvm_vcpu *vcpu, u64 reg,\n \tu64 mask = ftr_bits-\u003emask;\n \tu64 val, old_val, ftr;\n \tint r;\n+\tbool match;\n \n \tval = vcpu_get_reg(vcpu, reg);\n \tftr = (val \u0026 mask) \u003e\u003e shift;\n@@ -424,11 +463,19 @@ static void test_reg_set_fail(struct kvm_vcpu *vcpu, u64 reg,\n \tval |= ftr;\n \n \tr = __vcpu_set_reg(vcpu, reg, val);\n-\tTEST_ASSERT(r \u003c 0 \u0026\u0026 errno == EINVAL,\n-\t\t \"Unexpected KVM_SET_ONE_REG error: r=%d, errno=%d\", r, errno);\n+\tif (r \u003e= 0 || errno != EINVAL) {\n+\t\tksft_print_msg(\"Unexpected KVM_SET_ONE_REG error: r=%d, errno=%d (%s)\\n\",\n+\t\t\t r, errno, strerror(errno));\n+\t\tksft_test_result_fail(\"%s invalid write rejected\\n\",\n+\t\t\t\t ftr_bits-\u003ename);\n+\t\treturn;\n+\t}\n \n \tval = vcpu_get_reg(vcpu, reg);\n-\tTEST_ASSERT_EQ(val, old_val);\n+\tmatch = val == old_val;\n+\tif (!match)\n+\t\tksft_print_msg(\"%lx != %lx\\n\", val, old_val);\n+\tksft_test_result(match, \"%s invalid write rejected\\n\", ftr_bits-\u003ename);\n }\n \n static u64 test_reg_vals[KVM_ARM_FEATURE_ID_RANGE_SIZE];\n@@ -468,7 +515,11 @@ static void test_vm_ftr_id_regs(struct kvm_vcpu *vcpu, bool aarch64_only)\n \t\tfor (int j = 0; ftr_bits[j].type != FTR_END; j++) {\n \t\t\t/* Skip aarch32 reg on aarch64 only system, since they are RAZ/WI. */\n \t\t\tif (aarch64_only \u0026\u0026 sys_reg_CRm(reg_id) \u003c 4) {\n-\t\t\t\tksft_test_result_skip(\"%s on AARCH64 only system\\n\",\n+\t\t\t\tksft_print_msg(\"%s on AARCH64 only system\\n\",\n+\t\t\t\t\t ftr_bits[j].name);\n+\t\t\t\tksft_test_result_skip(\"%s invalid write rejected\\n\",\n+\t\t\t\t\t\t ftr_bits[j].name);\n+\t\t\t\tksft_test_result_skip(\"%s valid write succeeded\\n\",\n \t\t\t\t\t\t ftr_bits[j].name);\n \t\t\t\tcontinue;\n \t\t\t}\n@@ -480,8 +531,6 @@ static void test_vm_ftr_id_regs(struct kvm_vcpu *vcpu, bool aarch64_only)\n \n \t\t\ttest_reg_vals[idx] = test_reg_set_success(vcpu, reg,\n \t\t\t\t\t\t\t\t \u0026ftr_bits[j]);\n-\n-\t\t\tksft_test_result_pass(\"%s\\n\", ftr_bits[j].name);\n \t\t}\n \t}\n }\n@@ -674,7 +723,8 @@ static void test_guest_reg_read(struct kvm_vcpu *vcpu)\n \tstruct ucall uc;\n \n \twhile (!done) {\n-\t\tu64 val;\n+\t\tu64 reg_id, expected_val, guest_val;\n+\t\tbool match;\n \n \t\tvcpu_run(vcpu);\n \n@@ -683,11 +733,20 @@ static void test_guest_reg_read(struct kvm_vcpu *vcpu)\n \t\t\tREPORT_GUEST_ASSERT(uc);\n \t\t\tbreak;\n \t\tcase UCALL_SYNC:\n-\t\t\tval = test_reg_vals[encoding_to_range_idx(uc.args[2])];\n-\t\t\tval = reset_mutable_bits(uc.args[2], val);\n+\t\t\texpected_val = test_reg_vals[encoding_to_range_idx(uc.args[2])];\n+\t\t\texpected_val = reset_mutable_bits(uc.args[2], expected_val);\n \n \t\t\t/* Make sure the written values are seen by guest */\n-\t\t\tTEST_ASSERT_EQ(val, reset_mutable_bits(uc.args[2], uc.args[3]));\n+\t\t\treg_id = uc.args[2];\n+\t\t\tguest_val = reset_mutable_bits(uc.args[2], uc.args[3]);\n+\n+\t\t\tmatch = expected_val == guest_val;\n+\t\t\tif (!match)\n+\t\t\t\tksft_print_msg(\"%lx != %lx\\n\",\n+\t\t\t\t\t expected_val, guest_val);\n+\t\t\tksft_test_result(match,\n+\t\t\t\t\t \"%s value seen in guest\\n\",\n+\t\t\t\t\t get_reg_name(reg_id));\n \t\t\tbreak;\n \t\tcase UCALL_DONE:\n \t\t\tdone = true;\n@@ -775,13 +834,21 @@ static void test_vcpu_non_ftr_id_regs(struct kvm_vcpu *vcpu)\n static void test_assert_id_reg_unchanged(struct kvm_vcpu *vcpu, u32 encoding)\n {\n \tsize_t idx = encoding_to_range_idx(encoding);\n-\tu64 observed;\n+\tu64 observed, expected;\n+\tbool pass;\n \n \tobserved = vcpu_get_reg(vcpu, KVM_ARM64_SYS_REG(encoding));\n-\tTEST_ASSERT_EQ(reset_mutable_bits(encoding, test_reg_vals[idx]),\n-\t\t reset_mutable_bits(encoding, observed));\n+\tobserved = reset_mutable_bits(encoding, observed);\n+\texpected = reset_mutable_bits(encoding, test_reg_vals[idx]);\n+\tpass = expected == observed;\n+\tif (!pass)\n+\t\tksft_print_msg(\"%lx != %lx\\n\", expected, observed);\n+\tksft_test_result(pass, \"%s unchanged by reset\\n\",\n+\t\t\t get_reg_name(encoding));\n }\n \n+#define ID_REG_RESET_UNCHANGED_TEST (ARRAY_SIZE(test_regs) + NUM_EXTRA_REGS)\n+\n static void test_reset_preserves_id_regs(struct kvm_vcpu *vcpu)\n {\n \t/*\n@@ -799,8 +866,6 @@ static void test_reset_preserves_id_regs(struct kvm_vcpu *vcpu)\n \ttest_assert_id_reg_unchanged(vcpu, SYS_MIDR_EL1);\n \ttest_assert_id_reg_unchanged(vcpu, SYS_REVIDR_EL1);\n \ttest_assert_id_reg_unchanged(vcpu, SYS_AIDR_EL1);\n-\n-\tksft_test_result_pass(\"%s\\n\", __func__);\n }\n \n int main(void)\n@@ -828,10 +893,11 @@ int main(void)\n \n \tksft_print_header();\n \n-\ttest_cnt = 3 + MPAM_IDREG_TEST + MTE_IDREG_TEST;\n+\ttest_cnt = 2 + MPAM_IDREG_TEST + MTE_IDREG_TEST + GUEST_READ_TEST +\n+\t\tID_REG_RESET_UNCHANGED_TEST;\n \tfor (i = 0; i \u003c ARRAY_SIZE(test_regs); i++)\n \t\tfor (j = 0; test_regs[i].ftr_bits[j].type != FTR_END; j++)\n-\t\t\ttest_cnt++;\n+\t\t\ttest_cnt += 2;\n \n \tksft_set_plan(test_cnt);\n \n"
} |
| 2/1 | 2026/09/30 17:52 | agent | patch-evaluator |
0mModel:core Args: null Results: {
"EnableConfigs": null,
"FocusSymbols": [],
"Reasoning": "The patch only modifies a userspace selftest file (tools/testing/selftests/kvm/arm64/set_id_regs.c). It does not alter the kernel image (vmlinux) or any kernel modules, and it is also specific to arm64 while the target architecture is amd64. Therefore, it does not warrant fuzzing.",
"WorthFuzzing": false
}Instruction: You are an expert Linux kernel maintainer and security engineer.
Your job is to review a provided patch series and evaluate whether it warrants fuzzing with syzkaller.
IMPORTANT: The changes have ALREADY been applied and committed as the HEAD commit in
your workspace. Do NOT rely on internal assumptions. You must actively use your code access
tools to inspect the actual source code, callers, and surrounding context.
================================================================================
1. CORE TRIAGE PHILOSOPHY
================================================================================
The goal of patch fuzzing is to discover crashes, regressions, exposed latent bugs,
and newly triggered assertions introduced by the patch series.
- REACHABILITY IS THE PRIMARY GATE:
Fuzzing can only discover bugs in code that can actually execute in standard virtualized
environments (GCE or QEMU, utilizing software-emulated devices like USB gadgets, netdev, tun/tap).
If the modified code is structurally unreachable (see Section 2), it MUST NOT be fuzzed,
regardless of whether it adds assertions or complex logic.
- DO NOT BLINDLY TRUST "NO FUNCTIONAL CHANGE" (NFCI) OR "REFACTORING" CLAIMS:
Patch authors routinely label changes as "cleanups", "refactorings", or state
"No functional change intended". Do NOT take these claims at face value.
Code refactorings that rearrange logic, introduce helper functions, or alter state management
in core subsystems frequently introduce subtle semantic shifts or uncover latent kernel bugs.
If reachable executable code is modified or refactored, it MUST be fuzzed.
- NEW OR MODIFIED ASSERTIONS IN REACHABLE CODE MUST BE FUZZED:
When a patch introduces or modifies runtime checks or assertions (e.g., WARN_ON*, VM_WARN_ON*,
BUG_ON*, lockdep_assert*) in reachable code paths, it enforces new or stricter invariants.
Even if the author believes the invariant always holds, fuzzing is essential to verify whether
an unusual sequence of operations can violate it.
================================================================================
2. WHEN TO RETURN WorthFuzzing=false (NEGATIVE CRITERIA)
================================================================================
Return WorthFuzzing=false ONLY IF all modified code falls strictly into one or more of these categories:
- Non-kernel and non-executable changes:
* Modifications to Documentation/, comments, or spelling fixes.
* User-space directories, self-tests, samples, or scripts (e.g., tools/, samples/, scripts/, usr/)
that do not affect the compiled kernel image (vmlinux) or kernel modules.
* Purely decorative logging (e.g., message strings in pr_err, printk, dev_info) or tracepoints
that do not alter control flow or data structures.
* Build system or Kconfig changes that do not alter compiled C logic.
- Structurally unreachable hardware:
* Vendor-specific PCIe switches, SmartNICs, or GPU drivers (e.g., mlxsw, pds_core, qed,
ionic, amdgpu) requiring physical ASIC/PCIe cards not emulated in standard QEMU.
- Unreachable execution paths:
* Driver teardown callbacks (.remove, .shutdown, pci_unregister_driver) executed only during
physical PCI hot-unplug or manual sysfs driver unbinding.
* Code paths exclusive to architectures other than the target architecture.
================================================================================
3. WHEN TO RETURN WorthFuzzing=true (POSITIVE CRITERIA)
================================================================================
Return WorthFuzzing=true whenever the patch touches reachable executable code, including:
- Core Subsystems:
* Any logic modifications in memory management (mm/), synchronization/locking (kernel/locking/),
BPF, scheduler, core networking, VFS, or syscall handling.
- Refactorings and Code Cleanups:
* Any restructuring of reachable data structures, helper abstractions, or algorithm flows.
- Runtime Assertions and Defensive Checks:
* Any introduction or alteration of assertions (WARN_ON*, VM_WARN_ON*, BUG_ON*, etc.) in reachable paths.
- Reachable Drivers and Protocols:
* Drivers accessible via virtual buses (virtio, USB gadget, loopback, netlink, binder, sockets, etc.).
================================================================================
4. EXTRACTING FocusSymbols (PREVENTING DILUTION)
================================================================================
When WorthFuzzing=true, you must extract specific kernel functions into FocusSymbols to guide the fuzzer:
- AVOID UBIQUITOUS LIFECYCLE HOT-PATHS:
Do NOT list generic, ubiquitous functions called by almost every program in the corpus
(including, but not limited to: general memory allocators and deallocators, page fault
and trap handlers, or core synchronization primitives; this is not an exhaustive list).
Listing ubiquitous functions causes the fuzzer to classify thousands of unrelated tests as "focused",
which severely dilutes fuzzing effort away from the actual changes.
- TARGET SPECIFIC FEATURE LOGIC AND ENTRYPOINTS:
List functions that specifically implement the logic being added or altered, or direct API entrypoints
for the subsystem feature under review.
- HANDLING STATIC INLINE FUNCTIONS IN HEADERS (.h):
Compiler-inlined static functions (such as static inlines in mm/*.h or include/linux/*.h) lack
distinct symbol addresses in vmlinux and cannot be targeted directly by symbol coverage filters.
If the changes are primarily in static inline helpers, identify non-static, feature-specific caller
functions in .c files that exercise them (avoiding ubiquitous lifecycle wrappers).
================================================================================
5. IDENTIFYING EnableConfigs
================================================================================
Identify any specific CONFIG_ options required to properly compile and reach the modified code:
- Inspect Kconfig files and #ifdef guards; do not make assumptions.
- Check "depends on" lines in Kconfig to include any non-standard parent subsystem configs needed.
- Strip any 'CONFIG_' prefix (e.g., return "NET_IPV4" instead of "CONFIG_NET_IPV4").
Prefer calling several tools at the same time to save round-trips.
Use set-results tool to provide results of the analysis.
It must be called exactly once before the final reply.
Ignore results of this tool.
Prompt: Target architecture: amd64
For your convenience, here is the diff of the changes:
commit 879656cdeb371c5c484a69d5d126495793df2cea
Author: syz-cluster <triage@syzkaller.com>
Date: Wed Sep 30 17:52:39 2026 +0000
syz-cluster: applied patch under review
diff --git a/tools/testing/selftests/kvm/arm64/set_id_regs.c b/tools/testing/selftests/kvm/arm64/set_id_regs.c
index 7429a1055df56..43dd9506036cf 100644
--- a/tools/testing/selftests/kvm/arm64/set_id_regs.c
+++ b/tools/testing/selftests/kvm/arm64/set_id_regs.c
@@ -43,6 +43,7 @@ struct reg_ftr_bits {
};
struct test_feature_reg {
+ const char *name;
u32 reg;
const struct reg_ftr_bits *ftr_bits;
};
@@ -227,30 +228,32 @@ static const struct reg_ftr_bits ftr_id_aa64zfr0_el1[] = {
#define TEST_REG(id, table) \
{ \
- .reg = id, \
+ .name = #id, \
+ .reg = SYS_ ## id, \
.ftr_bits = &((table)[0]), \
}
static struct test_feature_reg test_regs[] = {
- TEST_REG(SYS_ID_AA64DFR0_EL1, ftr_id_aa64dfr0_el1),
- TEST_REG(SYS_ID_DFR0_EL1, ftr_id_dfr0_el1),
- TEST_REG(SYS_ID_AA64ISAR0_EL1, ftr_id_aa64isar0_el1),
- TEST_REG(SYS_ID_AA64ISAR1_EL1, ftr_id_aa64isar1_el1),
- TEST_REG(SYS_ID_AA64ISAR2_EL1, ftr_id_aa64isar2_el1),
- TEST_REG(SYS_ID_AA64ISAR3_EL1, ftr_id_aa64isar3_el1),
- TEST_REG(SYS_ID_AA64PFR0_EL1, ftr_id_aa64pfr0_el1),
- TEST_REG(SYS_ID_AA64PFR1_EL1, ftr_id_aa64pfr1_el1),
- TEST_REG(SYS_ID_AA64MMFR0_EL1, ftr_id_aa64mmfr0_el1),
- TEST_REG(SYS_ID_AA64MMFR1_EL1, ftr_id_aa64mmfr1_el1),
- TEST_REG(SYS_ID_AA64MMFR2_EL1, ftr_id_aa64mmfr2_el1),
- TEST_REG(SYS_ID_AA64MMFR3_EL1, ftr_id_aa64mmfr3_el1),
- TEST_REG(SYS_ID_AA64ZFR0_EL1, ftr_id_aa64zfr0_el1),
+ TEST_REG(ID_AA64DFR0_EL1, ftr_id_aa64dfr0_el1),
+ TEST_REG(ID_DFR0_EL1, ftr_id_dfr0_el1),
+ TEST_REG(ID_AA64ISAR0_EL1, ftr_id_aa64isar0_el1),
+ TEST_REG(ID_AA64ISAR1_EL1, ftr_id_aa64isar1_el1),
+ TEST_REG(ID_AA64ISAR2_EL1, ftr_id_aa64isar2_el1),
+ TEST_REG(ID_AA64ISAR3_EL1, ftr_id_aa64isar3_el1),
+ TEST_REG(ID_AA64PFR0_EL1, ftr_id_aa64pfr0_el1),
+ TEST_REG(ID_AA64PFR1_EL1, ftr_id_aa64pfr1_el1),
+ TEST_REG(ID_AA64MMFR0_EL1, ftr_id_aa64mmfr0_el1),
+ TEST_REG(ID_AA64MMFR1_EL1, ftr_id_aa64mmfr1_el1),
+ TEST_REG(ID_AA64MMFR2_EL1, ftr_id_aa64mmfr2_el1),
+ TEST_REG(ID_AA64MMFR3_EL1, ftr_id_aa64mmfr3_el1),
+ TEST_REG(ID_AA64ZFR0_EL1, ftr_id_aa64zfr0_el1),
};
#define GUEST_REG_SYNC(id) GUEST_SYNC_ARGS(0, id, read_sysreg_s(id), 0, 0);
static void guest_code(void)
{
+ /* Registers in test_regs array */
GUEST_REG_SYNC(SYS_ID_AA64DFR0_EL1);
GUEST_REG_SYNC(SYS_ID_DFR0_EL1);
GUEST_REG_SYNC(SYS_ID_AA64ISAR0_EL1);
@@ -264,6 +267,8 @@ static void guest_code(void)
GUEST_REG_SYNC(SYS_ID_AA64MMFR2_EL1);
GUEST_REG_SYNC(SYS_ID_AA64MMFR3_EL1);
GUEST_REG_SYNC(SYS_ID_AA64ZFR0_EL1);
+
+ /* Additional registers counted in NUM_EXTRA_REGS */
GUEST_REG_SYNC(SYS_MPIDR_EL1);
GUEST_REG_SYNC(SYS_CLIDR_EL1);
GUEST_REG_SYNC(SYS_CTR_EL0);
@@ -274,6 +279,35 @@ static void guest_code(void)
GUEST_DONE();
}
+#define NUM_EXTRA_REGS 6
+#define GUEST_READ_TEST (ARRAY_SIZE(test_regs) + NUM_EXTRA_REGS)
+
+static const char *get_reg_name(u64 id)
+{
+ int i;
+
+ for (i = 0; i < ARRAY_SIZE(test_regs); i++)
+ if (test_regs[i].reg == id)
+ return test_regs[i].name;
+
+ switch (id) {
+ case SYS_MPIDR_EL1:
+ return "MPIDR_EL1";
+ case SYS_CLIDR_EL1:
+ return "CLIDR_EL1";
+ case SYS_CTR_EL0:
+ return "CTR_EL0";
+ case SYS_MIDR_EL1:
+ return "MIDR_EL1";
+ case SYS_REVIDR_EL1:
+ return "REVIDR_EL1";
+ case SYS_AIDR_EL1:
+ return "AIDR_EL1";
+ default:
+ TEST_FAIL("Unknown register");
+ }
+}
+
/* Return a safe value to a given ftr_bits an ftr value */
u64 get_safe_value(const struct reg_ftr_bits *ftr_bits, u64 ftr)
{
@@ -388,6 +422,7 @@ static u64 test_reg_set_success(struct kvm_vcpu *vcpu, u64 reg,
u8 shift = ftr_bits->shift;
u64 mask = ftr_bits->mask;
u64 val, new_val, ftr;
+ bool match;
val = vcpu_get_reg(vcpu, reg);
ftr = (val & mask) >> shift;
@@ -400,7 +435,10 @@ static u64 test_reg_set_success(struct kvm_vcpu *vcpu, u64 reg,
vcpu_set_reg(vcpu, reg, val);
new_val = vcpu_get_reg(vcpu, reg);
- TEST_ASSERT_EQ(new_val, val);
+ match = new_val == val;
+ if (!match)
+ ksft_print_msg("%lx != %lx\n", new_val, val);
+ ksft_test_result(match, "%s valid write succeeded\n", ftr_bits->name);
return new_val;
}
@@ -412,6 +450,7 @@ static void test_reg_set_fail(struct kvm_vcpu *vcpu, u64 reg,
u64 mask = ftr_bits->mask;
u64 val, old_val, ftr;
int r;
+ bool match;
val = vcpu_get_reg(vcpu, reg);
ftr = (val & mask) >> shift;
@@ -424,11 +463,19 @@ static void test_reg_set_fail(struct kvm_vcpu *vcpu, u64 reg,
val |= ftr;
r = __vcpu_set_reg(vcpu, reg, val);
- TEST_ASSERT(r < 0 && errno == EINVAL,
- "Unexpected KVM_SET_ONE_REG error: r=%d, errno=%d", r, errno);
+ if (r >= 0 || errno != EINVAL) {
+ ksft_print_msg("Unexpected KVM_SET_ONE_REG error: r=%d, errno=%d (%s)\n",
+ r, errno, strerror(errno));
+ ksft_test_result_fail("%s invalid write rejected\n",
+ ftr_bits->name);
+ return;
+ }
val = vcpu_get_reg(vcpu, reg);
- TEST_ASSERT_EQ(val, old_val);
+ match = val == old_val;
+ if (!match)
+ ksft_print_msg("%lx != %lx\n", val, old_val);
+ ksft_test_result(match, "%s invalid write rejected\n", ftr_bits->name);
}
static u64 test_reg_vals[KVM_ARM_FEATURE_ID_RANGE_SIZE];
@@ -468,7 +515,11 @@ static void test_vm_ftr_id_regs(struct kvm_vcpu *vcpu, bool aarch64_only)
for (int j = 0; ftr_bits[j].type != FTR_END; j++) {
/* Skip aarch32 reg on aarch64 only system, since they are RAZ/WI. */
if (aarch64_only && sys_reg_CRm(reg_id) < 4) {
- ksft_test_result_skip("%s on AARCH64 only system\n",
+ ksft_print_msg("%s on AARCH64 only system\n",
+ ftr_bits[j].name);
+ ksft_test_result_skip("%s invalid write rejected\n",
+ ftr_bits[j].name);
+ ksft_test_result_skip("%s valid write succeeded\n",
ftr_bits[j].name);
continue;
}
@@ -480,8 +531,6 @@ static void test_vm_ftr_id_regs(struct kvm_vcpu *vcpu, bool aarch64_only)
test_reg_vals[idx] = test_reg_set_success(vcpu, reg,
&ftr_bits[j]);
-
- ksft_test_result_pass("%s\n", ftr_bits[j].name);
}
}
}
@@ -674,7 +723,8 @@ static void test_guest_reg_read(struct kvm_vcpu *vcpu)
struct ucall uc;
while (!done) {
- u64 val;
+ u64 reg_id, expected_val, guest_val;
+ bool match;
vcpu_run(vcpu);
@@ -683,11 +733,20 @@ static void test_guest_reg_read(struct kvm_vcpu *vcpu)
REPORT_GUEST_ASSERT(uc);
break;
case UCALL_SYNC:
- val = test_reg_vals[encoding_to_range_idx(uc.args[2])];
- val = reset_mutable_bits(uc.args[2], val);
+ expected_val = test_reg_vals[encoding_to_range_idx(uc.args[2])];
+ expected_val = reset_mutable_bits(uc.args[2], expected_val);
/* Make sure the written values are seen by guest */
- TEST_ASSERT_EQ(val, reset_mutable_bits(uc.args[2], uc.args[3]));
+ reg_id = uc.args[2];
+ guest_val = reset_mutable_bits(uc.args[2], uc.args[3]);
+
+ match = expected_val == guest_val;
+ if (!match)
+ ksft_print_msg("%lx != %lx\n",
+ expected_val, guest_val);
+ ksft_test_result(match,
+ "%s value seen in guest\n",
+ get_reg_name(reg_id));
break;
case UCALL_DONE:
done = true;
@@ -775,13 +834,21 @@ static void test_vcpu_non_ftr_id_regs(struct kvm_vcpu *vcpu)
static void test_assert_id_reg_unchanged(struct kvm_vcpu *vcpu, u32 encoding)
{
size_t idx = encoding_to_range_idx(encoding);
- u64 observed;
+ u64 observed, expected;
+ bool pass;
observed = vcpu_get_reg(vcpu, KVM_ARM64_SYS_REG(encoding));
- TEST_ASSERT_EQ(reset_mutable_bits(encoding, test_reg_vals[idx]),
- reset_mutable_bits(encoding, observed));
+ observed = reset_mutable_bits(encoding, observed);
+ expected = reset_mutable_bits(encoding, test_reg_vals[idx]);
+ pass = expected == observed;
+ if (!pass)
+ ksft_print_msg("%lx != %lx\n", expected, observed);
+ ksft_test_result(pass, "%s unchanged by reset\n",
+ get_reg_name(encoding));
}
+#define ID_REG_RESET_UNCHANGED_TEST (ARRAY_SIZE(test_regs) + NUM_EXTRA_REGS)
+
static void test_reset_preserves_id_regs(struct kvm_vcpu *vcpu)
{
/*
@@ -799,8 +866,6 @@ static void test_reset_preserves_id_regs(struct kvm_vcpu *vcpu)
test_assert_id_reg_unchanged(vcpu, SYS_MIDR_EL1);
test_assert_id_reg_unchanged(vcpu, SYS_REVIDR_EL1);
test_assert_id_reg_unchanged(vcpu, SYS_AIDR_EL1);
-
- ksft_test_result_pass("%s\n", __func__);
}
int main(void)
@@ -828,10 +893,11 @@ int main(void)
ksft_print_header();
- test_cnt = 3 + MPAM_IDREG_TEST + MTE_IDREG_TEST;
+ test_cnt = 2 + MPAM_IDREG_TEST + MTE_IDREG_TEST + GUEST_READ_TEST +
+ ID_REG_RESET_UNCHANGED_TEST;
for (i = 0; i < ARRAY_SIZE(test_regs); i++)
for (j = 0; test_regs[i].ftr_bits[j].type != FTR_END; j++)
- test_cnt++;
+ test_cnt += 2;
ksft_set_plan(test_cnt);
|
| 3/2 | 2026/09/30 17:52 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 6867 output: 36 thoughts: 292 Thoughts: **Fuzzing Evaluation: Quick Decision Time** Okay, so I need to decide if this patch series is worth fuzzing with syzkaller. The task at hand is to assess if the modified code warrants it. First, I need to take a quick look at the diff. It seems the change is only in `tools/testing/selftests/kvm/arm64/set_id_regs.c`. Hold on a minute. Let's make sure there aren't any other modified files. I'll quickly check with `git status` or `git show`, just to be certain. Ah, but before I do that, I should remember the negative criteria. It says I should immediately dismiss it if the changes are strictly one or more of these: non-kernel and non-executable stuff, documentation, comments, spelling fixes, or user-space directories like tools, samples, scripts that *don't* impact the kernel image or modules. Wait a second... it's just `tools/testing/selftests/kvm/arm64/set_id_regs.c`. And further, it's under `tools/testing/selftests/`, and it's for arm64 selftests. The instructions say the target is amd64! This seems like a slam-dunk. It's user-space, part of a test suite, and doesn't affect the core kernel. I still probably will quickly verify with `git diff` or `git show HEAD` just to be absolutely certain before I make my decision. |
| 4/2 | 2026/09/30 17:52 | tool | grepper |
0mError:no matches Args: {
"Expression": "tools/testing/selftests/kvm/arm64/set_id_regs.c"
}Results: {
"error": "no matches"
} |
| 5/2 | 2026/09/30 17:52 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 7544 output: 48 thoughts: 37 Thoughts: Here's a summary of my thought process: **Reviewing the Set ID Registers Test** Okay, let's just make sure I'm clear on the implementation. I need to go through `tools/testing/selftests/kvm/arm64/set_id_regs.c` and specifically look at the `read-file` operation. I need to confirm something there. I'll need to double check the specifics of the test. |
| 6/2 | 2026/09/30 17:52 | tool | read-file |
0mArgs:{
"File": "tools/testing/selftests/kvm/arm64/set_id_regs.c",
"FirstLine": 1,
"LineCount": 50
}Results: {
"Contents": " 1:\t// SPDX-License-Identifier: GPL-2.0-only\n 2:\t/*\n 3:\t * set_id_regs - Test for setting ID register from usersapce.\n 4:\t *\n 5:\t * Copyright (c) 2023 Google LLC.\n 6:\t *\n 7:\t *\n 8:\t * Test that KVM supports setting ID registers from userspace and handles the\n 9:\t * feature set correctly.\n 10:\t */\n 11:\t\n 12:\t#include \u003cstdint.h\u003e\n 13:\t#include \"kvm_util.h\"\n 14:\t#include \"processor.h\"\n 15:\t#include \"test_util.h\"\n 16:\t#include \u003clinux/bitfield.h\u003e\n 17:\t\n 18:\tenum ftr_type {\n 19:\t\tFTR_EXACT,\t\t\t/* Use a predefined safe value */\n 20:\t\tFTR_LOWER_SAFE,\t\t\t/* Smaller value is safe */\n 21:\t\tFTR_HIGHER_SAFE,\t\t/* Bigger value is safe */\n 22:\t\tFTR_HIGHER_OR_ZERO_SAFE,\t/* Bigger value is safe, but 0 is biggest */\n 23:\t\tFTR_END,\t\t\t/* Mark the last ftr bits */\n 24:\t};\n 25:\t\n 26:\t#define FTR_SIGNED\ttrue\t/* Value should be treated as signed */\n 27:\t#define FTR_UNSIGNED\tfalse\t/* Value should be treated as unsigned */\n 28:\t\n 29:\tstruct reg_ftr_bits {\n 30:\t\tchar *name;\n 31:\t\tbool sign;\n 32:\t\tenum ftr_type type;\n 33:\t\tu8 shift;\n 34:\t\tu64 mask;\n 35:\t\t/*\n 36:\t\t * For FTR_EXACT, safe_val is used as the exact safe value.\n 37:\t\t * For FTR_LOWER_SAFE, safe_val is used as the minimal safe value.\n 38:\t\t */\n 39:\t\ts64 safe_val;\n 40:\t\n 41:\t\t/* Allowed to be changed by the host after run */\n 42:\t\tbool mutable;\n 43:\t};\n 44:\t\n 45:\tstruct test_feature_reg {\n 46:\t\tconst char *name;\n 47:\t\tu32 reg;\n 48:\t\tconst struct reg_ftr_bits *ftr_bits;\n 49:\t};\n 50:\t\n"
} |
| 7/2 | 2026/09/30 17:52 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 8390 output: 109 thoughts: 471 Thoughts: **WorthFuzzing Decision for This Commit** Okay, so the only file this commit touches is `tools/testing/selftests/kvm/arm64/set_id_regs.c`. Before I make a final decision, I always double-check the git diff to make sure nothing else snuck in. I could use `git log` or `grepper` but `git grep` isn't quite the right tool here. Now, let's carefully review the rules for determining `WorthFuzzing`. Remember, we only return `WorthFuzzing=false` if *all* the modified code falls into specific negative categories. Let's make sure that's true: The rules clearly state we should return `WorthFuzzing=false` if the changes are: * Non-kernel and non-executable changes: Modifications to documentation, comments, or spelling fixes; user-space directories, self-tests, samples, or scripts (like `tools/`, `samples/`, `scripts/`, or `usr/`) that do not affect the compiled kernel image (`vmlinux`) or kernel modules; decorative logging or tracepoints that don't alter control flow or data structures; or build system or Kconfig changes that don't alter compiled C logic. * Structurally unreachable hardware. * Unreachable execution paths: Driver teardown callbacks only executed during hot-unplug or manual unbinding; code paths exclusive to architectures other than the target architecture. Looking at the code, it's pretty clear: 1. The changes are *entirely* within `tools/testing/selftests/`, which is a user-space selftest directory. This means it doesn't impact the compiled kernel image (`vmlinux`) or kernel modules. 2. It is specifically an arm64 selftest (`tools/testing/selftests/kvm/arm64/set_id_regs.c`), and the target architecture is amd64. Therefore, applying the rules, this commit is *not* worth fuzzing. I'm setting `WorthFuzzing` to `false`. Consequently: * `FocusSymbols` will be an empty list: `[]`. * `EnableConfigs` will also be an empty list: `[]`. * And I'll provide this concise reasoning for the decision. Now, let's call the `set-results` tool and move on. |
| 8/2 | 2026/09/30 17:53 | tool | set-results |
0mArgs:{
"EnableConfigs": [],
"FocusSymbols": [],
"Reasoning": "The patch only modifies a userspace selftest file (tools/testing/selftests/kvm/arm64/set_id_regs.c). It does not alter the kernel image (vmlinux) or any kernel modules, and it is also specific to arm64 while the target architecture is amd64. Therefore, it does not warrant fuzzing.",
"WorthFuzzing": false
}Results: {
"EnableConfigs": null,
"FocusSymbols": [],
"Reasoning": "The patch only modifies a userspace selftest file (tools/testing/selftests/kvm/arm64/set_id_regs.c). It does not alter the kernel image (vmlinux) or any kernel modules, and it is also specific to arm64 while the target architecture is amd64. Therefore, it does not warrant fuzzing.",
"WorthFuzzing": false
} |
| 9/1 | 2026/09/30 17:53 | action | If |
0mArgs:{
"WorthFuzzing": false
}Results: null |
| Total Calls | Total Tokens | Avg Tokens | Total Duration (Seconds) | Avg Duration (Seconds) |
|---|
| Total Calls | Total Duration (Seconds) | Avg Duration (Seconds) |
|---|