Received: by 10.223.176.46 with SMTP id f43csp3050872wra; Mon, 22 Jan 2018 07:40:08 -0800 (PST) X-Google-Smtp-Source: AH8x2258F6qlIDU7Fyg7tzPtHborcRtXdJERn/70izP0emEyk9A8ZNY9K8UKArV2UYc81om+sVV1 X-Received: by 10.107.147.87 with SMTP id v84mr8657385iod.293.1516635607814; Mon, 22 Jan 2018 07:40:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516635607; cv=none; d=google.com; s=arc-20160816; b=CyXJ1FeviNSuVBVk49eADH2jtbXO6CSiv+6qMXuo2FtffPSHMFA3TIh/vQOxYc94ud y645tkRiNcyGCF+l//rZOBndz6qCVHG4SvRkdJoy6VNc1Q51azPrCVnQtYGZJcVLQWuO G8XKNzA+YTZM0GG4vJlYa3KWEJBPIXPVB9DHguqOUAcMvq9DNz7mWfv4UilruOGHsIGi fzQsmqF37+8Bo/K60HjARjayGQDtHFZXh3HPRYg+i2GQ8dfCI1ZmJb0u1RLKJWbN4cqd 2Bt1iSzsJqRUQw0u/XPDS5nCf76javLrF84Ka9aCXfjqPhDJnrNiqXb1s2LuxnK1A6pP 3jFQ== 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=yT+EqRhNakYGlWGfCzRlpXpZwbOj9TNg8edPjYzLd3M=; b=QJZgt4Dzokwut3R7J3DiFxotCVJnI6IeEsMUk/hUymY9sG7XZLsuqbbWmSyhpNJcGh PUKFO/2jWzwqDs/ZXn6p1F4eZK+kxnndl1CinFXid31XhX2Rs2x+1amIdvytcUU9NhyX 48w/RUJpfwDtEgsmtC/19g7B70r41CVkkFi/yWa5BC0K74VRVVbVeT0NOQBbAGGkn9E5 TTdVaffgqUec823YrACGbEYpCRvnSuyeCMiGZP4CUCLLpZE2RP0RKfUdtmLvC4iuAggd xpUDMFVp9IBSdx6yNG3Baj3y8eoXRZybxWyrTaqUhiOXYV2BPbRhkEbr2ZMCrWa+BIEK pNwg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=ochDQJWX; 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 d8si5976030itf.75.2018.01.22.07.39.54; Mon, 22 Jan 2018 07:40:07 -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=fail header.i=@gmail.com header.s=20161025 header.b=ochDQJWX; 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 S1751185AbeAVPjF (ORCPT + 99 others); Mon, 22 Jan 2018 10:39:05 -0500 Received: from mail-ot0-f195.google.com ([74.125.82.195]:37570 "EHLO mail-ot0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751116AbeAVPjB (ORCPT ); Mon, 22 Jan 2018 10:39:01 -0500 Received: by mail-ot0-f195.google.com with SMTP id a24so7810482otd.4; Mon, 22 Jan 2018 07:39:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=yT+EqRhNakYGlWGfCzRlpXpZwbOj9TNg8edPjYzLd3M=; b=ochDQJWXKDbLUb+AZCdx0weu/2zAhTcPyEpU/RyiD4hBAFtLoklL9NogTFv9w6VcwP ojttape2x/XaNp73m2KpNXA7OGg1KRiyF2uQrPHtOd9mjZftznhX6b+LVvVBcXZKqUtI 6Imcky3QNO65UpV3WzyXmKts2xTmNtB4SNKwlcEr8xqSH4U0VtQ4Mxb+tJtiptm2HFmZ DZqnmTxydtjzzDuAuefMmcrvDMfnbpebWxYyQ6DhFFxKK3Cel/BUd6CIlxYLR0SvDb/8 EYEKGjB1kW7mxTIQNNwFutPV/m7Ka9bnfq4M5feru1tSlrJCdRp/6+uoizGAJiFtELd5 ibcQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=yT+EqRhNakYGlWGfCzRlpXpZwbOj9TNg8edPjYzLd3M=; b=SArbkRLwU24Mi3zYGqaGizTh++P2rDdRGNMsxsEYMIVyBBJQcCQMmwlvJi4ArZwzj0 sFOXTnilTTtmkIRWlD1GpSCh5i/msbVCkQ9CBOxEWQEr5UwBYC3JWkULjfhHfwk4Ln+U T0TkHex1F8rBt7qzYMgKI5GduupCsUj5bdymsVywYrrQn+WxhdNboSLU4gMvbbjI2QZe YrJHyzahfcxp5/gMJwkOi670pNOT59G90Y8FklyaH9BzhKOJKqlzu4wtcJDaMQdcODz2 qZDXiGx1wsG1DL9JXvmqjGXdEXqFXGvMiLtwTxTtQtTN2g5OiZeakGmBEsoUx3RfjdhY bN4g== X-Gm-Message-State: AKwxytdL9QitV6TJ8h2DCQr/R9ivYR1+4XXgPYYvdduDbw5TKjxlPd3b eq/JNPCaKQ+hNrVGOkiwrj6em9VH2Cx+xMW4p01HT2XQ X-Received: by 10.157.67.90 with SMTP id y26mr4194520oti.229.1516635540131; Mon, 22 Jan 2018 07:39:00 -0800 (PST) MIME-Version: 1.0 Received: by 10.157.68.119 with HTTP; Mon, 22 Jan 2018 07:38:59 -0800 (PST) In-Reply-To: References: From: Arnd Bergmann Date: Mon, 22 Jan 2018 16:38:59 +0100 X-Google-Sender-Auth: 9M7bVRHSZ4F6scRmBRmZKLeabDE Message-ID: Subject: Re: [PATCH v6 29/36] 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, Geert Uytterhoeven , Linus Walleij , Mark Rutland , Greg KH , Guo Ren , Randy Dunlap , David Miller , Jonas Bonn , Stefan Kristiansson , Stafford Horne , 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 On Mon, Jan 22, 2018 at 4:20 PM, Greentime Hu wrote: BE >> >> I think it's better to drop GENERIC_IRQ_PROBE here, no modern driver >> should rely on that. > > I will drop it. > >>> +choice >>> + prompt "CPU type" >>> + default CPU_V3 >>> +config CPU_N15 >>> + bool "AndesCore N15" >>> +config CPU_N13 >>> + bool "AndesCore N13" >>> + select CPU_CACHE_ALIASING if ANDES_PAGE_SIZE_4KB >>> +config CPU_N10 >>> + bool "AndesCore N10" >>> + select CPU_CACHE_ALIASING >>> +config CPU_D15 >>> + bool "AndesCore D15" >>> +config CPU_D10 >>> + bool "AndesCore D10" >>> + select CPU_CACHE_ALIASING >>> +config CPU_V3 >>> + bool "AndesCore v3 compatible" >>> + select ANDES_PAGE_SIZE_8KB >>> +endchoice >> >> I forget what we discussed here earlier, but at the very least, there should be >> some help text here to explain what the implications are. I assume that you >> generally want to be able to build one kernel to run on all of the above, right? >> >> Will selecting 'CPU_V3' result in a kernel binary that can run on all of them? >> If so, please explain it here as that is not obvious. >> >> For the other CPU types, can you list the what backwards-compatiblity >> you get? E.g. will a kernel built for N13 run on any of N15, D15 or N10? >> > Yes, we would like to build a kernel with CPU_V3 to run on all of the above. > > Not sure if these help texts clear enough? > > choice > prompt "CPU type" > default CPU_V3 > help > The data cache of N15/D15 is implemented as PIPT and it will > not cause the > cache aliasing issue. The rest cpus(N13, N10 and D10) are > implemented as > VIPT data cache. It may cause the cache aliasing issue if > its cache way > size is larger than page size. You can specify the the CPU > type direcly or > choose CPU_V3 if unsure. > > A kernel built for N10 is able to run on N15, D15, N13, N10 or D10. > A kernel built for N15 is able to run on N15 or D15. > A kernel built for D10 is able to run on D10 or D15. > A kernel built for D15 is able to run on D15. > A kernel built for N13 with CPU_CACHE_ALIASING is able to > run on N15, D15, N13, N10 or D10 > A kernel built for N13 without CPU_CACHE_ALIASING is able to > run on N15, N13 or D15 > > config CPU_N15 > bool "AndesCore N15" > config CPU_N13 > bool "AndesCore N13" > select CPU_CACHE_ALIASING if ANDES_PAGE_SIZE_4KB > config CPU_N10 > bool "AndesCore N10" > select CPU_CACHE_ALIASING > config CPU_D15 > bool "AndesCore D15" > config CPU_D10 > bool "AndesCore D10" > select CPU_CACHE_ALIASING > config CPU_V3 > bool "AndesCore v3 compatible" > select CPU_CACHE_ALIASING > endchoice I would drop the description about CPU_CACHE_ALIASING in the list of compatibilities text and simply say 'A kernel built for N13 is able to run on N15, N13 or D15', it's more logical that way, and it gives you the freedom to later change the rules about whether it can or cannot run. Maybe also change the initial prompt from "CPU type" to "minimum CPU type". >> I think the 'select ANDES_PAGE_SIZE_8KB' cannot work as expected, >> since ANDES_PAGE_SIZE_8KB is inside of a 'choice' statement. Since >> there are only two options (4K and 8K), you can address that by making >> it a simple bool option and fall back to 4K when ANDES_PAGE_SIZE_8KB >> is disabled. > > After reviewing this config, it seems to make much more sense if we > select CPU_CACHE_ALIASING. > A kernel with aliasing cache handling should be able to run on > aliasing/non-aliasing CPU. > > config CPU_V3 > bool "AndesCore v3 compatible" > select CPU_CACHE_ALIASING Sure, that's a possible way out. Arnd