Skip to content

block: add a bio_init_inline helper#188

Closed
blktests-ci[bot] wants to merge 2 commits intolinus-master_basefrom
series/999965=>linus-master
Closed

block: add a bio_init_inline helper#188
blktests-ci[bot] wants to merge 2 commits intolinus-master_basefrom
series/999965=>linus-master

Conversation

@blktests-ci
Copy link
Copy Markdown

@blktests-ci blktests-ci Bot commented Sep 8, 2025

Pull request for series with
subject: block: add a bio_init_inline helper
version: 1
url: https://patchwork.kernel.org/project/linux-block/list/?series=999965

@blktests-ci
Copy link
Copy Markdown
Author

blktests-ci Bot commented Sep 8, 2025

Upstream branch: 76eeb9b
series: https://patchwork.kernel.org/project/linux-block/list/?series=999965
version: 1

@blktests-ci
Copy link
Copy Markdown
Author

blktests-ci Bot commented Sep 8, 2025

Upstream branch: f777d11
series: https://patchwork.kernel.org/project/linux-block/list/?series=999965
version: 1

@blktests-ci blktests-ci Bot force-pushed the series/999965=>linus-master branch from 2671bac to 23949dc Compare September 8, 2025 23:59
@blktests-ci
Copy link
Copy Markdown
Author

blktests-ci Bot commented Sep 9, 2025

Upstream branch: f777d11
series: https://patchwork.kernel.org/project/linux-block/list/?series=999965
version: 1

@blktests-ci blktests-ci Bot force-pushed the series/999965=>linus-master branch from 23949dc to 4f67034 Compare September 9, 2025 08:18
@blktests-ci
Copy link
Copy Markdown
Author

blktests-ci Bot commented Sep 9, 2025

Upstream branch: f777d11
series: https://patchwork.kernel.org/project/linux-block/list/?series=999965
version: 1

@blktests-ci blktests-ci Bot force-pushed the series/999965=>linus-master branch from 4f67034 to 0aeaeb7 Compare September 9, 2025 08:45
@blktests-ci
Copy link
Copy Markdown
Author

blktests-ci Bot commented Sep 9, 2025

Upstream branch: f777d11
series: https://patchwork.kernel.org/project/linux-block/list/?series=999965
version: 1

@blktests-ci blktests-ci Bot force-pushed the series/999965=>linus-master branch from 0aeaeb7 to c410a91 Compare September 9, 2025 08:54
@blktests-ci
Copy link
Copy Markdown
Author

blktests-ci Bot commented Sep 11, 2025

Upstream branch: 7aac719
series: https://patchwork.kernel.org/project/linux-block/list/?series=999965
version: 1

@blktests-ci blktests-ci Bot force-pushed the series/999965=>linus-master branch from c410a91 to bbf325e Compare September 11, 2025 08:18
@blktests-ci
Copy link
Copy Markdown
Author

blktests-ci Bot commented Sep 12, 2025

Upstream branch: 320475f
series: https://patchwork.kernel.org/project/linux-block/list/?series=999965
version: 1

@blktests-ci blktests-ci Bot force-pushed the series/999965=>linus-master branch from bbf325e to 85d6d9d Compare September 12, 2025 01:42
@blktests-ci
Copy link
Copy Markdown
Author

blktests-ci Bot commented Sep 13, 2025

Upstream branch: 22f2037
series: https://patchwork.kernel.org/project/linux-block/list/?series=999965
version: 1

@blktests-ci blktests-ci Bot force-pushed the series/999965=>linus-master branch from 85d6d9d to ed4119b Compare September 13, 2025 00:41
@blktests-ci
Copy link
Copy Markdown
Author

blktests-ci Bot commented Sep 16, 2025

Upstream branch: 46a51f4
series: https://patchwork.kernel.org/project/linux-block/list/?series=999965
version: 1

@blktests-ci blktests-ci Bot force-pushed the series/999965=>linus-master branch from ed4119b to 8772668 Compare September 16, 2025 02:24
@blktests-ci
Copy link
Copy Markdown
Author

blktests-ci Bot commented Sep 17, 2025

Upstream branch: 5aca796
series: https://patchwork.kernel.org/project/linux-block/list/?series=999965
version: 1

@blktests-ci blktests-ci Bot force-pushed the series/999965=>linus-master branch from 8772668 to 7e129e0 Compare September 17, 2025 00:40
@blktests-ci
Copy link
Copy Markdown
Author

blktests-ci Bot commented Sep 18, 2025

Upstream branch: 992d4e4
series: https://patchwork.kernel.org/project/linux-block/list/?series=999965
version: 1

@blktests-ci blktests-ci Bot force-pushed the series/999965=>linus-master branch from 7e129e0 to c427ef1 Compare September 18, 2025 00:45
@blktests-ci
Copy link
Copy Markdown
Author

blktests-ci Bot commented Sep 18, 2025

Upstream branch: 8b789f2
series: https://patchwork.kernel.org/project/linux-block/list/?series=999965
version: 1

@blktests-ci blktests-ci Bot force-pushed the series/999965=>linus-master branch from c427ef1 to e64db37 Compare September 18, 2025 09:03
@blktests-ci
Copy link
Copy Markdown
Author

blktests-ci Bot commented Sep 19, 2025

Upstream branch: 097a6c3
series: https://patchwork.kernel.org/project/linux-block/list/?series=999965
version: 1

@blktests-ci blktests-ci Bot force-pushed the series/999965=>linus-master branch from e64db37 to ec6dc35 Compare September 19, 2025 00:13
@blktests-ci
Copy link
Copy Markdown
Author

blktests-ci Bot commented Sep 22, 2025

Upstream branch: 07e27ad
series: https://patchwork.kernel.org/project/linux-block/list/?series=999965
version: 1

@blktests-ci blktests-ci Bot force-pushed the series/999965=>linus-master branch from ec6dc35 to 84c689e Compare September 22, 2025 00:26
@blktests-ci
Copy link
Copy Markdown
Author

blktests-ci Bot commented Sep 22, 2025

Upstream branch: 07e27ad
series: https://patchwork.kernel.org/project/linux-block/list/?series=999965
version: 1

Christoph Hellwig added 2 commits September 22, 2025 09:45
Just a simpler wrapper around bio_init for callers that want to
initialize a bio with inline bvecs.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Yu Kuai <yukuai3@huawei.com>
Reviewed-by: John Garry <john.g.garry@oracle.com>
Bios are embedded into other structures, and at least spare is unhappy
about embedding structures with variable sized arrays.  There's no
real need to the array anyway, we can replace it with a helper pointing
to the memory just behind the bio, and with the previous cleanups there
is very few site doing anything special with it.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: John Garry <john.g.garry@oracle.com>
@blktests-ci blktests-ci Bot force-pushed the series/999965=>linus-master branch from 84c689e to f30dc46 Compare September 22, 2025 00:45
@kawasaki kawasaki closed this Sep 22, 2025
@blktests-ci blktests-ci Bot deleted the series/999965=>linus-master branch September 24, 2025 02:37
blktests-ci Bot pushed a commit that referenced this pull request Feb 17, 2026
On MIPS, __current_thread_info is defined as global register variable
locating in $gp, and is simply assigned with new address during kernel
relocation.

This however is broken with LLVM, which always restores $gp if it finds
$gp is clobbered in any form, including when intentionally through a
global register variable. This is against GCC's documentation[1], which
requires a callee-saved register used as global register variable not to
be restored if it's clobbered.

As a result, $gp will continue to point to the unrelocated kernel after
the epilog of relocate_kernel(), leading to an early crash in init_idle,

