public inbox for linuxppc-dev@ozlabs.org 
 help / color / mirror / Atom feed
From: Michael Ellerman <mpe@ellerman•id.au>
To: christophe leroy <christophe.leroy@c-s•fr>
Cc: Scott Wood <scottwood@freescale•com>,
	Benjamin Herrenschmidt <benh@kernel•crashing.org>,
	Paul Mackerras <paulus@samba•org>,
	sojkam1@fel•cvut.cz, linux-kernel@vger•kernel.org,
	linuxppc-dev@lists•ozlabs.org
Subject: Re: [PATCH v2] powerpc32: memcpy/memset: only use dcbz once cache is enabled
Date: Mon, 14 Sep 2015 19:59:10 +1000	[thread overview]
Message-ID: <1442224750.21802.2.camel@ellerman.id.au> (raw)
In-Reply-To: <55F3F701.5030303@c-s.fr>

On Sat, 2015-09-12 at 11:57 +0200, christophe leroy wrote:
> 
> Le 11/09/2015 03:24, Michael Ellerman a écrit :
> > On Thu, 2015-09-10 at 17:05 -0500, Scott Wood wrote:
> >>
> >> I don't think this duplication is what Michael meant by "the normal cpu
> >> feature sections".  What else is going to use this very specific
> >> infrastructure?
> > Yeah, sorry, I was hoping you could do it with the existing cpu feature
> > mechanism.
> >
> > It looks like the timing doesn't work, ie. you need to patch this stuff in
> > machine_init(), which is later than the regular patching which gets done in
> > early_init().
> >
> > This is one of the festering differences we have between the 32 and 64-bit
> > initialisation code, ie. on 64-bit we do the patching much later.
>
> I've just thought about maybe another alternative.
> Is there any issue with calling do_feature_fixups() twice for the same
> features ?

Not that I can think of, but you never know.

> If not, we could define a MMU_CACHE_NOW_ON dummy MMU feature, then
> call again do_feature_fixups() in machine_init() to patch memcpy/memset 
> stuff, something like:
> 
> In arch/powerpc/include/asm/mmu.h:
> +#define MMU_CACHE_NOW_ON                ASM_CONST(0x00008000)
> 
> In arch/powerpc/kernel/setup_32.c: @machine_init()
> 
>          udbg_early_init();
> 
> +        spec = identify_cpu(0, mfspr(SPRN_PVR));
> +        do_feature_fixups(spec->mmu_features | MMU_CACHE_NOW_ON,
> +                          &__start___mmu_ftr_fixup,
> +                          &__stop___mmu_ftr_fixup);


Did you try that? It would be cleaner, especially now that you have to do memset as well.

cheers

  reply	other threads:[~2015-09-14  9:59 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-10  6:41 [PATCH v2] powerpc32: memcpy/memset: only use dcbz once cache is enabled Christophe Leroy
2015-09-10 22:05 ` Scott Wood
2015-09-11  1:24   ` Michael Ellerman
2015-09-12  9:57     ` christophe leroy
2015-09-14  9:59       ` Michael Ellerman [this message]
2015-09-14 16:32       ` Scott Wood

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=1442224750.21802.2.camel@ellerman.id.au \
    --to=mpe@ellerman$(echo .)id.au \
    --cc=benh@kernel$(echo .)crashing.org \
    --cc=christophe.leroy@c-s$(echo .)fr \
    --cc=linux-kernel@vger$(echo .)kernel.org \
    --cc=linuxppc-dev@lists$(echo .)ozlabs.org \
    --cc=paulus@samba$(echo .)org \
    --cc=scottwood@freescale$(echo .)com \
    --cc=sojkam1@fel$(echo .)cvut.cz \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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