Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751707AbdLMKFb (ORCPT ); Wed, 13 Dec 2017 05:05:31 -0500 Received: from mail-vk0-f51.google.com ([209.85.213.51]:46512 "EHLO mail-vk0-f51.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752473AbdLMKF0 (ORCPT ); Wed, 13 Dec 2017 05:05:26 -0500 X-Google-Smtp-Source: ACJfBourBWwHGVTsNWB7S8Aa74ZcTeZNO023nyfICfAZ1+2rowHLOXp3lNyAvzwWtpCi6BVDOQdTVi7lhRqIsC7N2qk= MIME-Version: 1.0 In-Reply-To: <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> <20171213094548.GA23563@gary-OptiPlex-3050> From: Greentime Hu Date: Wed, 13 Dec 2017 18:04:44 +0800 Message-ID: Subject: Re: [PATCH v3 09/33] nds32: Cache and TLB routines To: Guo Ren 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 Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 873 Lines: 27 2017-12-13 17:45 GMT+08:00 Guo Ren : > 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. > :) > Oh, I see. I may propose this idea to our ARCH colleagues for the next version design. Many thanks.