From: Greg Kroah-Hartman Date: Sun, 8 Sep 2024 10:21:48 +0000 (+0200) Subject: 6.1-stable patches X-Git-Tag: v4.19.322~123 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=e79ac4248584486f53b570b8bb4a15e74f4a8bed;p=thirdparty%2Fkernel%2Fstable-queue.git 6.1-stable patches added patches: alsa-hda-conexant-add-pincfg-quirk-to-enable-top-speakers-on-sirius-devices.patch alsa-hda-realtek-add-patch-for-internal-mic-in-lenovo-v145.patch alsa-hda-realtek-support-mute-led-on-hp-laptop-14-dq2xxx.patch kvm-svm-don-t-advertise-bus-lock-detect-to-guest-if-svm-support-is-missing.patch kvm-svm-fix-emulation-of-msr-reads-writes-of-msr_fs_base-and-msr_gs_base.patch kvm-x86-acquire-kvm-srcu-when-handling-kvm_set_vcpu_events.patch --- diff --git a/queue-6.1/alsa-hda-conexant-add-pincfg-quirk-to-enable-top-speakers-on-sirius-devices.patch b/queue-6.1/alsa-hda-conexant-add-pincfg-quirk-to-enable-top-speakers-on-sirius-devices.patch new file mode 100644 index 00000000000..279445ef4c6 --- /dev/null +++ b/queue-6.1/alsa-hda-conexant-add-pincfg-quirk-to-enable-top-speakers-on-sirius-devices.patch @@ -0,0 +1,66 @@ +From 4178d78cd7a86510ba68d203f26fc01113c7f126 Mon Sep 17 00:00:00 2001 +From: Christoffer Sandberg +Date: Tue, 27 Aug 2024 12:25:40 +0200 +Subject: ALSA: hda/conexant: Add pincfg quirk to enable top speakers on Sirius devices + +From: Christoffer Sandberg + +commit 4178d78cd7a86510ba68d203f26fc01113c7f126 upstream. + +The Sirius notebooks have two sets of speakers 0x17 (sides) and +0x1d (top center). The side speakers are active by default but +the top speakers aren't. + +This patch provides a pincfg quirk to activate the top speakers. + +Signed-off-by: Christoffer Sandberg +Signed-off-by: Werner Sembach +Cc: stable@vger.kernel.org +Link: https://patch.msgid.link/20240827102540.9480-1-wse@tuxedocomputers.com +Signed-off-by: Takashi Iwai +Signed-off-by: Greg Kroah-Hartman +--- + sound/pci/hda/patch_conexant.c | 11 +++++++++++ + 1 file changed, 11 insertions(+) + +--- a/sound/pci/hda/patch_conexant.c ++++ b/sound/pci/hda/patch_conexant.c +@@ -311,6 +311,7 @@ enum { + CXT_FIXUP_HEADSET_MIC, + CXT_FIXUP_HP_MIC_NO_PRESENCE, + CXT_PINCFG_SWS_JS201D, ++ CXT_PINCFG_TOP_SPEAKER, + }; + + /* for hda_fixup_thinkpad_acpi() */ +@@ -978,6 +979,13 @@ static const struct hda_fixup cxt_fixups + .type = HDA_FIXUP_PINS, + .v.pins = cxt_pincfg_sws_js201d, + }, ++ [CXT_PINCFG_TOP_SPEAKER] = { ++ .type = HDA_FIXUP_PINS, ++ .v.pins = (const struct hda_pintbl[]) { ++ { 0x1d, 0x82170111 }, ++ { } ++ }, ++ }, + }; + + static const struct snd_pci_quirk cxt5045_fixups[] = { +@@ -1074,6 +1082,8 @@ static const struct snd_pci_quirk cxt506 + SND_PCI_QUIRK_VENDOR(0x17aa, "Thinkpad", CXT_FIXUP_THINKPAD_ACPI), + SND_PCI_QUIRK(0x1c06, 0x2011, "Lemote A1004", CXT_PINCFG_LEMOTE_A1004), + SND_PCI_QUIRK(0x1c06, 0x2012, "Lemote A1205", CXT_PINCFG_LEMOTE_A1205), ++ SND_PCI_QUIRK(0x2782, 0x12c3, "Sirius Gen1", CXT_PINCFG_TOP_SPEAKER), ++ SND_PCI_QUIRK(0x2782, 0x12c5, "Sirius Gen2", CXT_PINCFG_TOP_SPEAKER), + {} + }; + +@@ -1093,6 +1103,7 @@ static const struct hda_model_fixup cxt5 + { .id = CXT_FIXUP_HP_MIC_NO_PRESENCE, .name = "hp-mic-fix" }, + { .id = CXT_PINCFG_LENOVO_NOTEBOOK, .name = "lenovo-20149" }, + { .id = CXT_PINCFG_SWS_JS201D, .name = "sws-js201d" }, ++ { .id = CXT_PINCFG_TOP_SPEAKER, .name = "sirius-top-speaker" }, + {} + }; + diff --git a/queue-6.1/alsa-hda-realtek-add-patch-for-internal-mic-in-lenovo-v145.patch b/queue-6.1/alsa-hda-realtek-add-patch-for-internal-mic-in-lenovo-v145.patch new file mode 100644 index 00000000000..d97e2153816 --- /dev/null +++ b/queue-6.1/alsa-hda-realtek-add-patch-for-internal-mic-in-lenovo-v145.patch @@ -0,0 +1,61 @@ +From ef27e89e7f3015be2b3c124833fbd6d2e4686561 Mon Sep 17 00:00:00 2001 +From: Terry Cheong +Date: Fri, 30 Aug 2024 04:11:53 +0800 +Subject: ALSA: hda/realtek: add patch for internal mic in Lenovo V145 + +From: Terry Cheong + +commit ef27e89e7f3015be2b3c124833fbd6d2e4686561 upstream. + +Lenovo V145 is having phase inverted dmic but simply applying inverted +dmic fixups does not work. Chaining up verb fixes for ALC283 enables +inverting dmic fixup to work properly. + +Signed-off-by: Terry Cheong +Cc: +Link: https://patch.msgid.link/20240830-lenovo-v145-fixes-v3-1-f7b7265068fa@chromium.org +Signed-off-by: Takashi Iwai +Signed-off-by: Greg Kroah-Hartman +--- + sound/pci/hda/patch_realtek.c | 9 +++++++++ + 1 file changed, 9 insertions(+) + +--- a/sound/pci/hda/patch_realtek.c ++++ b/sound/pci/hda/patch_realtek.c +@@ -7289,6 +7289,7 @@ enum { + ALC236_FIXUP_HP_GPIO_LED, + ALC236_FIXUP_HP_MUTE_LED, + ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF, ++ ALC236_FIXUP_LENOVO_INV_DMIC, + ALC298_FIXUP_SAMSUNG_AMP, + ALC298_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET, + ALC256_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET, +@@ -8805,6 +8806,12 @@ static const struct hda_fixup alc269_fix + .type = HDA_FIXUP_FUNC, + .v.func = alc236_fixup_hp_mute_led_micmute_vref, + }, ++ [ALC236_FIXUP_LENOVO_INV_DMIC] = { ++ .type = HDA_FIXUP_FUNC, ++ .v.func = alc_fixup_inv_dmic, ++ .chained = true, ++ .chain_id = ALC283_FIXUP_INT_MIC, ++ }, + [ALC298_FIXUP_SAMSUNG_AMP] = { + .type = HDA_FIXUP_FUNC, + .v.func = alc298_fixup_samsung_amp, +@@ -10111,6 +10118,7 @@ static const struct snd_pci_quirk alc269 + SND_PCI_QUIRK(0x17aa, 0x3866, "Lenovo 13X", ALC287_FIXUP_CS35L41_I2C_2), + SND_PCI_QUIRK(0x17aa, 0x3869, "Lenovo Yoga7 14IAL7", ALC287_FIXUP_YOGA9_14IAP7_BASS_SPK_PIN), + SND_PCI_QUIRK(0x17aa, 0x3902, "Lenovo E50-80", ALC269_FIXUP_DMIC_THINKPAD_ACPI), ++ SND_PCI_QUIRK(0x17aa, 0x3913, "Lenovo 145", ALC236_FIXUP_LENOVO_INV_DMIC), + SND_PCI_QUIRK(0x17aa, 0x3977, "IdeaPad S210", ALC283_FIXUP_INT_MIC), + SND_PCI_QUIRK(0x17aa, 0x3978, "Lenovo B50-70", ALC269_FIXUP_DMIC_THINKPAD_ACPI), + SND_PCI_QUIRK(0x17aa, 0x3bf8, "Quanta FL1", ALC269_FIXUP_PCM_44K), +@@ -10359,6 +10367,7 @@ static const struct hda_model_fixup alc2 + {.id = ALC623_FIXUP_LENOVO_THINKSTATION_P340, .name = "alc623-lenovo-thinkstation-p340"}, + {.id = ALC255_FIXUP_ACER_HEADPHONE_AND_MIC, .name = "alc255-acer-headphone-and-mic"}, + {.id = ALC285_FIXUP_HP_GPIO_AMP_INIT, .name = "alc285-hp-amp-init"}, ++ {.id = ALC236_FIXUP_LENOVO_INV_DMIC, .name = "alc236-fixup-lenovo-inv-mic"}, + {} + }; + #define ALC225_STANDARD_PINS \ diff --git a/queue-6.1/alsa-hda-realtek-support-mute-led-on-hp-laptop-14-dq2xxx.patch b/queue-6.1/alsa-hda-realtek-support-mute-led-on-hp-laptop-14-dq2xxx.patch new file mode 100644 index 00000000000..b18185c45df --- /dev/null +++ b/queue-6.1/alsa-hda-realtek-support-mute-led-on-hp-laptop-14-dq2xxx.patch @@ -0,0 +1,30 @@ +From 47a9e8dbb8d4713a9aac7cc6ce3c82dcc94217d8 Mon Sep 17 00:00:00 2001 +From: Maximilien Perreault +Date: Tue, 3 Sep 2024 20:10:13 -0700 +Subject: ALSA: hda/realtek: Support mute LED on HP Laptop 14-dq2xxx + +From: Maximilien Perreault + +commit 47a9e8dbb8d4713a9aac7cc6ce3c82dcc94217d8 upstream. + +The mute LED on this HP laptop uses ALC236 and requires a quirk to function. This patch enables the existing quirk for the device. + +Signed-off-by: Maximilien Perreault +Cc: +Link: https://patch.msgid.link/20240904031013.21220-1-maximilienperreault@gmail.com +Signed-off-by: Takashi Iwai +Signed-off-by: Greg Kroah-Hartman +--- + sound/pci/hda/patch_realtek.c | 1 + + 1 file changed, 1 insertion(+) + +--- a/sound/pci/hda/patch_realtek.c ++++ b/sound/pci/hda/patch_realtek.c +@@ -9717,6 +9717,7 @@ static const struct snd_pci_quirk alc269 + SND_PCI_QUIRK(0x103c, 0x87f5, "HP", ALC287_FIXUP_HP_GPIO_LED), + SND_PCI_QUIRK(0x103c, 0x87f6, "HP Spectre x360 14", ALC245_FIXUP_HP_X360_AMP), + SND_PCI_QUIRK(0x103c, 0x87f7, "HP Spectre x360 14", ALC245_FIXUP_HP_X360_AMP), ++ SND_PCI_QUIRK(0x103c, 0x87fd, "HP Laptop 14-dq2xxx", ALC236_FIXUP_HP_MUTE_LED_COEFBIT2), + SND_PCI_QUIRK(0x103c, 0x87fe, "HP Laptop 15s-fq2xxx", ALC236_FIXUP_HP_MUTE_LED_COEFBIT2), + SND_PCI_QUIRK(0x103c, 0x8805, "HP ProBook 650 G8 Notebook PC", ALC236_FIXUP_HP_GPIO_LED), + SND_PCI_QUIRK(0x103c, 0x880d, "HP EliteBook 830 G8 Notebook PC", ALC285_FIXUP_HP_GPIO_LED), diff --git a/queue-6.1/kvm-svm-don-t-advertise-bus-lock-detect-to-guest-if-svm-support-is-missing.patch b/queue-6.1/kvm-svm-don-t-advertise-bus-lock-detect-to-guest-if-svm-support-is-missing.patch new file mode 100644 index 00000000000..912bdd23095 --- /dev/null +++ b/queue-6.1/kvm-svm-don-t-advertise-bus-lock-detect-to-guest-if-svm-support-is-missing.patch @@ -0,0 +1,40 @@ +From 54950bfe2b69cdc06ef753872b5225e54eb73506 Mon Sep 17 00:00:00 2001 +From: Ravi Bangoria +Date: Thu, 8 Aug 2024 06:29:36 +0000 +Subject: KVM: SVM: Don't advertise Bus Lock Detect to guest if SVM support is missing + +From: Ravi Bangoria + +commit 54950bfe2b69cdc06ef753872b5225e54eb73506 upstream. + +If host supports Bus Lock Detect, KVM advertises it to guests even if +SVM support is absent. Additionally, guest wouldn't be able to use it +despite guest CPUID bit being set. Fix it by unconditionally clearing +the feature bit in KVM cpu capability. + +Reported-by: Jim Mattson +Closes: https://lore.kernel.org/r/CALMp9eRet6+v8Y1Q-i6mqPm4hUow_kJNhmVHfOV8tMfuSS=tVg@mail.gmail.com +Fixes: 76ea438b4afc ("KVM: X86: Expose bus lock debug exception to guest") +Cc: stable@vger.kernel.org +Signed-off-by: Ravi Bangoria +Reviewed-by: Jim Mattson +Reviewed-by: Tom Lendacky +Link: https://lore.kernel.org/r/20240808062937.1149-4-ravi.bangoria@amd.com +Signed-off-by: Sean Christopherson +Signed-off-by: Greg Kroah-Hartman +--- + arch/x86/kvm/svm/svm.c | 3 +++ + 1 file changed, 3 insertions(+) + +--- a/arch/x86/kvm/svm/svm.c ++++ b/arch/x86/kvm/svm/svm.c +@@ -4972,6 +4972,9 @@ static __init void svm_set_cpu_caps(void + + /* CPUID 0x8000001F (SME/SEV features) */ + sev_set_cpu_caps(); ++ ++ /* Don't advertise Bus Lock Detect to guest if SVM support is absent */ ++ kvm_cpu_cap_clear(X86_FEATURE_BUS_LOCK_DETECT); + } + + static __init int svm_hardware_setup(void) diff --git a/queue-6.1/kvm-svm-fix-emulation-of-msr-reads-writes-of-msr_fs_base-and-msr_gs_base.patch b/queue-6.1/kvm-svm-fix-emulation-of-msr-reads-writes-of-msr_fs_base-and-msr_gs_base.patch new file mode 100644 index 00000000000..8d37c9b0685 --- /dev/null +++ b/queue-6.1/kvm-svm-fix-emulation-of-msr-reads-writes-of-msr_fs_base-and-msr_gs_base.patch @@ -0,0 +1,52 @@ +From dad1613e0533b380318281c1519e1a3477c2d0d2 Mon Sep 17 00:00:00 2001 +From: Maxim Levitsky +Date: Fri, 2 Aug 2024 18:16:08 +0300 +Subject: KVM: SVM: fix emulation of msr reads/writes of MSR_FS_BASE and MSR_GS_BASE + +From: Maxim Levitsky + +commit dad1613e0533b380318281c1519e1a3477c2d0d2 upstream. + +If these msrs are read by the emulator (e.g due to 'force emulation' prefix), +SVM code currently fails to extract the corresponding segment bases, +and return them to the emulator. + +Fix that. + +Cc: stable@vger.kernel.org +Signed-off-by: Maxim Levitsky +Link: https://lore.kernel.org/r/20240802151608.72896-3-mlevitsk@redhat.com +Signed-off-by: Sean Christopherson +Signed-off-by: Greg Kroah-Hartman +--- + arch/x86/kvm/svm/svm.c | 12 ++++++++++++ + 1 file changed, 12 insertions(+) + +--- a/arch/x86/kvm/svm/svm.c ++++ b/arch/x86/kvm/svm/svm.c +@@ -2756,6 +2756,12 @@ static int svm_get_msr(struct kvm_vcpu * + case MSR_CSTAR: + msr_info->data = svm->vmcb01.ptr->save.cstar; + break; ++ case MSR_GS_BASE: ++ msr_info->data = svm->vmcb01.ptr->save.gs.base; ++ break; ++ case MSR_FS_BASE: ++ msr_info->data = svm->vmcb01.ptr->save.fs.base; ++ break; + case MSR_KERNEL_GS_BASE: + msr_info->data = svm->vmcb01.ptr->save.kernel_gs_base; + break; +@@ -2982,6 +2988,12 @@ static int svm_set_msr(struct kvm_vcpu * + case MSR_CSTAR: + svm->vmcb01.ptr->save.cstar = data; + break; ++ case MSR_GS_BASE: ++ svm->vmcb01.ptr->save.gs.base = data; ++ break; ++ case MSR_FS_BASE: ++ svm->vmcb01.ptr->save.fs.base = data; ++ break; + case MSR_KERNEL_GS_BASE: + svm->vmcb01.ptr->save.kernel_gs_base = data; + break; diff --git a/queue-6.1/kvm-x86-acquire-kvm-srcu-when-handling-kvm_set_vcpu_events.patch b/queue-6.1/kvm-x86-acquire-kvm-srcu-when-handling-kvm_set_vcpu_events.patch new file mode 100644 index 00000000000..9f24c68a31b --- /dev/null +++ b/queue-6.1/kvm-x86-acquire-kvm-srcu-when-handling-kvm_set_vcpu_events.patch @@ -0,0 +1,80 @@ +From 4bcdd831d9d01e0fb64faea50732b59b2ee88da1 Mon Sep 17 00:00:00 2001 +From: Sean Christopherson +Date: Tue, 23 Jul 2024 16:20:55 -0700 +Subject: KVM: x86: Acquire kvm->srcu when handling KVM_SET_VCPU_EVENTS + +From: Sean Christopherson + +commit 4bcdd831d9d01e0fb64faea50732b59b2ee88da1 upstream. + +Grab kvm->srcu when processing KVM_SET_VCPU_EVENTS, as KVM will forcibly +leave nested VMX/SVM if SMM mode is being toggled, and leaving nested VMX +reads guest memory. + +Note, kvm_vcpu_ioctl_x86_set_vcpu_events() can also be called from KVM_RUN +via sync_regs(), which already holds SRCU. I.e. trying to precisely use +kvm_vcpu_srcu_read_lock() around the problematic SMM code would cause +problems. Acquiring SRCU isn't all that expensive, so for simplicity, +grab it unconditionally for KVM_SET_VCPU_EVENTS. + + ============================= + WARNING: suspicious RCU usage + 6.10.0-rc7-332d2c1d713e-next-vm #552 Not tainted + ----------------------------- + include/linux/kvm_host.h:1027 suspicious rcu_dereference_check() usage! + + other info that might help us debug this: + + rcu_scheduler_active = 2, debug_locks = 1 + 1 lock held by repro/1071: + #0: ffff88811e424430 (&vcpu->mutex){+.+.}-{3:3}, at: kvm_vcpu_ioctl+0x7d/0x970 [kvm] + + stack backtrace: + CPU: 15 PID: 1071 Comm: repro Not tainted 6.10.0-rc7-332d2c1d713e-next-vm #552 + Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 0.0.0 02/06/2015 + Call Trace: + + dump_stack_lvl+0x7f/0x90 + lockdep_rcu_suspicious+0x13f/0x1a0 + kvm_vcpu_gfn_to_memslot+0x168/0x190 [kvm] + kvm_vcpu_read_guest+0x3e/0x90 [kvm] + nested_vmx_load_msr+0x6b/0x1d0 [kvm_intel] + load_vmcs12_host_state+0x432/0xb40 [kvm_intel] + vmx_leave_nested+0x30/0x40 [kvm_intel] + kvm_vcpu_ioctl_x86_set_vcpu_events+0x15d/0x2b0 [kvm] + kvm_arch_vcpu_ioctl+0x1107/0x1750 [kvm] + ? mark_held_locks+0x49/0x70 + ? kvm_vcpu_ioctl+0x7d/0x970 [kvm] + ? kvm_vcpu_ioctl+0x497/0x970 [kvm] + kvm_vcpu_ioctl+0x497/0x970 [kvm] + ? lock_acquire+0xba/0x2d0 + ? find_held_lock+0x2b/0x80 + ? do_user_addr_fault+0x40c/0x6f0 + ? lock_release+0xb7/0x270 + __x64_sys_ioctl+0x82/0xb0 + do_syscall_64+0x6c/0x170 + entry_SYSCALL_64_after_hwframe+0x4b/0x53 + RIP: 0033:0x7ff11eb1b539 + + +Fixes: f7e570780efc ("KVM: x86: Forcibly leave nested virt when SMM state is toggled") +Cc: stable@vger.kernel.org +Link: https://lore.kernel.org/r/20240723232055.3643811-1-seanjc@google.com +Signed-off-by: Sean Christopherson +Signed-off-by: Greg Kroah-Hartman +--- + arch/x86/kvm/x86.c | 2 ++ + 1 file changed, 2 insertions(+) + +--- a/arch/x86/kvm/x86.c ++++ b/arch/x86/kvm/x86.c +@@ -5747,7 +5747,9 @@ long kvm_arch_vcpu_ioctl(struct file *fi + if (copy_from_user(&events, argp, sizeof(struct kvm_vcpu_events))) + break; + ++ kvm_vcpu_srcu_read_lock(vcpu); + r = kvm_vcpu_ioctl_x86_set_vcpu_events(vcpu, &events); ++ kvm_vcpu_srcu_read_unlock(vcpu); + break; + } + case KVM_GET_DEBUGREGS: { diff --git a/queue-6.1/series b/queue-6.1/series index 5b38a198ad8..e8a0497f114 100644 --- a/queue-6.1/series +++ b/queue-6.1/series @@ -1,2 +1,8 @@ sch-netem-fix-use-after-free-in-netem_dequeue.patch asoc-dapm-fix-uaf-for-snd_soc_pcm_runtime-object.patch +kvm-x86-acquire-kvm-srcu-when-handling-kvm_set_vcpu_events.patch +kvm-svm-fix-emulation-of-msr-reads-writes-of-msr_fs_base-and-msr_gs_base.patch +kvm-svm-don-t-advertise-bus-lock-detect-to-guest-if-svm-support-is-missing.patch +alsa-hda-conexant-add-pincfg-quirk-to-enable-top-speakers-on-sirius-devices.patch +alsa-hda-realtek-add-patch-for-internal-mic-in-lenovo-v145.patch +alsa-hda-realtek-support-mute-led-on-hp-laptop-14-dq2xxx.patch