[    0.000000] CPU 0 Unable to handle kernel paging request at virtual address 0000000000000000, epc == ffffffff81afada8, ra == ffffffff81afad90
[    0.000000] Oops[#1]:
[    0.000000] CPU: 0 UID: 0 PID: 0 Comm: swapper Tainted: G        W           6.19.0-rc5-00262-gd3eeb99bbc99-dirty #188 VOLUNTARY
[    0.000000] Tainted: [W]=WARN
[    0.000000] Hardware name: loongson,loongson64v-4core-virtio
[    0.000000] $ 0   : 0000000000000000 0000000000000000 0000000000000001 0000000000000000
[    0.000000] $ 4   : ffffffff80b80ec0 ffffffff80b53d48 0000000000000000 00000000000f4240
[    0.000000] $ 8   : 0000000000000100 ffffffff81d82f80 ffffffff81d82f80 0000000000000001
[    0.000000] $12   : 0000000000000000 ffffffff81776f58 00000000000005da 0000000000000002
[    0.000000] $16   : ffffffff80b80e40 0000000000000000 ffffffff80b81614 9800000005dfbe80
[    0.000000] $20   : 00000000540000e0 ffffffff81980000 0000000000000000 ffffffff80f81c80
[    0.000000] $24   : 0000000000000a26 ffffffff8114fb90
[    0.000000] $28   : ffffffff80b50000 ffffffff80b53d40 0000000000000000 ffffffff81afad90
[    0.000000] Hi    : 0000000000000000
[    0.000000] Lo    : 0000000000000000
[    0.000000] epc   : ffffffff81afada8 init_idle+0x130/0x270
[    0.000000] ra    : ffffffff81afad90 init_idle+0x118/0x270
[    0.000000] Status: 540000e2	KX SX UX KERNEL EXL
[    0.000000] Cause : 00000008 (ExcCode 02)
[    0.000000] BadVA : 0000000000000000
[    0.000000] PrId  : 00006305 (ICT Loongson-3)
[    0.000000] Process swapper (pid: 0, threadinfo=(____ptrval____), task=(____ptrval____), tls=0000000000000000)
[    0.000000] Stack : 9800000005dfbf00 ffffffff8178e950 0000000000000000 0000000000000000
[    0.000000]         0000000000000000 ffffffff81970000 000000000000003f ffffffff810a6528
[    0.000000]         0000000000000001 9800000005dfbe80 9800000005dfbf00 ffffffff81980000
[    0.000000]         ffffffff810a6450 ffffffff81afb6c0 0000000000000000 ffffffff810a2258
[    0.000000]         ffffffff81d82ec8 ffffffff8198d010 ffffffff81b67e80 ffffffff8197dd98
[    0.000000]         ffffffff81d81c80 ffffffff81930000 0000000000000040 0000000000000000
[    0.000000]         0000000000000000 0000000000000000 0000000000000000 0000000000000000
[    0.000000]         0000000000000000 000000000000009e ffffffff9fc01000 0000000000000000
[    0.000000]         0000000000000000 0000000000000000 0000000000000000 0000000000000000
[    0.000000]         0000000000000000 ffffffff81ae86dc ffffffff81b3c741 0000000000000002
[    0.000000]         ...
[    0.000000] Call Trace:
[    0.000000] [<ffffffff81afada8>] init_idle+0x130/0x270
[    0.000000] [<ffffffff81afb6c0>] sched_init+0x5c8/0x6c0
[    0.000000] [<ffffffff81ae86dc>] start_kernel+0x27c/0x7a8

This bug has been reported to LLVM[2] and affects version from (at
least) 18 to 21. Let's work around this by using inline assembly to
assign $gp before a fix is widely available.

Cc: stable@vger.kernel.org
Link: https://gcc.gnu.org/onlinedocs/gcc-15.2.0/gcc/Global-Register-Variables.html # [1]
Link: llvm/llvm-project#176546 # [2]
Signed-off-by: Yao Zi <me@ziyao.cc>
Acked-by: Nathan Chancellor <nathan@kernel.org>
Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant