Received: by 10.192.165.156 with SMTP id m28csp934448imm; Wed, 18 Apr 2018 00:37:32 -0700 (PDT) X-Google-Smtp-Source: AIpwx49Mw4a1d4pmuD3nKGMf6Py0ZTaVit3dNBAUxtesjvLZAbWHwCfzBKY1+FNLytA7jmplO6/f X-Received: by 2002:a17:902:2943:: with SMTP id g61-v6mr1055870plb.238.1524037052547; Wed, 18 Apr 2018 00:37:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524037052; cv=none; d=google.com; s=arc-20160816; b=bELdZBxRFRpf96ZwL4Ly0N5zqhaz51hfK5vRSIv5HKKLbuXel5X9MJ3bcb2SmhIXQw ReoBciXPEvwMXkPG0LUjLDjfCs5+sExnN+ZRYOPAq5x2oUkKPNth1BexSuocs+4PbkVd M/DLi1ckHMxiGYp3DLzH+0K0fLEph/1qLdkTRHTHsNmtNk5cFFtjYP3+xAmUlsMqAcgR VC8iCXt1E/w0yWOoMP365fX0hrH0DXZejgqpKJ38WAcN8Rc4X7GDV+FLUhf4fxQFNdHh YqL5PwpJuclDmwmEmjnNWMTNbb25W6jCYOlClvspZapbBIintIZa5BwvLba2iFZAoYdR uaKQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=UQZZH1svp6rhZf0mhmGDfiD/yPiqCw+AxLV8Qgp3aBk=; b=y3FW3vdjgggSdizTsXc9I1FhReEh8TBfllVY3To4NDZAwAeHQk68ItTvdEmfRYjfsS 5g4MXiLsaI4DeimulPEJcdIqMOPyJjUIcyei5GdhMp8VKL42+zCsGyvjGfhUUQttnaMx 09Dn+29FrLZULqQJ6nx6/JPhQazvCZUa3XDpzcJejGxC8cltXERaef72YUNqLNmahbD2 dtxJ0eJcGVKVsz45h8NlHcftPDCn9+32pE9wzNkBmyLdPO5XHBZViPmuWbqBWxLOhbK6 a1u9fXV3XVbrIz3dt1ML1HEKswqH+e+rhNuZxot+d5fJo/6Fuc68+YceDkCCWCtV/5Vc mgvw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p9si604233pgu.80.2018.04.18.00.37.18; Wed, 18 Apr 2018 00:37:32 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753256AbeDRHgG (ORCPT + 99 others); Wed, 18 Apr 2018 03:36:06 -0400 Received: from mx2.suse.de ([195.135.220.15]:38042 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753201AbeDRHgE (ORCPT ); Wed, 18 Apr 2018 03:36:04 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 33572AC21; Wed, 18 Apr 2018 07:36:03 +0000 (UTC) Date: Wed, 18 Apr 2018 09:35:58 +0200 From: Joerg Roedel 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" 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: User-Agent: NeoMutt/20170421 (1.8.2) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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