Skip to content

Commit e2ada1f

Browse files
committed
Merge remote-tracking branch 'stable/linux-6.12.y' into rpi-6.12.y
2 parents 080d4e0 + 2b2cbdc commit e2ada1f

File tree

37 files changed

+346
-112
lines changed

37 files changed

+346
-112
lines changed

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 = 51
4+
SUBLEVEL = 52
55
EXTRAVERSION =
66
NAME = Baby Opossum Posse
77

arch/x86/kvm/emulate.c

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5104,12 +5104,11 @@ void init_decode_cache(struct x86_emulate_ctxt *ctxt)
51045104
ctxt->mem_read.end = 0;
51055105
}
51065106

5107-
int x86_emulate_insn(struct x86_emulate_ctxt *ctxt)
5107+
int x86_emulate_insn(struct x86_emulate_ctxt *ctxt, bool check_intercepts)
51085108
{
51095109
const struct x86_emulate_ops *ops = ctxt->ops;
51105110
int rc = X86EMUL_CONTINUE;
51115111
int saved_dst_type = ctxt->dst.type;
5112-
bool is_guest_mode = ctxt->ops->is_guest_mode(ctxt);
51135112

51145113
ctxt->mem_read.pos = 0;
51155114

@@ -5157,7 +5156,7 @@ int x86_emulate_insn(struct x86_emulate_ctxt *ctxt)
51575156
fetch_possible_mmx_operand(&ctxt->dst);
51585157
}
51595158

