From: Ingo Molnar <mingo@elte.hu>
To: Cyrill Gorcunov <gorcunov@openvz.org>
Cc: "H. Peter Anvin" <hpa@zytor.com>,
Thomas Gleixner <tglx@linutronix.de>,
LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH -tip] x86: smp_scan_config - use signed long as scan area size
Date: Fri, 21 Aug 2009 18:04:26 +0200 [thread overview]
Message-ID: <20090821160426.GA17731@elte.hu> (raw)
In-Reply-To: <20090820173427.GA8517@lenovo>
* Cyrill Gorcunov <gorcunov@openvz.org> wrote:
> Unsigned value potentially could be overlapped
> if length parameter is that: length % 16 != 0.
>
> This is not a problem at moment since all values
> we pass now are 16 divisible (0x400 and 0x10000).
>
> Though there is no need unsigned value anyway.
> Max range pointed out by MP specification is
> in kilobytes so plain "signed long" is enough.
>
> This allow us to be on a safe side.
>
> Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
> ---
>
> (I doubt if we ever will need to scan 1G of physical
> memory with 16 byte step at booting procedure 'xcept
> memtest case)
>
> Please review. Not sure if the patch is that worth
> but anyway :)
>
> arch/x86/kernel/mpparse.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> Index: linux-2.6.git/arch/x86/kernel/mpparse.c
> =====================================================================
> --- linux-2.6.git.orig/arch/x86/kernel/mpparse.c
> +++ linux-2.6.git/arch/x86/kernel/mpparse.c
> @@ -705,7 +705,7 @@ static void __init smp_reserve_bootmem(s
> #endif
> }
>
> -static int __init smp_scan_config(unsigned long base, unsigned long length,
> +static int __init smp_scan_config(unsigned long base, long length,
> unsigned reserve)
> {
> unsigned int *bp = phys_to_virt(base);
Hm, does a BUILD_BUG_ON((length & 15) != 0) line catch incorrectly
aligned length parameters?
Ingo
next prev parent reply other threads:[~2009-08-21 16:04 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-08-20 17:34 [PATCH -tip] x86: smp_scan_config - use signed long as scan area size Cyrill Gorcunov
2009-08-21 16:04 ` Ingo Molnar [this message]
2009-08-21 16:49 ` Cyrill Gorcunov
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=20090821160426.GA17731@elte.hu \
--to=mingo@elte.hu \
--cc=gorcunov@openvz.org \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=tglx@linutronix.de \
/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