id
stringlengths
40
40
instruction
stringlengths
68
308
input
stringlengths
17
33.4k
output
stringlengths
100
30k
5442e7912050bff9f866d03ee5005731dbd7a708
Analyze and fix the following issue in the Linux kernel code: dt-bindings: usb: rockchip,dwc3: Move RK3399 to its own schema
Problem Details: The rockchip,dwc3.yaml schema defines a single DWC3 node, but the RK3399 uses the discouraged parent wrapper node and child 'generic' DWC3 node. The intent was to modify the RK3399 DTs to use a single node, but the DT changes were rejected for ABI reasons. However, the schema was accepted as-is. To fi...
```diff diff --git a/Documentation/devicetree/bindings/usb/rockchip,dwc3.yaml b/Documentation/devicetree/bindings/usb/rockchip,dwc3.yaml index b3798d94d2fd..291844c8f3e1 100644 --- a/Documentation/devicetree/bindings/usb/rockchip,dwc3.yaml +++ b/Documentation/devicetree/bindings/usb/rockchip,dwc3.yaml @@ -29,7 +29,6 @@...
e538e3614c5c5a9a692c96a76e9b06e552dc9b6c
Analyze and fix the following issue in the Linux kernel code: usb: fotg210: fix a Kconfig spelling mistake
Problem Details: Correct a spelling mistake (reported by codespell). Signed-off-by: Randy Dunlap <rdunlap@infradead.org> Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Link: https://lore.kernel.org/r/20230124233511.23616-1-rdunlap@infradead.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
```diff diff --git a/drivers/usb/fotg210/Kconfig b/drivers/usb/fotg210/Kconfig index 2b05968735ba..87a16258274e 100644 --- a/drivers/usb/fotg210/Kconfig +++ b/drivers/usb/fotg210/Kconfig @@ -29,7 +29,7 @@ config USB_FOTG210_UDC bool "Faraday FOTG210 USB Peripheral Controller support" help Faraday USB2.0 OTG co...
acd7e9ee57c880b99671dd99680cb707b7b5b0ee
Analyze and fix the following issue in the Linux kernel code: thermal: intel: int340x: Add locking to int340x_thermal_get_trip_type()
Problem Details: In order to prevent int340x_thermal_get_trip_type() from possibly racing with int340x_thermal_read_trips() invoked by int3403_notify() add locking to it in analogy with int340x_thermal_get_trip_temp(). Fixes: 6757a7abe47b ("thermal: intel: int340x: Protect trip temperature from concurrent updates") Si...
```diff diff --git a/drivers/thermal/intel/int340x_thermal/int340x_thermal_zone.c b/drivers/thermal/intel/int340x_thermal/int340x_thermal_zone.c index 852f6c579af5..0a4eaa307156 100644 --- a/drivers/thermal/intel/int340x_thermal/int340x_thermal_zone.c +++ b/drivers/thermal/intel/int340x_thermal/int340x_thermal_zone.c @...
636be128d659131739df62e08455bbf6678fc58b
Analyze and fix the following issue in the Linux kernel code: ASoC: Kconfig: fix spelling of "up to"
Problem Details: Fix spelling in sound/soc/ Kconfig files: s/upto/up to/ (reported by codespell) Signed-off-by: Randy Dunlap <rdunlap@infradead.org> Reviewed-by: Heiko Stuebner <heiko@sntech.de> #rockchip Link: https://lore.kernel.org/r/20230124181746.19028-1-rdunlap@infradead.org Signed-off-by: Mark Brown <broonie@ke...
```diff diff --git a/sound/soc/rockchip/Kconfig b/sound/soc/rockchip/Kconfig index 42f76bc0fb02..f98a2fa85edd 100644 --- a/sound/soc/rockchip/Kconfig +++ b/sound/soc/rockchip/Kconfig @@ -13,7 +13,7 @@ config SND_SOC_ROCKCHIP_I2S select SND_SOC_GENERIC_DMAENGINE_PCM help Say Y or M if you want to add support for...
fc64adc56b8302ed21189607dd4b4f4719f2c78f
Analyze and fix the following issue in the Linux kernel code: accel/ivpu: Fix spelling mistake "tansition" -> "transition"
Problem Details: There are spelling mistakes in two ivpu_err error messages. Fix them. Signed-off-by: Colin Ian King <colin.i.king@gmail.com> Reviewed-by: Stanislaw Gruszka <stanislaw.gruszka@linux.intel.com> Signed-off-by: Jacek Lawrynowicz <jacek.lawrynowicz@linux.intel.com> Link: https://patchwork.freedesktop.org/p...
```diff diff --git a/drivers/accel/ivpu/ivpu_hw_mtl.c b/drivers/accel/ivpu/ivpu_hw_mtl.c index b59b1f472b40..62bfaa9081c4 100644 --- a/drivers/accel/ivpu/ivpu_hw_mtl.c +++ b/drivers/accel/ivpu/ivpu_hw_mtl.c @@ -608,7 +608,7 @@ static int ivpu_boot_d0i3_drive(struct ivpu_device *vdev, bool enable) ret = REGB_POLL_FL...
b98e1a04e27fddfdc808bf46fe78eca30db89ab3
Analyze and fix the following issue in the Linux kernel code: net: mctp: mark socks as dead on unhash, prevent re-add
Problem Details: Once a socket has been unhashed, we want to prevent it from being re-used in a sk_key entry as part of a routing operation. This change marks the sk as SOCK_DEAD on unhash, which prevents addition into the net's key list. We need to do this during the key add path, rather than key lookup, as we relea...
```diff diff --git a/net/mctp/af_mctp.c b/net/mctp/af_mctp.c index fb6ae3110528..45bbe3e54cc2 100644 --- a/net/mctp/af_mctp.c +++ b/net/mctp/af_mctp.c @@ -577,6 +577,7 @@ static void mctp_sk_unhash(struct sock *sk) spin_lock_irqsave(&key->lock, fl2); __mctp_key_remove(key, net, fl2, MCTP_TRACE_KEY_CLOSED); } + ...
6e54ea37e344f145665c2dc3cc534b92529e8de5
Analyze and fix the following issue in the Linux kernel code: net: mctp: hold key reference when looking up a general key
Problem Details: Currently, we have a race where we look up a sock through a "general" (ie, not directly associated with the (src,dest,tag) tuple) key, then drop the key reference while still holding the key's sock. This change expands the key reference until we've finished using the sock, and hence the sock reference...
```diff diff --git a/net/mctp/route.c b/net/mctp/route.c index ce10ba7ae839..06c0de21984d 100644 --- a/net/mctp/route.c +++ b/net/mctp/route.c @@ -317,8 +317,8 @@ static int mctp_frag_queue(struct mctp_sk_key *key, struct sk_buff *skb) static int mctp_route_input(struct mctp_route *route, struct sk_buff *skb) { + s...
5f41ae6fca9d40ab3cb9b0507931ef7a9b3ea50b
Analyze and fix the following issue in the Linux kernel code: net: mctp: move expiry timer delete to unhash
Problem Details: Currently, we delete the key expiry timer (in sk->close) before unhashing the sk. This means that another thread may find the sk through its presence on the key list, and re-queue the timer. This change moves the timer deletion to the unhash, after we have made the key no longer observable, so the tim...
```diff diff --git a/net/mctp/af_mctp.c b/net/mctp/af_mctp.c index fc9e728b6333..fb6ae3110528 100644 --- a/net/mctp/af_mctp.c +++ b/net/mctp/af_mctp.c @@ -544,9 +544,6 @@ static int mctp_sk_init(struct sock *sk) static void mctp_sk_close(struct sock *sk, long timeout) { - struct mctp_sock *msk = container_of(sk, st...
de8a6b15d9654c3e4f672d76da9d9df8ee06331d
Analyze and fix the following issue in the Linux kernel code: net: mctp: add an explicit reference from a mctp_sk_key to sock
Problem Details: Currently, we correlate the mctp_sk_key lifetime to the sock lifetime through the sock hash/unhash operations, but this is pretty tenuous, and there are cases where we may have a temporary reference to an unhashed sk. This change makes the reference more explicit, by adding a hold on the sock when it'...
```diff diff --git a/net/mctp/route.c b/net/mctp/route.c index f9a80b82dc51..ce10ba7ae839 100644 --- a/net/mctp/route.c +++ b/net/mctp/route.c @@ -147,6 +147,7 @@ static struct mctp_sk_key *mctp_key_alloc(struct mctp_sock *msk, key->valid = true; spin_lock_init(&key->lock); refcount_set(&key->refs, 1); + sock_hol...
f3c07758c9007a6bfff5290d9e19d3c41930c897
Analyze and fix the following issue in the Linux kernel code: net: ravb: Fix possible hang if RIS2_QFF1 happen
Problem Details: Since this driver enables the interrupt by RIC2_QFE1, this driver should clear the interrupt flag if it happens. Otherwise, the interrupt causes to hang the system. Note that this also fix a minor coding style (a comment indentation) around the fixed code. Fixes: c156633f1353 ("Renesas Ethernet AVB d...
```diff diff --git a/drivers/net/ethernet/renesas/ravb_main.c b/drivers/net/ethernet/renesas/ravb_main.c index 3f61100c02f4..0f54849a3823 100644 --- a/drivers/net/ethernet/renesas/ravb_main.c +++ b/drivers/net/ethernet/renesas/ravb_main.c @@ -1101,14 +1101,14 @@ static void ravb_error_interrupt(struct net_device *ndev)...
c2b6cdee1d13ffbb24baca3c9b8a572d6b541e4e
Analyze and fix the following issue in the Linux kernel code: net: ravb: Fix lack of register setting after system resumed for Gen3
Problem Details: After system entered Suspend to RAM, registers setting of this hardware is reset because the SoC will be turned off. On R-Car Gen3 (info->ccc_gac), ravb_ptp_init() is called in ravb_probe() only. So, after system resumed, it lacks of the initial settings for ptp. So, add ravb_ptp_{init,stop}() into rav...
```diff diff --git a/drivers/net/ethernet/renesas/ravb_main.c b/drivers/net/ethernet/renesas/ravb_main.c index b4e0fc7f65bd..3f61100c02f4 100644 --- a/drivers/net/ethernet/renesas/ravb_main.c +++ b/drivers/net/ethernet/renesas/ravb_main.c @@ -2973,6 +2973,9 @@ static int __maybe_unused ravb_suspend(struct device *dev) ...
0f04cdbdb210000a97c773b28b598fa8ac3aafa4
Analyze and fix the following issue in the Linux kernel code: gpio: ep93xx: Fix port F hwirq numbers in handler
Problem Details: Fix wrong translation of irq numbers in port F handler, as ep93xx hwirqs increased by 1, we should simply decrease them by 1 in translation. Fixes: 482c27273f52 ("ARM: ep93xx: renumber interrupts") Signed-off-by: Nikita Shubin <nikita.shubin@maquefel.me> Acked-by: Arnd Bergmann <arnd@arndb.de> Signed-...
```diff diff --git a/drivers/gpio/gpio-ep93xx.c b/drivers/gpio/gpio-ep93xx.c index 2e1779709113..7edcdc575080 100644 --- a/drivers/gpio/gpio-ep93xx.c +++ b/drivers/gpio/gpio-ep93xx.c @@ -148,7 +148,7 @@ static void ep93xx_gpio_f_irq_handler(struct irq_desc *desc) */ struct irq_chip *irqchip = irq_desc_get_chip(des...
22913a63b477c5f167012d4f1265d023a102c1fe
Analyze and fix the following issue in the Linux kernel code: spi: Kconfig: fix a spelling mistake & hyphenation
Problem Details: Correct a spelling mistake (reported by codespell). Also hyphenate "8-bit". Signed-off-by: Randy Dunlap <rdunlap@infradead.org> Cc: Mark Brown <broonie@kernel.org> Cc: linux-spi@vger.kernel.org Link: https://lore.kernel.org/r/20230124233502.23330-1-rdunlap@infradead.org Signed-off-by: Mark Brown <broo...
```diff diff --git a/drivers/spi/Kconfig b/drivers/spi/Kconfig index 3b1c0878bb85..df96a6c2e633 100644 --- a/drivers/spi/Kconfig +++ b/drivers/spi/Kconfig @@ -247,7 +247,7 @@ config SPI_CADENCE_XSPI Enable support for the Cadence XSPI Flash controller. Cadence XSPI is a specialized controller for connecting a...
cc5be0e5477f53f2d4b3c9211206f34505ec17ba
Analyze and fix the following issue in the Linux kernel code: ASoC: dt-bindings: samsung,odroid: correct codec DAI phandles
Problem Details: The order of codec DAI phandles is reversed - first comes HDMI (always present) and then codec (physically not present on Odroid XU4). Fixes: 97709d365bbd ("ASoC: dt-bindings: Centralize the 'sound-dai' definition") Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Acked-by: Rob Herr...
```diff diff --git a/Documentation/devicetree/bindings/sound/samsung,odroid.yaml b/Documentation/devicetree/bindings/sound/samsung,odroid.yaml index 7b4e08ddef6a..7774543b8819 100644 --- a/Documentation/devicetree/bindings/sound/samsung,odroid.yaml +++ b/Documentation/devicetree/bindings/sound/samsung,odroid.yaml @@ -4...
100c94ffde489ee11e23400f2a07b236144b048f
Analyze and fix the following issue in the Linux kernel code: ASoC: codecs: wsa883x: correct playback min/max rates
Problem Details: Correct reversed values used in min/max rates, leading to incorrect playback constraints. Cc: <stable@vger.kernel.org> Fixes: 43b8c7dc85a1 ("ASoC: codecs: add wsa883x amplifier support") Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Link: https://lore.kernel.org/r/20230124123049....
```diff diff --git a/sound/soc/codecs/wsa883x.c b/sound/soc/codecs/wsa883x.c index 966ba4909204..58fdb4e9fd97 100644 --- a/sound/soc/codecs/wsa883x.c +++ b/sound/soc/codecs/wsa883x.c @@ -1359,8 +1359,8 @@ static struct snd_soc_dai_driver wsa883x_dais[] = { .stream_name = "SPKR Playback", .rates = WSA883X_RATES ...
37870358616ca7fdb1e90ad1cdd791655ec54414
Analyze and fix the following issue in the Linux kernel code: gpio: mxc: Unlock on error path in mxc_flip_edge()
Problem Details: We recently added locking to this function but one error path was over looked. Drop the lock before returning. Fixes: e5464277625c ("gpio: mxc: Protect GPIO irqchip RMW with bgpio spinlock") Signed-off-by: Dan Carpenter <error27@gmail.com> Acked-by: Marek Vasut <marex@denx.de> Signed-off-by: Bartosz ...
```diff diff --git a/drivers/gpio/gpio-mxc.c b/drivers/gpio/gpio-mxc.c index 6f673b2f2a1b..9d0cec4b82a3 100644 --- a/drivers/gpio/gpio-mxc.c +++ b/drivers/gpio/gpio-mxc.c @@ -249,10 +249,11 @@ static void mxc_flip_edge(struct mxc_gpio_port *port, u32 gpio) } else { pr_err("mxc: invalid configuration for GPIO %d: %...
1bc5d819f0b9784043ea08570e1b21107aa35739
Analyze and fix the following issue in the Linux kernel code: platform/x86: thinkpad_acpi: Fix profile modes on Intel platforms
Problem Details: My last commit to fix profile mode displays on AMD platforms caused an issue on Intel platforms - sorry! In it I was reading the current functional mode (MMC, PSC, AMT) from the BIOS but didn't account for the fact that on some of our Intel platforms I use a different API which returns just the profil...
```diff diff --git a/drivers/platform/x86/thinkpad_acpi.c b/drivers/platform/x86/thinkpad_acpi.c index a95946800ae9..02860c32625e 100644 --- a/drivers/platform/x86/thinkpad_acpi.c +++ b/drivers/platform/x86/thinkpad_acpi.c @@ -10496,8 +10496,7 @@ static int dytc_profile_set(struct platform_profile_handler *pprof, i...
54628de6792bfa86a8d73520b6fa0029971f9fc6
Analyze and fix the following issue in the Linux kernel code: x86/Kconfig: Fix spellos & punctuation
Problem Details: Fix spelling (reported by codespell) & punctuation in arch/x86/ Kconfig. Signed-off-by: Randy Dunlap <rdunlap@infradead.org> Signed-off-by: Ingo Molnar <mingo@kernel.org> Link: https://lore.kernel.org/r/20230124181753.19309-1-rdunlap@infradead.org
```diff diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig index 3604074a878b..a825bf031f49 100644 --- a/arch/x86/Kconfig +++ b/arch/x86/Kconfig @@ -1502,7 +1502,7 @@ config X86_5LEVEL depends on X86_64 help 5-level paging enables access to larger address space: - upto 128 PiB of virtual address space and 4 PiB...
c64074bfe2abbe18a57eb19c95f686298e8692b5
Analyze and fix the following issue in the Linux kernel code: iommu/exynos: Abstract getting the fault info
Problem Details: Fault info obtaining is implemented for SysMMU v1..v5 in a very hardware specific way, as it relies on: - interrupt bits being tied to read or write access - having separate registers for the fault address w.r.t. AR/AW ops Newer SysMMU versions (like SysMMU v7) have different way of providing the ...
```diff diff --git a/drivers/iommu/exynos-iommu.c b/drivers/iommu/exynos-iommu.c index c1d579c24740..75cade7382ab 100644 --- a/drivers/iommu/exynos-iommu.c +++ b/drivers/iommu/exynos-iommu.c @@ -185,38 +185,36 @@ static sysmmu_pte_t *page_entry(sysmmu_pte_t *sent, sysmmu_iova_t iova) lv2table_base(sent)) + lv2ent_...
1369459b2e219a6f4c861404c4f195cd81dcbb40
Analyze and fix the following issue in the Linux kernel code: iommu: Add a gfp parameter to iommu_map()
Problem Details: The internal mechanisms support this, but instead of exposting the gfp to the caller it wrappers it into iommu_map() and iommu_map_atomic() Fix this instead of adding more variants for GFP_KERNEL_ACCOUNT. Reviewed-by: Kevin Tian <kevin.tian@intel.com> Signed-off-by: Jason Gunthorpe <jgg@nvidia.com> R...
```diff diff --git a/arch/arm/mm/dma-mapping.c b/arch/arm/mm/dma-mapping.c index c135f6e37a00..8bc01071474a 100644 --- a/arch/arm/mm/dma-mapping.c +++ b/arch/arm/mm/dma-mapping.c @@ -984,7 +984,8 @@ __iommu_create_mapping(struct device *dev, struct page **pages, size_t size, len = (j - i) << PAGE_SHIFT; ret = i...
72715b54d4601dca6ebfdaee8a5d327d4441e95f
Analyze and fix the following issue in the Linux kernel code: drm/i915/sdvo: Do ELD hardware readout
Problem Details: Read out the ELD from the hw so the state checker can verify it. v2: Check the "ELD valid" bit separately v3: Fix ELD tx rate handling during readout Cc: Chaitanya Kumar Borah <chaitanya.kumar.borah@intel.com> Cc: Takashi Iwai <tiwai@suse.de> Reviewed-by: Jani Nikula <jani.nikula@intel.com> #v1 Revie...
```diff diff --git a/drivers/gpu/drm/i915/display/intel_sdvo.c b/drivers/gpu/drm/i915/display/intel_sdvo.c index 68e5c7be2135..c469ec3e6042 100644 --- a/drivers/gpu/drm/i915/display/intel_sdvo.c +++ b/drivers/gpu/drm/i915/display/intel_sdvo.c @@ -1069,7 +1069,8 @@ static ssize_t intel_sdvo_read_infoframe(struct intel_s...
d6393793848550e22cf7f4263f1a520b987d589a
Analyze and fix the following issue in the Linux kernel code: drm/i915/audio: Don't enable audio with bogus ELD
Problem Details: Currently we just print a debug message if the ELD is bogus. Maybe we should just not enable audio at all in that case? Cc: Chaitanya Kumar Borah <chaitanya.kumar.borah@intel.com> Cc: Takashi Iwai <tiwai@suse.de> Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com> Signed-off-by: Ville Syrjälä <vi...
```diff diff --git a/drivers/gpu/drm/i915/display/intel_audio.c b/drivers/gpu/drm/i915/display/intel_audio.c index 326e93768687..5123bab17063 100644 --- a/drivers/gpu/drm/i915/display/intel_audio.c +++ b/drivers/gpu/drm/i915/display/intel_audio.c @@ -757,10 +757,12 @@ bool intel_audio_compute_config(struct intel_encode...
f5be9caf7bf022ab550f62ea68f1c1bb8f5287ee
Analyze and fix the following issue in the Linux kernel code: net: ethtool: fix NULL pointer dereference in pause_prepare_data()
Problem Details: In the following call path: ethnl_default_dumpit -> ethnl_default_dump_one -> ctx->ops->prepare_data -> pause_prepare_data struct genl_info *info will be passed as NULL, and pause_prepare_data() dereferences it while getting the extended ack pointer. To avoid that, just set the extack to NU...
```diff diff --git a/net/ethtool/pause.c b/net/ethtool/pause.c index e2be9e89c9d9..dcd34b9a849f 100644 --- a/net/ethtool/pause.c +++ b/net/ethtool/pause.c @@ -54,9 +54,9 @@ static int pause_prepare_data(const struct ethnl_req_info *req_base, struct genl_info *info) { const struct pause_req_info *req_info =...
c96de136329b38172f21214021fc30d67f05c399
Analyze and fix the following issue in the Linux kernel code: net: ethtool: fix NULL pointer dereference in stats_prepare_data()
Problem Details: In the following call path: ethnl_default_dumpit -> ethnl_default_dump_one -> ctx->ops->prepare_data -> stats_prepare_data struct genl_info *info will be passed as NULL, and stats_prepare_data() dereferences it while getting the extended ack pointer. To avoid that, just set the extack to NU...
```diff diff --git a/net/ethtool/stats.c b/net/ethtool/stats.c index 7294be5855d4..010ed19ccc99 100644 --- a/net/ethtool/stats.c +++ b/net/ethtool/stats.c @@ -117,9 +117,9 @@ static int stats_prepare_data(const struct ethnl_req_info *req_base, struct genl_info *info) { const struct stats_req_info *req_info...
f2b0b5210f67c56a3bcdf92ff665fb285d6e0067
Analyze and fix the following issue in the Linux kernel code: net/x25: Fix to not accept on connected socket
Problem Details: When listen() and accept() are called on an x25 socket that connect() succeeds, accept() succeeds immediately. This is because x25_connect() queues the skb to sk->sk_receive_queue, and x25_accept() dequeues it. This creates a child socket with the sk of the parent x25 socket, which can cause confusion...
```diff diff --git a/net/x25/af_x25.c b/net/x25/af_x25.c index 3b55502b2965..5c7ad301d742 100644 --- a/net/x25/af_x25.c +++ b/net/x25/af_x25.c @@ -482,6 +482,12 @@ static int x25_listen(struct socket *sock, int backlog) int rc = -EOPNOTSUPP; lock_sock(sk); + if (sock->state != SS_UNCONNECTED) { + rc = -EINVAL; +...
d0671115869d19ec76d658c4bf86d3211a8ea121
Analyze and fix the following issue in the Linux kernel code: virtio-net: Reduce debug name field size to 16 bytes
Problem Details: virtio queue index can be maximum of 65535. 16 bytes are enough to store the vq name with the existing string prefix. With this change, send queue struct saves 24 bytes and receive queue saves whole cache line worth 64 bytes per structure due to saving in alignment bytes. Pahole results before: paho...
```diff diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c index a170b0075dcf..3855b8524300 100644 --- a/drivers/net/virtio_net.c +++ b/drivers/net/virtio_net.c @@ -134,7 +134,7 @@ struct send_queue { struct scatterlist sg[MAX_SKB_FRAGS + 2]; /* Name of the send queue: output.$index */ - char name[4...
b041c9d038f7defe20cfbdfeeb1b80f855394bfc
Analyze and fix the following issue in the Linux kernel code: ARM: dts: gemini: Fix USB block version
Problem Details: The FOTG version in the Gemini is the FOTG200, fix this up. Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Link: https://lore.kernel.org/r/20230123073916.2350839-1-linus.walleij@linaro.org
```diff diff --git a/arch/arm/boot/dts/gemini.dtsi b/arch/arm/boot/dts/gemini.dtsi index 3ed04d2f394c..966b193c05ad 100644 --- a/arch/arm/boot/dts/gemini.dtsi +++ b/arch/arm/boot/dts/gemini.dtsi @@ -439,7 +439,7 @@ }; usb0: usb@68000000 { - compatible = "cortina,gemini-usb", "faraday,fotg210"; + compatible ...
285b6a18daf1358e70a4c842884d9ff2d2fe53e2
Analyze and fix the following issue in the Linux kernel code: RISC-V: Fix do_notify_resume / do_work_pending prototype
Problem Details: Commit b0f4c74eadbf ("RISC-V: Fix unannoted hardirqs-on in return to userspace slow-path") renamed the do_notify_resume function to do_work_pending but did not change the prototype in signal.h Do that now, as the original function does not exist anymore. Fixes: b0f4c74eadbf ("RISC-V: Fix unannoted har...
```diff diff --git a/arch/riscv/include/asm/signal.h b/arch/riscv/include/asm/signal.h index 532c29ef0376..956ae0a01bad 100644 --- a/arch/riscv/include/asm/signal.h +++ b/arch/riscv/include/asm/signal.h @@ -7,6 +7,6 @@ #include <uapi/asm/ptrace.h> asmlinkage __visible -void do_notify_resume(struct pt_regs *regs, un...
85eee6341abb81ac6a35062ffd5c3029eb53be6b
Analyze and fix the following issue in the Linux kernel code: nvme: fix passthrough csi check
Problem Details: The namespace head saves the Command Set Indicator enum, so use that instead of the Command Set Selected. The two values are not the same. Fixes: 831ed60c2aca2d ("nvme: also return I/O command effects from nvme_command_effects") Signed-off-by: Keith Busch <kbusch@kernel.org> Signed-off-by: Christoph H...
```diff diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c index d307ae4d8a57..2990ed331a1a 100644 --- a/drivers/nvme/host/core.c +++ b/drivers/nvme/host/core.c @@ -1093,7 +1093,7 @@ u32 nvme_command_effects(struct nvme_ctrl *ctrl, struct nvme_ns *ns, u8 opcode) if (ns) { if (ns->head->effects) e...
ca0254998be4d74cf6add70ccfab0d2dbd362a10
Analyze and fix the following issue in the Linux kernel code: riscv/kprobe: Fix instruction simulation of JALR
Problem Details: Set kprobe at 'jalr 1140(ra)' of vfs_write results in the following crash: [ 32.092235] Unable to handle kernel access to user memory without uaccess routines at virtual address 00aaaaaad77b1170 [ 32.093115] Oops [#1] [ 32.093251] Modules linked in: [ 32.093626] CPU: 0 PID: 135 Comm: ftracetes...
```diff diff --git a/arch/riscv/kernel/probes/simulate-insn.c b/arch/riscv/kernel/probes/simulate-insn.c index d73e96f6ed7c..a20568bd1f1a 100644 --- a/arch/riscv/kernel/probes/simulate-insn.c +++ b/arch/riscv/kernel/probes/simulate-insn.c @@ -71,11 +71,11 @@ bool __kprobes simulate_jalr(u32 opcode, unsigned long addr, ...
c88ea16a8f892bce3bfb3f6a0d91b2bb27df8f59
Analyze and fix the following issue in the Linux kernel code: selftests/bpf: Cover listener cloning with progs attached to sockmap
Problem Details: Today we test if a child socket is cloned properly from a listening socket inside a sockmap only when there are no BPF programs attached to the map. A bug has been reported [1] for the case when sockmap has a verdict program attached. So cover this case as well to prevent regressions. [1]: https://lo...
```diff diff --git a/tools/testing/selftests/bpf/prog_tests/sockmap_listen.c b/tools/testing/selftests/bpf/prog_tests/sockmap_listen.c index 499fba8f55b9..567e07c19ecc 100644 --- a/tools/testing/selftests/bpf/prog_tests/sockmap_listen.c +++ b/tools/testing/selftests/bpf/prog_tests/sockmap_listen.c @@ -563,8 +563,7 @@ c...
b4ea530d024ca6095fc80290075893a5b7136516
Analyze and fix the following issue in the Linux kernel code: selftests/bpf: Pass BPF skeleton to sockmap_listen ops tests
Problem Details: Following patch extends the sockmap ops tests to cover the scenario when a sockmap with attached programs holds listening sockets. Pass the BPF skeleton to sockmap ops test so that the can access and attach the BPF programs. Signed-off-by: Jakub Sitnicki <jakub@cloudflare.com> Acked-by: John Fastaben...
```diff diff --git a/tools/testing/selftests/bpf/prog_tests/sockmap_listen.c b/tools/testing/selftests/bpf/prog_tests/sockmap_listen.c index 2cf0c7a3fe23..499fba8f55b9 100644 --- a/tools/testing/selftests/bpf/prog_tests/sockmap_listen.c +++ b/tools/testing/selftests/bpf/prog_tests/sockmap_listen.c @@ -30,6 +30,8 @@ #d...
ddce1e091757d0259107c6c0c7262df201de2b66
Analyze and fix the following issue in the Linux kernel code: bpf, sockmap: Check for any of tcp_bpf_prots when cloning a listener
Problem Details: A listening socket linked to a sockmap has its sk_prot overridden. It points to one of the struct proto variants in tcp_bpf_prots. The variant depends on the socket's family and which sockmap programs are attached. A child socket cloned from a TCP listener initially inherits their sk_prot. But before ...
```diff diff --git a/include/linux/util_macros.h b/include/linux/util_macros.h index 72299f261b25..43db6e47503c 100644 --- a/include/linux/util_macros.h +++ b/include/linux/util_macros.h @@ -38,4 +38,16 @@ */ #define find_closest_descending(x, a, as) __find_closest(x, a, as, >=) +/** + * is_insidevar - check if th...
5b4a79ba65a1ab479903fff2e604865d229b70a9
Analyze and fix the following issue in the Linux kernel code: bpf, sockmap: Don't let sock_map_{close,destroy,unhash} call itself
Problem Details: sock_map proto callbacks should never call themselves by design. Protect against bugs like [1] and break out of the recursive loop to avoid a stack overflow in favor of a resource leak. [1] https://lore.kernel.org/all/00000000000073b14905ef2e7401@google.com/ Suggested-by: Eric Dumazet <edumazet@googl...
```diff diff --git a/net/core/sock_map.c b/net/core/sock_map.c index 22fa2c5bc6ec..a68a7290a3b2 100644 --- a/net/core/sock_map.c +++ b/net/core/sock_map.c @@ -1569,15 +1569,16 @@ void sock_map_unhash(struct sock *sk) psock = sk_psock(sk); if (unlikely(!psock)) { rcu_read_unlock(); - if (sk->sk_prot->unhash) - ...
418e53401e478a743cf33b1c32ea0728f0afef66
Analyze and fix the following issue in the Linux kernel code: ice: move devlink port creation/deletion
Problem Details: Commit a286ba738714 ("ice: reorder PF/representor devlink port register/unregister flows") moved the code to create and destroy the devlink PF port. This was fine, but created a corner case issue in the case of ice_register_netdev() failing. In that case, the driver would end up calling ice_devlink_des...
```diff diff --git a/drivers/net/ethernet/intel/ice/ice_lib.c b/drivers/net/ethernet/intel/ice/ice_lib.c index 94aa834cd9a6..a596e07b3ce9 100644 --- a/drivers/net/ethernet/intel/ice/ice_lib.c +++ b/drivers/net/ethernet/intel/ice/ice_lib.c @@ -3235,9 +3235,6 @@ int ice_vsi_release(struct ice_vsi *vsi) } } - if (v...
9d5567ccf96fb2f1eb83d531eee23ead4aa8f2a3
Analyze and fix the following issue in the Linux kernel code: riscv: fix jal offsets in patched alternatives
Problem Details: Alternatives live in a different section, so offsets used by jal instruction will point to wrong locations after the patch got applied. Similar to arm64, adjust the location to consider that offset. Co-developed-by: Heiko Stuebner <heiko.stuebner@vrull.eu> Signed-off-by: Jisheng Zhang <jszhang@kernel...
```diff diff --git a/arch/riscv/include/asm/insn.h b/arch/riscv/include/asm/insn.h index 98453535324a..25ef9c0b19e7 100644 --- a/arch/riscv/include/asm/insn.h +++ b/arch/riscv/include/asm/insn.h @@ -291,6 +291,33 @@ static __always_inline bool riscv_insn_is_branch(u32 code) (RVC_X(x_, RVC_B_IMM_7_6_OPOFF, RVC_B_IMM_7...
28113cfada8bce91c627b057f68cd723cac2cf73
Analyze and fix the following issue in the Linux kernel code: net: mscc: ocelot: fix incorrect verify_enabled reporting in ethtool get_mm()
Problem Details: We don't read the verify_enabled variable from hardware in the MAC Merge layer state GET operation, instead we always leave it set to "false". The user may think something is wrong if they set verify_enabled to true, then read it back and see it's still false, even though the configuration took place. ...
```diff diff --git a/drivers/net/ethernet/mscc/ocelot_mm.c b/drivers/net/ethernet/mscc/ocelot_mm.c index 08820f2341a1..0a8f21ae23f0 100644 --- a/drivers/net/ethernet/mscc/ocelot_mm.c +++ b/drivers/net/ethernet/mscc/ocelot_mm.c @@ -165,6 +165,7 @@ int ocelot_port_get_mm(struct ocelot *ocelot, int port, state->tx_enabl...
458e279f861d3f61796894cd158b780765a1569f
Analyze and fix the following issue in the Linux kernel code: sctp: fail if no bound addresses can be used for a given scope
Problem Details: Currently, if you bind the socket to something like: servaddr.sin6_family = AF_INET6; servaddr.sin6_port = htons(0); servaddr.sin6_scope_id = 0; inet_pton(AF_INET6, "::1", &servaddr.sin6_addr); And then request a connect to: connaddr.sin6_family = AF_INET6; ...
```diff diff --git a/net/sctp/bind_addr.c b/net/sctp/bind_addr.c index 59e653b528b1..6b95d3ba8fe1 100644 --- a/net/sctp/bind_addr.c +++ b/net/sctp/bind_addr.c @@ -73,6 +73,12 @@ int sctp_bind_addr_copy(struct net *net, struct sctp_bind_addr *dest, } } + /* If somehow no addresses were found that can be used with...
ea4fdbaa2f7798cb25adbe4fd52ffc6356f097bb
Analyze and fix the following issue in the Linux kernel code: net/sched: sch_taprio: do not schedule in taprio_reset()
Problem Details: As reported by syzbot and hinted by Vinicius, I should not have added a qdisc_synchronize() call in taprio_reset() taprio_reset() can be called with qdisc spinlock held (and BH disabled) as shown in included syzbot report [1]. Only taprio_destroy() needed this synchronization, as explained in the bla...
```diff diff --git a/net/sched/sch_taprio.c b/net/sched/sch_taprio.c index 9a11a499ea2d..c322a61eaeea 100644 --- a/net/sched/sch_taprio.c +++ b/net/sched/sch_taprio.c @@ -1700,7 +1700,6 @@ static void taprio_reset(struct Qdisc *sch) int i; hrtimer_cancel(&q->advance_timer); - qdisc_synchronize(sch); if (q->qd...
852db33c6c180a48268eca52e25b267ed32de3ab
Analyze and fix the following issue in the Linux kernel code: cxl/pci: Show opcode in debug messages when sending a command
Problem Details: For debugging it is very helpful to see which commands are sent. Add it to the debug message. Signed-off-by: Robert Richter <rrichter@amd.com> Link: https://lore.kernel.org/r/20230103210151.1126873-1-rrichter@amd.com Signed-off-by: Dan Williams <dan.j.williams@intel.com>
```diff diff --git a/drivers/cxl/pci.c b/drivers/cxl/pci.c index 3a66aadb4df0..2bbebbc7e032 100644 --- a/drivers/cxl/pci.c +++ b/drivers/cxl/pci.c @@ -160,7 +160,7 @@ static int __cxl_pci_mbox_send_cmd(struct cxl_dev_state *cxlds, writeq(cmd_reg, cxlds->regs.mbox + CXLDEV_MBOX_CMD_OFFSET); /* #4 */ - dev_dbg(dev,...
ec8f7d495b3d37c5f0d66cdc7e43ef76939293b6
Analyze and fix the following issue in the Linux kernel code: netlink: fix spelling mistake in dump size assert
Problem Details: Commit 2c7bc10d0f7b ("netlink: add macro for checking dump ctx size") misspelled the name of the assert as asset, missing an R. Reported-by: Ido Schimmel <idosch@idosch.org> Reviewed-by: Ido Schimmel <idosch@nvidia.com> Link: https://lore.kernel.org/r/20230123222224.732338-1-kuba@kernel.org Signed-off...
```diff diff --git a/include/linux/netlink.h b/include/linux/netlink.h index 38f6334f408c..fa4d86da0ec7 100644 --- a/include/linux/netlink.h +++ b/include/linux/netlink.h @@ -263,7 +263,7 @@ struct netlink_callback { }; }; -#define NL_ASSET_DUMP_CTX_FITS(type_name) \ +#define NL_ASSERT_DUMP_CTX_FITS(type_name) ...
ca0f2cfc495d9b614ac6431d7029f1f140403155
Analyze and fix the following issue in the Linux kernel code: lib: Kconfig: fix spellos
Problem Details: Fix spelling in lib/ Kconfig files. (reported by codespell) Link: https://lkml.kernel.org/r/20230124181655.16269-1-rdunlap@infradead.org Cc: Andrew Morton <akpm@linux-foundation.org> Cc: Marco Elver <elver@google.com> Cc: Dmitry Vyukov <dvyukov@google.com> Cc: kasan-dev@googlegroups.com Reviewed-by: ...
```diff diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug index 881c3f84e88a..6426dbf99c12 100644 --- a/lib/Kconfig.debug +++ b/lib/Kconfig.debug @@ -1917,7 +1917,7 @@ config FUNCTION_ERROR_INJECTION help Add fault injections into various functions that are annotated with ALLOW_ERROR_INJECTION() in the kerne...
6be1ff430dab9fc047762b10b2c9669399ea1f37
Analyze and fix the following issue in the Linux kernel code: riscv: pgtable: Fixup comment for KERN_VIRT_SIZE
Problem Details: KERN_VIRT_SIZE is 1/4 of the entries of the page global directory, not half. Fixes: f7ae02333d13 ("riscv: Move KASAN mapping next to the kernel mapping") Signed-off-by: Guo Ren <guoren@linux.alibaba.com> Signed-off-by: Guo Ren <guoren@kernel.org> Cc: Alexandre Ghiti <alexandre.ghiti@canonical.com> Rev...
```diff diff --git a/arch/riscv/include/asm/pgtable.h b/arch/riscv/include/asm/pgtable.h index 4eba9a98d0e3..2a88362dffa5 100644 --- a/arch/riscv/include/asm/pgtable.h +++ b/arch/riscv/include/asm/pgtable.h @@ -31,7 +31,7 @@ #define PTRS_PER_PTE (PAGE_SIZE / sizeof(pte_t)) /* - * Half of the kernel address space...
c54ba4178159e440bea3826d22d43a9d0d94b071
Analyze and fix the following issue in the Linux kernel code: selftests/nolibc: Add a "run-user" target to test the program in user land
Problem Details: When developing tests, it is much faster to use the QEMU Linux emulator instead of the system emulator, which among other things avoids kernel-build latencies. Although use of the QEMU Linux emulator does have its limitations (please see below), it is sufficient to test startup code, stdlib code, and ...
```diff diff --git a/tools/testing/selftests/nolibc/Makefile b/tools/testing/selftests/nolibc/Makefile index 423598045ff1..8fe61d3e3cce 100644 --- a/tools/testing/selftests/nolibc/Makefile +++ b/tools/testing/selftests/nolibc/Makefile @@ -80,6 +80,7 @@ help: @echo " help this help" @echo " sysroot cr...
8b152e9150d07a885f95e1fd401fc81af202d9a4
Analyze and fix the following issue in the Linux kernel code: trace_events_hist: add check for return value of 'create_hist_field'
Problem Details: Function 'create_hist_field' is called recursively at trace_events_hist.c:1954 and can return NULL-value that's why we have to check it to avoid null pointer dereference. Found by Linux Verification Center (linuxtesting.org) with SVACE. Link: https://lkml.kernel.org/r/20230111120409.4111-1-n.petrova@...
```diff diff --git a/kernel/trace/trace_events_hist.c b/kernel/trace/trace_events_hist.c index fcaf226b7744..5edbf6b1da3f 100644 --- a/kernel/trace/trace_events_hist.c +++ b/kernel/trace/trace_events_hist.c @@ -1988,6 +1988,8 @@ static struct hist_field *create_hist_field(struct hist_trigger_data *hist_data, hist_fi...
685b64e4d6da4be8b4595654a57db663b3d1dfc2
Analyze and fix the following issue in the Linux kernel code: tracing/osnoise: Use built-in RCU list checking
Problem Details: list_for_each_entry_rcu() has built-in RCU and lock checking. Pass cond argument to list_for_each_entry_rcu() to silence false lockdep warning when CONFIG_PROVE_RCU_LIST is enabled. Execute as follow: [tracing]# echo osnoise > current_tracer [tracing]# echo 1 > tracing_on [tracing]# echo 0 > trac...
```diff diff --git a/kernel/trace/trace_osnoise.c b/kernel/trace/trace_osnoise.c index 94c1b5eb1dc0..210e1f168392 100644 --- a/kernel/trace/trace_osnoise.c +++ b/kernel/trace/trace_osnoise.c @@ -147,9 +147,8 @@ static void osnoise_unregister_instance(struct trace_array *tr) * register/unregister serialization is pro...
941c95fdd61f4a0d2cd01520282a713962f485f6
Analyze and fix the following issue in the Linux kernel code: Docs/subsystem-apis: Remove '[The ]Linux' prefixes from titles of listed documents
Problem Details: Some documents that listed on subsystem-apis have 'Linux' or 'The Linux' title prefixes. It's duplicated information, and makes finding the document of interest with human eyes not easy. Remove the prefixes from the titles. Signed-off-by: SeongJae Park <sj@kernel.org> Acked-by: Iwona Winiarska <iwon...
```diff diff --git a/Documentation/PCI/index.rst b/Documentation/PCI/index.rst index c17c87af1968..e73f84aebde3 100644 --- a/Documentation/PCI/index.rst +++ b/Documentation/PCI/index.rst @@ -1,8 +1,8 @@ .. SPDX-License-Identifier: GPL-2.0 -======================= -Linux PCI Bus Subsystem -======================= +==...
c70313cd177d28ea15a3f5cb3e6f10292a782c63
Analyze and fix the following issue in the Linux kernel code: docs: accel: Fix debugfs path
Problem Details: The device specific directory in debugfs does not have "accel". For example, the documentation says device 0 should have a debugfs entry as /sys/kernel/debug/accel/accel0/ but in reality the entry is /sys/kernel/debug/accel/0/ Fix the documentation to match the implementation. Fixes: 8c5577a5ccc6 ("...
```diff diff --git a/Documentation/accel/introduction.rst b/Documentation/accel/introduction.rst index 6f31af14b1fc..11cade51f387 100644 --- a/Documentation/accel/introduction.rst +++ b/Documentation/accel/introduction.rst @@ -69,7 +69,7 @@ The accelerator devices will be exposed to the user space with the dedicated ...
015b5162be05b95bd97c8c4afc37b11ac6466900
Analyze and fix the following issue in the Linux kernel code: Documentation: kprobetrace: Fix code block markup
Problem Details: This display the following code extract as a code block instead of a normal paragraph. Signed-off-by: Yoann Congal <yoann.congal@smile.fr> Reviewed-by: Steven Rostedt (Google) <rostedt@goodmis.org> Acked-by: Masami Hiramatsu (Google) <mhiramat@kernel.org> Link: https://lore.kernel.org/r/20230121225304...
```diff diff --git a/Documentation/trace/kprobetrace.rst b/Documentation/trace/kprobetrace.rst index 5c49cdc8f832..febfd3792854 100644 --- a/Documentation/trace/kprobetrace.rst +++ b/Documentation/trace/kprobetrace.rst @@ -161,11 +161,11 @@ You can add and enable new kprobe events when booting up the kernel by "kprobe...
776b32b7567a7402e7d8f971ea88001a42829434
Analyze and fix the following issue in the Linux kernel code: Documentation: kprobetrace: Fix some typos
Problem Details: * Uncapitalise tracepoint * Hyphen in *-based * Plurals * fetch-args -> fetchargs * 2bytes hex -> 2-byte hex * .. -> . * arch -> architecture Signed-off-by: Yoann Congal <yoann.congal@smile.fr> Reviewed-by: Steven Rostedt (Google) <rostedt@goodmis.org> Acked-by: Masami Hiramatsu (Google) <mhiramat@ker...
```diff diff --git a/Documentation/trace/kprobetrace.rst b/Documentation/trace/kprobetrace.rst index 08a2a6a3782f..5c49cdc8f832 100644 --- a/Documentation/trace/kprobetrace.rst +++ b/Documentation/trace/kprobetrace.rst @@ -6,16 +6,16 @@ Kprobe-based Event Tracing Overview -------- -These events are similar to trace...
d9b6c322fd33d55a254756b0269d644851899e5f
Analyze and fix the following issue in the Linux kernel code: ARM: dts: aspeed: Fix pca9849 compatible
Problem Details: Missed a digit in the PCA9849 compatible string. Signed-off-by: Eddie James <eajames@linux.ibm.com> Fixes: 65b697e5dec7 ("ARM: dts: aspeed: Add IBM Bonnell system BMC devicetree") Link: https://lore.kernel.org/r/20220826194457.164492-1-eajames@linux.ibm.com Signed-off-by: Joel Stanley <joel@jms.id.au>...
```diff diff --git a/arch/arm/boot/dts/aspeed-bmc-ibm-bonnell.dts b/arch/arm/boot/dts/aspeed-bmc-ibm-bonnell.dts index d1971ddf06a5..7f755e5a4624 100644 --- a/arch/arm/boot/dts/aspeed-bmc-ibm-bonnell.dts +++ b/arch/arm/boot/dts/aspeed-bmc-ibm-bonnell.dts @@ -751,7 +751,7 @@ }; pca9849@75 { - compatible = "nxp,pc...
0254127ab977e70798707a7a2b757c9f3c971210
Analyze and fix the following issue in the Linux kernel code: module: Don't wait for GOING modules
Problem Details: During a system boot, it can happen that the kernel receives a burst of requests to insert the same module but loading it eventually fails during its init call. For instance, udev can make a request to insert a frequency module for each individual CPU when another frequency module is already loaded whi...
```diff diff --git a/kernel/module/main.c b/kernel/module/main.c index 48568a0f5651..4ac3fe43e6c8 100644 --- a/kernel/module/main.c +++ b/kernel/module/main.c @@ -2393,7 +2393,8 @@ static bool finished_loading(const char *name) sched_annotate_sleep(); mutex_lock(&module_mutex); mod = find_module_all(name, strlen(...
6757a7abe47bcb12cb2d45661067e182424b0ee3
Analyze and fix the following issue in the Linux kernel code: thermal: intel: int340x: Protect trip temperature from concurrent updates
Problem Details: Trip temperatures are read using ACPI methods and stored in the memory during zone initializtion and when the firmware sends a notification for change. This trip temperature is returned when the thermal core calls via callback get_trip_temp(). But it is possible that while updating the memory copy of ...
```diff diff --git a/drivers/thermal/intel/int340x_thermal/int340x_thermal_zone.c b/drivers/thermal/intel/int340x_thermal/int340x_thermal_zone.c index 62c0aa5d0783..852f6c579af5 100644 --- a/drivers/thermal/intel/int340x_thermal/int340x_thermal_zone.c +++ b/drivers/thermal/intel/int340x_thermal/int340x_thermal_zone.c @...
5a5754a4997c372292e57ed631807131c63cebaf
Analyze and fix the following issue in the Linux kernel code: nvme-pci: flush initial scan_work for async probe
Problem Details: The nvme device may have a namespace with the root partition, so make sure we've completed scanning before returning from the async probe. Fixes: eac3ef262941 ("nvme-pci: split the initial probe from the rest path") Reported-by: Klaus Jensen <its@irrelevant.dk> Signed-off-by: Keith Busch <kbusch@kerne...
```diff diff --git a/drivers/nvme/host/pci.c b/drivers/nvme/host/pci.c index 1ff8843bc4b3..c734934c407c 100644 --- a/drivers/nvme/host/pci.c +++ b/drivers/nvme/host/pci.c @@ -3102,6 +3102,7 @@ static int nvme_probe(struct pci_dev *pdev, const struct pci_device_id *id) nvme_start_ctrl(&dev->ctrl); nvme_put_ctrl(&d...
478f32ab4daae8a9bae3723d1040c6e4e3a09bc5
Analyze and fix the following issue in the Linux kernel code: platform/chrome: cros_typec_vdm: Fix VDO copy
Problem Details: The usage of memcpy() affects the representation of the VDOs as they are copied to the EC Host Command buffer. Specifically, all higher order bits get dropped (for example: a VDO of 0x406 just gets copied as 0x6). Avoid this by explicitly copying each VDO in the array. The number of VDOs generated by ...
```diff diff --git a/drivers/platform/chrome/cros_typec_vdm.c b/drivers/platform/chrome/cros_typec_vdm.c index aca9d337118e..06f4a55999c5 100644 --- a/drivers/platform/chrome/cros_typec_vdm.c +++ b/drivers/platform/chrome/cros_typec_vdm.c @@ -86,10 +86,12 @@ static int cros_typec_port_amode_vdm(struct typec_altmode *am...
11633f69506d038120925691626f2851203af241
Analyze and fix the following issue in the Linux kernel code: KVM: VMX: Always inline eVMCS read/write helpers
Problem Details: Tag all evmcs_{read,write}() helpers __always_inline so that they can be freely used in noinstr sections, e.g. to get the VM-Exit reason in vcpu_vmx_enter_exit() (in a future patch). For consistency and to avoid more spot fixes in the future, e.g. see commit 010050a86393 ("x86/kvm: Always inline evmcs...
```diff diff --git a/arch/x86/kvm/vmx/hyperv.h b/arch/x86/kvm/vmx/hyperv.h index ab08a9b9ab7d..caf658726169 100644 --- a/arch/x86/kvm/vmx/hyperv.h +++ b/arch/x86/kvm/vmx/hyperv.h @@ -196,7 +196,7 @@ static __always_inline void evmcs_write64(unsigned long field, u64 value) current_evmcs->hv_clean_fields &= ~clean_fiel...
fc9465be8aad2042978590d44c01350534c1ac11
Analyze and fix the following issue in the Linux kernel code: KVM: x86: Make vmx_get_exit_qual() and vmx_get_intr_info() noinstr-friendly
Problem Details: Add an extra special noinstr-friendly helper to test+mark a "register" available and use it when caching vmcs.EXIT_QUALIFICATION and vmcs.VM_EXIT_INTR_INFO. Make the caching helpers __always_inline too so that they can be used in noinstr functions. A future fix will move VMX's handling of NMI exits i...
```diff diff --git a/arch/x86/kvm/kvm_cache_regs.h b/arch/x86/kvm/kvm_cache_regs.h index c09174f73a34..4c91f626c058 100644 --- a/arch/x86/kvm/kvm_cache_regs.h +++ b/arch/x86/kvm/kvm_cache_regs.h @@ -75,6 +75,18 @@ static inline void kvm_register_mark_dirty(struct kvm_vcpu *vcpu, __set_bit(reg, (unsigned long *)&vcpu-...
acd82cb42bd7cbffeaab15818b4334159b6f6e5a
Analyze and fix the following issue in the Linux kernel code: drm/amd/display: 3.2.220
Problem Details: This version brings along following fixes: - Fix timing not changning when freesync video is enabled - avoid disable otg when dig was disabled - Properly reuse completion structure - Pass DSC slice height to PSR FW - merge dc_link_dp into dc_link - move dp cts functions from dc_link_dp to link_dp_cts -...
```diff diff --git a/drivers/gpu/drm/amd/display/dc/dc.h b/drivers/gpu/drm/amd/display/dc/dc.h index e967455ed0c7..42ce45306483 100644 --- a/drivers/gpu/drm/amd/display/dc/dc.h +++ b/drivers/gpu/drm/amd/display/dc/dc.h @@ -47,7 +47,7 @@ struct aux_payload; struct set_config_cmd_payload; struct dmub_notification; -#...
0f5f1ee45ff8e76916be2290ef91cc2234450ccb
Analyze and fix the following issue in the Linux kernel code: drm/amd/display: Fix timing not changning when freesync video is enabled
Problem Details: [Why&How] Switching between certain modes that are freesync video modes and those are not freesync video modes result in timing not changing as seen by the monitor due to incorrect timing being driven. The issue is fixed by ensuring that when a non freesync video mode is set, we reset the freesync sta...
```diff diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c index ff0085c455e3..bbe4486fda42 100644 --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c @@ -9073,6 +9073,13 @@ static int dm_update_c...
e019a7ba38fba807076c501deb757ed18cd6a0df
Analyze and fix the following issue in the Linux kernel code: drm/amd/display: 3.2.219
Problem Details: This version brings along following fixes: - [FW Promotion] Release 0.0.150.0 - Correcting prefetch mode for fast validate - Set hvm_enabled flag for S/G mode - set allow_freesync parameter in DM - Revert "ignore msa parameter only if freesync is enabled" - Allow idle optimization after turning off all...
```diff diff --git a/drivers/gpu/drm/amd/display/dc/dc.h b/drivers/gpu/drm/amd/display/dc/dc.h index 22e754ad22c8..7105bc5c43d8 100644 --- a/drivers/gpu/drm/amd/display/dc/dc.h +++ b/drivers/gpu/drm/amd/display/dc/dc.h @@ -47,7 +47,7 @@ struct aux_payload; struct set_config_cmd_payload; struct dmub_notification; -#...
9b2d019144a00627ed95cc1f664fc681b6fe1c7d
Analyze and fix the following issue in the Linux kernel code: drm/display/dp_mst: Correct the kref of port.
Problem Details: [why & how] We still need to refer to port while removing payload at commit_tail. we should keep the kref till then to release. Bug: https://gitlab.freedesktop.org/drm/amd/-/issues/2171 Signed-off-by: Wayne Lin <Wayne.Lin@amd.com> Signed-off-by: Harry Wentland <harry.wentland@amd.com> Fixes: 4d07b0bc4...
```diff diff --git a/drivers/gpu/drm/display/drm_dp_mst_topology.c b/drivers/gpu/drm/display/drm_dp_mst_topology.c index 51a46689cda7..4ca37261584a 100644 --- a/drivers/gpu/drm/display/drm_dp_mst_topology.c +++ b/drivers/gpu/drm/display/drm_dp_mst_topology.c @@ -3372,6 +3372,9 @@ void drm_dp_remove_payload(struct drm_d...
d987150b539271b0394f24c1c648d2846662adb4
Analyze and fix the following issue in the Linux kernel code: drm/drm_print: correct format problem
Problem Details: [why & how] __drm_dbg() parameter set format is wrong and not aligned with the format under CONFIG_DRM_USE_DYNAMIC_DEBUG is on. Fix it. Signed-off-by: Wayne Lin <Wayne.Lin@amd.com> Signed-off-by: Harry Wentland <harry.wentland@amd.com> Acked-by: Harry Wentland <harry.wentland@amd.com> Reviewed-by: Lyu...
```diff diff --git a/include/drm/drm_print.h b/include/drm/drm_print.h index a44fb7ef257f..094ded23534c 100644 --- a/include/drm/drm_print.h +++ b/include/drm/drm_print.h @@ -521,7 +521,7 @@ __printf(1, 2) void __drm_err(const char *format, ...); #if !defined(CONFIG_DRM_USE_DYNAMIC_DEBUG) -#define __drm_dbg(fmt, .....
2daeb74b7d66362de8e15b983e310e85f01930e5
Analyze and fix the following issue in the Linux kernel code: drm/amdgpu/display/mst: update mst_mgr relevant variable when long HPD
Problem Details: [Why & How] Now the vc_start_slot is controlled at drm side. When we service a long HPD, we still need to run dm_helpers_dp_mst_write_payload_allocation_table() to update drm mst_mgr's relevant variable. Otherwise, on the next plug-in, payload will get assigned with a wrong start slot. Bug: https://gi...
```diff diff --git a/drivers/gpu/drm/amd/display/dc/core/dc_link.c b/drivers/gpu/drm/amd/display/dc/core/dc_link.c index d9e490eca10f..bf5a31e2be8a 100644 --- a/drivers/gpu/drm/amd/display/dc/core/dc_link.c +++ b/drivers/gpu/drm/amd/display/dc/core/dc_link.c @@ -3999,10 +3999,13 @@ static enum dc_status deallocate_mst_...
ea38dd57b0a65a7d434a7d9528c7b0445a5ea3ed
Analyze and fix the following issue in the Linux kernel code: drm/amdgpu/display/mst: limit payload to be updated one by one
Problem Details: [Why] amdgpu expects to update payload table for one stream one time by calling dm_helpers_dp_mst_write_payload_allocation_table(). Currently, it get modified to try to update HW payload table at once by referring mst_state. [How] This is just a quick workaround. Should find way to remove the temporar...
```diff diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c index f8882c324ba6..0b1d1bb8cbc7 100644 --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c @@ -123,23 +1...
c689e1e362ea29d10fbd9a5e94b17be991d0e231
Analyze and fix the following issue in the Linux kernel code: drm/amdgpu/display/mst: Fix mst_state->pbn_div and slot count assignments
Problem Details: Looks like I made a pretty big mistake here without noticing: it seems when I moved the assignments of mst_state->pbn_div I completely missed the fact that the reason for us calling drm_dp_mst_update_slots() earlier was to account for the fact that we need to call this function using info from the root...
```diff diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c index 39513a6d2244..2122c2be269b 100644 --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c @@ -9683,6 +9683,8 @@ static int amdgpu_dm_at...
ac28d0a0f40782d216f6aaaf22e0d8bded06a435
Analyze and fix the following issue in the Linux kernel code: tracing: Kconfig: Fix spelling/grammar/punctuation
Problem Details: Fix some editorial nits in trace Kconfig. Link: https://lkml.kernel.org/r/20230124181647.15902-1-rdunlap@infradead.org Signed-off-by: Randy Dunlap <rdunlap@infradead.org> Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
```diff diff --git a/kernel/trace/Kconfig b/kernel/trace/Kconfig index 197545241ab8..d7043043f59c 100644 --- a/kernel/trace/Kconfig +++ b/kernel/trace/Kconfig @@ -933,8 +933,8 @@ config RING_BUFFER_RECORD_RECURSION default y help The ring buffer has its own internal recursion. Although when - recursion happen...
7ae4ba7195b1bac04a4210a499da9d8c63b0ba9c
Analyze and fix the following issue in the Linux kernel code: ftrace/scripts: Update the instructions for ftrace-bisect.sh
Problem Details: The instructions for the ftrace-bisect.sh script, which is used to find what function is being traced that is causing a kernel crash, and possibly a triple fault reboot, uses the old method. In 5.1, a new feature was added that let the user write in the index into available_filter_functions that maps t...
```diff diff --git a/scripts/tracing/ftrace-bisect.sh b/scripts/tracing/ftrace-bisect.sh index 926701162bc8..bb4f59262bbe 100755 --- a/scripts/tracing/ftrace-bisect.sh +++ b/scripts/tracing/ftrace-bisect.sh @@ -12,7 +12,7 @@ # (note, if this is a problem with function_graph tracing, then simply # replace "functi...
a31b531cd2fa2e6b2a736833a94b990d5cf56b40
Analyze and fix the following issue in the Linux kernel code: KVM: SVM: Account scratch allocations used to decrypt SEV guest memory
Problem Details: Account the temp/scratch allocation used to decrypt unaligned debug accesses to SEV guest memory, the allocation is very much tied to the target VM. Reported-by: Mingwei Zhang <mizhang@google.com> Signed-off-by: Anish Ghulati <aghulati@google.com> Link: https://lore.kernel.org/r/20230113220923.2834699...
```diff diff --git a/arch/x86/kvm/svm/sev.c b/arch/x86/kvm/svm/sev.c index 273cba809328..a5e4c5ef7c9e 100644 --- a/arch/x86/kvm/svm/sev.c +++ b/arch/x86/kvm/svm/sev.c @@ -813,7 +813,7 @@ static int __sev_dbg_decrypt_user(struct kvm *kvm, unsigned long paddr, if (!IS_ALIGNED(dst_paddr, 16) || !IS_ALIGNED(paddr, ...
78332517a5dab54514ae719805eec218715de1fc
Analyze and fix the following issue in the Linux kernel code: KVM: selftests: Stop assuming stats are contiguous in kvm_binary_stats_test
Problem Details: Remove the assumption from kvm_binary_stats_test that all stats are laid out contiguously in memory. The current stats in KVM are contiguously laid out in memory, but that may change in the future and the ABI specifically allows holes in the stats data (since each stat exposes its own offset). While h...
```diff diff --git a/tools/testing/selftests/kvm/kvm_binary_stats_test.c b/tools/testing/selftests/kvm/kvm_binary_stats_test.c index 894417c96f70..a7001e29dc06 100644 --- a/tools/testing/selftests/kvm/kvm_binary_stats_test.c +++ b/tools/testing/selftests/kvm/kvm_binary_stats_test.c @@ -134,7 +134,7 @@ static void stats...
e99b0d4cc2b679c5892d0994610b44e7b584d98b
Analyze and fix the following issue in the Linux kernel code: KVM: selftests: x86: Use "this_cpu" prefix for cpu vendor queries
Problem Details: Replace is_intel/amd_cpu helpers with this_cpu_* helpers to better convey the intent of querying vendor of the current cpu. Suggested-by: Sean Christopherson <seanjc@google.com> Reviewed-by: David Matlack <dmatlack@google.com> Signed-off-by: Vishal Annapurve <vannapurve@google.com> Link: https://lore....
```diff diff --git a/tools/testing/selftests/kvm/include/x86_64/processor.h b/tools/testing/selftests/kvm/include/x86_64/processor.h index bbe47e6707eb..b5ea72f79540 100644 --- a/tools/testing/selftests/kvm/include/x86_64/processor.h +++ b/tools/testing/selftests/kvm/include/x86_64/processor.h @@ -555,6 +555,28 @@ stat...
ca17899693518acde9ba1adcf46b95d76286106d
Analyze and fix the following issue in the Linux kernel code: KVM: selftests: Fix a typo in the vcpu_msrs_set assert
Problem Details: The assert incorrectly identifies the ioctl being called. Switch it from KVM_GET_MSRS to KVM_SET_MSRS. Fixes: 6ebfef83f03f ("KVM: selftest: Add proper helpers for x86-specific save/restore ioctls") Signed-off-by: Aaron Lewis <aaronlewis@google.com> Reviewed-by: Jim Mattson <jmattson@google.com> Revie...
```diff diff --git a/tools/testing/selftests/kvm/include/x86_64/processor.h b/tools/testing/selftests/kvm/include/x86_64/processor.h index 2a5f47d51388..bbe47e6707eb 100644 --- a/tools/testing/selftests/kvm/include/x86_64/processor.h +++ b/tools/testing/selftests/kvm/include/x86_64/processor.h @@ -717,7 +717,7 @@ stati...
bf10993313e909bbf928bc40fd03141ffe23c7ec
Analyze and fix the following issue in the Linux kernel code: KVM: selftests: kvm_vm_elf_load() and elfhdr_get() should close fd
Problem Details: kvm_vm_elf_load() and elfhdr_get() open one file each, but they never close the opened file descriptor. If a test repeatedly creates and destroys a VM with __vm_create(), which (directly or indirectly) calls those two functions, the test might end up getting a open failure with EMFILE. Fix those two f...
```diff diff --git a/tools/testing/selftests/kvm/lib/elf.c b/tools/testing/selftests/kvm/lib/elf.c index 820ac2d08c98..266f3876e10a 100644 --- a/tools/testing/selftests/kvm/lib/elf.c +++ b/tools/testing/selftests/kvm/lib/elf.c @@ -90,6 +90,7 @@ static void elfhdr_get(const char *filename, Elf64_Ehdr *hdrp) " hdrp->...
6a5cba7bed35580effda9fb1872b274da47e6b23
Analyze and fix the following issue in the Linux kernel code: KVM: x86/pmu: Correct the mask used in a pmu event filter lookup
Problem Details: When checking if a pmu event the guest is attempting to program should be filtered, only consider the event select + unit mask in that decision. Use an architecture specific mask to mask out all other bits, including bits 35:32 on Intel. Those bits are not part of the event select and should not be co...
```diff diff --git a/arch/x86/kvm/pmu.c b/arch/x86/kvm/pmu.c index d939d3b84e6f..f5b933eeb549 100644 --- a/arch/x86/kvm/pmu.c +++ b/arch/x86/kvm/pmu.c @@ -279,7 +279,8 @@ static bool check_pmu_event_filter(struct kvm_pmc *pmc) goto out; if (pmc_is_gp(pmc)) { - key = pmc->eventsel & AMD64_RAW_EVENT_MASK_NB; + k...
3cdf93746f9a9a8a81b044219dcf51ce98bd0abf
Analyze and fix the following issue in the Linux kernel code: KVM: x86/mmu: Fix wrong gfn range of tlb flushing in validate_direct_spte()
Problem Details: The spte pointing to the children SP is dropped, so the whole gfn range covered by the children SP should be flushed. Although, Hyper-V may treat a 1-page flush the same if the address points to a huge page, it still would be better to use the correct size of huge page. Fixes: c3134ce240eed ("KVM: Rep...
```diff diff --git a/arch/x86/kvm/mmu/mmu.c b/arch/x86/kvm/mmu/mmu.c index 5e34f07e46ba..47b15c146ba5 100644 --- a/arch/x86/kvm/mmu/mmu.c +++ b/arch/x86/kvm/mmu/mmu.c @@ -2414,7 +2414,7 @@ static void validate_direct_spte(struct kvm_vcpu *vcpu, u64 *sptep, return; drop_parent_pte(child, sptep); - kvm_flush_re...
1b2dc7360463932d2e7cac9461de16ce6fa11cb7
Analyze and fix the following issue in the Linux kernel code: KVM: x86/mmu: Fix wrong start gfn of tlb flushing with range
Problem Details: When a spte is dropped, the start gfn of tlb flushing should be the gfn of spte not the base gfn of SP which contains the spte. Also introduce a helper function to do range-based flushing when a spte is dropped, which would help prevent future buggy use of kvm_flush_remote_tlbs_with_address() in such c...
```diff diff --git a/arch/x86/kvm/mmu/mmu.c b/arch/x86/kvm/mmu/mmu.c index 52be98e0102a..5e34f07e46ba 100644 --- a/arch/x86/kvm/mmu/mmu.c +++ b/arch/x86/kvm/mmu/mmu.c @@ -269,6 +269,17 @@ void kvm_flush_remote_tlbs_with_address(struct kvm *kvm, kvm_flush_remote_tlbs_with_range(kvm, &range); } +static gfn_t kvm_mmu...
1e203847aa9245bd782d6dc904ece124ca1b89cb
Analyze and fix the following issue in the Linux kernel code: KVM: x86/mmu: Reduce gfn range of tlb flushing in tdp_mmu_map_handle_target_level()
Problem Details: Since the children SP is zapped, the gfn range of tlb flushing should be the range covered by children SP not parent SP. Replace sp->gfn which is the base gfn of parent SP with iter->gfn and use the correct size of gfn range for children SP to reduce tlb flushing range. Fixes: bb95dfb9e2df ("KVM: x86/...
```diff diff --git a/arch/x86/kvm/mmu/tdp_mmu.c b/arch/x86/kvm/mmu/tdp_mmu.c index bba33aea0fb0..ce2f86f8a3a5 100644 --- a/arch/x86/kvm/mmu/tdp_mmu.c +++ b/arch/x86/kvm/mmu/tdp_mmu.c @@ -1080,8 +1080,7 @@ static int tdp_mmu_map_handle_target_level(struct kvm_vcpu *vcpu, return RET_PF_RETRY; else if (is_shadow_pres...
9ffe9265375cbaf6c01647e31ae9fee8595b698c
Analyze and fix the following issue in the Linux kernel code: KVM: x86/mmu: Fix wrong gfn range of tlb flushing in kvm_set_pte_rmapp()
Problem Details: When the spte of hupe page is dropped in kvm_set_pte_rmapp(), the whole gfn range covered by the spte should be flushed. However, rmap_walk_init_level() doesn't align down the gfn for new level like tdp iterator does, then the gfn used in kvm_set_pte_rmapp() is not the base gfn of huge page. And the si...
```diff diff --git a/arch/x86/kvm/mmu/mmu.c b/arch/x86/kvm/mmu/mmu.c index f3bef56a89a3..52be98e0102a 100644 --- a/arch/x86/kvm/mmu/mmu.c +++ b/arch/x86/kvm/mmu/mmu.c @@ -1469,7 +1469,7 @@ restart: } if (need_flush && kvm_available_flush_tlb_with_range()) { - kvm_flush_remote_tlbs_with_address(kvm, gfn, 1); + k...
c667a3baeddcc982bf512c126aec8d0f04adecfe
Analyze and fix the following issue in the Linux kernel code: KVM: x86/mmu: Move round_gfn_for_level() helper into mmu_internal.h
Problem Details: Rounding down the GFN to a huge page size is a common pattern throughout KVM, so move round_gfn_for_level() helper in tdp_iter.c to mmu_internal.h for common usage. Also rename it as gfn_round_for_level() to use gfn_* prefix and clean up the other call sites. Signed-off-by: Hou Wenlong <houwenlong.hwl...
```diff diff --git a/arch/x86/kvm/mmu/mmu.c b/arch/x86/kvm/mmu/mmu.c index d43952fb05a6..f3bef56a89a3 100644 --- a/arch/x86/kvm/mmu/mmu.c +++ b/arch/x86/kvm/mmu/mmu.c @@ -3169,7 +3169,7 @@ static int direct_map(struct kvm_vcpu *vcpu, struct kvm_page_fault *fault) if (fault->nx_huge_page_workaround_enabled) disal...
a7e48ef77ff27ba2647edec271b302804a0b14c3
Analyze and fix the following issue in the Linux kernel code: KVM: x86/mmu: fix an incorrect comment in kvm_mmu_new_pgd()
Problem Details: There is no function named kvm_mmu_ensure_valid_pgd(). Fix the comment and remove the pair of braces to conform to Linux kernel coding style. Signed-off-by: Wei Liu <wei.liu@kernel.org> Reviewed-by: Sean Christopherson <seanjc@google.com> Link: https://lore.kernel.org/r/20221128214709.224710-1-wei.li...
```diff diff --git a/arch/x86/kvm/mmu/mmu.c b/arch/x86/kvm/mmu/mmu.c index aeb240b339f5..d43952fb05a6 100644 --- a/arch/x86/kvm/mmu/mmu.c +++ b/arch/x86/kvm/mmu/mmu.c @@ -4556,10 +4556,12 @@ void kvm_mmu_new_pgd(struct kvm_vcpu *vcpu, gpa_t new_pgd) struct kvm_mmu *mmu = vcpu->arch.mmu; union kvm_mmu_page_role new_...
a2b07fa7b93321c059af0c6d492cc9a4f1e390aa
Analyze and fix the following issue in the Linux kernel code: x86/reboot: Disable SVM, not just VMX, when stopping CPUs
Problem Details: Disable SVM and more importantly force GIF=1 when halting a CPU or rebooting the machine. Similar to VMX, SVM allows software to block INITs via CLGI, and thus can be problematic for a crash/reboot. The window for failure is smaller with SVM as INIT is only blocked while GIF=0, i.e. between CLGI and ...
```diff diff --git a/arch/x86/kernel/smp.c b/arch/x86/kernel/smp.c index 06db901fabe8..375b33ecafa2 100644 --- a/arch/x86/kernel/smp.c +++ b/arch/x86/kernel/smp.c @@ -32,7 +32,7 @@ #include <asm/mce.h> #include <asm/trace/irq_vectors.h> #include <asm/kexec.h> -#include <asm/virtext.h> +#include <asm/reboot.h> /* ...
26044aff37a5455b19a91785086914fd33053ef4
Analyze and fix the following issue in the Linux kernel code: x86/crash: Disable virt in core NMI crash handler to avoid double shootdown
Problem Details: Disable virtualization in crash_nmi_callback() and rework the emergency_vmx_disable_all() path to do an NMI shootdown if and only if a shootdown has not already occurred. NMI crash shootdown fundamentally can't support multiple invocations as responding CPUs are deliberately put into halt state witho...
```diff diff --git a/arch/x86/include/asm/reboot.h b/arch/x86/include/asm/reboot.h index 04c17be9b5fd..bc5b4d788c08 100644 --- a/arch/x86/include/asm/reboot.h +++ b/arch/x86/include/asm/reboot.h @@ -25,6 +25,8 @@ void __noreturn machine_real_restart(unsigned int type); #define MRR_BIOS 0 #define MRR_APM 1 +void cp...
b9926482ab91cd6dc19e28ae4f0ae98c6c1217d7
Analyze and fix the following issue in the Linux kernel code: kvm_host.h: fix spelling typo in function declaration
Problem Details: Make parameters in function declaration consistent with those in function definition for better cscope-ability Signed-off-by: Wang Liang <wangliangzz@inspur.com> Reviewed-by: Sean Christopherson <seanjc@google.com> Link: https://lore.kernel.org/r/20220920060210.4842-1-wangliangzz@126.com Signed-off-by...
```diff diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h index c2bd15204c3f..a7d6a6111f5e 100644 --- a/include/linux/kvm_host.h +++ b/include/linux/kvm_host.h @@ -1353,7 +1353,7 @@ void kvm_arch_vcpu_unblocking(struct kvm_vcpu *vcpu); bool kvm_vcpu_wake_up(struct kvm_vcpu *vcpu); void kvm_vcpu_kick(st...
02efd818a6c095bcbf422f47fccc4ef27d53f344
Analyze and fix the following issue in the Linux kernel code: KVM: VMX: Intercept reads to invalid and write-only x2APIC registers
Problem Details: Intercept reads to invalid (non-existent) and write-only x2APIC registers when configuring VMX's MSR bitmaps for x2APIC+APICv. When APICv is fully enabled, Intel hardware doesn't validate the registers on RDMSR and instead blindly retrieves data from the vAPIC page, i.e. it's software's responsibility...
```diff diff --git a/arch/x86/kvm/vmx/vmx.c b/arch/x86/kvm/vmx/vmx.c index 82c61c16f8f5..1be2bc7185be 100644 --- a/arch/x86/kvm/vmx/vmx.c +++ b/arch/x86/kvm/vmx/vmx.c @@ -4031,7 +4031,7 @@ static void vmx_update_msr_bitmap_x2apic(struct kvm_vcpu *vcpu) u64 *msr_bitmap = (u64 *)vmx->vmcs01.msr_bitmap; u8 mode; - i...
c39857ce8daaaa429ccae2a393301ffeed67e235
Analyze and fix the following issue in the Linux kernel code: KVM: VMX: Always intercept accesses to unsupported "extended" x2APIC regs
Problem Details: Don't clear the "read" bits for x2APIC registers above SELF_IPI (APIC regs 0x400 - 0xff0, MSRs 0x840 - 0x8ff). KVM doesn't emulate registers in that space (there are a smattering of AMD-only extensions) and so should intercept reads in order to inject #GP. When APICv is fully enabled, Intel hardware ...
```diff diff --git a/arch/x86/kvm/vmx/vmx.c b/arch/x86/kvm/vmx/vmx.c index c788aa382611..82c61c16f8f5 100644 --- a/arch/x86/kvm/vmx/vmx.c +++ b/arch/x86/kvm/vmx/vmx.c @@ -4018,26 +4018,17 @@ void vmx_enable_intercept_for_msr(struct kvm_vcpu *vcpu, u32 msr, int type) vmx_set_msr_bitmap_write(msr_bitmap, msr); } -s...
b223649576fc21bec46260805c2cd70e1cb3b8e8
Analyze and fix the following issue in the Linux kernel code: KVM: x86: Mark x2APIC DFR reg as non-existent for x2APIC
Problem Details: Mark APIC_DFR as being invalid/non-existent in x2APIC mode instead of handling it as a one-off check in kvm_x2apic_msr_read(). This will allow reusing "valid_reg_mask" to generate VMX's interception bitmaps for x2APIC. Handling DFR in the common read path may also fix the Hyper-V PV MSR interface, if...
```diff diff --git a/arch/x86/kvm/lapic.c b/arch/x86/kvm/lapic.c index 814b65106057..91e6f958d4b2 100644 --- a/arch/x86/kvm/lapic.c +++ b/arch/x86/kvm/lapic.c @@ -1573,7 +1573,6 @@ static int kvm_lapic_reg_read(struct kvm_lapic *apic, u32 offset, int len, APIC_REG_MASK(APIC_TASKPRI) | APIC_REG_MASK(APIC_PROCPRI) ...
ab52be1b310bcb39e6745d34a8f0e8475d67381a
Analyze and fix the following issue in the Linux kernel code: KVM: x86: Inject #GP on x2APIC WRMSR that sets reserved bits 63:32
Problem Details: Reject attempts to set bits 63:32 for 32-bit x2APIC registers, i.e. all x2APIC registers except ICR. Per Intel's SDM: Non-zero writes (by WRMSR instruction) to reserved bits to these registers will raise a general protection fault exception Opportunistically fix a typo in a nearby comment. Repo...
```diff diff --git a/arch/x86/kvm/lapic.c b/arch/x86/kvm/lapic.c index 9aca006b2d22..814b65106057 100644 --- a/arch/x86/kvm/lapic.c +++ b/arch/x86/kvm/lapic.c @@ -3114,13 +3114,17 @@ static int kvm_lapic_msr_read(struct kvm_lapic *apic, u32 reg, u64 *data) static int kvm_lapic_msr_write(struct kvm_lapic *apic, u32 reg...
7cb79f433e75b05d1635aefaa851cfcd1cb7dc4f
Analyze and fix the following issue in the Linux kernel code: KVM: PPC: Fix refactoring goof in kvmppc_e500mc_init()
Problem Details: Fix a build error due to a mixup during a recent refactoring. The error was reported during code review, but the fixed up patch didn't make it into the final commit. Fixes: 474856bad921 ("KVM: PPC: Move processor compatibility check to module init") Link: https://lore.kernel.org/all/87cz93snqc.fsf@mp...
```diff diff --git a/arch/powerpc/kvm/booke.c b/arch/powerpc/kvm/booke.c index 0dce93ccaadf..96a4803ba31c 100644 --- a/arch/powerpc/kvm/booke.c +++ b/arch/powerpc/kvm/booke.c @@ -1211,7 +1211,7 @@ int kvmppc_handle_exit(struct kvm_vcpu *vcpu, unsigned int exit_nr) /* * On cores with Vector category, KVM is loaded ...
921deb9da15851425ccbb6ee409dc2fd8fbdfe6b
Analyze and fix the following issue in the Linux kernel code: usb: gadget: f_fs: Fix unbalanced spinlock in __ffs_ep0_queue_wait
Problem Details: __ffs_ep0_queue_wait executes holding the spinlock of &ffs->ev.waitq.lock and unlocks it after the assignments to usb_request are done. However in the code if the request is already NULL we bail out returning -EINVAL but never unlocked the spinlock. Fix this by adding spin_unlock_irq &ffs->ev.waitq.lo...
```diff diff --git a/drivers/usb/gadget/function/f_fs.c b/drivers/usb/gadget/function/f_fs.c index 523a961b910b..8ad354741380 100644 --- a/drivers/usb/gadget/function/f_fs.c +++ b/drivers/usb/gadget/function/f_fs.c @@ -279,8 +279,10 @@ static int __ffs_ep0_queue_wait(struct ffs_data *ffs, char *data, size_t len) stru...
eb320f76e31dc835b9f57f04af1a2353b13bb7d8
Analyze and fix the following issue in the Linux kernel code: usb: dwc3: qcom: enable vbus override when in OTG dr-mode
Problem Details: With vbus override enabled when in OTG dr_mode, Host<->Peripheral switch now works on SM8550, otherwise the DWC3 seems to be stuck in Host mode only. Fixes: a4333c3a6ba9 ("usb: dwc3: Add Qualcomm DWC3 glue driver") Reviewed-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org> Signed-off-by: Neil Armstron...
```diff diff --git a/drivers/usb/dwc3/dwc3-qcom.c b/drivers/usb/dwc3/dwc3-qcom.c index b0a0351d2d8b..959fc925ca7c 100644 --- a/drivers/usb/dwc3/dwc3-qcom.c +++ b/drivers/usb/dwc3/dwc3-qcom.c @@ -901,7 +901,7 @@ static int dwc3_qcom_probe(struct platform_device *pdev) qcom->mode = usb_get_dr_mode(&qcom->dwc3->dev); ...
e55f67391fa986f7357edba0ca59e668d99c3a5f
Analyze and fix the following issue in the Linux kernel code: fotg210-udc: Add missing completion handler
Problem Details: This is used when responding to GET_STATUS requests. Without this, it crashes on completion. Fixes: b84a8dee23fd ("usb: gadget: add Faraday fotg210_udc driver") Signed-off-by: Fabian Vogt <fabian@ritter-vogt.de> Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Link: https://lore.kernel.org/r/20...
```diff diff --git a/drivers/usb/fotg210/fotg210-udc.c b/drivers/usb/fotg210/fotg210-udc.c index 4334504fccc8..53b7d078a54d 100644 --- a/drivers/usb/fotg210/fotg210-udc.c +++ b/drivers/usb/fotg210/fotg210-udc.c @@ -709,6 +709,20 @@ static int fotg210_is_epnstall(struct fotg210_ep *ep) return value & INOUTEPMPSR_STL_E...
3bb06eb6e9acf7c4a3e1b5bc87aed398ff8e2253
Analyze and fix the following issue in the Linux kernel code: tracing: Make sure trace_printk() can output as soon as it can be used
Problem Details: Currently trace_printk() can be used as soon as early_trace_init() is called from start_kernel(). But if a crash happens, and "ftrace_dump_on_oops" is set on the kernel command line, all you get will be: [ 0.456075] <idle>-0 0dN.2. 347519us : Unknown type 6 [ 0.456075] <idle>-0 ...
```diff diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c index a555a861b978..78ed5f1baa8c 100644 --- a/kernel/trace/trace.c +++ b/kernel/trace/trace.c @@ -10295,6 +10295,8 @@ void __init early_trace_init(void) static_key_enable(&tracepoint_printk_key.key); } tracer_alloc_buffers(); + + init_events(); }...
8be9fbd5345da52f4a74f7f81d55ff9fa0a2958e
Analyze and fix the following issue in the Linux kernel code: ftrace: Export ftrace_free_filter() to modules
Problem Details: Setting filters on an ftrace ops results in some memory being allocated for the filter hashes, which must be freed before the ops can be freed. This can be done by removing every individual element of the hash by calling ftrace_set_filter_ip() or ftrace_set_filter_ips() with `remove` set, but this is s...
```diff diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c index 442438b93fe9..750aa3f08b25 100644 --- a/kernel/trace/ftrace.c +++ b/kernel/trace/ftrace.c @@ -1248,12 +1248,17 @@ static void free_ftrace_hash_rcu(struct ftrace_hash *hash) call_rcu(&hash->rcu, __free_ftrace_hash_rcu); } +/** + * ftrace_free_...
0eb9d19e2201068260e439a5c96dc85f9f3722a2
Analyze and fix the following issue in the Linux kernel code: bpf, docs: Fix modulo zero, division by zero, overflow, and underflow
Problem Details: Fix modulo zero, division by zero, overflow, and underflow. Also clarify how a negative immediate value is used in unsigned division. Signed-off-by: Dave Thaler <dthaler@microsoft.com> Signed-off-by: Daniel Borkmann <daniel@iogearbox.net> Link: https://lore.kernel.org/bpf/20230124001218.827-1-dthaler1...
```diff diff --git a/Documentation/bpf/instruction-set.rst b/Documentation/bpf/instruction-set.rst index e672d5ec6cc7..2d3fe59bd260 100644 --- a/Documentation/bpf/instruction-set.rst +++ b/Documentation/bpf/instruction-set.rst @@ -99,19 +99,26 @@ code value description BPF_ADD 0x00 dst += src BPF_SUB 0x10...
89c08aef8f8dcb5fc98ad8db7ca92c9dab1f26b0
Analyze and fix the following issue in the Linux kernel code: media: videobuf2: set q->streaming later
Problem Details: Commit a10b21532574 ("media: vb2: add (un)prepare_streaming queue ops") moved up the q->streaming = 1 assignment to before the call to vb2_start_streaming(). This does make sense since q->streaming indicates that VIDIOC_STREAMON is called, and the call to start_streaming happens either at that time or...
```diff diff --git a/drivers/media/common/videobuf2/videobuf2-core.c b/drivers/media/common/videobuf2/videobuf2-core.c index fc3758a5bc1c..53e495223ea0 100644 --- a/drivers/media/common/videobuf2/videobuf2-core.c +++ b/drivers/media/common/videobuf2/videobuf2-core.c @@ -2149,8 +2149,6 @@ int vb2_core_streamon(struct vb...
facd61053cff100973921d4d45d47cf53c747ec6
Analyze and fix the following issue in the Linux kernel code: fuse: fixes after adapting to new posix acl api
Problem Details: This cycle we ported all filesystems to the new posix acl api. While looking at further simplifications in this area to remove the last remnants of the generic dummy posix acl handlers we realized that we regressed fuse daemons that don't set FUSE_POSIX_ACL but still make use of posix acls. With the c...
```diff diff --git a/fs/fuse/acl.c b/fs/fuse/acl.c index a4850aee2639..ad670369955f 100644 --- a/fs/fuse/acl.c +++ b/fs/fuse/acl.c @@ -11,9 +11,10 @@ #include <linux/posix_acl.h> #include <linux/posix_acl_xattr.h> -struct posix_acl *fuse_get_acl(struct inode *inode, int type, bool rcu) +static struct posix_acl *__f...
b0935f110cff5d70da05c5cb1670bee0b07b631c
Analyze and fix the following issue in the Linux kernel code: ACPI: video: Fix apple gmux detection
Problem Details: Some apple laptop models have an ACPI device with a HID of APP000B and that device has an IO resource (so it does not describe the new unsupported MMIO based gmux type), but there actually is no gmux in the laptop at all. The gmux_probe() function of the actual apple-gmux driver has code to detect thi...
```diff diff --git a/drivers/acpi/video_detect.c b/drivers/acpi/video_detect.c index 65cec7bb6d96..8626869c4904 100644 --- a/drivers/acpi/video_detect.c +++ b/drivers/acpi/video_detect.c @@ -110,26 +110,6 @@ static bool nvidia_wmi_ec_supported(void) } #endif -static bool apple_gmux_backlight_present(void) -{ - stru...
d143908f80f3e5d164ac3342f73d6b9f536e8b4d
Analyze and fix the following issue in the Linux kernel code: platform/x86: apple-gmux: Add apple_gmux_detect() helper
Problem Details: Add a new (static inline) apple_gmux_detect() helper to apple-gmux.h which can be used for gmux detection instead of apple_gmux_present(). The latter is not really reliable since an ACPI device with a HID of APP000B is present on some devices without a gmux at all, as well as on devices with a newer (...
```diff diff --git a/drivers/platform/x86/apple-gmux.c b/drivers/platform/x86/apple-gmux.c index a0af01f6a0fd..9333f82cfa8a 100644 --- a/drivers/platform/x86/apple-gmux.c +++ b/drivers/platform/x86/apple-gmux.c @@ -226,23 +226,6 @@ static void gmux_write32(struct apple_gmux_data *gmux_data, int port, gmux_pio_write3...
39f5a81f7ad80eb3fbcbfd817c6552db9de5504d
Analyze and fix the following issue in the Linux kernel code: platform/x86: apple-gmux: Move port defines to apple-gmux.h
Problem Details: This is a preparation patch for adding a new static inline apple_gmux_detect() helper which actually checks a supported gmux is present, rather then only checking an ACPI device with the HID is there as apple_gmux_present() does. Fixes: 21245df307cb ("ACPI: video: Add Apple GMUX brightness control det...
```diff diff --git a/drivers/platform/x86/apple-gmux.c b/drivers/platform/x86/apple-gmux.c index ca33df7ea550..a0af01f6a0fd 100644 --- a/drivers/platform/x86/apple-gmux.c +++ b/drivers/platform/x86/apple-gmux.c @@ -64,29 +64,6 @@ struct apple_gmux_data { static struct apple_gmux_data *apple_gmux_data; -/* - * gmux...
ce95010ef62d4bf470928969bafc9070ae98cbb1
Analyze and fix the following issue in the Linux kernel code: platform/x86: hp-wmi: Fix cast to smaller integer type warning
Problem Details: Fix the following compiler warning: drivers/platform/x86/hp/hp-wmi.c:551:24: warning: cast to smaller integer type 'enum hp_wmi_radio' from 'void *' [-Wvoid-pointer-to-enum-cast] Reported-by: kernel test robot <lkp@intel.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com> Link: https://lore.ke...
```diff diff --git a/drivers/platform/x86/hp/hp-wmi.c b/drivers/platform/x86/hp/hp-wmi.c index 4a3851332ef2..2ef201b625b3 100644 --- a/drivers/platform/x86/hp/hp-wmi.c +++ b/drivers/platform/x86/hp/hp-wmi.c @@ -551,7 +551,7 @@ static int __init hp_wmi_enable_hotkeys(void) static int hp_wmi_set_block(void *data, bool...
8e60615e8932167057b363c11a7835da7f007106
Analyze and fix the following issue in the Linux kernel code: platform/x86/amd: pmc: Disable IRQ1 wakeup for RN/CZN
Problem Details: By default when the system is configured for low power idle in the FADT the keyboard is set up as a wake source. This matches the behavior that Windows uses for Modern Standby as well. It has been reported that a variety of AMD based designs there are spurious wakeups are happening where two IRQ sour...
```diff diff --git a/drivers/platform/x86/amd/pmc.c b/drivers/platform/x86/amd/pmc.c index 8d924986381b..be1b49824edb 100644 --- a/drivers/platform/x86/amd/pmc.c +++ b/drivers/platform/x86/amd/pmc.c @@ -22,6 +22,7 @@ #include <linux/pci.h> #include <linux/platform_device.h> #include <linux/rtc.h> +#include <linux/se...