mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Amerigo Wang <xiyou.wangcong@gmail.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: Tetsuo Handa <penguin-kernel@i-love.sakura.ne.jp>,
	linux-kernel@vger.kernel.org, xiyou.wangcong@gmail.com,
	andreas.herrmann3@amd.com, mingo@elte.hu
Subject: Re: [2.6.30-rc8] gcc 3.3 : __udivdi3 undefined.
Date: Fri, 5 Jun 2009 14:26:19 +0800	[thread overview]
Message-ID: <20090605062619.GA8171@cr0.nay.redhat.com> (raw)
In-Reply-To: <20090604212018.b9e9f354.akpm@linux-foundation.org>

On Thu, Jun 04, 2009 at 09:20:18PM -0700, Andrew Morton wrote:
>On Fri, 05 Jun 2009 13:00:28 +0900 Tetsuo Handa <penguin-kernel@i-love.sakura.ne.jp> wrote:
>
>> > Perhaps it's this:
>> > 
>> > static void __init memtest(u64 pattern, u64 start_phys, u64 size)
>> > {
>> > 	u64 i, count;
>> > 	u64 *start;
>> > 	u64 start_bad, last_bad;
>> > 	u64 start_phys_aligned;
>> > 	size_t incr;
>> > 
>> > 	incr = sizeof(pattern);
>> > 	start_phys_aligned = ALIGN(start_phys, incr);
>> > 	count = (size - (start_phys_aligned - start_phys))/incr;
>> Bingo!
>
>OK, thanks.  We should fix this for 2.6.30.
>
>We could do the obvious:

Excellent!


>
>--- a/arch/x86/mm/memtest.c~a
>+++ a/arch/x86/mm/memtest.c
>@@ -8,6 +8,7 @@
> #include <linux/pfn.h>
> 
> #include <asm/e820.h>
>+#include <asm/div64.h>
> 
> static u64 patterns[] __initdata = {
> 	0,
>@@ -48,7 +49,8 @@ static void __init memtest(u64 pattern, 
> 
> 	incr = sizeof(pattern);
> 	start_phys_aligned = ALIGN(start_phys, incr);
>-	count = (size - (start_phys_aligned - start_phys))/incr;
>+	count = size - (start_phys_aligned - start_phys);
>+	do_div(count, incr);
> 	start = __va(start_phys_aligned);
> 	start_bad = 0;
> 	last_bad = 0;

This patch looks fine for me. :)


>_
>
>but I wonder why all those things are u64.  They all hold virtual
>addresses, don't they?  The code doesn't test highmem.  So shouldn't
>these all be unsigned longs?
>
>

It looks like no, since many other functions also use u64 instead
of unsigned long, e.g. find_e820_area_size().

Thanks.

  reply	other threads:[~2009-06-05  6:24 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-06-05  0:38 Tetsuo Handa
2009-06-05  2:38 ` Amerigo Wang
2009-06-05  3:17   ` Andrew Morton
2009-06-05  3:39     ` Tetsuo Handa
2009-06-05  3:51       ` Andrew Morton
2009-06-05  4:00         ` Tetsuo Handa
2009-06-05  4:20           ` Andrew Morton
2009-06-05  6:26             ` Amerigo Wang [this message]
2009-06-05  6:51             ` Tetsuo Handa
2009-06-05  7:03               ` Andrew Morton
2009-06-05  9:37                 ` Andreas Herrmann
2009-06-05 12:58                   ` Tetsuo Handa
2009-06-05 17:24                   ` Andrew Morton
2009-06-08 17:09                     ` [PATCH] x86: memtest: remove 64-bit division Andreas Herrmann
2009-06-08 20:36                       ` [tip:x86/urgent] " tip-bot for Andreas Herrmann
2009-06-05  3:24   ` [2.6.30-rc8] gcc 3.3 : __udivdi3 undefined Tetsuo Handa

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=20090605062619.GA8171@cr0.nay.redhat.com \
    --to=xiyou.wangcong@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=andreas.herrmann3@amd.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=penguin-kernel@i-love.sakura.ne.jp \
    /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®