Error ioport_map in version 8
Hello everyone,
I found some arm64 server(e.g. Greatwall DF720) could not display correctly via BMC KVM. The root cause is the io port of AST2500 is allocate to 0x5000.
while, ioport_map function is implement as:
static inline void __iomem ioport_map(unsigned long port, unsigned int nr)
{
return PCI_IOBASE + (port & MMIO_UPPER_LIMIT);
}
where MMIO_UPPER_LIMIT is defined to be:
/
* We reserve 0x4000 bytes for Indirect IO as so far this library is only
* used by the HiSilicon LPC Host. If needed, we can reserve a wider IO
* area by redefining the macro below.
*/
define PIO_INDIRECT_SIZE 0x4000
define MMIO_UPPER_LIMIT (IO_SPACE_LIMIT - PIO_INDIRECT_SIZE)
Then MMIO_UPPER_LIMIT is to be 0xFFBFFF, so the result of ioport_map(0x5000) is (PCI_IOBASE + 0x5000 & 0xFFBFFF) = (PCI_IOBASE + 0x1000).
I found this bug is fixed in 500dd232449e7c07500e713dc6970aa713f8e4f1, which is not backport to RHEL 8 kernel version yet.