mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Alan Cox <alan@lxorguk.ukuu.org.uk>
To: Keith Mannthey <kmannth@us.ibm.com>
Cc: lkml <linux-kernel@vger.kernel.org>, John Stultz <johnstul@us.ibm.com>
Subject: Re: [RFC][Patch] IBM Real-Time "SMI Free" mode driver
Date: Wed, 11 Feb 2009 10:05:57 +0000	[thread overview]
Message-ID: <20090211100557.634529ae@lxorguk.ukuu.org.uk> (raw)
In-Reply-To: <1234312633.15410.546.camel@keith-laptop>

> +	/*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

  parent reply	other threads:[~2009-02-11 10:05 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-02-11  0:37 Keith Mannthey
2009-02-11 10:02 ` Alan Cox
2009-02-11 10:05 ` Alan Cox [this message]
2009-02-11 12:18 ` Michal Schmidt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20090211100557.634529ae@lxorguk.ukuu.org.uk \
    --to=alan@lxorguk.ukuu.org.uk \
    --cc=johnstul@us.ibm.com \
    --cc=kmannth@us.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®