6.1.25-rc1 review
Subsystems (6)
Greg Kroah-Hartman
maintainerPATCH 1/134 Revert "pinctrl: amd: Disable and mask interrupts on resume"
In reply to Greg Kroah-HartmanFrom: Kornel Dulęba <[email protected]>
commit 534e465845ebfb4a97eb5459d3931a0b35e3b9a5 upstream.
This reverts commit b26cd9325be4c1fcd331b77f10acb627c560d4d7.
This patch introduces a regression on Lenovo Z13, which can't wake from the lid with it applied; and some unspecified AMD based Dell platforms are unable to wake from hitting the power button
--- drivers/pinctrl/pinctrl-amd.c | 36 ++++++++++++++++-------------------- 1 file changed, 16 insertions(+), 20 deletions(-)
drivers/pinctrl/pinctrl-amd.c +16 -20
@@ -865,34 +865,32 @@ static const struct pinconf_ops amd_pinc .pin_config_group_set = amd_pinconf_group_set, }; -static void amd_gpio_irq_init_pin (struct amd_gpio *gpio_dev,int pin) +static void amd_gpio_irq_init (struct amd_gpio *gpio_dev) { -const struct pin_desc *pd; +struct pinctrl_desc *desc = gpio_dev->pctrl->desc;unsigned long flags;u32 pin_reg, mask; +int i; mask =BIT (WAKE_CNTRL_OFF_S0I3 ) |BIT (WAKE_CNTRL_OFF_S3 ) |BIT (INTERRUPT_MASK_OFF ) |BIT (INTERRUPT_ENABLE_OFF ) |BIT (WAKE_CNTRL_OFF_S4 ); - pd =pin_desc_get (gpio_dev->pctrl, pin); -if (!pd) -return ; +for (i =0 ; i < desc->npins; i++) { +int pin = desc->pins[i].number; +const struct pin_desc *pd =pin_desc_get (gpio_dev->pctrl, pin); -raw_spin_lock_irqsave (&gpio_dev->lock, flags); - pin_reg =readl (gpio_dev->base + pin *4 ); - pin_reg &= ~mask; -writel (pin_reg, gpio_dev->base + pin *4 ); -raw_spin_unlock_irqrestore (&gpio_dev->lock, flags); -} +if (!pd) +continue ; -static void amd_gpio_irq_init (struct amd_gpio *gpio_dev) -{ -struct pinctrl_desc *desc = gpio_dev->pctrl->desc; -int i; +raw_spin_lock_irqsave (&gpio_dev->lock, flags); -for (i =0 ; i < desc->npins; i++) -amd_gpio_irq_init_pin (gpio_dev, i); + pin_reg =readl (gpio_dev->base + i *4 ); + pin_reg &= ~mask; +writel (pin_reg, gpio_dev->base + i *4 ); + +raw_spin_unlock_irqrestore (&gpio_dev->lock, flags); + } }#ifdef CONFIG_PM_SLEEP
@@ -945,10 +943,8 @@ static int amd_gpio_resume(struct devicefor (i =0 ; i < desc->npins; i++) {int pin = desc->pins[i].number; -if (!amd_gpio_should_save (gpio_dev, pin)) { -amd_gpio_irq_init_pin (gpio_dev, pin); +if (!amd_gpio_should_save (gpio_dev, pin))continue ; - }raw_spin_lock_irqsave (&gpio_dev->lock, flags); gpio_dev->saved_regs[i] |=readl (gpio_dev->base + pin *4 ) &PIN_IRQ_PENDING ;
Greg Kroah-Hartman
maintainerPATCH 2/134 drm/amd/display: Pass the right info to drm_dp_remove_payload
In reply to Greg Kroah-HartmanFrom: Wayne Lin <[email protected]>
commit b8ca445f550a9a079134f836466ddda3bfad6108 upstream.
[Why & How]drm_dp_remove_payload() interface was changed. Correct amdgpu dm code to pass the right parameter to the drm helper function.
(cherry-picked from b8ca445f550a9a079134f836466ddda3bfad6108) [Hand modified due to missing f0127cb11299df80df45583b216e13f27c408545 which
failed to apply due to missing 94dfeaa46925bb6b4d43645bbb6234e846dec257]
--- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c | 57 ++++++++++++-- 1 file changed, 50 insertions(+), 7 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c +50 -7
@@ -175,6 +175,40 @@ void dm_helpers_dp_update_branch_info( const struct dc_link *link) {} +static void dm_helpers_construct_old_payload ( +struct dc_link *link, +int pbn_per_slot, +struct drm_dp_mst_atomic_payload *new_payload, +struct drm_dp_mst_atomic_payload *old_payload) +{ +struct link_mst_stream_allocation_table current_link_table = + link->mst_stream_alloc_table; +struct link_mst_stream_allocation *dc_alloc; +int i; + + *old_payload = *new_payload; + +/* Set correct time_slots/PBN of old payload. +* other fields (delete & dsc_enabled) in +* struct drm_dp_mst_atomic_payload are don't care fields +* while calling drm_dp_remove_payload() +*/ +for (i =0 ; i < current_link_table.stream_count; i++) { + dc_alloc = + ¤t_link_table.stream_allocations[i]; + +if (dc_alloc->vcp_id == new_payload->vcpi) { + old_payload->time_slots = dc_alloc->slot_count; + old_payload->pbn = dc_alloc->slot_count * pbn_per_slot; +break ; + } + } + +/* make sure there is an old payload*/ +ASSERT (i != current_link_table.stream_count); + +} +/* * Writes payload allocation table in immediate downstream device. */
@@ -186,7 +220,7 @@ bool dm_helpers_dp_mst_write_payload_all {struct amdgpu_dm_connector *aconnector;struct drm_dp_mst_topology_state *mst_state; -struct drm_dp_mst_atomic_payload *payload; +struct drm_dp_mst_atomic_payload *target_payload, *new_payload, old_payload;struct drm_dp_mst_topology_mgr *mst_mgr; aconnector = (struct amdgpu_dm_connector *)stream->dm_stream_context;
@@ -202,17 +236,26 @@ bool dm_helpers_dp_mst_write_payload_all mst_state =to_drm_dp_mst_topology_state (mst_mgr->base.state);/* It's OK for this to fail */ - payload =drm_atomic_get_mst_payload_state (mst_state, aconnector->port); -if (enable) -drm_dp_add_payload_part1 (mst_mgr, mst_state, payload); -else -drm_dp_remove_payload (mst_mgr, mst_state, payload, payload); + new_payload =drm_atomic_get_mst_payload_state (mst_state, aconnector->port); + +if (enable) { + target_payload = new_payload; + +drm_dp_add_payload_part1 (mst_mgr, mst_state, new_payload); + }else { +/* construct old payload by VCPI*/ +dm_helpers_construct_old_payload (stream->link, mst_state->pbn_div, + new_payload, &old_payload); + target_payload = &old_payload; + +drm_dp_remove_payload (mst_mgr, mst_state, &old_payload, new_payload); + }/* mst_mgr->->payloads are VC payload notify MST branch using DPCD or * AUX message. The sequence is slot 1-63 allocated sequence for each * stream. AMD ASIC stream slot allocation should follow the same * sequence. copy DRM MST allocation to dc */ -fill_dc_mst_payload_table_from_drm (stream->link, enable, payload, proposed_table); +fill_dc_mst_payload_table_from_drm (stream->link, enable, target_payload, proposed_table);return true; }
Greg Kroah-Hartman
maintainerPATCH 3/134 ALSA: emu10k1: fix capture interrupt handler unlinking
In reply to Greg Kroah-HartmanFrom: Oswald Buddenhagen <[email protected]>
commit b09c551c77c7e01dc6e4f3c8bf06b5ffa7b06db5 upstream.
Due to two copy/pastos, closing the MIC or EFX capture device would make a running ADC capture hang due to unsetting its interrupt handler. In principle, this would have also allowed dereferencing dangling pointers, but we're actually rather thorough at disabling and flushing the ints.
While it may sound like one, this actually wasn't a hypothetical bug:
PortAudio will open a capture stream at startup (and close it right away) even if not asked to. If the first device is busy, it will just proceed with the next one ... thus killing a concurrent capture.
--- sound/pci/emu10k1/emupcm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
sound/pci/emu10k1/emupcm.c +2 -2
@@ -1236,7 +1236,7 @@ static int snd_emu10k1_capture_mic_close {struct snd_emu10k1 *emu =snd_pcm_substream_chip (substream); - emu->capture_interrupt =NULL ; + emu->capture_mic_interrupt =NULL ; emu->pcm_capture_mic_substream =NULL ;return 0 ; }
@@ -1344,7 +1344,7 @@ static int snd_emu10k1_capture_efx_close {struct snd_emu10k1 *emu =snd_pcm_substream_chip (substream); - emu->capture_interrupt =NULL ; + emu->capture_efx_interrupt =NULL ; emu->pcm_capture_efx_substream =NULL ;return 0 ; }
Greg Kroah-Hartman
maintainerPATCH 4/134 ALSA: hda/sigmatel: add pin overrides for Intel DP45SG motherboard
In reply to Greg Kroah-HartmanFrom: Oswald Buddenhagen <[email protected]>
commit c17f8fd31700392b1bb9e7b66924333568cb3700 upstream.
Like the other boards from the D*45* series, this one sets up the outputs not quite correctly.
--- Documentation/sound/hd-audio/models.rst | 2 +- sound/pci/hda/patch_sigmatel.c | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-)
Documentation/sound/hd-audio/models.rst +1 -1
@@ -704,7 +704,7 @@ ref no-jd BIOS setup but without jack-detection intel - Intel DG45* mobos + Intel D*45* mobos dell-m6-amic Dell desktops/laptops with analog mics dell-m6-dmic
sound/pci/hda/patch_sigmatel.c +2 -0
@@ -1955,6 +1955,8 @@ static const struct snd_pci_quirk stac92 "DFI LanParty", STAC_92HD73XX_REF),SND_PCI_QUIRK (PCI_VENDOR_ID_DFI ,0x3101 ,"DFI LanParty" ,STAC_92HD73XX_REF ), +SND_PCI_QUIRK (PCI_VENDOR_ID_INTEL ,0x5001 , +"Intel DP45SG" ,STAC_92HD73XX_INTEL ),SND_PCI_QUIRK (PCI_VENDOR_ID_INTEL ,0x5002 ,"Intel DG45ID" ,STAC_92HD73XX_INTEL ), SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x5003,
Greg Kroah-Hartman
maintainerPATCH 5/134 ALSA: i2c/cs8427: fix iec958 mixer control deactivation
In reply to Greg Kroah-HartmanFrom: Oswald Buddenhagen <[email protected]>
commit e98e7a82bca2b6dce3e03719cff800ec913f9af7 upstream.
snd_cs8427_iec958_active() would always delete SNDRV_CTL_ELEM_ACCESS_INACTIVE, even though the function has an argument active.
--- sound/i2c/cs8427.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)
sound/i2c/cs8427.c +5 -2
@@ -561,10 +561,13 @@ int snd_cs8427_iec958_active(struct snd_if (snd_BUG_ON (!cs8427))return -ENXIO ; chip = cs8427->private_data; -if (active) +if (active) {memcpy (chip->playback.pcm_status, chip->playback.def_status,24 ); - chip->playback.pcm_ctl->vd[0 ].access &= ~SNDRV_CTL_ELEM_ACCESS_INACTIVE ; + chip->playback.pcm_ctl->vd[0 ].access &= ~SNDRV_CTL_ELEM_ACCESS_INACTIVE ; + }else { + chip->playback.pcm_ctl->vd[0 ].access |=SNDRV_CTL_ELEM_ACCESS_INACTIVE ; + }snd_ctl_notify (cs8427->bus->card,SNDRV_CTL_EVENT_MASK_VALUE |SNDRV_CTL_EVENT_MASK_INFO , &chip->playback.pcm_ctl->id);
Greg Kroah-Hartman
maintainerPATCH 6/134 ALSA: hda: patch_realtek: add quirk for Asus N7601ZM
In reply to Greg Kroah-HartmanFrom: Pierre-Louis Bossart <[email protected]>
commit e959f2beec8e655dba79c5a7111beedae5e757e0 upstream.
Add pins and verbs needed to enable speakers and jack.
The pins and verbs configurations were identified by snooping the Windows driver commands, with a nice write-up here:
https://brakkee.org/site/2023/02/07/fixing-sound-on-the-asus-n7601zm/
--- sound/pci/hda/patch_realtek.c | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+)
sound/pci/hda/patch_realtek.c +26 -0
@@ -6960,6 +6960,8 @@ enum {ALC269_FIXUP_DELL_M101Z ,ALC269_FIXUP_SKU_IGNORE ,ALC269_FIXUP_ASUS_G73JW , +ALC269_FIXUP_ASUS_N7601ZM_PINS , +ALC269_FIXUP_ASUS_N7601ZM ,ALC269_FIXUP_LENOVO_EAPD ,ALC275_FIXUP_SONY_HWEQ , ALC275_FIXUP_SONY_DISABLE_AAMIX,
@@ -7256,6 +7258,29 @@ static const struct hda_fixup alc269_fix { } } }, + [ALC269_FIXUP_ASUS_N7601ZM_PINS] = { + .type = HDA_FIXUP_PINS, + .v.pins = (const struct hda_pintbl[]) { + { 0x19, 0x03A11050 }, + { 0x1a, 0x03A11C30 }, + { 0x21, 0x03211420 }, + { } + } + }, + [ALC269_FIXUP_ASUS_N7601ZM] = { + .type = HDA_FIXUP_VERBS, + .v.verbs = (const struct hda_verb[]) { + {0x20, AC_VERB_SET_COEF_INDEX, 0x62}, + {0x20, AC_VERB_SET_PROC_COEF, 0xa007}, + {0x20, AC_VERB_SET_COEF_INDEX, 0x10}, + {0x20, AC_VERB_SET_PROC_COEF, 0x8420}, + {0x20, AC_VERB_SET_COEF_INDEX, 0x0f}, + {0x20, AC_VERB_SET_PROC_COEF, 0x7774}, + { } + }, + .chained = true, + .chain_id = ALC269_FIXUP_ASUS_N7601ZM_PINS, + }, [ALC269_FIXUP_LENOVO_EAPD] = { .type = HDA_FIXUP_VERBS, .v.verbs = (const struct hda_verb[]) {
@@ -9465,6 +9490,7 @@ static const struct snd_pci_quirk alc269SND_PCI_QUIRK (0x1043 ,0x1271 ,"ASUS X430UN" ,ALC256_FIXUP_ASUS_MIC_NO_PRESENCE ),SND_PCI_QUIRK (0x1043 ,0x1290 ,"ASUS X441SA" ,ALC233_FIXUP_EAPD_COEF_AND_MIC_NO_PRESENCE ),SND_PCI_QUIRK (0x1043 ,0x12a0 ,"ASUS X441UV" ,ALC233_FIXUP_EAPD_COEF_AND_MIC_NO_PRESENCE ), +SND_PCI_QUIRK (0x1043 ,0x12a3 ,"Asus N7691ZM" ,ALC269_FIXUP_ASUS_N7601ZM ),SND_PCI_QUIRK (0x1043 ,0x12af ,"ASUS UX582ZS" ,ALC245_FIXUP_CS35L41_SPI_2 ),SND_PCI_QUIRK (0x1043 ,0x12e0 ,"ASUS X541SA" ,ALC256_FIXUP_ASUS_MIC ), SND_PCI_QUIRK(0x1043, 0x12f0, "ASUS X541UV", ALC256_FIXUP_ASUS_MIC),
Greg Kroah-Hartman
maintainerPATCH 7/134 ALSA: hda/realtek: Add quirks for Lenovo Z13/Z16 Gen2
In reply to Greg Kroah-HartmanFrom: Stefan Binding <[email protected]>
commit 8eda19cd59cedbfe4ec11aea4bcecabe4c98e9e4 upstream.
These Lenovo laptops use Realtek HDA codec combined with 2xCS35L41 Amplifiers using I2C with External Boost.
--- sound/pci/hda/patch_realtek.c | 3 +++ 1 file changed, 3 insertions(+)
sound/pci/hda/patch_realtek.c +3 -0
@@ -9688,6 +9688,9 @@ static const struct snd_pci_quirk alc269SND_PCI_QUIRK (0x17aa ,0x22f1 ,"Thinkpad" ,ALC287_FIXUP_CS35L41_I2C_2 ),SND_PCI_QUIRK (0x17aa ,0x22f2 ,"Thinkpad" ,ALC287_FIXUP_CS35L41_I2C_2 ),SND_PCI_QUIRK (0x17aa ,0x22f3 ,"Thinkpad" ,ALC287_FIXUP_CS35L41_I2C_2 ), +SND_PCI_QUIRK (0x17aa ,0x2318 ,"Thinkpad Z13 Gen2" ,ALC287_FIXUP_CS35L41_I2C_2 ), +SND_PCI_QUIRK (0x17aa ,0x2319 ,"Thinkpad Z16 Gen2" ,ALC287_FIXUP_CS35L41_I2C_2 ), +SND_PCI_QUIRK (0x17aa ,0x231a ,"Thinkpad Z16 Gen2" ,ALC287_FIXUP_CS35L41_I2C_2 ),SND_PCI_QUIRK (0x17aa ,0x30bb ,"ThinkCentre AIO" ,ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY ),SND_PCI_QUIRK (0x17aa ,0x30e2 ,"ThinkCentre AIO" ,ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY ), SND_PCI_QUIRK(0x17aa, 0x310c, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION),
Greg Kroah-Hartman
maintainerPATCH 8/134 ALSA: firewire-tascam: add missing unwind goto in snd_tscm_stream_start_duplex()
In reply to Greg Kroah-HartmanFrom: Xu Biang <[email protected]>
commit fb4a624f88f658c7b7ae124452bd42eaa8ac7168 upstream.
Smatch Warns:sound/firewire/tascam/tascam-stream.c:493 snd_tscm_stream_start_duplex()
warn: missing unwind goto?
The direct return will cause the stream list of "&tscm->domain" unemptied and the session in "tscm" unfinished if amdtp_domain_start() returns with an error.
Fix this by changing the direct return to a goto which will empty the stream list of "&tscm->domain" and finish the session in "tscm".
The snd_tscm_stream_start_duplex() function is called in the prepare callback of PCM. According to "ALSA Kernel API Documentation", the prepare callback of PCM will be called many times at each setup. So, if the "&d->streams" list is not emptied, when the prepare callback is called next time, snd_tscm_stream_start_duplex() will receive -EBUSY from amdtp_domain_add_stream() that tries to add an existing stream to the domain. The error handling code after the "error" label will be executed in this case, and the "&d->streams" list will be emptied. So not emptying the "&d->streams" list will not cause an issue. But it is more efficient and readable to empty it on the first error by changing the direct return to a goto statement.
The session in "tscm" has been begun before amdtp_domain_start(), so it needs to be finished when amdtp_domain_start() fails.
--- sound/firewire/tascam/tascam-stream.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
sound/firewire/tascam/tascam-stream.c +1 -1
@@ -490,7 +490,7 @@ int snd_tscm_stream_start_duplex(struct// packet is important for media clock recovery. err =amdtp_domain_start (&tscm->domain, tx_init_skip_cycles, true, true);if (err <0 ) -return err; + goto error;if (!amdtp_domain_wait_ready (&tscm->domain,READY_TIMEOUT_MS )) { err = -ETIMEDOUT ;
Greg Kroah-Hartman
maintainerPATCH 9/134 ALSA: emu10k1: dont create old pass-through playback device on Audigy
In reply to Greg Kroah-HartmanFrom: Oswald Buddenhagen <[email protected]>
commit 8dd13214a810c695044aa168c0ddba1a9c433e4f upstream.
It could have never worked, as snd_emu10k1_fx8010_playback_prepare() and snd_emu10k1_fx8010_playback_hw_free() assume the emu10k1 offset for the ETRAM, and the default DSP code includes no handler for it. It also wouldn't make a lot of sense to make it work, as Audigy has an own, much simpler, pass-through mechanism. So just skip creation of the device.
--- sound/pci/emu10k1/emupcm.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-)
sound/pci/emu10k1/emupcm.c +7 -3
@@ -1781,17 +1781,21 @@ int snd_emu10k1_pcm_efx(struct snd_emu10struct snd_kcontrol *kctl;int err; - err =snd_pcm_new (emu->card,"emu10k1 efx" , device,8 ,1 , &pcm); + err =snd_pcm_new (emu->card,"emu10k1 efx" , device, emu->audigy ?0 :8 ,1 , &pcm);if (err <0 )return err; pcm->private_data = emu; -snd_pcm_set_ops (pcm,SNDRV_PCM_STREAM_PLAYBACK , &snd_emu10k1_fx8010_playback_ops); +if (!emu->audigy) +snd_pcm_set_ops (pcm,SNDRV_PCM_STREAM_PLAYBACK , &snd_emu10k1_fx8010_playback_ops);snd_pcm_set_ops (pcm,SNDRV_PCM_STREAM_CAPTURE , &snd_emu10k1_capture_efx_ops); pcm->info_flags =0 ; -strcpy (pcm->name,"Multichannel Capture/PT Playback" ); +if (emu->audigy) +strcpy (pcm->name,"Multichannel Capture" ); +else +strcpy (pcm->name,"Multichannel Capture/PT Playback" ); emu->pcm_efx = pcm;/* EFX capture - record the "FXBUS2" channels, by default we connect the EXTINs
Greg Kroah-Hartman
maintainercover 6.1.25-rc1 review
This is the start of the stable review cycle for the 6.1.25 release. There are 134 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Thu, 20 Apr 2023 12:02:44 +0000. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
https://www.kernel.org/pub/linux/kernel/v6.x/stable-review/patch-6.1.25-rc1.gz
or in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git linux-6.1.y
and the diffstat can be found below.
thanks,
greg k-h
-------------
Pseudo-Shortlog of commits:
Greg Kroah-Hartman <[email protected]>
Linux 6.1.25-rc1
Waiman Long <[email protected]>
cgroup/cpuset: Add cpuset_can_fork() and cpuset_cancel_fork() methods
Waiman Long <[email protected]>
cgroup/cpuset: Make cpuset_fork() handle CLONE_INTO_CGROUP properly
Waiman Long <[email protected]>
cgroup/cpuset: Skip spread flags update on v2
Duy Truong <[email protected]>
nvme-pci: add NVME_QUIRK_BOGUS_NID for T-FORCE Z330 SSD
Juraj Pecigos <[email protected]>
nvme-pci: mark Lexar NM760 as IGNORE_DEV_SUBNQN
Alexandre Ghiti <[email protected]>
riscv: Move early dtb mapping into the fixmap region
Björn Töpel <[email protected]>
Documentation: riscv: Document the sv57 VM layout
Alyssa Ross <[email protected]>
purgatory: fix disabling debug info
Heiko Stuebner <[email protected]>
RISC-V: add infrastructure to allow different str* implementations
David Disseldorp <[email protected]>
cifs: fix negotiate context parsing
Gregor Herburger <[email protected]>
i2c: ocores: generate stop condition after timeout in polling mode
Matija Glavinic Pecotic <[email protected]>
x86/rtc: Remove __init for runtime functions
Vincent Guittot <[email protected]>
sched/fair: Fix imbalance overflow
Aneesh Kumar K.V <[email protected]>
powerpc/papr_scm: Update the NUMA distance table for the target node
Tharun Kumar P <[email protected]>
i2c: mchp-pci1xxxx: Update Timing registers
ZhaoLong Wang <[email protected]>
ubi: Fix deadlock caused by recursively holding work_sem
Zhihao Cheng <[email protected]>
ubi: Fix failure attaching when vid_hdr offset equals to (sub)page size
Paolo Abeni <[email protected]>
mptcp: stricter state check in mptcp_worker
Paolo Abeni <[email protected]>
mptcp: use mptcp_schedule_work instead of open-coding it
Horatio Zhang <[email protected]>
drm/amd/pm: correct SMU13.0.7 max shader clock reporting
Horatio Zhang <[email protected]>
drm/amd/pm: correct SMU13.0.7 pstate profiling clock settings
Waiman Long <[email protected]>
cgroup/cpuset: Wake up cpuset_attach_wq tasks in cpuset_cancel_attach()
Waiman Long <[email protected]>
cgroup/cpuset: Fix partition root's cpuset.cpus update bug
Josh Don <[email protected]>
cgroup: fix display of forceidle time at root
Basavaraj Natikar <[email protected]>
x86/PCI: Add quirk for AMD XHCI controller that loses MSI-X state in D3hot
Jiri Kosina <[email protected]>
scsi: ses: Handle enclosure with just a primary component gracefully
Radu Pirea (OSS) <[email protected]>
net: phy: nxp-c45-tja11xx: fix unsigned long multiplication overflow
Radu Pirea (OSS) <[email protected]>
net: phy: nxp-c45-tja11xx: add remove callback
Ivan Bornyakov <[email protected]>
net: sfp: initialize sfp->i2c_block_size at sfp allocation
Tanu Malhotra <[email protected]>
HID: intel-ish-hid: Fix kernel panic during warm reset
Mathis Salmen <[email protected]>
riscv: add icache flush for nommu sigreturn trampoline
Alexandre Ghiti <[email protected]>
riscv: Do not set initial_boot_params to the linear address of the dtb
David Disseldorp <[email protected]>
ksmbd: avoid out of bounds access in decode_preauth_ctxt()
Liam R. Howlett <[email protected]>
maple_tree: fix write memory barrier of nodes once dead for RCU mode
Steven Rostedt (Google) <[email protected]>
tracing: Have tracing_snapshot_instance_cond() write errors to the appropriate instance
Steven Rostedt (Google) <[email protected]>
tracing: Add trace_array_puts() to write into instance
Jeremi Piotrowski <[email protected]>
KVM: SVM: Flush Hyper-V TLB when required
Sean Christopherson <[email protected]>
x86/hyperv: KVM: Rename "hv_enlightenments" to "hv_vmcb_enlightenments"
Sean Christopherson <[email protected]>
KVM: SVM: Add a proper field for Hyper-V VMCB enlightenments
Sean Christopherson <[email protected]>
KVM: selftests: Move "struct hv_enlightenments" to x86_64/svm.h
Sean Christopherson <[email protected]>
x86/hyperv: Move VMCB enlightenment definitions to hyperv-tlfs.h
Aymeric Wibo <[email protected]>
ACPI: resource: Add Medion S17413 to IRQ override quirk
Jane Jian <[email protected]>
drm/amdgpu/gfx: set cg flags to enter/exit safe mode
YuBiao Wang <[email protected]>
drm/amdgpu: Force signal hw_fences that are embedded in non-sched jobs
Tong Liu01 <[email protected]>
drm/amdgpu: add mes resume when do gfx post soft reset
Johannes Berg <[email protected]>
wifi: iwlwifi: mvm: protect TXQ list manipulation
Johannes Berg <[email protected]>
wifi: iwlwifi: mvm: fix mvmtxq->stopped handling
Martin George <[email protected]>
nvme: send Identify with CNS 06h only to I/O controllers
Robbie Harwood <[email protected]>
asymmetric_keys: log on fatal failures in PE/pkcs7
Robbie Harwood <[email protected]>
verify_pefile: relax wrapper length check
Tianyi Jing <[email protected]>
hwmon: (xgene) Fix ioremap and memremap leak
Iwona Winiarska <[email protected]>
hwmon: (peci/cputemp) Fix miscalculated DTS for SKX
Hans de Goede <[email protected]>
drm: panel-orientation-quirks: Add quirk for Lenovo Yoga Book X90F
Hans de Goede <[email protected]>
ACPI: video: Add backlight=native DMI quirk for Acer Aspire 3830TG
Ming Lei <[email protected]>
block: ublk_drv: mark device as LIVE before adding disk
Hans de Goede <[email protected]>
efi: sysfb_efi: Add quirk for Lenovo Yoga Book X91F/L
Yicong Yang <[email protected]>
i2c: hisi: Avoid redundant interrupts
Alexander Stein <[email protected]>
i2c: imx-lpi2c: clean rx/tx buffers upon new message
Krzysztof Kozlowski <[email protected]>
wifi: mwifiex: mark OF related data as maybe unused
Alexei Starovoitov <[email protected]>
selftests/bpf: Fix progs/find_vma_fail1.c build error.
Denis Arefev <[email protected]>
power: supply: axp288_fuel_gauge: Added check for negative values
Grant Grundler <[email protected]>
power: supply: cros_usbpd: reclassify "default case!" as debug
Jiapeng Chong <[email protected]>
power: supply: rk817: Fix unsigned comparison with less than zero
Luca Weiss <[email protected]>
ARM: dts: qcom: apq8026-lg-lenok: add missing reserved memory
Andrew Jeffery <[email protected]>
ARM: 9290/1: uaccess: Fix KASAN false-positives
Andrii Nakryiko <[email protected]>
libbpf: Fix single-line struct definition output in btf_dump
Liang Chen <[email protected]>
skbuff: Fix a race between coalescing and releasing SKBs
Roman Gushchin <[email protected]>
net: macb: fix a memory corruption in extended buffer descriptor mode
Eric Dumazet <[email protected]>
udp6: fix potential access to stale information
Aaron Conole <[email protected]>
selftests: openvswitch: adjust datapath NL message declaration
Saravanan Vajravel <[email protected]>
RDMA/core: Fix GID entry ref leak when create_ah fails
Xin Long <[email protected]>
sctp: fix a potential overflow in sctp_ifwdtsn_skip
Ziyang Xuan <[email protected]>
net: qrtr: Fix an uninit variable access bug in qrtr_tx_resume()
Tetsuo Handa <[email protected]>
cgroup,freezer: hold cpu_hotplug_lock before freezer_mutex
Harshit Mogalapalli <[email protected]>
net: wwan: iosm: Fix error handling path in ipc_pcie_probe()
Denis Plotnikov <[email protected]>
qlcnic: check pci_reset_function result
Christophe JAILLET <[email protected]>
drm/armada: Fix a potential double free in an error handling path
Claudia Draghicescu <[email protected]>
Bluetooth: Set ISO Data Path on broadcast sink
Luiz Augusto von Dentz <[email protected]>
Bluetooth: SCO: Fix possible circular locking dependency sco_sock_getsockopt
Luiz Augusto von Dentz <[email protected]>
Bluetooth: Fix printing errors if LE Connection times out
Luiz Augusto von Dentz <[email protected]>
Bluetooth: hci_conn: Fix not cleaning up on LE Connection failure
Felix Huettner <[email protected]>
net: openvswitch: fix race on port output
Ahmed Zaki <[email protected]>
iavf: remove active_cvlans and active_svlans bitmaps
Ahmed Zaki <[email protected]>
iavf: refactor VLAN filter states
Hangbin Liu <[email protected]>
bonding: fix ns validation on backup slaves
YueHaibing <[email protected]>
tcp: restrict net.ipv4.tcp_app_win
Harshit Mogalapalli <[email protected]>
niu: Fix missing unwind goto in niu_alloc_channels()
Fuad Tabba <[email protected]>
KVM: arm64: Advertise ID_AA64PFR0_EL1.CSV2/3 to protected VMs
Will Deacon <[email protected]>
KVM: arm64: Initialise hypervisor copies of host symbols unconditionally
Xu Kuohai <[email protected]>
bpf, arm64: Fixed a BTI error on returning to patched function
Zheng Wang <[email protected]>
9p/xen : Fix use after free bug in xen_9pfs_front_remove due to race condition
Martin Povišer <[email protected]>
dmaengine: apple-admac: Fix 'current_tx' not getting freed
Martin Povišer <[email protected]>
dmaengine: apple-admac: Set src_addr_widths capability
Martin Povišer <[email protected]>
dmaengine: apple-admac: Handle 'global' interrupt flags
George Guo <[email protected]>
LoongArch, bpf: Fix jit to skip speculation barrier opcode
Martin KaFai Lau <[email protected]>
bpf: tcp: Use sock_gen_put instead of sock_put in bpf_iter_tcp
Mark Zhang <[email protected]>
RDMA/cma: Allow UD qp_type to join multicast only
Alexander Stein <[email protected]>
clk: rs9: Fix suspend/resume
Cheng Xu <[email protected]>
RDMA/erdma: Defer probing if netdevice can not be found
Cheng Xu <[email protected]>
RDMA/erdma: Inline mtt entries into WQE if supported
Cheng Xu <[email protected]>
RDMA/erdma: Update default EQ depth to 4096 and max_send_wr to 8192
Maher Sanalla <[email protected]>
IB/mlx5: Add support for 400G_8X lane speed
Tatyana Nikolova <[email protected]>
RDMA/irdma: Add ipv4 check to irdma_find_listener()
Mustafa Ismail <[email protected]>
RDMA/irdma: Increase iWARP CM default rexmit count
Mustafa Ismail <[email protected]>
RDMA/irdma: Fix memory leak of PBLE objects
Mustafa Ismail <[email protected]>
RDMA/irdma: Do not generate SW completions for NOPs
Chunyan Zhang <[email protected]>
clk: sprd: set max_register according to mapping range
Jani Nikula <[email protected]>
drm/i915/dsi: fix DSS CTL register offsets for TGL+
Daniel Vetter <[email protected]>
fbcon: set_con2fb_map needs to set con2fb_map!
Daniel Vetter <[email protected]>
fbcon: Fix error paths in set_con2fb_map
Reiji Watanabe <[email protected]>
KVM: arm64: PMU: Restore the guest's EL0 event counting after migration
Christophe Kerello <[email protected]>
mtd: rawnand: stm32_fmc2: use timings.mode instead of checking tRC_min
Christophe Kerello <[email protected]>
mtd: rawnand: stm32_fmc2: remove unsupported EDO mode
Arseniy Krasnov <[email protected]>
mtd: rawnand: meson: fix bitmask for length in command word
Bang Li <[email protected]>
mtdblock: tolerate corrected bit-flips
Daniel Vetter <[email protected]>
fbmem: Reject FB_ACTIVATE_KD_TEXT from userspace
Christoph Hellwig <[email protected]>
btrfs: fix fast csum implementation detection
Christoph Hellwig <[email protected]>
btrfs: restore the thread_pool= behavior in remount for the end I/O workqueues
Luiz Augusto von Dentz <[email protected]>
Bluetooth: hci_conn: Fix possible UAF
Archie Pusaka <[email protected]>
Bluetooth: Free potentially unfreed SCO connection
Sasha Finkelstein <[email protected]>
bluetooth: btbcm: Fix logic error in forming the board name.
Min Li <[email protected]>
Bluetooth: Fix race condition in hidp_session_thread
Luiz Augusto von Dentz <[email protected]>
Bluetooth: L2CAP: Fix use-after-free in l2cap_disconnect_{req,rsp}Kai Vehmanen <[email protected]>
ALSA: hda/hdmi: disable KAE for Intel DG2
Oswald Buddenhagen <[email protected]>
ALSA: hda/sigmatel: fix S/PDIF out on Intel D*45* motherboards
Oswald Buddenhagen <[email protected]>
ALSA: emu10k1: don't create old pass-through playback device on Audigy
Xu Biang <[email protected]>
ALSA: firewire-tascam: add missing unwind goto in snd_tscm_stream_start_duplex()
Stefan Binding <[email protected]>
ALSA: hda/realtek: Add quirks for Lenovo Z13/Z16 Gen2
Pierre-Louis Bossart <[email protected]>
ALSA: hda: patch_realtek: add quirk for Asus N7601ZM
Oswald Buddenhagen <[email protected]>
ALSA: i2c/cs8427: fix iec958 mixer control deactivation
Oswald Buddenhagen <[email protected]>
ALSA: hda/sigmatel: add pin overrides for Intel DP45SG motherboard
Oswald Buddenhagen <[email protected]>
ALSA: emu10k1: fix capture interrupt handler unlinking
Wayne Lin <[email protected]>
drm/amd/display: Pass the right info to drm_dp_remove_payload
Kornel Dulęba <[email protected]>
Revert "pinctrl: amd: Disable and mask interrupts on resume"
-------------
Diffstat:
Documentation/networking/ip-sysctl.rst | 2 + Documentation/riscv/vm-layout.rst | 40 ++++- Documentation/sound/hd-audio/models.rst | 2 +- Makefile | 4 +- arch/arm/boot/dts/qcom-apq8026-lg-lenok.dts | 10 ++ arch/arm/lib/uaccess_with_memcpy.c | 4 +- arch/arm64/kvm/arm.c | 39 ++++- arch/arm64/kvm/hyp/include/nvhe/fixed_config.h | 5 +- arch/arm64/kvm/hyp/nvhe/sys_regs.c | 7 - arch/arm64/kvm/pmu-emul.c | 1 + arch/arm64/kvm/sys_regs.c | 1 - arch/arm64/net/bpf_jit.h | 4 + arch/arm64/net/bpf_jit_comp.c | 3 +- arch/loongarch/net/bpf_jit.c | 4 + arch/powerpc/mm/numa.c | 1 + arch/powerpc/platforms/pseries/papr_scm.c | 7 + arch/riscv/include/asm/fixmap.h | 8 + arch/riscv/include/asm/pgtable.h | 8 +- arch/riscv/include/asm/string.h | 10 ++ arch/riscv/kernel/riscv_ksyms.c | 3 + arch/riscv/kernel/setup.c | 6 +- arch/riscv/kernel/signal.c | 9 +- arch/riscv/lib/Makefile | 3 + arch/riscv/lib/strcmp.S | 36 ++++ arch/riscv/lib/strlen.S | 28 +++ arch/riscv/lib/strncmp.S | 41 +++++ arch/riscv/mm/init.c | 61 ++++--- arch/riscv/purgatory/Makefile | 14 +- arch/x86/include/asm/hyperv-tlfs.h | 22 +++ arch/x86/include/asm/svm.h | 7 +- arch/x86/kernel/x86_init.c | 4 +- arch/x86/kvm/kvm_onhyperv.h | 5 + arch/x86/kvm/svm/hyperv.h | 22 --- arch/x86/kvm/svm/nested.c | 11 +- arch/x86/kvm/svm/svm.c | 37 +++- arch/x86/kvm/svm/svm.h | 5 +- arch/x86/kvm/svm/svm_onhyperv.c | 6 +- arch/x86/kvm/svm/svm_onhyperv.h | 34 ++-- arch/x86/pci/fixup.c | 21 +++ arch/x86/purgatory/Makefile | 3 +- crypto/asymmetric_keys/pkcs7_verify.c | 10 +- crypto/asymmetric_keys/verify_pefile.c | 32 ++-- drivers/acpi/resource.c | 7 + drivers/acpi/video_detect.c | 8 + drivers/block/ublk_drv.c | 3 +- drivers/bluetooth/btbcm.c | 2 +- drivers/clk/clk-renesas-pcie.c | 3 +- drivers/clk/sprd/common.c | 9 +- drivers/dma/apple-admac.c | 20 ++- drivers/firmware/efi/sysfb_efi.c | 8 + drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c | 9 + drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c | 14 ++ .../drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c | 57 ++++++- .../gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_7_ppt.c | 83 ++++++++- drivers/gpu/drm/armada/armada_drv.c | 1 - drivers/gpu/drm/drm_panel_orientation_quirks.c | 13 +- drivers/gpu/drm/i915/display/icl_dsi.c | 20 ++- drivers/hid/intel-ish-hid/ishtp/bus.c | 4 +- drivers/hwmon/peci/cputemp.c | 8 +- drivers/hwmon/xgene-hwmon.c | 14 +- drivers/i2c/busses/i2c-hisi.c | 7 + drivers/i2c/busses/i2c-imx-lpi2c.c | 2 + drivers/i2c/busses/i2c-mchp-pci1xxxx.c | 60 +++---- drivers/i2c/busses/i2c-ocores.c | 35 ++-- drivers/infiniband/core/cma.c | 60 ++++--- drivers/infiniband/core/verbs.c | 2 + drivers/infiniband/hw/erdma/erdma_hw.h | 2 +- drivers/infiniband/hw/erdma/erdma_main.c | 2 +- drivers/infiniband/hw/erdma/erdma_qp.c | 2 +- drivers/infiniband/hw/erdma/erdma_verbs.h | 2 +- drivers/infiniband/hw/irdma/cm.c | 16 +- drivers/infiniband/hw/irdma/cm.h | 2 +- drivers/infiniband/hw/irdma/hw.c | 3 + drivers/infiniband/hw/irdma/utils.c | 5 +- drivers/infiniband/hw/mlx5/main.c | 4 + drivers/mtd/mtdblock.c | 12 +- drivers/mtd/nand/raw/meson_nand.c | 6 +- drivers/mtd/nand/raw/stm32_fmc2_nand.c | 3 + drivers/mtd/ubi/build.c | 21 ++- drivers/mtd/ubi/wl.c | 4 +- drivers/net/bonding/bond_main.c | 5 +- drivers/net/ethernet/cadence/macb_main.c | 4 + drivers/net/ethernet/intel/iavf/iavf.h | 20 ++- drivers/net/ethernet/intel/iavf/iavf_main.c | 44 ++--- drivers/net/ethernet/intel/iavf/iavf_virtchnl.c | 68 ++++---- drivers/net/ethernet/qlogic/qlcnic/qlcnic_ctx.c | 8 +- drivers/net/ethernet/sun/niu.c | 2 +- drivers/net/phy/nxp-c45-tja11xx.c | 14 +- drivers/net/phy/sfp.c | 13 +- drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c | 50 ++---- drivers/net/wireless/intel/iwlwifi/mvm/mvm.h | 6 +- drivers/net/wireless/intel/iwlwifi/mvm/ops.c | 6 +- drivers/net/wireless/intel/iwlwifi/mvm/sta.c | 29 +++- drivers/net/wireless/marvell/mwifiex/pcie.c | 2 +- drivers/net/wireless/marvell/mwifiex/sdio.c | 2 +- drivers/net/wwan/iosm/iosm_ipc_pcie.c | 3 +- drivers/nvme/host/core.c | 3 +- drivers/nvme/host/pci.c | 3 + drivers/pinctrl/pinctrl-amd.c | 36 ++-- drivers/power/supply/axp288_fuel_gauge.c | 2 + drivers/power/supply/cros_usbpd-charger.c | 2 +- drivers/power/supply/rk817_charger.c | 4 - drivers/scsi/ses.c | 20 +-- drivers/video/fbdev/core/fbcon.c | 18 +- drivers/video/fbdev/core/fbmem.c | 2 + fs/btrfs/disk-io.c | 14 ++ fs/btrfs/super.c | 4 +- fs/cifs/smb2pdu.c | 41 +++-- fs/ksmbd/smb2pdu.c | 23 ++- include/linux/trace.h | 12 ++ include/net/bluetooth/hci_core.h | 1 + include/net/bonding.h | 8 +- kernel/cgroup/cpuset.c | 187 +++++++++++++++++---- kernel/cgroup/legacy_freezer.c | 7 +- kernel/cgroup/rstat.c | 4 +- kernel/sched/fair.c | 10 ++ kernel/trace/trace.c | 41 +++-- lib/maple_tree.c | 7 +- net/9p/trans_xen.c | 4 + net/bluetooth/hci_conn.c | 92 ++++++---- net/bluetooth/hci_event.c | 18 +- net/bluetooth/hci_sync.c | 13 +- net/bluetooth/hidp/core.c | 2 +- net/bluetooth/l2cap_core.c | 24 +-- net/bluetooth/sco.c | 16 +- net/core/dev.c | 1 + net/core/skbuff.c | 16 +- net/ipv4/sysctl_net_ipv4.c | 3 + net/ipv4/tcp_ipv4.c | 4 +- net/ipv6/udp.c | 8 +- net/mptcp/options.c | 5 +- net/mptcp/protocol.c | 2 +- net/mptcp/subflow.c | 18 +- net/openvswitch/actions.c | 2 +- net/qrtr/af_qrtr.c | 8 +- net/sctp/stream_interleave.c | 3 +- sound/firewire/tascam/tascam-stream.c | 2 +- sound/i2c/cs8427.c | 7 +- sound/pci/emu10k1/emupcm.c | 14 +- sound/pci/hda/patch_hdmi.c | 2 +- sound/pci/hda/patch_realtek.c | 29 ++++ sound/pci/hda/patch_sigmatel.c | 10 ++ tools/lib/bpf/btf_dump.c | 7 +- tools/testing/radix-tree/maple.c | 16 ++ tools/testing/selftests/bpf/progs/find_vma_fail1.c | 1 + tools/testing/selftests/kvm/include/x86_64/svm.h | 22 ++- .../testing/selftests/kvm/x86_64/hyperv_svm_test.c | 25 +-- .../testing/selftests/net/openvswitch/ovs-dpctl.py | 2 +- 148 files changed, 1551 insertions(+), 663 deletions(-)
Greg Kroah-Hartman
maintainerPATCH 11/134 ALSA: hda/hdmi: disable KAE for Intel DG2
From: Kai Vehmanen <[email protected]>
commit 6ab6f98fcdc9d4fbe245aa67de03542deea65322 upstream.
Use of keep-alive (KAE) has resulted in loss of audio on some A750/770 cards as the transition from keep-alive to stream playback is not working as expected. As there is limited benefit of the new KAE mode on discrete cards, revert back to older silent-stream implementation on these systems.
--- sound/pci/hda/patch_hdmi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
sound/pci/hda/patch_hdmi.c +1 -1
@@ -4604,7 +4604,7 @@ HDA_CODEC_ENTRY(0x80862814, "DG1 HDMI",HDA_CODEC_ENTRY (0x80862815 ,"Alderlake HDMI" , patch_i915_tgl_hdmi),HDA_CODEC_ENTRY (0x80862816 ,"Rocketlake HDMI" , patch_i915_tgl_hdmi),HDA_CODEC_ENTRY (0x80862818 ,"Raptorlake HDMI" , patch_i915_tgl_hdmi), -HDA_CODEC_ENTRY (0x80862819 ,"DG2 HDMI" , patch_i915_adlp_hdmi), +HDA_CODEC_ENTRY (0x80862819 ,"DG2 HDMI" , patch_i915_tgl_hdmi),HDA_CODEC_ENTRY (0x8086281a ,"Jasperlake HDMI" , patch_i915_icl_hdmi),HDA_CODEC_ENTRY (0x8086281b ,"Elkhartlake HDMI" , patch_i915_icl_hdmi), HDA_CODEC_ENTRY(0x8086281c, "Alderlake-P HDMI", patch_i915_adlp_hdmi),
Greg Kroah-Hartman
maintainerPATCH 20/134 mtdblock: tolerate corrected bit-flips
In reply to Greg Kroah-HartmanFrom: Bang Li <[email protected]>
commit 0c3089601f064d80b3838eceb711fcac04bceaad upstream.
mtd_read() may return -EUCLEAN in case of corrected bit-flips.This particular condition should not be treated like an error.
--- drivers/mtd/mtdblock.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-)
drivers/mtd/mtdblock.c +8 -4
@@ -153,7 +153,7 @@ static int do_cached_write (struct mtdbl mtdblk->cache_state =STATE_EMPTY ; ret =mtd_read (mtd, sect_start, sect_size, &retlen, mtdblk->cache_data); -if (ret) +if (ret && !mtd_is_bitflip (ret))return ret;if (retlen != sect_size)return -EIO ;
@@ -188,8 +188,12 @@ static int do_cached_read (struct mtdblkpr_debug ("mtdblock: read on \"%s\" at 0x%lx, size 0x%x\n" , mtd->name, pos, len); -if (!sect_size) -return mtd_read (mtd, pos, len, &retlen, buf); +if (!sect_size) { + ret =mtd_read (mtd, pos, len, &retlen, buf); +if (ret && !mtd_is_bitflip (ret)) +return ret; +return 0 ; + }while (len >0 ) {unsigned long sect_start = (pos/sect_size)*sect_size;
@@ -209,7 +213,7 @@ static int do_cached_read (struct mtdblkmemcpy (buf, mtdblk->cache_data + offset, size); }else { ret =mtd_read (mtd, pos, size, &retlen, buf); -if (ret) +if (ret && !mtd_is_bitflip (ret))return ret;if (retlen != size)return -EIO ;
Greg Kroah-Hartman
maintainerPATCH 21/134 mtd: rawnand: meson: fix bitmask for length in command word
In reply to Greg Kroah-HartmanFrom: Arseniy Krasnov <[email protected]>
commit 93942b70461574ca7fc3d91494ca89b16a4c64c7 upstream.
Valid mask is 0x3FFF, without this patch the following problems were found:
1) [ 0.938914] Could not find a valid ONFI parameter page, trying
bit-wise majority to recover it
[ 0.947384] ONFI parameter recovery failed, aborting
2) Read with disabled ECC mode was broken.
--- drivers/mtd/nand/raw/meson_nand.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/mtd/nand/raw/meson_nand.c +3 -3
@@ -280,7 +280,7 @@ static void meson_nfc_cmd_access(structif (raw) { len = mtd->writesize + mtd->oobsize; - cmd = (len &GENMASK (5 ,0 )) | scrambler |DMA_DIR (dir); + cmd = (len &GENMASK (13 ,0 )) | scrambler |DMA_DIR (dir);writel (cmd, nfc->reg_base +NFC_REG_CMD );return ; }
@@ -544,7 +544,7 @@ static int meson_nfc_read_buf(struct nanif (ret) goto out; - cmd =NFC_CMD_N2M | (len &GENMASK (5 ,0 )); + cmd =NFC_CMD_N2M | (len &GENMASK (13 ,0 ));writel (cmd, nfc->reg_base +NFC_REG_CMD );meson_nfc_drain_cmd (nfc);
@@ -568,7 +568,7 @@ static int meson_nfc_write_buf(struct naif (ret)return ret; - cmd =NFC_CMD_M2N | (len &GENMASK (5 ,0 )); + cmd =NFC_CMD_M2N | (len &GENMASK (13 ,0 ));writel (cmd, nfc->reg_base +NFC_REG_CMD );meson_nfc_drain_cmd (nfc);
Greg Kroah-Hartman
maintainerPATCH 22/134 mtd: rawnand: stm32_fmc2: remove unsupported EDO mode
In reply to Greg Kroah-HartmanFrom: Christophe Kerello <[email protected]>
commit f71e0e329c152c7f11ddfd97ffc62aba152fad3f upstream.
Remove the EDO mode support from as the FMC2 controller does not support the feature.
--- drivers/mtd/nand/raw/stm32_fmc2_nand.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/mtd/nand/raw/stm32_fmc2_nand.c +3 -0
@@ -1531,6 +1531,9 @@ static int stm32_fmc2_nfc_setup_interfacif (IS_ERR (sdrt))return PTR_ERR (sdrt); +if (sdrt->tRC_min <30000 ) +return -EOPNOTSUPP ; +if (chipnr ==NAND_DATA_IFACE_CHECK_ONLY )return 0 ;
Greg Kroah-Hartman
maintainerPATCH 23/134 mtd: rawnand: stm32_fmc2: use timings.mode instead of checking tRC_min
In reply to Greg Kroah-HartmanFrom: Christophe Kerello <[email protected]>
commit ddbb664b6ab8de7dffa388ae0c88cd18616494e5 upstream.
Use timings.mode value instead of checking tRC_min timing for EDO mode support.
--- drivers/mtd/nand/raw/stm32_fmc2_nand.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mtd/nand/raw/stm32_fmc2_nand.c +1 -1
@@ -1531,7 +1531,7 @@ static int stm32_fmc2_nfc_setup_interfacif (IS_ERR (sdrt))return PTR_ERR (sdrt); -if (sdrt->tRC_min <30000 ) +if (conf->timings.mode >3 )return -EOPNOTSUPP ;if (chipnr ==NAND_DATA_IFACE_CHECK_ONLY )
Greg Kroah-Hartman
maintainerPATCH 24/134 KVM: arm64: PMU: Restore the guests EL0 event counting after migration
In reply to Greg Kroah-HartmanFrom: Reiji Watanabe <[email protected]>
commit f9ea835e99bc8d049bf2a3ec8fa5a7cb4fcade23 upstream.
Currently, with VHE, KVM enables the EL0 event counting for the guest on vcpu_load() or KVM enables it as a part of the PMU register emulation process, when needed. However, in the migration case (with VHE), the same handling is lacking, as vPMU register values that were restored by userspace haven't been propagated yet (the PMU events haven't been created) at the vcpu load-time on the first KVM_RUN (kvm_vcpu_pmu_restore_guest() called from vcpu_load() on the first KVM_RUN won't do anything as events_{guest,host} of kvm_pmu_events are still zero).
So, with VHE, enable the guest's EL0 event counting on the first KVM_RUN (after the migration) when needed. More specifically, have kvm_pmu_handle_pmcr() call kvm_vcpu_pmu_restore_guest() so that kvm_pmu_handle_pmcr() on the first KVM_RUN can take care of it.
--- arch/arm64/kvm/pmu-emul.c | 1 + arch/arm64/kvm/sys_regs.c | 1 - 2 files changed, 1 insertion(+), 1 deletion(-)
arch/arm64/kvm/pmu-emul.c +1 -0
@@ -531,6 +531,7 @@ void kvm_pmu_handle_pmcr(struct kvm_vcpufor_each_set_bit (i, &mask,32 )kvm_pmu_set_counter_value (vcpu, i,0 ); } +kvm_vcpu_pmu_restore_guest (vcpu); }static bool kvm_pmu_counter_is_enabled (struct kvm_vcpu *vcpu,u64 select_idx)
arch/arm64/kvm/sys_regs.c +0 -1
@@ -707,7 +707,6 @@ static bool access_pmcr(struct kvm_vcpuif (!kvm_supports_32bit_el0 ()) val |=ARMV8_PMU_PMCR_LC ;kvm_pmu_handle_pmcr (vcpu, val); -kvm_vcpu_pmu_restore_guest (vcpu); }else {/* PMCR.P & PMCR.C are RAZ */ val =__vcpu_sys_reg (vcpu,PMCR_EL0 )
Greg Kroah-Hartman
maintainerPATCH 25/134 fbcon: Fix error paths in set_con2fb_map
In reply to Greg Kroah-HartmanFrom: Daniel Vetter <[email protected]>
commit edf79dd2172233452ff142dcc98b19d955fc8974 upstream.
This is a regressoin introduced in b07db3958485 ("fbcon: Ditch error handling for con2fb_release_oldinfo"). I failed to realize what the if (!err) checks. The mentioned commit was dropping the con2fb_release_oldinfo() return value but the if (!err) was also checking whether the con2fb_acquire_newinfo() function call above failed or not.
Fix this with an early return statement.
Note that there's still a difference compared to the orginal state of the code, the below lines are now also skipped on error:
if (!search_fb_in_map(info_idx)) info_idx = newidx;
These are only needed when we've actually thrown out an old fb_info from the console mappings, which only happens later on.
Also move the fbcon_add_cursor_work() call into the same if block, it's all protected by console_lock so doesn't matter when we set up the blinking cursor delayed work anyway. This further simplifies the control flow and allows us to ditch the found local variable.
v2: Clarify commit message (Javier)
--- drivers/video/fbdev/core/fbcon.c | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-)
drivers/video/fbdev/core/fbcon.c +8 -9
@@ -823,7 +823,7 @@ static int set_con2fb_map(int unit, intint oldidx = con2fb_map[unit];struct fb_info *info = fbcon_registered_fb[newidx];struct fb_info *oldinfo =NULL ; -int found, err =0 , show_logo; +int err =0 , show_logo;WARN_CONSOLE_UNLOCKED ();
@@ -841,26 +841,25 @@ static int set_con2fb_map(int unit, intif (oldidx !=-1 ) oldinfo = fbcon_registered_fb[oldidx]; - found =search_fb_in_map (newidx); - -if (!err && !found) { +if (!search_fb_in_map (newidx)) { err =con2fb_acquire_newinfo (vc, info, unit); -if (!err) - con2fb_map[unit] = newidx; +if (err) +return err; + + con2fb_map[unit] = newidx; +fbcon_add_cursor_work (info); }/* * If old fb is not mapped to any of the consoles, * fbcon should release it. */ -if (!err && oldinfo && !search_fb_in_map (oldidx)) +if (oldinfo && !search_fb_in_map (oldidx))con2fb_release_oldinfo (vc, oldinfo, info); show_logo = (fg_console ==0 && !user && logo_shown !=FBCON_LOGO_DONTSHOW ); -if (!found) -fbcon_add_cursor_work (info); con2fb_map_boot[unit] = newidx;con2fb_init_display (vc, info, unit, show_logo);
Greg Kroah-Hartman
maintainerPATCH 26/134 fbcon: set_con2fb_map needs to set con2fb_map!
In reply to Greg Kroah-HartmanFrom: Daniel Vetter <[email protected]>
commit fffb0b52d5258554c645c966c6cbef7de50b851d upstream.
I got really badly confused in d443d9386472 ("fbcon: move more common code into fb_open()") because we set the con2fb_map before the failure points, which didn't look good.
But in trying to fix that I moved the assignment into the wrong path - we need to do it for _all_ vc we take over, not just the first one (which additionally requires the call to con2fb_acquire_newinfo).
I've figured this out because of a KASAN bug report, where the fbcon_registered_fb and fbcon_display arrays went out of sync in fbcon_mode_deleted() because the con2fb_map pointed at the old fb_info, but the modes and everything was updated for the new one.
--- drivers/video/fbdev/core/fbcon.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/video/fbdev/core/fbcon.c +2 -1
@@ -846,10 +846,11 @@ static int set_con2fb_map(int unit, intif (err)return err; - con2fb_map[unit] = newidx;fbcon_add_cursor_work (info); } + con2fb_map[unit] = newidx; +/* * If old fb is not mapped to any of the consoles, * fbcon should release it.
Greg Kroah-Hartman
maintainerPATCH 27/134 drm/i915/dsi: fix DSS CTL register offsets for TGL+
In reply to Greg Kroah-HartmanFrom: Jani Nikula <[email protected]>
commit 6b8446859c971a5783a2cdc90adf32e64de3bd23 upstream.
On TGL+ the DSS control registers are at different offsets, and there's one per pipe. Fix the offsets to fix dual link DSI for TGL+.
There would be helpers for this in the DSC code, but just do the quick fix now for DSI. Long term, we should probably move all the DSS handling into intel_vdsc.c, so exporting the helpers seems counter-productive.
--- drivers/gpu/drm/i915/display/icl_dsi.c | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-)
drivers/gpu/drm/i915/display/icl_dsi.c +16 -4
@@ -299,9 +299,21 @@ static void configure_dual_link_mode(str {struct drm_i915_private *dev_priv =to_i915 (encoder->base.dev);struct intel_dsi *intel_dsi =enc_to_intel_dsi (encoder); +i915_reg_t dss_ctl1_reg, dss_ctl2_reg;u32 dss_ctl1; - dss_ctl1 =intel_de_read (dev_priv,DSS_CTL1 ); +/* FIXME: Move all DSS handling to intel_vdsc.c */ +if (DISPLAY_VER (dev_priv) >=12 ) { +struct intel_crtc *crtc =to_intel_crtc (pipe_config->uapi.crtc); + + dss_ctl1_reg =ICL_PIPE_DSS_CTL1 (crtc->pipe); + dss_ctl2_reg =ICL_PIPE_DSS_CTL2 (crtc->pipe); + }else { + dss_ctl1_reg =DSS_CTL1 ; + dss_ctl2_reg =DSS_CTL2 ; + } + + dss_ctl1 =intel_de_read (dev_priv, dss_ctl1_reg); dss_ctl1 |=SPLITTER_ENABLE ; dss_ctl1 &= ~OVERLAP_PIXELS_MASK ; dss_ctl1 |=OVERLAP_PIXELS (intel_dsi->pixel_overlap);
@@ -322,16 +334,16 @@ static void configure_dual_link_mode(str dss_ctl1 &= ~LEFT_DL_BUF_TARGET_DEPTH_MASK ; dss_ctl1 |=LEFT_DL_BUF_TARGET_DEPTH (dl_buffer_depth); - dss_ctl2 =intel_de_read (dev_priv,DSS_CTL2 ); + dss_ctl2 =intel_de_read (dev_priv, dss_ctl2_reg); dss_ctl2 &= ~RIGHT_DL_BUF_TARGET_DEPTH_MASK ; dss_ctl2 |=RIGHT_DL_BUF_TARGET_DEPTH (dl_buffer_depth); -intel_de_write (dev_priv,DSS_CTL2 , dss_ctl2); +intel_de_write (dev_priv, dss_ctl2_reg, dss_ctl2); }else {/* Interleave */ dss_ctl1 |=DUAL_LINK_MODE_INTERLEAVE ; } -intel_de_write (dev_priv,DSS_CTL1 , dss_ctl1); +intel_de_write (dev_priv, dss_ctl1_reg, dss_ctl1); }/* aka DSI 8X clock */
Greg Kroah-Hartman
maintainerPATCH 28/134 clk: sprd: set max_register according to mapping range
In reply to Greg Kroah-HartmanFrom: Chunyan Zhang <[email protected]>
[ Upstream commit 47d43086531f10539470a63e8ad92803e686a3dd ]
In sprd clock driver, regmap_config.max_register was set to a fixed value which is likely larger than the address range configured in device tree, when reading registers through debugfs it would cause access violation.
--- drivers/clk/sprd/common.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-)
drivers/clk/sprd/common.c +6 -3
@@ -17,7 +17,6 @@ static const struct regmap_config sprdclk_regmap_config = { .reg_bits = 32, .reg_stride = 4, .val_bits = 32, - .max_register = 0xffff, .fast_io = true, };
@@ -43,6 +42,8 @@ int sprd_clk_regmap_init(struct platform_device *pdev,struct device *dev = &pdev->dev;struct device_node *node = dev->of_node, *np;struct regmap *regmap; +struct resource *res; +struct regmap_config reg_config = sprdclk_regmap_config;if (of_find_property (node,"sprd,syscon" ,NULL )) { regmap =syscon_regmap_lookup_by_phandle (node,"sprd,syscon" );
@@ -59,12 +60,14 @@ int sprd_clk_regmap_init(struct platform_device *pdev,return PTR_ERR (regmap); } }else { - base =devm_platform_ioremap_resource (pdev,0 ); + base =devm_platform_get_and_ioremap_resource (pdev,0 , &res);if (IS_ERR (base))return PTR_ERR (base); + reg_config.max_register =resource_size (res) - reg_config.reg_stride; + regmap =devm_regmap_init_mmio (&pdev->dev, base, - &sprdclk_regmap_config); + ®_config);if (IS_ERR (regmap)) {pr_err ("failed to init regmap\n" );return PTR_ERR (regmap);
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 29/134 RDMA/irdma: Do not generate SW completions for NOPs
In reply to Greg Kroah-HartmanFrom: Mustafa Ismail <[email protected]>
[ Upstream commit 30ed9ee9a10a90ae719dcfcacead1d0506fa45ed ]
Currently, artificial SW completions are generated for NOP wqes which can generate unexpected completions with wr_id = 0. Skip the generation of artificial completions for NOPs.
--- drivers/infiniband/hw/irdma/utils.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/infiniband/hw/irdma/utils.c +4 -1
@@ -2595,7 +2595,10 @@ void irdma_generate_flush_completions(struct irdma_qp *iwqp)/* remove the SQ WR by moving SQ tail*/ IRDMA_RING_SET_TAIL (*sq_ring, sq_ring->tail + qp->sq_wrtrk_array[sq_ring->tail].quanta); - +if (cmpl->cpi.op_type ==IRDMAQP_OP_NOP ) { +kfree (cmpl); +continue ; + }ibdev_dbg (iwqp->iwscq->ibcq.device,"DEV: %s: adding wr_id = 0x%llx SQ Completion to list qp_id=%d\n" , __func__, cmpl->cpi.wr_id, qp->qp_id);
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 12/134 Bluetooth: L2CAP: Fix use-after-free in l2cap_disconnect_{req,rsp}
In reply to Greg Kroah-HartmanFrom: Luiz Augusto von Dentz <[email protected]>
commit a2a9339e1c9deb7e1e079e12e27a0265aea8421a upstream.
Similar to commit d0be8347c623 ("Bluetooth: L2CAP: Fix use-after-free caused by l2cap_chan_put"), just use l2cap_chan_hold_unless_zero to prevent referencing a channel that is about to be destroyed.
--- net/bluetooth/l2cap_core.c | 24 ++++++------------------ 1 file changed, 6 insertions(+), 18 deletions(-)
net/bluetooth/l2cap_core.c +6 -18
@@ -4652,33 +4652,27 @@ static inline int l2cap_disconnect_req(sBT_DBG ("scid 0x%4.4x dcid 0x%4.4x" , scid, dcid); -mutex_lock (&conn->chan_lock); - - chan =__l2cap_get_chan_by_scid (conn, dcid); + chan =l2cap_get_chan_by_scid (conn, dcid);if (!chan) { -mutex_unlock (&conn->chan_lock);cmd_reject_invalid_cid (conn, cmd->ident, dcid, scid);return 0 ; } -l2cap_chan_hold (chan); -l2cap_chan_lock (chan); - rsp.dcid =cpu_to_le16 (chan->scid); rsp.scid =cpu_to_le16 (chan->dcid);l2cap_send_cmd (conn, cmd->ident,L2CAP_DISCONN_RSP ,sizeof (rsp), &rsp); chan->ops->set_shutdown (chan); +mutex_lock (&conn->chan_lock);l2cap_chan_del (chan,ECONNRESET ); +mutex_unlock (&conn->chan_lock); chan->ops->close (chan);l2cap_chan_unlock (chan);l2cap_chan_put (chan); -mutex_unlock (&conn->chan_lock); -return 0 ; }
@@ -4698,33 +4692,27 @@ static inline int l2cap_disconnect_rsp(sBT_DBG ("dcid 0x%4.4x scid 0x%4.4x" , dcid, scid); -mutex_lock (&conn->chan_lock); - - chan =__l2cap_get_chan_by_scid (conn, scid); + chan =l2cap_get_chan_by_scid (conn, scid);if (!chan) {mutex_unlock (&conn->chan_lock);return 0 ; } -l2cap_chan_hold (chan); -l2cap_chan_lock (chan); -if (chan->state !=BT_DISCONN ) {l2cap_chan_unlock (chan);l2cap_chan_put (chan); -mutex_unlock (&conn->chan_lock);return 0 ; } +mutex_lock (&conn->chan_lock);l2cap_chan_del (chan,0 ); +mutex_unlock (&conn->chan_lock); chan->ops->close (chan);l2cap_chan_unlock (chan);l2cap_chan_put (chan); -mutex_unlock (&conn->chan_lock); -return 0 ; }
Greg Kroah-Hartman
maintainerPATCH 30/134 RDMA/irdma: Fix memory leak of PBLE objects
In reply to Greg Kroah-HartmanFrom: Mustafa Ismail <[email protected]>
[ Upstream commit b69a6979dbaa2453675fe9c71bdc2497fedb11f9 ]
On rmmod of irdma, the PBLE object memory is not being freed. PBLE object memory are not statically pre-allocated at function initialization time unlike other HMC objects. PBLEs objects and the Segment Descriptors (SD) for it can be dynamically allocated during scale up and SD's remain allocated till function deinitialization.
Fix this leak by adding IRDMA_HMC_IW_PBLE to the iw_hmc_obj_types[] table and skip pbles in irdma_create_hmc_obj but not in irdma_del_hmc_objects().
--- drivers/infiniband/hw/irdma/hw.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/infiniband/hw/irdma/hw.c +3 -0
@@ -41,6 +41,7 @@ static enum irdma_hmc_rsrc_type iw_hmc_obj_types[] = {IRDMA_HMC_IW_XFFL ,IRDMA_HMC_IW_Q1 ,IRDMA_HMC_IW_Q1FL , +IRDMA_HMC_IW_PBLE ,IRDMA_HMC_IW_TIMER ,IRDMA_HMC_IW_FSIMC , IRDMA_HMC_IW_FSIAV,
@@ -827,6 +828,8 @@ static int irdma_create_hmc_objs(struct irdma_pci_f *rf, bool privileged, info.entry_type = rf->sd_type;for (i =0 ; i <IW_HMC_OBJ_TYPE_NUM ; i++) { +if (iw_hmc_obj_types[i] ==IRDMA_HMC_IW_PBLE ) +continue ;if (dev->hmc_info->hmc_obj[iw_hmc_obj_types[i]].cnt) { info.rsrc_type = iw_hmc_obj_types[i]; info.count = dev->hmc_info->hmc_obj[info.rsrc_type].cnt;
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 31/134 RDMA/irdma: Increase iWARP CM default rexmit count
In reply to Greg Kroah-HartmanFrom: Mustafa Ismail <[email protected]>
[ Upstream commit 8385a875c9eecc429b2f72970efcbb0e5cb5b547 ]
When running perftest with large number of connections in iWARP mode, the passive side could be slow to respond. Increase the rexmit counter default to allow scaling connections.
--- drivers/infiniband/hw/irdma/cm.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/infiniband/hw/irdma/cm.h +1 -1
@@ -41,7 +41,7 @@#define TCP_OPTIONS_PADDING 3#define IRDMA_DEFAULT_RETRYS 64 -#define IRDMA_DEFAULT_RETRANS 8 +#define IRDMA_DEFAULT_RETRANS 32#define IRDMA_DEFAULT_TTL 0x40#define IRDMA_DEFAULT_RTT_VAR 6#define IRDMA_DEFAULT_SS_THRESH 0x3fffffff
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 32/134 RDMA/irdma: Add ipv4 check to irdma_find_listener()
In reply to Greg Kroah-HartmanFrom: Tatyana Nikolova <[email protected]>
[ Upstream commit e4522c097ec10f23ea0933e9e69d4fa9d8ae9441 ]
Add ipv4 check to irdma_find_listener(). Otherwise the function incorrectly finds and returns a listener with a different addr family for the zero IP addr, if a listener with a zero IP addr and the same port as the one searched for has already been created.
--- drivers/infiniband/hw/irdma/cm.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-)
drivers/infiniband/hw/irdma/cm.c +10 -6
@@ -1458,13 +1458,15 @@ static int irdma_send_fin(struct irdma_cm_node *cm_node)* irdma_find_listener - find a cm node listening on this addr-port pair * @cm_core: cm's core * @dst_addr: listener ip addr +* @ipv4: flag indicating IPv4 when true * @dst_port: listener tcp port num * @vlan_id: virtual LAN ID * @listener_state: state to match with listen node's */ static struct irdma_cm_listener * -irdma_find_listener (struct irdma_cm_core *cm_core,u32 *dst_addr,u16 dst_port, -u16 vlan_id,enum irdma_cm_listener_state listener_state) +irdma_find_listener (struct irdma_cm_core *cm_core,u32 *dst_addr,bool ipv4, +u16 dst_port,u16 vlan_id, +enum irdma_cm_listener_state listener_state) {struct irdma_cm_listener *listen_node;static const u32 ip_zero[4 ] = {0 ,0 ,0 ,0 };
@@ -1477,7 +1479,7 @@ irdma_find_listener(struct irdma_cm_core *cm_core, u32 *dst_addr, u16 dst_port, list_for_each_entry (listen_node, &cm_core->listen_list, list) {memcpy (listen_addr, listen_node->loc_addr,sizeof (listen_addr)); listen_port = listen_node->loc_port; -if (listen_port != dst_port || +if (listen_node->ipv4 != ipv4 || listen_port != dst_port || !(listener_state & listen_node->listener_state))continue ;/* compare node pair, return node handle if a match */
@@ -2902,9 +2904,10 @@ irdma_make_listen_node(struct irdma_cm_core *cm_core,unsigned long flags;/* cannot have multiple matching listeners */ - listener =irdma_find_listener (cm_core, cm_info->loc_addr, - cm_info->loc_port, cm_info->vlan_id, -IRDMA_CM_LISTENER_EITHER_STATE ); + listener = +irdma_find_listener (cm_core, cm_info->loc_addr, cm_info->ipv4, + cm_info->loc_port, cm_info->vlan_id, +IRDMA_CM_LISTENER_EITHER_STATE );if (listener && listener->listener_state ==IRDMA_CM_LISTENER_ACTIVE_STATE ) {refcount_dec (&listener->refcnt);
@@ -3153,6 +3156,7 @@ void irdma_receive_ilq(struct irdma_sc_vsi *vsi, struct irdma_puda_buf *rbuf) listener =irdma_find_listener (cm_core, cm_info.loc_addr, + cm_info.ipv4, cm_info.loc_port, cm_info.vlan_id,IRDMA_CM_LISTENER_ACTIVE_STATE );
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 33/134 IB/mlx5: Add support for 400G_8X lane speed
In reply to Greg Kroah-HartmanFrom: Maher Sanalla <[email protected]>
[ Upstream commit 88c9483faf15ada14eca82714114656893063458 ]
Currently, when driver queries PTYS to report which link speed is being used on its RoCE ports, it does not check the case of having 400Gbps transmitted over 8 lanes. Thus it fails to report the said speed and instead it defaults to report 10G over 4 lanes.
Add a check for the said speed when querying PTYS and report it back correctly when needed.
--- drivers/infiniband/hw/mlx5/main.c | 4 ++++ 1 file changed, 4 insertions(+)
drivers/infiniband/hw/mlx5/main.c +4 -0
@@ -442,6 +442,10 @@ static int translate_eth_ext_proto_oper(u32 eth_proto_oper, u16 *active_speed, *active_width =IB_WIDTH_2X ; *active_speed =IB_SPEED_NDR ;break ; +case MLX5E_PROT_MASK (MLX5E_400GAUI_8 ): + *active_width =IB_WIDTH_8X ; + *active_speed =IB_SPEED_HDR ; +break ;case MLX5E_PROT_MASK (MLX5E_400GAUI_4_400GBASE_CR4_KR4 ): *active_width =IB_WIDTH_4X ; *active_speed =IB_SPEED_NDR ;
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 34/134 RDMA/erdma: Update default EQ depth to 4096 and max_send_wr to 8192
In reply to Greg Kroah-HartmanFrom: Cheng Xu <[email protected]>
[ Upstream commit 6256aa9ae955d10ec73a434533ca62034eff1b76 ]
Max EQ depth of hardware is 32K, the current default EQ depth is too small for some applications, so change the default depth to 4096. Max send WRs the hardware can support is 8K, but the driver limits the value to 4K. Remove this limitation.
--- drivers/infiniband/hw/erdma/erdma_hw.h | 2 +- drivers/infiniband/hw/erdma/erdma_verbs.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
drivers/infiniband/hw/erdma/erdma_hw.h +1 -1
@@ -420,7 +420,7 @@ struct erdma_reg_mr_sqe { };/* EQ related. */ -#define ERDMA_DEFAULT_EQ_DEPTH 256 +#define ERDMA_DEFAULT_EQ_DEPTH 4096/* ceqe */ #define ERDMA_CEQE_HDR_DB_MASK BIT_ULL(63)
drivers/infiniband/hw/erdma/erdma_verbs.h +1 -1
@@ -11,7 +11,7 @@/* RDMA Capability. */ #define ERDMA_MAX_PD (128 * 1024) -#define ERDMA_MAX_SEND_WR 4096 +#define ERDMA_MAX_SEND_WR 8192#define ERDMA_MAX_ORD 128#define ERDMA_MAX_IRD 128#define ERDMA_MAX_SGE_RD 1
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 35/134 RDMA/erdma: Inline mtt entries into WQE if supported
In reply to Greg Kroah-HartmanFrom: Cheng Xu <[email protected]>
[ Upstream commit 0dd83a4d7756713f81990d6c5547500f212a1190 ]
The max inline mtt count supported is ERDMA_MAX_INLINE_MTT_ENTRIES. When mr->mem.mtt_nents == ERDMA_MAX_INLINE_MTT_ENTRIES, inline mtt is also supported, fix it.
--- drivers/infiniband/hw/erdma/erdma_qp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/infiniband/hw/erdma/erdma_qp.c +1 -1
@@ -402,7 +402,7 @@ static int erdma_push_one_sqe(struct erdma_qp *qp, u16 *pi,FIELD_PREP (ERDMA_SQE_MR_MTT_CNT_MASK , mr->mem.mtt_nents); -if (mr->mem.mtt_nents <ERDMA_MAX_INLINE_MTT_ENTRIES ) { +if (mr->mem.mtt_nents <=ERDMA_MAX_INLINE_MTT_ENTRIES ) { attrs |=FIELD_PREP (ERDMA_SQE_MR_MTT_TYPE_MASK ,0 );/* Copy SGLs to SQE content to accelerate */ memcpy(get_queue_entry(qp->kern_qp.sq_buf, idx + 1,
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 36/134 RDMA/erdma: Defer probing if netdevice can not be found
In reply to Greg Kroah-HartmanFrom: Cheng Xu <[email protected]>
[ Upstream commit 6bd1bca858f1734a75572a788213d1e1143f2f0a ]
ERDMA device may be probed before its associated netdevice, returning -EPROBE_DEFER allows OS try to probe erdma device later.
--- drivers/infiniband/hw/erdma/erdma_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/infiniband/hw/erdma/erdma_main.c +1 -1
@@ -56,7 +56,7 @@ static int erdma_netdev_event(struct notifier_block *nb, unsigned long event,static int erdma_enum_and_get_netdev (struct erdma_dev *dev) {struct net_device *netdev; -int ret = -ENODEV ; +int ret = -EPROBE_DEFER ;/* Already binded to a net_device, so we skip. */ if (dev->netdev)
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 37/134 clk: rs9: Fix suspend/resume
In reply to Greg Kroah-HartmanFrom: Alexander Stein <[email protected]>
[ Upstream commit 632e04739c8f45c2d9ca4d4c5bd18d80c2ac9296 ]
Disabling the cache in commit 2ff4ba9e3702 ("clk: rs9: Fix I2C accessors") without removing cache synchronization in resume path results in a kernel panic as map->cache_ops is unset, due to REGCACHE_NONE. Enable flat cache again to support resume again. num_reg_defaults_raw is necessary to read the cache defaults from hardware. Some registers are strapped in hardware and cannot be provided in software.
--- drivers/clk/clk-renesas-pcie.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/clk/clk-renesas-pcie.c +2 -1
@@ -144,8 +144,9 @@ static int rs9_regmap_i2c_read(void *context,static const struct regmap_config rs9_regmap_config = { .reg_bits =8 , .val_bits =8 , - .cache_type =REGCACHE_NONE , + .cache_type =REGCACHE_FLAT , .max_register =RS9_REG_BCP , + .num_reg_defaults_raw =0x8 , .rd_table = &rs9_readable_table, .wr_table = &rs9_writeable_table, .reg_write = rs9_regmap_i2c_write,
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 38/134 RDMA/cma: Allow UD qp_type to join multicast only
In reply to Greg Kroah-HartmanFrom: Mark Zhang <[email protected]>
[ Upstream commit 58e84f6b3e84e46524b7e5a916b53c1ad798bc8f ]
As for multicast:
- The SIDR is the only mode that makes sense;
- Besides PS_UDP, other port spaces like PS_IB is also allowed, as it is UD compatible. In this case qkey also needs to be set [1].
This patch allows only UD qp_type to join multicast, and set qkey to default if it's not set, to fix an uninit-value error: the ib->rec.qkey field is accessed without being initialized.
=====================================================
BUG: KMSAN: uninit-value in cma_set_qkey drivers/infiniband/core/cma.c:510 [inline] BUG: KMSAN: uninit-value in cma_make_mc_event+0xb73/0xe00 drivers/infiniband/core/cma.c:4570 cma_set_qkey drivers/infiniband/core/cma.c:510 [inline] cma_make_mc_event+0xb73/0xe00 drivers/infiniband/core/cma.c:4570 cma_iboe_join_multicast drivers/infiniband/core/cma.c:4782 [inline] rdma_join_multicast+0x2b83/0x30a0 drivers/infiniband/core/cma.c:4814 ucma_process_join+0xa76/0xf60 drivers/infiniband/core/ucma.c:1479 ucma_join_multicast+0x1e3/0x250 drivers/infiniband/core/ucma.c:1546 ucma_write+0x639/0x6d0 drivers/infiniband/core/ucma.c:1732 vfs_write+0x8ce/0x2030 fs/read_write.c:588 ksys_write+0x28c/0x520 fs/read_write.c:643 __do_sys_write fs/read_write.c:655 [inline] __se_sys_write fs/read_write.c:652 [inline] __ia32_sys_write+0xdb/0x120 fs/read_write.c:652 do_syscall_32_irqs_on arch/x86/entry/common.c:114 [inline] __do_fast_syscall_32+0x96/0xf0 arch/x86/entry/common.c:180 do_fast_syscall_32+0x34/0x70 arch/x86/entry/common.c:205 do_SYSENTER_32+0x1b/0x20 arch/x86/entry/common.c:248 entry_SYSENTER_compat_after_hwframe+0x4d/0x5c
Local variable ib.i created at:
cma_iboe_join_multicast drivers/infiniband/core/cma.c:4737 [inline] rdma_join_multicast+0x586/0x30a0 drivers/infiniband/core/cma.c:4814 ucma_process_join+0xa76/0xf60 drivers/infiniband/core/ucma.c:1479 CPU: 0 PID: 29874 Comm: syz-executor.3 Not tainted 5.16.0-rc3-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 =====================================================
[1] https://lore.kernel.org/linux-rdma/[email protected]/
--- drivers/infiniband/core/cma.c | 60 ++++++++++++++++++++--------------- 1 file changed, 34 insertions(+), 26 deletions(-)
drivers/infiniband/core/cma.c +34 -26
@@ -624,22 +624,11 @@ static inline unsigned short cma_family(struct rdma_id_private *id_priv)return id_priv->id.route.addr.src_addr.ss_family; } -static int cma_set_qkey (struct rdma_id_private *id_priv,u32 qkey) +static int cma_set_default_qkey (struct rdma_id_private *id_priv) {struct ib_sa_mcmember_rec rec;int ret =0 ; -if (id_priv->qkey) { -if (qkey && id_priv->qkey != qkey) -return -EINVAL ; -return 0 ; - } - -if (qkey) { - id_priv->qkey = qkey; -return 0 ; - } -switch (id_priv->id.ps) {case RDMA_PS_UDP :case RDMA_PS_IB :
@@ -659,6 +648,16 @@ static int cma_set_qkey(struct rdma_id_private *id_priv, u32 qkey)return ret; } +static int cma_set_qkey (struct rdma_id_private *id_priv,u32 qkey) +{ +if (!qkey || + (id_priv->qkey && (id_priv->qkey != qkey))) +return -EINVAL ; + + id_priv->qkey = qkey; +return 0 ; +} +static void cma_translate_ib (struct sockaddr_ib *sib,struct rdma_dev_addr *dev_addr) { dev_addr->dev_type =ARPHRD_INFINIBAND ;
@@ -1229,7 +1228,7 @@ static int cma_ib_init_qp_attr(struct rdma_id_private *id_priv, *qp_attr_mask =IB_QP_STATE |IB_QP_PKEY_INDEX |IB_QP_PORT ;if (id_priv->id.qp_type ==IB_QPT_UD ) { - ret =cma_set_qkey (id_priv,0 ); + ret =cma_set_default_qkey (id_priv);if (ret)return ret;
@@ -4558,7 +4557,10 @@ static int cma_send_sidr_rep(struct rdma_id_private *id_priv,memset (&rep,0 ,sizeof rep); rep.status = status;if (status ==IB_SIDR_SUCCESS ) { - ret =cma_set_qkey (id_priv, qkey); +if (qkey) + ret =cma_set_qkey (id_priv, qkey); +else + ret =cma_set_default_qkey (id_priv);if (ret)return ret; rep.qp_num = id_priv->qp_num;
@@ -4763,9 +4765,7 @@ static void cma_make_mc_event(int status, struct rdma_id_private *id_priv,enum ib_gid_type gid_type;struct net_device *ndev; -if (!status) - status =cma_set_qkey (id_priv,be32_to_cpu (multicast->rec.qkey)); -else +if (status)pr_debug_ratelimited ("RDMA CM: MULTICAST_ERROR: failed to join multicast. status %d\n" , status);
@@ -4793,7 +4793,7 @@ static void cma_make_mc_event(int status, struct rdma_id_private *id_priv, } event->param.ud.qp_num =0xFFFFFF ; - event->param.ud.qkey =be32_to_cpu (multicast->rec.qkey); + event->param.ud.qkey = id_priv->qkey; out:if (ndev)
@@ -4812,8 +4812,11 @@ static int cma_ib_mc_handler(int status, struct ib_sa_multicast *multicast) READ_ONCE(id_priv->state) == RDMA_CM_DESTROYING) goto out; -cma_make_mc_event (status, id_priv, multicast, &event, mc); - ret =cma_cm_event_handler (id_priv, &event); + ret =cma_set_qkey (id_priv,be32_to_cpu (multicast->rec.qkey)); +if (!ret) { +cma_make_mc_event (status, id_priv, multicast, &event, mc); + ret =cma_cm_event_handler (id_priv, &event); + }rdma_destroy_ah_attr (&event.param.ud.ah_attr);WARN_ON (ret);
@@ -4866,9 +4869,11 @@ static int cma_join_ib_multicast(struct rdma_id_private *id_priv,if (ret)return ret; - ret =cma_set_qkey (id_priv,0 ); -if (ret) -return ret; +if (!id_priv->qkey) { + ret =cma_set_default_qkey (id_priv); +if (ret) +return ret; + }cma_set_mgid (id_priv, (struct sockaddr *) &mc->addr, &rec.mgid); rec.qkey =cpu_to_be32 (id_priv->qkey);
@@ -4945,9 +4950,6 @@ static int cma_iboe_join_multicast(struct rdma_id_private *id_priv,cma_iboe_set_mgid (addr, &ib.rec.mgid, gid_type); ib.rec.pkey =cpu_to_be16 (0xffff ); -if (id_priv->id.ps ==RDMA_PS_UDP ) - ib.rec.qkey =cpu_to_be32 (RDMA_UDP_QKEY ); -if (dev_addr->bound_dev_if) ndev =dev_get_by_index (dev_addr->net, dev_addr->bound_dev_if);if (!ndev)
@@ -4973,6 +4975,9 @@ static int cma_iboe_join_multicast(struct rdma_id_private *id_priv,if (err || !ib.rec.mtu)return err ?: -EINVAL ; +if (!id_priv->qkey) +cma_set_default_qkey (id_priv); +rdma_ip2gid ((struct sockaddr *)&id_priv->id.route.addr.src_addr, &ib.rec.port_gid);INIT_WORK (&mc->iboe_join.work, cma_iboe_join_work_handler);
@@ -4998,6 +5003,9 @@ int rdma_join_multicast(struct rdma_cm_id *id, struct sockaddr *addr, READ_ONCE(id_priv->state) != RDMA_CM_ADDR_RESOLVED))return -EINVAL ; +if (id_priv->id.qp_type !=IB_QPT_UD ) +return -EINVAL ; + mc =kzalloc (sizeof (*mc),GFP_KERNEL );if (!mc)return -ENOMEM ;
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 39/134 bpf: tcp: Use sock_gen_put instead of sock_put in bpf_iter_tcp
In reply to Greg Kroah-HartmanFrom: Martin KaFai Lau <[email protected]>
[ Upstream commit 580031ff9952b7dbf48dedba6b56a100ae002bef ]
While reviewing the udp-iter batching patches, noticed the bpf_iter_tcp calling sock_put() is incorrect. It should call sock_gen_put instead because bpf_iter_tcp is iterating the ehash table which has the req sk and tw sk. This patch replaces all sock_put with sock_gen_put in the bpf_iter_tcp codepath.
--- net/ipv4/tcp_ipv4.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
net/ipv4/tcp_ipv4.c +2 -2
@@ -2728,7 +2728,7 @@ static int tcp_prog_seq_show(struct bpf_prog *prog, struct bpf_iter_meta *meta,static void bpf_iter_tcp_put_batch (struct bpf_tcp_iter_state *iter) {while (iter->cur_sk < iter->end_sk) -sock_put (iter->batch[iter->cur_sk++]); +sock_gen_put (iter->batch[iter->cur_sk++]); } static int bpf_iter_tcp_realloc_batch(struct bpf_tcp_iter_state *iter,
@@ -2889,7 +2889,7 @@ static void *bpf_iter_tcp_seq_next(struct seq_file *seq, void *v, loff_t *pos)* st->bucket. See tcp_seek_last_pos(). */ st->offset++; -sock_put (iter->batch[iter->cur_sk++]); +sock_gen_put (iter->batch[iter->cur_sk++]); }if (iter->cur_sk < iter->end_sk)
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 13/134 Bluetooth: Fix race condition in hidp_session_thread
In reply to Greg Kroah-HartmanFrom: Min Li <[email protected]>
commit c95930abd687fcd1aa040dc4fe90dff947916460 upstream.
There is a potential race condition in hidp_session_thread that may lead to use-after-free. For instance, the timer is active while hidp_del_timer is called in hidp_session_thread(). After hidp_session_put, then 'session' will be freed, causing kernel panic when hidp_idle_timeout is running.
The solution is to use del_timer_sync instead of del_timer.
Here is the call trace:
? hidp_session_probe+0x780/0x780 call_timer_fn+0x2d/0x1e0 __run_timers.part.0+0x569/0x940 hidp_session_probe+0x780/0x780 call_timer_fn+0x1e0/0x1e0 ktime_get+0x5c/0xf0 lapic_next_deadline+0x2c/0x40 clockevents_program_event+0x205/0x320 run_timer_softirq+0xa9/0x1b0 __do_softirq+0x1b9/0x641 __irq_exit_rcu+0xdc/0x190 irq_exit_rcu+0xe/0x20 sysvec_apic_timer_interrupt+0xa1/0xc0
--- net/bluetooth/hidp/core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/bluetooth/hidp/core.c +1 -1
@@ -433,7 +433,7 @@ static void hidp_set_timer(struct hidp_sstatic void hidp_del_timer (struct hidp_session *session) {if (session->idle_to >0 ) -del_timer (&session->timer); +del_timer_sync (&session->timer); } static void hidp_process_report(struct hidp_session *session, int type,
Greg Kroah-Hartman
maintainerPATCH 40/134 LoongArch, bpf: Fix jit to skip speculation barrier opcode
In reply to Greg Kroah-HartmanFrom: George Guo <[email protected]>
[ Upstream commit a6f6a95f25803500079513780d11a911ce551d76 ]
Just skip the opcode(BPF_ST | BPF_NOSPEC) in the BPF JIT instead of failing to JIT the entire program, given LoongArch currently has no couterpart of a speculation barrier instruction. To verify the issue, use the ltp testcase as shown below.
Also, Wang says:
I can confirm there's currently no speculation barrier equivalent on LonogArch. (Loongson says there are builtin mitigations for Spectre-V1 and V2 on their chips, and AFAIK efforts to port the exploits to mips/LoongArch have all failed a few years ago.)
Without this patch:
$ ./bpf_prog02 [...] bpf_common.c:123: TBROK: Failed verification: ??? (524) [...] Summary: passed 0 failed 0 broken 1 skipped 0 warnings 0
With this patch:
$ ./bpf_prog02 [...] Summary: passed 0 failed 0 broken 0 skipped 0 warnings 0
--- arch/loongarch/net/bpf_jit.c | 4 ++++ 1 file changed, 4 insertions(+)
arch/loongarch/net/bpf_jit.c +4 -0
@@ -955,6 +955,10 @@ static int build_insn(const struct bpf_insn *insn, struct jit_ctx *ctx, bool extemit_atomic (insn, ctx);break ; +/* Speculation barrier */ +case BPF_ST |BPF_NOSPEC : +break ; +default :pr_err ("bpf_jit: unknown opcode %02x\n" , code);return -EINVAL ;
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 41/134 dmaengine: apple-admac: Handle global interrupt flags
In reply to Greg Kroah-HartmanFrom: Martin Povišer <[email protected]>
[ Upstream commit a288fd158fbf85c06a9ac01cecabf97ac5d962e7 ]
In addition to TX channel and RX channel interrupt flags there's another class of 'global' interrupt flags with unknown semantics. Those weren't being handled up to now, and they are the suspected cause of stuck IRQ states that have been sporadically occurring. Check the global flags and clear them if raised.
--- drivers/dma/apple-admac.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-)
drivers/dma/apple-admac.c +10 -2
@@ -75,6 +75,7 @@#define REG_TX_INTSTATE (idx) (0x0030 + (idx) * 4)#define REG_RX_INTSTATE (idx) (0x0040 + (idx) * 4) +#define REG_GLOBAL_INTSTATE (idx) (0x0050 + (idx) * 4)#define REG_CHAN_INTSTATUS (ch, idx) (0x8010 + (ch) * 0x200 + (idx) * 4)#define REG_CHAN_INTMASK (ch, idx) (0x8020 + (ch) * 0x200 + (idx) * 4)
@@ -672,13 +673,14 @@ static void admac_handle_chan_int(struct admac_data *ad, int no)static irqreturn_t admac_interrupt (int irq,void *devid) {struct admac_data *ad = devid; -u32 rx_intstate, tx_intstate; +u32 rx_intstate, tx_intstate, global_intstate;int i; rx_intstate =readl_relaxed (ad->base +REG_RX_INTSTATE (ad->irq_index)); tx_intstate =readl_relaxed (ad->base +REG_TX_INTSTATE (ad->irq_index)); + global_intstate =readl_relaxed (ad->base +REG_GLOBAL_INTSTATE (ad->irq_index)); -if (!tx_intstate && !rx_intstate) +if (!tx_intstate && !rx_intstate && !global_intstate)return IRQ_NONE ;for (i =0 ; i < ad->nchannels; i +=2 ) {
@@ -693,6 +695,12 @@ static irqreturn_t admac_interrupt(int irq, void *devid) rx_intstate >>=1 ; } +if (global_intstate) { +dev_warn (ad->dev,"clearing unknown global interrupt flag: %x\n" , + global_intstate); +writel_relaxed (~(u32 )0 , ad->base +REG_GLOBAL_INTSTATE (ad->irq_index)); + } +return IRQ_HANDLED ; }
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 14/134 bluetooth: btbcm: Fix logic error in forming the board name.
In reply to Greg Kroah-HartmanFrom: Sasha Finkelstein <[email protected]>
commit b76abe4648c1acc791a207e7c08d1719eb9f4ea8 upstream.
This patch fixes an incorrect loop exit condition in code that replaces '/' symbols in the board name. There might also be a memory corruption issue here, but it is unlikely to be a real problem.
--- drivers/bluetooth/btbcm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/bluetooth/btbcm.c +1 -1
@@ -511,7 +511,7 @@ static const char *btbcm_get_board_name( len =strlen (tmp) +1 ; board_type =devm_kzalloc (dev, len,GFP_KERNEL );strscpy (board_type, tmp, len); -for (i =0 ; i < board_type[i]; i++) { +for (i =0 ; i < len; i++) {if (board_type[i] =='/' ) board_type[i] ='-' ; }
Greg Kroah-Hartman
maintainerPATCH 15/134 Bluetooth: Free potentially unfreed SCO connection
In reply to Greg Kroah-HartmanFrom: Archie Pusaka <[email protected]>
commit 0f00cd322d22d4441de51aa80bcce5bb6a8cbb44 upstream.
It is possible to initiate a SCO connection while deleting the corresponding ACL connection, e.g. in below scenario:
(1) < hci setup sync connect command
(2) > hci disconn complete event (for the acl connection)
(3) > hci command complete event (for(1), failure)
When it happens, hci_cs_setup_sync_conn won't be able to obtain the reference to the SCO connection, so it will be stuck and potentially hinder subsequent connections to the same device.
This patch prevents that by also deleting the SCO connection if it is still not established when the corresponding ACL connection is deleted.
--- net/bluetooth/hci_conn.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-)
net/bluetooth/hci_conn.c +8 -1
@@ -1063,8 +1063,15 @@ int hci_conn_del(struct hci_conn *conn)if (conn->type ==ACL_LINK ) {struct hci_conn *sco = conn->link; -if (sco) +if (sco) { sco->link =NULL ; +/* Due to race, SCO connection might be not established +* yet at this point. Delete it now, otherwise it is +* possible for it to be stuck and can't be deleted. +*/ +if (sco->handle ==HCI_CONN_HANDLE_UNSET ) +hci_conn_del (sco); + }/* Unacked frames */ hdev->acl_cnt += conn->sent;
Greg Kroah-Hartman
maintainerPATCH 16/134 Bluetooth: hci_conn: Fix possible UAF
In reply to Greg Kroah-HartmanFrom: Luiz Augusto von Dentz <[email protected]>
commit 5dc7d23e167e2882ef118456ceccd57873e876d8 upstream.
This fixes the following trace:
==================================================================
BUG: KASAN: slab-use-after-free in hci_conn_del+0xba/0x3a0 Write of size 8 at addr ffff88800208e9c8 by task iso-tester/31 CPU: 0 PID: 31 Comm: iso-tester Not tainted 6.3.0-rc2-g991aa4a69a47 #4716 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.1-2.fc36 04/01/2014 Call Trace: <TASK> dump_stack_lvl+0x1d/0x70 print_report+0xce/0x610 ? __virt_addr_valid+0xd4/0x150 ? hci_conn_del+0xba/0x3a0 kasan_report+0xdd/0x110 ? hci_conn_del+0xba/0x3a0 hci_conn_del+0xba/0x3a0 hci_conn_hash_flush+0xf2/0x120 hci_dev_close_sync+0x388/0x920 hci_unregister_dev+0x122/0x260 vhci_release+0x4f/0x90 __fput+0x102/0x430 task_work_run+0xf1/0x160 ? __pfx_task_work_run+0x10/0x10 ? mark_held_locks+0x24/0x90 exit_to_user_mode_prepare+0x170/0x180 syscall_exit_to_user_mode+0x19/0x50 do_syscall_64+0x4e/0x90 entry_SYSCALL_64_after_hwframe+0x70/0xda
--- net/bluetooth/hci_conn.c | 30 ++++++++++++++++++++++++------ 1 file changed, 24 insertions(+), 6 deletions(-)
net/bluetooth/hci_conn.c +24 -6
@@ -1051,6 +1051,17 @@ struct hci_conn *hci_conn_add(struct hcireturn conn; } +static bool hci_conn_unlink (struct hci_conn *conn) +{ +if (!conn->link) +return false; + + conn->link->link =NULL ; + conn->link =NULL ; + +return true; +} +int hci_conn_del (struct hci_conn *conn) {struct hci_dev *hdev = conn->hdev;
@@ -1062,15 +1073,16 @@ int hci_conn_del(struct hci_conn *conn)cancel_delayed_work_sync (&conn->idle_work);if (conn->type ==ACL_LINK ) { -struct hci_conn *sco = conn->link; -if (sco) { - sco->link =NULL ; +struct hci_conn *link = conn->link; + +if (link) { +hci_conn_unlink (conn);/* Due to race, SCO connection might be not established * yet at this point. Delete it now, otherwise it is * possible for it to be stuck and can't be deleted. */ -if (sco->handle ==HCI_CONN_HANDLE_UNSET ) -hci_conn_del (sco); +if (link->handle ==HCI_CONN_HANDLE_UNSET ) +hci_conn_del (link); }/* Unacked frames */
@@ -1086,7 +1098,7 @@ int hci_conn_del(struct hci_conn *conn)struct hci_conn *acl = conn->link;if (acl) { - acl->link =NULL ; +hci_conn_unlink (conn);hci_conn_drop (acl); }
@@ -2445,6 +2457,12 @@ void hci_conn_hash_flush(struct hci_dev c->state =BT_CLOSED ;hci_disconn_cfm (c,HCI_ERROR_LOCAL_HOST_TERM ); + +/* Unlink before deleting otherwise it is possible that +* hci_conn_del removes the link which may cause the list to +* contain items already freed. +*/ +hci_conn_unlink (c);hci_conn_del (c); } }
Greg Kroah-Hartman
maintainerPATCH 17/134 btrfs: restore the thread_pool= behavior in remount for the end I/O workqueues
In reply to Greg Kroah-HartmanFrom: Christoph Hellwig <[email protected]>
commit 40fac6472f22a59f5694496e179988ab4a1dfe07 upstream.
Commit d7b9416fe5c5 ("btrfs: remove btrfs_end_io_wq") converted the read and I/O handling from btrfs_workqueues to Linux workqueues, and as part of that lost the code to apply the thread_pool= based max_active limit on remount. Restore it.
--- fs/btrfs/super.c | 2 ++ 1 file changed, 2 insertions(+)
fs/btrfs/super.c +2 -0
@@ -1939,6 +1939,8 @@ static void btrfs_resize_thread_pool(strbtrfs_workqueue_set_max (fs_info->hipri_workers, new_pool_size);btrfs_workqueue_set_max (fs_info->delalloc_workers, new_pool_size);btrfs_workqueue_set_max (fs_info->caching_workers, new_pool_size); +workqueue_set_max_active (fs_info->endio_workers, new_pool_size); +workqueue_set_max_active (fs_info->endio_meta_workers, new_pool_size);btrfs_workqueue_set_max (fs_info->endio_write_workers, new_pool_size);btrfs_workqueue_set_max (fs_info->endio_freespace_worker, new_pool_size);btrfs_workqueue_set_max (fs_info->delayed_workers, new_pool_size);
Greg Kroah-Hartman
maintainerPATCH 18/134 btrfs: fix fast csum implementation detection
In reply to Greg Kroah-HartmanFrom: Christoph Hellwig <[email protected]>
commit 68d99ab0e9221ef54506f827576c5a914680eeaf upstream.
The BTRFS_FS_CSUM_IMPL_FAST flag is currently set whenever a non-generic crc32c is detected, which is the incorrect check if the file system uses a different checksumming algorithm. Refactor the code to only check this if crc32c is actually used. Note that in an ideal world the information if an algorithm is hardware accelerated or not should be provided by the crypto API instead, but that's left for another day.
--- fs/btrfs/disk-io.c | 14 ++++++++++++++ fs/btrfs/super.c | 2 -- 2 files changed, 14 insertions(+), 2 deletions(-)
fs/btrfs/disk-io.c +14 -0
@@ -2347,6 +2347,20 @@ static int btrfs_init_csum_hash(struct b fs_info->csum_shash = csum_shash; +/* +* Check if the checksum implementation is a fast accelerated one. +* As-is this is a bit of a hack and should be replaced once the csum +* implementations provide that information themselves. +*/ +switch (csum_type) { +case BTRFS_CSUM_TYPE_CRC32 : +if (!strstr (crypto_shash_driver_name (csum_shash),"generic" )) +set_bit (BTRFS_FS_CSUM_IMPL_FAST , &fs_info->flags); +break ; +default : +break ; + } +btrfs_info (fs_info,"using %s (%s) checksum algorithm" ,btrfs_super_csum_name (csum_type),crypto_shash_driver_name (csum_shash));
fs/btrfs/super.c +0 -2
@@ -1824,8 +1824,6 @@ static struct dentry *btrfs_mount_root(sshrinker_debugfs_rename (&s->s_shrink,"sb-%s:%s" , fs_type->name, s->s_id);btrfs_sb (s)->bdev_holder = fs_type; -if (!strstr (crc32c_impl (),"generic" )) -set_bit (BTRFS_FS_CSUM_IMPL_FAST , &fs_info->flags); error =btrfs_fill_super (s, fs_devices, data); }if (!error)
Greg Kroah-Hartman
maintainerPATCH 19/134 fbmem: Reject FB_ACTIVATE_KD_TEXT from userspace
In reply to Greg Kroah-HartmanFrom: Daniel Vetter <[email protected]>
commit 6fd33a3333c7916689b8f051a185defe4dd515b0 upstream.
This is an oversight from dc5bdb68b5b3 ("drm/fb-helper: Fix vt restore") - I failed to realize that nasty userspace could set this.
It's not pretty to mix up kernel-internal and userspace uapi flags like this, but since the entire fb_var_screeninfo structure is uapi we'd need to either add a new parameter to the ->fb_set_par callback and fb_set_par() function, which has a _lot_ of users. Or some other fairly ugly side-channel int fb_info. Neither is a pretty prospect.
Instead just correct the issue at hand by filtering out this kernel-internal flag in the ioctl handling code.
--- drivers/video/fbdev/core/fbmem.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/video/fbdev/core/fbmem.c +2 -0
@@ -1116,6 +1116,8 @@ static long do_fb_ioctl(struct fb_info *case FBIOPUT_VSCREENINFO :if (copy_from_user (&var, argp,sizeof (var)))return -EFAULT ; +/* only for kernel-internal use */ + var.activate &= ~FB_ACTIVATE_KD_TEXT ;console_lock ();lock_fb_info (info); ret =fbcon_modechange_possible (info, &var);
Greg Kroah-Hartman
maintainerPATCH 10/134 ALSA: hda/sigmatel: fix S/PDIF out on Intel D*45* motherboards
In reply to Greg Kroah-HartmanFrom: Oswald Buddenhagen <[email protected]>
commit f342ac00da1064eb4f94b1f4bcacbdfea955797a upstream.
The BIOS botches this one completely - it says the 2nd S/PDIF output is used, while in fact it's the 1st one. This is tested on DP45SG, but I'm assuming it's valid for the other boards in the series as well.
Also add some comments regarding the pins.
FWIW, the codec is apparently still sold by Tempo Semiconductor, Inc., where one can download the documentation.
--- sound/pci/hda/patch_sigmatel.c | 8 ++++++++ 1 file changed, 8 insertions(+)
sound/pci/hda/patch_sigmatel.c +8 -0
@@ -1707,6 +1707,7 @@ static const struct snd_pci_quirk stac92 };static const struct hda_pintbl ref92hd73xx_pin_configs[] = { +// Port A-H {0x0a ,0x02214030 }, {0x0b ,0x02a19040 }, {0x0c ,0x01a19020 },
@@ -1715,9 +1716,12 @@ static const struct hda_pintbl ref92hd73 { 0x0f, 0x01014010 }, { 0x10, 0x01014020 }, { 0x11, 0x01014030 }, +// CD in { 0x12, 0x02319040 }, +// Digial Mic ins { 0x13, 0x90a000f0 }, { 0x14, 0x90a000f0 }, +// Digital outs { 0x22, 0x01452050 }, { 0x23, 0x01452050 }, {}
@@ -1758,6 +1762,7 @@ static const struct hda_pintbl alienware };static const struct hda_pintbl intel_dg45id_pin_configs[] = { +// Analog outputs {0x0a ,0x02214230 }, {0x0b ,0x02A19240 }, {0x0c ,0x01013214 },
@@ -1765,6 +1770,9 @@ static const struct hda_pintbl intel_dg4 { 0x0e, 0x01A19250 }, { 0x0f, 0x01011212 }, { 0x10, 0x01016211 }, +// Digital output + { 0x22, 0x01451380 }, + { 0x23, 0x40f000f0 }, {} };
Greg Kroah-Hartman
maintainerPATCH 43/134 dmaengine: apple-admac: Fix current_tx not getting freed
In reply to Greg Kroah-HartmanFrom: Martin Povišer <[email protected]>
[ Upstream commit d9503be5a100c553731c0e8a82c7b4201e8a970c ]
In terminate_all we should queue up all submitted descriptors to be freed. We do that for the content of the 'issued' and 'submitted' lists, but the 'current_tx' descriptor falls through the cracks as it's removed from the 'issued' list once it gets assigned to be the current descriptor. Explicitly queue up freeing of the 'current_tx' descriptor to address a memory leak that is otherwise present.
--- drivers/dma/apple-admac.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/dma/apple-admac.c +4 -1
@@ -512,7 +512,10 @@ static int admac_terminate_all(struct dma_chan *chan)admac_stop_chan (adchan);admac_reset_rings (adchan); - adchan->current_tx =NULL ; +if (adchan->current_tx) { +list_add_tail (&adchan->current_tx->node, &adchan->to_free); + adchan->current_tx =NULL ; + }/* * Descriptors can only be freed after the tasklet * has been killed (in admac_synchronize).
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 52/134 iavf: remove active_cvlans and active_svlans bitmaps
In reply to Greg Kroah-HartmanFrom: Ahmed Zaki <[email protected]>
[ Upstream commit 9c85b7fa12ef2e4fc11a4e31ac595fb5f9d0ddf9 ]
The VLAN filters info is currently being held in a list and 2 bitmaps (active_cvlans and active_svlans). We are experiencing some racing where data is not in sync in the list and bitmaps. For example, the VLAN is initially added to the list but only when the PF replies, it is added to the bitmap. If a user adds many V2 VLANS before the PF responds:
while [ $((i++)) ]
ip l add l eth0 name eth0.$i type vlan id $i
we might end up with more VLAN list entries than the designated limit. Also, The "ip link show" will show more links added than the PF limit.
On the other and, the bitmaps are only used to check the number of VLAN filters and to re-enable the filters when the interface goes from DOWN to UP.
This patch gets rid of the bitmaps and uses the list only. To do that, the states of the VLAN filter are modified:
1 - IAVF_VLAN_REMOVE: the entry needs to be totally removed after informing
the PF. This is the "ip link del eth0.$i" path.
2 - IAVF_VLAN_DISABLE: (new) the netdev went down. The filter needs to be
removed from the PF and then marked INACTIVE.
3 - IAVF_VLAN_INACTIVE: (new) no PF filter exists, but the user did not
delete the VLAN.
--- drivers/net/ethernet/intel/iavf/iavf.h | 7 +-- drivers/net/ethernet/intel/iavf/iavf_main.c | 40 +++++++---------- .../net/ethernet/intel/iavf/iavf_virtchnl.c | 45 ++++++++++--------- 3 files changed, 45 insertions(+), 47 deletions(-)
drivers/net/ethernet/intel/iavf/iavf.h +4 -3
@@ -58,8 +58,6 @@ enum iavf_vsi_state_t {struct iavf_vsi {struct iavf_adapter *back;struct net_device *netdev; -unsigned long active_cvlans[BITS_TO_LONGS (VLAN_N_VID )]; -unsigned long active_svlans[BITS_TO_LONGS (VLAN_N_VID )];u16 seid;u16 id; DECLARE_BITMAP(state, __IAVF_VSI_STATE_SIZE__);
@@ -162,7 +160,9 @@ enum iavf_vlan_state_t {IAVF_VLAN_ADD ,/* filter needs to be added */ IAVF_VLAN_IS_NEW ,/* filter is new, wait for PF answer */ IAVF_VLAN_ACTIVE ,/* filter is accepted by PF */ - IAVF_VLAN_REMOVE, /* filter needs to be removed */ +IAVF_VLAN_DISABLE ,/* filter needs to be deleted by PF, then marked INACTIVE */ +IAVF_VLAN_INACTIVE ,/* filter is inactive, we are in IFF_DOWN */ + IAVF_VLAN_REMOVE, /* filter needs to be removed from list */ }; struct iavf_vlan_filter {
@@ -260,6 +260,7 @@ struct iavf_adapter {wait_queue_head_t vc_waitqueue;struct iavf_q_vector *q_vectors;struct list_head vlan_filter_list; +int num_vlan_filters;struct list_head mac_filter_list;struct mutex crit_lock;struct mutex client_lock;
drivers/net/ethernet/intel/iavf/iavf_main.c +16 -24
@@ -792,6 +792,7 @@ iavf_vlan_filter *iavf_add_vlan(struct iavf_adapter *adapter,list_add_tail (&f->list, &adapter->vlan_filter_list); f->state =IAVF_VLAN_ADD ; + adapter->num_vlan_filters++; adapter->aq_required |=IAVF_FLAG_AQ_ADD_VLAN_FILTER ; }
@@ -828,14 +829,18 @@ static void iavf_del_vlan(struct iavf_adapter *adapter, struct iavf_vlan vlan)**/ static void iavf_restore_filters (struct iavf_adapter *adapter) { -u16 vid; +struct iavf_vlan_filter *f;/* re-add all VLAN filters */ -for_each_set_bit (vid, adapter->vsi.active_cvlans,VLAN_N_VID ) -iavf_add_vlan (adapter,IAVF_VLAN (vid,ETH_P_8021Q )); +spin_lock_bh (&adapter->mac_vlan_list_lock); -for_each_set_bit (vid, adapter->vsi.active_svlans,VLAN_N_VID ) -iavf_add_vlan (adapter,IAVF_VLAN (vid,ETH_P_8021AD )); +list_for_each_entry (f, &adapter->vlan_filter_list, list) { +if (f->state ==IAVF_VLAN_INACTIVE ) + f->state =IAVF_VLAN_ADD ; + } + +spin_unlock_bh (&adapter->mac_vlan_list_lock); + adapter->aq_required |=IAVF_FLAG_AQ_ADD_VLAN_FILTER ; }/**
@@ -844,8 +849,7 @@ static void iavf_restore_filters(struct iavf_adapter *adapter)*/ u16 iavf_get_num_vlans_added (struct iavf_adapter *adapter) { -return bitmap_weight (adapter->vsi.active_cvlans,VLAN_N_VID ) + -bitmap_weight (adapter->vsi.active_svlans,VLAN_N_VID ); +return adapter->num_vlan_filters; }/**
@@ -928,11 +932,6 @@ static int iavf_vlan_rx_kill_vid(struct net_device *netdev,return 0 ;iavf_del_vlan (adapter,IAVF_VLAN (vid,be16_to_cpu (proto))); -if (proto ==cpu_to_be16 (ETH_P_8021Q )) -clear_bit (vid, adapter->vsi.active_cvlans); -else -clear_bit (vid, adapter->vsi.active_svlans); -return 0 ; }
@@ -1293,16 +1292,11 @@ static void iavf_clear_mac_vlan_filters(struct iavf_adapter *adapter) } } -/* remove all VLAN filters */ +/* disable all VLAN filters */ list_for_each_entry_safe (vlf, vlftmp, &adapter->vlan_filter_list, - list) { -if (vlf->state ==IAVF_VLAN_ADD ) { -list_del (&vlf->list); -kfree (vlf); - }else { - vlf->state =IAVF_VLAN_REMOVE ; - } - } + list) + vlf->state =IAVF_VLAN_DISABLE ; +spin_unlock_bh (&adapter->mac_vlan_list_lock); }
@@ -2905,6 +2899,7 @@ static void iavf_disable_vf(struct iavf_adapter *adapter)list_del (&fv->list);kfree (fv); } + adapter->num_vlan_filters =0 ;spin_unlock_bh (&adapter->mac_vlan_list_lock);
@@ -3122,9 +3117,6 @@ static void iavf_reset_task(struct work_struct *work) adapter->aq_required |=IAVF_FLAG_AQ_ADD_CLOUD_FILTER ;iavf_misc_irq_enable (adapter); -bitmap_clear (adapter->vsi.active_cvlans,0 ,VLAN_N_VID ); -bitmap_clear (adapter->vsi.active_svlans,0 ,VLAN_N_VID ); -mod_delayed_work (adapter->wq, &adapter->watchdog_task,2 );/* We were running when the reset started, so we need to restore some
drivers/net/ethernet/intel/iavf/iavf_virtchnl.c +25 -20
88 lines not on this page · raw message
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 53/134 net: openvswitch: fix race on port output
In reply to Greg Kroah-HartmanFrom: Felix Huettner <[email protected]>
[ Upstream commit 066b86787fa3d97b7aefb5ac0a99a22dad2d15f8 ]
assume the following setup on a single machine:
1. An openvswitch instance with one bridge and default flows
2. two network namespaces "server" and "client"
3. two ovs interfaces "server" and "client" on the bridge
4. for each ovs interface a veth pair with a matching name and 32 rx and tx queues
5. move the ends of the veth pairs to the respective network namespaces
6. assign ip addresses to each of the veth ends in the namespaces (needs to be the same subnet)
7. start some http server on the server network namespace
8. test if a client in the client namespace can reach the http server
when following the actions below the host has a chance of getting a cpu stuck in a infinite loop:
1. send a large amount of parallel requests to the http server (around 3000 curls should work)
2. in parallel delete the network namespace (do not delete interfaces or stop the server, just kill the namespace)
there is a low chance that this will cause the below kernel cpu stuck message. If this does not happen just retry.
Below there is also the output of bpftrace for the functions mentioned in the output.
The series of events happening here is:
1. the network namespace is deleted calling unregister_netdevice_many_notify somewhere in the process
2. this sets first NETREG_UNREGISTERING on both ends of the veth and then runs synchronize_net
3. it then calls call_netdevice_notifiers with NETDEV_UNREGISTER
4. this is then handled by dp_device_event which calls ovs_netdev_detach_dev (if a vport is found, which is the case for the veth interface attached to ovs)
5. this removes the rx_handlers of the device but does not prevent packages to be sent to the device
6. dp_device_event then queues the vport deletion to work in background as a ovs_lock is needed that we do not hold in the unregistration path
7. unregister_netdevice_many_notify continues to call netdev_unregister_kobject which sets real_num_tx_queues to 0
8. port deletion continues (but details are not relevant for this issue)
9. at some future point the background task deletes the vport
If after 7. but before 9. a packet is send to the ovs vport (which is not deleted at this point in time) which forwards it to the dev_queue_xmit flow even though the device is unregistering. In skb_tx_hash (which is called in the dev_queue_xmit) path there is a while loop (if the packet has a rx_queue recorded) that is infinite if dev->real_num_tx_queues is zero.
To prevent this from happening we update do_output to handle devices without carrier the same as if the device is not found (which would be the code path after 9. is done).
Additionally we now produce a warning in skb_tx_hash if we will hit the infinite loop.
bpftrace (first word is function name):
__dev_queue_xmit server: real_num_tx_queues: 1, cpu: 2, pid: 28024, tid: 28024, skb_addr: 0xffff9edb6f207000, reg_state: 1 netdev_core_pick_tx server: addr: 0xffff9f0a46d4a000 real_num_tx_queues: 1, cpu: 2, pid: 28024, tid: 28024, skb_addr: 0xffff9edb6f207000, reg_state: 1 dp_device_event server: real_num_tx_queues: 1 cpu 9, pid: 21024, tid: 21024, event 2, reg_state: 1synchronize_rcu_expedited: cpu 9, pid: 21024, tid: 21024synchronize_rcu_expedited: cpu 9, pid: 21024, tid: 21024synchronize_rcu_expedited: cpu 9, pid: 21024, tid: 21024synchronize_rcu_expedited: cpu 9, pid: 21024, tid: 21024dp_device_event server: real_num_tx_queues: 1 cpu 9, pid: 21024, tid: 21024, event 6, reg_state: 2ovs_netdev_detach_dev server: real_num_tx_queues: 1 cpu 9, pid: 21024, tid: 21024, reg_state: 2netdev_rx_handler_unregister server: real_num_tx_queues: 1, cpu: 9, pid: 21024, tid: 21024, reg_state: 2synchronize_rcu_expedited: cpu 9, pid: 21024, tid: 21024netdev_rx_handler_unregister ret server: real_num_tx_queues: 1, cpu: 9, pid: 21024, tid: 21024, reg_state: 2dp_device_event server: real_num_tx_queues: 1 cpu 9, pid: 21024, tid: 21024, event 27, reg_state: 2dp_device_event server: real_num_tx_queues: 1 cpu 9, pid: 21024, tid: 21024, event 22, reg_state: 2dp_device_event server: real_num_tx_queues: 1 cpu 9, pid: 21024, tid: 21024, event 18, reg_state: 2netdev_unregister_kobject: real_num_tx_queues: 1, cpu: 9, pid: 21024, tid: 21024synchronize_rcu_expedited: cpu 9, pid: 21024, tid: 21024ovs_vport_send server: real_num_tx_queues: 0, cpu: 2, pid: 28024, tid: 28024, skb_addr: 0xffff9edb6f207000, reg_state: 2 __dev_queue_xmit server: real_num_tx_queues: 0, cpu: 2, pid: 28024, tid: 28024, skb_addr: 0xffff9edb6f207000, reg_state: 2 netdev_core_pick_tx server: addr: 0xffff9f0a46d4a000 real_num_tx_queues: 0, cpu: 2, pid: 28024, tid: 28024, skb_addr: 0xffff9edb6f207000, reg_state: 2 broken device server: real_num_tx_queues: 0, cpu: 2, pid: 28024, tid: 28024ovs_dp_detach_port server: real_num_tx_queues: 0 cpu 9, pid: 9124, tid: 9124, reg_state: 2synchronize_rcu_expedited: cpu 9, pid: 33604, tid: 33604
stuck message:
watchdog: BUG: soft lockup - CPU#5 stuck for 26s! [curl:1929279] Modules linked in: veth pktgen bridge stp llc ip_set_hash_net nft_counter xt_set nft_compat nf_tables ip_set_hash_ip ip_set nfnetlink_cttimeout nfnetlink openvswitch nsh nf_conncount nf_nat nf_conntrack nf_defrag_ipv6 nf_defrag_ipv4 tls binfmt_misc nls_iso8859_1 input_leds joydev serio_raw dm_multipath scsi_dh_rdac scsi_dh_emc scsi_dh_alua sch_fq_codel drm efi_pstore virtio_rng ip_tables x_tables autofs4 btrfs blake2b_generic zstd_compress raid10 raid456 async_raid6_recov async_memcpy async_pq async_xor async_tx xor raid6_pq libcrc32c raid1 raid0 multipath linear hid_generic usbhid hid crct10dif_pclmul crc32_pclmul ghash_clmulni_intel aesni_intel virtio_net ahci net_failover crypto_simd cryptd psmouse libahci virtio_blk failover CPU: 5 PID: 1929279 Comm: curl Not tainted 5.15.0-67-generic #74-Ubuntu Hardware name: OpenStack Foundation OpenStack Nova, BIOS rel-1.16.0-0-gd239552ce722-prebuilt.qemu.org 04/01/2014 RIP: 0010:netdev_pick_tx+0xf1/0x320 Code: 00 00 8d 48 ff 0f b7 c1 66 39 ca 0f 86 e9 01 00 00 45 0f b7 ff 41 39 c7 0f 87 5b 01 00 00 44 29 f8 41 39 c7 0f 87 4f 01 00 00 <eb> f2 0f 1f 44 00 00 49 8b 94 24 28 04 00 00 48 85 d2 0f 84 53 01 RSP: 0018:ffffb78b40298820 EFLAGS: 00000246 RAX: 0000000000000000 RBX: ffff9c8773adc2e0 RCX: 000000000000083f RDX: 0000000000000000 RSI: ffff9c8773adc2e0 RDI: ffff9c870a25e000 RBP: ffffb78b40298858 R08: 0000000000000001 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000000 R12: ffff9c870a25e000 R13: ffff9c870a25e000 R14: ffff9c87fe043480 R15: 0000000000000000 FS: 00007f7b80008f00(0000) GS:ffff9c8e5f740000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00007f7b80f6a0b0 CR3: 0000000329d66000 CR4: 0000000000350ee0 Call Trace: <IRQ> netdev_core_pick_tx+0xa4/0xb0 __dev_queue_xmit+0xf8/0x510 ? __bpf_prog_exit+0x1e/0x30 dev_queue_xmit+0x10/0x20 ovs_vport_send+0xad/0x170 [openvswitch] do_output+0x59/0x180 [openvswitch] do_execute_actions+0xa80/0xaa0 [openvswitch] ? kfree+0x1/0x250 ? kfree+0x1/0x250 ? kprobe_perf_func+0x4f/0x2b0 ? flow_lookup.constprop.0+0x5c/0x110 [openvswitch] ovs_execute_actions+0x4c/0x120 [openvswitch] ovs_dp_process_packet+0xa1/0x200 [openvswitch] ? ovs_ct_update_key.isra.0+0xa8/0x120 [openvswitch] ? ovs_ct_fill_key+0x1d/0x30 [openvswitch] ? ovs_flow_key_extract+0x2db/0x350 [openvswitch] ovs_vport_receive+0x77/0xd0 [openvswitch] ? __htab_map_lookup_elem+0x4e/0x60 ? bpf_prog_680e8aff8547aec1_kfree+0x3b/0x714 ? trace_call_bpf+0xc8/0x150 ? kfree+0x1/0x250 ? kfree+0x1/0x250 ? kprobe_perf_func+0x4f/0x2b0 ? kprobe_perf_func+0x4f/0x2b0 ? __mod_memcg_lruvec_state+0x63/0xe0 netdev_port_receive+0xc4/0x180 [openvswitch] ? netdev_port_receive+0x180/0x180 [openvswitch] netdev_frame_hook+0x1f/0x40 [openvswitch] __netif_receive_skb_core.constprop.0+0x23d/0xf00 __netif_receive_skb_one_core+0x3f/0xa0 __netif_receive_skb+0x15/0x60 process_backlog+0x9e/0x170 __napi_poll+0x33/0x180 net_rx_action+0x126/0x280 ? ttwu_do_activate+0x72/0xf0 __do_softirq+0xd9/0x2e7 ? rcu_report_exp_cpu_mult+0x1b0/0x1b0 do_softirq+0x7d/0xb0 </IRQ> <TASK> __local_bh_enable_ip+0x54/0x60 ip_finish_output2+0x191/0x460 __ip_finish_output+0xb7/0x180 ip_finish_output+0x2e/0xc0 ip_output+0x78/0x100 ? __ip_finish_output+0x180/0x180 ip_local_out+0x5e/0x70 __ip_queue_xmit+0x184/0x440 ? tcp_syn_options+0x1f9/0x300 ip_queue_xmit+0x15/0x20 __tcp_transmit_skb+0x910/0x9c0 ? __mod_memcg_state+0x44/0xa0 tcp_connect+0x437/0x4e0 ? ktime_get_with_offset+0x60/0xf0 tcp_v4_connect+0x436/0x530 __inet_stream_connect+0xd4/0x3a0 ? kprobe_perf_func+0x4f/0x2b0 ? aa_sk_perm+0x43/0x1c0 inet_stream_connect+0x3b/0x60 __sys_connect_file+0x63/0x70 __sys_connect+0xa6/0xd0 ? setfl+0x108/0x170 ? do_fcntl+0xe8/0x5a0 __x64_sys_connect+0x18/0x20 do_syscall_64+0x5c/0xc0 ? __x64_sys_fcntl+0xa9/0xd0 ? exit_to_user_mode_prepare+0x37/0xb0 ? syscall_exit_to_user_mode+0x27/0x50 ? do_syscall_64+0x69/0xc0 ? __sys_setsockopt+0xea/0x1e0 ? exit_to_user_mode_prepare+0x37/0xb0 ? syscall_exit_to_user_mode+0x27/0x50 ? __x64_sys_setsockopt+0x1f/0x30 ? do_syscall_64+0x69/0xc0 ? irqentry_exit+0x1d/0x30 ? exc_page_fault+0x89/0x170 entry_SYSCALL_64_after_hwframe+0x61/0xcb RIP: 0033:0x7f7b8101c6a7 Code: 64 89 01 48 83 c8 ff c3 66 2e 0f 1f 84 00 00 00 00 00 90 f3 0f 1e fa 64 8b 04 25 18 00 00 00 85 c0 75 10 b8 2a 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 51 c3 48 83 ec 18 89 54 24 0c 48 89 34 24 89 RSP: 002b:00007ffffd6b2198 EFLAGS: 00000246 ORIG_RAX: 000000000000002a RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007f7b8101c6a7 RDX: 0000000000000010 RSI: 00007ffffd6b2360 RDI: 0000000000000005 RBP: 0000561f1370d560 R08: 00002795ad21d1ac R09: 0030312e302e302e R10: 00007ffffd73f080 R11: 0000000000000246 R12: 0000561f1370c410 R13: 0000000000000000 R14: 0000000000000005 R15: 0000000000000000 </TASK>
--- net/core/dev.c | 1 + net/openvswitch/actions.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-)
net/core/dev.c +1 -0
@@ -3211,6 +3211,7 @@ static u16 skb_tx_hash(const struct net_device *dev, }if (skb_rx_queue_recorded (skb)) { +DEBUG_NET_WARN_ON_ONCE (qcount ==0 ); hash =skb_get_rx_queue (skb);if (hash >= qoffset) hash -= qoffset;
net/openvswitch/actions.c +1 -1
@@ -913,7 +913,7 @@ static void do_output(struct datapath *dp, struct sk_buff *skb, int out_port, {struct vport *vport =ovs_vport_rcu (dp, out_port); -if (likely (vport)) { +if (likely (vport &&netif_carrier_ok (vport->dev))) {u16 mru =OVS_CB (skb)->mru;u32 cutlen =OVS_CB (skb)->cutlen;
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 54/134 Bluetooth: hci_conn: Fix not cleaning up on LE Connection failure
In reply to Greg Kroah-HartmanFrom: Luiz Augusto von Dentz <[email protected]>
[ Upstream commit 19cf60bf63cbaf5262eac400c707966e19999b83 ]
hci_connect_le_scan_cleanup shall always be invoked to cleanup the states and re-enable passive scanning if necessary, otherwise it may cause the pending action to stay active causing multiple attempts to connect.
--- net/bluetooth/hci_conn.c | 52 +++++++++++++++++++--------------------- 1 file changed, 24 insertions(+), 28 deletions(-)
net/bluetooth/hci_conn.c +24 -28
@@ -68,7 +68,7 @@ static const struct sco_param esco_param_msbc[] = { };/* This function requires the caller holds hdev->lock */ -static void hci_connect_le_scan_cleanup (struct hci_conn *conn) +static void hci_connect_le_scan_cleanup (struct hci_conn *conn,u8 status) {struct hci_conn_params *params;struct hci_dev *hdev = conn->hdev;
@@ -88,9 +88,28 @@ static void hci_connect_le_scan_cleanup(struct hci_conn *conn) params =hci_pend_le_action_lookup (&hdev->pend_le_conns, bdaddr, bdaddr_type); -if (!params || !params->explicit_connect) +if (!params)return ; +if (params->conn) { +hci_conn_drop (params->conn); +hci_conn_put (params->conn); + params->conn =NULL ; + } + +if (!params->explicit_connect) +return ; + +/* If the status indicates successful cancellation of +* the attempt (i.e. Unknown Connection Id) there's no point of +* notifying failure since we'll go back to keep trying to +* connect. The only exception is explicit connect requests +* where a timeout + cancel does indicate an actual failure. +*/ +if (status && status !=HCI_ERROR_UNKNOWN_CONN_ID ) +mgmt_connect_failed (hdev, &conn->dst, conn->type, + conn->dst_type, status); +/* The connection attempt was doing scan for new RPA, and is * in scan phase. If params are not associated with any other * autoconnect action, remove them completely. If they are, just unmark
@@ -178,7 +197,7 @@ static void le_scan_cleanup(struct work_struct *work)rcu_read_unlock ();if (c == conn) { -hci_connect_le_scan_cleanup (conn); +hci_connect_le_scan_cleanup (conn,0x00 );hci_conn_cleanup (conn); }
@@ -1193,31 +1212,8 @@ EXPORT_SYMBOL(hci_get_route);static void hci_le_conn_failed (struct hci_conn *conn,u8 status) {struct hci_dev *hdev = conn->hdev; -struct hci_conn_params *params; - params =hci_pend_le_action_lookup (&hdev->pend_le_conns, &conn->dst, - conn->dst_type); -if (params && params->conn) { -hci_conn_drop (params->conn); -hci_conn_put (params->conn); - params->conn =NULL ; - } - -/* If the status indicates successful cancellation of -* the attempt (i.e. Unknown Connection Id) there's no point of -* notifying failure since we'll go back to keep trying to -* connect. The only exception is explicit connect requests -* where a timeout + cancel does indicate an actual failure. -*/ -if (status !=HCI_ERROR_UNKNOWN_CONN_ID || - (params && params->explicit_connect)) -mgmt_connect_failed (hdev, &conn->dst, conn->type, - conn->dst_type, status); - -/* Since we may have temporarily stopped the background scanning in -* favor of connection establishment, we should restart it. -*/ -hci_update_passive_scan (hdev); +hci_connect_le_scan_cleanup (conn, status);/* Enable advertising in case this was a failed connection * attempt as a peripheral.
@@ -1254,7 +1250,7 @@ static void create_le_conn_complete(struct hci_dev *hdev, void *data, int err)hci_dev_lock (hdev);if (!err) { -hci_connect_le_scan_cleanup (conn); +hci_connect_le_scan_cleanup (conn,0x00 ); goto done; }
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 55/134 Bluetooth: Fix printing errors if LE Connection times out
In reply to Greg Kroah-HartmanFrom: Luiz Augusto von Dentz <[email protected]>
[ Upstream commit b62e72200eaad523f08d8319bba50fc652e032a8 ]
This fixes errors like bellow when LE Connection times out since that is actually not a controller error:
Bluetooth: hci0: Opcode 0x200d failed: -110
Bluetooth: hci0: request failed to create LE connection: err -110
Instead the code shall properly detect if -ETIMEDOUT is returned and send HCI_OP_LE_CREATE_CONN_CANCEL to give up on the connection.
--- include/net/bluetooth/hci_core.h | 1 + net/bluetooth/hci_conn.c | 7 +++++-- net/bluetooth/hci_event.c | 16 ++++++---------- net/bluetooth/hci_sync.c | 13 ++++++++++--- 4 files changed, 22 insertions(+), 15 deletions(-)
include/net/bluetooth/hci_core.h +1 -0
@@ -953,6 +953,7 @@ enum {HCI_CONN_STK_ENCRYPT ,HCI_CONN_AUTH_INITIATOR ,HCI_CONN_DROP , +HCI_CONN_CANCEL ,HCI_CONN_PARAM_REMOVAL_PEND ,HCI_CONN_NEW_LINK_KEY , HCI_CONN_SCANNING,
net/bluetooth/hci_conn.c +5 -2
@@ -1247,6 +1247,8 @@ static void create_le_conn_complete(struct hci_dev *hdev, void *data, int err) {struct hci_conn *conn = data; +bt_dev_dbg (hdev,"err %d" , err); +hci_dev_lock (hdev);if (!err) {
@@ -1254,8 +1256,6 @@ static void create_le_conn_complete(struct hci_dev *hdev, void *data, int err) goto done; } -bt_dev_err (hdev,"request failed to create LE connection: err %d" , err); -/* Check if connection is still pending */ if (conn !=hci_lookup_le_connect (hdev)) goto done;
@@ -2796,6 +2796,9 @@ int hci_abort_conn(struct hci_conn *conn, u8 reason) {int r =0 ; +if (test_and_set_bit (HCI_CONN_CANCEL , &conn->flags)) +return 0 ; +switch (conn->state) {case BT_CONNECTED :case BT_CONFIG :
net/bluetooth/hci_event.c +6 -10
@@ -2876,16 +2876,6 @@ static void cs_le_create_conn(struct hci_dev *hdev, bdaddr_t *peer_addr, conn->resp_addr_type = peer_addr_type;bacpy (&conn->resp_addr, peer_addr); - -/* We don't want the connection attempt to stick around -* indefinitely since LE doesn't have a page timeout concept -* like BR/EDR. Set a timer for any connection that doesn't use -* the accept list for connecting. -*/ -if (filter_policy ==HCI_LE_USE_PEER_ADDR ) -queue_delayed_work (conn->hdev->workqueue, - &conn->le_conn_timeout, - conn->conn_timeout); }static void hci_cs_le_create_conn (struct hci_dev *hdev,u8 status)
@@ -5892,6 +5882,12 @@ static void le_conn_complete_evt(struct hci_dev *hdev, u8 status,if (status) goto unlock; +/* Drop the connection if it has been aborted */ +if (test_bit (HCI_CONN_CANCEL , &conn->flags)) { +hci_conn_drop (conn); + goto unlock; + } +if (conn->dst_type ==ADDR_LE_DEV_PUBLIC ) addr_type =BDADDR_LE_PUBLIC ;else
net/bluetooth/hci_sync.c +10 -3
@@ -246,8 +246,9 @@ int __hci_cmd_sync_status_sk(struct hci_dev *hdev, u16 opcode, u32 plen, skb =__hci_cmd_sync_sk (hdev, opcode, plen, param, event, timeout, sk);if (IS_ERR (skb)) { -bt_dev_err (hdev,"Opcode 0x%4x failed: %ld" , opcode, -PTR_ERR (skb)); +if (!event) +bt_dev_err (hdev,"Opcode 0x%4x failed: %ld" , opcode, +PTR_ERR (skb));return PTR_ERR (skb); }
@@ -5108,8 +5109,11 @@ static int hci_le_connect_cancel_sync(struct hci_dev *hdev,if (test_bit (HCI_CONN_SCANNING , &conn->flags))return 0 ; +if (test_and_set_bit (HCI_CONN_CANCEL , &conn->flags)) +return 0 ; +return __hci_cmd_sync_status (hdev,HCI_OP_LE_CREATE_CONN_CANCEL , -6 , &conn->dst,HCI_CMD_TIMEOUT ); +0 ,NULL ,HCI_CMD_TIMEOUT ); }static int hci_connect_cancel_sync (struct hci_dev *hdev,struct hci_conn *conn)
@@ -6084,6 +6088,9 @@ int hci_le_create_conn_sync(struct hci_dev *hdev, struct hci_conn *conn) conn->conn_timeout, NULL); done: +if (err == -ETIMEDOUT ) +hci_le_connect_cancel_sync (hdev, conn); +/* Re-enable advertising after the connection attempt is finished. */ hci_resume_advertising_sync (hdev);return err;
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 56/134 Bluetooth: SCO: Fix possible circular locking dependency sco_sock_getsockopt
In reply to Greg Kroah-HartmanFrom: Luiz Augusto von Dentz <[email protected]>
[ Upstream commit 975abc0c90fc485ff9b4a6afa475c3b1398d5d47 ]
This attempts to fix the following trace:
======================================================
WARNING: possible circular locking dependency detected 6.3.0-rc2-g68fcb3a7bf97 #4706 Not tainted
------------------------------------------------------
sco-tester/31 is trying to acquire lock:ffff8880025b8070 (&hdev->lock){+.+.}-{3:3}, at:sco_sock_getsockopt+0x1fc/0xa90
but task is already holding lock:ffff888001eeb130 (sk_lock-AF_BLUETOOTH-BTPROTO_SCO){+.+.}-{0:0}, at:sco_sock_getsockopt+0x104/0xa90
which lock already depends on the new lock.
the existing dependency chain (in reverse order) is:
-> #2 (sk_lock-AF_BLUETOOTH-BTPROTO_SCO){+.+.}-{0:0}:
lock_sock_nested+0x32/0x80
sco_connect_cfm+0x118/0x4a0
hci_sync_conn_complete_evt+0x1e6/0x3d0
hci_event_packet+0x55c/0x7c0
hci_rx_work+0x34c/0xa00
process_one_work+0x575/0x910
worker_thread+0x89/0x6f0
kthread+0x14e/0x180
ret_from_fork+0x2b/0x50-> #1 (hci_cb_list_lock){+.+.}-{3:3}:
__mutex_lock+0x13b/0xcc0
hci_sync_conn_complete_evt+0x1ad/0x3d0
hci_event_packet+0x55c/0x7c0
hci_rx_work+0x34c/0xa00
process_one_work+0x575/0x910
worker_thread+0x89/0x6f0
kthread+0x14e/0x180
ret_from_fork+0x2b/0x50-> #0 (&hdev->lock){+.+.}-{3:3}:
__lock_acquire+0x18cc/0x3740
lock_acquire+0x151/0x3a0
__mutex_lock+0x13b/0xcc0
sco_sock_getsockopt+0x1fc/0xa90
__sys_getsockopt+0xe9/0x190
__x64_sys_getsockopt+0x5b/0x70
do_syscall_64+0x42/0x90
entry_SYSCALL_64_after_hwframe+0x70/0xdaother info that might help us debug this:
Chain exists of: &hdev->lock --> hci_cb_list_lock --> sk_lock-AF_BLUETOOTH-BTPROTO_SCO Possible unsafe locking scenario:
CPU0 CPU1
---- ----
lock(sk_lock-AF_BLUETOOTH-BTPROTO_SCO);
lock(hci_cb_list_lock);
lock(sk_lock-AF_BLUETOOTH-BTPROTO_SCO); lock(&hdev->lock);
*** DEADLOCK ***
1 lock held by sco-tester/31:
#0: ffff888001eeb130 (sk_lock-AF_BLUETOOTH-BTPROTO_SCO){+.+.}-{0:0},
at: sco_sock_getsockopt+0x104/0xa90
--- net/bluetooth/sco.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-)
net/bluetooth/sco.c +9 -7
@@ -1129,6 +1129,8 @@ static int sco_sock_getsockopt(struct socket *sock, int level, int optname,break ; } +release_sock (sk); +/* find total buffer size required to copy codec + caps */ hci_dev_lock (hdev);list_for_each_entry (c, &hdev->local_codecs, list) {
@@ -1146,15 +1148,13 @@ static int sco_sock_getsockopt(struct socket *sock, int level, int optname, buf_len +=sizeof (struct bt_codecs );if (buf_len > len) {hci_dev_put (hdev); - err = -ENOBUFS ; -break ; +return -ENOBUFS ; } ptr = optval;if (put_user (num_codecs, ptr)) {hci_dev_put (hdev); - err = -EFAULT ; -break ; +return -EFAULT ; } ptr +=sizeof (num_codecs);
@@ -1194,12 +1194,14 @@ static int sco_sock_getsockopt(struct socket *sock, int level, int optname, ptr += len; } -if (!err &&put_user (buf_len, optlen)) - err = -EFAULT ; -hci_dev_unlock (hdev);hci_dev_put (hdev); +lock_sock (sk); + +if (!err &&put_user (buf_len, optlen)) + err = -EFAULT ; +break ;default :
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 57/134 Bluetooth: Set ISO Data Path on broadcast sink
In reply to Greg Kroah-HartmanFrom: Claudia Draghicescu <[email protected]>
[ Upstream commit d2e4f1b1cba8742db66aaf77374cab7c0c7c8656 ]
This patch enables ISO data rx on broadcast sink.
--- net/bluetooth/hci_event.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/bluetooth/hci_event.c +1 -1
@@ -6981,7 +6981,7 @@ static void hci_le_big_sync_established_evt(struct hci_dev *hdev, void *data, bis->iso_qos.in.latency =le16_to_cpu (ev->interval) *125 /100 ; bis->iso_qos.in.sdu =le16_to_cpu (ev->max_pdu); -hci_connect_cfm (bis, ev->status); +hci_iso_setup_path (bis); }hci_dev_unlock (hdev);
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 58/134 drm/armada: Fix a potential double free in an error handling path
In reply to Greg Kroah-HartmanFrom: Christophe JAILLET <[email protected]>
[ Upstream commit b89ce1177d42d5c124e83f3858818cd4e6a2c46f ]
'priv' is a managed resource, so there is no need to free it explicitly or there will be a double free().
--- drivers/gpu/drm/armada/armada_drv.c | 1 - 1 file changed, 1 deletion(-)
drivers/gpu/drm/armada/armada_drv.c +0 -1
@@ -99,7 +99,6 @@ static int armada_drm_bind(struct device *dev)if (ret) {dev_err (dev,"[" DRM_NAME ":%s] can't kick out simple-fb: %d\n" , __func__, ret); -kfree (priv);return ret; }
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 59/134 qlcnic: check pci_reset_function result
In reply to Greg Kroah-HartmanFrom: Denis Plotnikov <[email protected]>
[ Upstream commit 7573099e10ca69c3be33995c1fcd0d241226816d ]
Static code analyzer complains to unchecked return value. The result of pci_reset_function() is unchecked.
Despite, the issue is on the FLR supported code path and in that case reset can be done with pcie_flr(), the patch uses less invasive approach by adding the result check of pci_reset_function().
Found by Linux Verification Center (linuxtesting.org) with SVACE.
--- drivers/net/ethernet/qlogic/qlcnic/qlcnic_ctx.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-)
drivers/net/ethernet/qlogic/qlcnic/qlcnic_ctx.c +7 -1
@@ -628,7 +628,13 @@ int qlcnic_fw_create_ctx(struct qlcnic_adapter *dev)int i, err, ring;if (dev->flags &QLCNIC_NEED_FLR ) { -pci_reset_function (dev->pdev); + err =pci_reset_function (dev->pdev); +if (err) { +dev_err (&dev->pdev->dev, +"Adapter reset failed (%d). Please reboot\n" , + err); +return err; + } dev->flags &= ~QLCNIC_NEED_FLR ; }
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 60/134 net: wwan: iosm: Fix error handling path in ipc_pcie_probe()
In reply to Greg Kroah-HartmanFrom: Harshit Mogalapalli <[email protected]>
[ Upstream commit a56ef25619e079bd7d744636cf18d054d1e91982 ]
Smatch reports:
drivers/net/wwan/iosm/iosm_ipc_pcie.c:298 ipc_pcie_probe() warn: missing unwind goto?
When dma_set_mask fails it directly returns without disabling pci device and freeing ipc_pcie. Fix this my calling a correct goto label
As dma_set_mask returns either 0 or -EIO, we can use a goto label, as it finally returns -EIO.
Add a set_mask_fail goto label which stands consistent with other goto labels in this function..
--- drivers/net/wwan/iosm/iosm_ipc_pcie.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/net/wwan/iosm/iosm_ipc_pcie.c +2 -1
@@ -295,7 +295,7 @@ static int ipc_pcie_probe(struct pci_dev *pci, ret =dma_set_mask (ipc_pcie->dev,DMA_BIT_MASK (64 ));if (ret) {dev_err (ipc_pcie->dev,"Could not set PCI DMA mask: %d" , ret); -return ret; + goto set_mask_fail; }ipc_pcie_config_aspm (ipc_pcie);
@@ -323,6 +323,7 @@ static int ipc_pcie_probe(struct pci_dev *pci, imem_init_fail:ipc_pcie_resources_release (ipc_pcie); resources_req_fail: +set_mask_fail:pci_disable_device (pci); pci_enable_fail:kfree (ipc_pcie);
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 61/134 cgroup,freezer: hold cpu_hotplug_lock before freezer_mutex
In reply to Greg Kroah-HartmanFrom: Tetsuo Handa <[email protected]>
[ Upstream commit 57dcd64c7e036299ef526b400a8d12b8a2352f26 ]
syzbot is reporting circular locking dependency between cpu_hotplug_lock and freezer_mutex, for commit f5d39b020809 ("freezer,sched: Rewrite core freezer logic") replaced atomic_inc() in freezer_apply_state() with static_branch_inc() which holds cpu_hotplug_lock.
cpu_hotplug_lock => cgroup_threadgroup_rwsem => freezer_mutex
cgroup_file_write() {
cgroup_procs_write() {
__cgroup_procs_write() {
cgroup_procs_write_start() {
cgroup_attach_lock() {
cpus_read_lock() {
percpu_down_read(&cpu_hotplug_lock);
}
percpu_down_write(&cgroup_threadgroup_rwsem);
}
}
cgroup_attach_task() {
cgroup_migrate() {
cgroup_migrate_execute() {
freezer_attach() {
mutex_lock(&freezer_mutex);
(...snipped...)
}
}
}
}
(...snipped...)
}
}
}freezer_mutex => cpu_hotplug_lock
cgroup_file_write() {
freezer_write() {
freezer_change_state() {
mutex_lock(&freezer_mutex);
freezer_apply_state() {
static_branch_inc(&freezer_active) {
static_key_slow_inc() {
cpus_read_lock();
static_key_slow_inc_cpuslocked();
cpus_read_unlock();
}
}
}
mutex_unlock(&freezer_mutex);
}
}
}Swap locking order by moving cpus_read_lock() in freezer_apply_state() to before mutex_lock(&freezer_mutex) in freezer_change_state().
--- kernel/cgroup/legacy_freezer.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)
kernel/cgroup/legacy_freezer.c +5 -2
@@ -22,6 +22,7 @@#include <linux/freezer.h> #include <linux/seq_file.h> #include <linux/mutex.h> +#include <linux/cpu.h> /* * A cgroup is freezing if any FREEZING flags are set. FREEZING_SELF is
@@ -350,7 +351,7 @@ static void freezer_apply_state(struct freezer *freezer, bool freeze,if (freeze) {if (!(freezer->state &CGROUP_FREEZING )) -static_branch_inc (&freezer_active); +static_branch_inc_cpuslocked (&freezer_active); freezer->state |= state;freeze_cgroup (freezer); }else {
@@ -361,7 +362,7 @@ static void freezer_apply_state(struct freezer *freezer, bool freeze,if (!(freezer->state &CGROUP_FREEZING )) { freezer->state &= ~CGROUP_FROZEN ;if (was_freezing) -static_branch_dec (&freezer_active); +static_branch_dec_cpuslocked (&freezer_active);unfreeze_cgroup (freezer); } }
@@ -379,6 +380,7 @@ static void freezer_change_state(struct freezer *freezer, bool freeze) {struct cgroup_subsys_state *pos; +cpus_read_lock ();/* * Update all its descendants in pre-order traversal. Each * descendant will try to inherit its parent's FREEZING state as
@@ -407,6 +409,7 @@ static void freezer_change_state(struct freezer *freezer, bool freeze) }rcu_read_unlock ();mutex_unlock (&freezer_mutex); +cpus_read_unlock (); } static ssize_t freezer_write(struct kernfs_open_file *of,
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 44/134 9p/xen : Fix use after free bug in xen_9pfs_front_remove due to race condition
In reply to Greg Kroah-HartmanFrom: Zheng Wang <[email protected]>
[ Upstream commit ea4f1009408efb4989a0f139b70fb338e7f687d0 ]
In xen_9pfs_front_probe, it calls xen_9pfs_front_alloc_dataring to init priv->rings and bound &ring->work with p9_xen_response.
When it calls xen_9pfs_front_event_handler to handle IRQ requests, it will finally call schedule_work to start the work.
When we call xen_9pfs_front_remove to remove the driver, there may be a sequence as follows:
Fix it by finishing the work before cleanup in xen_9pfs_front_free.
Note that, this bug is found by static analysis, which might be false positive.
CPU0 CPU1
|p9_xen_response
xen_9pfs_front_remove|
xen_9pfs_front_free|
kfree(priv) |
//free priv |
|p9_tag_lookup
|//use priv->client--- net/9p/trans_xen.c | 4 ++++ 1 file changed, 4 insertions(+)
net/9p/trans_xen.c +4 -0
@@ -278,6 +278,10 @@ static void xen_9pfs_front_free(struct xen_9pfs_front_priv *priv)write_unlock (&xen_9pfs_lock);for (i =0 ; i < priv->num_rings; i++) { +struct xen_9pfs_dataring *ring = &priv->rings[i]; + +cancel_work_sync (&ring->work); +if (!priv->rings[i].intf)break ;if (priv->rings[i].irq >0 )
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 62/134 net: qrtr: Fix an uninit variable access bug in qrtr_tx_resume()
In reply to Greg Kroah-HartmanFrom: Ziyang Xuan <[email protected]>
[ Upstream commit 6417070918de3bcdbe0646e7256dae58fd8083ba ]
Syzbot reported a bug as following:
=====================================================
BUG: KMSAN: uninit-value in qrtr_tx_resume+0x185/0x1f0 net/qrtr/af_qrtr.c:230 qrtr_tx_resume+0x185/0x1f0 net/qrtr/af_qrtr.c:230 qrtr_endpoint_post+0xf85/0x11b0 net/qrtr/af_qrtr.c:519 qrtr_tun_write_iter+0x270/0x400 net/qrtr/tun.c:108 call_write_iter include/linux/fs.h:2189 [inline] aio_write+0x63a/0x950 fs/aio.c:1600 io_submit_one+0x1d1c/0x3bf0 fs/aio.c:2019 __do_sys_io_submit fs/aio.c:2078 [inline] __se_sys_io_submit+0x293/0x770 fs/aio.c:2048 __x64_sys_io_submit+0x92/0xd0 fs/aio.c:2048 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd
Uninit was created at:
slab_post_alloc_hook mm/slab.h:766 [inline] slab_alloc_node mm/slub.c:3452 [inline] __kmem_cache_alloc_node+0x71f/0xce0 mm/slub.c:3491 __do_kmalloc_node mm/slab_common.c:967 [inline] __kmalloc_node_track_caller+0x114/0x3b0 mm/slab_common.c:988 kmalloc_reserve net/core/skbuff.c:492 [inline] __alloc_skb+0x3af/0x8f0 net/core/skbuff.c:565 __netdev_alloc_skb+0x120/0x7d0 net/core/skbuff.c:630 qrtr_endpoint_post+0xbd/0x11b0 net/qrtr/af_qrtr.c:446 qrtr_tun_write_iter+0x270/0x400 net/qrtr/tun.c:108 call_write_iter include/linux/fs.h:2189 [inline] aio_write+0x63a/0x950 fs/aio.c:1600 io_submit_one+0x1d1c/0x3bf0 fs/aio.c:2019 __do_sys_io_submit fs/aio.c:2078 [inline] __se_sys_io_submit+0x293/0x770 fs/aio.c:2048 __x64_sys_io_submit+0x92/0xd0 fs/aio.c:2048 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd
It is because that skb->len requires at least sizeof(struct qrtr_ctrl_pkt) in qrtr_tx_resume(). And skb->len equals to size in qrtr_endpoint_post(). But size is less than sizeof(struct qrtr_ctrl_pkt) when qrtr_cb->type equals to QRTR_TYPE_RESUME_TX in qrtr_endpoint_post() under the syzbot scenario. This triggers the uninit variable access bug.
Add size check when qrtr_cb->type equals to QRTR_TYPE_RESUME_TX in qrtr_endpoint_post() to fix the bug.
--- net/qrtr/af_qrtr.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-)
net/qrtr/af_qrtr.c +5 -3
@@ -498,6 +498,11 @@ int qrtr_endpoint_post(struct qrtr_endpoint *ep, const void *data, size_t len)if (!size || len !=ALIGN (size,4 ) + hdrlen) goto err; +if ((cb->type ==QRTR_TYPE_NEW_SERVER || + cb->type ==QRTR_TYPE_RESUME_TX ) && + size <sizeof (struct qrtr_ctrl_pkt )) + goto err; +if (cb->dst_port !=QRTR_PORT_CTRL && cb->type !=QRTR_TYPE_DATA && cb->type !=QRTR_TYPE_RESUME_TX ) goto err;
@@ -510,9 +515,6 @@ int qrtr_endpoint_post(struct qrtr_endpoint *ep, const void *data, size_t len)/* Remote node endpoint can bridge other distant nodes */ const struct qrtr_ctrl_pkt *pkt; -if (size <sizeof (*pkt)) - goto err; - pkt = data + hdrlen;qrtr_node_assign (node,le32_to_cpu (pkt->server.node)); }
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 63/134 sctp: fix a potential overflow in sctp_ifwdtsn_skip
In reply to Greg Kroah-HartmanFrom: Xin Long <[email protected]>
[ Upstream commit 32832a2caf82663870126c5186cf8f86c8b2a649 ]
Currently, when traversing ifwdtsn skips with _sctp_walk_ifwdtsn, it only checks the pos against the end of the chunk. However, the data left for the last pos may be < sizeof(struct sctp_ifwdtsn_skip), and dereference it as struct sctp_ifwdtsn_skip may cause coverflow.
This patch fixes it by checking the pos against "the end of the chunk - sizeof(struct sctp_ifwdtsn_skip)" in sctp_ifwdtsn_skip, similar to sctp_fwdtsn_skip.
--- net/sctp/stream_interleave.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
net/sctp/stream_interleave.c +2 -1
@@ -1160,7 +1160,8 @@ static void sctp_generate_iftsn(struct sctp_outq *q, __u32 ctsn)#define _sctp_walk_ifwdtsn (pos, chunk, end) \ for (pos = chunk->subh.ifwdtsn_hdr->skip; \ - (void *)pos < (void *)chunk->subh.ifwdtsn_hdr->skip + (end); pos++) + (void *)pos <= (void *)chunk->subh.ifwdtsn_hdr->skip + (end) - \ + sizeof(struct sctp_ifwdtsn_skip); pos++)#define sctp_walk_ifwdtsn (pos, ch) \ _sctp_walk_ifwdtsn((pos), (ch), ntohs((ch)->chunk_hdr->length) - \
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 64/134 RDMA/core: Fix GID entry ref leak when create_ah fails
In reply to Greg Kroah-HartmanFrom: Saravanan Vajravel <[email protected]>
[ Upstream commit aca3b0fa3d04b40c96934d86cc224cccfa7ea8e0 ]
If AH create request fails, release sgid_attr to avoid GID entry referrence leak reported while releasing GID table
--- drivers/infiniband/core/verbs.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/infiniband/core/verbs.c +2 -0
@@ -532,6 +532,8 @@ static struct ib_ah *_rdma_create_ah(struct ib_pd *pd,else ret = device->ops.create_ah (ah, &init_attr,NULL );if (ret) { +if (ah->sgid_attr) +rdma_put_gid_attr (ah->sgid_attr);kfree (ah);return ERR_PTR (ret); }
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 65/134 selftests: openvswitch: adjust datapath NL message declaration
In reply to Greg Kroah-HartmanFrom: Aaron Conole <[email protected]>
[ Upstream commit 306dc21361993f4fe50a15d4db6b1a4de5d0adb0 ]
The netlink message for creating a new datapath takes an array of ports for the PID creation. This shouldn't cause much issue but correct it for future cases where we need to do decode of datapath information that could include the per-cpu PID map.
--- tools/testing/selftests/net/openvswitch/ovs-dpctl.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tools/testing/selftests/net/openvswitch/ovs-dpctl.py +1 -1
@@ -62,7 +62,7 @@ class OvsDatapath(GenericNetlinkSocket): nla_map = ( ("OVS_DP_ATTR_UNSPEC", "none"), ("OVS_DP_ATTR_NAME", "asciiz"), - ("OVS_DP_ATTR_UPCALL_PID", "uint32"), + ("OVS_DP_ATTR_UPCALL_PID", "array(uint32)"), ("OVS_DP_ATTR_STATS", "dpstats"), ("OVS_DP_ATTR_MEGAFLOW_STATS", "megaflowstats"), ("OVS_DP_ATTR_USER_FEATURES", "uint32"),
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 66/134 udp6: fix potential access to stale information
In reply to Greg Kroah-HartmanFrom: Eric Dumazet <[email protected]>
[ Upstream commit 1c5950fc6fe996235f1d18539b9c6b64b597f50f ]
lena wang reported an issue caused by udpv6_sendmsg() mangling msg->msg_name and msg->msg_namelen, which are later read from ____sys_sendmsg() :
/*
* If this is sendmmsg() and sending to current destination address was
* successful, remember it.
*/
if (used_address && err >= 0) {
used_address->name_len = msg_sys->msg_namelen;
if (msg_sys->msg_name)
memcpy(&used_address->name, msg_sys->msg_name,
used_address->name_len);
}udpv6_sendmsg() wants to pretend the remote address family is AF_INET in order to call udp_sendmsg().
A fix would be to modify the address in-place, instead of using a local variable, but this could have other side effects.
Instead, restore initial values before we return from udpv6_sendmsg().
--- net/ipv6/udp.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-)
net/ipv6/udp.c +5 -3
@@ -1391,9 +1391,11 @@ int udpv6_sendmsg(struct sock *sk, struct msghdr *msg, size_t len) msg->msg_name = &sin; msg->msg_namelen =sizeof (sin); do_udp_sendmsg: -if (ipv6_only_sock (sk)) -return -ENETUNREACH ; -return udp_sendmsg (sk, msg, len); + err =ipv6_only_sock (sk) ? + -ENETUNREACH :udp_sendmsg (sk, msg, len); + msg->msg_name = sin6; + msg->msg_namelen = addr_len; +return err; } }
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 67/134 net: macb: fix a memory corruption in extended buffer descriptor mode
In reply to Greg Kroah-HartmanFrom: Roman Gushchin <[email protected]>
[ Upstream commit e8b74453555872851bdd7ea43a7c0ec39659834f ]
For quite some time we were chasing a bug which looked like a sudden permanent failure of networking and mmc on some of our devices. The bug was very sensitive to any software changes and even more to any kernel debug options.
Finally we got a setup where the problem was reproducible with CONFIG_DMA_API_DEBUG=y and it revealed the issue with the rx dma:
[ 16.992082] ------------[ cut here ]------------ [ 16.996779] DMA-API: macb ff0b0000.ethernet: device driver tries to free DMA memory it has not allocated [device address=0x0000000875e3e244] [size=1536 bytes] [ 17.011049] WARNING: CPU: 0 PID: 85 at kernel/dma/debug.c:1011 check_unmap+0x6a0/0x900 [ 17.018977] Modules linked in: xxxxx [ 17.038823] CPU: 0 PID: 85 Comm: irq/55-8000f000 Not tainted 5.4.0 #28 [ 17.045345] Hardware name: xxxxx [ 17.049528] pstate: 60000005 (nZCv daif -PAN -UAO) [ 17.054322] pc : check_unmap+0x6a0/0x900 [ 17.058243] lr : check_unmap+0x6a0/0x900 [ 17.062163] sp : ffffffc010003c40 [ 17.065470] x29: ffffffc010003c40 x28: 000000004000c03c [ 17.070783] x27: ffffffc010da7048 x26: ffffff8878e38800 [ 17.076095] x25: ffffff8879d22810 x24: ffffffc010003cc8 [ 17.081407] x23: 0000000000000000 x22: ffffffc010a08750 [ 17.086719] x21: ffffff8878e3c7c0 x20: ffffffc010acb000 [ 17.092032] x19: 0000000875e3e244 x18: 0000000000000010 [ 17.097343] x17: 0000000000000000 x16: 0000000000000000 [ 17.102647] x15: ffffff8879e4a988 x14: 0720072007200720 [ 17.107959] x13: 0720072007200720 x12: 0720072007200720 [ 17.113261] x11: 0720072007200720 x10: 0720072007200720 [ 17.118565] x9 : 0720072007200720 x8 : 000000000000022d [ 17.123869] x7 : 0000000000000015 x6 : 0000000000000098 [ 17.129173] x5 : 0000000000000000 x4 : 0000000000000000 [ 17.134475] x3 : 00000000ffffffff x2 : ffffffc010a1d370 [ 17.139778] x1 : b420c9d75d27bb00 x0 : 0000000000000000 [ 17.145082] Call trace: [ 17.147524] check_unmap+0x6a0/0x900 [ 17.151091] debug_dma_unmap_page+0x88/0x90 [ 17.155266] gem_rx+0x114/0x2f0 [ 17.158396] macb_poll+0x58/0x100 [ 17.161705] net_rx_action+0x118/0x400 [ 17.165445] __do_softirq+0x138/0x36c [ 17.169100] irq_exit+0x98/0xc0 [ 17.172234] __handle_domain_irq+0x64/0xc0 [ 17.176320] gic_handle_irq+0x5c/0xc0 [ 17.179974] el1_irq+0xb8/0x140 [ 17.183109] xiic_process+0x5c/0xe30 [ 17.186677] irq_thread_fn+0x28/0x90 [ 17.190244] irq_thread+0x208/0x2a0 [ 17.193724] kthread+0x130/0x140 [ 17.196945] ret_from_fork+0x10/0x20 [ 17.200510] ---[ end trace 7240980785f81d6f ]---
[ 237.021490] ------------[ cut here ]------------ [ 237.026129] DMA-API: exceeded 7 overlapping mappings of cacheline 0x0000000021d79e7b [ 237.033886] WARNING: CPU: 0 PID: 0 at kernel/dma/debug.c:499 add_dma_entry+0x214/0x240 [ 237.041802] Modules linked in: xxxxx [ 237.061637] CPU: 0 PID: 0 Comm: swapper/0 Tainted: G W 5.4.0 #28 [ 237.068941] Hardware name: xxxxx [ 237.073116] pstate: 80000085 (Nzcv daIf -PAN -UAO) [ 237.077900] pc : add_dma_entry+0x214/0x240 [ 237.081986] lr : add_dma_entry+0x214/0x240 [ 237.086072] sp : ffffffc010003c30 [ 237.089379] x29: ffffffc010003c30 x28: ffffff8878a0be00 [ 237.094683] x27: 0000000000000180 x26: ffffff8878e387c0 [ 237.099987] x25: 0000000000000002 x24: 0000000000000000 [ 237.105290] x23: 000000000000003b x22: ffffffc010a0fa00 [ 237.110594] x21: 0000000021d79e7b x20: ffffffc010abe600 [ 237.115897] x19: 00000000ffffffef x18: 0000000000000010 [ 237.121201] x17: 0000000000000000 x16: 0000000000000000 [ 237.126504] x15: ffffffc010a0fdc8 x14: 0720072007200720 [ 237.131807] x13: 0720072007200720 x12: 0720072007200720 [ 237.137111] x11: 0720072007200720 x10: 0720072007200720 [ 237.142415] x9 : 0720072007200720 x8 : 0000000000000259 [ 237.147718] x7 : 0000000000000001 x6 : 0000000000000000 [ 237.153022] x5 : ffffffc010003a20 x4 : 0000000000000001 [ 237.158325] x3 : 0000000000000006 x2 : 0000000000000007 [ 237.163628] x1 : 8ac721b3a7dc1c00 x0 : 0000000000000000 [ 237.168932] Call trace: [ 237.171373] add_dma_entry+0x214/0x240 [ 237.175115] debug_dma_map_page+0xf8/0x120 [ 237.179203] gem_rx_refill+0x190/0x280 [ 237.182942] gem_rx+0x224/0x2f0 [ 237.186075] macb_poll+0x58/0x100 [ 237.189384] net_rx_action+0x118/0x400 [ 237.193125] __do_softirq+0x138/0x36c [ 237.196780] irq_exit+0x98/0xc0 [ 237.199914] __handle_domain_irq+0x64/0xc0 [ 237.204000] gic_handle_irq+0x5c/0xc0 [ 237.207654] el1_irq+0xb8/0x140 [ 237.210789] arch_cpu_idle+0x40/0x200 [ 237.214444] default_idle_call+0x18/0x30 [ 237.218359] do_idle+0x200/0x280 [ 237.221578] cpu_startup_entry+0x20/0x30 [ 237.225493] rest_init+0xe4/0xf0 [ 237.228713] arch_call_rest_init+0xc/0x14 [ 237.232714] start_kernel+0x47c/0x4a8 [ 237.236367] ---[ end trace 7240980785f81d70 ]---
Lars was fast to find an explanation: according to the datasheet bit 2 of the rx buffer descriptor entry has a different meaning in the extended mode:
Address [2] of beginning of buffer, or
in extended buffer descriptor mode (DMA configuration register [28] = 1), indicates a valid timestamp in the buffer descriptor entry.
The macb driver didn't mask this bit while getting an address and it eventually caused a memory corruption and a dma failure.
The problem is resolved by explicitly clearing the problematic bit if hw timestamping is used.
--- drivers/net/ethernet/cadence/macb_main.c | 4 ++++ 1 file changed, 4 insertions(+)
drivers/net/ethernet/cadence/macb_main.c +4 -0
@@ -1010,6 +1010,10 @@ static dma_addr_t macb_get_addr(struct macb *bp, struct macb_dma_desc *desc) }#endif addr |=MACB_BF (RX_WADDR ,MACB_BFEXT (RX_WADDR , desc->addr)); +#ifdef CONFIG_MACB_USE_HWSTAMP +if (bp->hw_dma_cap &HW_DMA_CAP_PTP ) + addr &= ~GEM_BIT (DMA_RXVALID ); +#endif return addr; }
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 68/134 skbuff: Fix a race between coalescing and releasing SKBs
In reply to Greg Kroah-HartmanFrom: Liang Chen <[email protected]>
[ Upstream commit 0646dc31ca886693274df5749cd0c8c1eaaeb5ca ]
Commit 1effe8ca4e34 ("skbuff: fix coalescing for page_pool fragment recycling") allowed coalescing to proceed with non page pool page and page pool page when @from is cloned, i.e.
to->pp_recycle --> false from->pp_recycle --> true skb_cloned(from) --> true
However, it actually requires skb_cloned(@from) to hold true until coalescing finishes in this situation. If the other cloned SKB is released while the merging is in process, from_shinfo->nr_frags will be set to 0 toward the end of the function, causing the increment of frag page _refcount to be unexpectedly skipped resulting in inconsistent reference counts. Later when SKB(@to) is released, it frees the page directly even though the page pool page is still in use, leading to use-after-free or double-free errors. So it should be prohibited.
The double-free error message below prompted us to investigate:
BUG: Bad page state in process swapper/1 pfn:0e0d1 page:00000000c6548b28 refcount:-1 mapcount:0 mapping:0000000000000000 index:0x2 pfn:0xe0d1 flags: 0xfffffc0000000(node=0|zone=1|lastcpupid=0x1fffff) raw: 000fffffc0000000 0000000000000000 ffffffff00000101 0000000000000000 raw: 0000000000000002 0000000000000000 ffffffffffffffff 0000000000000000 page dumped because: nonzero _refcount CPU: 1 PID: 0 Comm: swapper/1 Tainted: G E 6.2.0+ Call Trace: <IRQ> dump_stack_lvl+0x32/0x50 bad_page+0x69/0xf0 free_pcp_prepare+0x260/0x2f0 free_unref_page+0x20/0x1c0 skb_release_data+0x10b/0x1a0 napi_consume_skb+0x56/0x150 net_rx_action+0xf0/0x350 ? __napi_schedule+0x79/0x90 __do_softirq+0xc8/0x2b1 __irq_exit_rcu+0xb9/0xf0 common_interrupt+0x82/0xa0 </IRQ> <TASK> asm_common_interrupt+0x22/0x40 RIP: 0010:default_idle+0xb/0x20
--- net/core/skbuff.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-)
net/core/skbuff.c +8 -8
@@ -5409,18 +5409,18 @@ bool skb_try_coalesce(struct sk_buff *to, struct sk_buff *from,if (skb_cloned (to))return false; -/* In general, avoid mixing slab allocated and page_pool allocated -* pages within the same SKB. However when @to is not pp_recycle and -* @from is cloned, we can transition frag pages from page_pool to -* reference counted. -* -* On the other hand, don't allow coalescing two pp_recycle SKBs if -* @from is cloned, in case the SKB is using page_pool fragment +/* In general, avoid mixing page_pool and non-page_pool allocated +* pages within the same SKB. Additionally avoid dealing with clones +* with page_pool pages, in case the SKB is using page_pool fragment * references (PP_FLAG_PAGE_FRAG). Since we only take full page * references for cloned SKBs at the moment that would result in * inconsistent reference counts. +* In theory we could take full references if @from is cloned and +* !@to->pp_recycle but its tricky (due to potential race with +* the clone disappearing) and rare, so not worth dealing with. */ -if (to->pp_recycle != (from->pp_recycle && !skb_cloned (from))) +if (to->pp_recycle != from->pp_recycle || + (from->pp_recycle &&skb_cloned (from)))return false;if (len <=skb_tailroom (to)) {
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 69/134 libbpf: Fix single-line struct definition output in btf_dump
In reply to Greg Kroah-HartmanFrom: Andrii Nakryiko <[email protected]>
[ Upstream commit 872aec4b5f635d94111d48ec3c57fbe078d64e7d ]
btf_dump APIs emit unnecessary tabs when emitting struct/union definition that fits on the single line. Before this patch we'd get:
struct blah {<tab>};
This patch fixes this and makes sure that we get more natural:
struct blah {};
--- tools/lib/bpf/btf_dump.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)
tools/lib/bpf/btf_dump.c +5 -2
@@ -1015,9 +1015,12 @@ static void btf_dump_emit_struct_def(struct btf_dump *d,* Keep `struct empty {}` on a single line, * only print newline when there are regular or padding fields. */ -if (vlen || t->size) +if (vlen || t->size) {btf_dump_printf (d,"\n" ); -btf_dump_printf (d,"%s}" ,pfx (lvl)); +btf_dump_printf (d,"%s}" ,pfx (lvl)); + }else { +btf_dump_printf (d,"}" ); + }if (packed)btf_dump_printf (d," __attribute__((packed))" ); }
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 70/134 ARM: 9290/1: uaccess: Fix KASAN false-positives
In reply to Greg Kroah-HartmanFrom: Andrew Jeffery <[email protected]>
[ Upstream commit ceac10c83b330680cc01ceaaab86cd49f4f30d81 ]
__copy_to_user_memcpy() and __clear_user_memset() had been calling memcpy() and memset() respectively, leading to false-positive KASAN reports when starting userspace:
[ 10.707901] Run /init as init process
[ 10.731892] process '/bin/busybox' started with executable stack
[ 10.745234] ==================================================================
[ 10.745796] BUG: KASAN: user-memory-access in __clear_user_memset+0x258/0x3ac
[ 10.747260] Write of size 2687 at addr 000de581 by task init/1Use __memcpy() and __memset() instead to allow userspace access, which is of course the intent of these functions.
--- arch/arm/lib/uaccess_with_memcpy.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
arch/arm/lib/uaccess_with_memcpy.c +2 -2
@@ -116,7 +116,7 @@ __copy_to_user_memcpy(void __user *to, const void *from, unsigned long n) tocopy = n; ua_flags =uaccess_save_and_enable (); -memcpy ((void *)to, from, tocopy); +__memcpy ((void *)to, from, tocopy);uaccess_restore (ua_flags); to += tocopy; from += tocopy;
@@ -178,7 +178,7 @@ __clear_user_memset(void __user *addr, unsigned long n) tocopy = n; ua_flags =uaccess_save_and_enable (); -memset ((void *)addr,0 , tocopy); +__memset ((void *)addr,0 , tocopy);uaccess_restore (ua_flags); addr += tocopy; n -= tocopy;
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 71/134 ARM: dts: qcom: apq8026-lg-lenok: add missing reserved memory
In reply to Greg Kroah-HartmanFrom: Luca Weiss <[email protected]>
[ Upstream commit ecd240875e877d78fd03efbc62292f550872df3f ]
Turns out these two memory regions also need to be avoided, otherwise weird things will happen when Linux tries to use this memory.
--- arch/arm/boot/dts/qcom-apq8026-lg-lenok.dts | 10 ++++++++++ 1 file changed, 10 insertions(+)
arch/arm/boot/dts/qcom-apq8026-lg-lenok.dts +10 -0
@@ -26,6 +26,16 @@ }; reserved-memory { + sbl_region: sbl@2f00000 { + reg = <0x02f00000 0x100000>; + no-map; + }; + + external_image_region: external-image@3100000 { + reg = <0x03100000 0x200000>; + no-map; + }; + adsp_region: adsp@3300000 { reg = <0x03300000 0x1400000>; no-map;
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 45/134 bpf, arm64: Fixed a BTI error on returning to patched function
In reply to Greg Kroah-HartmanFrom: Xu Kuohai <[email protected]>
[ Upstream commit 738a96c4a8c36950803fdd27e7c30aca92dccefd ]
When BPF_TRAMP_F_CALL_ORIG is set, BPF trampoline uses BLR to jump back to the instruction next to call site to call the patched function. For BTI-enabled kernel, the instruction next to call site is usually PACIASP, in this case, it's safe to jump back with BLR. But when the call site is not followed by a PACIASP or bti, a BTI exception is triggered.
Here is a fault log:
Unhandled 64-bit el1h sync exception on CPU0, ESR 0x0000000034000002 -- BTI
CPU: 0 PID: 263 Comm: test_progs Tainted: GF Hardware name: linux,dummy-virt (DT) pstate: 40400805 (nZcv daif +PAN -UAO -TCO -DIT -SSBS BTYPE=-c) pc : bpf_fentry_test1+0xc/0x30 lr : bpf_trampoline_6442573892_0+0x48/0x1000 sp : ffff80000c0c3a50 x29: ffff80000c0c3a90 x28: ffff0000c2e6c080 x27: 0000000000000000 x26: 0000000000000000 x25: 0000000000000000 x24: 0000000000000050 x23: 0000000000000000 x22: 0000ffffcfd2a7f0 x21: 000000000000000a x20: 0000ffffcfd2a7f0 x19: 0000000000000000 x18: 0000000000000000 x17: 0000000000000000 x16: 0000000000000000 x15: 0000ffffcfd2a7f0 x14: 0000000000000000 x13: 0000000000000000 x12: 0000000000000000 x11: 0000000000000000 x10: ffff80000914f5e4 x9 : ffff8000082a1528 x8 : 0000000000000000 x7 : 0000000000000000 x6 : 0101010101010101 x5 : 0000000000000000 x4 : 00000000fffffff2 x3 : 0000000000000001 x2 : ffff8001f4b82000 x1 : 0000000000000000 x0 : 0000000000000001 Kernel panic - not syncing: Unhandled exception CPU: 0 PID: 263 Comm: test_progs Tainted: GF Hardware name: linux,dummy-virt (DT) Call trace: dump_backtrace+0xec/0x144 show_stack+0x24/0x7c dump_stack_lvl+0x8c/0xb8 dump_stack+0x18/0x34 panic+0x1cc/0x3ec __el0_error_handler_common+0x0/0x130 el1h_64_sync_handler+0x60/0xd0 el1h_64_sync+0x78/0x7c bpf_fentry_test1+0xc/0x30 bpf_fentry_test1+0xc/0x30 bpf_prog_test_run_tracing+0xdc/0x2a0 __sys_bpf+0x438/0x22a0 __arm64_sys_bpf+0x30/0x54 invoke_syscall+0x78/0x110 el0_svc_common.constprop.0+0x6c/0x1d0 do_el0_svc+0x38/0xe0 el0_svc+0x30/0xd0 el0t_64_sync_handler+0x1ac/0x1b0 el0t_64_sync+0x1a0/0x1a4 Kernel Offset: disabled CPU features: 0x0000,00034c24,f994fdab Memory Limit: none
And the instruction next to call site of bpf_fentry_test1 is ADD, not PACIASP:
<bpf_fentry_test1>:
bti c nop nop add w0, w0, #0x1 paciasp
For BPF prog, JIT always puts a PACIASP after call site for BTI-enabled kernel, so there is no problem. To fix it, replace BLR with RET to bypass the branch target check.
--- arch/arm64/net/bpf_jit.h | 4 ++++ arch/arm64/net/bpf_jit_comp.c | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-)
arch/arm64/net/bpf_jit.h +4 -0
@@ -281,4 +281,8 @@/* DMB */ #define A64_DMB_ISH aarch64_insn_gen_dmb(AARCH64_INSN_MB_ISH) +/* ADR */ +#define A64_ADR (Rd, offset) \ + aarch64_insn_gen_adr(0, offset, Rd, AARCH64_INSN_ADR_TYPE_ADR) +#endif /* _BPF_JIT_H */
arch/arm64/net/bpf_jit_comp.c +2 -1
@@ -1905,7 +1905,8 @@ static int prepare_trampoline(struct jit_ctx *ctx, struct bpf_tramp_image *im,restore_args (ctx, args_off, nargs);/* call original func */ emit (A64_LDR64I (A64_R (10 ),A64_SP , retaddr_off), ctx); -emit (A64_BLR (A64_R (10 )), ctx); +emit (A64_ADR (A64_LR ,AARCH64_INSN_SIZE *2 ), ctx); +emit (A64_RET (A64_R (10 )), ctx);/* store return value */ emit (A64_STR64I (A64_R (0 ),A64_SP , retval_off), ctx);/* reserve a nop for bpf_tramp_image_put */
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 72/134 power: supply: rk817: Fix unsigned comparison with less than zero
In reply to Greg Kroah-HartmanFrom: Jiapeng Chong <[email protected]>
[ Upstream commit 3268a4d9b0b85a4382e93bdf7be5400a73db74c5 ]
The tmp is defined as u32 type, which results in invalid processing of tmp<0 in function rk817_read_or_set_full_charge_on_boot(). Therefore, drop the comparison.
drivers/power/supply/rk817_charger.c:828 rk817_read_or_set_full_charge_on_boot() warn: unsigned 'tmp' is never less than zero. drivers/power/supply/rk817_charger.c:788 rk817_read_or_set_full_charge_on_boot() warn: unsigned 'tmp' is never less than zero.
--- drivers/power/supply/rk817_charger.c | 4 ---- 1 file changed, 4 deletions(-)
drivers/power/supply/rk817_charger.c +0 -4
@@ -785,8 +785,6 @@ rk817_read_or_set_full_charge_on_boot(struct rk817_charger *charger,regmap_bulk_read (rk808->regmap,RK817_GAS_GAUGE_Q_PRES_H3 , bulk_reg,4 ); tmp =get_unaligned_be32 (bulk_reg); -if (tmp <0 ) - tmp =0 ; boot_charge_mah =ADC_TO_CHARGE_UAH (tmp, charger->res_div) /1000 ;/*
@@ -825,8 +823,6 @@ rk817_read_or_set_full_charge_on_boot(struct rk817_charger *charger,regmap_bulk_read (rk808->regmap,RK817_GAS_GAUGE_Q_PRES_H3 , bulk_reg,4 ); tmp =get_unaligned_be32 (bulk_reg); -if (tmp <0 ) - tmp =0 ; boot_charge_mah =ADC_TO_CHARGE_UAH (tmp, charger->res_div) /1000 ;regmap_bulk_read (rk808->regmap,RK817_GAS_GAUGE_OCV_VOL_H , bulk_reg,2 );
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 73/134 power: supply: cros_usbpd: reclassify "default case!" as debug
In reply to Greg Kroah-HartmanFrom: Grant Grundler <[email protected]>
[ Upstream commit 14c76b2e75bca4d96e2b85a0c12aa43e84fe3f74 ]
This doesn't need to be printed every second as an error:
...
<3>[17438.628385] cros-usbpd-charger cros-usbpd-charger.3.auto: Port 1: default case! <3>[17439.634176] cros-usbpd-charger cros-usbpd-charger.3.auto: Port 1: default case! <3>[17440.640298] cros-usbpd-charger cros-usbpd-charger.3.auto: Port 1: default case!
...
Reduce priority from ERROR to DEBUG.
--- drivers/power/supply/cros_usbpd-charger.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/power/supply/cros_usbpd-charger.c +1 -1
@@ -276,7 +276,7 @@ static int cros_usbpd_charger_get_power_info(struct port_data *port) port->psy_current_max =0 ;break ;default : -dev_err (dev,"Port %d: default case!\n" , port->port_number); +dev_dbg (dev,"Port %d: default case!\n" , port->port_number); port->psy_usb_type =POWER_SUPPLY_USB_TYPE_SDP ; }
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 46/134 KVM: arm64: Initialise hypervisor copies of host symbols unconditionally
In reply to Greg Kroah-HartmanFrom: Will Deacon <[email protected]>
[ Upstream commit 6c165223e9a6384aa1e934b90f2650e71adb972a ]
The nVHE object at EL2 maintains its own copies of some host variables so that, when pKVM is enabled, the host cannot directly modify the hypervisor state. When running in normal nVHE mode, however, these variables are still mirrored at EL2 but are not initialised.
Initialise the hypervisor symbols from the host copies regardless of pKVM, ensuring that any reference to this data at EL2 with normal nVHE will return a sensibly initialised value.
Stable-dep-of: e81625218bf7 ("KVM: arm64: Advertise ID_AA64PFR0_EL1.CSV2/3 to protected VMs")
--- arch/arm64/kvm/arm.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-)
arch/arm64/kvm/arm.c +9 -6
@@ -1870,11 +1870,8 @@ static int do_pkvm_init(u32 hyp_va_bits)return ret; } -static int kvm_hyp_init_protection (u32 hyp_va_bits) +static void kvm_hyp_init_symbols (void ) { -void *addr =phys_to_virt (hyp_mem_base); -int ret; -kvm_nvhe_sym (id_aa64pfr0_el1_sys_val) =read_sanitised_ftr_reg (SYS_ID_AA64PFR0_EL1 );kvm_nvhe_sym (id_aa64pfr1_el1_sys_val) =read_sanitised_ftr_reg (SYS_ID_AA64PFR1_EL1 );kvm_nvhe_sym (id_aa64isar0_el1_sys_val) =read_sanitised_ftr_reg (SYS_ID_AA64ISAR0_EL1 );
@@ -1883,6 +1880,12 @@ static int kvm_hyp_init_protection(u32 hyp_va_bits)kvm_nvhe_sym (id_aa64mmfr0_el1_sys_val) =read_sanitised_ftr_reg (SYS_ID_AA64MMFR0_EL1 );kvm_nvhe_sym (id_aa64mmfr1_el1_sys_val) =read_sanitised_ftr_reg (SYS_ID_AA64MMFR1_EL1 );kvm_nvhe_sym (id_aa64mmfr2_el1_sys_val) =read_sanitised_ftr_reg (SYS_ID_AA64MMFR2_EL1 ); +} + +static int kvm_hyp_init_protection (u32 hyp_va_bits) +{ +void *addr =phys_to_virt (hyp_mem_base); +int ret; ret =create_hyp_mappings (addr, addr + hyp_mem_size,PAGE_HYP );if (ret)
@@ -2057,6 +2060,8 @@ static int init_hyp_mode(void)cpu_prepare_hyp_mode (cpu); } +kvm_hyp_init_symbols (); +if (is_protected_kvm_enabled ()) {init_cpu_logical_map ();
@@ -2064,9 +2069,7 @@ static int init_hyp_mode(void) err = -ENODEV ; goto out_err; } - } -if (is_protected_kvm_enabled ()) { err =kvm_hyp_init_protection (hyp_va_bits);if (err) {kvm_err ("Failed to init hyp memory protection\n" );
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 47/134 KVM: arm64: Advertise ID_AA64PFR0_EL1.CSV2/3 to protected VMs
In reply to Greg Kroah-HartmanFrom: Fuad Tabba <[email protected]>
[ Upstream commit e81625218bf7986ba1351a98c43d346b15601d26 ]
The existing pKVM code attempts to advertise CSV2/3 using values initialized to 0, but never set. To advertise CSV2/3 to protected guests, pass the CSV2/3 values to hyp when initializing hyp's view of guests' ID_AA64PFR0_EL1.
Similar to non-protected KVM, these are system-wide, rather than per cpu, for simplicity.
--- arch/arm64/kvm/arm.c | 26 ++++++++++++++++++- .../arm64/kvm/hyp/include/nvhe/fixed_config.h | 5 +++- arch/arm64/kvm/hyp/nvhe/sys_regs.c | 7 ----- 3 files changed, 29 insertions(+), 9 deletions(-)
arch/arm64/kvm/arm.c +25 -1
@@ -1870,9 +1870,33 @@ static int do_pkvm_init(u32 hyp_va_bits)return ret; } +static u64 get_hyp_id_aa64pfr0_el1 (void ) +{ +/* +* Track whether the system isn't affected by spectre/meltdown in the +* hypervisor's view of id_aa64pfr0_el1, used for protected VMs. +* Although this is per-CPU, we make it global for simplicity, e.g., not +* to have to worry about vcpu migration. +* +* Unlike for non-protected VMs, userspace cannot override this for +* protected VMs. +*/ +u64 val =read_sanitised_ftr_reg (SYS_ID_AA64PFR0_EL1 ); + + val &= ~(ARM64_FEATURE_MASK (ID_AA64PFR0_EL1_CSV2 ) | +ARM64_FEATURE_MASK (ID_AA64PFR0_EL1_CSV3 )); + + val |=FIELD_PREP (ARM64_FEATURE_MASK (ID_AA64PFR0_EL1_CSV2 ), +arm64_get_spectre_v2_state () ==SPECTRE_UNAFFECTED ); + val |=FIELD_PREP (ARM64_FEATURE_MASK (ID_AA64PFR0_EL1_CSV3 ), +arm64_get_meltdown_state () ==SPECTRE_UNAFFECTED ); + +return val; +} +static void kvm_hyp_init_symbols (void ) { -kvm_nvhe_sym (id_aa64pfr0_el1_sys_val) =read_sanitised_ftr_reg (SYS_ID_AA64PFR0_EL1 ); +kvm_nvhe_sym (id_aa64pfr0_el1_sys_val) =get_hyp_id_aa64pfr0_el1 ();kvm_nvhe_sym (id_aa64pfr1_el1_sys_val) =read_sanitised_ftr_reg (SYS_ID_AA64PFR1_EL1 );kvm_nvhe_sym (id_aa64isar0_el1_sys_val) =read_sanitised_ftr_reg (SYS_ID_AA64ISAR0_EL1 );kvm_nvhe_sym (id_aa64isar1_el1_sys_val) =read_sanitised_ftr_reg (SYS_ID_AA64ISAR1_EL1 );
arch/arm64/kvm/hyp/include/nvhe/fixed_config.h +4 -1
@@ -33,11 +33,14 @@* Allow for protected VMs: * - Floating-point and Advanced SIMD * - Data Independent Timing +* - Spectre/Meltdown Mitigation */ #define PVM_ID_AA64PFR0_ALLOW (\ ARM64_FEATURE_MASK(ID_AA64PFR0_EL1_FP) | \ ARM64_FEATURE_MASK(ID_AA64PFR0_EL1_AdvSIMD) | \ - ARM64_FEATURE_MASK(ID_AA64PFR0_EL1_DIT) \ + ARM64_FEATURE_MASK(ID_AA64PFR0_EL1_DIT) | \ + ARM64_FEATURE_MASK(ID_AA64PFR0_EL1_CSV2) | \ + ARM64_FEATURE_MASK(ID_AA64PFR0_EL1_CSV3) \ )/*
arch/arm64/kvm/hyp/nvhe/sys_regs.c +0 -7
@@ -84,19 +84,12 @@ static u64 get_restricted_features_unsigned(u64 sys_reg_val,static u64 get_pvm_id_aa64pfr0 (const struct kvm_vcpu *vcpu) { -const struct kvm *kvm = (const struct kvm *)kern_hyp_va (vcpu->kvm);u64 set_mask =0 ;u64 allow_mask =PVM_ID_AA64PFR0_ALLOW ; set_mask |=get_restricted_features_unsigned (id_aa64pfr0_el1_sys_val,PVM_ID_AA64PFR0_RESTRICT_UNSIGNED ); -/* Spectre and Meltdown mitigation in KVM */ - set_mask |=FIELD_PREP (ARM64_FEATURE_MASK (ID_AA64PFR0_EL1_CSV2 ), - (u64 )kvm->arch.pfr0_csv2); - set_mask |=FIELD_PREP (ARM64_FEATURE_MASK (ID_AA64PFR0_EL1_CSV3 ), - (u64 )kvm->arch.pfr0_csv3); -return (id_aa64pfr0_el1_sys_val & allow_mask) | set_mask; }
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 48/134 niu: Fix missing unwind goto in niu_alloc_channels()
In reply to Greg Kroah-HartmanFrom: Harshit Mogalapalli <[email protected]>
[ Upstream commit 8ce07be703456acb00e83d99f3b8036252c33b02 ]
Smatch reports: drivers/net/ethernet/sun/niu.c:4525
niu_alloc_channels() warn: missing unwind goto?
If niu_rbr_fill() fails, then we are directly returning 'err' without freeing the channels.
Fix this by changing direct return to a goto 'out_err'.
--- drivers/net/ethernet/sun/niu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/sun/niu.c +1 -1
@@ -4522,7 +4522,7 @@ static int niu_alloc_channels(struct niu *np) err =niu_rbr_fill (np, rp,GFP_KERNEL );if (err) -return err; + goto out_err; } tx_rings = kcalloc(num_tx_rings, sizeof(struct tx_ring_info),
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 49/134 tcp: restrict net.ipv4.tcp_app_win
In reply to Greg Kroah-HartmanFrom: YueHaibing <[email protected]>
[ Upstream commit dc5110c2d959c1707e12df5f792f41d90614adaa ]
UBSAN: shift-out-of-bounds in net/ipv4/tcp_input.c:555:23 shift exponent 255 is too large for 32-bit type 'int' CPU: 1 PID: 7907 Comm: ssh Not tainted 6.3.0-rc4-00161-g62bad54b26db-dirty #206 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.15.0-1 04/01/2014 Call Trace: <TASK> dump_stack_lvl+0x136/0x150 __ubsan_handle_shift_out_of_bounds+0x21f/0x5a0 tcp_init_transfer.cold+0x3a/0xb9 tcp_finish_connect+0x1d0/0x620 tcp_rcv_state_process+0xd78/0x4d60 tcp_v4_do_rcv+0x33d/0x9d0 __release_sock+0x133/0x3b0 release_sock+0x58/0x1b0
'maxwin' is int, shifting int for 32 or more bits is undefined behaviour.
--- Documentation/networking/ip-sysctl.rst | 2 ++ net/ipv4/sysctl_net_ipv4.c | 3 +++ 2 files changed, 5 insertions(+)
Documentation/networking/ip-sysctl.rst +2 -0
@@ -337,6 +337,8 @@ tcp_app_win - INTEGER Reserve max(window/2^tcp_app_win, mss) of window for application buffer. Value 0 is special, it means that nothing is reserved. + Possible values are [0, 31], inclusive. + Default: 31 tcp_autocorking - BOOLEAN
net/ipv4/sysctl_net_ipv4.c +3 -0
@@ -25,6 +25,7 @@ static int ip_local_port_range_min[] = { 1, 1 };static int ip_local_port_range_max[] = {65535 ,65535 };static int tcp_adv_win_scale_min =-31 ;static int tcp_adv_win_scale_max =31 ; +static int tcp_app_win_max =31 ;static int tcp_min_snd_mss_min =TCP_MIN_SND_MSS ;static int tcp_min_snd_mss_max =65535 ;static int ip_privileged_port_min;
@@ -1171,6 +1172,8 @@ static struct ctl_table ipv4_net_table[] = { .maxlen = sizeof(u8), .mode = 0644, .proc_handler = proc_dou8vec_minmax, + .extra1 = SYSCTL_ZERO, + .extra2 = &tcp_app_win_max, }, { .procname = "tcp_adv_win_scale",
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 50/134 bonding: fix ns validation on backup slaves
In reply to Greg Kroah-HartmanFrom: Hangbin Liu <[email protected]>
[ Upstream commit 4598380f9c548aa161eb4e990a1583f0a7d1e0d7 ]
When arp_validate is set to 2, 3, or 6, validation is performed for backup slaves as well. As stated in the bond documentation, validation involves checking the broadcast ARP request sent out via the active slave. This helps determine which slaves are more likely to function in the event of an active slave failure.
However, when the target is an IPv6 address, the NS message sent from the active interface is not checked on backup slaves. Additionally, based on the bond_arp_rcv() rule b, we must reverse the saddr and daddr when checking the NS message.
Note that when checking the NS message, the destination address is a multicast address. Therefore, we must convert the target address to solicited multicast in the bond_get_targets_ip6() function.
Prior to the fix, the backup slaves had a mii status of "down", but after the fix, all of the slaves' mii status was updated to "UP".
--- drivers/net/bonding/bond_main.c | 5 +++-- include/net/bonding.h | 8 ++++++-- 2 files changed, 9 insertions(+), 4 deletions(-)
drivers/net/bonding/bond_main.c +3 -2
@@ -3266,7 +3266,8 @@ static int bond_na_rcv(const struct sk_buff *skb, struct bonding *bond, combined =skb_header_pointer (skb,0 ,sizeof (_combined), &_combined);if (!combined || combined->ip6.nexthdr !=NEXTHDR_ICMP || - combined->icmp6.icmp6_type !=NDISC_NEIGHBOUR_ADVERTISEMENT ) + (combined->icmp6.icmp6_type !=NDISC_NEIGHBOUR_SOLICITATION && + combined->icmp6.icmp6_type !=NDISC_NEIGHBOUR_ADVERTISEMENT )) goto out; saddr = &combined->ip6.saddr;
@@ -3288,7 +3289,7 @@ static int bond_na_rcv(const struct sk_buff *skb, struct bonding *bond,else if (curr_active_slave &&time_after (slave_last_rx (bond, curr_active_slave), curr_active_slave->last_link_up)) -bond_validate_na (bond, slave, saddr, daddr); +bond_validate_na (bond, slave, daddr, saddr);else if (curr_arp_slave &&bond_time_in_interval (bond,slave_last_tx (curr_arp_slave),1 ))bond_validate_na (bond, slave, saddr, daddr);
include/net/bonding.h +6 -2
@@ -765,13 +765,17 @@ static inline int bond_get_targets_ip(__be32 *targets, __be32 ip)#if IS_ENABLED (CONFIG_IPV6 )static inline int bond_get_targets_ip6 (struct in6_addr *targets,struct in6_addr *ip) { +struct in6_addr mcaddr;int i; -for (i =0 ; i <BOND_MAX_NS_TARGETS ; i++) -if (ipv6_addr_equal (&targets[i], ip)) +for (i =0 ; i <BOND_MAX_NS_TARGETS ; i++) { +addrconf_addr_solict_mult (&targets[i], &mcaddr); +if ((ipv6_addr_equal (&targets[i], ip)) || + (ipv6_addr_equal (&mcaddr, ip)))return i;else if (ipv6_addr_any (&targets[i]))break ; + }return -1 ; }
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 51/134 iavf: refactor VLAN filter states
In reply to Greg Kroah-HartmanFrom: Ahmed Zaki <[email protected]>
[ Upstream commit 0c0da0e951053fda20412cd284e2714bbbb31bff ]
The VLAN filter states are currently being saved as individual bits. This is error prone as multiple bits might be mistakenly set.
Fix by replacing the bits with a single state enum. Also, add an "ACTIVE" state for filters that are accepted by the PF.
Stable-dep-of: 9c85b7fa12ef ("iavf: remove active_cvlans and active_svlans bitmaps")
--- drivers/net/ethernet/intel/iavf/iavf.h | 15 +++++---- drivers/net/ethernet/intel/iavf/iavf_main.c | 8 ++--- .../net/ethernet/intel/iavf/iavf_virtchnl.c | 31 +++++++++---------- 3 files changed, 28 insertions(+), 26 deletions(-)
drivers/net/ethernet/intel/iavf/iavf.h +9 -6
@@ -157,15 +157,18 @@ struct iavf_vlan {u16 tpid; }; +enum iavf_vlan_state_t { +IAVF_VLAN_INVALID , +IAVF_VLAN_ADD ,/* filter needs to be added */ +IAVF_VLAN_IS_NEW ,/* filter is new, wait for PF answer */ +IAVF_VLAN_ACTIVE ,/* filter is accepted by PF */ +IAVF_VLAN_REMOVE ,/* filter needs to be removed */ +}; +struct iavf_vlan_filter {struct list_head list;struct iavf_vlan vlan; -struct { -u8 is_new_vlan:1 ;/* filter is new, wait for PF answer */ -u8 remove:1 ;/* filter needs to be removed */ -u8 add:1 ;/* filter needs to be added */ -u8 padding:5 ; - }; +enum iavf_vlan_state_t state; };#define IAVF_MAX_TRAFFIC_CLASS 4
drivers/net/ethernet/intel/iavf/iavf_main.c +4 -4
@@ -791,7 +791,7 @@ iavf_vlan_filter *iavf_add_vlan(struct iavf_adapter *adapter, f->vlan = vlan;list_add_tail (&f->list, &adapter->vlan_filter_list); - f->add = true; + f->state =IAVF_VLAN_ADD ; adapter->aq_required |=IAVF_FLAG_AQ_ADD_VLAN_FILTER ; }
@@ -813,7 +813,7 @@ static void iavf_del_vlan(struct iavf_adapter *adapter, struct iavf_vlan vlan) f =iavf_find_vlan (adapter, vlan);if (f) { - f->remove = true; + f->state =IAVF_VLAN_REMOVE ; adapter->aq_required |=IAVF_FLAG_AQ_DEL_VLAN_FILTER ; }
@@ -1296,11 +1296,11 @@ static void iavf_clear_mac_vlan_filters(struct iavf_adapter *adapter)/* remove all VLAN filters */ list_for_each_entry_safe (vlf, vlftmp, &adapter->vlan_filter_list, list) { -if (vlf->add) { +if (vlf->state ==IAVF_VLAN_ADD ) {list_del (&vlf->list);kfree (vlf); }else { - vlf->remove = true; + vlf->state =IAVF_VLAN_REMOVE ; } }spin_unlock_bh (&adapter->mac_vlan_list_lock);
drivers/net/ethernet/intel/iavf/iavf_virtchnl.c +15 -16
@@ -642,7 +642,7 @@ static void iavf_vlan_add_reject(struct iavf_adapter *adapter)spin_lock_bh (&adapter->mac_vlan_list_lock);list_for_each_entry_safe (f, ftmp, &adapter->vlan_filter_list, list) { -if (f->is_new_vlan) { +if (f->state ==IAVF_VLAN_IS_NEW ) {if (f->vlan.tpid ==ETH_P_8021Q )clear_bit (f->vlan.vid, adapter->vsi.active_cvlans);
@@ -679,7 +679,7 @@ void iavf_add_vlans(struct iavf_adapter *adapter)spin_lock_bh (&adapter->mac_vlan_list_lock);list_for_each_entry (f, &adapter->vlan_filter_list, list) { -if (f->add) +if (f->state ==IAVF_VLAN_ADD ) count++; }if (!count || !VLAN_FILTERING_ALLOWED (adapter)) {
@@ -710,11 +710,10 @@ void iavf_add_vlans(struct iavf_adapter *adapter) vvfl->vsi_id = adapter->vsi_res->vsi_id; vvfl->num_elements = count;list_for_each_entry (f, &adapter->vlan_filter_list, list) { -if (f->add) { +if (f->state ==IAVF_VLAN_ADD ) { vvfl->vlan_id[i] = f->vlan.vid; i++; - f->add = false; - f->is_new_vlan = true; + f->state =IAVF_VLAN_IS_NEW ;if (i == count)break ; }
@@ -760,7 +759,7 @@ void iavf_add_vlans(struct iavf_adapter *adapter) vvfl_v2->vport_id = adapter->vsi_res->vsi_id; vvfl_v2->num_elements = count;list_for_each_entry (f, &adapter->vlan_filter_list, list) { -if (f->add) { +if (f->state ==IAVF_VLAN_ADD ) {struct virtchnl_vlan_supported_caps *filtering_support = &adapter->vlan_v2_caps.filtering.filtering_support;struct virtchnl_vlan *vlan;
@@ -778,8 +777,7 @@ void iavf_add_vlans(struct iavf_adapter *adapter) vlan->tpid = f->vlan.tpid; i++; - f->add = false; - f->is_new_vlan = true; + f->state =IAVF_VLAN_IS_NEW ; } }
@@ -822,10 +820,11 @@ void iavf_del_vlans(struct iavf_adapter *adapter)* filters marked for removal to enable bailing out before * sending a virtchnl message */ -if (f->remove && !VLAN_FILTERING_ALLOWED (adapter)) { +if (f->state ==IAVF_VLAN_REMOVE && + !VLAN_FILTERING_ALLOWED (adapter)) {list_del (&f->list);kfree (f); - }else if (f->remove) { + }else if (f->state ==IAVF_VLAN_REMOVE ) { count++; } }
@@ -857,7 +856,7 @@ void iavf_del_vlans(struct iavf_adapter *adapter) vvfl->vsi_id = adapter->vsi_res->vsi_id; vvfl->num_elements = count;list_for_each_entry_safe (f, ftmp, &adapter->vlan_filter_list, list) { -if (f->remove) { +if (f->state ==IAVF_VLAN_REMOVE ) { vvfl->vlan_id[i] = f->vlan.vid; i++;list_del (&f->list);
@@ -901,7 +900,7 @@ void iavf_del_vlans(struct iavf_adapter *adapter) vvfl_v2->vport_id = adapter->vsi_res->vsi_id; vvfl_v2->num_elements = count;list_for_each_entry_safe (f, ftmp, &adapter->vlan_filter_list, list) { -if (f->remove) { +if (f->state ==IAVF_VLAN_REMOVE ) {struct virtchnl_vlan_supported_caps *filtering_support = &adapter->vlan_v2_caps.filtering.filtering_support;struct virtchnl_vlan *vlan;
@@ -2192,7 +2191,7 @@ void iavf_virtchnl_completion(struct iavf_adapter *adapter,list_for_each_entry (vlf, &adapter->vlan_filter_list, list) - vlf->add = true; + vlf->state =IAVF_VLAN_ADD ; adapter->aq_required |=IAVF_FLAG_AQ_ADD_VLAN_FILTER ;
@@ -2252,7 +2251,7 @@ void iavf_virtchnl_completion(struct iavf_adapter *adapter,list_for_each_entry (vlf, &adapter->vlan_filter_list, list) - vlf->add = true; + vlf->state =IAVF_VLAN_ADD ; aq_required |=IAVF_FLAG_AQ_ADD_VLAN_FILTER ; }
@@ -2436,8 +2435,8 @@ void iavf_virtchnl_completion(struct iavf_adapter *adapter,spin_lock_bh (&adapter->mac_vlan_list_lock);list_for_each_entry (f, &adapter->vlan_filter_list, list) { -if (f->is_new_vlan) { - f->is_new_vlan = false; +if (f->state ==IAVF_VLAN_IS_NEW ) { + f->state =IAVF_VLAN_ACTIVE ;if (f->vlan.tpid ==ETH_P_8021Q )set_bit (f->vlan.vid, adapter->vsi.active_cvlans);
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 42/134 dmaengine: apple-admac: Set src_addr_widths capability
In reply to Greg Kroah-HartmanFrom: Martin Povišer <[email protected]>
[ Upstream commit 6e96adcaa7a29827ac8ee8df290a44957a4823ec ]
Add missing setting of 'src_addr_widths', which is the same as for the other direction.
--- drivers/dma/apple-admac.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/dma/apple-admac.c +3 -0
@@ -858,6 +858,9 @@ static int admac_probe(struct platform_device *pdev) dma->directions =BIT (DMA_MEM_TO_DEV ) |BIT (DMA_DEV_TO_MEM ); dma->residue_granularity =DMA_RESIDUE_GRANULARITY_BURST ; + dma->src_addr_widths =BIT (DMA_SLAVE_BUSWIDTH_1_BYTE ) | +BIT (DMA_SLAVE_BUSWIDTH_2_BYTES ) | +BIT (DMA_SLAVE_BUSWIDTH_4_BYTES ); dma->dst_addr_widths =BIT (DMA_SLAVE_BUSWIDTH_1_BYTE ) |BIT (DMA_SLAVE_BUSWIDTH_2_BYTES ) |BIT (DMA_SLAVE_BUSWIDTH_4_BYTES );
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 75/134 selftests/bpf: Fix progs/find_vma_fail1.c build error.
In reply to Greg Kroah-HartmanFrom: Alexei Starovoitov <[email protected]>
[ Upstream commit 32513d40d908b267508d37994753d9bd1600914b ]
The commit 11e456cae91e ("selftests/bpf: Fix compilation errors: Assign a value to a constant") fixed the issue cleanly in bpf-next.
This is an alternative fix in bpf tree to avoid merge conflict between bpf and bpf-next.
--- tools/testing/selftests/bpf/progs/find_vma_fail1.c | 1 + 1 file changed, 1 insertion(+)
tools/testing/selftests/bpf/progs/find_vma_fail1.c +1 -0
@@ -2,6 +2,7 @@/* Copyright (c) 2021 Facebook */ #include "vmlinux.h" #include <bpf/bpf_helpers.h> +#define vm_flags vm_start char _license[] SEC("license") = "GPL";
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 84/134 hwmon: (xgene) Fix ioremap and memremap leak
In reply to Greg Kroah-HartmanFrom: Tianyi Jing <[email protected]>
[ Upstream commit 813cc94c7847ae4a17e9f744fb4dbdf7df6bd732 ]
Smatch reports:
drivers/hwmon/xgene-hwmon.c:757 xgene_hwmon_probe() warn:
'ctx->pcc_comm_addr' from ioremap() not released on line: 757.
This is because in drivers/hwmon/xgene-hwmon.c:701 xgene_hwmon_probe(), ioremap and memremap is not released, which may cause a leak.
To fix this, ioremap and memremap is modified to devm_ioremap and devm_memremap.
--- drivers/hwmon/xgene-hwmon.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-)
drivers/hwmon/xgene-hwmon.c +7 -7
@@ -698,14 +698,14 @@ static int xgene_hwmon_probe(struct platform_device *pdev) ctx->comm_base_addr = pcc_chan->shmem_base_addr;if (ctx->comm_base_addr) {if (version ==XGENE_HWMON_V2 ) - ctx->pcc_comm_addr = (void __force *)ioremap ( - ctx->comm_base_addr, - pcc_chan->shmem_size); + ctx->pcc_comm_addr = (void __force *)devm_ioremap (&pdev->dev, + ctx->comm_base_addr, + pcc_chan->shmem_size);else - ctx->pcc_comm_addr =memremap ( - ctx->comm_base_addr, - pcc_chan->shmem_size, -MEMREMAP_WB ); + ctx->pcc_comm_addr =devm_memremap (&pdev->dev, + ctx->comm_base_addr, + pcc_chan->shmem_size, +MEMREMAP_WB ); }else {dev_err (&pdev->dev,"Failed to get PCC comm region\n" ); rc = -ENODEV ;
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 85/134 verify_pefile: relax wrapper length check
In reply to Greg Kroah-HartmanFrom: Robbie Harwood <[email protected]>
[ Upstream commit 4fc5c74dde69a7eda172514aaeb5a7df3600adb3 ]
The PE Format Specification (section "The Attribute Certificate Table (Image Only)") states that dwLength is to be rounded up to 8-byte alignment when used for traversal. Therefore, the field is not required to be an 8-byte multiple in the first place.
Accordingly, pesign has not performed this alignment since version 0.110. This causes kexec failure on pesign'd binaries with "PEFILE:
Signature wrapper len wrong". Update the comment and relax the check.
--- crypto/asymmetric_keys/verify_pefile.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-)
crypto/asymmetric_keys/verify_pefile.c +8 -4
@@ -135,11 +135,15 @@ static int pefile_strip_sig_wrapper(const void *pebuf,pr_debug ("sig wrapper = { %x, %x, %x }\n" , wrapper.length, wrapper.revision, wrapper.cert_type); -/* Both pesign and sbsign round up the length of certificate table -* (in optional header data directories) to 8 byte alignment. +/* sbsign rounds up the length of certificate table (in optional +* header data directories) to 8 byte alignment. However, the PE +* specification states that while entries are 8-byte aligned, this is +* not included in their length, and as a result, pesign has not +* rounded up since 0.110. */ -if (round_up (wrapper.length,8 ) != ctx->sig_len) { -pr_debug ("Signature wrapper len wrong\n" ); +if (wrapper.length > ctx->sig_len) { +pr_debug ("Signature wrapper bigger than sig len (%x > %x)\n" , + ctx->sig_len, wrapper.length);return -ELIBBAD ; }if (wrapper.revision !=WIN_CERT_REVISION_2_0 ) {
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 86/134 asymmetric_keys: log on fatal failures in PE/pkcs7
In reply to Greg Kroah-HartmanFrom: Robbie Harwood <[email protected]>
[ Upstream commit 3584c1dbfffdabf8e3dc1dd25748bb38dd01cd43 ]
These particular errors can be encountered while trying to kexec when secureboot lockdown is in place. Without this change, even with a signed debug build, one still needs to reboot the machine to add the appropriate dyndbg parameters (since lockdown blocks debugfs).
Accordingly, upgrade all pr_debug() before fatal error into pr_warn().
--- crypto/asymmetric_keys/pkcs7_verify.c | 10 +++++----- crypto/asymmetric_keys/verify_pefile.c | 24 ++++++++++++------------ 2 files changed, 17 insertions(+), 17 deletions(-)
crypto/asymmetric_keys/pkcs7_verify.c +5 -5
@@ -79,16 +79,16 @@ static int pkcs7_digest(struct pkcs7_message *pkcs7, }if (sinfo->msgdigest_len != sig->digest_size) { -pr_debug ("Sig %u: Invalid digest size (%u)\n" , - sinfo->index, sinfo->msgdigest_len); +pr_warn ("Sig %u: Invalid digest size (%u)\n" , + sinfo->index, sinfo->msgdigest_len); ret = -EBADMSG ; goto error; }if (memcmp (sig->digest, sinfo->msgdigest, sinfo->msgdigest_len) !=0 ) { -pr_debug ("Sig %u: Message digest doesn't match\n" , - sinfo->index); +pr_warn ("Sig %u: Message digest doesn't match\n" , + sinfo->index); ret = -EKEYREJECTED ; goto error; }
@@ -478,7 +478,7 @@ int pkcs7_supply_detached_data(struct pkcs7_message *pkcs7, const void *data, size_t datalen) { if (pkcs7->data) { -pr_debug ("Data already supplied\n" ); +pr_warn ("Data already supplied\n" );return -EINVAL ; } pkcs7->data = data;
crypto/asymmetric_keys/verify_pefile.c +12 -12
@@ -74,7 +74,7 @@ static int pefile_parse_binary(const void *pebuf, unsigned int pelen,break ;default : -pr_debug ("Unknown PEOPT magic = %04hx\n" , pe32->magic); +pr_warn ("Unknown PEOPT magic = %04hx\n" , pe32->magic);return -ELIBBAD ; }
@@ -95,7 +95,7 @@ static int pefile_parse_binary(const void *pebuf, unsigned int pelen, ctx->certs_size = ddir->certs.size;if (!ddir->certs.virtual_address || !ddir->certs.size) { -pr_debug ("Unsigned PE binary\n" ); +pr_warn ("Unsigned PE binary\n" );return -ENODATA ; }
@@ -127,7 +127,7 @@ static int pefile_strip_sig_wrapper(const void *pebuf,unsigned len;if (ctx->sig_len <sizeof (wrapper)) { -pr_debug ("Signature wrapper too short\n" ); +pr_warn ("Signature wrapper too short\n" );return -ELIBBAD ; }
@@ -142,16 +142,16 @@ static int pefile_strip_sig_wrapper(const void *pebuf,* rounded up since 0.110. */ if (wrapper.length > ctx->sig_len) { -pr_debug ("Signature wrapper bigger than sig len (%x > %x)\n" , - ctx->sig_len, wrapper.length); +pr_warn ("Signature wrapper bigger than sig len (%x > %x)\n" , + ctx->sig_len, wrapper.length);return -ELIBBAD ; }if (wrapper.revision !=WIN_CERT_REVISION_2_0 ) { -pr_debug ("Signature is not revision 2.0\n" ); +pr_warn ("Signature is not revision 2.0\n" );return -ENOTSUPP ; }if (wrapper.cert_type !=WIN_CERT_TYPE_PKCS_SIGNED_DATA ) { -pr_debug ("Signature certificate type is not PKCS\n" ); +pr_warn ("Signature certificate type is not PKCS\n" );return -ENOTSUPP ; }
@@ -164,7 +164,7 @@ static int pefile_strip_sig_wrapper(const void *pebuf, ctx->sig_offset +=sizeof (wrapper); ctx->sig_len -=sizeof (wrapper);if (ctx->sig_len <4 ) { -pr_debug ("Signature data missing\n" ); +pr_warn ("Signature data missing\n" );return -EKEYREJECTED ; }
@@ -198,7 +198,7 @@ static int pefile_strip_sig_wrapper(const void *pebuf,return 0 ; } not_pkcs7: -pr_debug ("Signature data not PKCS#7\n" ); +pr_warn ("Signature data not PKCS#7\n" );return -ELIBBAD ; }
@@ -341,8 +341,8 @@ static int pefile_digest_pe(const void *pebuf, unsigned int pelen, digest_size =crypto_shash_digestsize (tfm);if (digest_size != ctx->digest_len) { -pr_debug ("Digest size mismatch (%zx != %x)\n" , - digest_size, ctx->digest_len); +pr_warn ("Digest size mismatch (%zx != %x)\n" , + digest_size, ctx->digest_len); ret = -EBADMSG ; goto error_no_desc; }
@@ -373,7 +373,7 @@ static int pefile_digest_pe(const void *pebuf, unsigned int pelen,* PKCS#7 certificate. */ if (memcmp (digest, ctx->digest, ctx->digest_len) !=0 ) { -pr_debug ("Digest mismatch\n" ); +pr_warn ("Digest mismatch\n" ); ret = -EKEYREJECTED ; }else {pr_debug ("The digests match!\n" );
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 87/134 nvme: send Identify with CNS 06h only to I/O controllers
In reply to Greg Kroah-HartmanFrom: Martin George <[email protected]>
[ Upstream commit def84ab600b71ea3fcc422a876d5d0d0daa7d4f3 ]
Identify CNS 06h (I/O Command Set Specific Identify Controller data structure) is supported only on i/o controllers.
But nvme_init_non_mdts_limits() currently invokes this on all controllers. Correct this by ensuring this is sent to I/O controllers only.
--- drivers/nvme/host/core.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/nvme/host/core.c +2 -1
@@ -3074,7 +3074,8 @@ static int nvme_init_non_mdts_limits(struct nvme_ctrl *ctrl)else ctrl->max_zeroes_sectors =0 ; -if (nvme_ctrl_limited_cns (ctrl)) +if (ctrl->subsys->subtype !=NVME_NQN_NVME || +nvme_ctrl_limited_cns (ctrl))return 0 ; id =kzalloc (sizeof (*id),GFP_KERNEL );
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 88/134 wifi: iwlwifi: mvm: fix mvmtxq->stopped handling
In reply to Greg Kroah-HartmanFrom: Johannes Berg <[email protected]>
[ Upstream commit b58e3d4311b54b6dd0e37165277965da0c9eb21d ]
This could race if the queue is redirected while full, then the flushing internally would start it while it's not yet usable again. Fix it by using two state bits instead of just one.
--- drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c | 5 ++++- drivers/net/wireless/intel/iwlwifi/mvm/mvm.h | 4 +++- drivers/net/wireless/intel/iwlwifi/mvm/ops.c | 5 ++++- drivers/net/wireless/intel/iwlwifi/mvm/sta.c | 4 ++-- 4 files changed, 13 insertions(+), 5 deletions(-)
drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c +4 -1
@@ -729,7 +729,10 @@ void iwl_mvm_mac_itxq_xmit(struct ieee80211_hw *hw, struct ieee80211_txq *txq)rcu_read_lock (); do { - while (likely(!mvmtxq->stopped && + while (likely(!test_bit(IWL_MVM_TXQ_STATE_STOP_FULL, + &mvmtxq->state) && + !test_bit(IWL_MVM_TXQ_STATE_STOP_REDIRECT, + &mvmtxq->state) && !test_bit(IWL_MVM_STATUS_IN_D3, &mvm->status))) { skb = ieee80211_tx_dequeue(hw, txq);
drivers/net/wireless/intel/iwlwifi/mvm/mvm.h +3 -1
@@ -729,7 +729,9 @@ struct iwl_mvm_txq {struct list_head list;u16 txq_id;atomic_t tx_request; -bool stopped; +#define IWL_MVM_TXQ_STATE_STOP_FULL 0 +#define IWL_MVM_TXQ_STATE_STOP_REDIRECT 1 +unsigned long state; }; static inline struct iwl_mvm_txq *
drivers/net/wireless/intel/iwlwifi/mvm/ops.c +4 -1
@@ -1680,7 +1680,10 @@ static void iwl_mvm_queue_state_change(struct iwl_op_mode *op_mode, txq = sta->txq[tid]; mvmtxq =iwl_mvm_txq_from_mac80211 (txq); - mvmtxq->stopped = !start; +if (start) +clear_bit (IWL_MVM_TXQ_STATE_STOP_FULL , &mvmtxq->state); +else +set_bit (IWL_MVM_TXQ_STATE_STOP_FULL , &mvmtxq->state);if (start && mvmsta->sta_state !=IEEE80211_STA_NOTEXIST )iwl_mvm_mac_itxq_xmit (mvm->hw, txq);
drivers/net/wireless/intel/iwlwifi/mvm/sta.c +2 -2
@@ -692,7 +692,7 @@ static int iwl_mvm_redirect_queue(struct iwl_mvm *mvm, int queue, int tid, queue, iwl_mvm_ac_to_tx_fifo[ac]);/* Stop the queue and wait for it to empty */ - txq->stopped = true; +set_bit (IWL_MVM_TXQ_STATE_STOP_REDIRECT , &txq->state); ret =iwl_trans_wait_tx_queues_empty (mvm->trans,BIT (queue));if (ret) {
@@ -735,7 +735,7 @@ static int iwl_mvm_redirect_queue(struct iwl_mvm *mvm, int queue, int tid, out:/* Continue using the queue */ - txq->stopped = false; +clear_bit (IWL_MVM_TXQ_STATE_STOP_REDIRECT , &txq->state);return ret; }
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 89/134 wifi: iwlwifi: mvm: protect TXQ list manipulation
In reply to Greg Kroah-HartmanFrom: Johannes Berg <[email protected]>
[ Upstream commit 923bf981eb6ecc027227716e30701bdcc1845fbf ]
Some recent upstream debugging uncovered the fact that in iwlwifi, the TXQ list manipulation is racy.
Introduce a new state bit for when the TXQ is completely ready and can be used without locking, and if that's not set yet acquire the lock to check everything correctly.
--- .../net/wireless/intel/iwlwifi/mvm/mac80211.c | 45 ++++++------------- drivers/net/wireless/intel/iwlwifi/mvm/mvm.h | 2 + drivers/net/wireless/intel/iwlwifi/mvm/ops.c | 1 + drivers/net/wireless/intel/iwlwifi/mvm/sta.c | 25 +++++++++-- 4 files changed, 39 insertions(+), 34 deletions(-)
drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c +14 -31
@@ -757,42 +757,25 @@ static void iwl_mvm_mac_wake_tx_queue(struct ieee80211_hw *hw,struct iwl_mvm *mvm =IWL_MAC80211_GET_MVM (hw);struct iwl_mvm_txq *mvmtxq =iwl_mvm_txq_from_mac80211 (txq); -/* -* Please note that racing is handled very carefully here: -* mvmtxq->txq_id is updated during allocation, and mvmtxq->list is -* deleted afterwards. -* This means that if: -* mvmtxq->txq_id != INVALID_QUEUE && list_empty(&mvmtxq->list): -* queue is allocated and we can TX. -* mvmtxq->txq_id != INVALID_QUEUE && !list_empty(&mvmtxq->list): -* a race, should defer the frame. -* mvmtxq->txq_id == INVALID_QUEUE && list_empty(&mvmtxq->list): -* need to allocate the queue and defer the frame. -* mvmtxq->txq_id == INVALID_QUEUE && !list_empty(&mvmtxq->list): -* queue is already scheduled for allocation, no need to allocate, -* should defer the frame. -*/ - -/* If the queue is allocated TX and return. */ -if (!txq->sta || mvmtxq->txq_id !=IWL_MVM_INVALID_QUEUE ) { -/* -* Check that list is empty to avoid a race where txq_id is -* already updated, but the queue allocation work wasn't -* finished -*/ -if (unlikely (txq->sta && !list_empty (&mvmtxq->list))) -return ; - +if (likely (test_bit (IWL_MVM_TXQ_STATE_READY , &mvmtxq->state)) || + !txq->sta) {iwl_mvm_mac_itxq_xmit (hw, txq);return ; } -/* The list is being deleted only after the queue is fully allocated. */ -if (!list_empty (&mvmtxq->list)) -return ; +/* iwl_mvm_mac_itxq_xmit() will later be called by the worker +* to handle any packets we leave on the txq now +*/ -list_add_tail (&mvmtxq->list, &mvm->add_stream_txqs); -schedule_work (&mvm->add_stream_wk); +spin_lock_bh (&mvm->add_stream_lock); +/* The list is being deleted only after the queue is fully allocated. */ +if (list_empty (&mvmtxq->list) && +/* recheck under lock */ + !test_bit (IWL_MVM_TXQ_STATE_READY , &mvmtxq->state)) { +list_add_tail (&mvmtxq->list, &mvm->add_stream_txqs); +schedule_work (&mvm->add_stream_wk); + } +spin_unlock_bh (&mvm->add_stream_lock); } #define CHECK_BA_TRIGGER(_mvm, _trig, _tid_bm, _tid, _fmt...) \
drivers/net/wireless/intel/iwlwifi/mvm/mvm.h +2 -0
@@ -731,6 +731,7 @@ struct iwl_mvm_txq {atomic_t tx_request;#define IWL_MVM_TXQ_STATE_STOP_FULL 0#define IWL_MVM_TXQ_STATE_STOP_REDIRECT 1 +#define IWL_MVM_TXQ_STATE_READY 2unsigned long state; };
@@ -829,6 +830,7 @@ struct iwl_mvm {struct iwl_mvm_tvqm_txq_info tvqm_info[IWL_MAX_TVQM_QUEUES ]; };struct work_struct add_stream_wk;/* To add streams to queues */ +spinlock_t add_stream_lock;const char *nvm_file_name;struct iwl_nvm_data *nvm_data;
drivers/net/wireless/intel/iwlwifi/mvm/ops.c +1 -0
@@ -1184,6 +1184,7 @@ iwl_op_mode_mvm_start(struct iwl_trans *trans, const struct iwl_cfg *cfg,INIT_DELAYED_WORK (&mvm->scan_timeout_dwork, iwl_mvm_scan_timeout_wk);INIT_WORK (&mvm->add_stream_wk, iwl_mvm_add_new_dqa_stream_wk);INIT_LIST_HEAD (&mvm->add_stream_txqs); +spin_lock_init (&mvm->add_stream_lock);init_waitqueue_head (&mvm->rx_sync_waitq);
drivers/net/wireless/intel/iwlwifi/mvm/sta.c +22 -3
@@ -383,8 +383,11 @@ static int iwl_mvm_disable_txq(struct iwl_mvm *mvm, struct ieee80211_sta *sta,struct iwl_mvm_txq *mvmtxq =iwl_mvm_txq_from_tid (sta, tid); - mvmtxq->txq_id =IWL_MVM_INVALID_QUEUE ; +spin_lock_bh (&mvm->add_stream_lock);list_del_init (&mvmtxq->list); +clear_bit (IWL_MVM_TXQ_STATE_READY , &mvmtxq->state); + mvmtxq->txq_id =IWL_MVM_INVALID_QUEUE ; +spin_unlock_bh (&mvm->add_stream_lock); }/* Regardless if this is a reserved TXQ for a STA - mark it as false */
@@ -478,8 +481,11 @@ static int iwl_mvm_remove_sta_queue_marking(struct iwl_mvm *mvm, int queue) disable_agg_tids |=BIT (tid); mvmsta->tid_data[tid].txq_id =IWL_MVM_INVALID_QUEUE ; - mvmtxq->txq_id =IWL_MVM_INVALID_QUEUE ; +spin_lock_bh (&mvm->add_stream_lock);list_del_init (&mvmtxq->list); +clear_bit (IWL_MVM_TXQ_STATE_READY , &mvmtxq->state); + mvmtxq->txq_id =IWL_MVM_INVALID_QUEUE ; +spin_unlock_bh (&mvm->add_stream_lock); } mvmsta->tfd_queue_msk &= ~BIT (queue);/* Don't use this queue anymore */
@@ -1443,12 +1449,22 @@ void iwl_mvm_add_new_dqa_stream_wk(struct work_struct *wk)* a queue in the function itself. */ if (iwl_mvm_sta_alloc_queue (mvm, txq->sta, txq->ac, tid)) { +spin_lock_bh (&mvm->add_stream_lock);list_del_init (&mvmtxq->list); +spin_unlock_bh (&mvm->add_stream_lock);continue ; } -list_del_init (&mvmtxq->list); +/* now we're ready, any remaining races/concurrency will be +* handled in iwl_mvm_mac_itxq_xmit() +*/ +set_bit (IWL_MVM_TXQ_STATE_READY , &mvmtxq->state); +local_bh_disable (); +spin_lock (&mvm->add_stream_lock); +list_del_init (&mvmtxq->list); +spin_unlock (&mvm->add_stream_lock); +iwl_mvm_mac_itxq_xmit (mvm->hw, txq);local_bh_enable (); }
@@ -1862,8 +1878,11 @@ static void iwl_mvm_disable_sta_queues(struct iwl_mvm *mvm,struct iwl_mvm_txq *mvmtxq =iwl_mvm_txq_from_mac80211 (sta->txq[i]); +spin_lock_bh (&mvm->add_stream_lock); mvmtxq->txq_id =IWL_MVM_INVALID_QUEUE ;list_del_init (&mvmtxq->list); +clear_bit (IWL_MVM_TXQ_STATE_READY , &mvmtxq->state); +spin_unlock_bh (&mvm->add_stream_lock); } }
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 90/134 drm/amdgpu: add mes resume when do gfx post soft reset
In reply to Greg Kroah-HartmanFrom: Tong Liu01 <[email protected]>
[ Upstream commit 4eb0b49a0ad3e004a6a65b84efe37bc7e66d560f ]
[why]
when gfx do soft reset, mes will also do reset, if mes is not resumed when do recover from soft reset, mes is unable to respond in later sequence
[how]
resume mes when do gfx post soft reset
--- drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c | 9 +++++++++ 1 file changed, 9 insertions(+)
drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c +9 -0
@@ -4625,6 +4625,14 @@ static bool gfx_v11_0_check_soft_reset(void *handle)return false; } +static int gfx_v11_0_post_soft_reset (void *handle) +{ +/** +* GFX soft reset will impact MES, need resume MES when do GFX soft reset +*/ +return amdgpu_mes_resume ((struct amdgpu_device *)handle); +} +static uint64_t gfx_v11_0_get_gpu_clock_counter (struct amdgpu_device *adev) {uint64_t clock;
@@ -6068,6 +6076,7 @@ static const struct amd_ip_funcs gfx_v11_0_ip_funcs = { .wait_for_idle = gfx_v11_0_wait_for_idle, .soft_reset = gfx_v11_0_soft_reset, .check_soft_reset = gfx_v11_0_check_soft_reset, + .post_soft_reset = gfx_v11_0_post_soft_reset, .set_clockgating_state = gfx_v11_0_set_clockgating_state, .set_powergating_state = gfx_v11_0_set_powergating_state, .get_clockgating_state = gfx_v11_0_get_clockgating_state,
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 91/134 drm/amdgpu: Force signal hw_fences that are embedded in non-sched jobs
In reply to Greg Kroah-HartmanFrom: YuBiao Wang <[email protected]>
[ Upstream commit 033c56474acf567a450f8bafca50e0b610f2b716 ]
[Why]
For engines not supporting soft reset, i.e. VCN, there will be a failed ib test before mode 1 reset during asic reset. The fences in this case are never signaled and next time when we try to free the sa_bo, kernel will hang.
[How]
During pre_asic_reset, driver will clear job fences and afterwards the fences' refcount will be reduced to 1. For drm_sched_jobs it will be released in job_free_cb, and for non-sched jobs like ib_test, it's meant to be released in sa_bo_free but only when the fences are signaled. So we have to force signal the non_sched bad job's fence during pre_asic_reset or the clear is not complete.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c | 9 +++++++++ 1 file changed, 9 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c +9 -0
@@ -624,6 +624,15 @@ void amdgpu_fence_driver_clear_job_fences(struct amdgpu_ring *ring) ptr = &ring->fence_drv.fences[i]; old =rcu_dereference_protected (*ptr,1 );if (old && old->ops == &amdgpu_job_fence_ops) { +struct amdgpu_job *job; + +/* For non-scheduler bad job, i.e. failed ib test, we need to signal +* it right here or we won't be able to track them in fence_drv +* and they will remain unsignaled during sa_bo free. +*/ + job = container_of(old, struct amdgpu_job, hw_fence); +if (!job->base.s_fence && !dma_fence_is_signaled (old)) +dma_fence_signal (old);RCU_INIT_POINTER (*ptr,NULL );dma_fence_put (old); }
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 92/134 drm/amdgpu/gfx: set cg flags to enter/exit safe mode
In reply to Greg Kroah-HartmanFrom: Jane Jian <[email protected]>
[ Upstream commit e06bfcc1a1c41bcb8c31470d437e147ce9f0acfd ]
sriov needs to enter/exit safe mode in update umd p state add the cg flag to let it enter or exit while needed
--- drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c | 5 +++++ 1 file changed, 5 insertions(+)
drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c +5 -0
@@ -1316,6 +1316,11 @@ static int gfx_v11_0_sw_init(void *handle)break ; } +/* Enable CG flag in one VF mode for enabling RLC safe mode enter/exit */ +if (adev->ip_versions[GC_HWIP ][0 ] ==IP_VERSION (11 ,0 ,3 ) && +amdgpu_sriov_is_pp_one_vf (adev)) + adev->cg_flags =AMD_CG_SUPPORT_GFX_CGCG ; +/* EOP Event */ r = amdgpu_irq_add_id(adev, SOC21_IH_CLIENTID_GRBM_CP, GFX_11_0_0__SRCID__CP_EOP_INTERRUPT,
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 93/134 ACPI: resource: Add Medion S17413 to IRQ override quirk
In reply to Greg Kroah-HartmanFrom: Aymeric Wibo <[email protected]>
[ Upstream commit 2d0ab14634a26e54f8d6d231b47b7ef233e84599 ]
Add DMI info of the Medion S17413 (board M1xA) to the IRQ override quirk table. This fixes the keyboard not working on these laptops.
--- drivers/acpi/resource.c | 7 +++++++ 1 file changed, 7 insertions(+)
drivers/acpi/resource.c +7 -0
@@ -400,6 +400,13 @@ static const struct dmi_system_id medion_laptop[] = { DMI_MATCH(DMI_BOARD_NAME, "M17T"), }, }, + { + .ident = "MEDION S17413", + .matches = { + DMI_MATCH(DMI_SYS_VENDOR, "MEDION"), + DMI_MATCH(DMI_BOARD_NAME, "M1xA"), + }, + }, { } };
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 76/134 wifi: mwifiex: mark OF related data as maybe unused
In reply to Greg Kroah-HartmanFrom: Krzysztof Kozlowski <[email protected]>
[ Upstream commit 139f6973bf140c65d4d1d4bde5485badb4454d7a ]
The driver can be compile tested with !CONFIG_OF making certain data unused:
drivers/net/wireless/marvell/mwifiex/sdio.c:498:34: error: ‘mwifiex_sdio_of_match_table’ defined but not used [-Werror=unused-const-variable=] drivers/net/wireless/marvell/mwifiex/pcie.c:175:34: error: ‘mwifiex_pcie_of_match_table’ defined but not used [-Werror=unused-const-variable=]
--- drivers/net/wireless/marvell/mwifiex/pcie.c | 2 +- drivers/net/wireless/marvell/mwifiex/sdio.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
drivers/net/wireless/marvell/mwifiex/pcie.c +1 -1
@@ -172,7 +172,7 @@ static const struct mwifiex_pcie_device mwifiex_pcie8997 = { .can_ext_scan = true, }; -static const struct of_device_id mwifiex_pcie_of_match_table[] = { +static const struct of_device_id mwifiex_pcie_of_match_table[]__maybe_unused = { { .compatible ="pci11ab,2b42" }, { .compatible ="pci1b4b,2b42" }, { }
drivers/net/wireless/marvell/mwifiex/sdio.c +1 -1
@@ -479,7 +479,7 @@ static struct memory_type_mapping mem_type_mapping_tbl[] = { {"EXTLAST", NULL, 0, 0xFE}, }; -static const struct of_device_id mwifiex_sdio_of_match_table[] = { +static const struct of_device_id mwifiex_sdio_of_match_table[]__maybe_unused = { { .compatible ="marvell,sd8787" }, { .compatible ="marvell,sd8897" }, { .compatible = "marvell,sd8997" },
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 94/134 x86/hyperv: Move VMCB enlightenment definitions to hyperv-tlfs.h
In reply to Greg Kroah-HartmanFrom: Sean Christopherson <[email protected]>
[ Upstream commit 089fe572a2e0a89e36a455d299d801770293d08f ]
Move Hyper-V's VMCB enlightenment definitions to the TLFS header; the definitions come directly from the TLFS[*], not from KVM.
No functional change intended.
[vitaly: rename VMCB_HV_ -> HV_VMCB_ to match the rest of hyperv-tlfs.h, keep svm/hyperv.h]
Message-Id: <[email protected]>
Stable-dep-of: e5c972c1fada ("KVM: SVM: Flush Hyper-V TLB when required")
--- arch/x86/include/asm/hyperv-tlfs.h | 22 +++++++++++++++++++ arch/x86/kvm/svm/hyperv.h | 22 ------------------- arch/x86/kvm/svm/nested.c | 2 +- arch/x86/kvm/svm/svm_onhyperv.c | 2 +- arch/x86/kvm/svm/svm_onhyperv.h | 4 ++-- .../selftests/kvm/x86_64/hyperv_svm_test.c | 6 ++--- 6 files changed, 29 insertions(+), 29 deletions(-)
arch/x86/include/asm/hyperv-tlfs.h +22 -0
@@ -598,6 +598,28 @@ struct hv_enlightened_vmcs {#define HV_VMX_ENLIGHTENED_CLEAN_FIELD_ALL 0xFFFF +/* +* Hyper-V uses the software reserved 32 bytes in VMCB control area to expose +* SVM enlightenments to guests. +*/ +struct hv_enlightenments { + struct __packed hv_enlightenments_control { +u32 nested_flush_hypercall:1 ; +u32 msr_bitmap:1 ; +u32 enlightened_npt_tlb:1 ; +u32 reserved:29 ; + } __packed hv_enlightenments_control; +u32 hv_vp_id; +u64 hv_vm_id; +u64 partition_assist_page; +u64 reserved; +} __packed; + +/* +* Hyper-V uses the software reserved clean bit in VMCB. +*/ +#define HV_VMCB_NESTED_ENLIGHTENMENTS 31 +struct hv_partition_assist_pg {u32 tlb_lock_count; };
arch/x86/kvm/svm/hyperv.h +0 -22
@@ -10,26 +10,4 @@#include "../hyperv.h" -/* -* Hyper-V uses the software reserved 32 bytes in VMCB -* control area to expose SVM enlightenments to guests. -*/ -struct hv_enlightenments { - struct __packed hv_enlightenments_control { -u32 nested_flush_hypercall:1 ; -u32 msr_bitmap:1 ; -u32 enlightened_npt_tlb:1 ; -u32 reserved:29 ; - } __packed hv_enlightenments_control; -u32 hv_vp_id; -u64 hv_vm_id; -u64 partition_assist_page; -u64 reserved; -} __packed; - -/* -* Hyper-V uses the software reserved clean bit in VMCB -*/ -#define VMCB_HV_NESTED_ENLIGHTENMENTS VMCB_SW -#endif /* __ARCH_X86_KVM_SVM_HYPERV_H__ */
arch/x86/kvm/svm/nested.c +1 -1
@@ -194,7 +194,7 @@ static bool nested_svm_vmrun_msrpm(struct vcpu_svm *svm)if (!svm->nested.force_msr_bitmap_recalc &&kvm_hv_hypercall_enabled (&svm->vcpu) && hve->hv_enlightenments_control.msr_bitmap && - (svm->nested.ctl.clean &BIT (VMCB_HV_NESTED_ENLIGHTENMENTS ))) + (svm->nested.ctl.clean &BIT (HV_VMCB_NESTED_ENLIGHTENMENTS ))) goto set_msrpm_base_pa;if (!(vmcb12_is_intercept (&svm->nested.ctl,INTERCEPT_MSR_PROT )))
arch/x86/kvm/svm/svm_onhyperv.c +1 -1
@@ -32,7 +32,7 @@ int svm_hv_enable_direct_tlbflush(struct kvm_vcpu *vcpu) hve->hv_vm_id = (unsigned long )vcpu->kvm;if (!hve->hv_enlightenments_control.nested_flush_hypercall) { hve->hv_enlightenments_control.nested_flush_hypercall =1 ; -vmcb_mark_dirty (to_svm (vcpu)->vmcb,VMCB_HV_NESTED_ENLIGHTENMENTS ); +vmcb_mark_dirty (to_svm (vcpu)->vmcb,HV_VMCB_NESTED_ENLIGHTENMENTS ); }return 0 ;
arch/x86/kvm/svm/svm_onhyperv.h +2 -2
@@ -64,7 +64,7 @@ static inline void svm_hv_vmcb_dirty_nested_enlightenments( (struct hv_enlightenments *)vmcb->control.reserved_sw;if (hve->hv_enlightenments_control.msr_bitmap) -vmcb_mark_dirty (vmcb,VMCB_HV_NESTED_ENLIGHTENMENTS ); +vmcb_mark_dirty (vmcb,HV_VMCB_NESTED_ENLIGHTENMENTS ); } static inline void svm_hv_update_vp_id(struct vmcb *vmcb,
@@ -76,7 +76,7 @@ static inline void svm_hv_update_vp_id(struct vmcb *vmcb,if (hve->hv_vp_id != vp_index) { hve->hv_vp_id = vp_index; -vmcb_mark_dirty (vmcb,VMCB_HV_NESTED_ENLIGHTENMENTS ); +vmcb_mark_dirty (vmcb,HV_VMCB_NESTED_ENLIGHTENMENTS ); } }#else
tools/testing/selftests/kvm/x86_64/hyperv_svm_test.c +3 -3
@@ -39,7 +39,7 @@ struct hv_enlightenments {/* * Hyper-V uses the software reserved clean bit in VMCB */ -#define VMCB_HV_NESTED_ENLIGHTENMENTS (1U << 31) +#define HV_VMCB_NESTED_ENLIGHTENMENTS (1U << 31)void l2_guest_code (void ) {
@@ -98,14 +98,14 @@ static void __attribute__((__flatten__)) guest_code(struct svm_test_data *svm)/* Intercept RDMSR 0xc0000101 without telling KVM about it */ set_bit (2 * (MSR_GS_BASE &0x1fff ), svm->msr +0x800 );/* Make sure HV_VMX_ENLIGHTENED_CLEAN_FIELD_MSR_BITMAP is set */ - vmcb->control.clean |=VMCB_HV_NESTED_ENLIGHTENMENTS ; + vmcb->control.clean |=HV_VMCB_NESTED_ENLIGHTENMENTS ;run_guest (vmcb, svm->vmcb_gpa);/* Make sure we don't see SVM_EXIT_MSR here so eMSR bitmap works */ GUEST_ASSERT (vmcb->control.exit_code ==SVM_EXIT_VMMCALL ); vmcb->save.rip +=3 ;/* vmcall */ /* Now tell KVM we've changed MSR-Bitmap */ - vmcb->control.clean &= ~VMCB_HV_NESTED_ENLIGHTENMENTS ; + vmcb->control.clean &= ~HV_VMCB_NESTED_ENLIGHTENMENTS ;run_guest (vmcb, svm->vmcb_gpa);GUEST_ASSERT (vmcb->control.exit_code ==SVM_EXIT_MSR ); vmcb->save.rip +=2 ;/* rdmsr */
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 95/134 KVM: selftests: Move "struct hv_enlightenments" to x86_64/svm.h
In reply to Greg Kroah-HartmanFrom: Sean Christopherson <[email protected]>
[ Upstream commit 381fc63ac0754e05d3921e9d399b89dfdfd2b2e5 ]
Move Hyper-V's VMCB "struct hv_enlightenments" to the svm.h header so that the struct can be referenced in "struct vmcb_control_area". Alternatively, a dedicated header for SVM+Hyper-V could be added, a la x86_64/evmcs.h, but it doesn't appear that Hyper-V will end up needing a wholesale replacement for the VMCB.
No functional change intended.
Message-Id: <[email protected]>
Stable-dep-of: e5c972c1fada ("KVM: SVM: Flush Hyper-V TLB when required")
--- .../testing/selftests/kvm/include/x86_64/svm.h | 17 +++++++++++++++++ .../selftests/kvm/x86_64/hyperv_svm_test.c | 18 ------------------ 2 files changed, 17 insertions(+), 18 deletions(-)
tools/testing/selftests/kvm/include/x86_64/svm.h +17 -0
@@ -58,6 +58,23 @@ enum { INTERCEPT_RDPRU, }; +struct hv_enlightenments { + struct __packed hv_enlightenments_control { +u32 nested_flush_hypercall:1 ; +u32 msr_bitmap:1 ; +u32 enlightened_npt_tlb:1 ; +u32 reserved:29 ; + } __packed hv_enlightenments_control; +u32 hv_vp_id; +u64 hv_vm_id; +u64 partition_assist_page; +u64 reserved; +} __packed; + +/* +* Hyper-V uses the software reserved clean bit in VMCB +*/ +#define HV_VMCB_NESTED_ENLIGHTENMENTS (1U << 31)struct __attribute__ ((__packed__ ))vmcb_control_area {u32 intercept_cr;
tools/testing/selftests/kvm/x86_64/hyperv_svm_test.c +0 -18
@@ -23,24 +23,6 @@#define L2_GUEST_STACK_SIZE 256 -struct hv_enlightenments { - struct __packed hv_enlightenments_control { -u32 nested_flush_hypercall:1 ; -u32 msr_bitmap:1 ; -u32 enlightened_npt_tlb:1 ; -u32 reserved:29 ; - } __packed hv_enlightenments_control; -u32 hv_vp_id; -u64 hv_vm_id; -u64 partition_assist_page; -u64 reserved; -} __packed; - -/* -* Hyper-V uses the software reserved clean bit in VMCB -*/ -#define HV_VMCB_NESTED_ENLIGHTENMENTS (1U << 31) -void l2_guest_code (void ) {GUEST_SYNC (3 );
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 96/134 KVM: SVM: Add a proper field for Hyper-V VMCB enlightenments
In reply to Greg Kroah-HartmanFrom: Sean Christopherson <[email protected]>
[ Upstream commit 68ae7c7bc56a4504ed5efde7c2f8d6024148a35e ]
Add a union to provide hv_enlightenments side-by-side with the sw_reserved bytes that Hyper-V's enlightenments overlay. Casting sw_reserved everywhere is messy, confusing, and unnecessarily unsafe.
No functional change intended.
Message-Id: <[email protected]>
Stable-dep-of: e5c972c1fada ("KVM: SVM: Flush Hyper-V TLB when required")
--- arch/x86/include/asm/svm.h | 7 ++++++- arch/x86/kvm/svm/nested.c | 9 ++++----- arch/x86/kvm/svm/svm.h | 5 ++++- arch/x86/kvm/svm/svm_onhyperv.c | 2 +- arch/x86/kvm/svm/svm_onhyperv.h | 15 +++++++-------- tools/testing/selftests/kvm/include/x86_64/svm.h | 5 ++++- .../selftests/kvm/x86_64/hyperv_svm_test.c | 3 +-- 7 files changed, 27 insertions(+), 19 deletions(-)
arch/x86/include/asm/svm.h +6 -1
@@ -5,6 +5,8 @@#include <uapi/asm/svm.h> #include <uapi/asm/kvm.h> +#include <asm/hyperv-tlfs.h> +/* * 32-bit intercept words in the VMCB Control Area, starting * at Byte offset 000h.
@@ -161,7 +163,10 @@ struct __attribute__ ((__packed__)) vmcb_control_area {* Offset 0x3e0, 32 bytes reserved * for use by hypervisor/software. */ -u8 reserved_sw[32 ]; +union { +struct hv_enlightenments hv_enlightenments; +u8 reserved_sw[32 ]; + }; };
arch/x86/kvm/svm/nested.c +4 -5
@@ -179,8 +179,7 @@ void recalc_intercepts(struct vcpu_svm *svm)*/ static bool nested_svm_vmrun_msrpm (struct vcpu_svm *svm) { -struct hv_enlightenments *hve = - (struct hv_enlightenments *)svm->nested.ctl.reserved_sw; +struct hv_enlightenments *hve = &svm->nested.ctl.hv_enlightenments;int i;/*
@@ -369,8 +368,8 @@ void __nested_copy_vmcb_control_to_cache(struct kvm_vcpu *vcpu,/* Hyper-V extensions (Enlightened VMCB) */ if (kvm_hv_hypercall_enabled (vcpu)) { to->clean = from->clean; -memcpy (to->reserved_sw, from->reserved_sw, -sizeof (struct hv_enlightenments )); +memcpy (&to->hv_enlightenments, &from->hv_enlightenments, +sizeof (to->hv_enlightenments)); } }
@@ -1485,7 +1484,7 @@ static void nested_copy_vmcb_cache_to_control(struct vmcb_control_area *dst, dst->virt_ext = from->virt_ext; dst->pause_filter_count = from->pause_filter_count; dst->pause_filter_thresh = from->pause_filter_thresh; -/* 'clean' and 'reserved_sw' are not changed by KVM */ +/* 'clean' and 'hv_enlightenments' are not changed by KVM */ } static int svm_get_nested_state(struct kvm_vcpu *vcpu,
arch/x86/kvm/svm/svm.h +4 -1
@@ -151,7 +151,10 @@ struct vmcb_ctrl_area_cached {u64 nested_cr3;u64 virt_ext;u32 clean; -u8 reserved_sw[32 ]; +union { +struct hv_enlightenments hv_enlightenments; +u8 reserved_sw[32 ]; + }; };struct svm_nested_state {
arch/x86/kvm/svm/svm_onhyperv.c +1 -1
@@ -26,7 +26,7 @@ int svm_hv_enable_direct_tlbflush(struct kvm_vcpu *vcpu)if (!*p_hv_pa_pg)return -ENOMEM ; - hve = (struct hv_enlightenments *)to_svm (vcpu)->vmcb->control.reserved_sw; + hve = &to_svm (vcpu)->vmcb->control.hv_enlightenments; hve->partition_assist_page =__pa (*p_hv_pa_pg); hve->hv_vm_id = (unsigned long )vcpu->kvm;
arch/x86/kvm/svm/svm_onhyperv.h +7 -8
@@ -17,8 +17,10 @@ int svm_hv_enable_direct_tlbflush(struct kvm_vcpu *vcpu);static inline void svm_hv_init_vmcb (struct vmcb *vmcb) { -struct hv_enlightenments *hve = - (struct hv_enlightenments *)vmcb->control.reserved_sw; +struct hv_enlightenments *hve = &vmcb->control.hv_enlightenments; + +BUILD_BUG_ON (sizeof (vmcb->control.hv_enlightenments) != +sizeof (vmcb->control.reserved_sw));if (npt_enabled && ms_hyperv.nested_features &HV_X64_NESTED_ENLIGHTENED_TLB )
@@ -60,18 +62,15 @@ static inline void svm_hv_vmcb_dirty_nested_enlightenments( struct kvm_vcpu *vcpu) {struct vmcb *vmcb =to_svm (vcpu)->vmcb; -struct hv_enlightenments *hve = - (struct hv_enlightenments *)vmcb->control.reserved_sw; +struct hv_enlightenments *hve = &vmcb->control.hv_enlightenments;if (hve->hv_enlightenments_control.msr_bitmap)vmcb_mark_dirty (vmcb,HV_VMCB_NESTED_ENLIGHTENMENTS ); } -static inline void svm_hv_update_vp_id (struct vmcb *vmcb, -struct kvm_vcpu *vcpu) +static inline void svm_hv_update_vp_id (struct vmcb *vmcb,struct kvm_vcpu *vcpu) { -struct hv_enlightenments *hve = - (struct hv_enlightenments *)vmcb->control.reserved_sw; +struct hv_enlightenments *hve = &vmcb->control.hv_enlightenments;u32 vp_index =kvm_hv_get_vpindex (vcpu);if (hve->hv_vp_id != vp_index) {
tools/testing/selftests/kvm/include/x86_64/svm.h +4 -1
@@ -123,7 +123,10 @@ struct __attribute__ ((__packed__)) vmcb_control_area {* Offset 0x3e0, 32 bytes reserved * for use by hypervisor/software. */ -u8 reserved_sw[32 ]; +union { +struct hv_enlightenments hv_enlightenments; +u8 reserved_sw[32 ]; + }; };
tools/testing/selftests/kvm/x86_64/hyperv_svm_test.c +1 -2
@@ -46,8 +46,7 @@ static void __attribute__((__flatten__)) guest_code(struct svm_test_data *svm) {unsigned long l2_guest_stack[L2_GUEST_STACK_SIZE ];struct vmcb *vmcb = svm->vmcb; -struct hv_enlightenments *hve = - (struct hv_enlightenments *)vmcb->control.reserved_sw; +struct hv_enlightenments *hve = &vmcb->control.hv_enlightenments;GUEST_SYNC (1 );
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 97/134 x86/hyperv: KVM: Rename "hv_enlightenments" to "hv_vmcb_enlightenments"
In reply to Greg Kroah-HartmanFrom: Sean Christopherson <[email protected]>
[ Upstream commit 26b516bb39215cf60aa1fb55d0a6fd73058698fa ]
Now that KVM isn't littered with "struct hv_enlightenments" casts, rename the struct to "hv_vmcb_enlightenments" to highlight the fact that the struct is specifically for SVM's VMCB.
No functional change intended.
Message-Id: <[email protected]>
Stable-dep-of: e5c972c1fada ("KVM: SVM: Flush Hyper-V TLB when required")
--- arch/x86/include/asm/hyperv-tlfs.h | 2 +- arch/x86/include/asm/svm.h | 2 +- arch/x86/kvm/svm/nested.c | 2 +- arch/x86/kvm/svm/svm.h | 2 +- arch/x86/kvm/svm/svm_onhyperv.c | 2 +- arch/x86/kvm/svm/svm_onhyperv.h | 6 +++--- tools/testing/selftests/kvm/include/x86_64/svm.h | 4 ++-- tools/testing/selftests/kvm/x86_64/hyperv_svm_test.c | 2 +- 8 files changed, 11 insertions(+), 11 deletions(-)
arch/x86/include/asm/hyperv-tlfs.h +1 -1
@@ -602,7 +602,7 @@ struct hv_enlightened_vmcs {* Hyper-V uses the software reserved 32 bytes in VMCB control area to expose * SVM enlightenments to guests. */ -struct hv_enlightenments { +struct hv_vmcb_enlightenments { struct __packed hv_enlightenments_control { u32 nested_flush_hypercall:1; u32 msr_bitmap:1;
arch/x86/include/asm/svm.h +1 -1
@@ -164,7 +164,7 @@ struct __attribute__ ((__packed__)) vmcb_control_area {* for use by hypervisor/software. */ union { -struct hv_enlightenments hv_enlightenments; +struct hv_vmcb_enlightenments hv_enlightenments;u8 reserved_sw[32 ]; }; };
arch/x86/kvm/svm/nested.c +1 -1
@@ -179,7 +179,7 @@ void recalc_intercepts(struct vcpu_svm *svm)*/ static bool nested_svm_vmrun_msrpm (struct vcpu_svm *svm) { -struct hv_enlightenments *hve = &svm->nested.ctl.hv_enlightenments; +struct hv_vmcb_enlightenments *hve = &svm->nested.ctl.hv_enlightenments;int i;/*
arch/x86/kvm/svm/svm.h +1 -1
@@ -152,7 +152,7 @@ struct vmcb_ctrl_area_cached {u64 virt_ext;u32 clean;union { -struct hv_enlightenments hv_enlightenments; +struct hv_vmcb_enlightenments hv_enlightenments;u8 reserved_sw[32 ]; }; };
arch/x86/kvm/svm/svm_onhyperv.c +1 -1
@@ -16,7 +16,7 @@int svm_hv_enable_direct_tlbflush (struct kvm_vcpu *vcpu) { -struct hv_enlightenments *hve; +struct hv_vmcb_enlightenments *hve;struct hv_partition_assist_pg **p_hv_pa_pg = &to_kvm_hv (vcpu->kvm)->hv_pa_pg;
arch/x86/kvm/svm/svm_onhyperv.h +3 -3
@@ -17,7 +17,7 @@ int svm_hv_enable_direct_tlbflush(struct kvm_vcpu *vcpu);static inline void svm_hv_init_vmcb (struct vmcb *vmcb) { -struct hv_enlightenments *hve = &vmcb->control.hv_enlightenments; +struct hv_vmcb_enlightenments *hve = &vmcb->control.hv_enlightenments;BUILD_BUG_ON (sizeof (vmcb->control.hv_enlightenments) !=sizeof (vmcb->control.reserved_sw));
@@ -62,7 +62,7 @@ static inline void svm_hv_vmcb_dirty_nested_enlightenments( struct kvm_vcpu *vcpu) {struct vmcb *vmcb =to_svm (vcpu)->vmcb; -struct hv_enlightenments *hve = &vmcb->control.hv_enlightenments; +struct hv_vmcb_enlightenments *hve = &vmcb->control.hv_enlightenments;if (hve->hv_enlightenments_control.msr_bitmap)vmcb_mark_dirty (vmcb,HV_VMCB_NESTED_ENLIGHTENMENTS );
@@ -70,7 +70,7 @@ static inline void svm_hv_vmcb_dirty_nested_enlightenments(static inline void svm_hv_update_vp_id (struct vmcb *vmcb,struct kvm_vcpu *vcpu) { -struct hv_enlightenments *hve = &vmcb->control.hv_enlightenments; +struct hv_vmcb_enlightenments *hve = &vmcb->control.hv_enlightenments;u32 vp_index =kvm_hv_get_vpindex (vcpu);if (hve->hv_vp_id != vp_index) {
tools/testing/selftests/kvm/include/x86_64/svm.h +2 -2
@@ -58,7 +58,7 @@ enum { INTERCEPT_RDPRU, }; -struct hv_enlightenments { +struct hv_vmcb_enlightenments { struct __packed hv_enlightenments_control { u32 nested_flush_hypercall:1; u32 msr_bitmap:1;
@@ -124,7 +124,7 @@ struct __attribute__ ((__packed__)) vmcb_control_area {* for use by hypervisor/software. */ union { -struct hv_enlightenments hv_enlightenments; +struct hv_vmcb_enlightenments hv_enlightenments;u8 reserved_sw[32 ]; }; };
tools/testing/selftests/kvm/x86_64/hyperv_svm_test.c +1 -1
@@ -46,7 +46,7 @@ static void __attribute__((__flatten__)) guest_code(struct svm_test_data *svm) {unsigned long l2_guest_stack[L2_GUEST_STACK_SIZE ];struct vmcb *vmcb = svm->vmcb; -struct hv_enlightenments *hve = &vmcb->control.hv_enlightenments; +struct hv_vmcb_enlightenments *hve = &vmcb->control.hv_enlightenments;GUEST_SYNC (1 );
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 98/134 KVM: SVM: Flush Hyper-V TLB when required
In reply to Greg Kroah-HartmanFrom: Jeremi Piotrowski <[email protected]>
[ Upstream commit e5c972c1fadacc858b6a564d056f177275238040 ]
The Hyper-V "EnlightenedNptTlb" enlightenment is always enabled when KVM is running on top of Hyper-V and Hyper-V exposes support for it (which is always). On AMD CPUs this enlightenment results in ASID invalidations not flushing TLB entries derived from the NPT. To force the underlying (L0) hypervisor to rebuild its shadow page tables, an explicit hypercall is needed.
The original KVM implementation of Hyper-V's "EnlightenedNptTlb" on SVM only added remote TLB flush hooks. This worked out fine for a while, as sufficient remote TLB flushes where being issued in KVM to mask the problem. Since v5.17, changes in the TDP code reduced the number of flushes and the out-of-sync TLB prevents guests from booting successfully.
Split svm_flush_tlb_current() into separate callbacks for the 3 cases (guest/all/current), and issue the required Hyper-V hypercall when a Hyper-V TLB flush is needed. The most important case where the TLB flush was missing is when loading a new PGD, which is followed by what is now svm_flush_tlb_current().
Message-Id: <[email protected]>
--- arch/x86/kvm/kvm_onhyperv.h | 5 +++++ arch/x86/kvm/svm/svm.c | 37 ++++++++++++++++++++++++++++++--- arch/x86/kvm/svm/svm_onhyperv.h | 15 +++++++++++++ 3 files changed, 54 insertions(+), 3 deletions(-)
arch/x86/kvm/kvm_onhyperv.h +5 -0
@@ -12,6 +12,11 @@ int hv_remote_flush_tlb_with_range(struct kvm *kvm,int hv_remote_flush_tlb (struct kvm *kvm);void hv_track_root_tdp (struct kvm_vcpu *vcpu,hpa_t root_tdp);#else /* !CONFIG_HYPERV */ +static inline int hv_remote_flush_tlb (struct kvm *kvm) +{ +return -EOPNOTSUPP ; +} +static inline void hv_track_root_tdp (struct kvm_vcpu *vcpu,hpa_t root_tdp) { }
arch/x86/kvm/svm/svm.c +34 -3
@@ -3719,7 +3719,7 @@ static void svm_enable_nmi_window(struct kvm_vcpu *vcpu) svm->vmcb->save.rflags |= (X86_EFLAGS_TF |X86_EFLAGS_RF ); } -static void svm_flush_tlb_current (struct kvm_vcpu *vcpu) +static void svm_flush_tlb_asid (struct kvm_vcpu *vcpu) {struct vcpu_svm *svm =to_svm (vcpu);
@@ -3736,6 +3736,37 @@ static void svm_flush_tlb_current(struct kvm_vcpu *vcpu) svm->current_vmcb->asid_generation--; } +static void svm_flush_tlb_current (struct kvm_vcpu *vcpu) +{ +hpa_t root_tdp = vcpu->arch.mmu->root.hpa; + +/* +* When running on Hyper-V with EnlightenedNptTlb enabled, explicitly +* flush the NPT mappings via hypercall as flushing the ASID only +* affects virtual to physical mappings, it does not invalidate guest +* physical to host physical mappings. +*/ +if (svm_hv_is_enlightened_tlb_enabled (vcpu) &&VALID_PAGE (root_tdp)) +hyperv_flush_guest_mapping (root_tdp); + +svm_flush_tlb_asid (vcpu); +} + +static void svm_flush_tlb_all (struct kvm_vcpu *vcpu) +{ +/* +* When running on Hyper-V with EnlightenedNptTlb enabled, remote TLB +* flushes should be routed to hv_remote_flush_tlb() without requesting +* a "regular" remote flush. Reaching this point means either there's +* a KVM bug or a prior hv_remote_flush_tlb() call failed, both of +* which might be fatal to the guest. Yell, but try to recover. +*/ +if (WARN_ON_ONCE (svm_hv_is_enlightened_tlb_enabled (vcpu))) +hv_remote_flush_tlb (vcpu->kvm); + +svm_flush_tlb_asid (vcpu); +} +static void svm_flush_tlb_gva (struct kvm_vcpu *vcpu,gva_t gva) {struct vcpu_svm *svm =to_svm (vcpu);
@@ -4733,10 +4764,10 @@ static struct kvm_x86_ops svm_x86_ops __initdata = { .set_rflags = svm_set_rflags, .get_if_flag = svm_get_if_flag, - .flush_tlb_all = svm_flush_tlb_current, + .flush_tlb_all = svm_flush_tlb_all, .flush_tlb_current = svm_flush_tlb_current, .flush_tlb_gva = svm_flush_tlb_gva, - .flush_tlb_guest = svm_flush_tlb_current, + .flush_tlb_guest = svm_flush_tlb_asid, .vcpu_pre_run = svm_vcpu_pre_run, .vcpu_run = svm_vcpu_run,
arch/x86/kvm/svm/svm_onhyperv.h +15 -0
@@ -6,6 +6,8 @@#ifndef __ARCH_X86_KVM_SVM_ONHYPERV_H__#define __ARCH_X86_KVM_SVM_ONHYPERV_H__ +#include <asm/mshyperv.h> +#if IS_ENABLED (CONFIG_HYPERV )#include "kvm_onhyperv.h"
@@ -15,6 +17,14 @@ static struct kvm_x86_ops svm_x86_ops;int svm_hv_enable_direct_tlbflush (struct kvm_vcpu *vcpu); +static inline bool svm_hv_is_enlightened_tlb_enabled (struct kvm_vcpu *vcpu) +{ +struct hv_vmcb_enlightenments *hve = &to_svm (vcpu)->vmcb->control.hv_enlightenments; + +return ms_hyperv.nested_features &HV_X64_NESTED_ENLIGHTENED_TLB && + !!hve->hv_enlightenments_control.enlightened_npt_tlb; +} +static inline void svm_hv_init_vmcb (struct vmcb *vmcb) {struct hv_vmcb_enlightenments *hve = &vmcb->control.hv_enlightenments;
@@ -80,6 +90,11 @@ static inline void svm_hv_update_vp_id(struct vmcb *vmcb, struct kvm_vcpu *vcpu) }#else +static inline bool svm_hv_is_enlightened_tlb_enabled (struct kvm_vcpu *vcpu) +{ +return false; +} +static inline void svm_hv_init_vmcb (struct vmcb *vmcb) { }
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 99/134 tracing: Add trace_array_puts() to write into instance
In reply to Greg Kroah-HartmanFrom: Steven Rostedt (Google) <[email protected]>
[ Upstream commit d503b8f7474fe7ac616518f7fc49773cbab49f36 ]
Add a generic trace_array_puts() that can be used to "trace_puts()" into an allocated trace_array instance. This is just another variant of trace_array_printk().
Stable-dep-of: 9d52727f8043 ("tracing: Have tracing_snapshot_instance_cond() write errors to the appropriate instance")
--- include/linux/trace.h | 12 ++++++++++++ kernel/trace/trace.c | 27 +++++++++++++++++---------- 2 files changed, 29 insertions(+), 10 deletions(-)
include/linux/trace.h +12 -0
@@ -33,6 +33,18 @@ struct trace_array;int register_ftrace_export (struct trace_export *export);int unregister_ftrace_export (struct trace_export *export); +/** +* trace_array_puts - write a constant string into the trace buffer. +* @tr: The trace array to write to +* @str: The constant string to write +*/ +#define trace_array_puts (tr, str) \ + ({ \ + str ? __trace_array_puts(tr, _THIS_IP_, str, strlen(str)) : -1; \ + }) +int __trace_array_puts (struct trace_array *tr,unsigned long ip, +const char *str,int size); +void trace_printk_init_buffers (void ); __printf(3, 4) int trace_array_printk(struct trace_array *tr, unsigned long ip,
kernel/trace/trace.c +17 -10
@@ -1002,13 +1002,8 @@ __buffer_unlock_commit(struct trace_buffer *buffer, struct ring_buffer_event *evring_buffer_unlock_commit (buffer, event); } -/** -* __trace_puts - write a constant string into the trace buffer. -* @ip: The address of the caller -* @str: The constant string to write -* @size: The size of the string. -*/ -int __trace_puts (unsigned long ip,const char *str,int size) +int __trace_array_puts (struct trace_array *tr,unsigned long ip, +const char *str,int size) {struct ring_buffer_event *event;struct trace_buffer *buffer;
@@ -1016,7 +1011,7 @@ int __trace_puts(unsigned long ip, const char *str, int size)unsigned int trace_ctx;int alloc; -if (!(global_trace.trace_flags &TRACE_ITER_PRINTK )) +if (!(tr->trace_flags &TRACE_ITER_PRINTK ))return 0 ;if (unlikely (tracing_selftest_running || tracing_disabled))
@@ -1025,7 +1020,7 @@ int __trace_puts(unsigned long ip, const char *str, int size) alloc =sizeof (*entry) + size +2 ;/* possible \n added */ trace_ctx =tracing_gen_ctx (); - buffer = global_trace.array_buffer.buffer; + buffer = tr->array_buffer.buffer;ring_buffer_nest_start (buffer); event =__trace_buffer_lock_reserve (buffer,TRACE_PRINT , alloc, trace_ctx);
@@ -1047,11 +1042,23 @@ int __trace_puts(unsigned long ip, const char *str, int size) entry->buf[size] ='\0' ;__buffer_unlock_commit (buffer, event); -ftrace_trace_stack (&global_trace, buffer, trace_ctx,4 ,NULL ); +ftrace_trace_stack (tr, buffer, trace_ctx,4 ,NULL ); out:ring_buffer_nest_end (buffer);return size; } +EXPORT_SYMBOL_GPL (__trace_array_puts); + +/** +* __trace_puts - write a constant string into the trace buffer. +* @ip: The address of the caller +* @str: The constant string to write +* @size: The size of the string. +*/ +int __trace_puts (unsigned long ip,const char *str,int size) +{ +return __trace_array_puts (&global_trace, ip, str, size); +}EXPORT_SYMBOL_GPL (__trace_puts);/**
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 100/134 tracing: Have tracing_snapshot_instance_cond() write errors to the appropriate instance
In reply to Greg Kroah-HartmanFrom: Steven Rostedt (Google) <[email protected]>
[ Upstream commit 9d52727f8043cfda241ae96896628d92fa9c50bb ]
If a trace instance has a failure with its snapshot code, the error message is to be written to that instance's buffer. But currently, the message is written to the top level buffer. Worse yet, it may also disable the top level buffer and not the instance that had the issue.
--- kernel/trace/trace.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-)
kernel/trace/trace.c +7 -7
@@ -1112,22 +1112,22 @@ static void tracing_snapshot_instance_cond(struct trace_array *tr,unsigned long flags;if (in_nmi ()) { -internal_trace_puts ("*** SNAPSHOT CALLED FROM NMI CONTEXT ***\n" ); -internal_trace_puts ("*** snapshot is being ignored ***\n" ); +trace_array_puts (tr,"*** SNAPSHOT CALLED FROM NMI CONTEXT ***\n" ); +trace_array_puts (tr,"*** snapshot is being ignored ***\n" );return ; }if (!tr->allocated_snapshot) { -internal_trace_puts ("*** SNAPSHOT NOT ALLOCATED ***\n" ); -internal_trace_puts ("*** stopping trace here! ***\n" ); -tracing_off (); +trace_array_puts (tr,"*** SNAPSHOT NOT ALLOCATED ***\n" ); +trace_array_puts (tr,"*** stopping trace here! ***\n" ); +tracer_tracing_off (tr);return ; }/* Note, snapshot can not be used when the tracer uses it */ if (tracer->use_max_tr) { -internal_trace_puts ("*** LATENCY TRACER ACTIVE ***\n" ); -internal_trace_puts ("*** Can not use snapshot (sorry) ***\n" ); +trace_array_puts (tr,"*** LATENCY TRACER ACTIVE ***\n" ); +trace_array_puts (tr,"*** Can not use snapshot (sorry) ***\n" );return ; }
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 101/134 maple_tree: fix write memory barrier of nodes once dead for RCU mode
In reply to Greg Kroah-HartmanFrom: Liam R. Howlett <[email protected]>
[ Upstream commit c13af03de46ba27674dd9fb31a17c0d480081139 ]
During the development of the maple tree, the strategy of freeing multiple nodes changed and, in the process, the pivots were reused to store pointers to dead nodes. To ensure the readers see accurate pivots, the writers need to mark the nodes as dead and call smp_wmb() to ensure any readers can identify the node as dead before using the pivot values.
There were two places where the old method of marking the node as dead without smp_wmb() were being used, which resulted in RCU readers seeing the wrong pivot value before seeing the node was dead. Fix this race condition by using mte_set_node_dead() which has the smp_wmb() call to ensure the race is closed.
Add a WARN_ON() to the ma_free_rcu() call to ensure all nodes being freed are marked as dead to ensure there are no other call paths besides the two updated paths.
This is necessary for the RCU mode of the maple tree.
--- lib/maple_tree.c | 7 +++++-- tools/testing/radix-tree/maple.c | 16 ++++++++++++++++ 2 files changed, 21 insertions(+), 2 deletions(-)
lib/maple_tree.c +5 -2
@@ -178,7 +178,7 @@ static void mt_free_rcu(struct rcu_head *head)*/ static void ma_free_rcu (struct maple_node *node) { - node->parent =ma_parent_ptr (node); +WARN_ON (node->parent !=ma_parent_ptr (node));call_rcu (&node->rcu, mt_free_rcu); }
@@ -1780,8 +1780,10 @@ static inline void mas_replace(struct ma_state *mas, bool advanced)rcu_assign_pointer (slots[offset], mas->node); } -if (!advanced) +if (!advanced) { +mte_set_node_dead (old_enode);mas_free (mas, old_enode); + } }/*
@@ -4216,6 +4218,7 @@ static inline bool mas_wr_node_store(struct ma_wr_state *wr_mas) done:mas_leaf_set_meta (mas, newnode, dst_pivots, maple_leaf_64, new_end);if (in_rcu) { +mte_set_node_dead (mas->node); mas->node =mt_mk_node (newnode, wr_mas->type);mas_replace (mas, false); }else {
tools/testing/radix-tree/maple.c +16 -0
@@ -107,6 +107,7 @@ static noinline void check_new_node(struct maple_tree *mt)MT_BUG_ON (mt, mn->slot[1 ] !=NULL );MT_BUG_ON (mt,mas_allocated (&mas) !=0 ); + mn->parent =ma_parent_ptr (mn);ma_free_rcu (mn); mas.node =MAS_START ;mas_nomem (&mas,GFP_KERNEL );
@@ -159,6 +160,7 @@ static noinline void check_new_node(struct maple_tree *mt)MT_BUG_ON (mt,mas_allocated (&mas) != i);MT_BUG_ON (mt, !mn);MT_BUG_ON (mt,not_empty (mn)); + mn->parent =ma_parent_ptr (mn);ma_free_rcu (mn); }
@@ -191,6 +193,7 @@ static noinline void check_new_node(struct maple_tree *mt)MT_BUG_ON (mt,not_empty (mn));MT_BUG_ON (mt,mas_allocated (&mas) != i -1 );MT_BUG_ON (mt, !mn); + mn->parent =ma_parent_ptr (mn);ma_free_rcu (mn); }
@@ -209,6 +212,7 @@ static noinline void check_new_node(struct maple_tree *mt) mn =mas_pop_node (&mas);MT_BUG_ON (mt,not_empty (mn));MT_BUG_ON (mt,mas_allocated (&mas) != j -1 ); + mn->parent =ma_parent_ptr (mn);ma_free_rcu (mn); }MT_BUG_ON (mt,mas_allocated (&mas) !=0 );
@@ -232,6 +236,7 @@ static noinline void check_new_node(struct maple_tree *mt)MT_BUG_ON (mt,mas_allocated (&mas) != i - j); mn =mas_pop_node (&mas);MT_BUG_ON (mt,not_empty (mn)); + mn->parent =ma_parent_ptr (mn);ma_free_rcu (mn);MT_BUG_ON (mt,mas_allocated (&mas) != i - j -1 ); }
@@ -268,6 +273,7 @@ static noinline void check_new_node(struct maple_tree *mt) mn =mas_pop_node (&mas);/* get the next node. */ MT_BUG_ON (mt, mn ==NULL );MT_BUG_ON (mt,not_empty (mn)); + mn->parent =ma_parent_ptr (mn);ma_free_rcu (mn); }MT_BUG_ON (mt,mas_allocated (&mas) !=0 );
@@ -293,6 +299,7 @@ static noinline void check_new_node(struct maple_tree *mt) mn =mas_pop_node (&mas2);/* get the next node. */ MT_BUG_ON (mt, mn ==NULL );MT_BUG_ON (mt,not_empty (mn)); + mn->parent =ma_parent_ptr (mn);ma_free_rcu (mn); }MT_BUG_ON (mt,mas_allocated (&mas2) !=0 );
@@ -333,10 +340,12 @@ static noinline void check_new_node(struct maple_tree *mt)MT_BUG_ON (mt,mas_allocated (&mas) !=MAPLE_ALLOC_SLOTS +2 ); mn =mas_pop_node (&mas);MT_BUG_ON (mt,not_empty (mn)); + mn->parent =ma_parent_ptr (mn);ma_free_rcu (mn);for (i =1 ; i <=MAPLE_ALLOC_SLOTS +1 ; i++) { mn =mas_pop_node (&mas);MT_BUG_ON (mt,not_empty (mn)); + mn->parent =ma_parent_ptr (mn);ma_free_rcu (mn); }MT_BUG_ON (mt,mas_allocated (&mas) !=0 );
@@ -374,6 +383,7 @@ static noinline void check_new_node(struct maple_tree *mt)mas_node_count (&mas, i);/* Request */ mas_nomem (&mas,GFP_KERNEL );/* Fill request */ mn =mas_pop_node (&mas);/* get the next node. */ + mn->parent =ma_parent_ptr (mn);ma_free_rcu (mn);mas_destroy (&mas);
@@ -381,10 +391,13 @@ static noinline void check_new_node(struct maple_tree *mt)mas_node_count (&mas, i);/* Request */ mas_nomem (&mas,GFP_KERNEL );/* Fill request */ mn =mas_pop_node (&mas);/* get the next node. */ + mn->parent =ma_parent_ptr (mn);ma_free_rcu (mn); mn =mas_pop_node (&mas);/* get the next node. */ + mn->parent =ma_parent_ptr (mn);ma_free_rcu (mn); mn =mas_pop_node (&mas);/* get the next node. */ + mn->parent =ma_parent_ptr (mn);ma_free_rcu (mn);mas_destroy (&mas); }
@@ -35368,6 +35381,7 @@ static noinline void check_prealloc(struct maple_tree *mt)MT_BUG_ON (mt, allocated !=1 + height *3 ); mn =mas_pop_node (&mas);MT_BUG_ON (mt,mas_allocated (&mas) != allocated -1 ); + mn->parent =ma_parent_ptr (mn);ma_free_rcu (mn);MT_BUG_ON (mt,mas_preallocate (&mas, ptr,GFP_KERNEL ) !=0 );mas_destroy (&mas);
@@ -35385,6 +35399,7 @@ static noinline void check_prealloc(struct maple_tree *mt)mas_destroy (&mas); allocated =mas_allocated (&mas);MT_BUG_ON (mt, allocated !=0 ); + mn->parent =ma_parent_ptr (mn);ma_free_rcu (mn);MT_BUG_ON (mt,mas_preallocate (&mas, ptr,GFP_KERNEL ) !=0 );
@@ -35755,6 +35770,7 @@ void farmer_tests(void) tree.ma_root =mt_mk_node (node, maple_leaf_64);mt_dump (&tree); + node->parent =ma_parent_ptr (node);ma_free_rcu (node);/* Check things that will make lockdep angry */
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 102/134 ksmbd: avoid out of bounds access in decode_preauth_ctxt()
In reply to Greg Kroah-HartmanFrom: David Disseldorp <[email protected]>
commit e7067a446264a7514fa1cfaa4052cdb6803bc6a2 upstream.
Confirm that the accessed pneg_ctxt->HashAlgorithms address sits within the SMB request boundary; deassemble_neg_contexts() only checks that the eight byte smb2_neg_context header + (client controlled) DataLength are within the packet boundary, which is insufficient.
Checking for sizeof(struct smb2_preauth_neg_context) is overkill given that the type currently assumes SMB311_SALT_SIZE bytes of trailing Salt.
--- fs/ksmbd/smb2pdu.c | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-)
fs/ksmbd/smb2pdu.c +14 -9
@@ -872,17 +872,21 @@ static void assemble_neg_contexts(struct }static __le32 decode_preauth_ctxt (struct ksmbd_conn *conn, -struct smb2_preauth_neg_context *pneg_ctxt) +struct smb2_preauth_neg_context *pneg_ctxt, +int len_of_ctxts) { -__le32 err =STATUS_NO_PREAUTH_INTEGRITY_HASH_OVERLAP ; +/* +* sizeof(smb2_preauth_neg_context) assumes SMB311_SALT_SIZE Salt, +* which may not be present. Only check for used HashAlgorithms[1]. +*/ +if (len_of_ctxts <MIN_PREAUTH_CTXT_DATA_LEN ) +return STATUS_INVALID_PARAMETER ; -if (pneg_ctxt->HashAlgorithms ==SMB2_PREAUTH_INTEGRITY_SHA512 ) { - conn->preauth_info->Preauth_HashId = -SMB2_PREAUTH_INTEGRITY_SHA512 ; - err =STATUS_SUCCESS ; - } +if (pneg_ctxt->HashAlgorithms !=SMB2_PREAUTH_INTEGRITY_SHA512 ) +return STATUS_NO_PREAUTH_INTEGRITY_HASH_OVERLAP ; -return err; + conn->preauth_info->Preauth_HashId =SMB2_PREAUTH_INTEGRITY_SHA512 ; +return STATUS_SUCCESS ; } static void decode_encrypt_ctxt(struct ksmbd_conn *conn,
@@ -1010,7 +1014,8 @@ static __le32 deassemble_neg_contexts(stbreak ; status =decode_preauth_ctxt (conn, - (struct smb2_preauth_neg_context *)pctx); + (struct smb2_preauth_neg_context *)pctx, + len_of_ctxts);if (status !=STATUS_SUCCESS )break ; }else if (pctx->ContextType ==SMB2_ENCRYPTION_CAPABILITIES ) {
Greg Kroah-Hartman
maintainerPATCH 103/134 riscv: Do not set initial_boot_params to the linear address of the dtb
In reply to Greg Kroah-HartmanFrom: Alexandre Ghiti <[email protected]>
commit f1581626071c8e37c58c5e8f0b4126b17172a211 upstream.
early_init_dt_verify() is already called in parse_dtb() and since the dtb address does not change anymore (it is now in the fixmap region), no need to reset initial_boot_params by calling early_init_dt_verify() again.
--- arch/riscv/kernel/setup.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-)
arch/riscv/kernel/setup.c +1 -4
@@ -278,10 +278,7 @@ void __init setup_arch(char **cmdline_p)#if IS_ENABLED (CONFIG_BUILTIN_DTB )unflatten_and_copy_device_tree ();#else -if (early_init_dt_verify (__va (XIP_FIXUP (dtb_early_pa)))) -unflatten_device_tree (); -else -pr_err ("No DTB found in kernel mappings\n" ); +unflatten_device_tree ();#endif early_init_fdt_scan_reserved_mem ();misc_mem_init ();
Greg Kroah-Hartman
maintainerPATCH 77/134 i2c: imx-lpi2c: clean rx/tx buffers upon new message
In reply to Greg Kroah-HartmanFrom: Alexander Stein <[email protected]>
[ Upstream commit 987dd36c0141f6ab9f0fbf14d6b2ec3342dedb2f ]
When start sending a new message clear the Rx & Tx buffer pointers in order to avoid using stale pointers.
--- drivers/i2c/busses/i2c-imx-lpi2c.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/i2c/busses/i2c-imx-lpi2c.c +2 -0
@@ -463,6 +463,8 @@ static int lpi2c_imx_xfer(struct i2c_adapter *adapter,if (num ==1 && msgs[0 ].len ==0 ) goto stop; + lpi2c_imx->rx_buf =NULL ; + lpi2c_imx->tx_buf =NULL ; lpi2c_imx->delivered =0 ; lpi2c_imx->msglen = msgs[i].len;init_completion (&lpi2c_imx->complete);
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 104/134 riscv: add icache flush for nommu sigreturn trampoline
In reply to Greg Kroah-HartmanFrom: Mathis Salmen <[email protected]>
commit 8d736482749f6d350892ef83a7a11d43cd49981e upstream.
In a NOMMU kernel, sigreturn trampolines are generated on the user stack by setup_rt_frame. Currently, these trampolines are not instruction fenced, thus their visibility to ifetch is not guaranteed.
This patch adds a flush_icache_range in setup_rt_frame to fix this problem.
--- arch/riscv/kernel/signal.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-)
arch/riscv/kernel/signal.c +8 -1
@@ -19,6 +19,7 @@#include <asm/signal32.h> #include <asm/switch_to.h> #include <asm/csr.h> +#include <asm/cacheflush.h> extern u32 __user_rt_sigreturn[2 ];
@@ -181,6 +182,7 @@ static int setup_rt_frame(struct ksignal {struct rt_sigframe __user *frame;long err =0 ; +unsigned long __maybe_unused addr; frame =get_sigframe (ksig, regs,sizeof (*frame));if (!access_ok (frame,sizeof (*frame)))
@@ -209,7 +211,12 @@ static int setup_rt_frame(struct ksignalif (copy_to_user (&frame->sigreturn_code, __user_rt_sigreturn,sizeof (frame->sigreturn_code)))return -EFAULT ; - regs->ra = (unsigned long )&frame->sigreturn_code; + + addr = (unsigned long )&frame->sigreturn_code; +/* Make sure the two instructions are pushed to icache. */ +flush_icache_range (addr, addr +sizeof (frame->sigreturn_code)); + + regs->ra = addr;#endif /* CONFIG_MMU */ /*
Greg Kroah-Hartman
maintainerPATCH 105/134 HID: intel-ish-hid: Fix kernel panic during warm reset
In reply to Greg Kroah-HartmanFrom: Tanu Malhotra <[email protected]>
commit 38518593ec55e897abda4b4be77b2ec8ec4447d1 upstream.
During warm reset device->fw_client is set to NULL. If a bus driver is registered after this NULL setting and before new firmware clients are enumerated by ISHTP, kernel panic will result in the function ishtp_cl_bus_match(). This is because of reference to device->fw_client->props.protocol_name.
ISH firmware after getting successfully loaded, sends a warm reset notification to remove all clients from the bus and sets device->fw_client to NULL. Until kernel v5.15, all enabled ISHTP kernel module drivers were loaded right after any of the first ISHTP device was registered, regardless of whether it was a matched or an unmatched device. This resulted in all drivers getting registered much before the warm reset notification from ISH.
Starting kernel v5.16, this issue got exposed after the change was introduced to load only bus drivers for the respective matching devices. In this scenario, cros_ec_ishtp device and cros_ec_ishtp driver are registered after the warm reset device fw_client NULL setting. cros_ec_ishtp driver_register() triggers the callback to ishtp_cl_bus_match() to match ISHTP driver to the device and causes kernel panic in guid_equal() when dereferencing fw_client NULL pointer to get protocol_name.
--- drivers/hid/intel-ish-hid/ishtp/bus.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/hid/intel-ish-hid/ishtp/bus.c +2 -2
@@ -241,8 +241,8 @@ static int ishtp_cl_bus_match(struct devstruct ishtp_cl_device *device =to_ishtp_cl_device (dev);struct ishtp_cl_driver *driver =to_ishtp_cl_driver (drv); -return guid_equal (&driver->id[0 ].guid, - &device->fw_client->props.protocol_name); +return (device->fw_client ?guid_equal (&driver->id[0 ].guid, + &device->fw_client->props.protocol_name) :0 ); }/**
Greg Kroah-Hartman
maintainerPATCH 106/134 net: sfp: initialize sfp->i2c_block_size at sfp allocation
In reply to Greg Kroah-HartmanFrom: Ivan Bornyakov <[email protected]>
commit 813c2dd78618f108fdcf9cd726ea90f081ee2881 upstream.
sfp->i2c_block_size is initialized at SFP module insertion in sfp_sm_mod_probe(). Because of that, if SFP module was never inserted since boot, sfp_read() call will lead to zero-length I2C read attempt, and not all I2C controllers are happy with zero-length reads.
One way to issue sfp_read() on empty SFP cage is to execute ethtool -m. If SFP module was never plugged since boot, there will be a zero-length I2C read attempt.
# ethtool -m xge0 i2c i2c-3: adapter quirk: no zero length (addr 0x0050, size 0, read) Cannot get Module EEPROM data: Operation not supported
If SFP module was plugged then removed at least once, sfp->i2c_block_size will be initialized and ethtool -m will fail with different exit code and without I2C error
# ethtool -m xge0 Cannot get Module EEPROM data: Remote I/O error
Fix this by initializing sfp->i2_block_size at struct sfp allocation stage so no wild sfp_read() could issue zero-length I2C read.
--- drivers/net/phy/sfp.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-)
drivers/net/phy/sfp.c +8 -5
@@ -212,6 +212,12 @@ static const enum gpiod_flags gpio_flags#define SFP_PHY_ADDR 22#define SFP_PHY_ADDR_ROLLBALL 17 +/* SFP_EEPROM_BLOCK_SIZE is the size of data chunk to read the EEPROM +* at a time. Some SFP modules and also some Linux I2C drivers do not like +* reads longer than 16 bytes. +*/ +#define SFP_EEPROM_BLOCK_SIZE 16 +struct sff_data {unsigned int gpios;bool (*module_supported)(const struct sfp_eeprom_id *id);
@@ -1928,11 +1934,7 @@ static int sfp_sm_mod_probe(struct sfp *u8 check;int ret; -/* Some SFP modules and also some Linux I2C drivers do not like reads -* longer than 16 bytes, so read the EEPROM in chunks of 16 bytes at -* a time. -*/ - sfp->i2c_block_size =16 ; + sfp->i2c_block_size =SFP_EEPROM_BLOCK_SIZE ; ret =sfp_read (sfp, false,0 , &id.base,sizeof (id.base));if (ret <0 ) {
@@ -2615,6 +2617,7 @@ static struct sfp *sfp_alloc(struct devireturn ERR_PTR (-ENOMEM ); sfp->dev = dev; + sfp->i2c_block_size =SFP_EEPROM_BLOCK_SIZE ;mutex_init (&sfp->sm_mutex);mutex_init (&sfp->st_mutex);
Greg Kroah-Hartman
maintainerPATCH 78/134 i2c: hisi: Avoid redundant interrupts
In reply to Greg Kroah-HartmanFrom: Yicong Yang <[email protected]>
[ Upstream commit cc9812a3096d1986caca9a23bee99effc45c08df ]
After issuing all the messages we can disable the TX_EMPTY interrupts to avoid handling redundant interrupts. For doing a sinlge bus detection (i2cdetect -y -r 0) we can reduce ~97% interrupts (before ~12000 after ~400).
--- drivers/i2c/busses/i2c-hisi.c | 7 +++++++ 1 file changed, 7 insertions(+)
drivers/i2c/busses/i2c-hisi.c +7 -0
@@ -314,6 +314,13 @@ static void hisi_i2c_xfer_msg(struct hisi_i2c_controller *ctlr) max_write == 0)break ; } + +/* +* Disable the TX_EMPTY interrupt after finishing all the messages to +* avoid overwhelming the CPU. +*/ +if (ctlr->msg_tx_idx == ctlr->msg_num) +hisi_i2c_disable_int (ctlr,HISI_I2C_INT_TX_EMPTY ); }static irqreturn_t hisi_i2c_irq (int irq,void *context)
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 79/134 efi: sysfb_efi: Add quirk for Lenovo Yoga Book X91F/L
In reply to Greg Kroah-HartmanFrom: Hans de Goede <[email protected]>
[ Upstream commit 5ed213dd64681f84a01ceaa82fb336cf7d59ddcf ]
Another Lenovo convertable which reports a landscape resolution of 1920x1200 with a pitch of (1920 * 4) bytes, while the actual framebuffer has a resolution of 1200x1920 with a pitch of (1200 * 4) bytes.
--- drivers/firmware/efi/sysfb_efi.c | 8 ++++++++ 1 file changed, 8 insertions(+)
drivers/firmware/efi/sysfb_efi.c +8 -0
@@ -272,6 +272,14 @@ static const struct dmi_system_id efifb_dmi_swap_width_height[] __initconst = { "IdeaPad Duet 3 10IGL5"), }, }, + { + /* Lenovo Yoga Book X91F / X91L */ + .matches = { + DMI_EXACT_MATCH(DMI_SYS_VENDOR, "LENOVO"), + /* Non exact match to match F + L versions */ + DMI_MATCH(DMI_PRODUCT_NAME, "Lenovo YB1-X91"), + }, + }, {}, };
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 80/134 block: ublk_drv: mark device as LIVE before adding disk
In reply to Greg Kroah-HartmanFrom: Ming Lei <[email protected]>
[ Upstream commit 4985e7b2c002eb4c5c794a1d3acd91b82c89a0fd ]
IO can be started before add_disk() returns, such as reading parititon table, then the monitor work should work for making forward progress.
So mark device as LIVE before adding disk, meantime change to DEAD if add_disk() fails.
Fixed: 71f28f3136af ("ublk_drv: add io_uring based userspace block driver")
--- drivers/block/ublk_drv.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/block/ublk_drv.c +2 -1
@@ -1571,17 +1571,18 @@ static int ublk_ctrl_start_dev(struct io_uring_cmd *cmd)set_bit (GD_SUPPRESS_PART_SCAN , &disk->state);get_device (&ub->cdev_dev); + ub->dev_info.state =UBLK_S_DEV_LIVE ; ret =add_disk (disk);if (ret) {/* * Has to drop the reference since ->free_disk won't be * called in case of add_disk failure. */ + ub->dev_info.state =UBLK_S_DEV_DEAD ;ublk_put_device (ub); goto out_put_disk; }set_bit (UB_STATE_USED , &ub->state); - ub->dev_info.state =UBLK_S_DEV_LIVE ; out_put_disk:if (ret)put_disk (disk);
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 81/134 ACPI: video: Add backlight=native DMI quirk for Acer Aspire 3830TG
In reply to Greg Kroah-HartmanFrom: Hans de Goede <[email protected]>
[ Upstream commit 5e7a3bf65db57461d0f47955248fcadf37321a74 ]
The Acer Aspire 3830TG predates Windows 8, so it defaults to using acpi_video# for backlight control, but this is non functional on this model.
Add a DMI quirk to use the native backlight interface which does work properly.
--- drivers/acpi/video_detect.c | 8 ++++++++ 1 file changed, 8 insertions(+)
drivers/acpi/video_detect.c +8 -0
@@ -530,6 +530,14 @@ static const struct dmi_system_id video_detect_dmi_table[] = { DMI_MATCH(DMI_PRODUCT_NAME, "Precision 7510"), }, }, + { + .callback = video_detect_force_native, +/* Acer Aspire 3830TG */ + .matches = { +DMI_MATCH (DMI_SYS_VENDOR ,"Acer" ), + DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 3830TG"), + }, + }, { .callback = video_detect_force_native,/* Acer Aspire 4810T */
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 82/134 drm: panel-orientation-quirks: Add quirk for Lenovo Yoga Book X90F
In reply to Greg Kroah-HartmanFrom: Hans de Goede <[email protected]>
[ Upstream commit 03aecb1acbcd7a660f97d645ca6c09d9de27ff9d ]
Like the Windows Lenovo Yoga Book X91F/L the Android Lenovo Yoga Book X90F/L has a portrait 1200x1920 screen used in landscape mode, add a quirk for this.
When the quirk for the X91F/L was initially added it was written to also apply to the X90F/L but this does not work because the Android version of the Yoga Book uses completely different DMI strings. Also adjust the X91F/L quirk to reflect that it only applies to the X91F/L models.
--- drivers/gpu/drm/drm_panel_orientation_quirks.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-)
drivers/gpu/drm/drm_panel_orientation_quirks.c +10 -3
@@ -328,10 +328,17 @@ static const struct dmi_system_id orientation_data[] = { DMI_EXACT_MATCH(DMI_PRODUCT_VERSION, "IdeaPad Duet 3 10IGL5"), }, .driver_data = (void *)&lcd1200x1920_rightside_up, - }, { /* Lenovo Yoga Book X90F / X91F / X91L */ + }, { /* Lenovo Yoga Book X90F / X90L */ .matches = { -/* Non exact match to match all versions */ - DMI_MATCH(DMI_PRODUCT_NAME, "Lenovo YB1-X9"), +DMI_EXACT_MATCH (DMI_SYS_VENDOR ,"Intel Corporation" ), +DMI_EXACT_MATCH (DMI_PRODUCT_NAME ,"CHERRYVIEW D1 PLATFORM" ), + DMI_EXACT_MATCH(DMI_PRODUCT_VERSION, "YETI-11"), + }, + .driver_data = (void *)&lcd1200x1920_rightside_up, + }, { /* Lenovo Yoga Book X91F / X91L */ + .matches = { +/* Non exact match to match F + L versions */ + DMI_MATCH(DMI_PRODUCT_NAME, "Lenovo YB1-X91"), }, .driver_data = (void *)&lcd1200x1920_rightside_up, }, { /* Lenovo Yoga Tablet 2 830F / 830L */
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 83/134 hwmon: (peci/cputemp) Fix miscalculated DTS for SKX
In reply to Greg Kroah-HartmanFrom: Iwona Winiarska <[email protected]>
[ Upstream commit 2b91c4a870c9830eaf95e744454c9c218cccb736 ]
For Skylake, DTS temperature of the CPU is reported in S10.6 format instead of S8.8.
--- drivers/hwmon/peci/cputemp.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-)
drivers/hwmon/peci/cputemp.c +7 -1
@@ -537,6 +537,12 @@ static const struct cpu_info cpu_hsx = { .thermal_margin_to_millidegree = &dts_eight_dot_eight_to_millidegree, }; +static const struct cpu_info cpu_skx = { + .reg = &resolved_cores_reg_hsx, + .min_peci_revision =0x33 , + .thermal_margin_to_millidegree = &dts_ten_dot_six_to_millidegree, +}; +static const struct cpu_info cpu_icx = { .reg = &resolved_cores_reg_icx, .min_peci_revision =0x40 ,
@@ -558,7 +564,7 @@ static const struct auxiliary_device_id peci_cputemp_ids[] = { }, { .name = "peci_cpu.cputemp.skx", - .driver_data = (kernel_ulong_t)&cpu_hsx, + .driver_data = (kernel_ulong_t)&cpu_skx, }, { .name = "peci_cpu.cputemp.icx",
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 74/134 power: supply: axp288_fuel_gauge: Added check for negative values
In reply to Greg Kroah-HartmanFrom: Denis Arefev <[email protected]>
[ Upstream commit bf6c880d5d1448489ebf92e2d13d5713ff644930 ]
Variable 'pirq', which may receive negative value in platform_get_irq().
Used as an index in a function regmap_irq_get_virq().
Found by Linux Verification Center (linuxtesting.org) with SVACE.
--- drivers/power/supply/axp288_fuel_gauge.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/power/supply/axp288_fuel_gauge.c +2 -0
@@ -724,6 +724,8 @@ static int axp288_fuel_gauge_probe(struct platform_device *pdev)for (i =0 ; i <AXP288_FG_INTR_NUM ; i++) { pirq =platform_get_irq (pdev, i); +if (pirq <0 ) +continue ; ret =regmap_irq_get_virq (axp20x->regmap_irqc, pirq);if (ret <0 )return dev_err_probe (dev, ret,"getting vIRQ %d\n" , pirq);
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 108/134 net: phy: nxp-c45-tja11xx: fix unsigned long multiplication overflow
In reply to Greg Kroah-HartmanFrom: Radu Pirea (OSS) <[email protected]>
commit bdaaecc127d471c422ee9e994978617c8aa79e1e upstream.
Any multiplication between GENMASK(31, 0) and a number bigger than 1 will be truncated because of the overflow, if the size of unsigned long is 32 bits.
Replaced GENMASK with GENMASK_ULL to make sure that multiplication will be between 64 bits values.
--- drivers/net/phy/nxp-c45-tja11xx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/phy/nxp-c45-tja11xx.c +1 -1
@@ -191,7 +191,7 @@#define MAX_ID_PS 2260U#define DEFAULT_ID_PS 2000U -#define PPM_TO_SUBNS_INC (ppb) div_u64(GENMASK(31, 0) * (ppb) * \ +#define PPM_TO_SUBNS_INC (ppb) div_u64(GENMASK_ULL(31, 0) * (ppb) * \ PTP_CLK_PERIOD_100BT1, NSEC_PER_SEC)#define NXP_C45_SKB_CB (skb) ((struct nxp_c45_skb_cb *)(skb)->cb)
Greg Kroah-Hartman
maintainerPATCH 117/134 mptcp: stricter state check in mptcp_worker
In reply to Greg Kroah-HartmanFrom: Paolo Abeni <[email protected]>
commit d6a0443733434408f2cbd4c53fea6910599bab9e upstream.
As reported by Christoph, the mptcp protocol can run the worker when the relevant msk socket is in an unexpected state:
connect()
// incoming reset + fastclose
// the mptcp worker is scheduledmptcp_disconnect()
// msk is now CLOSEDlisten()mptcp_worker()
Leading to the following splat:
divide error: 0000 [#1] PREEMPT SMP
CPU: 1 PID: 21 Comm: kworker/1:0 Not tainted 6.3.0-rc1-gde5e8fd0123c #11 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.11.0-2.el7 04/01/2014 Workqueue: events mptcp_worker RIP: 0010:__tcp_select_window+0x22c/0x4b0 net/ipv4/tcp_output.c:3018 RSP: 0018:ffffc900000b3c98 EFLAGS: 00010293 RAX: 000000000000ffd7 RBX: 000000000000ffd7 RCX: 0000000000000000 RDX: 0000000000000000 RSI: ffffffff8214ce97 RDI: 0000000000000004 RBP: 000000000000ffd7 R08: 0000000000000004 R09: 0000000000010000 R10: 000000000000ffd7 R11: ffff888005afa148 R12: 000000000000ffd7 R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000 FS: 0000000000000000(0000) GS:ffff88803ed00000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 0000000000405270 CR3: 000000003011e006 CR4: 0000000000370ee0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Call Trace: <TASK> tcp_select_window net/ipv4/tcp_output.c:262 [inline] __tcp_transmit_skb+0x356/0x1280 net/ipv4/tcp_output.c:1345 tcp_transmit_skb net/ipv4/tcp_output.c:1417 [inline] tcp_send_active_reset+0x13e/0x320 net/ipv4/tcp_output.c:3459 mptcp_check_fastclose net/mptcp/protocol.c:2530 [inline] mptcp_worker+0x6c7/0x800 net/mptcp/protocol.c:2705 process_one_work+0x3bd/0x950 kernel/workqueue.c:2390 worker_thread+0x5b/0x610 kernel/workqueue.c:2537 kthread+0x138/0x170 kernel/kthread.c:376 ret_from_fork+0x2c/0x50 arch/x86/entry/entry_64.S:308 </TASK>
This change addresses the issue explicitly checking for bad states before running the mptcp worker.
--- net/mptcp/protocol.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/mptcp/protocol.c +1 -1
@@ -2638,7 +2638,7 @@ static void mptcp_worker(struct work_strlock_sock (sk); state = sk->sk_state; -if (unlikely (state ==TCP_CLOSE )) +if (unlikely ((1 << state) & (TCPF_CLOSE |TCPF_LISTEN ))) goto unlock;mptcp_check_data_fin_ack (sk);
Greg Kroah-Hartman
maintainerPATCH 118/134 ubi: Fix failure attaching when vid_hdr offset equals to (sub)page size
In reply to Greg Kroah-HartmanFrom: Zhihao Cheng <[email protected]>
commit 1e020e1b96afdecd20680b5b5be2a6ffc3d27628 upstream.
Following process will make ubi attaching failed since commit 1b42b1a36fc946 ("ubi: ensure that VID header offset ... size"):
ID="0xec,0xa1,0x00,0x15" # 128M 128KB 2KB
modprobe nandsim id_bytes=$IDflash_eraseall /dev/mtd0
modprobe ubi mtd="0,2048" # set vid_hdr offset as 2048 (one page) (dmesg):
ubi0 error: ubi_attach_mtd_dev [ubi]: VID header offset 2048 too large. UBI error: cannot attach mtd0
UBI error: cannot initialize UBI, error -22
Rework original solution, the key point is making sure 'vid_hdr_shift + UBI_VID_HDR_SIZE < ubi->vid_hdr_alsize', so we should check vid_hdr_shift rather not vid_hdr_offset. Then, ubi still support (sub)page aligined VID header offset.
--- drivers/mtd/ubi/build.c | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-)
drivers/mtd/ubi/build.c +15 -6
@@ -664,12 +664,6 @@ static int io_init(struct ubi_device *ub ubi->ec_hdr_alsize =ALIGN (UBI_EC_HDR_SIZE , ubi->hdrs_min_io_size); ubi->vid_hdr_alsize =ALIGN (UBI_VID_HDR_SIZE , ubi->hdrs_min_io_size); -if (ubi->vid_hdr_offset && ((ubi->vid_hdr_offset +UBI_VID_HDR_SIZE ) > - ubi->vid_hdr_alsize)) { -ubi_err (ubi,"VID header offset %d too large." , ubi->vid_hdr_offset); -return -EINVAL ; - } -dbg_gen ("min_io_size %d" , ubi->min_io_size);dbg_gen ("max_write_size %d" , ubi->max_write_size);dbg_gen ("hdrs_min_io_size %d" , ubi->hdrs_min_io_size);
@@ -687,6 +681,21 @@ static int io_init(struct ubi_device *ub ubi->vid_hdr_aloffset; } +/* +* Memory allocation for VID header is ubi->vid_hdr_alsize +* which is described in comments in io.c. +* Make sure VID header shift + UBI_VID_HDR_SIZE not exceeds +* ubi->vid_hdr_alsize, so that all vid header operations +* won't access memory out of bounds. +*/ +if ((ubi->vid_hdr_shift +UBI_VID_HDR_SIZE ) > ubi->vid_hdr_alsize) { +ubi_err (ubi,"Invalid VID header offset %d, VID header shift(%d)" +" + VID header size(%zu) > VID header aligned size(%d)." , + ubi->vid_hdr_offset, ubi->vid_hdr_shift, +UBI_VID_HDR_SIZE , ubi->vid_hdr_alsize); +return -EINVAL ; + } +/* Similar for the data offset */ ubi->leb_start = ubi->vid_hdr_offset +UBI_VID_HDR_SIZE ; ubi->leb_start =ALIGN (ubi->leb_start, ubi->min_io_size);
Greg Kroah-Hartman
maintainerPATCH 119/134 ubi: Fix deadlock caused by recursively holding work_sem
In reply to Greg Kroah-HartmanFrom: ZhaoLong Wang <[email protected]>
[ Upstream commit f773f0a331d6c41733b17bebbc1b6cae12e016f5 ]
During the processing of the bgt, if the sync_erase() return -EBUSY or some other error code in __erase_worker(),schedule_erase() called again lead to the down_read(ubi->work_sem) hold twice and may get block by down_write(ubi->work_sem) in ubi_update_fastmap(), which cause deadlock.
ubi bgt other task
do_work
down_read(&ubi->work_sem) ubi_update_fastmap
erase_worker # Blocked by down_read
__erase_worker down_write(&ubi->work_sem)
schedule_erase
schedule_ubi_work
down_read(&ubi->work_sem)Fix this by changing input parameter @nested of the schedule_erase() to 'true' to avoid recursively acquiring the down_read(&ubi->work_sem).
Also, fix the incorrect comment about @nested parameter of the schedule_erase() because when down_write(ubi->work_sem) is held, the @nested is also need be true.
--- drivers/mtd/ubi/wl.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/mtd/ubi/wl.c +2 -2
@@ -575,7 +575,7 @@ static int erase_worker(struct ubi_device *ubi, struct ubi_work *wl_wrk,* @vol_id: the volume ID that last used this PEB * @lnum: the last used logical eraseblock number for the PEB * @torture: if the physical eraseblock has to be tortured -* @nested: denotes whether the work_sem is already held in read mode +* @nested: denotes whether the work_sem is already held * * This function returns zero in case of success and a %-ENOMEM in case of * failure.
@@ -1131,7 +1131,7 @@ static int __erase_worker(struct ubi_device *ubi, struct ubi_work *wl_wrk)int err1;/* Re-schedule the LEB for erasure */ - err1 =schedule_erase (ubi, e, vol_id, lnum,0 , false); + err1 =schedule_erase (ubi, e, vol_id, lnum,0 , true);if (err1) {spin_lock (&ubi->wl_lock);wl_entry_destroy (ubi, e);
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 120/134 i2c: mchp-pci1xxxx: Update Timing registers
In reply to Greg Kroah-HartmanFrom: Tharun Kumar P <[email protected]>
[ Upstream commit aa874cdfec07d4dd9c6f0c356d65c609ba31a26f ]
Update I2C timing registers based on latest hardware design. This fix does not break functionality of chips with older design and existing users will not be affected.
--- drivers/i2c/busses/i2c-mchp-pci1xxxx.c | 60 +++++++++++++------------- 1 file changed, 30 insertions(+), 30 deletions(-)
drivers/i2c/busses/i2c-mchp-pci1xxxx.c +30 -30
@@ -48,9 +48,9 @@* SR_HOLD_TIME_XK_TICKS field will indicate the number of ticks of the * baud clock required to program 'Hold Time' at X KHz. */ -#define SR_HOLD_TIME_100K_TICKS 133 -#define SR_HOLD_TIME_400K_TICKS 20 -#define SR_HOLD_TIME_1000K_TICKS 11 +#define SR_HOLD_TIME_100K_TICKS 150 +#define SR_HOLD_TIME_400K_TICKS 20 +#define SR_HOLD_TIME_1000K_TICKS 12#define SMB_CORE_COMPLETION_REG_OFF3 (SMBUS_MAST_CORE_ADDR_BASE + 0x23)
@@ -65,17 +65,17 @@* the baud clock required to program 'fair idle delay' at X KHz. Fair idle * delay establishes the MCTP T(IDLE_DELAY) period. */ -#define FAIR_BUS_IDLE_MIN_100K_TICKS 969 -#define FAIR_BUS_IDLE_MIN_400K_TICKS 157 -#define FAIR_BUS_IDLE_MIN_1000K_TICKS 157 +#define FAIR_BUS_IDLE_MIN_100K_TICKS 992 +#define FAIR_BUS_IDLE_MIN_400K_TICKS 500 +#define FAIR_BUS_IDLE_MIN_1000K_TICKS 500/* * FAIR_IDLE_DELAY_XK_TICKS field will indicate the number of ticks of the * baud clock required to satisfy the fairness protocol at X KHz. */ -#define FAIR_IDLE_DELAY_100K_TICKS 1000 -#define FAIR_IDLE_DELAY_400K_TICKS 500 -#define FAIR_IDLE_DELAY_1000K_TICKS 500 +#define FAIR_IDLE_DELAY_100K_TICKS 963 +#define FAIR_IDLE_DELAY_400K_TICKS 156 +#define FAIR_IDLE_DELAY_1000K_TICKS 156#define SMB_IDLE_SCALING_100K \ ((FAIR_IDLE_DELAY_100K_TICKS << 16) | FAIR_BUS_IDLE_MIN_100K_TICKS)
@@ -105,7 +105,7 @@*/ #define BUS_CLK_100K_LOW_PERIOD_TICKS 156#define BUS_CLK_400K_LOW_PERIOD_TICKS 41 -#define BUS_CLK_1000K_LOW_PERIOD_TICKS 15 +#define BUS_CLK_1000K_LOW_PERIOD_TICKS 15/* * BUS_CLK_XK_HIGH_PERIOD_TICKS field defines the number of I2C Baud Clock
@@ -131,7 +131,7 @@*/ #define CLK_SYNC_100K 4#define CLK_SYNC_400K 4 -#define CLK_SYNC_1000K 4 +#define CLK_SYNC_1000K 4#define SMB_CORE_DATA_TIMING_REG_OFF (SMBUS_MAST_CORE_ADDR_BASE + 0x40)
@@ -142,25 +142,25 @@* determines the SCLK hold time following SDAT driven low during the first * START bit in a transfer. */ -#define FIRST_START_HOLD_100K_TICKS 22 -#define FIRST_START_HOLD_400K_TICKS 16 -#define FIRST_START_HOLD_1000K_TICKS 6 +#define FIRST_START_HOLD_100K_TICKS 23 +#define FIRST_START_HOLD_400K_TICKS 8 +#define FIRST_START_HOLD_1000K_TICKS 12/* * STOP_SETUP_XK_TICKS will indicate the number of ticks of the baud clock * required to program 'STOP_SETUP' timer at X KHz. This timer determines the * SDAT setup time from the rising edge of SCLK for a STOP condition. */ -#define STOP_SETUP_100K_TICKS 157 +#define STOP_SETUP_100K_TICKS 150#define STOP_SETUP_400K_TICKS 20 -#define STOP_SETUP_1000K_TICKS 12 +#define STOP_SETUP_1000K_TICKS 12/* * RESTART_SETUP_XK_TICKS will indicate the number of ticks of the baud clock * required to program 'RESTART_SETUP' timer at X KHz. This timer determines the * SDAT setup time from the rising edge of SCLK for a repeated START condition. */ -#define RESTART_SETUP_100K_TICKS 157 +#define RESTART_SETUP_100K_TICKS 156#define RESTART_SETUP_400K_TICKS 20#define RESTART_SETUP_1000K_TICKS 12
@@ -169,7 +169,7 @@* required to program 'DATA_HOLD' timer at X KHz. This timer determines the * SDAT hold time following SCLK driven low. */ -#define DATA_HOLD_100K_TICKS 2 +#define DATA_HOLD_100K_TICKS 12#define DATA_HOLD_400K_TICKS 2#define DATA_HOLD_1000K_TICKS 2
@@ -190,35 +190,35 @@* Bus Idle Minimum time = BUS_IDLE_MIN[7:0] x Baud_Clock_Period x * (BUS_IDLE_MIN_XK_TICKS[7] ? 4,1) */ -#define BUS_IDLE_MIN_100K_TICKS 167UL -#define BUS_IDLE_MIN_400K_TICKS 139UL -#define BUS_IDLE_MIN_1000K_TICKS 133UL +#define BUS_IDLE_MIN_100K_TICKS 36UL +#define BUS_IDLE_MIN_400K_TICKS 10UL +#define BUS_IDLE_MIN_1000K_TICKS 4UL/* * CTRL_CUM_TIME_OUT_XK_TICKS defines SMBus Controller Cumulative Time-Out. * SMBus Controller Cumulative Time-Out duration = * CTRL_CUM_TIME_OUT_XK_TICKS[7:0] x Baud_Clock_Period x 2048 */ -#define CTRL_CUM_TIME_OUT_100K_TICKS 159 -#define CTRL_CUM_TIME_OUT_400K_TICKS 159 -#define CTRL_CUM_TIME_OUT_1000K_TICKS 159 +#define CTRL_CUM_TIME_OUT_100K_TICKS 76 +#define CTRL_CUM_TIME_OUT_400K_TICKS 76 +#define CTRL_CUM_TIME_OUT_1000K_TICKS 76/* * TARGET_CUM_TIME_OUT_XK_TICKS defines SMBus Target Cumulative Time-Out duration. * SMBus Target Cumulative Time-Out duration = TARGET_CUM_TIME_OUT_XK_TICKS[7:0] x * Baud_Clock_Period x 4096 */ -#define TARGET_CUM_TIME_OUT_100K_TICKS 199 -#define TARGET_CUM_TIME_OUT_400K_TICKS 199 -#define TARGET_CUM_TIME_OUT_1000K_TICKS 199 +#define TARGET_CUM_TIME_OUT_100K_TICKS 95 +#define TARGET_CUM_TIME_OUT_400K_TICKS 95 +#define TARGET_CUM_TIME_OUT_1000K_TICKS 95/* * CLOCK_HIGH_TIME_OUT_XK defines Clock High time out period. * Clock High time out period = CLOCK_HIGH_TIME_OUT_XK[7:0] x Baud_Clock_Period x 8 */ -#define CLOCK_HIGH_TIME_OUT_100K_TICKS 204 -#define CLOCK_HIGH_TIME_OUT_400K_TICKS 204 -#define CLOCK_HIGH_TIME_OUT_1000K_TICKS 204 +#define CLOCK_HIGH_TIME_OUT_100K_TICKS 97 +#define CLOCK_HIGH_TIME_OUT_400K_TICKS 97 +#define CLOCK_HIGH_TIME_OUT_1000K_TICKS 97#define TO_SCALING_100K \ ((BUS_IDLE_MIN_100K_TICKS << 24) | (CTRL_CUM_TIME_OUT_100K_TICKS << 16) | \
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 121/134 powerpc/papr_scm: Update the NUMA distance table for the target node
In reply to Greg Kroah-HartmanFrom: Aneesh Kumar K.V <[email protected]>
[ Upstream commit b277fc793daf258877b4c0744b52f69d6e6ba22e ]
Platform device helper routines won't update the NUMA distance table while creating a platform device, even if the device is present on a NUMA node that doesn't have memory or CPU. This is especially true for pmem devices. If the target node of the pmem device is not online, we find the nearest online node to the device and associate the pmem device with that online node. To find the nearest online node, we should have the numa distance table updated correctly. Update the distance information during the device probe.
For a papr scm device on NUMA node 3 distance_lookup_table value for distance_ref_points_depth = 2 before and after fix is below:
Before fix:
node 3 distance depth 0 - 0 node 3 distance depth 1 - 0 node 4 distance depth 0 - 4 node 4 distance depth 1 - 2 node 5 distance depth 0 - 5 node 5 distance depth 1 - 1
After fix
node 3 distance depth 0 - 3 node 3 distance depth 1 - 1 node 4 distance depth 0 - 4 node 4 distance depth 1 - 2 node 5 distance depth 0 - 5 node 5 distance depth 1 - 1
Without the fix, the nearest numa node to the pmem device (NUMA node 3) will be picked as 4. After the fix, we get the correct numa node which is 5.
--- arch/powerpc/mm/numa.c | 1 + arch/powerpc/platforms/pseries/papr_scm.c | 7 +++++++ 2 files changed, 8 insertions(+)
arch/powerpc/mm/numa.c +1 -0
@@ -366,6 +366,7 @@ void update_numa_distance(struct device_node *node)WARN (numa_distance_table[nid][nid] ==-1 ,"NUMA distance details for node %d not provided\n" , nid); } +EXPORT_SYMBOL_GPL (update_numa_distance);/* * ibm,numa-lookup-index-table= {N, domainid1, domainid2, ..... domainidN}
arch/powerpc/platforms/pseries/papr_scm.c +7 -0
@@ -1428,6 +1428,13 @@ static int papr_scm_probe(struct platform_device *pdev)return -ENODEV ; } +/* +* open firmware platform device create won't update the NUMA +* distance table. For PAPR SCM devices we use numa_map_to_online_node() +* to find the nearest online NUMA node and that requires correct +* distance table information. +*/ +update_numa_distance (dn); p =kzalloc (sizeof (*p),GFP_KERNEL );if (!p)
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 122/134 sched/fair: Fix imbalance overflow
In reply to Greg Kroah-HartmanFrom: Vincent Guittot <[email protected]>
[ Upstream commit 91dcf1e8068e9a8823e419a7a34ff4341275fb70 ]
When local group is fully busy but its average load is above system load, computing the imbalance will overflow and local group is not the best target for pulling this load.
--- kernel/sched/fair.c | 10 ++++++++++ 1 file changed, 10 insertions(+)
kernel/sched/fair.c +10 -0
@@ -10041,6 +10041,16 @@ static inline void calculate_imbalance(struct lb_env *env, struct sd_lb_stats *s sds->avg_load = (sds->total_load *SCHED_CAPACITY_SCALE ) / sds->total_capacity; + +/* +* If the local group is more loaded than the average system +* load, don't try to pull any tasks. +*/ +if (local->avg_load >= sds->avg_load) { + env->imbalance =0 ; +return ; + } + }/*
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 123/134 x86/rtc: Remove __init for runtime functions
In reply to Greg Kroah-HartmanFrom: Matija Glavinic Pecotic <[email protected]>
[ Upstream commit 775d3c514c5b2763a50ab7839026d7561795924d ]
set_rtc_noop(), get_rtc_noop() are after booting, therefore their __init annotation is wrong.
A crash was observed on an x86 platform where CMOS RTC is unused and disabled via device tree. set_rtc_noop() was invoked from ntp:sync_hw_clock(), although CONFIG_RTC_SYSTOHC=n, however sync_cmos_clock() doesn't honour that.
Workqueue: events_power_efficient sync_hw_clock RIP: 0010:set_rtc_noop Call Trace: update_persistent_clock64 sync_hw_clock
Fix this by dropping the __init annotation from set/get_rtc_noop().
--- arch/x86/kernel/x86_init.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
arch/x86/kernel/x86_init.c +2 -2
@@ -33,8 +33,8 @@ static int __init iommu_init_noop(void) { return 0; }static void iommu_shutdown_noop (void ) { }bool __init bool_x86_init_noop (void ) {return false; }void x86_op_int_noop (int cpu) { } -static __init int set_rtc_noop (const struct timespec64 *now) {return -EINVAL ; } -static __init void get_rtc_noop (struct timespec64 *now) { } +static int set_rtc_noop (const struct timespec64 *now) {return -EINVAL ; } +static void get_rtc_noop (struct timespec64 *now) { }static __initconst const struct of_device_id of_cmos_match[] = { { .compatible ="motorola,mc146818" },
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 124/134 i2c: ocores: generate stop condition after timeout in polling mode
In reply to Greg Kroah-HartmanFrom: Gregor Herburger <[email protected]>
[ Upstream commit f8160d3b35fc94491bb0cb974dbda310ef96c0e2 ]
In polling mode, no stop condition is generated after a timeout. This causes SCL to remain low and thereby block the bus. If this happens during a transfer it can cause slaves to misinterpret the subsequent transfer and return wrong values.
To solve this, pass the ETIMEDOUT error up from ocores_process_polling() instead of setting STATE_ERROR directly. The caller is adjusted to call ocores_process_timeout() on error both in polling and in IRQ mode, which will set STATE_ERROR and generate a stop condition.
--- drivers/i2c/busses/i2c-ocores.c | 35 ++++++++++++++++++--------------- 1 file changed, 19 insertions(+), 16 deletions(-)
drivers/i2c/busses/i2c-ocores.c +19 -16
@@ -342,18 +342,18 @@ static int ocores_poll_wait(struct ocores_i2c *i2c)* ocores_isr(), we just add our polling code around it. * * It can run in atomic context +* +* Return: 0 on success, -ETIMEDOUT on timeout */ -static void ocores_process_polling (struct ocores_i2c *i2c) +static int ocores_process_polling (struct ocores_i2c *i2c) { -while (1 ) { -irqreturn_t ret; -int err; +irqreturn_t ret; +int err =0 ; +while (1 ) { err =ocores_poll_wait (i2c); -if (err) { - i2c->state =STATE_ERROR ; +if (err)break ;/* timeout */ - } ret =ocores_isr (-1 , i2c);if (ret ==IRQ_NONE )
@@ -364,13 +364,15 @@ static void ocores_process_polling(struct ocores_i2c *i2c)break ; } } + +return err; }static int ocores_xfer_core (struct ocores_i2c *i2c,struct i2c_msg *msgs,int num,bool polling) { -int ret; +int ret =0 ;u8 ctrl; ctrl =oc_getreg (i2c,OCI2C_CONTROL );
@@ -388,15 +390,16 @@ static int ocores_xfer_core(struct ocores_i2c *i2c,oc_setreg (i2c,OCI2C_CMD ,OCI2C_CMD_START );if (polling) { -ocores_process_polling (i2c); + ret =ocores_process_polling (i2c); }else { - ret =wait_event_timeout (i2c->wait, - (i2c->state ==STATE_ERROR ) || - (i2c->state ==STATE_DONE ),HZ ); -if (ret ==0 ) { -ocores_process_timeout (i2c); -return -ETIMEDOUT ; - } +if (wait_event_timeout (i2c->wait, + (i2c->state ==STATE_ERROR ) || + (i2c->state ==STATE_DONE ),HZ ) ==0 ) + ret = -ETIMEDOUT ; + } +if (ret) { +ocores_process_timeout (i2c); +return ret; }return (i2c->state ==STATE_DONE ) ? num : -EIO ;
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 125/134 cifs: fix negotiate context parsing
In reply to Greg Kroah-HartmanFrom: David Disseldorp <[email protected]>
[ Upstream commit 5105a7ffce19160e7062aee67fb6b3b8a1b56d78 ]
smb311_decode_neg_context() doesn't properly check against SMB packet boundaries prior to accessing individual negotiate context entries. This is due to the length check omitting the eight byte smb2_neg_context header, as well as incorrect decrementing of len_of_ctxts.
--- fs/cifs/smb2pdu.c | 41 +++++++++++++++++++++++++++++++---------- 1 file changed, 31 insertions(+), 10 deletions(-)
fs/cifs/smb2pdu.c +31 -10
@@ -588,11 +588,15 @@ assemble_neg_contexts(struct smb2_negotiate_req *req, } +/* If invalid preauth context warn but use what we requested, SHA-512 */ static void decode_preauth_context (struct smb2_preauth_neg_context *ctxt) {unsigned int len =le16_to_cpu (ctxt->DataLength); -/* If invalid preauth context warn but use what we requested, SHA-512 */ +/* +* Caller checked that DataLength remains within SMB boundary. We still +* need to confirm that one HashAlgorithms member is accounted for. +*/ if (len <MIN_PREAUTH_CTXT_DATA_LEN ) {pr_warn_once ("server sent bad preauth context\n" );return ;
@@ -611,7 +615,11 @@ static void decode_compress_ctx(struct TCP_Server_Info *server, {unsigned int len =le16_to_cpu (ctxt->DataLength); -/* sizeof compress context is a one element compression capbility struct */ +/* +* Caller checked that DataLength remains within SMB boundary. We still +* need to confirm that one CompressionAlgorithms member is accounted +* for. +*/ if (len <10 ) {pr_warn_once ("server sent bad compression cntxt\n" );return ;
@@ -633,6 +641,11 @@ static int decode_encrypt_ctx(struct TCP_Server_Info *server,unsigned int len =le16_to_cpu (ctxt->DataLength);cifs_dbg (FYI ,"decode SMB3.11 encryption neg context of len %d\n" , len); +/* +* Caller checked that DataLength remains within SMB boundary. We still +* need to confirm that one Cipher flexible array member is accounted +* for. +*/ if (len <MIN_ENCRYPT_CTXT_DATA_LEN ) {pr_warn_once ("server sent bad crypto ctxt len\n" );return -EINVAL ;
@@ -679,6 +692,11 @@ static void decode_signing_ctx(struct TCP_Server_Info *server, {unsigned int len =le16_to_cpu (pctxt->DataLength); +/* +* Caller checked that DataLength remains within SMB boundary. We still +* need to confirm that one SigningAlgorithms flexible array member is +* accounted for. +*/ if ((len <4 ) || (len >16 )) {pr_warn_once ("server sent bad signing negcontext\n" );return ;
@@ -720,14 +738,19 @@ static int smb311_decode_neg_context(struct smb2_negotiate_rsp *rsp,for (i =0 ; i < ctxt_cnt; i++) {int clen;/* check that offset is not beyond end of SMB */ -if (len_of_ctxts ==0 ) -break ; -if (len_of_ctxts <sizeof (struct smb2_neg_context ))break ; pctx = (struct smb2_neg_context *)(offset + (char *)rsp); - clen =le16_to_cpu (pctx->DataLength); + clen =sizeof (struct smb2_neg_context ) + +le16_to_cpu (pctx->DataLength); +/* +* 2.2.4 SMB2 NEGOTIATE Response +* Subsequent negotiate contexts MUST appear at the first 8-byte +* aligned offset following the previous negotiate context. +*/ +if (i +1 != ctxt_cnt) + clen =ALIGN (clen,8 );if (clen > len_of_ctxts)break ;
@@ -748,12 +771,10 @@ static int smb311_decode_neg_context(struct smb2_negotiate_rsp *rsp,else cifs_server_dbg (VFS ,"unknown negcontext of type %d ignored\n" ,le16_to_cpu (pctx->ContextType)); -if (rc)break ; -/* offsets must be 8 byte aligned */ - clen =ALIGN (clen,8 ); - offset += clen +sizeof (struct smb2_neg_context ); + + offset += clen; len_of_ctxts -= clen; }return rc;
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 126/134 RISC-V: add infrastructure to allow different str* implementations
In reply to Greg Kroah-HartmanFrom: Heiko Stuebner <[email protected]>
[ Upstream commit 56e0790c7f9e59ba6a0f4b59981d1d6fbf43efb0 ]
Depending on supported extensions on specific RISC-V cores, optimized str* functions might make sense.
This adds basic infrastructure to allow patching the function calls via alternatives later on.
The Linux kernel provides standard implementations for string functions but when architectures want to extend them, they need to provide their own.
The added generic string functions are done in assembler (taken from disassembling the main-kernel functions for now) to allow us to control the used registers and extend them with optimized variants.
This doesn't override the compiler's use of builtin replacements. So still first of all the compiler will select if a builtin will be better suitable i.e. for known strings. For all regular cases we will want to later select possible optimized variants and in the worst case fall back to the generic implemention added with this change.
Stable-dep-of: d83806c4c0cc ("purgatory: fix disabling debug info")
--- arch/riscv/include/asm/string.h | 10 ++++++++ arch/riscv/kernel/riscv_ksyms.c | 3 +++ arch/riscv/lib/Makefile | 3 +++ arch/riscv/lib/strcmp.S | 36 +++++++++++++++++++++++++++++ arch/riscv/lib/strlen.S | 28 ++++++++++++++++++++++ arch/riscv/lib/strncmp.S | 41 +++++++++++++++++++++++++++++++++ arch/riscv/purgatory/Makefile | 13 +++++++++++ 7 files changed, 134 insertions(+) create mode 100644 arch/riscv/lib/strcmp.S create mode 100644 arch/riscv/lib/strlen.S create mode 100644 arch/riscv/lib/strncmp.S
arch/riscv/include/asm/string.h +10 -0
@@ -18,6 +18,16 @@ extern asmlinkage void *__memcpy(void *, const void *, size_t);#define __HAVE_ARCH_MEMMOVE extern asmlinkage void *memmove(void *, const void *, size_t); extern asmlinkage void *__memmove(void *, const void *, size_t); + +#define __HAVE_ARCH_STRCMP +extern asmlinkage int strcmp(const char *cs, const char *ct); + +#define __HAVE_ARCH_STRLEN +extern asmlinkage __kernel_size_t strlen(const char *); + +#define __HAVE_ARCH_STRNCMP +extern asmlinkage int strncmp(const char *cs, const char *ct, size_t count); +/* For those files which don't want to check by kasan. */ #if defined(CONFIG_KASAN ) && !defined(__SANITIZE_ADDRESS__)#define memcpy (dst, src, len) __memcpy(dst, src, len)
arch/riscv/kernel/riscv_ksyms.c +3 -0
@@ -12,6 +12,9 @@EXPORT_SYMBOL (memset);EXPORT_SYMBOL (memcpy);EXPORT_SYMBOL (memmove); +EXPORT_SYMBOL (strcmp); +EXPORT_SYMBOL (strlen); +EXPORT_SYMBOL (strncmp);EXPORT_SYMBOL (__memset);EXPORT_SYMBOL (__memcpy);EXPORT_SYMBOL (__memmove);
arch/riscv/lib/Makefile +3 -0
@@ -3,6 +3,9 @@ lib-y += delay.o lib-y += memcpy.o lib-y += memset.o lib-y += memmove.o +lib-y += strcmp.o +lib-y += strlen.o +lib-y += strncmp.o lib-$(CONFIG_MMU) += uaccess.o lib-$(CONFIG_64BIT) += tishift.o
arch/riscv/lib/strcmp.S new file +36 -0
@@ -0,0 +1,36 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ + +#include <linux/linkage.h> +#include <asm/asm.h> +#include <asm-generic/export.h> + +/* int strcmp(const char *cs, const char *ct) */ +SYM_FUNC_START(strcmp) + /* + * Returns + * a0 - comparison result, value like strcmp + * + * Parameters + * a0 - string1 + * a1 - string2 + * + * Clobbers + * t0, t1 + */ +1: + lbu t0, 0(a0) + lbu t1, 0(a1) + addi a0, a0, 1 + addi a1, a1, 1 + bne t0, t1, 2f + bnez t0, 1b + li a0, 0 + ret +2: + /* + * strcmp only needs to return (< 0, 0, > 0) values + * not necessarily -1, 0, +1 + */ + sub a0, t0, t1 + ret +SYM_FUNC_END(strcmp)
arch/riscv/lib/strlen.S new file +28 -0
@@ -0,0 +1,28 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ + +#include <linux/linkage.h> +#include <asm/asm.h> +#include <asm-generic/export.h> + +/* int strlen(const char *s) */ +SYM_FUNC_START(strlen) + /* + * Returns + * a0 - string length + * + * Parameters + * a0 - String to measure + * + * Clobbers: + * t0, t1 + */ + mv t1, a0 +1: + lbu t0, 0(t1) + beqz t0, 2f + addi t1, t1, 1 + j 1b +2: + sub a0, t1, a0 + ret +SYM_FUNC_END(strlen)
arch/riscv/lib/strncmp.S new file +41 -0
41 lines not on this page · raw message
arch/riscv/purgatory/Makefile +13 -0
@@ -2,6 +2,7 @@ OBJECT_FILES_NON_STANDARD := y purgatory-y := purgatory.o sha256.o entry.o string.o ctype.o memcpy.o memset.o +purgatory-y += strcmp.o strlen.o strncmp.o targets += $(purgatory-y) PURGATORY_OBJS = $(addprefix $(obj)/,$(purgatory-y))
@@ -18,6 +19,15 @@ $(obj)/memcpy.o: $(srctree)/arch/riscv/lib/memcpy.S FORCE $(obj)/memset.o: $(srctree)/arch/riscv/lib/memset.S FORCE $(call if_changed_rule,as_o_S) +$(obj)/strcmp.o: $(srctree)/arch/riscv/lib/strcmp.S FORCE + $(call if_changed_rule,as_o_S) + +$(obj)/strlen.o: $(srctree)/arch/riscv/lib/strlen.S FORCE + $(call if_changed_rule,as_o_S) + +$(obj)/strncmp.o: $(srctree)/arch/riscv/lib/strncmp.S FORCE + $(call if_changed_rule,as_o_S) + $(obj)/sha256.o: $(srctree)/lib/crypto/sha256.c FORCE $(call if_changed_rule,cc_o_c)
@@ -77,6 +87,9 @@ CFLAGS_ctype.o += $(PURGATORY_CFLAGS) AFLAGS_REMOVE_entry.o += -Wa,-gdwarf-2 AFLAGS_REMOVE_memcpy.o += -Wa,-gdwarf-2 AFLAGS_REMOVE_memset.o += -Wa,-gdwarf-2 +AFLAGS_REMOVE_strcmp.o += -Wa,-gdwarf-2 +AFLAGS_REMOVE_strlen.o += -Wa,-gdwarf-2 +AFLAGS_REMOVE_strncmp.o += -Wa,-gdwarf-2 $(obj)/purgatory.ro: $(PURGATORY_OBJS) FORCE $(call if_changed,ld)
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 109/134 scsi: ses: Handle enclosure with just a primary component gracefully
In reply to Greg Kroah-HartmanFrom: Jiri Kosina <[email protected]>
commit c8e22b7a1694bb8d025ea636816472739d859145 upstream.
This reverts commit 3fe97ff3d949 ("scsi: ses: Don't attach if enclosure has no components") and introduces proper handling of case where there are no detected secondary components, but primary component (enumerated in num_enclosures) does exist. That fix was originally proposed by Ding Hui <[email protected]>.
Completely ignoring devices that have one primary enclosure and no secondary one results in ses_intf_add() bailing completely
scsi 2:0:0:254: enclosure has no enumerated components
scsi 2:0:0:254: Failed to bind enclosure -12ven in valid configurations such
even on valid configurations with 1 primary and 0 secondary enclosures as below:
# sg_ses /dev/sg0 3PARdata SES 3321 Supported diagnostic pages: Supported Diagnostic Pages [sdp] [0x0] Configuration (SES) [cf] [0x1] Short Enclosure Status (SES) [ses] [0x8] # sg_ses -p cf /dev/sg0 3PARdata SES 3321 Configuration diagnostic page: number of secondary subenclosures: 0 generation code: 0x0 enclosure descriptor list Subenclosure identifier: 0 [primary] relative ES process id: 0, number of ES processes: 1 number of type descriptor headers: 1 enclosure logical identifier (hex): 20000002ac02068d enclosure vendor: 3PARdata product: VV rev: 3321 type descriptor header and text list Element type: Unspecified, subenclosure id: 0 number of possible elements: 1
The changelog for the original fix follows
=====
We can get a crash when disconnecting the iSCSI session, the call trace like this:
[ffff00002a00fb70] kfree at ffff00000830e224 [ffff00002a00fba0] ses_intf_remove at ffff000001f200e4 [ffff00002a00fbd0] device_del at ffff0000086b6a98 [ffff00002a00fc50] device_unregister at ffff0000086b6d58 [ffff00002a00fc70] __scsi_remove_device at ffff00000870608c [ffff00002a00fca0] scsi_remove_device at ffff000008706134 [ffff00002a00fcc0] __scsi_remove_target at ffff0000087062e4 [ffff00002a00fd10] scsi_remove_target at ffff0000087064c0 [ffff00002a00fd70] __iscsi_unbind_session at ffff000001c872c4 [ffff00002a00fdb0] process_one_work at ffff00000810f35c [ffff00002a00fe00] worker_thread at ffff00000810f648 [ffff00002a00fe70] kthread at ffff000008116e98
In ses_intf_add, components count could be 0, and kcalloc 0 size scomp, but not saved in edev->component[i].scratch
In this situation, edev->component[0].scratch is an invalid pointer, when kfree it in ses_intf_remove_enclosure, a crash like above would happen The call trace also could be other random cases when kfree cannot catch the invalid pointer
We should not use edev->component[] array when the components count is 0 We also need check index when use edev->component[] array in ses_enclosure_data_process
=====
--- drivers/scsi/ses.c | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-)
drivers/scsi/ses.c +8 -12
@@ -503,9 +503,6 @@ static int ses_enclosure_find_by_addr(stint i;struct ses_component *scomp; -if (!edev->component[0 ].scratch) -return 0 ; -for (i =0 ; i < edev->components; i++) { scomp = edev->component[i].scratch;if (scomp->addr != efd->addr)
@@ -596,8 +593,10 @@ static void ses_enclosure_data_process(s components++, type_ptr[0 ], name); - else + else if (components < edev->components) ecomp = &edev->component[components++]; + else + ecomp =ERR_PTR (-EINVAL );if (!IS_ERR (ecomp)) {if (addl_desc_ptr) {
@@ -728,11 +727,6 @@ static int ses_intf_add(struct device *c components += type_ptr[1 ]; } -if (components ==0 ) { -sdev_printk (KERN_WARNING , sdev,"enclosure has no enumerated components\n" ); - goto err_free; - } - ses_dev->page1 = buf; ses_dev->page1_len = len; buf =NULL ;
@@ -774,9 +768,11 @@ static int ses_intf_add(struct device *c buf =NULL ; } page2_not_supported: - scomp =kcalloc (components,sizeof (struct ses_component ),GFP_KERNEL ); -if (!scomp) - goto err_free; +if (components >0 ) { + scomp =kcalloc (components,sizeof (struct ses_component ),GFP_KERNEL ); +if (!scomp) + goto err_free; + } edev =enclosure_register (cdev->parent,dev_name (&sdev->sdev_gendev), components, &ses_enclosure_callbacks);
Greg Kroah-Hartman
maintainerPATCH 127/134 purgatory: fix disabling debug info
In reply to Greg Kroah-HartmanFrom: Alyssa Ross <[email protected]>
[ Upstream commit d83806c4c0cccc0d6d3c3581a11983a9c186a138 ]
Since 32ef9e5054ec, -Wa,-gdwarf-2 is no longer used in KBUILD_AFLAGS. Instead, it includes -g, the appropriate -gdwarf-* flag, and also the -Wa versions of both of those if building with Clang and GNU as. As a result, debug info was being generated for the purgatory objects, even though the intention was that it not be.
--- arch/riscv/purgatory/Makefile | 7 +------ arch/x86/purgatory/Makefile | 3 +-- 2 files changed, 2 insertions(+), 8 deletions(-)
arch/riscv/purgatory/Makefile +1 -6
@@ -84,12 +84,7 @@ CFLAGS_string.o += $(PURGATORY_CFLAGS) CFLAGS_REMOVE_ctype.o += $(PURGATORY_CFLAGS_REMOVE) CFLAGS_ctype.o += $(PURGATORY_CFLAGS) -AFLAGS_REMOVE_entry.o += -Wa,-gdwarf-2 -AFLAGS_REMOVE_memcpy.o += -Wa,-gdwarf-2 -AFLAGS_REMOVE_memset.o += -Wa,-gdwarf-2 -AFLAGS_REMOVE_strcmp.o += -Wa,-gdwarf-2 -AFLAGS_REMOVE_strlen.o += -Wa,-gdwarf-2 -AFLAGS_REMOVE_strncmp.o += -Wa,-gdwarf-2 +asflags-remove-y += $(foreach x, -g -gdwarf-4 -gdwarf-5, $(x) -Wa,$(x)) $(obj)/purgatory.ro: $(PURGATORY_OBJS) FORCE $(call if_changed,ld)
arch/x86/purgatory/Makefile +1 -2
@@ -69,8 +69,7 @@ CFLAGS_sha256.o += $(PURGATORY_CFLAGS) CFLAGS_REMOVE_string.o += $(PURGATORY_CFLAGS_REMOVE) CFLAGS_string.o += $(PURGATORY_CFLAGS) -AFLAGS_REMOVE_setup-x86_$(BITS).o += -Wa,-gdwarf-2 -AFLAGS_REMOVE_entry64.o += -Wa,-gdwarf-2 +asflags-remove-y += $(foreach x, -g -gdwarf-4 -gdwarf-5, $(x) -Wa,$(x)) $(obj)/purgatory.ro: $(PURGATORY_OBJS) FORCE $(call if_changed,ld)
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 128/134 Documentation: riscv: Document the sv57 VM layout
In reply to Greg Kroah-HartmanFrom: Björn Töpel <[email protected]>
[ Upstream commit dd3553793a759e4f7f21c1aaffd5cb2de7a0068d ]
RISC-V has been supporting the "sv57" address translation mode for a while, but is has not been added to the VM layout documentation. Let us fix that.
Stable-dep-of: ef69d2559fe9 ("riscv: Move early dtb mapping into the fixmap region")
--- Documentation/riscv/vm-layout.rst | 36 +++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+)
Documentation/riscv/vm-layout.rst +36 -0
@@ -97,3 +97,39 @@ RISC-V Linux Kernel SV48 ffffffff00000000 | -4 GB | ffffffff7fffffff | 2 GB | modules, BPF ffffffff80000000 | -2 GB | ffffffffffffffff | 2 GB | kernel __________________|____________|__________________|_________|____________________________________________________________ + + +RISC-V Linux Kernel SV57 +------------------------ + +:: + + ======================================================================================================================== + Start addr | Offset | End addr | Size | VM area description + ======================================================================================================================== + | | | | + 0000000000000000 | 0 | 00ffffffffffffff | 64 PB | user-space virtual memory, different per mm + __________________|____________|__________________|_________|___________________________________________________________ + | | | | + 0100000000000000 | +64 PB | feffffffffffffff | ~16K PB | ... huge, almost 64 bits wide hole of non-canonical + | | | | virtual memory addresses up to the -64 PB + | | | | starting offset of kernel mappings. + __________________|____________|__________________|_________|___________________________________________________________ + | + | Kernel-space virtual memory, shared between all processes: + ____________________________________________________________|___________________________________________________________ + | | | | + ff1bfffffee00000 | -57 PB | ff1bfffffeffffff | 2 MB | fixmap + ff1bffffff000000 | -57 PB | ff1bffffffffffff | 16 MB | PCI io + ff1c000000000000 | -57 PB | ff1fffffffffffff | 1 PB | vmemmap + ff20000000000000 | -56 PB | ff5fffffffffffff | 16 PB | vmalloc/ioremap space + ff60000000000000 | -40 PB | ffdeffffffffffff | 32 PB | direct mapping of all physical memory + ffdf000000000000 | -8 PB | fffffffeffffffff | 8 PB | kasan + __________________|____________|__________________|_________|____________________________________________________________ + | + | Identical layout to the 39-bit one from here on: + ____________________________________________________________|____________________________________________________________ + | | | | + ffffffff00000000 | -4 GB | ffffffff7fffffff | 2 GB | modules, BPF + ffffffff80000000 | -2 GB | ffffffffffffffff | 2 GB | kernel + __________________|____________|__________________|_________|____________________________________________________________
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 129/134 riscv: Move early dtb mapping into the fixmap region
In reply to Greg Kroah-HartmanFrom: Alexandre Ghiti <[email protected]>
[ Upstream commit ef69d2559fe91f23d27a3d6fd640b5641787d22e ]
riscv establishes 2 virtual mappings:
- early_pg_dir maps the kernel which allows to discover the system memory
- swapper_pg_dir installs the final mapping (linear mapping included)
We used to map the dtb in early_pg_dir using DTB_EARLY_BASE_VA, and this mapping was not carried over in swapper_pg_dir. It happens that early_init_fdt_scan_reserved_mem() must be called before swapper_pg_dir is setup otherwise we could allocate reserved memory defined in the dtb. And this function initializes reserved_mem variable with addresses that lie in the early_pg_dir dtb mapping: when those addresses are reused with swapper_pg_dir, this mapping does not exist and then we trap.
The previous "fix" was incorrect as early_init_fdt_scan_reserved_mem() must be called before swapper_pg_dir is set up otherwise we could allocate in reserved memory defined in the dtb.
So move the dtb mapping in the fixmap region which is established in early_pg_dir and handed over to swapper_pg_dir.
--- Documentation/riscv/vm-layout.rst | 6 +-- arch/riscv/include/asm/fixmap.h | 8 ++++ arch/riscv/include/asm/pgtable.h | 8 +++- arch/riscv/kernel/setup.c | 1 - arch/riscv/mm/init.c | 61 +++++++++++++++++-------------- 5 files changed, 51 insertions(+), 33 deletions(-)
Documentation/riscv/vm-layout.rst +3 -3
@@ -47,7 +47,7 @@ RISC-V Linux Kernel SV39 | Kernel-space virtual memory, shared between all processes: ____________________________________________________________|___________________________________________________________ | | | | - ffffffc6fee00000 | -228 GB | ffffffc6feffffff | 2 MB | fixmap + ffffffc6fea00000 | -228 GB | ffffffc6feffffff | 6 MB | fixmap ffffffc6ff000000 | -228 GB | ffffffc6ffffffff | 16 MB | PCI io ffffffc700000000 | -228 GB | ffffffc7ffffffff | 4 GB | vmemmap ffffffc800000000 | -224 GB | ffffffd7ffffffff | 64 GB | vmalloc/ioremap space
@@ -83,7 +83,7 @@ RISC-V Linux Kernel SV48 | Kernel-space virtual memory, shared between all processes: ____________________________________________________________|___________________________________________________________ | | | | - ffff8d7ffee00000 | -114.5 TB | ffff8d7ffeffffff | 2 MB | fixmap + ffff8d7ffea00000 | -114.5 TB | ffff8d7ffeffffff | 6 MB | fixmap ffff8d7fff000000 | -114.5 TB | ffff8d7fffffffff | 16 MB | PCI io ffff8d8000000000 | -114.5 TB | ffff8f7fffffffff | 2 TB | vmemmap ffff8f8000000000 | -112.5 TB | ffffaf7fffffffff | 32 TB | vmalloc/ioremap space
@@ -119,7 +119,7 @@ RISC-V Linux Kernel SV57 | Kernel-space virtual memory, shared between all processes: ____________________________________________________________|___________________________________________________________ | | | | - ff1bfffffee00000 | -57 PB | ff1bfffffeffffff | 2 MB | fixmap + ff1bfffffea00000 | -57 PB | ff1bfffffeffffff | 6 MB | fixmap ff1bffffff000000 | -57 PB | ff1bffffffffffff | 16 MB | PCI io ff1c000000000000 | -57 PB | ff1fffffffffffff | 1 PB | vmemmap ff20000000000000 | -56 PB | ff5fffffffffffff | 16 PB | vmalloc/ioremap space
arch/riscv/include/asm/fixmap.h +8 -0
@@ -22,6 +22,14 @@*/ enum fixed_addresses {FIX_HOLE , +/* +* The fdt fixmap mapping must be PMD aligned and will be mapped +* using PMD entries in fixmap_pmd in 64-bit and a PGD entry in 32-bit. +*/ +FIX_FDT_END , +FIX_FDT =FIX_FDT_END +FIX_FDT_SIZE /PAGE_SIZE -1 , + +/* Below fixmaps will be mapped using fixmap_pte */ FIX_PTE ,FIX_PMD ,FIX_PUD ,
arch/riscv/include/asm/pgtable.h +6 -2
@@ -87,9 +87,13 @@#define FIXADDR_TOP PCI_IO_START#ifdef CONFIG_64BIT -#define FIXADDR_SIZE PMD_SIZE +#define MAX_FDT_SIZE PMD_SIZE +#define FIX_FDT_SIZE (MAX_FDT_SIZE + SZ_2M) +#define FIXADDR_SIZE (PMD_SIZE + FIX_FDT_SIZE)#else -#define FIXADDR_SIZE PGDIR_SIZE +#define MAX_FDT_SIZE PGDIR_SIZE +#define FIX_FDT_SIZE MAX_FDT_SIZE +#define FIXADDR_SIZE (PGDIR_SIZE + FIX_FDT_SIZE)#endif #define FIXADDR_START (FIXADDR_TOP - FIXADDR_SIZE)
arch/riscv/kernel/setup.c +0 -1
@@ -280,7 +280,6 @@ void __init setup_arch(char **cmdline_p)#else unflatten_device_tree ();#endif -early_init_fdt_scan_reserved_mem ();misc_mem_init ();init_resources ();
arch/riscv/mm/init.c +34 -27
117 lines not on this page · raw message
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 130/134 nvme-pci: mark Lexar NM760 as IGNORE_DEV_SUBNQN
In reply to Greg Kroah-HartmanFrom: Juraj Pecigos <[email protected]>
[ Upstream commit 1231363aec86704a6b0467a12e3ca7bdf890e01d ]
A system with more than one of these SSDs will only have one usable. The kernel fails to detect more than one nvme device due to duplicate cntlids.
before:
[ 9.395229] nvme 0000:01:00.0: platform quirk: setting simple suspend [ 9.395262] nvme nvme0: pci function 0000:01:00.0 [ 9.395282] nvme 0000:03:00.0: platform quirk: setting simple suspend [ 9.395305] nvme nvme1: pci function 0000:03:00.0 [ 9.409873] nvme nvme0: Duplicate cntlid 1 with nvme1, subsys nqn.2022-07.com.siliconmotion:nvm-subsystem-sn- , rejecting [ 9.409982] nvme nvme0: Removing after probe failure status: -22 [ 9.427487] nvme nvme1: allocated 64 MiB host memory buffer. [ 9.445088] nvme nvme1: 16/0/0 default/read/poll queues [ 9.449898] nvme nvme1: Ignoring bogus Namespace Identifiers
after:
[ 1.161890] nvme 0000:01:00.0: platform quirk: setting simple suspend [ 1.162660] nvme nvme0: pci function 0000:01:00.0 [ 1.162684] nvme 0000:03:00.0: platform quirk: setting simple suspend [ 1.162707] nvme nvme1: pci function 0000:03:00.0 [ 1.191354] nvme nvme0: allocated 64 MiB host memory buffer. [ 1.193378] nvme nvme1: allocated 64 MiB host memory buffer. [ 1.211044] nvme nvme1: 16/0/0 default/read/poll queues [ 1.211080] nvme nvme0: 16/0/0 default/read/poll queues [ 1.216145] nvme nvme0: Ignoring bogus Namespace Identifiers [ 1.216261] nvme nvme1: Ignoring bogus Namespace Identifiers
Adding the NVME_QUIRK_IGNORE_DEV_SUBNQN quirk to resolves the issue.
Stable-dep-of: 74391b3e6985 ("nvme-pci: add NVME_QUIRK_BOGUS_NID for T-FORCE Z330 SSD")
--- drivers/nvme/host/pci.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/nvme/host/pci.c +2 -1
@@ -3550,7 +3550,8 @@ static const struct pci_device_id nvme_id_table[] = { { PCI_DEVICE(0x1d97, 0x1d97), /* Lexar NM620 */ .driver_data = NVME_QUIRK_BOGUS_NID, }, { PCI_DEVICE(0x1d97, 0x2269), /* Lexar NM760 */ - .driver_data = NVME_QUIRK_BOGUS_NID, }, + .driver_data = NVME_QUIRK_BOGUS_NID | + NVME_QUIRK_IGNORE_DEV_SUBNQN, }, { PCI_DEVICE(PCI_VENDOR_ID_AMAZON, 0x0061), .driver_data = NVME_QUIRK_DMA_ADDRESS_BITS_48, }, { PCI_DEVICE(PCI_VENDOR_ID_AMAZON, 0x0065),
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 131/134 nvme-pci: add NVME_QUIRK_BOGUS_NID for T-FORCE Z330 SSD
In reply to Greg Kroah-HartmanFrom: Duy Truong <[email protected]>
[ Upstream commit 74391b3e69855e7dd65a9cef36baf5fc1345affd ]
Added a quirk to fix the TeamGroup T-Force Cardea Zero Z330 SSDs reporting duplicate NGUIDs.
--- drivers/nvme/host/pci.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/nvme/host/pci.c +2 -0
@@ -3552,6 +3552,8 @@ static const struct pci_device_id nvme_id_table[] = { { PCI_DEVICE(0x1d97, 0x2269), /* Lexar NM760 */ .driver_data =NVME_QUIRK_BOGUS_NID | NVME_QUIRK_IGNORE_DEV_SUBNQN, }, + { PCI_DEVICE(0x10ec, 0x5763), /* TEAMGROUP T-FORCE CARDEA ZERO Z330 SSD */ + .driver_data = NVME_QUIRK_BOGUS_NID, }, { PCI_DEVICE(PCI_VENDOR_ID_AMAZON, 0x0061), .driver_data = NVME_QUIRK_DMA_ADDRESS_BITS_48, }, { PCI_DEVICE(PCI_VENDOR_ID_AMAZON, 0x0065),
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 132/134 cgroup/cpuset: Skip spread flags update on v2
In reply to Greg Kroah-HartmanFrom: Waiman Long <[email protected]>
[ Upstream commit 18f9a4d47527772515ad6cbdac796422566e6440 ]
Cpuset v2 has no spread flags to set. So we can skip spread flags update if cpuset v2 is being used. Also change the name to cpuset_update_task_spread_flags() to indicate that there are multiple spread flags.
Stable-dep-of: 42a11bf5c543 ("cgroup/cpuset: Make cpuset_fork() handle CLONE_INTO_CGROUP properly")
--- kernel/cgroup/cpuset.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-)
kernel/cgroup/cpuset.c +8 -4
@@ -550,11 +550,15 @@ static void guarantee_online_mems(struct cpuset *cs, nodemask_t *pmask)/* * update task's spread flag if cpuset's page/slab spread flag is set * -* Call with callback_lock or cpuset_rwsem held. +* Call with callback_lock or cpuset_rwsem held. The check can be skipped +* if on default hierarchy. */ -static void cpuset_update_task_spread_flag (struct cpuset *cs, +static void cpuset_update_task_spread_flags (struct cpuset *cs,struct task_struct *tsk) { +if (cgroup_subsys_on_dfl (cpuset_cgrp_subsys)) +return ; +if (is_spread_page (cs))task_set_spread_page (tsk);else
@@ -2165,7 +2169,7 @@ static void update_tasks_flags(struct cpuset *cs)css_task_iter_start (&cs->css,0 , &it);while ((task =css_task_iter_next (&it))) -cpuset_update_task_spread_flag (cs, task); +cpuset_update_task_spread_flags (cs, task);css_task_iter_end (&it); }
@@ -2547,7 +2551,7 @@ static void cpuset_attach(struct cgroup_taskset *tset)WARN_ON_ONCE (set_cpus_allowed_ptr (task, cpus_attach));cpuset_change_task_nodemask (task, &cpuset_attach_nodemask_to); -cpuset_update_task_spread_flag (cs, task); +cpuset_update_task_spread_flags (cs, task); }/*
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 133/134 cgroup/cpuset: Make cpuset_fork() handle CLONE_INTO_CGROUP properly
In reply to Greg Kroah-HartmanFrom: Waiman Long <[email protected]>
[ Upstream commit 42a11bf5c5436e91b040aeb04063be1710bb9f9c ]
By default, the clone(2) syscall spawn a child process into the same cgroup as its parent. With the use of the CLONE_INTO_CGROUP flag introduced by commit ef2c41cf38a7 ("clone3: allow spawning processes into cgroups"), the child will be spawned into a different cgroup which is somewhat similar to writing the child's tid into "cgroup.threads".
The current cpuset_fork() method does not properly handle the CLONE_INTO_CGROUP case where the cpuset of the child may be different from that of its parent. Update the cpuset_fork() method to treat the CLONE_INTO_CGROUP case similar to cpuset_attach().
Since the newly cloned task has not been running yet, its actual memory usage isn't known. So it is not necessary to make change to mm in cpuset_fork().
--- kernel/cgroup/cpuset.c | 62 ++++++++++++++++++++++++++++-------------- 1 file changed, 42 insertions(+), 20 deletions(-)
kernel/cgroup/cpuset.c +42 -20
@@ -2515,16 +2515,33 @@ static void cpuset_cancel_attach(struct cgroup_taskset *tset) }/* -* Protected by cpuset_rwsem. cpus_attach is used only by cpuset_attach() +* Protected by cpuset_rwsem. cpus_attach is used only by cpuset_attach_task() * but we can't allocate it dynamically there. Define it global and * allocate from cpuset_init(). */ static cpumask_var_t cpus_attach; +static nodemask_t cpuset_attach_nodemask_to; + +static void cpuset_attach_task (struct cpuset *cs,struct task_struct *task) +{ +percpu_rwsem_assert_held (&cpuset_rwsem); + +if (cs != &top_cpuset) +guarantee_online_cpus (task, cpus_attach); +else +cpumask_copy (cpus_attach,task_cpu_possible_mask (task)); +/* +* can_attach beforehand should guarantee that this doesn't +* fail. TODO: have a better way to handle failure here +*/ +WARN_ON_ONCE (set_cpus_allowed_ptr (task, cpus_attach)); + +cpuset_change_task_nodemask (task, &cpuset_attach_nodemask_to); +cpuset_update_task_spread_flags (cs, task); +}static void cpuset_attach (struct cgroup_taskset *tset) { -/* static buf protected by cpuset_rwsem */ -static nodemask_t cpuset_attach_nodemask_to;struct task_struct *task;struct task_struct *leader;struct cgroup_subsys_state *css;
@@ -2539,20 +2556,8 @@ static void cpuset_attach(struct cgroup_taskset *tset)guarantee_online_mems (cs, &cpuset_attach_nodemask_to); -cgroup_taskset_for_each (task, css, tset) { -if (cs != &top_cpuset) -guarantee_online_cpus (task, cpus_attach); -else -cpumask_copy (cpus_attach,task_cpu_possible_mask (task)); -/* -* can_attach beforehand should guarantee that this doesn't -* fail. TODO: have a better way to handle failure here -*/ -WARN_ON_ONCE (set_cpus_allowed_ptr (task, cpus_attach)); - -cpuset_change_task_nodemask (task, &cpuset_attach_nodemask_to); -cpuset_update_task_spread_flags (cs, task); - } +cgroup_taskset_for_each (task, css, tset) +cpuset_attach_task (cs, task);/* * Change mm for all threadgroup leaders. This is expensive and may
@@ -3240,11 +3245,28 @@ static void cpuset_bind(struct cgroup_subsys_state *root_css)*/ static void cpuset_fork (struct task_struct *task) { -if (task_css_is_root (task, cpuset_cgrp_id)) +struct cpuset *cs; +bool same_cs; + +rcu_read_lock (); + cs =task_cs (task); + same_cs = (cs ==task_cs (current)); +rcu_read_unlock (); + +if (same_cs) { +if (cs == &top_cpuset) +return ; + +set_cpus_allowed_ptr (task, current->cpus_ptr); + task->mems_allowed = current->mems_allowed;return ; + } -set_cpus_allowed_ptr (task, current->cpus_ptr); - task->mems_allowed = current->mems_allowed; +/* CLONE_INTO_CGROUP */ +percpu_down_write (&cpuset_rwsem); +guarantee_online_mems (cs, &cpuset_attach_nodemask_to); +cpuset_attach_task (cs, task); +percpu_up_write (&cpuset_rwsem); }struct cgroup_subsys cpuset_cgrp_subsys = {
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 134/134 cgroup/cpuset: Add cpuset_can_fork() and cpuset_cancel_fork() methods
In reply to Greg Kroah-HartmanFrom: Waiman Long <[email protected]>
[ Upstream commit eee87853794187f6adbe19533ed79c8b44b36a91 ]
In the case of CLONE_INTO_CGROUP, not all cpusets are ready to accept new tasks. It is too late to check that in cpuset_fork(). So we need to add the cpuset_can_fork() and cpuset_cancel_fork() methods to pre-check it before we can allow attachment to a different cpuset.
We also need to set the attach_in_progress flag to alert other code that a new task is going to be added to the cpuset.
--- kernel/cgroup/cpuset.c | 97 +++++++++++++++++++++++++++++++++++++----- 1 file changed, 86 insertions(+), 11 deletions(-)
kernel/cgroup/cpuset.c +86 -11
@@ -2453,6 +2453,20 @@ static int fmeter_getrate(struct fmeter *fmp)static struct cpuset *cpuset_attach_old_cs; +/* +* Check to see if a cpuset can accept a new task +* For v1, cpus_allowed and mems_allowed can't be empty. +* For v2, effective_cpus can't be empty. +* Note that in v1, effective_cpus = cpus_allowed. +*/ +static int cpuset_can_attach_check (struct cpuset *cs) +{ +if (cpumask_empty (cs->effective_cpus) || + (!is_in_v2_mode () &&nodes_empty (cs->mems_allowed))) +return -ENOSPC ; +return 0 ; +} +/* Called by cgroups to determine if a cpuset is usable; cpuset_rwsem held */ static int cpuset_can_attach (struct cgroup_taskset *tset) {
@@ -2467,16 +2481,9 @@ static int cpuset_can_attach(struct cgroup_taskset *tset)percpu_down_write (&cpuset_rwsem); -/* allow moving tasks into an empty cpuset if on default hierarchy */ - ret = -ENOSPC ; -if (!is_in_v2_mode () && - (cpumask_empty (cs->cpus_allowed) ||nodes_empty (cs->mems_allowed))) - goto out_unlock; - -/* -* Task cannot be moved to a cpuset with empty effective cpus. -*/ -if (cpumask_empty (cs->effective_cpus)) +/* Check to see if task is allowed in the cpuset */ + ret =cpuset_can_attach_check (cs); +if (ret) goto out_unlock;cgroup_taskset_for_each (task, css, tset) {
@@ -2493,7 +2500,6 @@ static int cpuset_can_attach(struct cgroup_taskset *tset)* changes which zero cpus/mems_allowed. */ cs->attach_in_progress++; - ret =0 ; out_unlock:percpu_up_write (&cpuset_rwsem);return ret;
@@ -3238,6 +3244,68 @@ static void cpuset_bind(struct cgroup_subsys_state *root_css)percpu_up_write (&cpuset_rwsem); } +/* +* In case the child is cloned into a cpuset different from its parent, +* additional checks are done to see if the move is allowed. +*/ +static int cpuset_can_fork (struct task_struct *task,struct css_set *cset) +{ +struct cpuset *cs =css_cs (cset->subsys[cpuset_cgrp_id]); +bool same_cs; +int ret; + +rcu_read_lock (); + same_cs = (cs ==task_cs (current)); +rcu_read_unlock (); + +if (same_cs) +return 0 ; + +lockdep_assert_held (&cgroup_mutex); +percpu_down_write (&cpuset_rwsem); + +/* Check to see if task is allowed in the cpuset */ + ret =cpuset_can_attach_check (cs); +if (ret) + goto out_unlock; + + ret =task_can_attach (task, cs->effective_cpus); +if (ret) + goto out_unlock; + + ret =security_task_setscheduler (task); +if (ret) + goto out_unlock; + +/* +* Mark attach is in progress. This makes validate_change() fail +* changes which zero cpus/mems_allowed. +*/ + cs->attach_in_progress++; +out_unlock: +percpu_up_write (&cpuset_rwsem); +return ret; +} + +static void cpuset_cancel_fork (struct task_struct *task,struct css_set *cset) +{ +struct cpuset *cs =css_cs (cset->subsys[cpuset_cgrp_id]); +bool same_cs; + +rcu_read_lock (); + same_cs = (cs ==task_cs (current)); +rcu_read_unlock (); + +if (same_cs) +return ; + +percpu_down_write (&cpuset_rwsem); + cs->attach_in_progress--; +if (!cs->attach_in_progress) +wake_up (&cpuset_attach_wq); +percpu_up_write (&cpuset_rwsem); +} +/* * Make sure the new task conform to the current state of its parent, * which could have been changed by cpuset just after it inherits the
@@ -3266,6 +3334,11 @@ static void cpuset_fork(struct task_struct *task)percpu_down_write (&cpuset_rwsem);guarantee_online_mems (cs, &cpuset_attach_nodemask_to);cpuset_attach_task (cs, task); + + cs->attach_in_progress--; +if (!cs->attach_in_progress) +wake_up (&cpuset_attach_wq); +percpu_up_write (&cpuset_rwsem); }
@@ -3279,6 +3352,8 @@ struct cgroup_subsys cpuset_cgrp_subsys = { .attach = cpuset_attach, .post_attach = cpuset_post_attach, .bind = cpuset_bind, + .can_fork = cpuset_can_fork, + .cancel_fork = cpuset_cancel_fork, .fork = cpuset_fork, .legacy_cftypes = legacy_files, .dfl_cftypes = dfl_files,
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 110/134 x86/PCI: Add quirk for AMD XHCI controller that loses MSI-X state in D3hot
In reply to Greg Kroah-HartmanFrom: Basavaraj Natikar <[email protected]>
commit f195fc1e9715ba826c3b62d58038f760f66a4fe9 upstream.
The AMD [1022:15b8] USB controller loses some internal functional MSI-X context when transitioning from D0 to D3hot. BIOS normally traps D0->D3hot and D3hot->D0 transitions so it can save and restore that internal context, but some firmware in the field can't do this because it fails to clear the AMD_15B8_RCC_DEV2_EPF0_STRAP2 NO_SOFT_RESET bit.
Clear AMD_15B8_RCC_DEV2_EPF0_STRAP2 NO_SOFT_RESET bit before USB controller initialization during boot.
--- arch/x86/pci/fixup.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+)
arch/x86/pci/fixup.c +21 -0
@@ -7,6 +7,7 @@#include <linux/dmi.h> #include <linux/pci.h> #include <linux/vgaarb.h> +#include <asm/amd_nb.h> #include <asm/hpet.h> #include <asm/pci_x86.h>
@@ -824,3 +825,23 @@ static void rs690_fix_64bit_dma(struct pDECLARE_PCI_FIXUP_FINAL (PCI_VENDOR_ID_ATI ,0x7910 , rs690_fix_64bit_dma);#endif + +#ifdef CONFIG_AMD_NB + +#define AMD_15B8_RCC_DEV2_EPF0_STRAP2 0x10136008 +#define AMD_15B8_RCC_DEV2_EPF0_STRAP2_NO_SOFT_RESET_DEV2_F0_MASK 0x00000080L + +static void quirk_clear_strap_no_soft_reset_dev2_f0 (struct pci_dev *dev) +{ +u32 data; + +if (!amd_smn_read (0 ,AMD_15B8_RCC_DEV2_EPF0_STRAP2 , &data)) { + data &= ~AMD_15B8_RCC_DEV2_EPF0_STRAP2_NO_SOFT_RESET_DEV2_F0_MASK ; +if (amd_smn_write (0 ,AMD_15B8_RCC_DEV2_EPF0_STRAP2 , data)) +pci_err (dev,"Failed to write data 0x%x\n" , data); + }else { +pci_err (dev,"Failed to read data\n" ); + } +} +DECLARE_PCI_FIXUP_FINAL (PCI_VENDOR_ID_AMD ,0x15b8 , quirk_clear_strap_no_soft_reset_dev2_f0); +#endif
Greg Kroah-Hartman
maintainerPATCH 111/134 cgroup: fix display of forceidle time at root
In reply to Greg Kroah-HartmanFrom: Josh Don <[email protected]>
commit fcdb1eda5302599045bb366e679cccb4216f3873 upstream.
We need to reset forceidle_sum to 0 when reading from root, since the bstat we accumulate into is stack allocated.
To make this more robust, just replace the existing cputime reset with a memset of the overall bstat.
--- kernel/cgroup/rstat.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
kernel/cgroup/rstat.c +1 -3
@@ -457,9 +457,7 @@ static void root_cgroup_cputime(struct cgroup_base_stat *bstat)struct task_cputime *cputime = &bstat->cputime;int i; - cputime->stime =0 ; - cputime->utime =0 ; - cputime->sum_exec_runtime =0 ; +memset (bstat,0 ,sizeof (*bstat));for_each_possible_cpu (i) {struct kernel_cpustat kcpustat;u64 *cpustat = kcpustat.cpustat;
Signature · 1 line
2.40.0
Greg Kroah-Hartman
maintainerPATCH 112/134 cgroup/cpuset: Fix partition roots cpuset.cpus update bug
In reply to Greg Kroah-HartmanFrom: Waiman Long <[email protected]>
commit 292fd843de26c551856e66faf134512c52dd78b4 upstream.
It was found that commit 7a2127e66a00 ("cpuset: Call set_cpus_allowed_ptr() with appropriate mask for task") introduced a bug that corrupted "cpuset.cpus" of a partition root when it was updated.
It is because the tmp->new_cpus field of the passed tmp parameter of update_parent_subparts_cpumask() should not be used at all as it contains important cpumask data that should not be overwritten. Fix it by using tmp->addmask instead.
Also update update_cpumask() to make sure that trialcs->cpu_allowed will not be corrupted until it is no longer needed.
--- kernel/cgroup/cpuset.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-)
kernel/cgroup/cpuset.c +10 -2
@@ -1509,7 +1509,7 @@ static int update_parent_subparts_cpumasspin_unlock_irq (&callback_lock);if (adding || deleting) -update_tasks_cpumask (parent, tmp->new_cpus); +update_tasks_cpumask (parent, tmp->addmask);/* * Set or clear CS_SCHED_LOAD_BALANCE when partcmd_update, if necessary.
@@ -1766,10 +1766,13 @@ static int update_cpumask(struct cpuset/* * Use the cpumasks in trialcs for tmpmasks when they are pointers * to allocated cpumasks. +* +* Note that update_parent_subparts_cpumask() uses only addmask & +* delmask, but not new_cpus. */ tmp.addmask = trialcs->subparts_cpus; tmp.delmask = trialcs->effective_cpus; - tmp.new_cpus = trialcs->cpus_allowed; + tmp.new_cpus =NULL ;#endif retval =validate_change (cs, trialcs);
@@ -1834,6 +1837,11 @@ static int update_cpumask(struct cpuset }spin_unlock_irq (&callback_lock); +#ifdef CONFIG_CPUMASK_OFFSTACK +/* Now trialcs->cpus_allowed is available */ + tmp.new_cpus = trialcs->cpus_allowed; +#endif +/* effective_cpus will be updated here */ update_cpumasks_hier (cs, &tmp, false);
Greg Kroah-Hartman
maintainerPATCH 113/134 cgroup/cpuset: Wake up cpuset_attach_wq tasks in cpuset_cancel_attach()
In reply to Greg Kroah-HartmanFrom: Waiman Long <[email protected]>
commit ba9182a89626d5f83c2ee4594f55cb9c1e60f0e2 upstream.
After a successful cpuset_can_attach() call which increments the attach_in_progress flag, either cpuset_cancel_attach() or cpuset_attach() will be called later. In cpuset_attach(), tasks in cpuset_attach_wq, if present, will be woken up at the end. That is not the case in cpuset_cancel_attach(). So missed wakeup is possible if the attach operation is somehow cancelled. Fix that by doing the wakeup in cpuset_cancel_attach() as well.
--- kernel/cgroup/cpuset.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
kernel/cgroup/cpuset.c +5 -1
@@ -2498,11 +2498,15 @@ out_unlock:static void cpuset_cancel_attach (struct cgroup_taskset *tset) {struct cgroup_subsys_state *css; +struct cpuset *cs;cgroup_taskset_first (tset, &css); + cs =css_cs (css);percpu_down_write (&cpuset_rwsem); -css_cs (css)->attach_in_progress--; + cs->attach_in_progress--; +if (!cs->attach_in_progress) +wake_up (&cpuset_attach_wq);percpu_up_write (&cpuset_rwsem); }
Greg Kroah-Hartman
maintainerPATCH 114/134 drm/amd/pm: correct SMU13.0.7 pstate profiling clock settings
In reply to Greg Kroah-HartmanFrom: Horatio Zhang <[email protected]>
commit f06b8887e3ef4f50098d3a949aef392c529c831a upstream.
Correct the pstate standard/peak profiling mode clock settings for SMU13.0.7.
--- drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_7_ppt.c | 22 ++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-)
drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_7_ppt.c +15 -7
@@ -1328,9 +1328,17 @@ static int smu_v13_0_7_populate_umd_stat &dpm_context->dpm_tables.fclk_table;struct smu_umd_pstate_table *pstate_table = &smu->pstate_table; +struct smu_table_context *table_context = &smu->smu_table; +PPTable_t *pptable = table_context->driver_pptable; +DriverReportedClocks_t driver_clocks = + pptable->SkuTable.DriverReportedClocks; pstate_table->gfxclk_pstate.min = gfx_table->min; - pstate_table->gfxclk_pstate.peak = gfx_table->max; +if (driver_clocks.GameClockAc && + (driver_clocks.GameClockAc < gfx_table->max)) + pstate_table->gfxclk_pstate.peak = driver_clocks.GameClockAc; +else + pstate_table->gfxclk_pstate.peak = gfx_table->max; pstate_table->uclk_pstate.min = mem_table->min; pstate_table->uclk_pstate.peak = mem_table->max;
@@ -1347,12 +1355,12 @@ static int smu_v13_0_7_populate_umd_stat pstate_table->fclk_pstate.min = fclk_table->min; pstate_table->fclk_pstate.peak = fclk_table->max; -/* -* For now, just use the mininum clock frequency. -* TODO: update them when the real pstate settings available -*/ - pstate_table->gfxclk_pstate.standard = gfx_table->min; - pstate_table->uclk_pstate.standard = mem_table->min; +if (driver_clocks.BaseClockAc && + driver_clocks.BaseClockAc < gfx_table->max) + pstate_table->gfxclk_pstate.standard = driver_clocks.BaseClockAc; +else + pstate_table->gfxclk_pstate.standard = gfx_table->max; + pstate_table->uclk_pstate.standard = mem_table->max; pstate_table->socclk_pstate.standard = soc_table->min; pstate_table->vclk_pstate.standard = vclk_table->min; pstate_table->dclk_pstate.standard = dclk_table->min;
Greg Kroah-Hartman
maintainerPATCH 115/134 drm/amd/pm: correct SMU13.0.7 max shader clock reporting
In reply to Greg Kroah-HartmanFrom: Horatio Zhang <[email protected]>
commit 85e0689eb6b10cd3b2fb455d1b3f4d4d0b13ff78 upstream.
Correct the max shader clock reporting on SMU 13.0.7.
--- drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_7_ppt.c | 61 ++++++++++++++++++- 1 file changed, 60 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_7_ppt.c +60 -1
@@ -575,6 +575,14 @@ static int smu_v13_0_7_set_default_dpm_t dpm_table);if (ret)return ret; + +if (skutable->DriverReportedClocks.GameClockAc && + (dpm_table->dpm_levels[dpm_table->count -1 ].value > + skutable->DriverReportedClocks.GameClockAc)) { + dpm_table->dpm_levels[dpm_table->count -1 ].value = + skutable->DriverReportedClocks.GameClockAc; + dpm_table->max = skutable->DriverReportedClocks.GameClockAc; + } }else { dpm_table->count =1 ; dpm_table->dpm_levels[0 ].value = smu->smu_table.boot_values.gfxclk /100 ;
@@ -828,6 +836,57 @@ static int smu_v13_0_7_get_smu_metrics_dreturn ret; } +static int smu_v13_0_7_get_dpm_ultimate_freq (struct smu_context *smu, +enum smu_clk_type clk_type, +uint32_t *min, +uint32_t *max) +{ +struct smu_13_0_dpm_context *dpm_context = + smu->smu_dpm.dpm_context; +struct smu_13_0_dpm_table *dpm_table; + +switch (clk_type) { +case SMU_MCLK : +case SMU_UCLK : +/* uclk dpm table */ + dpm_table = &dpm_context->dpm_tables.uclk_table; +break ; +case SMU_GFXCLK : +case SMU_SCLK : +/* gfxclk dpm table */ + dpm_table = &dpm_context->dpm_tables.gfx_table; +break ; +case SMU_SOCCLK : +/* socclk dpm table */ + dpm_table = &dpm_context->dpm_tables.soc_table; +break ; +case SMU_FCLK : +/* fclk dpm table */ + dpm_table = &dpm_context->dpm_tables.fclk_table; +break ; +case SMU_VCLK : +case SMU_VCLK1 : +/* vclk dpm table */ + dpm_table = &dpm_context->dpm_tables.vclk_table; +break ; +case SMU_DCLK : +case SMU_DCLK1 : +/* dclk dpm table */ + dpm_table = &dpm_context->dpm_tables.dclk_table; +break ; +default : +dev_err (smu->adev->dev,"Unsupported clock type!\n" ); +return -EINVAL ; + } + +if (min) + *min = dpm_table->min; +if (max) + *max = dpm_table->max; + +return 0 ; +} + static int smu_v13_0_7_read_sensor(struct smu_context *smu, enum amd_pp_sensors sensor, void *data,
@@ -1683,7 +1742,7 @@ static const struct pptable_funcs smu_v1 .dpm_set_jpeg_enable = smu_v13_0_set_jpeg_enable, .init_pptable_microcode = smu_v13_0_init_pptable_microcode, .populate_umd_state_clk = smu_v13_0_7_populate_umd_state_clk, - .get_dpm_ultimate_freq = smu_v13_0_get_dpm_ultimate_freq, + .get_dpm_ultimate_freq = smu_v13_0_7_get_dpm_ultimate_freq, .get_vbios_bootup_values = smu_v13_0_get_vbios_bootup_values, .read_sensor = smu_v13_0_7_read_sensor, .feature_is_enabled = smu_cmn_feature_is_enabled,
Greg Kroah-Hartman
maintainerPATCH 116/134 mptcp: use mptcp_schedule_work instead of open-coding it
In reply to Greg Kroah-HartmanFrom: Paolo Abeni <[email protected]>
commit a5cb752b125766524c921faab1a45cc96065b0a7 upstream.
Beyond reducing code duplication this also avoids scheduling the mptcp_worker on a closed socket on some edge scenarios.
The addressed issue is actually older than the blamed commit below, but this fix needs it as a pre-requisite.
--- net/mptcp/options.c | 5 ++--- net/mptcp/subflow.c | 18 ++++++------------ 2 files changed, 8 insertions(+), 15 deletions(-)
net/mptcp/options.c +2 -3
@@ -1183,9 +1183,8 @@ bool mptcp_incoming_options(struct sock*/ if (TCP_SKB_CB (skb)->seq ==TCP_SKB_CB (skb)->end_seq) {if (mp_opt.data_fin && mp_opt.data_len ==1 && -mptcp_update_rcv_data_fin (msk, mp_opt.data_seq, mp_opt.dsn64) && -schedule_work (&msk->work)) -sock_hold (subflow->conn); +mptcp_update_rcv_data_fin (msk, mp_opt.data_seq, mp_opt.dsn64)) +mptcp_schedule_work ((struct sock *)msk);return true; }
net/mptcp/subflow.c +6 -12
@@ -366,9 +366,8 @@ void mptcp_subflow_reset(struct sock *sstcp_send_active_reset (ssk,GFP_ATOMIC );tcp_done (ssk); -if (!test_and_set_bit (MPTCP_WORK_CLOSE_SUBFLOW , &mptcp_sk (sk)->flags) && -schedule_work (&mptcp_sk (sk)->work)) -return ;/* worker will put sk for us */ +if (!test_and_set_bit (MPTCP_WORK_CLOSE_SUBFLOW , &mptcp_sk (sk)->flags)) +mptcp_schedule_work (sk);sock_put (sk); }
@@ -1054,8 +1053,8 @@ static enum mapping_status get_mapping_sskb_ext_del (skb,SKB_EXT_MPTCP );return MAPPING_OK ; }else { -if (updated &&schedule_work (&msk->work)) -sock_hold ((struct sock *)msk); +if (updated) +mptcp_schedule_work ((struct sock *)msk);return MAPPING_DATA_FIN ; }
@@ -1158,17 +1157,12 @@ static void mptcp_subflow_discard_data(s/* sched mptcp worker to remove the subflow if no more data is pending */ static void subflow_sched_work_if_closed (struct mptcp_sock *msk,struct sock *ssk) { -struct sock *sk = (struct sock *)msk; -if (likely (ssk->sk_state !=TCP_CLOSE ))return ;if (skb_queue_empty (&ssk->sk_receive_queue) && - !test_and_set_bit (MPTCP_WORK_CLOSE_SUBFLOW , &msk->flags)) { -sock_hold (sk); -if (!schedule_work (&msk->work)) -sock_put (sk); - } + !test_and_set_bit (MPTCP_WORK_CLOSE_SUBFLOW , &msk->flags)) +mptcp_schedule_work ((struct sock *)msk); }static bool subflow_can_fallback (struct mptcp_subflow_context *subflow)
Greg Kroah-Hartman
maintainerPATCH 107/134 net: phy: nxp-c45-tja11xx: add remove callback
In reply to Greg Kroah-HartmanFrom: Radu Pirea (OSS) <[email protected]>
commit a4506722dc39ca840593f14e3faa4c9ba9408211 upstream.
Unregister PTP clock when the driver is removed.
Purge the RX and TX skb queues.
--- drivers/net/phy/nxp-c45-tja11xx.c | 12 ++++++++++++ 1 file changed, 12 insertions(+)
drivers/net/phy/nxp-c45-tja11xx.c +12 -0
@@ -1337,6 +1337,17 @@ no_ptp_support:return ret; } +static void nxp_c45_remove (struct phy_device *phydev) +{ +struct nxp_c45_phy *priv = phydev->priv; + +if (priv->ptp_clock) +ptp_clock_unregister (priv->ptp_clock); + +skb_queue_purge (&priv->tx_queue); +skb_queue_purge (&priv->rx_queue); +} +static struct phy_driver nxp_c45_driver[] = { {PHY_ID_MATCH_MODEL (PHY_ID_TJA_1103 ),
@@ -1359,6 +1370,7 @@ static struct phy_driver nxp_c45_driver[ .set_loopback = genphy_c45_loopback, .get_sqi = nxp_c45_get_sqi, .get_sqi_max = nxp_c45_get_sqi_max, + .remove = nxp_c45_remove, }, };
Re: [PATCH 6.1 129/134] riscv: Move early dtb mapping into the fixmap region
In reply to Greg Kroah-HartmanQuoted 3 lines · Greg Kroah-Hartman
From: Alexandre Ghiti <[email protected]>
[ Upstream commit
ef69d2559fe91f23d27a3d6fd640b5641787d22e]
Hey Greg,
Please check out <[email protected]> (I can't find a lore link for stable-commit@vger stuff)
as I am not sure whether it is okay to backport this in isolation.
Cheers,
Conor.
Quoted 258 lines
riscv establishes 2 virtual mappings:
-
early_pg_dirmaps the kernel which allows to discover the system memory
-swapper_pg_dirinstalls the final mapping (linear mapping included)We used to map the dtb in
early_pg_dirusingDTB_EARLY_BASE_VA, and this mapping was not carried over inswapper_pg_dir. It happens thatearly_init_fdt_scan_reserved_mem()must be called beforeswapper_pg_diris setup otherwise we could allocate reserved memory defined in the dtb. And this function initializesreserved_memvariable with addresses that lie in theearly_pg_dirdtb mapping: when those addresses are reused withswapper_pg_dir, this mapping does not exist and then we trap.The previous "fix" was incorrect as
early_init_fdt_scan_reserved_mem()must be called beforeswapper_pg_diris set up otherwise we could allocate in reserved memory defined in the dtb.So move the dtb mapping in the fixmap region which is established in
early_pg_dirand handed over toswapper_pg_dir.Fixes 922b0375fc93 ("riscv: Fix memblock reservation for device tree blob")Fixes 8f3a2b4a96dc ("RISC-V: Move DT mapping outof fixmap")Fixes 50e63dd8ed92 ("riscv: fix reserved memory setup")Reported-by Conor Dooley <[email protected]>Signed-off-by Alexandre Ghiti <[email protected]>Reviewed-by Conor Dooley <[email protected]>Tested-by Conor Dooley <[email protected]>Signed-off-by Palmer Dabbelt <[email protected]>Signed-off-by Sasha Levin <[email protected]>--- Documentation/riscv/vm-layout.rst | 6 +-- arch/riscv/include/asm/fixmap.h | 8 ++++ arch/riscv/include/asm/pgtable.h | 8 +++- arch/riscv/kernel/setup.c | 1 - arch/riscv/mm/init.c | 61 +++++++++++++++++-------------- 5 files changed, 51 insertions(+), 33 deletions(-)Documentation/riscv/vm-layout.rst +3
-3@@ -47,7 +47,7 @@ RISC-V Linux Kernel SV39 | Kernel-space virtual memory, shared between all processes: ____________________________________________________________|___________________________________________________________ | | | | - ffffffc6fee00000 | -228 GB | ffffffc6feffffff | 2 MB | fixmap + ffffffc6fea00000 | -228 GB | ffffffc6feffffff | 6 MB | fixmap ffffffc6ff000000 | -228 GB | ffffffc6ffffffff | 16 MB | PCI io ffffffc700000000 | -228 GB | ffffffc7ffffffff | 4 GB | vmemmap ffffffc800000000 | -224 GB | ffffffd7ffffffff | 64 GB | vmalloc/ioremap space@@ -83,7 +83,7 @@ RISC-V Linux Kernel SV48 | Kernel-space virtual memory, shared between all processes: ____________________________________________________________|___________________________________________________________ | | | | - ffff8d7ffee00000 | -114.5 TB | ffff8d7ffeffffff | 2 MB | fixmap + ffff8d7ffea00000 | -114.5 TB | ffff8d7ffeffffff | 6 MB | fixmap ffff8d7fff000000 | -114.5 TB | ffff8d7fffffffff | 16 MB | PCI io ffff8d8000000000 | -114.5 TB | ffff8f7fffffffff | 2 TB | vmemmap ffff8f8000000000 | -112.5 TB | ffffaf7fffffffff | 32 TB | vmalloc/ioremap space@@ -119,7 +119,7 @@ RISC-V Linux Kernel SV57 | Kernel-space virtual memory, shared between all processes: ____________________________________________________________|___________________________________________________________ | | | | - ff1bfffffee00000 | -57 PB | ff1bfffffeffffff | 2 MB | fixmap + ff1bfffffea00000 | -57 PB | ff1bfffffeffffff | 6 MB | fixmap ff1bffffff000000 | -57 PB | ff1bffffffffffff | 16 MB | PCI io ff1c000000000000 | -57 PB | ff1fffffffffffff | 1 PB | vmemmap ff20000000000000 | -56 PB | ff5fffffffffffff | 16 PB | vmalloc/ioremap spacearch/riscv/include/asm/fixmap.h +8
-0@@ -22,6 +22,14 @@*/ enum fixed_addresses {FIX_HOLE , +/* +* The fdt fixmap mapping must be PMD aligned and will be mapped +* using PMD entries in fixmap_pmd in 64-bit and a PGD entry in 32-bit. +*/ +FIX_FDT_END , +FIX_FDT =FIX_FDT_END +FIX_FDT_SIZE /PAGE_SIZE -1 , + +/* Below fixmaps will be mapped using fixmap_pte */ FIX_PTE ,FIX_PMD ,FIX_PUD ,arch/riscv/include/asm/pgtable.h +6
-2@@ -87,9 +87,13 @@#define FIXADDR_TOP PCI_IO_START#ifdef CONFIG_64BIT -#define FIXADDR_SIZE PMD_SIZE +#define MAX_FDT_SIZE PMD_SIZE +#define FIX_FDT_SIZE (MAX_FDT_SIZE + SZ_2M) +#define FIXADDR_SIZE (PMD_SIZE + FIX_FDT_SIZE)#else -#define FIXADDR_SIZE PGDIR_SIZE +#define MAX_FDT_SIZE PGDIR_SIZE +#define FIX_FDT_SIZE MAX_FDT_SIZE +#define FIXADDR_SIZE (PGDIR_SIZE + FIX_FDT_SIZE)#endif #define FIXADDR_START (FIXADDR_TOP - FIXADDR_SIZE)arch/riscv/kernel/setup.c +0
-1@@ -280,7 +280,6 @@ void __init setup_arch(char **cmdline_p)#else unflatten_device_tree ();#endif -early_init_fdt_scan_reserved_mem ();misc_mem_init ();init_resources ();arch/riscv/mm/init.c +34
-27@@ -57,7 +57,6 @@ unsigned long empty_zero_page[PAGE_SIZE / sizeof(unsigned long)]EXPORT_SYMBOL (empty_zero_page);extern char _start[]; -#define DTB_EARLY_BASE_VA PGDIR_SIZEvoid *_dtb_early_va__initdata ;uintptr_t _dtb_early_pa__initdata ;@@ -236,6 +235,14 @@ static void __init setup_bootmem(void)set_max_mapnr (max_low_pfn -ARCH_PFN_OFFSET );reserve_initrd_mem (); + +/* +* No allocation should be done before reserving the memory as defined +* in the device tree, otherwise the allocation could end up in a +* reserved region. +*/ +early_init_fdt_scan_reserved_mem (); +/* * If DTB is built in, no need to reserve its memblock. * Otherwise, do reserve it but avoid using @@ -279,9 +286,6 @@ pgd_t trampoline_pg_dir[PTRS_PER_PGD] __page_aligned_bss; static pte_t fixmap_pte[PTRS_PER_PTE] __page_aligned_bss;pgd_t early_pg_dir[PTRS_PER_PGD ]__initdata __aligned(PAGE_SIZE) ; -static p4d_t __maybe_unused early_dtb_p4d[PTRS_PER_P4D ]__initdata __aligned(PAGE_SIZE) ; -static pud_t __maybe_unused early_dtb_pud[PTRS_PER_PUD ]__initdata __aligned(PAGE_SIZE) ; -static pmd_t __maybe_unused early_dtb_pmd[PTRS_PER_PMD ]__initdata __aligned(PAGE_SIZE) ;#ifdef CONFIG_XIP_KERNEL #define pt_ops (*(struct pt_alloc_ops *)XIP_FIXUP(&pt_ops))@@ -626,9 +630,6 @@ static void __init create_p4d_mapping(p4d_t *p4dp,#define trampoline_pgd_next (pgtable_l5_enabled ? \ (uintptr_t)trampoline_p4d : (pgtable_l4_enabled ? \ (uintptr_t)trampoline_pud : (uintptr_t)trampoline_pmd)) -#define early_dtb_pgd_next (pgtable_l5_enabled ? \ - (uintptr_t)early_dtb_p4d : (pgtable_l4_enabled ? \ - (uintptr_t)early_dtb_pud : (uintptr_t)early_dtb_pmd))#else #define pgd_next_t pte_t#define alloc_pgd_next (__va) pt_ops.alloc_pte(__va)@@ -636,7 +637,6 @@ static void __init create_p4d_mapping(p4d_t *p4dp,#define create_pgd_next_mapping (__nextp, __va, __pa, __sz, __prot) \ create_pte_mapping(__nextp, __va, __pa, __sz, __prot)#define fixmap_pgd_next ((uintptr_t)fixmap_pte) -#define early_dtb_pgd_next ((uintptr_t)early_dtb_pmd)#define create_p4d_mapping (__pmdp, __va, __pa, __sz, __prot) do {} while(0)#define create_pud_mapping (__pmdp, __va, __pa, __sz, __prot) do {} while(0)#define create_pmd_mapping (__pmdp, __va, __pa, __sz, __prot) do {} while(0)@@ -859,32 +859,28 @@ static void __init create_kernel_page_table(pgd_t *pgdir, bool early)* this means 2 PMD entries whereas for 32-bit kernel, this is only 1 PGDIR * entry. */ -static void __init create_fdt_early_page_table (pgd_t *pgdir,uintptr_t dtb_pa) +static void __init create_fdt_early_page_table (pgd_t *pgdir, +uintptr_t fix_fdt_va, +uintptr_t dtb_pa) { -#ifndef CONFIG_BUILTIN_DTB uintptr_t pa = dtb_pa & ~(PMD_SIZE -1 ); -create_pgd_mapping (early_pg_dir,DTB_EARLY_BASE_VA , -IS_ENABLED (CONFIG_64BIT ) ? early_dtb_pgd_next : pa, -PGDIR_SIZE , -IS_ENABLED (CONFIG_64BIT ) ?PAGE_TABLE :PAGE_KERNEL ); - -if (pgtable_l5_enabled) -create_p4d_mapping (early_dtb_p4d,DTB_EARLY_BASE_VA , - (uintptr_t )early_dtb_pud,P4D_SIZE ,PAGE_TABLE ); - -if (pgtable_l4_enabled) -create_pud_mapping (early_dtb_pud,DTB_EARLY_BASE_VA , - (uintptr_t )early_dtb_pmd,PUD_SIZE ,PAGE_TABLE ); +#ifndef CONFIG_BUILTIN_DTB +/* Make sure the fdt fixmap address is always aligned on PMD size */ +BUILD_BUG_ON (FIX_FDT % (PMD_SIZE /PAGE_SIZE )); -if (IS_ENABLED (CONFIG_64BIT )) { -create_pmd_mapping (early_dtb_pmd,DTB_EARLY_BASE_VA , +/* In 32-bit only, the fdt lies in its own PGD */ +if (!IS_ENABLED (CONFIG_64BIT )) { +create_pgd_mapping (early_pg_dir, fix_fdt_va, + pa,MAX_FDT_SIZE ,PAGE_KERNEL ); + }else { +create_pmd_mapping (fixmap_pmd, fix_fdt_va, pa,PMD_SIZE ,PAGE_KERNEL ); -create_pmd_mapping (early_dtb_pmd,DTB_EARLY_BASE_VA +PMD_SIZE , +create_pmd_mapping (fixmap_pmd, fix_fdt_va +PMD_SIZE , pa +PMD_SIZE ,PMD_SIZE ,PAGE_KERNEL ); } - dtb_early_va = (void *)DTB_EARLY_BASE_VA + (dtb_pa & (PMD_SIZE -1 )); + dtb_early_va = (void *)fix_fdt_va + (dtb_pa & (PMD_SIZE -1 ));#else /* * For 64-bit kernel, __va can't be used since it would return a linear @@ -1054,7 +1050,8 @@ asmlinkage void __init setup_vm(uintptr_t dtb_pa)create_kernel_page_table (early_pg_dir, true);/* Setup early mapping for FDT early scan */ -create_fdt_early_page_table (early_pg_dir, dtb_pa); +create_fdt_early_page_table (early_pg_dir, +__fix_to_virt (FIX_FDT ), dtb_pa);/* * Bootime fixmap only can handle PMD_SIZE mapping. Thus, boot-ioremap @@ -1096,6 +1093,16 @@ static void __init setup_vm_final(void)u64 i;/* Setup swapper PGD for fixmap */ +#if !defined(CONFIG_64BIT ) +/* +* In 32-bit, the device tree lies in a pgd entry, so it must be copied +* directly in swapper_pg_dir in addition to the pgd entry that points +* to fixmap_pte. +*/ +unsigned long idx =pgd_index (__fix_to_virt (FIX_FDT )); + +set_pgd (&swapper_pg_dir[idx], early_pg_dir[idx]); +#endif create_pgd_mapping (swapper_pg_dir,FIXADDR_START ,__pa_symbol (fixmap_pgd_next),PGDIR_SIZE ,PAGE_TABLE );Signature · 1 line
2.39.2
Re: [PATCH 6.1 127/134] purgatory: fix disabling debug info
In reply to Greg Kroah-HartmanHey folks,
Quoted 26 lines · Greg Kroah-Hartman
From: Alyssa Ross <[email protected]>
[ Upstream commit
d83806c4c0cccc0d6d3c3581a11983a9c186a138]Since
32ef9e5054ec, -Wa,-gdwarf-2 is no longer used inKBUILD_AFLAGS. Instead, it includes -g, the appropriate -gdwarf-* flag, and also the -Wa versions of both of those if building with Clang and GNU as. As a result, debug info was being generated for the purgatory objects, even though the intention was that it not be.Fixes 32ef9e5054ec ("Makefile.debug: re-enable debug info for .S files")Signed-off-by Alyssa Ross <[email protected]>Acked-by Nick Desaulniers <[email protected]>Signed-off-by Masahiro Yamada <[email protected]>Signed-off-by Sasha Levin <[email protected]>--- arch/riscv/purgatory/Makefile | 7 +------ arch/x86/purgatory/Makefile | 3 +-- 2 files changed, 2 insertions(+), 8 deletions(-)arch/riscv/purgatory/Makefile +0
-0
arch/riscv/purgatory/Makefile CFLAGS_string.o += $(PURGATORY_CFLAGS) · line 93
Quoted 10 lines
arch/riscv/purgatory/Makefile +0
-6@@ -84,12 +84,7 @@ CFLAGS_string.o += $(PURGATORY_CFLAGS) CFLAGS_REMOVE_ctype.o += $(PURGATORY_CFLAGS_REMOVE) CFLAGS_ctype.o += $(PURGATORY_CFLAGS) -AFLAGS_REMOVE_entry.o += -Wa,-gdwarf-2 -AFLAGS_REMOVE_memcpy.o += -Wa,-gdwarf-2 -AFLAGS_REMOVE_memset.o += -Wa,-gdwarf-2 -AFLAGS_REMOVE_strcmp.o += -Wa,-gdwarf-2 -AFLAGS_REMOVE_strlen.o += -Wa,-gdwarf-2 -AFLAGS_REMOVE_strncmp.o += -Wa,-gdwarf-2
How about just deleting these 3 lines, rather than pulling back commit 56e0790c7f9e ("RISC-V: add infrastructure to allow different str* implementations") <[email protected]> as that is just going to be a bunch of dead code?
Cheers,
Conor.
Quoted 23 lines
arch/riscv/purgatory/Makefile +1
-0+asflags-remove-y += $(foreach x, -g -gdwarf-4 -gdwarf-5, $(x) -Wa,$(x)) $(obj)/purgatory.ro: $(PURGATORY_OBJS) FORCEarch/riscv/purgatory/Makefile +0
-0$(call if_changed,ld)arch/x86/purgatory/Makefile +1
-2@@ -69,8 +69,7 @@ CFLAGS_sha256.o += $(PURGATORY_CFLAGS) CFLAGS_REMOVE_string.o += $(PURGATORY_CFLAGS_REMOVE) CFLAGS_string.o += $(PURGATORY_CFLAGS) -AFLAGS_REMOVE_setup-x86_$(BITS).o += -Wa,-gdwarf-2 -AFLAGS_REMOVE_entry64.o += -Wa,-gdwarf-2 +asflags-remove-y += $(foreach x, -g -gdwarf-4 -gdwarf-5, $(x) -Wa,$(x)) $(obj)/purgatory.ro: $(PURGATORY_OBJS) FORCE $(call if_changed,ld)Signature · 1 line
2.39.2
Re: [PATCH 6.1 127/134] purgatory: fix disabling debug info
Quoted 36 lines · Conor Dooley
Hey folks,
Quoted 32 lines · Greg Kroah-Hartman
From: Alyssa Ross <[email protected]>
[ Upstream commit
d83806c4c0cccc0d6d3c3581a11983a9c186a138]Since
32ef9e5054ec, -Wa,-gdwarf-2 is no longer used inKBUILD_AFLAGS. Instead, it includes -g, the appropriate -gdwarf-* flag, and also the -Wa versions of both of those if building with Clang and GNU as. As a result, debug info was being generated for the purgatory objects, even though the intention was that it not be.Fixes 32ef9e5054ec ("Makefile.debug: re-enable debug info for .S files")Signed-off-by Alyssa Ross <[email protected]>Acked-by Nick Desaulniers <[email protected]>Signed-off-by Masahiro Yamada <[email protected]>Signed-off-by Sasha Levin <[email protected]>--- arch/riscv/purgatory/Makefile | 7 +------ arch/x86/purgatory/Makefile | 3 +-- 2 files changed, 2 insertions(+), 8 deletions(-)arch/riscv/purgatory/Makefile +0
-3@@ -84,12 +84,7 @@ CFLAGS_string.o += $(PURGATORY_CFLAGS) CFLAGS_REMOVE_ctype.o += $(PURGATORY_CFLAGS_REMOVE) CFLAGS_ctype.o += $(PURGATORY_CFLAGS) -AFLAGS_REMOVE_entry.o += -Wa,-gdwarf-2 -AFLAGS_REMOVE_memcpy.o += -Wa,-gdwarf-2 -AFLAGS_REMOVE_memset.o += -Wa,-gdwarf-2
Quoted 8 lines
arch/riscv/purgatory/Makefile CFLAGS_string.o += $(PURGATORY_CFLAGS) · line 92
Quoted 3 lines
arch/riscv/purgatory/Makefile +0
-3-AFLAGS_REMOVE_strcmp.o += -Wa,-gdwarf-2 -AFLAGS_REMOVE_strlen.o += -Wa,-gdwarf-2 -AFLAGS_REMOVE_strncmp.o += -Wa,-gdwarf-2How about just deleting these 3 lines, rather than pulling back commit
56e0790c7f9e("RISC-V: add infrastructure to allow different str* implementations") <[email protected]> as that is just going to be a bunch of dead code?
Hmm, in the port to 6.1 I submitted <[email protected]>, I did just drop those lines. Did I get it wrong somehow to have it not picked up?
Quoted 7 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 6.1.25 release. There are 134 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Thu, 20 Apr 2023 12:02:44 +0000. Anything received after that time might be too late.
Hi Greg
6.1.25-rc1
compiles, boots and runs here on x86_64
(AMD Ryzen 5 PRO 4650G, Slackware64-15.0)
Hello Greg,
Quoted 10 lines
From: Greg Kroah-Hartman <[email protected]>
Sent: Tuesday, April 18, 2023 1:21 PMThis is the start of the stable review cycle for the 6.1.25 release. There are 134 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Thu, 20 Apr 2023 12:02:44 +0000. Anything received after that time might be too late.
CIP configurations built and booted with Linux 6.1.25-rc1 (90c08f549ee7):
https://gitlab.com/cip-project/cip-testing/linux-stable-rc-ci/-/pipelines/840945625
https://gitlab.com/cip-project/cip-testing/linux-stable-rc-ci/-/commits/linux-6.1.y
Kind regards, Chris
Quoted 9 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 6.1.25 release. There are 134 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Thu, 20 Apr 2023 12:02:44 +0000. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
Quoted 9 lines
https://www.kernel.org/pub/linux/kernel/v6.x/stable-review/patch-6.1.25-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-6.1.y
and the diffstat can be found below.thanks,
greg k-h
Compiled and booted on my test system. No dmesg regressions.
thanks,
-- Shuah
Quoted 9 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 6.1.25 release. There are 134 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Thu, 20 Apr 2023 12:02:44 +0000. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
Quoted 8 lines
https://www.kernel.org/pub/linux/kernel/v6.x/stable-review/patch-6.1.25-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-6.1.y
and the diffstat can be found below.thanks,
greg k-h
On ARCH_BRCMSTB using 32-bit and 64-bit ARM kernels, build tested on BMIPS_GENERIC:
Signature · 1 line
Florian
Hi Greg
Quoted 10 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 6.1.25 release. There are 134 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Thu, 20 Apr 2023 12:02:44 +0000. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
Quoted 9 lines
https://www.kernel.org/pub/linux/kernel/v6.x/stable-review/patch-6.1.25-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-6.1.y
and the diffstat can be found below.thanks,
greg k-h
6.1.25-rc1 tested.
x86_64
Build successfully completed.
Boot successfully completed.
No dmesg regressions.
Video output normal.
Sound output normal.
Lenovo ThinkPad X1 Carbon Gen10(Intel i7-1260P, arch linux)
Thanks
Quoted 8 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 6.1.25 release. There are 134 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Thu, 20 Apr 2023 12:02:44 +0000. Anything received after that time might be too late.
Build results:
total: 155 pass: 155 fail: 0 Qemu test results: total: 519 pass: 519 fail: 0
Guenter
Quoted 5 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 6.1.25 release. There are 134 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Successfully cross-compiled for arm64 (bcm2711_defconfig, GCC 10.2.0) and powerpc (ps3_defconfig, GCC 12.2.0).
Signature · 1 line
An old man doll... just what I always wanted! - Clara
Quoted 10 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 6.1.25 release. There are 134 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Thu, 20 Apr 2023 12:02:44 +0000. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
Quoted 8 lines
https://www.kernel.org/pub/linux/kernel/v6.x/stable-review/patch-6.1.25-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-6.1.y
and the diffstat can be found below.thanks,
greg k-h
Results from Linaro’s test farm.
No regressions on arm64, arm, x86_64, and i386.
## Build
* kernel: 6.1.25-rc1
* git: https://gitlab.com/Linaro/lkft/mirrors/stable/linux-stable-rc
* git branch: linux-6.1.y
* git commit: 90c08f549ee77571625a1b42bbb3fcc956181801
* git describe: v6.1.22-480-g90c08f549ee7
* test details:
https://qa-reports.linaro.org/lkft/linux-stable-rc-linux-6.1.y/build/v6.1.22-480-g90c08f549ee7
## Test Regressions (compared to v6.1.22)
## Metric Regressions (compared to v6.1.22)
## Test Fixes (compared to v6.1.22)
## Metric Fixes (compared to v6.1.22)
## Test result summary
total: 156939, pass: 136263, fail: 3904, skip: 16450, xfail: 322
## Build Summary
* arc: 5 total, 5 passed, 0 failed
* arm: 149 total, 148 passed, 1 failed
* arm64: 52 total, 51 passed, 1 failed
* i386: 39 total, 36 passed, 3 failed
* mips: 30 total, 28 passed, 2 failed
* parisc: 8 total, 8 passed, 0 failed
* powerpc: 38 total, 36 passed, 2 failed
* riscv: 16 total, 15 passed, 1 failed
* s390: 16 total, 16 passed, 0 failed
* sh: 14 total, 12 passed, 2 failed
* sparc: 8 total, 8 passed, 0 failed
* x86_64: 44 total, 44 passed, 0 failed
## Test suites summary
* boot
* fwts
* igt-gpu-tools
* kselftest-android
* kselftest-arm64
* kselftest-breakpoints
* kselftest-capabilities
* kselftest-cgroup
* kselftest-clone3
* kselftest-core
* kselftest-cpu-hotplug
* kselftest-cpufreq
* kselftest-drivers-dma-buf
* kselftest-efivarfs
* kselftest-filesystems
* kselftest-filesystems-binderfs
* kselftest-firmware
* kselftest-fpu
* kselftest-ftrace
* kselftest-futex
* kselftest-gpio
* kselftest-intel_pstate
* kselftest-ipc
* kselftest-ir
* kselftest-kcmp
* kselftest-kexec
* kselftest-kvm
* kselftest-lib
* kselftest-livepatch
* kselftest-membarrier
* kselftest-memfd
* kselftest-memory-hotplug
* kselftest-mincore
* kselftest-mount
* kselftest-mqueue
* kselftest-net
* kselftest-net-forwarding
* kselftest-net-mptcp
* kselftest-netfilter
* kselftest-nsfs
* kselftest-openat2
* kselftest-pid_namespace
* kselftest-pidfd
* kselftest-proc
* kselftest-pstore
* kselftest-ptrace
* kselftest-rseq
* kselftest-rtc
* kselftest-seccomp
* kselftest-sigaltstack
* kselftest-size
* kselftest-splice
* kselftest-static_keys
* kselftest-sync
* kselftest-sysctl
* kselftest-tc-testing
* kselftest-timens
* kselftest-timers
* kselftest-tmpfs
* kselftest-tpm2
* kselftest-user
* kselftest-vm
* kselftest-x86
* kselftest-zram
* kunit
* kvm-unit-tests
* libhugetlbfs
* log-parser-boot
* log-parser-test
* ltp-cap_bounds
* ltp-commands
* ltp-containers
* ltp-controllers
* ltp-cpuhotplug
* ltp-crypto
* ltp-cve
* ltp-dio
* ltp-fcntl-locktests
* ltp-filecaps
* ltp-fs
* ltp-fs_bind
* ltp-fs_perms_simple
* ltp-fsx
* ltp-hugetlb
* ltp-io
* ltp-ipc
* ltp-math
* ltp-mm
* ltp-nptl
* ltp-pty
* ltp-sched
* ltp-securebits
* ltp-smoke
* ltp-syscalls
* ltp-tracing
* network-basic-tests
* perf
* rcutorture
* v4l2-compliance
* vdso
--
Linaro LKFT
https://lkft.linaro.org
Greg Kroah-Hartman
maintainerRe: [PATCH 6.1 129/134] riscv: Move early dtb mapping into the fixmap region
In reply to Conor DooleyQuoted 10 lines · Conor Dooley
Quoted 3 lines · Greg Kroah-Hartman
From: Alexandre Ghiti <[email protected]>
[ Upstream commit
ef69d2559fe91f23d27a3d6fd640b5641787d22e]Hey Greg,
Please check out <[email protected]> (I can't find a lore link for stable-commit@vger stuff)
as I am not sure whether it is okay to backport this in isolation.
I'm confused, what is needed to be done here?
thanks,
greg "drowning in email" k-h
Re: [PATCH 6.1 129/134] riscv: Move early dtb mapping into the fixmap region
Quoted 6 lines · Greg Kroah-Hartman
Quoted 5 lines · Conor Dooley
Quoted 3 lines · Greg Kroah-Hartman
From: Alexandre Ghiti <[email protected]>
[ Upstream commit
ef69d2559fe91f23d27a3d6fd640b5641787d22e]
Quoted 7 lines
Quoted 5 lines
Hey Greg,
Please check out <[email protected]> (I can't find a lore link for stable-commit@vger stuff)
as I am not sure whether it is okay to backport this in isolation.I'm confused, what is needed to be done here?
Originally I got an email saying that some patches had failed to apply:
FAILED: patch "[PATCH] riscv: Move early dtb mapping into the fixmap region" failed to apply to 5.15-stable tree <2023041706-esophagus-evacuate-b5a7@gregkh>
FAILED: patch "[PATCH] riscv: Move early dtb mapping into the fixmap region" failed to apply to 6.1-stable tree <2023041708-sinless-rectangle-f480@gregkh>
I replied to:
Patch "riscv: No need to relocate the dtb as it lies in the fixmap region" has been added to the 5.15-stable tree <2023041741-dirtiness-canon-8104@gregkh>
Where I said that without the failed patches, the above should not be
applied to 5.15.y or 6.1y. You said you would drop it from all stable
trees.
However, this patch ("riscv: Move early dtb mapping into the fixmap region") did end up getting applied to 6.1.y and 6.2.y, despite what the email I got said for 6.1.y!
I don't think that either of the patches can be backported in isolation, so either:
a) drop ("riscv: Move early dtb mapping into the fixmap region") from all stable trees & queue it up alongside (riscv: No need to relocate the dtb as it lies in the fixmap region) for the next stable update
b) pick ("riscv: No need to relocate the dtb as it lies in the fixmap region") up in such a way that it sits immediately after ("riscv: No need to relocate the dtb as it lies in the fixmap region") in the history
I am the original reporter of the issue and I have a workaround in place so personally the backport is not urgent (to me at least), so which option you go for doesn't matter to me.
In case it helps, the patch to pick up for b) is commit 1b50f956c8fe ("riscv: No need to relocate the dtb as it lies in the fixmap region") upstream.
HTH,
Conor
Greg Kroah-Hartman
maintainerRe: [PATCH 6.1 129/134] riscv: Move early dtb mapping into the fixmap region
Quoted 28 lines · Conor Dooley
Quoted 6 lines · Greg Kroah-Hartman
Quoted 5 lines · Conor Dooley
Quoted 3 lines · Greg Kroah-Hartman
From: Alexandre Ghiti <[email protected]>
[ Upstream commit
ef69d2559fe91f23d27a3d6fd640b5641787d22e]Quoted 7 lines
Quoted 5 lines
Hey Greg,
Please check out <[email protected]> (I can't find a lore link for stable-commit@vger stuff)
as I am not sure whether it is okay to backport this in isolation.I'm confused, what is needed to be done here?
Originally I got an email saying that some patches had failed to apply:
FAILED: patch "[PATCH] riscv: Move early dtb mapping into the fixmap region" failed to apply to 5.15-stable tree <2023041706-esophagus-evacuate-b5a7@gregkh>
FAILED: patch "[PATCH] riscv: Move early dtb mapping into the fixmap region" failed to apply to 6.1-stable tree <2023041708-sinless-rectangle-f480@gregkh>I replied to:
Patch "riscv: No need to relocate the dtb as it lies in the fixmap region" has been added to the 5.15-stable tree <2023041741-dirtiness-canon-8104@gregkh>
Where I said that without the failed patches, the above should not be
applied to 5.15.y or 6.1y. You said you would drop it from all stable
trees.
Quoted 3 lines
However, this patch ("riscv: Move early dtb mapping into the fixmap region") did end up getting applied to 6.1.y and 6.2.y, despite what the email I got said for 6.1.y!
That's because Sasha backported the dependent patches to get it to apply.
Quoted 7 lines
I don't think that either of the patches can be backported in isolation, so either:
a) drop ("riscv: Move early dtb mapping into the fixmap region") from all stable trees & queue it up alongside (riscv: No need to relocate the dtb as it lies in the fixmap region) for the next stable update
Quoted 8 lines
b) pick ("riscv: No need to relocate the dtb as it lies in the fixmap region") up in such a way that it sits immediately after ("riscv: No need to relocate the dtb as it lies in the fixmap region") in the history
I am the original reporter of the issue and I have a workaround in place so personally the backport is not urgent (to me at least), so which option you go for doesn't matter to me.
Let me just drop all of them, that makes it simpler and then if anyone wants them applied, then they can send us an explicit set of patches.
thanks,
greg k-h
Re: [PATCH 6.1 129/134] riscv: Move early dtb mapping into the fixmap region
Quoted 8 lines · Greg Kroah-Hartman
Quoted 3 lines · Conor Dooley
However, this patch ("riscv: Move early dtb mapping into the fixmap region") did end up getting applied to 6.1.y and 6.2.y, despite what the email I got said for 6.1.y!
That's because Sasha backported the dependent patches to get it to apply.
Should probably send out a notification of success then, no? At least, I didn't see one land in my inbox.
Quoted 2 lines
Let me just drop all of them, that makes it simpler and then if anyone wants them applied, then they can send us an explicit set of patches.
Perfect, I should be able to do that.
Some time here might actually work in our favour, as I don't think this stuff has been tested yet by anyone using XIP and I had expressed some concerns that we would cause them issues.
I already owe you one set of non-urgent backports that I have yet to get around to...
Cheers,
Conor.
Re: [PATCH 6.1 129/134] riscv: Move early dtb mapping into the fixmap region
Hi Conor,
Quoted 14 lines · Conor Dooley
Quoted 8 lines · Greg Kroah-Hartman
Quoted 3 lines · Conor Dooley
However, this patch ("riscv: Move early dtb mapping into the fixmap region") did end up getting applied to 6.1.y and 6.2.y, despite what the email I got said for 6.1.y!
That's because Sasha backported the dependent patches to get it to apply.
Should probably send out a notification of success then, no? At least, I didn't see one land in my inbox.
Quoted 7 lines
Quoted 2 lines
Let me just drop all of them, that makes it simpler and then if anyone wants them applied, then they can send us an explicit set of patches.
Perfect, I should be able to do that.
Some time here might actually work in our favour, as I don't think this stuff has been tested yet by anyone using XIP and I had expressed some concerns that we would cause them issues.
Let me know how far you'd like to see it backported, I'll do it, I already let you deal with all the backport errors, that's the least I can do :)
Thanks!
Alex
Quoted 5 lines
I already owe you one set of non-urgent backports that I have yet to get around to...
Cheers,
Conor.
Re: [PATCH 6.1 129/134] riscv: Move early dtb mapping into the fixmap region
On 19/04/2023 10:57, Alexandre Ghiti wrote:
lore seems to be quite sluggish, so my usual office setup of public-inbox + mutt isn't working..
Quoted 22 lines
Hi Conor,
Quoted 17 lines · Conor Dooley
Quoted 8 lines · Greg Kroah-Hartman
Quoted 3 lines · Conor Dooley
However, this patch ("riscv: Move early dtb mapping into the fixmap region") did end up getting applied to 6.1.y and 6.2.y, despite what the email I got said for 6.1.y!
That's because Sasha backported the dependent patches to get it to apply.
Should probably send out a notification of success then, no? At least, I didn't see one land in my inbox.
Quoted 2 lines
Let me just drop all of them, that makes it simpler and then if anyone wants them applied, then they can send us an explicit set of patches.
Quoted 8 lines
Quoted 4 lines
Perfect, I should be able to do that.
Some time here might actually work in our favour, as I don't think this stuff has been tested yet by anyone using XIP and I had expressed some concerns that we would cause them issues.Let me know how far you'd like to see it backported, I'll do it, I already let you deal with all the backport errors, that's the least I can do :)
Uh, sure! Always happy to have less to do.
I think 6.1 and 6.2 are "free", it's just a case of telling Greg/Sasha exactly what commits to pick.
I believe that is your 3 patches for 6.2.y and your 3 patches plus Bjorn's virtual memory documentation patch for 6.1.y
I don't know what 5.15.y needs, that may be a custom backport. I don't care about 5.10 (and it may predate any of the commits in the
Fixes: tags.
Cheers,
Conor.