Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp3058009imm; Fri, 20 Jul 2018 09:23:39 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdSjBJ2pIuwC282I+dCf9DaDnDGv7O1AGx+TCKVrxND9zRJUurXMP19QDXhaf8guLORKjYQ X-Received: by 2002:a62:90d4:: with SMTP id q81-v6mr2876089pfk.37.1532103819832; Fri, 20 Jul 2018 09:23:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532103819; cv=none; d=google.com; s=arc-20160816; b=ZvDjM/+Ge1/o8LX+x7KOXL0/pl/Zy1K0dLTRBXI+c62cq2WeUnBmVRJBtITjGLv9Y/ 4nyg3NF0vyt2H8PSVBjpDaLRqAbezyVw/+WpZlXRvTrgQ0b2UDKAsBNGaG/vfSno3jnC UAdfVuaKDwkmwWfCi3/8Uvog5Ziks7THcUao5KLKy80YkzqMn4XsECyCusLwAml5UAMN b/do9KbJMdW1u50wwTrjd7EFD0/NzlPjioVPmBvxekdqIUI+sDNNJK4Xd7qzFLLvNNgA 0Gp7GwMqdrfcCFNOn7mIDi9zCMjR+zmBkc72R4oxo5To87j3aAj3Wbmsfo4HHhcicENi N/NQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=z+fb9JTSqoGOUvqnsFEHLJJY748lUbYAaeBSjJdtzyw=; b=eXW2Aq1Z3MHQcq5FIhy9+tzp3H+N1DNCcudK/R2yP45CFmKus9Tfi5HkmcrJcm3ewJ +n7Mj09FZxn6/3Ab1FjqA+7cveupDZKXprDVXGNysmbxoIh0cEcoJsOw2yR7pKmbU4RB XlvbluPUZaQfdp5sOebRYAb8Khm8PmRMh1Az4ZUOWod2O9fTZFd2sWMKy99G3umZyv/I crnIlqaqxg5haYTUhtOXdzvt/Mh+OUC01uUSMIC8XOiGeiVLXn+Yo4jP269Nh5jOtdaL zeaTAbRPiabPD2pattWuMaOcgxvE3bFoYRzYtaaBC5bDhcaGqUYb/cWMgJvQ/IgCwcJB t8NQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail (test mode) header.i=@8bytes.org header.s=mail-1 header.b=QnOvrCDS; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=8bytes.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 15-v6si2131651pgo.574.2018.07.20.09.23.25; Fri, 20 Jul 2018 09:23:39 -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; dkim=fail (test mode) header.i=@8bytes.org header.s=mail-1 header.b=QnOvrCDS; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=8bytes.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387974AbeGTRLl (ORCPT + 99 others); Fri, 20 Jul 2018 13:11:41 -0400 Received: from 8bytes.org ([81.169.241.247]:35720 "EHLO theia.8bytes.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387822AbeGTRLk (ORCPT ); Fri, 20 Jul 2018 13:11:40 -0400 Received: by theia.8bytes.org (Postfix, from userid 1000) id 13787450; Fri, 20 Jul 2018 18:22:39 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=8bytes.org; s=mail-1; t=1532103759; bh=kqBTbTaBbz8EbgmB3AwTXiJkPwtCRz2xn4k5jm1THBA=; h=From:To:Cc:Subject:Date:From; b=QnOvrCDSIhdvOhhlrMVQod/lTfpktKj6qW9SCFLDSjnjM5eMaDQxR8X2qcf6hS7wl OjflpAVni5W23c2KejbtgqWTSKNFeXW6aFSfo3WZzJTelCbNaIPjAVpScRSrtVUatA bfWIBWUnNfncBe7gfLHX1CiFGmnZtrYz1V/4ObVBhIFp+leTyA+4I2KO+aaJo+widB 1OApjs8dgjrFuoXOFm3YzxCV8pLQM4E4syVF0mJ+cDnVKfTyGFsLU8GAKSI1RoBFD2 jvnsvmkrMbAj5ego3xDskNdvymwn26GZxz8fyyUMZ09WRw6tPTFTPzIhy5x2yZvlTx /Nh9itgLWiigA== 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, Arnaldo Carvalho de Melo , Alexander Shishkin , Jiri Olsa , Namhyung Kim , joro@8bytes.org Subject: [PATCH 0/3] PTI for x86-32 Fixes and Updates Date: Fri, 20 Jul 2018 18:22:21 +0200 Message-Id: <1532103744-31902-1-git-send-email-joro@8bytes.org> X-Mailer: git-send-email 2.7.4 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, here are 3 patches which update the PTI-x86-32 patches recently merged into the tip-tree. The patches are ordered by importance: Patch 1: Very important, it fixes a vmalloc-fault in NMI context when PTI is enabled. This is pretty unlikely to hit when starting perf on an idle machine, which is why I didn't find it earlier in my testing. I always started 'perf top' first :/ But when I start 'perf top' last when the kernel-compile already runs, it hits almost immediatly. Patch 2: Fix the 'from-kernel-check' in SWITCH_TO_KERNEL_STACK to also take VM86 into account. This is not strictly necessary because the slow-path also works for VM86 mode but it is not how the code was intended to work. And it breaks when Patch 3 is applied on-top. Patch 3: Implement the reduced copying in the paranoid entry/exit path as suggested by Andy Lutomirski while reviewing version 7 of the original patches. I have the x86/tip branch with these patches on-top running my test for 6h now, with no issues so far. So for now it looks like there are no scheduling points or irq-enabled sections reached from the paranoid entry/exit paths and we always return to the entry-stack we came from. I keep the test running over the weekend at least. Please review. [ If Patch 1 looks good to the maintainers I suggest applying it soon, before too many linux-next testers run into this issue. It is actually the reason why I send out the patches _now_ and didn't wait until next week when the other two patches got more testing from my side. ] Thanks, Joerg Joerg Roedel (3): perf/core: Make sure the ring-buffer is mapped in all page-tables x86/entry/32: Check for VM86 mode in slow-path check x86/entry/32: Copy only ptregs on paranoid entry/exit path arch/x86/entry/entry_32.S | 82 ++++++++++++++++++++++++++------------------- kernel/events/ring_buffer.c | 10 ++++++ 2 files changed, 58 insertions(+), 34 deletions(-) -- 2.7.4