From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr0-f197.google.com (mail-wr0-f197.google.com [209.85.128.197]) by kanga.kvack.org (Postfix) with ESMTP id 0B39C6B0253 for ; Wed, 1 Nov 2017 06:56:33 -0400 (EDT) Received: by mail-wr0-f197.google.com with SMTP id w105so1069553wrc.20 for ; Wed, 01 Nov 2017 03:56:32 -0700 (PDT) Received: from mail-sor-f65.google.com (mail-sor-f65.google.com. [209.85.220.65]) by mx.google.com with SMTPS id p26sor420048eda.51.2017.11.01.03.56.31 for (Google Transport Security); Wed, 01 Nov 2017 03:56:31 -0700 (PDT) Date: Wed, 1 Nov 2017 13:56:29 +0300 From: "Kirill A. Shutemov" Subject: Re: [PATCH 04/23] x86, tlb: make CR4-based TLB flushes more robust Message-ID: <20171101105629.xne4hbivhu6ex3bx@node.shutemov.name> References: <20171031223146.6B47C861@viggo.jf.intel.com> <20171031223154.67F15B2A@viggo.jf.intel.com> <20171101101147.x2gvag62zpzydgr3@node.shutemov.name> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: owner-linux-mm@kvack.org List-ID: To: Andy Lutomirski Cc: Dave Hansen , "linux-kernel@vger.kernel.org" , "linux-mm@kvack.org" , moritz.lipp@iaik.tugraz.at, daniel.gruss@iaik.tugraz.at, michael.schwarz@iaik.tugraz.at, Linus Torvalds , Kees Cook , Hugh Dickins , X86 ML On Wed, Nov 01, 2017 at 03:38:23AM -0700, Andy Lutomirski wrote: > On Wed, Nov 1, 2017 at 3:11 AM, Kirill A. Shutemov wrote: > > On Wed, Nov 01, 2017 at 01:01:45AM -0700, Andy Lutomirski wrote: > >> On Tue, Oct 31, 2017 at 3:31 PM, Dave Hansen > >> wrote: > >> > > >> > Our CR4-based TLB flush currently requries global pages to be > >> > supported *and* enabled. But, we really only need for them to be > >> > supported. Make the code more robust by alllowing X86_CR4_PGE to > >> > clear as well as set. > >> > > >> > This change was suggested by Kirill Shutemov. > >> > >> I may have missed something, but why would be ever have CR4.PGE off? > > > > This came out from me thinking on if we can disable global pages by not > > turning on CR4.PGE instead of making _PAGE_GLOBAL zero. > > > > Dave decided to not take this path, but this change would make > > __native_flush_tlb_global_irq_disabled() a bit less fragile in case > > if the situation would change in the future. > > How about just adding a VM_WARN_ON_ONCE, then? What's wrong with xor? The function will continue to work this way even if CR4.PGE is disabled. -- Kirill A. Shutemov -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org