From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f69.google.com (mail-wm0-f69.google.com [74.125.82.69]) by kanga.kvack.org (Postfix) with ESMTP id D6CDF6B3CA1 for ; Sun, 26 Aug 2018 16:16:08 -0400 (EDT) Received: by mail-wm0-f69.google.com with SMTP id b134-v6so6149167wmd.6 for ; Sun, 26 Aug 2018 13:16:08 -0700 (PDT) Received: from Galois.linutronix.de (Galois.linutronix.de. [2a01:7a0:2:106d:700::1]) by mx.google.com with ESMTPS id 71-v6si5445778wmm.75.2018.08.26.13.16.07 for (version=TLS1_2 cipher=AES128-SHA bits=128/128); Sun, 26 Aug 2018 13:16:07 -0700 (PDT) Date: Sun, 26 Aug 2018 22:15:17 +0200 (CEST) From: Thomas Gleixner Subject: Re: TLB flushes on fixmap changes In-Reply-To: Message-ID: References: <20180822153012.173508681@infradead.org> <20180823133958.GA1496@brain-police> <20180824084717.GK24124@hirez.programming.kicks-ass.net> <20180824180438.GS24124@hirez.programming.kicks-ass.net> <56A9902F-44BE-4520-A17C-26650FCC3A11@gmail.com> <9A38D3F4-2F75-401D-8B4D-83A844C9061B@gmail.com> <8E0D8C66-6F21-4890-8984-B6B3082D4CC5@gmail.com> <20180826112341.f77a528763e297cbc36058fa@kernel.org> <952A64F0-90B3-4E2F-B410-7E20BE90D617@amacapital.net> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Sender: owner-linux-mm@kvack.org List-ID: To: Andy Lutomirski Cc: Kees Cook , Andy Lutomirski , Masami Hiramatsu , Nadav Amit , Linus Torvalds , Paolo Bonzini , Jiri Kosina , Peter Zijlstra , Will Deacon , Benjamin Herrenschmidt , Nick Piggin , the arch/x86 maintainers , Borislav Petkov , Rik van Riel , Jann Horn , Adin Scannell , Dave Hansen , Linux Kernel Mailing List , linux-mm , David Miller , Martin Schwidefsky , Michael Ellerman On Sun, 26 Aug 2018, Andy Lutomirski wrote: > > On Aug 26, 2018, at 9:47 AM, Kees Cook wrote: > >> On Sun, Aug 26, 2018 at 7:20 AM, Andy Lutomirski wrote: > >>> I tried to convince Ingo to use this method for doing "write rarely" > >>> and he soundly rejected it. :) I've always liked this because AFAICT, > >>> it's local to the CPU. I had proposed it in > >>> https://git.kernel.org/pub/scm/linux/kernel/git/kees/linux.git/commit/?h=kspp/write-rarely&id=9ab0cb2618ebbc51f830ceaa06b7d2182fe1a52d > >> > >> Ingo, can you clarify why you hate it? I personally would rather use CR3, but CR0 seems like a fine first step, at least for text_poke. > > > > Sorry, it looks like it was tglx, not Ingo: > > > > https://lkml.kernel.org/r/alpine.DEB.2.20.1704071048360.1716@nanos > > > > This thread is long, and one thing that I think went unanswered was > > "why do we want this to be fast?" the answer is: for doing page table > > updates. Page tables are becoming a bigger target for attacks now, and > > it's be nice if they could stay read-only unless they're getting > > updated (with something like this). > > > > > It kind of sounds like tglx would prefer the CR3 approach. And indeed my > patch has a serious problem wrt the NMI code. That's exactly the problem I have with CR0. It leaves everything and some more writeable for any code which can interrupt that section. Performance wise CR0 is not that much better than CR3 except that it has the costs nicely hidden. Thanks, tglx