From: Michael Ellerman <mpe@ellerman.id.au>
To: Mathieu Malaterre <malat@debian.org>,
Christophe LEROY <christophe.leroy@c-s.fr>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>,
Paul Mackerras <paulus@samba.org>,
rjw@rjwysocki.net, viresh.kumar@linaro.org,
linuxppc-dev <linuxppc-dev@lists.ozlabs.org>,
LKML <linux-kernel@vger.kernel.org>,
linux-pm@vger.kernel.org
Subject: Re: [PATCH 2/7] powerpc: change CONFIG_6xx to CONFIG_PPC_BOOK3S_32
Date: Tue, 04 Dec 2018 14:55:36 +1100 [thread overview]
Message-ID: <877egqhrnr.fsf@concordia.ellerman.id.au> (raw)
In-Reply-To: <CA+7wUsx3iZhPH0uwukRNXaT_ZygaqKNXaNf=kcwoJ9nGqTb2Mw@mail.gmail.com>
Mathieu Malaterre <malat@debian.org> writes:
> On Sat, Nov 17, 2018 at 11:29 AM Christophe Leroy
> <christophe.leroy@c-s.fr> wrote:
>>
>> Today we have:
>>
>> config PPC_BOOK3S_32
>> bool "512x/52xx/6xx/7xx/74xx/82xx/83xx/86xx"
>> [depends on PPC32 within a choice]
>>
>> config PPC_BOOK3S
>> def_bool y
>> depends on PPC_BOOK3S_32 || PPC_BOOK3S_64
>>
>> config 6xx
>> def_bool y
>> depends on PPC32 && PPC_BOOK3S
>>
>> 6xx is therefore redundant with PPC_BOOK3S_32.
>>
>> In order to make the code clearer, lets use preferably PPC_BOOK3S_32.
>> This will allow to remove CONFIG_6xx in a later patch.
>>
>> Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>
>> ---
>> arch/powerpc/Makefile | 2 +-
>> arch/powerpc/include/asm/cache.h | 2 +-
>> arch/powerpc/include/asm/mmu.h | 2 +-
>> arch/powerpc/include/asm/reg.h | 2 +-
>> arch/powerpc/include/asm/time.h | 2 +-
>> arch/powerpc/kernel/Makefile | 2 +-
>> arch/powerpc/kernel/cpu_setup_6xx.S | 2 +-
>> arch/powerpc/kernel/entry_32.S | 10 +++++-----
>> arch/powerpc/kernel/head_32.S | 14 +++++++-------
>> arch/powerpc/kernel/misc_32.S | 4 ++--
>> arch/powerpc/kernel/pmc.c | 2 +-
>> arch/powerpc/kernel/setup_32.c | 2 +-
>> arch/powerpc/kernel/sysfs.c | 2 +-
>> arch/powerpc/mm/mmu_decl.h | 2 +-
>> arch/powerpc/oprofile/Makefile | 2 +-
>> arch/powerpc/oprofile/common.c | 2 +-
>> arch/powerpc/platforms/powermac/cache.S | 4 ++--
>> arch/powerpc/platforms/powermac/feature.c | 2 +-
>> arch/powerpc/platforms/powermac/sleep.S | 4 ++--
>> arch/powerpc/sysdev/Makefile | 2 +-
>> 20 files changed, 33 insertions(+), 33 deletions(-)
>>
>> diff --git a/arch/powerpc/Makefile b/arch/powerpc/Makefile
>> index 8a2ce14d68d0..e259b8a2dd44 100644
>> --- a/arch/powerpc/Makefile
>> +++ b/arch/powerpc/Makefile
>> @@ -241,7 +241,7 @@ KBUILD_CFLAGS += $(call cc-option,-fno-dwarf2-cfi-asm)
>> # often slow when they are implemented at all
>> KBUILD_CFLAGS += $(call cc-option,-mno-string)
>>
>> -ifdef CONFIG_6xx
>> +ifdef CONFIG_PPC_BOOK3S_32
>> KBUILD_CFLAGS += -mcpu=powerpc
>> endif
>
> I never quite understood this part. Let say I want to specify 'power4'
> in arch/powerpc/platforms/Kconfig.cputype as new TARGET_CPU. The line
> above will always append -mcpu=powerpc *after* a TARGET_CPU=power4
> which defeat the whole purpose, right ?
Yes, I think you're right.
The code above was added in 2006 in f48b8296b315 ("[PATCH] powerpc32:
Set cpu explicitly in kernel compiles").
Back then the target CPU selection was 64-bit only, so setting it to
powerpc always for 6xx was fine.
It was only recently that Christophe made the target CPU selection
available on 32-bit, see 0e00a8c9fd92 ("powerpc: Allow CPU selection
also on PPC32").
So since that commit the above has been overriding any specific CPU
selection it seems, eg:
gcc -Wp,-MD,init/.do_mounts.o.d ...
-mcpu=powerpc -mbig-endian -m32 ...
-mcpu=e300c2 ...
-mcpu=powerpc ...
../init/do_mounts.c
That seems like a bug.
It would be good to clean up the CPU selection logic, it's a bit of a
mess. But for now it's probably best to just move the above snippet
prior to the TARGET_CPU logic.
cheers
next prev parent reply other threads:[~2018-12-04 3:55 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-11-17 10:24 [PATCH 1/7] drivers/cpufreq: " Christophe Leroy
2018-11-17 10:24 ` [PATCH 2/7] powerpc: " Christophe Leroy
2018-12-03 21:15 ` Mathieu Malaterre
2018-12-04 3:55 ` Michael Ellerman [this message]
2018-11-17 10:24 ` [PATCH 3/7] powerpc/kconfig: remove CONFIG_6xx Christophe Leroy
2018-11-17 10:25 ` [PATCH 4/7] powerpc/32: Remove #ifdef CONFIG_PPC_STD_MMU_32 in asm/book3s/32/pgtable.h Christophe Leroy
2018-11-17 10:25 ` [PATCH 5/7] powerpc: change CONFIG_PPC_STD_MMU_32 to CONFIG_PPC_BOOK3S_32 Christophe Leroy
2018-11-17 10:25 ` [PATCH 6/7] powerpc: change CONFIG_PPC_STD_MMU to CONFIG_PPC_BOOK3S Christophe Leroy
2018-11-17 10:25 ` [PATCH 7/7] powerpc/kconfig: remove PPC_STD_MMU_32 and PPC_STD_MMU Christophe Leroy
2018-11-19 4:04 ` [PATCH 1/7] drivers/cpufreq: change CONFIG_6xx to CONFIG_PPC_BOOK3S_32 Viresh Kumar
2018-12-07 13:07 ` [1/7] " Michael Ellerman
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=877egqhrnr.fsf@concordia.ellerman.id.au \
--to=mpe@ellerman.id.au \
--cc=benh@kernel.crashing.org \
--cc=christophe.leroy@c-s.fr \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=malat@debian.org \
--cc=paulus@samba.org \
--cc=rjw@rjwysocki.net \
--cc=viresh.kumar@linaro.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
all inboxes | Powered by JetHome®