From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752820AbdKNCSJ (ORCPT ); Mon, 13 Nov 2017 21:18:09 -0500 Received: from mail.kernel.org ([198.145.29.99]:56316 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751161AbdKNCSF (ORCPT ); Mon, 13 Nov 2017 21:18:05 -0500 DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 29D5B21904 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=luto@kernel.org X-Google-Smtp-Source: AGs4zMY5K78Nbv7hwylOmMylMAkpYhbkI4AC/g+I+3hrgg6p7gO46FNQR5EeXE0LJtyAhjMW1Xh7K1W/vlcR7hMR/Ss= MIME-Version: 1.0 In-Reply-To: References: <96d9a6a2849d20775028ea1586a84118ad82670b.1510371795.git.luto@kernel.org> From: Andy Lutomirski Date: Mon, 13 Nov 2017 18:17:44 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [RFC 1/7] x86/asm/64: Allocate and enable the SYSENTER stack To: Dave Hansen Cc: Andy Lutomirski , X86 ML , Borislav Petkov , "linux-kernel@vger.kernel.org" , Brian Gerst , Linus Torvalds 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 Mon, Nov 13, 2017 at 11:07 AM, Dave Hansen wrote: > On 11/10/2017 08:05 PM, Andy Lutomirski wrote: >> This will simplify some future code changes that will want some >> temporary stack space in more places. It also lets us get rid of a >> SWAPGS_UNSAFE_STACK user. >> >> This does not depend on CONFIG_IA32_EMULATION because we'll want the >> stack space even without IA32 emulation. > > It was never clear to me why we don't use this on 64-bit today. Does > anybody know why? Nothing used it? As far as I can tell, the original x86_64 Linux port was a little bit more excited about IST than I think made sense. As a result, we use IST for #DB and #BP, which is IMO rather nasty and causes a lot more problems than it solves. But, since #DB uses IST, we don't actually need a real stack for SYSENTER (because SYSENTER with TF set will invoke #DB on the IST stack rather than the SYSENTER stack). I have old patches to stop using IST for #DB and #BP, but I never finished them.