Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933226AbdLRJJJ (ORCPT ); Mon, 18 Dec 2017 04:09:09 -0500 Received: from smtp2200-217.mail.aliyun.com ([121.197.200.217]:44162 "EHLO smtp2200-217.mail.aliyun.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932766AbdLRJJD (ORCPT ); Mon, 18 Dec 2017 04:09:03 -0500 X-Alimail-AntiSpam: AC=CONTINUE;BC=0.08954946|-1;CH=green;FP=0|0|0|0|0|-1|-1|-1;HT=e02c03307;MF=ren_guo@c-sky.com;NM=1;PH=DS;RN=22;RT=22;SR=0;TI=SMTPD_---.9lmVhuO_1513588128; Date: Mon, 18 Dec 2017 17:08:48 +0800 From: Guo Ren To: Greentime Hu Cc: greentime@andestech.com, linux-kernel@vger.kernel.org, arnd@arndb.de, linux-arch@vger.kernel.org, tglx@linutronix.de, jason@lakedaemon.net, marc.zyngier@arm.com, robh+dt@kernel.org, netdev@vger.kernel.org, deanbo422@gmail.com, devicetree@vger.kernel.org, viro@zeniv.linux.org.uk, dhowells@redhat.com, will.deacon@arm.com, daniel.lezcano@linaro.org, linux-serial@vger.kernel.org, geert.uytterhoeven@gmail.com, linus.walleij@linaro.org, mark.rutland@arm.com, greg@kroah.com, Vincent Chen Subject: Re: [PATCH v3 07/33] nds32: MMU initialization Message-ID: <20171218090848.GA5823@gary-OptiPlex-3050> References: <0964714c3dcac46ac700085717b0f414b7978112.1512723245.git.green.hu@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <0964714c3dcac46ac700085717b0f414b7978112.1512723245.git.green.hu@gmail.com> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 727 Lines: 27 Hi Greentime, On Fri, Dec 08, 2017 at 05:11:50PM +0800, Greentime Hu wrote: [...] > > diff --git a/arch/nds32/mm/highmem.c b/arch/nds32/mm/highmem.c [...] > +void *kmap(struct page *page) > +{ > + unsigned long vaddr; > + might_sleep(); > + if (!PageHighMem(page)) > + return page_address(page); > + vaddr = (unsigned long)kmap_high(page); Here should invalid the cpu_mmu_tlb's entry, Or invalid it in the set_pte(). eg: vaddr0 = kmap(page0) *vaddr0 = val0 //It will cause tlb-miss, and hard-refill to MMU-tlb kunmap(page0) vaddr1 = kmap(page1) // Mostly vaddr1 = vaddr0 val = vaddr1; //No tlb-miss and it will get page0's val not page1, because last expired vaddr0's entry is left in CPU-MMU-tlb. Best Regards Guo Ren