Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp2246839imm; Thu, 19 Jul 2018 16:21:21 -0700 (PDT) X-Google-Smtp-Source: AAOMgpePCiYymQnf5MVIgMMOXkqtXjVNMk3bk8RwegJgvPDH968ck50TuefzsNfRPt/se1RueY1q X-Received: by 2002:a65:6455:: with SMTP id s21-v6mr11448243pgv.394.1532042481797; Thu, 19 Jul 2018 16:21:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532042481; cv=none; d=google.com; s=arc-20160816; b=D19hckpOaJugllHTnaaJhl1NlGn6Tf+NhefDmLipa3yGQyoUBC2W15EZrWRhuwuFJz zP7jWkkdCMRiI3Xz326fCZRpklSEWO/VAANFIGyAr2XL7wJoclyAWdVtVVwf/0eUFG33 jLoxA92m7Sw9L7LRYtN9ro6NT7GX1rwWDO8BEzslTZwjaFMMkQGQ3HRyv3r72+qDhTUd J1rCUys2FBXv1SoTuv7pcVP57Aseu8BYh9nX4iCUFBL9Ta6rqfHQJqTmlU4fuCiPqgPn 01npNCT39LbVNLxpxhhkYOwhvr1Sqp0tKLVxqSS6CkrEPH4iUY93AFHhpB+u+vt+B9ud 0QXQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-disposition :content-transfer-encoding:mime-version:robot-unsubscribe:robot-id :git-commit-id:subject:to:references:in-reply-to:reply-to:cc :message-id:from:date:arc-authentication-results; bh=b3yxm4xDPiCAyfH4mpxatNrkvUBiSLoe5nMts8m7w+M=; b=OzoUmfnssjSF9XWJMVK/72HK6WPJBe2J9J2PhYlFFqYagJIdcGQ8vs+RJubFc/fCdv sa/8YyAe4w78wkFWcoNf7idvf1C289k6wOj56VJCQPe+HUCB7iDGiVOO3PNj+vLSFZmu gpYCFC6udngxQXcG3pu6CPgZdYG4IjLqJHRY4kEiSsOz7ZuvaIeWG7F98zVoqVPHz7Cg HYwRKSUHw7aoqfOlL3cFPFxbOPaNqN/aVdUhSxLvZrNkwkXd8q2fhfrVksZkO1iFlKWG 58IkBA8lFFvrRhJGIC2g/pyC0swbbETxZ21C6TyF97MK2gRT9eTOl6DV/4oVYLbRB904 Nvrg== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v71-v6si405285pfj.354.2018.07.19.16.21.07; Thu, 19 Jul 2018 16:21:21 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730862AbeGTAFq (ORCPT + 99 others); Thu, 19 Jul 2018 20:05:46 -0400 Received: from terminus.zytor.com ([198.137.202.136]:46403 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729919AbeGTAFq (ORCPT ); Thu, 19 Jul 2018 20:05:46 -0400 Received: from terminus.zytor.com (localhost [127.0.0.1]) by terminus.zytor.com (8.15.2/8.15.2) with ESMTPS id w6JNJOtr2450892 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Thu, 19 Jul 2018 16:19:24 -0700 Received: (from tipbot@localhost) by terminus.zytor.com (8.15.2/8.15.2/Submit) id w6JNJOOV2450889; Thu, 19 Jul 2018 16:19:24 -0700 Date: Thu, 19 Jul 2018 16:19:24 -0700 X-Authentication-Warning: terminus.zytor.com: tipbot set sender to tipbot@zytor.com using -f From: tip-bot for Joerg Roedel Message-ID: Cc: llong@redhat.com, will.deacon@arm.com, linux-kernel@vger.kernel.org, aarcange@redhat.com, jpoimboe@redhat.com, dhgutteridge@sympatico.ca, eduval@amazon.com, pavel@ucw.cz, dvlasenk@redhat.com, mingo@kernel.org, David.Laight@aculab.com, brgerst@gmail.com, torvalds@linux-foundation.org, tglx@linutronix.de, bp@alien8.de, hpa@zytor.com, luto@kernel.org, dave.hansen@intel.com, jroedel@suse.de, jkosina@suse.cz, peterz@infradead.org, gregkh@linuxfoundation.org, jgross@suse.com, boris.ostrovsky@oracle.com Reply-To: peterz@infradead.org, gregkh@linuxfoundation.org, boris.ostrovsky@oracle.com, jgross@suse.com, tglx@linutronix.de, bp@alien8.de, hpa@zytor.com, luto@kernel.org, jkosina@suse.cz, jroedel@suse.de, dave.hansen@intel.com, dhgutteridge@sympatico.ca, jpoimboe@redhat.com, dvlasenk@redhat.com, mingo@kernel.org, pavel@ucw.cz, eduval@amazon.com, torvalds@linux-foundation.org, David.Laight@aculab.com, brgerst@gmail.com, llong@redhat.com, will.deacon@arm.com, aarcange@redhat.com, linux-kernel@vger.kernel.org In-Reply-To: <1531906876-13451-3-git-send-email-joro@8bytes.org> References: <1531906876-13451-3-git-send-email-joro@8bytes.org> To: linux-tip-commits@vger.kernel.org Subject: [tip:x86/pti] x86/entry/32: Rename TSS_sysenter_sp0 to TSS_entry2task_stack Git-Commit-ID: ae2e565bc6aaee3f3db420fec5fdd39755c9813e X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00, DATE_IN_FUTURE_96_Q autolearn=ham autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on terminus.zytor.com Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: ae2e565bc6aaee3f3db420fec5fdd39755c9813e Gitweb: https://git.kernel.org/tip/ae2e565bc6aaee3f3db420fec5fdd39755c9813e Author: Joerg Roedel AuthorDate: Wed, 18 Jul 2018 11:40:39 +0200 Committer: Thomas Gleixner CommitDate: Fri, 20 Jul 2018 01:11:35 +0200 x86/entry/32: Rename TSS_sysenter_sp0 to TSS_entry2task_stack The stack address doesn't need to be stored in tss.sp0 if the stack is switched manually like on sysenter. Rename the offset so that it still makes sense when its location is changed in later patches. This stackk will also be used 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 Signed-off-by: Thomas Gleixner Tested-by: Pavel Machek Cc: "H . Peter Anvin" Cc: linux-mm@kvack.org Cc: Linus Torvalds Cc: Andy Lutomirski Cc: Dave Hansen Cc: Josh Poimboeuf Cc: Juergen Gross Cc: Peter Zijlstra Cc: Borislav Petkov Cc: Jiri Kosina Cc: Boris Ostrovsky Cc: Brian Gerst Cc: David Laight Cc: Denys Vlasenko Cc: Eduardo Valentin Cc: Greg KH Cc: Will Deacon Cc: aliguori@amazon.com Cc: daniel.gruss@iaik.tugraz.at Cc: hughd@google.com Cc: keescook@google.com Cc: Andrea Arcangeli Cc: Waiman Long Cc: "David H . Gutteridge" Cc: joro@8bytes.org Link: https://lkml.kernel.org/r/1531906876-13451-3-git-send-email-joro@8bytes.org --- 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 c371bfee137a..39f711ad0fc9 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 a4a3be399f4b..15b3f45b69cd 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