id
stringlengths
40
40
instruction
stringlengths
68
308
input
stringlengths
17
33.4k
output
stringlengths
100
30k
9b6b016df4c2902cd6acd2673bffea6c1e8f643d
Analyze and fix the following issue in the Linux kernel code: tools: ynl: fix logic errors reported by pylint
Problem Details: Fix the following logic errors: tools/net/ynl/pyynl/lib/nlspec.py:299:15: E1101: Instance of 'list' has no 'items' member (no-member) tools/net/ynl/pyynl/lib/nlspec.py:580:22: E0606: Possibly using variable 'op' before assignment (possibly-used-before-assignment) Signed-off-by: Donald Hunter <donald...
```diff diff --git a/tools/net/ynl/pyynl/lib/nlspec.py b/tools/net/ynl/pyynl/lib/nlspec.py index 0b5277082b38..fcffeb5b7ba3 100644 --- a/tools/net/ynl/pyynl/lib/nlspec.py +++ b/tools/net/ynl/pyynl/lib/nlspec.py @@ -295,7 +295,7 @@ class SpecStruct(SpecElement): yield from self.members def items(self): -...
00ef9f153ed899e26382fc7918c1d087b20ef2c5
Analyze and fix the following issue in the Linux kernel code: tools: ynl: fix pylint global variable related warnings
Problem Details: Refactor to avoid using global variables to fix the following pylint issues: - invalid-name - global-statement - global-variable-not-assigned Signed-off-by: Donald Hunter <donald.hunter@gmail.com> Link: https://patch.msgid.link/20260108161339.29166-7-donald.hunter@gmail.com Signed-off-by: Jakub Kicin...
```diff diff --git a/tools/net/ynl/pyynl/lib/nlspec.py b/tools/net/ynl/pyynl/lib/nlspec.py index f3173146b64b..0b5277082b38 100644 --- a/tools/net/ynl/pyynl/lib/nlspec.py +++ b/tools/net/ynl/pyynl/lib/nlspec.py @@ -13,10 +13,6 @@ import os import yaml as pyyaml -# To be loaded dynamically as needed -jsonschema = N...
542ba2de32fb7ad6b8c51a05a4f0d6ca3cc66d67
Analyze and fix the following issue in the Linux kernel code: tools: ynl: fix pylint misc warnings
Problem Details: Fix pylint warnings for: - unused-argument - consider-using-in - consider-using-get - consider-using-f-string - protected-access - unidiomatic-typecheck - no-else-return Signed-off-by: Donald Hunter <donald.hunter@gmail.com> Link: https://patch.msgid.link/20260108161339.29166-6-donald.hunter@gmail.co...
```diff diff --git a/tools/net/ynl/pyynl/lib/doc_generator.py b/tools/net/ynl/pyynl/lib/doc_generator.py index 3a16b8eb01ca..d1afff9d9956 100644 --- a/tools/net/ynl/pyynl/lib/doc_generator.py +++ b/tools/net/ynl/pyynl/lib/doc_generator.py @@ -109,8 +109,7 @@ class RstFormatters: 'fixed-header': 'de...
04b0b64e86b7ee9923099d141f8e2ed74389c435
Analyze and fix the following issue in the Linux kernel code: tools: ynl: fix pylint dict, indentation, long lines, uninitialised
Problem Details: Fix pylint warnings for: - use-dict-literal - bad-indentation - line-too-long - possibly-used-before-assignment Signed-off-by: Donald Hunter <donald.hunter@gmail.com> Link: https://patch.msgid.link/20260108161339.29166-5-donald.hunter@gmail.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
```diff diff --git a/tools/net/ynl/pyynl/lib/nlspec.py b/tools/net/ynl/pyynl/lib/nlspec.py index a35f827f09e3..fcd4106d0cfa 100644 --- a/tools/net/ynl/pyynl/lib/nlspec.py +++ b/tools/net/ynl/pyynl/lib/nlspec.py @@ -129,8 +129,8 @@ class SpecEnumSet(SpecElement): prev_entry = None value_start = self....
b6270a10b0f8727fea3005eecd9907ddaf38dc3f
Analyze and fix the following issue in the Linux kernel code: tools: ynl: fix pylint exception warnings
Problem Details: Fix pylint warnings for: - broad-exception-raised - broad-exception-caught - raise-missing-from Signed-off-by: Donald Hunter <donald.hunter@gmail.com> Link: https://patch.msgid.link/20260108161339.29166-4-donald.hunter@gmail.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
```diff diff --git a/tools/net/ynl/pyynl/cli.py b/tools/net/ynl/pyynl/cli.py index 37efa8c4f0e2..5fee45e48bbf 100755 --- a/tools/net/ynl/pyynl/cli.py +++ b/tools/net/ynl/pyynl/cli.py @@ -15,7 +15,7 @@ import textwrap # pylint: disable=no-name-in-module,wrong-import-position sys.path.append(pathlib.Path(__file__).re...
bcdd8ea73f750a4a6c38859a3f06027aa40b84c5
Analyze and fix the following issue in the Linux kernel code: tools: ynl: fix pylint redefinition, encoding errors
Problem Details: Fix pylint warnings for: - invalid-name - arguments-renamed - redefined-outer-name - unspecified-encoding - consider-using-sys-exit Signed-off-by: Donald Hunter <donald.hunter@gmail.com> Link: https://patch.msgid.link/20260108161339.29166-3-donald.hunter@gmail.com Signed-off-by: Jakub Kicinski <kuba@...
```diff diff --git a/tools/net/ynl/pyynl/cli.py b/tools/net/ynl/pyynl/cli.py index 996c76be1403..37efa8c4f0e2 100755 --- a/tools/net/ynl/pyynl/cli.py +++ b/tools/net/ynl/pyynl/cli.py @@ -17,8 +17,8 @@ import textwrap sys.path.append(pathlib.Path(__file__).resolve().parent.as_posix()) from lib import YnlFamily, Netlin...
08b096c1372cd69627f4f559fb47c9fb67a52b39
Analyze and fix the following issue in the Linux kernel code: btrfs: send: check for inline extents in range_is_hole_in_parent()
Problem Details: Before accessing the disk_bytenr field of a file extent item we need to check if we are dealing with an inline extent. This is because for inline extents their data starts at the offset of the disk_bytenr field. So accessing the disk_bytenr means we are accessing inline data or in case the inline data ...
```diff diff --git a/fs/btrfs/send.c b/fs/btrfs/send.c index 130aabced207..d0b2f9bd4150 100644 --- a/fs/btrfs/send.c +++ b/fs/btrfs/send.c @@ -6382,6 +6382,8 @@ static int range_is_hole_in_parent(struct send_ctx *sctx, extent_end = btrfs_file_extent_end(path); if (extent_end <= start) goto next; + if (btrfs_...
d5fac7ddb38cd627a8fc2b87e5b588b48a803956
Analyze and fix the following issue in the Linux kernel code: btrfs: tests: fix return 0 on rmap test failure
Problem Details: In test_rmap_blocks(), we have ret = 0 before checking the results. We need to set it to -EINVAL, so that a mismatching result will return -EINVAL not 0. Reviewed-by: Qu Wenruo <wqu@suse.com> Signed-off-by: Naohiro Aota <naohiro.aota@wdc.com> Reviewed-by: David Sterba <dsterba@suse.com> Signed-off-by:...
```diff diff --git a/fs/btrfs/tests/extent-map-tests.c b/fs/btrfs/tests/extent-map-tests.c index 0b9f25dd1a68..aabf825e8d7b 100644 --- a/fs/btrfs/tests/extent-map-tests.c +++ b/fs/btrfs/tests/extent-map-tests.c @@ -1059,6 +1059,7 @@ static int test_rmap_block(struct btrfs_fs_info *fs_info, if (out_stripe_len != BTR...
be1c2e8afe3ac4a4f15a13f6844619c2cf47b1d1
Analyze and fix the following issue in the Linux kernel code: btrfs: tests: fix root tree leak in btrfs_test_qgroups()
Problem Details: If btrfs_insert_fs_root() fails, the tmp_root allocated by btrfs_alloc_dummy_root() is leaked because its initial reference count is not decremented. Fix this by calling btrfs_put_root() unconditionally after btrfs_insert_fs_root(). This ensures the local reference is always dropped. Also fix a copy-...
```diff diff --git a/fs/btrfs/tests/qgroup-tests.c b/fs/btrfs/tests/qgroup-tests.c index e9124605974b..0fcc31beeffe 100644 --- a/fs/btrfs/tests/qgroup-tests.c +++ b/fs/btrfs/tests/qgroup-tests.c @@ -517,11 +517,11 @@ int btrfs_test_qgroups(u32 sectorsize, u32 nodesize) tmp_root->root_key.objectid = BTRFS_FS_TREE_OBJE...
1e1f2055ad5a7a5d548789b334a4473a7665c418
Analyze and fix the following issue in the Linux kernel code: btrfs: release path before iget_failed() in btrfs_read_locked_inode()
Problem Details: In btrfs_read_locked_inode() if we fail to lookup the inode, we jump to the 'out' label with a path that has a read locked leaf and then we call iget_failed(). This can result in a ABBA deadlock, since iget_failed() triggers inode eviction and that causes the release of the delayed inode, which must lo...
```diff diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c index 5ea1c392bbc7..731cd5df232c 100644 --- a/fs/btrfs/inode.c +++ b/fs/btrfs/inode.c @@ -4178,6 +4178,15 @@ cache_acl: return 0; out: + /* + * We may have a read locked leaf and iget_failed() triggers inode + * eviction which needs to release the delayed ...
b49c35ba0ce1ce1779a2ad563c85fbf87d03689f
Analyze and fix the following issue in the Linux kernel code: drm/panfrost: Fix a page leak in panfrost_mmu_map_fault_addr() when THP is on
Problem Details: drm_gem_put_pages(), which we rely on for returning BO pages to shmem, assume per-folio refcounting and not per-page. If we call shmem_read_mapping_page() per-page, we break this assumption and leak pages every time we get a huge page allocated. v2: - Rework the logic for() loop to better match the fo...
```diff diff --git a/drivers/gpu/drm/panfrost/panfrost_mmu.c b/drivers/gpu/drm/panfrost/panfrost_mmu.c index 8f3b7a7b6ad0..50ff30849361 100644 --- a/drivers/gpu/drm/panfrost/panfrost_mmu.c +++ b/drivers/gpu/drm/panfrost/panfrost_mmu.c @@ -587,12 +587,12 @@ out: static int panfrost_mmu_map_fault_addr(struct panfrost_de...
3e8aaacdad4f66641f87ab441fe644b45f8ebdff
Analyze and fix the following issue in the Linux kernel code: cxl/port: Fix target list setup for multiple decoders sharing the same dport
Problem Details: If a switch port has more than one decoder that is using the same downstream port, the enumeration of the target lists may fail with: # dmesg | grep target.list update_decoder_targets: cxl decoder1.0: dport3 found in target list, index 3 update_decoder_targets: cxl decoder1.0: dport2 found in targe...
```diff diff --git a/drivers/cxl/core/port.c b/drivers/cxl/core/port.c index fef3aa0c6680..3310dbfae9d6 100644 --- a/drivers/cxl/core/port.c +++ b/drivers/cxl/core/port.c @@ -1590,7 +1590,7 @@ static int update_decoder_targets(struct device *dev, void *data) cxlsd->target[i] = dport; dev_dbg(dev, "dport%d found...
29f4e7301910d7d1ece249cf34dfbe4dd7c2c6c4
Analyze and fix the following issue in the Linux kernel code: drm/gpuvm: fix name in kernel doc of drm_gpuvm_bo_obtain_locked()
Problem Details: When renaming this function, the name in the docs was not updated. This causes a KernelDoc warning. Thus, fix it. Reported-by: kernel test robot <lkp@intel.com> Closes: https://lore.kernel.org/oe-kbuild-all/202601091113.0b0WuRML-lkp@intel.com/ Fixes: 9bf4ca1e699c ("drm/gpuvm: drm_gpuvm_bo_obtain() req...
```diff diff --git a/drivers/gpu/drm/drm_gpuvm.c b/drivers/gpu/drm/drm_gpuvm.c index 0bb115b6b59c..c75b4877ab92 100644 --- a/drivers/gpu/drm/drm_gpuvm.c +++ b/drivers/gpu/drm/drm_gpuvm.c @@ -1815,8 +1815,8 @@ drm_gpuvm_bo_find(struct drm_gpuvm *gpuvm, EXPORT_SYMBOL_GPL(drm_gpuvm_bo_find); /** - * drm_gpuvm_bo_obtai...
701c47493328a8173996e7590733be3493af572f
Analyze and fix the following issue in the Linux kernel code: drm/i915/guc: make 'guc_hw_reg_state' static as it isn't exported
Problem Details: The guc_hw_reg_state array is not exported, so make it static. Fixes the following sparse warning: drivers/gpu/drm/i915/i915_gpu_error.c:692:3: warning: symbol 'guc_hw_reg_state' was not declared. Should it be static? Fixes: ba391a102ec11 ("drm/i915/guc: Include the GuC registers in the error state") ...
```diff diff --git a/drivers/gpu/drm/i915/i915_gpu_error.c b/drivers/gpu/drm/i915/i915_gpu_error.c index 7582ef34bf3f..303d8d9b7775 100644 --- a/drivers/gpu/drm/i915/i915_gpu_error.c +++ b/drivers/gpu/drm/i915/i915_gpu_error.c @@ -686,7 +686,7 @@ static void err_print_guc_ctb(struct drm_i915_error_state_buf *m, } /...
ee021b27333b657d0799ac791c1a6b9ddb293547
Analyze and fix the following issue in the Linux kernel code: arm64: dts: qcom: kodiak: Add missing clock votes for lpass_tlmm
Problem Details: Without the correct clock votes set, we may be hitting a synchronous external abort error when touching the lpi registers. Internal error: synchronous external abort: 0000000096000010 [#1] SMP <...> Call trace: lpi_gpio_read.isra.0+0x2c/0x58 (P) pinmux_enable_setting+0x218/0x300 pinctr...
```diff diff --git a/arch/arm64/boot/dts/qcom/kodiak.dtsi b/arch/arm64/boot/dts/qcom/kodiak.dtsi index 076069f14495..f478c5e1d2d5 100644 --- a/arch/arm64/boot/dts/qcom/kodiak.dtsi +++ b/arch/arm64/boot/dts/qcom/kodiak.dtsi @@ -2994,6 +2994,11 @@ compatible = "qcom,sc7280-lpass-lpi-pinctrl"; reg = <0 0x033c0000 ...
1fed08c5519d2f929457f354d3c06c6a8c33829c
Analyze and fix the following issue in the Linux kernel code: wifi: ath12k: don't force radio frequency check in freq_to_idx()
Problem Details: freq_to_idx() is used to map a channel to a survey index. Commit acc152f9be20 ("wifi: ath12k: combine channel list for split-phy devices in single-wiphy") adds radio specific frequency range check in this helper to make sure an invalid index is returned if the channel falls outside that range. However,...
```diff diff --git a/drivers/net/wireless/ath/ath12k/wmi.c b/drivers/net/wireless/ath/ath12k/wmi.c index be8b2943094f..3ce5fcb0e460 100644 --- a/drivers/net/wireless/ath/ath12k/wmi.c +++ b/drivers/net/wireless/ath/ath12k/wmi.c @@ -6575,16 +6575,9 @@ static int freq_to_idx(struct ath12k *ar, int freq) if (!sband) ...
bb97131fbf9b708dd9616ac2bdc793ad102b5c48
Analyze and fix the following issue in the Linux kernel code: wifi: ath12k: fix dma_free_coherent() pointer
Problem Details: dma_alloc_coherent() allocates a DMA mapped buffer and stores the addresses in XXX_unaligned fields. Those should be reused when freeing the buffer rather than the aligned addresses. Fixes: d889913205cf ("wifi: ath12k: driver for Qualcomm Wi-Fi 7 devices") Cc: stable@vger.kernel.org Signed-off-by: Th...
```diff diff --git a/drivers/net/wireless/ath/ath12k/ce.c b/drivers/net/wireless/ath/ath12k/ce.c index 9a63608838ac..4aea58446838 100644 --- a/drivers/net/wireless/ath/ath12k/ce.c +++ b/drivers/net/wireless/ath/ath12k/ce.c @@ -984,8 +984,8 @@ void ath12k_ce_free_pipes(struct ath12k_base *ab) dma_free_coherent(ab->d...
9282a1e171ad8d2205067e8ec3bbe4e3cef4f29f
Analyze and fix the following issue in the Linux kernel code: wifi: ath10k: fix dma_free_coherent() pointer
Problem Details: dma_alloc_coherent() allocates a DMA mapped buffer and stores the addresses in XXX_unaligned fields. Those should be reused when freeing the buffer rather than the aligned addresses. Fixes: 2a1e1ad3fd37 ("ath10k: Add support for 64 bit ce descriptor") Cc: stable@vger.kernel.org Signed-off-by: Thomas ...
```diff diff --git a/drivers/net/wireless/ath/ath10k/ce.c b/drivers/net/wireless/ath/ath10k/ce.c index 7bbda46cfd93..82f120ee1c66 100644 --- a/drivers/net/wireless/ath/ath10k/ce.c +++ b/drivers/net/wireless/ath/ath10k/ce.c @@ -1727,8 +1727,8 @@ static void _ath10k_ce_free_pipe(struct ath10k *ar, int ce_id) (ce_s...
1690eeb0cb2bb77096cb6c826b6849ef05013e34
Analyze and fix the following issue in the Linux kernel code: irqchip/gic-v5: Fix gicv5_its_map_event() ITTE read endianness
Problem Details: Kbuild bot (through sparse) reported that the ITTE read to carry out a valid check in gicv5_its_map_event() lacks proper endianness handling. Add the missing endianess conversion. Fixes: 57d72196dfc8 ("irqchip/gic-v5: Add GICv5 ITS support") Reported-by: kernel test robot <lkp@intel.com> Signed-off-b...
```diff diff --git a/drivers/irqchip/irq-gic-v5-its.c b/drivers/irqchip/irq-gic-v5-its.c index 554485f0be1f..8e22134b9f48 100644 --- a/drivers/irqchip/irq-gic-v5-its.c +++ b/drivers/irqchip/irq-gic-v5-its.c @@ -849,7 +849,7 @@ static int gicv5_its_map_event(struct gicv5_its_dev *its_dev, u16 event_id, u32 itte = gi...
7d3fa7e954934fbda0a017ac1c305b7b10ecceef
Analyze and fix the following issue in the Linux kernel code: nvme-apple: add "apple,t8103-nvme-ans2" as compatible
Problem Details: After discussion with the devicetree maintainers we agreed to not extend lists with the generic compatible "apple,nvme-ans2" anymore [1]. Add "apple,t8103-nvme-ans2" as fallback compatible as it is the SoC the driver and bindings were written for. [1]: https://lore.kernel.org/asahi/12ab93b7-1fc2-4ce0-...
```diff diff --git a/drivers/nvme/host/apple.c b/drivers/nvme/host/apple.c index 15b3d07f8ccd..ed61b97fde59 100644 --- a/drivers/nvme/host/apple.c +++ b/drivers/nvme/host/apple.c @@ -1704,6 +1704,7 @@ static const struct apple_nvme_hw apple_nvme_t8103_hw = { static const struct of_device_id apple_nvme_of_match[] = {...
32b63acd78f577b332d976aa06b56e70d054cbba
Analyze and fix the following issue in the Linux kernel code: nvme-tcp: fix NULL pointer dereferences in nvmet_tcp_build_pdu_iovec
Problem Details: Commit efa56305908b ("nvmet-tcp: Fix a kernel panic when host sends an invalid H2C PDU length") added ttag bounds checking and data_offset validation in nvmet_tcp_handle_h2c_data_pdu(), but it did not validate whether the command's data structures (cmd->req.sg and cmd->iov) have been properly initializ...
```diff diff --git a/drivers/nvme/target/tcp.c b/drivers/nvme/target/tcp.c index 15416ff0eac4..d5966d007ba3 100644 --- a/drivers/nvme/target/tcp.c +++ b/drivers/nvme/target/tcp.c @@ -982,6 +982,18 @@ static int nvmet_tcp_handle_h2c_data_pdu(struct nvmet_tcp_queue *queue) pr_err("H2CData PDU len %u is invalid\n", cmd...
b3a7767989e6519127ac5e0cde682c50ad587f3b
Analyze and fix the following issue in the Linux kernel code: drm/xe/vm: fix xe_vm_validation_exec() kernel-doc
Problem Details: Fix kernel-doc warnings on xe_vm_validation_exec(): Warning: ../drivers/gpu/drm/xe/xe_vm.h:392 expecting prototype for xe_vm_set_validation_exec(). Prototype was for xe_vm_validation_exec() instead Fixes: 0131514f9789 ("drm/xe: Pass down drm_exec context to validation") Cc: Thomas Hellström <thom...
```diff diff --git a/drivers/gpu/drm/xe/xe_vm.h b/drivers/gpu/drm/xe/xe_vm.h index 7d11ca47d73e..6cc98df47291 100644 --- a/drivers/gpu/drm/xe/xe_vm.h +++ b/drivers/gpu/drm/xe/xe_vm.h @@ -382,7 +382,7 @@ static inline void xe_vm_set_validation_exec(struct xe_vm *vm, struct drm_exec * } /** - * xe_vm_set_validation_e...
a857e6102970c7bd8f2db967fe02d76741179d14
Analyze and fix the following issue in the Linux kernel code: drm/xe/xe_late_bind_fw: fix enum xe_late_bind_fw_id kernel-doc
Problem Details: Fix kernel-doc warnings on enum xe_late_bind_fw_id: Warning: ../drivers/gpu/drm/xe/xe_late_bind_fw_types.h:19 cannot understand function prototype: 'enum xe_late_bind_fw_id' Fixes: 45832bf9c10f ("drm/xe/xe_late_bind_fw: Initialize late binding firmware") Cc: Badal Nilawar <badal.nilawar@intel.com> ...
```diff diff --git a/drivers/gpu/drm/xe/xe_late_bind_fw_types.h b/drivers/gpu/drm/xe/xe_late_bind_fw_types.h index 0f5da89ce98b..2a8a985c37e7 100644 --- a/drivers/gpu/drm/xe/xe_late_bind_fw_types.h +++ b/drivers/gpu/drm/xe/xe_late_bind_fw_types.h @@ -15,10 +15,12 @@ #define XE_LB_MAX_PAYLOAD_SIZE SZ_4K /** - * xe_l...
44393331c79f5df14c1ff25f4a355f439a2dc8a2
Analyze and fix the following issue in the Linux kernel code: drm/xe/vf: fix struct xe_gt_sriov_vf_migration kernel-doc
Problem Details: Fix kernel-doc warnings on struct xe_gt_sriov_vf_migration: Warning: ../drivers/gpu/drm/xe/xe_gt_sriov_vf_types.h:47 cannot understand function prototype: 'struct xe_gt_sriov_vf_migration' Fixes: e1d2e2d878bf ("drm/xe/vf: Add xe_gt_recovery_pending helper") Cc: Matthew Brost <matthew.brost@intel.co...
```diff diff --git a/drivers/gpu/drm/xe/xe_gt_sriov_vf_types.h b/drivers/gpu/drm/xe/xe_gt_sriov_vf_types.h index 9a6b5672d569..4ef881b9b662 100644 --- a/drivers/gpu/drm/xe/xe_gt_sriov_vf_types.h +++ b/drivers/gpu/drm/xe/xe_gt_sriov_vf_types.h @@ -43,10 +43,10 @@ struct xe_gt_sriov_vf_runtime { }; /** - * xe_gt_srio...
4cdcfa64b6032ec68cdaa6c424b3b293cf7ff45c
Analyze and fix the following issue in the Linux kernel code: drm/xe/guc: fix struct guc_lfd_file_header kernel-doc
Problem Details: Fix kernel-doc warnings on struct guc_lfd_file_header: Warning: ../drivers/gpu/drm/xe/abi/guc_lfd_abi.h:168 expecting prototype for struct guc_logfile_header. Prototype was for struct guc_lfd_file_header instead Fixes: 7eeb0e5408bd ("drm/xe/guc: Add LFD related abi definitions") Cc: Zhanjun Dong ...
```diff diff --git a/drivers/gpu/drm/xe/abi/guc_lfd_abi.h b/drivers/gpu/drm/xe/abi/guc_lfd_abi.h index b6ed20d5b508..5c48459f365f 100644 --- a/drivers/gpu/drm/xe/abi/guc_lfd_abi.h +++ b/drivers/gpu/drm/xe/abi/guc_lfd_abi.h @@ -148,7 +148,7 @@ struct guc_lfd_data_os_info { } __packed; /** - * struct guc_logfile_head...
0f8d0d764cc936cb834f39f0279c7776e0c1209d
Analyze and fix the following issue in the Linux kernel code: drm/i915/cdclk: Incorporate Xe3_LPD changes for CD2X divider
Problem Details: On Xe3_LPD, there is no instruction to program the CD2X divider anymore and the hardware is expected to always use the default value of 0b00, meaning "divide by 1". With that, the CDCLK_CTL register was changed so that: (1) The field "CD2X Divider Select" became a debug-only field. Because we...
```diff diff --git a/drivers/gpu/drm/i915/display/intel_cdclk.c b/drivers/gpu/drm/i915/display/intel_cdclk.c index 7443e5285942..9bfbfbf34dc0 100644 --- a/drivers/gpu/drm/i915/display/intel_cdclk.c +++ b/drivers/gpu/drm/i915/display/intel_cdclk.c @@ -1948,6 +1948,8 @@ static u32 bxt_cdclk_cd2x_pipe(struct intel_display...
f0d385f6689f37a2828c686fb279121df006b4cb
Analyze and fix the following issue in the Linux kernel code: ublk: fix use-after-free in ublk_partition_scan_work
Problem Details: A race condition exists between the async partition scan work and device teardown that can lead to a use-after-free of ub->ub_disk: 1. ublk_ctrl_start_dev() schedules partition_scan_work after add_disk() 2. ublk_stop_dev() calls ublk_stop_dev_unlocked() which does: - del_gendisk(ub->ub_disk) - u...
```diff diff --git a/drivers/block/ublk_drv.c b/drivers/block/ublk_drv.c index 837fedb02e0d..f6e5a0766721 100644 --- a/drivers/block/ublk_drv.c +++ b/drivers/block/ublk_drv.c @@ -255,20 +255,6 @@ static inline struct request *__ublk_check_and_get_req(struct ublk_device *ub, u16 q_id, u16 tag, struct ublk_io *io, siz...
e23c0a59dabae9166bbea26fc05d08e7d9e900b7
Analyze and fix the following issue in the Linux kernel code: regulator: core: don't ignore errors from event forwarding setup
Problem Details: Receiving and forwarding critical supply events seems like they're important information and we shouldn't ignore errors occurring during registration for such events. With this change the supply is unset on event registration failure, allowing us to potentially retry another time. Fixes: 433e294c3c5b...
```diff diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c index fd8da369c052..86dbee3ffda0 100644 --- a/drivers/regulator/core.c +++ b/drivers/regulator/core.c @@ -2273,10 +2273,21 @@ static int regulator_resolve_supply(struct regulator_dev *rdev) * under-voltage. */ ret = register_regulator_even...
4f3323b752bfcc185c98ce4fb841cca8b700a7c0
Analyze and fix the following issue in the Linux kernel code: regulator: core: streamline supply resolution for always-on/boot-on regulators
Problem Details: For always-on and boot-on regulators, regulator_register() is currently trying to anticipate the requirement to resolve a supply early. Unfortunately, this code executes too early, before we have potentially updated the regulator's always_on constraint as part of set_machine_constraints(), causing it ...
```diff diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c index 9ce0eef1dcfc..08bdb1e4175e 100644 --- a/drivers/regulator/core.c +++ b/drivers/regulator/core.c @@ -5937,7 +5937,6 @@ regulator_register(struct device *dev, bool dangling_cfg_gpiod = false; bool dangling_of_gpiod = false; int ret, i; -...
86a8eeb0e913f4b6a55dabba5122098d4e805e55
Analyze and fix the following issue in the Linux kernel code: regulator: core: move supply check earlier in set_machine_constraints()
Problem Details: Since commit 98e48cd9283d ("regulator: core: resolve supply for boot-on/always-on regulators"), set_machine_constraints() can return -EPROBE_DEFER very late, after it has done a lot of work and configuration of the regulator. This means that configuration will happen multiple times for no benefit in t...
```diff diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c index 48c091de68d8..9ce0eef1dcfc 100644 --- a/drivers/regulator/core.c +++ b/drivers/regulator/core.c @@ -1444,6 +1444,33 @@ static int set_machine_constraints(struct regulator_dev *rdev) int ret = 0; const struct regulator_ops *ops = rdev->de...
497330b203d2c59c5ff3fa4c34d14494d7203bc3
Analyze and fix the following issue in the Linux kernel code: regulator: core: fix locking in regulator_resolve_supply() error path
Problem Details: If late enabling of a supply regulator fails in regulator_resolve_supply(), the code currently triggers a lockdep warning: WARNING: drivers/regulator/core.c:2649 at _regulator_put+0x80/0xa0, CPU#6: kworker/u32:4/596 ... Call trace: _regulator_put+0x80/0xa0 (P) regulator_resolve_s...
```diff diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c index a723bd00e171..48c091de68d8 100644 --- a/drivers/regulator/core.c +++ b/drivers/regulator/core.c @@ -2285,8 +2285,16 @@ static int regulator_resolve_supply(struct regulator_dev *rdev) if (rdev->use_count) { ret = regulator_enable(rdev->s...
96e7a88d32de2554a5d7e54e87eb03d445dd6924
Analyze and fix the following issue in the Linux kernel code: regulator: core: update two debug messages
Problem Details: 1) In print_constraints_debug(), the power budget is printed as: lldo2: 450 <--> 1300 mV at 900 mV 2147483647 mW budge, enabled (note the missing t in budget). This is because there is a --count just below the call to scnprintf(), to make space for the comma. All similar calls to scnprintf() above...
```diff diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c index 4b6182cde859..a723bd00e171 100644 --- a/drivers/regulator/core.c +++ b/drivers/regulator/core.c @@ -1183,7 +1183,7 @@ static void print_constraints_debug(struct regulator_dev *rdev) count += scnprintf(buf + count, len - count, "standby ")...
e707c591a139d1bfa4ddc83036fc820ca006a140
Analyze and fix the following issue in the Linux kernel code: can: ctucanfd: fix SSP_SRC in cases when bit-rate is higher than 1 MBit.
Problem Details: The Secondary Sample Point Source field has been set to an incorrect value by some mistake in the past 0b01 - SSP_SRC_NO_SSP - SSP is not used. for data bitrates above 1 MBit/s. The correct/default value already used for lower bitrates is 0b00 - SSP_SRC_MEAS_N_OFFSET - SSP position = TRV_DELAY ...
```diff diff --git a/drivers/net/can/ctucanfd/ctucanfd_base.c b/drivers/net/can/ctucanfd/ctucanfd_base.c index 1e6b9e3dc2fe..0ea1ff28dfce 100644 --- a/drivers/net/can/ctucanfd/ctucanfd_base.c +++ b/drivers/net/can/ctucanfd/ctucanfd_base.c @@ -310,7 +310,7 @@ static int ctucan_set_secondary_sample_point(struct net_devic...
b540b4e157c4b24d0501e5e50ffba598d066de42
Analyze and fix the following issue in the Linux kernel code: ASoC: dt-bindings: realtek,rt5640: Document port node
Problem Details: Various boards that use the rt5640 audio codec define a 'port' child node under the codec node to describe the interface between it and the SoC that it is connected to. The binding document for the rt5640 codec does not define the 'port' child node and so this is generating warnings when running the DT...
```diff diff --git a/Documentation/devicetree/bindings/sound/realtek,rt5640.yaml b/Documentation/devicetree/bindings/sound/realtek,rt5640.yaml index e7d4ec29b0ec..2f6a4a6cc0e6 100644 --- a/Documentation/devicetree/bindings/sound/realtek,rt5640.yaml +++ b/Documentation/devicetree/bindings/sound/realtek,rt5640.yaml @@ -1...
25b858474497b5f7e2198f6fc9381488d9bdb55d
Analyze and fix the following issue in the Linux kernel code: ASoC: dt-bindings: realtek,rt5640: Update jack-detect
Problem Details: The device-tree property 'realtek,jack-detect-source' currently only permits values from 0-6. However, commit 2b9c8d2b3c89 ("ASoC: rt5640: Add the HDA header support") updated the Realtek rt5640 to support setting the 'realtek,jack-detect-source' to 7 to support the HDA header. The Tegra234 platforms ...
```diff diff --git a/Documentation/devicetree/bindings/sound/realtek,rt5640.yaml b/Documentation/devicetree/bindings/sound/realtek,rt5640.yaml index 6bb6e12bdf8b..e7d4ec29b0ec 100644 --- a/Documentation/devicetree/bindings/sound/realtek,rt5640.yaml +++ b/Documentation/devicetree/bindings/sound/realtek,rt5640.yaml @@ -1...
66b47b9c069fa548db64bde6a32d3b33aa05f740
Analyze and fix the following issue in the Linux kernel code: ASoC: dt-bindings: realtek,rt5640: Document mclk
Problem Details: Commit eba5a0bac211 ("ASoC: dt-bindings: realtek,rt5640: Convert to dtschema") converted the rt5640 dt-binding to yaml format but in the process dropped 'clock' and 'clock-names' properties that are used to specify the codec 'mclk'. This is causing DTB build warnings for boards that use this codec and ...
```diff diff --git a/Documentation/devicetree/bindings/sound/realtek,rt5640.yaml b/Documentation/devicetree/bindings/sound/realtek,rt5640.yaml index 3f4f59287c1c..6bb6e12bdf8b 100644 --- a/Documentation/devicetree/bindings/sound/realtek,rt5640.yaml +++ b/Documentation/devicetree/bindings/sound/realtek,rt5640.yaml @@ -4...
2bdf777410dc6e022d1081885ff34673b5dfee99
Analyze and fix the following issue in the Linux kernel code: sched/mm_cid: Prevent NULL mm dereference in sched_mm_cid_after_execve()
Problem Details: sched_mm_cid_after_execve() is called in bprm_execve()'s cleanup path even when exec_binprm() fails. For the init task's first execve(), this causes a problem: 1. current->mm is NULL (kernel threads don't have an mm) 2. sched_mm_cid_before_execve() exits early because mm is NULL 3. exec_binprm()...
```diff diff --git a/kernel/sched/core.c b/kernel/sched/core.c index 41ba0be16911..60afadb6eede 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c @@ -10694,10 +10694,11 @@ void sched_mm_cid_before_execve(struct task_struct *t) sched_mm_cid_exit(t); } -/* Reactivate MM CID after successful execve() */ +/* ...
8dad31f85c7b91fd8bdbc6d0f27abc53bd8b1ffe
Analyze and fix the following issue in the Linux kernel code: xfs: fix memory leak in xfs_growfs_check_rtgeom()
Problem Details: Free the "nmp" allocation before returning -EINVAL. Fixes: dc68c0f60169 ("xfs: fix the zoned RT growfs check for zone alignment") Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org> Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Carlos Maiolino <cem@kernel.org>
```diff diff --git a/fs/xfs/xfs_rtalloc.c b/fs/xfs/xfs_rtalloc.c index e063f4f2f2e6..167298ad88dd 100644 --- a/fs/xfs/xfs_rtalloc.c +++ b/fs/xfs/xfs_rtalloc.c @@ -1265,7 +1265,7 @@ xfs_growfs_check_rtgeom( uint32_t rem; if (rextsize != 1) - return -EINVAL; + goto out_inval; div_u64_rem(nmp->m_sb.sb_rbloc...
5f8d6f29c51ab8572fc1d3891952ca445e75a610
Analyze and fix the following issue in the Linux kernel code: drm/gem: Fix a GEM leak in drm_gem_get_unmapped_area()
Problem Details: drm_gem_object_lookup_at_offset() can return a valid object with filp or filp->f_op->get_unmapped_area set to NULL. Make sure we still release the ref we acquired on such objects. Cc: Loïc Molinari <loic.molinari@collabora.com> Fixes: 99bda20d6d4c ("drm/gem: Introduce drm_gem_get_unmapped_area() fop")...
```diff diff --git a/drivers/gpu/drm/drm_gem.c b/drivers/gpu/drm/drm_gem.c index 36c8af123877..f7cbf6e8d1e0 100644 --- a/drivers/gpu/drm/drm_gem.c +++ b/drivers/gpu/drm/drm_gem.c @@ -1298,11 +1298,13 @@ unsigned long drm_gem_get_unmapped_area(struct file *filp, unsigned long uaddr, unsigned long ret; obj = drm_ge...
a1b1ee0348f889ec262482e16e9ff670617db7b0
Analyze and fix the following issue in the Linux kernel code: arm64: dts: renesas: rzt2h-n2h-evk-common: Use GPIO for SD0 write protect
Problem Details: Switch SD0 write-protect detection to a GPIO on the RZ/T2H and RZ/N2H EVKs. Both boards use a full-size SD card slot on the SD0 channel with a dedicated WP pin. The RZ/T2H and RZ/N2H SoCs use of_data_rcar_gen3, which sets MMC_CAP2_NO_WRITE_PROTECT and causes the core to ignore the WP signal unless a w...
```diff diff --git a/arch/arm64/boot/dts/renesas/rzt2h-n2h-evk-common.dtsi b/arch/arm64/boot/dts/renesas/rzt2h-n2h-evk-common.dtsi index 3eed1f3948e8..63bd91690b54 100644 --- a/arch/arm64/boot/dts/renesas/rzt2h-n2h-evk-common.dtsi +++ b/arch/arm64/boot/dts/renesas/rzt2h-n2h-evk-common.dtsi @@ -224,8 +224,7 @@ ctrl-p...
15e8d739fda1084d81f7d3813e9600eba6e0f134
Analyze and fix the following issue in the Linux kernel code: selftests/landlock: Properly close a file descriptor
Problem Details: Add a missing close(srv_fd) call, and use EXPECT_EQ() to check the result. Signed-off-by: Günther Noack <gnoack3000@gmail.com> Fixes: f83d51a5bdfe ("selftests/landlock: Check IOCTL restrictions for named UNIX domain sockets") Link: https://lore.kernel.org/r/20260101134102.25938-2-gnoack3000@gmail.com ...
```diff diff --git a/tools/testing/selftests/landlock/fs_test.c b/tools/testing/selftests/landlock/fs_test.c index 37a5a3df712e..968a91c927a4 100644 --- a/tools/testing/selftests/landlock/fs_test.c +++ b/tools/testing/selftests/landlock/fs_test.c @@ -4399,7 +4399,8 @@ TEST_F_FORK(layout1, named_unix_domain_socket_ioctl...
bdf3f4176092df5281877cacf42f843063b4784d
Analyze and fix the following issue in the Linux kernel code: arm64: Fix cleared E0POE bit after cpu_suspend()/resume()
Problem Details: TCR2_ELx.E0POE is set during smp_init(). However, this bit is not reprogrammed when the CPU enters suspension and later resumes via cpu_resume(), as __cpu_setup() does not re-enable E0POE and there is no save/restore logic for the TCR2_ELx system register. As a result, the E0POE feature no longer work...
```diff diff --git a/arch/arm64/include/asm/suspend.h b/arch/arm64/include/asm/suspend.h index e65f33edf9d6..e9ce68d50ba4 100644 --- a/arch/arm64/include/asm/suspend.h +++ b/arch/arm64/include/asm/suspend.h @@ -2,7 +2,7 @@ #ifndef __ASM_SUSPEND_H #define __ASM_SUSPEND_H -#define NR_CTX_REGS 13 +#define NR_CTX_REGS ...
736a2dcfdae72483a36793bc92182f33bd61d30e
Analyze and fix the following issue in the Linux kernel code: x86/CPU/AMD: Simplify the spectral chicken fix
Problem Details: msr_set_bit() takes a bit number to set but MSR_ZEN2_SPECTRAL_CHICKEN_BIT is a bit mask. The usual pattern that code uses is a _BIT-named type macro instead of a mask. So convert it to a bit number to reflect that. Also, msr_set_bit() already does the reading and checking whether the bit needs to be ...
```diff diff --git a/arch/x86/include/asm/msr-index.h b/arch/x86/include/asm/msr-index.h index 3d0a0950d20a..43adc38d31d5 100644 --- a/arch/x86/include/asm/msr-index.h +++ b/arch/x86/include/asm/msr-index.h @@ -794,8 +794,8 @@ #define MSR_F19H_UMC_PERF_CTR 0xc0010801 /* Zen 2 */ -#define MSR_ZEN2_SPECTRAL...
3132ec8c8c2c28787d0ad80e53db296713155f12
Analyze and fix the following issue in the Linux kernel code: clk: renesas: cpg-mssr: Handle RZ/T2H register layout in PM callbacks
Problem Details: The register layout for RZ/T2H is not handled inside cpg_mssr_suspend_noirq() and cpg_mssr_resume_noirq(), causing a memory abort because the wrong code path is taken, as shown below. Explicitly handle the RZ/T2H register layout in cpg_mssr_suspend_noirq() and cpg_mssr_resume_noirq(), similar to how i...
```diff diff --git a/drivers/clk/renesas/renesas-cpg-mssr.c b/drivers/clk/renesas/renesas-cpg-mssr.c index 031e4b125f2d..976c157829f1 100644 --- a/drivers/clk/renesas/renesas-cpg-mssr.c +++ b/drivers/clk/renesas/renesas-cpg-mssr.c @@ -1077,11 +1077,19 @@ static int cpg_mssr_suspend_noirq(struct device *dev) /* Save...
d6df4abe95a409e812c5d9af9657fe63ac299e3a
Analyze and fix the following issue in the Linux kernel code: pinctrl: meson: amlogic-a4: mark the GPIO controller as sleeping
Problem Details: The GPIO controller is configured as non-sleeping but it uses generic pinctrl helpers which use a mutex for synchronization. This will cause lockdep splats when used together with shared GPIOs going through the GPIO shared proxy driver. Fixes: 6e9be3abb78c ("pinctrl: Add driver support for Amlogic SoC...
```diff diff --git a/drivers/pinctrl/meson/pinctrl-amlogic-a4.c b/drivers/pinctrl/meson/pinctrl-amlogic-a4.c index d9e3a8d5932a..ded7b218e2ec 100644 --- a/drivers/pinctrl/meson/pinctrl-amlogic-a4.c +++ b/drivers/pinctrl/meson/pinctrl-amlogic-a4.c @@ -893,7 +893,7 @@ static const struct gpio_chip aml_gpio_template = { ...
7352e1d5932a0e777e39fa4b619801191f57e603
Analyze and fix the following issue in the Linux kernel code: can: gs_usb: gs_usb_receive_bulk_callback(): fix URB memory leak
Problem Details: In gs_can_open(), the URBs for USB-in transfers are allocated, added to the parent->rx_submitted anchor and submitted. In the complete callback gs_usb_receive_bulk_callback(), the URB is processed and resubmitted. In gs_can_close() the URBs are freed by calling usb_kill_anchored_urbs(parent->rx_submitt...
```diff diff --git a/drivers/net/can/usb/gs_usb.c b/drivers/net/can/usb/gs_usb.c index a0233e550a5a..d093babbc320 100644 --- a/drivers/net/can/usb/gs_usb.c +++ b/drivers/net/can/usb/gs_usb.c @@ -751,6 +751,8 @@ resubmit_urb: hf, parent->hf_size_rx, gs_usb_receive_bulk_callback, parent); + usb_anchor_urb(u...
b1979778e98569c1e78c2c7f16bb24d76541ab00
Analyze and fix the following issue in the Linux kernel code: can: etas_es58x: allow partial RX URB allocation to succeed
Problem Details: When es58x_alloc_rx_urbs() fails to allocate the requested number of URBs but succeeds in allocating some, it returns an error code. This causes es58x_open() to return early, skipping the cleanup label 'free_urbs', which leads to the anchored URBs being leaked. As pointed out by maintainer Vincent Mai...
```diff diff --git a/drivers/net/can/usb/etas_es58x/es58x_core.c b/drivers/net/can/usb/etas_es58x/es58x_core.c index f799233c2b72..2d248deb69dc 100644 --- a/drivers/net/can/usb/etas_es58x/es58x_core.c +++ b/drivers/net/can/usb/etas_es58x/es58x_core.c @@ -1736,7 +1736,7 @@ static int es58x_alloc_rx_urbs(struct es58x_dev...
940e9b835ab7f7228e6eefc7a649fcb417119b7e
Analyze and fix the following issue in the Linux kernel code: dt-bindings: pinctrl: intel: keembay: fix typo
Problem Details: Fix a typo in the documentation ("upto" -> "up to"). Signed-off-by: Akiyoshi Kurita <weibu@redadmin.org> Acked-by: Rob Herring (Arm) <robh@kernel.org> Signed-off-by: Linus Walleij <linusw@kernel.org>
```diff diff --git a/Documentation/devicetree/bindings/pinctrl/intel,pinctrl-keembay.yaml b/Documentation/devicetree/bindings/pinctrl/intel,pinctrl-keembay.yaml index 005d95a9e4d6..ec9848192351 100644 --- a/Documentation/devicetree/bindings/pinctrl/intel,pinctrl-keembay.yaml +++ b/Documentation/devicetree/bindings/pinc...
e034e058897a12bc856f8b22d1796964c742f732
Analyze and fix the following issue in the Linux kernel code: gpio: line-mux: remove bits already handled by GPIO core
Problem Details: GPIO core already handles checking the offset against the number of GPIOs as well as missing any of the GPIO chip callbacks. Remove the unnecessary bits. Also, the offset check was off-by-one as reported by Dan. Fixes: 2b03d9a40cd1 ("gpio: add gpio-line-mux driver") Reported-by: Dan Carpenter <dan.ca...
```diff diff --git a/drivers/gpio/gpio-line-mux.c b/drivers/gpio/gpio-line-mux.c index a4f384306218..62548fbd3ca0 100644 --- a/drivers/gpio/gpio-line-mux.c +++ b/drivers/gpio/gpio-line-mux.c @@ -29,9 +29,6 @@ static int gpio_lmux_gpio_get(struct gpio_chip *gc, unsigned int offset) struct gpio_lmux *glm = gpiochip_get...
d578b31856cec31315f27b3ba97b212e4c6989b3
Analyze and fix the following issue in the Linux kernel code: gpio: shared: fix a false-positive sharing detection with reset-gpios
Problem Details: After scanning the devicetree, we remove all entries that have only one reference, while creating GPIO shared proxies for the remaining, shared entries. However: for the reset-gpio corner-case, we will have two references for a "reset-gpios" pin that's not really shared. In this case one will come from...
```diff diff --git a/drivers/gpio/gpiolib-shared.c b/drivers/gpio/gpiolib-shared.c index 076d8642675c..17343fdc9758 100644 --- a/drivers/gpio/gpiolib-shared.c +++ b/drivers/gpio/gpiolib-shared.c @@ -41,6 +41,7 @@ struct gpio_shared_ref { struct lock_class_key lock_key; struct auxiliary_device adev; struct gpiod_l...
6abb6a0e1104279763d1561b8110c1db442c5fac
Analyze and fix the following issue in the Linux kernel code: drm/panic: Fix expected string for QR_CODE in drm_panic_type_map
Problem Details: The help text of CONFIG_DRM_PANIC_SCREEN_QR_CODE documents the expected value to CONFIG_DRM_PANIC_SCREEN as "qr_code" but drm_panic_type_map checks for "qr". Adjust drm_panic_type_map and the module description to match so that existing configurations do not stop working. Fixes: e85e9ccf3f84 ("drm/pan...
```diff diff --git a/drivers/gpu/drm/drm_panic.c b/drivers/gpu/drm/drm_panic.c index 0cd574dd9d88..d6d3b8d85dea 100644 --- a/drivers/gpu/drm/drm_panic.c +++ b/drivers/gpu/drm/drm_panic.c @@ -823,7 +823,7 @@ static const char *drm_panic_type_map[] = { [DRM_PANIC_TYPE_KMSG] = "kmsg", [DRM_PANIC_TYPE_USER] = "user", ...
6419fc157e55665dc8680deb1737dc4c53c33f94
Analyze and fix the following issue in the Linux kernel code: drm/panic: Ensure drm_panic_type is initialized to a valid value
Problem Details: If a user has set an invalid CONFIG_DRM_PANIC_SCREEN value (such as "qr_code" without CONFIG_DRM_PANIC_SCREEN_QR_CODE=y due to missing or incorrect Rust dependencies), there is a panic when accessing /sys/module/drm/parameters/panic_screen: [ 12.218375] BUG: unable to handle page fault for address...
```diff diff --git a/drivers/gpu/drm/drm_panic.c b/drivers/gpu/drm/drm_panic.c index eb7ef17b9c71..0cd574dd9d88 100644 --- a/drivers/gpu/drm/drm_panic.c +++ b/drivers/gpu/drm/drm_panic.c @@ -1072,8 +1072,11 @@ void drm_panic_unregister(struct drm_device *dev) */ void __init drm_panic_init(void) { - if (drm_panic_ty...
a45ed8db62f8051275112babb271f53a13aec02e
Analyze and fix the following issue in the Linux kernel code: sfc: correct kernel-doc complaints
Problem Details: Fix kernel-doc warnings by adding 3 missing struct member descriptions in struct efx_ef10_nic_data and removing preprocessor directives (which are not handled by kernel-doc). Fixes these 5 warnings: Warning: drivers/net/ethernet/sfc/nic.h:158 bad line: #ifdef CONFIG_SFC_SRIOV Warning: drivers/net/ethe...
```diff diff --git a/drivers/net/ethernet/sfc/nic.h b/drivers/net/ethernet/sfc/nic.h index 9fa5c4c713ab..ec3b2df43b68 100644 --- a/drivers/net/ethernet/sfc/nic.h +++ b/drivers/net/ethernet/sfc/nic.h @@ -156,9 +156,9 @@ enum { * @tx_dpcpu_fw_id: Firmware ID of the TxDPCPU * @must_probe_vswitching: Flag: vswitching h...
872ac785e7680dac9ec7f8c5ccd4f667f49d6997
Analyze and fix the following issue in the Linux kernel code: ipv4: ip_tunnel: spread netdev_lockdep_set_classes()
Problem Details: Inspired by yet another syzbot report. IPv6 tunnels call netdev_lockdep_set_classes() for each tunnel type, while IPv4 currently centralizes netdev_lockdep_set_classes() call from ip_tunnel_init(). Make ip_tunnel_init() a macro, so that we have different lockdep classes per tunnel type. Fixes: 0bef5...
```diff diff --git a/include/net/ip_tunnels.h b/include/net/ip_tunnels.h index ecae35512b9b..4021e6a73e32 100644 --- a/include/net/ip_tunnels.h +++ b/include/net/ip_tunnels.h @@ -19,6 +19,7 @@ #include <net/rtnetlink.h> #include <net/lwtunnel.h> #include <net/dst_cache.h> +#include <net/netdev_lock.h> #if IS_ENAB...
0664a46f93e2fb2f75fa05b5f08949600cce88f9
Analyze and fix the following issue in the Linux kernel code: clk: spacemit: add platform SoC prefix to reset name
Problem Details: This change is needed for adding future new SpacemiT K3 reset driver. Since both K1 and K3 reset code register via the same module which its name changed to spacemit_ccu, it's necessary to encode the platform/SoC in the reset auxiliary device name to distinguish them, otherwise two reset drivers will ...
```diff diff --git a/drivers/clk/spacemit/ccu-k1.c b/drivers/clk/spacemit/ccu-k1.c index 02c792a73759..dee14d25f75d 100644 --- a/drivers/clk/spacemit/ccu-k1.c +++ b/drivers/clk/spacemit/ccu-k1.c @@ -789,7 +789,7 @@ static struct clk_hw *k1_ccu_mpmu_hws[] = { }; static const struct spacemit_ccu_data k1_ccu_mpmu_data...
99669468d24ce21be12f3751e7381c47ab2c9ecd
Analyze and fix the following issue in the Linux kernel code: clk: spacemit: extract common ccu functions
Problem Details: Refactor the probe function of SpacemiT's clock, and extract a common ccu file, so new clock driver added in the future can share the same code, which would lower the burden of maintenance. Since this commit changes the module name from spacemit_ccu_k1 to spacemit_ccu where the auxiliary device registe...
```diff diff --git a/drivers/clk/spacemit/ccu-k1.c b/drivers/clk/spacemit/ccu-k1.c index 01d9485b615d..02c792a73759 100644 --- a/drivers/clk/spacemit/ccu-k1.c +++ b/drivers/clk/spacemit/ccu-k1.c @@ -5,15 +5,10 @@ */ #include <linux/array_size.h> -#include <linux/auxiliary_bus.h> #include <linux/clk-provider.h> -#...
f56bcc0425cb5aeac3557444e0f7538178daba05
Analyze and fix the following issue in the Linux kernel code: dt-bindings: net: dsa: microchip: Make pinctrl 'reset' optional
Problem Details: Commit e469b87e0fb0d ("dt-bindings: net: dsa: microchip: Add strap description to set SPI mode") required both 'default' and 'reset' pinctrl states for all compatible devices. However, this requirement should be only applicable to KSZ8463. Make the 'reset' pinctrl state optional for all other Microchi...
```diff diff --git a/Documentation/devicetree/bindings/net/dsa/microchip,ksz.yaml b/Documentation/devicetree/bindings/net/dsa/microchip,ksz.yaml index a8c8009414ae..8d4a3a9a33fc 100644 --- a/Documentation/devicetree/bindings/net/dsa/microchip,ksz.yaml +++ b/Documentation/devicetree/bindings/net/dsa/microchip,ksz.yaml @...
ecff77f7c04141cc18ee2482936c96117060c0f2
Analyze and fix the following issue in the Linux kernel code: reset: spacemit: fix auxiliary device id
Problem Details: Due to the auxiliary register procedure moved to ccu common module where the module name changed to spacemit_ccu, then the reset auxiliary device register id also need to be adjusted in order to prepare for adding new K3 reset driver, otherwise two reset drivers will claim to support same "compatible" ...
```diff diff --git a/drivers/reset/reset-spacemit.c b/drivers/reset/reset-spacemit.c index e1272aff28f7..cc7fd1f8750d 100644 --- a/drivers/reset/reset-spacemit.c +++ b/drivers/reset/reset-spacemit.c @@ -278,7 +278,7 @@ static int spacemit_reset_probe(struct auxiliary_device *adev, #define K1_AUX_DEV_ID(_unit) \ { ...
73711730a1128d91ebca1a6994ceeb18f36cb0cd
Analyze and fix the following issue in the Linux kernel code: PCI: Do not attempt to set ExtTag for VFs
Problem Details: The bit for enabling extended tags is Reserved and Preserved (RsvdP) for VFs, according to PCIe r7.0 section 7.5.3.4 table 7.21. Hence, bail out early from pci_configure_extended_tags() if the device is a VF. Otherwise, we may see incorrect log messages such as: kernel: pci 0000:af:00.2: enabling ...
```diff diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c index 41183aed8f5d..86665658d704 100644 --- a/drivers/pci/probe.c +++ b/drivers/pci/probe.c @@ -2270,7 +2270,8 @@ int pci_configure_extended_tags(struct pci_dev *dev, void *ign) u16 ctl; int ret; - if (!pci_is_pcie(dev)) + /* PCI_EXP_DEVCTL_EXT_TAG is...
83b914f972bb706536edd2b84230b9c1ce39f275
Analyze and fix the following issue in the Linux kernel code: drm/xe: Fix page reclaim entry handling for large pages
Problem Details: For 64KB pages, XE_PTE_PS64 is defined for all consecutive 4KB pages and are all considered leaf nodes, so existing check was falsely adding multiple 64KB pages to PRL. For larger entries such as 2MB PDE, the check for pte->base.children is insufficient since this array is always defined for page dir...
```diff diff --git a/drivers/gpu/drm/xe/xe_pt.c b/drivers/gpu/drm/xe/xe_pt.c index 2752a5a48a97..a53944957be4 100644 --- a/drivers/gpu/drm/xe/xe_pt.c +++ b/drivers/gpu/drm/xe/xe_pt.c @@ -1576,12 +1576,6 @@ static bool xe_pt_check_kill(u64 addr, u64 next, unsigned int level, return false; } -/* Huge 2MB leaf lives ...
52cb4a595fbce93b1ef940f9d1097be9245d9179
Analyze and fix the following issue in the Linux kernel code: drm/xe: Remove debug comment in page reclaim
Problem Details: Drop debug comment erronenously added in patch commit. Signed-off-by: Brian Nguyen <brian3.nguyen@intel.com> Reviewed-by: Matthew Brost <matthew.brost@intel.com> Signed-off-by: Matthew Brost <matthew.brost@intel.com> Link: https://patch.msgid.link/20260107010447.4125005-7-brian3.nguyen@intel.com
```diff diff --git a/drivers/gpu/drm/xe/xe_page_reclaim.c b/drivers/gpu/drm/xe/xe_page_reclaim.c index fd8c33761127..94d4608ebd74 100644 --- a/drivers/gpu/drm/xe/xe_page_reclaim.c +++ b/drivers/gpu/drm/xe/xe_page_reclaim.c @@ -108,7 +108,6 @@ void xe_page_reclaim_list_invalidate(struct xe_page_reclaim_list *prl) */ ...
aa39abc08e77d66ebb0c8c9ec4cc8d38ded34dc9
Analyze and fix the following issue in the Linux kernel code: drm/xe: fix WQ_MEM_RECLAIM passed as max_active to alloc_workqueue()
Problem Details: Workqueue xe-ggtt-wq has been allocated using WQ_MEM_RECLAIM, but the flag has been passed as 3rd parameter (max_active) instead of 2nd (flags) creating the workqueue as per-cpu with max_active = 8 (the WQ_MEM_RECLAIM value). So change this by set WQ_MEM_RECLAIM as the 2nd parameter with a default max...
```diff diff --git a/drivers/gpu/drm/xe/xe_ggtt.c b/drivers/gpu/drm/xe/xe_ggtt.c index 48ab8b43fcd0..9e6b4e983542 100644 --- a/drivers/gpu/drm/xe/xe_ggtt.c +++ b/drivers/gpu/drm/xe/xe_ggtt.c @@ -322,7 +322,7 @@ int xe_ggtt_init_early(struct xe_ggtt *ggtt) else ggtt->pt_ops = &xelp_pt_ops; - ggtt->wq = alloc_work...
96d45e34f8f9a459ae1a8d7a74638a96375d8597
Analyze and fix the following issue in the Linux kernel code: drm/xe/pf: Allow upon-any-hang wedged mode only in debug config
Problem Details: The GuC reset policy is global, so disabling it on PF can affect all running VFs. To avoid unintended side effects, restrict setting upon-any-hang (2) wedged mode on the PF to debug builds only. Signed-off-by: Lukasz Laguna <lukasz.laguna@intel.com> Reviewed-by: Michal Wajdeczko <michal.wajdeczko@inte...
```diff diff --git a/drivers/gpu/drm/xe/xe_device.c b/drivers/gpu/drm/xe/xe_device.c index d3431128670e..e400ad5c9f9e 100644 --- a/drivers/gpu/drm/xe/xe_device.c +++ b/drivers/gpu/drm/xe/xe_device.c @@ -1387,7 +1387,8 @@ int xe_device_validate_wedged_mode(struct xe_device *xe, unsigned int mode) if (mode > XE_WEDGED_...
0f13dead4e0385859f5c9c3625a19df116b389d3
Analyze and fix the following issue in the Linux kernel code: drm/xe: Update wedged.mode only after successful reset policy change
Problem Details: Previously, the driver's internal wedged.mode state was updated without verifying whether the corresponding engine reset policy update in GuC succeeded. This could leave the driver reporting a wedged.mode state that doesn't match the actual reset behavior programmed in GuC. With this change, the reset...
```diff diff --git a/drivers/gpu/drm/xe/xe_debugfs.c b/drivers/gpu/drm/xe/xe_debugfs.c index db2afd60d8bc..844cfafe1ec7 100644 --- a/drivers/gpu/drm/xe/xe_debugfs.c +++ b/drivers/gpu/drm/xe/xe_debugfs.c @@ -254,14 +254,64 @@ static ssize_t wedged_mode_show(struct file *f, char __user *ubuf, return simple_read_from_bu...
aba963cb98c6d9d42490262a39c3d383cfebc6a9
Analyze and fix the following issue in the Linux kernel code: KVM: arm64: Inject UNDEF for a register trap without accessor
Problem Details: Configuring a register trap without specifying an accessor function is abviously a bug. Instead of calling die() when that happens, let's be a bit more helpful and print the register encoding. Also inject an undefined instruction exception in the guest, similar to other unhandled register accesses. Si...
```diff diff --git a/arch/arm64/kvm/sys_regs.c b/arch/arm64/kvm/sys_regs.c index c8fd7c6a12a1..88a57ca36d96 100644 --- a/arch/arm64/kvm/sys_regs.c +++ b/arch/arm64/kvm/sys_regs.c @@ -4668,7 +4668,10 @@ static void perform_access(struct kvm_vcpu *vcpu, * that we don't know how to handle. This certainly qualifies *...
145cc42fe1217c66174c44c4034cc0fe3040bbb0
Analyze and fix the following issue in the Linux kernel code: KVM: arm64: Copy FGT traps to unprotected pKVM VCPU on VCPU load
Problem Details: Commit fb10ddf35c1c ("KVM: arm64: Compute per-vCPU FGTs at vcpu_load()") introduced per-VCPU FGT traps. For an unprotected pKVM VCPU, the untrusted host FGT configuration is copied in pkvm_vcpu_init_traps(), which is called from __pkvm_init_vcpu(). __pkvm_init_vcpu() is called once per VCPU (when the V...
```diff diff --git a/arch/arm64/kvm/hyp/nvhe/hyp-main.c b/arch/arm64/kvm/hyp/nvhe/hyp-main.c index a7c689152f68..8ffbbce5e2ed 100644 --- a/arch/arm64/kvm/hyp/nvhe/hyp-main.c +++ b/arch/arm64/kvm/hyp/nvhe/hyp-main.c @@ -180,6 +180,9 @@ static void handle___pkvm_vcpu_load(struct kvm_cpu_context *host_ctxt) /* Propagat...
ca2eccb953fd33ef38701e33e660b21f7e84aa14
Analyze and fix the following issue in the Linux kernel code: KVM: selftests: Extend vmx_set_nested_state_test to cover SVM
Problem Details: Add test cases for the validation checks in svm_set_nested_state(), and allow the test to run with SVM as well as VMX. The SVM test also makes sure that KVM_SET_NESTED_STATE accepts GIF being set or cleared if EFER.SVME is cleared, verifying a recently fixed bug where GIF was incorrectly expected to al...
```diff diff --git a/tools/testing/selftests/kvm/Makefile.kvm b/tools/testing/selftests/kvm/Makefile.kvm index ba5c2b643efa..4ddece4ee365 100644 --- a/tools/testing/selftests/kvm/Makefile.kvm +++ b/tools/testing/selftests/kvm/Makefile.kvm @@ -92,6 +92,7 @@ TEST_GEN_PROGS_x86 += x86/nested_close_kvm_test TEST_GEN_PROGS...
6f4d3ebc24c6ef92e196ebbd389a3f2bfdc7a144
Analyze and fix the following issue in the Linux kernel code: KVM: SVM: Allow KVM_SET_NESTED_STATE to clear GIF when SVME==0
Problem Details: GIF==0 together with EFER.SVME==0 is a valid architectural state. Don't return -EINVAL for KVM_SET_NESTED_STATE when this combination is specified. Fixes: cc440cdad5b7 ("KVM: nSVM: implement KVM_GET_NESTED_STATE and KVM_SET_NESTED_STATE") Signed-off-by: Jim Mattson <jmattson@google.com> Reviewed-by: Y...
```diff diff --git a/arch/x86/kvm/svm/nested.c b/arch/x86/kvm/svm/nested.c index 47e8ce7d360a..5b741f8ed170 100644 --- a/arch/x86/kvm/svm/nested.c +++ b/arch/x86/kvm/svm/nested.c @@ -1821,12 +1821,12 @@ static int svm_set_nested_state(struct kvm_vcpu *vcpu, /* * If in guest mode, vcpu->arch.efer actually refers to...
8312f1b9dd71340b5fff65e56c6c163187bfa5d0
Analyze and fix the following issue in the Linux kernel code: KVM: SVM: Don't set GIF when clearing EFER.SVME
Problem Details: Clearing EFER.SVME is not architected to set GIF. Don't set GIF when emulating a change to EFER that clears EFER.SVME. However, keep setting GIF if clearing EFER.SVME causes force-leaving the nested guest through svm_leave_nested(), to maintain a sane behavior of not leaving GIF cleared after exiting ...
```diff diff --git a/arch/x86/kvm/svm/nested.c b/arch/x86/kvm/svm/nested.c index 5a1e1164c197..47e8ce7d360a 100644 --- a/arch/x86/kvm/svm/nested.c +++ b/arch/x86/kvm/svm/nested.c @@ -1399,6 +1399,8 @@ void svm_leave_nested(struct kvm_vcpu *vcpu) nested_svm_uninit_mmu_context(vcpu); vmcb_mark_all_dirty(svm->vmcb);...
8d8e882c2b4b73a3f894c3cad74718b633e3d166
Analyze and fix the following issue in the Linux kernel code: KVM: arm64: Fix EL2 S1 XN handling for hVHE setups
Problem Details: The current XN implementation is tied to the EL2 translation regime, and fall flat on its face with the EL2&0 one that is used for hVHE, as the permission bit for privileged execution is a different one. Fixes: 6537565fd9b7f ("KVM: arm64: Adjust EL2 stage-1 leaf AP bits when ARM64_KVM_HVHE is set") Si...
```diff diff --git a/arch/arm64/include/asm/kvm_pgtable.h b/arch/arm64/include/asm/kvm_pgtable.h index fc02de43c68d..be68b8969206 100644 --- a/arch/arm64/include/asm/kvm_pgtable.h +++ b/arch/arm64/include/asm/kvm_pgtable.h @@ -87,7 +87,15 @@ typedef u64 kvm_pte_t; #define KVM_PTE_LEAF_ATTR_HI_SW GENMASK(58, 55) -...
38a0f4cf8c6147fd10baa206ab349f8ff724e391
Analyze and fix the following issue in the Linux kernel code: Revert duplicate "drm/amdgpu: disable peer-to-peer access for DCC-enabled GC12 VRAM surfaces"
Problem Details: This reverts commit 22a36e660d014925114feb09a2680bb3c2d1e279 once, which was merged twice due to an incorrect backmerge resolution. Fixes: ce0478b02ed2 ("Merge tag 'v6.18-rc6' into drm-next") Signed-off-by: Peter Colberg <pcolberg@redhat.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
```diff diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_dma_buf.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_dma_buf.c index 5f7d19f4c221..b9c38a4fe546 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_dma_buf.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_dma_buf.c @@ -84,18 +84,6 @@ static int amdgpu_dma_buf_attach(struct dma_buf *d...
fc3ba56385d03501eb582e4b86691ba378e556f9
Analyze and fix the following issue in the Linux kernel code: KVM: nSVM: Remove a user-triggerable WARN on nested_svm_load_cr3() succeeding
Problem Details: Drop the WARN in svm_set_nested_state() on nested_svm_load_cr3() failing as it is trivially easy to trigger from userspace by modifying CPUID after loading CR3. E.g. modifying the state restoration selftest like so: --- tools/testing/selftests/kvm/x86/state_test.c +++ tools/testing/selftests/kvm/...
```diff diff --git a/arch/x86/kvm/svm/nested.c b/arch/x86/kvm/svm/nested.c index ba0f11c68372..9be67040e94d 100644 --- a/arch/x86/kvm/svm/nested.c +++ b/arch/x86/kvm/svm/nested.c @@ -1870,10 +1870,9 @@ static int svm_set_nested_state(struct kvm_vcpu *vcpu, * thus MMU might not be initialized correctly. * Set it a...
19a4505a7a5d4eea70f1a42d601c25d730922fdf
Analyze and fix the following issue in the Linux kernel code: spi: microchip-core: use XOR instead of ANDNOT to fix the logic
Problem Details: Use XOR instead of ANDNOT to fix the logic. The current approach with (foo & BAR & ~baz) is harder to process, and it proved to be wrong, than more usual pattern for the comparing misconfiguration using ((foo ^ baz) & BAR) which can be read as "find all different bits between foo and baz that are relat...
```diff diff --git a/drivers/spi/spi-microchip-core-spi.c b/drivers/spi/spi-microchip-core-spi.c index 89e40fc45d73..c8ebb58e0369 100644 --- a/drivers/spi/spi-microchip-core-spi.c +++ b/drivers/spi/spi-microchip-core-spi.c @@ -161,7 +161,7 @@ static int mchp_corespi_setup(struct spi_device *spi) return -EOPNOTSUPP; ...
57a7b47ab30f6201769988392dc8b1c0822a3369
Analyze and fix the following issue in the Linux kernel code: KVM: x86: Don't read guest CR3 when doing async pf while the MMU is direct
Problem Details: Don't read guest CR3 in kvm_arch_setup_async_pf() if the MMU is direct and use INVALID_GPA instead. When KVM tries to perform the host-only async page fault for the shared memory of TDX guests, the following WARNING is triggered: WARNING: CPU: 1 PID: 90922 at arch/x86/kvm/vmx/main.c:483 vt_cache_re...
```diff diff --git a/arch/x86/kvm/mmu/mmu.c b/arch/x86/kvm/mmu/mmu.c index f17324546900..3911ac9bddfd 100644 --- a/arch/x86/kvm/mmu/mmu.c +++ b/arch/x86/kvm/mmu/mmu.c @@ -4521,7 +4521,10 @@ static bool kvm_arch_setup_async_pf(struct kvm_vcpu *vcpu, arch.gfn = fault->gfn; arch.error_code = fault->error_code; arch....
3cd5002807bebf504cbb6645e73d01204324e54a
Analyze and fix the following issue in the Linux kernel code: KVM: selftests: Stop setting A/D bits when creating EPT PTEs
Problem Details: Stop setting Accessed/Dirty bits when creating EPT entries for L2 so that the stage-1 and stage-2 (a.k.a. TDP) page table APIs can use common code without bleeding the EPT hack into the common APIs. While commit 094444204570 ("selftests: kvm: add test for dirty logging inside nested guests") is _very_...
```diff diff --git a/tools/testing/selftests/kvm/lib/x86/vmx.c b/tools/testing/selftests/kvm/lib/x86/vmx.c index 85043bb1ec4d..a3e2eae981da 100644 --- a/tools/testing/selftests/kvm/lib/x86/vmx.c +++ b/tools/testing/selftests/kvm/lib/x86/vmx.c @@ -432,14 +432,6 @@ void __tdp_pg_map(struct vmx_pages *vmx, struct kvm_vm *...
7fe9f5366bd5d7ee3cfd9f66868a4410d6e4792d
Analyze and fix the following issue in the Linux kernel code: KVM: selftests: Fix sign extension bug in get_desc64_base()
Problem Details: The function get_desc64_base() performs a series of bitwise left shifts on fields of various sizes. More specifically, when performing '<< 24' on 'desc->base2' (which is a u8), 'base2' is promoted to a signed integer before shifting. In a scenario where base2 >= 0x80, the shift places a 1 into bit 31,...
```diff diff --git a/tools/testing/selftests/kvm/include/x86/processor.h b/tools/testing/selftests/kvm/include/x86/processor.h index 57d62a425109..26a91bb73c93 100644 --- a/tools/testing/selftests/kvm/include/x86/processor.h +++ b/tools/testing/selftests/kvm/include/x86/processor.h @@ -436,8 +436,10 @@ struct kvm_x86_s...
5bb9ac1865123356337a389af935d3913ee917ed
Analyze and fix the following issue in the Linux kernel code: KVM: x86: Return "unsupported" instead of "invalid" on access to unsupported PV MSR
Problem Details: Return KVM_MSR_RET_UNSUPPORTED instead of '1' (which for all intents and purposes means "invalid") when rejecting accesses to KVM PV MSRs to adhere to KVM's ABI of allowing host reads and writes of '0' to MSRs that are advertised to userspace via KVM_GET_MSR_INDEX_LIST, even if the vCPU model doesn't s...
```diff diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c index 211d8c24a4b1..e4418409b468 100644 --- a/arch/x86/kvm/x86.c +++ b/arch/x86/kvm/x86.c @@ -4097,47 +4097,47 @@ int kvm_set_msr_common(struct kvm_vcpu *vcpu, struct msr_data *msr_info) break; case MSR_KVM_WALL_CLOCK_NEW: if (!guest_pv_has(vcpu, KVM_...
44da6629d2820c8fd9ffa58cc7e46c2215828cb8
Analyze and fix the following issue in the Linux kernel code: KVM: Use vCPU specific memslots in __kvm_vcpu_map()
Problem Details: When establishing a "host access map", lookup the gfn in the vCPU specific memslots, as the intent is that the mapping will be established for the current vCPU context. Specifically, using __kvm_vcpu_map() in x86's SMM context should create mappings based on the SMM memslots, not the non-SMM memslots....
```diff diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c index 5b5b69c97665..6b1097e76288 100644 --- a/virt/kvm/kvm_main.c +++ b/virt/kvm/kvm_main.c @@ -3134,7 +3134,7 @@ int __kvm_vcpu_map(struct kvm_vcpu *vcpu, gfn_t gfn, struct kvm_host_map *map, bool writable) { struct kvm_follow_pfn kfp = { - .slot...
2ed57bb8997610b33cb92c26ccb9a91b2966fff8
Analyze and fix the following issue in the Linux kernel code: KVM: VMX: Bug the VM if either MSR auto-load list is full
Problem Details: WARN and bug the VM if either MSR auto-load list is full when adding an MSR to the lists, as the set of MSRs that KVM loads via the lists is finite and entirely KVM controlled, i.e. overflowing the lists shouldn't be possible in a fully released version of KVM. Terminate the VM as the core KVM infrast...
```diff diff --git a/arch/x86/kvm/vmx/vmx.c b/arch/x86/kvm/vmx/vmx.c index 38491962b2c1..2c50ebf4ff1b 100644 --- a/arch/x86/kvm/vmx/vmx.c +++ b/arch/x86/kvm/vmx/vmx.c @@ -1098,6 +1098,7 @@ static void add_atomic_switch_msr(struct vcpu_vmx *vmx, unsigned msr, { int i, j = 0; struct msr_autoload *m = &vmx->msr_autol...
283a5aa57b2223abf2f73afcc714c4d4553660f2
Analyze and fix the following issue in the Linux kernel code: KVM: x86/pmu: Handle emulated instruction for mediated vPMU
Problem Details: Mediated vPMU needs to accumulate the emulated instructions into counter and load the counter into HW at vm-entry. Moreover, if the accumulation leads to counter overflow, KVM needs to update GLOBAL_STATUS and inject PMI into guest as well. Suggested-by: Sean Christopherson <seanjc@google.com> Signed...
```diff diff --git a/arch/x86/kvm/pmu.c b/arch/x86/kvm/pmu.c index f6387c67b25c..b78ad897886d 100644 --- a/arch/x86/kvm/pmu.c +++ b/arch/x86/kvm/pmu.c @@ -1031,10 +1031,45 @@ void kvm_pmu_destroy(struct kvm_vcpu *vcpu) kvm_pmu_reset(vcpu); } +static bool pmc_is_pmi_enabled(struct kvm_pmc *pmc) +{ + u8 fixed_ctr_ct...
a2f4ba534cc5d681a2d017c82e282bb32d8447df
Analyze and fix the following issue in the Linux kernel code: KVM: x86/pmu: Always stuff GuestOnly=1,HostOnly=0 for mediated PMCs on AMD
Problem Details: On AMD platforms, there is no way to restore PerfCntrGlobalCtl at VM-Entry or clear it at VM-Exit. Since the register states will be restored before entering and saved after exiting guest context, the counters can keep ticking and even overflow leading to chaos while still in host context. To avoid th...
```diff diff --git a/arch/x86/kvm/svm/pmu.c b/arch/x86/kvm/svm/pmu.c index c1ec1962314e..6d5f791126b1 100644 --- a/arch/x86/kvm/svm/pmu.c +++ b/arch/x86/kvm/svm/pmu.c @@ -166,7 +166,8 @@ static int amd_pmu_set_msr(struct kvm_vcpu *vcpu, struct msr_data *msr_info) data &= ~pmu->reserved_bits; if (data != pmc->even...
3db871fe185baca66e78b56a230e236af40f1027
Analyze and fix the following issue in the Linux kernel code: KVM: x86/pmu: Reprogram mediated PMU event selectors on event filter updates
Problem Details: Refresh the event selectors that are programmed into hardware when a PMC is "reprogrammed" for a mediated PMU, i.e. if userspace changes the PMU event filters Note, KVM doesn't utilize the reprogramming infrastructure to handle counter overflow for mediated PMUs, as there's no need to reprogram a non-...
```diff diff --git a/arch/x86/kvm/pmu.c b/arch/x86/kvm/pmu.c index a05366e4eef2..24f5c14715ef 100644 --- a/arch/x86/kvm/pmu.c +++ b/arch/x86/kvm/pmu.c @@ -520,6 +520,25 @@ static bool pmc_is_event_allowed(struct kvm_pmc *pmc) return is_fixed_event_allowed(filter, pmc->idx); } +static void kvm_mediated_pmu_refresh_...
0ea0d6314870493ac723afefb6257be71f4c636f
Analyze and fix the following issue in the Linux kernel code: KVM: x86/pmu: Bypass perf checks when emulating mediated PMU counter accesses
Problem Details: When emulating a PMC counter read or write for a mediated PMU, bypass the perf checks and emulated_counter logic as the counters aren't proxied through perf, i.e. pmc->counter always holds the guest's up-to-date value, and thus there's no need to defer emulated overflow checks. Suggested-by: Sean Chri...
```diff diff --git a/arch/x86/kvm/pmu.c b/arch/x86/kvm/pmu.c index 3e048c170b97..3a901587ca6b 100644 --- a/arch/x86/kvm/pmu.c +++ b/arch/x86/kvm/pmu.c @@ -379,6 +379,11 @@ static void pmc_update_sample_period(struct kvm_pmc *pmc) void pmc_write_counter(struct kvm_pmc *pmc, u64 val) { + if (kvm_vcpu_has_mediated_pmu...
5fcd5513072b09f6533e22a779183fa2818bce81
Analyze and fix the following issue in the Linux kernel code: arm64: mm: Fix incomplete tag reset in change_memory_common()
Problem Details: Running KASAN KUnit tests with {HW,SW}_TAGS mode triggers a fault in change_memory_common(): Call trace: change_memory_common+0x168/0x210 (P) set_memory_ro+0x20/0x48 vmalloc_helpers_tags+0xe8/0x338 kunit_try_run_case+0x74/0x188 kunit_generic_run_threadfn_adapter+0x30/0x70 kthread+0...
```diff diff --git a/arch/arm64/mm/pageattr.c b/arch/arm64/mm/pageattr.c index f0e784b963e6..7176ff39cb87 100644 --- a/arch/arm64/mm/pageattr.c +++ b/arch/arm64/mm/pageattr.c @@ -171,7 +171,8 @@ static int change_memory_common(unsigned long addr, int numpages, */ area = find_vm_area((void *)addr); if (!area || -...
74d74bb78aeccc9edc10db216d6be121cf7ec176
Analyze and fix the following issue in the Linux kernel code: lib/crypto: aes: Fix missing MMU protection for AES S-box
Problem Details: __cacheline_aligned puts the data in the ".data..cacheline_aligned" section, which isn't marked read-only i.e. it doesn't receive MMU protection. Replace it with ____cacheline_aligned which does the right thing and just aligns the data while keeping it in ".rodata". Fixes: b5e0b032b6c3 ("crypto: aes ...
```diff diff --git a/lib/crypto/aes.c b/lib/crypto/aes.c index b57fda3460f1..102aaa76bc8d 100644 --- a/lib/crypto/aes.c +++ b/lib/crypto/aes.c @@ -13,7 +13,7 @@ * Emit the sbox as volatile const to prevent the compiler from doing * constant folding on sbox references involving fixed indexes. */ -static volatile c...
0f42c2a52d8a7535088895c3104150ac9019afd8
Analyze and fix the following issue in the Linux kernel code: lib/crypto: tests: Fix syntax error for old python versions
Problem Details: 'make binrpm-pkg' throws me this error, with Python 3.9: *** Error compiling '.../gen-hash-testvecs.py'... File ".../scripts/crypto/gen-hash-testvecs.py", line 121 return f'{alg.upper().replace('-', '_')}_DIGEST_SIZE' ^ SyntaxError: f-string: unmatched '(' Old...
```diff diff --git a/scripts/crypto/gen-hash-testvecs.py b/scripts/crypto/gen-hash-testvecs.py index c1d0517140bd..c773294fba64 100755 --- a/scripts/crypto/gen-hash-testvecs.py +++ b/scripts/crypto/gen-hash-testvecs.py @@ -118,7 +118,7 @@ def print_c_struct_u8_array_field(name, value): def alg_digest_size_const(alg): ...
fcff71fd888dce1533a3975e68fc80824ff69ef9
Analyze and fix the following issue in the Linux kernel code: lib/crypto: tests: polyval_kunit: Increase iterations for preparekey in IRQs
Problem Details: On my development machine the generic, memcpy()-only implementation of polyval_preparekey() is too fast for the IRQ workers to actually fire. The test fails. Increase the iterations to make the test more robust. The test will run for a maximum of one second in any case. [EB: This failure was already ...
```diff diff --git a/lib/crypto/tests/polyval_kunit.c b/lib/crypto/tests/polyval_kunit.c index e59f598c1572..f47f41a39a41 100644 --- a/lib/crypto/tests/polyval_kunit.c +++ b/lib/crypto/tests/polyval_kunit.c @@ -183,7 +183,7 @@ static void test_polyval_preparekey_in_irqs(struct kunit *test) rand_bytes(state.raw_key,...
c2803bd580db226008aabf2fb2f0c9a7d3b5d0de
Analyze and fix the following issue in the Linux kernel code: arm_mpam: Stop using uninitialized variables in __ris_msmon_read()
Problem Details: Dan has reported two uses of uninitialized variables in __ris_msmon_read(). If an unknown monitor type is encountered then the local variable, now, is used uninitialized. Fix this by returning early on error. If a non-mbwu monitor is being read then the local variable, overflow, is not initialized but ...
```diff diff --git a/drivers/resctrl/mpam_devices.c b/drivers/resctrl/mpam_devices.c index 0b5b158e1aaf..b495d5291868 100644 --- a/drivers/resctrl/mpam_devices.c +++ b/drivers/resctrl/mpam_devices.c @@ -1072,7 +1072,7 @@ static void __ris_msmon_read(void *arg) u64 now; bool nrdy = false; bool config_mismatch; - b...
f403945d240417761d404cb1ce8fa2c1ec02daf5
Analyze and fix the following issue in the Linux kernel code: drm/rockchip: vop2: Fix Esmart test condition
Problem Details: If we want to find out if a window is Esmart or not, test for not being a cluster window, rather than AFBDC presence. No functional effect as only cluster windows support AFBC decode. Signed-off-by: Daniel Stone <daniels@collabora.com> Signed-off-by: Nicolas Frattaroli <nicolas.frattaroli@collabora.c...
```diff diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_vop2.c b/drivers/gpu/drm/rockchip/rockchip_drm_vop2.c index 1cad5a8ece61..fbcc655cb583 100644 --- a/drivers/gpu/drm/rockchip/rockchip_drm_vop2.c +++ b/drivers/gpu/drm/rockchip/rockchip_drm_vop2.c @@ -1229,12 +1229,10 @@ static void vop2_plane_atomic_update(stru...
ff8071eb3aa54e96336ecce7c88b25f9a4d62383
Analyze and fix the following issue in the Linux kernel code: KVM: VMX: Always reflect SGX EPCM #PFs back into the guest
Problem Details: When handling intercepted #PFs, reflect EPCM (Enclave Page Cache Map) violations, i.e. #PFs with the SGX flag set, back into the guest. KVM doesn't shadow EPCM entries (the EPCM deals only with virtual/linear addresses), and so EPCM violation cannot be due to KVM interference, and more importantly can...
```diff diff --git a/arch/x86/kvm/vmx/vmx.c b/arch/x86/kvm/vmx/vmx.c index 6b96f7aea20b..97d696014f9a 100644 --- a/arch/x86/kvm/vmx/vmx.c +++ b/arch/x86/kvm/vmx/vmx.c @@ -5303,12 +5303,53 @@ static bool is_xfd_nm_fault(struct kvm_vcpu *vcpu) !kvm_is_cr0_bit_set(vcpu, X86_CR0_TS); } +static int vmx_handle_pa...
929dc5b3e06c54f1d19b01c93042174d0e741b99
Analyze and fix the following issue in the Linux kernel code: ARM: dts: broadcom: bcm2711: Fix 'simple-bus' node names
Problem Details: Fix 'simple-bus' node names to follow the defined pattern. Nodes with 'reg' or 'ranges' addresses should also have a unit-address. Signed-off-by: Rob Herring (Arm) <robh@kernel.org> Link: https://lore.kernel.org/r/20260106-dt-dtbs-broadcom-fixes-v1-1-ba45874e4553@kernel.org Signed-off-by: Florian Fain...
```diff diff --git a/arch/arm/boot/dts/broadcom/bcm2711.dtsi b/arch/arm/boot/dts/broadcom/bcm2711.dtsi index c06d9f5e53c8..5e3b4bb39396 100644 --- a/arch/arm/boot/dts/broadcom/bcm2711.dtsi +++ b/arch/arm/boot/dts/broadcom/bcm2711.dtsi @@ -415,7 +415,7 @@ * The firmware will find whether the emmc2bus alias is defined...
5b577d214fcc109707bcb77b4ae72a31cfd86798
Analyze and fix the following issue in the Linux kernel code: ASoC: davinci-evm: Fix reference leak in davinci_evm_probe
Problem Details: The davinci_evm_probe() function calls of_parse_phandle() to acquire device nodes for "ti,audio-codec" and "ti,mcasp-controller". These functions return device nodes with incremented reference counts. However, in several error paths (e.g., when the second of_parse_phandle(), snd_soc_of_parse_card_name...
```diff diff --git a/sound/soc/ti/davinci-evm.c b/sound/soc/ti/davinci-evm.c index 3848766d96c3..ad514c2e5a25 100644 --- a/sound/soc/ti/davinci-evm.c +++ b/sound/soc/ti/davinci-evm.c @@ -194,27 +194,32 @@ static int davinci_evm_probe(struct platform_device *pdev) return -EINVAL; dai->cpus->of_node = of_parse_pha...
9bf4ca1e699c272defe9636f9812ff33a448d650
Analyze and fix the following issue in the Linux kernel code: drm/gpuvm: drm_gpuvm_bo_obtain() requires lock and staged mode
Problem Details: In commit 9ce4aef9a5b1 ("drm/gpuvm: take GEM lock inside drm_gpuvm_bo_obtain_prealloc()") we update drm_gpuvm_bo_obtain_prealloc() to take locks internally, which means that it's only usable in immediate mode. In this commit, we notice that drm_gpuvm_bo_obtain() requires you to use staged mode. This m...
```diff diff --git a/drivers/gpu/drm/drm_gpuvm.c b/drivers/gpu/drm/drm_gpuvm.c index 8a06d296561d..9826fc013d67 100644 --- a/drivers/gpu/drm/drm_gpuvm.c +++ b/drivers/gpu/drm/drm_gpuvm.c @@ -1825,16 +1825,26 @@ EXPORT_SYMBOL_GPL(drm_gpuvm_bo_find); * count of the &drm_gpuvm_bo accordingly. If not found, allocates a n...
c92510f5e3f82ba11c95991824a41e59a9c5ed81
Analyze and fix the following issue in the Linux kernel code: arp: do not assume dev_hard_header() does not change skb->head
Problem Details: arp_create() is the only dev_hard_header() caller making assumption about skb->head being unchanged. A recent commit broke this assumption. Initialize @arp pointer after dev_hard_header() call. Fixes: db5b4e39c4e6 ("ip6_gre: make ip6gre_header() robust") Reported-by: syzbot+58b44a770a1585795351@syzk...
```diff diff --git a/net/ipv4/arp.c b/net/ipv4/arp.c index 7f3863daaa40..c8c3e1713c0e 100644 --- a/net/ipv4/arp.c +++ b/net/ipv4/arp.c @@ -564,7 +564,7 @@ struct sk_buff *arp_create(int type, int ptype, __be32 dest_ip, skb_reserve(skb, hlen); skb_reset_network_header(skb); - arp = skb_put(skb, arp_hdr_len(dev)); ...
4b5bdabb5449b652122e43f507f73789041d4abe
Analyze and fix the following issue in the Linux kernel code: net: enetc: fix build warning when PAGE_SIZE is greater than 128K
Problem Details: The max buffer size of ENETC RX BD is 0xFFFF bytes, so if the PAGE_SIZE is greater than 128K, ENETC_RXB_DMA_SIZE and ENETC_RXB_DMA_SIZE_XDP will be greater than 0xFFFF, thus causing a build warning. This will not cause any practical issues because ENETC is currently only used on the ARM64 platform, an...
```diff diff --git a/drivers/net/ethernet/freescale/enetc/enetc.h b/drivers/net/ethernet/freescale/enetc/enetc.h index dce27bd67a7d..aecd40aeef9c 100644 --- a/drivers/net/ethernet/freescale/enetc/enetc.h +++ b/drivers/net/ethernet/freescale/enetc/enetc.h @@ -79,9 +79,9 @@ struct enetc_lso_t { #define ENETC_RXB_TRUESIZ...
4d984b0574ff708e66152763fbfdef24ea40933f
Analyze and fix the following issue in the Linux kernel code: atm: Fix dma_free_coherent() size
Problem Details: The size of the buffer is not the same when alloc'd with dma_alloc_coherent() in he_init_tpdrq() and freed. Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Cc: <stable@vger.kernel.org> Signed-off-by: Thomas Fourier <fourier.thomas@gmail.com> Link: https://patch.msgid.link/20260107090141.80900-2-fourier.thoma...
```diff diff --git a/drivers/atm/he.c b/drivers/atm/he.c index ad91cc6a34fc..92a041d5387b 100644 --- a/drivers/atm/he.c +++ b/drivers/atm/he.c @@ -1587,7 +1587,8 @@ he_stop(struct he_dev *he_dev) he_dev->tbrq_base, he_dev->tbrq_phys); if (he_dev->tpdrq_base) - dma_free_coherent(&he_dev->pci_dev->dev, CONFIG...
790792ebc9603a7ccbf6996cb537d89607e3a75b
Analyze and fix the following issue in the Linux kernel code: tools: ynl: don't install tests
Problem Details: make's install target is meant for installing the production artifacts, AFAIU. Don't install test_ynl_cli and test_ynl_ethtool from under the main YNL install target. The install target under tests/ is retained in case someone wants the tests to be installed. Fixes: 308b7dee3e5c ("tools: ynl: add YNL ...
```diff diff --git a/tools/net/ynl/Makefile b/tools/net/ynl/Makefile index 7736b492f559..c2f3e8b3f2ac 100644 --- a/tools/net/ynl/Makefile +++ b/tools/net/ynl/Makefile @@ -51,7 +51,6 @@ install: libynl.a lib/*.h @echo -e "\tINSTALL pyynl" @pip install --prefix=$(DESTDIR)$(prefix) . @make -C generated install - @ma...
7d11e047eda5f98514ae62507065ac961981c025
Analyze and fix the following issue in the Linux kernel code: net: do not write to msg_get_inq in callee
Problem Details: NULL pointer dereference fix. msg_get_inq is an input field from caller to callee. Don't set it in the callee, as the caller may not clear it on struct reuse. This is a kernel-internal variant of msghdr only, and the only user does reinitialize the field. So this is not critical for that reason. But ...
```diff diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c index f035440c475a..d5319ebe2452 100644 --- a/net/ipv4/tcp.c +++ b/net/ipv4/tcp.c @@ -2652,10 +2652,8 @@ static int tcp_recvmsg_locked(struct sock *sk, struct msghdr *msg, size_t len, if (sk->sk_state == TCP_LISTEN) goto out; - if (tp->recvmsg_inq) { + if (tp-...
9ce4aef9a5b1b76207152ba019f838f62dff97b8
Analyze and fix the following issue in the Linux kernel code: drm/gpuvm: take GEM lock inside drm_gpuvm_bo_obtain_prealloc()
Problem Details: When calling drm_gpuvm_bo_obtain_prealloc() and using immediate mode, this may result in a call to ops->vm_bo_free(vm_bo) while holding the GEMs gpuva mutex. This is a problem if ops->vm_bo_free(vm_bo) performs any operations that are not safe in the fence signalling critical path, and it turns out tha...
```diff diff --git a/drivers/gpu/drm/drm_gpuvm.c b/drivers/gpu/drm/drm_gpuvm.c index 8a06d296561d..0de47e83d84d 100644 --- a/drivers/gpu/drm/drm_gpuvm.c +++ b/drivers/gpu/drm/drm_gpuvm.c @@ -1602,14 +1602,48 @@ drm_gpuvm_bo_create(struct drm_gpuvm *gpuvm, } EXPORT_SYMBOL_GPL(drm_gpuvm_bo_create); +/* + * drm_gpuvm_...
3358995b1a7f9dcb52a56ec8251570d71024dad0
Analyze and fix the following issue in the Linux kernel code: bnxt_en: Fix NULL pointer crash in bnxt_ptp_enable during error cleanup
Problem Details: When bnxt_init_one() fails during initialization (e.g., bnxt_init_int_mode returns -ENODEV), the error path calls bnxt_free_hwrm_resources() which destroys the DMA pool and sets bp->hwrm_dma_pool to NULL. Subsequently, bnxt_ptp_clear() is called, which invokes ptp_clock_unregister(). Since commit a60f...
```diff diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.c b/drivers/net/ethernet/broadcom/bnxt/bnxt.c index d160e54ac121..8419d1eb4035 100644 --- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c @@ -16891,12 +16891,12 @@ init_err_dl: init_err_pci_clean: bnxt_hwrm_fun...