Skip to content

Commit b8c9c3b

Browse files
arndbjmberg-intel
authored andcommitted
um: stop using PCI port I/O
arch/um is one of the last users of CONFIG_GENERIC_IOMAP, but upon closer look it appears that the PCI host bridge does not register any port I/O, and the absense of both custom inb/outb functions and a PCI_IOBASE constant means that actually trying to use port I/O results on a NULL pointer access. Build testing with clang confirms this by warning about this exact problem: include/asm-generic/io.h:549:31: error: performing pointer arithmetic on a null pointer has undefined behavior [-Werror,-Wnull-pointer-arithmetic] 549 | val = __raw_readb(PCI_IOBASE + addr); | ~~~~~~~~~~ ^ Remove all the Kconfig selects that refer to legacy port I/O and instead just build the normal MMIO path that is emulated by the virtio PCI host. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Link: https://patch.msgid.link/20250509084125.1488601-1-arnd@kernel.org Signed-off-by: Johannes Berg <johannes.berg@intel.com>
1 parent e619e18 commit b8c9c3b

File tree

3 files changed

+0
-20
lines changed

3 files changed

+0
-20
lines changed

arch/um/Kconfig

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -52,13 +52,7 @@ config NO_IOMEM
5252
config UML_IOMEM_EMULATION
5353
bool
5454
select INDIRECT_IOMEM
55-
select HAS_IOPORT
5655
select GENERIC_PCI_IOMAP
57-
select GENERIC_IOMAP
58-
select NO_GENERIC_PCI_IOPORT_MAP
59-
60-
config NO_IOPORT_MAP
61-
def_bool !UML_IOMEM_EMULATION
6256

6357
config ISA
6458
bool

arch/um/kernel/Makefile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ obj-$(CONFIG_GPROF) += gprof_syms.o
2525
obj-$(CONFIG_OF) += dtb.o
2626
obj-$(CONFIG_EARLY_PRINTK) += early_printk.o
2727
obj-$(CONFIG_STACKTRACE) += stacktrace.o
28-
obj-$(CONFIG_GENERIC_PCI_IOMAP) += ioport.o
2928

3029
USER_OBJS := config.o
3130

arch/um/kernel/ioport.c

Lines changed: 0 additions & 13 deletions
This file was deleted.

0 commit comments

Comments
 (0)