From: Zachary Amsden <zach@vmware.com>
To: Linus Torvalds <torvalds@osdl.org>
Cc: linux-kernel@vger.kernel.org, Riley@Williams.Name,
davej@codemonkey.org.uk, hpa@zytor.com, Andi Kleen <ak@muc.de>
Subject: Re: [PATCH] i386/gcc bug with do_test_wp_bit
Date: Tue, 05 Oct 2004 20:19:59 -0700 [thread overview]
Message-ID: <4163645F.3030403@vmware.com> (raw)
In-Reply-To: <Pine.LNX.4.58.0410051903090.8290@ppc970.osdl.org>
I agree the code obviously looks ok, I will verify against 2.6.9-rc3
anyways and send an updated patch that gets a non-tweaked gcc 3.3.3
build to boot. Additional fixes are needed for regparm compliance
between prototypes and functions; I've done these for i386, but may have
missed some in other architectures. I'd also like to get rid of the
apparently harmless lvalue warnings I get from gcc 3.3.3.
I checked the gcc docs but couldn't find any versions where noinline was
unsupported, although I should have assumed otherwise.
Zach
Linus Torvalds wrote:
>On Tue, 5 Oct 2004, Zachary Amsden wrote:
>
>
>>I've included a small trivial fix that is harmless for users not using
>>gcc 3.3.3. Testing: my 2.6 kernel now boots when compiled with gcc
>>3.3.3 compiler.
>>
>>
>
>Thanks. However, it really should use the "noinline" define that we have
>for this, and that doesn't upset older versions of gcc that don't
>understand the "noinline" attribute.
>
>Also, declaration and definition should match, even if gcc doesn't seem to
>catch that.
>
>So here's the version I committed. It should be obviously ok, but it's
>still a good idea to verify..
>
> Linus
>
>---
># This is a BitKeeper generated diff -Nru style patch.
>#
># ChangeSet
># 2004/10/05 18:51:53-07:00 torvalds@evo.osdl.org
># i386: mark do_test_wp_bit() noinline
>#
># As reported by Zachary Amsden <zach@vmware.com>,
># some gcc versions will inline the function even when
># it is declared after the call-site. This particular
># function must not be inlined, since the exception
># recovery doesn't like __init sections (which the caller
># is in).
>#
># arch/i386/mm/init.c
># 2004/10/05 18:51:43-07:00 torvalds@evo.osdl.org +2 -2
># i386: mark do_test_wp_bit() noinline
>#
># As reported by Zachary Amsden <zach@vmware.com>,
># some gcc versions will inline the function even when
># it is declared after the call-site. This particular
># function must not be inlined, since the exception
># recovery doesn't like __init sections (which the caller
># is in).
>#
>diff -Nru a/arch/i386/mm/init.c b/arch/i386/mm/init.c
>--- a/arch/i386/mm/init.c 2004-10-05 19:04:53 -07:00
>+++ b/arch/i386/mm/init.c 2004-10-05 19:04:53 -07:00
>@@ -45,7 +45,7 @@
> DEFINE_PER_CPU(struct mmu_gather, mmu_gathers);
> unsigned long highstart_pfn, highend_pfn;
>
>-static int do_test_wp_bit(void);
>+static int noinline do_test_wp_bit(void);
>
> /*
> * Creates a middle page table and puts a pointer to it in the
>@@ -673,7 +673,7 @@
> * This function cannot be __init, since exceptions don't work in that
> * section. Put this after the callers, so that it cannot be inlined.
> */
>-static int do_test_wp_bit(void)
>+static int noinline do_test_wp_bit(void)
> {
> char tmp_reg;
> int flag;
>
>
next prev parent reply other threads:[~2004-10-06 3:21 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-10-06 1:45 [PATCH] i386/gcc bug with do_test_wp_bit Zachary Amsden
2004-10-06 2:05 ` Linus Torvalds
2004-10-06 3:19 ` Zachary Amsden [this message]
2004-10-06 11:55 ` Andi Kleen
2004-10-06 19:34 ` Zachary Amsden
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=4163645F.3030403@vmware.com \
--to=zach@vmware.com \
--cc=Riley@Williams.Name \
--cc=ak@muc.de \
--cc=davej@codemonkey.org.uk \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=torvalds@osdl.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