Skip to content
Commit 6f6f384c authored by Alexandru Elisei's avatar Alexandru Elisei Committed by Will Deacon
Browse files

mips: Do not emulate a serial device



Commit 45b4968e ("hw/serial: ARM/arm64: Use MMIO at higher addresses")
changed how the address for the UART is computed by using KVM_IOPORT_AREA.
The symbol is not defined for MIPS, which results in the following
compilation error:

hw/serial.c:21:27: error: ‘KVM_IOPORT_AREA’ undeclared here (not in a function); did you mean ‘KVM_MIPS_IOPORT_AREA’?
   21 | #define serial_iobase_0  (KVM_IOPORT_AREA + 0x3f8)
      |                           ^~~~~~~~~~~~~~~
hw/serial.c:29:27: note: in expansion of macro ‘serial_iobase_0’
   29 | #define serial_iobase(nr) serial_iobase_##nr
      |                           ^~~~~~~~~~~~~~
hw/serial.c:92:15: note: in expansion of macro ‘serial_iobase’
   92 |   .iobase   = serial_iobase(0),
      |               ^~~~~~~~~~~~~

Before the commit, the serial was placed at addresses 0x3f8, 0x2f8,
0x3e8 and 0x2e8. However, MIPS puts the RAM at those addresses, up to
KVM_MMIO_START, which is 0x10000000. Meaning that serial device
emulation never worked, as those addresses were part of a valid memslot
representing memory. This has been the case since commit 7281a8db
("kvm tools, mips: Add MIPS support") from 2014.

A quick examination of the MIPS code reveals that the architecture relies
on hypercalls from the guest and the virtio console for input and output.
Since nobody complained about the missing serial device, assume that it is
indeed not needed and do not compile it for MIPS.

Signed-off-by: Alexandru Elisei's avatarAlexandru Elisei <alexandru.elisei@arm.com>
Link: https://lore.kernel.org/r/20220525165704.186754-3-alexandru.elisei@arm.com


Signed-off-by: default avatarWill Deacon <will@kernel.org>
parent 8ec1e8bf
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment