Skip to content

Commit f8e1143

Browse files
committed
Merge remote-tracking branch 'stable/linux-6.12.y' into rpi-6.12.y
2 parents 21b4101 + 53d3c6d commit f8e1143

File tree

53 files changed

+520
-206
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+520
-206
lines changed

Documentation/process/2.Process.rst

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,8 +104,10 @@ kernels go out with a handful of known regressions though, hopefully, none
104104
of them are serious.
105105

106106
Once a stable release is made, its ongoing maintenance is passed off to the
107-
"stable team," currently Greg Kroah-Hartman. The stable team will release
108-
occasional updates to the stable release using the 5.x.y numbering scheme.
107+
"stable team," currently consists of Greg Kroah-Hartman and Sasha Levin. The
108+
stable team will release occasional updates to the stable release using the
109+
5.x.y numbering scheme.
110+
109111
To be considered for an update release, a patch must (1) fix a significant
110112
bug, and (2) already be merged into the mainline for the next development
111113
kernel. Kernels will typically receive stable updates for a little more

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# SPDX-License-Identifier: GPL-2.0
22
VERSION = 6
33
PATCHLEVEL = 12
4-
SUBLEVEL = 61
4+
SUBLEVEL = 62
55
EXTRAVERSION =
66
NAME = Baby Opossum Posse
77

arch/loongarch/kernel/machine_kexec.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -249,6 +249,7 @@ void machine_crash_shutdown(struct pt_regs *regs)
249249
#ifdef CONFIG_SMP
250250
crash_smp_send_stop();
251251
#endif
252+
machine_kexec_mask_interrupts();
252253
cpumask_set_cpu(crashing_cpu, &cpus_in_crash);
253254

254255
pr_info("Starting crashdump kernel...\n");
@@ -286,6 +287,7 @@ void machine_kexec(struct kimage *image)
286287

287288
/* We do not want to be bothered. */
288289
local_irq_disable();
290+
machine_kexec_mask_interrupts();
289291

290292
pr_notice("EFI boot flag 0x%lx\n", efi_boot);
291293
pr_notice("Command line at 0x%lx\n", cmdline_ptr);

arch/x86/include/asm/kvm_host.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2059,6 +2059,11 @@ u64 vcpu_tsc_khz(struct kvm_vcpu *vcpu);
20592059
* the gfn, i.e. retrying the instruction will hit a
20602060
* !PRESENT fault, which results in a new shadow page
20612061
* and sends KVM back to square one.
2062+
*
2063+
* EMULTYPE_SKIP_SOFT_INT - Set in combination with EMULTYPE_SKIP to only skip
2064+
* an instruction if it could generate a given software
2065+
* interrupt, which must be encoded via
2066+
* EMULTYPE_SET_SOFT_INT_VECTOR().
20622067
*/
20632068
#define EMULTYPE_NO_DECODE (1 << 0)
20642069
#define EMULTYPE_TRAP_UD (1 << 1)
@@ -2069,6 +2074,10 @@ u64 vcpu_tsc_khz(struct kvm_vcpu *vcpu);
20692074
#define EMULTYPE_PF (1 << 6)
20702075
#define EMULTYPE_COMPLETE_USER_EXIT (1 << 7)
20712076
#define EMULTYPE_WRITE_PF_TO_SP (1 << 8)
2077+
#define EMULTYPE_SKIP_SOFT_INT (1 << 9)
2078+
2079+
#define EMULTYPE_SET_SOFT_INT_VECTOR(v) ((u32)((v) & 0xff) << 16)
2080+
#define EMULTYPE_GET_SOFT_INT_VECTOR(e) (((e) >> 16) & 0xff)
20722081

20732082
int kvm_emulate_instruction(struct kvm_vcpu *vcpu, int emulation_type);
20742083
int kvm_emulate_instruction_from_buffer(struct kvm_vcpu *vcpu,

arch/x86/kvm/svm/svm.c

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -369,6 +369,7 @@ static void svm_set_interrupt_shadow(struct kvm_vcpu *vcpu, int mask)
369369
}
370370

