[boqun:rust-sync.20260105a 18/22] error[E0277]: the trait bound `i8: AtomicImpl` is not satisfied

Boqun Feng boqun.feng at gmail.com
Mon Jan 5 16:49:05 PST 2026


[Cc UML]

On Tue, Jan 06, 2026 at 12:25:24AM +0800, kernel test robot wrote:
> tree:   https://git.kernel.org/pub/scm/linux/kernel/git/boqun/linux.git rust-sync.20260105a
> head:   243aa6a057d46d3a4de9297422e480d469eddaf7
> commit: 06ed7e7e7aa656f7054af7d3d3387a07244d85b1 [18/22] rust: sync: atomic: Add i8/i16 xchg and cmpxchg support
> config: um-randconfig-001-20260105 (https://download.01.org/0day-ci/archive/20260106/202601060041.k0JkAkUD-lkp@intel.com/config)
> compiler: clang version 22.0.0git (https://github.com/llvm/llvm-project 9b8addffa70cee5b2acc5454712d9cf78ce45710)
> rustc: rustc 1.88.0 (6b00bc388 2025-06-23)
> reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260106/202601060041.k0JkAkUD-lkp@intel.com/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 at intel.com>
> | Closes: https://lore.kernel.org/oe-kbuild-all/202601060041.k0JkAkUD-lkp@intel.com/
> 
> All errors (new ones prefixed by >>):
> 
>    In file included from kernel/sched/rq-offsets.c:5:
>    In file included from kernel/sched/sched.h:28:
>    In file included from include/linux/cgroup_api.h:1:
>    In file included from include/linux/cgroup.h:27:
>    In file included from include/linux/kernel_stat.h:8:
>    In file included from include/linux/interrupt.h:11:
>    In file included from include/linux/hardirq.h:11:
>    In file included from arch/um/include/asm/hardirq.h:24:
>    In file included from include/linux/irq.h:20:
>    In file included from include/linux/io.h:12:
>    In file included from arch/um/include/asm/io.h:24:
>    include/asm-generic/io.h:1209:55: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
>    1209 |         return (port > MMIO_UPPER_LIMIT) ? NULL : PCI_IOBASE + port;
>    |                                                   ~~~~~~~~~~ ^
>    1 warning generated.
>    llvm-nm: error: rust/helpers/helpers.o: No such file or directory
>    clang diag: include/asm-generic/io.h:1209:55: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
>    clang diag: include/asm-generic/io.h:1209:55: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
>    clang diag: include/asm-generic/io.h:1209:55: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
> >> error[E0277]: the trait bound `i8: AtomicImpl` is not satisfied
>    --> rust/kernel/sync/atomic/internal.rs:265:7
>    |
>    265 |     [ i8 => atomic_i8, i16 => atomic_i16, i32 => atomic, i64 => atomic64 ]
>    |       ^^ the trait `AtomicImpl` is not implemented for `i8`
>    |
>    = help: the following other types implement trait `AtomicImpl`:
>    i32
>    i64

UML_X86 is using the atomics of x86 kernel (defined in
arch/x86/include/asm/atomic*), right? If so, I think we need this:

diff --git a/arch/x86/um/Kconfig b/arch/x86/um/Kconfig
index bdd7c8e39b01..44b12e45f9a0 100644
--- a/arch/x86/um/Kconfig
+++ b/arch/x86/um/Kconfig
@@ -9,6 +9,7 @@ endmenu
 config UML_X86
        def_bool y
        select ARCH_USE_QUEUED_RWLOCKS
+       select ARCH_SUPPORTS_ATOMIC_RMW
        select ARCH_USE_QUEUED_SPINLOCKS
        select DCACHE_WORD_ACCESS
        select HAVE_EFFICIENT_UNALIGNED_ACCESS

Regards,
Boqun

[...]



More information about the linux-um mailing list