6.8.3-rc1 review
Subsystems (6)
Greg Kroah-Hartman
maintainerPATCH 381/399 scsi: qla2xxx: NVME|FCP prefer flag not being honored
In reply to Greg Kroah-Hartman6.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Quinn Tran <[email protected]>
commit 69aecdd410106dc3a8f543a4f7ec6379b995b8d0 upstream.
Changing of [FCP|NVME] prefer flag in flash has no effect on driver. For device that supports both FCP + NVMe over the same connection, driver continues to connect to this device using the previous successful login mode.
On completion of flash update, adapter will be reset. Driver will reset the prefer flag based on setting from flash.
--- drivers/scsi/qla2xxx/qla_init.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+)
drivers/scsi/qla2xxx/qla_init.c +18 -0
@@ -7501,6 +7501,7 @@ qla2x00_abort_isp(scsi_qla_host_t *vha)struct scsi_qla_host *vp, *tvp;struct req_que *req = ha->req_q_map[0 ];unsigned long flags; +fc_port_t *fcport;if (vha->flags.online) {qla2x00_abort_isp_cleanup (vha);
@@ -7569,6 +7570,15 @@ qla2x00_abort_isp(scsi_qla_host_t *vha) "ISP Abort - ISP reg disconnect post nvmram config, exiting.\n");return status; } + +/* User may have updated [fcp|nvme] prefer in flash */ +list_for_each_entry (fcport, &vha->vp_fcports, list) { +if (NVME_PRIORITY (ha, fcport)) + fcport->do_prli_nvme =1 ; +else + fcport->do_prli_nvme =0 ; + } +if (!qla2x00_restart_isp (vha)) {clear_bit (RESET_MARKER_NEEDED , &vha->dpc_flags);
@@ -7639,6 +7649,14 @@ qla2x00_abort_isp(scsi_qla_host_t *vha)atomic_inc (&vp->vref_count);spin_unlock_irqrestore (&ha->vport_slock, flags); +/* User may have updated [fcp|nvme] prefer in flash */ +list_for_each_entry (fcport, &vp->vp_fcports, list) { +if (NVME_PRIORITY (ha, fcport)) + fcport->do_prli_nvme =1 ; +else + fcport->do_prli_nvme =0 ; + } +qla2x00_vp_abort_isp (vp);spin_lock_irqsave (&ha->vport_slock, flags);
Greg Kroah-Hartman
maintainerPATCH 382/399 scsi: qla2xxx: Fix command flush on cable pull
In reply to Greg Kroah-Hartman6.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Quinn Tran <[email protected]>
commit a27d4d0e7de305def8a5098a614053be208d1aa1 upstream.
System crash due to command failed to flush back to SCSI layer.
BUG: unable to handle kernel NULL pointer dereference at 0000000000000000 PGD 0 P4D 0 Oops: 0000 [#1] SMP NOPTI CPU: 27 PID: 793455 Comm: kworker/u130:6 Kdump: loaded Tainted: G OE --------- - - 4.18.0-372.9.1.el8.x86_64 #1 Hardware name: HPE ProLiant DL360 Gen10/ProLiant DL360 Gen10, BIOS U32 09/03/2021 Workqueue: nvme-wq nvme_fc_connect_ctrl_work [nvme_fc] RIP: 0010:__wake_up_common+0x4c/0x190 Code: 24 10 4d 85 c9 74 0a 41 f6 01 04 0f 85 9d 00 00 00 48 8b 43 08 48 83 c3 08 4c 8d 48 e8 49 8d 41 18 48 39 c3 0f 84 f0 00 00 00 <49> 8b 41 18 89 54 24 08 31 ed 4c 8d 70 e8 45 8b 29 41 f6 c5 04 75 RSP: 0018:ffff95f3e0cb7cd0 EFLAGS: 00010086 RAX: 0000000000000000 RBX: ffff8b08d3b26328 RCX: 0000000000000000 RDX: 0000000000000001 RSI: 0000000000000003 RDI: ffff8b08d3b26320 RBP: 0000000000000001 R08: 0000000000000000 R09: ffffffffffffffe8 R10: 0000000000000000 R11: ffff95f3e0cb7a60 R12: ffff95f3e0cb7d20 R13: 0000000000000003 R14: 0000000000000000 R15: 0000000000000000 FS: 0000000000000000(0000) GS:ffff8b2fdf6c0000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 0000000000000000 CR3: 0000002f1e410002 CR4: 00000000007706e0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 PKRU: 55555554 Call Trace: __wake_up_common_lock+0x7c/0xc0 qla_nvme_ls_req+0x355/0x4c0 [qla2xxx] qla2xxx [0000:12:00.1]-f084:3: qlt_free_session_done: se_sess 0000000000000000 / sess ffff8ae1407ca000 from port 21:32:00:02:ac:07:ee:b8 loop_id 0x02 s_id 01:02:00 logout 1 keep 0 els_logo 0 ? __nvme_fc_send_ls_req+0x260/0x380 [nvme_fc] qla2xxx [0000:12:00.1]-207d:3: FCPort 21:32:00:02:ac:07:ee:b8 state transitioned from ONLINE to LOST - portid=010200. ? nvme_fc_send_ls_req.constprop.42+0x1a/0x45 [nvme_fc] qla2xxx [0000:12:00.1]-2109:3: qla2x00_schedule_rport_del 21320002ac07eeb8. rport ffff8ae598122000 roles 1 ? nvme_fc_connect_ctrl_work.cold.63+0x1e3/0xa7d [nvme_fc] qla2xxx [0000:12:00.1]-f084:3: qlt_free_session_done: se_sess 0000000000000000 / sess ffff8ae14801e000 from port 21:32:01:02:ad:f7:ee:b8 loop_id 0x04 s_id 01:02:01 logout 1 keep 0 els_logo 0 ? __switch_to+0x10c/0x450 ? process_one_work+0x1a7/0x360 qla2xxx [0000:12:00.1]-207d:3: FCPort 21:32:01:02:ad:f7:ee:b8 state transitioned from ONLINE to LOST - portid=010201. ? worker_thread+0x1ce/0x390 ? create_worker+0x1a0/0x1a0 qla2xxx [0000:12:00.1]-2109:3: qla2x00_schedule_rport_del 21320102adf7eeb8. rport ffff8ae3b2312800 roles 70 ? kthread+0x10a/0x120 qla2xxx [0000:12:00.1]-2112:3: qla_nvme_unregister_remote_port: unregister remoteport on ffff8ae14801e000 21320102adf7eeb8 ? set_kthread_struct+0x40/0x40 qla2xxx [0000:12:00.1]-2110:3: remoteport_delete of ffff8ae14801e000 21320102adf7eeb8 completed. ? ret_from_fork+0x1f/0x40 qla2xxx [0000:12:00.1]-f086:3: qlt_free_session_done: waiting for sess ffff8ae14801e000 logout
The system was under memory stress where driver was not able to allocate an SRB to carry out error recovery of cable pull. The failure to flush causes upper layer to start modifying scsi_cmnd. When the system frees up some memory, the subsequent cable pull trigger another command flush. At this point the driver access a null pointer when attempting to DMA unmap the SGL.
Add a check to make sure commands are flush back on session tear down to prevent the null pointer access.
--- drivers/scsi/qla2xxx/qla_target.c | 10 ++++++++++ 1 file changed, 10 insertions(+)
drivers/scsi/qla2xxx/qla_target.c +10 -0
@@ -1062,6 +1062,16 @@ void qlt_free_session_done(struct work_s "%s: sess %p logout completed\n", __func__, sess); } +/* check for any straggling io left behind */ +if (!(sess->flags &FCF_FCP2_DEVICE ) && +qla2x00_eh_wait_for_pending_commands (sess->vha, sess->d_id.b24,0 ,WAIT_TARGET )) { +ql_log (ql_log_warn, vha,0x3027 , +"IO not return. Resetting.\n" ); +set_bit (ISP_ABORT_NEEDED , &vha->dpc_flags); +qla2xxx_wake_dpc (vha); +qla2x00_wait_for_chip_reset (vha); + } +if (sess->logo_ack_needed) { sess->logo_ack_needed =0 ; qla24xx_async_notify_ack(vha, sess,
Greg Kroah-Hartman
maintainerPATCH 383/399 scsi: qla2xxx: Fix double free of the ha->vp_map pointer
In reply to Greg Kroah-Hartman6.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Saurav Kashyap <[email protected]>
commit e288285d47784fdcf7c81be56df7d65c6f10c58b upstream.
Coverity scan reported potential risk of double free of the pointer ha->vp_map. ha->vp_map was freed in qla2x00_mem_alloc(), and again freed in function qla2x00_mem_free(ha).
Assign NULL to vp_map and kfree take care of NULL.
--- drivers/scsi/qla2xxx/qla_os.c | 1 + 1 file changed, 1 insertion(+)
drivers/scsi/qla2xxx/qla_os.c +1 -0
@@ -4602,6 +4602,7 @@ fail_free_init_cb: ha->init_cb_dma =0 ; fail_free_vp_map:kfree (ha->vp_map); + ha->vp_map =NULL ; fail:ql_log (ql_log_fatal,NULL ,0x0030 ,"Memory allocation failure.\n" );
Greg Kroah-Hartman
maintainerPATCH 384/399 scsi: qla2xxx: Fix double free of fcport
In reply to Greg Kroah-Hartman6.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Saurav Kashyap <[email protected]>
commit 82f522ae0d97119a43da53e0f729275691b9c525 upstream.
The server was crashing after LOGO because fcport was getting freed twice.
-----------[ cut here ]-----------
kernel BUG at mm/slub.c:371!
invalid opcode: 0000 1 SMP PTI
CPU: 35 PID: 4610 Comm: bash Kdump: loaded Tainted: G OE --------- - - 4.18.0-425.3.1.el8.x86_64 #1 Hardware name: HPE ProLiant DL360 Gen10/ProLiant DL360 Gen10, BIOS U32 09/03/2021 RIP: 0010:set_freepointer.part.57+0x0/0x10 RSP: 0018:ffffb07107027d90 EFLAGS: 00010246 RAX: ffff9cb7e3150000 RBX: ffff9cb7e332b9c0 RCX: ffff9cb7e3150400 RDX: 0000000000001f37 RSI: 0000000000000000 RDI: ffff9cb7c0005500 RBP: fffff693448c5400 R08: 0000000080000000 R09: 0000000000000009 R10: 0000000000000000 R11: 0000000000132af0 R12: ffff9cb7c0005500 R13: ffff9cb7e3150000 R14: ffffffffc06990e0 R15: ffff9cb7ea85ea58 FS: 00007ff6b79c2740(0000) GS:ffff9cb8f7ec0000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 000055b426b7d700 CR3: 0000000169c18002 CR4: 00000000007706e0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 PKRU: 55555554 Call Trace: kfree+0x238/0x250 qla2x00_els_dcmd_sp_free+0x20/0x230 [qla2xxx] ? qla24xx_els_dcmd_iocb+0x607/0x690 [qla2xxx] qla2x00_issue_logo+0x28c/0x2a0 [qla2xxx] ? qla2x00_issue_logo+0x28c/0x2a0 [qla2xxx] ? kernfs_fop_write+0x11e/0x1a0
Remove one of the free calls and add check for valid fcport. Also use function qla2x00_free_fcport() instead of kfree().
--- drivers/scsi/qla2xxx/qla_iocb.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/scsi/qla2xxx/qla_iocb.c +3 -2
@@ -2637,7 +2637,8 @@ static void qla2x00_els_dcmd_sp_free(srb {struct srb_iocb *elsio = &sp->u.iocb_cmd; -kfree (sp->fcport); +if (sp->fcport) +qla2x00_free_fcport (sp->fcport);if (elsio->u.els_logo.els_logo_pyld) dma_free_coherent(&sp->vha->hw->pdev->dev, DMA_POOL_SIZE,
@@ -2750,6 +2751,7 @@ qla24xx_els_dcmd_iocb(scsi_qla_host_t *vif (!elsio->u.els_logo.els_logo_pyld) {/* ref: INIT */ kref_put (&sp->cmd_kref, qla2x00_sp_release); +qla2x00_free_fcport (fcport);return QLA_FUNCTION_FAILED ; }
@@ -2784,7 +2786,6 @@ qla24xx_els_dcmd_iocb(scsi_qla_host_t *v fcport->d_id.b.area, fcport->d_id.b.al_pa);wait_for_completion (&elsio->u.els_logo.comp); -qla2x00_free_fcport (fcport);/* ref: INIT */ kref_put (&sp->cmd_kref, qla2x00_sp_release);
Greg Kroah-Hartman
maintainerPATCH 385/399 scsi: qla2xxx: Change debug message during driver unload
In reply to Greg Kroah-Hartman6.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Saurav Kashyap <[email protected]>
commit b5a30840727a3e41d12a336d19f6c0716b299161 upstream.
Upon driver unload, purge_mbox flag is set and the heartbeat monitor thread detects this flag and does not send the mailbox command down to FW with a debug message "Error detected: purge[1] eeh[0] cmd=0x0, Exiting". This being not a real error, change the debug message.
--- drivers/scsi/qla2xxx/qla_mbx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/scsi/qla2xxx/qla_mbx.c +1 -1
@@ -194,7 +194,7 @@ qla2x00_mailbox_command(scsi_qla_host_tif (ha->flags.purge_mbox || chip_reset != ha->chip_reset || ha->flags.eeh_busy) {ql_log (ql_log_warn, vha,0xd035 , -"Error detected: purge[%d] eeh[%d] cmd=0x%x, Exiting.\n" , +"Purge mbox: purge[%d] eeh[%d] cmd=0x%x, Exiting.\n" , ha->flags.purge_mbox, ha->flags.eeh_busy, mcp->mb[0 ]); rval =QLA_ABORTED ; goto premature_exit;
Greg Kroah-Hartman
maintainerPATCH 386/399 scsi: qla2xxx: Delay I/O Abort on PCI error
In reply to Greg Kroah-Hartman6.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Quinn Tran <[email protected]>
commit 591c1fdf2016d118b8fbde427b796fac13f3f070 upstream.
Currently when PCI error is detected, I/O is aborted manually through the ABORT IOCB mechanism which is not guaranteed to succeed.
Instead, wait for the OS or system to notify driver to wind down I/O through the pci_error_handlers api. Set eeh_busy flag to pause all traffic and wait for I/O to drain.
--- drivers/scsi/qla2xxx/qla_attr.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-)
drivers/scsi/qla2xxx/qla_attr.c +12 -2
@@ -2741,7 +2741,13 @@ qla2x00_dev_loss_tmo_callbk(struct fc_rpreturn ;if (unlikely (pci_channel_offline (fcport->vha->hw->pdev))) { -qla2x00_abort_all_cmds (fcport->vha,DID_NO_CONNECT <<16 ); +/* Will wait for wind down of adapter */ +ql_dbg (ql_dbg_aer, fcport->vha,0x900c , +"%s pci offline detected (id %06x)\n" , __func__, + fcport->d_id.b24); +qla_pci_set_eeh_busy (fcport->vha); +qla2x00_eh_wait_for_pending_commands (fcport->vha, fcport->d_id.b24, +0 ,WAIT_TARGET );return ; } }
@@ -2763,7 +2769,11 @@ qla2x00_terminate_rport_io(struct fc_rpo vha = fcport->vha;if (unlikely (pci_channel_offline (fcport->vha->hw->pdev))) { -qla2x00_abort_all_cmds (fcport->vha,DID_NO_CONNECT <<16 ); +/* Will wait for wind down of adapter */ +ql_dbg (ql_dbg_aer, fcport->vha,0x900b , +"%s pci offline detected (id %06x)\n" , __func__, + fcport->d_id.b24); +qla_pci_set_eeh_busy (vha);qla2x00_eh_wait_for_pending_commands (fcport->vha, fcport->d_id.b24,0 ,WAIT_TARGET );return ;
Greg Kroah-Hartman
maintainerPATCH 387/399 x86/bugs: Fix the SRSO mitigation on Zen3/4
In reply to Greg Kroah-Hartman6.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Borislav Petkov (AMD) <[email protected]>
commit 4535e1a4174c4111d92c5a9a21e542d232e0fcaa upstream.
The original version of the mitigation would patch in the calls to the untraining routines directly. That is, the alternative() in UNTRAIN_RET will patch in the CALL to srso_alias_untrain_ret() directly.
However, even if commit e7c25c441e9e ("x86/cpu: Cleanup the untrain mess") meant well in trying to clean up the situation, due to micro- architectural reasons, the untraining routine srso_alias_untrain_ret() must be the target of a CALL instruction and not of a JMP instruction as it is done now.
Reshuffle the alternative macros to accomplish that.
--- arch/x86/include/asm/asm-prototypes.h | 1 + arch/x86/include/asm/nospec-branch.h | 21 ++++++++++++++++----- arch/x86/lib/retpoline.S | 11 ++++++----- 3 files changed, 23 insertions(+), 10 deletions(-)
arch/x86/include/asm/asm-prototypes.h +1 -0
@@ -13,6 +13,7 @@#include <asm/preempt.h> #include <asm/asm.h> #include <asm/gsseg.h> +#include <asm/nospec-branch.h> #ifndef CONFIG_X86_CMPXCHG64 extern void cmpxchg8b_emu (void );
arch/x86/include/asm/nospec-branch.h +16 -5
@@ -271,11 +271,20 @@ .Lskip_rsb_\@: .endm +/* + * The CALL to srso_alias_untrain_ret() must be patched in directly at + * the spot where untraining must be done, ie., srso_alias_untrain_ret() + * must be the target of a CALL instruction instead of indirectly + * jumping to a wrapper which then calls it. Therefore, this macro is + * called outside of __UNTRAIN_RET below, for the time being, before the + * kernel can support nested alternatives with arbitrary nesting. + */ +.macro CALL_UNTRAIN_RET#if defined(CONFIG_CPU_UNRET_ENTRY ) || defined(CONFIG_CPU_SRSO ) -#define CALL_UNTRAIN_RET "call entry_untrain_ret" -#else -#define CALL_UNTRAIN_RET "" +ALTERNATIVE_2 "" ,"call entry_untrain_ret" ,X86_FEATURE_UNRET , \ +"call srso_alias_untrain_ret" ,X86_FEATURE_SRSO_ALIAS #endif +.endm/* * Mitigate RETBleed for AMD/Hygon Zen uarch. Requires KERNEL CR3 because the
@@ -291,8 +300,8 @@ .macro __UNTRAIN_RET ibpb_feature, call_depth_insns#if defined(CONFIG_RETHUNK ) || defined(CONFIG_CPU_IBPB_ENTRY )VALIDATE_UNRET_END - ALTERNATIVE_3 "", \ -CALL_UNTRAIN_RET ,X86_FEATURE_UNRET , \ + CALL_UNTRAIN_RET +ALTERNATIVE_2 "" , \ "call entry_ibpb", \ibpb_feature, \ __stringify(\call_depth_insns), X86_FEATURE_CALL_DEPTH#endif
@@ -351,6 +360,8 @@ extern void retbleed_return_thunk(void);static inline void retbleed_return_thunk (void ) {}#endif +extern void srso_alias_untrain_ret (void ); +#ifdef CONFIG_CPU_SRSO extern void srso_return_thunk (void );extern void srso_alias_return_thunk (void );
arch/x86/lib/retpoline.S +6 -5
@@ -163,6 +163,7 @@ SYM_CODE_START_NOALIGN(srso_alias_untrai lfence jmp srso_alias_return_thunk SYM_FUNC_END(srso_alias_untrain_ret) +__EXPORT_THUNK(srso_alias_untrain_ret) .popsection .pushsection .text..__x86.rethunk_safe
@@ -224,10 +225,12 @@ SYM_CODE_START(srso_return_thunk) SYM_CODE_END(srso_return_thunk) #define JMP_SRSO_UNTRAIN_RET "jmp srso_untrain_ret" -#define JMP_SRSO_ALIAS_UNTRAIN_RET "jmp srso_alias_untrain_ret" #else /* !CONFIG_CPU_SRSO */ #define JMP_SRSO_UNTRAIN_RET "ud2" -#define JMP_SRSO_ALIAS_UNTRAIN_RET "ud2" +/* Dummy for the alternative in CALL_UNTRAIN_RET. */ +SYM_CODE_START(srso_alias_untrain_ret) + RET +SYM_FUNC_END(srso_alias_untrain_ret) #endif /* CONFIG_CPU_SRSO */ #ifdef CONFIG_CPU_UNRET_ENTRY
@@ -319,9 +322,7 @@ SYM_FUNC_END(retbleed_untrain_ret) #if defined(CONFIG_CPU_UNRET_ENTRY) || defined(CONFIG_CPU_SRSO) SYM_FUNC_START(entry_untrain_ret) - ALTERNATIVE_2 JMP_RETBLEED_UNTRAIN_RET, \ - JMP_SRSO_UNTRAIN_RET, X86_FEATURE_SRSO, \ - JMP_SRSO_ALIAS_UNTRAIN_RET, X86_FEATURE_SRSO_ALIAS + ALTERNATIVE JMP_RETBLEED_UNTRAIN_RET, JMP_SRSO_UNTRAIN_RET, X86_FEATURE_SRSO SYM_FUNC_END(entry_untrain_ret) __EXPORT_THUNK(entry_untrain_ret)
Re: [PATCH 6.8 387/399] x86/bugs: Fix the SRSO mitigation on Zen3/4
Quoted 1 line · Greg Kroah-Hartman
6.8-stable review patch. If anyone has any objections, please let me know.
Did not test the release candidate, but noticed that the build failed in both 6.8.3 and 6.7.12. I have not tested other kernels yet.
Quoted 112 lines
------------------
From: Borislav Petkov (AMD) <[email protected]>
commit
4535e1a4174c4111d92c5a9a21e542d232e0fcaaupstream.The original version of the mitigation would patch in the calls to the untraining routines directly. That is, the
alternative()inUNTRAIN_RETwill patch in the CALL tosrso_alias_untrain_ret()directly.However, even if commit
e7c25c441e9e("x86/cpu: Cleanup the untrain mess") meant well in trying to clean up the situation, due to micro- architectural reasons, the untraining routinesrso_alias_untrain_ret()must be the target of a CALL instruction and not of a JMP instruction as it is done now.Reshuffle the alternative macros to accomplish that.
Fixes e7c25c441e9e ("x86/cpu: Cleanup the untrain mess")Signed-off-by Borislav Petkov (AMD) <[email protected]>Reviewed-by Ingo Molnar <[email protected]>Signed-off-by Linus Torvalds <[email protected]>Signed-off-by Greg Kroah-Hartman <[email protected]>--- arch/x86/include/asm/asm-prototypes.h | 1 + arch/x86/include/asm/nospec-branch.h | 21 ++++++++++++++++----- arch/x86/lib/retpoline.S | 11 ++++++----- 3 files changed, 23 insertions(+), 10 deletions(-)arch/x86/include/asm/asm-prototypes.h +1
-0@@ -13,6 +13,7 @@#include <asm/preempt.h> #include <asm/asm.h> #include <asm/gsseg.h> +#include <asm/nospec-branch.h> #ifndef CONFIG_X86_CMPXCHG64 extern void cmpxchg8b_emu (void );arch/x86/include/asm/nospec-branch.h +16
-5@@ -271,11 +271,20 @@ .Lskip_rsb_\@: .endm +/* + * The CALL to srso_alias_untrain_ret() must be patched in directly at + * the spot where untraining must be done, ie., srso_alias_untrain_ret() + * must be the target of a CALL instruction instead of indirectly + * jumping to a wrapper which then calls it. Therefore, this macro is + * called outside of __UNTRAIN_RET below, for the time being, before the + * kernel can support nested alternatives with arbitrary nesting. + */ +.macro CALL_UNTRAIN_RET#if defined(CONFIG_CPU_UNRET_ENTRY ) || defined(CONFIG_CPU_SRSO ) -#define CALL_UNTRAIN_RET "call entry_untrain_ret" -#else -#define CALL_UNTRAIN_RET "" +ALTERNATIVE_2 "" ,"call entry_untrain_ret" ,X86_FEATURE_UNRET , \ +"call srso_alias_untrain_ret" ,X86_FEATURE_SRSO_ALIAS #endif +.endm/* * Mitigate RETBleed for AMD/Hygon Zen uarch. Requires KERNEL CR3 because the @@ -291,8 +300,8 @@ .macro __UNTRAIN_RET ibpb_feature, call_depth_insns#if defined(CONFIG_RETHUNK ) || defined(CONFIG_CPU_IBPB_ENTRY )VALIDATE_UNRET_END - ALTERNATIVE_3 "", \ -CALL_UNTRAIN_RET ,X86_FEATURE_UNRET , \ + CALL_UNTRAIN_RET +ALTERNATIVE_2 "" , \ "call entry_ibpb", \ibpb_feature, \ __stringify(\call_depth_insns), X86_FEATURE_CALL_DEPTH#endif @@ -351,6 +360,8 @@ extern void retbleed_return_thunk(void);static inline void retbleed_return_thunk (void ) {}#endif +extern void srso_alias_untrain_ret (void ); +#ifdef CONFIG_CPU_SRSO extern void srso_return_thunk (void );extern void srso_alias_return_thunk (void );arch/x86/lib/retpoline.S +5
-2@@ -163,6 +163,7 @@ SYM_CODE_START_NOALIGN(srso_alias_untrai lfence jmp srso_alias_return_thunk SYM_FUNC_END(srso_alias_untrain_ret) +__EXPORT_THUNK(srso_alias_untrain_ret) .popsection .pushsection .text..__x86.rethunk_safe@@ -224,10 +225,12 @@ SYM_CODE_START(srso_return_thunk) SYM_CODE_END(srso_return_thunk) #define JMP_SRSO_UNTRAIN_RET "jmp srso_untrain_ret" -#define JMP_SRSO_ALIAS_UNTRAIN_RET "jmp srso_alias_untrain_ret" #else /* !CONFIG_CPU_SRSO */ #define JMP_SRSO_UNTRAIN_RET "ud2" -#define JMP_SRSO_ALIAS_UNTRAIN_RET "ud2" +/* Dummy for the alternative in CALL_UNTRAIN_RET. */ +SYM_CODE_START(srso_alias_untrain_ret) + RET +SYM_FUNC_END(srso_alias_untrain_ret) #endif /* CONFIG_CPU_SRSO */ #ifdef CONFIG_CPU_UNRET_ENTRY
arch/x86/lib/retpoline.S SYM_FUNC_END(retbleed_untrain_ret) · line 327
Quoted 9 lines
arch/x86/lib/retpoline.S +1
-3@@ -319,9 +322,7 @@ SYM_FUNC_END(retbleed_untrain_ret) #if defined(CONFIG_CPU_UNRET_ENTRY) || defined(CONFIG_CPU_SRSO) SYM_FUNC_START(entry_untrain_ret) - ALTERNATIVE_2 JMP_RETBLEED_UNTRAIN_RET, \ - JMP_SRSO_UNTRAIN_RET, X86_FEATURE_SRSO, \ - JMP_SRSO_ALIAS_UNTRAIN_RET, X86_FEATURE_SRSO_ALIAS + ALTERNATIVE JMP_RETBLEED_UNTRAIN_RET, JMP_SRSO_UNTRAIN_RET, X86_FEATURE_SRSO SYM_FUNC_END(entry_untrain_ret) __EXPORT_THUNK(entry_untrain_ret)
This failed to build on my laptop where CONFIG_CPU_SRSO is not set (CPU is too old to be vulnerable):
,----
| OBJCOPY modules.builtin.modinfo | GEN modules.builtin | MODPOST Module.symvers | ERROR: modpost: "srso_alias_untrain_ret" [arch/x86/kvm/kvm-amd.ko] undefined! | make[5]: *** [scripts/Makefile.modpost:145: Module.symvers] Error 1 | make[4]: *** [Makefile:1873: modpost] Error 2
`----
Cheers,
Sven
Re: [PATCH 6.8 387/399] x86/bugs: Fix the SRSO mitigation on Zen3/4
Quoted 6 lines · Sven Joachim
Quoted 1 line · Greg Kroah-Hartman
6.8-stable review patch. If anyone has any objections, please let me know.
Did not test the release candidate, but noticed that the build failed in both 6.8.3 and 6.7.12. I have not tested other kernels yet.
https://lore.kernel.org/r/20240403170534.GHZg2MXmwFRv-x8usY@fat_crate.local
Once Linus commits it, I'll backport it.
Thx.
Signature · 4 lines
Regards/Gruss,
Boris.
https://people.kernel.org/tglx/notes-about-netiquetteRe: [PATCH 6.8 387/399] x86/bugs: Fix the SRSO mitigation on Zen3/4
Quoted 4 lines · Borislav Petkov
https://lore.kernel.org/r/20240403170534.GHZg2MXmwFRv-x8usY@fat_crate.local
Once Linus commits it, I'll backport it.
This?
already committed.
Linus
Re: [PATCH 6.8 387/399] x86/bugs: Fix the SRSO mitigation on Zen3/4
Quoted 5 lines · Linus Torvalds
This?
already committed.
Bah, you're waaay too quick for me.
Signature · 4 lines
Regards/Gruss,
Boris.
https://people.kernel.org/tglx/notes-about-netiquetteGreg Kroah-Hartman
maintainerPATCH 388/399 crash: use macro to add crashk_res into iomem early for specific arch
In reply to Greg Kroah-Hartman6.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Baoquan He <[email protected]>
commit 32fbe5246582af4f611ccccee33fd6e559087252 upstream.
There are regression reports[1][2] that crashkernel region on x86_64 can't be added into iomem tree sometime. This causes the later failure of kdump loading.
This happened after commit 4a693ce65b18 ("kdump: defer the insertion of crashkernel resources") was merged.
Even though, these reported issues are proved to be related to other component, they are just exposed after above commmit applied, I still would like to keep crashk_res and crashk_low_res being added into iomem early as before because the early adding has been always there on x86_64 and working very well. For safety of kdump, Let's change it back.
Here, add a macro HAVE_ARCH_ADD_CRASH_RES_TO_IOMEM_EARLY to limit that only ARCH defining the macro can have the early adding crashk_res/_low_res into iomem. Then define HAVE_ARCH_ADD_CRASH_RES_TO_IOMEM_EARLY on x86 to enable it.
Note: In reserve_crashkernel_low(), there's a remnant of crashk_low_res handling which was mistakenly added back in commit 85fcde402db1 ("kexec:
split crashkernel reservation code out from crash_core.c").
[1]
[PATCH V2] x86/kexec: do not update E820 kexec table for setup_data
https://lore.kernel.org/all/[email protected]/T/#u
[2]
Question about Address Range Validation in Crash Kernel Allocation
https://lore.kernel.org/all/[email protected]/T/#u
--- arch/x86/include/asm/crash_core.h | 2 ++ kernel/crash_core.c | 8 ++++++++ 2 files changed, 10 insertions(+)
arch/x86/include/asm/crash_core.h +2 -0
@@ -39,4 +39,6 @@ static inline unsigned long crash_low_si #endif } +#define HAVE_ARCH_ADD_CRASH_RES_TO_IOMEM_EARLY +#endif /* _X86_CRASH_CORE_H */
kernel/crash_core.c +8 -0
@@ -376,6 +376,9 @@ static int __init reserve_crashkernel_lo crashk_low_res.start = low_base; crashk_low_res.end = low_base + low_size -1 ; +#ifdef HAVE_ARCH_ADD_CRASH_RES_TO_IOMEM_EARLY +insert_resource (&iomem_resource, &crashk_low_res); +#endif #endif return 0 ; }
@@ -457,8 +460,12 @@ retry: crashk_res.start = crash_base; crashk_res.end = crash_base + crash_size -1 ; +#ifdef HAVE_ARCH_ADD_CRASH_RES_TO_IOMEM_EARLY +insert_resource (&iomem_resource, &crashk_res); +#endif } +#ifndef HAVE_ARCH_ADD_CRASH_RES_TO_IOMEM_EARLY static __init int insert_crashkernel_resources (void ) {if (crashk_res.start < crashk_res.end)
@@ -471,6 +478,7 @@ static __init int insert_crashkernel_res }early_initcall (insert_crashkernel_resources);#endif +#endif int crash_prepare_elf64_headers (struct crash_mem *mem,int need_kernel_map,void **addr,unsigned long *sz)
Greg Kroah-Hartman
maintainerPATCH 389/399 drm/amd/display: fix IPX enablement
In reply to Greg Kroah-Hartman6.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Hamza Mahfooz <[email protected]>
commit 1202f794cdaa4f0ba6a456bc034f2db6cfcf5579 upstream.
We need to re-enable idle power optimizations after entering PSR. Since, we get kicked out of idle power optimizations before entering PSR (entering PSR requires us to write to DCN registers, which isn't allowed while we are in IPS).
--- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_psr.c | 8 +++++--- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_psr.h | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_psr.c +5 -3
@@ -141,9 +141,8 @@ bool amdgpu_dm_link_setup_psr(struct dc_* amdgpu_dm_psr_enable() - enable psr f/w * @stream: stream state * -* Return: true if success */ -bool amdgpu_dm_psr_enable (struct dc_stream_state *stream) +void amdgpu_dm_psr_enable (struct dc_stream_state *stream) {struct dc_link *link = stream->link;unsigned int vsync_rate_hz =0 ;
@@ -190,7 +189,10 @@ bool amdgpu_dm_psr_enable(struct dc_streif (link->psr_settings.psr_version <DC_PSR_VERSION_SU_1 ) power_opt |= psr_power_opt_z10_static_screen; -return dc_link_set_psr_allow_active (link, &psr_enable, false, false, &power_opt); +dc_link_set_psr_allow_active (link, &psr_enable, false, false, &power_opt); + +if (link->ctx->dc->caps.ips_support) +dc_allow_idle_optimizations (link->ctx->dc, true); }/*
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_psr.h +1 -1
@@ -32,7 +32,7 @@#define AMDGPU_DM_PSR_ENTRY_DELAY 5void amdgpu_dm_set_psr_caps (struct dc_link *link); -bool amdgpu_dm_psr_enable (struct dc_stream_state *stream); +void amdgpu_dm_psr_enable (struct dc_stream_state *stream);bool amdgpu_dm_link_setup_psr (struct dc_stream_state *stream);bool amdgpu_dm_psr_disable (struct dc_stream_state *stream);bool amdgpu_dm_psr_disable_all (struct amdgpu_display_manager *dm);
Greg Kroah-Hartman
maintainerPATCH 390/399 x86/bugs: Use fixed addressing for VERW operand
In reply to Greg Kroah-Hartman6.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Pawan Gupta <[email protected]>
commit 8009479ee919b9a91674f48050ccbff64eafedaa upstream.
The macro used for MDS mitigation executes VERW with relative addressing for the operand. This was necessary in earlier versions of the series. Now it is unnecessary and creates a problem for backports on older kernels that don't support relocations in alternatives. Relocation support was added by commit 270a69c4485d ("x86/alternative:
Support relocations in alternatives"). Also asm for fixed addressing is much cleaner than relative RIP addressing.
Simplify the asm by using fixed addressing for VERW operand.
[ dhansen: tweak changelog ]
--- arch/x86/include/asm/nospec-branch.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/x86/include/asm/nospec-branch.h +1 -1
@@ -332,7 +332,7 @@* Note: Only the memory operand variant of VERW clears the CPU buffers. */ .macro CLEAR_CPU_BUFFERS - ALTERNATIVE "", __stringify(verw _ASM_RIP(mds_verw_sel)), X86_FEATURE_CLEAR_CPU_BUF + ALTERNATIVE "", __stringify(verw mds_verw_sel), X86_FEATURE_CLEAR_CPU_BUF .endm#else /* __ASSEMBLY__ */
Greg Kroah-Hartman
maintainerPATCH 391/399 Revert "x86/bugs: Use fixed addressing for VERW operand"
In reply to Greg Kroah-Hartman6.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Dave Hansen <[email protected]>
commit 532a0c57d7ff75e8f07d4e25cba4184989e2a241 upstream.
This was reverts commit 8009479ee919b9a91674f48050ccbff64eafedaa.
It was originally in x86/urgent, but was deemed wrong so got zapped. But in the meantime, x86/urgent had been merged into x86/apic to resolve a conflict. I didn't notice the merge so didn't zap it from x86/apic and it managed to make it up with the x86/apic material.
The reverted commit is known to cause some KASAN problems.
--- arch/x86/include/asm/nospec-branch.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/x86/include/asm/nospec-branch.h +1 -1
@@ -332,7 +332,7 @@* Note: Only the memory operand variant of VERW clears the CPU buffers. */ .macro CLEAR_CPU_BUFFERS - ALTERNATIVE "", __stringify(verw mds_verw_sel), X86_FEATURE_CLEAR_CPU_BUF + ALTERNATIVE "", __stringify(verw _ASM_RIP(mds_verw_sel)), X86_FEATURE_CLEAR_CPU_BUF .endm#else /* __ASSEMBLY__ */
Greg Kroah-Hartman
maintainerPATCH 392/399 usb: dwc3: pci: Drop duplicate ID
In reply to Greg Kroah-Hartman6.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Heikki Krogerus <[email protected]>
commit f121531703ae442edc1dde4b56803680628bc5b7 upstream.
Intel Arrow Lake CPU uses the Meteor Lake ID with this controller (the controller that's part of the Intel Arrow Lake chipset (PCH) does still have unique PCI ID).
--- drivers/usb/dwc3/dwc3-pci.c | 2 -- 1 file changed, 2 deletions(-)
drivers/usb/dwc3/dwc3-pci.c +0 -2
@@ -51,7 +51,6 @@#define PCI_DEVICE_ID_INTEL_MTLP 0x7ec1#define PCI_DEVICE_ID_INTEL_MTLS 0x7f6f#define PCI_DEVICE_ID_INTEL_MTL 0x7e7e -#define PCI_DEVICE_ID_INTEL_ARLH 0x7ec1#define PCI_DEVICE_ID_INTEL_ARLH_PCH 0x777e#define PCI_DEVICE_ID_INTEL_TGL 0x9a15#define PCI_DEVICE_ID_AMD_MR 0x163a
@@ -423,7 +422,6 @@ static const struct pci_device_id dwc3_p { PCI_DEVICE_DATA(INTEL, MTLP, &dwc3_pci_intel_swnode) }, { PCI_DEVICE_DATA(INTEL, MTL, &dwc3_pci_intel_swnode) }, { PCI_DEVICE_DATA(INTEL, MTLS, &dwc3_pci_intel_swnode) }, - { PCI_DEVICE_DATA(INTEL, ARLH, &dwc3_pci_intel_swnode) }, { PCI_DEVICE_DATA(INTEL, ARLH_PCH, &dwc3_pci_intel_swnode) }, { PCI_DEVICE_DATA(INTEL, TGL, &dwc3_pci_intel_swnode) },
Greg Kroah-Hartman
maintainerPATCH 393/399 scsi: lpfc: Correct size for cmdwqe/rspwqe for memset()
In reply to Greg Kroah-Hartman6.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Muhammad Usama Anjum <[email protected]>
commit 16cc2ba71b9f6440805aef7f92ba0f031f79b765 upstream.
The cmdwqe and rspwqe are of type lpfc_wqe128. They should be memset() with the same type.
--- drivers/scsi/lpfc/lpfc_bsg.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/scsi/lpfc/lpfc_bsg.c +2 -2
@@ -3169,10 +3169,10 @@ lpfc_bsg_diag_loopback_run(struct bsg_jo } cmdwqe = &cmdiocbq->wqe; -memset (cmdwqe,0 ,sizeof (union lpfc_wqe )); +memset (cmdwqe,0 ,sizeof (*cmdwqe));if (phba->sli_rev <LPFC_SLI_REV4 ) { rspwqe = &rspiocbq->wqe; -memset (rspwqe,0 ,sizeof (union lpfc_wqe )); +memset (rspwqe,0 ,sizeof (*rspwqe)); }INIT_LIST_HEAD (&head);
Greg Kroah-Hartman
maintainerPATCH 394/399 scsi: lpfc: Correct size for wqe for memset()
In reply to Greg Kroah-Hartman6.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Muhammad Usama Anjum <[email protected]>
commit 28d41991182c210ec1654f8af2e140ef4cc73f20 upstream.
The wqe is of type lpfc_wqe128. It should be memset with the same type.
--- drivers/scsi/lpfc/lpfc_nvmet.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/scsi/lpfc/lpfc_nvmet.c +1 -1
@@ -1586,7 +1586,7 @@ lpfc_nvmet_setup_io_context(struct lpfc_ wqe = &nvmewqe->wqe;/* Initialize WQE */ -memset (wqe,0 ,sizeof (union lpfc_wqe )); +memset (wqe,0 ,sizeof (*wqe)); ctx_buf->iocbq->cmd_dmabuf =NULL ;spin_lock (&phba->sli4_hba.sgl_list_lock);
Greg Kroah-Hartman
maintainerPATCH 395/399 scsi: libsas: Add a helper sas_get_sas_addr_and_dev_type()
In reply to Greg Kroah-Hartman6.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Xingui Yang <[email protected]>
commit a57345279fd311ba679b8083feb0eec5272c7729 upstream.
Add a helper to get attached_sas_addr and device type from disc_resp.
--- drivers/scsi/libsas/sas_expander.c | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-)
drivers/scsi/libsas/sas_expander.c +12 -7
@@ -1621,6 +1621,16 @@ out_err:/* ---------- Domain revalidation ---------- */ +static void sas_get_sas_addr_and_dev_type (struct smp_disc_resp *disc_resp, +u8 *sas_addr, +enum sas_device_type *type) +{ +memcpy (sas_addr, disc_resp->disc.attached_sas_addr,SAS_ADDR_SIZE ); + *type =to_dev_type (&disc_resp->disc); +if (*type ==SAS_PHY_UNUSED ) +memset (sas_addr,0 ,SAS_ADDR_SIZE ); +} +static int sas_get_phy_discover (struct domain_device *dev,int phy_id,struct smp_disc_resp *disc_resp) {
@@ -1674,13 +1684,8 @@ int sas_get_phy_attached_dev(struct domareturn -ENOMEM ; res =sas_get_phy_discover (dev, phy_id, disc_resp); -if (res ==0 ) { -memcpy (sas_addr, disc_resp->disc.attached_sas_addr, -SAS_ADDR_SIZE ); - *type =to_dev_type (&disc_resp->disc); -if (*type ==0 ) -memset (sas_addr,0 ,SAS_ADDR_SIZE ); - } +if (res ==0 ) +sas_get_sas_addr_and_dev_type (disc_resp, sas_addr, type);kfree (disc_resp);return res; }
Greg Kroah-Hartman
maintainerPATCH 396/399 scsi: libsas: Fix disk not being scanned in after being removed
In reply to Greg Kroah-Hartman6.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Xingui Yang <[email protected]>
commit 8e68a458bcf5b5cb9c3624598bae28f08251601f upstream.
As of commit d8649fc1c5e4 ("scsi: libsas: Do discovery on empty PHY to update PHY info"), do discovery will send a new SMP_DISCOVER and update phy->phy_change_count. We found that if the disk is reconnected and phy change_count changes at this time, the disk scanning process will not be triggered.
Therefore, call sas_set_ex_phy() to update the PHY info with the results of the last query. And because the previous phy info will be used when calling sas_unregister_devs_sas_addr(), sas_unregister_devs_sas_addr() should be called before sas_set_ex_phy().
--- drivers/scsi/libsas/sas_expander.c | 32 ++++++++++++++++++++++---------- 1 file changed, 22 insertions(+), 10 deletions(-)
drivers/scsi/libsas/sas_expander.c +22 -10
@@ -1945,6 +1945,7 @@ static int sas_rediscover_dev(struct domstruct expander_device *ex = &dev->ex_dev;struct ex_phy *phy = &ex->ex_phy[phy_id];enum sas_device_type type =SAS_PHY_UNUSED ; +struct smp_disc_resp *disc_resp;u8 sas_addr[SAS_ADDR_SIZE ];char msg[80 ] ="" ;int res;
@@ -1956,33 +1957,41 @@ static int sas_rediscover_dev(struct dom SAS_ADDR(dev->sas_addr), phy_id, msg);memset (sas_addr,0 ,SAS_ADDR_SIZE ); - res =sas_get_phy_attached_dev (dev, phy_id, sas_addr, &type); + disc_resp =alloc_smp_resp (DISCOVER_RESP_SIZE ); +if (!disc_resp) +return -ENOMEM ; + + res =sas_get_phy_discover (dev, phy_id, disc_resp);switch (res) {case SMP_RESP_NO_PHY : phy->phy_state =PHY_NOT_PRESENT ;sas_unregister_devs_sas_addr (dev, phy_id, last); -return res; + goto out_free_resp;case SMP_RESP_PHY_VACANT : phy->phy_state =PHY_VACANT ;sas_unregister_devs_sas_addr (dev, phy_id, last); -return res; + goto out_free_resp;case SMP_RESP_FUNC_ACC :break ;case -ECOMM :break ;default : -return res; + goto out_free_resp; } +if (res ==0 ) +sas_get_sas_addr_and_dev_type (disc_resp, sas_addr, &type); +if ((SAS_ADDR (sas_addr) ==0 ) || (res == -ECOMM )) { phy->phy_state =PHY_EMPTY ;sas_unregister_devs_sas_addr (dev, phy_id, last);/* -* Even though the PHY is empty, for convenience we discover -* the PHY to update the PHY info, like negotiated linkrate. +* Even though the PHY is empty, for convenience we update +* the PHY info, like negotiated linkrate. */ -sas_ex_phy_discover (dev, phy_id); -return res; +if (res ==0 ) +sas_set_ex_phy (dev, phy_id, disc_resp); + goto out_free_resp; }else if (SAS_ADDR (sas_addr) ==SAS_ADDR (phy->attached_sas_addr) &&dev_type_flutter (type, phy->attached_dev_type)) {struct domain_device *ata_dev =sas_ex_to_ata (dev, phy_id);
@@ -1994,7 +2003,7 @@ static int sas_rediscover_dev(struct dom action =", needs recovery" ;pr_debug ("ex %016llx phy%02d broadcast flutter%s\n" ,SAS_ADDR (dev->sas_addr), phy_id, action); -return res; + goto out_free_resp; }/* we always have to delete the old device when we went here */
@@ -2003,7 +2012,10 @@ static int sas_rediscover_dev(struct dom SAS_ADDR(phy->attached_sas_addr));sas_unregister_devs_sas_addr (dev, phy_id, last); -return sas_discover_new (dev, phy_id); + res =sas_discover_new (dev, phy_id); +out_free_resp: +kfree (disc_resp); +return res; }/**
Greg Kroah-Hartman
maintainerPATCH 397/399 perf/x86/amd/core: Update and fix stalled-cycles-* events for Zen 2 and later
In reply to Greg Kroah-Hartman6.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Sandipan Das <[email protected]>
commit c7b2edd8377be983442c1344cb940cd2ac21b601 upstream.
AMD processors based on Zen 2 and later microarchitectures do not support PMCx087 (instruction pipe stalls) which is used as the backing event for "stalled-cycles-frontend" and "stalled-cycles-backend".
Use PMCx0A9 (cycles where micro-op queue is empty) instead to count frontend stalls and remove the entry for backend stalls since there is no direct replacement.
--- arch/x86/events/amd/core.c | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-)
arch/x86/events/amd/core.c +17 -3
@@ -250,7 +250,7 @@ static const u64 amd_perfmon_event_map[P/* * AMD Performance Monitor Family 17h and later: */ -static const u64 amd_f17h_perfmon_event_map[PERF_COUNT_HW_MAX ] = +static const u64 amd_zen1_perfmon_event_map[PERF_COUNT_HW_MAX ] = { [PERF_COUNT_HW_CPU_CYCLES ] =0x0076 , [PERF_COUNT_HW_INSTRUCTIONS ] =0x00c0 ,
@@ -262,10 +262,24 @@ static const u64 amd_f17h_perfmon_event_ [PERF_COUNT_HW_STALLED_CYCLES_BACKEND] = 0x0187, }; +static const u64 amd_zen2_perfmon_event_map[PERF_COUNT_HW_MAX ] = +{ + [PERF_COUNT_HW_CPU_CYCLES ] =0x0076 , + [PERF_COUNT_HW_INSTRUCTIONS ] =0x00c0 , + [PERF_COUNT_HW_CACHE_REFERENCES ] =0xff60 , + [PERF_COUNT_HW_CACHE_MISSES ] =0x0964 , + [PERF_COUNT_HW_BRANCH_INSTRUCTIONS ] =0x00c2 , + [PERF_COUNT_HW_BRANCH_MISSES ] =0x00c3 , + [PERF_COUNT_HW_STALLED_CYCLES_FRONTEND ] =0x00a9 , +}; +static u64 amd_pmu_event_map (int hw_event) { -if (boot_cpu_data.x86 >=0x17 ) -return amd_f17h_perfmon_event_map[hw_event]; +if (cpu_feature_enabled (X86_FEATURE_ZEN2 ) || boot_cpu_data.x86 >=0x19 ) +return amd_zen2_perfmon_event_map[hw_event]; + +if (cpu_feature_enabled (X86_FEATURE_ZEN1 )) +return amd_zen1_perfmon_event_map[hw_event];return amd_perfmon_event_map[hw_event]; }
Greg Kroah-Hartman
maintainerPATCH 398/399 x86/sev: Skip ROM range scans and validation for SEV-SNP guests
In reply to Greg Kroah-Hartman6.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Kevin Loughlin <[email protected]>
commit 0f4a1e80989aca185d955fcd791d7750082044a2 upstream.
SEV-SNP requires encrypted memory to be validated before access. Because the ROM memory range is not part of the e820 table, it is not pre-validated by the BIOS. Therefore, if a SEV-SNP guest kernel wishes to access this range, the guest must first validate the range.
The current SEV-SNP code does indeed scan the ROM range during early boot and thus attempts to validate the ROM range in probe_roms(). However, this behavior is neither sufficient nor necessary for the following reasons:
* With regards to sufficiency, if EFI_CONFIG_TABLES are not enabled and CONFIG_DMI_SCAN_MACHINE_NON_EFI_FALLBACK is set, the kernel will attempt to access the memory at SMBIOS_ENTRY_POINT_SCAN_START (which falls in the ROM range) prior to validation.
For example, Project Oak Stage 0 provides a minimal guest firmware that currently meets these configuration conditions, meaning guests booting atop Oak Stage 0 firmware encounter a problematic call chain during dmi_setup() -> dmi_scan_machine() that results in a crash during boot if SEV-SNP is enabled.
* With regards to necessity, SEV-SNP guests generally read garbage (which changes across boots) from the ROM range, meaning these scans are unnecessary. The guest reads garbage because the legacy ROM range is unencrypted data but is accessed via an encrypted PMD during early boot (where the PMD is marked as encrypted due to potentially mapping actually-encrypted data in other PMD-contained ranges).
In one exceptional case, EISA probing treats the ROM range as unencrypted data, which is inconsistent with other probing.
Continuing to allow SEV-SNP guests to use garbage and to inconsistently classify ROM range encryption status can trigger undesirable behavior. For instance, if garbage bytes appear to be a valid signature, memory may be unnecessarily reserved for the ROM range. Future code or other use cases may result in more problematic (arbitrary) behavior that should be avoided.
While one solution would be to overhaul the early PMD mapping to always treat the ROM region of the PMD as unencrypted, SEV-SNP guests do not currently rely on data from the ROM region during early boot (and even if they did, they would be mostly relying on garbage data anyways).
As a simpler solution, skip the ROM range scans (and the otherwise- necessary range validation) during SEV-SNP guest early boot. The potential SEV-SNP guest crash due to lack of ROM range validation is thus avoided by simply not accessing the ROM range.
In most cases, skip the scans by overriding problematic x86_init functions during sme_early_init() to SNP-safe variants, which can be likened to x86_init overrides done for other platforms (ex: Xen); such overrides also avoid the spread of cc_platform_has() checks throughout the tree.
In the exceptional EISA case, still use cc_platform_has() for the simplest change, given (1) checks for guest type (ex: Xen domain status) are already performed here, and (2) these checks occur in a subsys initcall instead of an x86_init function.
[ bp: Massage commit message, remove "we"s. ]
--- arch/x86/include/asm/sev.h | 4 ++-- arch/x86/include/asm/x86_init.h | 3 ++- arch/x86/kernel/eisa.c | 3 ++- arch/x86/kernel/probe_roms.c | 10 ---------- arch/x86/kernel/setup.c | 3 +-- arch/x86/kernel/sev.c | 27 ++++++++++++--------------- arch/x86/kernel/x86_init.c | 2 ++ arch/x86/mm/mem_encrypt_amd.c | 18 ++++++++++++++++++ 8 files changed, 39 insertions(+), 31 deletions(-)
arch/x86/include/asm/sev.h +2 -2
@@ -203,12 +203,12 @@ void __init early_snp_set_memory_private unsigned long npages);void __init early_snp_set_memory_shared (unsigned long vaddr,unsigned long paddr,unsigned long npages); -void __init snp_prep_memory (unsigned long paddr,unsigned int sz,enum psc_op op);void snp_set_memory_shared (unsigned long vaddr,unsigned long npages);void snp_set_memory_private (unsigned long vaddr,unsigned long npages);void snp_set_wakeup_secondary_cpu (void );bool snp_init (struct boot_params *bp);void __init __noreturn snp_abort (void ); +void snp_dmi_setup (void );int snp_issue_guest_request (u64 exit_code,struct snp_req_data *input,struct snp_guest_request_ioctl *rio);void snp_accept_memory (phys_addr_t start,phys_addr_t end);u64 snp_get_unsupported_features (u64 status);
@@ -227,12 +227,12 @@ static inline void __init early_snp_set_memory_private(unsigned long vaddr, unsigned long paddr, unsigned long npages) { }static inline void __init early_snp_set_memory_shared (unsigned long vaddr,unsigned long paddr,unsigned long npages) { } -static inline void __init snp_prep_memory (unsigned long paddr,unsigned int sz,enum psc_op op) { }static inline void snp_set_memory_shared (unsigned long vaddr,unsigned long npages) { }static inline void snp_set_memory_private (unsigned long vaddr,unsigned long npages) { }static inline void snp_set_wakeup_secondary_cpu (void ) { }static inline bool snp_init (struct boot_params *bp) {return false; }static inline void snp_abort (void ) { } +static inline void snp_dmi_setup (void ) { }static inline int snp_issue_guest_request (u64 exit_code,struct snp_req_data *input,struct snp_guest_request_ioctl *rio) {return -ENOTTY ;
arch/x86/include/asm/x86_init.h +2 -1
@@ -30,12 +30,13 @@ struct x86_init_mpparse {* @reserve_resources: reserve the standard resources for the * platform * @memory_setup: platform specific memory setup -* +* @dmi_setup: platform specific DMI setup */ struct x86_init_resources {void (*probe_roms)(void );void (*reserve_resources)(void );char *(*memory_setup)(void ); +void (*dmi_setup)(void ); };/**
arch/x86/kernel/eisa.c +2 -1
@@ -2,6 +2,7 @@/* * EISA specific code */ +#include <linux/cc_platform.h> #include <linux/ioport.h> #include <linux/eisa.h> #include <linux/io.h>
@@ -12,7 +13,7 @@ static __init int eisa_bus_probe(void) {void __iomem *p; -if (xen_pv_domain () && !xen_initial_domain ()) +if ((xen_pv_domain () && !xen_initial_domain ()) ||cc_platform_has (CC_ATTR_GUEST_SEV_SNP ))return 0 ; p =ioremap (0x0FFFD9 ,4 );
arch/x86/kernel/probe_roms.c +0 -10
@@ -203,16 +203,6 @@ void __init probe_roms(void)unsigned char c;int i; -/* -* The ROM memory range is not part of the e820 table and is therefore not -* pre-validated by BIOS. The kernel page table maps the ROM region as encrypted -* memory, and SNP requires encrypted memory to be validated before access. -* Do that here. -*/ -snp_prep_memory (video_rom_resource.start, - ((system_rom_resource.end +1 ) - video_rom_resource.start), -SNP_PAGE_STATE_PRIVATE ); -/* video rom */ upper = adapter_rom_resources[0 ].start;for (start = video_rom_resource.start; start < upper; start +=2048 ) {
arch/x86/kernel/setup.c +1 -2
@@ -9,7 +9,6 @@#include <linux/console.h> #include <linux/crash_dump.h> #include <linux/dma-map-ops.h> -#include <linux/dmi.h> #include <linux/efi.h> #include <linux/ima.h> #include <linux/init_ohci1394_dma.h>
@@ -902,7 +901,7 @@ void __init setup_arch(char **cmdline_p)efi_init ();reserve_ibft_region (); -dmi_setup (); + x86_init.resources.dmi_setup ();/* * VMware detection requires dmi to be available, so this
arch/x86/kernel/sev.c +12 -15
@@ -23,6 +23,7 @@#include <linux/platform_device.h> #include <linux/io.h> #include <linux/psp-sev.h> +#include <linux/dmi.h> #include <uapi/linux/sev-guest.h> #include <asm/cpu_entry_area.h>
@@ -774,21 +775,6 @@ void __init early_snp_set_memory_shared(early_set_pages_state (vaddr, paddr, npages,SNP_PAGE_STATE_SHARED ); } -void __init snp_prep_memory (unsigned long paddr,unsigned int sz,enum psc_op op) -{ -unsigned long vaddr, npages; - - vaddr = (unsigned long )__va (paddr); - npages =PAGE_ALIGN (sz) >>PAGE_SHIFT ; - -if (op ==SNP_PAGE_STATE_PRIVATE ) -early_snp_set_memory_private (vaddr, paddr, npages); -else if (op ==SNP_PAGE_STATE_SHARED ) -early_snp_set_memory_shared (vaddr, paddr, npages); -else -WARN (1 ,"invalid memory op %d\n" , op); -} -static unsigned long __set_pages_state (struct snp_psc_desc *data,unsigned long vaddr,unsigned long vaddr_end,int op) {
@@ -2112,6 +2098,17 @@ void __init __noreturn snp_abort(void)sev_es_terminate (SEV_TERM_SET_GEN ,GHCB_SNP_UNSUPPORTED ); } +/* +* SEV-SNP guests should only execute dmi_setup() if EFI_CONFIG_TABLES are +* enabled, as the alternative (fallback) logic for DMI probing in the legacy +* ROM region can cause a crash since this region is not pre-validated. +*/ +void __init snp_dmi_setup (void ) +{ +if (efi_enabled (EFI_CONFIG_TABLES )) +dmi_setup (); +} +static void dump_cpuid_table (void ) {const struct snp_cpuid_table *cpuid_table =snp_cpuid_get_table ();
arch/x86/kernel/x86_init.c +2 -0
@@ -3,6 +3,7 @@* * For licencing details see kernel-base/COPYING */ +#include <linux/dmi.h> #include <linux/init.h> #include <linux/ioport.h> #include <linux/export.h>
@@ -66,6 +67,7 @@ struct x86_init_ops x86_init __initdata .probe_roms = probe_roms, .reserve_resources = reserve_standard_io_resources, .memory_setup = e820__memory_setup_default, + .dmi_setup = dmi_setup, }, .mpparse = {
arch/x86/mm/mem_encrypt_amd.c +18 -0
@@ -492,6 +492,24 @@ void __init sme_early_init(void)*/ if (sev_status &MSR_AMD64_SEV_ENABLED )ia32_disable (); + +/* +* Override init functions that scan the ROM region in SEV-SNP guests, +* as this memory is not pre-validated and would thus cause a crash. +*/ +if (sev_status &MSR_AMD64_SEV_SNP_ENABLED ) { + x86_init.mpparse.find_smp_config = x86_init_noop; + x86_init.pci.init_irq = x86_init_noop; + x86_init.resources.probe_roms = x86_init_noop; + +/* +* DMI setup behavior for SEV-SNP guests depends on +* efi_enabled(EFI_CONFIG_TABLES), which hasn't been +* parsed yet. snp_dmi_setup() will run after that +* parsing has happened. +*/ + x86_init.resources.dmi_setup = snp_dmi_setup; + } }void __init mem_encrypt_free_decrypted_mem (void )
Greg Kroah-Hartman
maintainerPATCH 399/399 tools/resolve_btfids: fix build with musl libc
In reply to Greg Kroah-Hartman6.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Natanael Copa <[email protected]>
commit 62248b22d01e96a4d669cde0d7005bd51ebf9e76 upstream.
Include the header that defines u32.
This fixes build of 6.6.23 and 6.1.83 kernels for Alpine Linux, which uses musl libc. I assume that GNU libc indirecly pulls in linux/types.h.
--- tools/include/linux/btf_ids.h | 2 ++ 1 file changed, 2 insertions(+)
tools/include/linux/btf_ids.h +2 -0
@@ -3,6 +3,8 @@ #ifndef _LINUX_BTF_IDS_H #define _LINUX_BTF_IDS_H +#include <linux/types.h> /* for u32 */ + struct btf_id_set { u32 cnt; u32 ids[];
Hello,
Quoted 5 lines · On Mon, 1 Apr 2024 17:39:26 +0200 Greg Kroah-Hartman…
This is the start of the stable review cycle for the 6.8.3 release. There are 399 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.
Quoted 8 lines
Responses should be made by Wed, 03 Apr 2024 15:24:46 +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.8.3-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-6.8.y
and the diffstat can be found below.
This rc kernel passes DAMON functionality test[1] on my test machine. Attaching the test results summary below. Please note that I retrieved the kernel from linux-stable-rc tree[2].
[1] https://github.com/awslabs/damon-tests/tree/next/corr
[2] bffeaccf18b5 ("Linux 6.8.3-rc1")
Thanks,
SJ
[...]
---
ok 2 selftests: damon: debugfs_schemes.sh
ok 3 selftests: damon: debugfs_target_ids.sh
ok 4 selftests: damon: debugfs_empty_targets.sh
ok 5 selftests: damon: debugfs_huge_count_read_write.sh
ok 6 selftests: damon: debugfs_duplicate_context_creation.sh
ok 7 selftests: damon: debugfs_rm_non_contexts.sh
ok 8 selftests: damon: sysfs.sh
ok 9 selftests: damon: sysfs_update_removed_scheme_dir.sh
ok 10 selftests: damon: sysfs_update_schemes_tried_regions_hang.py ok 11 selftests: damon: sysfs_update_schemes_tried_regions_wss_estimation.py ok 12 selftests: damon: reclaim.sh
ok 13 selftests: damon: lru_sort.sh
ok 1 selftests: damon-tests: kunit.sh
ok 2 selftests: damon-tests: huge_count_read_write.sh
ok 3 selftests: damon-tests: buffer_overflow.sh
ok 4 selftests: damon-tests: rm_contexts.sh
ok 5 selftests: damon-tests: record_null_deref.sh
ok 6 selftests: damon-tests: dbgfs_target_ids_read_before_terminate_race.sh ok 7 selftests: damon-tests: dbgfs_target_ids_pid_leak.sh
ok 8 selftests: damon-tests: damo_tests.sh
ok 9 selftests: damon-tests: masim-record.sh
ok 10 selftests: damon-tests: build_i386.sh
ok 11 selftests: damon-tests: build_arm64.sh
ok 12 selftests: damon-tests: build_m68k.sh
ok 13 selftests: damon-tests: build_i386_idle_flag.sh
ok 14 selftests: damon-tests: build_i386_highpte.sh
ok 15 selftests: damon-tests: build_nomemcg.sh
[33m
[92mPASS [39m
Quoted 10 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 6.8.3 release. There are 399 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 Wed, 03 Apr 2024 15:24:46 +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.8.3-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-6.8.y
and the diffstat can be found below.thanks,
greg k-h
Following kernel warnings have been noticed on qemu-x86_64 while running LTP cve ioctl_sg01 tests the kernel with stable-rc 6.6.24-rc1, 6.7.12-rc1 and 6.8.3-rc1.
We have started bi-secting this issue.
Always reproduced.
ioctl_sg01.c:81: TINFO: Found SCSI device /dev/sg0
------------[ cut here ]------------ [ 36.606841] WARNING: CPU: 0 PID: 8 at drivers/scsi/sg.c:2237 sg_remove_sfp_usercontext+0x145/0x150 [ 36.609445] Modules linked in: [ 36.610793] CPU: 0 PID: 8 Comm: kworker/0:0 Not tainted 6.6.24-rc1 #1 [ 36.611568] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2~bpo12+1 04/01/2014 [ 36.612872] Workqueue: events sg_remove_sfp_usercontext [ 36.613691] RIP: 0010:sg_remove_sfp_usercontext+0x145/0x150
<trim>
[ 36.621539] Call Trace: [ 36.621953] <TASK> [ 36.622444] ? show_regs+0x69/0x80 [ 36.622819] ? __warn+0x8d/0x150 [ 36.623078] ? sg_remove_sfp_usercontext+0x145/0x150 [ 36.623558] ? report_bug+0x171/0x1a0 [ 36.623881] ? handle_bug+0x42/0x80 [ 36.624070] ? exc_invalid_op+0x1c/0x70 [ 36.624491] ? asm_exc_invalid_op+0x1f/0x30 [ 36.624897] ? sg_remove_sfp_usercontext+0x145/0x150 [ 36.625408] process_one_work+0x141/0x300 [ 36.625769] worker_thread+0x2f6/0x430 [ 36.626073] ? __pfx_worker_thread+0x10/0x10 [ 36.626529] kthread+0x105/0x140 [ 36.626778] ? __pfx_kthread+0x10/0x10 [ 36.627059] ret_from_fork+0x41/0x60 [ 36.627441] ? __pfx_kthread+0x10/0x10 [ 36.627735] ret_from_fork_asm+0x1b/0x30 [ 36.628293] </TASK> [ 36.628604] ---[ end trace 0000000000000000 ]---
ioctl_sg01.c:122: TPASS: Output buffer is empty, no data leaked
Suspecting commit:
-----
scsi: sg: Avoid sg device teardown race
commit 27f58c04a8f438078583041468ec60597841284d upstream.
+ WARN_ON_ONCE(kref_read(&sdp->d_ref) != 1);
Steps to reproduce:
- https://tuxapi.tuxsuite.com/v1/groups/linaro/projects/lkft/tests/2eVWFlAeOUepfeFVkrOXFYNNAqI/reproducer
Links:
- https://qa-reports.linaro.org/lkft/linux-stable-rc-linux-6.6.y/build/v6.6.23-397-g75a2533b74d0/testrun/23255318/suite/log-parser-test/tests/
- https://tuxapi.tuxsuite.com/v1/groups/linaro/projects/lkft/tests/2eVTitwVMagaiWhs5T2iKH390D5
--
Linaro LKFT
https://lkft.linaro.org
Quoted 10 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 6.8.3 release. There are 399 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 Wed, 03 Apr 2024 15:24:46 +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.8.3-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-6.8.y
and the diffstat can be found below.thanks,
greg k-h
The following kernel BUG: unable to handle page fault for address and followed by Kernel panic - not syncing: Fatal exception in interrupt noticed on the qemu-i386 running selftests: net: pmtu.sh test case and the kernel built with kselftest merge net configs with clang.
We are investigating this problem on qemu-i386.
# selftests: net: pmtu.sh
# TEST: ipv4: PMTU exceptions [ OK ] # TEST: ipv4: PMTU exceptions - nexthop objects [ OK ] # TEST: ipv6: PMTU exceptions [ OK ] <trim> # TEST: ipv4: cleanup of cached exceptions [ OK ] # TEST: ipv4: cleanup of cached exceptions - nexthop objects [ OK ] # TEST: ipv6: cleanup of cached exceptions [ OK ] # TEST: ipv6: cleanup of cached exceptions - nexthop objects [ OK ] <1>[ 577.550133] BUG: unable to handle page fault for address: 26c2e000 <1>[ 577.555420] #PF: supervisor read access in kernel mode <1>[ 577.555881] #PF: error_code(0x0000) - not-present page <6>[ 577.556265] *pde = 00000000 <4>[ 577.558166] Oops: 0000 [#1] PREEMPT SMP <4>[ 577.559142] CPU: 1 PID: 59 Comm: kworker/u4:5 Not tainted 6.8.3-rc1 #1 <4>[ 577.560387] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2~bpo12+1 04/01/2014 <4>[ 577.561517] Workqueue: netns cleanup_net <4>[ 577.563500] EIP: percpu_counter_add_batch+0x38/0xc0
<trim>
<4>[ 577.569244] Call Trace: <4>[ 577.570414] <SOFTIRQ> <4>[ 577.571182] ? __die_body+0x56/0xa0 <4>[ 577.571635] ? __die+0x6b/0x80 <4>[ 577.571877] ? page_fault_oops+0x296/0x2e0 <4>[ 577.572169] ? kernelmode_fixup_or_oops+0xa0/0xb0 <4>[ 577.572535] ? __bad_area_nosemaphore+0x43/0x180 <4>[ 577.572856] ? bad_area_nosemaphore+0xd/0x20 <4>[ 577.573186] ? do_user_addr_fault+0x314/0x400 <4>[ 577.573524] ? exc_page_fault+0x49/0xa0 <4>[ 577.573807] ? pvclock_clocksource_read_nowd+0xec/0xec <4>[ 577.574143] ? dst_release+0x60/0x60 <4>[ 577.574408] ? handle_exception+0x14b/0x14b <4>[ 577.574706] ? dst_release+0x60/0x60 <4>[ 577.574990] ? pvclock_clocksource_read_nowd+0xec/0xec <4>[ 577.575340] ? percpu_counter_add_batch+0x38/0xc0 <4>[ 577.575664] ? pvclock_clocksource_read_nowd+0xec/0xec <4>[ 577.576005] ? percpu_counter_add_batch+0x38/0xc0 <4>[ 577.576333] ? dst_release+0x60/0x60 <4>[ 577.576594] dst_destroy+0x34/0xe0 <4>[ 577.577017] dst_destroy_rcu+0xb/0x10 <4>[ 577.577298] rcu_core+0x3f5/0x920 <4>[ 577.577561] rcu_core_si+0x8/0x10 <4>[ 577.577803] __do_softirq+0xa8/0x23e <4>[ 577.578088] ? __lock_text_end+0x3/0x3 <4>[ 577.578353] do_softirq_own_stack+0x50/0x60 <4>[ 577.578744] </SOFTIRQ> <4>[ 577.578974] ? sysvec_call_function_single+0x2c/0x2c <4>[ 577.579313] irq_exit_rcu+0x3a/0x80 <4>[ 577.579574] sysvec_apic_timer_interrupt+0x1f/0x30 <4>[ 577.579893] handle_exception+0x14b/0x14b <4>[ 577.580315] EIP: rb_erase+0x1aa/0x270
<trim>
<4>[ 577.581832] ? sysvec_call_function_single+0x2c/0x2c <4>[ 577.582101] ? sysvec_call_function_single+0x2c/0x2c <4>[ 577.582361] ? rb_erase+0x1aa/0x270 <4>[ 577.582631] remove_proc_entry+0xce/0x1a0 <4>[ 577.582959] tcp4_proc_exit_net+0x10/0x20 <4>[ 577.583251] cleanup_net+0x1fb/0x350 <4>[ 577.583515] process_scheduled_works+0x1e1/0x3a0 <4>[ 577.583837] worker_thread+0x294/0x3c0 <4>[ 577.584112] kthread+0x13a/0x150 <4>[ 577.584348] ? pr_cont_work+0x180/0x180 <4>[ 577.584624] ? kthread_blkcg+0x30/0x30 <4>[ 577.584892] ? kthread_blkcg+0x30/0x30 <4>[ 577.585175] ret_from_fork+0x2b/0x40 <4>[ 577.585433] ret_from_fork_asm+0x12/0x18 <4>[ 577.585734] entry_INT80_32+0x108/0x108 <4>[ 577.586133] Modules linked in: xfrm_user ipip bridge stp llc
geneve vxlan act_csum act_pedit cls_flower sch_prio xt_mark nft_compat nf_tables libcrc32c sch_ingress act_mirred cls_basic sch_fq_codel vrf macvtap macvlan tap ip_tables x_tables [last unloaded:test_blackhole_dev]
<4>[ 577.588292] CR2: 0000000026c2e000 <4>[ 577.589067] ---[ end trace 0000000000000000 ]--- <4>[ 577.589465] EIP: percpu_counter_add_batch+0x38/0xc0
<trim>
<0>[ 577.592536] Kernel panic - not syncing: Fatal exception in interrupt <0>[ 577.598118] Kernel Offset: disabled <0>[ 577.598605] ---[ end Kernel panic - not syncing: Fatal exception
in interrupt ]---
Steps to reproduce:
-----
- https://tuxapi.tuxsuite.com/v1/groups/linaro/projects/lkft/tests/2eVRrC1WkGHyPnNFg2O7ZvT2Vgy/reproducer
Links:
- https://qa-reports.linaro.org/lkft/linux-stable-rc-linux-6.8.y/build/v6.8.2-400-gbffeaccf18b5/testrun/23255383/suite/log-parser-test/test/check-kernel-bug/log
- https://qa-reports.linaro.org/lkft/linux-stable-rc-linux-6.8.y/build/v6.8.2-400-gbffeaccf18b5/testrun/23255383/suite/log-parser-test/tests/
- https://tuxapi.tuxsuite.com/v1/groups/linaro/projects/lkft/tests/2eVRrC1WkGHyPnNFg2O7ZvT2Vgy
--
Linaro LKFT
https://lkft.linaro.org
Jakub Kicinski
maintainerQuoted 6 lines · On Tue, 2 Apr 2024 01:10:11 +0530 Naresh Kamboju wrote:
The following kernel BUG: unable to handle page fault for address and followed by Kernel panic - not syncing: Fatal exception in interrupt noticed on the qemu-i386 running selftests: net:
pmtu.shtest case and the kernel built with kselftest merge net configs with clang.We are investigating this problem on qemu-i386.
One-off or does it repro?
Quoted 10 lines · Jakub Kicinski
Quoted 6 lines · On Tue, 2 Apr 2024 01:10:11 +0530 Naresh Kamboju wrote:
The following kernel BUG: unable to handle page fault for address and followed by Kernel panic - not syncing: Fatal exception in interrupt noticed on the qemu-i386 running selftests: net:
pmtu.shtest case and the kernel built with kselftest merge net configs with clang.We are investigating this problem on qemu-i386.
One-off or does it repro?
one-off.
I have tried reproducing this problem and no luck yet.
- Naresh
Hi!
Quoted 4 lines
This is the start of the stable review cycle for the 6.8.3 release. There are 399 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.
CIP runs testing on 6.8, 6.7 and 6.6. 6.8 and 6.7 tested out okay, 6.6 is still running last test.
Best regards,
Pavel
Signature · 2 lines
DENX Software Engineering GmbH, Managing Director: Erika Unter HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Quoted 9 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 6.8.3 release. There are 399 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 Wed, 03 Apr 2024 15:24:46 +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.8.3-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-6.8.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
Quoted 9 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 6.8.3 release. There are 399 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 Wed, 03 Apr 2024 15:24:46 +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.8.3-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-6.8.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.8.3 release. There are 399 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 Wed, 03 Apr 2024 15:24:46 +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.8.3-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-6.8.y
and the diffstat can be found below.thanks,
greg k-h
Built and booted successfully on RISC-V RV64 (HiFive Unmatched).
Quoted 5 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 6.8.3 release. There are 399 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 compiled and installed the kernel on my computer (Acer Aspire E15, Intel Core i3 Haswell). No noticeable regressions.
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.8.3 release. There are 399 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 Wed, 03 Apr 2024 15:24:46 +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.8.3-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-6.8.y
and the diffstat can be found below.thanks,
greg k-h
Results from Linaro’s test farm.
Regressions on arm64, arm, x86_64, and i386 with libgpiod tests.
libgpiod test regressions noticed on Linux stable-rc 6.8, 6.7 and 6.6 and Linux next and mainline master.
Anders bisected and found this first bad commit,
gpio: cdev: sanitize the label before requesting the interrupt commit b34490879baa847d16fc529c8ea6e6d34f004b38 upstream.
LKFT is running libgpiod test suite version
v2.0.1-0-gae275c3 ( and also tested v2.1 )
libgpiod
- _gpiod_edge-event_edge_event_wait_timeout
- _gpiod_edge-event_event_copy
- _gpiod_edge-event_null_buffer
- _gpiod_edge-event_read_both_events
- _gpiod_edge-event_read_both_events_blocking
- _gpiod_edge-event_read_falling_edge_event
- _gpiod_edge-event_read_rising_edge_event
- _gpiod_edge-event_read_rising_edge_event_polled
- _gpiod_edge-event_reading_more_events_than_the_queue_contains_doesnt_block
- _gpiod_edge-event_seqno
- _gpiod_line-info_edge_detection_settings
Test log:
-------
ok 16 /gpiod/edge-event/edge_event_buffer_max_capacity
** gpiod-test:ERROR:tests-edge-event.c:52:_gpiod_test_func_edge_event_wait_timeout:
'_request' should not be NULL
# gpiod-test:ERROR:tests-edge-event.c:52:_gpiod_test_func_edge_event_wait_timeout:
'_request' should not be NULL
not ok 17 /gpiod/edge-event/edge_event_wait_timeout
ok 18 /gpiod/edge-event/cannot_request_lines_in_output_mode_with_edge_detection ** gpiod-test:ERROR:tests-edge-event.c:125:_gpiod_test_func_read_both_events:
'_request' should not be NULL
# gpiod-test:ERROR:tests-edge-event.c:125:_gpiod_test_func_read_both_events:
'_request' should not be NULL
not ok 19 /gpiod/edge-event/read_both_events
## Build
* kernel: 6.8.3-rc1
* git: https://gitlab.com/Linaro/lkft/mirrors/stable/linux-stable-rc
* git branch: linux-6.8.y
* git commit: bffeaccf18b5433577a5f823e5b98bee675d530c
* git describe: v6.8.2-400-gbffeaccf18b5
* test details:
https://qa-reports.linaro.org/lkft/linux-stable-rc-linux-6.8.y/build/v6.8.2-400-gbffeaccf18b5
## Test Regressions (compared to v6.8.2)
* libgpiod
- _gpiod_edge-event_edge_event_wait_timeout
- _gpiod_edge-event_event_copy
- _gpiod_edge-event_null_buffer
- _gpiod_edge-event_read_both_events
- _gpiod_edge-event_read_both_events_blocking
- _gpiod_edge-event_read_falling_edge_event
- _gpiod_edge-event_read_rising_edge_event
- _gpiod_edge-event_read_rising_edge_event_polled
- _gpiod_edge-event_reading_more_events_than_the_queue_contains_doesnt_block
- _gpiod_edge-event_seqno
- _gpiod_line-info_edge_detection_settings
## Metric Regressions (compared to v6.8.2)
## Test Fixes (compared to v6.8.2)
## Metric Fixes (compared to v6.8.2)
## Test result summary
total: 256232, pass: 222485, fail: 2538, skip: 30869, xfail: 340
## Build Summary
* arc: 5 total, 5 passed, 0 failed
* arm: 130 total, 128 passed, 2 failed
* arm64: 41 total, 40 passed, 1 failed
* i386: 32 total, 32 passed, 0 failed
* mips: 26 total, 26 passed, 0 failed
* parisc: 4 total, 4 passed, 0 failed
* powerpc: 36 total, 36 passed, 0 failed
* riscv: 18 total, 18 passed, 0 failed
* s390: 13 total, 13 passed, 0 failed
* sh: 10 total, 10 passed, 0 failed
* sparc: 8 total, 6 passed, 2 failed
* x86_64: 36 total, 35 passed, 1 failed
## Test suites summary
* boot
* kselftest-arm64
* kselftest-breakpoints
* kselftest-capabilities
* kselftest-cgroup
* kselftest-clone3
* kselftest-core
* kselftest-cpu-hotplug
* kselftest-cpufreq
* kselftest-efivarfs
* kselftest-exec
* kselftest-filesystems
* kselftest-filesystems-binderfs
* kselftest-filesystems-epoll
* kselftest-firmware
* kselftest-fpu
* kselftest-ftrace
* kselftest-futex
* kselftest-gpio
* kselftest-intel_pstate
* kselftest-ipc
* kselftest-kcmp
* kselftest-kvm
* kselftest-livepatch
* kselftest-membarrier
* kselftest-mincore
* kselftest-mqueue
* kselftest-net
* kselftest-net-mptcp
* kselftest-openat2
* kselftest-ptrace
* kselftest-rseq
* kselftest-rtc
* kselftest-seccomp
* kselftest-sigaltstack
* kselftest-size
* kselftest-tc-testing
* kselftest-timers
* kselftest-tmpfs
* kselftest-tpm2
* kselftest-user_events
* kselftest-vDSO
* kselftest-watchdog
* kselftest-x86
* kunit
* libgpiod
* 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-hugetlb
* ltp-io
* ltp-ipc
* ltp-math
* ltp-mm
* ltp-nptl
* ltp-pty
* ltp-sched
* ltp-securebits
* ltp-smoke
* ltp-smoketest
* ltp-syscalls
* ltp-tracing
* perf
* rcutorture
--
Linaro LKFT
https://lkft.linaro.org
Quoted 9 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 6.8.3 release. There are 399 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 Wed, 03 Apr 2024 15:24:46 +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.8.3-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-6.8.y
and the diffstat can be found below.thanks,
greg k-h
Tested rc1 against the Fedora build system (aarch64, ppc64le, s390x, x86_64), and boot tested x86_64. No regressions noted.
Quoted 4 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 6.8.3 release. There are 399 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.
Hi Greg,
Quoted 9 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 6.8.3 release. There are 399 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 Wed, 03 Apr 2024 15:24:46 +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.8.3-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-6.8.y
and the diffstat can be found below.thanks,
greg k-h
We have two test failures ...
Test results for stable-v6.8:
10 builds: 10 pass, 0 fail
26 boots: 26 pass, 0 fail
116 tests: 114 pass, 2 failLinux version: 6.8.3-rc1-gbffeaccf18b5
Boards tested: tegra124-jetson-tk1, tegra186-p2771-0000,
tegra194-p2972-0000, tegra194-p3509-0000+p3668-0000,
tegra20-ventana, tegra210-p2371-2180,
tegra210-p3450-0000, tegra30-cardhu-a04Test failures: tegra186-p2771-0000: pm-system-suspend.sh
tegra194-p2972-0000: boot.py
1. The system suspend regression appears to be a new regression from v6.8.2 related to some workqueue changes and I have reported this here [0].
2. The boot.py is a kernel warning that we observed with v6.8 and still see with v6.9-rc2. There is a fix in the works and I am checking on this [1]. This is not a regression for v6.8.y but a known issue.
Jon
[0] https://lore.kernel.org/stable/[email protected]/
[1] https://lore.kernel.org/linux-tegra/[email protected]/T/#t
Signature · 1 line
nvpublic