Skip to contentSkip to conversation

error[E0277]: the trait bound `i8: AtomicImpl` is not satisfied

PATCH Applied kernel test robot 5 participants 7 messages Jan 5 – Jan 13

Subsystems (3)
lore
Share & tools
lore

kernel test robot

author build bot
#0 lore raw
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/[email protected]/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/[email protected]/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 <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/

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
   note: required by a bound in `AtomicBasicOps`
   --> rust/kernel/sync/atomic/internal.rs:190:26
   |
   190 |           $pub trait $ops: AtomicImpl {
   |                            ^^^^^^^^^^ required by this bound in `AtomicBasicOps`
   ...
   264 | / declare_and_impl_atomic_methods!(
   265 | |     [ i8 => atomic_i8, i16 => atomic_i16, i32 => atomic, i64 => atomic64 ]
   266 | |     /// Basic atomic operations
   267 | |     pub trait AtomicBasicOps {
   | |               -------------- required by a bound in this trait
   ...   |
   280 | | );
   | |_- in this macro invocation
   = note: this error originates in the macro `declare_atomic_ops_trait` which comes from the expansion of the macro `declare_and_impl_atomic_methods` (in Nightly builds, run with -Z macro-backtrace for more info)
--
>> error[E0277]: the trait bound `i16: AtomicImpl` is not satisfied
   --> rust/kernel/sync/atomic/internal.rs:265:24
   |
   265 |     [ i8 => atomic_i8, i16 => atomic_i16, i32 => atomic, i64 => atomic64 ]
   |                        ^^^ the trait `AtomicImpl` is not implemented for `i16`
   |
   = help: the following other types implement trait `AtomicImpl`:
   i32
   i64
   note: required by a bound in `AtomicBasicOps`
   --> rust/kernel/sync/atomic/internal.rs:190:26
   |
   190 |           $pub trait $ops: AtomicImpl {
   |                            ^^^^^^^^^^ required by this bound in `AtomicBasicOps`
   ...
   264 | / declare_and_impl_atomic_methods!(
   265 | |     [ i8 => atomic_i8, i16 => atomic_i16, i32 => atomic, i64 => atomic64 ]
   266 | |     /// Basic atomic operations
   267 | |     pub trait AtomicBasicOps {
   | |               -------------- required by a bound in this trait
   ...   |
   280 | | );
   | |_- in this macro invocation
   = note: this error originates in the macro `declare_atomic_ops_trait` which comes from the expansion of the macro `declare_and_impl_atomic_methods` (in Nightly builds, run with -Z macro-backtrace for more info)
--
>> error[E0277]: the trait bound `i16: AtomicImpl` is not satisfied

--> rust/kernel/sync/atomic/internal.rs:289:48
|
289 | fn xchg[acquire, release, relaxed](a: &AtomicRepr<Self>, v: Self) -> Self {
| ^^^^^^^^^^^^^^^^ the trait AtomicImpl is not implemented for i16
|
= help: the following other types implement trait AtomicImpl:
i32
i64
note: required by a bound in AtomicRepr
--> rust/kernel/sync/atomic/internal.rs:66:26
|
66 | pub struct AtomicRepr<T: AtomicImpl>(UnsafeCell<T>);
| ^^^^^^^^^^ required by this bound in AtomicRepr
--

>> error[E0277]: the trait bound `i16: AtomicImpl` is not satisfied

--> rust/kernel/sync/atomic/internal.rs:301:17
|
301 | a: &AtomicRepr<Self>, old: &mut Self, new: Self
| ^^^^^^^^^^^^^^^^ the trait AtomicImpl is not implemented for i16
|
= help: the following other types implement trait AtomicImpl:
i32
i64
note: required by a bound in AtomicRepr
--> rust/kernel/sync/atomic/internal.rs:66:26
|
66 | pub struct AtomicRepr<T: AtomicImpl>(UnsafeCell<T>);
| ^^^^^^^^^^ required by this bound in AtomicRepr
--

>> error[E0277]: the trait bound `i8: AtomicImpl` is not satisfied

--> rust/kernel/sync/atomic/predefine.rs:11:17
|
11 | type Repr = i8;
| ^^ the trait AtomicImpl is not implemented for i8
|
= help: the following other types implement trait AtomicImpl:
i32
i64
note: required by a bound in AtomicType::Repr
--> rust/kernel/sync/atomic.rs:113:16
|
113 | type Repr: AtomicImpl;
| ^^^^^^^^^^ required by this bound in AtomicType::Repr
--

>> error[E0277]: the trait bound `i16: AtomicImpl` is not satisfied

--> rust/kernel/sync/atomic/predefine.rs:17:17
|
17 | type Repr = i16;
| ^^^ the trait AtomicImpl is not implemented for i16
|
= help: the following other types implement trait AtomicImpl:
i32
i64
note: required by a bound in AtomicType::Repr
--> rust/kernel/sync/atomic.rs:113:16
|
113 | type Repr: AtomicImpl;
| ^^^^^^^^^^ required by this bound in AtomicType::Repr
--

>> error[E0599]: the method `as_ptr` exists for reference `&AtomicRepr<i8>`, but its trait bounds were not satisfied
   --> rust/kernel/sync/atomic/internal.rs:271:40
   |
   271 |             unsafe { bindings::#call(a.as_ptr().cast()) }
   |                                        ^^^^^^ method cannot be called on `&AtomicRepr<i8>` due to unsatisfied trait bounds
   |
   note: trait bound `i8: AtomicImpl` was not satisfied
   --> rust/kernel/sync/atomic/internal.rs:68:9
   |
   68  | impl<T: AtomicImpl> AtomicRepr<T> {
   |         ^^^^^^^^^^  -------------
   |         |
   |         unsatisfied trait bound introduced here

= help: items from traits can only be used if the trait is implemented and in scope
note: device_id::IdTable defines an item as_ptr, perhaps you need to implement it --> rust/kernel/device_id.rs:165:1
|
165 | pub trait IdTable<T: RawDeviceId, U> {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
--

>> error[E0599]: the method `as_ptr` exists for reference `&AtomicRepr<i8>`, but its trait bounds were not satisfied
   --> rust/kernel/sync/atomic/internal.rs:277:40
   |
   277 |             unsafe { bindings::#call(a.as_ptr().cast(), v) }
   |                                        ^^^^^^ method cannot be called on `&AtomicRepr<i8>` due to unsatisfied trait bounds
   |
   note: trait bound `i8: AtomicImpl` was not satisfied
   --> rust/kernel/sync/atomic/internal.rs:68:9
   |
   68  | impl<T: AtomicImpl> AtomicRepr<T> {
   |         ^^^^^^^^^^  -------------
   |         |
   |         unsatisfied trait bound introduced here

= help: items from traits can only be used if the trait is implemented and in scope
note: device_id::IdTable defines an item as_ptr, perhaps you need to implement it --> rust/kernel/device_id.rs:165:1
|
165 | pub trait IdTable<T: RawDeviceId, U> {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
--

>> error[E0599]: the method `as_ptr` exists for reference `&AtomicRepr<i16>`, but its trait bounds were not satisfied
   --> rust/kernel/sync/atomic/internal.rs:271:40
   |
   271 |             unsafe { bindings::#call(a.as_ptr().cast()) }
   |                                        ^^^^^^ method cannot be called on `&AtomicRepr<i16>` due to unsatisfied trait bounds
   |
   note: trait bound `i16: AtomicImpl` was not satisfied
   --> rust/kernel/sync/atomic/internal.rs:68:9
   |
   68  | impl<T: AtomicImpl> AtomicRepr<T> {
   |         ^^^^^^^^^^  -------------
   |         |
   |         unsatisfied trait bound introduced here

= help: items from traits can only be used if the trait is implemented and in scope
note: device_id::IdTable defines an item as_ptr, perhaps you need to implement it --> rust/kernel/device_id.rs:165:1
|
165 | pub trait IdTable<T: RawDeviceId, U> {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
--

>> error[E0599]: the method `as_ptr` exists for reference `&AtomicRepr<i16>`, but its trait bounds were not satisfied
   --> rust/kernel/sync/atomic/internal.rs:277:40
   |
   277 |             unsafe { bindings::#call(a.as_ptr().cast(), v) }
   |                                        ^^^^^^ method cannot be called on `&AtomicRepr<i16>` due to unsatisfied trait bounds
   |
   note: trait bound `i16: AtomicImpl` was not satisfied
   --> rust/kernel/sync/atomic/internal.rs:68:9
   |
   68  | impl<T: AtomicImpl> AtomicRepr<T> {
   |         ^^^^^^^^^^  -------------
   |         |
   |         unsatisfied trait bound introduced here

= help: items from traits can only be used if the trait is implemented and in scope
note: device_id::IdTable defines an item as_ptr, perhaps you need to implement it --> rust/kernel/device_id.rs:165:1
|
165 | pub trait IdTable<T: RawDeviceId, U> {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
--

>> error[E0599]: the method `as_ptr` exists for reference `&AtomicRepr<i8>`, but its trait bounds were not satisfied
   --> rust/kernel/sync/atomic/internal.rs:291:40
   |
   291 |             unsafe { bindings::#call(a.as_ptr().cast(), v) }
   |                                        ^^^^^^ method cannot be called on `&AtomicRepr<i8>` due to unsatisfied trait bounds
   |
   note: trait bound `i8: AtomicImpl` was not satisfied
   --> rust/kernel/sync/atomic/internal.rs:68:9
   |
   68  | impl<T: AtomicImpl> AtomicRepr<T> {
   |         ^^^^^^^^^^  -------------
   |         |
   |         unsatisfied trait bound introduced here

= help: items from traits can only be used if the trait is implemented and in scope
note: device_id::IdTable defines an item as_ptr, perhaps you need to implement it --> rust/kernel/device_id.rs:165:1
|
165 | pub trait IdTable<T: RawDeviceId, U> {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
..

Signature · 2 lines
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
#1 lore raw

[Cc UML]

Quoted 35 lines · kernel test robot
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/[email protected]/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/[email protected]/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 <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/

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]

Quoted 1 line
Quoted 1 line

error[E0277]: the trait bound i8: AtomicImpl is not satisfied

Quoted 8 lines

--> 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:

arch/x86/um/Kconfig +1 -0
index bdd7c8e39b01..44b12e45f9a0 100644
@@ -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

[...]

#2 lore raw

PATCH 1/1 arch: um/x86: Select ARCH_SUPPORTS_ATOMIC_RMW for UML_X86

x86 atomic instructions are used for um on UML_X86, therefore atomics on UML_X86 support native atomic RmW as x86 does, hence select ARCH_SUPPORTS_ATOMIC_RMW.

---
UM & x86 maintainers,

I need this to avoid a build error for Rust atomics since Rust currently only support Atomic<i8/i16> on ARCH_SUPPORTS_ATOMIC_RMW archs. I will add it to my upcoming PR if I get some Acked-by, thanks!

 arch/x86/um/Kconfig | 1 +
 1 file changed, 1 insertion(+)
arch/x86/um/Kconfig +1 -0
index bdd7c8e39b01..44b12e45f9a0 100644
@@ -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
Signature · 1 line
2.51.0
maintainer Acked-by on v1 1/1
#4 lore raw

Re: [PATCH] arch: um/x86: Select ARCH_SUPPORTS_ATOMIC_RMW for UML_X86

In reply to Boqun Feng

----- Ursprüngliche Mail -----

Quoted 20 lines

Von: "Boqun Feng" <[email protected]>
An: "linux-um" <[email protected]>, "x86" <[email protected]>
CC: "richard" <[email protected]>, "anton ivanov" <[email protected]>, "Johannes Berg" <[email protected]>, "tglx" <[email protected]>, "mingo" <[email protected]>, "bp" <[email protected]>, "dave hansen" <[email protected]>, "hpa" <[email protected]>, "Miguel Ojeda" <[email protected]>, "Boqun Feng" <[email protected]>, "Gary Guo" <[email protected]>, "Björn Roy Baron" <[email protected]>, "Benno Lossin" <[email protected]>, "Andreas Hindborg" <[email protected]>, "Alice Ryhl" <[email protected]>, "Trevor Gross" <[email protected]>, "dakr" <[email protected]>, "linux-kernel" <[email protected]>, "Rust for Linux Kernel" <[email protected]>, "FUJITA Tomonori" <[email protected]>
Gesendet: Dienstag, 6. Januar 2026 04:40:34
Betreff: [PATCH] arch: um/x86: Select ARCH_SUPPORTS_ATOMIC_RMW for UML_X86

x86 atomic instructions are used for um on UML_X86, therefore atomics on UML_X86 support native atomic RmW as x86 does, hence select ARCH_SUPPORTS_ATOMIC_RMW.

---
UM & x86 maintainers,

Quoted 6 lines

I need this to avoid a build error for Rust atomics since Rust currently only support Atomic<i8/i16> on ARCH_SUPPORTS_ATOMIC_RMW archs. I will add it to my upcoming PR if I get some Acked-by, thanks!

arch/x86/um/Kconfig | 1 +

1 file changed, 1 insertion(+)

Thanks,
//richard

Applied
#5 lore raw

Re: [PATCH] arch: um/x86: Select ARCH_SUPPORTS_ATOMIC_RMW for UML_X86

Quoted 21 lines · Richard Weinberger

----- Ursprüngliche Mail -----

Quoted 20 lines

Von: "Boqun Feng" <[email protected]>
An: "linux-um" <[email protected]>, "x86" <[email protected]>
CC: "richard" <[email protected]>, "anton ivanov" <[email protected]>, "Johannes Berg" <[email protected]>, "tglx" <[email protected]>, "mingo" <[email protected]>, "bp" <[email protected]>, "dave hansen" <[email protected]>, "hpa" <[email protected]>, "Miguel Ojeda" <[email protected]>, "Boqun Feng" <[email protected]>, "Gary Guo" <[email protected]>, "Björn Roy Baron" <[email protected]>, "Benno Lossin" <[email protected]>, "Andreas Hindborg" <[email protected]>, "Alice Ryhl" <[email protected]>, "Trevor Gross" <[email protected]>, "dakr" <[email protected]>, "linux-kernel" <[email protected]>, "Rust for Linux Kernel" <[email protected]>, "FUJITA Tomonori" <[email protected]>
Gesendet: Dienstag, 6. Januar 2026 04:40:34
Betreff: [PATCH] arch: um/x86: Select ARCH_SUPPORTS_ATOMIC_RMW for UML_X86

x86 atomic instructions are used for um on UML_X86, therefore atomics on UML_X86 support native atomic RmW as x86 does, hence select ARCH_SUPPORTS_ATOMIC_RMW.

---
UM & x86 maintainers,

Quoted 9 lines
Quoted 6 lines

I need this to avoid a build error for Rust atomics since Rust currently only support Atomic<i8/i16> on ARCH_SUPPORTS_ATOMIC_RMW archs. I will add it to my upcoming PR if I get some Acked-by, thanks!

arch/x86/um/Kconfig | 1 +

1 file changed, 1 insertion(+)

Queued with both tags applied, thank you both!

Regards,
Boqun

Quoted 2 lines

Thanks,
//richard

merge bot Applied
#6 lore raw

[tip: locking/core] arch: um/x86: Select ARCH_SUPPORTS_ATOMIC_RMW for UML_X86

In reply to Boqun Feng
The following commit has been merged into the locking/core branch of tip:

The following commit has been merged into the locking/core branch of tip:

Commit-ID:     cf4c3bc1445152c1949a4b5fef56d07579fadb1e
Gitweb:        https://git.kernel.org/tip/cf4c3bc1445152c1949a4b5fef56d07579fadb1e
Author:        Boqun Feng <[email protected]>
AuthorDate:    Tue, 06 Jan 2026 11:40:34 +08:00
Committer:     Boqun Feng <[email protected]>
CommitterDate: Fri, 09 Jan 2026 19:01:41 +08:00

arch: um/x86: Select ARCH_SUPPORTS_ATOMIC_RMW for UML_X86

x86 atomic instructions are used for um on UML_X86, therefore atomics on UML_X86 support native atomic RmW as x86 does, hence select ARCH_SUPPORTS_ATOMIC_RMW.

---
 arch/x86/um/Kconfig | 1 +
 1 file changed, 1 insertion(+)
arch/x86/um/Kconfig +1 -0
index bdd7c8e..44b12e4 100644
@@ -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