The two binaries are very small. I will post both.
This is the one with inline(always) (works):
cargo objdump -- -disassemble -no-show-raw-insn -print-imm-hex build/kernel.elf
build/kernel.elf: file format ELF64-aarch64-little
Disassembly of section .text:
0000000004000000 _start:
4000000: mrs x1, MPIDR_EL1
4000004: and x1, x1, #0x3
4000008: cbz x1, #0xc <_start+0x14>
400000c: wfe
4000010: b #-0x4 <_start+0xc>
4000014: adr x1, #-0x14
4000018: mov sp, x1
400001c: bl #0xc <kinit>
4000020: b #-0x14 <_start+0xc>
4000024: udf #0x0
0000000004000028 kinit:
4000028: adrp x8, #0x0
400002c: add x8, x8, #0xc0
4000030: adrp x9, #0x0
4000034: add x9, x9, #0xc0
4000038: cmp x9, x8
400003c: b.hs #0x18 <kinit+0x2c>
4000040: adrp x9, #0x0
4000044: add x9, x9, #0xc0
4000048: str xzr, [x9], #0x8
400004c: cmp x9, x8
4000050: b.lo #-0x8 <kinit+0x20>
4000054: bl #0xc <kmain::h497e3e7b019098a1>
4000058: brk #0x1
400005c: udf #0x0
0000000004000060 kmain::h497e3e7b019098a1:
4000060: mov w8, #0x4
4000064: movk w8, #0x3f20, lsl #16
4000068: ldr w9, [x8]
400006c: orr w10, w9, #0x40000
4000070: mov w9, #0x27c0
4000074: movk w9, #0x9, lsl #16
4000078: str w10, [x8]
400007c: ldr w10, [x8, #0x18]
4000080: orr w11, w10, #0x10000
4000084: mov x10, x9
4000088: str w11, [x8, #0x18]
400008c: subs x10, x10, #0x1
4000090: nop
4000094: b.ne #-0x8 <kmain::h497e3e7b019098a1+0x2c>
4000098: ldr w10, [x8, #0x24]
400009c: orr w11, w10, #0x10000
40000a0: mov x10, x9
40000a4: str w11, [x8, #0x24]
40000a8: subs x10, x10, #0x1
40000ac: nop
40000b0: b.ne #-0x8 <kmain::h497e3e7b019098a1+0x48>
40000b4: b #-0x38 <kmain::h497e3e7b019098a1+0x1c>
The next one is the one with inline(never) (does not work):
cargo objdump -- -disassemble -no-show-raw-insn -print-imm-hex build/kernel.elf
build/kernel.elf: file format ELF64-aarch64-little
Disassembly of section .text:
0000000004000000 _start:
4000000: mrs x1, MPIDR_EL1
4000004: and x1, x1, #0x3
4000008: cbz x1, #0xc <_start+0x14>
400000c: wfe
4000010: b #-0x4 <_start+0xc>
4000014: adr x1, #-0x14
4000018: mov sp, x1
400001c: bl #0xc <kinit>
4000020: b #-0x14 <_start+0xc>
4000024: udf #0x0
0000000004000028 kinit:
4000028: adrp x8, #0x0
400002c: add x8, x8, #0xc0
4000030: adrp x9, #0x0
4000034: add x9, x9, #0xc0
4000038: cmp x9, x8
400003c: b.hs #0x18 <kinit+0x2c>
4000040: adrp x9, #0x0
4000044: add x9, x9, #0xc0
4000048: str xzr, [x9], #0x8
400004c: cmp x9, x8
4000050: b.lo #-0x8 <kinit+0x20>
4000054: bl #0x24 <kmain::h497e3e7b019098a1>
4000058: brk #0x1
400005c: udf #0x0
0000000004000060 spin_sleep_ms::hbe40fb542a7832db.llvm.13348190869585059564:
4000060: mov w8, #0x27c0
4000064: movk w8, #0x9, lsl #16
4000068: subs x8, x8, #0x1
400006c: nop
4000070: b.ne #-0x8 <spin_sleep_ms::hbe40fb542a7832db.llvm.13348190869585059564+0x8>
4000074: ret
0000000004000078 kmain::h497e3e7b019098a1:
4000078: stp x19, x30, [sp, #-0x10]!
400007c: mov w19, #0x4
4000080: movk w19, #0x3f20, lsl #16
4000084: ldr w8, [x19]
4000088: orr w8, w8, #0x40000
400008c: str w8, [x19]
4000090: ldr w8, [x19, #0x18]
4000094: orr w8, w8, #0x10000
4000098: str w8, [x19, #0x18]
400009c: bl #-0x3c <spin_sleep_ms::hbe40fb542a7832db.llvm.13348190869585059564>
40000a0: ldr w8, [x19, #0x24]
40000a4: orr w8, w8, #0x10000
40000a8: str w8, [x19, #0x24]
40000ac: bl #-0x4c <spin_sleep_ms::hbe40fb542a7832db.llvm.13348190869585059564>
40000b0: b #-0x20 <kmain::h497e3e7b019098a1+0x18>
The first does not have the stp instruction the second has. I don't know if that makes any difference.