5160-
if (unlikely(is_guest_mode) && ctxt->intercept) {
5159+
if (unlikely(check_intercepts) && ctxt->intercept) {
51615160
rc = emulator_check_intercept(ctxt, ctxt->intercept,
51625161
X86_ICPT_PRE_EXCEPT);
51635162
if (rc != X86EMUL_CONTINUE)
@@ -5186,7 +5185,7 @@ int x86_emulate_insn(struct x86_emulate_ctxt *ctxt)
51865185
goto done;
51875186
}
51885187

5189-
if (unlikely(is_guest_mode) && (ctxt->d & Intercept)) {
5188+
if (unlikely(check_intercepts) && (ctxt->d & Intercept)) {
51905189
rc = emulator_check_intercept(ctxt, ctxt->intercept,
51915190
X86_ICPT_POST_EXCEPT);
51925191
if (rc != X86EMUL_CONTINUE)
@@ -5240,7 +5239,7 @@ int x86_emulate_insn(struct x86_emulate_ctxt *ctxt)
52405239

52415240
special_insn:
52425241

5243-
if (unlikely(is_guest_mode) && (ctxt->d & Intercept)) {
5242+
if (unlikely(check_intercepts) && (ctxt->d & Intercept)) {
52445243
rc = emulator_check_intercept(ctxt, ctxt->intercept,
52455244
X86_ICPT_POST_MEMACCESS);
52465245
if (rc != X86EMUL_CONTINUE)

arch/x86/kvm/kvm_emulate.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,6 @@ struct x86_emulate_ops {
230230
void (*set_nmi_mask)(struct x86_emulate_ctxt *ctxt, bool masked);
231231

232232
bool (*is_smm)(struct x86_emulate_ctxt *ctxt);
233-
bool (*is_guest_mode)(struct x86_emulate_ctxt *ctxt);
234233
int (*leave_smm)(struct x86_emulate_ctxt *ctxt);
235234
void (*triple_fault)(struct x86_emulate_ctxt *ctxt);
236235
int (*set_xcr)(struct x86_emulate_ctxt *ctxt, u32 index, u64 xcr);
@@ -514,7 +513,7 @@ bool x86_page_table_writing_insn(struct x86_emulate_ctxt *ctxt);
514513
#define EMULATION_RESTART 1
515514
#define EMULATION_INTERCEPTED 2
516515
void init_decode_cache(struct x86_emulate_ctxt *ctxt);
517-
int x86_emulate_insn(struct x86_emulate_ctxt *ctxt);
516+
int x86_emulate_insn(struct x86_emulate_ctxt *ctxt, bool check_intercepts);
518517
int emulator_task_switch(struct x86_emulate_ctxt *ctxt,
519518
u16 tss_selector, int idt_index, int reason,
520519
bool has_error_code, u32 error_code);

arch/x86/kvm/x86.c

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8567,11 +8567,6 @@ static bool emulator_is_smm(struct x86_emulate_ctxt *ctxt)
85678567
return is_smm(emul_to_vcpu(ctxt));
85688568
}
85698569

8570-
static bool emulator_is_guest_mode(struct x86_emulate_ctxt *ctxt)
8571-
{
8572-
return is_guest_mode(emul_to_vcpu(ctxt));
8573-
}
8574-
85758570
#ifndef CONFIG_KVM_SMM
85768571
static int emulator_leave_smm(struct x86_emulate_ctxt *ctxt)
85778572
{
@@ -8655,7 +8650,6 @@ static const struct x86_emulate_ops emulate_ops = {
86558650
.guest_cpuid_is_intel_compatible = emulator_guest_cpuid_is_intel_compatible,
86568651
.set_nmi_mask = emulator_set_nmi_mask,
86578652
.is_smm = emulator_is_smm,
8658-
.is_guest_mode = emulator_is_guest_mode,
86598653
.leave_smm = emulator_leave_smm,
86608654
.triple_fault = emulator_triple_fault,
86618655
.set_xcr = emulator_set_xcr,
@@ -9209,7 +9203,14 @@ int x86_emulate_instruction(struct kvm_vcpu *vcpu, gpa_t cr2_or_gpa,
92099203
ctxt->exception.address = 0;
92109204
}
92119205

9212-
r = x86_emulate_insn(ctxt);
9206+
/*
9207+
* Check L1's instruction intercepts when emulating instructions for
9208+
* L2, unless KVM is re-emulating a previously decoded instruction,
9209+
* e.g. to complete userspace I/O, in which case KVM has already
9210+
* checked the intercepts.
9211+
*/
9212+
r = x86_emulate_insn(ctxt, is_guest_mode(vcpu) &&
9213+
!(emulation_type & EMULTYPE_NO_DECODE));
92139214

92149215
if (r == EMULATION_INTERCEPTED)
92159216
return 1;

crypto/rng.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,11 @@ int crypto_del_default_rng(void)
167167
EXPORT_SYMBOL_GPL(crypto_del_default_rng);
168168
#endif
169169

170+
static void rng_default_set_ent(struct crypto_rng *tfm, const u8 *data,
171+
unsigned int len)
172+
{
173+
}
174+
170175
int crypto_register_rng(struct rng_alg *alg)
171176
{
172177
struct crypto_alg *base = &alg->base;
@@ -178,6 +183,9 @@ int crypto_register_rng(struct rng_alg *alg)
178183
base->cra_flags &= ~CRYPTO_ALG_TYPE_MASK;
179184
base->cra_flags |= CRYPTO_ALG_TYPE_RNG;
180185

186+
if (!alg->set_ent)
187+
alg->set_ent = rng_default_set_ent;
188+
181189
return crypto_register_alg(base);
182190
}
183191
EXPORT_SYMBOL_GPL(crypto_register_rng);

drivers/android/dbitmap.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ static inline void dbitmap_free(struct dbitmap *dmap)
3737
{
3838
dmap->nbits = 0;
3939
kfree(dmap->map);
40+
dmap->map = NULL;
4041
}
4142

4243
/* Returns the nbits that a dbitmap can shrink to, 0 if not possible. */

drivers/bluetooth/btusb.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -514,6 +514,8 @@ static const struct usb_device_id quirks_table[] = {
514514
/* Realtek 8851BU Bluetooth devices */
515515
{ USB_DEVICE(0x3625, 0x010b), .driver_info = BTUSB_REALTEK |
516516
BTUSB_WIDEBAND_SPEECH },
517+
{ USB_DEVICE(0x2001, 0x332a), .driver_info = BTUSB_REALTEK |
518+
BTUSB_WIDEBAND_SPEECH },
517519

518520
/* Realtek 8852AE Bluetooth devices */
519521
{ USB_DEVICE(0x0bda, 0x2852), .driver_info = BTUSB_REALTEK |

drivers/gpu/drm/amd/amdgpu/mes_v11_0.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -677,6 +677,12 @@ static int mes_v11_0_set_hw_resources(struct amdgpu_mes *mes)
677677
mes_set_hw_res_pkt.enable_reg_active_poll = 1;
678678
mes_set_hw_res_pkt.enable_level_process_quantum_check = 1;
679679
mes_set_hw_res_pkt.oversubscription_timer = 50;
680+
if ((mes->adev->mes.sched_version & AMDGPU_MES_VERSION_MASK) >= 0x7f)
681+
mes_set_hw_res_pkt.enable_lr_compute_wa = 1;
682+
else
683+
dev_info_once(mes->adev->dev,
684+
"MES FW version must be >= 0x7f to enable LR compute workaround.\n");
685+
680686
if (amdgpu_mes_log_enable) {
681687
mes_set_hw_res_pkt.enable_mes_event_int_logging = 1;
682688
mes_set_hw_res_pkt.event_intr_history_gpu_mc_ptr =

drivers/gpu/drm/amd/amdgpu/mes_v12_0.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -610,6 +610,11 @@ static int mes_v12_0_set_hw_resources(struct amdgpu_mes *mes, int pipe)
610610
mes_set_hw_res_pkt.use_different_vmid_compute = 1;
611611
mes_set_hw_res_pkt.enable_reg_active_poll = 1;
612612
mes_set_hw_res_pkt.enable_level_process_quantum_check = 1;
613+
if ((mes->adev->mes.sched_version & AMDGPU_MES_VERSION_MASK) >= 0x82)
614+
mes_set_hw_res_pkt.enable_lr_compute_wa = 1;
615+
else
616+
dev_info_once(adev->dev,
617+
"MES FW version must be >= 0x82 to enable LR compute workaround.\n");
613618

614619
/*
615620
* Keep oversubscribe timer for sdma . When we have unmapped doorbell

drivers/gpu/drm/amd/include/mes_v11_api_def.h

Lines changed: 45 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -230,13 +230,24 @@ union MESAPI_SET_HW_RESOURCES {
230230
uint32_t disable_add_queue_wptr_mc_addr : 1;
231231
uint32_t enable_mes_event_int_logging : 1;
232232
uint32_t enable_reg_active_poll : 1;
233-
uint32_t reserved : 21;
233+
uint32_t use_disable_queue_in_legacy_uq_preemption : 1;
234+
uint32_t send_write_data : 1;
235+
uint32_t os_tdr_timeout_override : 1;
236+
uint32_t use_rs64mem_for_proc_gang_ctx : 1;
237+
uint32_t use_add_queue_unmap_flag_addr : 1;
238+
uint32_t enable_mes_sch_stb_log : 1;
239+
uint32_t limit_single_process : 1;
240+
uint32_t is_strix_tmz_wa_enabled :1;
241+
uint32_t enable_lr_compute_wa : 1;
242+
uint32_t reserved : 12;
234243
};
235244
uint32_t uint32_t_all;
236245
};
237246
uint32_t oversubscription_timer;
238247
uint64_t doorbell_info;
239248
uint64_t event_intr_history_gpu_mc_ptr;
249+
uint64_t timestamp;
250+
uint32_t os_tdr_timeout_in_sec;
240251
};
241252

242253
uint32_t max_dwords_in_api[API_FRAME_SIZE_IN_DWORDS];
@@ -256,7 +267,8 @@ union MESAPI_SET_HW_RESOURCES_1 {
256267
};
257268
uint64_t mes_info_ctx_mc_addr;
258269
uint32_t mes_info_ctx_size;
259-
uint32_t mes_kiq_unmap_timeout; // unit is 100ms
270+
uint64_t reserved1;
271+
uint64_t cleaner_shader_fence_mc_addr;
260272
};
261273

262274
uint32_t max_dwords_in_api[API_FRAME_SIZE_IN_DWORDS];
@@ -563,6 +575,11 @@ enum MESAPI_MISC_OPCODE {
563575
MESAPI_MISC__READ_REG,
564576
MESAPI_MISC__WAIT_REG_MEM,
565577
MESAPI_MISC__SET_SHADER_DEBUGGER,
578+
MESAPI_MISC__NOTIFY_WORK_ON_UNMAPPED_QUEUE,
579+
MESAPI_MISC__NOTIFY_TO_UNMAP_PROCESSES,
580+
MESAPI_MISC__CHANGE_CONFIG,
581+
MESAPI_MISC__LAUNCH_CLEANER_SHADER,
582+
566583
MESAPI_MISC__MAX,
567584
};
568585

@@ -617,6 +634,31 @@ struct SET_SHADER_DEBUGGER {
617634
uint32_t trap_en;
618635
};
619636

637+
enum MESAPI_MISC__CHANGE_CONFIG_OPTION {
638+
MESAPI_MISC__CHANGE_CONFIG_OPTION_LIMIT_SINGLE_PROCESS = 0,
639+
MESAPI_MISC__CHANGE_CONFIG_OPTION_ENABLE_HWS_LOGGING_BUFFER = 1,
640+
MESAPI_MISC__CHANGE_CONFIG_OPTION_CHANGE_TDR_CONFIG = 2,
641+
642+
MESAPI_MISC__CHANGE_CONFIG_OPTION_MAX = 0x1F
643+
};
644+
645+
struct CHANGE_CONFIG {
646+
enum MESAPI_MISC__CHANGE_CONFIG_OPTION opcode;
647+
union {
648+
struct {
649+
uint32_t limit_single_process : 1;
650+
uint32_t enable_hws_logging_buffer : 1;
651+
uint32_t reserved : 31;
652+
} bits;
653+
uint32_t all;
654+
} option;
655+
656+
struct {
657+
uint32_t tdr_level;
658+
uint32_t tdr_delay;
659+
} tdr_config;
660+
};
661+
620662
union MESAPI__MISC {
621663
struct {
622664
union MES_API_HEADER header;
@@ -631,6 +673,7 @@ union MESAPI__MISC {
631673
struct WAIT_REG_MEM wait_reg_mem;
632674
struct SET_SHADER_DEBUGGER set_shader_debugger;
633675
enum MES_AMD_PRIORITY_LEVEL queue_sch_level;
676+
struct CHANGE_CONFIG change_config;
634677

635678
uint32_t data[MISC_DATA_MAX_SIZE_IN_DWORDS];
636679
};

0 commit comments

Comments
 (0)