Received: by 10.223.164.202 with SMTP id h10csp4696764wrb; Wed, 29 Nov 2017 10:19:43 -0800 (PST) X-Google-Smtp-Source: AGs4zMaoT2uyFGJbSUd/SPthwhFHMKGtNFISs/6irdZybHErPGabxw1qPGzivyjPy83XXJd4x/x7 X-Received: by 10.99.174.73 with SMTP id e9mr3511686pgp.297.1511979583121; Wed, 29 Nov 2017 10:19:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1511979583; cv=none; d=google.com; s=arc-20160816; b=zKbwUMeMScIrTNSRBqMtRvJwe3Y/GAtn2Ij2SlwLdt9dJ4tVyt4ym5Q3VuvXxAZjrn I4MV4inVCnk/Qe47FtX7dhsI6k5WoKuFsJzhr2CPNDqhjgnQlppcO+KkcLfc69oo6tWj 3OQ2eSD00HwrNvZIa0IA95QU0+hrxQeXVf+srSvIWqoVzlW0HSt2Jovc+zKxyyREZQ+o XjVmVNaxOhsBbcE3k+uxy3LBcKWZFJS08oqrlYNeY+c7uR4uHdBSaGlWq7SAGa828XT3 92VdkgJq4eNukO5hBSs0ahlTCpShTZqaRRVevlGdTSXN56hOJpH1irDw/grwpLW6fWA8 MOLg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:to:references:message-id :content-transfer-encoding:cc:date:in-reply-to:from:subject :mime-version:dkim-signature:arc-authentication-results; bh=IwhZtABGG6zRvbV8aGn0Qevdg7rp/TkULrW6u69B280=; b=xk0ho/PvuY2U1u0batv8FU1GbyRgI/RCB6i33I1Z46w7DuZdwSWp8JzrVwdnq22kL/ EfN7G0E8zlV5oSkZzkLRGNMM9esWLAdlVVspjwuAe8qGi55BOa2hHAD6dbwRPMCmTZcv 7GaNm3JSK5izuw/JzeBum/HfwEOPeIW8mB2zjFLTOWLDnrvDw5jIZnjlIP6u64eFT2F1 FPRG4Uf9m+e+4uKBth3ctLeYEdA2cghF3vcQd0mk6ip6ZmjzGv8QP+u9f2NZ2ZQ4Cb6J ZC/LsUEyWJ2M1TnRnk7y+8V1JG1i5tLTPtua+5ZLaVOycBV+VOQhsSTh7AKcAEyCnJdH VmKg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amacapital-net.20150623.gappssmtp.com header.s=20150623 header.b=mtrlyRHk; 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 n12si1621419pgr.71.2017.11.29.10.19.32; Wed, 29 Nov 2017 10:19:43 -0800 (PST) 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=pass header.i=@amacapital-net.20150623.gappssmtp.com header.s=20150623 header.b=mtrlyRHk; 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 S1752914AbdK2Odl (ORCPT + 70 others); Wed, 29 Nov 2017 09:33:41 -0500 Received: from mail-pg0-f65.google.com ([74.125.83.65]:40638 "EHLO mail-pg0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751077AbdK2Odj (ORCPT ); Wed, 29 Nov 2017 09:33:39 -0500 Received: by mail-pg0-f65.google.com with SMTP id k15so1569365pgr.7 for ; Wed, 29 Nov 2017 06:33:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amacapital-net.20150623.gappssmtp.com; s=20150623; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=IwhZtABGG6zRvbV8aGn0Qevdg7rp/TkULrW6u69B280=; b=mtrlyRHkAbNeYwhVKsQuTTXbp9n2VEEuaeFk+nDXL6x7K0f1mqdp/lctQnZsFtDT0l xHFmZzFCLYH3M9TSNrJNeUcNx4Z846C+uBS5vq+jWMW80LtgGuQMQSe1Kky1E7/R4ODp WhfLtMWClcgw6jv8plz/oWDyzt/U217gkNZftfxejU4TNw8n2v+PFyrm3vVgGWGfvlPB iHgzSnpI9f+Zik6CZpT9kkee0IH4StLuJzWYJZua2gFxCb7vcrZX7Qa23L6GXZ7NWdJ9 3gbuwECKcgnXPbwmvnlsBRrAih3PeG19Vu5K5dnuQAYmduf8IqITS+64SXSQmSH7qmUO A3Lg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=IwhZtABGG6zRvbV8aGn0Qevdg7rp/TkULrW6u69B280=; b=GRKy6KonPOSlrZS7C7nxKqm1uoHJDJBdF2A/sf0U2nXUmp1FDOejG0WfvCzInPisO1 ihmkBw7h24EEep+zZoBAmVDaFX+PuF7kSmAWEkF7LiCBOehhStx39I2aS+8kVnJc+3e7 Mo9XfyXPPlBZsGO30+UgKRK5otIvjAVKLIJ6tt1Rl3SPpZhGD4CmtyNKrLKmNplks2vQ tNB6cdJSlKePQEErcuosZMU0HVZ0VrqQ3+66oQ2S4gBe4jo+c2C03g5fTjEW7rFNiARt M4hP5aXlZW3+8BuYzT5GXIyxbtcgJMuqVeT3yTUROFLZ+UMBmVplrfzinhPTKUanFTco jsaw== X-Gm-Message-State: AJaThX692uoQFKp70Xs4WVb4ObMlg0LP1nL9QA3NVKrHNz+JGL7YIkMc 4Qvs6mjPXSaPbso2RhpGcuOa+t9lYec= X-Received: by 10.99.142.73 with SMTP id k70mr3049601pge.426.1511966019057; Wed, 29 Nov 2017 06:33:39 -0800 (PST) Received: from ?IPv6:2601:646:c200:7429:75bb:522c:7123:45a4? ([2601:646:c200:7429:75bb:522c:7123:45a4]) by smtp.gmail.com with ESMTPSA id y7sm3800300pfy.144.2017.11.29.06.33.37 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 29 Nov 2017 06:33:37 -0800 (PST) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (1.0) Subject: Re: [PATCH] x86/entry/64: Fix native_load_gs_index() SWAPGS handling with IRQ state tracing enabled From: Andy Lutomirski X-Mailer: iPhone Mail (15B150) In-Reply-To: <20171129124711.slmq5emx4f26c4zp@hirez.programming.kicks-ass.net> Date: Wed, 29 Nov 2017 06:33:37 -0800 Cc: Ingo Molnar , Jarkko Nikula , linux-kernel , Andy Lutomirski , Thomas Gleixner , Linus Torvalds , Borislav Petkov Content-Transfer-Encoding: quoted-printable Message-Id: References: <0fede9f9-88b0-a6e7-1027-dfb2019b8ef2@linux.intel.com> <20171129070951.hjjjpbyilzaak4ig@gmail.com> <20171129124711.slmq5emx4f26c4zp@hirez.programming.kicks-ass.net> To: Peter Zijlstra Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > On Nov 29, 2017, at 4:47 AM, Peter Zijlstra wrote: >=20 >> On Wed, Nov 29, 2017 at 08:09:51AM +0100, Ingo Molnar wrote: >> diff --git a/arch/x86/entry/entry_64.S b/arch/x86/entry/entry_64.S >> index f81d50d7ceac..c0b52df8ee4f 100644 >> --- a/arch/x86/entry/entry_64.S >> +++ b/arch/x86/entry/entry_64.S >> @@ -945,16 +945,16 @@ idtentry simd_coprocessor_error do_simd_copr= ocessor_error has_error_code=3D0 >> */ >> ENTRY(native_load_gs_index) >> FRAME_BEGIN >> + SWAPGS /* switch from user GS to kernel GS */ >> pushfq >> DISABLE_INTERRUPTS(CLBR_ANY & ~CLBR_RDI) >> TRACE_IRQS_OFF >> - SWAPGS >=20 > I'm thinking those moves it too far back; we should at least have > interrupts disabled when we do SWAPGS, no? Also, curse paravirt. >=20 I'll look in a few hours. But we definitely can't have irqs on when running with user gs.= From 1585425215511738930@xxx Wed Nov 29 18:15:08 +0000 2017 X-GM-THRID: 1585383480543829622 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread