[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20090211100557.634529ae@lxorguk.ukuu.org.uk>
Date: Wed, 11 Feb 2009 10:05:57 +0000
From: Alan Cox <alan@...rguk.ukuu.org.uk>
To: Keith Mannthey <kmannth@...ibm.com>
Cc: lkml <linux-kernel@...r.kernel.org>,
John Stultz <johnstul@...ibm.com>
Subject: Re: [RFC][Patch] IBM Real-Time "SMI Free" mode driver
> + /*get the address for the RTL table from the EBDA */
> + ebda_addr = *(unsigned short *)phys_to_virt(0x40E);
> + ebda_addr <<= 4;
> + ebda_size = 64*1024;
Second problem - you'll crash some systems with the assumptions here
> + for (i = 0 ; i < ebda_size/4; i++) {
> + unsigned int *tmp = (unsigned int *) data++;
> + if (*tmp == RTL_MAGIC_IDENT) {
> + table_addr = ebda_addr + i;
> + ret = rtl_setup_sysfs();
> + goto exit;
> + }
> + }
Some machines place the EBDA in the top pages of the low 640K. Your 64K
walk will continue into ISA MMIO space which isn't safe to blindly read.
Alan
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists