Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp655940imm; Mon, 2 Jul 2018 19:54:58 -0700 (PDT) X-Google-Smtp-Source: AAOMgpfurZltnImxvZ7UsZvbHnvBFXAb38oHdx4zYsn/EZ+crHzi6UoqH8RQK2JMlcQedD9EkKXw X-Received: by 2002:a63:5106:: with SMTP id f6-v6mr6423308pgb.95.1530586498690; Mon, 02 Jul 2018 19:54:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530586498; cv=none; d=google.com; s=arc-20160816; b=MhxaRxapvNfC3v+vBCxHtArolt9FEnW/CVcD+XLjasiiDEhtKzMvhFMZ89pXaWkAlv RbBVMmlfbumlIUp3uZwzmt6fK2OOJzdf8d59nnzLG7dljhWNhQ8LuT/HUFvJ8+PSX5Du chkQi2BzGz0vxFf9aArOCzrJeZtaox8JZVfacQr47YvyUHyRMBSg/ZvHUQmDsAU5RDOj lO4kGESP5xm8m7wIKFtWYjwy5/yKQitQ+r6P/eIjA9kSv0qOPGyCTIVY0v2K1Cyo7/C2 6UkkRo0+ncxlLxyUk6fiHTIBjPnhJxBrR+s5N9GPuiuVF49j5jL6s0H/P4sl5c+qRB8h Vo9Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date :arc-authentication-results; bh=MaxCNa0zzT/na9jZ01Y7hdyDxfRm5RpkISdIEi4yTa4=; b=NhFIWPwyGaX5qhiadJAHI4BUQdBNHApSgCtZqCbCyFARtFwMsESqhchbimw2s3VB9G n2xhL4TAjsJ29lczHZG45bwXdrqfCDT6vDv2/Kp+mOgJdg2YZjYGsCi2VxTcHfgwYmqi 7xQVgkMJHexDV5rYC6AmPwAt204aW+36n/wwlnFFbTrpz8reY1rLkMpc73UtrxAtkdA0 O4uXFXose0695uoQLiYGuFAkScCGdyT69qmjDqzF6tVTy5HUduHWFFfyUTL+Nm7QuKjg 0Gu2biksmqIyoGp8WqAIIdd7gXltK3G3Nx7pm7tORlkOa+/m1vURRW4tyVIpVrhZJDXW qOJw== ARC-Authentication-Results: i=1; mx.google.com; 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 n11-v6si55767pgu.649.2018.07.02.19.54.44; Mon, 02 Jul 2018 19:54:58 -0700 (PDT) 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; 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 S1753838AbeGCCyE (ORCPT + 99 others); Mon, 2 Jul 2018 22:54:04 -0400 Received: from smtp2200-217.mail.aliyun.com ([121.197.200.217]:49160 "EHLO smtp2200-217.mail.aliyun.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753805AbeGCCyC (ORCPT ); Mon, 2 Jul 2018 22:54:02 -0400 X-Alimail-AntiSpam: AC=CONTINUE;BC=0.07979855|-1;CH=green;FP=0|0|0|0|0|-1|-1|-1;HT=e02c03301;MF=ren_guo@c-sky.com;NM=1;PH=DS;RN=12;RT=12;SR=0;TI=SMTPD_---.CLXqNEC_1530586430; Received: from localhost(mailfrom:ren_guo@c-sky.com fp:SMTPD_---.CLXqNEC_1530586430) by smtp.aliyun-inc.com(10.147.42.16); Tue, 03 Jul 2018 10:53:51 +0800 Date: Tue, 3 Jul 2018 10:53:50 +0800 From: Guo Ren To: Christoph Hellwig Cc: linux-arch@vger.kernel.org, linux-kernel@vger.kernel.org, tglx@linutronix.de, daniel.lezcano@linaro.org, jason@lakedaemon.net, arnd@arndb.de, c-sky_gcc_upstream@c-sky.com, gnu-csky@mentor.com, thomas.petazzoni@bootlin.com, wbx@uclibc-ng.org, green.hu@gmail.com Subject: Re: [PATCH V2 07/19] csky: MMU and page table management Message-ID: <20180703025348.GA32371@guoren> References: <20180702132915.GA6578@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20180702132915.GA6578@infradead.org> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jul 02, 2018 at 06:29:15AM -0700, Christoph Hellwig wrote: > This commit is missing an explanation. The patch is for abiv1 & abiv2 CPU series' MMU support. - abiv1 CPU (CK610) is VIPT cache and it doesn't support highmem. - abiv2 CPUs are all PIPT cache and they could support highmem. We seperate abiv1 and abiv2 into two direcotries for coding convention. > For the dma-mapping code please use the generic kernel/dma/noncoherent.c > code instead of duplicating it. Thx for the tips and I think you mean the lib/dma-noncoherent.c in the lastest kernel source and not in linux-4.16.2. I'll rebase on the newest RC version of linux in next version patch and reuse the code in lib/dma-noncoherent.c. Current csky_dma_alloc implementation is not good, it use 512MB uncached area to mirror the Normal cachable-512MB area. In next version patch, we will increase the max-Normal memory zone to (1GB + 768MB). In csky_dma_alloc we will seperate the atomic_dma and non-atomic_dma and reserve the area in fixmap area. Here is my memory layout plan in next version patch: Fixmap : 0xffc02000 – 0xfffff000 (4 MB - 12KB) kmap_atomic, dma_atomic ... Pkmap : 0xff800000 – 0xffc00000 (4 MB) PTR_PER_PTE = 1024 Vmalloc : 0xf0200000 – 0xff000000 (238 MB) max: 238MB + 256MB + 1GB Lowmem : 0x80000000 – 0xf0000000 (1G + 768 MB) Guo Ren