Received: by 10.223.164.202 with SMTP id h10csp263497wrb; Wed, 29 Nov 2017 21:49:22 -0800 (PST) X-Google-Smtp-Source: AGs4zMbmGtd9U83KUT2tM/lMuGBCMM4JFVty7v0HNYissOcSe3wqak/itqLEaJuQ1TrGKxAapMz9 X-Received: by 10.159.253.73 with SMTP id b9mr1418399plx.357.1512020962855; Wed, 29 Nov 2017 21:49:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1512020962; cv=none; d=google.com; s=arc-20160816; b=Fgjtf7ZdzY+5ph5KpRMk4ezAztZOTh9db6BID2F3MV0ZpUiQB0+qPSYDoJ5S4jHMmN PSXABlXHXz+hB1NzEVmfiuPIvR56jMAQDSjjtbXZPL71wPCN2WB5LxvRilYqWOb2poBi ydnhqoGBXZrWfPqJ6ySISgnqwYwOX+l4t/XXmoOjpCh5aHDfKirdb6gf85z9mKHWXQzN chndHWSyLrep0qE0yHshQ7aSbUbVBEqGNoR05X5bpnV1UGU+/4HRvtWNPEbYZpBcoul+ HQz9NIhRzCkfuBI9x0581qIIkUytOmQYqO2T0I1Iz2c2JhsU23od5+0HOT82Cf7k1b5F G+6Q== 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=YufgGbukBqWA+lxn1ShYOjMTmWRo7WC0cOMxvuh3Nfo=; b=SY1eCppfxmgwkLEmacfibkwFX5f8lZK+V1173EVjfGXRDhn1rR1xtJ/kz4EQDs5Go9 V+Yti2Dw6LUI5BAyhEpK81DFme9cMIbBuxMYXzGREQpQEYr3aPIR7WAeKd5RI+8GWnL6 TShwg6ffDqkjqBdcAkl1SuVuqA3Rpx8mv0KYTRR8yKtQMGr99O/d7eoqeN2Ir1Pzp+HT 5sNE+WA3uoPs3kDLtOQ4DHN+HmBVn3jtwCP31f2M6b3fU5nEk//kr0B9oK0wx3ZEbAPg GrOFdxVYFGNRpiDw2AGyxB7IwG82i+iHH9XSB8SVK/a9VxqoJQdrY6ZACQ+ivh1DEVRx 0soA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=ScwQ6RpI; 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 d62si2473810pgc.151.2017.11.29.21.49.09; Wed, 29 Nov 2017 21:49:22 -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=ScwQ6RpI; 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 S1751513AbdK3Fsv (ORCPT + 99 others); Thu, 30 Nov 2017 00:48:51 -0500 Received: from mail-ua0-f195.google.com ([209.85.217.195]:46378 "EHLO mail-ua0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750920AbdK3Fsq (ORCPT ); Thu, 30 Nov 2017 00:48:46 -0500 Received: by mail-ua0-f195.google.com with SMTP id t24so5001679uaa.13; Wed, 29 Nov 2017 21:48:46 -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=YufgGbukBqWA+lxn1ShYOjMTmWRo7WC0cOMxvuh3Nfo=; b=ScwQ6RpI+yuWYIcpQN1zJojVPKCEdwWZVwqvUihAAhjAUE19fHeDDgi6UHyKiW3s2D knXIMvU7ZTxlrU34fd8Irp4/KATxVzC0/qwzBLgo1hhWkMAts8yXpfsRMMegPP2vqpxC OATPvh0J/dUYqHzIwwaU0crXy/4/RaV9dfdmBXTa5oyBwcxiAkzrCT5LXjeFDCzbRg1u RdWgmpjEvhIAWhv6noidho9HlW0XrNSImkegB1JqLwk8GXibsvdP9+TgdRQ96+Tlkwy0 CL84XXB9hdJOeXUfYlwF2HvOuPzedSInXasUQZYcuLbbcGwYdWjBWH565+63T2sEJYl5 cjcQ== 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=YufgGbukBqWA+lxn1ShYOjMTmWRo7WC0cOMxvuh3Nfo=; b=G0Av9a0CjkPIQX1akGwPzN8bH0USZctmwK6eJ0Qc/0SK+oWTrKSRJu0BCzLiQ0Y1Wm oGtLL7qjQm2FF5MCQ8adq92/8FegHPRvGH0JeDGhm6dPRFo4E07JczXgxTYnBoUatGP0 xFqMW2OPFBezrVBo53l/3lhNjMj72edMdCpSC5+kq+T1vt9AYJIcvHDYkBs3PaMDa0ds OUTzemGzuzJpXnGREDAuDOMCi6XctlvJaWr9mKw+GLBkoYRXh63ZAjgmdRJjD2h08qc6 6HiVrbhpry41w2O5w4RMRF8a8OHnqwzwRb8qnjLrBevvb2eecK6cuaKXZKCVwSGRb8rx LjMg== X-Gm-Message-State: AKGB3mIvJ4H5Apo0kMCbuvOZ8vxbWQz5gncNmgysWYEF9yX31DjWbdjx 0hPPrbfvGZPD0vY1P6jppzMMDln7/VcMkQ/PPkk= X-Received: by 10.176.30.12 with SMTP id m12mr925947uak.91.1512020925784; Wed, 29 Nov 2017 21:48:45 -0800 (PST) MIME-Version: 1.0 Received: by 10.176.27.105 with HTTP; Wed, 29 Nov 2017 21:48:05 -0800 (PST) In-Reply-To: References: <5e1be9ebc591c6de79b75f726a5a38b2564eaa92.1511785528.git.green.hu@gmail.com> From: Greentime Hu Date: Thu, 30 Nov 2017 13:48:05 +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 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 : >>> On Wed, Nov 29, 2017 at 12:39 PM, Greentime Hu wrote: >>>> >>>> How about this? >>>> >>>> choice >>>> prompt "CPU type" >>>> default CPU_N13 >>>> 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" >>>> select CPU_CACHE_NONALIASING if ANDES_PAGE_SIZE_8KB >>>> config CPU_D15 >>>> bool "AndesCore D15" >>>> select CPU_CACHE_NONALIASING >>>> select HWZOL >>>> config CPU_D10 >>>> bool "AndesCore D10" >>>> select CPU_CACHE_NONALIASING if ANDES_PAGE_SIZE_8KB >>>> endchoice >>> >>> With a 'choice' statement this works, but I would consider that >>> suboptimal for another reason: now you cannot build a kernel that >>> works on e.g. both N13 and N15. >>> >>> This is what we had on ARM a long time ago and on MIPS not so long >>> ago, but it's really a burden for testing and distribution once you get >>> support for more than a handful of machines supported in the mainline >>> kernel: If each CPU core is mutually incompatible with the other ones, >>> this means you likely end up having one defconfig per CPU core, >>> or even one defconfig per SoC or board. >>> >>> I would always try to get the largest amount of hardware to work >>> in the same kernel concurrently. >>> >>> One way of of this would be to define the "CPU type" as the minimum >>> supported CPU, e.g. selecting D15 would result in a kernel that >>> only works on D15, while selecting N15 would work on both N15 and >>> D15, and selecting D10 would work on both D10 and D15. >>> >> >> Hi, Arnd: >> >> Maybe we should keep the original implementation for this reason. >> The default value of CPU_CACHE_NONALIASING and ANDES_PAGE_SIZE_8KB is >> available for all CPU types for now. >> User can use these configs built kernel to boot on almost all nds32 CPUs. >> >> It might be a little bit weird if we config CPU_N10 but run on a N13 CPU. >> This might confuse our users. > > I think it really depends on how much flexibility you want to give to users. > The way I suggested first was to allow selecting an arbitrary combination > of CPUs, and then let Kconfig derive the correct set of optimization flags > and other options that work with those. That is probably the easiest for > the users, but can be tricky to get right for all combinations. > > 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. 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. 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 From 1585433576474622839@xxx Wed Nov 29 20:28:02 +0000 2017 X-GM-THRID: 1585224361841060243 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread