Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp365460imu; Thu, 8 Nov 2018 03:18:38 -0800 (PST) X-Google-Smtp-Source: AJdET5ep/+S6LcNdG/PjCPLPJI6LzVSoR3xTZ323pxHIw4oX3Bwqxen7ABrYB8niducjEQiFJQNI X-Received: by 2002:a17:902:9698:: with SMTP id n24-v6mr4237589plp.9.1541675918786; Thu, 08 Nov 2018 03:18:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541675918; cv=none; d=google.com; s=arc-20160816; b=u3mczsQuWUdKIZ8dZwS6/bEG4lZ6Wtqizj0oCGyyp1opJ/lf/pYWf76CW7O3Hr9nKF 81wiA+YbfaUuYxqWmdjHdh9tWNTDXNZqDtqVS1mOO+YjA1aBU7Lr2OXmBtQrpwBxtjko +BKOEt9KzXAvDKfQtdQ2lLxC1A58ClN5ytrrVnKXirMhwVdVyYzB8Y7M5eRnTKpLsHYs QlnnzNgy3LB9q5TjW2fIBuF/tnzYsEZsQ8RSWo8TKy252tmXQvzUHcsRWfgLOioQpnBP xzy+gPEGf7ngxQAF0wg8yLlbjDkoSPjdhxW0azY6QCUMEgaHvokoQ6acxdLGIHza8kdG T6vA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:date:cc:to:subject:from:references :in-reply-to:message-id; bh=1MaYx6cHigeGDjvQlNp+JwJcK+eqNd9q7xa1irRLAxs=; b=V5PcyHJ0jfPT+u9BYBzWhSRb39BJR+xGW3hZt5Bp8h+1g7MJdEzFe4zRiTOZxgN0hT UMhwmGpZDP8noUbdngAI0R/TZ6xAGmcJI6bDaikf5bJqJRMGG7J1KK2iP4s3552LxM51 4mCcW3oBo4ZHus7uuCQ68zAc2Ig7HYaIqzUq10Z+A096eLY2c1msEWmKSOGDj4nf0yJe /GSKOiaoB5twiUdMDthaM8MZgK3EwUI7VeiP2w8mQlvnTSmUhRaf7Tny7NOvnhpas8HR uJwut0wHN4oOQF7WZcQE4WLCADZJXXoxFwWg4rf+MufueW+cyFPrLIuwdBbd/1TaCnSM 9bSw== 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 11-v6si4001384pfx.102.2018.11.08.03.18.07; Thu, 08 Nov 2018 03:18:38 -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; 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 S1727483AbeKHUwL (ORCPT + 99 others); Thu, 8 Nov 2018 15:52:11 -0500 Received: from pegase1.c-s.fr ([93.17.236.30]:17948 "EHLO pegase1.c-s.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727438AbeKHUwK (ORCPT ); Thu, 8 Nov 2018 15:52:10 -0500 Received: from localhost (mailhub1-int [192.168.12.234]) by localhost (Postfix) with ESMTP id 42rLN20kf4z9ty72; Thu, 8 Nov 2018 12:17:06 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at c-s.fr Received: from pegase1.c-s.fr ([192.168.12.234]) by localhost (pegase1.c-s.fr [192.168.12.234]) (amavisd-new, port 10024) with ESMTP id 4-OIWdr9MNTK; Thu, 8 Nov 2018 12:17:06 +0100 (CET) Received: from messagerie.si.c-s.fr (messagerie.si.c-s.fr [192.168.25.192]) by pegase1.c-s.fr (Postfix) with ESMTP id 42rLN20Gw0z9ty6t; Thu, 8 Nov 2018 12:17:06 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by messagerie.si.c-s.fr (Postfix) with ESMTP id A34628B832; Thu, 8 Nov 2018 12:17:09 +0100 (CET) X-Virus-Scanned: amavisd-new at c-s.fr Received: from messagerie.si.c-s.fr ([127.0.0.1]) by localhost (messagerie.si.c-s.fr [127.0.0.1]) (amavisd-new, port 10023) with ESMTP id yBwLze07jwLH; Thu, 8 Nov 2018 12:17:09 +0100 (CET) Received: from po14163vm.idsi0.si.c-s.fr (unknown [192.168.232.3]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 585D98B844; Thu, 8 Nov 2018 12:17:09 +0100 (CET) Received: by po14163vm.idsi0.si.c-s.fr (Postfix, from userid 0) id 00E016997B; Thu, 8 Nov 2018 11:17:08 +0000 (UTC) Message-Id: <8cf14ec1fbdbc50e729ae5a8cc1e62c6033882d7.1541675278.git.christophe.leroy@c-s.fr> In-Reply-To: References: From: Christophe Leroy Subject: [PATCH v9 6/9] powerpc: 'current_set' is now a table of task_struct pointers To: Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman Cc: linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org Date: Thu, 8 Nov 2018 11:17:08 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The table of pointers 'current_set' has been used for retrieving the stack and current. They used to be thread_info pointers as they were pointing to the stack and current was taken from the 'task' field of the thread_info. Now, the pointers of 'current_set' table are now both pointers to task_struct and pointers to thread_info. As they are used to get current, and the stack pointer is retrieved from current's stack field, this patch changes their type to task_struct, and renames secondary_ti to secondary_current. Reviewed-by: Nicholas Piggin Signed-off-by: Christophe Leroy --- arch/powerpc/include/asm/asm-prototypes.h | 4 ++-- arch/powerpc/kernel/head_32.S | 6 +++--- arch/powerpc/kernel/head_44x.S | 4 ++-- arch/powerpc/kernel/head_fsl_booke.S | 4 ++-- arch/powerpc/kernel/smp.c | 10 ++++------ 5 files changed, 13 insertions(+), 15 deletions(-) diff --git a/arch/powerpc/include/asm/asm-prototypes.h b/arch/powerpc/include/asm/asm-prototypes.h index ec691d489656..b1b999b22a12 100644 --- a/arch/powerpc/include/asm/asm-prototypes.h +++ b/arch/powerpc/include/asm/asm-prototypes.h @@ -23,8 +23,8 @@ #include /* SMP */ -extern struct thread_info *current_set[NR_CPUS]; -extern struct thread_info *secondary_ti; +extern struct task_struct *current_set[NR_CPUS]; +extern struct task_struct *secondary_current; void start_secondary(void *unused); /* kexec */ diff --git a/arch/powerpc/kernel/head_32.S b/arch/powerpc/kernel/head_32.S index 44dfd73b2a62..ba0341bd5a00 100644 --- a/arch/powerpc/kernel/head_32.S +++ b/arch/powerpc/kernel/head_32.S @@ -842,9 +842,9 @@ __secondary_start: #endif /* CONFIG_6xx */ /* get current's stack and current */ - lis r1,secondary_ti@ha - tophys(r1,r1) - lwz r2,secondary_ti@l(r1) + lis r2,secondary_current@ha + tophys(r2,r2) + lwz r2,secondary_current@l(r2) tophys(r1,r2) lwz r1,TASK_STACK(r1) diff --git a/arch/powerpc/kernel/head_44x.S b/arch/powerpc/kernel/head_44x.S index 2c7e90f36358..48e4de4dfd0c 100644 --- a/arch/powerpc/kernel/head_44x.S +++ b/arch/powerpc/kernel/head_44x.S @@ -1021,8 +1021,8 @@ _GLOBAL(start_secondary_47x) /* Now we can get our task struct and real stack pointer */ /* Get current's stack and current */ - lis r1,secondary_ti@ha - lwz r2,secondary_ti@l(r1) + lis r2,secondary_current@ha + lwz r2,secondary_current@l(r2) lwz r1,TASK_STACK(r2) /* Current stack pointer */ diff --git a/arch/powerpc/kernel/head_fsl_booke.S b/arch/powerpc/kernel/head_fsl_booke.S index b8a2b789677e..0d27bfff52dd 100644 --- a/arch/powerpc/kernel/head_fsl_booke.S +++ b/arch/powerpc/kernel/head_fsl_booke.S @@ -1076,8 +1076,8 @@ __secondary_start: bl call_setup_cpu /* get current's stack and current */ - lis r1,secondary_ti@ha - lwz r2,secondary_ti@l(r1) + lis r2,secondary_current@ha + lwz r2,secondary_current@l(r2) lwz r1,TASK_STACK(r2) /* stack */ diff --git a/arch/powerpc/kernel/smp.c b/arch/powerpc/kernel/smp.c index aa4517686f90..a41fa8924004 100644 --- a/arch/powerpc/kernel/smp.c +++ b/arch/powerpc/kernel/smp.c @@ -76,7 +76,7 @@ static DEFINE_PER_CPU(int, cpu_state) = { 0 }; #endif -struct thread_info *secondary_ti; +struct task_struct *secondary_current; bool has_big_cores; DEFINE_PER_CPU(cpumask_var_t, cpu_sibling_map); @@ -664,7 +664,7 @@ void smp_send_stop(void) } #endif /* CONFIG_NMI_IPI */ -struct thread_info *current_set[NR_CPUS]; +struct task_struct *current_set[NR_CPUS]; static void smp_store_cpu_info(int id) { @@ -929,7 +929,7 @@ void smp_prepare_boot_cpu(void) paca_ptrs[boot_cpuid]->__current = current; #endif set_numa_node(numa_cpu_lookup_table[boot_cpuid]); - current_set[boot_cpuid] = task_thread_info(current); + current_set[boot_cpuid] = current; } #ifdef CONFIG_HOTPLUG_CPU @@ -1014,15 +1014,13 @@ static bool secondaries_inhibited(void) static void cpu_idle_thread_init(unsigned int cpu, struct task_struct *idle) { - struct thread_info *ti = task_thread_info(idle); - #ifdef CONFIG_PPC64 paca_ptrs[cpu]->__current = idle; paca_ptrs[cpu]->kstack = (unsigned long)task_stack_page(idle) + THREAD_SIZE - STACK_FRAME_OVERHEAD; #endif idle->cpu = cpu; - secondary_ti = current_set[cpu] = ti; + secondary_current = current_set[cpu] = idle; } int __cpu_up(unsigned int cpu, struct task_struct *tidle) -- 2.13.3