371371
static int __svm_skip_emulated_instruction(struct kvm_vcpu *vcpu,
372+
int emul_type,
372373
bool commit_side_effects)
373374
{
374375
struct vcpu_svm *svm = to_svm(vcpu);
@@ -390,7 +391,7 @@ static int __svm_skip_emulated_instruction(struct kvm_vcpu *vcpu,
390391
if (unlikely(!commit_side_effects))
391392
old_rflags = svm->vmcb->save.rflags;
392393

393-
if (!kvm_emulate_instruction(vcpu, EMULTYPE_SKIP))
394+
if (!kvm_emulate_instruction(vcpu, emul_type))
394395
return 0;
395396

396397
if (unlikely(!commit_side_effects))
@@ -408,11 +409,13 @@ static int __svm_skip_emulated_instruction(struct kvm_vcpu *vcpu,
408409

409410
static int svm_skip_emulated_instruction(struct kvm_vcpu *vcpu)
410411
{
411-
return __svm_skip_emulated_instruction(vcpu, true);
412+
return __svm_skip_emulated_instruction(vcpu, EMULTYPE_SKIP, true);
412413
}
413414

414-
static int svm_update_soft_interrupt_rip(struct kvm_vcpu *vcpu)
415+
static int svm_update_soft_interrupt_rip(struct kvm_vcpu *vcpu, u8 vector)
415416
{
417+
const int emul_type = EMULTYPE_SKIP | EMULTYPE_SKIP_SOFT_INT |
418+
EMULTYPE_SET_SOFT_INT_VECTOR(vector);
416419
unsigned long rip, old_rip = kvm_rip_read(vcpu);
417420
struct vcpu_svm *svm = to_svm(vcpu);
418421

@@ -428,7 +431,7 @@ static int svm_update_soft_interrupt_rip(struct kvm_vcpu *vcpu)
428431
* in use, the skip must not commit any side effects such as clearing
429432
* the interrupt shadow or RFLAGS.RF.
430433
*/
431-
if (!__svm_skip_emulated_instruction(vcpu, !nrips))
434+
if (!__svm_skip_emulated_instruction(vcpu, emul_type, !nrips))
432435
return -EIO;
433436

434437
rip = kvm_rip_read(vcpu);
@@ -464,7 +467,7 @@ static void svm_inject_exception(struct kvm_vcpu *vcpu)
464467
kvm_deliver_exception_payload(vcpu, ex);
465468

466469
if (kvm_exception_is_soft(ex->vector) &&
467-
svm_update_soft_interrupt_rip(vcpu))
470+
svm_update_soft_interrupt_rip(vcpu, ex->vector))
468471
return;
469472

470473
svm->vmcb->control.event_inj = ex->vector
@@ -3743,24 +3746,23 @@ static bool svm_set_vnmi_pending(struct kvm_vcpu *vcpu)
37433746

37443747
static void svm_inject_irq(struct kvm_vcpu *vcpu, bool reinjected)
37453748
{
3749+
struct kvm_queued_interrupt *intr = &vcpu->arch.interrupt;
37463750
struct vcpu_svm *svm = to_svm(vcpu);
37473751
u32 type;
37483752

3749-
if (vcpu->arch.interrupt.soft) {
3750-
if (svm_update_soft_interrupt_rip(vcpu))
3753+
if (intr->soft) {
3754+
if (svm_update_soft_interrupt_rip(vcpu, intr->nr))
37513755
return;
37523756

37533757
type = SVM_EVTINJ_TYPE_SOFT;
37543758
} else {
37553759
type = SVM_EVTINJ_TYPE_INTR;
37563760
}
37573761

3758-
trace_kvm_inj_virq(vcpu->arch.interrupt.nr,
3759-
vcpu->arch.interrupt.soft, reinjected);
3762+
trace_kvm_inj_virq(intr->nr, intr->soft, reinjected);
37603763
++vcpu->stat.irq_injections;
37613764

3762-
svm->vmcb->control.event_inj = vcpu->arch.interrupt.nr |
3763-
SVM_EVTINJ_VALID | type;
3765+
svm->vmcb->control.event_inj = intr->nr | SVM_EVTINJ_VALID | type;
37643766
}
37653767

37663768
void svm_complete_interrupt_delivery(struct kvm_vcpu *vcpu, int delivery_mode,

arch/x86/kvm/x86.c

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9055,6 +9055,23 @@ static bool is_vmware_backdoor_opcode(struct x86_emulate_ctxt *ctxt)
90559055
return false;
90569056
}
90579057

9058+
static bool is_soft_int_instruction(struct x86_emulate_ctxt *ctxt,
9059+
int emulation_type)
9060+
{
9061+
u8 vector = EMULTYPE_GET_SOFT_INT_VECTOR(emulation_type);
9062+
9063+
switch (ctxt->b) {
9064+
case 0xcc:
9065+
return vector == BP_VECTOR;
9066+
case 0xcd:
9067+
return vector == ctxt->src.val;
9068+
case 0xce:
9069+
return vector == OF_VECTOR;
9070+
default:
9071+
return false;
9072+
}
9073+
}
9074+
90589075
/*
90599076
* Decode an instruction for emulation. The caller is responsible for handling
90609077
* code breakpoints. Note, manually detecting code breakpoints is unnecessary
@@ -9156,6 +9173,10 @@ int x86_emulate_instruction(struct kvm_vcpu *vcpu, gpa_t cr2_or_gpa,
91569173
* injecting single-step #DBs.
91579174
*/
91589175
if (emulation_type & EMULTYPE_SKIP) {
9176+
if (emulation_type & EMULTYPE_SKIP_SOFT_INT &&
9177+
!is_soft_int_instruction(ctxt, emulation_type))
9178+
return 0;
9179+
91599180
if (ctxt->mode != X86EMUL_MODE_PROT64)
91609181
ctxt->eip = (u32)ctxt->_eip;
91619182
else

drivers/bluetooth/btrtl.c

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050

5151
#define RTL_CHIP_SUBVER (&(struct rtl_vendor_cmd) {{0x10, 0x38, 0x04, 0x28, 0x80}})
5252
#define RTL_CHIP_REV (&(struct rtl_vendor_cmd) {{0x10, 0x3A, 0x04, 0x28, 0x80}})
53-
#define RTL_SEC_PROJ (&(struct rtl_vendor_cmd) {{0x10, 0xA4, 0x0D, 0x00, 0xb0}})
53+
#define RTL_SEC_PROJ (&(struct rtl_vendor_cmd) {{0x10, 0xA4, 0xAD, 0x00, 0xb0}})
5454

5555
#define RTL_PATCH_SNIPPETS 0x01
5656
#define RTL_PATCH_DUMMY_HEADER 0x02
@@ -534,7 +534,6 @@ static int rtlbt_parse_firmware_v2(struct hci_dev *hdev,
534534
{
535535
struct rtl_epatch_header_v2 *hdr;
536536
int rc;
537-
u8 reg_val[2];
538537
u8 key_id;
539538
u32 num_sections;
540539
struct rtl_section *section;
@@ -549,14 +548,7 @@ static int rtlbt_parse_firmware_v2(struct hci_dev *hdev,
549548
.len = btrtl_dev->fw_len - 7, /* Cut the tail */
550549
};
551550

552-
rc = btrtl_vendor_read_reg16(hdev, RTL_SEC_PROJ, reg_val);
553-
if (rc < 0)
554-
return -EIO;
555-
key_id = reg_val[0];
556-
557-
rtl_dev_dbg(hdev, "%s: key id %u", __func__, key_id);
558-
559-
btrtl_dev->key_id = key_id;
551+
key_id = btrtl_dev->key_id;
560552

561553
hdr = rtl_iov_pull_data(&iov, sizeof(*hdr));
562554
if (!hdr)
@@ -1070,6 +1062,8 @@ struct btrtl_device_info *btrtl_initialize(struct hci_dev *hdev,
10701062
u16 hci_rev, lmp_subver;
10711063
u8 hci_ver, lmp_ver, chip_type = 0;
10721064
int ret;
1065+
int rc;
1066+
u8 key_id;
10731067
u8 reg_val[2];
10741068

10751069
btrtl_dev = kzalloc(sizeof(*btrtl_dev), GFP_KERNEL);
@@ -1180,6 +1174,14 @@ struct btrtl_device_info *btrtl_initialize(struct hci_dev *hdev,
11801174
goto err_free;
11811175
}
11821176

1177+
rc = btrtl_vendor_read_reg16(hdev, RTL_SEC_PROJ, reg_val);
1178+
if (rc < 0)
1179+
goto err_free;
1180+
1181+
key_id = reg_val[0];
1182+
btrtl_dev->key_id = key_id;
1183+
rtl_dev_info(hdev, "%s: key id %u", __func__, key_id);
1184+
11831185
btrtl_dev->fw_len = -EIO;
11841186
if (lmp_subver == RTL_ROM_LMP_8852A && hci_rev == 0x000c) {
11851187
snprintf(fw_name, sizeof(fw_name), "%s_v2.bin",
@@ -1202,7 +1204,7 @@ struct btrtl_device_info *btrtl_initialize(struct hci_dev *hdev,
12021204
goto err_free;
12031205
}
12041206

1205-
if (btrtl_dev->ic_info->cfg_name) {
1207+
if (btrtl_dev->ic_info->cfg_name && !btrtl_dev->key_id) {
12061208
if (postfix) {
12071209
snprintf(cfg_name, sizeof(cfg_name), "%s-%s.bin",
12081210
btrtl_dev->ic_info->cfg_name, postfix);

drivers/bus/mhi/host/pci_generic.c

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -698,6 +698,52 @@ static const struct mhi_pci_dev_info mhi_telit_fe990a_info = {
698698
.mru_default = 32768,
699699
};
700700

701+
static const struct mhi_channel_config mhi_telit_fn920c04_channels[] = {
702+
MHI_CHANNEL_CONFIG_UL_SBL(2, "SAHARA", 32, 0),
703+
MHI_CHANNEL_CONFIG_DL_SBL(3, "SAHARA", 32, 0),
704+
MHI_CHANNEL_CONFIG_UL(4, "DIAG", 64, 1),
705+
MHI_CHANNEL_CONFIG_DL(5, "DIAG", 64, 1),
706+
MHI_CHANNEL_CONFIG_UL(14, "QMI", 32, 0),
707+
MHI_CHANNEL_CONFIG_DL(15, "QMI", 32, 0),
708+
MHI_CHANNEL_CONFIG_UL(32, "DUN", 32, 0),
709+
MHI_CHANNEL_CONFIG_DL(33, "DUN", 32, 0),
710+
MHI_CHANNEL_CONFIG_UL_FP(34, "FIREHOSE", 32, 0),
711+
MHI_CHANNEL_CONFIG_DL_FP(35, "FIREHOSE", 32, 0),
712+
MHI_CHANNEL_CONFIG_UL(92, "DUN2", 32, 1),
713+
MHI_CHANNEL_CONFIG_DL(93, "DUN2", 32, 1),
714+
MHI_CHANNEL_CONFIG_HW_UL(100, "IP_HW0", 128, 2),
715+
MHI_CHANNEL_CONFIG_HW_DL(101, "IP_HW0", 128, 3),
716+
};
717+
718+
static const struct mhi_controller_config modem_telit_fn920c04_config = {
719+
.max_channels = 128,
720+
.timeout_ms = 50000,
721+
.num_channels = ARRAY_SIZE(mhi_telit_fn920c04_channels),
722+
.ch_cfg = mhi_telit_fn920c04_channels,
723+
.num_events = ARRAY_SIZE(mhi_telit_fn990_events),
724+
.event_cfg = mhi_telit_fn990_events,
725+
};
726+
727+
static const struct mhi_pci_dev_info mhi_telit_fn920c04_info = {
728+
.name = "telit-fn920c04",
729+
.config = &modem_telit_fn920c04_config,
730+
.bar_num = MHI_PCI_DEFAULT_BAR_NUM,
731+
.dma_data_width = 32,
732+
.sideband_wake = false,
733+
.mru_default = 32768,
734+
.edl_trigger = true,
735+
};
736+
737+
static const struct mhi_pci_dev_info mhi_telit_fn990b40_info = {
738+
.name = "telit-fn990b40",
739+
.config = &modem_telit_fn920c04_config,
740+
.bar_num = MHI_PCI_DEFAULT_BAR_NUM,
741+
.dma_data_width = 32,
742+
.sideband_wake = false,
743+
.mru_default = 32768,
744+
.edl_trigger = true,
745+
};
746+
701747
static const struct mhi_pci_dev_info mhi_netprisma_lcur57_info = {
702748
.name = "netprisma-lcur57",
703749
.edl = "qcom/prog_firehose_sdx24.mbn",
@@ -720,6 +766,9 @@ static const struct mhi_pci_dev_info mhi_netprisma_fcun69_info = {
720766

721767
/* Keep the list sorted based on the PID. New VID should be added as the last entry */
722768
static const struct pci_device_id mhi_pci_id_table[] = {
769+
/* Telit FN920C04 (sdx35) */
770+
{PCI_DEVICE_SUB(PCI_VENDOR_ID_QCOM, 0x011a, 0x1c5d, 0x2020),
771+
.driver_data = (kernel_ulong_t) &mhi_telit_fn920c04_info },
723772
{ PCI_DEVICE(PCI_VENDOR_ID_QCOM, 0x0304),
724773
.driver_data = (kernel_ulong_t) &mhi_qcom_sdx24_info },
725774
{ PCI_DEVICE_SUB(PCI_VENDOR_ID_QCOM, 0x0306, PCI_VENDOR_ID_QCOM, 0x010c),
@@ -740,6 +789,9 @@ static const struct pci_device_id mhi_pci_id_table[] = {
740789
.driver_data = (kernel_ulong_t) &mhi_telit_fe990a_info },
741790
{ PCI_DEVICE(PCI_VENDOR_ID_QCOM, 0x0308),
742791
.driver_data = (kernel_ulong_t) &mhi_qcom_sdx65_info },
792+
/* Telit FN990B40 (sdx72) */
793+
{ PCI_DEVICE_SUB(PCI_VENDOR_ID_QCOM, 0x0309, 0x1c5d, 0x201a),
794+
.driver_data = (kernel_ulong_t) &mhi_telit_fn990b40_info },
743795
{ PCI_DEVICE(PCI_VENDOR_ID_QCOM, 0x0309),
744796
.driver_data = (kernel_ulong_t) &mhi_qcom_sdx75_info },
745797
{ PCI_DEVICE(PCI_VENDOR_ID_QUECTEL, 0x1001), /* EM120R-GL (sdx24) */

drivers/comedi/comedi_fops.c

Lines changed: 36 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2971,7 +2971,12 @@ static int compat_chaninfo(struct file *file, unsigned long arg)
29712971
chaninfo.rangelist = compat_ptr(chaninfo32.rangelist);
29722972

29732973
mutex_lock(&dev->mutex);
2974-
err = do_chaninfo_ioctl(dev, &chaninfo);
2974+
if (!dev->attached) {
2975+
dev_dbg(dev->class_dev, "no driver attached\n");
2976+
err = -ENODEV;
2977+
} else {
2978+
err = do_chaninfo_ioctl(dev, &chaninfo);
2979+
}
29752980
mutex_unlock(&dev->mutex);
29762981
return err;
29772982
}
@@ -2992,7 +2997,12 @@ static int compat_rangeinfo(struct file *file, unsigned long arg)
29922997
rangeinfo.range_ptr = compat_ptr(rangeinfo32.range_ptr);
29932998

29942999
mutex_lock(&dev->mutex);
2995-
err = do_rangeinfo_ioctl(dev, &rangeinfo);
3000+
if (!dev->attached) {
3001+
dev_dbg(dev->class_dev, "no driver attached\n");
3002+
err = -ENODEV;
3003+
} else {
3004+
err = do_rangeinfo_ioctl(dev, &rangeinfo);
3005+
}
29963006
mutex_unlock(&dev->mutex);
29973007
return err;
29983008
}
@@ -3068,7 +3078,12 @@ static int compat_cmd(struct file *file, unsigned long arg)
30683078
return rc;
30693079

30703080
mutex_lock(&dev->mutex);
3071-
rc = do_cmd_ioctl(dev, &cmd, &copy, file);
3081+
if (!dev->attached) {
3082+
dev_dbg(dev->class_dev, "no driver attached\n");
3083+
rc = -ENODEV;
3084+
} else {
3085+
rc = do_cmd_ioctl(dev, &cmd, &copy, file);
3086+
}
30723087
mutex_unlock(&dev->mutex);
30733088
if (copy) {
30743089
/* Special case: copy cmd back to user. */
@@ -3093,7 +3108,12 @@ static int compat_cmdtest(struct file *file, unsigned long arg)
30933108
return rc;
30943109

30953110
mutex_lock(&dev->mutex);
3096-
rc = do_cmdtest_ioctl(dev, &cmd, &copy, file);
3111+
if (!dev->attached) {
3112+
dev_dbg(dev->class_dev, "no driver attached\n");
3113+
rc = -ENODEV;
3114+
} else {
3115+
rc = do_cmdtest_ioctl(dev, &cmd, &copy, file);
3116+
}
30973117
mutex_unlock(&dev->mutex);
30983118
if (copy) {
30993119
err = put_compat_cmd(compat_ptr(arg), &cmd);
@@ -3153,7 +3173,12 @@ static int compat_insnlist(struct file *file, unsigned long arg)
31533173
}
31543174

31553175
mutex_lock(&dev->mutex);
3156-
rc = do_insnlist_ioctl(dev, insns, insnlist32.n_insns, file);
3176+
if (!dev->attached) {
3177+
dev_dbg(dev->class_dev, "no driver attached\n");
3178+
rc = -ENODEV;
3179+
} else {
3180+
rc = do_insnlist_ioctl(dev, insns, insnlist32.n_insns, file);
3181+
}
31573182
mutex_unlock(&dev->mutex);
31583183
kfree(insns);
31593184
return rc;
@@ -3172,7 +3197,12 @@ static int compat_insn(struct file *file, unsigned long arg)
31723197
return rc;
31733198

31743199
mutex_lock(&dev->mutex);
3175-
rc = do_insn_ioctl(dev, &insn, file);
3200+
if (!dev->attached) {
3201+
dev_dbg(dev->class_dev, "no driver attached\n");
3202+
rc = -ENODEV;
3203+
} else {
3204+
rc = do_insn_ioctl(dev, &insn, file);
3205+
}
31763206
mutex_unlock(&dev->mutex);
31773207
return rc;
31783208
}

0 commit comments

Comments
 (0)