Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758106AbbDXRdJ (ORCPT ); Fri, 24 Apr 2015 13:33:09 -0400 Received: from mail-oi0-f43.google.com ([209.85.218.43]:36091 "EHLO mail-oi0-f43.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754420AbbDXRdC (ORCPT ); Fri, 24 Apr 2015 13:33:02 -0400 MIME-Version: 1.0 In-Reply-To: References: <5d120f358612d73fc909f5bfa47e7bd082db0af0.1429841474.git.luto@kernel.org> <553A2896.1000200@redhat.com> Date: Fri, 24 Apr 2015 13:33:01 -0400 Message-ID: Subject: Re: [PATCH] x86_64, asm: Work around AMD SYSRET SS descriptor attribute issue From: Brian Gerst To: Linus Torvalds Cc: Denys Vlasenko , Andy Lutomirski , "the arch/x86 maintainers" , "H. Peter Anvin" , Andy Lutomirski , Borislav Petkov , Denys Vlasenko , Ingo Molnar , Steven Rostedt , Oleg Nesterov , Frederic Weisbecker , Alexei Starovoitov , Will Drewry , Kees Cook , Linux Kernel Mailing List Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1168 Lines: 27 On Fri, Apr 24, 2015 at 12:25 PM, Linus Torvalds wrote: > On Fri, Apr 24, 2015 at 5:00 AM, Brian Gerst wrote: >> >> So actually this isn't a preemption issue, as the NULL SS is coming >> from an interrupt from userspace (timer tick, etc.). > > It *is* a preemption issue, in the sense that the interrupt that > clears SS also then returns to user space using an "iret" that will > properly restore it. > > So the only case we need to worry about is the preemption case, where > the interrupt has caused a task switch (typically because it woke > something up or it was the timer interrupt and the timeslice of the > previous task is up), and we switch to another context that returns to > user space using "sysret" instead. To clarify, I was thinking of the CONFIG_PREEMPT case. A nested interrupt wouldn't change SS, and IST interrupts can't schedule. -- Brian Gerst -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/