From patchwork Tue Aug 7 10:24:28 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joerg Roedel X-Patchwork-Id: 10558489 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 4EDE6157B for ; Tue, 7 Aug 2018 10:24:38 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3705F287D1 for ; Tue, 7 Aug 2018 10:24:38 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 28C4C295FC; Tue, 7 Aug 2018 10:24:38 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7529B287D1 for ; Tue, 7 Aug 2018 10:24:37 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 421E06B0003; Tue, 7 Aug 2018 06:24:36 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 3D12E6B0005; Tue, 7 Aug 2018 06:24:36 -0400 (EDT) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 2EA366B000C; Tue, 7 Aug 2018 06:24:36 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-ed1-f72.google.com (mail-ed1-f72.google.com [209.85.208.72]) by kanga.kvack.org (Postfix) with ESMTP id C556E6B0003 for ; Tue, 7 Aug 2018 06:24:35 -0400 (EDT) Received: by mail-ed1-f72.google.com with SMTP id s18-v6so5226355edr.15 for ; Tue, 07 Aug 2018 03:24:35 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:dkim-signature:from:to:cc:subject:date :message-id; bh=zrZHR59BcJZx8rbSHriFA7OzKAxC5qeu3SzqXrTUskE=; b=DcAI0bPeg9HLIIRVJv9mdyyWAYYNB3F60IV0mBJrPDk+5L7VBFV7ljFvnjZukqboAf +bdX1upssnqj3pobVONMoUyDhaw9xnUyUgIg0jdWrewC+oUMngjPrCq0gHx5dtg5NqNs 84VQzO2rn7X+o+g9lwozi15E+tsh9bzoj3zuOHjzpxwO3HUe6mXZE53881TqHvGhxM9E KLmrofhslawuy4q3PlmHF89TEvRa1bL8WJQFn8J87c0ts8INN/yz11WbX0YCnhBD3o2w 1MzcGRrqFJH5eQfoDvdh/mFbR+a1bfs3NGsJcuOJXXpcIFfNb6SpO7h7bANLPZn6wvAk IlTQ== X-Gm-Message-State: AOUpUlEqFLM/saMHArKrKkukcZ2iHeysgjN796PJhdKFBwFZ/4I6ZNm0 5lnM6D4hE07HYFnWSxEcNZKb/HGrJBhOdrTch4RPcrWreNpgQ9eqFjsOLkO1DI9emE1iubIEeLT miiQGwzh1LFwEtKMMwrf4KbPMgKECW+4jm/UQ9ay5mz7y/cwABV4Is3RU16V6ocAcyw== X-Received: by 2002:a50:8466:: with SMTP id 93-v6mr22571226edp.304.1533637475183; Tue, 07 Aug 2018 03:24:35 -0700 (PDT) X-Google-Smtp-Source: AAOMgpe5ibvX+DBxeqjUTENjNkpcu1xxVV4rBeaW8pJasTY11FMTzmykrMwJWZ95IzdCl6z1z0zk X-Received: by 2002:a50:8466:: with SMTP id 93-v6mr22571178edp.304.1533637474461; Tue, 07 Aug 2018 03:24:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533637474; cv=none; d=google.com; s=arc-20160816; b=j30fDbEWwtoLRuyW/sX3zDhLJ9KOWUYb+pS12BtZz6S0r8XHL4tFi/7cHuCTiCL53g C0ScIUWzEWe6+RPIANLkHtgnNW7AFJiiy2FXBaJ+8g9reApBqcTQPZ4ys3TeN6JjICbr 5jCnh4kNTfez6MFJoKUjZt28lmfSM9GOxX/Y5/N9N9eD7fhyxfX/TEKLJPHoE/JEBTcr iRNcBTS5UAy9Kw0+GMeL887KBWAU4tE9kyoS/GjsY2a5WnQmlOgSllCYkny/hj4IKkvd hLPaYG/vZ6GP7wNwPOZLfjCJ3GhUqCoFHwOsIB05k6GqzIhbLLIUvzvEk/gUYBp5n8wl DRyQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=message-id:date:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=zrZHR59BcJZx8rbSHriFA7OzKAxC5qeu3SzqXrTUskE=; b=hftsw5S6w74OS5RApesNr/uBuQzgKANE/2nHTo2gvhTgjZZ05/owDnBcoeMzcwXTar s+oG/vSzKmvmxJV8GhsL/kD5QUwrW1Qe4oxqqNwfRImmLgxYOp9BA+CmrGysP2sj+yF5 uKafh4K8aq/d6adFQzFMDjStY73JyLl7L/2qfEmdm3kMvtQ6J/fCp46a1r9h/L4CXjta rCY6x/NIzh02jQ5I0gBtxYWcYxbhILJcYWjGgqUPqPgHMywCOCchGLcnq1ZNtdJwCOnm ohC+NhkmWOcoAYuIFjoKGPd0yoEZ8w1JLW4MlH22SJ07n40aiUBYphkrzOL8P/JaFMBc cLhA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass (test mode) header.i=@8bytes.org header.s=mail-1 header.b=RrorpSx6; spf=pass (google.com: domain of joro@8bytes.org designates 2a01:238:4383:600:38bc:a715:4b6d:a889 as permitted sender) smtp.mailfrom=joro@8bytes.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=8bytes.org Received: from theia.8bytes.org (8bytes.org. [2a01:238:4383:600:38bc:a715:4b6d:a889]) by mx.google.com with ESMTPS id a5-v6si1244039edl.388.2018.08.07.03.24.34 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 07 Aug 2018 03:24:34 -0700 (PDT) Received-SPF: pass (google.com: domain of joro@8bytes.org designates 2a01:238:4383:600:38bc:a715:4b6d:a889 as permitted sender) client-ip=2a01:238:4383:600:38bc:a715:4b6d:a889; Authentication-Results: mx.google.com; dkim=pass (test mode) header.i=@8bytes.org header.s=mail-1 header.b=RrorpSx6; spf=pass (google.com: domain of joro@8bytes.org designates 2a01:238:4383:600:38bc:a715:4b6d:a889 as permitted sender) smtp.mailfrom=joro@8bytes.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=8bytes.org Received: by theia.8bytes.org (Postfix, from userid 1000) id 27D75220; Tue, 7 Aug 2018 12:24:33 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=8bytes.org; s=mail-1; t=1533637473; bh=E/cO6UwIuvwTfAr9UjHcfZD3F2tB/lHW3z78HEvDf70=; h=From:To:Cc:Subject:Date:From; b=RrorpSx6B1Zy9kXFlomHm94g1qgP6nZ8OOCGDVg9YUiwpX21qX9OnZJfpReQ1WIlO tivzmZx5NuuOdOZ9qSqGbrjrpgnw7cOFqs1UfG/kQXZp6IZW9yFWKwtXRUoeWpxC8I /9IdNq1wgojwxtZc/RDmoEhQjabZI4MvBUc4DCGLVe22fw5qvxInU0uxqntMkQGrhl +tBtC2OvolYsDdW7lO2dHQ3zw/wsEY/kJgbaHIgVCZL9rey8WBj57aUrN9JRvFsh2X 0RFkgny58TukGXvS6bJb4ojgEdUXelunoRh9tPNIrqxiPDulnjfNPvC/XiWWE28SuO rtXsvetG2ukIg== From: Joerg Roedel To: Thomas Gleixner , Ingo Molnar , "H . Peter Anvin" Cc: x86@kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, Linus Torvalds , 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 , aliguori@amazon.com, daniel.gruss@iaik.tugraz.at, hughd@google.com, keescook@google.com, Andrea Arcangeli , Waiman Long , Pavel Machek , "David H . Gutteridge" , jroedel@suse.de, joro@8bytes.org Subject: [PATCH 0/3] PTI for x86-32 Fixes Date: Tue, 7 Aug 2018 12:24:28 +0200 Message-Id: <1533637471-30953-1-git-send-email-joro@8bytes.org> X-Mailer: git-send-email 2.7.4 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: X-Virus-Scanned: ClamAV using ClamSMTP Hi, here is a small patch-set to fix two small issues in the PTI implementation for 32 bit x86. The issues are: 1) Fix the 32 bit PCID check. I used the wrong operator there and this caused false-positive warnings. 2) The other two patches make sure the init-hole is not mapped into the user page-table. It is the 32 bit counterpart to commit c40a56a7818c ('x86/mm/init: Remove freed kernel image areas from alias mapping') for the 64 bit PTI implementation. I tested that no-PAE, PAE and 64 bit kernel all boot and have correct user page-tables with identical global mappings between user and kernel. Regards, Joerg Joerg Roedel (3): x86/mm/pti: Fix 32 bit PCID check x86/mm/pti: Don't clear permissions in pti_clone_pmd() x86/mm/pti: Clone kernel-image on PTE level for 32 bit arch/x86/mm/pti.c | 143 ++++++++++++++++++++++++++++++++++++++---------------- 1 file changed, 100 insertions(+), 43 deletions(-) Tested-by: David H. Gutteridge