From patchwork Wed Jul 25 15:48:02 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joerg Roedel X-Patchwork-Id: 10544231 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 C4227139A for ; Wed, 25 Jul 2018 15:48:24 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B1F4E2A562 for ; Wed, 25 Jul 2018 15:48:24 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A5B3D2A577; Wed, 25 Jul 2018 15:48:24 +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 34CCB2A56B for ; Wed, 25 Jul 2018 15:48:24 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 8EB526B0008; Wed, 25 Jul 2018 11:48:22 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 899416B000A; Wed, 25 Jul 2018 11:48:22 -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 7383D6B026A; Wed, 25 Jul 2018 11:48:22 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-ed1-f71.google.com (mail-ed1-f71.google.com [209.85.208.71]) by kanga.kvack.org (Postfix) with ESMTP id 127766B0008 for ; Wed, 25 Jul 2018 11:48:22 -0400 (EDT) Received: by mail-ed1-f71.google.com with SMTP id t10-v6so3253612eds.7 for ; Wed, 25 Jul 2018 08:48:22 -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:in-reply-to:references; bh=e7JIXeIE5y6qltsPiO3RKWlFtD+ateGuDZYAyHjxLWg=; b=Vt0L60z5otAveCfHtNSjfEoRmfMozWEEjyDIwrh2HHlwx9mBVw/pO+pO6MTnRCYAea gzbG5iBLQX8ByVWGn6oJo7OXDHaLOYw3IiOajn8nH5SFSLD0R41pKsxNvBtJ9iIqXESD SDipuicaeaZC8ZSemgo8SErTO1XENu1UoVUDNtF45I3Aw4qL9qdBhi3vNw9MppFrWfz0 wX9KNkI5yqjgaYrTHdpjlNuphELM5I0OyynRbU7U0rlnADeIGx/YW9KC55owifrudRC6 EjmzhoyJacBqS866LxPB3E621taK8fxu23zSnx3Dt1iR7PPIiHO/YVFBgi24+IGQPcs9 G76A== X-Gm-Message-State: AOUpUlEAS5iSa0pTUvSuRDoowkJt4yVb1u2GzOndVq0hh6uAns3Y0QJ6 0txW87OgkEYVxOadOfM/NpqbMR/+0h0NRkkYIXeAxYtTASAkbwjCo7Wldmb4+GmUZW9CgD6OEUX irP9ofHonkme28Q42VcooDdZOEypp6bO45itXSlQQNH7zuN5fjgqxAmPZ2CxeikC/Gw== X-Received: by 2002:a50:8327:: with SMTP id 36-v6mr22778829edh.305.1532533701632; Wed, 25 Jul 2018 08:48:21 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdGVmpO501+cj9mCojbVX/XlP9oO54h42EwNlPSgpt2kaTi6SyHchHsrqmSNnO5VRl7wo31 X-Received: by 2002:a50:8327:: with SMTP id 36-v6mr22778800edh.305.1532533701019; Wed, 25 Jul 2018 08:48:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532533701; cv=none; d=google.com; s=arc-20160816; b=BtKj296uH6TL84UiHpaOsE0piZDHrViMVtSlgumlpXfcr2QjzsMaAXh7/ejmc5kfcS etMZWUO8MePjQnkKSKORsOMlbqe7URwJ+b8CA3LRbQjX+M7saHDg0qayCKdtYN2ItjZM Y0ImVpafMi+H8DgtmPGTKfmun5rdE2t4wqeXnPoVlXGd0B2Br0orJf+vO8rCFKGbuIX+ psmeRJsg8LGqCOV/HhtqluAxgjP98cMVt9sv9ueT2+4iAJ5ys1k4SsTEwLitOBMOYi9U NgiBTcrqCN1sSi5x0EEEGZLtIadfq57vNvnKxdYDJqEtb2mAZVtkSUThIZ+MpDrTpyhc 0PwA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=e7JIXeIE5y6qltsPiO3RKWlFtD+ateGuDZYAyHjxLWg=; b=hl9wdUA2c2MlwZKxNAXHGiMHhtrowUxWaiUytg0fnVhDJBMYS8jKg5qTwQP7YZY5mZ O6tsMFzZ9gOTqzcfzEFf2Nr67U2nNVtvplgJZd5tmNSFkHAufYOcI4EWL8Nxu/V/Uac8 yzB4Rk7Gzv8g/TdYKvFBXaTuDblk/Q0XbHE9Pg5P/HQ+SgmtHv2x0uv2mgRuTsVdjj0X 6gfVfJUkdl8Fmk3wb9P4ym7by64j4YaA5uwTKAOpOibsRpQcWZnUCIuv20fA8aDRIHIj xncex45IknEQ2bS8xoi9lOJ2RNrv5AIMFdRA4UWBt5FqPxy0qw5jCsza7qnyrvRCfpL8 vJZQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass (test mode) header.i=@8bytes.org header.s=mail-1 header.b=pQwHZjV+; spf=pass (google.com: domain of joro@8bytes.org designates 81.169.241.247 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. [81.169.241.247]) by mx.google.com with ESMTPS id j18-v6si8553819edf.210.2018.07.25.08.48.20 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 25 Jul 2018 08:48:20 -0700 (PDT) Received-SPF: pass (google.com: domain of joro@8bytes.org designates 81.169.241.247 as permitted sender) client-ip=81.169.241.247; Authentication-Results: mx.google.com; dkim=pass (test mode) header.i=@8bytes.org header.s=mail-1 header.b=pQwHZjV+; spf=pass (google.com: domain of joro@8bytes.org designates 81.169.241.247 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 A25381EB; Wed, 25 Jul 2018 17:48:19 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=8bytes.org; s=mail-1; t=1532533699; bh=ykRHdAWzkL9irMORgQ3yCGBj8VygOYQR3zKjFy1te0g=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=pQwHZjV+Hsuy/UbgSaVcSi+/79PBz/0jUAGxon4xT3VYFfAELiMBFwtdhiEFS3k1I SaCSLOQLHLrxHDMlUeepWNNwDcka98DxxWd6GSKwnHJDTz8DMnYK1AoY5op7DdlSTT cZ9Utz6IpkmJIbUo2jerBINddG4/P489XP228bM3tPjkPs5KZ7ZBwj7ybO/DwwIc6Q IBS/g3pxjlfkCDp9HXcX9udwzhbODpSQ03oqGyEwDpOPkaZVS0f979VnKR9JrjSo/X o/NJcYMrEIJJsMJo23ZVTsVHhYvMPTUQT5btkkVSJjUVLTDW7u0yarxS2d4fT0a0MX Ml+mp/m7n1wmw== 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 2/3] Revert "perf/core: Make sure the ring-buffer is mapped in all page-tables" Date: Wed, 25 Jul 2018 17:48:02 +0200 Message-Id: <1532533683-5988-3-git-send-email-joro@8bytes.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1532533683-5988-1-git-send-email-joro@8bytes.org> References: <1532533683-5988-1-git-send-email-joro@8bytes.org> 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 From: Joerg Roedel This reverts commit 77754cfa09a6c528c38cbca9ee4cc4f7cf6ad6f2. The patch was necessary to silence a WARN_ON_ONCE(in_nmi()) that triggered in the vmalloc_fault() function when PTI was enabled on x86-32. Faulting in an NMI handler turned out to be safe and the warning in vmalloc_fault() is gone now. So the above patch can be reverted. Signed-off-by: Joerg Roedel --- kernel/events/ring_buffer.c | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/kernel/events/ring_buffer.c b/kernel/events/ring_buffer.c index df2d8cf..5d3cf40 100644 --- a/kernel/events/ring_buffer.c +++ b/kernel/events/ring_buffer.c @@ -814,13 +814,6 @@ static void rb_free_work(struct work_struct *work) vfree(base); kfree(rb); - - /* - * FIXME: PAE workaround for vmalloc_fault(): Make sure buffer is - * unmapped in all page-tables. - */ - if (IS_ENABLED(CONFIG_X86_PAE)) - vmalloc_sync_all(); } void rb_free(struct ring_buffer *rb) @@ -847,15 +840,6 @@ struct ring_buffer *rb_alloc(int nr_pages, long watermark, int cpu, int flags) if (!all_buf) goto fail_all_buf; - /* - * FIXME: PAE workaround for vmalloc_fault(): The buffer is - * accessed in NMI handlers, make sure it is mapped in all - * page-tables in the system so that we don't fault on the range in - * an NMI handler. - */ - if (IS_ENABLED(CONFIG_X86_PAE)) - vmalloc_sync_all(); - rb->user_page = all_buf; rb->data_pages[0] = all_buf + PAGE_SIZE; if (nr_pages) {