| Seq | Timestamp | Type | Name | Duration |
|---|---|---|---|---|
| 0/0 | 2026/07/20 11:30 | flow | patch-triage |
0mArgs:null Results: {
"EnableConfigs": [
"KVM"
],
"FocusSymbols": [
"do_secure_storage_access",
"uv_alloc_stor_var",
"uv_free_stor_var",
"uv_alloc_range_cb",
"uv_free_range_cb",
"ex_handler_zeropad"
],
"Reasoning": "The patch enables DCACHE_WORD_ACCESS for s390, introducing `load_unaligned_zeropad` and its exception handler `ex_handler_zeropad`. It also modifies KVM PV variable storage allocation to use new `uv_alloc_stor_var` and `uv_free_stor_var` functions, and updates `do_secure_storage_access` to handle kernel faults correctly. These are functional changes in architecture-specific memory and exception handling, as well as KVM, which can be reached during VFS operations and KVM VM lifecycle.",
"WorthFuzzing": true
} |
| 1/1 | 2026/07/20 11:30 | action | read-patch-diff |
0mArgs:null Results: {
"PatchDiff": "commit 9c045955ec62f5037b5bbf81441855e2ed4d5882\nAuthor: syz-cluster \u003ctriage@syzkaller.com\u003e\nDate: Mon Jul 20 11:30:00 2026 +0000\n\n syz-cluster: applied patch under review\n\ndiff --git a/arch/s390/Kconfig b/arch/s390/Kconfig\nindex 84404e6778d504..fe81c539ef2ffc 100644\n--- a/arch/s390/Kconfig\n+++ b/arch/s390/Kconfig\n@@ -163,6 +163,7 @@ config S390\n \tselect ARCH_WANTS_THP_SWAP\n \tselect BUILDTIME_TABLE_SORT\n \tselect CLONE_BACKWARDS2\n+\tselect DCACHE_WORD_ACCESS if !KMSAN\n \tselect DYNAMIC_FTRACE if FUNCTION_TRACER\n \tselect FUNCTION_ALIGNMENT_8B if CC_IS_GCC\n \tselect FUNCTION_ALIGNMENT_16B if !CC_IS_GCC\ndiff --git a/arch/s390/include/asm/asm-extable.h b/arch/s390/include/asm/asm-extable.h\nindex 99748c20e76713..d23ea0c94e4ea6 100644\n--- a/arch/s390/include/asm/asm-extable.h\n+++ b/arch/s390/include/asm/asm-extable.h\n@@ -12,6 +12,7 @@\n #define EX_TYPE_UA_FAULT\t3\n #define EX_TYPE_UA_LOAD_REG\t5\n #define EX_TYPE_UA_LOAD_REGPAIR\t6\n+#define EX_TYPE_ZEROPAD\t\t7\n #define EX_TYPE_FPC\t\t8\n #define EX_TYPE_UA_MVCOS_TO\t9\n #define EX_TYPE_UA_MVCOS_FROM\t10\n@@ -79,6 +80,9 @@\n #define EX_TABLE_UA_LOAD_REGPAIR(_fault, _target, _regerr, _regzero)\t\\\n \t__EX_TABLE(__ex_table, _fault, _target, EX_TYPE_UA_LOAD_REGPAIR, _regerr, _regzero, 0)\n \n+#define EX_TABLE_ZEROPAD(_fault, _target, _regdata, _regaddr)\t\t\\\n+\t__EX_TABLE(__ex_table, _fault, _target, EX_TYPE_ZEROPAD, _regdata, _regaddr, 0)\n+\n #define EX_TABLE_FPC(_fault, _target)\t\t\t\t\t\\\n \t__EX_TABLE(__ex_table, _fault, _target, EX_TYPE_FPC, __stringify(%%r0), __stringify(%%r0), 0)\n \ndiff --git a/arch/s390/include/asm/uv.h b/arch/s390/include/asm/uv.h\nindex d919e69662f584..153fed63adda3c 100644\n--- a/arch/s390/include/asm/uv.h\n+++ b/arch/s390/include/asm/uv.h\n@@ -635,6 +635,8 @@ int s390_wiggle_split_folio(struct mm_struct *mm, struct folio *folio);\n int __make_folio_secure(struct folio *folio, struct uv_cb_header *uvcb);\n int uv_convert_from_secure(unsigned long paddr);\n int uv_convert_from_secure_folio(struct folio *folio);\n+void *uv_alloc_stor_var(unsigned long size);\n+void uv_free_stor_var(void *stor_var);\n \n void setup_uv(void);\n \ndiff --git a/arch/s390/include/asm/word-at-a-time.h b/arch/s390/include/asm/word-at-a-time.h\nindex e9287036392d08..eaa19dee769941 100644\n--- a/arch/s390/include/asm/word-at-a-time.h\n+++ b/arch/s390/include/asm/word-at-a-time.h\n@@ -4,6 +4,7 @@\n \n #include \u003clinux/bitops.h\u003e\n #include \u003clinux/wordpart.h\u003e\n+#include \u003casm/asm-extable.h\u003e\n #include \u003casm/bitsperlong.h\u003e\n \n struct word_at_a_time {\n@@ -40,4 +41,25 @@ static inline unsigned long zero_bytemask(unsigned long data)\n \treturn ~1UL \u003c\u003c data;\n }\n \n+/*\n+ * Load an unaligned word from kernel space.\n+ *\n+ * In the (very unlikely) case of the word being a page-crosser\n+ * and the next page not being mapped, take the exception and\n+ * return zeroes in the non-existing part.\n+ */\n+static inline unsigned long load_unaligned_zeropad(const void *addr)\n+{\n+\tunsigned long data;\n+\n+\tasm_inline volatile(\n+\t\t\"0:\tlg\t%[data],0(%[addr])\\n\"\n+\t\t\"1:\tnopr\t%%r7\\n\"\n+\t\tEX_TABLE_ZEROPAD(0b, 1b, %[data], %[addr])\n+\t\tEX_TABLE_ZEROPAD(1b, 1b, %[data], %[addr])\n+\t\t: [data] \"=d\" (data)\n+\t\t: [addr] \"a\" (addr), \"m\" (*(unsigned long *)addr));\n+\treturn data;\n+}\n+\n #endif /* _ASM_WORD_AT_A_TIME_H */\ndiff --git a/arch/s390/kernel/uv.c b/arch/s390/kernel/uv.c\nindex a284f98d971680..d1cdc5ae5e270c 100644\n--- a/arch/s390/kernel/uv.c\n+++ b/arch/s390/kernel/uv.c\n@@ -16,6 +16,7 @@\n #include \u003clinux/swap.h\u003e\n #include \u003clinux/pagewalk.h\u003e\n #include \u003clinux/backing-dev.h\u003e\n+#include \u003clinux/vmalloc.h\u003e\n #include \u003casm/facility.h\u003e\n #include \u003casm/sections.h\u003e\n #include \u003casm/uv.h\u003e\n@@ -209,6 +210,70 @@ int uv_convert_from_secure_pte(pte_t pte)\n \treturn uv_convert_from_secure_folio(pfn_folio(pte_pfn(pte)));\n }\n \n+static int uv_free_range_cb(pte_t *ptep, unsigned long addr, void *data)\n+{\n+\tpte_t pte = ptep_get(ptep);\n+\n+\tif (!pte_present(pte))\n+\t\treturn 0;\n+\t/*\n+\t * Note: do not update the pte here, since there is no code which\n+\t * accesses the memory range, besides bugs. The invalidation of ptes\n+\t * and TLB flushing is deferred like for regular vfree() calls.\n+\t */\n+\t__free_page(pte_page(pte));\n+\treturn 0;\n+}\n+\n+void uv_free_stor_var(void *stor_var)\n+{\n+\tunsigned long addr, size;\n+\tstruct vm_struct *area;\n+\n+\tif (!stor_var)\n+\t\treturn;\n+\tarea = find_vm_area(stor_var);\n+\tif (WARN_ON_ONCE(!area || !(area-\u003eflags \u0026 VM_SPARSE)))\n+\t\treturn;\n+\tsize = get_vm_area_size(area);\n+\taddr = (unsigned long)area-\u003eaddr;\n+\tapply_to_existing_page_range(\u0026init_mm, addr, size, uv_free_range_cb, NULL);\n+\tfree_vm_area(area);\n+}\n+EXPORT_SYMBOL_FOR_MODULES(uv_free_stor_var, \"kvm\");\n+\n+static int uv_alloc_range_cb(pte_t *ptep, unsigned long addr, void *data)\n+{\n+\tstruct page *page;\n+\tpte_t pte;\n+\n+\tpage = alloc_page(GFP_KERNEL_ACCOUNT | __GFP_ZERO);\n+\tif (!page)\n+\t\treturn -ENOMEM;\n+\tpte = __pte(page_to_phys(page) | pgprot_val(PAGE_KERNEL));\n+\tset_pte(ptep, pte);\n+\treturn 0;\n+}\n+\n+void *uv_alloc_stor_var(unsigned long size)\n+{\n+\tstruct vm_struct *area;\n+\tunsigned long addr;\n+\n+\tsize = PAGE_ALIGN(size);\n+\tarea = get_vm_area(size, VM_SPARSE);\n+\tif (!area)\n+\t\treturn NULL;\n+\taddr = (unsigned long)area-\u003eaddr;\n+\tif (apply_to_page_range(\u0026init_mm, addr, size, uv_alloc_range_cb, NULL))\n+\t\tgoto out;\n+\treturn area-\u003eaddr;\n+out:\n+\tuv_free_stor_var(area-\u003eaddr);\n+\treturn NULL;\n+}\n+EXPORT_SYMBOL_FOR_MODULES(uv_alloc_stor_var, \"kvm\");\n+\n /*\n * Calculate the expected ref_count for a folio that would otherwise have no\n * further pins. This was cribbed from similar functions in other places in\ndiff --git a/arch/s390/kvm/pv.c b/arch/s390/kvm/pv.c\nindex 1beacc841ca850..dc5ac29b4c3118 100644\n--- a/arch/s390/kvm/pv.c\n+++ b/arch/s390/kvm/pv.c\n@@ -337,7 +337,7 @@ int kvm_s390_pv_create_cpu(struct kvm_vcpu *vcpu, u16 *rc, u16 *rrc)\n /* only free resources when the destroy was successful */\n static void kvm_s390_pv_dealloc_vm(struct kvm *kvm)\n {\n-\tvfree(kvm-\u003earch.pv.stor_var);\n+\tuv_free_stor_var(kvm-\u003earch.pv.stor_var);\n \tfree_pages(kvm-\u003earch.pv.stor_base,\n \t\t get_order(uv_info.guest_base_stor_len));\n \tkvm_s390_clear_pv_state(kvm);\n@@ -369,7 +369,7 @@ static int kvm_s390_pv_alloc_vm(struct kvm *kvm)\n \t/* Allocate variable storage */\n \tvlen = ALIGN(virt * ((npages * PAGE_SIZE) / HPAGE_SIZE), PAGE_SIZE);\n \tvlen += uv_info.guest_virt_base_stor_len;\n-\tkvm-\u003earch.pv.stor_var = vzalloc(vlen);\n+\tkvm-\u003earch.pv.stor_var = uv_alloc_stor_var(vlen);\n \tif (!kvm-\u003earch.pv.stor_var)\n \t\tgoto out_err;\n \treturn 0;\n@@ -414,7 +414,7 @@ static int kvm_s390_pv_dispose_one_leftover(struct kvm *kvm,\n \t */\n \tfree_pages(leftover-\u003estor_base, get_order(uv_info.guest_base_stor_len));\n \tfree_pages(leftover-\u003eold_gmap_table, CRST_ALLOC_ORDER);\n-\tvfree(leftover-\u003estor_var);\n+\tuv_free_stor_var(leftover-\u003estor_var);\n done_fast:\n \tatomic_dec(\u0026kvm-\u003emm-\u003econtext.protected_count);\n \treturn 0;\ndiff --git a/arch/s390/mm/extable.c b/arch/s390/mm/extable.c\nindex 063b4346742d96..7498e858c40195 100644\n--- a/arch/s390/mm/extable.c\n+++ b/arch/s390/mm/extable.c\n@@ -50,6 +50,22 @@ static bool ex_handler_ua_load_reg(const struct exception_table_entry *ex,\n \treturn true;\n }\n \n+static bool ex_handler_zeropad(const struct exception_table_entry *ex, struct pt_regs *regs)\n+{\n+\tunsigned int reg_addr = FIELD_GET(EX_DATA_REG_ADDR, ex-\u003edata);\n+\tunsigned int reg_data = FIELD_GET(EX_DATA_REG_ERR, ex-\u003edata);\n+\tunsigned long data, addr, offset;\n+\n+\taddr = regs-\u003egprs[reg_addr];\n+\toffset = addr \u0026 (sizeof(unsigned long) - 1);\n+\taddr \u0026= ~(sizeof(unsigned long) - 1);\n+\tdata = *(unsigned long *)addr;\n+\tdata \u003c\u003c= BITS_PER_BYTE * offset;\n+\tregs-\u003egprs[reg_data] = data;\n+\tregs-\u003epsw.addr = extable_fixup(ex);\n+\treturn true;\n+}\n+\n static bool ex_handler_fpc(const struct exception_table_entry *ex, struct pt_regs *regs)\n {\n \tfpu_sfpc(0);\n@@ -118,6 +134,8 @@ bool fixup_exception(struct pt_regs *regs)\n \t\treturn ex_handler_ua_load_reg(ex, false, regs);\n \tcase EX_TYPE_UA_LOAD_REGPAIR:\n \t\treturn ex_handler_ua_load_reg(ex, true, regs);\n+\tcase EX_TYPE_ZEROPAD:\n+\t\treturn ex_handler_zeropad(ex, regs);\n \tcase EX_TYPE_FPC:\n \t\treturn ex_handler_fpc(ex, regs);\n \tcase EX_TYPE_UA_MVCOS_TO:\ndiff --git a/arch/s390/mm/fault.c b/arch/s390/mm/fault.c\nindex 028aeb9c48d6ff..666fe8e9948019 100644\n--- a/arch/s390/mm/fault.c\n+++ b/arch/s390/mm/fault.c\n@@ -409,9 +409,9 @@ void do_secure_storage_access(struct pt_regs *regs)\n {\n \tunion teid teid = { .val = regs-\u003eint_parm_long };\n \tunsigned long addr = get_fault_address(regs);\n+\tstruct mm_struct *mm = current-\u003emm;\n \tstruct vm_area_struct *vma;\n \tstruct folio_walk fw;\n-\tstruct mm_struct *mm;\n \tstruct folio *folio;\n \tint rc;\n \n@@ -427,10 +427,8 @@ void do_secure_storage_access(struct pt_regs *regs)\n \t\t * was not supposed to do, e.g. branching into secure\n \t\t * memory. Trigger a segmentation fault.\n \t\t */\n-\t\tif (user_mode(regs)) {\n-\t\t\tsend_sig(SIGSEGV, current, 0);\n-\t\t\treturn;\n-\t\t}\n+\t\tif (user_mode(regs))\n+\t\t\treturn handle_fault_error_nolock(regs, SEGV_ACCERR);\n \t\t/*\n \t\t * The kernel should never run into this case and\n \t\t * there is no way out of this situation.\n@@ -438,13 +436,9 @@ void do_secure_storage_access(struct pt_regs *regs)\n \t\tpanic(\"Unexpected PGM 0x3d with TEID bit 61=0\");\n \t}\n \tif (is_kernel_fault(regs)) {\n-\t\tfolio = virt_to_folio((void *)addr);\n-\t\tif (unlikely(!folio_try_get(folio)))\n-\t\t\treturn;\n-\t\trc = uv_convert_from_secure(folio_to_phys(folio));\n-\t\tif (!rc)\n-\t\t\tclear_bit(PG_arch_1, \u0026folio-\u003eflags.f);\n-\t\tfolio_put(folio);\n+\t\tif (is_vmalloc_addr((void *)addr))\n+\t\t\treturn handle_fault_error_nolock(regs, 0);\n+\t\trc = uv_convert_from_secure(__pa(addr));\n \t\t/*\n \t\t * There are some valid fixup types for kernel\n \t\t * accesses to donated secure memory. zeropad is one\n@@ -453,25 +447,22 @@ void do_secure_storage_access(struct pt_regs *regs)\n \t\tif (rc)\n \t\t\treturn handle_fault_error_nolock(regs, 0);\n \t} else {\n-\t\tif (faulthandler_disabled())\n+\t\tif (faulthandler_disabled() || !mm)\n \t\t\treturn handle_fault_error_nolock(regs, 0);\n-\t\tmm = current-\u003emm;\n-\t\tmmap_read_lock(mm);\n-\t\tvma = find_vma(mm, addr);\n+\t\tvma = lock_mm_and_find_vma(mm, addr, regs);\n \t\tif (!vma)\n-\t\t\treturn handle_fault_error(regs, SEGV_MAPERR);\n+\t\t\treturn handle_fault_error_nolock(regs, SEGV_MAPERR);\n \t\tfolio = folio_walk_start(\u0026fw, vma, addr, 0);\n-\t\tif (!folio) {\n-\t\t\tmmap_read_unlock(mm);\n-\t\t\treturn;\n-\t\t}\n+\t\tif (!folio)\n+\t\t\tgoto out;\n \t\t/* arch_make_folio_accessible() needs a raised refcount. */\n \t\tfolio_get(folio);\n \t\trc = arch_make_folio_accessible(folio);\n \t\tfolio_put(folio);\n \t\tfolio_walk_end(\u0026fw, vma);\n \t\tif (rc)\n-\t\t\tsend_sig(SIGSEGV, current, 0);\n+\t\t\treturn handle_fault_error(regs, SEGV_ACCERR);\n+out:\n \t\tmmap_read_unlock(mm);\n \t}\n }\n"
} |
| 2/1 | 2026/07/20 11:30 | agent | patch-evaluator |
0mModel:gemini-3.1-pro-preview Args: null Results: {
"EnableConfigs": [
"KVM"
],
"FocusSymbols": [
"do_secure_storage_access",
"uv_alloc_stor_var",
"uv_free_stor_var",
"uv_alloc_range_cb",
"uv_free_range_cb",
"ex_handler_zeropad"
],
"Reasoning": "The patch enables DCACHE_WORD_ACCESS for s390, introducing `load_unaligned_zeropad` and its exception handler `ex_handler_zeropad`. It also modifies KVM PV variable storage allocation to use new `uv_alloc_stor_var` and `uv_free_stor_var` functions, and updates `do_secure_storage_access` to handle kernel faults correctly. These are functional changes in architecture-specific memory and exception handling, as well as KVM, which can be reached during VFS operations and KVM VM lifecycle.",
"WorthFuzzing": true
}Instruction: You are an expert Linux kernel maintainer. Your job is to review a provided patch series and determine if it makes functional changes to the kernel that should be fuzzed. IMPORTANT: The changes have ALREADY been applied and committed as the HEAD commit in your workspace. Do NOT rely on your internal knowledge of the kernel. You must actively use your code access tools to examine the actual source code and confirm any assumptions. Return WorthFuzzing=false if the patch only contains: - Modifications to Documentation/, Kconfig files, or code comments. - Purely decorative changes, such as logging (e.g., pr_err, printk) or tracepoints. - Changes to numeric constants or macros that do not functionally alter execution flow. - Code paths that are impossible to reach in virtualized environments like GCE or QEMU, even when utilizing software-emulated hardware (e.g., usb gadget, mac80211_hwsim). If it modifies reachable core kernel logic, drivers, or architectures, use your code search tools to verify the code can be executed, then return WorthFuzzing=true. When returning WorthFuzzing=true, you MUST ALSO: 1. Extract any specific kernel functions that should be heavily fuzzed into FocusSymbols. Avoid listing generic hot-path functions to prevent skewed test distributions. 2. Identify any specific CONFIG_ options required to properly test this new/modified feature. Go and look into the Kconfig files and check for ifdefs around the code, do not make assumptions. Do not list too generic configs (we already have them enabled). Only list those that specifically cover the modified code. List them in the EnableConfigs output array, and DO NOT add a '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: For your convenience, here is the diff of the changes:
commit 9c045955ec62f5037b5bbf81441855e2ed4d5882
Author: syz-cluster <triage@syzkaller.com>
Date: Mon Jul 20 11:30:00 2026 +0000
syz-cluster: applied patch under review
diff --git a/arch/s390/Kconfig b/arch/s390/Kconfig
index 84404e6778d504..fe81c539ef2ffc 100644
--- a/arch/s390/Kconfig
+++ b/arch/s390/Kconfig
@@ -163,6 +163,7 @@ config S390
select ARCH_WANTS_THP_SWAP
select BUILDTIME_TABLE_SORT
select CLONE_BACKWARDS2
+ select DCACHE_WORD_ACCESS if !KMSAN
select DYNAMIC_FTRACE if FUNCTION_TRACER
select FUNCTION_ALIGNMENT_8B if CC_IS_GCC
select FUNCTION_ALIGNMENT_16B if !CC_IS_GCC
diff --git a/arch/s390/include/asm/asm-extable.h b/arch/s390/include/asm/asm-extable.h
index 99748c20e76713..d23ea0c94e4ea6 100644
--- a/arch/s390/include/asm/asm-extable.h
+++ b/arch/s390/include/asm/asm-extable.h
@@ -12,6 +12,7 @@
#define EX_TYPE_UA_FAULT 3
#define EX_TYPE_UA_LOAD_REG 5
#define EX_TYPE_UA_LOAD_REGPAIR 6
+#define EX_TYPE_ZEROPAD 7
#define EX_TYPE_FPC 8
#define EX_TYPE_UA_MVCOS_TO 9
#define EX_TYPE_UA_MVCOS_FROM 10
@@ -79,6 +80,9 @@
#define EX_TABLE_UA_LOAD_REGPAIR(_fault, _target, _regerr, _regzero) \
__EX_TABLE(__ex_table, _fault, _target, EX_TYPE_UA_LOAD_REGPAIR, _regerr, _regzero, 0)
+#define EX_TABLE_ZEROPAD(_fault, _target, _regdata, _regaddr) \
+ __EX_TABLE(__ex_table, _fault, _target, EX_TYPE_ZEROPAD, _regdata, _regaddr, 0)
+
#define EX_TABLE_FPC(_fault, _target) \
__EX_TABLE(__ex_table, _fault, _target, EX_TYPE_FPC, __stringify(%%r0), __stringify(%%r0), 0)
diff --git a/arch/s390/include/asm/uv.h b/arch/s390/include/asm/uv.h
index d919e69662f584..153fed63adda3c 100644
--- a/arch/s390/include/asm/uv.h
+++ b/arch/s390/include/asm/uv.h
@@ -635,6 +635,8 @@ int s390_wiggle_split_folio(struct mm_struct *mm, struct folio *folio);
int __make_folio_secure(struct folio *folio, struct uv_cb_header *uvcb);
int uv_convert_from_secure(unsigned long paddr);
int uv_convert_from_secure_folio(struct folio *folio);
+void *uv_alloc_stor_var(unsigned long size);
+void uv_free_stor_var(void *stor_var);
void setup_uv(void);
diff --git a/arch/s390/include/asm/word-at-a-time.h b/arch/s390/include/asm/word-at-a-time.h
index e9287036392d08..eaa19dee769941 100644
--- a/arch/s390/include/asm/word-at-a-time.h
+++ b/arch/s390/include/asm/word-at-a-time.h
@@ -4,6 +4,7 @@
#include <linux/bitops.h>
#include <linux/wordpart.h>
+#include <asm/asm-extable.h>
#include <asm/bitsperlong.h>
struct word_at_a_time {
@@ -40,4 +41,25 @@ static inline unsigned long zero_bytemask(unsigned long data)
return ~1UL << data;
}
+/*
+ * Load an unaligned word from kernel space.
+ *
+ * In the (very unlikely) case of the word being a page-crosser
+ * and the next page not being mapped, take the exception and
+ * return zeroes in the non-existing part.
+ */
+static inline unsigned long load_unaligned_zeropad(const void *addr)
+{
+ unsigned long data;
+
+ asm_inline volatile(
+ "0: lg %[data],0(%[addr])\n"
+ "1: nopr %%r7\n"
+ EX_TABLE_ZEROPAD(0b, 1b, %[data], %[addr])
+ EX_TABLE_ZEROPAD(1b, 1b, %[data], %[addr])
+ : [data] "=d" (data)
+ : [addr] "a" (addr), "m" (*(unsigned long *)addr));
+ return data;
+}
+
#endif /* _ASM_WORD_AT_A_TIME_H */
diff --git a/arch/s390/kernel/uv.c b/arch/s390/kernel/uv.c
index a284f98d971680..d1cdc5ae5e270c 100644
--- a/arch/s390/kernel/uv.c
+++ b/arch/s390/kernel/uv.c
@@ -16,6 +16,7 @@
#include <linux/swap.h>
#include <linux/pagewalk.h>
#include <linux/backing-dev.h>
+#include <linux/vmalloc.h>
#include <asm/facility.h>
#include <asm/sections.h>
#include <asm/uv.h>
@@ -209,6 +210,70 @@ int uv_convert_from_secure_pte(pte_t pte)
return uv_convert_from_secure_folio(pfn_folio(pte_pfn(pte)));
}
+static int uv_free_range_cb(pte_t *ptep, unsigned long addr, void *data)
+{
+ pte_t pte = ptep_get(ptep);
+
+ if (!pte_present(pte))
+ return 0;
+ /*
+ * Note: do not update the pte here, since there is no code which
+ * accesses the memory range, besides bugs. The invalidation of ptes
+ * and TLB flushing is deferred like for regular vfree() calls.
+ */
+ __free_page(pte_page(pte));
+ return 0;
+}
+
+void uv_free_stor_var(void *stor_var)
+{
+ unsigned long addr, size;
+ struct vm_struct *area;
+
+ if (!stor_var)
+ return;
+ area = find_vm_area(stor_var);
+ if (WARN_ON_ONCE(!area || !(area->flags & VM_SPARSE)))
+ return;
+ size = get_vm_area_size(area);
+ addr = (unsigned long)area->addr;
+ apply_to_existing_page_range(&init_mm, addr, size, uv_free_range_cb, NULL);
+ free_vm_area(area);
+}
+EXPORT_SYMBOL_FOR_MODULES(uv_free_stor_var, "kvm");
+
+static int uv_alloc_range_cb(pte_t *ptep, unsigned long addr, void *data)
+{
+ struct page *page;
+ pte_t pte;
+
+ page = alloc_page(GFP_KERNEL_ACCOUNT | __GFP_ZERO);
+ if (!page)
+ return -ENOMEM;
+ pte = __pte(page_to_phys(page) | pgprot_val(PAGE_KERNEL));
+ set_pte(ptep, pte);
+ return 0;
+}
+
+void *uv_alloc_stor_var(unsigned long size)
+{
+ struct vm_struct *area;
+ unsigned long addr;
+
+ size = PAGE_ALIGN(size);
+ area = get_vm_area(size, VM_SPARSE);
+ if (!area)
+ return NULL;
+ addr = (unsigned long)area->addr;
+ if (apply_to_page_range(&init_mm, addr, size, uv_alloc_range_cb, NULL))
+ goto out;
+ return area->addr;
+out:
+ uv_free_stor_var(area->addr);
+ return NULL;
+}
+EXPORT_SYMBOL_FOR_MODULES(uv_alloc_stor_var, "kvm");
+
/*
* Calculate the expected ref_count for a folio that would otherwise have no
* further pins. This was cribbed from similar functions in other places in
diff --git a/arch/s390/kvm/pv.c b/arch/s390/kvm/pv.c
index 1beacc841ca850..dc5ac29b4c3118 100644
--- a/arch/s390/kvm/pv.c
+++ b/arch/s390/kvm/pv.c
@@ -337,7 +337,7 @@ int kvm_s390_pv_create_cpu(struct kvm_vcpu *vcpu, u16 *rc, u16 *rrc)
/* only free resources when the destroy was successful */
static void kvm_s390_pv_dealloc_vm(struct kvm *kvm)
{
- vfree(kvm->arch.pv.stor_var);
+ uv_free_stor_var(kvm->arch.pv.stor_var);
free_pages(kvm->arch.pv.stor_base,
get_order(uv_info.guest_base_stor_len));
kvm_s390_clear_pv_state(kvm);
@@ -369,7 +369,7 @@ static int kvm_s390_pv_alloc_vm(struct kvm *kvm)
/* Allocate variable storage */
vlen = ALIGN(virt * ((npages * PAGE_SIZE) / HPAGE_SIZE), PAGE_SIZE);
vlen += uv_info.guest_virt_base_stor_len;
- kvm->arch.pv.stor_var = vzalloc(vlen);
+ kvm->arch.pv.stor_var = uv_alloc_stor_var(vlen);
if (!kvm->arch.pv.stor_var)
goto out_err;
return 0;
@@ -414,7 +414,7 @@ static int kvm_s390_pv_dispose_one_leftover(struct kvm *kvm,
*/
free_pages(leftover->stor_base, get_order(uv_info.guest_base_stor_len));
free_pages(leftover->old_gmap_table, CRST_ALLOC_ORDER);
- vfree(leftover->stor_var);
+ uv_free_stor_var(leftover->stor_var);
done_fast:
atomic_dec(&kvm->mm->context.protected_count);
return 0;
diff --git a/arch/s390/mm/extable.c b/arch/s390/mm/extable.c
index 063b4346742d96..7498e858c40195 100644
--- a/arch/s390/mm/extable.c
+++ b/arch/s390/mm/extable.c
@@ -50,6 +50,22 @@ static bool ex_handler_ua_load_reg(const struct exception_table_entry *ex,
return true;
}
+static bool ex_handler_zeropad(const struct exception_table_entry *ex, struct pt_regs *regs)
+{
+ unsigned int reg_addr = FIELD_GET(EX_DATA_REG_ADDR, ex->data);
+ unsigned int reg_data = FIELD_GET(EX_DATA_REG_ERR, ex->data);
+ unsigned long data, addr, offset;
+
+ addr = regs->gprs[reg_addr];
+ offset = addr & (sizeof(unsigned long) - 1);
+ addr &= ~(sizeof(unsigned long) - 1);
+ data = *(unsigned long *)addr;
+ data <<= BITS_PER_BYTE * offset;
+ regs->gprs[reg_data] = data;
+ regs->psw.addr = extable_fixup(ex);
+ return true;
+}
+
static bool ex_handler_fpc(const struct exception_table_entry *ex, struct pt_regs *regs)
{
fpu_sfpc(0);
@@ -118,6 +134,8 @@ bool fixup_exception(struct pt_regs *regs)
return ex_handler_ua_load_reg(ex, false, regs);
case EX_TYPE_UA_LOAD_REGPAIR:
return ex_handler_ua_load_reg(ex, true, regs);
+ case EX_TYPE_ZEROPAD:
+ return ex_handler_zeropad(ex, regs);
case EX_TYPE_FPC:
return ex_handler_fpc(ex, regs);
case EX_TYPE_UA_MVCOS_TO:
diff --git a/arch/s390/mm/fault.c b/arch/s390/mm/fault.c
index 028aeb9c48d6ff..666fe8e9948019 100644
--- a/arch/s390/mm/fault.c
+++ b/arch/s390/mm/fault.c
@@ -409,9 +409,9 @@ void do_secure_storage_access(struct pt_regs *regs)
{
union teid teid = { .val = regs->int_parm_long };
unsigned long addr = get_fault_address(regs);
+ struct mm_struct *mm = current->mm;
struct vm_area_struct *vma;
struct folio_walk fw;
- struct mm_struct *mm;
struct folio *folio;
int rc;
@@ -427,10 +427,8 @@ void do_secure_storage_access(struct pt_regs *regs)
* was not supposed to do, e.g. branching into secure
* memory. Trigger a segmentation fault.
*/
- if (user_mode(regs)) {
- send_sig(SIGSEGV, current, 0);
- return;
- }
+ if (user_mode(regs))
+ return handle_fault_error_nolock(regs, SEGV_ACCERR);
/*
* The kernel should never run into this case and
* there is no way out of this situation.
@@ -438,13 +436,9 @@ void do_secure_storage_access(struct pt_regs *regs)
panic("Unexpected PGM 0x3d with TEID bit 61=0");
}
if (is_kernel_fault(regs)) {
- folio = virt_to_folio((void *)addr);
- if (unlikely(!folio_try_get(folio)))
- return;
- rc = uv_convert_from_secure(folio_to_phys(folio));
- if (!rc)
- clear_bit(PG_arch_1, &folio->flags.f);
- folio_put(folio);
+ if (is_vmalloc_addr((void *)addr))
+ return handle_fault_error_nolock(regs, 0);
+ rc = uv_convert_from_secure(__pa(addr));
/*
* There are some valid fixup types for kernel
* accesses to donated secure memory. zeropad is one
@@ -453,25 +447,22 @@ void do_secure_storage_access(struct pt_regs *regs)
if (rc)
return handle_fault_error_nolock(regs, 0);
} else {
- if (faulthandler_disabled())
+ if (faulthandler_disabled() || !mm)
return handle_fault_error_nolock(regs, 0);
- mm = current->mm;
- mmap_read_lock(mm);
- vma = find_vma(mm, addr);
+ vma = lock_mm_and_find_vma(mm, addr, regs);
if (!vma)
- return handle_fault_error(regs, SEGV_MAPERR);
+ return handle_fault_error_nolock(regs, SEGV_MAPERR);
folio = folio_walk_start(&fw, vma, addr, 0);
- if (!folio) {
- mmap_read_unlock(mm);
- return;
- }
+ if (!folio)
+ goto out;
/* arch_make_folio_accessible() needs a raised refcount. */
folio_get(folio);
rc = arch_make_folio_accessible(folio);
folio_put(folio);
folio_walk_end(&fw, vma);
if (rc)
- send_sig(SIGSEGV, current, 0);
+ return handle_fault_error(regs, SEGV_ACCERR);
+out:
mmap_read_unlock(mm);
}
}
|
| 3/2 | 2026/07/20 11:30 | llm | patch-evaluator |
0mModel:gemini-3.1-pro-preview Args: null Results: null Tokens: input: 6203 output: 33 thoughts: 706 Thoughts: **Analyzing the s390 Architecture Patch** Okay, so I've got this patch here targeting the s390 architecture. Looks like the core of it revolves around a few key additions: `DCACHE_WORD_ACCESS`, which is now being enabled for s390 when KMSAN isn't in play, some modifications to the exception table with `EX_TYPE_ZEROPAD` and `EX_TABLE_ZEROPAD`, new functions for variable storage management (`uv_alloc_stor_var` and `uv_free_stor_var`) and the introduction of `load_unaligned_zeropad` for word-at-a-time access within the dcache. It's also modifying a few KVM PV-related functions, specifically those that allocate and deallocate virtual machines, to use these new storage functions. We've got changes in the exception handler (`ex_handler_zeropad`) and the secure storage access function (`do_secure_storage_access`) as well. Functionally, this seems pretty clear: this is about KVM PV code and exception handling for secure storage access on s390. `load_unaligned_zeropad` is key here, directly impacting `DCACHE_WORD_ACCESS`, meaning this has implications for *all* VFS path lookups on s390x now that the word-at-a-time feature is present. It's definitely active and ready to cause some interesting results. Now, the question is reachability. Given that QEMU supports s390x, and we can test KVM on s390x with nested virtualization or, wait, wasn't syzkaller running on s390x? Yes! That's perfect. The changes to `do_secure_storage_access` and `uv_alloc_stor_var` clearly tie into KVM PV. And the dcache changes mean *every* VFS lookup on s390x is affected. So, where do we focus? I think these are the critical functions: `do_secure_storage_access`, `uv_alloc_stor_var`, `uv_free_stor_var`, and `load_unaligned_zeropad` (even if it's inline, it's used in the VFS!). `ex_handler_zeropad`, is also a good target being an exception handler. Let me take a quick look at `Kconfig` to confirm the dependency of `DCACHE_WORD_ACCESS` on `S390` and the exclusion of `KMSAN`. And I'll double-check the KVM configs for s390. It looks like it's just `CONFIG_KVM` that's needed for the pv.c code, nothing exotic. I'll need to verify if `uv_alloc_stor_var` is compiled conditionally. A quick check of the makefiles and Kconfig should do the trick. |
| 4/2 | 2026/07/20 11:30 | tool | grepper |
0mArgs:{
"Expression": "uv\\.o",
"PathPrefix": "arch/s390/kernel/Makefile"
}Results: {
"Output": "arch/s390/kernel/Makefile=45=obj-y\t+= nospec-branch.o ipl_vmparm.o machine_kexec_reloc.o unwind_bc.o\narch/s390/kernel/Makefile:46:obj-y\t+= smp.o text_amode31.o stacktrace.o abs_lowcore.o facility.o uv.o wti.o\narch/s390/kernel/Makefile-47-obj-y\t+= diag/\n"
} |
| 5/2 | 2026/07/20 11:30 | llm | patch-evaluator |
0mModel:gemini-3.1-pro-preview Args: null Results: null Tokens: input: 7712 output: 34 thoughts: 23 Thoughts: Okay, here's my take on those thoughts, framed as an expert's internal monologue: **Assessing Build Dependencies** Right, so `uv.o`... that's always built on s390, no question. It's a fundamental part of the environment there, I'm already aware of that. Now, the real question is: what about `pv.c`? Is it also rigidly tied to the s390 architecture, or is there some more flexibility there? I need to quickly assess the build configuration to understand its target environment. Does it rely on specific s390 intrinsics, assembly language, or platform-dependent libraries? Or is it written in a way that allows for broader portability with minimal effort? I have a hunch it might have broader implications for the build process depending on the answer... time to get some more context on that specific file. |
| 6/2 | 2026/07/20 11:30 | tool | grepper |
0mArgs:{
"Expression": "pv\\.o",
"PathPrefix": "arch/s390/kvm/Makefile"
}Results: {
"Output": "arch/s390/kvm/Makefile=10=kvm-y += kvm-s390.o intercept.o interrupt.o priv.o sigp.o\narch/s390/kvm/Makefile:11:kvm-y += diag.o gaccess.o guestdbg.o vsie.o pv.o\narch/s390/kvm/Makefile-12-kvm-y += dat.o gmap.o faultin.o\n"
} |
| 7/2 | 2026/07/20 11:30 | llm | patch-evaluator |
0mModel:gemini-3.1-pro-preview Args: null Results: null Tokens: input: 8082 output: 33 thoughts: 49 Thoughts: Okay, here's my take on those thoughts, tailored for an expert audience: **Analyzing the KVM-Related Compilation** Right, so `pv.o` is clearly tied into `kvm-y`. That means it's automatically included in the build process if `CONFIG_KVM` is set. Now I need to figure out the granularity of the inclusion. Is it just enabled *when* `CONFIG_KVM` is on, or are there more specific dependencies? To get a clear picture of its role, the next logical step is to dive deeper into the Kconfig files. Specifically, I'll need to check if there are any dedicated configuration options that directly pertain to "PV" or "Protected Virtualization" within the KVM configuration space. Understanding those dependencies is key. |
| 8/2 | 2026/07/20 11:30 | tool | grepper |
0mError:no matches Args: {
"Expression": "config.*PROTECTED",
"PathPrefix": "arch/s390/Kconfig"
}Results: {
"error": "no matches"
} |
| 9/2 | 2026/07/20 11:30 | llm | patch-evaluator |
0mModel:gemini-3.1-pro-preview Args: null Results: null Tokens: input: 8345 output: 34 thoughts: 18 Thoughts: Here's a first-person summary, tailored for an expert audience, of the thought process described: **Examining KVM Configuration for s390 Architecture** Okay, so we're diving into the KVM configuration for the s390 architecture. My immediate thought is to check `arch/s390/kvm/Kconfig`. This is where all the key KVM-related options specific to System z should be defined. I'll need to see how the features are structured, which options are available, and their dependencies. I'm looking for things like virtualization support, specific instruction extensions leveraged by KVM, and whether there are different KVM backends defined or enabled based on hardware features. I want to quickly understand the configuration landscape to identify what features are available, how they're enabled, and whether there are any dependencies or potential conflicts that could influence performance or compatibility. |
| 10/2 | 2026/07/20 11:30 | tool | grepper |
0mArgs:{
"Expression": "config.*",
"PathPrefix": "arch/s390/kvm/Kconfig"
}Results: {
"Output": "arch/s390/kvm/Kconfig-2-#\narch/s390/kvm/Kconfig:3:# KVM configuration\narch/s390/kvm/Kconfig-4-#\narch/s390/kvm/Kconfig:5:source \"virt/kvm/Kconfig\"\narch/s390/kvm/Kconfig-6-\narch/s390/kvm/Kconfig:7:menuconfig VIRTUALIZATION\narch/s390/kvm/Kconfig-8-\tdef_bool y\n--\narch/s390/kvm/Kconfig=17=if VIRTUALIZATION\narch/s390/kvm/Kconfig-18-\narch/s390/kvm/Kconfig:19:config KVM\narch/s390/kvm/Kconfig-20-\tdef_tristate y\n--\narch/s390/kvm/Kconfig-46-\narch/s390/kvm/Kconfig:47:config KVM_S390_UCONTROL\narch/s390/kvm/Kconfig-48-\tbool \"Userspace controlled virtual machines\"\n"
} |
| 11/2 | 2026/07/20 11:30 | llm | patch-evaluator |
0mModel:gemini-3.1-pro-preview Args: null Results: null Tokens: input: 8892 output: 34 thoughts: 41 Thoughts: Okay, here's my take on those thoughts, framed from my perspective: **Deep Dive into KVM and Secure Storage on s390** Alright, my focus is immediately drawn to `CONFIG_KVM`. That's the core of the virtualization piece, the starting point. I need to understand how secure storage access interacts within the KVM framework on s390. Let's dig into the heart of the matter and jump straight to `do_secure_storage_access` in `arch/s390/mm/fault.c`. That function's likely the key. It's where the interplay between the architecture's memory management and the security features I'm interested in probably converge. This is where I'll get the real low-down. |
| 12/2 | 2026/07/20 11:30 | tool | grepper |
0mArgs:{
"Expression": "do_secure_storage_access",
"PathPrefix": "arch/s390/"
}Results: {
"Output": "arch/s390/kernel/entry.h=29=void do_dat_exception(struct pt_regs *regs);\narch/s390/kernel/entry.h:30:void do_secure_storage_access(struct pt_regs *regs);\narch/s390/kernel/entry.h-31-void do_non_secure_storage_access(struct pt_regs *regs);\n--\narch/s390/kernel/traps.c=401=static void (*pgm_check_table[128])(struct pt_regs *regs) = {\n--\narch/s390/kernel/traps.c-437-\t[0x3c]\t\t= default_trap_handler,\narch/s390/kernel/traps.c:438:\t[0x3d]\t\t= do_secure_storage_access,\narch/s390/kernel/traps.c-439-\t[0x3e]\t\t= default_trap_handler,\n--\narch/s390/kernel/traps.c-449-\narch/s390/kernel/traps.c:450:COND_TRAP(do_secure_storage_access);\n--\narch/s390/mm/fault.c=404=NOKPROBE_SYMBOL(do_dat_exception);\n--\narch/s390/mm/fault.c-407-\narch/s390/mm/fault.c:408:void do_secure_storage_access(struct pt_regs *regs)\narch/s390/mm/fault.c-409-{\n--\narch/s390/mm/fault.c-468-}\narch/s390/mm/fault.c:469:NOKPROBE_SYMBOL(do_secure_storage_access);\narch/s390/mm/fault.c-470-\n"
} |
| 13/2 | 2026/07/20 11:30 | llm | patch-evaluator |
0mModel:gemini-3.1-pro-preview Args: null Results: null Tokens: input: 9625 output: 39 thoughts: 661 Thoughts: **Analyzing Secure Storage Access and KVM Integration** Okay, so I'm looking at this patch and it's dealing with a program check 0x3d, the secure storage access exception. The core of the change appears to be in how `do_secure_storage_access` is handling kernel faults, specifically related to `zeropad` which is coupled with `DCACHE_WORD_ACCESS`. I get it – `DCACHE_WORD_ACCESS` enabled means the kernel could potentially read beyond the end of a string and hit an unmapped or, crucially, a *secure* page. That's what triggers this 0x3d. The patch's modification of `do_secure_storage_access` now checks `is_kernel_fault(regs)`. If it *is* a kernel fault, and if it's not a vmalloc address, it tries to convert the physical address from secure space with `uv_convert_from_secure(__pa(addr))`, otherwise, returns `handle_fault_error_nolock(regs, 0)`. My focus needs to be on these functions: `do_secure_storage_access`, `uv_alloc_stor_var`, `uv_free_stor_var`, and `ex_handler_zeropad`. I need to figure out how they interact, and if this patch impacts the KVM changes. Now, `DCACHE_WORD_ACCESS` isn't KVM specific, it is a generic feature. But the secure storage access exception, is tied to Ultravisor (UV) and KVM PV. `uv_alloc_stor_var` and `uv_free_stor_var` are exported for the KVM module, which is important. The configs to enable, therefore, will be `KVM` for the KVM PV changes, on this s390 architecture. So, digging deeper into these functions: `do_secure_storage_access` is an exception handler, not a hot-path performance-critical section. `uv_alloc_stor_var` and `uv_free_stor_var` are called during VM creation and destruction. `ex_handler_zeropad` is called when `load_unaligned_zeropad` has a page fault, also an exception path. This means that these functions are excellent candidates to add to `FocusSymbols`. I also noticed `kvm_s390_pv_alloc_vm`, `kvm_s390_pv_dealloc_vm`, and `kvm_s390_pv_dispose_one_leftover` are now using `uv_alloc_stor_var` and `uv_free_stor_var`. I can either include these KVM functions as focus points, or just rely on the inclusion of the `uv_*` functions since they handle the allocation and deallocation. I need to review `uv_alloc_stor_var` specifically, in `arch/s390/kernel/uv.c`, to understand its behavior and how it interacts with the secure storage. |
| 14/2 | 2026/07/20 11:30 | tool | grepper |
0mArgs:{
"Expression": "uv_alloc_stor_var",
"PathPrefix": "arch/s390/kernel/uv.c"
}Results: {
"Output": "arch/s390/kernel/uv.c=245=static int uv_alloc_range_cb(pte_t *ptep, unsigned long addr, void *data)\n--\narch/s390/kernel/uv.c-257-\narch/s390/kernel/uv.c:258:void *uv_alloc_stor_var(unsigned long size)\narch/s390/kernel/uv.c-259-{\n--\narch/s390/kernel/uv.c-274-}\narch/s390/kernel/uv.c:275:EXPORT_SYMBOL_FOR_MODULES(uv_alloc_stor_var, \"kvm\");\narch/s390/kernel/uv.c-276-\n"
} |
| 15/2 | 2026/07/20 11:30 | llm | patch-evaluator |
0mModel:gemini-3.1-pro-preview Args: null Results: null Tokens: input: 11188 output: 40 thoughts: 36 Thoughts: Okay, here's my take on those thoughts, framed as an expert's inner monologue: **Checking the Exception Handler** Yes, the problem *is* definitely manifesting. I'm seeing it. Now, let's drill down. I need to investigate the exception handler responsible. The most likely culprit in a S390 architecture context, especially if we're dealing with zero-padding issues, is probably the extended table handler. I think I will check `ex_handler_zeropad` within `arch/s390/mm/extable.c`. That's the logical place to start digging into the details of how the kernel is handling those exceptions. I'm going to want to understand what's happening at the point of the exception, how the kernel is responding, and if the zero padding behavior is causing any issues within that code block. |
| 16/2 | 2026/07/20 11:30 | tool | grepper |
0mArgs:{
"Expression": "ex_handler_zeropad",
"PathPrefix": "arch/s390/mm/extable.c"
}Results: {
"Output": "arch/s390/mm/extable.c=39=static bool ex_handler_ua_load_reg(const struct exception_table_entry *ex,\n--\narch/s390/mm/extable.c-52-\narch/s390/mm/extable.c:53:static bool ex_handler_zeropad(const struct exception_table_entry *ex, struct pt_regs *regs)\narch/s390/mm/extable.c-54-{\n--\narch/s390/mm/extable.c=119=bool fixup_exception(struct pt_regs *regs)\n--\narch/s390/mm/extable.c-137-\tcase EX_TYPE_ZEROPAD:\narch/s390/mm/extable.c:138:\t\treturn ex_handler_zeropad(ex, regs);\narch/s390/mm/extable.c-139-\tcase EX_TYPE_FPC:\n"
} |
| 17/2 | 2026/07/20 11:30 | llm | patch-evaluator |
0mModel:gemini-3.1-pro-preview Args: null Results: null Tokens: input: 11710 output: 48 thoughts: 45 Thoughts: Okay, here's my take on those thoughts, tailored for an expert audience: **Analyzing the Alignment Strategy** Alright, yep, I see it. The core issue is right where I expected it to be. Time to dive into the nitty-gritty. Let's head straight to the implementation. I'm going to take a look at `load_unaligned_zeropad` in `arch/s390/include/asm/word-at-a-time.h`. I need to understand how the architecture is handling those potentially unaligned accesses and the zero-padding strategy being employed. It's crucial to evaluate the performance implications and potential hazards introduced by this specific method within the context of the S/390's memory model. Let's see how they've optimized it, any potential areas for improvement, or perhaps any edge cases the current code might overlook. |
| 18/2 | 2026/07/20 11:30 | tool | grepper |
0mArgs:{
"Expression": "load_unaligned_zeropad",
"PathPrefix": "arch/s390/include/asm/word-at-a-time.h"
}Results: {
"Output": "arch/s390/include/asm/word-at-a-time.h=39=static inline unsigned long zero_bytemask(unsigned long data)\n--\narch/s390/include/asm/word-at-a-time.h-50- */\narch/s390/include/asm/word-at-a-time.h:51:static inline unsigned long load_unaligned_zeropad(const void *addr)\narch/s390/include/asm/word-at-a-time.h-52-{\n"
} |
| 19/2 | 2026/07/20 11:30 | llm | patch-evaluator |
0mModel:gemini-3.1-pro-preview Args: null Results: null Tokens: input: 12141 output: 39 thoughts: 57 Thoughts: Okay, here's my take on those thoughts, framed as an expert's internal monologue: **Investigating Potential Focus Symbols** Hmm, this function's inline, so it's probably not a good candidate for a focus symbol. The compiler's likely going to fold it away in many cases, making it hard to track in the disassembly or debug output. I need something more concrete to latch onto. Alright, let's pivot. I'll need to dig into the `uv.c` file specifically related to the s390 architecture. Let's see... `uv_free_range_cb` and `uv_alloc_range_cb` are probably relevant callbacks in `arch/s390/kernel/uv.c`. I'll start there. I'm guessing they are associated with the memory allocation/deallocation process and those, depending on the implementation details, *could* provide a good focal point for analysis. Let's see if those are worth my time. |
| 20/2 | 2026/07/20 11:30 | tool | grepper |
0mArgs:{
"Expression": "uv_free_range_cb",
"PathPrefix": "arch/s390/kernel/uv.c"
}Results: {
"Output": "arch/s390/kernel/uv.c=207=int uv_convert_from_secure_pte(pte_t pte)\n--\narch/s390/kernel/uv.c-212-\narch/s390/kernel/uv.c:213:static int uv_free_range_cb(pte_t *ptep, unsigned long addr, void *data)\narch/s390/kernel/uv.c-214-{\n--\narch/s390/kernel/uv.c=228=void uv_free_stor_var(void *stor_var)\n--\narch/s390/kernel/uv.c-239-\taddr = (unsigned long)area-\u003eaddr;\narch/s390/kernel/uv.c:240:\tapply_to_existing_page_range(\u0026init_mm, addr, size, uv_free_range_cb, NULL);\narch/s390/kernel/uv.c-241-\tfree_vm_area(area);\n"
} |
| 21/2 | 2026/07/20 11:30 | llm | patch-evaluator |
0mModel:gemini-3.1-pro-preview Args: null Results: null Tokens: input: 12719 output: 216 thoughts: 325 Thoughts: **Analyzing the Implications of the Proposed Changes** Okay, so we're looking at static callbacks, and yes, we can definitely include those. Let me see... the key function symbols here are: `do_secure_storage_access`, `uv_alloc_stor_var`, `uv_free_stor_var`, `uv_alloc_range_cb`, `uv_free_range_cb`, and `ex_handler_zeropad`. Got it. Now, the config item we're focusing on is `KVM`. Let me break this down. It looks like this patch enables `DCACHE_WORD_ACCESS` specifically for s390, and it adds `load_unaligned_zeropad` along with the relevant exception handler, `ex_handler_zeropad`. Further, it's modifying KVM's PV variable storage allocation to leverage those new `uv_alloc_stor_var` and `uv_free_stor_var` functions. And of course, there's an update to `do_secure_storage_access` to handle kernel faults. Essentially, these are functional changes to architecture-specific memory and exception handling, specifically on s390, and of course with KVM. This has to be considered to affect VFS operations and KVM VM lifecycle. Now, the question is whether `KVM` is the *only* config that's required. Let's dig in a bit. It looks like `DCACHE_WORD_ACCESS` is implicitly selected by `S390` when `!KMSAN`. So we don't have to worry about enabling that explicitly. It's handled by default on s390 unless KMSAN is active. Perfect. The `KVM` config is clearly needed because of the modifications to the `arch/s390/kvm/pv.c` file. So it looks like `KVM` is the critical item to ensure is enabled. I'm ready to call `set-results`. |
| 22/2 | 2026/07/20 11:30 | tool | set-results |
0mArgs:{
"EnableConfigs": [
"KVM"
],
"FocusSymbols": [
"do_secure_storage_access",
"uv_alloc_stor_var",
"uv_free_stor_var",
"uv_alloc_range_cb",
"uv_free_range_cb",
"ex_handler_zeropad"
],
"Reasoning": "The patch enables DCACHE_WORD_ACCESS for s390, introducing `load_unaligned_zeropad` and its exception handler `ex_handler_zeropad`. It also modifies KVM PV variable storage allocation to use new `uv_alloc_stor_var` and `uv_free_stor_var` functions, and updates `do_secure_storage_access` to handle kernel faults correctly. These are functional changes in architecture-specific memory and exception handling, as well as KVM, which can be reached during VFS operations and KVM VM lifecycle.",
"WorthFuzzing": true
}Results: {
"EnableConfigs": [
"KVM"
],
"FocusSymbols": [
"do_secure_storage_access",
"uv_alloc_stor_var",
"uv_free_stor_var",
"uv_alloc_range_cb",
"uv_free_range_cb",
"ex_handler_zeropad"
],
"Reasoning": "The patch enables DCACHE_WORD_ACCESS for s390, introducing `load_unaligned_zeropad` and its exception handler `ex_handler_zeropad`. It also modifies KVM PV variable storage allocation to use new `uv_alloc_stor_var` and `uv_free_stor_var` functions, and updates `do_secure_storage_access` to handle kernel faults correctly. These are functional changes in architecture-specific memory and exception handling, as well as KVM, which can be reached during VFS operations and KVM VM lifecycle.",
"WorthFuzzing": true
} |
| Total Calls | Total Tokens | Avg Tokens | Total Duration (Seconds) | Avg Duration (Seconds) |
|---|
| Total Calls | Total Duration (Seconds) | Avg Duration (Seconds) |
|---|