From: Suzuki Poulose <suzuki@in.ibm.com>
To: Josh Poimboeuf <jpoimboe@linux.vnet.ibm.com>
Cc: Nathan Miller <nathanm2@us.ibm.com>,
Josh Poimboeuf <jpoimboe@us.ibm.com>,
Dave Hansen <dave@linux.vnet.ibm.com>,
Alan Modra <amodra@au1.ibm.com>,
Scott Wood <scottwood@freescale.com>,
Paul Mackerras <paulus@samba.org>,
linuxppc-dev <linuxppc-dev@lists.ozlabs.org>
Subject: Re: [PATCH v2 1/5] [ppc] Process dynamic relocations for kernel
Date: Tue, 08 Nov 2011 12:41:36 +0530 [thread overview]
Message-ID: <4EB8D628.2090304@in.ibm.com> (raw)
In-Reply-To: <1320678819.2750.15.camel@treble>
On 11/07/11 20:43, Josh Poimboeuf wrote:
> On Fri, 2011-11-04 at 14:06 +0530, Suzuki Poulose wrote:
>> On 11/03/11 05:06, Josh Poimboeuf wrote:
>>> On Tue, 2011-10-25 at 17:23 +0530, Suzuki K. Poulose wrote:
>>> @@ -137,6 +137,9 @@ get_type:
>>> lwz r0, 8(r9) /* r_addend */
>>> add r0, r0, r3 /* final addend */
>>> stwx r0, r4, r7 /* memory[r4+r7]) = (u32)r0 */
>>> + dcbst r4,r7 /* flush dcache line to memory */
>>> + sync /* wait for flush to complete */
>>> + icbi r4,r7 /* invalidate icache line */
>>
>> Doing it this way has two drawbacks :
>>
>> 1) Placing it here in relocate would do the flushing for each and every update.
>
> I agree. My kernel had around 80,000 relocations, which means 80,000
> d-cache line flushes (for a 32k d-cache) and 80,000 i-cache line
> invalidates (for a 32k i-cache). Which is obviously a little overkill.
> Although I didn't notice a performance hit during boot.
>
>
>> 2) I would like to keep this code as generic as possible for the PPC32 code.
>>
>> Could we move this to the place from relocate is called and flush the d-cache and
>> i-cache entirely ?
>
> Why not put the cache flushing code at the end of relocate? Would some
> of the other PPC32 platforms not require the cache flushing?
What I was suggesting is, instead of flushing the cache in relocate(), lets do it
like:
for e.g, on 440x, (in head_44x.S :)
#ifdef CONFIG_RELOCATABLE
...
bl relocate
#Flush the d-cache and invalidate the i-cache here
#endif
This would let the different platforms do the the cache invalidation in their
own way.
Btw, I didn't find an instruction to flush the entire d-cache in PPC440 manual.
We have instructions to flush only a block corresponding to an address.
However, we have 'iccci' which would invalidate the entire i-cache which, which
I think is better than 80,000 i-cache invalidates.
Kumar / Josh,
Do you have any suggestions here ?
>
> My PPC32 knowledge is 4xx-centric, so please feel free to rewrite the
> patch as needed to accommodate other PPC32 cores.
Same here :)
Thanks
Suzuki
next prev parent reply other threads:[~2011-11-08 7:12 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-10-25 11:53 [PATCH v2 0/5] Kdump support for PPC440x Suzuki K. Poulose
2011-10-25 11:53 ` [PATCH v2 1/5] [ppc] Process dynamic relocations for kernel Suzuki K. Poulose
2011-11-02 23:36 ` Josh Poimboeuf
2011-11-04 8:36 ` Suzuki Poulose
2011-11-07 15:13 ` Josh Poimboeuf
2011-11-07 15:26 ` David Laight
2011-11-08 7:11 ` Suzuki Poulose [this message]
2011-11-08 16:19 ` Josh Poimboeuf
2011-11-09 6:33 ` Suzuki Poulose
2011-11-09 8:42 ` Suzuki Poulose
2011-11-09 14:53 ` Josh Poimboeuf
2011-11-10 2:31 ` Suzuki Poulose
2011-11-10 9:15 ` David Laight
2011-11-10 21:44 ` Josh Poimboeuf
2011-11-11 4:11 ` Benjamin Herrenschmidt
2011-10-25 11:54 ` [PATCH v2 2/5] [ppc] Define virtual-physical translations for PIE relocations Suzuki K. Poulose
2011-10-25 11:54 ` [PATCH v2 3/5] [44x] Enable CONFIG_RELOCATABLE for PPC44x Suzuki K. Poulose
2011-10-25 11:54 ` [PATCH v2 4/5] [44x] Enable CRASH_DUMP for 440x Suzuki K. Poulose
2011-10-25 11:54 ` [PATCH v2 5/5] [boot] Change the load address for the wrapper to fit the kernel Suzuki K. Poulose
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=4EB8D628.2090304@in.ibm.com \
--to=suzuki@in.ibm.com \
--cc=amodra@au1.ibm.com \
--cc=dave@linux.vnet.ibm.com \
--cc=jpoimboe@linux.vnet.ibm.com \
--cc=jpoimboe@us.ibm.com \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=nathanm2@us.ibm.com \
--cc=paulus@samba.org \
--cc=scottwood@freescale.com \
/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.