public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Keith Mannthey <kmannth@us.ibm.com>
To: Alan Cox <alan@lxorguk.ukuu.org.uk>
Cc: lkml <linux-kernel@vger.kernel.org>, John Stultz <johnstul@us.ibm.com>
Subject: Re: [RFC][Patch] IBM Real-Time "SMI Free" mode drive -v2
Date: Wed, 16 Dec 2009 18:09:14 -0800	[thread overview]
Message-ID: <1261015754.6521.99.camel@keith-laptop> (raw)
In-Reply-To: <20091216000258.4c294d90@lxorguk.ukuu.org.uk>

On Wed, 2009-12-16 at 00:02 +0000, Alan Cox wrote:
> > --- linux-2.6.32/drivers/misc/ibmrtl/ibm_rtl.c	1969-12-31 16:00:00.000000000 -0800
> > +++ linux-2.6.32-rtl/drivers/misc/ibmrtl/ibm_rtl.c	2009-12-14 16:37:19.000000000 -0800
> 
> Probably belongs in drivers/firmware as its not a misc_* interface user.

Ack. 

> > +	/* Get the address for the Extende Biso Data Area */
> > +	ebda_addr = *(u16 *) phys_to_virt(EDBA_ADDR);
> > +	ebda_addr <<= 4;
> > +	edba_map = ioremap(ebda_addr, 4);
> > +	if (!edba_map)
> > +		return -ENOMEM;
> 
> This is wrong. I wish we had a single proper EBDA handling function
> because this keeps coming up.
>
> The rules for the EBDA on PC class hardware as that the EBDA address
> provides a real segment offset for the EBDA *if one is present*. Lots of
> machines including quite a few suprisingly modern boxes (eg AMD76x
> systems without a PS/2 mouse plugged in) don't have an EBDA so you need
> to check if the word you read is zero before doing an ioremap.

Ok so if I can read a word at 0x40E that means an EDBA table is present?

> > +	for (table = (u32 *) edba_map ; \
> > +			table < (u32 *) edba_map + ebda_size/4; table++)
> 
> You need to check the table is valid and has a correct signature. Not
> doing so is completely unsafe.

What does a valid signature on an EDBA look like, I really do not have
much info on the table. 

How do I check the signature? I don't really have lot of into about the
EDBA region any info is helpful. 

Thanks,
  Keith Mannthey
  LTC Real-Time 


  reply	other threads:[~2009-12-17  2:09 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-12-15 20:09 [RFC][Patch] IBM Real-Time "SMI Free" mode drive -v2 Keith Mannthey
2009-12-15 23:12 ` Randy Dunlap
2009-12-15 23:58   ` Keith Mannthey
2009-12-15 23:49 ` Jonathan Corbet
2009-12-16  0:09   ` Thomas Gleixner
2009-12-16  0:38   ` Keith Mannthey
2009-12-16  0:50     ` Jonathan Corbet
2009-12-16  0:02 ` Alan Cox
2009-12-17  2:09   ` Keith Mannthey [this message]
2009-12-16 23:09 ` Peter Zijlstra
2009-12-17  1:37   ` john stultz
2009-12-17  2:06     ` Keith Mannthey
2009-12-17  1:50   ` Keith Mannthey

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=1261015754.6521.99.camel@keith-laptop \
    --to=kmannth@us.ibm.com \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=johnstul@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