Re: [PATCH 1/5] rust: percpu: introduce a rust API for per-CPU variables
From: kernel test robot
Date: Thu Jun 26 2025 - 10:11:05 EST
Hi Mitchell,
kernel test robot noticed the following build errors:
[auto build test ERROR on 19272b37aa4f83ca52bdf9c16d5d81bdd1354494]
url: https://github.com/intel-lab-lkp/linux/commits/Mitchell-Levy/rust-percpu-introduce-a-rust-API-for-per-CPU-variables/20250625-061219
base: 19272b37aa4f83ca52bdf9c16d5d81bdd1354494
patch link: https://lore.kernel.org/r/20250624-rust-percpu-v1-1-9c59b07d2a9c%40gmail.com
patch subject: [PATCH 1/5] rust: percpu: introduce a rust API for per-CPU variables
config: x86_64-buildonly-randconfig-004-20250626 (https://download.01.org/0day-ci/archive/20250626/202506262153.vo9sMbM8-lkp@xxxxxxxxx/config)
compiler: clang version 20.1.7 (https://github.com/llvm/llvm-project 6146a88f60492b520a36f8f8f3231e15f3cc6082)
rustc: rustc 1.78.0 (9b00956e5 2024-04-29)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250626/202506262153.vo9sMbM8-lkp@xxxxxxxxx/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@xxxxxxxxx>
| Closes: https://lore.kernel.org/oe-kbuild-all/202506262153.vo9sMbM8-lkp@xxxxxxxxx/
All errors (new ones prefixed by >>):
>> error[E0425]: cannot find function `align_of` in this scope
--> rust/kernel/percpu.rs:106:65
|
106 | let ptr: *mut T = unsafe { alloc_percpu(size_of::<T>(), align_of::<T>()) } as *mut T;
| ^^^^^^^^ not found in this scope
|
help: consider importing this function
|
6 + use core::mem::align_of;
|
--
>> error: use of extern static is unsafe and requires unsafe block (error E0133)
--> rust/kernel/percpu.rs:71:53
|
71 | let this_cpu_off_pcpu = core::ptr::addr_of!(this_cpu_off);
| ^^^^^^^^^^^^ use of extern static
|
= note: for more information, see issue #71668 <https://github.com/rust-lang/rust/issues/71668>
= note: extern statics are not controlled by the Rust type system: invalid data, aliasing violations or data races will cause undefined behavior
note: an unsafe function restricts its caller, but its body is safe by default
--> rust/kernel/percpu.rs:70:5
|
70 | pub unsafe fn get_ref(&self) -> &mut T {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= note: requested on the command line with `-D unsafe-op-in-unsafe-fn`
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki