Received: by 10.223.164.202 with SMTP id h10csp1236666wrb; Fri, 10 Nov 2017 00:28:30 -0800 (PST) X-Google-Smtp-Source: ABhQp+RsGEXk6ByrBJpZjFfj5luUsSJN1NE+zfJXysG1adcRZXpI9S7h/JO9McoQOIKsBeo2btiR X-Received: by 10.99.36.133 with SMTP id k127mr3218209pgk.171.1510302510136; Fri, 10 Nov 2017 00:28:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1510302510; cv=none; d=google.com; s=arc-20160816; b=dXSE/HKzm1lrMyxsOVrgPgxg/aCmjhS6SQF0hnyxzKwqiFRyj1Tu2zzcbzofkHVQHj aW1h9/KIRApu2qFtQi1ixu0iMcj90f47CuC5AowXu/ApE5UckztRIs39uMqR+fhXb96q pi5jJeGrmH3I6e1nyIKNM0iSQXF2w0c2VYxuPnbAh1iY3pUxW6rvRE9JgVqaa5hoHd/H WJYiOwAI4BnX3n0SW/0LcNocF4BmUsqE9nn6vSoK/TTxQ0X1upluC2PazJ6zNwF2YF/M H+oD92aGlSWmmTDvNG5t98Hkntpai0I1Olm1Up3yT70M/2y0cvnaNrh7ArQu+pgvbOo7 qFKQ== 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=cQND+CmfVbRDmoucSrsKNiLcZdlmHWeubfxN3fdGs3c=; b=VxZHc4OoXVayg2i5cF1Sc6CI510F2m7+Cigv+/X6g88u8IfLDBevO1wglD4GmojIm1 D6jMg/2bsRA+GP+qR7Tfvo90sLHcHgfLet7ZhT7AnblIrfGNouiRd00IhBNC9iEV0Skn UNOngkkPkPGLuglrLaIJZKsxwsF86JXDkHnbz1h4jgGf/m11RE0xZZ348SDHlhfcFbNg bY8OflJerg1BEu4Yfz4Dr4OV3Uh4IyIkGwTBGZDgDf3OAPe1wc2kZ0rog9ZUJL1hZ5Fz +j8St4tok+AAsVtE9KQr2dXuraeLl1Gcuv6oveo7mf6l6f/NPKZP0m4o+WCQVrOLhs4u CMMg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=A53E5R3t; 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 x12si8033890pgq.380.2017.11.10.00.28.18; Fri, 10 Nov 2017 00:28:30 -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=A53E5R3t; 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 S1751963AbdKJI1o (ORCPT + 82 others); Fri, 10 Nov 2017 03:27:44 -0500 Received: from mail-ua0-f193.google.com ([209.85.217.193]:44442 "EHLO mail-ua0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750793AbdKJI1j (ORCPT ); Fri, 10 Nov 2017 03:27:39 -0500 Received: by mail-ua0-f193.google.com with SMTP id f46so6296311uae.1; Fri, 10 Nov 2017 00:27:39 -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=cQND+CmfVbRDmoucSrsKNiLcZdlmHWeubfxN3fdGs3c=; b=A53E5R3tFHCHP+sNrSV5+pZOMnvzlLvagXzqD36n4aXeSXoI1UF2V1YBqKehPhGAOf AShW8XZ+hrHLuOlMpLtjheb+Tt5nfyWW/4ak+GxWl+xGRyO2zddbMrkKerUFRhvLTeG8 pfnCj+27wIgmauvkRwbuVollXZvpatbPUYuquFWMR39SuoFY5804DBwJY8mI76UlOCHs DmIyWWrYOkekwdqDhxjswL78Uo8w6j4ld1ZZoAt5QdTQBhuAB/AEHT4dlppvszncz7E5 JEkdH0cmb3Kpp6m1rIuo8DlkoWZnDf0y3BuwZpvas0+QzoO5L3N3JD7QYfsa9t7OfOrc 8shA== 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=cQND+CmfVbRDmoucSrsKNiLcZdlmHWeubfxN3fdGs3c=; b=qWhwg7APRJME0jupVLlu/lUpiyK2Xlfz9I+ipkdXbyBmkfYKA2TxqQP38Rk6cJIj63 N47cTRSGSUnQFGfZv5NmoKY3BJkTM74CiuB1fwchQFnkEoEvKIndUii4JHQEvtAAaVTA ONEOdzgnypNMAnqhuQXFEfIlILh+IcXDMjwq+CKqnbv+Zgbk41f/qQ765BP4gHYm+0VT IkN4aHPwYlpLfCOphx3IncpJgp5ahQ+Hio7LvDht365shMQnFlCF9U1LVQt6vGLu44Oo i950FcU6d1dGXl8H6v7zsGAGyh5n5ubbn4QUgolcRkhQCnwpbWMEGiXHWZger1TmQYt/ Ec2A== X-Gm-Message-State: AJaThX7LPKf5c9zlvawI+AEmenSxclOc0b0hDrcMO/P+opdCSlXUtCEs IRU4+Qa/xuOd65IuP5TJo0le2j87AHwu/8XS4xw= X-Received: by 10.176.91.195 with SMTP id z3mr2863500uae.111.1510302458738; Fri, 10 Nov 2017 00:27:38 -0800 (PST) MIME-Version: 1.0 Received: by 10.159.62.8 with HTTP; Fri, 10 Nov 2017 00:26:58 -0800 (PST) In-Reply-To: References: <7278eca76456b412e02d9baa5dc164e83199cbab.1510118606.git.green.hu@gmail.com> From: Greentime Hu Date: Fri, 10 Nov 2017 16:26:58 +0800 Message-ID: Subject: Re: [PATCH 26/31] nds32: Build infrastructure To: Arnd Bergmann Cc: Greentime , Linux Kernel Mailing List , linux-arch , Thomas Gleixner , Jason Cooper , Marc Zyngier , Rob Herring , Networking , 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-09 18:33 GMT+08:00 Arnd Bergmann : > On Thu, Nov 9, 2017 at 10:02 AM, Greentime Hu wrote: >> 2017-11-08 18:16 GMT+08:00 Arnd Bergmann : >>> On Wed, Nov 8, 2017 at 6:55 AM, Greentime Hu wrote: > >>>> +config GENERIC_CALIBRATE_DELAY >>>> + def_bool y >>> >>> It's better to avoid the delay loop completely and skip the calibration, >>> if your hardware allows. >> >> Thanks. >> Do you mean that this config should be def_bool n? >> why? Almost all arch enable it. > > It depends on what your hardware can do. If you have a way to see how much > time has passed that is guaranteed to be reliable on all machines, then > use that instead. > > On a lot of architectures, it's not possible, so they have to fall back to using > the delay loop. I get it. I will discuss it with our HW colleagues. We may get these informations in some registers. >>>> +config ALIGNMENT_TRAP >>>> + tristate "Kernel support unaligned access handling" >>>> + default y >>>> + help >>>> + Andes processors cannot fetch/store information which is not >>>> + naturally aligned on the bus, i.e., a 4 byte fetch must start at an >>>> + address divisible by 4. On 32-bit Andes processors, these non-aligned >>>> + fetch/store instructions will be emulated in software if you say >>>> + here, which has a severe performance impact. This is necessary for >>>> + correct operation of some network protocols. With an IP-only >>>> + configuration it is safe to say N, otherwise say Y. >>> >>> Which network protocols are you referring to? >> >> I will modify these descriptions. It was written by someone I don't know. :p >> This case only happened when I found is compiler code gen issue or >> wrong pointer usage. > > Ok, should it also be 'default n' then? Yup. I will use 'default n' in the next version patch. >>>> +config HIGHMEM >>>> + bool "High Memory Support" >>>> + depends on MMU && CPU_CACHE_NONALIASING >>>> + help >>>> + The address space of Andes processors is only 4 Gigabytes large >>>> + and it has to accommodate user address space, kernel address >>>> + space as well as some memory mapped IO. That means that, if you >>>> + have a large amount of physical memory and/or IO, not all of the >>>> + memory can be "permanently mapped" by the kernel. The physical >>>> + memory that is not permanently mapped is called "high memory". >>>> + >>>> + Depending on the selected kernel/user memory split, minimum >>>> + vmalloc space and actual amount of RAM, you may not need this >>>> + option which should result in a slightly faster kernel. >>>> + >>>> + If unsure, say N. >>> >>> Generally speaking, highmem support is a mess, and it's better to avoid it. >>> >>> I see that the two device tree files you have list 1GB of memory. Do you think >>> that is a common configuration for actual products? Do you expect any to >>> have more than 1GB (or more than 4GB) in the future, or is that the upper >>> end of the scale? >>> >>> If 1GB is a reasonable upper bound, then you could change the vmsplit >>> to give slightly less address space to user space and have 1GB of direct-mapped >>> kernel memory plus 256MB of vmalloc space reserved for the kernel, >>> and completely avoid highmem. >> >> Thanks. >> We do realy use 1GB ram in some products. >> We also verify CONFIG_HIGHMEM with LTP too. >> It seems fine but I will study vmsplit to see if we should use it. > > For the 1GB configuration, something like ARM's CONFIG_VMSPLIT_3G_OPT > should be optimal, it will result in better performance because it allows you > to completely turn off CONFIG_HIGHMEM. The reason we don't always > use it on ARM is that traditionally we had the 3GB vmsplit, and some > applications > might rely on having the exact amount of available address space that they > expect. For a new architecture that should be less of a problem. > > The interesting case is what happens if you have machines with 1.5GB or > or more physical RAM. You can obviously have another vmsplit configuration > for those, but at some point going to highmem is better than limiting the > user address space. > > Ideally 1.5GB is the point where you start using a 64-bit CPU, but of course > that is not something you have available at the moment. >>>> +config MEMORY_START >>>> + hex "Physical memory start address" >>>> + default "0x00000000" >>>> + help >>>> + Physical memory start address, you may modify it if it is porting to >>>> + a new SoC with different start address. >>>> +endmenu >>> >>> On ARM, we found options like this to be rather problematic since it prevents >>> you from running the same kernel on boards that are otherwise compatible. >>> >>> If the architecture easily allows the memory to start at address 0, could >>> you require this address for all SoCs that want to run Linux, and get >>> rid of the compile-time option? >> >> Thanks. >> The reason we need this config is because we need to define PHYS_OFFSET. >> #define PHYS_OFFSET (CONFIG_MEMORY_START) >> >> It needs to be set in compile-time. I don't know how to get rid of it. > > PHYS_OFFSET doesn't have to be a constant, a lot of architectures make > the __va()/__pa() and related functions use a variable for the offset. > This is also useful to implement KASLR, and booting the kernel from > a random physical address. > > My actual suggestion however was to just mandate that PHYS_OFFSET > is always zero for your architecture, and not support any other value. > This is easy as long as you don't have existing hardware that would > break. Thanks. I will check how other architectures do. I can mandate that PHYS_OFFSET is zero but our customers(SoC company) may not use 0x0 as default DRAM starting address. This assumption is a little bit too strong. From 1583584304360728783@xxx Thu Nov 09 10:34:38 +0000 2017 X-GM-THRID: 1583483358934427114 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread