Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp6475666imm; Mon, 23 Jul 2018 19:38:51 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdWfJPbuIUmaq2bt++S71TnMMwCeGiwZm3gdHCsAzK+i57KHs8lM8QDxf7u+aoOUuU8xsmA X-Received: by 2002:a63:5204:: with SMTP id g4-v6mr14726192pgb.274.1532399931709; Mon, 23 Jul 2018 19:38:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532399931; cv=none; d=google.com; s=arc-20160816; b=VWeWQ1TOSt0RKFSGEmAXz111F1Iwu6tbxRS7KMOVPH4XPa8RsuSYO0e2COWWeLvlui gpOQYpOrlDjV+8lu0dssDBHjL2UA/x0pcrGvNUbmBf2GVEC4X7QiaFrXKtLiA3PDhyOz oTDwbv15ErBYBo+VpBKK6VQ8FRClfvG7N/CzijaaFqkznjtfEitjbfP1OCpifNwRZkSi fYueTHF2j5WE1sMuWD1k6hjQHSootcThILee2C1ZEklDJl5Wf7TkFbQSj8az64nGFkeF AQpxmLKlI64Hbg+M8Nn/FgwvIrUySEBhkAyAzvTyCUrIt36ob2fVdEMO5+jWBrusOEwt y+kQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=8pl5SjYAV3IOmYh8AP2E6rqkupl9+uuZCKB8vHZezb8=; b=snLNE0DE/Dim3imSW/i1dC1/ROqoa179Wb7lrDT6i5e7ejweds2owR4PNGY5eZD0Z6 kIF+lg5HHT1ZwihpGOm7pIA7G63gAI7ByeAhbh6NsGF02FDfp6VmeYQpNAr3BA1ezqKR fjtFiwuejmSy6YFmsQz5X2PKCE08ShIQWxSqwzOzDrHoFepDzluFz/ep34bMVTSOvltT Gerc4QVWDfbWLazcHCZLHLJ/VoqvuILdenbBJ6epodN6/6kuU8zuL+JD2UKpH8PZ8sgN KLMRSeEWdf9GlUErmrNvzWFHHr3PSOZlkwgckAgNlNRAzNZqSJmXHwxJNpuh1X23Kzf7 tcfA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=qa086obT; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d19-v6si11397326pfm.226.2018.07.23.19.38.36; Mon, 23 Jul 2018 19:38:51 -0700 (PDT) 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=@kernel.org header.s=default header.b=qa086obT; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388420AbeGXDlO (ORCPT + 99 others); Mon, 23 Jul 2018 23:41:14 -0400 Received: from mail.kernel.org ([198.145.29.99]:58108 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388321AbeGXDlO (ORCPT ); Mon, 23 Jul 2018 23:41:14 -0400 Received: from mail-wr1-f42.google.com (mail-wr1-f42.google.com [209.85.221.42]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id C71CD20882 for ; Tue, 24 Jul 2018 02:37:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1532399825; bh=RC2xsBB/HbwLbQZDynpvHVAJd8ZIZrwPVFGsEu8N9HE=; h=In-Reply-To:References:From:Date:Subject:To:Cc:From; b=qa086obTBmeaykO5obk6ro+svk+jN5UYlw/lbKiD9QYPf4oxeEZ6Uu+u7op2gweBk r+3uEwkeDHCo8xQJ1moS4UQDy4/bZw/7D44n9dtO0+DpTgO0YkCxaaZrhfyvuKUXjH EAhnXU1gY9X7K4WkWQ/Vr07NdapN9nMuO3BuQWtE= Received: by mail-wr1-f42.google.com with SMTP id b15-v6so2512730wrv.10 for ; Mon, 23 Jul 2018 19:37:04 -0700 (PDT) X-Gm-Message-State: AOUpUlFP+BjX3dDEw3HTJUK8W1h98fakRpoFxrkCaWe9FoMuKzUbEs+0 DyCSKbkGzhxVyF3SJbnjHhZFTd2RO3fUNAs7gSjCmA== X-Received: by 2002:adf:81c3:: with SMTP id 61-v6mr10241701wra.120.1532399823270; Mon, 23 Jul 2018 19:37:03 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a1c:d548:0:0:0:0:0 with HTTP; Mon, 23 Jul 2018 19:36:42 -0700 (PDT) In-Reply-To: <854ac759-efec-3e35-59a9-8da35b2b5156@linux.intel.com> References: <38b5a24f3c9f519dd7dc98171eb3a3c669fff48c.1532281180.git.luto@kernel.org> <854ac759-efec-3e35-59a9-8da35b2b5156@linux.intel.com> From: Andy Lutomirski Date: Mon, 23 Jul 2018 19:36:42 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [RFC 1/2] x86/entry/64: Use the TSS sp2 slot for rsp_scratch To: Dave Hansen Cc: Andy Lutomirski , X86 ML , LKML , Borislav Petkov , Linus Torvalds Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jul 23, 2018 at 5:38 AM, Dave Hansen wrote: > On 07/22/2018 10:45 AM, Andy Lutomirski wrote: >> + /* >> + * sp2 is scratch space used by the SYSCALL64 handler. Linux does >> + * not use rung 2, so sp2 is not otherwise needed. >> + */ >> u64 sp2; > > Could we call out the actual thing that we use this slot for, and the > symbol name so folks can find the corresponding code that does this? > While I know the spot in entry_64 you're talking about, it might not be > patently obvious to everyone, and it's also a bit more challenging to > grep for than normal C code. > > Maybe: > > /* > * Since Linux does not use ring 2, the 'sp2' slot is unused. > * entry_SYSCALL_64 uses this as scratch space to stash the user > * %RSP value. > */ I'll improve this for v2.