Re: Linux-2.2.0 (pre1)

Gerard Roudier (groudier@club-internet.fr)
Wed, 30 Dec 1998 20:58:28 +0100 (MET)


On Mon, 28 Dec 1998, Linus Torvalds wrote:

> Ok,
> we're in the pre-2.2.0 series now, I'm all synched up with Alan, and I
> don't have anything pending any more. Over the internet nobody can hear
> you all scream in pain over all your favourite features that didn't make
> it.

More than 2 GB memory + PCI MMIO in high memory seems to me not to work
for x86 at least, if readX/writeX are used to access the MMIO area:
(BTW, this also seem to make problems with more that 1 GB of memory and
the default value of PAGE_OFFSET)

PAGE_OFFSET = 0x70000000
high_memory = 0x70000000 + 1xxxxxxx = 0x8xxxxxxx
=> vremapped addresses = 0x8xxxxxxx

#define __io_virt(x) ((void *)(PAGE_OFFSET | (unsigned long)(x)))
#define readb(addr) (*(volatile unsigned char *) __io_virt(addr))

The breakage is that __io_virt() may add spurious bits 0x70000000 to the
ioremapped address instead of just leaving it unchanged.

There are several possible fixes:

1 - Fix old drivers that need the __io_virt() macro to be used by
the readX/writeX stuff.
2 - Not use readX/writeX in PCI device drivers for MMIO on x86.
3 - Let ioremap/iounmap return a value that compensates the __io_virt
tampering of addresses passed to readX/writeX stuff.
4 - Invent special pci_readX/pci_writeX functions for PCI or whatever
does not tamper the address parameter.
5 - Require PAGE_OFFSET to have all high bits set (does not help for
more than 2 GB memory)

If you are OK with (2), we may just apply obvious changes to low-level
PCI device drivers that use MMIO in 2.2.

Sorry, if I just misunderstood something.

Happy New Year!

Regards,
Gerard.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/