Received: by 10.223.185.116 with SMTP id b49csp3211934wrg; Mon, 5 Mar 2018 16:39:30 -0800 (PST) X-Google-Smtp-Source: AG47ELsOmvF1RC3fkUFjLJeMepNIPCv61K+lb4j3cidM7e8nGzE8TM+uuEHD5/80bq47POmZhQ+k X-Received: by 10.99.97.68 with SMTP id v65mr13759713pgb.104.1520296770302; Mon, 05 Mar 2018 16:39:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520296770; cv=none; d=google.com; s=arc-20160816; b=qasWl1BBLXtLHyhOHH2NmVFUarRs8guSWXAd1PxLFnGhEoPSCIYpnvv4NilPARf712 cv6Mi6Vo9rFdAERKiA7nayv5INwjRk6pAb+Fro4tZiAet9iKhHaHoM9s7M1MuT4BNFNa SRrU48O0rULl8fRw4c6fhdwoueR5kMocCCboaE77mPERK/a2TilUMUISXhr7RZpfUNGQ f0Cwmm24p6AtDxuY1rhhpTnHZF9lBPcXoTbQm129VLWYmvAUqiliTCTJPBZGDgcgQ5Xf 15SA9vRwO/7JpUII8PoClWsixozvR9XdcFwjUrHUW3OOcqfNUNgi1R/Wa7G/+R9u5XwA hJ2g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:to:from:dkim-signature:arc-authentication-results; bh=tdpc+7Jw/Ly+c4riK6XReTTY0hZGVnX8jKWoqZX+t60=; b=vpB4h9Z3LZ9ndeoy62BIvvYJjUphMQeJyqjXoWdMo1I10QLre5E6hEiSGCeAtf3sSY KYkW6ZiJgPUiBeeJJp1efF+1otfb2HefGUVw9LcN9h/K0UJsjV6tZzyAgIkOYZMWhFpG /6f6Nu+ril8/EF/EEll06gbktACWBWvSNMZkoluAmMFpjsE8+7PwBciM3H1FFsoCN30f WpSkx4DisW4ld5mcvPKYR5OkFItbhQKRZYKYDhHqmk6Vry85D/SdgRZtUGWFQ/lBRi+n Ez5mwo2L9it77tnikXmOpTZ/RVx/l0lfel2HpO15ba3ALOpqEC66CCEsvoM9U8Du8Fmr vkgA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2017-10-26 header.b=Sw7D8SOx; 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=oracle.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l24si9042685pgo.580.2018.03.05.16.39.16; Mon, 05 Mar 2018 16:39:30 -0800 (PST) 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=@oracle.com header.s=corp-2017-10-26 header.b=Sw7D8SOx; 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=oracle.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933554AbeCFAgy (ORCPT + 99 others); Mon, 5 Mar 2018 19:36:54 -0500 Received: from aserp2120.oracle.com ([141.146.126.78]:56268 "EHLO aserp2120.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933131AbeCFA0Y (ORCPT ); Mon, 5 Mar 2018 19:26:24 -0500 Received: from pps.filterd (aserp2120.oracle.com [127.0.0.1]) by aserp2120.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w260LXEA034897; Tue, 6 Mar 2018 00:26:21 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : subject : date : message-id : in-reply-to : references; s=corp-2017-10-26; bh=tdpc+7Jw/Ly+c4riK6XReTTY0hZGVnX8jKWoqZX+t60=; b=Sw7D8SOx/GWECI/qd0TJOTu3qk1D/8+XHLKjhk1Z4BIKcr1MPao4xmvRJpRFtMjJXt52 zAG6Z9K+kktsThosAlIDg9wOlU3SUPTUJjaWY5BGO+63fETkYEe+Jsev1b9D9uL0ZgXt g3+nJoUv3dXR+y1Nt87MkaoraLqr8RYfKhYi8fsAp1rbchnBY3ID69kpfLKq1Xo9vBwb P1cLf/mYGezgBicqL5ypT1cqKHN8DtV5emAIMxGn/47GFx+kC6/E3F4b1nE2vI7u4iwF SB3PQXjwml3Rv9qhVh7L96fsllgV6Y0n+gB6X3o0b1XB6L0L4l3jyIy9CHXm8xNTSaCV NA== Received: from userv0022.oracle.com (userv0022.oracle.com [156.151.31.74]) by aserp2120.oracle.com with ESMTP id 2ghe3kgg3n-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 06 Mar 2018 00:26:21 +0000 Received: from userv0122.oracle.com (userv0122.oracle.com [156.151.31.75]) by userv0022.oracle.com (8.14.4/8.14.4) with ESMTP id w260QKEs011195 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 6 Mar 2018 00:26:20 GMT Received: from abhmp0008.oracle.com (abhmp0008.oracle.com [141.146.116.14]) by userv0122.oracle.com (8.14.4/8.14.4) with ESMTP id w260QJ3P025074; Tue, 6 Mar 2018 00:26:19 GMT Received: from localhost.localdomain (/98.216.35.41) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Mon, 05 Mar 2018 16:26:19 -0800 From: Pavel Tatashin To: steven.sistare@oracle.com, daniel.m.jordan@oracle.com, linux-kernel@vger.kernel.org, Alexander.Levin@microsoft.com, dan.j.williams@intel.com, sathyanarayanan.kuppuswamy@intel.com, pankaj.laxminarayan.bharadiya@intel.com, akuster@mvista.com, cminyard@mvista.com, pasha.tatashin@oracle.com, gregkh@linuxfoundation.org, stable@vger.kernel.org Subject: [PATCH 4.1 24/65] x86/entry: Remove unused 'kernel_stack' per-cpu variable Date: Mon, 5 Mar 2018 19:24:57 -0500 Message-Id: <20180306002538.1761-25-pasha.tatashin@oracle.com> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180306002538.1761-1-pasha.tatashin@oracle.com> References: <20180306002538.1761-1-pasha.tatashin@oracle.com> X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=8823 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1711220000 definitions=main-1803060003 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Denys Vlasenko Signed-off-by: Denys Vlasenko Acked-by: Andy Lutomirski Cc: Alexei Starovoitov Cc: Andrew Morton Cc: Borislav Petkov Cc: Frederic Weisbecker Cc: H. Peter Anvin Cc: Kees Cook Cc: Linus Torvalds Cc: Oleg Nesterov Cc: Peter Zijlstra Cc: Steven Rostedt Cc: Thomas Gleixner Cc: Will Drewry Link: http://lkml.kernel.org/r/1429889495-27850-2-git-send-email-dvlasenk@redhat.com Signed-off-by: Ingo Molnar (cherry picked from commit fed7c3f0f750f225317828d691e9eb76eec887b3) Signed-off-by: Pavel Tatashin --- arch/x86/include/asm/thread_info.h | 2 -- arch/x86/kernel/cpu/common.c | 4 ---- arch/x86/kernel/process_32.c | 5 +---- arch/x86/kernel/process_64.c | 3 --- arch/x86/kernel/smpboot.c | 2 -- 5 files changed, 1 insertion(+), 15 deletions(-) diff --git a/arch/x86/include/asm/thread_info.h b/arch/x86/include/asm/thread_info.h index d656a363e1eb..472288962c99 100644 --- a/arch/x86/include/asm/thread_info.h +++ b/arch/x86/include/asm/thread_info.h @@ -177,8 +177,6 @@ struct thread_info { */ #ifndef __ASSEMBLY__ -DECLARE_PER_CPU(unsigned long, kernel_stack); - static inline struct thread_info *current_thread_info(void) { return (struct thread_info *)(current_top_of_stack() - THREAD_SIZE); diff --git a/arch/x86/kernel/cpu/common.c b/arch/x86/kernel/cpu/common.c index f5647d238337..4f1db34113e2 100644 --- a/arch/x86/kernel/cpu/common.c +++ b/arch/x86/kernel/cpu/common.c @@ -1210,10 +1210,6 @@ static __init int setup_disablecpuid(char *arg) } __setup("clearcpuid=", setup_disablecpuid); -DEFINE_PER_CPU(unsigned long, kernel_stack) = - (unsigned long)&init_thread_union + THREAD_SIZE; -EXPORT_PER_CPU_SYMBOL(kernel_stack); - #ifdef CONFIG_X86_64 struct desc_ptr idt_descr = { NR_VECTORS * 16 - 1, (unsigned long) idt_table }; struct desc_ptr debug_idt_descr = { NR_VECTORS * 16 - 1, diff --git a/arch/x86/kernel/process_32.c b/arch/x86/kernel/process_32.c index 8ed2106b06da..a99900cedc22 100644 --- a/arch/x86/kernel/process_32.c +++ b/arch/x86/kernel/process_32.c @@ -302,13 +302,10 @@ __switch_to(struct task_struct *prev_p, struct task_struct *next_p) arch_end_context_switch(next_p); /* - * Reload esp0, kernel_stack, and current_top_of_stack. This changes + * Reload esp0 and cpu_current_top_of_stack. This changes * current_thread_info(). */ load_sp0(tss, next); - this_cpu_write(kernel_stack, - (unsigned long)task_stack_page(next_p) + - THREAD_SIZE); this_cpu_write(cpu_current_top_of_stack, (unsigned long)task_stack_page(next_p) + THREAD_SIZE); diff --git a/arch/x86/kernel/process_64.c b/arch/x86/kernel/process_64.c index f7724a1d7de1..b6533ef508c9 100644 --- a/arch/x86/kernel/process_64.c +++ b/arch/x86/kernel/process_64.c @@ -410,9 +410,6 @@ __switch_to(struct task_struct *prev_p, struct task_struct *next_p) /* Reload esp0 and ss1. This changes current_thread_info(). */ load_sp0(tss, next); - this_cpu_write(kernel_stack, - (unsigned long)task_stack_page(next_p) + THREAD_SIZE); - /* * Now maybe reload the debug registers and handle I/O bitmaps */ diff --git a/arch/x86/kernel/smpboot.c b/arch/x86/kernel/smpboot.c index 50e547eac8cd..023cccf5a4ae 100644 --- a/arch/x86/kernel/smpboot.c +++ b/arch/x86/kernel/smpboot.c @@ -792,8 +792,6 @@ void common_cpu_up(unsigned int cpu, struct task_struct *idle) clear_tsk_thread_flag(idle, TIF_FORK); initial_gs = per_cpu_offset(cpu); #endif - per_cpu(kernel_stack, cpu) = - (unsigned long)task_stack_page(idle) + THREAD_SIZE; } /* -- 2.16.2