All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sam Ravnborg <sam@ravnborg.org>
To: sparclinux@vger.kernel.org
Subject: Re: Linker script cleanup / consolidation
Date: Mon, 28 May 2007 18:53:36 +0000	[thread overview]
Message-ID: <20070528185336.GA31031@uranus.ravnborg.org> (raw)
In-Reply-To: <20070524200934.GB1109@uranus.ravnborg.org>

> 
> On a related topic, I've been wondering how to make instruction
> patching sections work with initdata without warning.  I have
> a bunch of assembler patches in the main kernel image that go
> something like this:
> 
> 661:	ldx		[%g7 + TRAP_PER_CPU_TSB_HUGE], %g5
> 	nop
> 	.section	.sun4v_2insn_patch, "ax"
> 	.word		661b
> 	mov		SCRATCHPAD_UTSBREG2, %g5
> 	ldxa		[%g5] ASI_SCRATCHPAD, %g5
> 	.previous
> 
> And then an __init function walks the tables in the
> ".sun4v_2insn_patch" instruction to patch things as
> needed.
> 
> I don't need to do this patching in modules or anything
> complicated like that, just in the static kernel image.
> 
> The problem is if I put one of these patches into __init assembler
> code, the modpost.c thing warns.  As you can see, these patch sections
> in between __init_begin and __init_end.
> 
> I see that IA64 has something similar, and they prepend their
> patch section names with ".data." would that help me with the
> modpost.c warning issue?
> 
> The history behind this is that I want to make the assembler in
> arch/sparc64/kernel/trampoline.S __init to fix one modpost.c
> warning, but once I dod that I hit this patching section issue
> which makes more warnings that the original problem :-)

First off. I tried building a sparc64 kernel from -linus using
defconfig and got no section mismatch warnings.
Building a ia64 kernel now...

What we can do in modpost is to define that references from a certain
section or sections that start with for example ".patch_insn."
to .init.text / .init.data will be ignored.
Avoiding hardcoding ".sun4v_*" would be preferred and maybe
we could move paravirt over to use a section with the same naming
convention.

Trying to cheat modpost is only a source of confusion and thats
not the way to do it.

	Sam


  parent reply	other threads:[~2007-05-28 18:53 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-05-24 20:09 Linker script cleanup / consolidation Sam Ravnborg
2007-05-24 20:45 ` David Miller
2007-05-24 21:15 ` Sam Ravnborg
2007-05-24 21:16 ` David Miller
2007-05-28 18:53 ` Sam Ravnborg [this message]
2007-05-29  6:00 ` David Miller
2007-05-29 18:41 ` Sam Ravnborg
  -- strict thread matches above, loose matches on Subject: below --
2007-05-24 20:04 Sam Ravnborg

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=20070528185336.GA31031@uranus.ravnborg.org \
    --to=sam@ravnborg.org \
    --cc=sparclinux@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.