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 A3D216B0005 for ; Wed, 18 Apr 2018 03:36:05 -0400 (EDT) Received: by mail-wr0-f197.google.com with SMTP id 38-v6so816282wrv.8 for ; Wed, 18 Apr 2018 00:36:05 -0700 (PDT) Received: from mx2.suse.de (mx2.suse.de. [195.135.220.15]) by mx.google.com with ESMTPS id f16si1005730edf.188.2018.04.18.00.36.04 for (version=TLS1 cipher=AES128-SHA bits=128/128); Wed, 18 Apr 2018 00:36:04 -0700 (PDT) Date: Wed, 18 Apr 2018 09:35:58 +0200 From: Joerg Roedel Subject: Re: [PATCH 00/35 v5] PTI support for x32 Message-ID: <20180418073558.mebtl457ss2rzhrm@suse.de> References: <1523892323-14741-1-git-send-email-joro@8bytes.org> <20180416160154.GE15462@8bytes.org> 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: Linus Torvalds Cc: Joerg Roedel , Thomas Gleixner , Ingo Molnar , "H . Peter Anvin" , the arch/x86 maintainers , Linux Kernel Mailing List , linux-mm , Andy Lutomirski , Dave Hansen , Josh Poimboeuf , Juergen Gross , Peter Zijlstra , Borislav Petkov , Jiri Kosina , Boris Ostrovsky , Brian Gerst , David Laight , Denys Vlasenko , Eduardo Valentin , Greg KH , Will Deacon , "Liguori, Anthony" , Daniel Gruss , Hugh Dickins , Kees Cook , Andrea Arcangeli , Waiman Long , Pavel Machek , "David H . Gutteridge" On Mon, Apr 16, 2018 at 09:13:22AM -0700, Linus Torvalds wrote: > See for example commit 8c06c7740d19 ("x86/pti: Leave kernel text > global for !PCID") and in particular the performance numbers (that's > an Atom microserver, but it was chosen due to lack of PCID). Okay, I checked this on 32 bit and after some small changes I got identical mappings with GLB set in all page-tables. The changes were: * Don't change permission bits in pti_clone_kernel_text(). Changing them does not make a difference on 64 bit as everything cloned in this function is RO anyway. On 32 bit some areas are mapped RW, so it does make a difference there. Having different permissions between kernel and user page-table does also not make sense, because a permission mismatch in the TLB will cause a re-walk, which is as fast as not mapping it at all. * Mapping kernel-text to user-space on 32 bit too. Since there is no PCID this should improve performance. I have not measured that yet, but will do so before posting the next version. I do some more testing and performance measurements and will send version 6 of my patches beginning of next week when v4.17-rc2 is out. Regards, Joerg