| Seq | Timestamp | Type | Name | Duration |
|---|---|---|---|---|
| 0/0 | 2026/08/14 11:05 | flow | patch-triage |
0mArgs:null Results: {
"EnableConfigs": [
"KVM"
],
"FocusSymbols": [
"kvm_arch_vcpu_ioctl",
"kvm_arch_init_vm"
],
"KMSANReasoning": "The patch adds a spinlock (`pv_setting_lock`) to protect the `pv_features` field in `struct kvm_arch` from concurrent modifications during vCPU configuration. This is a concurrency/locking fix aimed at preventing data races or inconsistent states across vCPUs. It does not introduce any new memory allocations, structures sent to user space, or changes to bounds checking that could expose uninitialized memory. Concurrency issues and data races are best detected by tools like KCSAN or LOCKDEP, while KASAN handles memory corruption. KMSAN is specifically for detecting uninitialized memory usage, which is not relevant to this patch.",
"NeedsKMSAN": false,
"Reasoning": "The patch fixes a race condition in LoongArch KVM CPU configuration by introducing a new spinlock `pv_setting_lock`. This is a functional change in the KVM subsystem that is reachable via VCPU ioctls.",
"WorthFuzzing": true
} |
| 1/1 | 2026/08/14 11:05 | action | read-patch-diff |
0mArgs:null Results: {
"PatchDiff": "commit 3ce7f3e7613615fa480008b73185ae2fe187a1ba\nAuthor: syz-cluster \u003ctriage@syzkaller.com\u003e\nDate: Fri Aug 14 11:05:34 2026 +0000\n\n syz-cluster: applied patch under review\n\ndiff --git a/arch/loongarch/include/asm/kvm_host.h b/arch/loongarch/include/asm/kvm_host.h\nindex 23cfbecebbd79..3538a199aac62 100644\n--- a/arch/loongarch/include/asm/kvm_host.h\n+++ b/arch/loongarch/include/asm/kvm_host.h\n@@ -125,6 +125,7 @@ struct kvm_arch {\n \tunsigned int pte_shifts[MAX_PGTABLE_LEVELS];\n \tunsigned int root_level;\n \tspinlock_t phyid_map_lock;\n+\tspinlock_t pv_setting_lock;\n \tstruct kvm_phyid_map *phyid_map;\n \t/* Enabled PV features */\n \tunsigned long pv_features;\ndiff --git a/arch/loongarch/kvm/vcpu.c b/arch/loongarch/kvm/vcpu.c\nindex 20c207d80e31a..e47fa463a8bec 100644\n--- a/arch/loongarch/kvm/vcpu.c\n+++ b/arch/loongarch/kvm/vcpu.c\n@@ -1165,10 +1165,14 @@ static int kvm_loongarch_cpucfg_set_attr(struct kvm_vcpu *vcpu,\n \t\t\treturn -EINVAL;\n \n \t\t/* All vCPUs need set the same PV features */\n+\t\tspin_lock(\u0026kvm-\u003earch.pv_setting_lock);\n \t\tif ((kvm-\u003earch.pv_features \u0026 LOONGARCH_PV_FEAT_UPDATED)\n-\t\t\t\t\u0026\u0026 ((kvm-\u003earch.pv_features \u0026 valid) != val))\n+\t\t\t\t\u0026\u0026 ((kvm-\u003earch.pv_features \u0026 valid) != val)) {\n+\t\t\tspin_unlock(\u0026kvm-\u003earch.pv_setting_lock);\n \t\t\treturn -EINVAL;\n+\t\t}\n \t\tkvm-\u003earch.pv_features = val | LOONGARCH_PV_FEAT_UPDATED;\n+\t\tspin_unlock(\u0026kvm-\u003earch.pv_setting_lock);\n \t\treturn 0;\n \tdefault:\n \t\treturn -ENXIO;\ndiff --git a/arch/loongarch/kvm/vm.c b/arch/loongarch/kvm/vm.c\nindex 1317c718f896a..86ba7d54e81f8 100644\n--- a/arch/loongarch/kvm/vm.c\n+++ b/arch/loongarch/kvm/vm.c\n@@ -76,6 +76,7 @@ int kvm_arch_init_vm(struct kvm *kvm, unsigned long type)\n \t\treturn -ENOMEM;\n \t}\n \tspin_lock_init(\u0026kvm-\u003earch.phyid_map_lock);\n+\tspin_lock_init(\u0026kvm-\u003earch.pv_setting_lock);\n \n \tkvm_init_vmcs(kvm);\n \tkvm_vm_init_features(kvm);\n"
} |
| 2/1 | 2026/08/14 11:05 | agent | patch-evaluator |
0mModel:best-expensive Args: null Results: {
"EnableConfigs": [
"KVM"
],
"FocusSymbols": [
"kvm_arch_vcpu_ioctl",
"kvm_arch_init_vm"
],
"Reasoning": "The patch fixes a race condition in LoongArch KVM CPU configuration by introducing a new spinlock `pv_setting_lock`. This is a functional change in the KVM subsystem that is reachable via VCPU ioctls.",
"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). - Code in vendor-specific PCIe switch, SmartNIC, or GPU drivers (e.g., mlxsw, pds_core, qed, ionic, amdgpu) that require physical PCIe hardware cards not emulated in standard QEMU. - Driver .remove, .shutdown, or pci_unregister_driver teardown callbacks (e.g., igb_remove) that are executed only during PCI hot-unplug or sysfs driver unbind operations. 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. Prefer non-static, non-inlined API entrypoint functions over internal static helper functions (which are inlined by the compiler and do not have distinct symbol addresses). 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. Also check "depends on" lines in Kconfig to include any non-standard parent subsystem configs needed for Kbuild to compile the code statically into vmlinux. 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 3ce7f3e7613615fa480008b73185ae2fe187a1ba
Author: syz-cluster <triage@syzkaller.com>
Date: Fri Aug 14 11:05:34 2026 +0000
syz-cluster: applied patch under review
diff --git a/arch/loongarch/include/asm/kvm_host.h b/arch/loongarch/include/asm/kvm_host.h
index 23cfbecebbd79..3538a199aac62 100644
--- a/arch/loongarch/include/asm/kvm_host.h
+++ b/arch/loongarch/include/asm/kvm_host.h
@@ -125,6 +125,7 @@ struct kvm_arch {
unsigned int pte_shifts[MAX_PGTABLE_LEVELS];
unsigned int root_level;
spinlock_t phyid_map_lock;
+ spinlock_t pv_setting_lock;
struct kvm_phyid_map *phyid_map;
/* Enabled PV features */
unsigned long pv_features;
diff --git a/arch/loongarch/kvm/vcpu.c b/arch/loongarch/kvm/vcpu.c
index 20c207d80e31a..e47fa463a8bec 100644
--- a/arch/loongarch/kvm/vcpu.c
+++ b/arch/loongarch/kvm/vcpu.c
@@ -1165,10 +1165,14 @@ static int kvm_loongarch_cpucfg_set_attr(struct kvm_vcpu *vcpu,
return -EINVAL;
/* All vCPUs need set the same PV features */
+ spin_lock(&kvm->arch.pv_setting_lock);
if ((kvm->arch.pv_features & LOONGARCH_PV_FEAT_UPDATED)
- && ((kvm->arch.pv_features & valid) != val))
+ && ((kvm->arch.pv_features & valid) != val)) {
+ spin_unlock(&kvm->arch.pv_setting_lock);
return -EINVAL;
+ }
kvm->arch.pv_features = val | LOONGARCH_PV_FEAT_UPDATED;
+ spin_unlock(&kvm->arch.pv_setting_lock);
return 0;
default:
return -ENXIO;
diff --git a/arch/loongarch/kvm/vm.c b/arch/loongarch/kvm/vm.c
index 1317c718f896a..86ba7d54e81f8 100644
--- a/arch/loongarch/kvm/vm.c
+++ b/arch/loongarch/kvm/vm.c
@@ -76,6 +76,7 @@ int kvm_arch_init_vm(struct kvm *kvm, unsigned long type)
return -ENOMEM;
}
spin_lock_init(&kvm->arch.phyid_map_lock);
+ spin_lock_init(&kvm->arch.pv_setting_lock);
kvm_init_vmcs(kvm);
kvm_vm_init_features(kvm);
|
| 3/2 | 2026/08/14 11:05 | llm | patch-evaluator |
0mModel:gemini-3.1-pro-preview Args: null Results: null Tokens: input: 2571 output: 28 thoughts: 305 Thoughts: **Fuzzing the LoongArch KVM Patch** Okay, so I've got this patch affecting `arch/loongarch/include/asm/kvm_host.h`, `arch/loongarch/kvm/vcpu.c`, and `arch/loongarch/kvm/vm.c`. It's a functional change, a spinlock (`pv_setting_lock`) protecting `kvm->arch.pv_features` in `kvm_loongarch_cpucfg_set_attr()`. It's fixing a race condition in the LoongArch KVM implementation. Hmm, is this something we should be fuzzing? Absolutely. It's a functional change *in KVM* on *LoongArch*. That's a target-rich environment for fuzzing, if we can reach it. Wait, the bigger question is, can we *actually* fuzz LoongArch KVM with something like syzkaller? Syzkaller is pretty versatile, supports several architectures, but I usually see fuzzing on x86_64, ARM64, RISC-V, etc. But this is KVM, a core kernel feature, and we're talking about a specific architecture. It's worth pursuing. Let's see if we can reach it. My first check is `kvm_loongarch_cpucfg_set_attr`. Okay, I remember it's called through KVM ioctls. Good, that's a defined attack surface. Now, let's confirm the relevant config is enabled: `CONFIG_KVM` on LoongArch. Bingo. Let me refresh my memory of what's happening in `kvm_loongarch_cpucfg_set_attr` directly, so I'll quickly look at the source in `arch/loongarch/kvm/vcpu.c`. |
| 4/2 | 2026/08/14 11:05 | tool | grepper |
0mArgs:{
"Expression": "kvm_loongarch_cpucfg_set_attr"
}Results: {
"Output": "arch/loongarch/kvm/vcpu.c=1132=static int kvm_loongarch_vcpu_get_attr(struct kvm_vcpu *vcpu,\n--\narch/loongarch/kvm/vcpu.c-1150-\narch/loongarch/kvm/vcpu.c:1151:static int kvm_loongarch_cpucfg_set_attr(struct kvm_vcpu *vcpu,\narch/loongarch/kvm/vcpu.c-1152-\t\t\t\t\t struct kvm_device_attr *attr)\n--\narch/loongarch/kvm/vcpu.c=1219=static int kvm_loongarch_vcpu_set_attr(struct kvm_vcpu *vcpu,\n--\narch/loongarch/kvm/vcpu.c-1225-\tcase KVM_LOONGARCH_VCPU_CPUCFG:\narch/loongarch/kvm/vcpu.c:1226:\t\tret = kvm_loongarch_cpucfg_set_attr(vcpu, attr);\narch/loongarch/kvm/vcpu.c-1227-\t\tbreak;\n"
} |
| 5/2 | 2026/08/14 11:05 | llm | patch-evaluator |
0mModel:gemini-3.1-pro-preview Args: null Results: null Tokens: input: 3623 output: 27 thoughts: 61 Thoughts: **Tracing the `kvm_loongarch_vcpu_set_attr` Function** Okay, so I'm looking at `kvm_loongarch_vcpu_set_attr` and immediately I see it's calling `kvm_loongarch_cpucfg_set_attr`. That's the link I need to understand. My next step is clear: I need to trace *where* `kvm_loongarch_vcpu_set_attr` itself is being called. That'll provide the upstream context and tell me what's triggering this whole process. Where does this function fit into the larger KVM on LoongArch picture? Let's get to the call sites. |
| 6/2 | 2026/08/14 11:05 | tool | grepper |
0mArgs:{
"Expression": "kvm_loongarch_vcpu_set_attr"
}Results: {
"Output": "arch/loongarch/kvm/vcpu.c=1182=static int kvm_loongarch_pvtime_set_attr(struct kvm_vcpu *vcpu,\n--\narch/loongarch/kvm/vcpu.c-1218-\narch/loongarch/kvm/vcpu.c:1219:static int kvm_loongarch_vcpu_set_attr(struct kvm_vcpu *vcpu,\narch/loongarch/kvm/vcpu.c-1220-\t\t\t\t struct kvm_device_attr *attr)\n--\narch/loongarch/kvm/vcpu.c=1238=long kvm_arch_vcpu_ioctl(struct file *filp,\n--\narch/loongarch/kvm/vcpu.c-1299-\t\t\tbreak;\narch/loongarch/kvm/vcpu.c:1300:\t\tr = kvm_loongarch_vcpu_set_attr(vcpu, \u0026attr);\narch/loongarch/kvm/vcpu.c-1301-\t\tbreak;\n"
} |
| 7/2 | 2026/08/14 11:05 | llm | patch-evaluator |
0mModel:gemini-3.1-pro-preview Args: null Results: null Tokens: input: 4154 output: 34 thoughts: 82 Thoughts: Here's my take on those thoughts: **Analyzing the KVM LoongArch VCPU Attribute Setting** Okay, so I'm tracing through this code, and it looks like `kvm_arch_vcpu_ioctl` is the entry point, ultimately leading to `kvm_loongarch_vcpu_set_attr`. That makes sense; `ioctl` is the classic way to control things. And this, in turn, calls `kvm_loongarch_cpucfg_set_attr`. Yep, that sequence confirms this *is* a path accessible through KVM ioctls. I'm satisfied that's the link. Now, to understand the build configuration options and any related dependencies, I need to check the Kconfig file. Let's see what's in `arch/loongarch/kvm/Kconfig`. It’ll be interesting to see if there are any specific compile-time flags governing this functionality. That should clear up the build conditions for it. |
| 8/2 | 2026/08/14 11:05 | tool | grepper |
0mArgs:{
"Expression": "config KVM",
"PathPrefix": "arch/loongarch/kvm/Kconfig"
}Results: {
"Output": "arch/loongarch/kvm/Kconfig=18=if VIRTUALIZATION\narch/loongarch/kvm/Kconfig-19-\narch/loongarch/kvm/Kconfig:20:config KVM\narch/loongarch/kvm/Kconfig-21-\ttristate \"Kernel-based Virtual Machine (KVM) support\"\n"
} |
| 9/2 | 2026/08/14 11:05 | llm | patch-evaluator |
0mModel:gemini-3.1-pro-preview Args: null Results: null Tokens: input: 4586 output: 37 thoughts: 34 Thoughts: **KVM Configuration Analysis** Okay, so the current configuration is definitely KVM. But I need to be thorough. Is there *any* other configuration possibly active? I need to rule that out. Let's dig in and examine the dependencies; I'll start by checking the Kconfig file for the LoongArch architecture, specifically within the kvm directory at `arch/loongarch/kvm/Kconfig`. This should reveal any conditional dependencies or options that might be relevant. It's time to understand the complete picture of this kvm configuration. |
| 10/2 | 2026/08/14 11:05 | tool | read-file |
0mArgs:{
"File": "arch/loongarch/kvm/Kconfig",
"FirstLine": 1,
"LineCount": 50
}Results: {
"Contents": " 1:\t# SPDX-License-Identifier: GPL-2.0\n 2:\t#\n 3:\t# KVM configuration\n 4:\t#\n 5:\t\n 6:\tsource \"virt/kvm/Kconfig\"\n 7:\t\n 8:\tmenuconfig VIRTUALIZATION\n 9:\t\tbool \"Virtualization\"\n 10:\t\thelp\n 11:\t\t Say Y here to get to see options for using your Linux host to run\n 12:\t\t other operating systems inside virtual machines (guests).\n 13:\t\t This option alone does not add any kernel code.\n 14:\t\n 15:\t\t If you say N, all options in this submenu will be skipped and\n 16:\t\t disabled.\n 17:\t\n 18:\tif VIRTUALIZATION\n 19:\t\n 20:\tconfig KVM\n 21:\t\ttristate \"Kernel-based Virtual Machine (KVM) support\"\n 22:\t\tdepends on AS_HAS_LVZ_EXTENSION \u0026\u0026 64BIT\n 23:\t\tselect HAVE_KVM_DIRTY_RING_ACQ_REL\n 24:\t\tselect HAVE_KVM_IRQ_ROUTING\n 25:\t\tselect HAVE_KVM_IRQCHIP\n 26:\t\tselect HAVE_KVM_MSI\n 27:\t\tselect HAVE_KVM_READONLY_MEM\n 28:\t\tselect KVM_COMMON\n 29:\t\tselect KVM_GENERIC_DIRTYLOG_READ_PROTECT\n 30:\t\tselect KVM_GENERIC_HARDWARE_ENABLING\n 31:\t\tselect KVM_MMIO\n 32:\t\tselect VIRT_XFER_TO_GUEST_WORK\n 33:\t\tselect SCHED_INFO\n 34:\t\tselect GUEST_PERF_EVENTS if PERF_EVENTS\n 35:\t\thelp\n 36:\t\t Support hosting virtualized guest machines using\n 37:\t\t hardware virtualization extensions. You will need\n 38:\t\t a processor equipped with virtualization extensions.\n 39:\t\n 40:\t\t If unsure, say N.\n 41:\t\n 42:\tendif # VIRTUALIZATION\n"
} |
| 11/2 | 2026/08/14 11:05 | llm | patch-evaluator |
0mModel:gemini-3.1-pro-preview Args: null Results: null Tokens: input: 5325 output: 23 thoughts: 230 Thoughts: **Analyzing the LoongArch KVM Patch for Syzkaller Integration** Okay, so this patch is clearly related to KVM configuration, my first thought is to ensure the configurations are correct. This is for the LoongArch architecture, so I need to assess whether Syzkaller is capable of fuzzing this architecture effectively. I know Syzkaller has some LoongArch support, but it's often more about the provided configs and symbols; the fuzzing infrastructure takes over from there, assuming it has the built-in ability. The key configurations I need to focus on are the KVM settings. Now, I'm thinking about the specific functions implicated by the patch: `kvm_loongarch_vcpu_set_attr` and `kvm_loongarch_cpucfg_set_attr`. My approach is to see which function I can use in the fuzzing process. `kvm_loongarch_cpucfg_set_attr` looks static, which means I can't directly use it. This brings me to either `kvm_arch_vcpu_ioctl` or, if `kvm_loongarch_vcpu_set_attr` wasn't inlined, I would try it. I need to quickly confirm that `kvm_loongarch_vcpu_set_attr` is indeed static. Ah, yes, it is. That leaves `kvm_arch_vcpu_ioctl` as the primary candidate. Let me verify it's not static. Good, it is non-static. This looks like the main entry point to focus on for this fuzzing effort. |
| 12/2 | 2026/08/14 11:05 | tool | grepper |
0mArgs:{
"Expression": "kvm_arch_vcpu_ioctl"
}Results: {
"Output": "\nFull output is too long, showing 500 out of 643 lines.\nUse more precise expression if possible.\n\narch/arm64/kvm/arm.c=781=static bool kvm_arm_vcpu_suspended(struct kvm_vcpu *vcpu)\n--\narch/arm64/kvm/arm.c-785-\narch/arm64/kvm/arm.c:786:int kvm_arch_vcpu_ioctl_get_mpstate(struct kvm_vcpu *vcpu,\narch/arm64/kvm/arm.c-787-\t\t\t\t struct kvm_mp_state *mp_state)\n--\narch/arm64/kvm/arm.c-793-\narch/arm64/kvm/arm.c:794:int kvm_arch_vcpu_ioctl_set_mpstate(struct kvm_vcpu *vcpu,\narch/arm64/kvm/arm.c-795-\t\t\t\t struct kvm_mp_state *mp_state)\n--\narch/arm64/kvm/arm.c=1066=static int kvm_vcpu_suspend(struct kvm_vcpu *vcpu)\n--\narch/arm64/kvm/arm.c-1092-\t * Otherwise, we were unblocked to process a different event, such as a\narch/arm64/kvm/arm.c:1093:\t * pending signal. Return 1 and allow kvm_arch_vcpu_ioctl_run() to\narch/arm64/kvm/arm.c-1094-\t * process the event.\n--\narch/arm64/kvm/arm.c=1230=static int noinstr kvm_arm_vcpu_enter_exit(struct kvm_vcpu *vcpu)\n--\narch/arm64/kvm/arm.c-1241-/**\narch/arm64/kvm/arm.c:1242: * kvm_arch_vcpu_ioctl_run - the main VCPU run function to execute guest code\narch/arm64/kvm/arm.c-1243- * @vcpu:\tThe VCPU pointer\n--\narch/arm64/kvm/arm.c-1250- */\narch/arm64/kvm/arm.c:1251:int kvm_arch_vcpu_ioctl_run(struct kvm_vcpu *vcpu)\narch/arm64/kvm/arm.c-1252-{\n--\narch/arm64/kvm/arm.c=1680=static int kvm_vcpu_set_target(struct kvm_vcpu *vcpu,\n--\narch/arm64/kvm/arm.c-1702-\narch/arm64/kvm/arm.c:1703:static int kvm_arch_vcpu_ioctl_vcpu_init(struct kvm_vcpu *vcpu,\narch/arm64/kvm/arm.c-1704-\t\t\t\t\t struct kvm_vcpu_init *init)\n--\narch/arm64/kvm/arm.c=1806=static int kvm_arm_vcpu_set_events(struct kvm_vcpu *vcpu,\n--\narch/arm64/kvm/arm.c-1823-\narch/arm64/kvm/arm.c:1824:long kvm_arch_vcpu_ioctl(struct file *filp,\narch/arm64/kvm/arm.c-1825-\t\t\t unsigned int ioctl, unsigned long arg)\n--\narch/arm64/kvm/arm.c-1839-\narch/arm64/kvm/arm.c:1840:\t\tr = kvm_arch_vcpu_ioctl_vcpu_init(vcpu, \u0026init);\narch/arm64/kvm/arm.c-1841-\t\tbreak;\n--\narch/arm64/kvm/guest.c=511=static int set_sve_reg(struct kvm_vcpu *vcpu, const struct kvm_one_reg *reg)\n--\narch/arm64/kvm/guest.c-535-\narch/arm64/kvm/guest.c:536:int kvm_arch_vcpu_ioctl_get_regs(struct kvm_vcpu *vcpu, struct kvm_regs *regs)\narch/arm64/kvm/guest.c-537-{\n--\narch/arm64/kvm/guest.c-540-\narch/arm64/kvm/guest.c:541:int kvm_arch_vcpu_ioctl_set_regs(struct kvm_vcpu *vcpu, struct kvm_regs *regs)\narch/arm64/kvm/guest.c-542-{\n--\narch/arm64/kvm/guest.c=719=int kvm_arm_set_reg(struct kvm_vcpu *vcpu, const struct kvm_one_reg *reg)\n--\narch/arm64/kvm/guest.c-735-\narch/arm64/kvm/guest.c:736:int kvm_arch_vcpu_ioctl_get_sregs(struct kvm_vcpu *vcpu,\narch/arm64/kvm/guest.c-737-\t\t\t\t struct kvm_sregs *sregs)\n--\narch/arm64/kvm/guest.c-741-\narch/arm64/kvm/guest.c:742:int kvm_arch_vcpu_ioctl_set_sregs(struct kvm_vcpu *vcpu,\narch/arm64/kvm/guest.c-743-\t\t\t\t struct kvm_sregs *sregs)\n--\narch/arm64/kvm/guest.c=825=u32 __attribute_const__ kvm_target_cpu(void)\n--\narch/arm64/kvm/guest.c-854-\narch/arm64/kvm/guest.c:855:int kvm_arch_vcpu_ioctl_get_fpu(struct kvm_vcpu *vcpu, struct kvm_fpu *fpu)\narch/arm64/kvm/guest.c-856-{\n--\narch/arm64/kvm/guest.c-859-\narch/arm64/kvm/guest.c:860:int kvm_arch_vcpu_ioctl_set_fpu(struct kvm_vcpu *vcpu, struct kvm_fpu *fpu)\narch/arm64/kvm/guest.c-861-{\n--\narch/arm64/kvm/guest.c-864-\narch/arm64/kvm/guest.c:865:int kvm_arch_vcpu_ioctl_translate(struct kvm_vcpu *vcpu,\narch/arm64/kvm/guest.c-866-\t\t\t\t struct kvm_translation *tr)\n--\narch/arm64/kvm/guest.c-871-/**\narch/arm64/kvm/guest.c:872: * kvm_arch_vcpu_ioctl_set_guest_debug - set up guest debugging\narch/arm64/kvm/guest.c-873- * @vcpu: the vCPU pointer\n--\narch/arm64/kvm/guest.c-880- */\narch/arm64/kvm/guest.c:881:int kvm_arch_vcpu_ioctl_set_guest_debug(struct kvm_vcpu *vcpu,\narch/arm64/kvm/guest.c-882-\t\t\t\t\tstruct kvm_guest_debug *dbg)\n--\narch/arm64/kvm/hyp/nvhe/switch.c=226=static inline bool fixup_guest_exit(struct kvm_vcpu *vcpu, u64 *exit_code)\n--\narch/arm64/kvm/hyp/nvhe/switch.c-238-\t * it. The check below is based on the one in\narch/arm64/kvm/hyp/nvhe/switch.c:239:\t * kvm_arch_vcpu_ioctl_run().\narch/arm64/kvm/hyp/nvhe/switch.c-240-\t */\n--\narch/loongarch/kvm/vcpu.c=420=vm_fault_t kvm_arch_vcpu_fault(struct kvm_vcpu *vcpu, struct vm_fault *vmf)\n--\narch/loongarch/kvm/vcpu.c-424-\narch/loongarch/kvm/vcpu.c:425:int kvm_arch_vcpu_ioctl_translate(struct kvm_vcpu *vcpu,\narch/loongarch/kvm/vcpu.c-426-\t\t\t\t struct kvm_translation *tr)\n--\narch/loongarch/kvm/vcpu.c=444=int kvm_arch_vcpu_dump_regs(struct kvm_vcpu *vcpu)\n--\narch/loongarch/kvm/vcpu.c-466-\narch/loongarch/kvm/vcpu.c:467:int kvm_arch_vcpu_ioctl_get_mpstate(struct kvm_vcpu *vcpu,\narch/loongarch/kvm/vcpu.c-468-\t\t\t\tstruct kvm_mp_state *mp_state)\n--\narch/loongarch/kvm/vcpu.c-474-\narch/loongarch/kvm/vcpu.c:475:int kvm_arch_vcpu_ioctl_set_mpstate(struct kvm_vcpu *vcpu,\narch/loongarch/kvm/vcpu.c-476-\t\t\t\tstruct kvm_mp_state *mp_state)\n--\narch/loongarch/kvm/vcpu.c-490-\narch/loongarch/kvm/vcpu.c:491:int kvm_arch_vcpu_ioctl_set_guest_debug(struct kvm_vcpu *vcpu,\narch/loongarch/kvm/vcpu.c-492-\t\t\t\t\tstruct kvm_guest_debug *dbg)\n--\narch/loongarch/kvm/vcpu.c=984=static int kvm_set_reg(struct kvm_vcpu *vcpu, const struct kvm_one_reg *reg)\n--\narch/loongarch/kvm/vcpu.c-1001-\narch/loongarch/kvm/vcpu.c:1002:int kvm_arch_vcpu_ioctl_get_sregs(struct kvm_vcpu *vcpu, struct kvm_sregs *sregs)\narch/loongarch/kvm/vcpu.c-1003-{\n--\narch/loongarch/kvm/vcpu.c-1006-\narch/loongarch/kvm/vcpu.c:1007:int kvm_arch_vcpu_ioctl_set_sregs(struct kvm_vcpu *vcpu, struct kvm_sregs *sregs)\narch/loongarch/kvm/vcpu.c-1008-{\n--\narch/loongarch/kvm/vcpu.c-1011-\narch/loongarch/kvm/vcpu.c:1012:int kvm_arch_vcpu_ioctl_get_regs(struct kvm_vcpu *vcpu, struct kvm_regs *regs)\narch/loongarch/kvm/vcpu.c-1013-{\n--\narch/loongarch/kvm/vcpu.c-1023-\narch/loongarch/kvm/vcpu.c:1024:int kvm_arch_vcpu_ioctl_set_regs(struct kvm_vcpu *vcpu, struct kvm_regs *regs)\narch/loongarch/kvm/vcpu.c-1025-{\n--\narch/loongarch/kvm/vcpu.c=1219=static int kvm_loongarch_vcpu_set_attr(struct kvm_vcpu *vcpu,\n--\narch/loongarch/kvm/vcpu.c-1237-\narch/loongarch/kvm/vcpu.c:1238:long kvm_arch_vcpu_ioctl(struct file *filp,\narch/loongarch/kvm/vcpu.c-1239-\t\t\t unsigned int ioctl, unsigned long arg)\n--\narch/loongarch/kvm/vcpu.c-1310-\narch/loongarch/kvm/vcpu.c:1311:int kvm_arch_vcpu_ioctl_get_fpu(struct kvm_vcpu *vcpu, struct kvm_fpu *fpu)\narch/loongarch/kvm/vcpu.c-1312-{\n--\narch/loongarch/kvm/vcpu.c-1322-\narch/loongarch/kvm/vcpu.c:1323:int kvm_arch_vcpu_ioctl_set_fpu(struct kvm_vcpu *vcpu, struct kvm_fpu *fpu)\narch/loongarch/kvm/vcpu.c-1324-{\n--\narch/loongarch/kvm/vcpu.c=1829=void kvm_arch_vcpu_put(struct kvm_vcpu *vcpu)\n--\narch/loongarch/kvm/vcpu.c-1852-\narch/loongarch/kvm/vcpu.c:1853:int kvm_arch_vcpu_ioctl_run(struct kvm_vcpu *vcpu)\narch/loongarch/kvm/vcpu.c-1854-{\n--\narch/mips/kvm/mips.c=386=void kvm_arch_vcpu_destroy(struct kvm_vcpu *vcpu)\n--\narch/mips/kvm/mips.c-397-\narch/mips/kvm/mips.c:398:int kvm_arch_vcpu_ioctl_set_guest_debug(struct kvm_vcpu *vcpu,\narch/mips/kvm/mips.c-399-\t\t\t\t\tstruct kvm_guest_debug *dbg)\n--\narch/mips/kvm/mips.c=411=static int noinstr kvm_mips_vcpu_enter_exit(struct kvm_vcpu *vcpu)\n--\narch/mips/kvm/mips.c-421-\narch/mips/kvm/mips.c:422:int kvm_arch_vcpu_ioctl_run(struct kvm_vcpu *vcpu)\narch/mips/kvm/mips.c-423-{\n--\narch/mips/kvm/mips.c=479=int kvm_vcpu_ioctl_interrupt(struct kvm_vcpu *vcpu,\n--\narch/mips/kvm/mips.c-514-\narch/mips/kvm/mips.c:515:int kvm_arch_vcpu_ioctl_get_mpstate(struct kvm_vcpu *vcpu,\narch/mips/kvm/mips.c-516-\t\t\t\t struct kvm_mp_state *mp_state)\n--\narch/mips/kvm/mips.c-520-\narch/mips/kvm/mips.c:521:int kvm_arch_vcpu_ioctl_set_mpstate(struct kvm_vcpu *vcpu,\narch/mips/kvm/mips.c-522-\t\t\t\t struct kvm_mp_state *mp_state)\n--\narch/mips/kvm/mips.c=898=long kvm_arch_vcpu_unlocked_ioctl(struct file *filp, unsigned int ioctl,\n--\narch/mips/kvm/mips.c-917-\narch/mips/kvm/mips.c:918:long kvm_arch_vcpu_ioctl(struct file *filp, unsigned int ioctl,\narch/mips/kvm/mips.c-919-\t\t\t unsigned long arg)\n--\narch/mips/kvm/mips.c=987=int kvm_arch_vm_ioctl(struct file *filp, unsigned int ioctl, unsigned long arg)\n--\narch/mips/kvm/mips.c-998-\narch/mips/kvm/mips.c:999:int kvm_arch_vcpu_ioctl_get_sregs(struct kvm_vcpu *vcpu,\narch/mips/kvm/mips.c-1000-\t\t\t\t struct kvm_sregs *sregs)\n--\narch/mips/kvm/mips.c-1004-\narch/mips/kvm/mips.c:1005:int kvm_arch_vcpu_ioctl_set_sregs(struct kvm_vcpu *vcpu,\narch/mips/kvm/mips.c-1006-\t\t\t\t struct kvm_sregs *sregs)\n--\narch/mips/kvm/mips.c=1011=void kvm_arch_vcpu_postcreate(struct kvm_vcpu *vcpu)\n--\narch/mips/kvm/mips.c-1014-\narch/mips/kvm/mips.c:1015:int kvm_arch_vcpu_ioctl_get_fpu(struct kvm_vcpu *vcpu, struct kvm_fpu *fpu)\narch/mips/kvm/mips.c-1016-{\n--\narch/mips/kvm/mips.c-1019-\narch/mips/kvm/mips.c:1020:int kvm_arch_vcpu_ioctl_set_fpu(struct kvm_vcpu *vcpu, struct kvm_fpu *fpu)\narch/mips/kvm/mips.c-1021-{\n--\narch/mips/kvm/mips.c=1082=int kvm_arch_vcpu_dump_regs(struct kvm_vcpu *vcpu)\n--\narch/mips/kvm/mips.c-1112-\narch/mips/kvm/mips.c:1113:int kvm_arch_vcpu_ioctl_set_regs(struct kvm_vcpu *vcpu, struct kvm_regs *regs)\narch/mips/kvm/mips.c-1114-{\n--\narch/mips/kvm/mips.c-1129-\narch/mips/kvm/mips.c:1130:int kvm_arch_vcpu_ioctl_get_regs(struct kvm_vcpu *vcpu, struct kvm_regs *regs)\narch/mips/kvm/mips.c-1131-{\n--\narch/mips/kvm/mips.c-1146-\narch/mips/kvm/mips.c:1147:int kvm_arch_vcpu_ioctl_translate(struct kvm_vcpu *vcpu,\narch/mips/kvm/mips.c-1148-\t\t\t\t struct kvm_translation *tr)\n--\narch/powerpc/kvm/book3s.c=525=void kvmppc_subarch_vcpu_uninit(struct kvm_vcpu *vcpu)\n--\narch/powerpc/kvm/book3s.c-528-\narch/powerpc/kvm/book3s.c:529:int kvm_arch_vcpu_ioctl_get_sregs(struct kvm_vcpu *vcpu,\narch/powerpc/kvm/book3s.c-530-\t\t\t\t struct kvm_sregs *sregs)\n--\narch/powerpc/kvm/book3s.c-540-\narch/powerpc/kvm/book3s.c:541:int kvm_arch_vcpu_ioctl_set_sregs(struct kvm_vcpu *vcpu,\narch/powerpc/kvm/book3s.c-542-\t\t\t\t struct kvm_sregs *sregs)\n--\narch/powerpc/kvm/book3s.c-552-\narch/powerpc/kvm/book3s.c:553:int kvm_arch_vcpu_ioctl_get_regs(struct kvm_vcpu *vcpu, struct kvm_regs *regs)\narch/powerpc/kvm/book3s.c-554-{\n--\narch/powerpc/kvm/book3s.c-580-\narch/powerpc/kvm/book3s.c:581:int kvm_arch_vcpu_ioctl_set_regs(struct kvm_vcpu *vcpu, struct kvm_regs *regs)\narch/powerpc/kvm/book3s.c-582-{\n--\narch/powerpc/kvm/book3s.c-607-\narch/powerpc/kvm/book3s.c:608:int kvm_arch_vcpu_ioctl_get_fpu(struct kvm_vcpu *vcpu, struct kvm_fpu *fpu)\narch/powerpc/kvm/book3s.c-609-{\n--\narch/powerpc/kvm/book3s.c-612-\narch/powerpc/kvm/book3s.c:613:int kvm_arch_vcpu_ioctl_set_fpu(struct kvm_vcpu *vcpu, struct kvm_fpu *fpu)\narch/powerpc/kvm/book3s.c-614-{\n--\narch/powerpc/kvm/book3s.c=807=int kvmppc_vcpu_run(struct kvm_vcpu *vcpu)\n--\narch/powerpc/kvm/book3s.c-811-\narch/powerpc/kvm/book3s.c:812:int kvm_arch_vcpu_ioctl_translate(struct kvm_vcpu *vcpu,\narch/powerpc/kvm/book3s.c-813- struct kvm_translation *tr)\n--\narch/powerpc/kvm/book3s.c-817-\narch/powerpc/kvm/book3s.c:818:int kvm_arch_vcpu_ioctl_set_guest_debug(struct kvm_vcpu *vcpu,\narch/powerpc/kvm/book3s.c-819-\t\t\t\t\tstruct kvm_guest_debug *dbg)\n--\narch/powerpc/kvm/book3s_hv.c=1968=static int kvmppc_handle_nested_exit(struct kvm_vcpu *vcpu)\n--\narch/powerpc/kvm/book3s_hv.c-2099-\narch/powerpc/kvm/book3s_hv.c:2100:static int kvm_arch_vcpu_ioctl_get_sregs_hv(struct kvm_vcpu *vcpu,\narch/powerpc/kvm/book3s_hv.c-2101-\t\t\t\t\t struct kvm_sregs *sregs)\n--\narch/powerpc/kvm/book3s_hv.c-2114-\narch/powerpc/kvm/book3s_hv.c:2115:static int kvm_arch_vcpu_ioctl_set_sregs_hv(struct kvm_vcpu *vcpu,\narch/powerpc/kvm/book3s_hv.c-2116-\t\t\t\t\t struct kvm_sregs *sregs)\n--\narch/powerpc/kvm/book3s_hv.c=6513=static struct kvmppc_ops kvm_ops_hv = {\narch/powerpc/kvm/book3s_hv.c:6514:\t.get_sregs = kvm_arch_vcpu_ioctl_get_sregs_hv,\narch/powerpc/kvm/book3s_hv.c:6515:\t.set_sregs = kvm_arch_vcpu_ioctl_set_sregs_hv,\narch/powerpc/kvm/book3s_hv.c-6516-\t.get_one_reg = kvmppc_get_one_reg_hv,\n--\narch/powerpc/kvm/book3s_pr.c=1135=int kvmppc_handle_exit_pr(struct kvm_vcpu *vcpu, unsigned int exit_nr)\n--\narch/powerpc/kvm/book3s_pr.c-1454-\narch/powerpc/kvm/book3s_pr.c:1455:static int kvm_arch_vcpu_ioctl_get_sregs_pr(struct kvm_vcpu *vcpu,\narch/powerpc/kvm/book3s_pr.c-1456-\t\t\t\t\t struct kvm_sregs *sregs)\n--\narch/powerpc/kvm/book3s_pr.c-1481-\narch/powerpc/kvm/book3s_pr.c:1482:static int kvm_arch_vcpu_ioctl_set_sregs_pr(struct kvm_vcpu *vcpu,\narch/powerpc/kvm/book3s_pr.c-1483-\t\t\t\t\t struct kvm_sregs *sregs)\n--\narch/powerpc/kvm/book3s_pr.c=2045=static struct kvmppc_ops kvm_ops_pr = {\narch/powerpc/kvm/book3s_pr.c:2046:\t.get_sregs = kvm_arch_vcpu_ioctl_get_sregs_pr,\narch/powerpc/kvm/book3s_pr.c:2047:\t.set_sregs = kvm_arch_vcpu_ioctl_set_sregs_pr,\narch/powerpc/kvm/book3s_pr.c-2048-\t.get_one_reg = kvmppc_get_one_reg_pr,\n--\narch/powerpc/kvm/booke.c=1442=void kvmppc_subarch_vcpu_uninit(struct kvm_vcpu *vcpu)\n--\narch/powerpc/kvm/booke.c-1446-\narch/powerpc/kvm/booke.c:1447:int kvm_arch_vcpu_ioctl_get_regs(struct kvm_vcpu *vcpu, struct kvm_regs *regs)\narch/powerpc/kvm/booke.c-1448-{\n--\narch/powerpc/kvm/booke.c-1477-\narch/powerpc/kvm/booke.c:1478:int kvm_arch_vcpu_ioctl_set_regs(struct kvm_vcpu *vcpu, struct kvm_regs *regs)\narch/powerpc/kvm/booke.c-1479-{\n--\narch/powerpc/kvm/booke.c=1605=int kvmppc_set_sregs_ivor(struct kvm_vcpu *vcpu, struct kvm_sregs *sregs)\n--\narch/powerpc/kvm/booke.c-1629-\narch/powerpc/kvm/booke.c:1630:int kvm_arch_vcpu_ioctl_get_sregs(struct kvm_vcpu *vcpu,\narch/powerpc/kvm/booke.c-1631- struct kvm_sregs *sregs)\n--\narch/powerpc/kvm/booke.c-1646-\narch/powerpc/kvm/booke.c:1647:int kvm_arch_vcpu_ioctl_set_sregs(struct kvm_vcpu *vcpu,\narch/powerpc/kvm/booke.c-1648- struct kvm_sregs *sregs)\n--\narch/powerpc/kvm/booke.c=1727=int kvmppc_set_one_reg(struct kvm_vcpu *vcpu, u64 id,\n--\narch/powerpc/kvm/booke.c-1795-\narch/powerpc/kvm/booke.c:1796:int kvm_arch_vcpu_ioctl_get_fpu(struct kvm_vcpu *vcpu, struct kvm_fpu *fpu)\narch/powerpc/kvm/booke.c-1797-{\n--\narch/powerpc/kvm/booke.c-1800-\narch/powerpc/kvm/booke.c:1801:int kvm_arch_vcpu_ioctl_set_fpu(struct kvm_vcpu *vcpu, struct kvm_fpu *fpu)\narch/powerpc/kvm/booke.c-1802-{\n--\narch/powerpc/kvm/booke.c-1805-\narch/powerpc/kvm/booke.c:1806:int kvm_arch_vcpu_ioctl_translate(struct kvm_vcpu *vcpu,\narch/powerpc/kvm/booke.c-1807- struct kvm_translation *tr)\n--\narch/powerpc/kvm/booke.c=1980=int kvmppc_xlate(struct kvm_vcpu *vcpu, ulong eaddr, enum xlate_instdata xlid,\n--\narch/powerpc/kvm/booke.c-2030-\narch/powerpc/kvm/booke.c:2031:int kvm_arch_vcpu_ioctl_set_guest_debug(struct kvm_vcpu *vcpu,\narch/powerpc/kvm/booke.c-2032-\t\t\t\t\t struct kvm_guest_debug *dbg)\n--\narch/powerpc/kvm/powerpc.c=1732=int kvm_vcpu_ioctl_set_one_reg(struct kvm_vcpu *vcpu, struct kvm_one_reg *reg)\n--\narch/powerpc/kvm/powerpc.c-1780-\narch/powerpc/kvm/powerpc.c:1781:int kvm_arch_vcpu_ioctl_run(struct kvm_vcpu *vcpu)\narch/powerpc/kvm/powerpc.c-1782-{\n--\narch/powerpc/kvm/powerpc.c=2000=bool kvm_arch_intc_initialized(struct kvm *kvm)\n--\narch/powerpc/kvm/powerpc.c-2012-\narch/powerpc/kvm/powerpc.c:2013:int kvm_arch_vcpu_ioctl_get_mpstate(struct kvm_vcpu *vcpu,\narch/powerpc/kvm/powerpc.c-2014- struct kvm_mp_state *mp_state)\n--\narch/powerpc/kvm/powerpc.c-2018-\narch/powerpc/kvm/powerpc.c:2019:int kvm_arch_vcpu_ioctl_set_mpstate(struct kvm_vcpu *vcpu,\narch/powerpc/kvm/powerpc.c-2020- struct kvm_mp_state *mp_state)\n--\narch/powerpc/kvm/powerpc.c=2025=long kvm_arch_vcpu_unlocked_ioctl(struct file *filp, unsigned int ioctl,\n--\narch/powerpc/kvm/powerpc.c-2039-\narch/powerpc/kvm/powerpc.c:2040:long kvm_arch_vcpu_ioctl(struct file *filp,\narch/powerpc/kvm/powerpc.c-2041- unsigned int ioctl, unsigned long arg)\n--\narch/riscv/kvm/vcpu.c=245=long kvm_arch_vcpu_unlocked_ioctl(struct file *filp, unsigned int ioctl,\n--\narch/riscv/kvm/vcpu.c-265-\narch/riscv/kvm/vcpu.c:266:long kvm_arch_vcpu_ioctl(struct file *filp,\narch/riscv/kvm/vcpu.c-267-\t\t\t unsigned int ioctl, unsigned long arg)\n--\narch/riscv/kvm/vcpu.c-312-\narch/riscv/kvm/vcpu.c:313:int kvm_arch_vcpu_ioctl_get_sregs(struct kvm_vcpu *vcpu,\narch/riscv/kvm/vcpu.c-314-\t\t\t\t struct kvm_sregs *sregs)\n--\narch/riscv/kvm/vcpu.c-318-\narch/riscv/kvm/vcpu.c:319:int kvm_arch_vcpu_ioctl_set_sregs(struct kvm_vcpu *vcpu,\narch/riscv/kvm/vcpu.c-320-\t\t\t\t struct kvm_sregs *sregs)\n--\narch/riscv/kvm/vcpu.c-324-\narch/riscv/kvm/vcpu.c:325:int kvm_arch_vcpu_ioctl_get_fpu(struct kvm_vcpu *vcpu, struct kvm_fpu *fpu)\narch/riscv/kvm/vcpu.c-326-{\n--\narch/riscv/kvm/vcpu.c-329-\narch/riscv/kvm/vcpu.c:330:int kvm_arch_vcpu_ioctl_set_fpu(struct kvm_vcpu *vcpu, struct kvm_fpu *fpu)\narch/riscv/kvm/vcpu.c-331-{\n--\narch/riscv/kvm/vcpu.c-334-\narch/riscv/kvm/vcpu.c:335:int kvm_arch_vcpu_ioctl_translate(struct kvm_vcpu *vcpu,\narch/riscv/kvm/vcpu.c-336-\t\t\t\t struct kvm_translation *tr)\n--\narch/riscv/kvm/vcpu.c-340-\narch/riscv/kvm/vcpu.c:341:int kvm_arch_vcpu_ioctl_get_regs(struct kvm_vcpu *vcpu, struct kvm_regs *regs)\narch/riscv/kvm/vcpu.c-342-{\n--\narch/riscv/kvm/vcpu.c-345-\narch/riscv/kvm/vcpu.c:346:int kvm_arch_vcpu_ioctl_set_regs(struct kvm_vcpu *vcpu, struct kvm_regs *regs)\narch/riscv/kvm/vcpu.c-347-{\n--\narch/riscv/kvm/vcpu.c=491=bool kvm_riscv_vcpu_stopped(struct kvm_vcpu *vcpu)\n--\narch/riscv/kvm/vcpu.c-495-\narch/riscv/kvm/vcpu.c:496:int kvm_arch_vcpu_ioctl_get_mpstate(struct kvm_vcpu *vcpu,\narch/riscv/kvm/vcpu.c-497-\t\t\t\t struct kvm_mp_state *mp_state)\n--\narch/riscv/kvm/vcpu.c-503-\narch/riscv/kvm/vcpu.c:504:int kvm_arch_vcpu_ioctl_set_mpstate(struct kvm_vcpu *vcpu,\narch/riscv/kvm/vcpu.c-505-\t\t\t\t struct kvm_mp_state *mp_state)\n--\narch/riscv/kvm/vcpu.c-532-\narch/riscv/kvm/vcpu.c:533:int kvm_arch_vcpu_ioctl_set_guest_debug(struct kvm_vcpu *vcpu,\narch/riscv/kvm/vcpu.c-534-\t\t\t\t\tstruct kvm_guest_debug *dbg)\n--\narch/riscv/kvm/vcpu.c=750=static void noinstr kvm_riscv_vcpu_enter_exit(struct kvm_vcpu *vcpu,\n--\narch/riscv/kvm/vcpu.c-759-\t * HTINST) here because we do local_irq_enable() after this\narch/riscv/kvm/vcpu.c:760:\t * function in kvm_arch_vcpu_ioctl_run() which can result in\narch/riscv/kvm/vcpu.c-761-\t * an interrupt immediately after local_irq_enable() and can\n--\narch/riscv/kvm/vcpu.c-829-\narch/riscv/kvm/vcpu.c:830:int kvm_arch_vcpu_ioctl_run(struct kvm_vcpu *vcpu)\narch/riscv/kvm/vcpu.c-831-{\n--\narch/s390/kvm/kvm-s390.c=3945=int kvm_arch_vcpu_should_kick(struct kvm_vcpu *vcpu)\n--\narch/s390/kvm/kvm-s390.c-3951-\narch/s390/kvm/kvm-s390.c:3952:static int kvm_arch_vcpu_ioctl_get_one_reg(struct kvm_vcpu *vcpu,\narch/s390/kvm/kvm-s390.c-3953-\t\t\t\t\t struct kvm_one_reg *reg)\n--\narch/s390/kvm/kvm-s390.c-4000-\narch/s390/kvm/kvm-s390.c:4001:static int kvm_arch_vcpu_ioctl_set_one_reg(struct kvm_vcpu *vcpu,\narch/s390/kvm/kvm-s390.c-4002-\t\t\t\t\t struct kvm_one_reg *reg)\n--\narch/s390/kvm/kvm-s390.c-4053-\narch/s390/kvm/kvm-s390.c:4054:static void kvm_arch_vcpu_ioctl_normal_reset(struct kvm_vcpu *vcpu)\narch/s390/kvm/kvm-s390.c-4055-{\n--\narch/s390/kvm/kvm-s390.c-4065-\narch/s390/kvm/kvm-s390.c:4066:static void kvm_arch_vcpu_ioctl_initial_reset(struct kvm_vcpu *vcpu)\narch/s390/kvm/kvm-s390.c-4067-{\narch/s390/kvm/kvm-s390.c-4068-\t/* Initial reset is a superset of the normal reset */\narch/s390/kvm/kvm-s390.c:4069:\tkvm_arch_vcpu_ioctl_normal_reset(vcpu);\narch/s390/kvm/kvm-s390.c-4070-\n--\narch/s390/kvm/kvm-s390.c-4109-\narch/s390/kvm/kvm-s390.c:4110:static void kvm_arch_vcpu_ioctl_clear_reset(struct kvm_vcpu *vcpu)\narch/s390/kvm/kvm-s390.c-4111-{\n--\narch/s390/kvm/kvm-s390.c-4114-\t/* Clear reset is a superset of the initial reset */\narch/s390/kvm/kvm-s390.c:4115:\tkvm_arch_vcpu_ioctl_initial_reset(vcpu);\narch/s390/kvm/kvm-s390.c-4116-\n--\narch/s390/kvm/kvm-s390.c-4125-\narch/s390/kvm/kvm-s390.c:4126:int kvm_arch_vcpu_ioctl_set_regs(struct kvm_vcpu *vcpu, struct kvm_regs *regs)\narch/s390/kvm/kvm-s390.c-4127-{\n--\narch/s390/kvm/kvm-s390.c-4133-\narch/s390/kvm/kvm-s390.c:4134:int kvm_arch_vcpu_ioctl_get_regs(struct kvm_vcpu *vcpu, struct kvm_regs *regs)\narch/s390/kvm/kvm-s390.c-4135-{\n--\narch/s390/kvm/kvm-s390.c-4141-\narch/s390/kvm/kvm-s390.c:4142:int kvm_arch_vcpu_ioctl_set_sregs(struct kvm_vcpu *vcpu,\narch/s390/kvm/kvm-s390.c-4143-\t\t\t\t struct kvm_sregs *sregs)\n--\narch/s390/kvm/kvm-s390.c-4153-\narch/s390/kvm/kvm-s390.c:4154:int kvm_arch_vcpu_ioctl_get_sregs(struct kvm_vcpu *vcpu,\narch/s390/kvm/kvm-s390.c-4155-\t\t\t\t struct kvm_sregs *sregs)\n--\narch/s390/kvm/kvm-s390.c-4165-\narch/s390/kvm/kvm-s390.c:4166:int kvm_arch_vcpu_ioctl_set_fpu(struct kvm_vcpu *vcpu, struct kvm_fpu *fpu)\narch/s390/kvm/kvm-s390.c-4167-{\n--\narch/s390/kvm/kvm-s390.c-4180-\narch/s390/kvm/kvm-s390.c:4181:int kvm_arch_vcpu_ioctl_get_fpu(struct kvm_vcpu *vcpu, struct kvm_fpu *fpu)\narch/s390/kvm/kvm-s390.c-4182-{\n--\narch/s390/kvm/kvm-s390.c-4195-\narch/s390/kvm/kvm-s390.c:4196:static int kvm_arch_vcpu_ioctl_set_initial_psw(struct kvm_vcpu *vcpu, psw_t psw)\narch/s390/kvm/kvm-s390.c-4197-{\n--\narch/s390/kvm/kvm-s390.c-4208-\narch/s390/kvm/kvm-s390.c:4209:int kvm_arch_vcpu_ioctl_translate(struct kvm_vcpu *vcpu,\narch/s390/kvm/kvm-s390.c-4210-\t\t\t\t struct kvm_translation *tr)\n--\narch/s390/kvm/kvm-s390.c-4218-\narch/s390/kvm/kvm-s390.c:4219:int kvm_arch_vcpu_ioctl_set_guest_debug(struct kvm_vcpu *vcpu,\narch/s390/kvm/kvm-s390.c-4220-\t\t\t\t\tstruct kvm_guest_debug *dbg)\n--\narch/s390/kvm/kvm-s390.c-4260-\narch/s390/kvm/kvm-s390.c:4261:int kvm_arch_vcpu_ioctl_get_mpstate(struct kvm_vcpu *vcpu,\narch/s390/kvm/kvm-s390.c-4262-\t\t\t\t struct kvm_mp_state *mp_state)\n--\narch/s390/kvm/kvm-s390.c-4275-\narch/s390/kvm/kvm-s390.c:4276:int kvm_arch_vcpu_ioctl_set_mpstate(struct kvm_vcpu *vcpu,\narch/s390/kvm/kvm-s390.c-4277-\t\t\t\t struct kvm_mp_state *mp_state)\n--\narch/s390/kvm/kvm-s390.c=4997=static void store_regs(struct kvm_vcpu *vcpu)\n--\narch/s390/kvm/kvm-s390.c-5017-\narch/s390/kvm/kvm-s390.c:5018:int kvm_arch_vcpu_ioctl_run(struct kvm_vcpu *vcpu)\narch/s390/kvm/kvm-s390.c-5019-{\n--\narch/s390/kvm/kvm-s390.c=5473=static int kvm_s390_handle_pv_vcpu_dump(struct kvm_vcpu *vcpu,\n--\narch/s390/kvm/kvm-s390.c-5514-\narch/s390/kvm/kvm-s390.c:5515:long kvm_arch_vcpu_ioctl(struct file *filp,\narch/s390/kvm/kvm-s390.c-5516-\t\t\t unsigned int ioctl, unsigned long arg)\n--\narch/s390/kvm/kvm-s390.c-5537-\t\t\tbreak;\narch/s390/kvm/kvm-s390.c:5538:\t\tr = kvm_arch_vcpu_ioctl_set_initial_psw(vcpu, psw);\narch/s390/kvm/kvm-s390.c-5539-\t\tbreak;\n--\narch/s390/kvm/kvm-s390.c-5542-\t\tr = 0;\narch/s390/kvm/kvm-s390.c:5543:\t\tkvm_arch_vcpu_ioctl_clear_reset(vcpu);\narch/s390/kvm/kvm-s390.c-5544-\t\tif (kvm_s390_pv_cpu_is_protected(vcpu)) {\n--\narch/s390/kvm/kvm-s390.c-5552-\t\tr = 0;\narch/s390/kvm/kvm-s390.c:5553:\t\tkvm_arch_vcpu_ioctl_initial_reset(vcpu);\narch/s390/kvm/kvm-s390.c-5554-\t\tif (kvm_s390_pv_cpu_is_protected(vcpu)) {\n--\narch/s390/kvm/kvm-s390.c-5563-\t\tr = 0;\narch/s390/kvm/kvm-s390.c:5564:\t\tkvm_arch_vcpu_ioctl_normal_reset(vcpu);\narch/s390/kvm/kvm-s390.c-5565-\t\tif (kvm_s390_pv_cpu_is_protected(vcpu)) {\n--\narch/s390/kvm/kvm-s390.c-5581-\t\tif (ioctl == KVM_SET_ONE_REG)\narch/s390/kvm/kvm-s390.c:5582:\t\t\tr = kvm_arch_vcpu_ioctl_set_one_reg(vcpu, \u0026reg);\narch/s390/kvm/kvm-s390.c-5583-\t\telse\n\n"
} |
| 13/2 | 2026/08/14 11:06 | llm | patch-evaluator |
0mModel:gemini-3.1-pro-preview Args: null Results: null Tokens: input: 18394 output: 45 thoughts: 176 Thoughts: **Focusing Fuzzing on LoongArch KVM VCPU Control** Okay, so I'm looking at how to direct fuzzing efforts related to the LoongArch KVM VCPU. The current thought is that `kvm_arch_vcpu_ioctl` is a good candidate, since it's non-static and accessible as a general KVM API function. But, if I put that into `FocusSymbols`, it's going to affect *all* architectures, not just LoongArch. That's not ideal for targeted fuzzing. I'm wondering if there's a LoongArch-specific function that would be better. Hmm, `kvm_loongarch_vcpu_set_attr` and `kvm_loongarch_cpucfg_set_attr` look promising, but they're both static. That's a deal breaker. So, while I *could* use `kvm_arch_vcpu_ioctl`, it's too generic. I'm thinking, the best approach is to check `arch/loongarch/kvm/vcpu.c` for any other non-static functions related to VCPU configuration or control. That will ensure that I'm focusing the fuzzing on the most relevant code for this specific architecture. |
| 14/2 | 2026/08/14 11:06 | tool | grepper |
0mArgs:{
"Expression": "^int kvm_arch_vcpu_ioctl_",
"PathPrefix": "arch/loongarch/kvm/vcpu.c"
}Results: {
"Output": "arch/loongarch/kvm/vcpu.c=420=vm_fault_t kvm_arch_vcpu_fault(struct kvm_vcpu *vcpu, struct vm_fault *vmf)\n--\narch/loongarch/kvm/vcpu.c-424-\narch/loongarch/kvm/vcpu.c:425:int kvm_arch_vcpu_ioctl_translate(struct kvm_vcpu *vcpu,\narch/loongarch/kvm/vcpu.c-426-\t\t\t\t struct kvm_translation *tr)\n--\narch/loongarch/kvm/vcpu.c=444=int kvm_arch_vcpu_dump_regs(struct kvm_vcpu *vcpu)\n--\narch/loongarch/kvm/vcpu.c-466-\narch/loongarch/kvm/vcpu.c:467:int kvm_arch_vcpu_ioctl_get_mpstate(struct kvm_vcpu *vcpu,\narch/loongarch/kvm/vcpu.c-468-\t\t\t\tstruct kvm_mp_state *mp_state)\n--\narch/loongarch/kvm/vcpu.c-474-\narch/loongarch/kvm/vcpu.c:475:int kvm_arch_vcpu_ioctl_set_mpstate(struct kvm_vcpu *vcpu,\narch/loongarch/kvm/vcpu.c-476-\t\t\t\tstruct kvm_mp_state *mp_state)\n--\narch/loongarch/kvm/vcpu.c-490-\narch/loongarch/kvm/vcpu.c:491:int kvm_arch_vcpu_ioctl_set_guest_debug(struct kvm_vcpu *vcpu,\narch/loongarch/kvm/vcpu.c-492-\t\t\t\t\tstruct kvm_guest_debug *dbg)\n--\narch/loongarch/kvm/vcpu.c=984=static int kvm_set_reg(struct kvm_vcpu *vcpu, const struct kvm_one_reg *reg)\n--\narch/loongarch/kvm/vcpu.c-1001-\narch/loongarch/kvm/vcpu.c:1002:int kvm_arch_vcpu_ioctl_get_sregs(struct kvm_vcpu *vcpu, struct kvm_sregs *sregs)\narch/loongarch/kvm/vcpu.c-1003-{\n--\narch/loongarch/kvm/vcpu.c-1006-\narch/loongarch/kvm/vcpu.c:1007:int kvm_arch_vcpu_ioctl_set_sregs(struct kvm_vcpu *vcpu, struct kvm_sregs *sregs)\narch/loongarch/kvm/vcpu.c-1008-{\n--\narch/loongarch/kvm/vcpu.c-1011-\narch/loongarch/kvm/vcpu.c:1012:int kvm_arch_vcpu_ioctl_get_regs(struct kvm_vcpu *vcpu, struct kvm_regs *regs)\narch/loongarch/kvm/vcpu.c-1013-{\n--\narch/loongarch/kvm/vcpu.c-1023-\narch/loongarch/kvm/vcpu.c:1024:int kvm_arch_vcpu_ioctl_set_regs(struct kvm_vcpu *vcpu, struct kvm_regs *regs)\narch/loongarch/kvm/vcpu.c-1025-{\n--\narch/loongarch/kvm/vcpu.c=1238=long kvm_arch_vcpu_ioctl(struct file *filp,\n--\narch/loongarch/kvm/vcpu.c-1310-\narch/loongarch/kvm/vcpu.c:1311:int kvm_arch_vcpu_ioctl_get_fpu(struct kvm_vcpu *vcpu, struct kvm_fpu *fpu)\narch/loongarch/kvm/vcpu.c-1312-{\n--\narch/loongarch/kvm/vcpu.c-1322-\narch/loongarch/kvm/vcpu.c:1323:int kvm_arch_vcpu_ioctl_set_fpu(struct kvm_vcpu *vcpu, struct kvm_fpu *fpu)\narch/loongarch/kvm/vcpu.c-1324-{\n--\narch/loongarch/kvm/vcpu.c=1829=void kvm_arch_vcpu_put(struct kvm_vcpu *vcpu)\n--\narch/loongarch/kvm/vcpu.c-1852-\narch/loongarch/kvm/vcpu.c:1853:int kvm_arch_vcpu_ioctl_run(struct kvm_vcpu *vcpu)\narch/loongarch/kvm/vcpu.c-1854-{\n"
} |
| 15/2 | 2026/08/14 11:06 | llm | patch-evaluator |
0mModel:gemini-3.1-pro-preview Args: null Results: null Tokens: input: 20185 output: 43 thoughts: 152 Thoughts: **Analyzing the LoongArch KVM Implementation** Okay, so I'm looking at `kvm_arch_vcpu_ioctl`. It's located in `arch/loongarch/kvm/vcpu.c`, which makes sense; this is the architecture-specific implementation of the more general KVM interface. Right, so if I call `kvm_arch_vcpu_ioctl`, it should resolve to the LoongArch version *if* the fuzzer is targeting LoongArch, which it should be in this case. But wait, I need to remember what *this* function actually does. Ah, right! `kvm_arch_vcpu_ioctl` handles `KVM_SET_DEVICE_ATTR` and `KVM_HAS_DEVICE_ATTR` calls related to the VCPU. So, I should probably check the source code in `arch/loongarch/kvm/vcpu.c` to see *exactly* how it's handling those specific ioctls. Time to dig in there. |
| 16/2 | 2026/08/14 11:06 | tool | grepper |
0mArgs:{
"Expression": "long kvm_arch_vcpu_ioctl",
"PathPrefix": "arch/loongarch/kvm/vcpu.c"
}Results: {
"Output": "arch/loongarch/kvm/vcpu.c=1219=static int kvm_loongarch_vcpu_set_attr(struct kvm_vcpu *vcpu,\n--\narch/loongarch/kvm/vcpu.c-1237-\narch/loongarch/kvm/vcpu.c:1238:long kvm_arch_vcpu_ioctl(struct file *filp,\narch/loongarch/kvm/vcpu.c-1239-\t\t\t unsigned int ioctl, unsigned long arg)\n"
} |
| 17/2 | 2026/08/14 11:06 | llm | patch-evaluator |
0mModel:gemini-3.1-pro-preview Args: null Results: null Tokens: input: 20751 output: 40 thoughts: 64 Thoughts: **LoongArch KVM Non-Static Function Check** Okay, so `kvm_arch_vcpu_ioctl` is definitely not static, got it. Now, the next question is whether there are *any* other LoongArch-specific functions within the KVM architecture that aren't declared as static. This is something I need to quickly ascertain. Let's see...I should probably check `arch/loongarch/kvm/vm.c`. I'll zero in on `kvm_arch_init_vm` and see what the declaration tells me. That should give me the answer I need. |
| 18/2 | 2026/08/14 11:06 | tool | grepper |
0mArgs:{
"Expression": "kvm_arch_init_vm",
"PathPrefix": "arch/loongarch/kvm/vm.c"
}Results: {
"Output": "arch/loongarch/kvm/vm.c=28=static void kvm_vm_init_features(struct kvm *kvm)\n--\narch/loongarch/kvm/vm.c-61-\narch/loongarch/kvm/vm.c:62:int kvm_arch_init_vm(struct kvm *kvm, unsigned long type)\narch/loongarch/kvm/vm.c-63-{\n"
} |
| 19/2 | 2026/08/14 11:06 | llm | patch-evaluator |
0mModel:gemini-3.1-pro-preview Args: null Results: null Tokens: input: 21109 output: 104 thoughts: 379 Thoughts: **My Fuzzing Strategy for the LoongArch KVM Race Condition Fix** Okay, so I'm looking at this patch and figuring out the best way to fuzz it. `kvm_arch_init_vm` is a pretty generic function, just like `kvm_arch_vcpu_ioctl`, so I need to choose carefully. Since this patch targets the LoongArch architecture specifically, the fact that `kvm_arch_vcpu_ioctl` is broad is less of a concern. It looks like the patch modifies `kvm_loongarch_cpucfg_set_attr`, which is then called from `kvm_loongarch_vcpu_set_attr` and then ultimately `kvm_arch_vcpu_ioctl`. It might be tempting to drill down further, but since we're targeting a very specific architecture I should stick with the most generic entry point. I checked if `kvm_loongarch_cpucfg_set_attr` was exportable or non-static, but it's internal. `kvm_arch_vcpu_ioctl` seems to be the best entry point for fuzzing, given its connectivity. Now I need to make sure I'm not missing anything. I don't see any other obvious configuration points outside of `KVM`. I also need to verify this is actually a worthwhile target. `kvm_arch_vcpu_ioctl` is an ioctl, not a hot path, so that's good. And yes, it fixes a race condition in KVM for LoongArch, so it is a good target. In summary, the important points are: * **WorthFuzzing**: true * **FocusSymbols**: `kvm_arch_vcpu_ioctl`, `kvm_arch_init_vm` * **EnableConfigs**: `KVM` * **Reasoning**: This patch fixes a race condition in LoongArch KVM CPU configuration using a new spinlock (`pv_setting_lock`). It directly modifies KVM functionality, reachable via VCPU ioctls, making it a good target for fuzzing. |
| 20/2 | 2026/08/14 11:06 | tool | set-results |
0mArgs:{
"EnableConfigs": [
"KVM"
],
"FocusSymbols": [
"kvm_arch_vcpu_ioctl",
"kvm_arch_init_vm"
],
"Reasoning": "The patch fixes a race condition in LoongArch KVM CPU configuration by introducing a new spinlock `pv_setting_lock`. This is a functional change in the KVM subsystem that is reachable via VCPU ioctls.",
"WorthFuzzing": true
}Results: {
"EnableConfigs": [
"KVM"
],
"FocusSymbols": [
"kvm_arch_vcpu_ioctl",
"kvm_arch_init_vm"
],
"Reasoning": "The patch fixes a race condition in LoongArch KVM CPU configuration by introducing a new spinlock `pv_setting_lock`. This is a functional change in the KVM subsystem that is reachable via VCPU ioctls.",
"WorthFuzzing": true
} |
| 21/1 | 2026/08/14 11:06 | action | If |
0mArgs:{
"WorthFuzzing": true
}Results: null |
| 22/2 | 2026/08/14 11:06 | agent | kmsan-evaluator |
0mModel:best-expensive Args: null Results: {
"KMSANReasoning": "The patch adds a spinlock (`pv_setting_lock`) to protect the `pv_features` field in `struct kvm_arch` from concurrent modifications during vCPU configuration. This is a concurrency/locking fix aimed at preventing data races or inconsistent states across vCPUs. It does not introduce any new memory allocations, structures sent to user space, or changes to bounds checking that could expose uninitialized memory. Concurrency issues and data races are best detected by tools like KCSAN or LOCKDEP, while KASAN handles memory corruption. KMSAN is specifically for detecting uninitialized memory usage, which is not relevant to this patch.",
"NeedsKMSAN": false
}Instruction: You are an expert Linux kernel security engineer specializing in kernel memory
error detectors (KASAN and KMSAN). Your job is to review the provided patch series and
determine if the code changes justify spawning a dedicated KMSAN (KernelMemorySanitizer)
fuzzing session in addition to standard KASAN fuzzing.
CRITICAL DISTINCTION BETWEEN KASAN AND KMSAN:
- Standard KASAN kernel builds (upstream-apparmor-kasan.config) already enable
a comprehensive suite of debugging tools and sanitizers, including KASAN
(out-of-bounds accesses, use-after-free, double free, invalid free), LOCKDEP
(locking bugs and deadlocks), UB-sanitizers, and memory corruption checks.
- KMSAN (KernelMemorySanitizer) detects reads of UNINITIALIZED memory (stack, heap,
or page allocations) and kernel-to-user memory info-leaks.
Rule: THERE IS NO SENSE IN RUNNING A KMSAN SESSION IF A BUG CAN BE CAUGHT BY KASAN,
LOCKDEP, OR OTHER STANDARD BUG DETECTORS.
A dedicated KMSAN fuzzing session incurs significant resource costs. You must ONLY
set NeedsKMSAN=true if the code changes introduce or expose UNINITIALIZED MEMORY risks
that are detected ONLY by KMSAN.
Look holistically at the patch series and surrounding code. Even if no direct
uninitialized field accesses or new buffer allocations are added in the diff itself,
a patch may alter control flow, bounds checking, or data length calculations in ways
that change how the rest of the code operates on existing buffers (e.g. allowing
uninitialized stack/heap memory to be read, copied to user space, or used in control
flow). Do not hesitate to use your code access tools to inspect the surrounding code,
called functions, and callers.
Set NeedsKMSAN=true ONLY IF the patch introduces or modifies:
1. Kernel structures sent to user space (via copy_to_user, put_user, netlink skb
attributes, ioctl output arguments, socket options, or BPF buffers) where fields
or structure padding might not be fully initialized/zeroed.
2. Conditional logic or branching that depends on potentially uninitialized variables
or struct fields.
3. Allocation or initialization of complex data structures where uninitialized fields
could be read later in reachable code paths.
4. Bounds checks, lengths, or logic in a way that allows surrounding code to access
uninitialized bytes of existing buffers.
Set NeedsKMSAN=false IF:
- The code changes primarily risk out-of-bounds access, array overflows, NULL pointer
dereferences, locking deadlocks, or use-after-free bugs (these are already caught
by KASAN, LOCKDEP, or standard bug detectors).
- All stack/heap structures touched or introduced by the patch are fully zeroed
or initialized (e.g. using = {0}, memset, kzalloc) before being read or copied.
- The patch does not introduce any risk of uninitialized memory usage or info-leaks.
Use your code access tools to inspect the surrounding code if necessary, then provide
detailed KMSANReasoning contrasting KASAN vs KMSAN applicability for this patch.
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 3ce7f3e7613615fa480008b73185ae2fe187a1ba
Author: syz-cluster <triage@syzkaller.com>
Date: Fri Aug 14 11:05:34 2026 +0000
syz-cluster: applied patch under review
diff --git a/arch/loongarch/include/asm/kvm_host.h b/arch/loongarch/include/asm/kvm_host.h
index 23cfbecebbd79..3538a199aac62 100644
--- a/arch/loongarch/include/asm/kvm_host.h
+++ b/arch/loongarch/include/asm/kvm_host.h
@@ -125,6 +125,7 @@ struct kvm_arch {
unsigned int pte_shifts[MAX_PGTABLE_LEVELS];
unsigned int root_level;
spinlock_t phyid_map_lock;
+ spinlock_t pv_setting_lock;
struct kvm_phyid_map *phyid_map;
/* Enabled PV features */
unsigned long pv_features;
diff --git a/arch/loongarch/kvm/vcpu.c b/arch/loongarch/kvm/vcpu.c
index 20c207d80e31a..e47fa463a8bec 100644
--- a/arch/loongarch/kvm/vcpu.c
+++ b/arch/loongarch/kvm/vcpu.c
@@ -1165,10 +1165,14 @@ static int kvm_loongarch_cpucfg_set_attr(struct kvm_vcpu *vcpu,
return -EINVAL;
/* All vCPUs need set the same PV features */
+ spin_lock(&kvm->arch.pv_setting_lock);
if ((kvm->arch.pv_features & LOONGARCH_PV_FEAT_UPDATED)
- && ((kvm->arch.pv_features & valid) != val))
+ && ((kvm->arch.pv_features & valid) != val)) {
+ spin_unlock(&kvm->arch.pv_setting_lock);
return -EINVAL;
+ }
kvm->arch.pv_features = val | LOONGARCH_PV_FEAT_UPDATED;
+ spin_unlock(&kvm->arch.pv_setting_lock);
return 0;
default:
return -ENXIO;
diff --git a/arch/loongarch/kvm/vm.c b/arch/loongarch/kvm/vm.c
index 1317c718f896a..86ba7d54e81f8 100644
--- a/arch/loongarch/kvm/vm.c
+++ b/arch/loongarch/kvm/vm.c
@@ -76,6 +76,7 @@ int kvm_arch_init_vm(struct kvm *kvm, unsigned long type)
return -ENOMEM;
}
spin_lock_init(&kvm->arch.phyid_map_lock);
+ spin_lock_init(&kvm->arch.pv_setting_lock);
kvm_init_vmcs(kvm);
kvm_vm_init_features(kvm);
|
| 23/3 | 2026/08/14 11:06 | llm | kmsan-evaluator |
0mModel:gemini-3.1-pro-preview Args: null Results: null Tokens: input: 2568 output: 157 thoughts: 315 Thoughts: **My Assessment of the KVM Loongarch Patch** Okay, so this patch is straightforward. It's adding a new spinlock, `pv_setting_lock`, to the `kvm_arch` struct in the LoongArch KVM implementation. From what I can see, it's initialized during VM initialization in `kvm_arch_init_vm` and then used to protect the `kvm->arch.pv_features` variable within `kvm_loongarch_cpucfg_set_attr`. Essentially, this is a classic locking fix to resolve a concurrency issue, likely a data race. The code clearly outlines a pattern: lock, check a condition, modify data, and unlock, with an early exit and unlock on failure. The code is clean and addresses a potential race condition when setting the `pv_features`. The patch doesn't involve any changes to how data is exposed to userspace, no modifications to existing bounds checks, and no allocation of any complex structures. Since the bug this is addressing is a concurrency issue and it's being caught by KCSAN or LOCKDEP, there's no need for KMSAN to be involved. I can confidently assess this as a standard locking fix, and there are no new uninitialized memory risks introduced. Therefore, I'm comfortable setting `NeedsKMSAN` to false. The patch is sound and addresses a real concurrency concern, preventing potential data corruption in the KVM LoongArch implementation. |
| 24/3 | 2026/08/14 11:06 | tool | set-results |
0mArgs:{
"KMSANReasoning": "The patch adds a spinlock (`pv_setting_lock`) to protect the `pv_features` field in `struct kvm_arch` from concurrent modifications during vCPU configuration. This is a concurrency/locking fix aimed at preventing data races or inconsistent states across vCPUs. It does not introduce any new memory allocations, structures sent to user space, or changes to bounds checking that could expose uninitialized memory. Concurrency issues and data races are best detected by tools like KCSAN or LOCKDEP, while KASAN handles memory corruption. KMSAN is specifically for detecting uninitialized memory usage, which is not relevant to this patch.",
"NeedsKMSAN": false
}Results: {
"KMSANReasoning": "The patch adds a spinlock (`pv_setting_lock`) to protect the `pv_features` field in `struct kvm_arch` from concurrent modifications during vCPU configuration. This is a concurrency/locking fix aimed at preventing data races or inconsistent states across vCPUs. It does not introduce any new memory allocations, structures sent to user space, or changes to bounds checking that could expose uninitialized memory. Concurrency issues and data races are best detected by tools like KCSAN or LOCKDEP, while KASAN handles memory corruption. KMSAN is specifically for detecting uninitialized memory usage, which is not relevant to this patch.",
"NeedsKMSAN": false
} |
| Total Calls | Total Tokens | Avg Tokens | Total Duration (Seconds) | Avg Duration (Seconds) |
|---|
| Total Calls | Total Duration (Seconds) | Avg Duration (Seconds) |
|---|