From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933515AbdKAWVn (ORCPT ); Wed, 1 Nov 2017 18:21:43 -0400 Received: from mga09.intel.com ([134.134.136.24]:6628 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933336AbdKAWVk (ORCPT ); Wed, 1 Nov 2017 18:21:40 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.44,331,1505804400"; d="scan'208";a="144842819" Subject: Re: [PATCH 04/23] x86, tlb: make CR4-based TLB flushes more robust To: Andy Lutomirski , "Kirill A. Shutemov" References: <20171031223146.6B47C861@viggo.jf.intel.com> <20171031223154.67F15B2A@viggo.jf.intel.com> <20171101101147.x2gvag62zpzydgr3@node.shutemov.name> <20171101105629.xne4hbivhu6ex3bx@node.shutemov.name> Cc: "linux-kernel@vger.kernel.org" , "linux-mm@kvack.org" , moritz.lipp@iaik.tugraz.at, Daniel Gruss , michael.schwarz@iaik.tugraz.at, Linus Torvalds , Kees Cook , Hugh Dickins , X86 ML From: Dave Hansen Message-ID: Date: Wed, 1 Nov 2017 15:21:21 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 11/01/2017 04:18 AM, Andy Lutomirski wrote: >>> 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. > That's true. OTOH, since no one is actually proposing doing that, > there's an argument that people should get warned and therefore be > forced to think about it. What this patch does in the end is make sure that __native_flush_tlb_global_irq_disabled() works, no matter the intiial state of CR4.PGE, *and* it makes it WARN if it gets called in an unexpected initial state (CR4.PGE). That's the best of both worlds IMNHO. Makes people think, and does the right thing no matter what.