From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752840AbdK2U65 (ORCPT ); Wed, 29 Nov 2017 15:58:57 -0500 Received: from mail-io0-f194.google.com ([209.85.223.194]:46904 "EHLO mail-io0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751783AbdK2U6z (ORCPT ); Wed, 29 Nov 2017 15:58:55 -0500 X-Google-Smtp-Source: AGs4zMYs9AJmDHyMgB/Ip1sdG7/J7BG95AzCjmtpSdDMW7crcn5wkFYHfDMCADy5cMkRVTzAj0hTQezTV5hL7ylMCkA= MIME-Version: 1.0 In-Reply-To: References: <0fede9f9-88b0-a6e7-1027-dfb2019b8ef2@linux.intel.com> <20171129070951.hjjjpbyilzaak4ig@gmail.com> From: Linus Torvalds Date: Wed, 29 Nov 2017 12:58:54 -0800 X-Google-Sender-Auth: XhQc3WRQInIWjCOKGe4a4-zM1Dw Message-ID: Subject: Re: [PATCH] x86/entry/64: Fix native_load_gs_index() SWAPGS handling with IRQ state tracing enabled To: Andy Lutomirski Cc: Ingo Molnar , Jarkko Nikula , linux-kernel , Thomas Gleixner , Peter Zijlstra , Borislav Petkov Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Nov 29, 2017 at 10:12 AM, Andy Lutomirski wrote: > > Jarkko, can you try the attached patch? If it survives resume, can > you see if the log contains anything interesting? I'm not Jarkko, but I'm not a huge fan of that patch. 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? That function is already marked "notrace" because it is so fragile, and it does the segment register reloads manually with inline asms. 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? (Maybe "native_wrmsrl()" too?) Or is this actually all supposed to work even under PV? That sounds really iffy. Linus