Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp7788055imu; Mon, 3 Dec 2018 19:56:33 -0800 (PST) X-Google-Smtp-Source: AFSGD/V5S4iU539ao0+jBNTz+nElR7tm8zdJiLk0zXv512b2fZzGb9pUPOl8JCQ6Ctj7rGMomJat X-Received: by 2002:a17:902:9691:: with SMTP id n17mr19002713plp.9.1543895792987; Mon, 03 Dec 2018 19:56:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543895792; cv=none; d=google.com; s=arc-20160816; b=K1SNwdVLRO5szF4LXAH3fvpXD+5an0LIvflf61WM/v9BH/Aa6Q5XwC+FT529vZsV7m c1JBEztw1euhu3PuVthP4hjudD7+XnQ9I89b22suULNSuqbu8BE9KkUgEcA5IJz4MZKZ A9A9JJYcPYbEQ0r2aGPOAbefyf7P1x4KWBcdDe855j4NqALctuLzFPyczA7s8q/1+ONU eXsm4JjZpOH1+Wf0Cikn4UTdRv6iS4tsldxd02jLrSxzQdn6ih2GAuiERnDjIKh8Kc3u 7t1ZqO8q3BI3oTWEGWYsPuDBL/Bi8Tn5Z64WB4khInXjQX/mEhwa9MBUdMot75SwjGvU jw/w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:references :in-reply-to:subject:cc:to:from; bh=0Knp7j0AIkWtqXoTJAgz0iOFYoyRgQrR0ge+MOPh8qk=; b=g7uVsrszXytgVW8sTZ3sPVkJUKBimC1AVZ5t8i2qby+Jl/yQO6Fs6Gn9QhzLJylnZa +9YmEEdydB9ECf8rNR2QKkSwIy6CCdQr0jzcq73m2k4o2rv7iOfwuVlWSjUxPnkhfsKj BZUJSSwy3WHbpP9CYb/Q0M7PF05oik3aZPyV0Ppdz5lYXdwmR6JSu1v3GZ9nu1lQPnDA 0A3ZH5t6FPGw+aheqop9T9JFhdy+/qPzHM08uVWzjkq0PaZLcxFnZH1DLpAuLnztMB98 9PLGzbZnn54jkWY84/txfIf8Y+pDMWjUPVh2FwKv92CD+/x8PZiBlE0h73xqx0VroJW6 cyIA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z15si14736088pgi.304.2018.12.03.19.56.18; Mon, 03 Dec 2018 19:56:32 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726038AbeLDDzn (ORCPT + 99 others); Mon, 3 Dec 2018 22:55:43 -0500 Received: from ozlabs.org ([203.11.71.1]:44455 "EHLO ozlabs.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725971AbeLDDzm (ORCPT ); Mon, 3 Dec 2018 22:55:42 -0500 Received: from authenticated.ozlabs.org (localhost [127.0.0.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPSA id 4387Lf5JD9z9s55; Tue, 4 Dec 2018 14:55:38 +1100 (AEDT) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=ellerman.id.au From: Michael Ellerman To: Mathieu Malaterre , Christophe LEROY Cc: Benjamin Herrenschmidt , Paul Mackerras , rjw@rjwysocki.net, viresh.kumar@linaro.org, linuxppc-dev , LKML , linux-pm@vger.kernel.org Subject: Re: [PATCH 2/7] powerpc: change CONFIG_6xx to CONFIG_PPC_BOOK3S_32 In-Reply-To: References: <73b5e7a43bb5979ac534d1c236adb2e04f9d6307.1542395798.git.christophe.leroy@c-s.fr> Date: Tue, 04 Dec 2018 14:55:36 +1100 Message-ID: <877egqhrnr.fsf@concordia.ellerman.id.au> MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Mathieu Malaterre writes: > On Sat, Nov 17, 2018 at 11:29 AM Christophe Leroy > 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 >> --- >> 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