public inbox for linux-ia64@vger.kernel.org
 help / color / mirror / Atom feed
From: Horms <horms@verge.net.au>
To: linux-ia64@vger.kernel.org
Subject: Re: [patch 3/3] IA64: verify the base address of crashkernel
Date: Wed, 07 Mar 2007 09:49:33 +0000	[thread overview]
Message-ID: <20070307094928.GB21399@verge.net.au> (raw)
In-Reply-To: <20070306073756.245032985@tabatha.lab.ultramonkey.org>

On Wed, Mar 07, 2007 at 05:06:39PM +0800, Zou, Nanhai wrote:
> > -----Original Message-----
> > From: Horms [mailto:horms@verge.net.au]
> > Sent: 2007年3月7日 15:55
> > To: Zou, Nanhai
> > Cc: Linux-IA64; fastboot@lists.osdl.org; Luck, Tony; Magnus Damm
> > Subject: Re: [patch 3/3] IA64: verify the base address of crashkernel
> > 
> > On Wed, Mar 07, 2007 at 12:50:12PM +0800, Zou, Nanhai wrote:
> > > On Wed, Mar 07, 2007 at 11:46, Horms wrote:
> > > >
> > > > I think that the manual option is also important because it
> > > > maintains feature-compatibility with other architectures. I don't
> > > > consider it a hack that might work purely for the purposes of
> > > > debugging.
> > >
> > > I don't understand why we need to maintain compatibility with other
> > > architectures here. Manfully choose may confuse user, XXX@16M may work
> > > on one arch,but not on another arch. Other architectures need manually
> > > choose crash kernel region simply because they do not support kernel
> > > automatically choose feature.
> > >
> > > I keep the XXX@YYY format to just make kdump script compatible, do
> > > that distributions does not need to maintain different kdump scripts
> > > for different arches.
> > 
> 
> > From my point of view, what you say in the paragraph immediately above
> > Thanks, is this logic better?
> > 
>   Don't write code to improve a "no user will use" feature. 
>   Let's keep kernel code clean.

I think we could argue about this forever :-)

> > kdump_region_verify_rsvd_region (unsigned long base, unsigned long size,
> >                                 struct rsvd_region *rsvd_regions, int n)
> > {
> > 	int i;
> > 
> > 	for (i = 0; i < n; i++) {
> > 		/* Assume that start < end && size > 0 */
> > 		if (__pa(rsvd_regions[i].start) >= base + size &&
> > 		    __pa(rsvd_regions[i].end) < base)
> > 			continue;
>     This is much worse. Have you ever tested it?

Sorry, I wrote it down wrong :(
That should have been:

	if (__pa(rsvd_regions[i].start) >= base + size ||
	    __pa(rsvd_regions[i].end) <= base)
		continue;

I'll do some testing tomorrow. But this was what I was thinking about:

s=__pa(rsvd_regions[i].start)
e=__pa(rsvd_regions[i].end)

                  base             base+size
OK:    s:bad  e:ok |                  |
BAD:   s:bad       |            e:bad |
BAD:   s:bad       |                  |         e:bad
BAD:   s:bad       |            e:bad |
BAD:               |  s:bad     e:bad | 
BAD:               |  s:bad           |         e:bad
OK:                |                  |  s:ok   e:bad

-- 
Horms
  H: http://www.vergenet.net/~horms/
  W: http://www.valinux.co.jp/en/


      parent reply	other threads:[~2007-03-07  9:49 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-03-06  7:28 [patch 3/3] IA64: verify the base address of crashkernel Horms
2007-03-06  8:23 ` Zou, Nanhai
2007-03-06 17:08 ` Aron Griffis
2007-03-07  0:42 ` Horms
2007-03-07  0:50 ` Horms
2007-03-07  0:57 ` Horms
2007-03-07  2:15 ` Zou, Nanhai
2007-03-07  3:46 ` Horms
2007-03-07  4:50 ` Zou, Nanhai
2007-03-07  7:55 ` Horms
2007-03-07  9:06 ` Zou, Nanhai
2007-03-07  9:49 ` Horms [this message]

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=20070307094928.GB21399@verge.net.au \
    --to=horms@verge.net.au \
    --cc=linux-ia64@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