From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753826AbdK2I65 (ORCPT ); Wed, 29 Nov 2017 03:58:57 -0500 Received: from mail-ot0-f196.google.com ([74.125.82.196]:33145 "EHLO mail-ot0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751355AbdK2I6z (ORCPT ); Wed, 29 Nov 2017 03:58:55 -0500 X-Google-Smtp-Source: AGs4zMbvZN0qWV2wB4IeiWBCVqp75kfVba7qUC3BbWYJDhubxoyBcVZjN8rZfm3UeswaPtCXTjUdRVic1u/pn+Gm3Ps= MIME-Version: 1.0 In-Reply-To: References: <5e1be9ebc591c6de79b75f726a5a38b2564eaa92.1511785528.git.green.hu@gmail.com> From: Arnd Bergmann Date: Wed, 29 Nov 2017 09:58:53 +0100 X-Google-Sender-Auth: KQaKRsp6rHSuTNjG7HfdTvseDRw Message-ID: Subject: Re: [PATCH v2 25/35] nds32: Build infrastructure To: Greentime Hu Cc: Greentime , Linux Kernel Mailing List , linux-arch , Thomas Gleixner , Jason Cooper , Marc Zyngier , Rob Herring , Networking , Vincent Chen , DTML , Al Viro , David Howells , Will Deacon , Daniel Lezcano , linux-serial@vger.kernel.org, Vincent Chen Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Nov 29, 2017 at 9:39 AM, Greentime Hu wrote: > 2017-11-27 22:21 GMT+08:00 Arnd Bergmann : >> On Mon, Nov 27, 2017 at 1:28 PM, Greentime Hu wrote: >>> diff --git a/arch/nds32/Kconfig.cpu b/arch/nds32/Kconfig.cpu >>> +config CPU_CACHE_NONALIASING >>> + bool "Non-aliasing cache" >>> + help >>> + If this CPU is using VIPT data cache and its cache way size is larger >>> + than page size, say N. If it is using PIPT data cache, say Y. >>> + >>> + If unsure, say Y. >> >> Can you determine this from the CPU type? > > There is no cpu register to determine it. It also depeneds on page > size and way size however page size is configurable by software. > These codes are determined at compile time will be benefit to code > size and performance. > IMHO, I think it would be better to be determined here. I meant determining it at compile time from other Kconfig symbols, if that's possible. Do the CPU cores each have a fixed way-size? If they do, it could be done like menu "CPU selection" config CPU_N15 bool "AndesCore N15" select CPU_CACHE_NONALIASING config CPU_N13 bool "AndesCore N15" select CPU_CACHE_NONALIASING if PAGE_SIZE_16K ... endmenu and then you can use the same CPU_... symbols to make other decisions as well, e.g. CPU specific compiler optimizations. Arnd