From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752612AbdLMJqP (ORCPT ); Wed, 13 Dec 2017 04:46:15 -0500 Received: from smtp2200-217.mail.aliyun.com ([121.197.200.217]:54446 "EHLO smtp2200-217.mail.aliyun.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752563AbdLMJqI (ORCPT ); Wed, 13 Dec 2017 04:46:08 -0500 X-Alimail-AntiSpam: AC=CONTINUE;BC=0.1405234|-1;CH=green;FP=0|0|0|0|0|-1|-1|-1;HT=e02c03269;MF=ren_guo@c-sky.com;NM=1;PH=DS;RN=22;RT=22;SR=0;TI=SMTPD_---.9hjj6SC_1513158348; Date: Wed, 13 Dec 2017 17:45:48 +0800 From: Guo Ren To: Greentime Hu Cc: Greentime , Linux Kernel Mailing List , Arnd Bergmann , linux-arch , Thomas Gleixner , Jason Cooper , Marc Zyngier , Rob Herring , netdev , Vincent Chen , DTML , Al Viro , David Howells , Will Deacon , Daniel Lezcano , linux-serial@vger.kernel.org, Geert Uytterhoeven , Linus Walleij , Mark Rutland , Greg KH , Vincent Chen Subject: Re: [PATCH v3 09/33] nds32: Cache and TLB routines Message-ID: <20171213094548.GA23563@gary-OptiPlex-3050> References: <9d0e976c3e60bf6834dffb6ef798ad2a03e1c9ac.1512723245.git.green.hu@gmail.com> <20171213021619.GA6254@gary-OptiPlex-3050> <20171213081949.GA18840@gary-OptiPlex-3050> <20171213085334.GA21382@gary-OptiPlex-3050> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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 Hello, CPU team could improve the tlbop_*. Eg: Design a hardware internal flag bit for SR_TLB_VPN, tlbop_* will invalid it and mtsr SR_TLB_VPN will valid it. So: On Wed, Dec 13, 2017 at 05:03:33PM +0800, Greentime Hu wrote: > mtsr addr1 NDS32_SR_TLB_VPN > interrupt coming > mtsr addr2 NDS32_SR_TLB_VPN <- TLB_VPN has been set to addr2 mtsr SR_TLB_VPN will valid the flag bit > tlbop_rwr(*pte); tlbop_rwr will invalid SR_TLB_VPN flag bit > interrupt finish > tlbop_rwr(*pte); <- it will use the wrong TLB_VPN Because SR_TLB_VPN is in a invalid state, no operation happen on tlbop_rwr. Then they are atomic safe ,no spin_lock_irq need. :) Guo Ren From mboxrd@z Thu Jan 1 00:00:00 1970 From: Guo Ren Subject: Re: [PATCH v3 09/33] nds32: Cache and TLB routines Date: Wed, 13 Dec 2017 17:45:48 +0800 Message-ID: <20171213094548.GA23563@gary-OptiPlex-3050> References: <9d0e976c3e60bf6834dffb6ef798ad2a03e1c9ac.1512723245.git.green.hu@gmail.com> <20171213021619.GA6254@gary-OptiPlex-3050> <20171213081949.GA18840@gary-OptiPlex-3050> <20171213085334.GA21382@gary-OptiPlex-3050> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Greentime , Linux Kernel Mailing List , Arnd Bergmann , linux-arch , Thomas Gleixner , Jason Cooper , Marc Zyngier , Rob Herring , netdev , Vincent Chen , DTML , Al Viro , David Howells , Will Deacon , Daniel Lezcano , linux-serial-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Geert Uytterhoeven , Linus Walleij , Mark Rutland , Greg KH To: Greentime Hu Return-path: Content-Disposition: inline In-Reply-To: Sender: devicetree-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org List-Id: netdev.vger.kernel.org Hello, CPU team could improve the tlbop_*. Eg: Design a hardware internal flag bit for SR_TLB_VPN, tlbop_* will invalid it and mtsr SR_TLB_VPN will valid it. So: On Wed, Dec 13, 2017 at 05:03:33PM +0800, Greentime Hu wrote: > mtsr addr1 NDS32_SR_TLB_VPN > interrupt coming > mtsr addr2 NDS32_SR_TLB_VPN <- TLB_VPN has been set to addr2 mtsr SR_TLB_VPN will valid the flag bit > tlbop_rwr(*pte); tlbop_rwr will invalid SR_TLB_VPN flag bit > interrupt finish > tlbop_rwr(*pte); <- it will use the wrong TLB_VPN Because SR_TLB_VPN is in a invalid state, no operation happen on tlbop_rwr. Then they are atomic safe ,no spin_lock_irq need. :) Guo Ren -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html