Received: by 10.223.164.202 with SMTP id h10csp4876285wrb; Wed, 29 Nov 2017 13:26:38 -0800 (PST) X-Google-Smtp-Source: AGs4zMaRM2ju6IepfPgxs3VtTbeURJzMPbTud8M5PaCZacJ+SRCzQSPICofApH2Vgv7ebZ1dC7uS X-Received: by 10.98.202.26 with SMTP id n26mr4336971pfg.202.1511990798129; Wed, 29 Nov 2017 13:26:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1511990798; cv=none; d=google.com; s=arc-20160816; b=pxyMhGKgTkNfBZUcw6jK+pDEF1RA4PfU5YxePglwVCgPoyFkGZiS75xPliABWgXbWM hwB2nJW3ia6B9/Rd3ZehjXUyadrY55D8zmms6REcN4ZVlZvPjIUJUaNcKeYjuPZTI+CF C6GsDocnFEfPW9aduQKzp92CLkzLSQkoz/SePvNnL42o9OjAQCUGMSAqDo+NWIJVzLhk Fc/sfDgW5xev7viCD2aLZhH7fSQYzlkKJS0zFwRCU2k59c9Wba/PHYiQ2cocGBmZKltL mRxfnmfHF2Xh74k2TEyospR1LAAN/9nHZ5DLR7IBuqXNM048yz8V85VVui2KJVeRe0AX bxYA== 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=QpzfdoOqQEtMYEnSXOKjVJkAICUzt56TN5qJqDisVtQ=; b=GyP2nv1IysLnCu+yX9m/MqHxR/snpO16i/Wh6yNbVoUZfswk2I1eXmTAM4SsJgiKvd c8DXgrLhPJlx4tUVzRpSkqhtBNakIKd/XfGPNMm1hL5Yg05tkzUBEXvVme2658Q5I2qr Mis5kkFXLwrHyxDAmcZcopziIG3fcRykbaeJxUOJ04yAeYhJXKvL6WbZGgha2wHckhrJ DBewxrzxXHDOklc6EKfwF1/0aOZe7sLXLGYwJNqkMXXqmWktz1RZXLLyLM2SDjMwqWp2 t/66VznArQMI9WpozJZNo7JkWq6z/6YVgCR9oYvkAF4Jl385RYe3IuJDB+JTzJ16Alzt xNbA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amacapital-net.20150623.gappssmtp.com header.s=20150623 header.b=hafGHub+; 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 s20si1823790pgn.363.2017.11.29.13.26.23; Wed, 29 Nov 2017 13:26:38 -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=hafGHub+; 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 S1751077AbdK2VZP (ORCPT + 99 others); Wed, 29 Nov 2017 16:25:15 -0500 Received: from mail-pl0-f65.google.com ([209.85.160.65]:38803 "EHLO mail-pl0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751350AbdK2VZM (ORCPT ); Wed, 29 Nov 2017 16:25:12 -0500 Received: by mail-pl0-f65.google.com with SMTP id s10so2859950plj.5 for ; Wed, 29 Nov 2017 13:25:11 -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=QpzfdoOqQEtMYEnSXOKjVJkAICUzt56TN5qJqDisVtQ=; b=hafGHub+TtTQ2YApxMpuqgczXI8novpC7lnJxum0bV17GVNGOFsjU3bMrrgD6rClvP dVFs2PKoC87QxRVvvQxoQDgRzfu4K0eU2i9f9qeCjaqAlHANLJsbD+XlQflxLJI2b0jI 8rgX9GUNknKgDBut7vn6eUnSfU1M5MF8ZCxazHNgC1eUuKVclJ1IVV6YAZEpNtzFePMV ozTHUI3Vjiu16NS1UFhvA+GDPVO4FiCQizVRulQFNj7c80qcK7x/z6nDZ5z3fXLyFm7Y CfV/ZgafQqMgFS9WTAkH8Gk8NA1RgvrpMOcqeIBAPY7khQdmBJZYLGqHyxYWixO/7ZCH J0Ww== 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=QpzfdoOqQEtMYEnSXOKjVJkAICUzt56TN5qJqDisVtQ=; b=iOqPbrM0s8q1wZo8Eld66+wec2fQnMGsouNdi6UZw+tUh91IMfPT6QnvNEBheL5lip 239S4WaETvqp0oDm1bBSeHP+9nCJkmC/KHMXST+y14a8PPFr+R+rnA0rtrsobhc22wBj 8XdQEFL8DEV0ij344VN+5Z/zZXmDyXHt/TlkFsUpTByjjJ5OPmJ6mzfw7eKIvNYE+v15 9KsYEhLRovMm93YpPW5peSReHw+2hcYIxDGb9G8wgKHxoVIE6vsx/5druxrZbYI74pUs AREFl+RcRJ2JnpQwqBgMj6LIR/TrhLv0uIo+qfCFJ058B2pauYwaHT0RmLXgyVzP6EkI q+qg== X-Gm-Message-State: AJaThX5zEaJl71UL0X+fQjjXOSf0aGXE1yfobbKXjfYIzbYg6nM95P67 +iOb3yvGWhZ6ea+s81vJdS3zLQ== X-Received: by 10.84.234.135 with SMTP id n7mr241617plk.298.1511990711323; Wed, 29 Nov 2017 13:25:11 -0800 (PST) Received: from ?IPv6:2601:646:c200:7429:a593:fa9e:6d2:2508? ([2601:646:c200:7429:a593:fa9e:6d2:2508]) by smtp.gmail.com with ESMTPSA id f67sm4801271pff.173.2017.11.29.13.25.10 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 29 Nov 2017 13:25:10 -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 (15B202) In-Reply-To: Date: Wed, 29 Nov 2017 13:25:09 -0800 Cc: Andy Lutomirski , Ingo Molnar , Jarkko Nikula , linux-kernel , Thomas Gleixner , Peter Zijlstra , Borislav Petkov Content-Transfer-Encoding: quoted-printable Message-Id: <31643632-8A3F-46AC-95AB-27FC94ED79A3@amacapital.net> References: <0fede9f9-88b0-a6e7-1027-dfb2019b8ef2@linux.intel.com> <20171129070951.hjjjpbyilzaak4ig@gmail.com> To: Linus Torvalds Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > On Nov 29, 2017, at 12:58 PM, Linus Torvalds wrote: >=20 >> On Wed, Nov 29, 2017 at 10:12 AM, Andy Lutomirski wrote= : >>=20 >> Jarkko, can you try the attached patch? If it survives resume, can >> you see if the log contains anything interesting? >=20 > I'm not Jarkko, but I'm not a huge fan of that patch. >=20 > If this was the cause of the problem (and it looks likely), wouldn't > it be nicer to instead make sure that __restore_processor_state() is > made to use only low-level code and easy to verify? >=20 > That function is already marked "notrace" because it is so fragile, > and it does the segment register reloads manually with inline asms. I completely agree, and I think it might be better to move more of that crap= to asm. Also, it looks quite buggy -- it restores segment registers before= it loads the LDT, so they had better not be user registers. Or we could load fixed values into the segment regs if they're not user valu= es. >=20 > Could we make it use "native_load_gs_index()" instead? Or even go all > the way and make it do that user-space %gs load internally with inline > asm, the way it already does the kernel space %gs? Dunno. If we need the exception handling, it can't be inlined. Anyway, this wasn't meant to be an upstreamable fix. It was meant to make s= ure the problem I'm fixing is the right problem. >=20 > (Maybe "native_wrmsrl()" too?) >=20 > Or is this actually all supposed to work even under PV? That sounds really= iffy. >=20 > Linus From 1585435586854620669@xxx Wed Nov 29 20:59:59 +0000 2017 X-GM-THRID: 1585383480543829622 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread