From patchwork Wed Jul 18 09:40:39 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joerg Roedel X-Patchwork-Id: 10531793 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 1A890602CA for ; Wed, 18 Jul 2018 09:41:32 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0BF4428FD5 for ; Wed, 18 Jul 2018 09:41:32 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0018A28FF3; Wed, 18 Jul 2018 09:41:31 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=unavailable version=3.3.1 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5DA0C28FD5 for ; Wed, 18 Jul 2018 09:41:30 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id C62476B026D; Wed, 18 Jul 2018 05:41:24 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id B973D6B026E; Wed, 18 Jul 2018 05:41:24 -0400 (EDT) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id A37DE6B026F; Wed, 18 Jul 2018 05:41:24 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-ed1-f71.google.com (mail-ed1-f71.google.com [209.85.208.71]) by kanga.kvack.org (Postfix) with ESMTP id 4499B6B026D for ; Wed, 18 Jul 2018 05:41:24 -0400 (EDT) Received: by mail-ed1-f71.google.com with SMTP id d5-v6so1699570edq.3 for ; Wed, 18 Jul 2018 02:41:24 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:dkim-signature:from:to:cc:subject:date :message-id:in-reply-to:references; bh=KdBuKMvrcMnD5ADgtnBenjayX2QY4DVc3n4XmAHKWC4=; b=PoQXThW+F/Hb0HGMrcl8epmKxI0L6flzxMoTGpt41c0KqADgsJ54YsGg0DQlz6Xt9C 20Ih5Fddscl8ct/1e3nNlFCnLpsV9OZCMUElZ70qucHEeJWGR9S17XZI9NIbJK3gjp7i EqUJo08OBxQ3yyQa6IhyVN4OQZfNcT5ieVgp7ru0CBGQVOZw2axrZHAM5Hf/gdkw0RqA LawUZu291bdBexrO19Qp2mITaIOKsPe4CXW6EJ36rhMlRU+wBA4EXFzMMtrB9O0ok1Xd ILlaNn173QCnZ1JxDDGyoukwJYvBgV66pkaeqg4Hv9fyzTZb3IEO8lvP8jtL0+boc8Ad ollg== X-Gm-Message-State: AOUpUlEMLL89+RWTEDe+lOzF7N7R53PSHirfIMt4lq9BEkHKAONH98aG gTMdZfBCgfoep4i+JWHDwrZrQjFRjAET/itun3MvCoSS1rdXLes32WbO4/zWl+dOtGpLcROvEnQ 45KZtAbluD6I9g0U40hNXkBzbh9GkVa5Wle2cWBXilzT/pBDULO6CILyAxG1PUDCEog== X-Received: by 2002:a50:87a8:: with SMTP id a37-v6mr6280244eda.31.1531906883838; Wed, 18 Jul 2018 02:41:23 -0700 (PDT) X-Google-Smtp-Source: AAOMgpfvbPhq8YTMYm43jZfHyr82fYNbjsh4Z+kZT4+ts8Yt1GmrSSpRp+w+fuDGdDBT6JYr4oi+ X-Received: by 2002:a50:87a8:: with SMTP id a37-v6mr6280205eda.31.1531906883166; Wed, 18 Jul 2018 02:41:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531906883; cv=none; d=google.com; s=arc-20160816; b=Byry9wD1tI9hB+Dv2NS40uaLm5LFQa4Ed3oqV+EQg/2K4cvK0TafbpL9oFvaqdHbpo QlQafcl3phEKLBqgdP03pHpQRZQ8c/aNWzeSZEXiuHHDJwAnOWOgIe+5/P9aQd2ay4Wi sYipx/knu8Vaq2Dc/hlLC8BlxBOe2aOKTqdxFOZrAd7fe/j/mrSOeC1xN1OYOAnvpD2F j6Zg/kcioTx1GF/AR84fTPCQoBiLPwZMwzcMurwznsAcHkecJOOTotlFH4CNCk33Khv2 bPmPg/Nvu3QwSrdmCQHOPjQSXN0b1QXS+mVTw551Q20nxXPOCJmTQZ1uRIAxGJ4ldQj4 NQpw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=KdBuKMvrcMnD5ADgtnBenjayX2QY4DVc3n4XmAHKWC4=; b=mTkQHidaEegHoELBxSpL2XiYhUNGuRyADH0AnttB5Atoq0q495jkp9l9NYIOsB/FdZ tQCxevPJSNTUrep5brNOWRiiAejFZFrNwN/kRsXwrwZnmAKuTvKoxnYbKIarCZFaz3bI QUqhYNVMIXixg5FmU/B4LXCVpJdu2gJLquD/IMtbe1c46dZZo/a5l92FN/YDnsS/fS7C bxH6AWRNHc2mqdlTwphAkQfKw+Ow3gUezy7TNgG8q2zeoOW6zqJYJoKqU2ng7WIseIrN M+BUHFp6QxaUFYH6rJMN5/iF4Dz7ZsOpwwEx8unvQk9sYecdFsUXpX/ibbXLkFVqxN3m Fe3g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass (test mode) header.i=@8bytes.org header.s=mail-1 header.b=IZoRGrgV; spf=pass (google.com: domain of joro@8bytes.org designates 2a01:238:4383:600:38bc:a715:4b6d:a889 as permitted sender) smtp.mailfrom=joro@8bytes.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=8bytes.org Received: from theia.8bytes.org (8bytes.org. [2a01:238:4383:600:38bc:a715:4b6d:a889]) by mx.google.com with ESMTPS id z25-v6si2943977edq.292.2018.07.18.02.41.23 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 18 Jul 2018 02:41:23 -0700 (PDT) Received-SPF: pass (google.com: domain of joro@8bytes.org designates 2a01:238:4383:600:38bc:a715:4b6d:a889 as permitted sender) client-ip=2a01:238:4383:600:38bc:a715:4b6d:a889; Authentication-Results: mx.google.com; dkim=pass (test mode) header.i=@8bytes.org header.s=mail-1 header.b=IZoRGrgV; spf=pass (google.com: domain of joro@8bytes.org designates 2a01:238:4383:600:38bc:a715:4b6d:a889 as permitted sender) smtp.mailfrom=joro@8bytes.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=8bytes.org Received: by theia.8bytes.org (Postfix, from userid 1000) id E3C451CF; Wed, 18 Jul 2018 11:41:18 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=8bytes.org; s=mail-1; t=1531906878; bh=QlE8MZLewD3R1oAeDLNK4aQRy8X1hW4H3O+KcJhJiz4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=IZoRGrgVkTgjISKKhmP2jBgCvQIqVRTPWV8N/V752Lp8rD6XABYdtq2I91fpbdNLv Jgp4SO5Tymwfmcd26aPOspu/7462W2e1LgRWtNJ5niaQiRcjE8jJrNnVN3QOmDQqj+ y2rRVowo56E9s+SSfUnw0MJsrGmF0P3oYtXOoEBxpwmz3apVGe80wVFDqam1MN/8Oq 8jVT5b5EAYUNHVHV8YrNxqhmy/eyQGeCKa0TzCd7L8QyguN0XxtcdFFNQlZSPffEPI o4vlItX4PjDheWaeNTc9kyNZtHyS0HOIKJQOIPpaKYDDH2pGxxit9/4Q0+l9TmVBl1 5Zkwk8epzEnLA== From: Joerg Roedel To: Thomas Gleixner , Ingo Molnar , "H . Peter Anvin" Cc: x86@kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, Linus Torvalds , Andy Lutomirski , Dave Hansen , Josh Poimboeuf , Juergen Gross , Peter Zijlstra , Borislav Petkov , Jiri Kosina , Boris Ostrovsky , Brian Gerst , David Laight , Denys Vlasenko , Eduardo Valentin , Greg KH , Will Deacon , aliguori@amazon.com, daniel.gruss@iaik.tugraz.at, hughd@google.com, keescook@google.com, Andrea Arcangeli , Waiman Long , Pavel Machek , "David H . Gutteridge" , jroedel@suse.de, joro@8bytes.org Subject: [PATCH 02/39] x86/entry/32: Rename TSS_sysenter_sp0 to TSS_entry2task_stack Date: Wed, 18 Jul 2018 11:40:39 +0200 Message-Id: <1531906876-13451-3-git-send-email-joro@8bytes.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1531906876-13451-1-git-send-email-joro@8bytes.org> References: <1531906876-13451-1-git-send-email-joro@8bytes.org> X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: X-Virus-Scanned: ClamAV using ClamSMTP From: Joerg Roedel The stack address doesn't need to be stored in tss.sp0 if we switch manually like on sysenter. Rename the offset so that it still makes sense when we change its location. We will also use this stack for all kernel-entry points, not just sysenter. Reflect that and the fact that it is the offset to the task-stack location in the name as well. Signed-off-by: Joerg Roedel --- arch/x86/entry/entry_32.S | 2 +- arch/x86/kernel/asm-offsets_32.c | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/arch/x86/entry/entry_32.S b/arch/x86/entry/entry_32.S index c371bfe..39f711a 100644 --- a/arch/x86/entry/entry_32.S +++ b/arch/x86/entry/entry_32.S @@ -412,7 +412,7 @@ ENTRY(xen_sysenter_target) * 0(%ebp) arg6 */ ENTRY(entry_SYSENTER_32) - movl TSS_sysenter_sp0(%esp), %esp + movl TSS_entry2task_stack(%esp), %esp .Lsysenter_past_esp: pushl $__USER_DS /* pt_regs->ss */ pushl %ebp /* pt_regs->sp (stashed in bp) */ diff --git a/arch/x86/kernel/asm-offsets_32.c b/arch/x86/kernel/asm-offsets_32.c index a4a3be3..15b3f45 100644 --- a/arch/x86/kernel/asm-offsets_32.c +++ b/arch/x86/kernel/asm-offsets_32.c @@ -46,8 +46,9 @@ void foo(void) OFFSET(saved_context_gdt_desc, saved_context, gdt_desc); BLANK(); - /* Offset from the sysenter stack to tss.sp0 */ - DEFINE(TSS_sysenter_sp0, offsetof(struct cpu_entry_area, tss.x86_tss.sp0) - + /* Offset from the entry stack to task stack stored in TSS */ + DEFINE(TSS_entry2task_stack, + offsetof(struct cpu_entry_area, tss.x86_tss.sp0) - offsetofend(struct cpu_entry_area, entry_stack_page.stack)); #ifdef CONFIG_STACKPROTECTOR