Received: by 10.223.164.202 with SMTP id h10csp452531wrb; Thu, 30 Nov 2017 02:02:38 -0800 (PST) X-Google-Smtp-Source: AGs4zMYKir6Mu56TU+RKLb+vJzwujls7/WqyYsYL4nm1KAcv2B364TIdDPKWmAKLwOfHucLqlNq1 X-Received: by 10.98.196.77 with SMTP id y74mr6138517pff.186.1512036158650; Thu, 30 Nov 2017 02:02:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1512036158; cv=none; d=google.com; s=arc-20160816; b=vEMQ0kfKfKKLGbLv21j9GV/5ng7RSHDcV/LPpq5jvAGkrn8VaY/C/SYiM9mIkTH0mO ctTFuDabyS69lEXWx9VJ34TmNaQ3mik7udjDt1vjk1FuPqAGEAvIr6tlhhK7Q1LZy6a3 ORXUJs9nSIDIERnM5i3In5F8bLxaQFv4IbzA3r5XYcJXIefjeeMvPsYtfJg8FnRgU9Nq 7QTnn0QjWr1cVyMlS7HDSP9zze34rOz9sjHjgqucK/sQbH932I+ENKNSkjy6P7hrngvF DNi1r65bpNfu/4ZqDocmjFl8YpbwgXQ4tVR6xbfN9R+0fYYN2KLcqu6mN+R04YhLG638 Tnhw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=0wpUqsa88mPera5PNyYZHD93J5NXForGYa+2sRzsCis=; b=ZYec0ccsAd9ky6oaXBUihue98Y6hs28uZHm3kcULZ2PbNcu4DpdxK84LZdQ+fUY3Xh t0Q4jRSeQdNqn8SIuNY31KZhKpTAyRtFo9NC8NhqJfqIlW4cYD4F84oC3rxS0P02WhTp MtupOvtYJQx+tc6RPner/bCOUZa6ATWqbnJ9dE0fTysedg/zfH4gDcDMdfwUyxtB8BXM wS+K+4IXcPQklin21PvEnFBoixVkzOzVxNULEB8ztkKnHDqyRnEaTr6ni5vKNxag0vGh 5lAcd94VqPcXK+3QBxh0PWXlFc576dgsDSOMeRQVDLK45ew5tEidbDZf+o77wrtZVdqw dJVQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=tkHm+MnL; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t10si2854594plh.762.2017.11.30.02.02.25; Thu, 30 Nov 2017 02:02:38 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=tkHm+MnL; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751498AbdK3KCH (ORCPT + 99 others); Thu, 30 Nov 2017 05:02:07 -0500 Received: from mail-vk0-f45.google.com ([209.85.213.45]:39016 "EHLO mail-vk0-f45.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750760AbdK3KCE (ORCPT ); Thu, 30 Nov 2017 05:02:04 -0500 Received: by mail-vk0-f45.google.com with SMTP id h203so3039869vka.6; Thu, 30 Nov 2017 02:02:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=0wpUqsa88mPera5PNyYZHD93J5NXForGYa+2sRzsCis=; b=tkHm+MnLpP3v4eUjdQ0+SjR2mRsCsT7iIO734D5CNjVdXkBp+iVr+2jztx7zy3Jh3V DYEe5nCT7/I+uuwzgH2on4RT3/U6Lneb2/h5UyE3l1MZxrM532YmdigsE4UPAyy1Xxq1 iTRaO3z8CfJVE18HHARQd3Gf9xOxZdiuGowSVspMk+UFtIm5/gSGT6/0/P+VsIPvxfry 5IBfARxNRSbDx0ZFF8rmZRcVqyt6UIOGcc+tBFolws4fMpxEi7p4TxCxiqVWw2SlzTby DTLEm1RFfsqxnEQ9Jjvy4QRJlIq5lVGxh/kQLWZSCZcUf9tXPwqBWKZX+ZuTi0j0RkU4 1xLQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=0wpUqsa88mPera5PNyYZHD93J5NXForGYa+2sRzsCis=; b=fJMxoeJcJIma2Elypgeb2L95cL/ixaVIY75TGfeNiEVWC1RbPprw2wZb667TlgwkKM 6mcFeBxUUICk6vUUMylpAqwOgolro0c1tFxwtpf3mhvJTBj8eXYdNutykAFInmFj2OA5 ahyL8JuoiNHbmteH+WCQuQJ8M2GcV4l02b4PhAbwJ/bufPyAJrRD0HQWuxJq/+iCMuQv WRoL+zOw97Xs2oRfrOaG46m5jXqCpbIarD/ijP7MlCp0HO9+pT926nZ+zN6HxQg5mumX g199NLDhQrFiLo41sdGPDC2r4Sz6mpnC7JbRTQHIes2UfmRsNazxM99G3HwpMNqRDBkT RwXQ== X-Gm-Message-State: AKGB3mLx1Zyr1oJwuXoZinJo8Zrr8oV4YNKJ4kL8weQwTg9yZNsXk8To bVdtPxK7ftrBZFAUD40LeQb+BSl6i7F0ZfI4CF0= X-Received: by 10.31.205.131 with SMTP id d125mr1368686vkg.198.1512036122887; Thu, 30 Nov 2017 02:02:02 -0800 (PST) MIME-Version: 1.0 Received: by 10.176.27.105 with HTTP; Thu, 30 Nov 2017 02:01:22 -0800 (PST) In-Reply-To: References: <5e1be9ebc591c6de79b75f726a5a38b2564eaa92.1511785528.git.green.hu@gmail.com> From: Greentime Hu Date: Thu, 30 Nov 2017 18:01:22 +0800 Message-ID: Subject: Re: [PATCH v2 25/35] nds32: Build infrastructure To: Arnd Bergmann Cc: Geert Uytterhoeven , 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 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 2017-11-30 17:30 GMT+08:00 Arnd Bergmann : > On Thu, Nov 30, 2017 at 6:48 AM, Greentime Hu wrote: >> 2017-11-30 4:27 GMT+08:00 Arnd Bergmann : >>> On Wed, Nov 29, 2017 at 3:10 PM, Greentime Hu wrote: >>>> 2017-11-29 19:57 GMT+08:00 Arnd Bergmann : > >>> When you put them in a sorted list like I mentioned for simplicity, you >>> could reduce the confusion by naming them differently, e.g. >>> CONFIG_CPU_N10_OR_NEWER. >>> >>> Having only the CPU_CACHE_NONALIASING option is fine if you >>> never need to make any other decisions based on the CPU core >>> type, but then the help text should describe specifically which cases >>> are affected (N10/N13/D13 with 4K page size), and you can decide to >>> hide the option and make it always-on when using 8K page size. >>> >>> Arnd >> >> >> Hi, Arnd: >> >> I think I can use this name "CPU_V3" for all nds32 v3 compatible cpu. >> It will be implemented like this. > > I think I'm still a bit confused about the relation between CPU cores > and architecture levels. Is it correct to say that there are orthogonal, > and that you can have e.g. an N10 core implementing either nds32v2 > or nds32v3? > Yup, we did having N10 cores are implementing either nds32v3 or nds32v2, but nds32v2 are not used anymore. We can assume every nds32 cores are v3. > There is nothing wrong with that of course, it's just not what I > expected from having worked with other architectures. > > I also see that GCC has no pipeline specific optimizations for > specific cores, it just understands the differences between the > architecture levels, so at least today there is way to pass e.g. > "-march=nds32v2 -mtune=d15" to generate code that would > work on both v2 and v3 but be optimized for d15. Thanks. We will work on that. >> config HWZOL >> bool "hardware zero overhead loop support" >> depends on CPU_D10 || CPU_D15 >> default n >> help >> A set of Zero-Overhead Loop mechanism is provided to reduce the >> instruction fetch and execution overhead of loop-control instructions. >> It will save 3 registers($LB, $LC, $LE) for context saving if say Y. >> You don't need to save these registers if you can make sure your user >> program doesn't use these registers. >> >> If unsure, say N. >> >> config CPU_CACHE_NONALIASING >> bool "Non-aliasing cache" >> depends on !CPU_N10 && !CPU_D10 >> default n >> 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 N. > > This looks ok, yes, but as Geert said, it would seem more intuitive to > write it as > > config CPU_CACHE_ALIASING > bool "Aliasing VIPT cache" > depends on CPU_N10 || CPU_D10 > >> choice >> prompt "CPU type" >> default CPU_V3 >> config CPU_N15 >> bool "AndesCore N15" >> select CPU_CACHE_NONALIASING >> config CPU_N13 >> bool "AndesCore N13" >> select CPU_CACHE_NONALIASING if ANDES_PAGE_SIZE_8KB >> config CPU_N10 >> bool "AndesCore N10" >> config CPU_D15 >> bool "AndesCore D15" >> select CPU_CACHE_NONALIASING >> config CPU_D10 >> bool "AndesCore D10" >> config CPU_V3 >> bool "AndesCore v3 compatible" >> select ANDES_PAGE_SIZE_4KB >> endchoice > > Two points here: > > - Generally you should not mix 'select' and 'depends on' like this. > Either you make the cache aliasing a user visible option that > uses 'depends on' with a combination of CPU cores, or you > make it a hidden option (with no string after the "bool" keyword) > that always gets selected from the per-cpu options. > > - There is a little-known trick with choice statements that allows > you to use 'tristate' instead of 'bool' in the choice. In that case, > you can enable multiple options together as long as all of them > are 'm'. > > Arnd Thanks. CPU_CACHE_ALIASING is more intuitive. I will apply it. From 1585482950297494138@xxx Thu Nov 30 09:32:48 +0000 2017 X-GM-THRID: 1585224361841060243 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread