`io{re,un}map()` build error in s390 under `!CONFIG_HAS_IOMEM`

Miguel Ojeda <[email protected]> Mon, 3 Aug 2026 20:09:31 +0200
Newsgroups dev.linux.lists.driver-core,org.kernel.vger.linux-arch,org.kernel.vger.linux-s390,org.kernel.vger.rust-for-linux
Message-ID <[email protected]>
Hi all,

s390 does not provide `ioremap()`/`iounmap()` under `!CONFIG_HAS_IOMEM`:

    In file included from rust/helpers/helpers.c:68:
    rust/helpers/io.c:8:9: error: call to undeclared function 'ioremap'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
        8 |         return ioremap(offset, size);
          |                ^
    rust/helpers/io.c:8:9: error: incompatible integer to pointer conversion returning 'int' from a function with result type 'void *' [-Wint-conversion]
        8 |         return ioremap(offset, size);
          |                ^~~~~~~~~~~~~~~~~~~~~
    rust/helpers/io.c:19:2: error: call to undeclared function 'iounmap'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
       19 |         iounmap(addr);
          |         ^
    ./arch/s390/include/asm/io.h:31:17: note: expanded from macro 'iounmap'
       31 | #define iounmap iounmap
          |                 ^
    rust/helpers/io.c:19:2: note: did you mean 'kunmap'?
    ./arch/s390/include/asm/io.h:31:17: note: expanded from macro 'iounmap'
       31 | #define iounmap iounmap
          |                 ^
    ./include/linux/highmem.h:46:20: note: 'kunmap' declared here
       46 | static inline void kunmap(const struct page *page);
          |                    ^

so e.g. an `allnoconfig` with Rust fails.

I assume we will need to `#ifdef` the helpers, plus the users; or stub
at some layer to avoid changing callers.

I hope that helps & thanks!

Cheers,
Miguel